Add compiler test for +Olit=all support for hpux cc.

Bug #146426 r=wtc
This commit is contained in:
seawood%netscape.com 2002-08-10 04:32:49 +00:00
Родитель f96401a20b
Коммит 99e9b98017
2 изменённых файлов: 88 добавлений и 25 удалений

79
nsprpub/configure поставляемый
Просмотреть файл

@ -3360,8 +3360,6 @@ EOF
if test -z "$GNU_CC"; then if test -z "$GNU_CC"; then
CC="$CC -Ae" CC="$CC -Ae"
CXX="$CXX -ext" CXX="$CXX -ext"
CFLAGS="$CFLAGS +ESlit"
CXXFLAGS="$CXXFLAGS +ESlit"
DSO_CFLAGS=+Z DSO_CFLAGS=+Z
else else
DSO_CFLAGS=-fPIC DSO_CFLAGS=-fPIC
@ -4188,17 +4186,17 @@ EOF
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4197 "configure" #line 4195 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <machine/builtins.h> #include <machine/builtins.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -4705,12 +4703,12 @@ esac
if test -z "$SKIP_LIBRARY_CHECKS"; then if test -z "$SKIP_LIBRARY_CHECKS"; then
echo $ac_n "checking for dlopen""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4714 "configure" #line 4712 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */ which can conflict with char dlopen(); below. */
@ -4733,7 +4731,7 @@ dlopen();
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_func_dlopen=yes" eval "ac_cv_func_dlopen=yes"
else else
@ -4752,7 +4750,7 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 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_%'` ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -4760,7 +4758,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4764 "configure" #line 4762 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -4771,7 +4769,7 @@ int main() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -4799,13 +4797,13 @@ fi
if test $ac_cv_prog_gcc = yes; then if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
ac_pattern="Autoconf.*'x'" ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4809 "configure" #line 4807 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sgtty.h> #include <sgtty.h>
Autoconf TIOCGETP Autoconf TIOCGETP
@ -4823,7 +4821,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4827 "configure" #line 4825 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <termio.h> #include <termio.h>
Autoconf TCGETA Autoconf TCGETA
@ -4847,12 +4845,12 @@ fi
for ac_func in lchown strerror for ac_func in lchown strerror
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4856 "configure" #line 4854 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -4875,7 +4873,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -4909,11 +4907,46 @@ if test "${enable_strip+set}" = set; then
fi 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 $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 " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -4935,7 +4968,7 @@ echo "
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 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 " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -4957,7 +4990,7 @@ echo "
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 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 " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -4979,7 +5012,7 @@ echo "
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 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 " echo "
#include <pthread.h> #include <pthread.h>
void *foo(void *v) { return v; } void *foo(void *v) { return v; }
@ -5131,7 +5164,7 @@ if test -n "$USE_PTHREADS"; then
rm -f conftest* rm -f conftest*
ac_cv_have_dash_pthread=no ac_cv_have_dash_pthread=no
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 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 echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then 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 ac_cv_have_dash_pthreads=no
if test "$ac_cv_have_dash_pthread" = "no"; then if test "$ac_cv_have_dash_pthread" = "no"; then
echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 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 echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then if test $? -eq 0; then

Просмотреть файл

@ -903,8 +903,6 @@ case "$target" in
if test -z "$GNU_CC"; then if test -z "$GNU_CC"; then
CC="$CC -Ae" CC="$CC -Ae"
CXX="$CXX -ext" CXX="$CXX -ext"
CFLAGS="$CFLAGS +ESlit"
CXXFLAGS="$CXXFLAGS +ESlit"
DSO_CFLAGS=+Z DSO_CFLAGS=+Z
else else
DSO_CFLAGS=-fPIC DSO_CFLAGS=-fPIC
@ -1861,6 +1859,38 @@ AC_ARG_ENABLE(strip,
[ --enable-strip Enable stripping of shared libs and programs], [ --enable-strip Enable stripping of shared libs and programs],
[ ENABLE_STRIP=1 ]) [ 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
dnl Apparently, some systems cannot properly check for the pthread dnl Apparently, some systems cannot properly check for the pthread
dnl library unless <pthread.h> is included so we need to test dnl library unless <pthread.h> is included so we need to test