diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index 14cb336877f5..79ade8dab223 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_8_9_BETA1 +NSPR_4_8_9_BETA2 diff --git a/nsprpub/build/autoconf/config.sub b/nsprpub/build/autoconf/config.sub index 724382959124..3fad4d748241 100755 --- a/nsprpub/build/autoconf/config.sub +++ b/nsprpub/build/autoconf/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2009-12-04' +timestamp='2011-01-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -1432,6 +1432,9 @@ case $os in -dicos*) os=-dicos ;; + -android*) + os=android + ;; -none) ;; *) @@ -1686,6 +1689,9 @@ case $basic_machine in -vos*) vendor=stratus ;; + *-android*|*-linuxandroid*) + vendor=linux- + ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; diff --git a/nsprpub/build/win32/pgomerge.py b/nsprpub/build/win32/pgomerge.py new file mode 100644 index 000000000000..383457bf2ee1 --- /dev/null +++ b/nsprpub/build/win32/pgomerge.py @@ -0,0 +1,40 @@ +#!/usr/bin/python +# Usage: pgomerge.py +# Gathers .pgc files from dist/bin and merges them into +# $PWD/$basename.pgd using pgomgr, then deletes them. +# No errors if any of these files don't exist. + +import sys, os, os.path, subprocess +if not sys.platform == "win32": + raise Exception("This script was only meant for Windows.") + +def MergePGOFiles(basename, pgddir, pgcdir): + """Merge pgc files produced from an instrumented binary + into the pgd file for the second pass of profile-guided optimization + with MSVC. |basename| is the name of the DLL or EXE without the + extension. |pgddir| is the path that contains .pgd + (should be the objdir it was built in). |pgcdir| is the path + containing basename!N.pgc files, which is probably dist/bin. + Calls pgomgr to merge each pgc file into the pgd, then deletes + the pgc files.""" + if not os.path.isdir(pgddir) or not os.path.isdir(pgcdir): + return + pgdfile = os.path.abspath(os.path.join(pgddir, basename + ".pgd")) + if not os.path.isfile(pgdfile): + return + for file in os.listdir(pgcdir): + if file.startswith(basename+"!") and file.endswith(".pgc"): + try: + pgcfile = os.path.normpath(os.path.join(pgcdir, file)) + subprocess.call(['pgomgr', '-merge', + pgcfile, + pgdfile]) + os.remove(pgcfile) + except OSError: + pass + +if __name__ == '__main__': + if len(sys.argv) != 3: + print >>sys.stderr, "Usage: pgomerge.py " + sys.exit(1) + MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2]) diff --git a/nsprpub/config/config.mk b/nsprpub/config/config.mk index f47d8fee805f..cfb9f3f2552c 100644 --- a/nsprpub/config/config.mk +++ b/nsprpub/config/config.mk @@ -78,11 +78,13 @@ LDFLAGS = $(OS_LDFLAGS) ifdef MOZ_PROFILE_GENERATE CFLAGS += $(PROFILE_GEN_CFLAGS) LDFLAGS += $(PROFILE_GEN_LDFLAGS) +DLLFLAGS += $(PROFILE_GEN_LDFLAGS) endif # MOZ_PROFILE_GENERATE ifdef MOZ_PROFILE_USE CFLAGS += $(PROFILE_USE_CFLAGS) LDFLAGS += $(PROFILE_USE_LDFLAGS) +DLLFLAGS += $(PROFILE_USE_LDFLAGS) endif # MOZ_PROFILE_USE define MAKE_OBJDIR diff --git a/nsprpub/config/rules.mk b/nsprpub/config/rules.mk index 344ad2e5ff68..a8ee19548d97 100644 --- a/nsprpub/config/rules.mk +++ b/nsprpub/config/rules.mk @@ -280,6 +280,13 @@ $(NFSPWD): $(PROGRAM): $(OBJS) @$(MAKE_OBJDIR) ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) +ifdef MOZ_PROFILE_USE +# In the second pass, we need to merge the pgc files into the pgd file. +# The compiler would do this for us automatically if they were in the right +# place, but they're in dist/bin. + python $(topsrcdir)/build/win32/pgomerge.py \ + $(notdir $(PROGRAM:.exe=)) $(DIST)/bin +endif # MOZ_PROFILE_USE $(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) ifdef MT @if test -f $@.manifest; then \ @@ -287,6 +294,11 @@ ifdef MT rm -f $@.manifest; \ fi endif # MSVC with manifest tool +ifdef MOZ_PROFILE_GENERATE +# touch it a few seconds into the future to work around FAT's +# 2-second granularity + touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink +endif # MOZ_PROFILE_GENERATE else # WINNT && !GCC $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) endif # WINNT && !GCC @@ -326,6 +338,10 @@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) else # AIX 4.1 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) +ifdef MOZ_PROFILE_USE + python $(topsrcdir)/build/win32/pgomerge.py \ + $(notdir $(SHARED_LIBRARY:.$(DLL_SUFFIX)=)) $(DIST)/bin +endif # MOZ_PROFILE_USE $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES) ifdef MT @if test -f $@.manifest; then \ @@ -333,6 +349,9 @@ ifdef MT rm -f $@.manifest; \ fi endif # MSVC with manifest tool +ifdef MOZ_PROFILE_GENERATE + touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink +endif # MOZ_PROFILE_GENERATE else # WINNT && !GCC $(MKSHLIB) $(OBJS) $(RES) $(LDFLAGS) $(EXTRA_LIBS) endif # WINNT && !GCC @@ -341,6 +360,24 @@ ifdef ENABLE_STRIP $(STRIP) $@ endif +################################################################################ + +ifdef MOZ_PROFILE_USE +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) +# When building with PGO, we have to make sure to re-link +# in the MOZ_PROFILE_USE phase if we linked in the +# MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink +# file in the link rule in the GENERATE phase to indicate +# that we need a relink. +$(SHARED_LIBRARY): pgo.relink + +$(PROGRAM): pgo.relink + +endif # WINNT && !GCC +endif # MOZ_PROFILE_USE + +################################################################################ + ifeq ($(OS_ARCH),WINNT) $(RES): $(RESNAME) @$(MAKE_OBJDIR) diff --git a/nsprpub/configure b/nsprpub/configure index 7c0b6434c3d1..18c10eb2e370 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -842,7 +842,20 @@ if test "${with_android_platform+set}" = set; then fi -if test "$target" = "arm-android-eabi" ; then +case "$target" in +arm-linux*-android*|*-linuxandroid*) + android_tool_prefix="arm-linux-androideabi" + ;; +arm-android-eabi) + android_tool_prefix="arm-eabi" + ;; +*) + android_tool_prefix="$target_os" + ;; +esac + +case "$target" in +*-android*|*-linuxandroid*) if test -z "$android_ndk" ; then { echo "configure: error: You must specify --with-android-ndk=/path/to/ndk when targeting Android." 1>&2; exit 1; } fi @@ -855,14 +868,14 @@ if test "$target" = "arm-android-eabi" ; then android_platform="$android_ndk"/build/platforms/android-5/arch-arm fi - AS="$android_toolchain"/bin/arm-eabi-as - CC="$android_toolchain"/bin/arm-eabi-gcc - CXX="$android_toolchain"/bin/arm-eabi-g++ - CPP="$android_toolchain"/bin/arm-eabi-cpp - LD="$android_toolchain"/bin/arm-eabi-ld - AR="$android_toolchain"/bin/arm-eabi-ar - RANLIB="$android_toolchain"/bin/arm-eabi-ranlib - STRIP="$android_toolchain"/bin/arm-eabi-strip + AS="$android_toolchain"/bin/"$android_tool_prefix"-as + CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc + CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++ + CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp + LD="$android_toolchain"/bin/"$android_tool_prefix"-ld + AR="$android_toolchain"/bin/"$android_tool_prefix"-ar + RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib + STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS" CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions $CFLAGS" @@ -888,7 +901,8 @@ if test "$target" = "arm-android-eabi" ; then #define ANDROID 1 EOF -fi + ;; +esac dist_prefix='${MOD_DEPTH}/dist' dist_bindir='${dist_prefix}/bin' @@ -1182,7 +1196,7 @@ if test -z "$SKIP_PATH_CHECKS"; then # Extract the first word of "$WHOAMI whoami", so it can be a program name with args. set dummy $WHOAMI whoami; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1186: checking for $ac_word" >&5 +echo "configure:1200: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1253,13 +1267,13 @@ if test "$target" != "$host"; then _SAVE_LDFLAGS="$LDFLAGS" echo $ac_n "checking for $host compiler""... $ac_c" 1>&6 -echo "configure:1257: checking for $host compiler" >&5 +echo "configure:1271: checking for $host compiler" >&5 for ac_prog in $HOST_CC gcc cc /usr/ucb/cc 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:1263: checking for $ac_word" >&5 +echo "configure:1277: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1305,16 +1319,16 @@ test -n "$HOST_CC" || HOST_CC="""" LDFLAGS="$HOST_LDFLAGS" echo $ac_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1309: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 +echo "configure:1323: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_prog_host_cc_works=1 echo "$ac_t""yes" 1>&6 else @@ -1343,7 +1357,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:1347: checking for $ac_word" >&5 +echo "configure:1361: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1377,7 +1391,7 @@ test -n "$CC" || CC="echo" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1381: checking for $ac_word" >&5 +echo "configure:1395: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1407,7 +1421,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1411: checking for $ac_word" >&5 +echo "configure:1425: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1458,7 +1472,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1462: checking for $ac_word" >&5 +echo "configure:1476: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1490,7 +1504,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1494: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1508: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1501,12 +1515,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1505 "configure" +#line 1519 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1532,12 +1546,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1536: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1550: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1541: checking whether we are using GNU C" >&5 +echo "configure:1555: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1546,7 +1560,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1565,7 +1579,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1569: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1583: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1602,7 +1616,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:1606: checking for $ac_word" >&5 +echo "configure:1620: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1638,7 +1652,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:1642: checking for $ac_word" >&5 +echo "configure:1656: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1670,7 +1684,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1674: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1688: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1681,12 +1695,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1685 "configure" +#line 1699 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1712,12 +1726,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1716: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1730: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1721: checking whether we are using GNU C++" >&5 +echo "configure:1735: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1726,7 +1740,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1745,7 +1759,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1749: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1763: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1790,7 +1804,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:1794: checking for $ac_word" >&5 +echo "configure:1808: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1825,7 +1839,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:1829: checking for $ac_word" >&5 +echo "configure:1843: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1860,7 +1874,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:1864: checking for $ac_word" >&5 +echo "configure:1878: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1895,7 +1909,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:1899: checking for $ac_word" >&5 +echo "configure:1913: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1930,7 +1944,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:1934: checking for $ac_word" >&5 +echo "configure:1948: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1965,7 +1979,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:1969: checking for $ac_word" >&5 +echo "configure:1983: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2000,7 +2014,7 @@ else # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2004: checking for $ac_word" >&5 +echo "configure:2018: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2030,7 +2044,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2034: checking for $ac_word" >&5 +echo "configure:2048: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2081,7 +2095,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2085: checking for $ac_word" >&5 +echo "configure:2099: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2113,7 +2127,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2117: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2131: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2124,12 +2138,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2128 "configure" +#line 2142 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2155,12 +2169,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2159: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2173: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2164: checking whether we are using GNU C" >&5 +echo "configure:2178: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2169,7 +2183,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2188,7 +2202,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2192: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2206: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2228,7 +2242,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:2232: checking for $ac_word" >&5 +echo "configure:2246: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2260,7 +2274,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2264: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:2278: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2271,12 +2285,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 2275 "configure" +#line 2289 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:2280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2302,12 +2316,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2306: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2320: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:2311: checking whether we are using GNU C++" >&5 +echo "configure:2325: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2316,7 +2330,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -2335,7 +2349,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:2339: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:2353: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2369,7 +2383,7 @@ fi fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2373: checking how to run the C preprocessor" >&5 +echo "configure:2387: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2384,13 +2398,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:2394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2408: \"$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 : @@ -2401,13 +2415,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:2411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2425: \"$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 : @@ -2418,13 +2432,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:2428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2442: \"$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 : @@ -2451,7 +2465,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2455: checking for $ac_word" >&5 +echo "configure:2469: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2483,7 +2497,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:2487: checking for $ac_word" >&5 +echo "configure:2501: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2524,7 +2538,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:2528: checking for $ac_word" >&5 +echo "configure:2542: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2565,7 +2579,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:2569: checking for $ac_word" >&5 +echo "configure:2583: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2606,7 +2620,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:2610: checking for $ac_word" >&5 +echo "configure:2624: 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 @@ -2647,7 +2661,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:2651: checking for $ac_word" >&5 +echo "configure:2665: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2715,7 +2729,7 @@ else fi echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6 -echo "configure:2719: checking for gcc -pipe support" >&5 +echo "configure:2733: checking for gcc -pipe support" >&5 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then echo '#include ' > dummy-hello.c echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c @@ -2730,14 +2744,14 @@ if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then _SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -pipe" cat > conftest.$ac_ext < int main() { printf("Hello World\n"); ; return 0; } EOF -if { (eval echo configure:2741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* _res_gcc_pipe="yes" else @@ -2767,16 +2781,16 @@ _SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6 -echo "configure:2771: checking whether C compiler supports -fprofile-generate" >&5 +echo "configure:2785: checking whether C compiler supports -fprofile-generate" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* PROFILE_GEN_CFLAGS="-fprofile-generate" result="yes" @@ -2799,7 +2813,7 @@ CFLAGS="$_SAVE_CFLAGS" if test "$GNU_CC"; then echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6 -echo "configure:2803: checking for visibility(hidden) attribute" >&5 +echo "configure:2817: checking for visibility(hidden) attribute" >&5 if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2823,7 +2837,7 @@ echo "$ac_t""$ac_cv_visibility_hidden" 1>&6 EOF echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6 -echo "configure:2827: checking for visibility pragma support" >&5 +echo "configure:2841: checking for visibility pragma support" >&5 if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2876,7 +2890,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:2880: checking for $ac_word" >&5 +echo "configure:2894: 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 @@ -3162,17 +3176,17 @@ EOF DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib' 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:3166: checking for sys/atomic_op.h" >&5 +echo "configure:3180: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3190: \"$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* @@ -3301,6 +3315,45 @@ EOF RESOLVE_LINK_SYMBOLS=1 ;; +*-android*|*-linuxandroid*) + if test -z "$USE_NSPR_THREADS"; then + USE_PTHREADS=1 + IMPL_STRATEGY=_PTH + fi + cat >> confdefs.h <<\EOF +#define XP_UNIX 1 +EOF + + cat >> confdefs.h <<\EOF +#define _GNU_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define HAVE_FCNTL_FILE_LOCKING 1 +EOF + + cat >> confdefs.h <<\EOF +#define LINUX 1 +EOF + + CFLAGS="$CFLAGS -Wall" + CXXFLAGS="$CXXFLAGS -Wall" + MDCPUCFG_H=_linux.cfg + PR_MD_CSRCS=linux.c + MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@' + DSO_CFLAGS=-fPIC + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' + _OPTIMIZE_FLAGS=-O2 + _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that + # combo is not yet good at debugging inlined + # functions (even when using DWARF2 as the + # debugging format) + COMPILER_TAG=_glibc + CPU_ARCH=arm + CPU_ARCH_TAG=_arm + OS_TARGET=Android + ;; + *-beos*) cat >> confdefs.h <<\EOF #define XP_BEOS 1 @@ -3329,7 +3382,7 @@ EOF _DEBUG_FLAGS='-gdwarf-2 -O0' MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@' echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6 -echo "configure:3333: checking for gethostbyaddr in -lbind" >&5 +echo "configure:3386: checking for gethostbyaddr in -lbind" >&5 ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3337,7 +3390,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3405: \"$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 @@ -4056,45 +4109,6 @@ EOF esac ;; -arm-android-eabi) - if test -z "$USE_NSPR_THREADS"; then - USE_PTHREADS=1 - IMPL_STRATEGY=_PTH - fi - cat >> confdefs.h <<\EOF -#define XP_UNIX 1 -EOF - - cat >> confdefs.h <<\EOF -#define _GNU_SOURCE 1 -EOF - - cat >> confdefs.h <<\EOF -#define HAVE_FCNTL_FILE_LOCKING 1 -EOF - - cat >> confdefs.h <<\EOF -#define LINUX 1 -EOF - - CFLAGS="$CFLAGS -Wall" - CXXFLAGS="$CXXFLAGS -Wall" - MDCPUCFG_H=_linux.cfg - PR_MD_CSRCS=linux.c - MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@' - DSO_CFLAGS=-fPIC - DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' - _OPTIMIZE_FLAGS=-O2 - _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that - # combo is not yet good at debugging inlined - # functions (even when using DWARF2 as the - # debugging format) - COMPILER_TAG=_glibc - CPU_ARCH=arm - CPU_ARCH_TAG=_arm - OS_TARGET=Android - ;; - *-linux*|*-gnu*|*-k*bsd*-gnu) if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 @@ -4206,8 +4220,8 @@ EOF RESOLVE_LINK_SYMBOLS=1 if test -n "$GNU_CC"; then - CC="$CC -mno-cygwin" - CXX="$CXX -mno-cygwin" + CC="$CC -mwindows" + CXX="$CXX -mwindows" DLL_SUFFIX=dll MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))' RC=$WINDRES @@ -4739,17 +4753,17 @@ EOF _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4743: checking for machine/builtins.h" >&5 +echo "configure:4757: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4767: \"$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* @@ -5398,7 +5412,7 @@ case $target in ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:5402: checking for dlopen in -ldl" >&5 +echo "configure:5416: 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 @@ -5406,7 +5420,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:5435: \"$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 @@ -5434,17 +5448,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5438: checking for dlfcn.h" >&5 +echo "configure:5452: checking for dlfcn.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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5462: \"$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* @@ -5477,13 +5491,13 @@ esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:5481: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:5495: 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 @@ -5501,7 +5515,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -5525,12 +5539,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5529: checking for $ac_func" >&5 +echo "configure:5543: 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:5571: \"$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 @@ -5604,7 +5618,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:5608: checking for $ac_word" >&5 +echo "configure:5622: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5663,7 +5677,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:5667: checking for +Olit support" >&5 +echo "configure:5681: 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 @@ -5705,7 +5719,7 @@ wince*) *) echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:5709: checking for pthread_create in -lpthreads" >&5 +echo "configure:5723: checking for pthread_create in -lpthreads" >&5 echo " #include void *foo(void *v) { return v; } @@ -5727,7 +5741,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:5731: checking for pthread_create in -lpthread" >&5 +echo "configure:5745: checking for pthread_create in -lpthread" >&5 echo " #include void *foo(void *v) { return v; } @@ -5749,7 +5763,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5753: checking for pthread_create in -lc_r" >&5 +echo "configure:5767: checking for pthread_create in -lc_r" >&5 echo " #include void *foo(void *v) { return v; } @@ -5771,7 +5785,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5775: checking for pthread_create in -lc" >&5 +echo "configure:5789: checking for pthread_create in -lc" >&5 echo " #include void *foo(void *v) { return v; } @@ -5889,7 +5903,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:5893: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5907: 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 @@ -5912,7 +5926,7 @@ echo "configure:5893: 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:5916: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5930: 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 diff --git a/nsprpub/configure.in b/nsprpub/configure.in index d9406aeaf397..80e6d2ea137e 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -152,7 +152,20 @@ AC_ARG_WITH(android-platform, location of platform dir, default NDK/build/platforms/android-5/arch-arm], android_platform=$withval) -if test "$target" = "arm-android-eabi" ; then +case "$target" in +arm-linux*-android*|*-linuxandroid*) + android_tool_prefix="arm-linux-androideabi" + ;; +arm-android-eabi) + android_tool_prefix="arm-eabi" + ;; +*) + android_tool_prefix="$target_os" + ;; +esac + +case "$target" in +*-android*|*-linuxandroid*) if test -z "$android_ndk" ; then AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.]) fi @@ -166,14 +179,14 @@ if test "$target" = "arm-android-eabi" ; then fi dnl set up compilers - AS="$android_toolchain"/bin/arm-eabi-as - CC="$android_toolchain"/bin/arm-eabi-gcc - CXX="$android_toolchain"/bin/arm-eabi-g++ - CPP="$android_toolchain"/bin/arm-eabi-cpp - LD="$android_toolchain"/bin/arm-eabi-ld - AR="$android_toolchain"/bin/arm-eabi-ar - RANLIB="$android_toolchain"/bin/arm-eabi-ranlib - STRIP="$android_toolchain"/bin/arm-eabi-strip + AS="$android_toolchain"/bin/"$android_tool_prefix"-as + CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc + CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++ + CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp + LD="$android_toolchain"/bin/"$android_tool_prefix"-ld + AR="$android_toolchain"/bin/"$android_tool_prefix"-ar + RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib + STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS" CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions $CFLAGS" @@ -197,7 +210,8 @@ if test "$target" = "arm-android-eabi" ; then WRAP_MALLOC_CFLAGS="-Wl,--wrap=dlopen -Wl,--wrap=dlclose -Wl,--wrap=dlerror -Wl,--wrap=dlsym -Wl,--wrap=dladdr" AC_DEFINE(ANDROID) -fi + ;; +esac dnl ======================================================== dnl = @@ -1036,6 +1050,33 @@ case "$target" in RESOLVE_LINK_SYMBOLS=1 ;; +*-android*|*-linuxandroid*) + if test -z "$USE_NSPR_THREADS"; then + USE_PTHREADS=1 + IMPL_STRATEGY=_PTH + fi + AC_DEFINE(XP_UNIX) + AC_DEFINE(_GNU_SOURCE) + AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) + AC_DEFINE(LINUX) + CFLAGS="$CFLAGS -Wall" + CXXFLAGS="$CXXFLAGS -Wall" + MDCPUCFG_H=_linux.cfg + PR_MD_CSRCS=linux.c + MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@' + DSO_CFLAGS=-fPIC + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' + _OPTIMIZE_FLAGS=-O2 + _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that + # combo is not yet good at debugging inlined + # functions (even when using DWARF2 as the + # debugging format) + COMPILER_TAG=_glibc + CPU_ARCH=arm + CPU_ARCH_TAG=_arm + OS_TARGET=Android + ;; + *-beos*) AC_DEFINE(XP_BEOS) AC_DEFINE(BeOS) @@ -1561,33 +1602,6 @@ tools are selected during the Xcode/Developer Tools installation.]) esac ;; -arm-android-eabi) - if test -z "$USE_NSPR_THREADS"; then - USE_PTHREADS=1 - IMPL_STRATEGY=_PTH - fi - AC_DEFINE(XP_UNIX) - AC_DEFINE(_GNU_SOURCE) - AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) - AC_DEFINE(LINUX) - CFLAGS="$CFLAGS -Wall" - CXXFLAGS="$CXXFLAGS -Wall" - MDCPUCFG_H=_linux.cfg - PR_MD_CSRCS=linux.c - MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@' - DSO_CFLAGS=-fPIC - DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' - _OPTIMIZE_FLAGS=-O2 - _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that - # combo is not yet good at debugging inlined - # functions (even when using DWARF2 as the - # debugging format) - COMPILER_TAG=_glibc - CPU_ARCH=arm - CPU_ARCH_TAG=_arm - OS_TARGET=Android - ;; - *-linux*|*-gnu*|*-k*bsd*-gnu) if test -z "$USE_NSPR_THREADS"; then USE_PTHREADS=1 @@ -1669,8 +1683,8 @@ arm-android-eabi) RESOLVE_LINK_SYMBOLS=1 if test -n "$GNU_CC"; then - CC="$CC -mno-cygwin" - CXX="$CXX -mno-cygwin" + CC="$CC -mwindows" + CXX="$CXX -mwindows" DLL_SUFFIX=dll MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))' RC=$WINDRES diff --git a/nsprpub/pr/src/misc/prnetdb.c b/nsprpub/pr/src/misc/prnetdb.c index b8e32db4a0ac..2bd7f5c70b31 100644 --- a/nsprpub/pr/src/misc/prnetdb.c +++ b/nsprpub/pr/src/misc/prnetdb.c @@ -2078,7 +2078,7 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInfoByName(const char *hostname, rv = GETADDRINFO(hostname, NULL, &hints, &res); #ifdef AI_ADDRCONFIG - if (rv == EAI_BADFLAGS) { + if (rv == EAI_BADFLAGS && (hints.ai_flags & AI_ADDRCONFIG)) { hints.ai_flags &= ~AI_ADDRCONFIG; rv = GETADDRINFO(hostname, NULL, &hints, &res); }