AC_SUBST(POSTGRES_CPPFLAGS)
AC_SUBST(POSTGRES_LDFLAGS)
-# test for libz (maybe required for linking mysql)
-zlib=1
-AC_CHECK_LIB(z, compress,,zlib=0)
-AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
-if test "$zlib" != 1
-then
- AC_MSG_ERROR([GNUnet requires zlib])
-fi
+# test for zlib
+SAVE_LDFLAGS=$LDFLAGS
+SAVE_CPPFLAGS=$CPPFLAGS
+AC_ARG_WITH(zlib,
+ [ --with-zlib[[=DIR]] use libz in DIR],
+ [AS_IF([test "$withval" = "no"],
+ [AC_MSG_ERROR([GNUnet requires zlib])],
+ [test "$withval" != "yes"],
+ [
+ Z_DIR=$withval
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ ])
+ ])
+AC_CHECK_HEADER(zlib.h,
+ [],
+ [AC_MSG_ERROR([GNUnet requires zlib])])
+AC_CHECK_LIB(z, compress2,
+ [
+ AC_DEFINE([HAVE_ZLIB], [], [Have compression library])
+ if test "x${Z_DIR}" != "x"; then
+ Z_CFLAGS="-I${Z_DIR}/include"
+ Z_LIBS="-L${Z_DIR}/lib -lz"
+ else
+ Z_LIBS="-lz"
+ fi],
+ [AC_MSG_ERROR([GNUnet requires zlib])])
+AC_SUBST(Z_CFLAGS)
+AC_SUBST(Z_LIBS)
+
+LDFLAGS=$SAVE_LDFLAGS
+CPPFLAGS=$SAVE_CPPFLAGS
# mysql & windows
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
libgnunet_plugin_datastore_mysql_la_LIBADD = \
$(top_builddir)/src/mysql/libgnunetmysql.la \
$(top_builddir)/src/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lz -lmysqlclient
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) $(Z_LIBS) -lmysqlclient
libgnunet_plugin_datastore_mysql_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS) $(MYSQL_LDFLAGS) -lmysqlclient
libgnunet_plugin_datastore_mysql_la_CPPFLAGS = \
$(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/testbed/libgnunettestbed.la \
$(top_builddir)/src/arm/libgnunetarm.la \
- $(LTLIBINTL) -lz
+ $(LTLIBINTL) $(Z_LIBS)
gnunet_service_testbed_DEPENDENCIES = \
libgnunettestbed.la
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/testing/libgnunettesting.la \
libgnunettestbed.la \
- $(LTLIBINTL) -lz
+ $(LTLIBINTL) $(Z_LIBS)
gnunet_helper_testbed_DEPENDENCIES = \
gnunet-service-testbed.$(OBJEXT) \
libgnunettestbed.la
test_gnunet_helper_testbed_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
libgnunettestbed.la \
- -lz
+ $(Z_LIBZ)
test_testbed_api_testbed_run_topologyrandom_SOURCES = \
test_testbed_api_testbed_run.c