fix libgnunetutil check

This commit is contained in:
Christian Grothoff 2016-07-13 11:11:34 +02:00
parent b2015c388c
commit b700ddb437

View File

@ -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])], []) AC_CHECK_HEADER(gcrypt.h, [], [AC_MSG_ERROR([unable to find the gcrypt.h header file from libgcrypt])], [])
SAVE_LIBS=$LIBS SAVE_LIBS=$LIBS
gnunetutil=0
AC_MSG_CHECKING(for libgnunetutil) AC_MSG_CHECKING([for libgnunetutil])
AC_ARG_WITH(gnunetutil, AC_ARG_WITH(gnunet,
[ --with-gnunetutil=PFX base of libgnunetutil installation], [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])],
[AC_MSG_RESULT([$with_gnunetutil]) [AC_MSG_RESULT([given as $with_gnunet])],
case $with_gnunetutil in [AC_MSG_RESULT(not given)
no) with_gnunet=yes])
;; AS_CASE([$with_gnunet],
yes) [yes], [],
AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h, [no], [AC_MSG_ERROR([--with-gnunet is required])],
AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog], [LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
gnunetutil=1)) 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)],
LDFLAGS="-L$with_gnunetutil/lib $LDFLAGS" [], [#ifdef HAVE_GNUNET_PLATFORM_H
CPPFLAGS="-I$with_gnunetutil/include $CPPFLAGS" #include <gnunet/platform.h>
AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h, #endif])
AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog], AS_IF([test $libgnunetutil != 1],
EXT_LIB_PATH="-L$with_gnunetutil/lib $EXT_LIB_PATH" [AC_MSG_ERROR([[
gnunetutil=1)) ***
;; *** You need libgnunetutil to build this program.
esac *** This library is part of GNUnet, available at
], *** https://gnunet.org
[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
# restore LIBS # restore LIBS
LIBS=$SAVE_LIBS LIBS=$SAVE_LIBS