]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure: make AC_TRY_* into AC_*_IFELSE
authorDaniel Stenberg <daniel@haxx.se>
Mon, 15 Mar 2021 22:11:29 +0000 (23:11 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 16 Mar 2021 22:02:02 +0000 (23:02 +0100)
... as the former versions are deprecated.

configure.ac

index f190926c1938064e624adebc03d514cd9eac7919..ed2f47afb4d95645dba59e810d11e8cc4758a1de 100755 (executable)
@@ -1321,7 +1321,8 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
        ;;
   esac ],
 
-  AC_TRY_RUN([ /* are AF_INET6 and sockaddr_in6 available? */
+  AC_RUN_IFELSE([AC_LANG_SOURCE([[
+/* are AF_INET6 and sockaddr_in6 available? */
 #include <sys/types.h>
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
@@ -1343,6 +1344,7 @@ main()
  else
    exit(0);
 }
+]])
 ],
   AC_MSG_RESULT(yes)
   ipv6=yes,
@@ -1359,7 +1361,7 @@ if test "$ipv6" = yes; then
   AC_SUBST(IPV6_ENABLED)
 
   AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
-  AC_TRY_COMPILE([
+  AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
@@ -1369,14 +1371,16 @@ if test "$ipv6" = yes; then
 #if defined (__TANDEM)
 # include <netinet/in6.h>
 #endif
-#endif] ,
-  struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
-  if test "$have_sin6_scope_id" = yes; then
-    AC_MSG_RESULT([yes])
-    AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
-  else
+#endif
+]], [[
+  struct sockaddr_in6 s;
+  s.sin6_scope_id = 0;
+]])], [
+  AC_MSG_RESULT([yes])
+  AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
+ ], [
     AC_MSG_RESULT([no])
-  fi
+ ])
 fi
 
 dnl **********************************************************************
@@ -1751,15 +1755,19 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
       AC_MSG_CHECKING([for gdi32])
       my_ac_save_LIBS=$LIBS
       LIBS="-lgdi32 $LIBS"
-      AC_TRY_LINK([#include <windef.h>
-                   #include <wingdi.h>],
-                   [GdiFlush();],
-                   [ dnl worked!
-                   AC_MSG_RESULT([yes])],
-                   [ dnl failed, restore LIBS
-                   LIBS=$my_ac_save_LIBS
-                   AC_MSG_RESULT(no)]
-                  )
+      AC_LINK_IFELSE([ AC_LANG_PROGRAM([[
+        #include <windef.h>
+        #include <wingdi.h>
+        ]],
+        [[
+          GdiFlush();
+        ]])],
+        [ dnl worked!
+        AC_MSG_RESULT([yes])],
+        [ dnl failed, restore LIBS
+        LIBS=$my_ac_save_LIBS
+        AC_MSG_RESULT(no)]
+        )
       ;;
   esac
 
@@ -1857,13 +1865,11 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
        dnl still no, but what about with -ldl?
        AC_MSG_CHECKING([OpenSSL linking with -ldl])
        LIBS="$CLEANLIBS -lcrypto -ldl"
-       AC_TRY_LINK(
-       [
+       AC_LINK_IFELSE([ AC_LANG_PROGRAM([[
          #include <openssl/err.h>
-       ],
-       [
+       ]], [[
          ERR_clear_error();
-       ],
+       ]]) ],
        [
          AC_MSG_RESULT(yes)
          HAVECRYPTO="yes"
@@ -1875,13 +1881,12 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
 
          AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
          LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
-         AC_TRY_LINK(
-         [
+         AC_LINK_IFELSE([
+           AC_LANG_PROGRAM([[
            #include <openssl/err.h>
-         ],
-         [
+         ]], [[
            ERR_clear_error();
-         ],
+         ]])],
          [
            AC_MSG_RESULT(yes)
            HAVECRYPTO="yes"