[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: avoiding obsolete macros like AC_TRY_RUN
From: |
Ralf Wildenhues |
Subject: |
Re: avoiding obsolete macros like AC_TRY_RUN |
Date: |
Fri, 4 Sep 2009 20:50:11 +0200 |
User-agent: |
Mutt/1.5.20 (2009-08-09) |
Hello All, esp. Ben, Paolo, Paul, Sergey, Simon,
the patch below removes obsolete macros from modules not maintained by
Bruno or Jim.
Special here is check-math-lib.m4:gl_CHECK_MATH_LIB which uses macro
arguments. Is this a public macro? All in-tree users do not mind the
change from double-quoted to single-quoted, but out-of-tree macros uses
may not.
Tested as before by ensuring 'gnulib-tool --with-tests --test' has only
whitespace and comment changes.
Here is the list of files and owners, in alphabetical order:
All are responsible for
m4/getcwd.m4
m4/gethostname.m4
m4/getopt.m4
m4/tsearch.m4
m4/wctype.m4
Ben Pfaff for
m4/check-math-lib.m4
m4/isfinite.m4
m4/round.m4
m4/roundf.m4
Paolo Bonzini for
m4/poll.m4
Paul Eggert for
m4/c-stack.m4
m4/getdate.m4
m4/time_r.m4
m4/vararrays.m4
Sergey Poznyakoff for
m4/argp.m4
Simon Josefsson for
m4/gc-camellia.m4
m4/getaddrinfo.m4
m4/getline.m4
m4/readline.m4
m4/select.m4
m4/sockets.m4
m4/socklen.m4
m4/sockpfaf.m4
m4/sysexits.m4
OK to commit?
Thanks,
Ralf
Remove obsolete macros from modules not maintained by Bruno or Jim.
* m4/argp.m4 (gl_ARGP): Replace obsolete Autoconf macros with
their modern counterparts.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Likewise.
* m4/check-math-lib.m4 (gl_CHECK_MATH_LIB): Likewise.
* m4/gc-camellia.m4 (gl_GC_CAMELLIA): Likewise.
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Likewise.
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
* m4/getdate.m4 (gl_C_COMPOUND_LITERALS): Likewise.
* m4/gethostname.m4 (gl_FUNC_GETHOSTNAME): Likewise.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise.
* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise.
* m4/poll.m4 (gl_FUNC_POLL): Likewise.
* m4/readline.m4 (gl_FUNC_READLINE): Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise.
* m4/select.m4 (gl_FUNC_SELECT): Likewise.
* m4/sockets.m4 (gl_SOCKETS): Likewise.
* m4/socklen.m4 (gl_TYPE_SOCKLEN_T): Likewise.
* m4/sockpfaf.m4 (gl_SOCKET_FAMILIES): Likewise.
* m4/sysexits.m4 (gl_SYSEXITS): Likewise.
* m4/time_r.m4 (gl_TIME_R): Likewise.
* m4/tsearch.m4 (gl_FUNC_TSEARCH): Likewise.
* m4/vararrays.m4 (AC_C_VARARRAYS): Likewise.
* m4/wctype.m4 (gl_WCTYPE_H): Likewise.
diff --git a/m4/argp.m4 b/m4/argp.m4
index b2a6940..99b52ce 100644
--- a/m4/argp.m4
+++ b/m4/argp.m4
@@ -1,4 +1,4 @@
-# argp.m4 serial 10
+# argp.m4 serial 11
dnl Copyright (C) 2003-2007, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -32,20 +32,20 @@ AC_DEFUN([gl_ARGP],
# be defined and other not, I prefer to stay on the safe side and to
# test each one separately.
AC_MSG_CHECKING([whether program_invocation_name is defined])
- AC_TRY_LINK([#include <argp.h>],
- [ program_invocation_name = "test"; ],
- [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
- [Define if program_invocation_name is defined])
- AC_MSG_RESULT([yes])],
- [ AC_MSG_RESULT([no])] )
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <argp.h>]],
+ [[ program_invocation_name = "test"; ]])],
+ [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
+ [Define if program_invocation_name is defined])
+ AC_MSG_RESULT([yes])],
+ [ AC_MSG_RESULT([no])] )
AC_MSG_CHECKING([whether program_invocation_short_name is defined])
- AC_TRY_LINK([#include <argp.h>],
- [ program_invocation_short_name = "test"; ],
- [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
- [Define if program_invocation_short_name is defined])
- AC_MSG_RESULT([yes])],
- [ AC_MSG_RESULT([no])] )
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <argp.h>]],
+ [[ program_invocation_short_name = "test";
]])],
+ [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
+ [Define if program_invocation_short_name is defined])
+ AC_MSG_RESULT([yes])],
+ [ AC_MSG_RESULT([no])] )
AC_CHECK_DECLS_ONCE([clearerr_unlocked])
AC_CHECK_DECLS_ONCE([feof_unlocked])
diff --git a/m4/c-stack.m4 b/m4/c-stack.m4
index 0963cc5..2a89696 100644
--- a/m4/c-stack.m4
+++ b/m4/c-stack.m4
@@ -7,7 +7,7 @@
# Written by Paul Eggert.
-# serial 9
+# serial 10
AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
[# for STACK_DIRECTION
@@ -36,86 +36,86 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
AC_CACHE_CHECK([for working C stack overflow detection],
[ac_cv_sys_stack_overflow_works],
- [AC_TRY_RUN(
- [
- #include <unistd.h>
- #include <signal.h>
- #if HAVE_SETRLIMIT
- # include <sys/types.h>
- # include <sys/time.h>
- # include <sys/resource.h>
- #endif
- #ifndef SIGSTKSZ
- # define SIGSTKSZ 16384
- #endif
-
- static union
- {
- char buffer[2 * SIGSTKSZ];
- long double ld;
- long u;
- void *p;
- } alternate_signal_stack;
-
- static void
- segv_handler (int signo)
- {
- _exit (0);
- }
-
- static int
- c_stack_action ()
- {
- stack_t st;
- struct sigaction act;
- int r;
-
- st.ss_flags = 0;
- /* Use the midpoint to avoid Irix sigaltstack bug. */
- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
- st.ss_size = SIGSTKSZ;
- r = sigaltstack (&st, 0);
- if (r != 0)
- return r;
-
- sigemptyset (&act.sa_mask);
- act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
- act.sa_handler = segv_handler;
- #if FAULT_YIELDS_SIGBUS
- if (sigaction (SIGBUS, &act, 0) < 0)
- return -1;
- #endif
- return sigaction (SIGSEGV, &act, 0);
- }
- static volatile int *
- recurse_1 (volatile int n, volatile int *p)
- {
- if (n >= 0)
- *recurse_1 (n + 1, p) += n;
- return p;
- }
- static int
- recurse (volatile int n)
- {
- int sum = 0;
- return *recurse_1 (n, &sum);
- }
- int
- main ()
- {
- #if HAVE_SETRLIMIT && defined RLIMIT_STACK
- /* Before starting the endless recursion, try to be friendly
- to the user's machine. On some Linux 2.2.x systems, there
- is no stack limit for user processes at all. We don't want
- to kill such systems. */
- struct rlimit rl;
- rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
- setrlimit (RLIMIT_STACK, &rl);
- #endif
-
- return c_stack_action () || recurse (0);
- }
- ],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE(
+ [[
+ #include <unistd.h>
+ #include <signal.h>
+ #if HAVE_SETRLIMIT
+ # include <sys/types.h>
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
+ #ifndef SIGSTKSZ
+ # define SIGSTKSZ 16384
+ #endif
+
+ static union
+ {
+ char buffer[2 * SIGSTKSZ];
+ long double ld;
+ long u;
+ void *p;
+ } alternate_signal_stack;
+
+ static void
+ segv_handler (int signo)
+ {
+ _exit (0);
+ }
+
+ static int
+ c_stack_action ()
+ {
+ stack_t st;
+ struct sigaction act;
+ int r;
+
+ st.ss_flags = 0;
+ /* Use the midpoint to avoid Irix sigaltstack bug. */
+ st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
+ st.ss_size = SIGSTKSZ;
+ r = sigaltstack (&st, 0);
+ if (r != 0)
+ return r;
+
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
+ act.sa_handler = segv_handler;
+ #if FAULT_YIELDS_SIGBUS
+ if (sigaction (SIGBUS, &act, 0) < 0)
+ return -1;
+ #endif
+ return sigaction (SIGSEGV, &act, 0);
+ }
+ static volatile int *
+ recurse_1 (volatile int n, volatile int *p)
+ {
+ if (n >= 0)
+ *recurse_1 (n + 1, p) += n;
+ return p;
+ }
+ static int
+ recurse (volatile int n)
+ {
+ int sum = 0;
+ return *recurse_1 (n, &sum);
+ }
+ int
+ main ()
+ {
+ #if HAVE_SETRLIMIT && defined RLIMIT_STACK
+ /* Before starting the endless recursion, try to be friendly
+ to the user's machine. On some Linux 2.2.x systems, there
+ is no stack limit for user processes at all. We don't want
+ to kill such systems. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+ setrlimit (RLIMIT_STACK, &rl);
+ #endif
+
+ return c_stack_action () || recurse (0);
+ }
+ ]])],
[ac_cv_sys_stack_overflow_works=yes],
[ac_cv_sys_stack_overflow_works=no],
[ac_cv_sys_stack_overflow_works=cross-compiling])])
@@ -190,118 +190,118 @@ int main ()
AC_CACHE_CHECK([for precise C stack overflow detection],
ac_cv_sys_xsi_stack_overflow_heuristic,
- [AC_TRY_RUN(
- [
- #include <unistd.h>
- #include <signal.h>
- #if HAVE_UCONTEXT_H
- # include <ucontext.h>
- #endif
- #if HAVE_SETRLIMIT
- # include <sys/types.h>
- # include <sys/time.h>
- # include <sys/resource.h>
- #endif
- #ifndef SIGSTKSZ
- # define SIGSTKSZ 16384
- #endif
-
- static union
- {
- char buffer[2 * SIGSTKSZ];
- long double ld;
- long u;
- void *p;
- } alternate_signal_stack;
-
- #if STACK_DIRECTION
- # define find_stack_direction(ptr) STACK_DIRECTION
- #else
- static int
- find_stack_direction (char const *addr)
- {
- char dummy;
- return (! addr ? find_stack_direction (&dummy)
- : addr < &dummy ? 1 : -1);
- }
- #endif
-
- static void
- segv_handler (int signo, siginfo_t *info, void *context)
- {
- if (0 < info->si_code)
- {
- /* For XSI heuristics to work, we need uc_stack to describe
- the interrupted stack (as on Solaris), and not the
- currently executing stack (as on Linux). */
- ucontext_t const *user_context = context;
- char const *stack_min = user_context->uc_stack.ss_sp;
- size_t stack_size = user_context->uc_stack.ss_size;
- char const *faulting_address = info->si_addr;
- size_t s = faulting_address - stack_min;
- size_t page_size = sysconf (_SC_PAGESIZE);
- if (find_stack_direction (0) < 0)
- s += page_size;
- if (s < stack_size + page_size)
- _exit (0);
- }
-
- _exit (1);
- }
-
- static int
- c_stack_action ()
- {
- stack_t st;
- struct sigaction act;
- int r;
-
- st.ss_flags = 0;
- /* Use the midpoint to avoid Irix sigaltstack bug. */
- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
- st.ss_size = SIGSTKSZ;
- r = sigaltstack (&st, 0);
- if (r != 0)
- return r;
-
- sigemptyset (&act.sa_mask);
- act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
- act.sa_sigaction = segv_handler;
- #if FAULT_YIELDS_SIGBUS
- if (sigaction (SIGBUS, &act, 0) < 0)
- return -1;
- #endif
- return sigaction (SIGSEGV, &act, 0);
- }
- static volatile int *
- recurse_1 (volatile int n, volatile int *p)
- {
- if (n >= 0)
- *recurse_1 (n + 1, p) += n;
- return p;
- }
- static int
- recurse (volatile int n)
- {
- int sum = 0;
- return *recurse_1 (n, &sum);
- }
- int
- main ()
- {
- #if HAVE_SETRLIMIT && defined RLIMIT_STACK
- /* Before starting the endless recursion, try to be friendly
- to the user's machine. On some Linux 2.2.x systems, there
- is no stack limit for user processes at all. We don't want
- to kill such systems. */
- struct rlimit rl;
- rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
- setrlimit (RLIMIT_STACK, &rl);
- #endif
-
- return c_stack_action () || recurse (0);
- }
- ],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE(
+ [[
+ #include <unistd.h>
+ #include <signal.h>
+ #if HAVE_UCONTEXT_H
+ # include <ucontext.h>
+ #endif
+ #if HAVE_SETRLIMIT
+ # include <sys/types.h>
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
+ #ifndef SIGSTKSZ
+ # define SIGSTKSZ 16384
+ #endif
+
+ static union
+ {
+ char buffer[2 * SIGSTKSZ];
+ long double ld;
+ long u;
+ void *p;
+ } alternate_signal_stack;
+
+ #if STACK_DIRECTION
+ # define find_stack_direction(ptr) STACK_DIRECTION
+ #else
+ static int
+ find_stack_direction (char const *addr)
+ {
+ char dummy;
+ return (! addr ? find_stack_direction (&dummy)
+ : addr < &dummy ? 1 : -1);
+ }
+ #endif
+
+ static void
+ segv_handler (int signo, siginfo_t *info, void *context)
+ {
+ if (0 < info->si_code)
+ {
+ /* For XSI heuristics to work, we need uc_stack to describe
+ the interrupted stack (as on Solaris), and not the
+ currently executing stack (as on Linux). */
+ ucontext_t const *user_context = context;
+ char const *stack_min = user_context->uc_stack.ss_sp;
+ size_t stack_size = user_context->uc_stack.ss_size;
+ char const *faulting_address = info->si_addr;
+ size_t s = faulting_address - stack_min;
+ size_t page_size = sysconf (_SC_PAGESIZE);
+ if (find_stack_direction (0) < 0)
+ s += page_size;
+ if (s < stack_size + page_size)
+ _exit (0);
+ }
+
+ _exit (1);
+ }
+
+ static int
+ c_stack_action ()
+ {
+ stack_t st;
+ struct sigaction act;
+ int r;
+
+ st.ss_flags = 0;
+ /* Use the midpoint to avoid Irix sigaltstack bug. */
+ st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
+ st.ss_size = SIGSTKSZ;
+ r = sigaltstack (&st, 0);
+ if (r != 0)
+ return r;
+
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND |
SA_SIGINFO;
+ act.sa_sigaction = segv_handler;
+ #if FAULT_YIELDS_SIGBUS
+ if (sigaction (SIGBUS, &act, 0) < 0)
+ return -1;
+ #endif
+ return sigaction (SIGSEGV, &act, 0);
+ }
+ static volatile int *
+ recurse_1 (volatile int n, volatile int *p)
+ {
+ if (n >= 0)
+ *recurse_1 (n + 1, p) += n;
+ return p;
+ }
+ static int
+ recurse (volatile int n)
+ {
+ int sum = 0;
+ return *recurse_1 (n, &sum);
+ }
+ int
+ main ()
+ {
+ #if HAVE_SETRLIMIT && defined RLIMIT_STACK
+ /* Before starting the endless recursion, try to be friendly
+ to the user's machine. On some Linux 2.2.x systems, there
+ is no stack limit for user processes at all. We don't want
+ to kill such systems. */
+ struct rlimit rl;
+ rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+ setrlimit (RLIMIT_STACK, &rl);
+ #endif
+
+ return c_stack_action () || recurse (0);
+ }
+ ]])],
[ac_cv_sys_xsi_stack_overflow_heuristic=yes],
[ac_cv_sys_xsi_stack_overflow_heuristic=no],
[ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
diff --git a/m4/check-math-lib.m4 b/m4/check-math-lib.m4
index 313dace..5f43a07 100644
--- a/m4/check-math-lib.m4
+++ b/m4/check-math-lib.m4
@@ -1,4 +1,4 @@
-# check-math-lib.m4 serial 2
+# check-math-lib.m4 serial 3
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,13 +17,13 @@ AC_DEFUN([gl_CHECK_MATH_LIB], [
$1=missing
for libm in "" "-lm"; do
LIBS="$save_LIBS $libm"
- AC_TRY_LINK([
- #ifndef __NO_MATH_INLINES
- # define __NO_MATH_INLINES 1 /* for glibc */
- #endif
- #include <math.h>
- double x;],
- [$2],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ double x;]],
+ [$2])],
[$1=$libm
break])
done
diff --git a/m4/gc-camellia.m4 b/m4/gc-camellia.m4
index fce5787..613e42e 100644
--- a/m4/gc-camellia.m4
+++ b/m4/gc-camellia.m4
@@ -1,4 +1,4 @@
-# gc-camellia.m4 serial 2
+# gc-camellia.m4 serial 3
dnl Copyright (C) 2007, 2009 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,8 +9,8 @@ AC_DEFUN([gl_GC_CAMELLIA],
AC_REQUIRE([gl_GC])
if test "$ac_cv_libgcrypt" = yes; then
AC_CACHE_CHECK([for camellia in libgcrypt], [gl_cv_libgcrypt_camellia], [
- AC_TRY_COMPILE([#include <gcrypt.h>],
- [return gcry_cipher_open (NULL, GCRY_CIPHER_CAMELLIA128, 0, 0);],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gcrypt.h>]],
+ [[return gcry_cipher_open (NULL, GCRY_CIPHER_CAMELLIA128, 0, 0);]])],
[gl_cv_libgcrypt_camellia=yes],
[gl_cv_libgcrypt_camellia=no])])
if test "$gl_cv_libgcrypt_camellia" = yes; then
diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4
index 4088671..3dfc17d 100644
--- a/m4/getaddrinfo.m4
+++ b/m4/getaddrinfo.m4
@@ -1,4 +1,4 @@
-# getaddrinfo.m4 serial 20
+# getaddrinfo.m4 serial 21
dnl Copyright (C) 2004-2009 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,7 +25,7 @@ AC_DEFUN([gl_GETADDRINFO],
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -34,7 +34,7 @@ AC_DEFUN([gl_GETADDRINFO],
#include <netdb.h>
#endif
#include <stddef.h>
-], [getaddrinfo("", "", NULL, NULL);],
+]], [[getaddrinfo("", "", NULL, NULL);]])],
[gl_cv_func_getaddrinfo=yes],
[gl_cv_func_getaddrinfo=no])])
if test $gl_cv_func_getaddrinfo = no; then
@@ -43,12 +43,12 @@ AC_DEFUN([gl_GETADDRINFO],
gl_cv_w32_getaddrinfo=no
am_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#include <stddef.h>
-], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes)
+]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes])
LIBS="$am_save_LIBS"
])
if test "$gl_cv_w32_getaddrinfo" = "yes"; then
@@ -64,7 +64,7 @@ AC_DEFUN([gl_GETADDRINFO],
# header included somehow.
AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)],
gl_cv_func_gai_strerror, [
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -76,7 +76,7 @@ AC_DEFUN([gl_GETADDRINFO],
#include <ws2tcpip.h>
#endif
#include <stddef.h>
-], [gai_strerror (NULL);],
+]], [[gai_strerror (NULL);]])],
[gl_cv_func_gai_strerror=yes],
[gl_cv_func_gai_strerror=no])])
if test $gl_cv_func_gai_strerror = no; then
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
index 6ebe2fc..bdbb096 100644
--- a/m4/getcwd.m4
+++ b/m4/getcwd.m4
@@ -1,6 +1,7 @@
# getcwd.m4 - check for working getcwd that is compatible with glibc
-# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
Inc.
+# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2009 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.
@@ -11,24 +12,23 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
[gl_cv_func_getcwd_null],
- [AC_TRY_RUN(
- [
-# include <stdlib.h>
-# include <unistd.h>
-# ifndef getcwd
- char *getcwd ();
-# endif
- int
- main ()
- {
- if (chdir ("/") != 0)
- exit (1);
- else
- {
- char *f = getcwd (NULL, 0);
- exit (! (f && f[0] == '/' && !f[1]));
- }
- }],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+# include <stdlib.h>
+# include <unistd.h>
+# ifndef getcwd
+ char *getcwd ();
+# endif
+ int
+ main ()
+ {
+ if (chdir ("/") != 0)
+ exit (1);
+ else
+ {
+ char *f = getcwd (NULL, 0);
+ exit (! (f && f[0] == '/' && !f[1]));
+ }
+ }]])],
[gl_cv_func_getcwd_null=yes],
[gl_cv_func_getcwd_null=no],
[gl_cv_func_getcwd_null=no])])
diff --git a/m4/getdate.m4 b/m4/getdate.m4
index 67f9c65..a70cba8 100644
--- a/m4/getdate.m4
+++ b/m4/getdate.m4
@@ -1,4 +1,4 @@
-# getdate.m4 serial 14
+# getdate.m4 serial 15
dnl Copyright (C) 2002-2006, 2008, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,9 +13,9 @@ dnl static variables (even though gcc supports this in
pre-C99 mode).
AC_DEFUN([gl_C_COMPOUND_LITERALS],
[
AC_CACHE_CHECK([for compound literals], [gl_cv_compound_literals],
- [AC_TRY_COMPILE([struct s { int i, j; };],
- [struct s t = (struct s) { 3, 4 };
- if (t.i != 0) return 0;],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct s { int i, j; };]],
+ [[struct s t = (struct s) { 3, 4 };
+ if (t.i != 0) return 0;]])],
gl_cv_compound_literals=yes,
gl_cv_compound_literals=no)])
if test $gl_cv_compound_literals = yes; then
diff --git a/m4/gethostname.m4 b/m4/gethostname.m4
index e32f7e5..02ce846 100644
--- a/m4/gethostname.m4
+++ b/m4/gethostname.m4
@@ -1,4 +1,4 @@
-# gethostname.m4 serial 8
+# gethostname.m4 serial 9
dnl Copyright (C) 2002, 2008, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -22,12 +22,12 @@ AC_DEFUN([gl_FUNC_GETHOSTNAME],
[gl_cv_w32_gethostname=no
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#include <stddef.h>
-], [gethostname(NULL, 0);], [gl_cv_w32_gethostname=yes])
+]], [[gethostname(NULL, 0);]])], [gl_cv_w32_gethostname=yes])
LIBS="$gl_save_LIBS"
])
if test "$gl_cv_w32_gethostname" = "yes"; then
diff --git a/m4/getline.m4 b/m4/getline.m4
index 9993345..4897bc3 100644
--- a/m4/getline.m4
+++ b/m4/getline.m4
@@ -1,4 +1,4 @@
-# getline.m4 serial 19
+# getline.m4 serial 20
dnl Copyright (C) 1998-2003, 2005-2007, 2009 Free Software Foundation, Inc.
dnl
@@ -29,7 +29,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
if test $gl_getline_needs_run_time_check = yes; then
AC_CACHE_CHECK([for working getline function],
[am_cv_func_working_getline],
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -44,8 +44,8 @@ AC_DEFUN([gl_FUNC_GETLINE],
len = getline (&line, &siz, in);
exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
}
- ], am_cv_func_working_getline=yes dnl The library version works.
- , am_cv_func_working_getline=no dnl The library version does NOT work.
+ ]])], [am_cv_func_working_getline=yes] dnl The library version works.
+ , [am_cv_func_working_getline=no] dnl The library version does NOT work.
, dnl We're cross compiling. Assume it works on glibc2 systems.
[AC_EGREP_CPP([Lucky GNU user],
[
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 346afb6..7443dfe 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 21
+# getopt.m4 serial 22
dnl Copyright (C) 2002-2006, 2008-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -82,7 +82,7 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
[gl_cv_func_getopt_posix],
[
dnl This test fails on mingw and succeeds on all other platforms.
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
@@ -158,7 +158,7 @@ main ()
return 0;
}
-],
+]])],
[gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
[case "$host_os" in
mingw*) gl_cv_func_getopt_posix="guessing no";;
diff --git a/m4/isfinite.m4 b/m4/isfinite.m4
index 019eb95..5f6119d 100644
--- a/m4/isfinite.m4
+++ b/m4/isfinite.m4
@@ -1,4 +1,4 @@
-# isfinite.m4 serial 5
+# isfinite.m4 serial 6
dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -48,7 +48,7 @@ AC_DEFUN([gl_ISFINITEL_WORKS],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether isfinite(long double) works],
[gl_cv_func_isfinitel_works],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <float.h>
#include <limits.h>
#include <math.h>
@@ -149,7 +149,7 @@ int main ()
#endif
return 0;
-}], [gl_cv_func_isfinitel_works=yes], [gl_cv_func_isfinitel_works=no],
+}]])], [gl_cv_func_isfinitel_works=yes], [gl_cv_func_isfinitel_works=no],
[case "$host_cpu" in
# Guess no on ia64, x86_64, i386.
ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";;
diff --git a/m4/poll.m4 b/m4/poll.m4
index a16e376..c427b09 100644
--- a/m4/poll.m4
+++ b/m4/poll.m4
@@ -1,4 +1,4 @@
-# poll.m4 serial 8
+# poll.m4 serial 9
dnl Copyright (c) 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_POLL],
AC_CHECK_FUNC([poll],
[# Check whether poll() works on special files (like /dev/null) and
# and ttys (like /dev/tty). On MacOS X 10.4.0 and AIX 5.3, it doesn't.
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
#include <poll.h>
int main()
@@ -39,7 +39,7 @@ AC_DEFUN([gl_FUNC_POLL],
return 1;
/* Trying /dev/tty may be too environment dependent. */
return 0;
- }],
+ }]])],
[gl_cv_func_poll=yes],
[gl_cv_func_poll=no],
[# When cross-compiling, assume that poll() works everywhere except on
diff --git a/m4/readline.m4 b/m4/readline.m4
index 60b0aa8..eb44b0a 100644
--- a/m4/readline.m4
+++ b/m4/readline.m4
@@ -1,4 +1,4 @@
-# readline.m4 serial 6
+# readline.m4 serial 7
dnl Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_READLINE],
dnl Add $INCREADLINE to CPPFLAGS before performing the following checks,
dnl because if the user has installed libreadline and not disabled its use
- dnl via --without-libreadline-prefix, he wants to use it. The AC_TRY_LINK
+ dnl via --without-libreadline-prefix, he wants to use it. The AC_LINK_IFELSE
dnl will then succeed.
am_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCREADLINE])
@@ -37,9 +37,9 @@ AC_DEFUN([gl_FUNC_READLINE],
if test -n "$extra_lib"; then
LIBS="$LIBS -l$extra_lib"
fi
- AC_TRY_LINK([#include <stdio.h>
-#include <readline/readline.h>],
- [readline((char*)0);],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+#include <readline/readline.h>]],
+ [[readline((char*)0);]])],
[gl_cv_lib_readline=" -l$extra_lib"])
if test "$gl_cv_lib_readline" != no; then
break
diff --git a/m4/round.m4 b/m4/round.m4
index a887127..a49719e 100644
--- a/m4/round.m4
+++ b/m4/round.m4
@@ -1,5 +1,5 @@
-# round.m4 serial 5
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# round.m4 serial 6
+dnl Copyright (C) 2007, 2009 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,7 +22,7 @@ AC_DEFUN([gl_FUNC_ROUND],
[
save_LIBS="$LIBS"
LIBS="$LIBS $ROUND_LIBM"
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <float.h>
#include <math.h>
int main()
@@ -39,7 +39,7 @@ int main()
* (double) (1U << ((DBL_MANT_DIG + 4) / 5));
volatile double x = 0.5 - 0.5 / TWO_MANT_DIG;
exit (x < 0.5 && round (x) != 0.0);
-}], [gl_cv_func_round_works=yes], [gl_cv_func_round_works=no],
+}]])], [gl_cv_func_round_works=yes], [gl_cv_func_round_works=no],
[case "$host_os" in
netbsd*) gl_cv_func_round_works="guessing no";;
*) gl_cv_func_round_works="guessing yes";;
diff --git a/m4/roundf.m4 b/m4/roundf.m4
index ac6bb64..d11b8ef 100644
--- a/m4/roundf.m4
+++ b/m4/roundf.m4
@@ -1,4 +1,4 @@
-# roundf.m4 serial 6
+# roundf.m4 serial 7
dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_ROUNDF],
[
save_LIBS="$LIBS"
LIBS="$LIBS $ROUNDF_LIBM"
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <float.h>
#include <math.h>
int main()
@@ -36,7 +36,7 @@ int main()
* (float) (1U << ((FLT_MANT_DIG + 2) / 3));
volatile float x = 0.5f - 0.5f / TWO_MANT_DIG;
exit (x < 0.5f && roundf (x) != 0.0f);
-}], [gl_cv_func_roundf_works=yes], [gl_cv_func_roundf_works=no],
+}]])], [gl_cv_func_roundf_works=yes], [gl_cv_func_roundf_works=no],
[case "$host_os" in
mingw*) gl_cv_func_roundf_works="guessing no";;
*) gl_cv_func_roundf_works="guessing yes";;
diff --git a/m4/select.m4 b/m4/select.m4
index 5397df0..53cc059 100644
--- a/m4/select.m4
+++ b/m4/select.m4
@@ -1,4 +1,4 @@
-# select.m4 serial 1
+# select.m4 serial 2
dnl Copyright (C) 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_SELECT],
AC_CACHE_CHECK([whether select supports a 0 argument],
[gl_cv_func_select_supports0],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/time.h>
#if HAVE_SYS_SELECT_H
@@ -29,7 +29,7 @@ int main ()
timeout.tv_sec = 0;
timeout.tv_usec = 5;
return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
-}], [gl_cv_func_select_supports0=yes], [gl_cv_func_select_supports0=no],
+}]])], [gl_cv_func_select_supports0=yes], [gl_cv_func_select_supports0=no],
[
changequote(,)dnl
case "$host_os" in
diff --git a/m4/sockets.m4 b/m4/sockets.m4
index db71bf1..3edc010 100644
--- a/m4/sockets.m4
+++ b/m4/sockets.m4
@@ -1,4 +1,4 @@
-# sockets.m4 serial 5
+# sockets.m4 serial 6
dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -16,14 +16,14 @@ AC_DEFUN([gl_SOCKETS],
[gl_cv_func_wsastartup], [
gl_save_LIBS="$LIBS"
LIBS="$LIBS -lws2_32"
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
-#endif], [
- WORD wVersionRequested = MAKEWORD(1, 1);
- WSADATA wsaData;
- int err = WSAStartup(wVersionRequested, &wsaData);
- WSACleanup ();],
+#endif]], [[
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ int err = WSAStartup(wVersionRequested, &wsaData);
+ WSACleanup ();]])],
gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no)
LIBS="$gl_save_LIBS"
])
@@ -38,35 +38,35 @@ AC_DEFUN([gl_SOCKETS],
dnl BeOS has most socket functions in libnet.
AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
gl_cv_lib_socket=
- AC_TRY_LINK([extern
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
#ifdef __cplusplus
"C"
#endif
-char setsockopt();], [setsockopt();],
+char setsockopt();]], [[setsockopt();]])],
[],
[gl_save_LIBS="$LIBS"
LIBS="$gl_save_LIBS -lsocket"
- AC_TRY_LINK([extern
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
#ifdef __cplusplus
"C"
#endif
-char setsockopt();], [setsockopt();],
+char setsockopt();]], [[setsockopt();]])],
[gl_cv_lib_socket="-lsocket"])
if test -z "$gl_cv_lib_socket"; then
LIBS="$gl_save_LIBS -lnetwork"
- AC_TRY_LINK([extern
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
#ifdef __cplusplus
"C"
#endif
-char setsockopt();], [setsockopt();],
+char setsockopt();]], [[setsockopt();]])],
[gl_cv_lib_socket="-lnetwork"])
if test -z "$gl_cv_lib_socket"; then
LIBS="$gl_save_LIBS -lnet"
- AC_TRY_LINK([extern
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
#ifdef __cplusplus
"C"
#endif
-char setsockopt();], [setsockopt();],
+char setsockopt();]], [[setsockopt();]])],
[gl_cv_lib_socket="-lnet"])
fi
fi
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index b755757..80ed513 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,5 +1,5 @@
-# socklen.m4 serial 6
-dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+# socklen.m4 serial 7
+dnl Copyright (C) 2005, 2006, 2007, 2009 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.
@@ -25,13 +25,13 @@ AC_DEFUN([gl_TYPE_SOCKLEN_T],
gl_cv_socklen_t_equiv=
for arg2 in "struct sockaddr" void; do
for t in int size_t "unsigned int" "long int" "unsigned long int"; do
- AC_TRY_COMPILE(
- [#include <sys/types.h>
- #include <sys/socket.h>
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/socket.h>
- int getpeername (int, $arg2 *, $t *);],
- [$t len;
- getpeername (0, 0, &len);],
+ int getpeername (int, $arg2 *, $t *);]],
+ [[$t len;
+ getpeername (0, 0, &len);]])],
[gl_cv_socklen_t_equiv="$t"])
test "$gl_cv_socklen_t_equiv" != "" && break
done
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
index 99ea06f..bbdfabc 100644
--- a/m4/sockpfaf.m4
+++ b/m4/sockpfaf.m4
@@ -1,4 +1,4 @@
-# sockpfaf.m4 serial 6
+# sockpfaf.m4 serial 7
dnl Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
AC_MSG_CHECKING([for IPv4 sockets])
AC_CACHE_VAL([gl_cv_socket_ipv4],
- [AC_TRY_COMPILE([#include <sys/types.h>
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -27,9 +27,9 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
-#endif],
-[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
- if (&x && &y && &z) return 0;],
+#endif]],
+[[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;]])],
gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
AC_MSG_RESULT([$gl_cv_socket_ipv4])
if test $gl_cv_socket_ipv4 = yes; then
@@ -38,7 +38,7 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
AC_MSG_CHECKING([for IPv6 sockets])
AC_CACHE_VAL([gl_cv_socket_ipv6],
- [AC_TRY_COMPILE([#include <sys/types.h>
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -47,9 +47,9 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
-#endif],
-[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
- if (&x && &y && &z) return 0;],
+#endif]],
+[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;]])],
gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
AC_MSG_RESULT([$gl_cv_socket_ipv6])
if test $gl_cv_socket_ipv6 = yes; then
diff --git a/m4/sysexits.m4 b/m4/sysexits.m4
index bbd6973..b6d2e08 100644
--- a/m4/sysexits.m4
+++ b/m4/sysexits.m4
@@ -1,5 +1,5 @@
-# sysexits.m4 serial 4
-dnl Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc.
+# sysexits.m4 serial 5
+dnl Copyright (C) 2003, 2005, 2007, 2009 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.
@@ -10,28 +10,28 @@ AC_DEFUN([gl_SYSEXITS],
if test $ac_cv_header_sysexits_h = yes; then
HAVE_SYSEXITS_H=1
gl_CHECK_NEXT_HEADERS([sysexits.h])
- AC_TRY_COMPILE([#include <sysexits.h>],
- [switch (0)
- {
- case EX_OK:
- case EX_USAGE:
- case EX_DATAERR:
- case EX_NOINPUT:
- case EX_NOUSER:
- case EX_NOHOST:
- case EX_UNAVAILABLE:
- case EX_SOFTWARE:
- case EX_OSERR:
- case EX_OSFILE:
- case EX_CANTCREAT:
- case EX_IOERR:
- case EX_TEMPFAIL:
- case EX_PROTOCOL:
- case EX_NOPERM:
- case EX_CONFIG:
- break;
- }
- ],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sysexits.h>]],
+ [[switch (0)
+ {
+ case EX_OK:
+ case EX_USAGE:
+ case EX_DATAERR:
+ case EX_NOINPUT:
+ case EX_NOUSER:
+ case EX_NOHOST:
+ case EX_UNAVAILABLE:
+ case EX_SOFTWARE:
+ case EX_OSERR:
+ case EX_OSFILE:
+ case EX_CANTCREAT:
+ case EX_IOERR:
+ case EX_TEMPFAIL:
+ case EX_PROTOCOL:
+ case EX_NOPERM:
+ case EX_CONFIG:
+ break;
+ }
+ ]])],
[SYSEXITS_H=],
[SYSEXITS_H=sysexits.h])
else
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index c871b56..de22db9 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -1,6 +1,6 @@
dnl Reentrant time functions like localtime_r.
-dnl Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006, 2007, 2008, 2009 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.
@@ -17,15 +17,15 @@ AC_DEFUN([gl_TIME_R],
AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
[gl_cv_time_r_posix],
- [AC_TRY_COMPILE(
- [#include <time.h>],
- [/* We don't need to append 'restrict's to the argument types,
- even though the POSIX signature has the 'restrict's,
- since C99 says they can't affect type compatibility. */
- struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
- if (ptr) return 0;
- /* Check the return type is a pointer. On HP-UX 10 it is 'int'. */
- *localtime_r (0, 0);],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <time.h>]],
+ [[/* We don't need to append 'restrict's to the argument types,
+ even though the POSIX signature has the 'restrict's,
+ since C99 says they can't affect type compatibility. */
+ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
+ if (ptr) return 0;
+ /* Check the return type is a pointer. On HP-UX 10 it is 'int'. */
+ *localtime_r (0, 0);]])],
[gl_cv_time_r_posix=yes],
[gl_cv_time_r_posix=no])])
if test $gl_cv_time_r_posix = yes; then
diff --git a/m4/tsearch.m4 b/m4/tsearch.m4
index 0281fb9..5f4da1b 100644
--- a/m4/tsearch.m4
+++ b/m4/tsearch.m4
@@ -1,5 +1,5 @@
-# tsearch.m4 serial 3
-dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
+# tsearch.m4 serial 4
+dnl Copyright (C) 2006-2009 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_DEFUN([gl_FUNC_TSEARCH],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether tdelete works], [gl_cv_func_tdelete_works],
[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stddef.h>
#include <search.h>
static int
@@ -32,7 +32,7 @@ main ()
if (!(tfind (&x, &root, cmp_fn) != NULL)) return 1;
if (!(tdelete (&x, &root, cmp_fn) != NULL)) return 1;
return 0;
-}], [gl_cv_func_tdelete_works=yes], [gl_cv_func_tdelete_works=no],
+}]])], [gl_cv_func_tdelete_works=yes], [gl_cv_func_tdelete_works=no],
[case "$host_os" in
openbsd*) gl_cv_func_tdelete_works="guessing no";;
*) gl_cv_func_tdelete_works="guessing yes";;
diff --git a/m4/vararrays.m4 b/m4/vararrays.m4
index 192b612..65fb4d9 100644
--- a/m4/vararrays.m4
+++ b/m4/vararrays.m4
@@ -1,6 +1,6 @@
# Check for variable-length arrays.
-# serial 3
+# serial 4
# From Paul Eggert
@@ -13,9 +13,9 @@ AC_DEFUN([AC_C_VARARRAYS],
[
AC_CACHE_CHECK([for variable-length arrays],
ac_cv_c_vararrays,
- [AC_TRY_COMPILE(
- [],
- [static int x; char a[++x]; a[sizeof a - 1] = 0; return a[0];],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [],
+ [[static int x; char a[++x]; a[sizeof a - 1] = 0; return a[0];]])],
ac_cv_c_vararrays=yes,
ac_cv_c_vararrays=no)])
if test $ac_cv_c_vararrays = yes; then
diff --git a/m4/wctype.m4 b/m4/wctype.m4
index 6a1b6f0..b9c4169 100644
--- a/m4/wctype.m4
+++ b/m4/wctype.m4
@@ -1,8 +1,8 @@
-# wctype.m4 serial 2
+# wctype.m4 serial 3
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2009 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.
@@ -37,17 +37,18 @@ AC_DEFUN([gl_WCTYPE_H],
dnl The other functions are likely broken in the same way.
AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
[
- AC_TRY_RUN([#include <stddef.h>
- #include <stdio.h>
- #include <time.h>
- #include <wchar.h>
- #include <wctype.h>
- int main () { return iswprint ('x') == 0; }],
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #include <wctype.h>
+ int main () { return iswprint ('x') == 0; }]])],
[gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
- [AC_TRY_COMPILE([#include <stdlib.h>
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#if __GNU_LIBRARY__ == 1
Linux libc5 i18n is broken.
- #endif], [],
+ #endif]], [])],
[gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
])
])
- avoiding obsolete macros like AC_TRY_RUN [Re: gnulib-izing sharutils, Jim Meyering, 2009/09/01
- Re: avoiding obsolete macros like AC_TRY_RUN, Ralf Wildenhues, 2009/09/02
- Re: avoiding obsolete macros like AC_TRY_RUN, Jim Meyering, 2009/09/02
- Re: avoiding obsolete macros like AC_TRY_RUN, Bruno Haible, 2009/09/02
- Re: avoiding obsolete macros like AC_TRY_RUN, Ralf Wildenhues, 2009/09/02
- Re: avoiding obsolete macros like AC_TRY_RUN,
Ralf Wildenhues <=
- Re: avoiding obsolete macros like AC_TRY_RUN, Jim Meyering, 2009/09/04
- Re: avoiding obsolete macros like AC_TRY_RUN, Ben Pfaff, 2009/09/04
- Re: avoiding obsolete macros like AC_TRY_RUN, Simon Josefsson, 2009/09/07
- Re: avoiding obsolete macros like AC_TRY_RUN, Paolo Bonzini, 2009/09/07
- Re: avoiding obsolete macros like AC_TRY_RUN, Ralf Wildenhues, 2009/09/08
- Re: avoiding obsolete macros like AC_TRY_RUN, Ralf Wildenhues, 2009/09/10