diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-07 21:03:24 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-07 21:03:24 +0000 |
commit | 24d1674dc6c5761fba6ac10de9d018ed2bdf4e21 (patch) | |
tree | 65c85a3e46778fa0f2b7ee1d3d40f2de49c304b3 /gcc/aclocal.m4 | |
parent | a303ed8c9e913d8c7210bbd355def502ec1f0613 (diff) | |
download | gcc-24d1674dc6c5761fba6ac10de9d018ed2bdf4e21.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61018 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/aclocal.m4')
-rw-r--r-- | gcc/aclocal.m4 | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index 0a954d81169..3ae8b83de80 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -1627,27 +1627,21 @@ strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) ]) 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 - cat > conftest.c <<EOF + AC_TRY_RUN([ static int x = -1; int main (void) { return x; } int foo (void) { x = 0; } -int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; -EOF - if AC_TRY_COMMAND([${CC-cc} -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD]) - then - if ./conftest; then - gcc_cv_initfinit_array=yes - else - gcc_cv_initfinit_array=no - 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]) +int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;], + [gcc_cv_initfinit_array=yes], [gcc_cv_initfinit_array=no], + [gcc_cv_initfinit_array=no])]) + enable_initfini_array=$gcc_cv_initfini_array +]) +if test $enable_initfini_array = yes; then + AC_DEFINE(HAVE_INITFINI_ARRAY, 1, + [Define .init_array/.fini_array sections are available and working.]) +fi]) |