]> granicus.if.org Git - php/commitdiff
unreliable check whether cc option can be used really
authorSascha Schumann <sas@php.net>
Sat, 24 Apr 1999 23:36:25 +0000 (23:36 +0000)
committerSascha Schumann <sas@php.net>
Sat, 24 Apr 1999 23:36:25 +0000 (23:36 +0000)
acinclude.m4
configure.in.in

index 4b2fbcc876f3a0dd1897333be52cfb9f8201ec63..f090513cb4dfeebdf935c039d92c1c37b1a75b9a 100644 (file)
@@ -2,6 +2,26 @@ dnl $Id$
 dnl
 dnl This file contains local autoconf functions.
 
+
+dnl
+dnl Check for cc option
+dnl
+AC_DEFUN(AC_CHECK_CC_OPTION,[
+  echo "main(){return 0;}" > conftest.$ac_ext
+  opt="$1"
+  var=`echo -n $opt|tr -c a-zA-Z0-9 _`
+  AC_MSG_CHECKING([if compiler supports $1 really])
+  ac_compile='${CC-cc} -$opt -c $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1'
+  if eval $ac_compile | egrep "$opt" > /dev/null 2>&1 ; then
+    eval php_cc_$var=no
+       AC_MSG_RESULT(no)
+  else
+    eval php_cc_$var=yes
+       AC_MSG_RESULT(yes)
+  fi
+])
+
+
 dnl
 dnl See if we have broken header files like SunOS has.
 dnl
index 57c9f86f40bd646dad896f431e5dae01798fb2bf..55ab6aba659ca3493f81cf91c8d36ab0c45f7b92 100644 (file)
@@ -124,6 +124,9 @@ AC_CACHE_VAL(php_cc_rdynamic,[
        AC_TRY_LINK([], [], php_cc_rdynamic=yes, php_cc_rdynamic=no)
        LIBS="${SAVE_LIBS}"])
 AC_MSG_RESULT($php_cc_rdynamic)
+if test $php_cc_rdynamic = "yes"; then
+  AC_CHECK_CC_OPTION(rdynamic)
+fi
 if test $php_cc_rdynamic = "yes"; then
        LDFLAGS="${LDFLAGS} -rdynamic"
        RDYNAMIC_LFLAGS="-rdynamic"
@@ -132,7 +135,6 @@ else
 fi
 AC_SUBST(RDYNAMIC_LFLAGS)
 
-
 dnl AC_PROG_INSTALL
 AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH /usr/bin /usr/sbin /usr/etc /etc /usr/ucblib)
 if test -n "$PROG_SENDMAIL"; then