From a1a703a9e118ed76cace8165d8ed3e5ec88c6477 Mon Sep 17 00:00:00 2001
From: Maximilian Downey Twiss <creatorsmithmdt@gmail.com>
Date: Thu, 24 Nov 2022 19:37:56 +1100
Subject: [PATCH 50/56] libjava: Replace AC_LANG_PROGRAM with AC_LANG_SOURCE.

libjava/classpath/ChangeLog:

	* configure.ac: Replace AC_LANG_PROGRAM with AC_LANG_SOURCE.
	* configure: Regenerate.

libjava/ChangeLog:

	* configure.ac: Replace AC_LANG_PROGRAM with AC_LANG_SOURCE, add additional AC_LANG_SOURCE call.
	* configure: Regenerate.
---
 libjava/classpath/configure    |  57 ++---------------
 libjava/classpath/configure.ac |  14 ++---
 libjava/configure              | 109 +++++----------------------------
 libjava/configure.ac           |  34 +++++-----
 4 files changed, 46 insertions(+), 168 deletions(-)

diff --git a/libjava/classpath/configure b/libjava/classpath/configure
index 091d96058f8..12ef419fa6b 100755
--- a/libjava/classpath/configure
+++ b/libjava/classpath/configure
@@ -17613,13 +17613,6 @@ $as_echo_n "checking whether struct sockaddr_in6 is in netinet/in.h... " >&6; }
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netinet/in.h>
-int
-main ()
-{
-struct sockaddr_in6 addr6;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -17779,13 +17772,6 @@ $as_echo_n "checking for tm_gmtoff in struct tm... " >&6; }
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-int
-main ()
-{
-struct tm tim; tim.tm_gmtoff = 0;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -17801,13 +17787,6 @@ $as_echo_n "checking for global timezone variable... " >&6; }
                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-int
-main ()
-{
-void i(){long z2 = 2*timezone;}
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -17823,13 +17802,6 @@ $as_echo_n "checking for global _timezone variable... " >&6; }
               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-int
-main ()
-{
-long z2 = _timezone;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -22205,13 +22177,6 @@ $as_echo_n "checking for MSG_NOSIGNAL... " >&6; }
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/socket.h>
-int
-main ()
-{
- int f = MSG_NOSIGNAL;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -22230,13 +22195,6 @@ $as_echo_n "checking for SO_NOSIGPIPE ... " >&6; }
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/socket.h>
-int
-main ()
-{
- int f = SO_NOSIGPIPE;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -22255,13 +22213,6 @@ $as_echo_n "checking for MSG_WAITALL... " >&6; }
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/socket.h>
-int
-main ()
-{
- int f = MSG_WAITALL;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -25591,7 +25542,7 @@ else
 JAVA_TEST=Object.java
 CLASS_TEST=Object.class
 cat << \EOF > $JAVA_TEST
-/* #line 25594 "configure" */
+/* #line 25545 "configure" */
 package java.lang;
 
 public class Object
@@ -25684,7 +25635,7 @@ EOF
 if uudecode$EXEEXT Test.uue; then
         ac_cv_prog_uudecode_base64=yes
 else
-        echo "configure: 25687: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
+        echo "configure: 25638: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
         echo "configure: failed file was:" >&5
         cat Test.uue >&5
         ac_cv_prog_uudecode_base64=no
@@ -25712,7 +25663,7 @@ JAVA_TEST=Test.java
 CLASS_TEST=Test.class
 TEST=Test
 cat << \EOF > $JAVA_TEST
-/* [#]line 25715 "configure" */
+/* [#]line 25666 "configure" */
 public class Test {
 public static void main (String args[]) {
         System.exit (0);
@@ -25920,7 +25871,7 @@ if test "x${use_glibj_zip}" = xfalse || \
   JAVA_TEST=Test.java
   CLASS_TEST=Test.class
   cat << \EOF > $JAVA_TEST
-  /* #line 25923 "configure" */
+  /* #line 25874 "configure" */
   public class Test
   {
     public static void main(String args)
diff --git a/libjava/classpath/configure.ac b/libjava/classpath/configure.ac
index 95c7b599297..77ed70300e9 100644
--- a/libjava/classpath/configure.ac
+++ b/libjava/classpath/configure.ac
@@ -532,7 +532,7 @@ if test "x${COMPILE_JNI}" = xyes; then
   AC_SUBST(LIBMAGIC)
 
   AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
                     [AC_DEFINE(HAVE_INET6, 1,
                      [Define if inet6 structures are defined in netinet/in.h.])
                      AC_MSG_RESULT(yes)],
@@ -543,7 +543,7 @@ if test "x${COMPILE_JNI}" = xyes; then
   AC_STRUCT_TIMEZONE
 
   AC_MSG_CHECKING([for tm_gmtoff in struct tm])
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
   [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
    AC_MSG_RESULT(yes)],
   [AC_MSG_RESULT(no)
@@ -552,13 +552,13 @@ if test "x${COMPILE_JNI}" = xyes; then
    dnl when cross-compiling.  So instead we make an assumption that
    dnl the header file will mention timezone if it exists.
    dnl Don't find the win32 function timezone
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
      [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
       AC_MSG_RESULT(yes)],
      [AC_MSG_RESULT(no)
        AC_MSG_CHECKING([for global _timezone variable])
        dnl FIXME: As above, don't want link check
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
+       AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <time.h>]], [[long z2 = _timezone;]])],
          [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
             [Define if your platform has the global _timezone variable.])
           AC_MSG_RESULT(yes)],
@@ -765,7 +765,7 @@ if test "x${COMPILE_JNI}" = xyes; then
   dnl Check for MSG_NOSIGNAL
   dnl **********************************************************************
   AC_MSG_CHECKING(for MSG_NOSIGNAL)
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_NOSIGNAL; ]])],[ AC_MSG_RESULT(yes)
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/socket.h>]], [[ int f = MSG_NOSIGNAL; ]])],[ AC_MSG_RESULT(yes)
      AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
      	       [Define this symbol if you have MSG_NOSIGNAL]) ],[ AC_MSG_RESULT(no)
   ])
