From da94b7111743455f1ae444c89ac6bccb9c13c950 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Wed, 14 Jun 2023 20:28:31 -0400
Subject: [PATCH 3/6] autoupdate valid substitutions

---
 configure.in | 470 ++++++++++++++++++---------------------------------
 1 file changed, 163 insertions(+), 307 deletions(-)

diff --git a/configure.in b/configure.in
index 9b10a308e4..19e87c3dce 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.58)
+AC_PREREQ([2.71])
 
 dnl ---------------------------------------------------------------------------
 dnl
@@ -14,7 +14,7 @@ dnl ---------------------------------------------------------------------------
 dnl initialization
 dnl ---------------------------------------------------------------------------
 
-AC_INIT([wxWidgets], [3.3.0], [wx-dev@googlegroups.com])
+AC_INIT([wxWidgets],[3.3.0],[wx-dev@googlegroups.com])
 
 dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package
 AC_CONFIG_SRCDIR([wx-config.in])
@@ -1325,16 +1325,14 @@ version or omitting it entirely."
 
     AC_LANG_PUSH(C)
     AC_MSG_CHECKING([if C compiler ($CC) works with SDK/version options])
-    AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([$error_message])])
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([$error_message])])
     AC_LANG_POP()
 
     AC_LANG_PUSH(C++)
     AC_MSG_CHECKING([if C++ compiler ($CXX) works with SDK/version options])
-    AC_TRY_LINK(
-        [
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
             #include <Availability.h>
-        ],
-        [
+        ]], [[
             #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
             #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101000
             #error macOS versions < 10.10 are not supported.
@@ -1345,10 +1343,8 @@ version or omitting it entirely."
             #elif !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
             #error unrecognized platform
             #endif
-        ],
-        [AC_MSG_RESULT([yes])],
-        [AC_MSG_FAILURE([$error_message])]
-    )
+        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([$error_message])
+    ])
     AC_LANG_POP()
 
     dnl If we are here, we must have set retest_macosx_linking to yes above,
@@ -1443,16 +1439,12 @@ case "${host}" in
         dnl headers and libraries, so it's Windows-like in this case
         AC_CACHE_CHECK([if -mno-cygwin is in effect], wx_cv_nocygwin,
             [
-                AC_TRY_COMPILE(
-                    [],
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
                         #ifdef __MINGW32__
                             choke me
                         #endif
-                    ],
-                    wx_cv_nocygwin=no,
-                    wx_cv_nocygwin=yes
-                )
+                    ]])],[wx_cv_nocygwin=no],[wx_cv_nocygwin=yes
+                ])
             ]
         )
 
@@ -1693,16 +1685,12 @@ if test -n "$LARGEFILE_CPPFLAGS"; then
             wx_cv_STDC_EXT_required,
             [
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE(
-                    [],
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
                         #ifndef __STDC_EXT__
                             choke me
                         #endif
-                    ],
-                    wx_cv_STDC_EXT_required=no,
-                    wx_cv_STDC_EXT_required=yes
-                )
+                    ]])],[wx_cv_STDC_EXT_required=no],[wx_cv_STDC_EXT_required=yes
+                ])
                 AC_LANG_POP()
             ]
         )
@@ -1758,15 +1746,12 @@ if test "x$SGICC" = "xyes"; then
     AC_CACHE_CHECK([if cc version is 7.4.4 or greater],
         wx_cv_prog_sgicc744,
         [
-            AC_TRY_COMPILE([],
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
                     #if _SGI_COMPILER_VERSION >= 744
                     chock me: mipsPro is 7.4.4 or later
                     #endif
-                ],
-                wx_cv_prog_sgicc744=no,
-                wx_cv_prog_sgicc744=yes
-            )
+                ]])],[wx_cv_prog_sgicc744=no],[wx_cv_prog_sgicc744=yes
+            ])
         ]
     )
 
@@ -1779,15 +1764,12 @@ if test "x$SGICXX" = "xyes"; then
         wx_cv_prog_sgicxx744,
         [
             AC_LANG_PUSH(C++)
-            AC_TRY_COMPILE([],
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
                     #if _SGI_COMPILER_VERSION >= 744
                     chock me: mipsPro is 7.4.4 or later
                     #endif
-                ],
-                wx_cv_prog_sgicxx744=no,
-                wx_cv_prog_sgicxx744=yes
-            )
+                ]])],[wx_cv_prog_sgicxx744=no],[wx_cv_prog_sgicxx744=yes
+            ])
             AC_LANG_POP()
         ]
     )
