diff options
author | wtc%netscape.com <devnull@localhost> | 2003-03-22 15:28:58 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2003-03-22 15:28:58 +0000 |
commit | f8b302ffe9aa168916ff5a85914e2139c881cdba (patch) | |
tree | 60d5defc5038682a5263e38680793096b2cb6b24 | |
parent | 5c6226f80be2eacf83b8af53b1d83287afcf3427 (diff) | |
download | nspr-hg-f8b302ffe9aa168916ff5a85914e2139c881cdba.tar.gz |
Bug 196004: support building with gcc on Solaris better, whether gcc uses
the GNU ld or Solaris ld. Do not pass -B/usr/ccs/bin/ to gcc.
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
Modified files: configure configure.in autoconf.mk.in
lib/ds/Makefile.in lib/libc/src/Makefile.in pr/src/Makefile.in
-rw-r--r-- | config/autoconf.mk.in | 1 | ||||
-rwxr-xr-x | configure | 45 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | lib/ds/Makefile.in | 4 | ||||
-rw-r--r-- | lib/libc/src/Makefile.in | 4 | ||||
-rw-r--r-- | pr/src/Makefile.in | 4 |
6 files changed, 43 insertions, 21 deletions
diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index d8b8eb17..a83ac501 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -55,6 +55,7 @@ ASFLAGS = @ASFLAGS@ CC = @CC@ CCC = @CXX@ NS_USE_GCC = @GNU_CC@ +GCC_USE_GNU_LD = @GCC_USE_GNU_LD@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ LD = @LD@ @@ -4444,7 +4444,10 @@ EOF RESOLVE_LINK_SYMBOLS=1 if test -n "$GNU_CC"; then DSO_CFLAGS=-fPIC - DSO_LDOPTS='-B/usr/ccs/bin/ -shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs' + if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then + GCC_USE_GNU_LD=1 + fi + DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs' else DSO_CFLAGS=-KPIC DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs' @@ -4712,12 +4715,12 @@ esac if test -z "$SKIP_LIBRARY_CHECKS"; then echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4716: checking for dlopen" >&5 +echo "configure:4719: 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 4721 "configure" +#line 4724 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen(); below. */ @@ -4740,7 +4743,7 @@ dlopen(); ; return 0; } EOF -if { (eval echo configure:4744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4747: \"$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 @@ -4759,7 +4762,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4763: checking for dlopen in -ldl" >&5 +echo "configure:4766: 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 @@ -4767,7 +4770,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4771 "configure" +#line 4774 "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 @@ -4778,7 +4781,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4785: \"$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 @@ -4806,13 +4809,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:4810: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:4813: 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 4816 "configure" +#line 4819 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -4830,7 +4833,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 4834 "configure" +#line 4837 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -4854,12 +4857,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4858: checking for $ac_func" >&5 +echo "configure:4861: 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 4863 "configure" +#line 4866 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4882,7 +4885,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4889: \"$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 @@ -4921,7 +4924,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:4925: checking for +Olit support" >&5 +echo "configure:4928: 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 @@ -4955,7 +4958,7 @@ esac echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:4959: checking for pthread_create in -lpthreads" >&5 +echo "configure:4962: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -4977,7 +4980,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4981: checking for pthread_create in -lpthread" >&5 +echo "configure:4984: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -4999,7 +5002,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5003: checking for pthread_create in -lc_r" >&5 +echo "configure:5006: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5021,7 +5024,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5025: checking for pthread_create in -lc" >&5 +echo "configure:5028: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5173,7 +5176,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:5177: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5180: 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 @@ -5196,7 +5199,7 @@ echo "configure:5177: 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:5200: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5203: 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 @@ -5588,6 +5591,7 @@ esac + MAKEFILES=" Makefile config/Makefile @@ -5816,6 +5820,7 @@ s%@SHELL_OVERRIDE@%$SHELL_OVERRIDE%g s%@MOZILLA_CLIENT@%$MOZILLA_CLIENT%g s%@HOST_CFLAGS@%$HOST_CFLAGS%g s%@GNU_CC@%$GNU_CC%g +s%@GCC_USE_GNU_LD@%$GCC_USE_GNU_LD%g s%@CROSS_COMPILE@%$CROSS_COMPILE%g s%@MOZ_OPTIMIZE@%$MOZ_OPTIMIZE%g s%@USE_CPLUS@%$USE_CPLUS%g diff --git a/configure.in b/configure.in index 40743691..91e0d4ee 100644 --- a/configure.in +++ b/configure.in @@ -1661,7 +1661,10 @@ mips-sony-newsos*) RESOLVE_LINK_SYMBOLS=1 if test -n "$GNU_CC"; then DSO_CFLAGS=-fPIC - DSO_LDOPTS='-B/usr/ccs/bin/ -shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs' + if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then + GCC_USE_GNU_LD=1 + fi + DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs' else DSO_CFLAGS=-KPIC DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs' @@ -2362,6 +2365,7 @@ AC_SUBST(HOST_CC) AC_SUBST(HOST_CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(GNU_CC) +AC_SUBST(GCC_USE_GNU_LD) AC_SUBST(CROSS_COMPILE) AC_SUBST(MOZ_OPTIMIZE) diff --git a/lib/ds/Makefile.in b/lib/ds/Makefile.in index 7814556a..08b4dd3d 100644 --- a/lib/ds/Makefile.in +++ b/lib/ds/Makefile.in @@ -85,7 +85,11 @@ OS_LIBS = -lc MAPFILE = $(OBJDIR)/pldsmap.sun GARBAGE += $(MAPFILE) ifdef NS_USE_GCC +ifdef GCC_USE_GNU_LD +MKSHLIB += -Wl,--version-script,$(MAPFILE) +else MKSHLIB += -Wl,-M,$(MAPFILE) +endif else MKSHLIB += -M $(MAPFILE) endif diff --git a/lib/libc/src/Makefile.in b/lib/libc/src/Makefile.in index 77379f35..39f71a3c 100644 --- a/lib/libc/src/Makefile.in +++ b/lib/libc/src/Makefile.in @@ -95,7 +95,11 @@ OS_LIBS = -lc MAPFILE = $(OBJDIR)/plcmap.sun GARBAGE += $(MAPFILE) ifdef NS_USE_GCC +ifdef GCC_USE_GNU_LD +MKSHLIB += -Wl,--version-script,$(MAPFILE) +else MKSHLIB += -Wl,-M,$(MAPFILE) +endif else MKSHLIB += -M $(MAPFILE) endif diff --git a/pr/src/Makefile.in b/pr/src/Makefile.in index f33f124d..7118c97f 100644 --- a/pr/src/Makefile.in +++ b/pr/src/Makefile.in @@ -72,7 +72,11 @@ else # 4.1.3_U1 MAPFILE = $(OBJDIR)/nsprmap.sun GARBAGE += $(MAPFILE) ifdef NS_USE_GCC +ifdef GCC_USE_GNU_LD +MKSHLIB += -Wl,--version-script,$(MAPFILE) +else MKSHLIB += -Wl,-M,$(MAPFILE) +endif else MKSHLIB += -M $(MAPFILE) endif |