@@ -773,7 +773,7 @@ if test "x${COMPILE_JNI}" = xyes; then
  dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
  dnl **********************************************************************
  AC_MSG_CHECKING(for SO_NOSIGPIPE )
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = SO_NOSIGPIPE; ]])],[ AC_MSG_RESULT(yes)
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/socket.h>]], [[ int f = SO_NOSIGPIPE; ]])],[ AC_MSG_RESULT(yes)
     AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
     	      [Define this symbol if you have SO_NOSIGPIPE]) ],[ AC_MSG_RESULT(no)
  ])
@@ -781,7 +781,7 @@ if test "x${COMPILE_JNI}" = xyes; then
   dnl Check for MSG_WAITALL
   dnl **********************************************************************
   AC_MSG_CHECKING(for MSG_WAITALL)
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_WAITALL; ]])],[ AC_MSG_RESULT(yes)
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/socket.h>]], [[ int f = MSG_WAITALL; ]])],[ AC_MSG_RESULT(yes)
      AC_DEFINE(HAVE_MSG_WAITALL, 1,
      	       [Define this symbol if you have MSG_WAITALL]) ],[ AC_MSG_RESULT(no)
   ])
diff --git a/libjava/configure b/libjava/configure
index d2b5d00d03a..1ae56784d5f 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -22238,13 +22238,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 	  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netdb.h>
-int
-main ()
-{
-gethostbyname_r("", 0, 0);
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
   libjava_cv_gethostbyname_r_needs_reentrant=no
@@ -22254,13 +22247,6 @@ else
 		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netdb.h>
-int
-main ()
-{
-gethostbyname_r("", 0, 0);
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_cxx_try_compile "$LINENO"; then :
   libjava_cv_gethostbyname_r_needs_reentrant=yes
@@ -22295,7 +22281,14 @@ $as_echo_n "checking for struct hostent_data... " >&6; }
 if ${libjava_cv_struct_hostent_data+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -22310,7 +22303,7 @@ struct hostent_data data;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   libjava_cv_struct_hostent_data=yes
 else
   libjava_cv_struct_hostent_data=no
@@ -22324,6 +22317,12 @@ $as_echo "$libjava_cv_struct_hostent_data" >&6; }
 $as_echo "#define HAVE_STRUCT_HOSTENT_DATA 1" >>confdefs.h
 
      fi
+   ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
 
 fi
 done
@@ -22611,15 +22610,6 @@ fi
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <pthread.h>
-int
-main ()
-{
-
-          extern pthread_mutex_t *mutex; int q = mutex->m_count;
-
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -22630,15 +22620,6 @@ else
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <pthread.h>
-int
-main ()
-{
-
-	    extern pthread_mutex_t *mutex; int q = mutex->__m_count;
-
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24318,20 +24299,13 @@ $as_echo_n "checking for in_addr_t... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
-#if HAVE_NETINET_IN_H
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-int
-main ()
-{
-in_addr_t foo;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24350,13 +24324,6 @@ $as_echo_n "checking whether struct ip_mreq is in netinet/in.h... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netinet/in.h>
-int
-main ()
-{
-struct ip_mreq mreq;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24375,13 +24342,6 @@ $as_echo_n "checking whether struct ipv6_mreq is in netinet/in.h... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netinet/in.h>
-int
-main ()
-{
-struct ipv6_mreq mreq6;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24400,13 +24360,6 @@ $as_echo_n "checking whether struct sockaddr_in6 is in netinet/in.h... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netinet/in.h>
-int
-main ()
-{
-struct sockaddr_in6 addr6;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24427,13 +24380,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #define _POSIX_PII_SOCKET
 #include <sys/types.h>
 #include <sys/socket.h>
-int
-main ()
-{
-socklen_t x = 5;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24452,13 +24398,6 @@ $as_echo_n "checking for tm_gmtoff in struct tm... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-int
-main ()
-{
-struct tm tim; tim.tm_gmtoff = 0;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24474,13 +24413,6 @@ $as_echo_n "checking for global timezone variable... " >&6; }
                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-int
-main ()
-{
-void i(){long z2 = 2*timezone;}
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
@@ -24496,13 +24428,6 @@ $as_echo_n "checking for global _timezone variable... " >&6; }
               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
-int
-main ()
-{
-long z2 = _timezone;
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
diff --git a/libjava/configure.ac b/libjava/configure.ac
index 98208565088..8fb16765e05 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -924,7 +924,7 @@ esac
 AC_CACHE_CHECK([for --no-merge-exidx-entries], [libgcj_cv_exidx],
   [saved_ldflags="$LDFLAGS"
    LDFLAGS="${LDFLAGS} -Wl,--no-merge-exidx-entries"
-   AC_LINK_IFELSE([int main(void){ return 0;} ],
+   AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void){ return 0;} ])],
 		      [eval "libgcj_cv_exidx=yes"],
 		      [eval "libgcj_cv_exidx=no"])
    LDFLAGS="${saved_ldflags}"]
@@ -1221,12 +1221,12 @@ else
 	AC_CACHE_CHECK([whether gethostbyname_r declaration requires -D_REENTRANT],
 	[libjava_cv_gethostbyname_r_needs_reentrant],
 	[ AC_LANG_PUSH(C++)
-	  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
+	  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <netdb.h>]],
 	    [[gethostbyname_r("", 0, 0);]])],
 	    [libjava_cv_gethostbyname_r_needs_reentrant=no], [dnl
 		CPPFLAGS_SAVE="$CPPFLAGS"
 		CPPFLAGS="$CPPFLAGS -D_REENTRANT"
-		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[gethostbyname_r("", 0, 0);]])],
+		AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <netdb.h>]], [[gethostbyname_r("", 0, 0);]])],
 		    [libjava_cv_gethostbyname_r_needs_reentrant=yes],
 		    [libjava_cv_gethostbyname_r_needs_reentrant=fail])
 		CPPFLAGS="$CPPFLAGS_SAVE"