@@ -2200,9 +2182,8 @@ if test "$wxUSE_ZLIB" != "no" ; then
         dnl has anything more ancient (1.1.3 was released in July 1998)
         dnl anyhow
         AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h,
-            [AC_TRY_RUN(
-                dnl zlib.h defines ZLIB_VERSION="x.y.z"
-                [
+            [AC_RUN_IFELSE([AC_LANG_SOURCE([[dnl zlib.h defines ZLIB_VERSION="x.y.z"
+                
                     #include <zlib.h>
                     #include <stdio.h>
                     #include <stdlib.h>
@@ -2218,12 +2199,7 @@ if test "$wxUSE_ZLIB" != "no" ; then
                                  ZLIB_VERSION[4] >= '4')) ? "yes" : "no");
                         return 0;
                     }
-                ],
-                ac_cv_header_zlib_h=`cat conftestval`,
-                ac_cv_header_zlib_h=no,
-                dnl cross-compiling: don't have an answer, try later
-                unset ac_cv_header_zlib_h
-            )]
+                ]])],[ac_cv_header_zlib_h=`cat conftestval`],[ac_cv_header_zlib_h=no],[dnl cross-compiling: don't have an answer])]
         )
         dnl If the test above did not come up with a value (e.g. cross
         dnl compiling) then this should give a definitive answer
@@ -2286,9 +2262,8 @@ if test "$wxUSE_LIBPNG" != "no" ; then
         dnl libpng version 0.9 is known to not work, if an even newer
         dnl version is required, just bump it up in the test below
         AC_CACHE_CHECK([for png.h > 0.90], ac_cv_header_png_h,
-            [AC_TRY_RUN(
-                dnl png.h defines PNG_LIBPNG_VER=number
-                [
+            [AC_RUN_IFELSE([AC_LANG_SOURCE([[dnl png.h defines PNG_LIBPNG_VER=number
+                
                     #include <png.h>
                     #include <stdio.h>
                     #include <stdlib.h>
@@ -2301,12 +2276,9 @@ if test "$wxUSE_LIBPNG" != "no" ; then
                                  PNG_LIBPNG_VER > 90 ? "yes" : "no");
                         return 0;
                     }
-                ],
-                ac_cv_header_png_h=`cat conftestval`,
-                ac_cv_header_png_h=no,
-                dnl cross-compiling: test (later) if we have any png.h
+                ]])],[ac_cv_header_png_h=`cat conftestval`],[ac_cv_header_png_h=no],[dnl cross-compiling: test (later) if we have any png.h
                 unset ac_cv_header_png_h
-            )]
+            ])]
         )
         AC_CHECK_HEADER(png.h,,, [ ])
 
@@ -2364,17 +2336,13 @@ if test "$wxUSE_LIBJPEG" != "no" ; then
         dnl a compiler warning which configure considers as an error...
         AC_MSG_CHECKING(for jpeglib.h)
         AC_CACHE_VAL(ac_cv_header_jpeglib_h,
-            AC_TRY_COMPILE(
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                     #undef HAVE_STDLIB_H
                     #include <stdio.h>
                     #include <jpeglib.h>
-                ],
-                [
-                ],
-                ac_cv_header_jpeglib_h=yes,
-                ac_cv_header_jpeglib_h=no
-            )
+                ]], [[
+                ]])],[ac_cv_header_jpeglib_h=yes],[ac_cv_header_jpeglib_h=no
+            ])
         )
         AC_MSG_RESULT($ac_cv_header_jpeglib_h)
 
@@ -2592,10 +2560,8 @@ if test "$wxUSE_EXPAT" != "no"; then
                 wx_cv_expat_is_not_broken,
                 [
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE([#include <expat.h>],[],
-                    wx_cv_expat_is_not_broken=yes,
-                    wx_cv_expat_is_not_broken=no
-                )
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <expat.h>]], [[]])],[wx_cv_expat_is_not_broken=yes],[wx_cv_expat_is_not_broken=no
+                ])
                 AC_LANG_POP()
                 ]
             )
@@ -2635,7 +2601,7 @@ if test "$wxUSE_EXPAT" != "no"; then
         dnl Expat requires C99 compiler, so define wxCFLAGS_C99 variable which
         dnl is used when compiling it in our makefiles.
         save_CC="$CC"
-        AC_PROG_CC_C99
+        AC_REQUIRE(AC_PROG_CC)
         CC="$save_CC"
 
         dnl Note that we need just the flags, not the full CC value including
