AC_CONFIG_HEADERS(include/config.h)
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([config])
-AM_INIT_AUTOMAKE([1.11.1 subdir-objects])
+AM_INIT_AUTOMAKE([1.9 subdir-objects])
dnl
AC_SUBST([READLINE_LIBS])
AC_SUBST([YAZ_CONF_CFLAGS])
AC_PROG_CC
AC_PROG_CPP
AC_CHECK_PROGS([YACC], 'bison -y')
-test -z "$YACC" && AC_MSG_WARN([GNU bison not found])
+test -z "$YACC" -a ! -f src/cql.c && AC_MSG_ERROR([GNU Bison not found])
+test -z "$YACC" && AC_MSG_WARN([GNU Bison not found])
AC_CHECK_PROGS([TCLSH], [tclsh tclsh8.5 tclsh8.4 tclsh8.3 tclsh8.2], [tclsh])
AC_PROG_INSTALL
AM_PROG_LIBTOOL
+AM_PROG_CC_C_O
AC_PATH_PROG([pkgconfigpath],[pkg-config],[NONE])
dnl
YAZ_DOC
dnl
dnl
-AC_CHECK_HEADERS([dirent.h fnmatch.h wchar.h locale.h langinfo.h pwd.h unistd.h sys/select.h sys/socket.h sys/stat.h sys/time.h sys/times.h sys/types.h sys/un.h sys/wait.h sys/prctl.h netdb.h arpa/inet.h netinet/tcp.h netinet/in_systm.h],[],[],[])
+AC_CHECK_HEADERS([dirent.h fnmatch.h wchar.h locale.h langinfo.h pwd.h unistd.h sys/select.h sys/socket.h sys/stat.h sys/time.h sys/times.h sys/types.h sys/un.h sys/wait.h sys/prctl.h netdb.h arpa/inet.h netinet/tcp.h netinet/in_systm.h execinfo.h],[],[],[])
AC_CHECK_HEADERS([net/if.h netinet/in.h netinet/if_ether.h],[],[],[
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
AC_CHECK_FUNC([accept], , [LIBS=$oldLibs])
fi
AC_CHECK_FUNC([gethostbyname], ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])])
+dnl
+dnl ------ nettle
+nettle=default
+AC_SUBST([NETTLE_LIBS])
+AC_ARG_WITH([nettle], [ --with-nettle Nettle library], [nettle=$withval])
+if test "$nettle" != "no"; then
+ AC_MSG_CHECKING([for nettle])
+ if $pkgconfigpath --cflags nettle >/dev/null 2>&1 ; then
+ if $pkgconfigpath --atleast-version 2.0 nettle; then
+ AC_MSG_RESULT([yes])
+ CFLAGS="$CFLAGS `$pkgconfigpath --cflags nettle`"
+ NETTLE_LIBS="`$pkgconfigpath --libs nettle`"
+ libgcryptversion=2enable
+ AC_DEFINE([HAVE_NETTLE],[1],[Define to 1 if nettle is enabled])
+ else
+ AC_MSG_RESULT([no. Version 2.0 required])
+ if test "$nettle" != "default"; then
+ AC_MSG_ERROR([nettle libraries missing])
+ fi
+ fi
+ else
+ AC_MSG_RESULT([no])
+ if test "$nettle" != "default"; then
+ AC_MSG_ERROR([nettle libraries missing])
+ fi
+ fi
+fi
+dnl
+dnl
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
+if test "$libgcryptpath" != "no" -a -z "$libgcryptversion"; then
if test "$libgcryptpath" = "NONE"; then
AC_PATH_PROG([libgcrypt],[libgcrypt-config],[NONE])
elif test -x $libgcryptpath/libgcrypt-config; then
dnl ------ redis
hiredis=default
AC_SUBST([HIREDIS_LIBS])
-AC_ARG_WITH([redis], [ --with-redis hiredis library], [hiredis=$withval])
+AC_ARG_WITH([redis], [ --with-redis hiredis library], [hiredis=$withval])
if test "$hiredis" != "no" -a "$pkgconfigpath" != "NONE" -a "$libgcryptversion"; then
AC_CHECK_LIB([hiredis],[redisCommandArgv],[HIREDIS_LIBS=-lhiredis])
AC_MSG_CHECKING([for redis])
if test "$memcached" != "no" -a -n "$libgcryptversion" -a "$pkgconfigpath" != "NONE"; then
AC_MSG_CHECKING([for libmemcached])
if $pkgconfigpath --cflags libmemcached >/dev/null 2>&1 ; then
- if $pkgconfigpath --atleast-version 1.0 libmemcached; then
+ if $pkgconfigpath --atleast-version 0.40 libmemcached; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS `$pkgconfigpath --cflags libmemcached`"
MEMCACHED_LIBS="`$pkgconfigpath --libs libmemcached`"
- AC_DEFINE([HAVE_LIBMEMCACHED_MEMCACHED_H],[1],[Define to 1 if memcached header])
- AC_DEFINE([HAVE_MEMCACHED_FUNC],[1],[Define to 1 if memcached function is defined])
- AC_DEFINE([HAVE_MEMCACHED_RETURN_T],[1],[Define to 1 if memcached_return_t is defined])
+ AC_DEFINE([HAVE_LIBMEMCACHED],[1],[Define to 1 if memcached is enabled])
else
- AC_MSG_RESULT([no. Version 1.0 required])
+ AC_MSG_RESULT([no. Version 0.40 required])
if test "$memcached" != "default"; then
- AC_MSG_ERROR([libmemcached libraries missing])
+ AC_MSG_ERROR([libmemcached libraries missing])
fi
fi
else
AC_MSG_RESULT([no])
if test "$memcached" != "default"; then
- AC_MSG_ERROR([libmemcached libraries missing])
+ AC_MSG_ERROR([libmemcached libraries missing])
fi
fi
fi
+dnl
+dnl
+dnl
dnl ------ GNU TLS
AC_SUBST([SSL_CFLAGS])
AC_SUBST([SSL_LIBS])