diff options
author | seawood%netscape.com <devnull@localhost> | 2002-08-10 04:32:49 +0000 |
---|---|---|
committer | seawood%netscape.com <devnull@localhost> | 2002-08-10 04:32:49 +0000 |
commit | 5ab2037a09703b65dafe603b974d031b62d163cb (patch) | |
tree | b2352843c992f88c6415d396e115147ed14d600b | |
parent | 326a84a4a7915569f75c961731e349d90c8a67d4 (diff) | |
download | nspr-hg-5ab2037a09703b65dafe603b974d031b62d163cb.tar.gz |
Add compiler test for +Olit=all support for hpux cc.
Bug #146426 r=wtc
-rwxr-xr-x | configure | 79 | ||||
-rw-r--r-- | configure.in | 34 |
2 files changed, 88 insertions, 25 deletions
@@ -3360,8 +3360,6 @@ EOF if test -z "$GNU_CC"; then CC="$CC -Ae" CXX="$CXX -ext" - CFLAGS="$CFLAGS +ESlit" - CXXFLAGS="$CXXFLAGS +ESlit" DSO_CFLAGS=+Z else DSO_CFLAGS=-fPIC @@ -4188,17 +4186,17 @@ EOF _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4192: checking for machine/builtins.h" >&5 +echo "configure:4190: checking for machine/builtins.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4197 "configure" +#line 4195 "configure" #include "confdefs.h" #include <machine/builtins.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4705,12 +4703,12 @@ esac if test -z "$SKIP_LIBRARY_CHECKS"; then echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4709: checking for dlopen" >&5 +echo "configure:4707: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4714 "configure" +#line 4712 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen(); below. */ @@ -4733,7 +4731,7 @@ dlopen(); ; return 0; } EOF -if { (eval echo configure:4737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4752,7 +4750,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4756: checking for dlopen in -ldl" >&5 +echo "configure:4754: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4760,7 +4758,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4764 "configure" +#line 4762 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4771,7 +4769,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4799,13 +4797,13 @@ fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:4803: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:4801: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 4809 "configure" +#line 4807 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -4823,7 +4821,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 4827 "configure" +#line 4825 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -4847,12 +4845,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4851: checking for $ac_func" >&5 +echo "configure:4849: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4856 "configure" +#line 4854 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4875,7 +4873,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4909,11 +4907,46 @@ if test "${enable_strip+set}" = set; then fi +case "${target_os}" in +hpux*) +if test -z "$GNU_CC"; then + + echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 +echo "configure:4916: checking for +Olit support" >&5 +if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_hpux_usable_olit_option=no + rm -f conftest* + echo 'int main() { return 0; }' | cat > conftest.c + ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1 + if test $? -eq 0; then + if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then + ac_cv_hpux_usable_olit_option=yes + fi + fi + rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_hpux_usable_olit_option" 1>&6 + + if test "$ac_cv_hpux_usable_olit_option" = "yes"; then + CFLAGS="$CFLAGS +Olit=all" + CXXFLAGS="$CXXFLAGS +Olit=all" + else + CFLAGS="$CFLAGS +ESlit" + CXXFLAGS="$CXXFLAGS +ESlit" + fi +fi +;; +esac + echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:4917: checking for pthread_create in -lpthreads" >&5 +echo "configure:4950: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -4935,7 +4968,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4939: checking for pthread_create in -lpthread" >&5 +echo "configure:4972: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -4957,7 +4990,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:4961: checking for pthread_create in -lc_r" >&5 +echo "configure:4994: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -4979,7 +5012,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:4983: checking for pthread_create in -lc" >&5 +echo "configure:5016: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5131,7 +5164,7 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:5135: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5168: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -5154,7 +5187,7 @@ echo "configure:5135: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:5158: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5191: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then diff --git a/configure.in b/configure.in index 01df6c42..ad0d73c8 100644 --- a/configure.in +++ b/configure.in @@ -903,8 +903,6 @@ case "$target" in if test -z "$GNU_CC"; then CC="$CC -Ae" CXX="$CXX -ext" - CFLAGS="$CFLAGS +ESlit" - CXXFLAGS="$CXXFLAGS +ESlit" DSO_CFLAGS=+Z else DSO_CFLAGS=-fPIC @@ -1861,6 +1859,38 @@ AC_ARG_ENABLE(strip, [ --enable-strip Enable stripping of shared libs and programs], [ ENABLE_STRIP=1 ]) +dnl Check for hpux options +case "${target_os}" in +hpux*) +if test -z "$GNU_CC"; then + + AC_CACHE_CHECK(for +Olit support, + ac_cv_hpux_usable_olit_option, + dnl since aCC doesn't throw an error on invalid options, + dnl we have to test this the hard way + [ac_cv_hpux_usable_olit_option=no + rm -f conftest* + echo 'int main() { return 0; }' | cat > conftest.c + ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1 + if test $? -eq 0; then + if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then + ac_cv_hpux_usable_olit_option=yes + fi + fi + rm -f conftest* + ]) + + if test "$ac_cv_hpux_usable_olit_option" = "yes"; then + CFLAGS="$CFLAGS +Olit=all" + CXXFLAGS="$CXXFLAGS +Olit=all" + else + CFLAGS="$CFLAGS +ESlit" + CXXFLAGS="$CXXFLAGS +ESlit" + fi +fi +;; +esac + dnl dnl Apparently, some systems cannot properly check for the pthread dnl library unless <pthread.h> is included so we need to test |