@@ -2896,17 +2862,14 @@ installed, where VER is 2, 3 or 4.
             dnl gtk/gtk.h from them.
 
             AC_CACHE_CHECK([if GTK+ is version >= 2.20], wx_cv_gtk220, [
-                AC_TRY_COMPILE([
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                                 #include <gtk/gtk.h>
-                               ],
-                               [
+                               ]], [[
                                 #if !GTK_CHECK_VERSION(2,20,0)
                                 Not GTK+ 2.20
                                 #endif
-                               ],
-                               wx_cv_gtk220=yes,
-                               wx_cv_gtk220=no
-                               )
+                               ]])],[wx_cv_gtk220=yes],[wx_cv_gtk220=no
+                               ])
             ])
 
             if test "$wx_cv_gtk220" = "yes"; then
@@ -2914,17 +2877,14 @@ installed, where VER is 2, 3 or 4.
                 wx_cv_gtk218=yes
             else
                 AC_CACHE_CHECK([if GTK+ is version >= 2.18], wx_cv_gtk218, [
-                    AC_TRY_COMPILE([
+                    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                                     #include <gtk/gtk.h>
-                                   ],
-                                   [
+                                   ]], [[
                                     #if !GTK_CHECK_VERSION(2,18,0)
                                     Not GTK+ 2.18
                                     #endif
-                                   ],
-                                   wx_cv_gtk218=yes,
-                                   wx_cv_gtk218=no
-                                   )
+                                   ]])],[wx_cv_gtk218=yes],[wx_cv_gtk218=no
+                                   ])
                 ])
             fi
 
@@ -2933,17 +2893,14 @@ installed, where VER is 2, 3 or 4.
                 wx_cv_gtk210=yes
             else
                 AC_CACHE_CHECK([if GTK+ is version >= 2.10], wx_cv_gtk210, [
-                    AC_TRY_COMPILE([
+                    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                                     #include <gtk/gtk.h>
-                                   ],
-                                   [
+                                   ]], [[
                                     #if !GTK_CHECK_VERSION(2,10,0)
                                     Not GTK+ 2.10
                                     #endif
-                                   ],
-                                   wx_cv_gtk210=yes,
-                                   wx_cv_gtk210=no
-                                   )
+                                   ]])],[wx_cv_gtk210=yes],[wx_cv_gtk210=no
+                                   ])
                 ])
             fi
 
@@ -2963,17 +2920,14 @@ installed, where VER is 2, 3 or 4.
         AC_CACHE_CHECK([for GDK Wayland backend], wx_cv_gdk_wayland, [
             save_CFLAGS=$CFLAGS
             CFLAGS="$CFLAGS $TOOLKIT_INCLUDE"
-            AC_TRY_COMPILE([
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                             #include <gdk/gdk.h>
-                           ],
-                           [
+                           ]], [[
                             #ifndef GDK_WINDOWING_WAYLAND
                             Not GDK Windowing Wayland
                             #endif
-                           ],
-                           wx_cv_gdk_wayland=yes,
-                           wx_cv_gdk_wayland=no
-                           )
+                           ]])],[wx_cv_gdk_wayland=yes],[wx_cv_gdk_wayland=no
+                           ])
             CFLAGS=$save_CFLAGS
         ])
     fi
@@ -3075,17 +3029,13 @@ installed, where VER is 2, 3 or 4.
                         save_CFLAGS=$CFLAGS
                         CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
-                        AC_TRY_COMPILE(
-                            [
+                        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                                 #include <X11/xpm.h>
-                            ],
-                            [
+                            ]], [[
                                 int version;
                                 version = XpmLibraryVersion();
-                            ],
-                            wx_cv_x11_xpm_h=yes,
-                            wx_cv_x11_xpm_h=no
-                        )
+                            ]])],[wx_cv_x11_xpm_h=yes],[wx_cv_x11_xpm_h=no
+                        ])
 
                         CFLAGS=$save_CFLAGS
                     ]
@@ -3114,20 +3064,17 @@ installed, where VER is 2, 3 or 4.
             CFLAGS="$TOOLKIT_INCLUDE $CFLAGS"
 
             AC_MSG_CHECKING([for X11/extensions/shape.h])
