Hi, Many uses of AC_LANG_PROGRAM doubly quote their arguments; correct. But many don't and therefore incite to write buggy autoconf macros.
The example in the autoconf macro shows doubly quoted arguments. Also, people who write AC_LANG_PROGRAM([#include <stdio.h>], ...) are probably not aware that the "include <stdio.h>" is considered as an m4 comment(!). (Up until a few weeks ago I didn't even know what an m4 comment is.) Testcase: ==================== configure.ac ======================== AC_INIT AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([#include [] <sys/types.h> const char hw1 [] = "Hello, World\n";] [[const char hw2 [] = "Hello, World\n";]], [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])], [gl_cv_header_sys_socket_h_shut=yes], [gl_cv_header_sys_socket_h_shut=no]) AC_OUTPUT ========================================================== yields the following C program: ---------------------------------------------------------- #include [] <sys/types.h> const char hw1 = "Hello, World\n"; const char hw2 [] = "Hello, World\n"; int main () { int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR }; ; return 0; } ---------------------------------------------------------- It is certainly surprising that the [] after #include is preserved but the [] after hw1 is macroexpanded and dropped! Here is a proposed patch to fix this in gnulib macros. Objections? 2008-04-13 Bruno Haible <[EMAIL PROTECTED]> * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Fix underquoting of AC_LANG_PROGRAM argument. * m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Likewise. * m4/gethrxtime.m4 (gl_ARITHMETIC_HRTIME_T): Likewise. * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise. * m4/inttypes.m4 (gl_INTTYPES_H): Likewise. * m4/math_h.m4 (gl_MATH_H): Likewise. * m4/mbstate_t.m4 (AC_TYPE_MBSTATE_T): Likewise. * m4/memmem.m4 (gl_FUNC_MEMMEM): Likewise. * m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): Likewise. * m4/physmem.m4 (gl_SYS__SYSTEM_CONFIGURATION): Likewise. * m4/putenv.m4 (gl_FUNC_PUTENV): Likewise. * m4/regex.m4 (gl_REGEX): Likewise. * m4/stdint.m4 (gl_INTEGER_TYPE_SUFFIX): Likewise. * m4/stdio_h.m4 (gl_STDIN_LARGE_OFFSET): Likewise. * m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise. * m4/strerror.m4 (gl_FUNC_STRERROR_SEPARATE): Likewise. * m4/strndup.m4 (gl_FUNC_STRNDUP): Likewise. * m4/strstr.m4 (gl_FUNC_STRSTR): Likewise. * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise. * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Likewise. --- m4/calloc.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/calloc.m4 2008-04-13 13:53:33.000000000 +0200 @@ -1,6 +1,6 @@ -# calloc.m4 serial 7 +# calloc.m4 serial 8 -# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004-2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,7 +19,7 @@ [AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_CACHE_CHECK([for GNU libc compatible calloc], ac_cv_func_calloc_0_nonnull, [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], - [exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8));])], + [[exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8));]])], [ac_cv_func_calloc_0_nonnull=yes], [ac_cv_func_calloc_0_nonnull=no], [ac_cv_func_calloc_0_nonnull=no])]) --- m4/extensions.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/extensions.m4 2008-04-13 14:06:20.000000000 +0200 @@ -1,7 +1,7 @@ # serial 5 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -61,9 +61,9 @@ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([ + [AC_LANG_PROGRAM([[ # define __EXTENSIONS__ 1 - AC_INCLUDES_DEFAULT])], + ]AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) test $ac_cv_safe_to_define___extensions__ = yes && --- m4/gethrxtime.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/gethrxtime.m4 2008-04-13 13:55:12.000000000 +0200 @@ -1,5 +1,5 @@ -# gethrxtime.m4 serial 6 -dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. +# gethrxtime.m4 serial 7 +dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -28,8 +28,8 @@ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CACHE_CHECK([for arithmetic hrtime_t], gl_cv_arithmetic_hrtime_t, [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([#include <time.h>], - [hrtime_t x = 0; return x/x;])], + [AC_LANG_PROGRAM([[#include <time.h>]], + [[hrtime_t x = 0; return x/x;]])], [gl_cv_arithmetic_hrtime_t=yes], [gl_cv_arithmetic_hrtime_t=no])]) if test $gl_cv_arithmetic_hrtime_t = yes; then --- m4/getopt.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/getopt.m4 2008-04-13 13:55:40.000000000 +0200 @@ -1,5 +1,5 @@ -# getopt.m4 serial 13 -dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# getopt.m4 serial 14 +dnl Copyright (C) 2002-2006, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -46,7 +46,7 @@ if test -z "$GETOPT_H"; then AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([#include <getopt.h>], + [AC_LANG_PROGRAM([[#include <getopt.h>]], [[ char *myargv[3]; myargv[0] = "conftest"; --- m4/inttypes.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/inttypes.m4 2008-04-13 13:58:00.000000000 +0200 @@ -1,5 +1,5 @@ -# inttypes.m4 serial 11 -dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +# inttypes.m4 serial 12 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -32,7 +32,7 @@ && test "$ac_cv_have_decl_strtoimax" = yes \ && test "$ac_cv_have_decl_strtoumax" = yes; then AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ + AC_LANG_PROGRAM([[ #include <stddef.h> #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ @@ -131,7 +131,7 @@ SCNoPTR SCNuPTR SCNxPTR #endif ; - ])], + ]])], [gl_cv_header_working_inttypes_h=yes]) fi]) @@ -174,9 +174,9 @@ I64) gltype1='__int64';; esac AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([#include <stdint.h> + [AC_LANG_PROGRAM([[#include <stdint.h> extern intptr_t foo; - extern $gltype1 foo;])], + extern $gltype1 foo;]])], [PRIPTR_PREFIX='"'$glpfx'"']) test -n "$PRIPTR_PREFIX" && break done --- m4/math_h.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/math_h.m4 2008-04-13 13:58:36.000000000 +0200 @@ -1,4 +1,4 @@ -# math_h.m4 serial 11 +# math_h.m4 serial 12 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,7 +9,7 @@ AC_REQUIRE([gl_MATH_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([math.h]) AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([EMAIL PROTECTED]:@include <math.h>], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([EMAIL PROTECTED]:@include <math.h>]], [[/* Solaris 10 has a broken definition of NAN. Other platforms fail to provide NAN, or provide it only in C99 mode; this test only needs to fail when NAN is provided but wrong. */ @@ -24,7 +24,7 @@ REPLACE_NAN=1 fi AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([EMAIL PROTECTED]:@include <math.h>], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([EMAIL PROTECTED]:@include <math.h>]], [[/* Solaris 10 has a broken definition of HUGE_VAL. */ double d = HUGE_VAL; return d == 0;]])], --- m4/mbstate_t.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/mbstate_t.m4 2008-04-13 13:59:16.000000000 +0200 @@ -1,5 +1,5 @@ -# mbstate_t.m4 serial 9 -dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +# mbstate_t.m4 serial 10 +dnl Copyright (C) 2000-2002, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -16,9 +16,9 @@ [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT -# include <wchar.h>], - [mbstate_t x; return sizeof x;])], + [AC_INCLUDES_DEFAULT[ +# include <wchar.h>]], + [[mbstate_t x; return sizeof x;]])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) if test $ac_cv_type_mbstate_t = yes; then --- m4/memmem.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/memmem.m4 2008-04-13 13:59:34.000000000 +0200 @@ -1,4 +1,4 @@ -# memmem.m4 serial 9 +# memmem.m4 serial 10 dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,11 +26,11 @@ if test $ac_cv_have_decl_memmem = yes; then AC_CACHE_CHECK([whether memmem works in linear time], [gl_cv_func_memmem_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([ + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> /* for memmem */ #include <stdlib.h> /* for malloc */ #include <unistd.h> /* for alarm */ -], [[size_t m = 1000000; +]], [[size_t m = 1000000; char *haystack = (char *) malloc (2 * m + 1); char *needle = (char *) malloc (m + 1); void *result = 0; --- m4/netinet_in_h.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/netinet_in_h.m4 2008-04-13 14:00:01.000000000 +0200 @@ -1,5 +1,5 @@ -# netinet_in_h.m4 serial 3 -dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +# netinet_in_h.m4 serial 4 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,7 +9,7 @@ AC_CACHE_CHECK([whether <netinet/in.h> is self-contained], [gl_cv_header_netinet_in_h_selfcontained], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netinet/in.h>], [])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])], [gl_cv_header_netinet_in_h_selfcontained=yes], [gl_cv_header_netinet_in_h_selfcontained=no]) ]) --- m4/physmem.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/physmem.m4 2008-04-13 14:00:46.000000000 +0200 @@ -1,5 +1,5 @@ -# physmem.m4 serial 7 -dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# physmem.m4 serial 8 +dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,8 +12,8 @@ [AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include <sys/systemcfg.h> ]], - [double x = _system_configuration.physmem; - if (x > 0.0) return 0;])], + [[double x = _system_configuration.physmem; + if (x > 0.0) return 0;]])], [gl_cv_var__system_configuration=yes], [gl_cv_var__system_configuration=no])]) --- m4/putenv.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/putenv.m4 2008-04-13 14:01:08.000000000 +0200 @@ -1,5 +1,5 @@ -# putenv.m4 serial 14 -dnl Copyright (C) 2002-2007 Free Software Foundation, Inc. +# putenv.m4 serial 15 +dnl Copyright (C) 2002-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_CACHE_CHECK([for putenv compatible with GNU and SVID], [gl_cv_func_svid_putenv], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[ + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ /* Put it in env. */ if (putenv ("CONFTEST_putenv=val")) return 1; @@ -28,7 +28,7 @@ return 1; return 0; - ])], + ]])], gl_cv_func_svid_putenv=yes, gl_cv_func_svid_putenv=no, dnl When crosscompiling, assume putenv is broken. --- m4/regex.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/regex.m4 2008-04-13 14:00:22.000000000 +0200 @@ -1,4 +1,4 @@ -#serial 50 +#serial 51 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. @@ -37,13 +37,13 @@ [gl_cv_func_re_compile_pattern_working], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT + [AC_INCLUDES_DEFAULT[ #if HAVE_LOCALE_H #include <locale.h> #endif #include <limits.h> #include <regex.h> - ], + ]], [[static struct re_pattern_buffer regex; unsigned char folded_chars[UCHAR_MAX + 1]; int i; --- m4/stdint.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/stdint.m4 2008-04-13 14:02:03.000000000 +0200 @@ -1,4 +1,4 @@ -# stdint.m4 serial 30 +# stdint.m4 serial 31 dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -337,9 +337,9 @@ ui64)gltype1='unsigned __int64';; esac AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([$2 + [AC_LANG_PROGRAM([$2[ extern $gltype foo; - extern $gltype1 foo;])], + extern $gltype1 foo;]])], [eval gl_cv_type_${gltype}_suffix=\$glsuf]) eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break --- m4/stdio_h.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/stdio_h.m4 2008-04-13 14:02:33.000000000 +0200 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 9 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# stdio_h.m4 serial 10 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -70,8 +70,8 @@ [ AC_CACHE_CHECK([whether stdin defaults to large file offsets], [gl_cv_var_stdin_large_offset], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], -[#if defined __SL64 && defined __SCLE /* cygwin */ + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], +[[#if defined __SL64 && defined __SCLE /* cygwin */ /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and it is easier to do a version check than building a runtime test. */ @@ -79,7 +79,7 @@ # if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) choke me # endif -#endif])], +#endif]])], [gl_cv_var_stdin_large_offset=yes], [gl_cv_var_stdin_large_offset=no])]) ]) --- m4/strcasestr.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/strcasestr.m4 2008-04-13 14:02:47.000000000 +0200 @@ -1,4 +1,4 @@ -# strcasestr.m4 serial 8 +# strcasestr.m4 serial 9 dnl Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -25,11 +25,11 @@ if test $ac_cv_func_strcasestr = yes; then AC_CACHE_CHECK([whether strcasestr works in linear time], [gl_cv_func_strcasestr_linear], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([ + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> /* for memmem */ #include <stdlib.h> /* for malloc */ #include <unistd.h> /* for alarm */ -], [[size_t m = 1000000; +]], [[size_t m = 1000000; char *haystack = (char *) malloc (2 * m + 2); char *needle = (char *) malloc (m + 2); void *result = 0; --- m4/strerror.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/strerror.m4 2008-04-13 14:03:21.000000000 +0200 @@ -1,5 +1,5 @@ -# strerror.m4 serial 7 -dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. +# strerror.m4 serial 8 +dnl Copyright (C) 2002, 2007-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,17 +22,17 @@ [gl_cv_func_working_strerror], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( - [#include <string.h> - ], - [return !*strerror (-2);])], + [[#include <string.h> + ]], + [[return !*strerror (-2);]])], [gl_cv_func_working_strerror=yes], [gl_cv_func_working_strerror=no], [dnl Assume crossbuild works if it compiles. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [#include <string.h> - ], - [return !*strerror (-2);])], + [[#include <string.h> + ]], + [[return !*strerror (-2);]])], [gl_cv_func_working_strerror=yes], [gl_cv_func_working_strerror=no])])]) if test $gl_cv_func_working_strerror = no ; then --- m4/strndup.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/strndup.m4 2008-04-13 14:03:38.000000000 +0200 @@ -1,5 +1,5 @@ -# strndup.m4 serial 14 -dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. +# strndup.m4 serial 15 +dnl Copyright (C) 2002-2003, 2005-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -18,8 +18,8 @@ # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup, [AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include <string.h> - #include <stdlib.h>], [[ + AC_LANG_PROGRAM([[#include <string.h> + #include <stdlib.h>]], [[ #ifndef HAVE_DECL_STRNDUP extern char *strndup (const char *, size_t); #endif --- m4/strstr.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/strstr.m4 2008-04-13 14:04:53.000000000 +0200 @@ -1,4 +1,4 @@ -# strstr.m4 serial 1 +# strstr.m4 serial 2 dnl Copyright (C) 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,11 +10,11 @@ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) AC_CACHE_CHECK([whether strstr works in linear time], [gl_cv_func_strstr_linear], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([ + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <string.h> /* for memmem */ #include <stdlib.h> /* for malloc */ #include <unistd.h> /* for alarm */ -], [[size_t m = 1000000; +]], [[size_t m = 1000000; char *haystack = (char *) malloc (2 * m + 2); char *needle = (char *) malloc (m + 2); void *result = 0; --- m4/sys_select_h.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/sys_select_h.m4 2008-04-13 14:03:59.000000000 +0200 @@ -1,5 +1,5 @@ -# sys_select_h.m4 serial 3 -dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +# sys_select_h.m4 serial 4 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,7 +9,7 @@ AC_CACHE_CHECK([whether <sys/select.h> is self-contained], [gl_cv_header_sys_select_h_selfcontained], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/select.h>], [])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]], [[]])], [gl_cv_header_sys_select_h_selfcontained=yes], [gl_cv_header_sys_select_h_selfcontained=no]) ]) --- m4/sys_socket_h.m4.orig 2008-04-13 14:08:47.000000000 +0200 +++ m4/sys_socket_h.m4 2008-04-13 14:04:23.000000000 +0200 @@ -1,5 +1,5 @@ -# sys_socket_h.m4 serial 4 -dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +# sys_socket_h.m4 serial 5 +dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +11,7 @@ AC_CACHE_CHECK([whether <sys/socket.h> is self-contained], [gl_cv_header_sys_socket_h_selfcontained], [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>], [])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])], [gl_cv_header_sys_socket_h_selfcontained=yes], [gl_cv_header_sys_socket_h_selfcontained=no]) ])