From 2ad9c051bec231d8b1142bc669cfa1bd10895e69 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Wed, 14 Jun 2023 21:19:28 -0400
Subject: [PATCH 4/6] autoupdate broken substitutions

---
 configure.in | 119 ++++++++++++++++++++-------------------------------
 1 file changed, 46 insertions(+), 73 deletions(-)

diff --git a/configure.in b/configure.in
index 19e87c3dce..4255910bfe 100644
--- a/configure.in
+++ b/configure.in
@@ -1407,12 +1407,10 @@ dnl This case is for OS X vs. everything else
 case "${host}" in
   *-*-darwin* )
     AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
-    AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
-],[],
-        [AC_MSG_RESULT([yes])],
-        [AC_MSG_RESULT([no])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CFBase.h>
+]], [[]])],[AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])
         AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required])
-        AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
+        _au_m4_changequote([,])AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
 #include <CoreFoundation/CFBase.h>
         ],[],
         [AC_MSG_RESULT([yes])
@@ -1421,8 +1419,8 @@ case "${host}" in
         CPPFLAGS="-D__CF_USE_FRAMEWORK_INCLUDES__ $CPPFLAGS"],
         [AC_MSG_FAILURE([no.  CoreFoundation not available.])]
         )
-        ]
-    )
+        
+    ])
   ;;
 esac
 
@@ -3420,9 +3418,7 @@ if test "$wxUSE_SHARED" = "yes"; then
         saveLdflags="$LDFLAGS"
         LDFLAGS="$saveLdflags -Wl,-rpath,/"
         AC_MSG_CHECKING([if the linker accepts -rpath])
-        AC_TRY_LINK(
-            [],[],
-            [
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[
                 AC_MSG_RESULT([yes])
                 SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib"
                 WXCONFIG_RPATH="-Wl,-rpath,\$libdir"
@@ -3430,7 +3426,7 @@ if test "$wxUSE_SHARED" = "yes"; then
                 AC_MSG_RESULT([no])
                 AC_MSG_CHECKING([if the linker accepts -R])
                 LDFLAGS="$saveLdflags -Wl,-R,/"
-                AC_TRY_LINK(
+                _au_m4_changequote([,])AC_TRY_LINK(
                     [],[],
                     [
                         AC_MSG_RESULT([yes])
@@ -3911,21 +3907,17 @@ if test "$wx_cv_func_statvfs" = "yes"; then
     dnl pointers is just a warning and not an error in C
     AC_CACHE_CHECK([for statvfs argument type], wx_cv_type_statvfs_t, [
         AC_LANG_PUSH(C++)
-        AC_TRY_COMPILE(
-            [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                 #include <sys/statvfs.h>
-            ],
-            [
+            ]], [[
                 long l;
                 statvfs_t fs;
                 statvfs("/", &fs);
                 l = fs.f_bsize;
                 l += fs.f_blocks;
                 l += fs.f_bavail;
-            ],
-            wx_cv_type_statvfs_t=statvfs_t,
-            [
-                AC_TRY_COMPILE(
+            ]])],[wx_cv_type_statvfs_t=statvfs_t],[
+                _au_m4_changequote([,])AC_TRY_COMPILE(
                     [
                         #include <sys/statvfs.h>
                     ],
@@ -3940,8 +3932,8 @@ if test "$wx_cv_func_statvfs" = "yes"; then
                     wx_cv_type_statvfs_t="struct statvfs",
                     wx_cv_type_statvfs_t="unknown"
                 )
-            ]
-        )
+            
+        ])
         AC_LANG_POP()]
     )
 
@@ -5003,18 +4995,15 @@ if test "$USE_UNIX" = 1 ; then
     dnl redefines ioctl as oss_ioctrl inside it and so we also need to test
     dnl whether we need -lossaudio at link-time
     AC_CACHE_CHECK([for SNDCTL_DSP_SPEED in sys/soundcard.h], ac_cv_header_sys_soundcard, [
-        AC_TRY_LINK([
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[
                 #include <sys/ioctl.h>
                 #include <sys/soundcard.h>
-            ],
-            [
+            ]], [[
                 ioctl(0, SNDCTL_DSP_SPEED, 0);
-            ],
-            ac_cv_header_sys_soundcard=yes,
-            [
+            ]])],[ac_cv_header_sys_soundcard=yes],[
                 saveLibs="$LIBS"
                 LIBS="$saveLibs -lossaudio"
-                AC_TRY_LINK([
+                _au_m4_changequote([,])AC_TRY_LINK([
                         #include <sys/ioctl.h>
                         #include <sys/soundcard.h>
                     ],
@@ -5027,8 +5016,8 @@ if test "$USE_UNIX" = 1 ; then
                         ac_cv_header_sys_soundcard=no
                     ]
                 )
-            ]
-        )
+            
+        ])
     ])
 
     if test "$ac_cv_header_sys_soundcard" = "yes"; then
