diff options
-rw-r--r-- | config/BeOS.mk | 1 | ||||
-rw-r--r-- | config/Linux.mk | 2 | ||||
-rw-r--r-- | config/OS2.mk | 1 | ||||
-rw-r--r-- | config/UNIX.mk | 1 | ||||
-rw-r--r-- | config/WIN32.mk | 1 | ||||
-rw-r--r-- | config/autoconf.mk.in | 3 | ||||
-rw-r--r-- | config/rules.mk | 6 | ||||
-rw-r--r-- | config/win16.mk | 1 | ||||
-rwxr-xr-x | configure | 116 | ||||
-rw-r--r-- | configure.in | 4 |
10 files changed, 101 insertions, 35 deletions
diff --git a/config/BeOS.mk b/config/BeOS.mk index 87dc2085..ef2a6a46 100644 --- a/config/BeOS.mk +++ b/config/BeOS.mk @@ -30,6 +30,7 @@ OBJ_SUFFIX = o LIB_SUFFIX = a DLL_SUFFIX = so AR = ar cr $@ +STRIP = strip ifdef BUILD_OPT DEFINES = -UDEBUG -DNDEBUG diff --git a/config/Linux.mk b/config/Linux.mk index 72dcc2d7..c7aae11b 100644 --- a/config/Linux.mk +++ b/config/Linux.mk @@ -99,6 +99,8 @@ endif MKSHLIB = $(LD) $(DSO_LDOPTS) -soname $(notdir $@) ifdef BUILD_OPT OPTIMIZER = -O2 +# invoke 'strip' on *.so files in optimized builds +STRIP = strip endif ###################################################################### diff --git a/config/OS2.mk b/config/OS2.mk index ec67d2a5..dba3901d 100644 --- a/config/OS2.mk +++ b/config/OS2.mk @@ -53,6 +53,7 @@ LINK = -ilink AR = -ilib /noignorecase /nologo /Out:$(subst /,\\,$@) RANLIB = @echo RANLIB BSDECHO = @echo BSDECHO +STRIP = @echo STRIP NSINSTALL = nsinstall INSTALL = $(NSINSTALL) MAKE_OBJDIR = if test ! -d $(OBJDIR); then mkdir $(OBJDIR); fi diff --git a/config/UNIX.mk b/config/UNIX.mk index b9868973..e3fab8d1 100644 --- a/config/UNIX.mk +++ b/config/UNIX.mk @@ -21,6 +21,7 @@ OBJ_SUFFIX = o LIB_SUFFIX = a DLL_SUFFIX = so AR = ar cr $@ +STRIP = true ifdef BUILD_OPT OPTIMIZER = -O diff --git a/config/WIN32.mk b/config/WIN32.mk index 8c4fc172..9121d724 100644 --- a/config/WIN32.mk +++ b/config/WIN32.mk @@ -35,6 +35,7 @@ LINK = link AR = lib -NOLOGO -OUT:"$@" RANLIB = echo BSDECHO = echo +STRIP = echo NSINSTALL = nsinstall INSTALL = $(NSINSTALL) define MAKE_OBJDIR diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index 83b7a86f..8979f323 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -10,6 +10,8 @@ DLL_SUFFIX = @DLL_SUFFIX@ MOD_VERSION = @NSPR_VERSION@ MOD_NAME = @NSPR_MODNAME@ +BUILD_OPT = @MOZ_OPTIMIZE@ + USE_CPLUS = @USE_CPLUS@ USE_IPV6 = @USE_IPV6@ USE_N32 = @USE_N32@ @@ -32,6 +34,7 @@ PERL = @PERL@ DLLTOOL = @DLLTOOL@ WINDRES = @WINDRES@ RC = $(WINDRES) +STRIP = @STRIP@ OS_CFLAGS = @CFLAGS@ $(DSO_CFLAGS) OS_CXXFLAGS = @CXXFLAGS@ $(DSO_CFLAGS) diff --git a/config/rules.mk b/config/rules.mk index 968c2880..0a3dc334 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -269,6 +269,9 @@ else $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) endif endif +ifdef BUILD_OPT + $(STRIP) $@ +endif $(LIBRARY): $(OBJS) @$(MAKE_OBJDIR) @@ -355,6 +358,9 @@ endif # OS2 endif # WINNT endif # AIX 4.1 endif # USE_AUTOCONF +ifdef BUILD_OPT + $(STRIP) $@ +endif ifeq (,$(filter-out WINNT OS2,$(OS_ARCH))) diff --git a/config/win16.mk b/config/win16.mk index e1cfd938..d47ed561 100644 --- a/config/win16.mk +++ b/config/win16.mk @@ -55,6 +55,7 @@ AR = wlib -q $@ RC = wrc.exe /r /dWIN16=1 /bt=windows RANLIB = echo BSDECHO = echo +STRIP = echo NSINSTALL = nsinstall INSTALL = $(NSINSTALL) MAKE_OBJDIR = mkdir $(OBJDIR) @@ -2325,6 +2325,47 @@ test -n "$PERL" && break done test -n "$PERL" || PERL=":" +for ac_prog in strip +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:2334: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$STRIP" in + /*) + ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_STRIP="$STRIP" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_STRIP="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +STRIP="$ac_cv_path_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$STRIP" && break +done +test -n "$STRIP" || STRIP=":" + OBJ_SUFFIX=o LIB_SUFFIX=a @@ -3099,7 +3140,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3103: checking how to run the C preprocessor" >&5 +echo "configure:3144: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3114,13 +3155,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 3118 "configure" +#line 3159 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3165: \"$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 : @@ -3131,13 +3172,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 3135 "configure" +#line 3176 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3182: \"$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 : @@ -3148,13 +3189,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 3152 "configure" +#line 3193 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3199: \"$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 : @@ -3180,13 +3221,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:3184: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3225: 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 3190 "configure" +#line 3231 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -3204,7 +3245,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 3208 "configure" +#line 3249 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -3228,12 +3269,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3232: checking for $ac_func" >&5 +echo "configure:3273: 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 3237 "configure" +#line 3278 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3256,7 +3297,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3301: \"$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 @@ -3284,7 +3325,7 @@ done echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6 -echo "configure:3288: checking for pthread_attr_init in -lpthread" >&5 +echo "configure:3329: 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 @@ -3292,7 +3333,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <<EOF -#line 3296 "configure" +#line 3337 "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 @@ -3303,7 +3344,7 @@ int main() { pthread_attr_init() ; return 0; } EOF -if { (eval echo configure:3307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3348: \"$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 @@ -3322,7 +3363,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:3326: checking for pthread_attr_init in -lc_r" >&5 +echo "configure:3367: 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 @@ -3330,7 +3371,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <<EOF -#line 3334 "configure" +#line 3375 "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 @@ -3341,7 +3382,7 @@ int main() { pthread_attr_init() ; return 0; } EOF -if { (eval echo configure:3345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3386: \"$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 @@ -3360,7 +3401,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:3364: checking for pthread_attr_init in -lc" >&5 +echo "configure:3405: 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 @@ -3368,7 +3409,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <<EOF -#line 3372 "configure" +#line 3413 "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 @@ -3379,7 +3420,7 @@ int main() { pthread_attr_init() ; return 0; } EOF -if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3424: \"$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 @@ -3506,7 +3547,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:3510: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:3551: 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 @@ -3576,12 +3617,12 @@ EOF esac echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 -echo "configure:3580: checking for pthread_create" >&5 +echo "configure:3621: 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 <<EOF -#line 3585 "configure" +#line 3626 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pthread_create(); below. */ @@ -3604,7 +3645,7 @@ pthread_create(); ; return 0; } EOF -if { (eval echo configure:3608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3649: \"$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 @@ -3623,7 +3664,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:3627: checking for pthread_create in -lpthread" >&5 +echo "configure:3668: 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 @@ -3631,7 +3672,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <<EOF -#line 3635 "configure" +#line 3676 "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 @@ -3642,7 +3683,7 @@ int main() { pthread_create() ; return 0; } EOF -if { (eval echo configure:3646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3687: \"$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 @@ -3741,12 +3782,12 @@ EOF esac echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:3745: checking for dlopen" >&5 +echo "configure:3786: 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 3750 "configure" +#line 3791 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen(); below. */ @@ -3769,7 +3810,7 @@ dlopen(); ; return 0; } EOF -if { (eval echo configure:3773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3814: \"$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 @@ -3788,7 +3829,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:3792: checking for dlopen in -ldl" >&5 +echo "configure:3833: 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 @@ -3796,7 +3837,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3800 "configure" +#line 3841 "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 @@ -3807,7 +3848,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:3811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3852: \"$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 @@ -3902,6 +3943,9 @@ fi + + + MAKEFILES=" Makefile config/Makefile @@ -4119,10 +4163,12 @@ s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@LN_S@%$LN_S%g s%@PERL@%$PERL%g +s%@STRIP@%$STRIP%g s%@CPP@%$CPP%g s%@MOZILLA_CLIENT@%$MOZILLA_CLIENT%g s%@HOST_CFLAGS@%$HOST_CFLAGS%g s%@GNU_CC@%$GNU_CC%g +s%@MOZ_OPTIMIZE@%$MOZ_OPTIMIZE%g s%@USE_CPLUS@%$USE_CPLUS%g s%@USE_IPV6@%$USE_IPV6%g s%@USE_N32@%$USE_N32%g diff --git a/configure.in b/configure.in index 0c1798c5..8301b599 100644 --- a/configure.in +++ b/configure.in @@ -234,6 +234,7 @@ dnl ======================================================== AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROGS(PERL, perl5 perl, :) +AC_PATH_PROGS(STRIP, strip, :) dnl ======================================================== dnl Default platform specific options @@ -1027,6 +1028,8 @@ AC_SUBST(HOST_CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(GNU_CC) +AC_SUBST(MOZ_OPTIMIZE) + AC_SUBST(USE_CPLUS) AC_SUBST(USE_IPV6) AC_SUBST(USE_N32) @@ -1069,6 +1072,7 @@ AC_SUBST(DLLTOOL) AC_SUBST(WINDRES) AC_SUBST(RANLIB) AC_SUBST(PERL) +AC_SUBST(STRIP) AC_SUBST(OS_LIBS) AC_SUBST(RESOLVE_LINK_SYMBOLS) |