changeset 10682:12699f21d6b2

Use AC_LANG_SOURCE instead of AC_LANG_PROGRAM.
author Bruno Haible <bruno@clisp.org>
date Mon, 20 Oct 2008 13:06:51 +0200
parents bf677e4be938
children b8ed97decfee
files ChangeLog m4/posix_spawn.m4
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-20  Bruno Haible  <bruno@clisp.org>
+
+	* m4/posix_spawn.m4 (gl_POSIX_SPAWN_WORKS): Use AC_LANG_SOURCE instead
+	of AC_LANG_PROGRAM.
+
 2008-10-20  Simon Josefsson  <simon@josefsson.org>
 
 	* lib/netdb.in.h: Don't define GNU specific constants until they
--- a/m4/posix_spawn.m4
+++ b/m4/posix_spawn.m4
@@ -59,7 +59,7 @@
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether posix_spawn works], [gl_cv_func_posix_spawn_works],
     [if test $cross_compiling = no; then
-       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+       AC_LINK_IFELSE([AC_LANG_SOURCE([[
 #include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
@@ -109,10 +109,11 @@
     }
 
   return fd;
-}  
-]],
-dnl Now comes the main() function.
-[[
+}
+
+int
+main ()
+{
   char *argv[2] = { CHILD_PROGRAM_FILENAME, NULL };
   int ofd[2];
   sigset_t blocked_signals;
@@ -181,6 +182,8 @@
       fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
       exit (1);
     }
+  return 0;
+}
 ]])],
          [if test -s conftest$ac_exeext \
              && ./conftest$ac_exeext > conftest.out \