-            AC_TRY_COMPILE([
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                             #include <X11/Xlib.h>
                             #include <X11/extensions/shape.h>
-                           ],
-                           [
+                           ]], [[
                             int dummy1, dummy2;
                             XShapeQueryExtension((Display*)NULL,
                                                  (int*)NULL, (int*)NULL);
-                           ],
-                           [
+                           ]])],[
                             AC_DEFINE(HAVE_XSHAPE)
                             AC_MSG_RESULT([found])
-                           ],
-                           [
+                           ],[
                             AC_MSG_RESULT([not found])
                            ])
             CFLAGS="$save_CFLAGS"
@@ -3593,23 +3540,20 @@ AC_LANG_PUSH(C++) dnl tests below use overloaded functions and so need C++
 AC_CACHE_CHECK([if size_t is unsigned int],
     wx_cv_size_t_is_uint,
     [
-    dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work
+    dnl an obvious check like AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[])[struct Foo { ... };] doesn't work
     dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
     dnl methods in a local class (i.e. class inside a function) declaration
     dnl without any objections!!
     dnl
     dnl hence the hack below: we must have Foo at global scope!
-    AC_TRY_COMPILE([#include <stddef.h>],
-        [
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>]], [[
             return 0; }
 
             struct Foo { void foo(size_t); void foo(unsigned int); };
 
             int bar() {
-        ],
-        wx_cv_size_t_is_uint=no,
-        wx_cv_size_t_is_uint=yes
-    )
+        ]])],[wx_cv_size_t_is_uint=no],[wx_cv_size_t_is_uint=yes
+    ])
     ]
 )
 
@@ -3618,17 +3562,14 @@ if test "$wx_cv_size_t_is_uint" = "yes"; then
 else
     AC_CACHE_CHECK([if size_t is unsigned long], [
         wx_cv_size_t_is_ulong, [
-        AC_TRY_COMPILE([#include <stddef.h>],
-            [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>]], [[
                 return 0; }
 
                 struct Foo { void foo(size_t); void foo(unsigned long); };
 
                 int bar() {
-            ],
-            wx_cv_size_t_is_ulong=no,
-            wx_cv_size_t_is_ulong=yes
-        )
+            ]])],[wx_cv_size_t_is_ulong=no],[wx_cv_size_t_is_ulong=yes
+        ])
     )]
 
     if test "$wx_cv_size_t_is_ulong" = "yes"; then
@@ -3639,8 +3580,7 @@ fi
 
 AC_CACHE_CHECK([if wchar_t is separate type],
     wx_cv_wchar_t_is_separate_type, [
-    AC_TRY_COMPILE([#include <wchar.h>],
-        [
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wchar.h>]], [[
             return 0; }
 
             struct Foo { void foo(wchar_t);
@@ -3649,10 +3589,8 @@ AC_CACHE_CHECK([if wchar_t is separate type],
                          void foo(unsigned long); };
 
             int bar() {
-        ],
-        wx_cv_wchar_t_is_separate_type=yes,
-        wx_cv_wchar_t_is_separate_type=no
-    )
+        ]])],[wx_cv_wchar_t_is_separate_type=yes],[wx_cv_wchar_t_is_separate_type=no
+    ])
 )]
 
 if test "$wx_cv_wchar_t_is_separate_type" = "yes"; then
@@ -3670,19 +3608,16 @@ dnl ---------------------------------------------------------------------------
 dnl does passwd struct has the pw_gecos field?
 AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos,
     [
-        AC_TRY_COMPILE([#include <pwd.h>],
-             [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[
                 char *p;
                 struct passwd *pw;
                 p = pw->pw_gecos;
-             ],
-             [
+             ]])],[
                 wx_cv_struct_pw_gecos=yes
-             ],
-             [
+             ],[
                 wx_cv_struct_pw_gecos=no
-             ]
-        )
+             
+        ])
     ]
 )
 
@@ -3752,20 +3687,16 @@ if test "$wx_cv_func_vsnprintf" = "yes"; then
     dnl may have one taking a "char *" format instead of "const char *"
     AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl,
         [
-            AC_TRY_COMPILE(
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                     #include <stdio.h>
                     #include <stdarg.h>
-                ],
-                [
+                ]], [[
                     char *buf;
                     va_list ap;
                     const char *fmt = "%s";
                     vsnprintf(buf, 10u, fmt, ap);
-                ],
-                wx_cv_func_broken_vsnprintf_decl=no,
-                wx_cv_func_broken_vsnprintf_decl=yes
-            )
+                ]])],[wx_cv_func_broken_vsnprintf_decl=no],[wx_cv_func_broken_vsnprintf_decl=yes
+            ])
         ]
     )
 
