diff --git a/nsprpub/config/autoconf.mk.in b/nsprpub/config/autoconf.mk.in index e551755cf0c..08d44021862 100644 --- a/nsprpub/config/autoconf.mk.in +++ b/nsprpub/config/autoconf.mk.in @@ -23,7 +23,8 @@ CLASSIC_NSPR = @USE_NSPR_THREADS@ AS = @AS@ CC = @CC@ CCC = @CXX@ -AR = @AR@ cr $@ +AR = @AR@ +AR_FLAGS = @AR_FLAGS@ RANLIB = @RANLIB@ PERL = @PERL@ DLLTOOL = @DLLTOOL@ diff --git a/nsprpub/config/rules.mk b/nsprpub/config/rules.mk index a0065556a07..31bd759b710 100644 --- a/nsprpub/config/rules.mk +++ b/nsprpub/config/rules.mk @@ -267,8 +267,12 @@ $(LIBRARY): $(OBJS) rm -f $@ ifdef XP_OS2_VACPP $(AR) $(subst /,\\,$(OBJS)) $(AR_EXTRA_ARGS) +else +ifdef USE_AUTOCONF + $(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS) else $(AR) $(OBJS) $(AR_EXTRA_ARGS) +endif # USE_AUTOCONF endif $(RANLIB) $@ diff --git a/nsprpub/configure b/nsprpub/configure index 7f4eab4f227..fe54408ab3f 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -2244,6 +2244,7 @@ DLL_SUFFIX=so MKSHLIB='$(CCC) -shared -o $@' PR_MD_ASFILES= PR_MD_CSRCS= +AR_FLAGS='cr $@' case "$host" in *-mingw*) @@ -2254,6 +2255,29 @@ case "$host" in esac case "$target" in + +*-nto*) + cat >> confdefs.h <<\EOF +#define XP_UNIX 1 +EOF + + MDCPUCFG_H=_nto.cfg + PR_MD_CSRCS=nto.c + PR_MD_ARCH_DIR=unix + MKSHLIB='qcc -Vgcc_ntox86 -shared -Wl,-h$(@:$(OBJDIR)/%.so=%.so) -o $(@:$(OBJDIR)/%.so=%.so)' + CFLAGS="$CFLAGS -Wc,-Wall -Wc,-Wno-parentheses -DNTO -D_QNX_SOURCE -DHAVE_POINTER_LOCALTIME_R -shared" + OS_LIBS="-lsocket" + _OPTIMIZE_FLAGS="-O2" + _DEBUG_FLAGS="-O2 -gdwarf-2" + COMPILER_TAG="_qcc" + CC="qcc -Vgcc_ntox86 -w" + CXX="QCC -Vgcc_ntox86 -w" + CPP="qcc -Vgcc_ntox86 -w" + LD="qcc -Vgcc_ntox86 -nostdlib" + AR="qcc -Vgcc_ntox86 -M -a " + AR_FLAGS="$@" + ;; + *-beos*) cat >> confdefs.h <<\EOF #define XP_BEOS 1 @@ -2456,6 +2480,7 @@ EOF ;; esac ;; + esac if test "$enable_shared" = no; then @@ -2466,7 +2491,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2470: checking how to run the C preprocessor" >&5 +echo "configure:2495: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2481,13 +2506,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2516: \"$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 : @@ -2498,13 +2523,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2533: \"$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 : @@ -2515,13 +2540,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2550: \"$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 : @@ -2547,13 +2572,13 @@ echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:2551: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:2576: 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 < Autoconf TIOCGETP @@ -2571,7 +2596,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -2595,12 +2620,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2599: checking for $ac_func" >&5 +echo "configure:2624: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2652: \"$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 @@ -2674,7 +2699,7 @@ fi echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 -echo "configure:2678: checking for pthread_attr_init in -lpthread" >&5 +echo "configure:2703: checking for pthread_attr_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2682,7 +2707,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2722: \"$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 @@ -2712,7 +2737,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6 -echo "configure:2716: checking for pthread_attr_init in -lc_r" >&5 +echo "configure:2741: checking for pthread_attr_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2720,7 +2745,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2760: \"$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 @@ -2750,7 +2775,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_attr_init in -lc""... $ac_c" 1>&6 -echo "configure:2754: checking for pthread_attr_init in -lc" >&5 +echo "configure:2779: checking for pthread_attr_init in -lc" >&5 ac_lib_var=`echo c'_'pthread_attr_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2758,7 +2783,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2798: \"$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 @@ -2898,7 +2923,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:2902: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:2927: 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 @@ -2946,12 +2971,12 @@ EOF esac echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 -echo "configure:2950: checking for pthread_create" >&5 +echo "configure:2975: checking for pthread_create" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_create=yes" else @@ -2993,7 +3018,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:2997: checking for pthread_create in -lpthread" >&5 +echo "configure:3022: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3001,7 +3026,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3041: \"$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 @@ -3068,12 +3093,12 @@ EOF esac echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:3072: checking for dlopen" >&5 +echo "configure:3097: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3125: \"$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 @@ -3115,7 +3140,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:3119: checking for dlopen in -ldl" >&5 +echo "configure:3144: 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 @@ -3123,7 +3148,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3163: \"$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 @@ -3215,6 +3240,7 @@ fi + trap '' 1 2 15 @@ -3459,6 +3485,7 @@ s%@LIB_SUFFIX@%$LIB_SUFFIX%g s%@DLL_SUFFIX@%$DLL_SUFFIX%g s%@MKSHLIB@%$MKSHLIB%g s%@DEFINES@%$DEFINES%g +s%@AR_FLAGS@%$AR_FLAGS%g s%@OS_LIBS@%$OS_LIBS%g s%@EXTRA_LIBS@%$EXTRA_LIBS%g diff --git a/nsprpub/configure.in b/nsprpub/configure.in index f320a907036..38d05e39c84 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -218,6 +218,7 @@ DLL_SUFFIX=so MKSHLIB='$(CCC) -shared -o $@' PR_MD_ASFILES= PR_MD_CSRCS= +AR_FLAGS='cr $@' dnl ======================================================== dnl Override of system specific host options @@ -234,6 +235,26 @@ dnl ======================================================== dnl Override of system specific target options dnl ======================================================== case "$target" in + +*-nto*) + AC_DEFINE(XP_UNIX) + MDCPUCFG_H=_nto.cfg + PR_MD_CSRCS=nto.c + PR_MD_ARCH_DIR=unix + MKSHLIB='qcc -Vgcc_ntox86 -shared -Wl,-h$(@:$(OBJDIR)/%.so=%.so) -o $(@:$(OBJDIR)/%.so=%.so)' + CFLAGS="$CFLAGS -Wc,-Wall -Wc,-Wno-parentheses -DNTO -D_QNX_SOURCE -DHAVE_POINTER_LOCALTIME_R -shared" + OS_LIBS="-lsocket" + _OPTIMIZE_FLAGS="-O2" + _DEBUG_FLAGS="-O2 -gdwarf-2" + COMPILER_TAG="_qcc" + CC="qcc -Vgcc_ntox86 -w" + CXX="QCC -Vgcc_ntox86 -w" + CPP="qcc -Vgcc_ntox86 -w" + LD="qcc -Vgcc_ntox86 -nostdlib" + AR="qcc -Vgcc_ntox86 -M -a " + AR_FLAGS="$@" + ;; + *-beos*) AC_DEFINE(XP_BEOS) AC_DEFINE(BeOS) @@ -379,6 +400,7 @@ case "$target" in ;; esac ;; + esac dnl Turn off shared libraries if asked to do so. @@ -685,6 +707,7 @@ AC_SUBST(MKSHLIB) AC_SUBST(DEFINES) AC_SUBST(DEFS) AC_SUBST(AR) +AC_SUBST(AR_FLAGS) AC_SUBST(DLLTOOL) AC_SUBST(WINDRES) AC_SUBST(RANLIB)