aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-13 11:11:34 +0200
committerChristian Grothoff <christian@grothoff.org>2016-07-13 11:11:34 +0200
commitb700ddb4372e3de25ffe5748f1f58cbbbddfc16e (patch)
tree840f7fd91b6cdfa22226b3553cc6ea29b7f8b5a1 /configure.ac
parentb2015c388cb42d9976a2aa6710667c168e61bd3a (diff)
fix libgnunetutil check
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac58
1 files changed, 25 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac
index fff6d4b..c14db9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,39 +29,31 @@ AC_SEARCH_LIBS([gcry_check_version], [gcrypt], [], [AC_MSG_ERROR([unable to find
AC_CHECK_HEADER(gcrypt.h, [], [AC_MSG_ERROR([unable to find the gcrypt.h header file from libgcrypt])], [])
SAVE_LIBS=$LIBS
-gnunetutil=0
-AC_MSG_CHECKING(for libgnunetutil)
-AC_ARG_WITH(gnunetutil,
- [ --with-gnunetutil=PFX base of libgnunetutil installation],
- [AC_MSG_RESULT([$with_gnunetutil])
- case $with_gnunetutil in
- no)
- ;;
- yes)
- AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h,
- AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog],
- gnunetutil=1))
- ;;
- *)
- LDFLAGS="-L$with_gnunetutil/lib $LDFLAGS"
- CPPFLAGS="-I$with_gnunetutil/include $CPPFLAGS"
- AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h,
- AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog],
- EXT_LIB_PATH="-L$with_gnunetutil/lib $EXT_LIB_PATH"
- gnunetutil=1))
- ;;
- esac
- ],
- [AC_MSG_RESULT([--with-gnunetutil not specified])
- AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h,
- AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog],
- gnunetutil=1))])
-if test x$gnunetutil = x1
-then
- AC_MSG_RESULT([libgnunetutil found])
-else
- AC_MSG_ERROR([libbrandt requires libgnunetutil])
-fi
+
+AC_MSG_CHECKING([for libgnunetutil])
+AC_ARG_WITH(gnunet,
+ [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])],
+ [AC_MSG_RESULT([given as $with_gnunet])],
+ [AC_MSG_RESULT(not given)
+ with_gnunet=yes])
+AS_CASE([$with_gnunet],
+ [yes], [],
+ [no], [AC_MSG_ERROR([--with-gnunet is required])],
+ [LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
+ CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
+AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
+ [AC_CHECK_LIB([gnunetutil], [GNUNET_SCHEDULER_run], libgnunetutil=1)],
+ [], [#ifdef HAVE_GNUNET_PLATFORM_H
+ #include <gnunet/platform.h>
+ #endif])
+AS_IF([test $libgnunetutil != 1],
+ [AC_MSG_ERROR([[
+***
+*** You need libgnunetutil to build this program.
+*** This library is part of GNUnet, available at
+*** https://gnunet.org
+*** ]])])
+
# restore LIBS
LIBS=$SAVE_LIBS