From 01cf037eee77c2cb1d0e90e525bea3128242a227 Mon Sep 17 00:00:00 2001 From: Paul Biggar Date: Fri, 29 Oct 2010 14:52:28 -0700 Subject: [PATCH] Backed out changeset 66f4a212edeb (bug 605133). Configure broke shell and unclobbered-build with js-config problem. --- configure.in | 20 +- js/src/configure.in | 858 +++++++++----------------------------------- 2 files changed, 182 insertions(+), 696 deletions(-) diff --git a/configure.in b/configure.in index fd013fd3c74..af629d52aa6 100644 --- a/configure.in +++ b/configure.in @@ -622,9 +622,6 @@ case "$target" in # Make sure compilers are valid CFLAGS="$CFLAGS -TC -nologo" CXXFLAGS="$CXXFLAGS -TP -nologo" - # MSVC warning C4345 warns of newly conformant behavior as of VS2003. - # MSVC warning C4800 is ubiquitous, useless, and annoying. - CXXFLAGS="$CXXFLAGS -wd4345 -wd4800" AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE([#include ], @@ -2743,11 +2740,6 @@ alpha*-*-osf*) *-solaris*) AC_DEFINE(SOLARIS) TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"' - if test -z "$CROSS_COMPILE" && pkginfo -q SUNWpr && pkginfo -q SUNWprd; then - NO_NSPR_CONFIG_SYSTEM_LDFLAGS="-L/usr/lib/mps -R/usr/lib/mps -lnspr4" - NO_NSPR_CONFIG_SYSTEM_CFLAGS="-I/usr/include/mps" - NO_NSPR_CONFIG_SYSTEM_VERSION=["`pkgparam SUNWpr SUNW_PRODVERS | sed -e 's/^[1-9][0-9]*\.[0-9][0-9]*$/&.0/'`"] - fi SYSTEM_MAKEDEPEND= MOZ_FIX_LINK_PATHS= # $ORIGIN/.. is for shared libraries under components/ to locate shared @@ -3806,9 +3798,9 @@ dnl Checks for library functions. dnl ======================================================== AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP -AC_CHECK_FUNCS([fchmod flockfile getc_unlocked _getc_nolock getpagesize \ - lchown localtime_r lstat64 memmove random rint sbrk snprintf \ - stat64 statvfs statvfs64 strerror strtok_r truncate64]) +AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty) +AC_CHECK_FUNCS(flockfile getpagesize) +AC_CHECK_FUNCS(localtime_r strtok_r) dnl check for clock_gettime(), the CLOCK_MONOTONIC clock, and -lrt _SAVE_LDFLAGS=$LDFLAGS @@ -5268,6 +5260,7 @@ cairo-cocoa) MOZ_WIDGET_TOOLKIT=cocoa AC_DEFINE(MOZ_WIDGET_COCOA) MOZ_USER_DIR="Mozilla" + AC_DEFINE(XP_MACOSX) TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL' TK_CFLAGS="-DNO_X11" LDFLAGS="$LDFLAGS -framework Cocoa -lobjc" @@ -7068,7 +7061,6 @@ if test -n "$MOZ_THUMB2"; then case "$target_cpu" in arm*) if test "$GNU_CC"; then - AC_DEFINE(MOZ_THUMB2) CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb" CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb" ASFLAGS="$ASFLAGS -march=armv7-a -mthumb" @@ -8026,6 +8018,7 @@ dnl ======================================================== dnl C++ rtti dnl Should be smarter and check that the compiler does indeed have rtti dnl ======================================================== + MOZ_ARG_ENABLE_BOOL(cpp-rtti, [ --enable-cpp-rtti Enable C++ RTTI ], [ _MOZ_USE_RTTI=1 ], @@ -9096,7 +9089,7 @@ if test "$USING_HCC"; then AC_SUBST(CXX) fi -AC_MSG_CHECKING([for posix_fallocate]) +AC_MSG_CHECKING([for posix_fallocate]) AC_TRY_LINK([#define _XOPEN_SOURCE 600 #include ], [posix_fallocate(0, 0, 0);], @@ -9167,7 +9160,6 @@ dnl ======================================================== if test "$OS_ARCH" = "BeOS"; then AC_DEFINE(XP_BEOS) elif test "$OS_ARCH" = "Darwin"; then - AC_DEFINE(XP_MACOSX) AC_DEFINE(XP_UNIX) AC_DEFINE(UNIX_ASYNC_DNS) elif test "$OS_ARCH" = "OpenVMS"; then diff --git a/js/src/configure.in b/js/src/configure.in index 46d491d77bb..619fd104123 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -42,8 +42,6 @@ dnl Mac OS X 10.4 support dnl Giorgio Maone dnl MSVC l10n compatible version check dnl Ben Turner -dnl Windows x64 support -dnl Makoto Kato dnl dnl Alternatively, the contents of this file may be used under the terms of dnl either the GNU General Public License Version 2 or later (the "GPL"), or @@ -110,7 +108,6 @@ NSPR_VERSION=4 dnl Set the minimum version of toolkit libs used by mozilla dnl ======================================================== PERL_VERSION=5.006 -PYTHON_VERSION=2.5 WINDRES_VERSION=2.14.90 W32API_VERSION=3.8 @@ -203,17 +200,11 @@ esac fi COMPILE_ENVIRONMENT=1 -MOZ_ARG_DISABLE_BOOL(compile-environment, +MOZ_ARG_ENABLE_BOOL(compile-environment, [ --disable-compile-environment Disable compiler/library checks.], + COMPILE_ENVIRONMENT=1, COMPILE_ENVIRONMENT= ) -AC_SUBST(COMPILE_ENVIRONMENT) - -dnl Check for Perl first -- needed for win32 SDK checks -MOZ_PATH_PROGS(PERL, $PERL perl5 perl ) -if test -z "$PERL" -o "$PERL" = ":"; then - AC_MSG_ERROR([perl not found in \$PATH]) -fi MOZ_ARG_ENABLE_BOOL(shared-js, [ --disable-shared-js @@ -234,8 +225,7 @@ dnl = here, so that the compiler checks can succeed dnl ======================================================== MOZ_ARG_WITH_STRING(android-ndk, -[ --with-android-ndk=DIR - location where the Android NDK can be found], +[ --with-android-ndk=DIR location where the Android NDK can be found], android_ndk=$withval) MOZ_ARG_WITH_STRING(android-toolchain, @@ -250,29 +240,11 @@ MOZ_ARG_WITH_STRING(android-version, android_version=$withval, android_version=5) -MOZ_ARG_WITH_STRING(android-sdk, -[ --with-android-sdk=DIR - location where the Android SDK can be found (base directory, e.g. .../android/platforms/android-6)], - android_sdk=$withval) - -MOZ_ARG_WITH_STRING(android-tools, -[ --with-android-tools=DIR - location where the Android Tools can be found (base directory, e.g. .../android/tools)], - android_tools=$withval) - if test "$target" = "arm-android-eabi" ; then if test -z "$android_ndk" ; then AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.]) fi - if test -z "$android_sdk" ; then - AC_MSG_ERROR([You must specify --with-android-sdk=/path/to/sdk when targeting Android.]) - fi - - if test -z "$android_tools" ; then - AC_MSG_ERROR([You must specify --with-android-tools=/path/to/sdk/tools when targeting Android.]) - fi - if test -z "$android_toolchain" ; then android_toolchain="$android_ndk"/build/prebuilt/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/arm-eabi-4.4.0 fi @@ -280,7 +252,6 @@ if test "$target" = "arm-android-eabi" ; then if test -z "$android_platform" ; then android_platform="$android_ndk"/build/platforms/android-"$android_version"/arch-"$target_cpu" fi - dnl set up compilers AS="$android_toolchain"/bin/arm-eabi-as CC="$android_toolchain"/bin/arm-eabi-gcc @@ -292,14 +263,9 @@ if test "$target" = "arm-android-eabi" ; then STRIP="$android_toolchain"/bin/arm-eabi-strip CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS" - CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions -march=armv5te -mthumb-interwork $CFLAGS" - CXXFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions -march=armv5te -mthumb-interwork $CXXFLAGS" - - dnl Add -llog by default, since we use it all over the place. - dnl Add --allow-shlib-undefined, because libGLESv2 links to an - dnl undefined symbol (present on the hardware, just not in the - dnl NDK.) - LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS" + CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions $CFLAGS" + CXXFLAGS="-mandroid -std=gnu++0x -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions $CXXFLAGS" + LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS" dnl prevent cross compile section from using these flags as host flags if test -z "$HOST_CPPFLAGS" ; then @@ -315,13 +281,6 @@ if test "$target" = "arm-android-eabi" ; then HOST_LDFLAGS=" " fi - ANDROID_NDK="${android_ndk}" - ANDROID_TOOLCHAIN="{android_toolchain}" - ANDROID_PLATFORM="{android_platform}" - ANDROID_SDK="${android_sdk}" - ANDROID_TOOLS="${android_tools}" - ANDROID_VERSION="${android_version}" - # save these for libffi's subconfigure, # which doesn't know how to figure this stuff out on its own ANDROID_CFLAGS="$CFLAGS" @@ -330,23 +289,12 @@ if test "$target" = "arm-android-eabi" ; then AC_DEFINE(ANDROID) AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version) - AC_SUBST(ANDROID_VERSION) - CROSS_COMPILE=1 - MOZ_CHROME_FILE_FORMAT=omni + AC_DEFINE(FORCE_LITTLE_ENDIAN) fi -AC_SUBST(ANDROID_NDK) -AC_SUBST(ANDROID_TOOLCHAIN) -AC_SUBST(ANDROID_PLATFORM) -AC_SUBST(ANDROID_SDK) -AC_SUBST(ANDROID_TOOLS) - dnl ======================================================== dnl Checks for compilers. dnl ======================================================== -dnl Set CROSS_COMPILE in the environment when running configure -dnl to use the cross-compile setup for now -dnl ======================================================== dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269) AR_FLAGS='cr $@' @@ -355,7 +303,6 @@ if test "$COMPILE_ENVIRONMENT"; then if test "$target" != "$host"; then echo "cross compiling from $host to $target" - cross_compiling=yes _SAVE_CC="$CC" _SAVE_CFLAGS="$CFLAGS" @@ -418,8 +365,8 @@ if test "$target" != "$host"; then dnl checks will fail. Fake a working SDK in that case. _SAVE_CFLAGS=$CFLAGS _SAVE_CXXFLAGS=$CXXLAGS - CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk $CFLAGS" - CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk $CXXFLAGS" + CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS" + CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS" ;; esac @@ -481,6 +428,12 @@ if test "$target" != "$host"; then AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :) AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :) AC_DEFINE(CROSS_COMPILE) + + dnl If we cross compile for ppc on Mac OS X x86, cross_compiling will + dnl have erroneously been set to "no", because the x86 build host is + dnl able to run ppc code in a translated environment, making a cross + dnl compiler appear native. So we override that here. + cross_compiling=yes else AC_PROG_CC AC_PROG_CXX @@ -561,34 +514,16 @@ dnl ======================================================== case "$target" in *-wince|*-winmo) WINVER=500 - WINSDK_TARGETVER=502 ;; *) - WINVER=502 - dnl Target the Windows 7 SDK by default - WINSDK_TARGETVER=601 + if test -n "$GNU_CC"; then + WINVER=501 + else + WINVER=500 + fi ;; esac -MOZ_ARG_WITH_STRING(windows-version, -[ --with-windows-version=WINSDK_TARGETVER - Highest Windows version to target using this SDK - 502: Windows Server 2003 - 600: Windows Vista - 601: Windows 7], - WINSDK_TARGETVER=$withval) - -case "$WINSDK_TARGETVER" in -502|600|601) - MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000 - ;; - -*) - AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]); - ;; - -esac - case "$target" in *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince|*-winmo) if test "$GCC" != "yes"; then @@ -699,112 +634,8 @@ case "$target" in fi INCREMENTAL_LINKER=1 - # Identify which version of the SDK we're building with - # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version - # from there - AC_CHECK_HEADERS([winsdkver.h]) - if test "$ac_cv_header_winsdkver_h" = "yes"; then - # Get the highest _WIN32_WINNT and NTDDI versions supported - # Take the higher of the two - # This is done because the Windows 7 beta SDK reports its - # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should - AC_CACHE_CHECK(for highest Windows version supported by this SDK, - ac_cv_winsdk_maxver, - [cat > conftest.h < -#include - -#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER) -#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) -#else -#define WINSDK_MAXVER NTDDI_MAXVER -#endif - -WINSDK_MAXVER -EOF - ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1` - rm -f conftest.h - ]) - MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver} - else - # The Vista SDK is the only one to have sdkddkver.h but not - # WinSDKVer.h - AC_CHECK_HEADERS([sdkddkver.h]) - if test "$ac_cv_header_sdkddkver_h" = "yes"; then - MOZ_WINSDK_MAXVER=0x06000000 - else - # Assume the Server 2003 Platform SDK - MOZ_WINSDK_MAXVER=0x05020000 - fi - fi - unset _MSVC_VER_FILTER - AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw, - [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - _SAVE_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" - AC_TRY_COMPILE([#include ], - [std::_Throw(std::exception()); return 0;], - ac_cv_have_std__Throw="yes", - ac_cv_have_std__Throw="no") - CXXFLAGS="$_SAVE_CXXFLAGS" - AC_LANG_RESTORE - ]) - - if test "$ac_cv_have_std__Throw" == "yes"; then - AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug, - ac_cv_have_dllimport_exception_bug, - [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - _SAVE_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" - AC_TRY_LINK([#include ], - [std::vector v; return v.at(1);], - ac_cv_have_dllimport_exception_bug="no", - ac_cv_have_dllimport_exception_bug="yes") - CXXFLAGS="$_SAVE_CXXFLAGS" - AC_LANG_RESTORE - ]) - if test "$ac_cv_have_dllimport_exception_bug" = "no"; then - WRAP_STL_INCLUDES=1 - MOZ_MSVC_STL_WRAP__Throw=1 - AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw) - fi - else - AC_CACHE_CHECK(for overridable _RAISE, - ac_cv_have__RAISE, - [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - _SAVE_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" - AC_TRY_COMPILE([#include - #undef _RAISE - #define _RAISE(x) externallyDefinedFunction((x).what()) - #include - ], - [std::vector v; return v.at(1);], - ac_cv_have__RAISE="no", - ac_cv_have__RAISE="yes") - CXXFLAGS="$_SAVE_CXXFLAGS" - AC_LANG_RESTORE - ]) - if test "$ac_cv_have__RAISE" = "yes"; then - WRAP_STL_INCLUDES=1 - MOZ_MSVC_STL_WRAP__RAISE=1 - AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE) - else - AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.]) - fi - fi - - if test "$WRAP_STL_INCLUDES" = "1"; then - STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers' - fi else # Check w32api version _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'` @@ -840,31 +671,12 @@ EOF then AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.]) fi - - # Server 2003 is the highest version supported - MOZ_WINSDK_MAXVER=0x05020000 fi # !GNU_CC AC_DEFINE_UNQUOTED(WINVER,0x$WINVER) AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER) # Require OS features provided by IE 5.0 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500) - - # If the maximum version supported by this SDK is lower than the target - # version, error out - AC_MSG_CHECKING([for Windows SDK being recent enough]) - if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. Alternatively, try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.]) - fi - - AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER) - # Definitions matching sdkddkver.h - AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000) - AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000) - AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000) ;; esac @@ -914,6 +726,12 @@ fi fi # COMPILE_ENVIRONMENT +if test "$cross_compiling" = "yes"; then + CROSS_COMPILE=1 +else + CROSS_COMPILE= +fi + # Check to see if we are running in a broken QEMU scratchbox. # We know that anything below 1.0.16 is broken. AC_CHECK_PROGS(SBCONF, sb-conf ve, "") @@ -937,16 +755,15 @@ AC_SUBST(GNU_CXX) AC_SUBST(INTEL_CC) AC_SUBST(INTEL_CXX) -AC_SUBST(STL_FLAGS) -AC_SUBST(WRAP_STL_INCLUDES) -AC_SUBST(MOZ_MSVC_STL_WRAP__Throw) -AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE) - dnl ======================================================== dnl Checks for programs. dnl ======================================================== AC_PROG_INSTALL AC_PROG_LN_S +MOZ_PATH_PROGS(PERL, $PERL perl5 perl ) +if test -z "$PERL" -o "$PERL" = ":"; then + AC_MSG_ERROR([perl not found in \$PATH]) +fi if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION]) @@ -969,7 +786,7 @@ else AC_MSG_RESULT([yes]) fi -MOZ_PATH_PROGS(PYTHON, $PYTHON python2.6 python2.5 python2.4 python) +MOZ_PATH_PROGS(PYTHON, $PYTHON python) if test -z "$PYTHON"; then AC_MSG_ERROR([python was not found in \$PATH]) fi @@ -1056,7 +873,7 @@ dnl Check for MacOS deployment target version dnl ======================================================== MOZ_ARG_ENABLE_STRING(macos-target, - [ --enable-macos-target=VER (default=10.5) + [ --enable-macos-target=VER (default=10.4) Set the minimum MacOS version needed at runtime], [_MACOSX_DEPLOYMENT_TARGET=$enableval]) @@ -1066,20 +883,11 @@ case "$target" in dnl Use the specified value export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET) - else + elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then dnl No value specified on the command line or in the environment, - dnl use architecture minimum. - case "${target_cpu}" in - ppc*) - export MACOSX_DEPLOYMENT_TARGET=10.5 - ;; - i*86) - export MACOSX_DEPLOYMENT_TARGET=10.5 - ;; - x86_64) - export MACOSX_DEPLOYMENT_TARGET=10.6 - ;; - esac + dnl use the lesser of the application's minimum or the architecture's + dnl minimum. + export MACOSX_DEPLOYMENT_TARGET=10.4 fi ;; esac @@ -1149,25 +957,17 @@ fi fi # COMPILE_ENVIRONMENT -if test -n "$MAKE"; then - if test `echo $MAKE | grep -c make.py` != 1; then - NOT_PYMAKE=$MAKE - fi +if test -z "$MAKE"; then + case "$host_os" in + cygwin*|mingw*|mks*|msvc*) + MOZ_PATH_PROGS(MAKE, $MAKE make gmake, :) + ;; + *) + MOZ_PATH_PROGS(MAKE, $MAKE gmake make, :) + ;; + esac fi -case "$host_os" in -cygwin*|mingw*|mks*|msvc*) - MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :) - ;; -*) - MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :) - ;; -esac -if test "$GMAKE" = ":"; then - AC_MSG_ERROR([GNU make not found]) -fi -AC_SUBST(GMAKE) - if test "$COMPILE_ENVIRONMENT"; then AC_PATH_XTRA @@ -1199,7 +999,7 @@ WIN_TOP_SRC= MOZ_USER_DIR=".mozilla" MOZ_JS_LIBS='-L$(libdir) -lmozjs' -MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib' +MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib' MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)' @@ -1207,6 +1007,8 @@ USE_DEPENDENT_LIBS=1 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2 +MOZ_THUMB2= + if test -n "$CROSS_COMPILE"; then OS_TARGET="${target_os}" OS_ARCH=`echo $target_os | sed -e 's|/|_|g'` @@ -1221,9 +1023,6 @@ if test -n "$CROSS_COMPILE"; then winmo*) OS_ARCH=WINCE ;; darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;; esac - case "${target}" in - arm-android-eabi) OS_ARCH=Linux OS_TARGET=Android ;; - esac else OS_TARGET=`uname -s` OS_ARCH=`uname -s | sed -e 's|/|_|g'` @@ -1261,9 +1060,6 @@ case "$HOST_OS_ARCH" in cygwin*|mingw*|mks*|msvc*) HOST_OS_ARCH=WINNT ;; -darwin*) - HOST_OS_ARCH=Darwin - ;; linux*) HOST_OS_ARCH=Linux ;; @@ -1330,9 +1126,7 @@ esac case "$OS_ARCH" in WINNT) - if test -z "$CROSS_COMPILE" ; then - OS_TEST=`uname -p` - fi + OS_TEST=`uname -p` ;; Windows_NT) # @@ -1436,17 +1230,13 @@ UnixWare) OS_RELEASE=`uname -v` ;; WINCE) + WINCE=1 OS_ARCH=WINCE - case "${target_os}" in - *winmo) + if test "$WINCE_WINDOWS_MOBILE"; then OS_TARGET=WINMO - WINCE_WINDOWS_MOBILE=1 - AC_DEFINE(WINCE_WINDOWS_MOBILE) - ;; - *) + else OS_TARGET=WINCE - ;; - esac + fi ;; Darwin) case "${target_cpu}" in @@ -1481,11 +1271,7 @@ case "$OS_TEST" in CPU_ARCH=x86 ;; -powerpc64 | ppc64) - CPU_ARCH=ppc64 - ;; - -powerpc | ppc | rs6000) +powerpc* | ppc | rs6000) CPU_ARCH=ppc ;; @@ -1493,14 +1279,6 @@ Alpha | alpha | ALPHA) CPU_ARCH=Alpha ;; -s390) - CPU_ARCH=s390 - ;; - -s390x) - CPU_ARCH=s390x - ;; - hppa* | parisc) CPU_ARCH=hppa ;; @@ -1556,7 +1334,7 @@ if test "$GNU_CC"; then if test -z "$INTEL_CC"; then # Don't use -Wcast-align with ICC case "$CPU_ARCH" in - # And don't use it on hppa, ia64, sparc, arm, since it's noisy there + # And don't use it on hppa, ia64, sparc, or arm since it's noisy there hppa | ia64 | sparc | arm) ;; *) @@ -1606,7 +1384,7 @@ if test "$GNU_CXX"; then if test -z "$INTEL_CC"; then # Don't use -Wcast-align with ICC case "$CPU_ARCH" in - # And don't use it on hppa, ia64, sparc, arm, since it's noisy there + # And don't use it on hppa, ia64, sparc, or arm since it's noisy there hppa | ia64 | sparc | arm) ;; *) @@ -1653,25 +1431,6 @@ if test "$GNU_CXX"; then if test "$ac_has_wno_variadic_macros" = "yes"; then _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros" fi - - AC_CACHE_CHECK(whether the compiler supports -Werror=return-type, - ac_has_werror_return_type, - [ - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - _SAVE_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -Werror=return-type" - AC_TRY_COMPILE([], - [return(0);], - ac_has_werror_return_type="yes", - ac_has_werror_return_type="no") - CXXFLAGS="$_SAVE_CXXFLAGS" - AC_LANG_RESTORE - ]) - if test "$ac_has_werror_return_type" = "yes"; then - _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type" - fi - else _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_JS_CONFDEFS_H_ $(ACDEFINES)' fi @@ -1806,8 +1565,6 @@ case "$host" in ;; *cygwin*|*mingw*|*mks*|*msvc*|*wince|*winmo) - # we need Python 2.5 on Windows - PYTHON_VERSION=2.5 if test -n "$_WIN32_MSVC"; then HOST_AR=lib HOST_AR_FLAGS='-NOLOGO -OUT:"$@"' @@ -1823,7 +1580,6 @@ case "$host" in case "$host" in *mingw*) dnl MinGW/MSYS does not need CYGWIN_WRAPPER - PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper" ;; *) CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper" @@ -1841,12 +1597,6 @@ case "$host" in fi ;; esac - - case "${host_cpu}" in - x86_64) - HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_" - ;; - esac ;; *-darwin*) @@ -1881,18 +1631,6 @@ case "$host" in ;; esac -dnl We require version 2.4 or newer of Python to build, -dnl and 2.5 or newer on Windows. -AC_MSG_CHECKING([for minimum required Python version >= $PYTHON_VERSION]) -changequote(,) -$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION -_python_res=$? -changequote([,]) -if test "$_python_res" != 0; then - AC_MSG_ERROR([Python $PYTHON_VERSION or higher is required.]) -fi -AC_MSG_RESULT([yes]) - dnl ======================================================== dnl System overrides of the defaults for target dnl ======================================================== @@ -2065,7 +1803,6 @@ ia64*-hpux*) MOZ_FIX_LINK_PATHS= SYSTEM_MAKEDEPEND= AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) - AC_DEFINE(_LARGEFILE64_SOURCE) ;; *-hpux*) @@ -2147,15 +1884,14 @@ ia64*-hpux*) ;; *-*linux*) - # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler. - # Similarly for GNU_CXX and INTEL_CXX. - if test "$INTEL_CC" -o "$INTEL_CXX"; then + # Note: both GNU_CXX and INTEL_CXX are set when using Intel's C compiler. + if test "$INTEL_CXX"; then # -Os has been broken on Intel's C/C++ compilers for quite a # while; Intel recommends against using it. MOZ_OPTIMIZE_FLAGS="-O2" MOZ_DEBUG_FLAGS="-g" - elif test "$GNU_CC" -o "$GNU_CXX"; then - GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'` + elif test "$GNU_CXX"; then + GCC_VERSION=`$CXX -v 2>&1 | awk '/^gcc version/ { print $3 }'` case $GCC_VERSION in 4.1.*|4.2.*|4.5.*) # -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results. @@ -2163,9 +1899,9 @@ ia64*-hpux*) esac # If we're building with --enable-profiling, we need a frame pointer. if test -z "$MOZ_PROFILING"; then - MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK" + MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK" else - MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-omit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK" + MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fno-omit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK" fi MOZ_DEBUG_FLAGS="-g" fi @@ -2212,7 +1948,7 @@ ia64*-hpux*) WARNINGS_AS_ERRORS='-WX' - MOZ_OPTIMIZE_FLAGS='-Ox' + MOZ_OPTIMIZE_FLAGS='-O1' AR_FLAGS='-NOLOGO -OUT:"$@"' ASM_SUFFIX=asm CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)" @@ -2220,12 +1956,11 @@ ia64*-hpux*) DLL_PREFIX= DOXYGEN=: DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE - DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib' + DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib' GARBAGE= IMPORT_LIB_SUFFIX=lib - dnl Need to force-link against mozalloc because it's used in the shunt - LIBS="$LIBS \$(LIBXUL_DIST)/lib/mozalloc.lib" - LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib' + LIBS="$LIBS" + LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib' LIB_PREFIX= LIB_SUFFIX=lib MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)' @@ -2244,9 +1979,10 @@ ia64*-hpux*) TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"' UNZIP=unzip XARGS=xargs - XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib' + XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib' ZIP=zip + AC_DEFINE(WINCE) AC_DEFINE(HAVE_SNPRINTF) AC_DEFINE(_WINDOWS) AC_DEFINE(WIN32) @@ -2256,10 +1992,9 @@ ia64*-hpux*) AC_DEFINE(STDC_HEADERS) AC_DEFINE(NEW_H, ) AC_DEFINE(WIN32_LEAN_AND_MEAN) - AC_DEFINE(HAVE_LOCALTIME_R) TARGET_MD_ARCH=win32 - _PLATFORM_DEFAULT_TOOLKIT='cairo-windows' + _PLATFORM_DEFAULT_TOOLKIT='windows' BIN_SUFFIX='.exe' MOZ_USER_DIR="Mozilla" @@ -2330,8 +2065,8 @@ ia64*-hpux*) LIBS="$LIBS -lgdi32 -lwinmm -lwsock32" MOZ_JS_LIBS='-L$(libdir) -lmozjs' MOZ_FIX_LINK_PATHS= - DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc' - XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc' + DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core' + XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom' DLL_PREFIX= IMPORT_LIB_SUFFIX=dll.a GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'` @@ -2341,7 +2076,7 @@ ia64*-hpux*) HOST_CXX='$(CXX)' HOST_LD='$(LD)' if test "$AS_BIN"; then - AS="$(basename "$AS_BIN")" + AS="$(basename "$AS_BIN")" fi AR='lib -NOLOGO -OUT:"$@"' AR_FLAGS= @@ -2382,9 +2117,9 @@ ia64*-hpux*) fi MOZ_JS_LIBS='$(libdir)/mozjs.lib' MOZ_FIX_LINK_PATHS= - DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib' - XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib' - LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib' + DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib' + XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib' + LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib' MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)' if test $_MSC_VER -ge 1400; then LDFLAGS="$LDFLAGS -NXCOMPAT" @@ -2448,12 +2183,11 @@ ia64*-hpux*) AC_MSG_ERROR([MOZ_TOOLS is not set]) fi - MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W` + MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd` if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS]) fi - MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)" - if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then + if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.]) fi MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S` @@ -2486,8 +2220,8 @@ ia64*-hpux*) AC_DEFINE(_MIPS_) ;; x86_64-*) - AC_DEFINE(_AMD64_) - ;; + AC_DEFINE(_AMD64_) + ;; *) AC_DEFINE(_CPU_ARCH_NOT_DEFINED) ;; @@ -2802,21 +2536,6 @@ alpha*-*-osf*) HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"' ;; -*-android*) - AC_DEFINE(NO_PW_GECOS) - no_x=yes - _PLATFORM_DEFAULT_TOOLKIT=cairo-android - TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"' - - MOZ_GFX_OPTIMIZE_MOBILE=1 - # If we're building with --enable-profiling, we need a frame pointer. - if test -z "$MOZ_PROFILING"; then - MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer" - else - MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fno-omit-frame-pointer" - fi - ;; - esac dnl Only one oddball right now (QNX), but this gives us flexibility @@ -3021,28 +2740,13 @@ AC_SUBST(NANOJIT_ARCH) if test -z "$SKIP_COMPILER_CHECKS"; then dnl Checks for typedefs, structures, and compiler characteristics. dnl ======================================================== +AC_LANG_C AC_HEADER_STDC AC_C_CONST AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T -AC_LANG_CPLUSPLUS -AC_MSG_CHECKING(for __stdcall) -AC_CACHE_VAL(ac_cv___stdcall, - [AC_TRY_COMPILE([template struct foo; - template <> struct foo {}; - template <> struct foo {};], - [], - [ac_cv___stdcall=true], - [ac_cv___stdcall=false])]) -if test "$ac_cv___stdcall" = true ; then - AC_DEFINE(HAVE_STDCALL) - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi -AC_LANG_C AC_MSG_CHECKING(for ssize_t) AC_CACHE_VAL(ac_cv_type_ssize_t, [AC_TRY_COMPILE([#include @@ -3340,8 +3044,6 @@ EOF "$ac_cv_have_visibility_class_bug" = "no"; then VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h' WRAP_SYSTEM_INCLUDES=1 - STL_FLAGS='-I$(DIST)/stl_wrappers' - WRAP_STL_INCLUDES=1 else VISIBILITY_FLAGS='-fvisibility=hidden' fi # have visibility pragma bug @@ -3358,26 +3060,6 @@ fi # Sun Studio on Solaris AC_SUBST(WRAP_SYSTEM_INCLUDES) AC_SUBST(VISIBILITY_FLAGS) -dnl Check for __force_align_arg_pointer__ for SSE2 on gcc -dnl ======================================================== -if test "$GNU_CC"; then - CFLAGS_save="${CFLAGS}" - CFLAGS="${CFLAGS} -Werror" - AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute, - ac_cv_force_align_arg_pointer, - [AC_TRY_COMPILE([__attribute__ ((__force_align_arg_pointer__)) void test() {}], - [], - ac_cv_force_align_arg_pointer="yes", - ac_cv_force_align_arg_pointer="no")]) - CFLAGS="${CFLAGS_save}" - if test "$ac_cv_force_align_arg_pointer" = "yes"; then - HAVE_GCC_ALIGN_ARG_POINTER=1 - else - HAVE_GCC_ALIGN_ARG_POINTER= - fi -fi -AC_SUBST(HAVE_GCC_ALIGN_ARG_POINTER) - dnl Checks for header files. dnl ======================================================== AC_HEADER_DIRENT @@ -3392,15 +3074,10 @@ AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h) AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(X11/XKBlib.h) -AC_CHECK_HEADERS(io.h) dnl These are all the places some variant of statfs can be hiding. AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h) -dnl Quota support -AC_CHECK_HEADERS(sys/quota.h) -AC_CHECK_HEADERS(linux/quota.h) - dnl Try for MMX support dnl NB - later gcc versions require -mmmx for this header to be successfully dnl included (or another option which implies it, such as -march=pentium-mmx) @@ -3496,34 +3173,6 @@ case $target in AC_CHECK_LIB(socket, socket) esac -AC_MSG_CHECKING(for ARM SIMD support in compiler) -AC_TRY_COMPILE([], - [asm("uqadd8 r1, r1, r2");], - result="yes", result="no") -AC_MSG_RESULT("$result") -if test "$result" = "yes"; then - AC_DEFINE(HAVE_ARM_SIMD) - HAVE_ARM_SIMD=1 -fi -AC_SUBST(HAVE_ARM_SIMD) - -AC_MSG_CHECKING(for ARM NEON support in compiler) -_SAVE_CFLAGS="$CFLAGS" -if test "$GNU_CC"; then - # gcc needs -mfpu=neon to recognize NEON instructions - CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp" -fi -AC_TRY_COMPILE([], - [asm("vadd.i8 d0, d0, d0");], - result="yes", result="no") -AC_MSG_RESULT("$result") -if test "$result" = "yes"; then - AC_DEFINE(HAVE_ARM_NEON) - HAVE_ARM_NEON=1 -fi -CFLAGS="$_SAVE_CFLAGS" -AC_SUBST(HAVE_ARM_NEON) - dnl ======================================================== dnl = pthread support dnl = Start by checking whether the system support pthreads @@ -3574,7 +3223,7 @@ then echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then - if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then + if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthread=yes case "$target_os" in freebsd*) @@ -3599,7 +3248,7 @@ then echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then - if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then + if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then ac_cv_have_dash_pthreads=yes CFLAGS="$CFLAGS -pthreads" CXXFLAGS="$CXXFLAGS -pthreads" @@ -3713,29 +3362,11 @@ dnl Checks for library functions. dnl ======================================================== AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP + AC_CHECK_FUNCS([fchmod flockfile getc_unlocked _getc_nolock getpagesize \ lchown localtime_r lstat64 memmove random rint sbrk snprintf \ stat64 statvfs statvfs64 strerror strtok_r truncate64]) -dnl check for clock_gettime(), the CLOCK_MONOTONIC clock, and -lrt -_SAVE_LDFLAGS=$LDFLAGS -LDFLAGS="$LDFLAGS -lrt" -AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC) and -lrt, - ac_cv_have_clock_monotonic, - [AC_TRY_LINK([#include ], - [ struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); ], - ac_cv_have_clock_monotonic=yes, - ac_cv_have_clock_monotonic=no)]) -LDFLAGS=$_SAVE_LDFLAGS -if test "$ac_cv_have_clock_monotonic" = "yes"; then - HAVE_CLOCK_MONOTONIC=1 - REALTIME_LIBS=-lrt - AC_DEFINE(HAVE_CLOCK_MONOTONIC) - AC_SUBST(HAVE_CLOCK_MONOTONIC) - AC_SUBST(REALTIME_LIBS) -fi - dnl Windows functions, for mingw. AC_TRY_LINK([#include ], [SYSTEMTIME st;FILETIME ft;SystemTimeToFileTime(&st,&ft);], @@ -4032,7 +3663,6 @@ if test "$GNU_CC"; then ac_cv_gcc_arm_eabi="yes", ac_cv_gcc_arm_eabi="no")]) if test "$ac_cv_gcc_arm_eabi" = "yes"; then - HAVE_ARM_EABI=1 ARM_ABI_PREFIX=eabi- else ARM_ABI_PREFIX=oabi- @@ -4347,79 +3977,8 @@ if test "$ac_cv_trouble_comparing_to_zero" = yes ; then AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO) fi -# try harder, when checking for __thread support, see bug 521750 comment #33 and below -_SAVE_LDFLAGS=$LDFLAGS -LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS" -AC_CACHE_CHECK(for __thread keyword for TLS variables, - ac_cv_thread_keyword, - [AC_TRY_LINK([__thread bool tlsIsMainThread = false;], - [return tlsIsMainThread;], - ac_cv_thread_keyword=yes, - ac_cv_thread_keyword=no)]) -LDFLAGS=$_SAVE_LDFLAGS -if test "$ac_cv_thread_keyword" = yes; then - # mips builds fail with TLS variables because of a binutils bug. - # See bug 528687 - case "${target}" in - mips*-*) - : - ;; - *-android*) - : - ;; - *) - AC_DEFINE(HAVE_THREAD_TLS_KEYWORD) - ;; - esac -fi -dnl Check for the existence of various allocation headers/functions -MALLOC_H= -AC_CHECK_HEADER(malloc.h, [MALLOC_H=malloc.h]) -if test "$MALLOC_H" = ""; then - AC_CHECK_HEADER(malloc/malloc.h, [MALLOC_H=malloc/malloc.h]) - if test "$MALLOC_H" = ""; then - AC_CHECK_HEADER(sys/malloc.h, [MALLOC_H=sys/malloc.h]) - fi -fi -if test "$MALLOC_H" != ""; then - AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>) -fi - -MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc" -AC_CHECK_FUNCS(strndup posix_memalign memalign valloc) - -dnl See if compiler supports some gcc-style attributes - -AC_CACHE_CHECK(for __attribute__((always_inline)), - ac_cv_attribute_always_inline, - [AC_TRY_COMPILE([], - [inline void f(void) __attribute__((always_inline));], - ac_cv_attribute_always_inline=yes, - ac_cv_attribute_always_inline=no)]) - -AC_CACHE_CHECK(for __attribute__((malloc)), - ac_cv_attribute_malloc, - [AC_TRY_COMPILE([], - [void* f(int) __attribute__((malloc));], - ac_cv_attribute_malloc=yes, - ac_cv_attribute_malloc=no)]) - -AC_CACHE_CHECK(for __attribute__((warn_unused_result)), - ac_cv_attribute_warn_unused, - [AC_TRY_COMPILE([], - [int f(void) __attribute__((warn_unused_result));], - ac_cv_attribute_warn_unused=yes, - ac_cv_attribute_warn_unused=no)]) - -AC_CACHE_CHECK(for __attribute__((noreturn)), - ac_cv_attribute_noreturn, - [AC_TRY_COMPILE([], - [void f(void) __attribute__((noreturn));], - ac_cv_attribute_noreturn=yes, - ac_cv_attribute_noreturn=no)]) - dnl End of C++ language/feature checks AC_LANG_C @@ -4440,9 +3999,7 @@ AC_CACHE_CHECK(for LC_MESSAGES, ac_cv_i18n_lc_messages=no)]) if test "$ac_cv_i18n_lc_messages" = yes; then AC_DEFINE(HAVE_I18N_LC_MESSAGES) -fi - -AC_HAVE_FUNCS(localeconv) +fi fi # SKIP_COMPILER_CHECKS @@ -4456,41 +4013,6 @@ dnl ======================================================== dnl The macros used for command line options dnl are defined in build/autoconf/altoptions.m4. -dnl If the compiler supports these attributes, define them as -dnl convenience macros. -if test "$ac_cv_attribute_always_inline" = yes ; then - AC_DEFINE(NS_ALWAYS_INLINE, [__attribute__((always_inline))]) -else - AC_DEFINE(NS_ALWAYS_INLINE,) -fi - -if test "$ac_cv_attribute_malloc" = yes ; then - AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))]) -else - AC_DEFINE(NS_ATTR_MALLOC,) -fi - -if test "$ac_cv_attribute_warn_unused" = yes ; then - AC_DEFINE(NS_WARN_UNUSED_RESULT, [__attribute__((warn_unused_result))]) -else - AC_DEFINE(NS_WARN_UNUSED_RESULT,) -fi - -if test "$ac_cv_attribute_noreturn" = yes ; then - AC_DEFINE(NS_NORETURN, [__attribute__((noreturn))]) -else - AC_DEFINE(NS_NORETURN,) -fi - -dnl We can't run TRY_COMPILE tests on Windows, so hard-code some -dnl features that Windows actually does support. - -if test -n "$SKIP_COMPILER_CHECKS"; then - dnl Windows has malloc.h - AC_DEFINE(MALLOC_H, []) - AC_DEFINE(HAVE_FORCEINLINE) - AC_DEFINE(HAVE_LOCALECONV) -fi # SKIP_COMPILER_CHECKS dnl ======================================================== dnl = @@ -4534,7 +4056,6 @@ if test "$_USE_SYSTEM_NSPR" && (test "$NSPR_CFLAGS" -o "$NSPR_LIBS"); then See 'configure --help'.]) fi -dnl Top-level Mozilla switched to requiring NSPR 4.8.6 (bug 560582), but we don't need it in JS. if test -n "$_USE_SYSTEM_NSPR"; then MOZ_NATIVE_NSPR= AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1]) @@ -4557,6 +4078,18 @@ if test -n "$MOZ_NATIVE_NSPR"; then CFLAGS=$_SAVE_CFLAGS fi +dnl ======================================================== +dnl Use ARM userspace kernel helpers; tell NSPR to enable +dnl their usage and use them in spidermonkey. +dnl ======================================================== +MOZ_ARG_WITH_BOOL(arm-kuser, +[ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)], + USE_ARM_KUSER=1, + USE_ARM_KUSER=) +if test -n "$USE_ARM_KUSER"; then + AC_DEFINE(USE_ARM_KUSER) +fi + dnl ======================================================== dnl = dnl = Application @@ -4568,27 +4101,6 @@ MOZ_ARG_HEADER(Application) BUILD_STATIC_LIBS= ENABLE_TESTS=1 -MOZ_THUMB2= -USE_ARM_KUSER= - -case "${target}" in - arm-android-eabi) - USE_ARM_KUSER=1 - MOZ_THUMB2=1 - ;; -esac - -dnl ======================================================== -dnl Use ARM userspace kernel helpers; tell NSPR to enable -dnl their usage and use them in spidermonkey. -dnl ======================================================== -MOZ_ARG_WITH_BOOL(arm-kuser, -[ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)], - USE_ARM_KUSER=1,) -if test -n "$USE_ARM_KUSER"; then - AC_DEFINE(USE_ARM_KUSER) -fi - dnl ======================================================== dnl = dnl = Components & Features @@ -4596,6 +4108,33 @@ dnl = dnl ======================================================== MOZ_ARG_HEADER(Components and Features) +dnl ======================================================== + +dnl ======================================================== +dnl = Enable building the Thumb2 instruction set +dnl ======================================================== +MOZ_ARG_ENABLE_BOOL(thumb2, + [ --enable-thumb2 Enable Thumb2 instruction set], + MOZ_THUMB2=1,) + +if test -n "$MOZ_THUMB2"; then + case "$target_cpu" in + arm*) + if test "$GNU_CC"; then + AC_DEFINE(MOZ_THUMB2) + CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb" + CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb" + ASFLAGS="$ASFLAGS -march=armv7-a -mthumb" + else + AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains]) + fi + ;; + *) + AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures]) + ;; + esac +fi + dnl ======================================================== dnl = Localization dnl ======================================================== @@ -4620,34 +4159,6 @@ dnl = dnl ======================================================== MOZ_ARG_HEADER(Individual module options) -dnl ======================================================== -dnl = Enable building the Thumb2 instruction set -dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(thumb2, - [ --enable-thumb2 Enable Thumb2 instruction set], - MOZ_THUMB2=1, - MOZ_THUMB2=) - -if test -n "$MOZ_THUMB2"; then - case "$target_cpu" in - arm*) - if test "$GNU_CC"; then - AC_DEFINE(MOZ_THUMB2) - CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb" - CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb" - ASFLAGS="$ASFLAGS -march=armv7-a -mthumb" - else - AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains]) - fi - ;; - *) - AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures]) - ;; - esac -fi - -AC_SUBST(MOZ_THUMB2) - dnl ======================================================== dnl = dnl = Debugging Options @@ -4659,13 +4170,33 @@ dnl ======================================================== dnl = Disable building with debug info. dnl = Debugging is OFF by default dnl ======================================================== -if test -z "$MOZ_DEBUG_FLAGS"; then - MOZ_DEBUG_FLAGS="-g" +if test -z "$MOZ_DEBUG_FLAGS" +then + case "$target" in + *-irix*) + if test "$GNU_CC"; then + GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'` + case "$GCC_VERSION" in + 2.95.*) + MOZ_DEBUG_FLAGS="" + ;; + *) + MOZ_DEBUG_FLAGS="-g" + ;; + esac + else + MOZ_DEBUG_FLAGS="-g" + fi + ;; + *) + MOZ_DEBUG_FLAGS="-g" + ;; + esac fi MOZ_ARG_ENABLE_STRING(debug, [ --enable-debug[=DBG] Enable building with developer debug info - (using compiler flags DBG)], + (Using compiler flags DBG)], [ if test "$enableval" != "no"; then MOZ_DEBUG=1 if test -n "$enableval" -a "$enableval" != "yes"; then @@ -4680,12 +4211,13 @@ MOZ_ARG_ENABLE_STRING(debug, MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING" MOZ_ARG_WITH_STRING(debug-label, [ --with-debug-label=LABELS - Define DEBUG_ for each comma-separated - value given.], + Enabled the use of DEBUG_label ifdefs + (comma separated)], [ for option in `echo $withval | sed 's/,/ /g'`; do MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}" done]) + MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED" if test -n "$MOZ_DEBUG"; then @@ -4779,17 +4311,6 @@ if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then fi dnl ======================================================== -dnl = Disable any treating of compile warnings as errors -dnl ======================================================== -MOZ_ARG_DISABLE_BOOL(warnings-as-errors, -[ --disable-warnings-as-errors - Disable treating of warnings as errors], - MOZ_DISABLE_WARNINGS_AS_ERRORS=1, - MOZ_DISABLE_WARNINGS_AS_ERRORS= ) -if test "$MOZ_DISABLE_WARNINGS_AS_ERRORS"; then - WARNINGS_AS_ERRORS='' -fi - dnl = Enable trace malloc dnl ======================================================== NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC} @@ -4867,14 +4388,7 @@ if test "$MOZ_MEMORY"; then AC_DEFINE(MOZ_MEMORY_WINDOWS) # the interesting bits will get passed down in MOZ_MEMORY_LDFLAGS ;; - *-*wince) - AC_DEFINE(MOZ_MEMORY_WINCE) - AC_DEFINE(MOZ_MEMORY_WINDOWS) - if test -z "$WINCE_WINDOWS_MOBILE"; then - AC_DEFINE(MOZ_MEMORY_WINCE6) - fi - ;; - *-*winmo) + *-*wince|*-*winmo) AC_DEFINE(MOZ_MEMORY_WINCE) AC_DEFINE(MOZ_MEMORY_WINDOWS) ;; @@ -4886,13 +4400,6 @@ if test "$MOZ_MEMORY"; then AC_MSG_ERROR([--enable-jemalloc not supported on ${target}]) ;; esac - - if test "$OS_ARCH" != "Darwin"; then - dnl NB: this must be kept in sync with jemalloc.h - AC_DEFINE(HAVE_JEMALLOC_VALLOC) - AC_DEFINE(HAVE_JEMALLOC_POSIX_MEMALIGN) - AC_DEFINE(HAVE_JEMALLOC_MEMALIGN) - fi fi AC_SUBST(MOZ_MEMORY) AC_SUBST(MOZ_MEMORY_LDFLAGS) @@ -4919,6 +4426,22 @@ MOZ_ARG_WITH_STRING(wrap-malloc, [ --with-wrap-malloc=DIR Location of malloc wrapper library], WRAP_MALLOC_LIB=$withval) +dnl ======================================================== +dnl = Build jsctypes if it's enabled +dnl ======================================================== +MOZ_ARG_ENABLE_BOOL(ctypes, +[ --enable-ctypes Enable js-ctypes (default=no)], + JS_HAS_CTYPES=1, + JS_HAS_CTYPES= ) +AC_SUBST(JS_HAS_CTYPES) +if test "$JS_HAS_CTYPES"; then + if test "$_MSC_VER" -a -z $AS; then + # Error out if we're on MSVC and MASM is unavailable. + AC_MSG_ERROR([No suitable assembler found. An assembler is required to build js-ctypes. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK.]) + fi + AC_DEFINE(JS_HAS_CTYPES) +fi + dnl ======================================================== dnl = Use JS Call tracing dnl ======================================================== @@ -5017,7 +4540,7 @@ if test -n "$MOZ_VTUNE"; then fi dnl ======================================================== -dnl Zealous JavaScript GC +dnl Zealous GC dnl ======================================================== MOZ_ARG_ENABLE_BOOL(gczeal, [ --enable-gczeal Enable zealous GCing], @@ -5036,11 +4559,13 @@ MOZ_ARG_WITH_STRING(ccache, CCACHE=$withval, CCACHE="no") if test "$CCACHE" != "no"; then - if test -z "$CCACHE" -o "$CCACHE" = "yes"; then - CCACHE= - else - if test ! -e "$CCACHE"; then - AC_MSG_ERROR([$CCACHE not found]) + if test -n "$CCACHE"; then + if test "$CCACHE" = "yes"; then + CCACHE= + else + if test ! -e "$CCACHE"; then + AC_MSG_ERROR([$CCACHE not found]) + fi fi fi MOZ_PATH_PROGS(CCACHE, $CCACHE ccache) @@ -5551,21 +5076,6 @@ dnl ======================================================== MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla)) dnl ======================================================== -dnl = Build jsctypes if it's enabled -dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(ctypes, -[ --enable-ctypes Enable js-ctypes (default=no)], - JS_HAS_CTYPES=1, - JS_HAS_CTYPES= ) -AC_SUBST(JS_HAS_CTYPES) -if test "$JS_HAS_CTYPES"; then - if test "$_MSC_VER" -a -z $AS; then - # Error out if we're on MSVC and MASM is unavailable. - AC_MSG_ERROR([No suitable assembler found. An assembler is required to build js-ctypes. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK.]) - fi - AC_DEFINE(JS_HAS_CTYPES) -fi - if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS= fi @@ -5640,6 +5150,8 @@ AC_SUBST(MOZ_OS2_USE_DECLSPEC) AC_SUBST(MOZ_POST_DSO_LIB_COMMAND) AC_SUBST(MOZ_POST_PROGRAM_COMMAND) AC_SUBST(MOZ_TIMELINE) +AC_SUBST(WINCE) +AC_SUBST(WINCE_WINDOWS_MOBILE) AC_SUBST(MOZ_APP_NAME) AC_SUBST(MOZ_APP_DISPLAYNAME) @@ -5661,10 +5173,6 @@ AC_SUBST(AS_PERL) AC_SUBST(WIN32_REDIST_DIR) AC_SUBST(PYTHON) -AC_SUBST(WINCE) -AC_SUBST(WINCE_SDK_DIR) -AC_SUBST(WINCE_WINDOWS_MOBILE) - dnl Echo the CFLAGS to remove extra whitespace. CFLAGS=`echo \ $_WARNINGS_CFLAGS \ @@ -5757,20 +5265,6 @@ if test "$USING_HCC"; then AC_SUBST(CXX) fi -AC_MSG_CHECKING([for posix_fallocate]) -AC_TRY_LINK([#define _XOPEN_SOURCE 600 - #include ], - [posix_fallocate(0, 0, 0);], - [ac_cv___posix_fallocate=true], - [ac_cv___posix_fallocate=false]) - -if test "$ac_cv___posix_fallocate" = true ; then - AC_DEFINE(HAVE_POSIX_FALLOCATE) - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - dnl Check for missing components if test "$COMPILE_ENVIRONMENT"; then if test "$MOZ_X11"; then