@@ -3783,8 +3714,7 @@ if test "$wx_cv_func_snprintf" = "yes"; then
         dnl     family and they all fallback to the same implementation
         AC_CACHE_CHECK([if snprintf supports positional arguments], wx_cv_func_snprintf_pos_params,
             [
-                AC_TRY_RUN(
-                    [
+                AC_RUN_IFELSE([AC_LANG_SOURCE([[
                         #include <stdio.h>
 
                         int main (void)
@@ -3795,16 +3725,13 @@ if test "$wx_cv_func_snprintf" = "yes"; then
                                 exit (0);
                             exit (1);
                         }
-                    ],
-                    wx_cv_func_snprintf_pos_params=no,
-                    wx_cv_func_snprintf_pos_params=yes,
-                    dnl be pessimistic when cross-compiling
-                    [
+                    ]])],[wx_cv_func_snprintf_pos_params=no],[wx_cv_func_snprintf_pos_params=yes],[dnl be pessimistic when cross-compiling
+                    
                         AC_MSG_WARN([Assuming Unix98 printf() is not available,
 define HAVE_UNIX98_PRINTF as 1 in setup.h if it is available.])
                         wx_cv_func_snprintf_pos_params=no
-                    ]
-                )
+                    
+                ])
             ]
         )
 
@@ -3820,19 +3747,15 @@ if test "$wx_cv_func_vsscanf" = "yes"; then
     dnl happens at least under HP-UX 11.31, see #15638).
     AC_CACHE_CHECK([if vsscanf() declaration is broken], wx_cv_func_broken_vsscanf_decl,
         [
-            AC_TRY_COMPILE(
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                     #include <stdio.h>
                     #include <stdarg.h>
-                ],
-                [
+                ]], [[
                     const char *buf;
                     va_list args;
                     vsscanf(buf, "%s", args);
-                ],
-                wx_cv_func_broken_vsscanf_decl=no,
-                wx_cv_func_broken_vsscanf_decl=yes
-            )
+                ]])],[wx_cv_func_broken_vsscanf_decl=no],[wx_cv_func_broken_vsscanf_decl=yes
+            ])
         ]
     )
 
@@ -3862,11 +3785,8 @@ dnl MinGW has a vswprintf with a different prototype, and
 dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
 dnl finds it even if it is not declared in some versions...
 AC_MSG_CHECKING([for _vsnwprintf])
-AC_TRY_COMPILE([#include <wchar.h>],
-               [&_vsnwprintf;],
-               [AC_MSG_RESULT([yes])
-                AC_DEFINE(HAVE__VSNWPRINTF)],
-               [AC_MSG_RESULT([no])]);
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wchar.h>]], [[&_vsnwprintf;]])],[AC_MSG_RESULT([yes])
+                AC_DEFINE(HAVE__VSNWPRINTF)],[AC_MSG_RESULT([no])]);
 
 if test "$wxUSE_FILE" = "yes"; then
     WX_CHECK_FUNCS(fsync)
@@ -3897,15 +3817,14 @@ if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
       [
         dnl C compiler happily compiles the code even if there is type mismatch
         AC_LANG_PUSH(C++)
-        AC_TRY_COMPILE([#include <signal.h>],
-                     [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[
                         extern void testSigHandler(int);
 
                         struct sigaction sa;
                         sa.sa_handler = testSigHandler;
-                     ], [
+                     ]])],[
                         wx_cv_type_sa_handler=int
-                     ], [
+                     ],[
                         wx_cv_type_sa_handler=void
                      ])
         AC_LANG_POP()
@@ -3920,16 +3839,13 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
     AC_CACHE_CHECK([for backtrace()], wx_cv_func_backtrace,
         [
             AC_LANG_PUSH(C++)
-            AC_TRY_COMPILE([#include <execinfo.h>],
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <execinfo.h>]], [[
                     void *trace[1];
                     char **messages;
                     backtrace(trace, 1);
                     messages = backtrace_symbols(trace, 1);
-                ],
-                wx_cv_func_backtrace=yes,
-                wx_cv_func_backtrace=no
-            )
+                ]])],[wx_cv_func_backtrace=yes],[wx_cv_func_backtrace=no
+            ])
             AC_LANG_POP()
         ]
     )
@@ -3945,14 +3861,11 @@ if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then
             AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle,
                 [
                     AC_LANG_PUSH(C++)
-                    AC_TRY_LINK([#include <cxxabi.h>],
-                        [
+                    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
                             int rc;
                             __cxxabiv1::__cxa_demangle("foo", 0, 0, &rc);
-                        ],
-                        wx_cv_func_cxa_demangle=yes,
-                        wx_cv_func_cxa_demangle=no
-                    )
+                        ]])],[wx_cv_func_cxa_demangle=yes],[wx_cv_func_cxa_demangle=no
+                    ])
                     AC_LANG_POP()
                 ]
             )
