gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 01/04: Autoconf 2.70 compatibility


From: gnunet
Subject: [libmicrohttpd] 01/04: Autoconf 2.70 compatibility
Date: Mon, 18 Jan 2021 21:25:22 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 7329b84ccfcf3552586a269dfd1369613337d1f1
Author: Evgeny Grin <k2k@narod.ru>
AuthorDate: Mon Jan 18 17:18:44 2021 +0300

    Autoconf 2.70 compatibility
---
 configure.ac                      | 19 ++++++++++++---
 m4/ax_pthread.m4                  |  3 ++-
 m4/libgcrypt.m4                   | 50 +++++++++++++++++++++++++++++----------
 m4/mhd_shutdown_socket_trigger.m4 |  4 ++--
 4 files changed, 57 insertions(+), 19 deletions(-)

diff --git a/configure.ac b/configure.ac
index 844ea46b..ce0be355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,20 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AC_CANONICAL_HOST
+m4_version_prereq([2.70],
+  [
+# Find C compiler and compiler options to support
+# the latest C standard (C11). Fallback to C99 and C89
+# if later C versions are not supported.
+AC_PROG_CC
+  ],
+  [
+# Find C compiler and compiler options to support
+# the latest C standard (C99). Fallback to C89
+# if later C versions are not supported.
 AC_PROG_CC_STDC
+  ]
+)
 MHD_SYS_EXT
 LT_INIT([win32-dll])
 LT_LANG([Windows Resource])
@@ -888,14 +901,14 @@ AS_VAR_IF([mhd_cv_macro___func___avail], ["yes"],
 )
 AC_CACHE_CHECK([[whether __builtin_bswap32() is available]],
   [[mhd_cv_func___builtin_bswap32_avail]], [dnl
-  AC_TRY_LINK([#include<stdint.h>],[uint32_t a = 1; uint32_t b = 
__builtin_bswap32(a); a = b;],
-    [[mhd_cv_func___builtin_bswap32_avail="yes"]], 
[[mhd_cv_func___builtin_bswap32_avail="no"]])
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include<stdint.h>]], [[uint32_t a = 1; 
uint32_t b = __builtin_bswap32(a); a = b;]])],
+    
[[mhd_cv_func___builtin_bswap32_avail="yes"]],[[mhd_cv_func___builtin_bswap32_avail="no"]])
 ])
 AS_IF([[test "x$mhd_cv_func___builtin_bswap32_avail" = "xyes"]],
   [AC_DEFINE([[MHD_HAVE___BUILTIN_BSWAP32]], [[1]], [Define to 1 if you have 
__builtin_bswap32() builtin function])])
 AC_CACHE_CHECK([[whether __builtin_bswap64() is available]],
   [[mhd_cv_func___builtin_bswap64_avail]], [dnl
-  AC_TRY_LINK([#include<stdint.h>],[uint64_t a = 1; uint32_t b = 
__builtin_bswap64(a); a = b;],
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include<stdint.h>]], [[uint64_t a = 1; 
uint32_t b = __builtin_bswap64(a); a = b;]])],
     [[mhd_cv_func___builtin_bswap64_avail="yes"]], 
