[pgpool-hackers: 175] Re: Possible issue with configure.in (?)
Waitman Gobble
uzimac at da3m0n8t3r.com
Sun Mar 17 04:11:08 JST 2013
Waitman Gobble <uzimac at da3m0n8t3r.com> wrote ..
>
> Hi,
>
> On my machine it seems that when the --with-memcached configuration option is set,
> the value of LIBS is overwritten and lost, which then causes an error about -lpq
> 'missing or old'
>
> > uname -a
> FreeBSD dx.burplex.com 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r248165: Mon Mar 11
> 18:20:30 PDT 2013 root at dx.burplex.com:/usr/obj/usr/src/sys/FURAHA amd64
>
>
>
> Example:
>
> ./configure --with-memcached=/usr/local
> ..
> checking for libmemcached/memcached.h... yes
> checking for memcached_create in -lmemcached... yes
> checking for PQexecPrepared in -lpq... no
> configure: error: libpq is not installed or libpq is old
>
> When I added OLD_LIBS=$LIBS before the memcached check, then restored the value
> with LIBS=$OLD_LIBS afterward, it seems to solve the problem.
>
> ie,
> [1318] > diff -u configure.in /tmp/configure.in
> --- configure.in 2013-02-17 17:50:16.000000000 -0800
> +++ /tmp/configure.in 2013-03-16 11:05:22.000000000 -0700
> @@ -321,6 +321,7 @@
> MEMCACHED_INCLUDE_DIR="$withval"/include
> MEMCACHED_LIB_DIR="$withval"/lib
> OLD_CFLAGS="$CFLAGS"
> + OLD_LIBS="$LIBS"
> CFLAGS="$CFLAGS -I$MEMCACHED_INCLUDE_DIR"
> AC_CHECK_HEADERS(
> [libmemcached/memcached.h],
> @@ -338,6 +339,7 @@
> AC_SUBST(MEMCACHED_INCLUDE_OPT)
> AC_SUBST(MEMCACHED_LINK_OPT)
> AC_SUBST(MEMCACHED_RPATH_OPT)
> +LIBS="$OLD_LIBS"
>
> OLD_LDFLAGS="$LDFLAGS"
> LDFLAGS="-L$PGSQL_LIB_DIR"
>
>
>
> After running autoconf to regenerate configure,
> ./configure --with-memcached=/usr/local
> ..
> checking for libmemcached/memcached.h... yes
> checking for memcached_create in -lmemcached... yes
> checking for PQexecPrepared in -lpq... yes
> checking for PQprepare... yes
> ..
>
> It seems to work.
>
> Thank you,
>
OOPS. that's not 100% correct, still needs some work. updating configure.in does let configuration finish without error, but it leaves -lmemcached out of Makefile.in
To get `gmake` to build without linker errors I had to add in -lmemcached, ie:
Makefile.in:
..
# suggested by libtoolize
ACLOCAL_AMFLAGS = -I m4
pgpool_LDADD = -L at PGSQL_LIB_DIR@ -lmemcached -lpq parser/libsql-parser.a pcp/libpcp.la parser/nodes.o watchdog/lib-watchdog.a -lpthread
obviously this isn't the correct solution. :-)
Thank you,
--
Waitman Gobble
San Jose California USA
More information about the pgpool-hackers
mailing list