@@ -3979,17 +3892,13 @@ dnl get the library function to use for wxGetDiskSpace(): prefer POSIX
 dnl statvfs() if it exists, but fall back to Linux/BSD-specific statfs() if
 dnl necessary.
 AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs, [
-    AC_TRY_COMPILE(
-        [
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
             #include <stddef.h>
             #include <sys/statvfs.h>
-        ],
-        [
+        ]], [[
             statvfs("/", NULL);
-        ],
-        wx_cv_func_statvfs=yes,
-        wx_cv_func_statvfs=no
-    )]
+        ]])],[wx_cv_func_statvfs=yes],[wx_cv_func_statvfs=no
+    ])]
 )
 
 if test "$wx_cv_func_statvfs" = "yes"; then
@@ -4046,48 +3955,40 @@ fi
 
 if test "$wx_cv_type_statvfs_t" = "unknown"; then
     AC_CACHE_CHECK([for statfs], wx_cv_func_statfs, [
-        AC_TRY_COMPILE(
-            [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                  #if defined(__BSD__)
                  #include <sys/param.h>
                  #include <sys/mount.h>
                  #else
                  #include <sys/vfs.h>
                  #endif
-            ],
-            [
+            ]], [[
                  long l;
                  struct statfs fs;
                  statfs("/", &fs);
                  l = fs.f_bsize;
                  l += fs.f_blocks;
                  l += fs.f_bavail;
-            ],
-             wx_cv_func_statfs=yes,
-             wx_cv_func_statfs=no
-        )]
+            ]])],[wx_cv_func_statfs=yes],[wx_cv_func_statfs=no
+        ])]
     )
 
     if test "$wx_cv_func_statfs" = "yes"; then
         dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
         AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl, [
             AC_LANG_PUSH(C++)
-            AC_TRY_COMPILE(
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                      #if defined(__BSD__)
                      #include <sys/param.h>
                      #include <sys/mount.h>
                      #else
                      #include <sys/vfs.h>
                      #endif
-                ],
-                [
+                ]], [[
                     struct statfs fs;
                     statfs("", &fs);
-                ],
-                wx_cv_func_statfs_decl=yes,
-                wx_cv_func_statfs_decl=no
-            )
+                ]])],[wx_cv_func_statfs_decl=yes],[wx_cv_func_statfs_decl=no
+            ])
             AC_LANG_POP()]
         )
 
@@ -4334,7 +4235,7 @@ if test "$TOOLKIT" != "MSW"; then
 
         case "${host}" in
             *-*-qnx*)
-                dnl -lpthread works, i.e. AC_TRY_LINK() would pass, but results
+                dnl -lpthread works, i.e. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) would pass, but results
                 dnl in warnings and is not needed under QNX so try without it
                 dnl first
                 THREAD_OPTS="none pthread"
@@ -4373,9 +4274,7 @@ if test "$TOOLKIT" != "MSW"; then
               LIBS="$THREADS_LINK $LIBS"
               CFLAGS="$THREADS_CFLAGS $CFLAGS"
 
-              AC_TRY_LINK([#include <pthread.h>],
-                          [pthread_create(0,0,0,0);],
-                          THREADS_OK=yes)
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_create(0,0,0,0);]])],[THREADS_OK=yes],[])
 
               LIBS="$save_LIBS"
               CFLAGS="$save_CFLAGS"
@@ -4461,19 +4360,18 @@ if test "$TOOLKIT" != "MSW"; then
         dnl function and not give a warning even if it's unavailable, so use
         dnl the C++ one for this test
         AC_LANG_PUSH(C++)
-        AC_TRY_COMPILE([#include <pthread.h>
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>
                void ThreadCleanupFunc(void *p);
-            ],
-            [
+            ]], [[
                 void *p;
                 pthread_cleanup_push(ThreadCleanupFunc, p);
                 pthread_cleanup_pop(0);
-            ], [
+            ]])],[
                wx_cv_func_pthread_cleanup=yes
-            ], [
+            ],[
                wx_cv_func_pthread_cleanup=no
-            ]
-        )
+            
+        ])
         AC_LANG_POP()
       ])
       if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then