[[mhd_cv_func___builtin_bswap64_avail="no"]])
 ])
 AS_IF([[test "x$mhd_cv_func___builtin_bswap64_avail" = "xyes"]],
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index 1598d077..2ef79838 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -83,6 +83,7 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 
+# locally patched for autoconf 2.70 compatibility
 #serial 27
 
 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
@@ -386,7 +387,7 @@ if test "x$ax_pthread_clang" = "xyes"; then
              # step
              ax_pthread_save_ac_link="$ac_link"
              ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
-             ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
+             ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed 
"$ax_pthread_sed"`
              ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && 
($ax_pthread_link_step)"
              ax_pthread_save_CFLAGS="$CFLAGS"
              for ax_pthread_try in '' -Qunused-arguments 
-Wno-unused-command-line-argument unknown; do
diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4
index dd167f81..19d514fd 100644
--- a/m4/libgcrypt.m4
+++ b/m4/libgcrypt.m4
@@ -1,5 +1,5 @@
 # libgcrypt.m4 - Autoconf macros to detect libgcrypt
-# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020 g10 Code GmbH
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -9,7 +9,7 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# Last-changed: 2014-10-02
+# Last-changed: 2020-09-27
 
 
 dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
@@ -19,7 +19,7 @@ dnl MINIMUM-VERSION is a string with the version number 
optionally prefixed
 dnl with the API version to also check the API compatibility. Example:
 dnl a MINIMUM-VERSION of 1:1.2.5 won't pass the test unless the installed
 dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1.  Using
-dnl this feature prevents building against newer versions of libgcrypt
+dnl this features allows to prevent build against newer versions of libgcrypt
 dnl with a changed API.
 dnl
 dnl If a prefix option is not used, the config script is first
@@ -30,14 +30,26 @@ dnl
 AC_DEFUN([AM_PATH_LIBGCRYPT],
 [ AC_REQUIRE([AC_CANONICAL_HOST])
   AC_ARG_WITH(libgcrypt-prefix,
-            AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
+            AS_HELP_STRING([--with-libgcrypt-prefix=PFX],
                            [prefix where LIBGCRYPT is installed (optional)]),
      libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
   if test x"${LIBGCRYPT_CONFIG}" = x ; then
      if test x"${libgcrypt_config_prefix}" != x ; then
         LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
-     else
-       case "${SYSROOT}" in
+     fi
+  fi
+
+  use_gpgrt_config=""
+  if test x"${LIBGCRYPT_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a 
"$GPGRT_CONFIG" != "no"; then
+    if $GPGRT_CONFIG libgcrypt --exists; then
+      LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt"
+      AC_MSG_NOTICE([Use gpgrt-config as libgcrypt-config])
+      use_gpgrt_config=yes
+    fi
+  fi
+  if test -z "$use_gpgrt_config"; then
+    if test x"${LIBGCRYPT_CONFIG}" = x ; then
+      case "${SYSROOT}" in
          /*)
            if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
              LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
@@ -48,11 +60,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
           *)
            AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
            ;;
-       esac
-     fi
+      esac
+    fi
+    AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
   fi
 
-  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
   tmp=ifelse([$1], ,1:1.2.0,$1)
   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
      req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
@@ -71,7 +83,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
     req_micro=`echo $min_libgcrypt_version | \
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
-    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+    if test -z "$use_gpgrt_config"; then
+      libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+    else
+      libgcrypt_config_version=`$LIBGCRYPT_CONFIG --modversion`
+    fi
     major=`echo $libgcrypt_config_version | \
                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
     minor=`echo $libgcrypt_config_version | \
@@ -103,7 +119,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
      # If we have a recent libgcrypt, we should also check that the
      # API is compatible
      if test "$req_libgcrypt_api" -gt 0 ; then
-        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
+        if test -z "$use_gpgrt_config"; then
+           tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
+       else
+           tmp=`$LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0`
+       fi
         if test "$tmp" -gt 0 ; then
            AC_MSG_CHECKING([LIBGCRYPT API version])
            if test "$req_libgcrypt_api" -eq "$tmp" ; then
@@ -119,12 +139,16 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
     LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
     LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
     ifelse([$2], , :, [$2])
-    libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+    if test -z "$use_gpgrt_config"; then
+      libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+    else
+      libgcrypt_config_host=`$LIBGCRYPT_CONFIG --variable=host 2>/dev/null || 
echo none`
+    fi
     if test x"$libgcrypt_config_host" != xnone ; then
       if test x"$libgcrypt_config_host" != x"$host" ; then
   AC_MSG_WARN([[
 ***
-*** The config script $LIBGCRYPT_CONFIG was
+*** The config script "$LIBGCRYPT_CONFIG" was
 *** built for $libgcrypt_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-libgcrypt-prefix
diff --git a/m4/mhd_shutdown_socket_trigger.m4 
b/m4/mhd_shutdown_socket_trigger.m4
index 12b88b79..1abe3b09 100644
--- a/m4/mhd_shutdown_socket_trigger.m4
+++ b/m4/mhd_shutdown_socket_trigger.m4
@@ -18,7 +18,7 @@
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 2
+#serial 3
 
 AC_DEFUN([MHD_CHECK_SOCKET_SHUTDOWN_TRIGGER],[dnl
   AC_PREREQ([2.64])dnl
@@ -26,7 +26,7 @@ AC_DEFUN([MHD_CHECK_SOCKET_SHUTDOWN_TRIGGER],[dnl
   AC_REQUIRE([AC_PROG_CC])dnl
   AC_REQUIRE([AX_PTHREAD])dnl
   AC_CHECK_HEADERS([sys/time.h],[AC_CHECK_FUNCS([gettimeofday])],[], 
[AC_INCLUDES_DEFAULT])
-  AC_CHECK_HEADERS([time.h],[AC_CHECK_FUNCS([[nanosleep]])],[], 
[AC_INCLUDES_DEFAULT])
+  AC_CHECK_HEADERS([time.h],[AC_CHECK_FUNCS([nanosleep])],[], 
[AC_INCLUDES_DEFAULT])
   AC_CHECK_HEADERS([unistd.h],[AC_CHECK_FUNCS([usleep])],[], 
[AC_INCLUDES_DEFAULT])
   AC_CHECK_HEADERS([string.h sys/types.h sys/socket.h netinet/in.h time.h 
sys/select.h netinet/tcp.h],[],[], [AC_INCLUDES_DEFAULT])
   AC_CACHE_CHECK([[whether shutdown of listen socket trigger select()]],

-- 
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]