diff options
author | seawood%netscape.com <devnull@localhost> | 2001-12-02 22:08:42 +0000 |
---|---|---|
committer | seawood%netscape.com <devnull@localhost> | 2001-12-02 22:08:42 +0000 |
commit | ceff9fa42cbd3802bfd8a5d446729b81008fbff9 (patch) | |
tree | f4c97c765a079fcc75c05f386f4f64a8f0a1cc44 | |
parent | b28b24817b0d8fb3a6b645bc7c91a1fcb3f080ae (diff) | |
download | nspr-hg-ceff9fa42cbd3802bfd8a5d446729b81008fbff9.tar.gz |
Adding test for gcc -pipe feature.
Bug #81031 r=wtc
-rwxr-xr-x | configure | 128 | ||||
-rw-r--r-- | configure.in | 64 |
2 files changed, 140 insertions, 52 deletions
@@ -2541,6 +2541,9 @@ fi if test "$GCC" = "yes"; then GNU_CC=1 fi +if test "$GXX" = "yes"; then + GNU_CXX=1 +fi if test "`echo | $AS -V 2>&1 | grep -c GNU`" != "0"; then GNU_AS=1 fi @@ -2552,6 +2555,54 @@ else CROSS_COMPILE= fi +echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6 +echo "configure:2560: checking for gcc -pipe support" >&5 +if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then + echo '#include <stdio.h>' > dummy-hello.c + echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c + ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5 + cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5 + if test $? = 0; then + _res_as_stdin="yes" + else + _res_as_stdin="no" + fi + if test "$_res_as_stdin" = "yes"; then + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -pipe" + cat > conftest.$ac_ext <<EOF +#line 2575 "configure" +#include "confdefs.h" + #include <stdio.h> +int main() { +printf("Hello World\n"); +; return 0; } +EOF +if { (eval echo configure:2582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + _res_gcc_pipe="yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + _res_gcc_pipe="no" +fi +rm -f conftest* + CFLAGS=$_SAVE_CFLAGS + fi + if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then + _res="yes"; + CFLAGS="$CFLAGS -pipe" + CXXFLAGS="$CXXFLAGS -pipe" + else + _res="no" + fi + rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out + echo "$ac_t""$_res" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + fi # SKIP_COMPILER_CHECKS if test -z "$SKIP_PATH_CHECKS"; then @@ -2560,7 +2611,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2564: checking for $ac_word" >&5 +echo "configure:2615: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2784,17 +2835,17 @@ EOF DSO_LDOPTS='-brtl -bM:SRE -bnoentry -bexpall' ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6 -echo "configure:2788: checking for sys/atomic_op.h" >&5 +echo "configure:2839: checking for sys/atomic_op.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 2793 "configure" +#line 2844 "configure" #include "confdefs.h" #include <sys/atomic_op.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2849: \"$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* @@ -3113,7 +3164,7 @@ EOF #define HAVE_BSD_FLOCK 1 EOF - CFLAGS="$CFLAGS -Wmost -fno-common -pipe" + CFLAGS="$CFLAGS -Wmost -fno-common" if echo $OS_TEST | grep -c 86 2>/dev/null; then CFLAGS="$CFLAGS -mno-486" cat >> confdefs.h <<\EOF @@ -3191,7 +3242,7 @@ EOF #define HAVE_BSD_FLOCK 1 EOF - CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall -pipe" + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall" MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` if test "$MOZ_OBJFORMAT" = "elf"; then DLL_SUFFIX=so @@ -3550,8 +3601,8 @@ EOF #define linux 1 EOF - CFLAGS="$CFLAGS -ansi -Wall -pipe" - CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" + CFLAGS="$CFLAGS -ansi -Wall" + CXXFLAGS="$CXXFLAGS -ansi -Wall" MDCPUCFG_H=_linux.cfg PR_MD_CSRCS=linux.c MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' @@ -3801,8 +3852,8 @@ EOF CFLAGS="$CFLAGS -Hnocopyr" CXXFLAGS="$CXXFLAGS -Hnocopyr" else - CFLAGS="$CFLAGS -fPIC -Wall -pipe" - CXXFLAGS="$CXXFLAGS -fPIC -Wall -pipe" + CFLAGS="$CFLAGS -fPIC -Wall" + CXXFLAGS="$CXXFLAGS -fPIC -Wall" DSO_LDOPTS=-G fi MDCPUCFG_H=_ncr.cfg @@ -3859,8 +3910,8 @@ EOF PR_MD_CSRCS=netbsd.c DSO_CFLAGS='-fPIC -DPIC' - CFLAGS="$CFLAGS -ansi -Wall -pipe" - CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" + CFLAGS="$CFLAGS -ansi -Wall" + CXXFLAGS="$CXXFLAGS -ansi -Wall" MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)' if test -z "$OBJECT_FMT"; then @@ -3934,8 +3985,8 @@ EOF #define _POSIX_SOURCE 1 EOF - CFLAGS="$CFLAGS -Wall -fno-common -pipe -traditional-cpp -posix" - CXXFLAGS="$CXXFLAGS -Wall -fno-common -pipe -traditional-cpp -posix" + CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix" + CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix" USE_NSPR_THREADS=1 DLL_SUFFIX=dylib MDCPUCFG_H=_nextstep.cfg @@ -3983,8 +4034,8 @@ EOF #define HAVE_BSD_FLOCK 1 EOF - CFLAGS="$CFLAGS -ansi -Wall -pipe" - CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" + CFLAGS="$CFLAGS -ansi -Wall" + CXXFLAGS="$CXXFLAGS -ansi -Wall" DLL_SUFFIX=so.1.0 DSO_CFLAGS=-fPIC MDCPUCFG_H=_openbsd.cfg @@ -4051,17 +4102,17 @@ EOF ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4055: checking for machine/builtins.h" >&5 +echo "configure:4106: 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 4060 "configure" +#line 4111 "configure" #include "confdefs.h" #include <machine/builtins.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4116: \"$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* @@ -4215,7 +4266,6 @@ EOF AS='$(CC) -x assembler-with-cpp' if test "$CPU_ARCH" = "mips"; then LD=gld - CFLAGS="$CFLAGS -pipe" fi CFLAGS="$CFLAGS -Wall -Wno-format" else @@ -4572,12 +4622,12 @@ esac if test -z "$SKIP_LIBRARY_CHECKS"; then echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4576: checking for dlopen" >&5 +echo "configure:4626: 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 4581 "configure" +#line 4631 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen(); below. */ @@ -4600,7 +4650,7 @@ dlopen(); ; return 0; } EOF -if { (eval echo configure:4604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4654: \"$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 @@ -4619,7 +4669,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4623: checking for dlopen in -ldl" >&5 +echo "configure:4673: 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 @@ -4627,7 +4677,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4631 "configure" +#line 4681 "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 @@ -4638,7 +4688,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4692: \"$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 @@ -4666,13 +4716,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:4670: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:4720: 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 4676 "configure" +#line 4726 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -4690,7 +4740,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 4694 "configure" +#line 4744 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -4714,12 +4764,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4718: checking for $ac_func" >&5 +echo "configure:4768: 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 4723 "configure" +#line 4773 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4742,7 +4792,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4796: \"$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 @@ -4780,7 +4830,7 @@ fi echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:4784: checking for pthread_create in -lpthreads" >&5 +echo "configure:4834: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { int a = 1; } @@ -4802,7 +4852,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4806: checking for pthread_create in -lpthread" >&5 +echo "configure:4856: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { int a = 1; } @@ -4824,7 +4874,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:4828: checking for pthread_create in -lc_r" >&5 +echo "configure:4878: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { int a = 1; } @@ -4846,7 +4896,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:4850: checking for pthread_create in -lc" >&5 +echo "configure:4900: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { int a = 1; } @@ -4996,7 +5046,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:5000: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5050: 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 @@ -5012,7 +5062,7 @@ echo "configure:5000: 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:5016: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5066: 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 @@ -5486,7 +5536,7 @@ s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' ' | tr '\015' ' '` +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '| tr '\015' ' '` rm -f conftest.defs diff --git a/configure.in b/configure.in index 67edf890..9b2f4880 100644 --- a/configure.in +++ b/configure.in @@ -425,6 +425,9 @@ fi if test "$GCC" = "yes"; then GNU_CC=1 fi +if test "$GXX" = "yes"; then + GNU_CXX=1 +fi if test "`echo | $AS -V 2>&1 | grep -c GNU`" != "0"; then GNU_AS=1 fi @@ -436,6 +439,42 @@ else CROSS_COMPILE= fi +dnl ======================================================== +dnl Check for gcc -pipe support +dnl ======================================================== +AC_MSG_CHECKING([for gcc -pipe support]) +if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then + echo '#include <stdio.h>' > dummy-hello.c + echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c + ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5 + cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5 + if test $? = 0; then + _res_as_stdin="yes" + else + _res_as_stdin="no" + fi + if test "$_res_as_stdin" = "yes"; then + _SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -pipe" + AC_TRY_COMPILE( [ #include <stdio.h> ], + [printf("Hello World\n");], + [_res_gcc_pipe="yes"], + [_res_gcc_pipe="no"] ) + CFLAGS=$_SAVE_CFLAGS + fi + if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then + _res="yes"; + CFLAGS="$CFLAGS -pipe" + CXXFLAGS="$CXXFLAGS -pipe" + else + _res="no" + fi + rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out + AC_MSG_RESULT([$_res]) +else + AC_MSG_RESULT([no]) +fi + fi # SKIP_COMPILER_CHECKS dnl ======================================================== @@ -788,7 +827,7 @@ case "$target" in AC_DEFINE(XP_UNIX) AC_DEFINE(DARWIN) AC_DEFINE(HAVE_BSD_FLOCK) - CFLAGS="$CFLAGS -Wmost -fno-common -pipe" + CFLAGS="$CFLAGS -Wmost -fno-common" if echo $OS_TEST | grep -c 86 2>/dev/null; then CFLAGS="$CFLAGS -mno-486" AC_DEFINE(i386) @@ -830,7 +869,7 @@ case "$target" in AC_DEFINE(XP_UNIX) AC_DEFINE(FREEBSD) AC_DEFINE(HAVE_BSD_FLOCK) - CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall -pipe" + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall" MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` if test "$MOZ_OBJFORMAT" = "elf"; then DLL_SUFFIX=so @@ -1070,8 +1109,8 @@ case "$target" in AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) AC_DEFINE(LINUX) AC_DEFINE(linux) - CFLAGS="$CFLAGS -ansi -Wall -pipe" - CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" + CFLAGS="$CFLAGS -ansi -Wall" + CXXFLAGS="$CXXFLAGS -ansi -Wall" MDCPUCFG_H=_linux.cfg PR_MD_CSRCS=linux.c MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' @@ -1258,8 +1297,8 @@ case "$target" in CFLAGS="$CFLAGS -Hnocopyr" CXXFLAGS="$CXXFLAGS -Hnocopyr" else - CFLAGS="$CFLAGS -fPIC -Wall -pipe" - CXXFLAGS="$CXXFLAGS -fPIC -Wall -pipe" + CFLAGS="$CFLAGS -fPIC -Wall" + CXXFLAGS="$CXXFLAGS -fPIC -Wall" DSO_LDOPTS=-G fi MDCPUCFG_H=_ncr.cfg @@ -1292,8 +1331,8 @@ mips-nec-sysv*) PR_MD_CSRCS=netbsd.c DSO_CFLAGS='-fPIC -DPIC' - CFLAGS="$CFLAGS -ansi -Wall -pipe" - CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" + CFLAGS="$CFLAGS -ansi -Wall" + CXXFLAGS="$CXXFLAGS -ansi -Wall" MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)' if test -z "$OBJECT_FMT"; then @@ -1334,8 +1373,8 @@ mips-sony-newsos*) AC_DEFINE(NEXTSTEP) AC_DEFINE(HAVE_BSD_FLOCK) AC_DEFINE(_POSIX_SOURCE) - CFLAGS="$CFLAGS -Wall -fno-common -pipe -traditional-cpp -posix" - CXXFLAGS="$CXXFLAGS -Wall -fno-common -pipe -traditional-cpp -posix" + CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix" + CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix" USE_NSPR_THREADS=1 DLL_SUFFIX=dylib MDCPUCFG_H=_nextstep.cfg @@ -1362,8 +1401,8 @@ mips-sony-newsos*) AC_DEFINE(XP_UNIX) AC_DEFINE(OPENBSD) AC_DEFINE(HAVE_BSD_FLOCK) - CFLAGS="$CFLAGS -ansi -Wall -pipe" - CXXFLAGS="$CXXFLAGS -ansi -Wall -pipe" + CFLAGS="$CFLAGS -ansi -Wall" + CXXFLAGS="$CXXFLAGS -ansi -Wall" DLL_SUFFIX=so.1.0 DSO_CFLAGS=-fPIC MDCPUCFG_H=_openbsd.cfg @@ -1475,7 +1514,6 @@ mips-sony-newsos*) AS='$(CC) -x assembler-with-cpp' if test "$CPU_ARCH" = "mips"; then LD=gld - CFLAGS="$CFLAGS -pipe" fi CFLAGS="$CFLAGS -Wall -Wno-format" else |