@@ -5442,17 +5431,13 @@ if test "$ac_cv_func_gettimeofday" = "yes"; then
                    wx_cv_func_gettimeofday_has_2_args,
     [
         dnl on some _really_ old systems it takes only 1 argument
-        AC_TRY_COMPILE(
-            [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                 #include <sys/time.h>
                 #include <unistd.h>
-            ],
-            [
+            ]], [[
                 struct timeval tv;
                 gettimeofday(&tv, NULL);
-            ],
-            wx_cv_func_gettimeofday_has_2_args=yes,
-            [AC_TRY_COMPILE(
+            ]])],[wx_cv_func_gettimeofday_has_2_args=yes],[_au_m4_changequote([,])AC_TRY_COMPILE(
                  [
                      #include <sys/time.h>
                      #include <unistd.h>
@@ -5466,8 +5451,8 @@ if test "$ac_cv_func_gettimeofday" = "yes"; then
                      AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
                      wx_cv_func_gettimeofday_has_2_args=unknown
                  ]
-            )]
-        )
+            )
+        ])
     ])
 
     if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
@@ -5482,19 +5467,15 @@ if test "$wxUSE_DATETIME" = "yes"; then
                    wx_cv_var_timezone,
                    [
                         AC_LANG_PUSH(C++)
-                        AC_TRY_COMPILE(
-                            [
+                        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                                 #include <time.h>
-                            ],
-                            [
+                            ]], [[
                                 int tz;
                                 tz = timezone;
-                            ],
-                            [
+                            ]])],[
                                 wx_cv_var_timezone=timezone
-                            ],
-                            [
-                                AC_TRY_COMPILE(
+                            ],[
+                                _au_m4_changequote([,])AC_TRY_COMPILE(
                                     [
                                         #include <time.h>
                                     ],
@@ -5506,7 +5487,7 @@ if test "$wxUSE_DATETIME" = "yes"; then
                                         wx_cv_var_timezone=_timezone
                                     ],
                                     [
-                                        AC_TRY_COMPILE(
+                                        _au_m4_changequote([,])AC_TRY_COMPILE(
                                             [
                                                 #include <time.h>
                                             ],
@@ -5525,8 +5506,8 @@ if test "$wxUSE_DATETIME" = "yes"; then
                                         )
                                     ]
                                 )
-                            ]
-                        )
+                            
+                        ])
                         AC_LANG_POP()
                    ]
     )
@@ -5629,17 +5610,13 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
                        wx_cv_type_getsockname3,
             [
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE(
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                         #include <sys/types.h>
                         #include <sys/socket.h>
-                    ],
-                    [
+                    ]], [[
                         socklen_t len;
                         getsockname(0, 0, &len);
-                    ],
-                    wx_cv_type_getsockname3=socklen_t,
-                    [
+                    ]])],[wx_cv_type_getsockname3=socklen_t],[
                         dnl the compiler will compile the version with size_t
                         dnl even if the real type of the last parameter is int
                         dnl but it should give at least a warning about
@@ -5651,7 +5628,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
                             CFLAGS="-Werror $CFLAGS"
                         fi
 
-                        AC_TRY_COMPILE(
+                        _au_m4_changequote([,])AC_TRY_COMPILE(
                             [
                                 #include <sys/types.h>
                                 #include <sys/socket.h>
@@ -5661,7 +5638,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
                                 getsockname(0, 0, &len);
                             ],
                             wx_cv_type_getsockname3=size_t, [
-                            AC_TRY_COMPILE(
+                            _au_m4_changequote([,])AC_TRY_COMPILE(
                                 [
                                     #include <sys/types.h>
                                     #include <sys/socket.h>
@@ -5676,8 +5653,8 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
                         )
 
                         CFLAGS="$CFLAGS_OLD"
-                    ]
-                )
+                    
+                ])
                 AC_LANG_POP()
             ])
 
@@ -5697,18 +5674,14 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
                 dnl converting between incompatible pointer types in C.
                 dnl So this test needs to be done in C++ mode.
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE(
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                         #include <sys/types.h>
                         #include <sys/socket.h>
-                    ],
-                    [
+                    ]], [[
                         socklen_t len;
                         getsockopt(0, 0, 0, 0, &len);
-                    ],
-                    wx_cv_type_getsockopt5=socklen_t,
-                    [
-                        AC_TRY_COMPILE(
+                    ]])],[wx_cv_type_getsockopt5=socklen_t],[
+                        _au_m4_changequote([,])AC_TRY_COMPILE(
                             [
                                 #include <sys/types.h>
                                 #include <sys/socket.h>
@@ -5718,7 +5691,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
                                 getsockopt(0, 0, 0, 0, &len);
                             ],
                             wx_cv_type_getsockopt5=size_t, [
-                            AC_TRY_COMPILE(
+                            _au_m4_changequote([,])AC_TRY_COMPILE(
                                 [
                                     #include <sys/types.h>
                                     #include <sys/socket.h>
@@ -5731,8 +5704,8 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
                                 wx_cv_type_getsockopt5=unknown
                             )]
                         )
-                    ]
-                )
+                    
+                ])
                 AC_LANG_POP()
             ])
 
-- 
2.40.1