@@ -1240,7 +1240,8 @@ else
      esac
 
      AC_CACHE_CHECK([for struct hostent_data],
-	[libjava_cv_struct_hostent_data], [dnl
+	[libjava_cv_struct_hostent_data], [
+  AC_LANG_PUSH(C++)
 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
 # define _REENTRANT 1
@@ -1252,6 +1253,7 @@ else
        AC_DEFINE(HAVE_STRUCT_HOSTENT_DATA, 1,
          [Define if struct hostent_data is defined in netdb.h])
      fi
+   AC_LANG_POP(C++)
    ])
 
    # FIXME: libjava source code expects to find a prototype for
@@ -1314,11 +1316,11 @@ else
 
       # We can save a little space at runtime if the mutex has m_count
       # or __m_count.  This is a nice hack for Linux.
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[
+      AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <pthread.h>]], [[
           extern pthread_mutex_t *mutex; int q = mutex->m_count;
         ]])], AC_DEFINE(PTHREAD_MUTEX_HAVE_M_COUNT, 1,
              [Define if pthread_mutex_t has m_count member.]), [
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[
+	AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <pthread.h>]], [[
 	    extern pthread_mutex_t *mutex; int q = mutex->__m_count;
 	  ]])], AC_DEFINE(PTHREAD_MUTEX_HAVE___M_COUNT, 1,
             [Define if pthread_mutex_t has __m_count member.]))])