@@ -4543,14 +4441,11 @@ if test "$TOOLKIT" != "MSW"; then
 
       AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
       [
-        AC_TRY_COMPILE([#include <pthread.h>],
-            [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[
                pthread_mutexattr_t attr;
                pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-            ],
-            wx_cv_type_pthread_mutexattr_t=yes,
-            wx_cv_type_pthread_mutexattr_t=no
-        )
+            ]])],[wx_cv_type_pthread_mutexattr_t=yes],[wx_cv_type_pthread_mutexattr_t=no
+        ])
       ])
 
       if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
@@ -4560,14 +4455,11 @@ if test "$TOOLKIT" != "MSW"; then
         dnl present in some systems' headers
         AC_CACHE_CHECK([for pthread_mutexattr_settype declaration],
                        wx_cv_func_pthread_mutexattr_settype_decl, [
-                       AC_TRY_COMPILE([#include <pthread.h>],
-                           [
+                       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[
                                pthread_mutexattr_t attr;
                                pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-                           ],
-                           wx_cv_func_pthread_mutexattr_settype_decl=yes,
-                           wx_cv_func_pthread_mutexattr_settype_decl=no
-                       )
+                           ]])],[wx_cv_func_pthread_mutexattr_settype_decl=yes],[wx_cv_func_pthread_mutexattr_settype_decl=no
+                       ])
         ])
         if test "$wx_cv_func_pthread_mutexattr_settype_decl" = "yes"; then
             AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL)
@@ -4577,15 +4469,14 @@ if test "$TOOLKIT" != "MSW"; then
         AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
                        wx_cv_type_pthread_rec_mutex_init,
         [
-            AC_TRY_COMPILE([#include <pthread.h>],
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[
                     pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-                ], [
+                ]])],[
                     wx_cv_type_pthread_rec_mutex_init=yes
-                ], [
+                ],[
                     wx_cv_type_pthread_rec_mutex_init=no
-                ]
-            )
+                
+            ])
         ])
         if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
           AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
@@ -4600,13 +4491,10 @@ if test "$TOOLKIT" != "MSW"; then
             wx_cv_type_abi_forced_unwind,
             [
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE([#include <cxxabi.h>],
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
                         void foo(abi::__forced_unwind&);
-                    ],
-                    wx_cv_type_abi_forced_unwind=yes,
-                    wx_cv_type_abi_forced_unwind=no
-                )
+                    ]])],[wx_cv_type_abi_forced_unwind=yes],[wx_cv_type_abi_forced_unwind=no
+                ])
                 AC_LANG_POP()
             ]
         )
@@ -5443,23 +5331,19 @@ if test "$wxUSE_XLOCALE" = "yes" ; then
     AC_CACHE_CHECK([for locale_t], wx_cv_type_locale_t,
     [
         AC_LANG_PUSH(C++)
-        AC_TRY_COMPILE(
-        [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
         #ifdef HAVE_XLOCALE_H
         #include <xlocale.h>
         #endif
         #include <locale.h>
         #include <stdlib.h>
-        ],
-        [
+        ]], [[
         locale_t t;
         strtod_l(NULL, NULL, t);
         strtol_l(NULL, NULL, 0, t);
         strtoul_l(NULL, NULL, 0, t);
-        ],
-        wx_cv_type_locale_t=yes,
-        wx_cv_type_locale_t=no
-        )
+        ]])],[wx_cv_type_locale_t=yes],[wx_cv_type_locale_t=no
+        ])
         AC_LANG_POP()
     ])
 
@@ -5659,19 +5543,15 @@ if test "$wxUSE_DATETIME" = "yes"; then
         AC_CACHE_CHECK(for tm_gmtoff in struct tm,
                        wx_cv_struct_tm_has_gmtoff,
         [
-            AC_TRY_COMPILE(
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                     #include <time.h>
-                ],
-                [
+                ]], [[
                     struct tm tm;
                     tm.tm_gmtoff++;
-                ],
-                [
+                ]])],[
                     wx_cv_struct_tm_has_gmtoff=yes
-                ],
-                wx_cv_struct_tm_has_gmtoff=no
-            )
+                ],[wx_cv_struct_tm_has_gmtoff=no
+            ])
         ])
     fi
 
