From: Sascha Schumann Date: Sat, 24 Apr 1999 23:36:25 +0000 (+0000) Subject: unreliable check whether cc option can be used really X-Git-Tag: BEFORE_PHP4_APACHE_MODULE_CHANGE~170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6955cacb21abc184ea4ab6bbdf1870c48bc95c85;p=php unreliable check whether cc option can be used really --- diff --git a/acinclude.m4 b/acinclude.m4 index 4b2fbcc876..f090513cb4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/configure.in.in b/configure.in.in index 57c9f86f40..55ab6aba65 100644 --- a/configure.in.in +++ b/configure.in.in @@ -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