@@ -1592,12 +1594,12 @@ AC_CHECK_TYPE([magic_t], [
 #endif])
 
 AC_MSG_CHECKING([for in_addr_t])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#if STDC_HEADERS
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>
+#ifdef STDC_HEADERS
 #include <stdlib.h>
 #include <stddef.h>
 #endif
-#if HAVE_NETINET_IN_H
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif]], [[in_addr_t foo;]])],
   [AC_DEFINE(HAVE_IN_ADDR_T, 1,
@@ -1606,28 +1608,28 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
   [AC_MSG_RESULT(no)])
 
 AC_MSG_CHECKING([whether struct ip_mreq is in netinet/in.h])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct ip_mreq mreq;]])],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <netinet/in.h>]], [[struct ip_mreq mreq;]])],
   [AC_DEFINE(HAVE_STRUCT_IP_MREQ, 1,
      [Define if struct ip_mreq is defined in netinet/in.h.])
    AC_MSG_RESULT(yes)],
   [AC_MSG_RESULT(no)])
 
 AC_MSG_CHECKING([whether struct ipv6_mreq is in netinet/in.h])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct ipv6_mreq mreq6;]])],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <netinet/in.h>]], [[struct ipv6_mreq mreq6;]])],
   [AC_DEFINE(HAVE_STRUCT_IPV6_MREQ, 1,
      [Define if struct ipv6_mreq is defined in netinet/in.h.])
    AC_MSG_RESULT(yes)],
   [AC_MSG_RESULT(no)])
 
 AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
   [AC_DEFINE(HAVE_INET6, 1,
      [Define if inet6 structures are defined in netinet/in.h.])
    AC_MSG_RESULT(yes)],
   [AC_MSG_RESULT(no)])
 
 AC_MSG_CHECKING([for socklen_t in sys/socket.h])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_PII_SOCKET
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#define _POSIX_PII_SOCKET
 #include <sys/types.h>
 #include <sys/socket.h>]], [[socklen_t x = 5;]])],
   [AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define it socklen_t typedef is in sys/socket.h.])
@@ -1635,7 +1637,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_PII_SOCKET
   [AC_MSG_RESULT(no)])
 
 AC_MSG_CHECKING([for tm_gmtoff in struct tm])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tim; tim.tm_gmtoff = 0;]])],
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <time.h>]], [[struct tm tim; tim.tm_gmtoff = 0;]])],
   [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
    AC_MSG_RESULT(yes)],
   [AC_MSG_RESULT(no)
@@ -1644,13 +1646,13 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm tim; tim.t
    dnl when cross-compiling.  So instead we make an assumption that
    dnl the header file will mention timezone if it exists.
    dnl Don't find the win32 function timezone
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
      [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
       AC_MSG_RESULT(yes)],
      [AC_MSG_RESULT(no)
        AC_MSG_CHECKING([for global _timezone variable])
        dnl FIXME: As above, don't want link check
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
+       AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <time.h>]], [[long z2 = _timezone;]])],
          [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
             [Define if your platform has the global _timezone variable.])
           AC_MSG_RESULT(yes)],
-- 
2.38.1

Reply via email to