]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in: extent no_builtin_flag to contain -fno-rtti and
authorStephan Kulow <coolo@kde.org>
Mon, 16 Nov 1998 13:21:02 +0000 (13:21 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 16 Nov 1998 13:21:02 +0000 (13:21 +0000)
-fno-exceptions in case we compile with a gcc, that supports
this options (egcs and gcc >= 2.8)

ChangeLog
ltconfig.in

index 597a90acd48e40c01efc8513c70645b0c7179d81..1a7825025153d0205fb5c80b2902d4010a2ab4c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1998-11-16  Stephan Kulow  <coolo@kde.org>
+
+       * ltconfig.in: extent no_builtin_flag to contain -fno-rtti and
+       -fno-exceptions in case we compile with a gcc, that supports
+       this options (egcs and gcc >= 2.8)
+
 1998-11-16  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * ltmain.in (C_compiler): copy $CC before it is overwritten with
index 30ab98043402a7a5562b551a0a8886666484b614..11da3572b8fe8a93154d1a1e624774a79ad1f186 100755 (executable)
@@ -570,7 +570,6 @@ no_builtin_flag=
 if test "$with_gcc" = yes; then
   wl='-Wl,'
   link_static_flag='-static'
-  no_builtin_flag=' -fno-builtin'
 
   case "$host_os" in
   aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
@@ -772,6 +771,42 @@ else
   need_locks=no
 fi
 
+if test "$with_gcc" = yes; then
+  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
+  $rm conftest*
+  echo "int some_variable = 0;" > conftest.c
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
+  echo "$progname:@LINENO@: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+  if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
+
+    # The compiler can only warn and ignore the option if not recognized
+    # So say no if there are warnings
+      if test -s conftest.err; then
+        echo "$ac_t"no 1>&6
+        compiler_rtti_exceptions=no
+      else
+        echo "$ac_t"yes 1>&6
+        compiler_rtti_exceptions=yes
+      fi
+  else
+    # Append any errors to the config.log.
+    cat conftest.err 1>&5
+    compiler_rtti_exceptions=no
+    echo "$ac_t"no 1>&6
+  fi
+  CFLAGS="$save_CFLAGS"
+  $rm conftest*
+
+  if test "$compiler_rtti_exceptions" = "yes"; then
+    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
+  else
+    no_builtin_flag=' -fno-builtin'
+  fi
+  
+fi
+
 # Check for any special shared library compilation flags.
 if test -n "$special_shlib_compile_flags"; then
   echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2