From: Adam Dickmeiss Date: Fri, 7 Feb 2014 14:10:42 +0000 (+0100) Subject: yaz-config --libs: omit grypt+memcached libs X-Git-Tag: v5.0.13~7 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=f33b7979ed1553753c5c54819ea2b4038c783d43;p=yaz-moved-to-github.git yaz-config --libs: omit grypt+memcached libs These are not necessary because 3rd party tools do not need access to gcrypt/memcached funtions directly. --- diff --git a/configure.ac b/configure.ac index 6bc1b10..b9a0398 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,7 @@ if test "$checkBoth" = "1"; then fi AC_CHECK_FUNC([gethostbyname], ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])]) dnl ------ libgcrypt +AC_SUBST([GCRYPT_LIBS]) libgcryptpath=NONE AC_ARG_WITH(libgcrypt, [ --with-libgcrypt=DIR use libgcrypt-config in DIR],[libgcryptpath=$withval]) if test "$libgcryptpath" != "no"; then @@ -76,7 +77,7 @@ if test "$libgcryptpath" != "no"; then libgcryptversion2=`echo "$libgcryptversion" | awk 'BEGIN { FS = "."; } { printf "%d", [$]1 * 1000 + [$]2;}'` AC_MSG_RESULT([$libgcryptversion]) if test $libgcryptversion2 -ge 1002; then - LIBS="$LIBS `$libgcrypt --libs`" + GCRYPT_LIBS="`$libgcrypt --libs`" CFLAGS="$CFLAGS `$libgcrypt --cflags`" AC_DEFINE([HAVE_GCRYPT_H],[1],[Define to 1 if libgcrypt is present]) else @@ -93,13 +94,15 @@ if test "$libgcryptpath" != "no"; then fi dnl ------ memcached memcached=default +AC_SUBST([MEMCACHED_LIBS]) AC_ARG_WITH([memcached], [ --with-memcached Memcached library], [memcached=$withval]) if test "$memcached" != "no" -a -n "$libgcryptversion"; then - AC_CHECK_LIB([memcached],[memcached_get]) + AC_CHECK_LIB([memcached],[memcached_get], [MEMCACHED_LIBS="-lmemcached"]) if test "$ac_cv_lib_memcached_memcached_get" = "yes"; then AC_CHECK_HEADERS([libmemcached/memcached.h]) if test "$ac_cv_header_libmemcached_memcached_h" = "yes"; then - AC_CHECK_FUNCS([memcached]) + AC_CHECK_LIB([memcached],[memcached], [ + AC_DEFINE([HAVE_MEMCACHED_FUNC],[1],[Define to 1 if memcached function is defined])]) AC_TRY_COMPILE( [ #include diff --git a/src/Makefile.am b/src/Makefile.am index cdccb09..6037383 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ YAZCOMP_Z = $(YAZCOMP) -d $(srcdir)/z.tcl -i yaz -I$(top_srcdir)/include YAZCOMP_I = $(YAZCOMP) -d $(srcdir)/ill.tcl -i yaz -I$(top_srcdir)/include AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS) -libyaz_la_LIBADD = $(SSL_LIBS) $(TCPD_LIBS) +libyaz_la_LIBADD = $(SSL_LIBS) $(TCPD_LIBS) $(GCRYPT_LIBS) $(MEMCACHED_LIBS) libyaz_server_la_LIBADD = libyaz.la libyaz_icu_la_CPPFLAGS = $(AM_CPPFLAGS) $(ICU_CPPFLAGS) -I$(top_srcdir)/libstemmer_c/include libyaz_icu_la_LIBADD = libyaz.la $(ICU_LIBS) diff --git a/src/zoom-memcached.c b/src/zoom-memcached.c index e1ebdc5..cbf4a9a 100644 --- a/src/zoom-memcached.c +++ b/src/zoom-memcached.c @@ -46,7 +46,7 @@ void ZOOM_memcached_destroy(ZOOM_connection c) /* memcached wrapper.. Because memcached function do not exist in older libs */ static memcached_st *yaz_memcached_wrap(const char *conf) { -#if HAVE_MEMCACHED +#if HAVE_MEMCACHED_FUNC return memcached(conf, strlen(conf)); #else char **darray; diff --git a/yaz-config.in b/yaz-config.in index fe26a60..27fb8bd 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -19,6 +19,8 @@ build_root="@abs_top_builddir@" ICU_LIBS="@ICU_LIBS@" ICU_CPPFLAGS="@ICU_CPPFLAGS@" SSL_LIBS="@SSL_LIBS@" +GCRYPT_LIBS="@GCRYPT_LIBS@" +MEMCACHED_LIBS="@MEMCACHED_LIBS@" LIBS="@LIBS@" VERSION=@VERSION@ YAZVERSION=$VERSION @@ -130,7 +132,7 @@ if test "$echo_source" = "yes"; then else YAZLIB="-L${build_root}/src/.libs $YAZLIB" fi - LIBS="${SSL_LIBS} $LIBS" + LIBS="${SSL_LIBS} ${GCRYPT_LIBS} ${MEMCACHED_LIBS} $LIBS" YAZLIB="$YAZLIB $LIBS" YAZLALIB="${build_root}/src/libyaz.la"