From 3547267797b23641ab00404727b9bb2362fb48df Mon Sep 17 00:00:00 2001
From: Andreas Karlsson <andreas@proxel.se>
Date: Fri, 13 Feb 2015 00:17:37 +0100
Subject: [PATCH 2/4] Prefer AC_LANG_SOURCE over AC_LANG_PROGRAM where main is
 unused.

---
 config/ac_func_accept_argtypes.m4 |  4 ++--
 config/c-compiler.m4              |  4 ++--
 configure                         | 21 ---------------------
 configure.in                      |  4 ++--
 4 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/config/ac_func_accept_argtypes.m4 b/config/ac_func_accept_argtypes.m4
index 0e50c8d..e57f3e6 100644
--- a/config/ac_func_accept_argtypes.m4
+++ b/config/ac_func_accept_argtypes.m4
@@ -50,14 +50,14 @@ AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES],
       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
-         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+         AC_COMPILE_IFELSE([AC_LANG_SOURCE(
 [#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);], [])],
+extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);])],
          [ac_not_found=no; break 4], [ac_not_found=yes])
        done
       done
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index 42679db..b87682c 100644
--- a/config/c-compiler.m4
+++ b/config/c-compiler.m4
@@ -199,9 +199,9 @@ fi])# PGAC_C_TYPES_COMPATIBLE
 # and define HAVE__BUILTIN_BSWAP32 if so.
 AC_DEFUN([PGAC_C_BUILTIN_BSWAP32],
 [AC_CACHE_CHECK(for __builtin_bswap32, pgac_cv__builtin_bswap32,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[AC_COMPILE_IFELSE([AC_LANG_SOURCE(
 [static unsigned long int x = __builtin_bswap32(0xaabbccdd);],
-[])],
+)],
 [pgac_cv__builtin_bswap32=yes],
 [pgac_cv__builtin_bswap32=no])])
 if test x"$pgac_cv__builtin_bswap32" = xyes ; then
diff --git a/configure b/configure
index fa271fe..f4b9da1 100755
--- a/configure
+++ b/configure
@@ -10341,13 +10341,6 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 static unsigned long int x = __builtin_bswap32(0xaabbccdd);
-int
-main ()
-{
-
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   pgac_cv__builtin_bswap32=yes
@@ -11309,13 +11302,6 @@ else
 #include <sys/socket.h>
 #endif
 extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
-int
-main ()
-{
-
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   ac_not_found=no; break 4
@@ -13147,13 +13133,6 @@ if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
 #define INT64CONST(x)  x##LL
 long long int foo = INT64CONST(0x1234567890123456);
 
-int
-main ()
-{
-
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
diff --git a/configure.in b/configure.in
index 64efd85..1725df6 100644
--- a/configure.in
+++ b/configure.in
@@ -1645,10 +1645,10 @@ AC_DEFINE_UNQUOTED(PG_INT64_TYPE, $pg_int64_type,
 dnl If we need to use "long long int", figure out whether nnnLL notation works.
 
 if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+  AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 #define INT64CONST(x)  x##LL
 long long int foo = INT64CONST(0x1234567890123456);
-], [])],
+])],
 	[AC_DEFINE(HAVE_LL_CONSTANTS, 1, [Define to 1 if constants of type 'long long int' should have the suffix LL.])],
 	[])
 fi
-- 
2.1.4

