Commit eb70d86d by Andreas Schwab Committed by Richard Henderson

configure.in: Restore CFLAGS before gcc_AC_INITFINI_ARRAY.

        * configure.in: Restore CFLAGS before gcc_AC_INITFINI_ARRAY.
        Move --enable-initfini-array check ...
        * aclocal.m4 (gcc_AC_INITFINI_ARRAY): ... here.  Define
        HAVE_INITFINI_ARRAY also when --enable-initfini-array is given.
        Don't AC_SUBST gcc_cv_initfinit_array.  Use AC_TRY_RUN.
        * configure: Rebuild.

From-SVN: r61018
parent 1afdf91c
2003-01-07 Andreas Schwab <schwab@suse.de>
* configure.in: Restore CFLAGS before gcc_AC_INITFINI_ARRAY.
Move --enable-initfini-array check ...
* aclocal.m4 (gcc_AC_INITFINI_ARRAY): ... here. Define
HAVE_INITFINI_ARRAY also when --enable-initfini-array is given.
Don't AC_SUBST gcc_cv_initfinit_array. Use AC_TRY_RUN.
* configure: Rebuild.
2003-01-07 Richard Henderson <rth@redhat.com> 2003-01-07 Richard Henderson <rth@redhat.com>
* alias.c (find_base_value): Only use new_reg_base_value shortcut * alias.c (find_base_value): Only use new_reg_base_value shortcut
......
...@@ -1627,27 +1627,21 @@ strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) ...@@ -1627,27 +1627,21 @@ strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
]) ])
AC_DEFUN(gcc_AC_INITFINI_ARRAY, AC_DEFUN(gcc_AC_INITFINI_ARRAY,
[AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, [AC_ARG_ENABLE(initfini-array,
[ --enable-initfini-array use .init_array/.fini_array sections],
[], [
AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
gcc_cv_initfinit_array, [dnl gcc_cv_initfinit_array, [dnl
cat > conftest.c <<EOF AC_TRY_RUN([
static int x = -1; static int x = -1;
int main (void) { return x; } int main (void) { return x; }
int foo (void) { x = 0; } int foo (void) { x = 0; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;],
EOF [gcc_cv_initfinit_array=yes], [gcc_cv_initfinit_array=no],
if AC_TRY_COMMAND([${CC-cc} -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]) [gcc_cv_initfinit_array=no])])
then enable_initfini_array=$gcc_cv_initfini_array
if ./conftest; then ])
gcc_cv_initfinit_array=yes if test $enable_initfini_array = yes; then
else AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
gcc_cv_initfinit_array=no [Define .init_array/.fini_array sections are available and working.])
fi fi])
else
gcc_cv_initfinit_array=no
fi
rm -f conftest*])
AC_SUBST(gcc_cv_initfinit_array)
if test $gcc_cv_initfinit_array = yes; then
AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
[Define .init_array/.fini_array sections are available and working.])
fi])
# configure.in for GCC # configure.in for GCC
# Process this file with autoconf to generate a configuration script. # Process this file with autoconf to generate a configuration script.
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
#This file is part of GCC. #This file is part of GCC.
...@@ -783,13 +784,11 @@ if test $gcc_cv_type_clock_t = yes; then ...@@ -783,13 +784,11 @@ if test $gcc_cv_type_clock_t = yes; then
[Define if <time.h> defines clock_t.]) [Define if <time.h> defines clock_t.])
fi fi
AC_ARG_ENABLE(initfini-array,
[ --enable-initfini-array use .init_array/.fini_array sections],
gcc_cv_initfinit_array=$enableval, [gcc_AC_INITFINI_ARRAY])
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS" CFLAGS="$saved_CFLAGS"
gcc_AC_INITFINI_ARRAY
# mkdir takes a single argument on some systems. # mkdir takes a single argument on some systems.
gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment