From d9ab9cb9c3eb63a7c98ca584156c4f8d8b1b9a74 Mon Sep 17 00:00:00 2001 From: pbrook Date: Wed, 27 Oct 2004 16:08:48 +0000 Subject: [PATCH] * configure.ac: Don't test for [build] __cxa_atexit when building a cross compiler. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89684 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/configure | 20 +++++++++++++++----- gcc/configure.ac | 23 ++++++++++++++++------- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6683c84920f..68fc9443ea1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-10-27 Paul Brook + + * configure.ac: Don't test for [build] __cxa_atexit when building a + cross compiler. + * configure: Regenerate. + 2004-10-27 Paul Brook * configure.ac: Use build_exeext not host_exeext when lookin for diff --git a/gcc/configure b/gcc/configure index ee1802e9815..117fb03d8ca 100755 --- a/gcc/configure +++ b/gcc/configure @@ -12005,9 +12005,11 @@ fi # UNSORTED # -------- +use_cxa_atexit=no if test x$enable___cxa_atexit = xyes || \ test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then - echo "$as_me:$LINENO: checking for __cxa_atexit" >&5 + if test x$host = x$target; then + echo "$as_me:$LINENO: checking for __cxa_atexit" >&5 echo $ECHO_N "checking for __cxa_atexit... $ECHO_C" >&6 if test "${ac_cv_func___cxa_atexit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12098,15 +12100,23 @@ fi echo "$as_me:$LINENO: result: $ac_cv_func___cxa_atexit" >&5 echo "${ECHO_T}$ac_cv_func___cxa_atexit" >&6 if test $ac_cv_func___cxa_atexit = yes; then + use_cxa_atexit=yes +else + echo "__cxa_atexit can't be enabled on this target" +fi + + else + # We can't check for __cxa_atexit when building a cross, so assume + # it is available + use_cxa_atexit=yes + fi + if test x$use_cxa_atexit = xyes; then cat >>confdefs.h <<\_ACEOF #define DEFAULT_USE_CXA_ATEXIT 1 _ACEOF -else - echo "__cxa_atexit can't be enabled on this target" -fi - + fi fi # Look for a file containing extra machine modes. diff --git a/gcc/configure.ac b/gcc/configure.ac index e5c371c8cff..6f388754da1 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1295,15 +1295,24 @@ AC_SUBST(gthread_flags) # UNSORTED # -------- +use_cxa_atexit=no if test x$enable___cxa_atexit = xyes || \ test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then - AC_CHECK_FUNC(__cxa_atexit, - [AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1, - [Define if you want to use __cxa_atexit, rather than atexit, to - register C++ destructors for local statics and global objects. - This is essential for fully standards-compliant handling of - destructors, but requires __cxa_atexit in libc.])], - echo "__cxa_atexit can't be enabled on this target") + if test x$host = x$target; then + AC_CHECK_FUNC(__cxa_atexit,[use_cxa_atexit=yes], + [echo "__cxa_atexit can't be enabled on this target"]) + else + # We can't check for __cxa_atexit when building a cross, so assume + # it is available + use_cxa_atexit=yes + fi + if test x$use_cxa_atexit = xyes; then + AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1, + [Define if you want to use __cxa_atexit, rather than atexit, to + register C++ destructors for local statics and global objects. + This is essential for fully standards-compliant handling of + destructors, but requires __cxa_atexit in libc.]) + fi fi # Look for a file containing extra machine modes. -- 2.11.4.GIT