This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] autoupdate for gcc's configure.ac
- From: Kelley Cook <kcook at gcc dot gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 May 2005 21:06:26 -0400
- Subject: [patch] autoupdate for gcc's configure.ac
This patch uses autoupdate's guidelines on gcc's configure.ac, which
along with its related unreviewed patch for aclocal.m4
*http://gcc.gnu.org/ml/gcc-patches/2005-05/msg02253.html,* eliminates
172 warnings while generating configure.
Neither patch causes any changes to the regenerated configure nor config.in
OK to install?
2005-05-26 Kelley Cook <kcook@gcc.gnu.org>
* configure.ac: Autoupdate for autoconf 2.59 style.
Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.113
diff -p -u -d -r2.113 configure.ac
--- configure.ac 25 May 2005 00:15:21 -0000 2.113
+++ configure.ac 27 May 2005 00:50:27 -0000
@@ -515,22 +515,22 @@ if test x$ac_valgrind_checking != x ; th
# It is certainly possible that there's valgrind but no valgrind.h.
# GCC relies on making annotations so we must have both.
AC_MSG_CHECKING(for VALGRIND_DISCARD in <valgrind/memcheck.h>)
- AC_TRY_CPP(
- [#include <valgrind/memcheck.h>
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE(
+ [[#include <valgrind/memcheck.h>
#ifndef VALGRIND_DISCARD
#error VALGRIND_DISCARD not defined
-#endif],
+#endif]])],
[gcc_cv_header_valgrind_memcheck_h=yes],
[gcc_cv_header_valgrind_memcheck_h=no])
AC_MSG_RESULT($gcc_cv_header_valgrind_memcheck_h)
AC_MSG_CHECKING(for VALGRIND_DISCARD in <memcheck.h>)
- AC_TRY_CPP(
- [#include <memcheck.h>
+ AC_PREPROC_IFELSE([AC_LANG_SOURCE(
+ [[#include <memcheck.h>
#ifndef VALGRIND_DISCARD
#error VALGRIND_DISCARD not defined
-#endif],
- [gcc_cv_header_memcheck_h=yes],
- gcc_cv_header_memcheck_h=no)
+#endif]])],
+ [gcc_cv_header_memcheck_h=yes],
+ [gcc_cv_header_memcheck_h=no])
AC_MSG_RESULT($gcc_cv_header_memcheck_h)
AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind,
[$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1])
@@ -857,13 +857,13 @@ fi
AC_MSG_CHECKING(for GNU C library)
AC_CACHE_VAL(gcc_cv_glibc,
-[AC_TRY_COMPILE(
- [#include <features.h>],[
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <features.h>]], [[
#if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
#error Not a GNU C library system
-#endif],
- [gcc_cv_glibc=yes],
- gcc_cv_glibc=no)])
+#endif]])],
+ [gcc_cv_glibc=yes],
+ [gcc_cv_glibc=no])])
AC_MSG_RESULT($gcc_cv_glibc)
if test $gcc_cv_glibc = yes; then
AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
@@ -957,12 +957,12 @@ AC_SUBST(LDEXP_LIB)
# doesn't clash with <sys/types.h>, and declares intmax_t.
AC_MSG_CHECKING(for inttypes.h)
AC_CACHE_VAL(gcc_cv_header_inttypes_h,
-[AC_TRY_COMPILE(
- [#include <sys/types.h>
-#include <inttypes.h>],
- [intmax_t i = -1;],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#include <sys/types.h>
+#include <inttypes.h>]],
+ [[intmax_t i = -1;]])],
[gcc_cv_header_inttypes_h=yes],
- gcc_cv_header_inttypes_h=no)])
+ [gcc_cv_header_inttypes_h=no])])
AC_MSG_RESULT($gcc_cv_header_inttypes_h)
if test $gcc_cv_header_inttypes_h = yes; then
AC_DEFINE(HAVE_INTTYPES_H, 1,
@@ -984,15 +984,15 @@ AC_CHECK_FUNCS(times clock dup2 kill get
if test x$ac_cv_func_mbstowcs = xyes; then
AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
-[ AC_TRY_RUN([#include <stdlib.h>
+[ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
int main()
{
mbstowcs(0, "", 0);
return 0;
-}],
- gcc_cv_func_mbstowcs_works=yes,
- gcc_cv_func_mbstowcs_works=no,
- gcc_cv_func_mbstowcs_works=yes)])
+}]])],
+ [gcc_cv_func_mbstowcs_works=yes],
+ [gcc_cv_func_mbstowcs_works=no],
+ [gcc_cv_func_mbstowcs_works=yes])])
if test x$gcc_cv_func_mbstowcs_works = xyes; then
AC_DEFINE(HAVE_WORKING_MBSTOWCS, 1,
[Define this macro if mbstowcs does not crash when its
@@ -1033,7 +1033,7 @@ case "${host}" in
ac_cv_func_vfork_works=yes
;;
esac
-AC_FUNC_VFORK
+AC_FUNC_FORK
AM_ICONV
# Until we have in-tree GNU iconv:
@@ -1061,13 +1061,13 @@ gcc_AC_CHECK_DECLS(getrlimit setrlimit g
#endif
])
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "ansidecl.h"
#include "system.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
-],[rlim_t l = 0;],,[AC_DEFINE([rlim_t],[long],
+]], [[rlim_t l = 0;]])],[],[AC_DEFINE([rlim_t],[long],
[Define to \`long' if <sys/resource.h> doesn't define.])])
# On AIX 5.2, <ldfcn.h> conflicts with <fcntl.h>, as both define incompatible
@@ -1094,13 +1094,13 @@ gcc_AC_CHECK_DECLS(times, , ,[
# More time-related stuff.
AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "ansidecl.h"
#include "system.h"
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
-], [struct tms tms;], ac_cv_struct_tms=yes, ac_cv_struct_tms=no)])
+]], [[struct tms tms;]])],[ac_cv_struct_tms=yes],[ac_cv_struct_tms=no])])
if test $ac_cv_struct_tms = yes; then
AC_DEFINE(HAVE_STRUCT_TMS, 1,
[Define if <sys/times.h> defines struct tms.])
@@ -1109,10 +1109,10 @@ fi
# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
# revisit after autoconf 2.50.
AC_CACHE_CHECK(for clock_t, gcc_cv_type_clock_t, [
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "ansidecl.h"
#include "system.h"
-], [clock_t x;], gcc_cv_type_clock_t=yes, gcc_cv_type_clock_t=no)])
+]], [[clock_t x;]])],[gcc_cv_type_clock_t=yes],[gcc_cv_type_clock_t=no])])
if test $gcc_cv_type_clock_t = yes; then
AC_DEFINE(HAVE_CLOCK_T, 1,
[Define if <time.h> defines clock_t.])