From 71954603039231e7e0a5b849baf65b9881556cea Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 21 Oct 2002 14:35:31 +0000 Subject: [PATCH] Disable -ggdb by using -g instead where necessary. This presently holds for Mac OS X, for which -ggdb cannot even compile an empty program. git-svn-id: https://svn.dealii.org/trunk@6697 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 57 +++++++++++++++++++++------------- deal.II/configure | 77 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 96 insertions(+), 38 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 74d54230a7..36f991e143 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -462,13 +462,13 @@ dnl ------------------------------------------------------------- AC_DEFUN(DEAL_II_SET_CXX_DEBUG_FLAG, dnl [ if test "$GXX" = yes ; then - AC_MSG_CHECKING(whether -ggdb works for long symbols) case "$target" in dnl On Alpha, use the special treatment alpha*-osf*) - CXXFLAGS="-ggdb $CXXFLAGSG" - AC_TRY_COMPILE( - [ + AC_MSG_CHECKING(whether -ggdb works for long symbols) + CXXFLAGS="-ggdb $CXXFLAGSG" + AC_TRY_COMPILE( + [ # include # include using namespace std; @@ -483,27 +483,40 @@ AC_DEFUN(DEAL_II_SET_CXX_DEBUG_FLAG, dnl ::const_iterator i1=t2->begin(); return (i1==i2); } - ], - [ + ], + [ ; - ], - [ - CXXFLAGSG="-ggdb $CXXFLAGSG" - AC_MSG_RESULT(yes) - ], - [ - CXXFLAGSG="-gstabs $CXXFLAGSG" - AC_MSG_RESULT(no -- using -gstabs) - ]) - ;; + ], + [ + CXXFLAGSG="-ggdb $CXXFLAGSG" + AC_MSG_RESULT(yes) + ], + [ + CXXFLAGSG="-gstabs $CXXFLAGSG" + AC_MSG_RESULT(no -- using -gstabs instead) + ]) + ;; - dnl For all other systems assume that -ggdb works (we can't make the - dnl test above the default, as stabs are not the default debugging - dnl format on many systems, and we only want to use it where necessary + dnl For all other systems test whether -ggdb works at all, and if + dnl not fall back on -g instead. This test is mainly used to + dnl accomodate for a failure on Mac OS X, where -ggdb leads to + dnl information the assembler does not understand (see mailing + dnl list thread on this from mid-October 2002) *) - AC_MSG_RESULT(yes) - CXXFLAGSG="-ggdb $CXXFLAGSG" - ;; + AC_MSG_CHECKING(whether -ggdb works) + CXXFLAGS="-ggdb $CXXFLAGSG" + AC_TRY_COMPILE( + [], + [ ; ], + [ + CXXFLAGSG="-ggdb $CXXFLAGSG" + AC_MSG_RESULT(yes) + ], + [ + CXXFLAGSG="-g $CXXFLAGSG" + AC_MSG_RESULT(no -- using -g instead) + ]) + ;; esac else diff --git a/deal.II/configure b/deal.II/configure index 2060c3c8bc..62ca5c03ed 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.124 . +# From configure.in Revision: 1.125 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53a. # @@ -2943,12 +2943,12 @@ echo "$as_me: error: No compiler options for this C++ compiler if test "$GXX" = yes ; then - echo "$as_me:$LINENO: checking whether -ggdb works for long symbols" >&5 -echo $ECHO_N "checking whether -ggdb works for long symbols... $ECHO_C" >&6 case "$target" in alpha*-osf*) - CXXFLAGS="-ggdb $CXXFLAGSG" - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me:$LINENO: checking whether -ggdb works for long symbols" >&5 +echo $ECHO_N "checking whether -ggdb works for long symbols... $ECHO_C" >&6 + CXXFLAGS="-ggdb $CXXFLAGSG" + cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" @@ -2996,27 +2996,72 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - CXXFLAGSG="-ggdb $CXXFLAGSG" - echo "$as_me:$LINENO: result: yes" >&5 + CXXFLAGSG="-ggdb $CXXFLAGSG" + echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - CXXFLAGSG="-gstabs $CXXFLAGSG" - echo "$as_me:$LINENO: result: no -- using -gstabs" >&5 -echo "${ECHO_T}no -- using -gstabs" >&6 + CXXFLAGSG="-gstabs $CXXFLAGSG" + echo "$as_me:$LINENO: result: no -- using -gstabs instead" >&5 +echo "${ECHO_T}no -- using -gstabs instead" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext - ;; + ;; + + *) + echo "$as_me:$LINENO: checking whether -ggdb works" >&5 +echo $ECHO_N "checking whether -ggdb works... $ECHO_C" >&6 + CXXFLAGS="-ggdb $CXXFLAGSG" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + ; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then - *) - echo "$as_me:$LINENO: result: yes" >&5 + CXXFLAGSG="-ggdb $CXXFLAGSG" + echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - CXXFLAGSG="-ggdb $CXXFLAGSG" - ;; + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + + CXXFLAGSG="-g $CXXFLAGSG" + echo "$as_me:$LINENO: result: no -- using -g instead" >&5 +echo "${ECHO_T}no -- using -g instead" >&6 + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + ;; esac else @@ -6202,7 +6247,7 @@ else fi; case "$target" in - *-aix* | alpha*-linux* | alpha*-osf45* | *cygwin ) + *-aix* | alpha*-linux* | alpha*-osf45* | *cygwin | powerpc-apple-darwin* ) { echo "$as_me:$LINENO: WARNING: Shared libraries not supported on $target. Using static libs instead" >&5 echo "$as_me: WARNING: Shared libraries not supported on $target. Using static libs instead" >&2;} enableshared=no -- 2.39.5