@@ -5682,19 +5562,15 @@ if test "$wxUSE_DATETIME" = "yes"; then
     AC_CACHE_CHECK([for _NL_TIME_FIRST_WEEKDAY in langinfo.h],
                    wx_cv_have_nl_time_first_weekday,
     [
-        AC_TRY_COMPILE(
-                [
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                      #define _GNU_SOURCE
                      #include <langinfo.h>
-                ],
-                [
+                ]], [[
                      _NL_TIME_FIRST_WEEKDAY;
-                ],
-                [
+                ]])],[
                      wx_cv_have_nl_time_first_weekday=yes
-                ],
-                wx_cv_have_nl_time_first_weekday=no
-        )
+                ],[wx_cv_have_nl_time_first_weekday=no
+        ])
     ])
 
     if test "$wx_cv_have_nl_time_first_weekday" = "yes"; then
@@ -5875,18 +5751,14 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
             [whether we have sockaddr_in6],
             [wx_cv_type_sockaddr_in6],
             [
-                AC_TRY_COMPILE(
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
                         #include <sys/types.h>
                         #include <sys/socket.h>
                         #include <netinet/in.h>
-                    ],
-                    [
+                    ]], [[
                         struct sockaddr_in6 sa6;
-                    ],
-                    wx_cv_type_sockaddr_in6=yes,
-                    wx_cv_type_sockaddr_in6=no
-                )
+                    ]])],[wx_cv_type_sockaddr_in6=yes],[wx_cv_type_sockaddr_in6=no
+                ])
             ]
         )
 
@@ -7069,20 +6941,16 @@ if test "$USE_WIN32" = 1 ; then
                 dnl we need just the header, not the library, as we load the
                 dnl DLL dynamically anyhow during run-time
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE(
-                    [#include <windows.h>
-                     #include <imagehlp.h>],
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <windows.h>
+                     #include <imagehlp.h>]], [[
                         #ifndef API_VERSION_NUMBER
                         #error API_VERSION_NUMBER not defined!
                         #endif
                         #if API_VERSION_NUMBER < 9
                         #error API_VERSION_NUMBER at least 9 required.
                         #endif
-                    ],
-                    wx_cv_lib_debughlp=yes,
-                    wx_cv_lib_debughlp=no
-                )
+                    ]])],[wx_cv_lib_debughlp=yes],[wx_cv_lib_debughlp=no
+                ])
                 AC_LANG_POP()
             ]
         )
@@ -7151,15 +7019,11 @@ if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then
                 dnl we need just the header, not the library, as we load the
                 dnl GDI+ DLL dynamically anyhow during run-time
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE(
-                    [#include <windows.h>
-                     #include <gdiplus.h>],
-                    [
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <windows.h>
+                     #include <gdiplus.h>]], [[
                         using namespace Gdiplus;
-                    ],
-                    wx_cv_lib_gdiplus=yes,
-                    wx_cv_lib_gdiplus=no
-                )
+                    ]])],[wx_cv_lib_gdiplus=yes],[wx_cv_lib_gdiplus=no
+                ])
                 AC_LANG_POP()
             ]
         )
@@ -7171,17 +7035,13 @@ if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then
             [
                 dnl same as above, we need to test only for the headers
                 AC_LANG_PUSH(C++)
-                AC_TRY_COMPILE(
-                    [#include <windows.h>
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <windows.h>
                      #include <d2d1.h>
                      #include <dwrite.h>
-                    ],
-                    [
+                    ]], [[
                         ID2D1Factory* factory = NULL;
-                    ],
-                    wx_cv_lib_direct2d=yes,
-                    wx_cv_lib_direct2d=no
-                )
+                    ]])],[wx_cv_lib_direct2d=yes],[wx_cv_lib_direct2d=no
+                ])
                 AC_LANG_POP()
             ]
         )
@@ -7279,18 +7139,14 @@ if test "$wxUSE_MEDIACTRL" = "yes" -o "$wxUSE_MEDIACTRL" = "auto"; then
             old_CPPFLAGS="$CPPFLAGS"
             CPPFLAGS="-x objective-c++ $CPPFLAGS"
             AC_MSG_CHECKING([if AVKit is available])
-            AC_TRY_COMPILE(
-                [#include "AvailabilityMacros.h"],
-                [
+            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "AvailabilityMacros.h"]], [[
                     #if defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
                         // AVKit available
                     #else
                         choke me
                     #endif
-                ],
-                [GST_LIBS="$GST_LIBS -weak_framework AVKit"; AC_MSG_RESULT(yes)],
-                AC_MSG_RESULT(no)
-            )
+                ]])],[GST_LIBS="$GST_LIBS -weak_framework AVKit"; AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
+            ])
             CPPFLAGS="$old_CPPFLAGS"
         fi
     fi
-- 
2.40.1

