diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2013-06-09 04:46:52 +0000 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2013-06-09 04:46:52 +0000 |
commit | 62e9ff1328fdffd4e0e40b1c039668f79aece64f (patch) | |
tree | c57118aa2aa7197364bc995a5ed78a95e13a7dda /configure.ac | |
parent | a8935d6b9cd972429dc7b84b4d2f3b40896688de (diff) | |
download | gnunet-62e9ff1328fdffd4e0e40b1c039668f79aece64f.tar.gz gnunet-62e9ff1328fdffd4e0e40b1c039668f79aece64f.zip |
Add --with-zlib=[DIR] configure option.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 178fdf94a..52bc8967d 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -568,14 +568,38 @@ AM_CONDITIONAL(HAVE_POSTGRES, test x$postgres = xtrue) | |||
568 | AC_SUBST(POSTGRES_CPPFLAGS) | 568 | AC_SUBST(POSTGRES_CPPFLAGS) |
569 | AC_SUBST(POSTGRES_LDFLAGS) | 569 | AC_SUBST(POSTGRES_LDFLAGS) |
570 | 570 | ||
571 | # test for libz (maybe required for linking mysql) | 571 | # test for zlib |
572 | zlib=1 | 572 | SAVE_LDFLAGS=$LDFLAGS |
573 | AC_CHECK_LIB(z, compress,,zlib=0) | 573 | SAVE_CPPFLAGS=$CPPFLAGS |
574 | AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1) | 574 | AC_ARG_WITH(zlib, |
575 | if test "$zlib" != 1 | 575 | [ --with-zlib[[=DIR]] use libz in DIR], |
576 | then | 576 | [AS_IF([test "$withval" = "no"], |
577 | AC_MSG_ERROR([GNUnet requires zlib]) | 577 | [AC_MSG_ERROR([GNUnet requires zlib])], |
578 | fi | 578 | [test "$withval" != "yes"], |
579 | [ | ||
580 | Z_DIR=$withval | ||
581 | CPPFLAGS="${CPPFLAGS} -I$withval/include" | ||
582 | LDFLAGS="${LDFLAGS} -L$withval/lib" | ||
583 | ]) | ||
584 | ]) | ||
585 | AC_CHECK_HEADER(zlib.h, | ||
586 | [], | ||
587 | [AC_MSG_ERROR([GNUnet requires zlib])]) | ||
588 | AC_CHECK_LIB(z, compress2, | ||
589 | [ | ||
590 | AC_DEFINE([HAVE_ZLIB], [], [Have compression library]) | ||
591 | if test "x${Z_DIR}" != "x"; then | ||
592 | Z_CFLAGS="-I${Z_DIR}/include" | ||
593 | Z_LIBS="-L${Z_DIR}/lib -lz" | ||
594 | else | ||
595 | Z_LIBS="-lz" | ||
596 | fi], | ||
597 | [AC_MSG_ERROR([GNUnet requires zlib])]) | ||
598 | AC_SUBST(Z_CFLAGS) | ||
599 | AC_SUBST(Z_LIBS) | ||
600 | |||
601 | LDFLAGS=$SAVE_LDFLAGS | ||
602 | CPPFLAGS=$SAVE_CPPFLAGS | ||
579 | 603 | ||
580 | # mysql & windows | 604 | # mysql & windows |
581 | AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>]) | 605 | AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>]) |