diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-13 11:11:34 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-13 11:11:34 +0200 |
commit | b700ddb4372e3de25ffe5748f1f58cbbbddfc16e (patch) | |
tree | 840f7fd91b6cdfa22226b3553cc6ea29b7f8b5a1 /configure.ac | |
parent | b2015c388cb42d9976a2aa6710667c168e61bd3a (diff) | |
download | libbrandt-b700ddb4372e3de25ffe5748f1f58cbbbddfc16e.tar.gz libbrandt-b700ddb4372e3de25ffe5748f1f58cbbbddfc16e.zip |
fix libgnunetutil check
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 58 |
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 | |||
29 | AC_CHECK_HEADER(gcrypt.h, [], [AC_MSG_ERROR([unable to find the gcrypt.h header file from libgcrypt])], []) | 29 | AC_CHECK_HEADER(gcrypt.h, [], [AC_MSG_ERROR([unable to find the gcrypt.h header file from libgcrypt])], []) |
30 | 30 | ||
31 | SAVE_LIBS=$LIBS | 31 | SAVE_LIBS=$LIBS |
32 | gnunetutil=0 | 32 | |
33 | AC_MSG_CHECKING(for libgnunetutil) | 33 | AC_MSG_CHECKING([for libgnunetutil]) |
34 | AC_ARG_WITH(gnunetutil, | 34 | AC_ARG_WITH(gnunet, |
35 | [ --with-gnunetutil=PFX base of libgnunetutil installation], | 35 | [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])], |
36 | [AC_MSG_RESULT([$with_gnunetutil]) | 36 | [AC_MSG_RESULT([given as $with_gnunet])], |
37 | case $with_gnunetutil in | 37 | [AC_MSG_RESULT(not given) |
38 | no) | 38 | with_gnunet=yes]) |
39 | ;; | 39 | AS_CASE([$with_gnunet], |
40 | yes) | 40 | [yes], [], |
41 | AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h, | 41 | [no], [AC_MSG_ERROR([--with-gnunet is required])], |
42 | AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog], | 42 | [LDFLAGS="-L$with_gnunet/lib $LDFLAGS" |
43 | gnunetutil=1)) | 43 | CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"]) |
44 | ;; | 44 | AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h], |
45 | *) | 45 | [AC_CHECK_LIB([gnunetutil], [GNUNET_SCHEDULER_run], libgnunetutil=1)], |
46 | LDFLAGS="-L$with_gnunetutil/lib $LDFLAGS" | 46 | [], [#ifdef HAVE_GNUNET_PLATFORM_H |
47 | CPPFLAGS="-I$with_gnunetutil/include $CPPFLAGS" | 47 | #include <gnunet/platform.h> |
48 | AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h, | 48 | #endif]) |
49 | AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog], | 49 | AS_IF([test $libgnunetutil != 1], |
50 | EXT_LIB_PATH="-L$with_gnunetutil/lib $EXT_LIB_PATH" | 50 | [AC_MSG_ERROR([[ |
51 | gnunetutil=1)) | 51 | *** |
52 | ;; | 52 | *** You need libgnunetutil to build this program. |
53 | esac | 53 | *** This library is part of GNUnet, available at |
54 | ], | 54 | *** https://gnunet.org |
55 | [AC_MSG_RESULT([--with-gnunetutil not specified]) | 55 | *** ]])]) |
56 | AC_CHECK_HEADERS(gnunet/gnunet_util_lib.h, | 56 | |
57 | AC_CHECK_LIB([gnunetutil], [GNUNET_CRYPTO_ecc_dlog], | ||
58 | gnunetutil=1))]) | ||
59 | if test x$gnunetutil = x1 | ||
60 | then | ||
61 | AC_MSG_RESULT([libgnunetutil found]) | ||
62 | else | ||
63 | AC_MSG_ERROR([libbrandt requires libgnunetutil]) | ||
64 | fi | ||
65 | # restore LIBS | 57 | # restore LIBS |
66 | LIBS=$SAVE_LIBS | 58 | LIBS=$SAVE_LIBS |
67 | 59 | ||