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 + #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