michael@0: dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*- michael@0: dnl michael@0: dnl This Source Code Form is subject to the terms of the Mozilla Public michael@0: dnl License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: AC_PREREQ(2.61) michael@0: AC_INIT michael@0: AC_CONFIG_SRCDIR([pr/include/nspr.h]) michael@0: michael@0: AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf) michael@0: AC_CANONICAL_TARGET michael@0: michael@0: dnl ======================================================== michael@0: dnl = Defaults michael@0: dnl ======================================================== michael@0: MOD_MAJOR_VERSION=4 michael@0: MOD_MINOR_VERSION=10 michael@0: MOD_PATCH_VERSION=6 michael@0: NSPR_MODNAME=nspr20 michael@0: _HAVE_PTHREADS= michael@0: USE_PTHREADS= michael@0: USE_USER_PTHREADS= michael@0: USE_NSPR_THREADS= michael@0: USE_N32= michael@0: USE_X32= michael@0: USE_64= michael@0: USE_CPLUS= michael@0: USE_IPV6= michael@0: USE_MDUPDATE= michael@0: _MACOSX_DEPLOYMENT_TARGET= michael@0: _OPTIMIZE_FLAGS=-O michael@0: _DEBUG_FLAGS=-g michael@0: MOZ_DEBUG=1 michael@0: MOZ_OPTIMIZE= michael@0: OBJDIR='$(OBJDIR_NAME)' michael@0: OBJDIR_NAME=. michael@0: OBJDIR_SUFFIX=OBJ michael@0: NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall' michael@0: NOSUCHFILE=/no-such-file michael@0: LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)' michael@0: LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)' michael@0: CYGWIN_WRAPPER= michael@0: MACOS_SDK_DIR= michael@0: NEXT_ROOT= michael@0: MT= michael@0: MOZ_OS2_HIGH_MEMORY=1 michael@0: PROFILE_GEN_CFLAGS= michael@0: PROFILE_GEN_LDFLAGS= michael@0: PROFILE_USE_CFLAGS= michael@0: PROFILE_USE_LDFLAGS= michael@0: michael@0: dnl Link in libraries necessary to resolve all symbols for shared libs michael@0: RESOLVE_LINK_SYMBOLS= michael@0: michael@0: dnl ======================================================== michael@0: dnl = michael@0: dnl = Dont change the following lines. Doing so breaks: michael@0: dnl = michael@0: dnl = CFLAGS="-foo" ./configure michael@0: dnl = michael@0: dnl ======================================================== michael@0: CFLAGS="${CFLAGS=}" michael@0: CXXFLAGS="${CXXFLAGS=}" michael@0: LDFLAGS="${LDFLAGS=}" michael@0: DLLFLAGS="${DLLFLAGS=}" michael@0: HOST_CFLAGS="${HOST_CFLAGS=}" michael@0: HOST_LDFLAGS="${HOST_LDFLAGS=}" michael@0: michael@0: case "$target" in michael@0: *-cygwin*|*-mingw*|*-msys*) michael@0: # Check to see if we are really running in a msvc environemnt michael@0: _WIN32_MSVC= michael@0: AC_CHECK_PROGS(CC, cl) michael@0: if test "$CC" = "cl"; then michael@0: echo 'main() { return 0; }' > dummy.c michael@0: ${CC} -o dummy dummy.c >/dev/null 2>&1 michael@0: if test $? = 0; then michael@0: _WIN32_MSVC=1 michael@0: CXX=$CC michael@0: else michael@0: AC_MSG_WARN([$(CC) test failed. Using normal feature tests]) michael@0: fi michael@0: rm -f dummy dummy.o dummy.obj dummy.exe dummy.c michael@0: fi michael@0: ;; michael@0: *-mks*) michael@0: _WIN32_MSVC=1 michael@0: ;; michael@0: esac michael@0: michael@0: if test -n "$_WIN32_MSVC"; then michael@0: SKIP_PATH_CHECKS=1 michael@0: SKIP_COMPILER_CHECKS=1 michael@0: SKIP_LIBRARY_CHECKS=1 michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl = Android uses a very custom (hacky) toolchain; we need to do this michael@0: dnl = here, so that the compiler checks can succeed michael@0: dnl ======================================================== michael@0: michael@0: AC_ARG_WITH(android-ndk, michael@0: [ --with-android-ndk=DIR michael@0: location where the Android NDK can be found], michael@0: android_ndk=$withval) michael@0: michael@0: AC_ARG_WITH(android-toolchain, michael@0: [ --with-android-toolchain=DIR michael@0: location of the Android toolchain], michael@0: android_toolchain=$withval) michael@0: michael@0: dnl The default android_version is different for each target cpu. michael@0: case "$target_cpu" in michael@0: arm) michael@0: android_version=5 michael@0: ;; michael@0: i?86|mipsel) michael@0: android_version=9 michael@0: ;; michael@0: esac michael@0: michael@0: AC_ARG_WITH(android-version, michael@0: [ --with-android-version=VER michael@0: Android platform version, default 5 for arm, 9 for x86/mips], michael@0: android_version=$withval) michael@0: michael@0: AC_ARG_WITH(android-platform, michael@0: [ --with-android-platform=DIR michael@0: location of platform dir], michael@0: android_platform=$withval) michael@0: michael@0: case "$target" in michael@0: arm-linux*-android*|*-linuxandroid*) michael@0: android_tool_prefix="arm-linux-androideabi" michael@0: ;; michael@0: i?86-*android*) michael@0: android_tool_prefix="i686-linux-android" michael@0: ;; michael@0: mipsel-*android*) michael@0: android_tool_prefix="mipsel-linux-android" michael@0: ;; michael@0: *) michael@0: android_tool_prefix="$target_os" michael@0: ;; michael@0: esac michael@0: michael@0: dnl ======================================================== michael@0: dnl = Gonk is a fork of Android used for Mozilla's B2G project. michael@0: dnl = Configuration is done largely by the top level config michael@0: dnl = and the specified gonk directory doesn't matter here. michael@0: dnl ======================================================== michael@0: michael@0: AC_ARG_WITH(gonk, michael@0: [ --with-gonk=DIR location of gonk dir], michael@0: gonkdir=$withval) michael@0: michael@0: if test -n "$gonkdir" ; then michael@0: dnl Most things are directly configured by env vars when building for gonk michael@0: michael@0: dnl prevent cross compile section from using these flags as host flags michael@0: if test -z "$HOST_CPPFLAGS" ; then michael@0: HOST_CPPFLAGS=" " michael@0: fi michael@0: if test -z "$HOST_CFLAGS" ; then michael@0: HOST_CFLAGS=" " michael@0: fi michael@0: if test -z "$HOST_CXXFLAGS" ; then michael@0: HOST_CXXFLAGS=" " michael@0: fi michael@0: if test -z "$HOST_LDFLAGS" ; then michael@0: HOST_LDFLAGS=" " michael@0: fi michael@0: michael@0: AC_DEFINE(ANDROID) michael@0: else michael@0: case "$target" in michael@0: *-android*|*-linuxandroid*) michael@0: if test -z "$android_ndk" ; then michael@0: AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.]) michael@0: fi michael@0: michael@0: if test -z "$android_toolchain" ; then michael@0: AC_MSG_CHECKING([for android toolchain directory]) michael@0: michael@0: kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"` michael@0: michael@0: case "$target_cpu" in michael@0: arm) michael@0: target_name=arm-linux-androideabi-4.4.3 michael@0: ;; michael@0: i?86) michael@0: target_name=x86-4.4.3 michael@0: ;; michael@0: mipsel) michael@0: target_name=mipsel-linux-android-4.4.3 michael@0: ;; michael@0: esac michael@0: android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86 michael@0: michael@0: if test -d "$android_toolchain" ; then michael@0: AC_MSG_RESULT([$android_toolchain]) michael@0: else michael@0: AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.]) michael@0: fi michael@0: fi michael@0: michael@0: if test -z "$android_platform" ; then michael@0: AC_MSG_CHECKING([for android platform directory]) michael@0: michael@0: case "$target_cpu" in michael@0: arm) michael@0: target_name=arm michael@0: ;; michael@0: i?86) michael@0: target_name=x86 michael@0: ;; michael@0: mipsel) michael@0: target_name=mips michael@0: ;; michael@0: esac michael@0: michael@0: android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name" michael@0: michael@0: if test -d "$android_platform" ; then michael@0: AC_MSG_RESULT([$android_platform]) michael@0: else michael@0: AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.]) michael@0: fi michael@0: fi michael@0: michael@0: dnl Old NDK support. If minimum requirement is changed to NDK r8b, michael@0: dnl please remove this. michael@0: case "$target_cpu" in michael@0: i?86) michael@0: if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then michael@0: dnl Old NDK toolchain name michael@0: android_tool_prefix="i686-android-linux" michael@0: fi michael@0: ;; michael@0: esac michael@0: michael@0: dnl set up compilers michael@0: AS="$android_toolchain"/bin/"$android_tool_prefix"-as michael@0: CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc michael@0: CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++ michael@0: CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp michael@0: LD="$android_toolchain"/bin/"$android_tool_prefix"-ld michael@0: AR="$android_toolchain"/bin/"$android_tool_prefix"-ar michael@0: RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib michael@0: STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip michael@0: michael@0: CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS" michael@0: CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS" michael@0: CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS" michael@0: LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS" michael@0: michael@0: dnl prevent cross compile section from using these flags as host flags michael@0: if test -z "$HOST_CPPFLAGS" ; then michael@0: HOST_CPPFLAGS=" " michael@0: fi michael@0: if test -z "$HOST_CFLAGS" ; then michael@0: HOST_CFLAGS=" " michael@0: fi michael@0: if test -z "$HOST_CXXFLAGS" ; then michael@0: HOST_CXXFLAGS=" " michael@0: fi michael@0: if test -z "$HOST_LDFLAGS" ; then michael@0: HOST_LDFLAGS=" " michael@0: fi michael@0: michael@0: AC_DEFINE(ANDROID) michael@0: ;; michael@0: esac michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl = michael@0: dnl = Check options that may affect the compiler michael@0: dnl = michael@0: dnl ======================================================== michael@0: dist_prefix='${MOD_DEPTH}/dist' michael@0: dist_bindir='${dist_prefix}/bin' michael@0: dist_includedir='${dist_prefix}/include/nspr' michael@0: dist_libdir='${dist_prefix}/lib' michael@0: dnl If the --includedir option was not specified, add '/nspr' to autoconf's michael@0: dnl default value of includedir. michael@0: if test "${includedir}" = '${prefix}/include'; then michael@0: includedir='${prefix}/include/nspr' michael@0: fi michael@0: michael@0: AC_ARG_WITH(dist-prefix, michael@0: [ --with-dist-prefix=DIST_PREFIX michael@0: place build files in DIST_PREFIX [dist]], michael@0: dist_prefix=$withval) michael@0: michael@0: AC_ARG_WITH(dist-bindir, michael@0: [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]], michael@0: dist_bindir=$withval) michael@0: michael@0: AC_ARG_WITH(dist-includedir, michael@0: [ --with-dist-includedir=DIR michael@0: build include files in DIR [DIST_PREFIX/include/nspr]], michael@0: dist_includedir=$withval) michael@0: michael@0: AC_ARG_WITH(dist-libdir, michael@0: [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]], michael@0: dist_libdir=$withval) michael@0: michael@0: AC_SUBST(dist_prefix) michael@0: AC_SUBST(dist_bindir) michael@0: AC_SUBST(dist_includedir) michael@0: AC_SUBST(dist_libdir) michael@0: michael@0: dnl Check if NSPR is being compiled for Mozilla michael@0: dnl Let --with-arg override environment setting michael@0: dnl michael@0: AC_ARG_WITH(mozilla, michael@0: [ --with-mozilla Compile NSPR with Mozilla support], michael@0: [ if test "$withval" = "yes"; then michael@0: AC_DEFINE(MOZILLA_CLIENT) michael@0: MOZILLA_CLIENT=1 michael@0: else michael@0: MOZILLA_CLIENT= michael@0: fi], michael@0: [ if test -n "$MOZILLA_CLIENT"; then michael@0: AC_DEFINE(MOZILLA_CLIENT) michael@0: fi]) michael@0: michael@0: AC_ARG_ENABLE(optimize, michael@0: [ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ], michael@0: [ if test "$enableval" != "no"; then michael@0: MOZ_OPTIMIZE=1 michael@0: if test -n "$enableval" -a "$enableval" != "yes"; then michael@0: _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'` michael@0: _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS michael@0: fi michael@0: else michael@0: MOZ_OPTIMIZE= michael@0: fi ]) michael@0: michael@0: AC_ARG_ENABLE(debug, michael@0: [ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)], michael@0: [ if test "$enableval" != "no"; then michael@0: MOZ_DEBUG=1 michael@0: MOZ_DEBUG_SYMBOLS=1 michael@0: if test -n "$enableval" -a "$enableval" != "yes"; then michael@0: _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'` michael@0: _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS michael@0: fi michael@0: else michael@0: MOZ_DEBUG= michael@0: fi ], michael@0: MOZ_DEBUG_SYMBOLS=1) michael@0: michael@0: AC_ARG_ENABLE(debug-symbols, michael@0: [ --enable-debug-symbols[=DBG] Enable debugging symbols michael@0: (using compiler flags DBG)], michael@0: [ if test "$enableval" != "no"; then michael@0: MOZ_DEBUG_SYMBOLS=1 michael@0: if test -n "$enableval" -a "$enableval" != "yes"; then michael@0: if test -z "$_SAVE_DEBUG_FLAGS"; then michael@0: _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'` michael@0: _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS michael@0: else michael@0: AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags]) michael@0: fi michael@0: fi michael@0: else michael@0: MOZ_DEBUG_SYMBOLS= michael@0: fi ]) michael@0: michael@0: AC_ARG_ENABLE(win32-target, michael@0: [ --enable-win32-target=\$t michael@0: Specify win32 flavor. (WIN95 or WINNT)], michael@0: OS_TARGET=`echo $enableval | tr a-z A-Z`) michael@0: michael@0: AC_ARG_ENABLE(symbian-target, michael@0: [ --enable-symbian-target=\$t michael@0: Specify symbian flavor. (WINSCW or GCCE)], michael@0: OS_TARGET=`echo $enableval | tr a-z A-Z`) michael@0: michael@0: AC_ARG_ENABLE(debug-rtl, michael@0: [ --enable-debug-rtl Use the MSVC debug runtime library], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_DEBUG_RTL=1 michael@0: else michael@0: USE_DEBUG_RTL=0 michael@0: fi ]) michael@0: michael@0: AC_ARG_ENABLE(n32, michael@0: [ --enable-n32 Enable n32 ABI support (IRIX only)], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_N32=1 michael@0: else if test "$enableval" = "no"; then michael@0: USE_N32= michael@0: fi michael@0: fi ]) michael@0: michael@0: AC_ARG_ENABLE(x32, michael@0: [ --enable-x32 Enable x32 ABI support (x86_64 only)], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_X32=1 michael@0: else if test "$enableval" = "no"; then michael@0: USE_X32= michael@0: fi michael@0: fi ]) michael@0: michael@0: AC_ARG_ENABLE(64bit, michael@0: [ --enable-64bit Enable 64-bit support (on certain platforms)], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_64=1 michael@0: fi ]) michael@0: michael@0: AC_ARG_ENABLE(mdupdate, michael@0: [ --enable-mdupdate Enable use of certain compilers' mdupdate feature], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_MDUPDATE=1 michael@0: fi ]) michael@0: michael@0: AC_ARG_ENABLE(cplus, michael@0: [ --enable-cplus Enable some c++ api routines], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_CPLUS=1 michael@0: fi]) michael@0: michael@0: AC_ARG_WITH(arm-kuser, michael@0: [ --with-arm-kuser Use kuser helpers (Linux/ARM only) michael@0: (Requires kernel 2.6.13 or later)], michael@0: [ if test "$withval" = "yes"; then michael@0: AC_DEFINE(_PR_ARM_KUSER) michael@0: fi ]) michael@0: michael@0: dnl ======================================================== michael@0: dnl = Mac OS X SDK support michael@0: dnl ======================================================== michael@0: AC_ARG_WITH(macos-sdk, michael@0: [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)], michael@0: MACOS_SDK_DIR=$withval) michael@0: michael@0: AC_ARG_ENABLE(macos-target, michael@0: [ --enable-macos-target=VER michael@0: Set the minimum MacOS version needed at runtime michael@0: [10.2 for ppc, 10.4 for x86]], michael@0: [_MACOSX_DEPLOYMENT_TARGET=$enableval]) michael@0: michael@0: dnl ======================================================== michael@0: dnl = michael@0: dnl = Set the threading model michael@0: dnl = michael@0: dnl ======================================================== michael@0: case "$target" in michael@0: michael@0: *-aix*) michael@0: case "${target_os}" in michael@0: aix3.2*) michael@0: USE_NSPR_THREADS=1 michael@0: ;; michael@0: *) michael@0: USE_PTHREADS=1 michael@0: ;; michael@0: esac michael@0: ;; michael@0: michael@0: esac michael@0: michael@0: dnl ======================================================== michael@0: dnl = michael@0: dnl = Set the default C compiler michael@0: dnl = michael@0: dnl ======================================================== michael@0: if test -z "$CC"; then michael@0: case "$target" in michael@0: michael@0: *-aix*) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: CC=xlc_r michael@0: else michael@0: CC=xlc michael@0: fi michael@0: ;; michael@0: michael@0: *-hpux*) michael@0: CC=cc michael@0: ;; michael@0: michael@0: *-irix*) michael@0: CC=cc michael@0: ;; michael@0: michael@0: *-osf*) michael@0: CC=cc michael@0: ;; michael@0: michael@0: *-solaris*) michael@0: CC=cc michael@0: ;; michael@0: michael@0: esac michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl = michael@0: dnl = Set the default C++ compiler michael@0: dnl = michael@0: dnl ======================================================== michael@0: if test -z "$CXX"; then michael@0: case "$target" in michael@0: michael@0: *-aix*) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: CXX=xlC_r michael@0: else michael@0: CXX=xlC michael@0: fi michael@0: ;; michael@0: michael@0: *-hpux*) michael@0: case "${target_os}" in michael@0: hpux10.30) michael@0: CXX=aCC michael@0: ;; michael@0: hpux11.*) michael@0: CXX=aCC michael@0: ;; michael@0: *) michael@0: CXX=CC michael@0: ;; michael@0: esac michael@0: ;; michael@0: michael@0: *-irix*) michael@0: CXX=CC michael@0: ;; michael@0: michael@0: *-osf*) michael@0: CXX=cxx michael@0: ;; michael@0: michael@0: *-solaris*) michael@0: CXX=CC michael@0: ;; michael@0: michael@0: esac michael@0: fi michael@0: michael@0: if test -z "$SKIP_PATH_CHECKS"; then michael@0: AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami) michael@0: fi michael@0: michael@0: if test -n "$MOZ_DEBUG"; then michael@0: AC_DEFINE(DEBUG) michael@0: DEFINES="$DEFINES -UNDEBUG" michael@0: michael@0: case "${target_os}" in michael@0: beos*) michael@0: DEFINES="$DEFINES -DDEBUG_${USER}" michael@0: ;; michael@0: mks*|cygwin*|mingw*|msys*|os2*) michael@0: DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`" michael@0: ;; michael@0: *) michael@0: DEFINES="$DEFINES -DDEBUG_`$WHOAMI`" michael@0: ;; michael@0: esac michael@0: else michael@0: AC_DEFINE(NDEBUG) michael@0: DEFINES="$DEFINES -UDEBUG" michael@0: fi michael@0: michael@0: if test -z "$SKIP_COMPILER_CHECKS"; then michael@0: dnl ======================================================== michael@0: dnl Checks for compilers. michael@0: dnl ======================================================== michael@0: if test "$target" != "$host"; then michael@0: echo "cross compiling from $host to $target" michael@0: cross_compiling=yes michael@0: michael@0: case "$build:$target" in michael@0: powerpc-apple-darwin8*:i?86-apple-darwin*) michael@0: dnl The Darwin cross compiler doesn't necessarily point itself at a michael@0: dnl root that has libraries for the proper architecture, it defaults michael@0: dnl to the system root. The libraries in the system root on current michael@0: dnl versions of PPC OS X 10.4 aren't fat, so these target compiler michael@0: dnl checks will fail. Fake a working SDK in that case. michael@0: _SAVE_CFLAGS=$CFLAGS michael@0: _SAVE_CXXFLAGS=$CXXFLAGS michael@0: CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS" michael@0: CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS" michael@0: ;; michael@0: *:arm*-apple-darwin*) michael@0: dnl The arm compiler doesn't appear to know about its root by default, michael@0: dnl so explicitly pass it one here. Later on we'll put this in CFLAGS michael@0: dnl anyway. michael@0: _SAVE_CFLAGS=$CFLAGS michael@0: _SAVE_CXXFLAGS=$CXXFLAGS michael@0: CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS" michael@0: CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS" michael@0: ;; michael@0: esac michael@0: michael@0: AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo) michael@0: unset ac_cv_prog_CC michael@0: dnl Now exit the conditional block to invoke AC_PROG_CC. michael@0: fi michael@0: michael@0: dnl In the latest versions of autoconf, AC_PROG_CC is a one-shot macro, michael@0: dnl declared with AC_DEFUN_ONCE. So it must not be expanded inside a michael@0: dnl conditional block. Invoke AC_PROG_CC outside any conditional block michael@0: dnl and before invoking AC_TRY_COMPILE (which requires AC_PROG_CC). michael@0: AC_PROG_CC michael@0: michael@0: dnl Reenter the conditional blocks after invoking AC_PROG_CC. michael@0: if test "$target" != "$host"; then michael@0: if test -n "$USE_CPLUS"; then michael@0: AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo) michael@0: unset ac_cv_prog_CXX michael@0: AC_PROG_CXX michael@0: fi michael@0: michael@0: case "$build:$target" in michael@0: powerpc-apple-darwin8*:i?86-apple-darwin*|*:arm*-apple-darwin*) michael@0: dnl Revert the changes made above. From this point on, the target michael@0: dnl compiler will never be used without applying the SDK to CFLAGS michael@0: dnl (see --with-macos-sdk below). michael@0: CFLAGS=$_SAVE_CFLAGS michael@0: CXXFLAGS=$_SAVE_CXXFLAGS michael@0: ;; michael@0: esac michael@0: michael@0: AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo) michael@0: AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo) michael@0: AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo) michael@0: AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo) michael@0: AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo) michael@0: AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo) michael@0: michael@0: _SAVE_CC="$CC" michael@0: _SAVE_CFLAGS="$CFLAGS" michael@0: _SAVE_LDFLAGS="$LDFLAGS" michael@0: michael@0: AC_MSG_CHECKING([for $host compiler]) michael@0: AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "") michael@0: if test -z "$HOST_CC"; then michael@0: AC_MSG_ERROR([no acceptable cc found in \$PATH]) michael@0: fi michael@0: AC_MSG_RESULT([$HOST_CC]) michael@0: if test -z "$HOST_CFLAGS"; then michael@0: HOST_CFLAGS="$CFLAGS" michael@0: fi michael@0: if test -z "$HOST_LDFLAGS"; then michael@0: HOST_LDFLAGS="$LDFLAGS" michael@0: fi michael@0: michael@0: CC="$HOST_CC" michael@0: CFLAGS="$HOST_CFLAGS" michael@0: LDFLAGS="$HOST_LDFLAGS" michael@0: michael@0: AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works]) michael@0: AC_TRY_COMPILE([], [return 0;], michael@0: [AC_MSG_RESULT([yes])], michael@0: [AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.])] ) michael@0: michael@0: CC=$_SAVE_CC michael@0: CFLAGS=$_SAVE_CFLAGS michael@0: LDFLAGS=$_SAVE_LDFLAGS michael@0: else michael@0: if test -n "$USE_CPLUS"; then michael@0: if test "$CC" = "cl" -a -z "$CXX"; then michael@0: CXX=$CC michael@0: else michael@0: AC_PROG_CXX michael@0: fi michael@0: fi michael@0: AC_PROG_RANLIB michael@0: AC_PATH_PROGS(AS, as, $CC) michael@0: AC_PATH_PROGS(AR, ar, echo not_ar) michael@0: AC_PATH_PROGS(LD, ld link, echo not_ld) michael@0: AC_PATH_PROGS(STRIP, strip, echo not_strip) michael@0: AC_PATH_PROGS(WINDRES, windres, echo not_windres) michael@0: if test -z "$HOST_CC"; then michael@0: HOST_CC="$CC" michael@0: fi michael@0: if test -z "$HOST_CFLAGS"; then michael@0: HOST_CFLAGS="$CFLAGS" michael@0: fi michael@0: fi michael@0: michael@0: AC_PROG_CPP michael@0: michael@0: if test "$GCC" = "yes"; then michael@0: GNU_CC=1 michael@0: fi michael@0: if test "$GXX" = "yes"; then michael@0: GNU_CXX=1 michael@0: fi michael@0: if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then michael@0: GNU_AS=1 michael@0: fi michael@0: rm -f a.out michael@0: michael@0: case "$build:$target" in michael@0: i?86-apple-darwin*:powerpc-apple-darwin*) michael@0: dnl cross_compiling will have erroneously been set to "no" in this michael@0: dnl case, because the x86 build host is able to run ppc code in a michael@0: dnl translated environment, making a cross compiler appear native. michael@0: cross_compiling=yes michael@0: ;; michael@0: esac michael@0: michael@0: if test "$cross_compiling" = "yes"; then michael@0: CROSS_COMPILE=1 michael@0: else michael@0: CROSS_COMPILE= michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl Check for gcc -pipe support michael@0: dnl ======================================================== michael@0: AC_MSG_CHECKING([for gcc -pipe support]) michael@0: if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then michael@0: echo '#include ' > dummy-hello.c michael@0: echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c michael@0: ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5 michael@0: cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5 michael@0: if test $? = 0; then michael@0: _res_as_stdin="yes" michael@0: else michael@0: _res_as_stdin="no" michael@0: fi michael@0: if test "$_res_as_stdin" = "yes"; then michael@0: _SAVE_CFLAGS=$CFLAGS michael@0: CFLAGS="$CFLAGS -pipe" michael@0: AC_TRY_COMPILE( [ #include ], michael@0: [printf("Hello World\n");], michael@0: [_res_gcc_pipe="yes"], michael@0: [_res_gcc_pipe="no"] ) michael@0: CFLAGS=$_SAVE_CFLAGS michael@0: fi michael@0: if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then michael@0: _res="yes"; michael@0: CFLAGS="$CFLAGS -pipe" michael@0: CXXFLAGS="$CXXFLAGS -pipe" michael@0: else michael@0: _res="no" michael@0: fi michael@0: rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out michael@0: AC_MSG_RESULT([$_res]) michael@0: else michael@0: AC_MSG_RESULT([no]) michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl Profile guided optimization michael@0: dnl ======================================================== michael@0: dnl Test for profiling options michael@0: dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use michael@0: michael@0: _SAVE_CFLAGS="$CFLAGS" michael@0: CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" michael@0: michael@0: AC_MSG_CHECKING([whether C compiler supports -fprofile-generate]) michael@0: AC_TRY_COMPILE([], [return 0;], michael@0: [ PROFILE_GEN_CFLAGS="-fprofile-generate" michael@0: result="yes" ], result="no") michael@0: AC_MSG_RESULT([$result]) michael@0: michael@0: if test $result = "yes"; then michael@0: PROFILE_GEN_LDFLAGS="-fprofile-generate" michael@0: PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" michael@0: PROFILE_USE_LDFLAGS="-fprofile-use" michael@0: fi michael@0: michael@0: CFLAGS="$_SAVE_CFLAGS" michael@0: michael@0: dnl =============================================================== michael@0: dnl Check for .hidden assembler directive and visibility attribute. michael@0: dnl Borrowed from glibc configure.in michael@0: dnl =============================================================== michael@0: if test "$GNU_CC"; then michael@0: AC_CACHE_CHECK(for visibility(hidden) attribute, michael@0: ac_cv_visibility_hidden, michael@0: [cat > conftest.c </dev/null 2>&1; then michael@0: if grep '\.hidden.*foo' conftest.s >/dev/null; then michael@0: ac_cv_visibility_hidden=yes michael@0: fi michael@0: fi michael@0: rm -f conftest.[cs] michael@0: ]) michael@0: if test "$ac_cv_visibility_hidden" = "yes"; then michael@0: AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE) michael@0: AC_CACHE_CHECK(for visibility pragma support, michael@0: ac_cv_visibility_pragma, michael@0: [cat > conftest.c </dev/null 2>&1; then michael@0: if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then michael@0: if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then michael@0: ac_cv_visibility_pragma=yes michael@0: fi michael@0: fi michael@0: fi michael@0: rm -f conftest.[cs] michael@0: ]) michael@0: if test "$ac_cv_visibility_pragma" = "yes"; then michael@0: AC_DEFINE(HAVE_VISIBILITY_PRAGMA) michael@0: # To work around a build problem on Linux x86-64 (Bugzilla bug michael@0: # 293438), we use the -fvisibility=hidden flag. This flag is less michael@0: # optimal than #pragma GCC visibility push(hidden) because the flag michael@0: # assumes that symbols defined outside the current source file have michael@0: # the default visibility. This has the advantage that we don't need michael@0: # to wrap system header files, but has the disadvantage that calls michael@0: # to hidden symbols defined in other source files cannot be michael@0: # optimized by the compiler. The -fvisibility=hidden flag does michael@0: # hide and export symbols correctly. michael@0: #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h' michael@0: #WRAP_SYSTEM_INCLUDES=1 michael@0: VISIBILITY_FLAGS="-fvisibility=hidden" michael@0: WRAP_SYSTEM_INCLUDES= michael@0: fi michael@0: fi michael@0: fi # GNU_CC michael@0: michael@0: fi # SKIP_COMPILER_CHECKS michael@0: michael@0: dnl ======================================================== michael@0: dnl Checks for programs. michael@0: dnl ======================================================== michael@0: if test -z "$SKIP_PATH_CHECKS"; then michael@0: AC_PATH_PROGS(PERL, perl5 perl, echo not_perl) michael@0: elif test -z "$PERL"; then michael@0: PERL=perl michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl Default platform specific options michael@0: dnl ======================================================== michael@0: OBJ_SUFFIX=o michael@0: LIB_SUFFIX=a michael@0: DLL_SUFFIX=so michael@0: ASM_SUFFIX=s michael@0: MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@' michael@0: PR_MD_ASFILES= michael@0: PR_MD_CSRCS= michael@0: PR_MD_ARCH_DIR=unix michael@0: AR_FLAGS='cr $@' michael@0: AS='$(CC)' michael@0: ASFLAGS='$(CFLAGS)' michael@0: michael@0: if test -n "$CROSS_COMPILE"; then michael@0: OS_ARCH=`echo $target_os | sed -e 's|/|_|g'` michael@0: OS_RELEASE= michael@0: OS_TEST="${target_cpu}" michael@0: case "${target_os}" in michael@0: linux*) OS_ARCH=Linux ;; michael@0: solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;; michael@0: mingw*) OS_ARCH=WINNT CPU_ARCH=x86 ;; michael@0: darwin*) OS_ARCH=Darwin ;; michael@0: riscos*) OS_ARCH=RISCOS ;; michael@0: esac michael@0: else michael@0: OS_ARCH=`uname -s | sed -e 's|/|_|g'` michael@0: OS_RELEASE=`uname -r` michael@0: OS_TEST=`uname -m` michael@0: fi michael@0: michael@0: if test "$OS_ARCH" = "IRIX64"; then michael@0: OS_ARCH=IRIX michael@0: fi michael@0: michael@0: if test "$OS_ARCH" = "AIX"; then michael@0: OS_RELEASE=`uname -v`.`uname -r` michael@0: fi michael@0: michael@0: if test "$OS_ARCH" = "FreeBSD"; then michael@0: OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'` michael@0: fi michael@0: michael@0: if test "$OS_ARCH" = "Linux"; then michael@0: OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'` michael@0: OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'` michael@0: fi michael@0: michael@0: ####################################################################### michael@0: # Master "Core Components" macros for getting the OS target # michael@0: ####################################################################### michael@0: michael@0: # michael@0: # Note: OS_TARGET should be specified on the command line for gmake. michael@0: # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built. michael@0: # The difference between the Win95 target and the WinNT target is that michael@0: # the WinNT target uses Windows NT specific features not available michael@0: # in Windows 95. The Win95 target will run on Windows NT, but (supposedly) michael@0: # at lesser performance (the Win95 target uses threads; the WinNT target michael@0: # uses fibers). michael@0: # michael@0: # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no michael@0: # cross-compilation. michael@0: # michael@0: michael@0: # michael@0: # The following hack allows one to build on a WIN95 machine (as if michael@0: # s/he were cross-compiling on a WINNT host for a WIN95 target). michael@0: # It also accomodates for MKS's uname.exe. If you never intend michael@0: # to do development on a WIN95 machine, you don't need this hack. michael@0: # michael@0: case "$OS_ARCH" in michael@0: Windows_95) michael@0: OS_ARCH=Windows_NT michael@0: OS_TARGET=WIN95 michael@0: ;; michael@0: Windows_98) michael@0: OS_ARCH=Windows_NT michael@0: OS_TARGET=WIN95 michael@0: ;; michael@0: CYGWIN_9*|CYGWIN_ME*) michael@0: OS_ARCH='CYGWIN_NT-4.0' michael@0: OS_TARGET=WIN95 michael@0: ;; michael@0: OS_2) michael@0: OS_ARCH=OS2 michael@0: OS_TARGET=OS2 michael@0: ;; michael@0: esac michael@0: michael@0: # michael@0: # On WIN32, we also define the variable CPU_ARCH. michael@0: # michael@0: michael@0: case "$OS_ARCH" in michael@0: Windows_NT) michael@0: # michael@0: # If uname -s returns "Windows_NT", we assume that we are using michael@0: # the uname.exe in MKS toolkit. michael@0: # michael@0: # The -r option of MKS uname only returns the major version number. michael@0: # So we need to use its -v option to get the minor version number. michael@0: # Moreover, it doesn't have the -p option, so we need to use uname -m. michael@0: # michael@0: OS_ARCH=WINNT michael@0: OS_MINOR_RELEASE=`uname -v` michael@0: if test "$OS_MINOR_RELEASE" = "00"; then michael@0: OS_MINOR_RELEASE=0 michael@0: fi michael@0: OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}" michael@0: CPU_ARCH=`uname -m` michael@0: # michael@0: # MKS's uname -m returns "586" on a Pentium machine. michael@0: # michael@0: if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then michael@0: CPU_ARCH=x86 michael@0: fi michael@0: ;; michael@0: CYGWIN_NT*|MINGW*_NT*|MSYS_NT*) michael@0: # michael@0: # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using michael@0: # the uname.exe in the Cygwin tools. michael@0: # If uname -s returns "MINGW32_NT-5.1", we assume that we are using michael@0: # the uname.exe in the MSYS tools. michael@0: # If uname -s returns "MSYS_NT-6.3", we assume that we are using michael@0: # the uname.exe in the MSYS2 tools. michael@0: # michael@0: OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'` michael@0: OS_ARCH=WINNT michael@0: CPU_ARCH=`uname -m` michael@0: # michael@0: # Cygwin's uname -m returns "i686" on a Pentium Pro machine. michael@0: # michael@0: if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then michael@0: CPU_ARCH=x86 michael@0: fi michael@0: ;; michael@0: esac michael@0: michael@0: if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then michael@0: OS_TARGET=WIN95 michael@0: if test -n "$MOZ_DEBUG" -a -z "$USE_DEBUG_RTL"; then michael@0: USE_DEBUG_RTL=1 michael@0: fi michael@0: fi michael@0: if test -z "$OS_TARGET"; then michael@0: OS_TARGET=$OS_ARCH michael@0: fi michael@0: if test "$OS_TARGET" = "WIN95"; then michael@0: OS_RELEASE="4.0" michael@0: fi michael@0: OS_CONFIG="${OS_TARGET}${OS_RELEASE}" michael@0: michael@0: dnl ======================================================== michael@0: dnl Enable high-memory support on OS/2 by default. michael@0: dnl ======================================================== michael@0: AC_ARG_ENABLE(os2-high-mem, michael@0: [ --disable-os2-high-mem Disable high-memory support on OS/2], michael@0: [ if test "$enableval" = "no"; then michael@0: MOZ_OS2_HIGH_MEMORY= michael@0: else michael@0: MOZ_OS2_HIGH_MEMORY=1 michael@0: fi ]) michael@0: michael@0: dnl ======================================================== michael@0: dnl = ARM toolchain tweaks michael@0: dnl ======================================================== michael@0: michael@0: dnl Defaults michael@0: MOZ_ALIGN=toolchain-default michael@0: michael@0: case "$target" in michael@0: arm*-android*|arm*-linuxandroid*) michael@0: MOZ_THUMB=yes michael@0: MOZ_ARCH=armv7-a michael@0: MOZ_FPU=vfp michael@0: MOZ_FLOAT_ABI=softfp michael@0: MOZ_SOFT_FLOAT=yes michael@0: MOZ_ALIGN=no michael@0: ;; michael@0: arm*-*) michael@0: if test -n "$MOZ_PLATFORM_MAEMO"; then michael@0: MOZ_THUMB=no michael@0: MOZ_ARCH=armv7-a michael@0: MOZ_FLOAT_ABI=softfp michael@0: fi michael@0: if test "$MOZ_PLATFORM_MAEMO" = 6; then michael@0: MOZ_THUMB=yes michael@0: fi michael@0: ;; michael@0: esac michael@0: michael@0: dnl Kept for compatibility with some buildbot mozconfig michael@0: AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval) michael@0: michael@0: AC_ARG_WITH(thumb, michael@0: [ --with-thumb[[=yes|no|toolchain-default]]] michael@0: [ Use Thumb instruction set (-mthumb)], michael@0: if test -z "$GNU_CC"; then michael@0: AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults]) michael@0: fi michael@0: MOZ_THUMB=$withval) michael@0: michael@0: AC_ARG_WITH(thumb-interwork, michael@0: [ --with-thumb-interwork[[=yes|no|toolchain-default]] michael@0: Use Thumb/ARM instuctions interwork (-mthumb-interwork)], michael@0: if test -z "$GNU_CC"; then michael@0: AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults]) michael@0: fi michael@0: MOZ_THUMB_INTERWORK=$withval) michael@0: michael@0: AC_ARG_WITH(arch, michael@0: [ --with-arch=[[type|toolchain-default]] michael@0: Use specific CPU features (-march=type)], michael@0: if test -z "$GNU_CC"; then michael@0: AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults]) michael@0: fi michael@0: MOZ_ARCH=$withval) michael@0: michael@0: AC_ARG_WITH(fpu, michael@0: [ --with-fpu=[[type|toolchain-default]] michael@0: Use specific FPU type (-mfpu=type)], michael@0: if test -z "$GNU_CC"; then michael@0: AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults]) michael@0: fi michael@0: MOZ_FPU=$withval) michael@0: michael@0: AC_ARG_WITH(float-abi, michael@0: [ --with-float-abi=[[type|toolchain-default]] michael@0: Use specific arm float ABI (-mfloat-abi=type)], michael@0: if test -z "$GNU_CC"; then michael@0: AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults]) michael@0: fi michael@0: MOZ_FLOAT_ABI=$withval) michael@0: michael@0: AC_ARG_WITH(soft-float, michael@0: [ --with-soft-float[[=yes|no|toolchain-default]] michael@0: Use soft float library (-msoft-float)], michael@0: if test -z "$GNU_CC"; then michael@0: AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults]) michael@0: fi michael@0: MOZ_SOFT_FLOAT=$withval) michael@0: michael@0: case "$MOZ_ARCH" in michael@0: toolchain-default|"") michael@0: arch_flag="" michael@0: ;; michael@0: *) michael@0: arch_flag="-march=$MOZ_ARCH" michael@0: ;; michael@0: esac michael@0: michael@0: case "$MOZ_THUMB" in michael@0: yes) michael@0: MOZ_THUMB2=1 michael@0: thumb_flag="-mthumb" michael@0: ;; michael@0: no) michael@0: MOZ_THUMB2= michael@0: thumb_flag="-marm" michael@0: ;; michael@0: *) michael@0: _SAVE_CFLAGS="$CFLAGS" michael@0: CFLAGS="$arch_flag" michael@0: AC_TRY_COMPILE([],[return sizeof(__thumb2__);], michael@0: MOZ_THUMB2=1, michael@0: MOZ_THUMB2=) michael@0: CFLAGS="$_SAVE_CFLAGS" michael@0: thumb_flag="" michael@0: ;; michael@0: esac michael@0: michael@0: case "$MOZ_THUMB_INTERWORK" in michael@0: yes) michael@0: thumb_interwork_flag="-mthumb-interwork" michael@0: ;; michael@0: no) michael@0: thumb_interwork_flag="-mno-thumb-interwork" michael@0: ;; michael@0: *) # toolchain-default michael@0: thumb_interwork_flag="" michael@0: ;; michael@0: esac michael@0: michael@0: case "$MOZ_FPU" in michael@0: toolchain-default|"") michael@0: fpu_flag="" michael@0: ;; michael@0: *) michael@0: fpu_flag="-mfpu=$MOZ_FPU" michael@0: ;; michael@0: esac michael@0: michael@0: case "$MOZ_FLOAT_ABI" in michael@0: toolchain-default|"") michael@0: float_abi_flag="" michael@0: ;; michael@0: *) michael@0: float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI" michael@0: ;; michael@0: esac michael@0: michael@0: case "$MOZ_SOFT_FLOAT" in michael@0: yes) michael@0: soft_float_flag="-msoft-float" michael@0: ;; michael@0: no) michael@0: soft_float_flag="-mno-soft-float" michael@0: ;; michael@0: *) # toolchain-default michael@0: soft_float_flag="" michael@0: ;; michael@0: esac michael@0: michael@0: case "$MOZ_ALIGN" in michael@0: toolchain-default|"") michael@0: align_flag="" michael@0: ;; michael@0: no) michael@0: align_flag="-mno-unaligned-access" michael@0: ;; michael@0: yes) michael@0: align_flag="-munaligned-access" michael@0: ;; michael@0: *) michael@0: align_flag="" michael@0: ;; michael@0: esac michael@0: michael@0: if test -n "$align_flag"; then michael@0: _SAVE_CFLAGS="$CFLAGS" michael@0: CFLAGS="$CFLAGS $align_flag" michael@0: AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported) michael@0: AC_TRY_COMPILE([],[],,align_flag="") michael@0: CFLAGS="$_SAVE_CFLAGS" michael@0: fi michael@0: michael@0: dnl Use echo to avoid accumulating space characters michael@0: all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag` michael@0: if test -n "$all_flags"; then michael@0: _SAVE_CFLAGS="$CFLAGS" michael@0: CFLAGS="$all_flags" michael@0: AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works) michael@0: AC_TRY_COMPILE([],[return 0;], michael@0: AC_MSG_RESULT([yes]), michael@0: AC_MSG_ERROR([no])) michael@0: michael@0: CFLAGS="$_SAVE_CFLAGS $all_flags" michael@0: CXXFLAGS="$CXXFLAGS $all_flags" michael@0: ASFLAGS="$ASFLAGS $all_flags" michael@0: if test -n "$thumb_flag"; then michael@0: LDFLAGS="$LDFLAGS $thumb_flag" michael@0: fi michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl Override of system specific host options michael@0: dnl ======================================================== michael@0: case "$host" in michael@0: *-mingw*|*-msys*) michael@0: NSINSTALL=nsinstall michael@0: ;; michael@0: *-cygwin*|*-mks*) michael@0: NSINSTALL='$(CYGWIN_WRAPPER) nsinstall' michael@0: if test `echo "${PATH}" | grep -c \;` = 0; then michael@0: CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper' michael@0: fi michael@0: ;; michael@0: *-beos*) michael@0: HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE" michael@0: ;; michael@0: *os2*) michael@0: ;; michael@0: *) michael@0: HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX" michael@0: ;; michael@0: esac michael@0: michael@0: dnl ======================================================== michael@0: dnl Override of system specific target options michael@0: dnl ======================================================== michael@0: case "$target" in michael@0: michael@0: *-aix*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(AIX) michael@0: AC_DEFINE(SYSV) michael@0: DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib' michael@0: AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H)) michael@0: case "${target_os}" in michael@0: aix3.2*) michael@0: AC_DEFINE(AIX_RENAME_SELECT) michael@0: AC_DEFINE(_PR_NO_LARGE_FILES) michael@0: AIX_LINK_OPTS='-bnso -berok' michael@0: PR_MD_ASFILES=os_AIX.s michael@0: ;; michael@0: aix4.1*) michael@0: AC_DEFINE(AIX_TIMERS) michael@0: AC_DEFINE(_PR_NO_LARGE_FILES) michael@0: AC_DEFINE(AIX4_1) michael@0: MKSHLIB= michael@0: DSO_LDOPTS= michael@0: AIX_LINK_OPTS='-bnso -berok' michael@0: LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr' michael@0: LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr' michael@0: ;; michael@0: aix4.2*) michael@0: AC_DEFINE(AIX_TIMERS) michael@0: AC_DEFINE(_PR_HAVE_OFF64_T) michael@0: AIX_LINK_OPTS='-brtl -bnso -berok' michael@0: ;; michael@0: aix4.3*) michael@0: AC_DEFINE(AIX_TIMERS) michael@0: AC_DEFINE(_PR_HAVE_OFF64_T) michael@0: AC_DEFINE(AIX4_3_PLUS) michael@0: AC_DEFINE(HAVE_SOCKLEN_T) michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: USE_IPV6=1 michael@0: AIX_LINK_OPTS='-brtl -bnso -berok' michael@0: ;; michael@0: *) michael@0: AC_DEFINE(AIX_TIMERS) michael@0: AC_DEFINE(_PR_HAVE_OFF64_T) michael@0: AC_DEFINE(AIX4_3_PLUS) michael@0: AC_DEFINE(HAVE_SOCKLEN_T) michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: USE_IPV6=1 michael@0: AIX_LINK_OPTS='-brtl -bnso -berok' michael@0: ;; michael@0: esac michael@0: CFLAGS="$CFLAGS -qro -qroconst" michael@0: AIX_WRAP='$(DIST)/lib/aixwrap.o' michael@0: AIX_TMP='./_aix_tmp.o' michael@0: if test -n "$USE_64"; then michael@0: MDCPUCFG_H=_aix64.cfg michael@0: OBJECT_MODE=64 michael@0: else michael@0: MDCPUCFG_H=_aix32.cfg michael@0: fi michael@0: PR_MD_CSRCS=aix.c michael@0: RESOLVE_LINK_SYMBOLS=1 michael@0: ;; michael@0: michael@0: *-beos*) michael@0: AC_DEFINE(XP_BEOS) michael@0: AC_DEFINE(BeOS) michael@0: AC_DEFINE(BEOS) michael@0: AC_DEFINE(_POSIX_SOURCE) michael@0: DSO_LDOPTS=-nostart michael@0: MDCPUCFG_H=_beos.cfg michael@0: USE_BTHREADS=1 michael@0: PR_MD_ARCH_DIR=beos michael@0: RESOLVE_LINK_SYMBOLS=1 michael@0: case "${target_cpu}" in michael@0: i*86) michael@0: _OPTIMIZE_FLAGS=-O2 michael@0: _DEBUG_FLAGS='-gdwarf-2 -O0' michael@0: MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@' michael@0: AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"]) michael@0: ;; michael@0: powerpc) michael@0: CC=mwcc michael@0: CCC=mwcc michael@0: LD=mwld michael@0: DSO_LDOPTS='-xms -export pragma -init _init_routine_ -term _term_routine_ -lroot -lnet /boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o /boot/develop/lib/ppc/start_dyn.o' michael@0: _OPTIMIZE_FLAGS=-O2 michael@0: _DEBUG_FLAGS='-g -O0' michael@0: ;; michael@0: esac michael@0: ;; michael@0: michael@0: *-bsdi*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(BSDI) michael@0: AC_DEFINE(NEED_BSDREGEX) michael@0: michael@0: CFLAGS="$CFLAGS -Wall -Wno-format" michael@0: CXXFLAGS="$CXXFLAGS -Wall -Wno-format" michael@0: michael@0: if echo "$OS_TEST" | grep -c 86 >/dev/null; then michael@0: CPU_ARCH=x86 michael@0: elif echo "$OS_TEST" | grep -c sparc >/dev/null; then michael@0: CPU_ARCH=sparc michael@0: fi michael@0: michael@0: MDCPUCFG_H=_bsdi.cfg michael@0: PR_MD_CSRCS=bsdi.c michael@0: michael@0: DSO_LDOPTS=-r michael@0: michael@0: case "$target_os" in michael@0: bsdi1.1*) michael@0: AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY) michael@0: AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME) michael@0: AC_DEFINE(_PR_NEED_H_ERRNO) michael@0: MKSHLIB= michael@0: DSO_CFLAGS= michael@0: DSO_LDOPTS= michael@0: ;; michael@0: michael@0: bsdi2.1*) michael@0: AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC) michael@0: AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY) michael@0: AC_DEFINE(HAVE_DLL) michael@0: AC_DEFINE(USE_DLFCN) michael@0: AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC) michael@0: PR_MD_ASFILES=os_BSD_OS_386_2.s michael@0: ;; michael@0: michael@0: bsdi4.* | bsdi5.*) michael@0: AC_DEFINE(_PR_SELECT_CONST_TIMEVAL) michael@0: AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT) michael@0: AC_DEFINE(HAVE_DLL) michael@0: AC_DEFINE(USE_DLFCN) michael@0: AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC) michael@0: MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)' michael@0: DSO_CFLAGS=-fPIC michael@0: DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)' michael@0: STRIP="$STRIP -d" michael@0: case "$target_os" in michael@0: bsdi4.2* | bsdi4.3* | bsdi5.*) michael@0: AC_DEFINE(_PR_HAVE_GETPROTO_R) michael@0: AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER) michael@0: ;; michael@0: esac michael@0: ;; michael@0: *) michael@0: AC_DEFINE(_PR_SELECT_CONST_TIMEVAL) michael@0: AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT) michael@0: AC_DEFINE(HAVE_DLL) michael@0: AC_DEFINE(USE_DLFCN) michael@0: AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC) michael@0: ;; michael@0: esac michael@0: michael@0: ;; michael@0: michael@0: *-darwin*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(DARWIN) michael@0: AC_DEFINE(HAVE_BSD_FLOCK) michael@0: AC_DEFINE(HAVE_SOCKLEN_T) michael@0: AS='$(CC) -x assembler-with-cpp' michael@0: CFLAGS="$CFLAGS -Wall -fno-common" michael@0: case "${target_cpu}" in michael@0: arm*) michael@0: CPU_ARCH=arm michael@0: ;; michael@0: i*86*|x86_64) michael@0: if test -n "$USE_64"; then michael@0: CPU_ARCH=x86_64 michael@0: else michael@0: CPU_ARCH=i386 michael@0: fi michael@0: ;; michael@0: *) michael@0: CPU_ARCH=ppc michael@0: ;; michael@0: esac michael@0: if test "`echo $CC | grep -c '\-arch '`" = "0"; then michael@0: CC="$CC -arch $CPU_ARCH" michael@0: fi michael@0: AC_CHECK_HEADER(crt_externs.h) michael@0: DSO_CFLAGS=-fPIC michael@0: DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names' michael@0: _OPTIMIZE_FLAGS=-O2 michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' michael@0: STRIP="$STRIP -x -S" michael@0: DLL_SUFFIX=dylib michael@0: USE_PTHREADS=1 michael@0: MDCPUCFG_H=_darwin.cfg michael@0: PR_MD_CSRCS=darwin.c michael@0: PR_MD_ASFILES=os_Darwin.s michael@0: michael@0: # Add Mac OS X support for loading CFM & CFBundle plugins michael@0: if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then michael@0: AC_DEFINE(XP_MACOSX) michael@0: OS_TARGET=MacOSX michael@0: michael@0: if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then michael@0: dnl Use the specified value michael@0: export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET michael@0: elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then michael@0: dnl No value specified on the command line or in the environment, michael@0: dnl use the lesser of the library's minimum or the architecture's michael@0: dnl minimum. michael@0: case "${target_cpu}" in michael@0: powerpc*) michael@0: dnl Architecture minimum 10.2 michael@0: export MACOSX_DEPLOYMENT_TARGET=10.2 michael@0: ;; michael@0: i*86*) michael@0: dnl Architecture minimum 10.4 michael@0: export MACOSX_DEPLOYMENT_TARGET=10.4 michael@0: ;; michael@0: esac michael@0: fi michael@0: michael@0: dnl MACOS_SDK_DIR will be set to the SDK location whenever one is michael@0: dnl in use. NEXT_ROOT will be set and exported if it's needed for michael@0: dnl ld. michael@0: michael@0: if test "$MACOS_SDK_DIR"; then michael@0: dnl Sync this section with the one in Mozilla's top level. michael@0: michael@0: if test ! -d "$MACOS_SDK_DIR"; then michael@0: AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must michael@0: specify a valid SDK. SDKs are installed when the optional cross-development michael@0: tools are selected during the Xcode/Developer Tools installation.]) michael@0: fi michael@0: michael@0: changequote(,) michael@0: CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'` michael@0: GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` michael@0: GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` michael@0: changequote([,]) michael@0: GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'` michael@0: if test "$GCC_VERSION_MAJOR" -lt "4" ; then michael@0: SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks" michael@0: if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then michael@0: SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks" michael@0: fi michael@0: michael@0: SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}" michael@0: michael@0: CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}" michael@0: michael@0: dnl CPP needs to be set for AC_CHECK_HEADER. michael@0: CPP="$CPP -nostdinc ${SDK_C_INCLUDE}" michael@0: michael@0: changequote(,) michael@0: HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'` michael@0: changequote([,]) michael@0: if test "$HOST_DARWIN_MAJOR" -lt 9 ; then michael@0: dnl The build host is running Tiger (10.4) or earlier. michael@0: dnl ld support for -syslibroot is compiler-agnostic, but michael@0: dnl only available on Tiger and later. On Tiger and michael@0: dnl earlier build hosts, just rely on NEXT_ROOT, because michael@0: dnl it's not been shown to cause any problems. michael@0: MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}" michael@0: else michael@0: dnl The build host is running Leopard (10.5) or later. michael@0: dnl With NEXT_ROOT set, the linker will still not apply michael@0: dnl it when resolving dependencies. This causes problems michael@0: dnl on Leopard, where an SDK depends on frameworks which michael@0: dnl were present in earlier OS releases (and the associated michael@0: dnl SDK) but not in Leopard. -syslibroot does not have michael@0: dnl this problem, but it results in harmless warnings when michael@0: dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even michael@0: dnl on Leopard because the compiler uses it too. michael@0: MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}" michael@0: fi michael@0: michael@0: LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS" michael@0: export NEXT_ROOT=$MACOS_SDK_DIR michael@0: michael@0: if test -n "$CROSS_COMPILE" ; then michael@0: dnl NEXT_ROOT will be in the environment, but it michael@0: dnl shouldn't be set for the build host. HOST_CXX is michael@0: dnl presently unused. michael@0: HOST_CC="NEXT_ROOT= $HOST_CC" michael@0: HOST_CXX="NEXT_ROOT= $HOST_CXX" michael@0: fi michael@0: else michael@0: dnl gcc >= 4.0 uses different paths than above, but knows michael@0: dnl how to find them itself. michael@0: CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}" michael@0: michael@0: dnl CPP needs to be set for AC_CHECK_HEADER. michael@0: CPP="$CPP -isysroot ${MACOS_SDK_DIR}" michael@0: michael@0: dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which michael@0: dnl has an ld that supports -syslibroot. Don't set michael@0: dnl NEXT_ROOT because it will be ignored and cause michael@0: dnl warnings when -syslibroot is specified. michael@0: if test "$GCC_VERSION_FULL" != "4.0.0" ; then michael@0: dnl gcc > 4.0.0 will pass -syslibroot to ld automatically michael@0: dnl based on the -isysroot it receives. michael@0: LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}" michael@0: else michael@0: dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs michael@0: dnl to be explicit. michael@0: LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}" michael@0: fi michael@0: fi michael@0: fi michael@0: fi michael@0: ;; michael@0: michael@0: *-dgux*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: AC_DEFINE(SVR4) michael@0: AC_DEFINE(SYSV) michael@0: AC_DEFINE(DGUX) michael@0: AC_DEFINE(_DGUX_SOURCE) michael@0: AC_DEFINE(_POSIX4A_DRAFT6_SOURCE) michael@0: DSO_LDOPTS=-G michael@0: _OPTIMIZE_FLAGS=-O2 michael@0: _DEBUG_FLAGS= michael@0: MDCPUCFG_H=_dgux.cfg michael@0: PR_MD_CSRCS=dgux.c michael@0: ;; michael@0: michael@0: *-freebsd*) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: USE_PTHREADS=1 michael@0: fi michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(FREEBSD) michael@0: AC_DEFINE(HAVE_BSD_FLOCK) michael@0: AC_DEFINE(HAVE_SOCKLEN_T) michael@0: CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall" michael@0: MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` michael@0: if test "$MOZ_OBJFORMAT" = "elf"; then michael@0: DLL_SUFFIX=so michael@0: else michael@0: DLL_SUFFIX=so.1.0 michael@0: fi michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' michael@0: DSO_CFLAGS=-fPIC michael@0: DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' michael@0: MDCPUCFG_H=_freebsd.cfg michael@0: PR_MD_CSRCS=freebsd.c michael@0: ;; michael@0: michael@0: *-hpux*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(HPUX) michael@0: AC_DEFINE(_HPUX_SOURCE) michael@0: # OSF1 and HPUX report the POLLHUP event for a socket when the michael@0: # shutdown(SHUT_WR) operation is called for the remote end, even though michael@0: # the socket is still writeable. Use select(), instead of poll(), to michael@0: # workaround this problem. michael@0: AC_DEFINE(_PR_POLL_WITH_SELECT) michael@0: AC_DEFINE(_USE_BIG_FDS) michael@0: DSO_LDOPTS='-b +h $(notdir $@)' michael@0: PR_MD_CSRCS=hpux.c michael@0: if test "$OS_TEST" = "ia64"; then michael@0: DLL_SUFFIX=so michael@0: DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'" michael@0: CPU_ARCH_TAG=_$OS_TEST michael@0: if test -z "$USE_64"; then michael@0: COMPILER_TAG=_32 michael@0: fi michael@0: PR_MD_ASFILES=os_HPUX_ia64.s michael@0: else michael@0: AC_DEFINE(hppa) michael@0: DLL_SUFFIX=sl michael@0: PR_MD_ASFILES=os_HPUX.s michael@0: fi michael@0: if test -n "$USE_64"; then michael@0: MDCPUCFG_H=_hpux64.cfg michael@0: else michael@0: MDCPUCFG_H=_hpux32.cfg michael@0: fi michael@0: if test -z "$GNU_CC"; then michael@0: CC="$CC -Ae" michael@0: CXX="$CXX -ext" michael@0: DSO_CFLAGS=+Z michael@0: else michael@0: DSO_CFLAGS=-fPIC michael@0: ASFLAGS="$ASFLAGS -x assembler-with-cpp" michael@0: fi michael@0: michael@0: if test -n "$MOZILLA_CLIENT"; then michael@0: DEFAULT_IMPL_STRATEGY=_EMU michael@0: fi michael@0: michael@0: if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then michael@0: AC_DEFINE(_PR_NEED_H_ERRNO) michael@0: AC_DEFINE(HPUX9) michael@0: DEFAULT_IMPL_STRATEGY=_EMU michael@0: USE_NSPR_THREADS=1 michael@0: fi michael@0: michael@0: if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then michael@0: AC_DEFINE(_PR_NO_LARGE_FILES) michael@0: fi michael@0: michael@0: if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then michael@0: AC_DEFINE(_PR_NEED_H_ERRNO) michael@0: fi michael@0: michael@0: if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then michael@0: AC_DEFINE(HAVE_INT_LOCALTIME_R) michael@0: fi michael@0: michael@0: if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then michael@0: AC_DEFINE(HAVE_POINTER_LOCALTIME_R) michael@0: fi michael@0: michael@0: # HP-UX 11i v2 (B.11.23) or higher michael@0: changequote(<<,>>) michael@0: case "$OS_RELEASE" in michael@0: [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*) michael@0: USE_IPV6=1 michael@0: ;; michael@0: esac michael@0: changequote([,]) michael@0: michael@0: if test "$OS_RELEASE" = "B.10.01"; then michael@0: AC_DEFINE(HPUX10) michael@0: DEFAULT_IMPL_STRATEGY=_EMU michael@0: fi michael@0: michael@0: if test "$OS_RELEASE" = "B.10.10"; then michael@0: AC_DEFINE(HPUX10) michael@0: AC_DEFINE(HPUX10_10) michael@0: DEFAULT_IMPL_STRATEGY=_PTH michael@0: fi michael@0: michael@0: if test "$OS_RELEASE" = "B.10.20"; then michael@0: AC_DEFINE(HPUX10) michael@0: AC_DEFINE(HPUX10_20) michael@0: if test -z "$GNU_CC"; then michael@0: CFLAGS="$CFLAGS +DAportable +DS1.1" michael@0: CXXFLAGS="$CXXFLAGS +DAportable +DS1.1" michael@0: fi michael@0: DEFAULT_IMPL_STRATEGY=_PTH michael@0: fi michael@0: michael@0: if test "$OS_RELEASE" = "B.10.30"; then michael@0: AC_DEFINE(HPUX10) michael@0: AC_DEFINE(HPUX10_30) michael@0: if test -z "$GNU_CC"; then michael@0: CFLAGS="$CFLAGS +DAportable +DS1.1" michael@0: CXXFLAGS="$CXXFLAGS +DAportable +DS1.1" michael@0: fi michael@0: DEFAULT_IMPL_STRATEGY=_PTH michael@0: fi michael@0: michael@0: if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then michael@0: AC_DEFINE(HPUX10) michael@0: AC_DEFINE(HPUX11) michael@0: AC_DEFINE(_LARGEFILE64_SOURCE) michael@0: AC_DEFINE(_PR_HAVE_OFF64_T) michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: if test -z "$GNU_CC"; then michael@0: if test -z "$USE_64"; then michael@0: if test "$OS_TEST" = "ia64"; then michael@0: CFLAGS="$CFLAGS +DD32" michael@0: CXXFLAGS="$CXXFLAGS +DD32" michael@0: else michael@0: CFLAGS="$CFLAGS +DAportable +DS2.0" michael@0: CXXFLAGS="$CXXFLAGS +DAportable +DS2.0" michael@0: fi michael@0: else michael@0: if test "$OS_TEST" = "ia64"; then michael@0: CFLAGS="$CFLAGS +DD64" michael@0: CXXFLAGS="$CXXFLAGS +DD64" michael@0: else michael@0: CFLAGS="$CFLAGS +DA2.0W +DS2.0" michael@0: CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0" michael@0: fi michael@0: fi michael@0: fi michael@0: DEFAULT_IMPL_STRATEGY=_PTH michael@0: fi michael@0: michael@0: if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then michael@0: USE_NSPR_THREADS=1 michael@0: USE_PTHREADS= michael@0: USE_USER_PTHREADS= michael@0: elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then michael@0: USE_PTHREADS=1 michael@0: if test "$USE_NSPR_THREADS"; then michael@0: USE_PTHREADS= michael@0: fi michael@0: if test "$USE_USER_PTHREADS"; then michael@0: USE_PTHREADS= michael@0: fi michael@0: fi michael@0: ;; michael@0: michael@0: *-irix*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(IRIX) michael@0: AC_DEFINE(SVR4) michael@0: AC_DEFINE(_SGI_MP_SOURCE) michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: PR_MD_CSRCS=irix.c michael@0: PR_MD_ASFILES=os_Irix.s michael@0: MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@' michael@0: STRIP="$STRIP -f" michael@0: RESOLVE_LINK_SYMBOLS=1 michael@0: if test -n "$USE_64"; then michael@0: MDCPUCFG_H=_irix64.cfg michael@0: else michael@0: MDCPUCFG_H=_irix32.cfg michael@0: fi michael@0: case "${target_os}" in michael@0: irix6*) michael@0: AC_DEFINE(IRIX6) michael@0: USE_PTHREADS=1 michael@0: USE_N32=1 michael@0: COMPILER_TAG=_n32 michael@0: IMPL_STRATEGY=_PTH michael@0: ;; michael@0: irix5*) michael@0: AC_DEFINE(IRIX5) michael@0: USE_NSPR_THREADS=1 michael@0: ;; michael@0: *) michael@0: USE_PTHREADS=1 michael@0: USE_N32=1 michael@0: ;; michael@0: esac michael@0: if test "$GNU_CC"; then michael@0: dnl michael@0: dnl If we are using gcc with native binutils, we need to michael@0: dnl suppress the michael@0: dnl #lineno "filename" num num michael@0: dnl lines, which confuse IRIX native as. Add -Wp,-P to the michael@0: dnl gcc command line, which passes -P to the preprocessor. michael@0: dnl michael@0: AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)' michael@0: CFLAGS="$CFLAGS -Wall -Wno-format" michael@0: _OPTIMIZE_FLAGS="-O6" michael@0: else michael@0: if test -n "$USE_N32"; then michael@0: AS='as -D_ASM $(INCLUDES) -n32' michael@0: else michael@0: AS='as -D_ASM $(INCLUDES)' michael@0: fi michael@0: CFLAGS="$CFLAGS -fullwarn -xansi" michael@0: if test "$USE_N32"; then michael@0: _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000" michael@0: else michael@0: _OPTIMIZE_FLAGS="-O -Olimit 4000" michael@0: fi michael@0: if test "$USE_MDUPDATE"; then michael@0: CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)" michael@0: fi michael@0: case "${target}" in michael@0: *-irix6.*) michael@0: CFLAGS="$CFLAGS -multigot" michael@0: DSO_LDOPTS="-no_unresolved" michael@0: if test "$USE_N32"; then michael@0: CFLAGS="$CFLAGS -n32 -woff 1209" michael@0: DSO_LDOPTS="$DSO_LDOPTS -n32" michael@0: else michael@0: if test "$USE_64"; then michael@0: CFLAGS="$CFLAGS -64" michael@0: else michael@0: CFLAGS="$CFLAGS -32" michael@0: fi michael@0: fi michael@0: ;; michael@0: *) michael@0: CFLAGS="$CFLAGS -xgot" michael@0: ;; michael@0: esac michael@0: fi michael@0: if test "${target_os}" = "irix5.3"; then michael@0: AC_DEFINE(IRIX5_3) michael@0: fi michael@0: case "${target_os}" in michael@0: irix6.5) michael@0: if test -z "$GNU_CC"; then michael@0: CFLAGS="$CFLAGS -mips3" michael@0: fi michael@0: AC_DEFINE(_PR_HAVE_GETPROTO_R) michael@0: AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER) michael@0: AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK) michael@0: ;; michael@0: irix5*) michael@0: ;; michael@0: *) michael@0: AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK) michael@0: ;; michael@0: esac michael@0: ;; michael@0: michael@0: *-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: USE_PTHREADS=1 michael@0: IMPL_STRATEGY=_PTH michael@0: fi michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(_GNU_SOURCE) michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: case "${target}" in michael@0: *-android*|*-linuxandroid*) michael@0: OS_TARGET=Android michael@0: AC_DEFINE(LINUX) michael@0: ;; michael@0: *-linux*) michael@0: AC_DEFINE(LINUX) michael@0: ;; michael@0: esac michael@0: CFLAGS="$CFLAGS -Wall" michael@0: CXXFLAGS="$CXXFLAGS -Wall" michael@0: MDCPUCFG_H=_linux.cfg michael@0: PR_MD_CSRCS=linux.c michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' michael@0: DSO_CFLAGS=-fPIC michael@0: DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' michael@0: _OPTIMIZE_FLAGS=-O2 michael@0: _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that michael@0: # combo is not yet good at debugging inlined michael@0: # functions (even when using DWARF2 as the michael@0: # debugging format) michael@0: COMPILER_TAG=_glibc michael@0: if echo "$OS_TEST" | grep -c 86 >/dev/null; then michael@0: CPU_ARCH=x86 michael@0: else michael@0: CPU_ARCH=$OS_TEST michael@0: fi michael@0: CPU_ARCH_TAG=_${CPU_ARCH} michael@0: case "${target_cpu}" in michael@0: alpha) michael@0: AC_DEFINE(_ALPHA_) michael@0: AC_DEFINE(__alpha) michael@0: CFLAGS="$CFLAGS -mieee" michael@0: CXXFLAGS="$CXXFLAGS -mieee" michael@0: ;; michael@0: i*86) michael@0: AC_DEFINE(i386) michael@0: PR_MD_ASFILES=os_Linux_x86.s michael@0: ;; michael@0: ia64) michael@0: PR_MD_ASFILES=os_Linux_ia64.s michael@0: ;; michael@0: x86_64) michael@0: if test -n "$USE_64"; then michael@0: PR_MD_ASFILES=os_Linux_x86_64.s michael@0: elif test -n "$USE_X32"; then michael@0: PR_MD_ASFILES=os_Linux_x86_64.s michael@0: CC="$CC -mx32" michael@0: CXX="$CXX -mx32" michael@0: else michael@0: AC_DEFINE(i386) michael@0: PR_MD_ASFILES=os_Linux_x86.s michael@0: CC="$CC -m32" michael@0: CXX="$CXX -m32" michael@0: fi michael@0: ;; michael@0: ppc|powerpc) michael@0: PR_MD_ASFILES=os_Linux_ppc.s michael@0: ;; michael@0: powerpc64) michael@0: if test -n "$USE_64"; then michael@0: CC="$CC -m64" michael@0: CXX="$CXX -m64" michael@0: else michael@0: PR_MD_ASFILES=os_Linux_ppc.s michael@0: fi michael@0: ;; michael@0: m68k) michael@0: CFLAGS="$CFLAGS -m68020-60" michael@0: CXXFLAGS="$CXXFLAGS -m68020-60" michael@0: ;; michael@0: esac michael@0: ;; michael@0: michael@0: *-mingw*|*-msys*|*-cygwin*|*-mks*) michael@0: AC_DEFINE(XP_PC) michael@0: AC_DEFINE(WIN32) michael@0: PR_MD_ARCH_DIR=windows michael@0: RESOLVE_LINK_SYMBOLS=1 michael@0: michael@0: if test -n "$GNU_CC"; then michael@0: CC="$CC -mwindows" michael@0: CXX="$CXX -mwindows" michael@0: DLL_SUFFIX=dll michael@0: MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))' michael@0: RC=$WINDRES michael@0: # Use temp file for windres (bug 213281) michael@0: RCFLAGS='-O coff --use-temp-file' michael@0: else michael@0: CC=cl michael@0: CXX=cl michael@0: LD=link michael@0: AR='lib -NOLOGO -OUT:"$@"' michael@0: AR_FLAGS= michael@0: RANLIB='echo not_ranlib' michael@0: STRIP='echo not_strip' michael@0: RC=rc.exe michael@0: GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb' michael@0: OBJ_SUFFIX=obj michael@0: LIB_SUFFIX=lib michael@0: DLL_SUFFIX=dll michael@0: michael@0: # Determine compiler version michael@0: changequote(,) michael@0: _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p' michael@0: changequote([,]) michael@0: CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` michael@0: _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'` michael@0: _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'` michael@0: _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'` michael@0: _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'` michael@0: MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION} michael@0: michael@0: if test "$_CC_MAJOR_VERSION" -eq "14"; then michael@0: dnl -DYNAMICBASE is only supported on VC8SP1 or newer, michael@0: dnl so be very specific here! michael@0: dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762 michael@0: if test $_CC_RELEASE -gt 50727; then michael@0: _USE_DYNAMICBASE=1 michael@0: elif test $_CC_BUILD -ge 762; then michael@0: _USE_DYNAMICBASE=1 michael@0: fi michael@0: AC_DEFINE(_CRT_SECURE_NO_DEPRECATE) michael@0: AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE) michael@0: elif test $_CC_MAJOR_VERSION -ge 15; then michael@0: _USE_DYNAMICBASE=1 michael@0: AC_DEFINE(_CRT_SECURE_NO_WARNINGS) michael@0: AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS) michael@0: fi michael@0: michael@0: if test -n "$_USE_DYNAMICBASE"; then michael@0: DLLFLAGS="$DLLFLAGS -DYNAMICBASE" michael@0: fi michael@0: michael@0: # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic michael@0: # tape manipulation utility (or something else) michael@0: if test "$MSC_VER" -ge "1400"; then michael@0: changequote(,) michael@0: _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p' michael@0: changequote([,]) michael@0: michael@0: MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'` michael@0: if test -n "$MSMT_TOOL"; then michael@0: MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"` michael@0: if test -z "$MSMANIFEST_TOOL_VERSION"; then michael@0: AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.]) michael@0: fi michael@0: MT=mt michael@0: unset MSMT_TOOL michael@0: else michael@0: AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.]) michael@0: fi michael@0: fi michael@0: michael@0: CFLAGS="$CFLAGS -W3 -nologo -GF -Gy" michael@0: DLLFLAGS="$DLLFLAGS -OUT:\"\$@\"" michael@0: _DEBUG_FLAGS=-Zi michael@0: _OPTIMIZE_FLAGS=-O2 michael@0: michael@0: PROFILE_GEN_CFLAGS="-GL" michael@0: PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT" michael@0: PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952" michael@0: PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE" michael@0: michael@0: if test "$MSC_VER" -ge "1800"; then michael@0: dnl Visual C++ 2013 requires -FS when parallel building with michael@0: dnl make -jN. If not specified, compiler sometimes emits C1041 michael@0: dnl error. michael@0: CFLAGS="$CFLAGS -FS" michael@0: dnl -Gw can benefit when using linker optimization on PGO. michael@0: dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx michael@0: PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -Gw" michael@0: PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw" michael@0: fi michael@0: michael@0: if test -z "$MOZ_OPTIMIZE"; then michael@0: CFLAGS="$CFLAGS -Od" michael@0: fi michael@0: michael@0: if test "$USE_DEBUG_RTL" = 1; then michael@0: CFLAGS="$CFLAGS -MDd" michael@0: else michael@0: CFLAGS="$CFLAGS -MD" michael@0: fi michael@0: michael@0: if test -n "$MOZ_DEBUG"; then michael@0: AC_DEFINE(_DEBUG) michael@0: else michael@0: DEFINES="$DEFINES -U_DEBUG" michael@0: fi michael@0: michael@0: if test -n "$MOZ_DEBUG_SYMBOLS"; then michael@0: if test -n "$MOZ_OPTIMIZE"; then michael@0: DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF" michael@0: LDFLAGS="$LDFLAGS -DEBUG -OPT:REF" michael@0: else michael@0: DLLFLAGS="$DLLFLAGS -DEBUG" michael@0: LDFLAGS="$LDFLAGS -DEBUG" michael@0: fi michael@0: fi michael@0: michael@0: OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS" michael@0: if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then michael@0: OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE" michael@0: fi michael@0: michael@0: if test "$OS_TARGET" = "WINNT"; then michael@0: CFLAGS="$CFLAGS -GT" michael@0: LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)' michael@0: LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)' michael@0: else michael@0: LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)' michael@0: LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)' michael@0: fi michael@0: fi # GNU_CC michael@0: michael@0: if test -n "$USE_STATIC_TLS"; then michael@0: AC_DEFINE(_PR_USE_STATIC_TLS) michael@0: fi michael@0: michael@0: if test "$OS_TARGET" = "WINNT"; then michael@0: AC_DEFINE(WINNT) michael@0: else michael@0: AC_DEFINE(WIN95) michael@0: # undefine WINNT as some versions of mingw gcc define it by default michael@0: DEFINES="$DEFINES -UWINNT" michael@0: AC_DEFINE(_PR_GLOBAL_THREADS_ONLY) michael@0: fi michael@0: michael@0: if test "$CPU_ARCH" = "x86"; then michael@0: CPU_ARCH_TAG= michael@0: else michael@0: CPU_ARCH_TAG=$CPU_ARCH michael@0: fi michael@0: michael@0: if test "$USE_DEBUG_RTL" = 1; then michael@0: OBJDIR_SUFFIX=OBJD michael@0: fi michael@0: michael@0: case "$OS_TARGET" in michael@0: WINNT) michael@0: MDCPUCFG_H=_winnt.cfg michael@0: ;; michael@0: WIN95) michael@0: MDCPUCFG_H=_win95.cfg michael@0: ;; michael@0: *) michael@0: AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.]) michael@0: ;; michael@0: esac michael@0: michael@0: case "$target_cpu" in michael@0: i*86) michael@0: if test -n "$USE_64"; then michael@0: AC_DEFINE(_AMD64_) michael@0: else michael@0: AC_DEFINE(_X86_) michael@0: fi michael@0: ;; michael@0: x86_64) michael@0: AC_DEFINE(_AMD64_) michael@0: USE_64=1 michael@0: ;; michael@0: ia64) michael@0: AC_DEFINE(_IA64_) michael@0: USE_64=1 michael@0: ;; michael@0: *) michael@0: AC_DEFINE(_CPU_ARCH_NOT_DEFINED) michael@0: ;; michael@0: esac michael@0: ;; michael@0: michael@0: *-netbsd*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(NETBSD) michael@0: AC_DEFINE(HAVE_BSD_FLOCK) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: USE_PTHREADS=1 michael@0: fi michael@0: MDCPUCFG_H=_netbsd.cfg michael@0: PR_MD_CSRCS=netbsd.c michael@0: michael@0: DSO_CFLAGS='-fPIC -DPIC' michael@0: CFLAGS="$CFLAGS -ansi -Wall" michael@0: CXXFLAGS="$CXXFLAGS -ansi -Wall" michael@0: MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)' michael@0: michael@0: if test -z "$OBJECT_FMT"; then michael@0: if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then michael@0: OBJECT_FMT=a.out michael@0: DLL_SUFFIX=so.1.0 michael@0: DSO_LDOPTS='-shared' michael@0: else michael@0: OBJECT_FMT=ELF michael@0: DLL_SUFFIX=so michael@0: DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)' michael@0: fi michael@0: fi michael@0: michael@0: if test "$LIBRUNPATH"; then michael@0: DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH" michael@0: fi michael@0: ;; michael@0: michael@0: *-nto*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(NTO) michael@0: AC_DEFINE(_QNX_SOURCE) michael@0: AC_DEFINE(HAVE_POINTER_LOCALTIME_R) michael@0: MDCPUCFG_H=_nto.cfg michael@0: PR_MD_CSRCS=nto.c michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@' michael@0: DSO_CFLAGS=-fPIC michael@0: DSO_LDOPTS=-shared michael@0: OS_LIBS="$OS_LIBS -lsocket" michael@0: _OPTIMIZE_FLAGS="-O1" michael@0: _DEBUG_FLAGS="-gstabs" michael@0: ;; michael@0: michael@0: *-openbsd*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(OPENBSD) michael@0: AC_DEFINE(HAVE_BSD_FLOCK) michael@0: AC_DEFINE(HAVE_SOCKLEN_T) michael@0: CFLAGS="$CFLAGS -ansi -Wall" michael@0: CXXFLAGS="$CXXFLAGS -ansi -Wall" michael@0: DLL_SUFFIX=so.1.0 michael@0: DSO_CFLAGS=-fPIC michael@0: MDCPUCFG_H=_openbsd.cfg michael@0: PR_MD_CSRCS=openbsd.c michael@0: OS_LIBS="-lc" michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: USE_PTHREADS=1 michael@0: fi michael@0: DSO_LDOPTS='-shared -fPIC' michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' michael@0: ;; michael@0: michael@0: *-osf*) michael@0: SHELL_OVERRIDE="SHELL = /usr/bin/ksh" michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(OSF1) michael@0: AC_DEFINE(_REENTRANT) michael@0: # OSF1 and HPUX report the POLLHUP event for a socket when the michael@0: # shutdown(SHUT_WR) operation is called for the remote end, even though michael@0: # the socket is still writeable. Use select(), instead of poll(), to michael@0: # workaround this problem. michael@0: AC_DEFINE(_PR_POLL_WITH_SELECT) michael@0: michael@0: if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then michael@0: USE_NSPR_THREADS=1 michael@0: fi michael@0: michael@0: if test -z "$GNU_CC"; then michael@0: CC="$CC -std1 -ieee_with_inexact" michael@0: if test "$OS_RELEASE" != "V2.0"; then michael@0: CC="$CC -readonly_strings" michael@0: fi michael@0: _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" michael@0: AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H)) michael@0: else michael@0: CFLAGS="$CFLAGS -mieee" michael@0: CXXFLAGS="$CXXFLAGS -mieee" michael@0: fi michael@0: michael@0: if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then michael@0: AC_DEFINE(HAVE_INT_LOCALTIME_R) michael@0: else michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: AC_DEFINE(HAVE_POINTER_LOCALTIME_R) michael@0: fi michael@0: if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then michael@0: AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG) michael@0: fi michael@0: DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)' michael@0: MDCPUCFG_H=_osf1.cfg michael@0: PR_MD_CSRCS=osf1.c michael@0: ;; michael@0: michael@0: *-qnx*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(QNX) michael@0: AC_DEFINE(_PR_NEED_H_ERRNO) michael@0: USE_NSPR_THREADS=1 michael@0: MDCPUCFG_H=_qnx.cfg michael@0: PR_MD_CSRCS=qnx.c michael@0: ;; michael@0: michael@0: *-riscos*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(RISCOS) michael@0: AC_DEFINE(_PR_NEED_H_ERRNO) michael@0: USE_PTHREADS=1 michael@0: MDCPUCFG_H=_riscos.cfg michael@0: PR_MD_CSRCS=riscos.c michael@0: DSO_CFLAGS=-fPIC michael@0: DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)' michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' michael@0: ;; michael@0: michael@0: *-*-sco*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(SCO) michael@0: AC_DEFINE(sco) michael@0: AC_DEFINE(SYSV) michael@0: AC_DEFINE(_SVID3) michael@0: AC_DEFINE(_PR_NEED_H_ERRNO) michael@0: CC='cc -b elf -KPIC' michael@0: CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w' michael@0: USE_NSPR_THREADS=1 michael@0: CPU_ARCH=x86 michael@0: DSO_LDOPTS='-b elf -G' michael@0: MDCPUCFG_H=_scoos.cfg michael@0: PR_MD_SRCS=scoos.c michael@0: ;; michael@0: michael@0: *-solaris*) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: USE_PTHREADS=1 michael@0: fi michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(SVR4) michael@0: AC_DEFINE(SYSV) michael@0: AC_DEFINE(__svr4) michael@0: AC_DEFINE(__svr4__) michael@0: AC_DEFINE(SOLARIS) michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: CPU_ARCH=`uname -p` michael@0: MDCPUCFG_H=_solaris.cfg michael@0: PR_MD_CSRCS=solaris.c michael@0: LD=/usr/ccs/bin/ld michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' michael@0: RESOLVE_LINK_SYMBOLS=1 michael@0: case "${OS_RELEASE}" in michael@0: 5.8|5.9) michael@0: ;; michael@0: *) michael@0: # It is safe to use the -Bdirect linker flag on Solaris 10 or later. michael@0: USE_B_DIRECT=1 michael@0: ;; michael@0: esac michael@0: if test -n "$GNU_CC"; then michael@0: DSO_CFLAGS=-fPIC michael@0: if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then michael@0: GCC_USE_GNU_LD=1 michael@0: fi michael@0: DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore' michael@0: if test -n "$USE_B_DIRECT"; then michael@0: DSO_LDOPTS="$DSO_LDOPTS,-Bdirect" michael@0: fi michael@0: else michael@0: DSO_CFLAGS=-KPIC michael@0: DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore' michael@0: if test -n "$USE_B_DIRECT"; then michael@0: DSO_LDOPTS="$DSO_LDOPTS -Bdirect" michael@0: fi michael@0: fi michael@0: if test -n "$GNU_CC"; then michael@0: CFLAGS="$CFLAGS -Wall" michael@0: CXXFLAGS="$CXXFLAGS -Wall" michael@0: if test -n "$USE_MDUPDATE"; then michael@0: CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)" michael@0: CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)" michael@0: fi michael@0: GCC_AS=`$CC -print-prog-name=as` michael@0: if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then michael@0: GNU_AS=1 michael@0: fi michael@0: else michael@0: CFLAGS="$CFLAGS -xstrconst" michael@0: CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife" michael@0: if test -z "$MOZ_OPTIMIZE"; then michael@0: CFLAGS="$CFLAGS -xs" michael@0: CXXFLAGS="$CXXFLAGS -xs" michael@0: fi michael@0: _OPTIMIZE_FLAGS=-xO4 michael@0: fi michael@0: if test -z "$GNU_AS"; then michael@0: ASFLAGS="$ASFLAGS -Wa,-P" michael@0: fi michael@0: if test -n "$USE_64"; then michael@0: if test -n "$GNU_CC"; then michael@0: CC="$CC -m64" michael@0: CXX="$CXX -m64" michael@0: else michael@0: if test "$OS_TEST" = "i86pc"; then michael@0: CC="$CC -xarch=amd64" michael@0: CXX="$CXX -xarch=amd64" michael@0: else michael@0: CC="$CC -xarch=v9" michael@0: CXX="$CXX -xarch=v9" michael@0: fi michael@0: fi michael@0: fi michael@0: if test "$OS_TEST" = "i86pc"; then michael@0: if test -z "$USE_64"; then michael@0: AC_DEFINE(i386) michael@0: fi michael@0: CPU_ARCH_TAG=_$OS_TEST michael@0: # The default debug format, DWARF (-g), is not supported by gcc michael@0: # on i386-ANY-sysv4/solaris, but the stabs format is. It is michael@0: # assumed that the Solaris assembler /usr/ccs/bin/as is used. michael@0: # If your gcc uses GNU as, you do not need the -Wa,-s option. michael@0: if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then michael@0: _DEBUG_FLAGS=-gstabs michael@0: if test -z "$GNU_AS"; then michael@0: _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s" michael@0: fi michael@0: fi michael@0: fi michael@0: case "${target_os}" in michael@0: solaris2.3*) michael@0: AC_DEFINE(_PR_NO_LARGE_FILES) michael@0: ;; michael@0: solaris2.4*) michael@0: AC_DEFINE(_PR_NO_LARGE_FILES) michael@0: ;; michael@0: solaris2.5*) michael@0: AC_DEFINE(SOLARIS2_5) michael@0: ;; michael@0: *) michael@0: AC_DEFINE(_PR_HAVE_OFF64_T) michael@0: # The lfcompile64(5) man page on Solaris 2.6 says: michael@0: # For applications that do not wish to conform to the POSIX or michael@0: # X/Open specifications, the 64-bit transitional interfaces michael@0: # are available by default. No compile-time flags need to be michael@0: # set. michael@0: # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default. michael@0: # The native compiler, gcc 2.8.x, and egcs don't have this problem. michael@0: if test -n "$GNU_CC"; then michael@0: AC_DEFINE(_LARGEFILE64_SOURCE) michael@0: fi michael@0: ;; michael@0: esac michael@0: case "${target_os}" in michael@0: solaris2.3*) michael@0: ;; michael@0: solaris2.4*) michael@0: ;; michael@0: solaris2.5*) michael@0: ;; michael@0: solaris2.6*) michael@0: ;; michael@0: solaris2.7*) michael@0: ;; michael@0: *) michael@0: # Solaris 8 or higher has IPv6. michael@0: AC_DEFINE(_PR_INET6) michael@0: ;; michael@0: esac michael@0: if test "$CPU_ARCH" = "sparc"; then michael@0: # 64-bit Solaris SPARC requires V9 architecture, so the following michael@0: # is not needed. michael@0: if test -z "$USE_64"; then michael@0: ULTRASPARC_LIBRARY=nspr_flt michael@0: fi michael@0: fi michael@0: # Purify requires that binaries linked against nspr also michael@0: # be linked against -lrt (or -lposix4) so add it to OS_LIBS michael@0: _rev=`uname -r` michael@0: _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'` michael@0: OS_LIBS="$OS_LIBS $_librt" michael@0: ;; michael@0: michael@0: *-sco-sysv5*) michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(UNIXWARE) michael@0: AC_DEFINE(SVR4) michael@0: AC_DEFINE(SYSV) michael@0: USE_NSPR_THREADS=1 michael@0: if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then michael@0: AC_DEFINE(_PR_NO_LARGE_FILES) michael@0: CC='$(NSDEPTH)/build/hcc cc' michael@0: CXX='$(NSDEPTH)/build/hcpp CC' michael@0: MDCPUCFG_H=_unixware.cfg michael@0: else michael@0: AC_DEFINE(_LARGEFILE64_SOURCE) michael@0: AC_DEFINE(_PR_HAVE_OFF64_T) michael@0: AC_DEFINE(_PR_HAVE_SOCKADDR_LEN) michael@0: MDCPUCFG_H=_unixware7.cfg michael@0: fi michael@0: PR_MD_CSRCS=unixware.c michael@0: DSO_LDOPTS=-G michael@0: CPU_ARCH=x86 michael@0: ;; michael@0: michael@0: *-symbian*) michael@0: AC_ARG_WITH(symbian-sdk, michael@0: [ --with-symbian-sdk=SYMBIAN_SDK_DIR michael@0: The path to the Symbian SDK], michael@0: SYMBIAN_SDK_DIR=$withval) michael@0: michael@0: echo ----------------------------------------------------------------------------- michael@0: echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR michael@0: echo ----------------------------------------------------------------------------- michael@0: michael@0: AC_DEFINE(XP_UNIX) michael@0: AC_DEFINE(SYMBIAN) michael@0: AC_DEFINE(__arm__) michael@0: AC_DEFINE(__SYMBIAN32__) michael@0: AC_DEFINE(_UNICODE) michael@0: AC_DEFINE(NDEBUG) michael@0: AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__) michael@0: AC_DEFINE(MOZ_STDERR_TO_STDOUT) michael@0: AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) michael@0: AC_DEFINE(HAVE_SOCKLEN_T) michael@0: USE_PTHREADS=1 michael@0: LIB_SUFFIX=lib michael@0: DLL_SUFFIX=dll michael@0: MKSHLIB= michael@0: DSO_LDOPTS= michael@0: DSO_CFLAGS= michael@0: VISIBILITY_FLAGS= michael@0: MDCPUCFG_H=_symbian.cfg michael@0: PR_MD_CSRCS=symbian.c michael@0: NSINSTALL=nsinstall michael@0: RANLIB='echo no ranlib ' michael@0: CPU_ARCH=ARM michael@0: OS_ARCH=SYMBIAN michael@0: OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__" michael@0: CFLAGS="$CFLAGS -MD -nostdinc" michael@0: SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis" michael@0: echo ------------------------------------------------------- michael@0: echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE michael@0: echo ------------------------------------------------------- michael@0: case "$OS_TARGET" in michael@0: WINSCW) michael@0: CC=mwccsym2.exe michael@0: CXX=mwccsym2.exe michael@0: LD=mwldsym2.exe michael@0: AR=mwldsym2.exe michael@0: WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB" michael@0: CFLAGS="$CFLAGS -O0 -inline off -wchar_t off -align 4 -warnings on -w nohidevirtual,nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -nostderr -gccdep -cwd source -i- -I\$(VPATH)" michael@0: SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh" michael@0: AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@" michael@0: AC_DEFINE(_DEBUG) michael@0: AC_DEFINE(__CW32__) michael@0: AC_DEFINE(__WINS__) michael@0: AC_DEFINE(__WINSCW__) michael@0: DEFINES="$DEFINES -U_WIN32" michael@0: ;; michael@0: GCCE) michael@0: CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float" michael@0: CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy" michael@0: SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h" michael@0: AC_DEFINE(__GCCE__) michael@0: AC_DEFINE(__EABI__) michael@0: DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh" michael@0: ;; michael@0: *) michael@0: AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.]) michael@0: ;; michael@0: esac michael@0: CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}" michael@0: ;; michael@0: michael@0: *-os2*) michael@0: AC_DEFINE(XP_OS2) michael@0: AC_DEFINE(XP_PC) michael@0: AC_DEFINE(BSD_SELECT) michael@0: AC_DEFINE(TCPV40HDRS) michael@0: LIB_SUFFIX=lib michael@0: DLL_SUFFIX=dll michael@0: RC=rc.exe michael@0: PR_MD_ARCH_DIR=os2 michael@0: PROG_SUFFIX=.exe michael@0: NSINSTALL=nsinstall michael@0: MDCPUCFG_H=_os2.cfg michael@0: RESOLVE_LINK_SYMBOLS=1 michael@0: michael@0: AC_DEFINE(OS2) michael@0: AR=emxomfar michael@0: AR_FLAGS='r $@' michael@0: CFLAGS="$CFLAGS -Wall -Zomf" michael@0: CXXFLAGS="$CFLAGS -Wall -Zomf" michael@0: MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' michael@0: DSO_CFLAGS= michael@0: DSO_LDOPTS='-Zomf -Zdll' michael@0: LDFLAGS='-Zmap' michael@0: _OPTIMIZE_FLAGS="-O2 -s" michael@0: _DEBUG_FLAGS="-g -fno-inline" michael@0: if test -n "$MOZ_OPTIMIZE"; then michael@0: DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA" michael@0: fi michael@0: IMPLIB='emximp -o' michael@0: FILTER='emxexp -o' michael@0: if test -n "$MOZ_OS2_HIGH_MEMORY"; then michael@0: LDFLAGS="$LDFLAGS -Zhigh-mem" michael@0: AC_DEFINE(MOZ_OS2_HIGH_MEMORY) michael@0: fi michael@0: michael@0: # GCC for OS/2 currently predefines these, but we don't want them michael@0: DEFINES="$DEFINES -Uunix -U__unix -U__unix__" michael@0: ;; michael@0: michael@0: *) michael@0: AC_DEFINE(XP_UNIX) michael@0: ;; michael@0: michael@0: esac michael@0: michael@0: if test -z "$SKIP_LIBRARY_CHECKS"; then michael@0: dnl ======================================================== michael@0: dnl Check for system libraries michael@0: dnl ======================================================== michael@0: michael@0: michael@0: dnl We don't want anything to link with libdl even if it's present on OS X, michael@0: dnl since it's not used and not part of the default installation. michael@0: dnl The same goes for BeOS. michael@0: dnl OS/2 has dlfcn in libc. michael@0: michael@0: case $target in michael@0: *-darwin*|*-beos*|*-os2*) michael@0: ;; michael@0: *) michael@0: AC_CHECK_LIB(dl, dlopen, michael@0: [AC_CHECK_HEADER(dlfcn.h, michael@0: OS_LIBS="-ldl $OS_LIBS")]) michael@0: ;; michael@0: esac michael@0: michael@0: michael@0: dnl ======================================================== michael@0: dnl Check for system header files. michael@0: dnl ======================================================== michael@0: michael@0: dnl ======================================================== michael@0: dnl Check for typedefs and structs michael@0: dnl ======================================================== michael@0: michael@0: dnl ======================================================== michael@0: dnl Checks for library functions. michael@0: dnl ======================================================== michael@0: AC_PROG_GCC_TRADITIONAL michael@0: _SAVE_LIBS="$LIBS" michael@0: LIBS="$LIBS $OS_LIBS" michael@0: AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall) michael@0: LIBS="$_SAVE_LIBS" michael@0: michael@0: dnl ======================================================== michael@0: dnl Check options michael@0: dnl ======================================================== michael@0: michael@0: dnl ====================================================== michael@0: dnl = Enable compiling with ccache michael@0: dnl ====================================================== michael@0: AC_ARG_WITH(ccache, michael@0: [ --with-ccache[=path/to/ccache] michael@0: Enable compiling with ccache], michael@0: CCACHE=$withval, CCACHE="no") michael@0: michael@0: if test "$CCACHE" != "no"; then michael@0: if test -n "$CCACHE"; then michael@0: if test "$CCACHE" = "yes"; then michael@0: CCACHE= michael@0: else michael@0: if test ! -e "$CCACHE"; then michael@0: AC_MSG_ERROR([$CCACHE not found]) michael@0: fi michael@0: fi michael@0: fi michael@0: AC_PATH_PROGS(CCACHE, $CCACHE ccache) michael@0: if test -z "$CCACHE" -o "$CCACHE" = ":"; then michael@0: AC_MSG_ERROR([ccache not found]) michael@0: elif test -x "$CCACHE"; then michael@0: CC="$CCACHE $CC" michael@0: CXX="$CCACHE $CXX" michael@0: else michael@0: AC_MSG_ERROR([$CCACHE is not executable]) michael@0: fi michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl = michael@0: dnl = --enable-strip michael@0: dnl = michael@0: dnl = Enable stripping of libs and executables michael@0: dnl = michael@0: dnl ======================================================== michael@0: AC_ARG_ENABLE(strip, michael@0: [ --enable-strip Enable stripping of shared libs and programs], michael@0: [ if test "$enableval" = "yes"; then michael@0: ENABLE_STRIP=1 michael@0: fi ]) michael@0: michael@0: dnl Check for hpux options michael@0: case "${target_os}" in michael@0: hpux*) michael@0: if test -z "$GNU_CC"; then michael@0: michael@0: AC_CACHE_CHECK(for +Olit support, michael@0: ac_cv_hpux_usable_olit_option, michael@0: dnl since aCC doesn't throw an error on invalid options, michael@0: dnl we have to test this the hard way michael@0: [ac_cv_hpux_usable_olit_option=no michael@0: rm -f conftest* michael@0: echo 'int main() { return 0; }' | cat > conftest.c michael@0: ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1 michael@0: if test $? -eq 0; then michael@0: if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then michael@0: ac_cv_hpux_usable_olit_option=yes michael@0: fi michael@0: fi michael@0: rm -f conftest* michael@0: ]) michael@0: michael@0: if test "$ac_cv_hpux_usable_olit_option" = "yes"; then michael@0: CFLAGS="$CFLAGS +Olit=all" michael@0: CXXFLAGS="$CXXFLAGS +Olit=all" michael@0: else michael@0: CFLAGS="$CFLAGS +ESlit" michael@0: CXXFLAGS="$CXXFLAGS +ESlit" michael@0: fi michael@0: fi michael@0: ;; michael@0: esac michael@0: michael@0: dnl michael@0: dnl Apparently, some systems cannot properly check for the pthread michael@0: dnl library unless is included so we need to test michael@0: dnl using it michael@0: dnl michael@0: dnl MOZ_CHECK_PTHREADS(lib, success, failure) michael@0: AC_DEFUN(MOZ_CHECK_PTHREADS, michael@0: [ michael@0: AC_MSG_CHECKING([for pthread_create in -l$1]) michael@0: echo " michael@0: #include michael@0: void *foo(void *v) { return v; } michael@0: int main() { michael@0: pthread_t t; michael@0: if (!pthread_create(&t, 0, &foo, 0)) { michael@0: pthread_join(t, 0); michael@0: } michael@0: return 0; michael@0: }" > dummy.c ; michael@0: echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5; michael@0: ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5; michael@0: _res=$? ; michael@0: rm -f dummy.c dummy${ac_exeext} ; michael@0: if test "$_res" = "0"; then michael@0: AC_MSG_RESULT([yes]) michael@0: [$2] michael@0: else michael@0: AC_MSG_RESULT([no]) michael@0: [$3] michael@0: fi michael@0: ]) michael@0: michael@0: case "$target_os" in michael@0: darwin*) michael@0: _HAVE_PTHREADS=1 michael@0: ;; michael@0: *) michael@0: MOZ_CHECK_PTHREADS(pthreads, michael@0: _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads", michael@0: MOZ_CHECK_PTHREADS(pthread, michael@0: _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread", michael@0: MOZ_CHECK_PTHREADS(c_r, michael@0: _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r", michael@0: MOZ_CHECK_PTHREADS(c, michael@0: _HAVE_PTHREADS=1 michael@0: ) michael@0: ) michael@0: ) michael@0: ) michael@0: ;; michael@0: esac michael@0: michael@0: AC_ARG_WITH(pthreads, michael@0: [ --with-pthreads Use system pthreads library as thread subsystem], michael@0: [ if test "$withval" = "yes"; then michael@0: if test -n "$_HAVE_PTHREADS"; then michael@0: USE_PTHREADS=1 michael@0: USE_USER_PTHREADS= michael@0: USE_NSPR_THREADS= michael@0: else michael@0: AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]); michael@0: fi michael@0: else michael@0: USE_PTHREADS= michael@0: _PTHREAD_LDFLAGS= michael@0: fi], michael@0: [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then michael@0: USE_PTHREADS=1 michael@0: USE_USER_PTHREADS= michael@0: USE_NSPR_THREADS= michael@0: fi]) michael@0: michael@0: AC_ARG_ENABLE(user-pthreads, michael@0: [ --enable-user-pthreads Build using userland pthreads], michael@0: [ if test "$enableval" = "yes"; then michael@0: if test -n "$_HAVE_PTHREADS"; then michael@0: USE_PTHREADS= michael@0: USE_USER_PTHREADS=1 michael@0: USE_NSPR_THREADS= michael@0: else michael@0: AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]); michael@0: fi michael@0: fi]) michael@0: michael@0: AC_ARG_ENABLE(nspr-threads, michael@0: [ --enable-nspr-threads Build using classic nspr threads], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_PTHREADS= michael@0: USE_USER_PTHREADS= michael@0: USE_NSPR_THREADS=1 michael@0: fi]) michael@0: michael@0: case "$target" in michael@0: *-beos*) michael@0: AC_ARG_WITH(bthreads, michael@0: [ --with-bthreads Use system bthreads library as thread subsystem michael@0: (BeOS only)], michael@0: [ if test "$withval" = "yes"; then michael@0: USE_BTHREADS=1 michael@0: USE_USER_PTHREADS= michael@0: USE_PTHREADS= michael@0: fi]) michael@0: ;; michael@0: esac michael@0: michael@0: fi # SKIP_LIBRARY_CHECKS michael@0: michael@0: AC_ARG_ENABLE(ipv6, michael@0: [ --enable-ipv6 Compile ipv6 support], michael@0: [ if test "$enableval" = "yes"; then michael@0: USE_IPV6=1 michael@0: else michael@0: USE_IPV6= michael@0: fi]) michael@0: michael@0: if test -n "$USE_PTHREADS"; then michael@0: dnl See if -pthread is supported. michael@0: rm -f conftest* michael@0: ac_cv_have_dash_pthread=no michael@0: AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread) michael@0: echo 'int main() { return 0; }' | cat > conftest.c michael@0: ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 michael@0: if test $? -eq 0; then michael@0: if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then michael@0: ac_cv_have_dash_pthread=yes michael@0: case "$target_os" in michael@0: freebsd*) michael@0: # Freebsd doesn't use -pthread for compiles, it uses them for linking michael@0: ;; michael@0: *) michael@0: CFLAGS="$CFLAGS -pthread" michael@0: CXXFLAGS="$CXXFLAGS -pthread" michael@0: ;; michael@0: esac michael@0: fi michael@0: fi michael@0: rm -f conftest* michael@0: AC_MSG_RESULT($ac_cv_have_dash_pthread) michael@0: michael@0: dnl michael@0: dnl See if -pthreads is supported. michael@0: dnl michael@0: ac_cv_have_dash_pthreads=no michael@0: if test "$ac_cv_have_dash_pthread" = "no"; then michael@0: AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads) michael@0: echo 'int main() { return 0; }' | cat > conftest.c michael@0: ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 michael@0: if test $? -eq 0; then michael@0: if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then michael@0: ac_cv_have_dash_pthreads=yes michael@0: CFLAGS="$CFLAGS -pthreads" michael@0: CXXFLAGS="$CXXFLAGS -pthreads" michael@0: fi michael@0: fi michael@0: rm -f conftest* michael@0: AC_MSG_RESULT($ac_cv_have_dash_pthreads) michael@0: fi michael@0: michael@0: case "$target" in michael@0: *-solaris*) michael@0: if test "$ac_cv_have_dash_pthreads" = "yes"; then michael@0: _PTHREAD_LDFLAGS= michael@0: fi michael@0: ;; michael@0: *-freebsd*) michael@0: AC_DEFINE(_REENTRANT) michael@0: AC_DEFINE(_THREAD_SAFE) michael@0: dnl -pthread links in -lc_r, so don't specify it explicitly. michael@0: if test "$ac_cv_have_dash_pthread" = "yes"; then michael@0: _PTHREAD_LDFLAGS="-pthread" michael@0: else michael@0: _PTHREAD_LDFLAGS="-lc_r" michael@0: fi michael@0: ;; michael@0: *-netbsd*) michael@0: if test "$ac_cv_have_dash_pthread" = "yes"; then michael@0: _PTHREAD_LDFLAGS="-pthread" michael@0: fi michael@0: ;; michael@0: *-bsdi*) michael@0: AC_DEFINE(_THREAD_SAFE) michael@0: dnl -pthread links in -lc_r, so don't specify it explicitly. michael@0: if test "$ac_cv_have_dash_pthread" = "yes"; then michael@0: _PTHREAD_LDFLAGS= michael@0: fi michael@0: ;; michael@0: *-openbsd*) michael@0: if test "$ac_cv_have_dash_pthread" = "yes"; then michael@0: _PTHREAD_LDFLAGS=-pthread michael@0: fi michael@0: ;; michael@0: *-linux*|*-gnu*|*-k*bsd*-gnu) michael@0: AC_DEFINE(_REENTRANT) michael@0: ;; michael@0: esac michael@0: michael@0: else michael@0: if test -n "$USE_USER_PTHREADS"; then michael@0: USE_PTHREADS= michael@0: USE_NSPR_THREADS= michael@0: else michael@0: _PTHREAD_LDFLAGS= michael@0: fi michael@0: fi michael@0: dnl Special thread exceptions michael@0: michael@0: case "$target" in michael@0: *-aix*) michael@0: if test -n "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: fi michael@0: case "$target_os" in michael@0: aix4.1*) michael@0: if test -z "$USE_PTHREADS"; then michael@0: AC_DEFINE(AIX_RENAME_SELECT) michael@0: fi michael@0: ;; michael@0: aix4.2*) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(HAVE_POINTER_LOCALTIME_R) michael@0: fi michael@0: ;; michael@0: aix4.3*) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(HAVE_POINTER_LOCALTIME_R) michael@0: fi michael@0: if test -n "$USE_PTHREADS"; then michael@0: AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST) michael@0: fi michael@0: ;; michael@0: *) michael@0: if test -z "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(HAVE_POINTER_LOCALTIME_R) michael@0: fi michael@0: if test -n "$USE_PTHREADS"; then michael@0: AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST) michael@0: fi michael@0: ;; michael@0: esac michael@0: ;; michael@0: *-bsdi*) michael@0: if test -n "$USE_PTHREADS"; then michael@0: AC_DEFINE(_PR_NEED_PTHREAD_INIT) michael@0: fi michael@0: ;; michael@0: *-freebsd*) michael@0: if test -n "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: fi michael@0: ;; michael@0: *-hpux*) michael@0: if test -n "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: fi michael@0: if test "$USE_PTHREADS"; then michael@0: if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then michael@0: AC_DEFINE(_REENTRANT) michael@0: AC_DEFINE(_PR_DCETHREADS) michael@0: else michael@0: AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L) michael@0: AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST) michael@0: fi michael@0: fi michael@0: if test "$USE_USER_PTHREADS"; then michael@0: AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L) michael@0: fi michael@0: ;; michael@0: *-irix*) michael@0: if test "${target_os}" = "irix6.5"; then michael@0: if test -n "$USE_PTHREADS"; then michael@0: AC_DEFINE(_PR_HAVE_GETHOST_R) michael@0: AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER) michael@0: fi michael@0: fi michael@0: ;; michael@0: *-linux*|*-gnu*|*-k*bsd*-gnu) michael@0: if test -n "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: fi michael@0: ;; michael@0: *-mingw*|*-msys*|*-cygwin*|*-mks*|*-os2*|*-beos*) michael@0: dnl win32, os2 & beos cannot use pthreads michael@0: USE_PTHREADS= michael@0: _PTHREAD_LDFLAGS= michael@0: USE_USER_PTHREADS= michael@0: ;; michael@0: *-netbsd*|*-openbsd*) michael@0: if test -n "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: fi michael@0: ;; michael@0: *-osf*) michael@0: if test -n "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: fi michael@0: if test -n "$USE_PTHREADS"; then michael@0: if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then michael@0: : michael@0: else michael@0: AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST) michael@0: fi michael@0: fi michael@0: ;; michael@0: *-solaris*) michael@0: if test -n "$USE_NSPR_THREADS"; then michael@0: AC_DEFINE(_PR_LOCAL_THREADS_ONLY) michael@0: fi michael@0: if test -n "$USE_PTHREADS"; then michael@0: AC_DEFINE(_REENTRANT) michael@0: AC_DEFINE(HAVE_POINTER_LOCALTIME_R) michael@0: if test "$OS_TEST" = "i86pc"; then michael@0: if test -n "$USE_64"; then michael@0: PR_MD_ASFILES=os_SunOS_x86_64.s michael@0: else michael@0: PR_MD_ASFILES=os_SunOS_x86.s michael@0: fi michael@0: else michael@0: if test -n "$USE_64"; then michael@0: PR_MD_ASFILES=os_SunOS_sparcv9.s michael@0: fi michael@0: fi michael@0: fi michael@0: ;; michael@0: *-nto*) michael@0: if test -n "$USE_PTHREADS"; then michael@0: AC_DEFINE(_PR_HAVE_GETHOST_R) michael@0: AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER) michael@0: fi michael@0: ;; michael@0: esac michael@0: michael@0: OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS" michael@0: michael@0: dnl If the user passed in arg to --enable-optimize or --enable-debug, michael@0: dnl make sure that we use it. michael@0: if test -n "$_SAVE_OPTIMIZE_FLAGS"; then michael@0: _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS" michael@0: fi michael@0: michael@0: if test -n "$_SAVE_DEBUG_FLAGS"; then michael@0: _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS" michael@0: fi michael@0: michael@0: if test -n "$MOZ_OPTIMIZE"; then michael@0: CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS" michael@0: CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS" michael@0: fi michael@0: michael@0: if test -n "$MOZ_DEBUG_SYMBOLS"; then michael@0: CFLAGS="$CFLAGS $_DEBUG_FLAGS" michael@0: CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS" michael@0: fi michael@0: michael@0: if test -n "$MOZ_OPTIMIZE"; then michael@0: OBJDIR_TAG=_OPT michael@0: else michael@0: OBJDIR_TAG=_DBG michael@0: fi michael@0: michael@0: if test -n "$USE_64"; then michael@0: COMPILER_TAG=_64 michael@0: fi michael@0: michael@0: RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}" michael@0: michael@0: dnl ======================================================== michael@0: dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW michael@0: dnl ======================================================== michael@0: case "$target_os" in michael@0: cygwin*|mks*) michael@0: CC="\$(CYGWIN_WRAPPER) $CC" michael@0: CXX="\$(CYGWIN_WRAPPER) $CXX" michael@0: RC="\$(CYGWIN_WRAPPER) $RC" michael@0: ;; michael@0: esac michael@0: michael@0: dnl ======================================================== michael@0: dnl = Use malloc wrapper lib michael@0: dnl ======================================================== michael@0: AC_ARG_ENABLE(wrap-malloc, michael@0: [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)], michael@0: [ if test "$enableval" = "yes"; then michael@0: _WRAP_MALLOC=1 michael@0: fi ]) michael@0: michael@0: if test -n "$_WRAP_MALLOC"; then michael@0: if test -n "$GNU_CC"; then michael@0: WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign" michael@0: WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete" michael@0: WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup" michael@0: WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size" michael@0: else michael@0: AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains]) michael@0: fi michael@0: fi michael@0: michael@0: dnl ======================================================== michael@0: dnl = Location of malloc wrapper lib michael@0: dnl ======================================================== michael@0: AC_ARG_WITH(wrap-malloc, michael@0: [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library], michael@0: WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval") michael@0: michael@0: dnl ======================================================== michael@0: dnl Substitution of found variables. michael@0: dnl ======================================================== michael@0: AC_SUBST(SHELL_OVERRIDE) michael@0: michael@0: AC_SUBST(MOZILLA_CLIENT) michael@0: AC_SUBST(CC) michael@0: AC_SUBST(CXX) michael@0: AC_SUBST(CFLAGS) michael@0: AC_SUBST(CXXFLAGS) michael@0: AC_SUBST(CPPFLAGS) michael@0: AC_SUBST(HOST_CC) michael@0: AC_SUBST(HOST_CFLAGS) michael@0: AC_SUBST(LDFLAGS) michael@0: AC_SUBST(HOST_LDFLAGS) michael@0: AC_SUBST(GNU_CC) michael@0: AC_SUBST(GCC_USE_GNU_LD) michael@0: AC_SUBST(MSC_VER) michael@0: AC_SUBST(CROSS_COMPILE) michael@0: michael@0: AC_SUBST(MOZ_OPTIMIZE) michael@0: AC_SUBST(MOZ_DEBUG) michael@0: AC_SUBST(MOZ_DEBUG_SYMBOLS) michael@0: michael@0: AC_SUBST(USE_CPLUS) michael@0: AC_SUBST(USE_IPV6) michael@0: AC_SUBST(USE_N32) michael@0: AC_SUBST(USE_X32) michael@0: AC_SUBST(USE_64) michael@0: AC_SUBST(OBJECT_MODE) michael@0: AC_SUBST(ENABLE_STRIP) michael@0: michael@0: AC_SUBST(USE_PTHREADS) michael@0: AC_SUBST(USE_BTHREADS) michael@0: AC_SUBST(USE_USER_PTHREADS) michael@0: AC_SUBST(USE_NSPR_THREADS) michael@0: michael@0: AC_SUBST(LIBNSPR) michael@0: AC_SUBST(LIBPLC) michael@0: michael@0: AC_SUBST(MOD_MAJOR_VERSION) michael@0: AC_SUBST(MOD_MINOR_VERSION) michael@0: AC_SUBST(MOD_PATCH_VERSION) michael@0: AC_SUBST(NSPR_MODNAME) michael@0: AC_SUBST(MDCPUCFG_H) michael@0: AC_SUBST(PR_MD_CSRCS) michael@0: AC_SUBST(PR_MD_ASFILES) michael@0: AC_SUBST(PR_MD_ARCH_DIR) michael@0: AC_SUBST(CPU_ARCH) michael@0: michael@0: AC_SUBST(OBJ_SUFFIX) michael@0: AC_SUBST(LIB_SUFFIX) michael@0: AC_SUBST(DLL_SUFFIX) michael@0: AC_SUBST(ASM_SUFFIX) michael@0: AC_SUBST(WRAP_LDFLAGS) michael@0: AC_SUBST(MKSHLIB) michael@0: AC_SUBST(DSO_CFLAGS) michael@0: AC_SUBST(DSO_LDOPTS) michael@0: michael@0: AC_SUBST(OS_TARGET) michael@0: AC_SUBST(OS_ARCH) michael@0: AC_SUBST(OS_RELEASE) michael@0: AC_SUBST(OS_TEST) michael@0: AC_SUBST(MACOSX_DEPLOYMENT_TARGET) michael@0: michael@0: AC_SUBST(DEFINES) michael@0: AC_SUBST(DEFS) michael@0: AC_SUBST(AR) michael@0: AC_SUBST(AR_FLAGS) michael@0: AC_SUBST(AS) michael@0: AC_SUBST(ASFLAGS) michael@0: AC_SUBST(LD) michael@0: AC_SUBST(RANLIB) michael@0: AC_SUBST(PERL) michael@0: AC_SUBST(STRIP) michael@0: AC_SUBST(FILTER) michael@0: AC_SUBST(IMPLIB) michael@0: michael@0: AC_SUBST(PROFILE_GEN_CFLAGS) michael@0: AC_SUBST(PROFILE_GEN_LDFLAGS) michael@0: AC_SUBST(PROFILE_USE_CFLAGS) michael@0: AC_SUBST(PROFILE_USE_LDFLAGS) michael@0: michael@0: AC_SUBST(OS_LIBS) michael@0: AC_SUBST(RESOLVE_LINK_SYMBOLS) michael@0: AC_SUBST(AIX_LINK_OPTS) michael@0: AC_SUBST(NOSUCHFILE) michael@0: AC_SUBST(MOZ_OBJFORMAT) michael@0: AC_SUBST(ULTRASPARC_LIBRARY) michael@0: michael@0: AC_SUBST(OBJDIR) michael@0: AC_SUBST(OBJDIR_NAME) michael@0: AC_SUBST(RELEASE_OBJDIR_NAME) michael@0: AC_SUBST(NSINSTALL) michael@0: AC_SUBST(OPTIMIZER) michael@0: AC_SUBST(RC) michael@0: AC_SUBST(RCFLAGS) michael@0: AC_SUBST(DLLFLAGS) michael@0: AC_SUBST(EXEFLAGS) michael@0: AC_SUBST(OS_DLLFLAGS) michael@0: AC_SUBST(CYGWIN_WRAPPER) michael@0: AC_SUBST(VISIBILITY_FLAGS) michael@0: AC_SUBST(WRAP_SYSTEM_INCLUDES) michael@0: AC_SUBST(MACOS_SDK_DIR) michael@0: AC_SUBST(SYMBIAN_SDK_DIR) michael@0: AC_SUBST(NEXT_ROOT) michael@0: AC_SUBST(MT) michael@0: michael@0: dnl ======================================================== michael@0: dnl Generate output files. michael@0: dnl ======================================================== michael@0: MAKEFILES=" michael@0: Makefile michael@0: config/Makefile michael@0: config/autoconf.mk michael@0: config/nsprincl.mk michael@0: config/nsprincl.sh michael@0: config/nspr-config michael@0: config/nspr.pc michael@0: lib/Makefile michael@0: lib/ds/Makefile michael@0: lib/libc/Makefile michael@0: lib/libc/include/Makefile michael@0: lib/libc/src/Makefile michael@0: lib/tests/Makefile michael@0: pkg/Makefile michael@0: pr/Makefile michael@0: pr/include/Makefile michael@0: pr/include/md/Makefile michael@0: pr/include/obsolete/Makefile michael@0: pr/include/private/Makefile michael@0: pr/src/Makefile michael@0: pr/src/io/Makefile michael@0: pr/src/linking/Makefile michael@0: pr/src/malloc/Makefile michael@0: pr/src/md/Makefile michael@0: pr/src/md/${PR_MD_ARCH_DIR}/Makefile michael@0: pr/src/memory/Makefile michael@0: pr/src/misc/Makefile michael@0: pr/src/threads/Makefile michael@0: pr/tests/Makefile michael@0: pr/tests/dll/Makefile michael@0: " michael@0: michael@0: if test "$OS_TARGET" = "Linux"; then michael@0: MAKEFILES="$MAKEFILES michael@0: pkg/linux/Makefile michael@0: " michael@0: elif test "$OS_TARGET" = "SunOS"; then michael@0: MAKEFILES="$MAKEFILES michael@0: pkg/solaris/Makefile michael@0: pkg/solaris/SUNWpr/Makefile michael@0: pkg/solaris/SUNWprd/Makefile michael@0: " michael@0: fi michael@0: michael@0: if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then michael@0: MAKEFILES="$MAKEFILES michael@0: pr/src/threads/combined/Makefile michael@0: " michael@0: elif test -n "$USE_PTHREADS"; then michael@0: MAKEFILES="$MAKEFILES michael@0: pr/src/pthreads/Makefile michael@0: " michael@0: elif test -n "$USE_BTHREADS"; then michael@0: MAKEFILES="$MAKEFILES michael@0: pr/src/bthreads/Makefile michael@0: " michael@0: fi michael@0: michael@0: if test -n "$USE_CPLUS"; then michael@0: MAKEFILES="$MAKEFILES michael@0: pr/src/cplus/Makefile michael@0: pr/src/cplus/tests/Makefile michael@0: " michael@0: fi michael@0: michael@0: echo $MAKEFILES > unallmakefiles michael@0: michael@0: AC_CONFIG_FILES([$MAKEFILES]) michael@0: AC_CONFIG_COMMANDS([default], [chmod +x config/nspr-config]) michael@0: AC_OUTPUT