gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated (52a8b8f8 -> b4f7231d)


From: gnunet
Subject: [taler-exchange] branch master updated (52a8b8f8 -> b4f7231d)
Date: Sat, 19 Mar 2022 12:54:04 +0100

This is an automated email from the git hooks/post-receive script.

ttn pushed a change to branch master
in repository exchange.

    from 52a8b8f8 -code cleanup
     new 98c21a51 Add autoconf macro to check for minimum libmicrohttpd version
     new b4f7231d [build int] Use ‘MHD_VERSION_AT_LEAST’

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac | 10 +---------
 m4/mhd.m4    | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 9 deletions(-)
 create mode 100644 m4/mhd.m4

diff --git a/configure.ac b/configure.ac
index 5efd4d66..01f1dc20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,7 +291,6 @@ AC_CHECK_HEADERS([gnunet/gnunet_sq_lib.h],
 
 
 # check for libmicrohttpd
-microhttpd=0
 AC_MSG_CHECKING([for microhttpd])
 AC_ARG_WITH([microhttpd],
             [AS_HELP_STRING([--with-microhttpd=PFX], [base of microhttpd 
installation])],
@@ -303,14 +302,7 @@ AS_CASE([$with_microhttpd],
         [no], [AC_MSG_ERROR([--with-microhttpd is required])],
         [LDFLAGS="-L$with_microhttpd/lib $LDFLAGS"
          CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"])
-AC_CHECK_LIB(microhttpd,MHD_start_daemon,
-  [AC_CHECK_HEADER([microhttpd.h],[microhttpd=1])])
-AC_CHECK_DECL([MHD_DAEMON_INFO_CURRENT_CONNECTIONS],,[microhttpd=0],[[#include 
<microhttpd.h>]])
-AS_IF([test $microhttpd = 0],
-  [AC_MSG_ERROR([[
-***
-*** You need libmicrohttpd >= 0.9.39 to build this program.
-*** ]])])
+MHD_VERSION_AT_LEAST([0.9.39])
 
 # check for libjansson (Jansson JSON library)
 jansson=0
diff --git a/m4/mhd.m4 b/m4/mhd.m4
new file mode 100644
index 00000000..40e5b468
--- /dev/null
+++ b/m4/mhd.m4
@@ -0,0 +1,49 @@
+# mhd.m4
+
+#  This file is part of TALER
+#  Copyright (C) 2022 Taler Systems SA
+#
+#  TALER is free software; you can redistribute it and/or modify it under the
+#  terms of the GNU General Public License as published by the Free Software
+#  Foundation; either version 3, or (at your option) any later version.
+#
+#  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+#  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License along with
+#  TALER; see the file COPYING.  If not, If not, see 
<http://www.gnu.org/license>
+
+# serial 1
+
+dnl MHD_VERSION_AT_LEAST([VERSION])
+dnl
+dnl Check that microhttpd.h can be used to build a program that prints out
+dnl the MHD_VERSION tuple in X.Y.Z format, and that X.Y.Z is greater or equal
+dnl to VERSION.  If not, display message and cause the configure script to
+dnl exit failurefully.
+dnl
+dnl This uses AX_COMPARE_VERSION to do the job.
+dnl It sets shell var mhd_cv_version, as well.
+dnl
+AC_DEFUN([MHD_VERSION_AT_LEAST],
+[AC_CACHE_CHECK([libmicrohttpd version],[mhd_cv_version],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+  #include <stdio.h>
+  #include <microhttpd.h>
+]],[[
+  int v = MHD_VERSION;
+  printf ("%x.%x.%x\n",
+          (v >> 24) & 0xff,
+          (v >> 16) & 0xff,
+          (v >>  8) & 0xff);
+]])],
+  [mhd_cv_version=$(./conftest)],
+  [mhd_cv_version=0])])
+AX_COMPARE_VERSION([$mhd_cv_version],[ge],[$1],,
+  [AC_MSG_ERROR([[
+***
+*** You need libmicrohttpd >= $1 to build this program.
+*** ]])])])
+
+# mhd.m4 ends here

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]