configure.in

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1
michael@0 2 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
michael@0 3 dnl vi: set tabstop=4 shiftwidth=4 expandtab syntax=m4:
michael@0 4 dnl This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 7
michael@0 8 dnl Process this file with autoconf to produce a configure script.
michael@0 9 dnl ========================================================
michael@0 10
michael@0 11 AC_PREREQ(2.13)
michael@0 12 AC_INIT(config/config.mk)
michael@0 13 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
michael@0 14 AC_CANONICAL_SYSTEM
michael@0 15 TARGET_CPU="${target_cpu}"
michael@0 16 TARGET_VENDOR="${target_vendor}"
michael@0 17 TARGET_OS="${target_os}"
michael@0 18
michael@0 19 dnl ========================================================
michael@0 20 dnl =
michael@0 21 dnl = Don't change the following two lines. Doing so breaks:
michael@0 22 dnl =
michael@0 23 dnl = CFLAGS="-foo" ./configure
michael@0 24 dnl =
michael@0 25 dnl ========================================================
michael@0 26 CFLAGS="${CFLAGS=}"
michael@0 27 CPPFLAGS="${CPPFLAGS=}"
michael@0 28 CXXFLAGS="${CXXFLAGS=}"
michael@0 29 LDFLAGS="${LDFLAGS=}"
michael@0 30 HOST_CFLAGS="${HOST_CFLAGS=}"
michael@0 31 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
michael@0 32 HOST_LDFLAGS="${HOST_LDFLAGS=}"
michael@0 33
michael@0 34 dnl ========================================================
michael@0 35 dnl = Preserve certain environment flags passed to configure
michael@0 36 dnl = We want sub projects to receive the same flags
michael@0 37 dnl = untainted by this configure script
michael@0 38 dnl ========================================================
michael@0 39 _SUBDIR_CC="$CC"
michael@0 40 _SUBDIR_CXX="$CXX"
michael@0 41 _SUBDIR_CFLAGS="$CFLAGS"
michael@0 42 _SUBDIR_CPPFLAGS="$CPPFLAGS"
michael@0 43 _SUBDIR_CXXFLAGS="$CXXFLAGS"
michael@0 44 _SUBDIR_LDFLAGS="$LDFLAGS"
michael@0 45 _SUBDIR_HOST_CC="$HOST_CC"
michael@0 46 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
michael@0 47 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
michael@0 48 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
michael@0 49 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
michael@0 50
michael@0 51 dnl Set the version number of the libs included with mozilla
michael@0 52 dnl ========================================================
michael@0 53 MOZJPEG=62
michael@0 54 MOZPNG=10610
michael@0 55 NSPR_VERSION=4
michael@0 56 NSS_VERSION=3
michael@0 57
michael@0 58 dnl Set the minimum version of toolkit libs used by mozilla
michael@0 59 dnl ========================================================
michael@0 60 GLIB_VERSION=1.2.0
michael@0 61 PERL_VERSION=5.006
michael@0 62 CAIRO_VERSION=1.10
michael@0 63 PANGO_VERSION=1.22.0
michael@0 64 GTK2_VERSION=2.10.0
michael@0 65 GTK3_VERSION=3.0.0
michael@0 66 WINDRES_VERSION=2.14.90
michael@0 67 W32API_VERSION=3.14
michael@0 68 GNOMEVFS_VERSION=2.0
michael@0 69 GNOMEUI_VERSION=2.2.0
michael@0 70 GCONF_VERSION=1.2.1
michael@0 71 GIO_VERSION=2.20
michael@0 72 STARTUP_NOTIFICATION_VERSION=0.8
michael@0 73 DBUS_VERSION=0.60
michael@0 74 SQLITE_VERSION=3.8.4.2
michael@0 75
michael@0 76 MSMANIFEST_TOOL=
michael@0 77
michael@0 78 dnl Set various checks
michael@0 79 dnl ========================================================
michael@0 80 MISSING_X=
michael@0 81 AC_PROG_AWK
michael@0 82
michael@0 83 dnl Initialize the Pthread test variables early so they can be
michael@0 84 dnl overridden by each platform.
michael@0 85 dnl ========================================================
michael@0 86 MOZ_USE_PTHREADS=
michael@0 87 _PTHREAD_LDFLAGS=""
michael@0 88
michael@0 89 dnl Do not allow objdir == srcdir builds.
michael@0 90 dnl ==============================================================
michael@0 91 _topsrcdir=`cd \`dirname $0\`; pwd`
michael@0 92 _objdir=`pwd`
michael@0 93
michael@0 94
michael@0 95 dnl TODO Don't exempt L10N builds once bug 842760 is resolved.
michael@0 96 if test "$_topsrcdir" = "$_objdir" -a "${with_l10n_base+set}" != set; then
michael@0 97 echo " ***"
michael@0 98 echo " * Building directly in the main source directory is not allowed."
michael@0 99 echo " *"
michael@0 100 echo " * To build, you must run configure from a separate directory"
michael@0 101 echo " * (referred to as an object directory)."
michael@0 102 echo " *"
michael@0 103 echo " * If you are building with a mozconfig, you will need to change your"
michael@0 104 echo " * mozconfig to point to a different object directory."
michael@0 105 echo " ***"
michael@0 106 exit 1
michael@0 107 fi
michael@0 108
michael@0 109 # Check for a couple representative files in the source tree
michael@0 110 _conflict_files=
michael@0 111 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
michael@0 112 if test -f $file; then
michael@0 113 _conflict_files="$_conflict_files $file"
michael@0 114 fi
michael@0 115 done
michael@0 116 if test "$_conflict_files"; then
michael@0 117 echo "***"
michael@0 118 echo "* Your source tree contains these files:"
michael@0 119 for file in $_conflict_files; do
michael@0 120 echo "* $file"
michael@0 121 done
michael@0 122 cat 1>&2 <<-EOF
michael@0 123 * This indicates that you previously built in the source tree.
michael@0 124 * A source tree build can confuse the separate objdir build.
michael@0 125 *
michael@0 126 * To clean up the source tree:
michael@0 127 * 1. cd $_topsrcdir
michael@0 128 * 2. gmake distclean
michael@0 129 ***
michael@0 130 EOF
michael@0 131 exit 1
michael@0 132 break
michael@0 133 fi
michael@0 134 MOZ_BUILD_ROOT=`pwd`
michael@0 135
michael@0 136 MOZ_PYTHON
michael@0 137
michael@0 138 MOZ_DEFAULT_COMPILER
michael@0 139
michael@0 140 COMPILE_ENVIRONMENT=1
michael@0 141 MOZ_ARG_DISABLE_BOOL(compile-environment,
michael@0 142 [ --disable-compile-environment
michael@0 143 Disable compiler/library checks.],
michael@0 144 COMPILE_ENVIRONMENT= )
michael@0 145 AC_SUBST(COMPILE_ENVIRONMENT)
michael@0 146
michael@0 147 MOZ_ARG_WITH_STRING(l10n-base,
michael@0 148 [ --with-l10n-base=DIR path to l10n repositories],
michael@0 149 L10NBASEDIR=$withval)
michael@0 150 if test -n "$L10NBASEDIR"; then
michael@0 151 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
michael@0 152 AC_MSG_ERROR([--with-l10n-base must specify a path])
michael@0 153 elif test -d "$L10NBASEDIR"; then
michael@0 154 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
michael@0 155 else
michael@0 156 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
michael@0 157 fi
michael@0 158 fi
michael@0 159 AC_SUBST(L10NBASEDIR)
michael@0 160
michael@0 161 dnl Check for Perl first -- needed for win32 SDK checks
michael@0 162 MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
michael@0 163 if test -z "$PERL" -o "$PERL" = ":"; then
michael@0 164 AC_MSG_ERROR([perl not found in \$PATH])
michael@0 165 fi
michael@0 166
michael@0 167 if test -n "$GAIADIR" -a ! -d "$GAIADIR" ; then
michael@0 168 AC_MSG_ERROR([GAIADIR '$GAIADIR' isn't a valid directory])
michael@0 169 fi
michael@0 170
michael@0 171 AC_SUBST(GAIADIR)
michael@0 172 if test -n "$GAIADIR" ; then
michael@0 173 AC_DEFINE(PACKAGE_GAIA)
michael@0 174 fi
michael@0 175
michael@0 176 if test -n "$FXOS_SIMULATOR" -a -z "$GAIADIR" ; then
michael@0 177 AC_MSG_ERROR([FXOS_SIMULATOR=1 requires GAIADIR to be defined])
michael@0 178 fi
michael@0 179
michael@0 180 if test -n "$FXOS_SIMULATOR" ; then
michael@0 181 AC_DEFINE(FXOS_SIMULATOR)
michael@0 182 AC_SUBST(FXOS_SIMULATOR)
michael@0 183 fi
michael@0 184
michael@0 185 MOZ_ARG_WITH_STRING(gonk,
michael@0 186 [ --with-gonk=DIR
michael@0 187 location of gonk dir],
michael@0 188 gonkdir=$withval)
michael@0 189
michael@0 190 MOZ_ARG_WITH_STRING(gonk-toolchain-prefix,
michael@0 191 [ --with-gonk-toolchain-prefix=DIR
michael@0 192 prefix to gonk toolchain commands],
michael@0 193 gonk_toolchain_prefix=$withval)
michael@0 194
michael@0 195 if test -n "$gonkdir" ; then
michael@0 196 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
michael@0 197 android_source="$gonkdir"
michael@0 198 ANDROID_SOURCE="$android_source"
michael@0 199 ANDROID_NDK="${ANDROID_SOURCE}/ndk"
michael@0 200 dnl Default to ICS
michael@0 201 ANDROID_VERSION=15
michael@0 202 if test -n "${PLATFORM_SDK_VERSION}"; then
michael@0 203 ANDROID_VERSION="${PLATFORM_SDK_VERSION}"
michael@0 204 fi
michael@0 205
michael@0 206 dnl set up compilers
michael@0 207 TOOLCHAIN_PREFIX="$gonk_toolchain_prefix"
michael@0 208 AS="$gonk_toolchain_prefix"as
michael@0 209 CC="$gonk_toolchain_prefix"gcc
michael@0 210 CXX="$gonk_toolchain_prefix"g++
michael@0 211 CPP="$gonk_toolchain_prefix"cpp
michael@0 212 LD="$gonk_toolchain_prefix"ld
michael@0 213 AR="$gonk_toolchain_prefix"ar
michael@0 214 RANLIB="$gonk_toolchain_prefix"ranlib
michael@0 215 STRIP="$gonk_toolchain_prefix"strip
michael@0 216 OBJCOPY="$gonk_toolchain_prefix"objcopy
michael@0 217
michael@0 218 if ! test -e "$gonkdir/ndk/sources/cxx-stl/stlport/src/iostream.cpp"; then
michael@0 219 AC_MSG_ERROR([Couldn't find path to stlport sources in the gonk tree])
michael@0 220 fi
michael@0 221 STLPORT_CPPFLAGS="-I$_topsrcdir/build/stlport/stlport -I$gonkdir/ndk/sources/cxx-stl/system/include"
michael@0 222 STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a"
michael@0 223
michael@0 224 case "$target_cpu" in
michael@0 225 arm)
michael@0 226 ARCH_DIR=arch-arm
michael@0 227 ;;
michael@0 228 i?86)
michael@0 229 ARCH_DIR=arch-x86
michael@0 230 ;;
michael@0 231 esac
michael@0 232
michael@0 233 case "$ANDROID_VERSION" in
michael@0 234 15)
michael@0 235 GONK_INCLUDES="-I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/frameworks/base/include -I$gonkdir/frameworks/base/services/camera -I$gonkdir/frameworks/base/include/media/ -I$gonkdir/frameworks/base/include/media/stagefright -I$gonkdir/frameworks/base/include/media/stagefright/openmax -I$gonkdir/frameworks/base/media/libstagefright/rtsp -I$gonkdir/frameworks/base/media/libstagefright/include -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib -I$gonkdir/dalvik/libnativehelper/include/nativehelper"
michael@0 236 MOZ_B2G_BT=1
michael@0 237 MOZ_B2G_BT_BLUEZ=1
michael@0 238 MOZ_NFC=1
michael@0 239 MOZ_B2G_CAMERA=1
michael@0 240 MOZ_OMX_DECODER=1
michael@0 241 AC_SUBST(MOZ_OMX_DECODER)
michael@0 242 MOZ_RTSP=1
michael@0 243 ;;
michael@0 244 17|18)
michael@0 245 GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include"
michael@0 246 if test -d "$gonkdir/external/bluetooth/bluez"; then
michael@0 247 GONK_INCLUDES="$GONK_INCLUDES -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib"
michael@0 248 MOZ_B2G_BT=1
michael@0 249 MOZ_B2G_BT_BLUEZ=1
michael@0 250 elif test -d "$gonkdir/external/bluetooth/bluedroid"; then
michael@0 251 MOZ_B2G_BT=1
michael@0 252 MOZ_B2G_BT_BLUEDROID=1
michael@0 253 fi
michael@0 254
michael@0 255 MOZ_RTSP=1
michael@0 256 MOZ_NFC=1
michael@0 257 MOZ_B2G_CAMERA=1
michael@0 258 MOZ_OMX_DECODER=1
michael@0 259 AC_SUBST(MOZ_OMX_DECODER)
michael@0 260 MOZ_OMX_ENCODER=1
michael@0 261 AC_SUBST(MOZ_OMX_ENCODER)
michael@0 262 AC_DEFINE(MOZ_OMX_ENCODER)
michael@0 263 ;;
michael@0 264 19)
michael@0 265 GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include"
michael@0 266 MOZ_B2G_CAMERA=1
michael@0 267 MOZ_B2G_BT=1
michael@0 268 MOZ_B2G_BT_BLUEDROID=1
michael@0 269 MOZ_NFC=1
michael@0 270 MOZ_RTSP=1
michael@0 271 MOZ_OMX_DECODER=1
michael@0 272 MOZ_OMX_ENCODER=1
michael@0 273 AC_DEFINE(MOZ_OMX_ENCODER)
michael@0 274 MOZ_AUDIO_OFFLOAD=1
michael@0 275 AC_SUBST(MOZ_AUDIO_OFFLOAD)
michael@0 276 AC_DEFINE(MOZ_AUDIO_OFFLOAD)
michael@0 277
michael@0 278 ;;
michael@0 279 *)
michael@0 280 AC_MSG_ERROR([Unsupported platform version: $ANDROID_VERSION])
michael@0 281 ;;
michael@0 282 esac
michael@0 283 CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/hardware/libhardware/include -I$gonkdir/external/valgrind/fxos-include $GONK_INCLUDES $CPPFLAGS"
michael@0 284 CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
michael@0 285 CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS $STLPORT_CPPFLAGS"
michael@0 286 dnl Add -llog by default, since we use it all over the place.
michael@0 287 LIBS="$LIBS -llog"
michael@0 288
michael@0 289 LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ $LDFLAGS"
michael@0 290
michael@0 291 dnl prevent cross compile section from using these flags as host flags
michael@0 292 if test -z "$HOST_CPPFLAGS" ; then
michael@0 293 HOST_CPPFLAGS=" "
michael@0 294 fi
michael@0 295 if test -z "$HOST_CFLAGS" ; then
michael@0 296 HOST_CFLAGS=" "
michael@0 297 fi
michael@0 298 if test -z "$HOST_CXXFLAGS" ; then
michael@0 299 HOST_CXXFLAGS=" "
michael@0 300 fi
michael@0 301 if test -z "$HOST_LDFLAGS" ; then
michael@0 302 HOST_LDFLAGS=" "
michael@0 303 fi
michael@0 304
michael@0 305 AC_DEFINE(ANDROID)
michael@0 306 AC_DEFINE_UNQUOTED(ANDROID_VERSION, $ANDROID_VERSION)
michael@0 307 AC_SUBST(ANDROID_VERSION)
michael@0 308 AC_DEFINE(HAVE_SYS_UIO_H)
michael@0 309 AC_DEFINE(HAVE_PTHREADS)
michael@0 310 MOZ_CHROME_FILE_FORMAT=omni
michael@0 311 direct_nspr_config=1
michael@0 312 else
michael@0 313 MOZ_ANDROID_NDK
michael@0 314
michael@0 315 case "$target" in
michael@0 316 *-android*|*-linuxandroid*)
michael@0 317 if test -z "$ANDROID_PACKAGE_NAME" ; then
michael@0 318 ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)'
michael@0 319 fi
michael@0 320 MOZ_CHROME_FILE_FORMAT=omni
michael@0 321 ZLIB_DIR=yes
michael@0 322 ;;
michael@0 323 *-linux*)
michael@0 324 AC_PATH_PROG(OBJCOPY,objcopy)
michael@0 325 ;;
michael@0 326 esac
michael@0 327 fi
michael@0 328
michael@0 329 AC_SUBST(ANDROID_SOURCE)
michael@0 330 AC_SUBST(ANDROID_PACKAGE_NAME)
michael@0 331 AC_SUBST(OBJCOPY)
michael@0 332
michael@0 333 dnl ========================================================
michael@0 334 dnl Checks for compilers.
michael@0 335 dnl ========================================================
michael@0 336
michael@0 337 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
michael@0 338 AR_FLAGS='crs $@'
michael@0 339
michael@0 340 if test "$COMPILE_ENVIRONMENT"; then
michael@0 341
michael@0 342 if test "$target" != "$host"; then
michael@0 343 MOZ_CROSS_COMPILER
michael@0 344 else
michael@0 345 AC_PROG_CC
michael@0 346 case "$target" in
michael@0 347 *-mingw*)
michael@0 348 # Work around the conftest.exe access problem on Windows
michael@0 349 sleep 2
michael@0 350 esac
michael@0 351 AC_PROG_CXX
michael@0 352 AC_PROG_RANLIB
michael@0 353 MOZ_PATH_PROGS(AS, $AS as, $CC)
michael@0 354 AC_CHECK_PROGS(AR, ar, :)
michael@0 355 AC_CHECK_PROGS(LD, ld, :)
michael@0 356 AC_CHECK_PROGS(STRIP, strip, :)
michael@0 357 AC_CHECK_PROGS(WINDRES, windres, :)
michael@0 358 if test -z "$HOST_CC"; then
michael@0 359 HOST_CC="$CC"
michael@0 360 fi
michael@0 361 if test -z "$HOST_CFLAGS"; then
michael@0 362 HOST_CFLAGS="$CFLAGS"
michael@0 363 fi
michael@0 364 if test -z "$HOST_CXX"; then
michael@0 365 HOST_CXX="$CXX"
michael@0 366 fi
michael@0 367 if test -z "$HOST_CXXFLAGS"; then
michael@0 368 HOST_CXXFLAGS="$CXXFLAGS"
michael@0 369 fi
michael@0 370 if test -z "$HOST_LDFLAGS"; then
michael@0 371 HOST_LDFLAGS="$LDFLAGS"
michael@0 372 fi
michael@0 373 if test -z "$HOST_RANLIB"; then
michael@0 374 HOST_RANLIB="$RANLIB"
michael@0 375 fi
michael@0 376 if test -z "$HOST_AR"; then
michael@0 377 HOST_AR="$AR"
michael@0 378 fi
michael@0 379 if test -z "$HOST_AR_FLAGS"; then
michael@0 380 HOST_AR_FLAGS="$AR_FLAGS"
michael@0 381 fi
michael@0 382 fi
michael@0 383
michael@0 384 if test -n "$MOZ_WINCONSOLE"; then
michael@0 385 AC_DEFINE(MOZ_WINCONSOLE)
michael@0 386 fi
michael@0 387
michael@0 388 MOZ_TOOL_VARIABLES
michael@0 389
michael@0 390 MOZ_CHECK_COMPILER_WRAPPER
michael@0 391
michael@0 392 if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then
michael@0 393 if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 4 ||
michael@0 394 test "$GCC_MAJOR_VERSION" -lt 4; then
michael@0 395 AC_MSG_ERROR([Only GCC 4.4 or newer supported])
michael@0 396 fi
michael@0 397 fi
michael@0 398
michael@0 399 dnl ========================================================
michael@0 400 dnl Special win32 checks
michael@0 401 dnl ========================================================
michael@0 402
michael@0 403 MOZ_ARG_ENABLE_BOOL(metro,
michael@0 404 [ --enable-metro Enable Windows Metro build targets],
michael@0 405 MOZ_METRO=1,
michael@0 406 MOZ_METRO=)
michael@0 407 if test -n "$MOZ_METRO"; then
michael@0 408 AC_DEFINE(MOZ_METRO)
michael@0 409 # Target the Windows 8 Kit
michael@0 410 WINSDK_TARGETVER=602
michael@0 411 WINVER=502
michael@0 412 # toolkit/library/makefile.in needs these, see nsDllMain.
michael@0 413 CRTDLLVERSION=110
michael@0 414 CRTEXPDLLVERSION=1-1-0
michael@0 415 else
michael@0 416 # Target the Windows 7 SDK by default
michael@0 417 WINSDK_TARGETVER=601
michael@0 418 WINVER=502
michael@0 419 fi
michael@0 420
michael@0 421 AC_SUBST(CRTDLLVERSION)
michael@0 422 AC_SUBST(CRTEXPDLLVERSION)
michael@0 423
michael@0 424 MOZ_ARG_WITH_STRING(windows-version,
michael@0 425 [ --with-windows-version=WINSDK_TARGETVER
michael@0 426 Windows SDK version to target. Lowest version
michael@0 427 currently allowed is 601 (Win7), highest is 602 (Win8)],
michael@0 428 WINSDK_TARGETVER=$withval)
michael@0 429
michael@0 430 # Currently only two sdk versions allowed, 601 and 602
michael@0 431 case "$WINSDK_TARGETVER" in
michael@0 432 601|602)
michael@0 433 MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
michael@0 434 ;;
michael@0 435
michael@0 436 *)
michael@0 437 AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER)]);
michael@0 438 ;;
michael@0 439 esac
michael@0 440
michael@0 441 case "$target" in
michael@0 442 *-mingw*)
michael@0 443 if test "$GCC" != "yes" -a -z "$CLANG_CC"; then
michael@0 444 # Check to see if we are really running in a msvc environemnt
michael@0 445 _WIN32_MSVC=1
michael@0 446 AC_CHECK_PROGS(MIDL, midl)
michael@0 447
michael@0 448 # Make sure compilers are valid
michael@0 449 CFLAGS="$CFLAGS -TC -nologo"
michael@0 450 CXXFLAGS="$CXXFLAGS -TP -nologo"
michael@0 451 AC_LANG_SAVE
michael@0 452 AC_LANG_C
michael@0 453 AC_TRY_COMPILE([#include <stdio.h>],
michael@0 454 [ printf("Hello World\n"); ],,
michael@0 455 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
michael@0 456
michael@0 457 AC_LANG_CPLUSPLUS
michael@0 458 AC_TRY_COMPILE([#include <new.h>],
michael@0 459 [ unsigned *test = new unsigned(42); ],,
michael@0 460 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
michael@0 461 AC_LANG_RESTORE
michael@0 462
michael@0 463 changequote(,)
michael@0 464 _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
michael@0 465 changequote([,])
michael@0 466
michael@0 467 # Determine compiler version
michael@0 468 CC_VERSION=`${CC} -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
michael@0 469 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
michael@0 470 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
michael@0 471 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
michael@0 472 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
michael@0 473 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
michael@0 474
michael@0 475 CXX_VERSION=`${CXX} -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
michael@0 476 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
michael@0 477
michael@0 478 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
michael@0 479 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
michael@0 480 fi
michael@0 481
michael@0 482 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
michael@0 483 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
michael@0 484
michael@0 485 if test "$_CC_MAJOR_VERSION" = "16"; then
michael@0 486 _CC_SUITE=10
michael@0 487 MSVS_VERSION=2010
michael@0 488 elif test "$_CC_MAJOR_VERSION" = "17"; then
michael@0 489 _CC_SUITE=11
michael@0 490 MSVS_VERSION=2012
michael@0 491 elif test "$_CC_MAJOR_VERSION" = "18"; then
michael@0 492 _CC_SUITE=12
michael@0 493 MSVS_VERSION=2013
michael@0 494 else
michael@0 495 AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
michael@0 496 fi
michael@0 497 AC_SUBST(MSVS_VERSION)
michael@0 498
michael@0 499 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
michael@0 500
michael@0 501 if test -n "$WIN32_REDIST_DIR"; then
michael@0 502 if test ! -d "$WIN32_REDIST_DIR"; then
michael@0 503 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
michael@0 504 fi
michael@0 505 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
michael@0 506 fi
michael@0 507
michael@0 508 dnl Confirm we have the pri tools on win8 builds
michael@0 509 if test -n "$MOZ_METRO"; then
michael@0 510 AC_MSG_CHECKING([for makepri])
michael@0 511 AC_CHECK_PROGS(MAKEPRI, makepri, "")
michael@0 512 if test -z "MAKEPRI" ; then
michael@0 513 AC_MSG_ERROR([makepri.exe is required for generating metro browser install components. It should be in the Win8 SDK.])
michael@0 514 fi
michael@0 515 AC_SUBST(MAKEPRI)
michael@0 516 fi
michael@0 517
michael@0 518 dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
michael@0 519 dnl not something else like "magnetic tape manipulation utility".
michael@0 520 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
michael@0 521 if test -z "$MSMT_TOOL"; then
michael@0 522 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
michael@0 523 fi
michael@0 524
michael@0 525 changequote(,)
michael@0 526 _MSMT_VER_FILTER='s|.*[^!-~]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
michael@0 527 changequote([,])
michael@0 528 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
michael@0 529 if test -z "$MSMANIFEST_TOOL_VERSION"; then
michael@0 530 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
michael@0 531 fi
michael@0 532
michael@0 533 MSMANIFEST_TOOL=1
michael@0 534 unset MSMT_TOOL
michael@0 535
michael@0 536 # Check linker version
michael@0 537 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
michael@0 538 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
michael@0 539 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
michael@0 540 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
michael@0 541 fi
michael@0 542
michael@0 543 INCREMENTAL_LINKER=1
michael@0 544
michael@0 545 # Set midl environment
michael@0 546 case "$target" in
michael@0 547 i*86-*)
michael@0 548 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
michael@0 549 ;;
michael@0 550 x86_64-*)
michael@0 551 MIDL_FLAGS="${MIDL_FLAGS} -env x64"
michael@0 552 ;;
michael@0 553 esac
michael@0 554
michael@0 555 unset _MSVC_VER_FILTER
michael@0 556
michael@0 557 AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw,
michael@0 558 [
michael@0 559 AC_LANG_SAVE
michael@0 560 AC_LANG_CPLUSPLUS
michael@0 561 _SAVE_CXXFLAGS="$CXXFLAGS"
michael@0 562 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
michael@0 563 AC_TRY_COMPILE([#include <exception>],
michael@0 564 [std::_Throw(std::exception()); return 0;],
michael@0 565 ac_cv_have_std__Throw="yes",
michael@0 566 ac_cv_have_std__Throw="no")
michael@0 567 CXXFLAGS="$_SAVE_CXXFLAGS"
michael@0 568 AC_LANG_RESTORE
michael@0 569 ])
michael@0 570
michael@0 571 if test "$ac_cv_have_std__Throw" = "yes"; then
michael@0 572 AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug,
michael@0 573 ac_cv_have_dllimport_exception_bug,
michael@0 574 [
michael@0 575 AC_LANG_SAVE
michael@0 576 AC_LANG_CPLUSPLUS
michael@0 577 _SAVE_CXXFLAGS="$CXXFLAGS"
michael@0 578 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
michael@0 579 AC_TRY_LINK([#include <vector>],
michael@0 580 [std::vector<int> v; return v.at(1);],
michael@0 581 ac_cv_have_dllimport_exception_bug="no",
michael@0 582 ac_cv_have_dllimport_exception_bug="yes")
michael@0 583 CXXFLAGS="$_SAVE_CXXFLAGS"
michael@0 584 AC_LANG_RESTORE
michael@0 585 ])
michael@0 586 if test "$ac_cv_have_dllimport_exception_bug" = "no"; then
michael@0 587 WRAP_STL_INCLUDES=1
michael@0 588 MOZ_MSVC_STL_WRAP__Throw=1
michael@0 589 AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw)
michael@0 590 fi
michael@0 591 else
michael@0 592 AC_CACHE_CHECK(for overridable _RAISE,
michael@0 593 ac_cv_have__RAISE,
michael@0 594 [
michael@0 595 AC_LANG_SAVE
michael@0 596 AC_LANG_CPLUSPLUS
michael@0 597 _SAVE_CXXFLAGS="$CXXFLAGS"
michael@0 598 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
michael@0 599 AC_TRY_COMPILE([#include <xstddef>
michael@0 600 #undef _RAISE
michael@0 601 #define _RAISE(x) externallyDefinedFunction((x).what())
michael@0 602 #include <vector>
michael@0 603 ],
michael@0 604 [std::vector<int> v; return v.at(1);],
michael@0 605 ac_cv_have__RAISE="no",
michael@0 606 ac_cv_have__RAISE="yes")
michael@0 607 CXXFLAGS="$_SAVE_CXXFLAGS"
michael@0 608 AC_LANG_RESTORE
michael@0 609 ])
michael@0 610 if test "$ac_cv_have__RAISE" = "yes"; then
michael@0 611 WRAP_STL_INCLUDES=1
michael@0 612 MOZ_MSVC_STL_WRAP__RAISE=1
michael@0 613 AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE)
michael@0 614 else
michael@0 615 AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.])
michael@0 616 fi
michael@0 617 fi
michael@0 618
michael@0 619 if test "$WRAP_STL_INCLUDES" = "1"; then
michael@0 620 STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers'
michael@0 621 fi
michael@0 622 elif test -z "$CLANG_CC"; then
michael@0 623 # Check w32api version
michael@0 624 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
michael@0 625 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
michael@0 626 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
michael@0 627 AC_TRY_COMPILE([#include <w32api.h>],
michael@0 628 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
michael@0 629 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
michael@0 630 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
michael@0 631 #error "test failed."
michael@0 632 #endif
michael@0 633 , [ res=yes ], [ res=no ])
michael@0 634 AC_MSG_RESULT([$res])
michael@0 635 if test "$res" != "yes"; then
michael@0 636 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
michael@0 637 fi
michael@0 638 # Check windres version
michael@0 639 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
michael@0 640 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
michael@0 641 AC_MSG_RESULT([$_WINDRES_VERSION])
michael@0 642 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
michael@0 643 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
michael@0 644 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
michael@0 645 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
michael@0 646 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
michael@0 647 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
michael@0 648 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
michael@0 649 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
michael@0 650 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
michael@0 651 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
michael@0 652 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
michael@0 653 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
michael@0 654 then
michael@0 655 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
michael@0 656 fi
michael@0 657
michael@0 658 AC_CHECK_PROGS(MIDL, $target-widl widl)
michael@0 659 if test -n "$MIDL"; then
michael@0 660 case "$target" in
michael@0 661 i*86-*)
michael@0 662 MIDL_FLAGS="$MIDL_FLAGS --win32 -m32"
michael@0 663 ;;
michael@0 664 x86_64-*)
michael@0 665 MIDL_FLAGS="$MIDL_FLAGS --win64 -m64"
michael@0 666 ;;
michael@0 667 esac
michael@0 668 fi
michael@0 669
michael@0 670 # strsafe.h on mingw uses macros for function deprecation that pollutes namespace
michael@0 671 # causing problems with local implementations with the same name.
michael@0 672 AC_DEFINE(STRSAFE_NO_DEPRECATE)
michael@0 673
michael@0 674 MOZ_WINSDK_MAXVER=0x06020000
michael@0 675 fi # !GNU_CC
michael@0 676
michael@0 677 # If MSVC or clang
michael@0 678 if test "$GCC" != "yes" -o -n "$CLANG_CC" ; then
michael@0 679 MOZ_FIND_WINSDK_VERSION
michael@0 680 fi
michael@0 681
michael@0 682 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
michael@0 683 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
michael@0 684 # Require OS features provided by IE 6.0 SP2 (XP SP2)
michael@0 685 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0603)
michael@0 686
michael@0 687 # If the maximum version supported by this SDK is lower than the target
michael@0 688 # version, error out
michael@0 689 AC_MSG_CHECKING([for Windows SDK being recent enough])
michael@0 690 if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
michael@0 691 AC_MSG_RESULT("yes")
michael@0 692 else
michael@0 693 AC_MSG_RESULT("no")
michael@0 694 AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. Alternatively, try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
michael@0 695 fi
michael@0 696
michael@0 697 AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
michael@0 698 # Definitions matching sdkddkver.h
michael@0 699 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
michael@0 700 AC_DEFINE_UNQUOTED(MOZ_WINSDK_MAXVER,$MOZ_WINSDK_MAXVER)
michael@0 701 AC_SUBST(MOZ_WINSDK_MAXVER)
michael@0 702 ;;
michael@0 703 esac
michael@0 704
michael@0 705 AC_PROG_CPP
michael@0 706 AC_PROG_CXXCPP
michael@0 707
michael@0 708 if test -n "$_WIN32_MSVC"; then
michael@0 709 SKIP_PATH_CHECKS=1
michael@0 710 SKIP_COMPILER_CHECKS=1
michael@0 711 SKIP_LIBRARY_CHECKS=1
michael@0 712
michael@0 713 # Since we're skipping compiler and library checks, hard-code
michael@0 714 # some facts here.
michael@0 715 AC_DEFINE(HAVE_IO_H)
michael@0 716 AC_DEFINE(HAVE_SETBUF)
michael@0 717 AC_DEFINE(HAVE_ISATTY)
michael@0 718 fi
michael@0 719
michael@0 720 fi # COMPILE_ENVIRONMENT
michael@0 721
michael@0 722 AC_SUBST(MIDL_FLAGS)
michael@0 723 AC_SUBST(_MSC_VER)
michael@0 724
michael@0 725 AC_SUBST(GNU_AS)
michael@0 726 AC_SUBST(GNU_LD)
michael@0 727 AC_SUBST(GNU_CC)
michael@0 728 AC_SUBST(GNU_CXX)
michael@0 729 AC_SUBST(INTEL_CC)
michael@0 730 AC_SUBST(INTEL_CXX)
michael@0 731
michael@0 732 AC_SUBST(STL_FLAGS)
michael@0 733 AC_SUBST(WRAP_STL_INCLUDES)
michael@0 734 AC_SUBST(MOZ_MSVC_STL_WRAP__Throw)
michael@0 735 AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE)
michael@0 736
michael@0 737 dnl ========================================================
michael@0 738 dnl Checks for programs.
michael@0 739 dnl ========================================================
michael@0 740 AC_PROG_INSTALL
michael@0 741 AC_PROG_LN_S
michael@0 742
michael@0 743 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
michael@0 744 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
michael@0 745 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
michael@0 746 _perl_res=$?
michael@0 747 AC_MSG_RESULT([$_perl_version])
michael@0 748
michael@0 749 if test "$_perl_res" != 0; then
michael@0 750 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
michael@0 751 fi
michael@0 752 fi
michael@0 753
michael@0 754 AC_MSG_CHECKING([for full perl installation])
michael@0 755 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
michael@0 756 _perl_res=$?
michael@0 757 if test "$_perl_res" != 0; then
michael@0 758 AC_MSG_RESULT([no])
michael@0 759 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
michael@0 760 else
michael@0 761 AC_MSG_RESULT([yes])
michael@0 762 fi
michael@0 763
michael@0 764 if test -z "$COMPILE_ENVIRONMENT"; then
michael@0 765 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
michael@0 766 fi
michael@0 767 AC_SUBST(NSINSTALL_BIN)
michael@0 768
michael@0 769 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
michael@0 770 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
michael@0 771 MOZ_PATH_PROGS(UNZIP, unzip)
michael@0 772 if test -z "$UNZIP" -o "$UNZIP" = ":"; then
michael@0 773 AC_MSG_ERROR([unzip not found in \$PATH])
michael@0 774 fi
michael@0 775 MOZ_PATH_PROGS(ZIP, zip)
michael@0 776 if test -z "$ZIP" -o "$ZIP" = ":"; then
michael@0 777 AC_MSG_ERROR([zip not found in \$PATH])
michael@0 778 fi
michael@0 779 MOZ_PATH_PROG(XARGS, xargs)
michael@0 780 if test -z "$XARGS" -o "$XARGS" = ":"; then
michael@0 781 AC_MSG_ERROR([xargs not found in \$PATH .])
michael@0 782 fi
michael@0 783
michael@0 784 MOZ_PATH_PROG(RPMBUILD, rpmbuild, :)
michael@0 785 AC_SUBST(RPMBUILD)
michael@0 786
michael@0 787 if test "$COMPILE_ENVIRONMENT"; then
michael@0 788
michael@0 789 dnl ========================================================
michael@0 790 dnl = Mac OS X toolchain support
michael@0 791 dnl ========================================================
michael@0 792
michael@0 793 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
michael@0 794 dnl that a universal binary is being produced and MOZ_CAN_RUN_PROGRAMS
michael@0 795 dnl when we can run target binaries.
michael@0 796 AC_SUBST(UNIVERSAL_BINARY)
michael@0 797 AC_SUBST(MOZ_CAN_RUN_PROGRAMS)
michael@0 798
michael@0 799 MOZ_ARG_WITH_STRING(unify-dist,
michael@0 800 [ --with-unify-dist=dir Location of the dist directory to unify with at packaging time (Mac OS X universal build only)],
michael@0 801 UNIFY_DIST=$withval)
michael@0 802 if test -n "$UNIVERSAL_BINARY"; then
michael@0 803 if test -z "$UNIFY_DIST"; then
michael@0 804 AC_MSG_ERROR([You need to provide the --with-unify-dist=dir argument when performing a universal build])
michael@0 805 fi
michael@0 806 case "$UNIFY_DIST" in
michael@0 807 /*)
michael@0 808 ;;
michael@0 809 *)
michael@0 810 UNIFY_DIST="${MOZ_BUILD_ROOT}/${UNIFY_DIST}"
michael@0 811 ;;
michael@0 812 esac
michael@0 813 fi
michael@0 814 AC_SUBST(UNIFY_DIST)
michael@0 815
michael@0 816 dnl ========================================================
michael@0 817 dnl Check for MacOS deployment target version
michael@0 818 dnl ========================================================
michael@0 819
michael@0 820 MOZ_ARG_ENABLE_STRING(macos-target,
michael@0 821 [ --enable-macos-target=VER (default=10.6)
michael@0 822 Set the minimum MacOS version needed at runtime],
michael@0 823 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
michael@0 824
michael@0 825 case "$target" in
michael@0 826 *-darwin*)
michael@0 827 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
michael@0 828 dnl Use the specified value
michael@0 829 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
michael@0 830 else
michael@0 831 dnl No value specified on the command line or in the environment,
michael@0 832 dnl use architecture minimum.
michael@0 833 export MACOSX_DEPLOYMENT_TARGET=10.6
michael@0 834 fi
michael@0 835 ;;
michael@0 836 esac
michael@0 837
michael@0 838 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
michael@0 839
michael@0 840 dnl ========================================================
michael@0 841 dnl = Mac OS X SDK support
michael@0 842 dnl ========================================================
michael@0 843 MACOS_SDK_DIR=
michael@0 844 MOZ_ARG_WITH_STRING(macos-sdk,
michael@0 845 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
michael@0 846 MACOS_SDK_DIR=$withval)
michael@0 847
michael@0 848 MACOS_PRIVATE_FRAMEWORKS_DIR_DEFAULTED=
michael@0 849 MOZ_ARG_WITH_STRING(macos-private-frameworks,
michael@0 850 [ --with-macos-private-frameworks=dir Location of private frameworks to use (Mac OS X only)],
michael@0 851 MACOS_PRIVATE_FRAMEWORKS_DIR=$withval,
michael@0 852 MACOS_PRIVATE_FRAMEWORKS_DIR=/System/Library/PrivateFrameworks
michael@0 853 MACOS_PRIVATE_FRAMEWORKS_DEFAULTED=1)
michael@0 854
michael@0 855 if test -z "${MACOS_PRIVATE_FRAMEWORKS_DEFAULTED}"; then
michael@0 856 if test -z "$CROSS_COMPILE"; then
michael@0 857 AC_MSG_WARN([You should only be using --with-macos-private-frameworks when cross-compiling.])
michael@0 858 fi
michael@0 859 if test ! -d "$MACOS_PRIVATE_FRAMEWORKS_DIR"; then
michael@0 860 AC_MSG_ERROR([PrivateFrameworks directory not found.])
michael@0 861 fi
michael@0 862 fi
michael@0 863
michael@0 864 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
michael@0 865 AC_SUBST(MACOS_SDK_DIR)
michael@0 866 AC_SUBST(MACOS_PRIVATE_FRAMEWORKS_DIR)
michael@0 867
michael@0 868 if test "$MACOS_SDK_DIR"; then
michael@0 869 dnl Sync this section with the ones in NSPR and NSS.
michael@0 870 dnl Changes to the cross environment here need to be accounted for in
michael@0 871 dnl the libIDL checks (below) and xpidl build.
michael@0 872
michael@0 873 if test ! -d "$MACOS_SDK_DIR"; then
michael@0 874 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
michael@0 875 specify a valid SDK. SDKs are installed when the optional cross-development
michael@0 876 tools are selected during the Xcode/Developer Tools installation.])
michael@0 877 fi
michael@0 878
michael@0 879 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
michael@0 880 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
michael@0 881
michael@0 882 dnl CPP/CXXCPP needs to be set for MOZ_CHECK_HEADER.
michael@0 883 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
michael@0 884 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
michael@0 885
michael@0 886 AC_LANG_SAVE
michael@0 887 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
michael@0 888 AC_LANG_CPLUSPLUS
michael@0 889 AC_TRY_COMPILE([#include <new>],[],
michael@0 890 result=yes,
michael@0 891 result=no)
michael@0 892 AC_LANG_RESTORE
michael@0 893 AC_MSG_RESULT($result)
michael@0 894
michael@0 895 if test "$result" = "no" ; then
michael@0 896 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
michael@0 897 fi
michael@0 898 fi
michael@0 899
michael@0 900 fi # COMPILE_ENVIRONMENT
michael@0 901
michael@0 902 AC_MSG_CHECKING([compiler version])
michael@0 903 # Just print it so it shows up in the logs.
michael@0 904 cc_version=$($CC --version)
michael@0 905 AC_MSG_RESULT([$cc_version])
michael@0 906
michael@0 907 if test -n "$MAKE"; then
michael@0 908 if test `echo $MAKE | grep -c make.py` != 1; then
michael@0 909 NOT_PYMAKE=$MAKE
michael@0 910 fi
michael@0 911 fi
michael@0 912
michael@0 913 case "$host_os" in
michael@0 914 mingw*)
michael@0 915 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
michael@0 916 ;;
michael@0 917 *)
michael@0 918 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
michael@0 919 ;;
michael@0 920 esac
michael@0 921 if test "$GMAKE" = ":"; then
michael@0 922 AC_MSG_ERROR([GNU make not found])
michael@0 923 fi
michael@0 924 AC_SUBST(GMAKE)
michael@0 925
michael@0 926 if test -z "$MAKE"; then
michael@0 927 MAKE=$GMAKE
michael@0 928 fi
michael@0 929
michael@0 930 if test "$COMPILE_ENVIRONMENT"; then
michael@0 931
michael@0 932 AC_PATH_XTRA
michael@0 933
michael@0 934 XCFLAGS="$X_CFLAGS"
michael@0 935
michael@0 936 fi # COMPILE_ENVIRONMENT
michael@0 937
michael@0 938 dnl ========================================================
michael@0 939 dnl set the defaults first
michael@0 940 dnl ========================================================
michael@0 941 AS_BIN=$AS
michael@0 942 AR_LIST='$(AR) t'
michael@0 943 AR_EXTRACT='$(AR) x'
michael@0 944 AR_DELETE='$(AR) d'
michael@0 945 AS='$(CC)'
michael@0 946 AS_DASH_C_FLAG='-c'
michael@0 947 DLL_PREFIX=lib
michael@0 948 LIB_PREFIX=lib
michael@0 949 DLL_SUFFIX=.so
michael@0 950 OBJ_SUFFIX=o
michael@0 951 LIB_SUFFIX=a
michael@0 952 ASM_SUFFIX=s
michael@0 953 IMPORT_LIB_SUFFIX=
michael@0 954 TARGET_MD_ARCH=unix
michael@0 955 DIRENT_INO=d_ino
michael@0 956 MOZ_USER_DIR=".mozilla"
michael@0 957
michael@0 958 MOZ_JPEG_CFLAGS=
michael@0 959 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)'
michael@0 960 MOZ_BZ2_CFLAGS=
michael@0 961 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
michael@0 962 MOZ_PNG_CFLAGS="-I$_objdir/dist/include" # needed for freetype compilation
michael@0 963 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'
michael@0 964
michael@0 965 MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
michael@0 966 MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
michael@0 967 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
michael@0 968 XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/bin)'
michael@0 969 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS)'
michael@0 970 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
michael@0 971 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
michael@0 972
michael@0 973 # These are specially defined on Windows only
michael@0 974 case "$target" in
michael@0 975 *-mingw*)
michael@0 976 XPCOM_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
michael@0 977 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime.$(LIB_SUFFIX)'
michael@0 978 ;;
michael@0 979 *)
michael@0 980 XPCOM_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_GLUE_LDOPTS
michael@0 981 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_STANDALONE_GLUE_LDOPTS
michael@0 982 ;;
michael@0 983 esac
michael@0 984
michael@0 985 MOZ_FS_LAYOUT=unix
michael@0 986
michael@0 987 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
michael@0 988
michael@0 989 USE_DEPENDENT_LIBS=1
michael@0 990
michael@0 991 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
michael@0 992
michael@0 993 if test -n "$CROSS_COMPILE"; then
michael@0 994 OS_TARGET="${target_os}"
michael@0 995 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
michael@0 996 OS_RELEASE=
michael@0 997 case "${target_os}" in
michael@0 998 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
michael@0 999 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU/kFreeBSD ;;
michael@0 1000 gnu*) OS_ARCH=GNU ;;
michael@0 1001 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
michael@0 1002 mingw*) OS_ARCH=WINNT OS_TARGET=WINNT ;;
michael@0 1003 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
michael@0 1004 dragonfly*) OS_ARCH=DragonFly OS_TARGET=DragonFly ;;
michael@0 1005 freebsd*) OS_ARCH=FreeBSD OS_TARGET=FreeBSD ;;
michael@0 1006 netbsd*) OS_ARCH=NetBSD OS_TARGET=NetBSD ;;
michael@0 1007 openbsd*) OS_ARCH=OpenBSD OS_TARGET=OpenBSD ;;
michael@0 1008 esac
michael@0 1009 case "${target}" in
michael@0 1010 *-android*|*-linuxandroid*) OS_ARCH=Linux OS_TARGET=Android ;;
michael@0 1011 esac
michael@0 1012 else
michael@0 1013 OS_TARGET=`uname -s`
michael@0 1014 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
michael@0 1015 OS_RELEASE=`uname -r`
michael@0 1016 fi
michael@0 1017
michael@0 1018 # Before this used `uname -m` when not cross compiling
michael@0 1019 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
michael@0 1020 OS_TEST="${target_cpu}"
michael@0 1021
michael@0 1022 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
michael@0 1023
michael@0 1024 #######################################################################
michael@0 1025 # Master "Core Components" macros for getting the OS target #
michael@0 1026 #######################################################################
michael@0 1027
michael@0 1028 #
michael@0 1029 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
michael@0 1030 # cross-compilation.
michael@0 1031 #
michael@0 1032
michael@0 1033 #
michael@0 1034 # Define and override various archtecture-specific variables, including
michael@0 1035 # HOST_OS_ARCH
michael@0 1036 # OS_ARCH
michael@0 1037 # OS_TEST
michael@0 1038 # OS_TARGET
michael@0 1039 # OS_RELEASE
michael@0 1040 # OS_MINOR_RELEASE
michael@0 1041 #
michael@0 1042
michael@0 1043 case "$HOST_OS_ARCH" in
michael@0 1044 mingw*)
michael@0 1045 HOST_OS_ARCH=WINNT
michael@0 1046 ;;
michael@0 1047 darwin*)
michael@0 1048 HOST_OS_ARCH=Darwin
michael@0 1049 ;;
michael@0 1050 linux*)
michael@0 1051 HOST_OS_ARCH=Linux
michael@0 1052 ;;
michael@0 1053 kfreebsd*-gnu)
michael@0 1054 HOST_OS_ARCH=GNU_kFreeBSD
michael@0 1055 ;;
michael@0 1056 gnu*)
michael@0 1057 HOST_OS_ARCH=GNU
michael@0 1058 ;;
michael@0 1059 dragonfly*)
michael@0 1060 HOST_OS_ARCH=DragonFly
michael@0 1061 ;;
michael@0 1062 freebsd*)
michael@0 1063 HOST_OS_ARCH=FreeBSD
michael@0 1064 ;;
michael@0 1065 netbsd*)
michael@0 1066 HOST_OS_ARCH=NetBSD
michael@0 1067 ;;
michael@0 1068 openbsd*)
michael@0 1069 HOST_OS_ARCH=OpenBSD
michael@0 1070 ;;
michael@0 1071 solaris*)
michael@0 1072 HOST_OS_ARCH=SunOS
michael@0 1073 SOLARIS_SUNPRO_CC=
michael@0 1074 SOLARIS_SUNPRO_CXX=
michael@0 1075 if test -z "$GNU_CC"; then
michael@0 1076 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
michael@0 1077 SOLARIS_SUNPRO_CC=1
michael@0 1078 fi
michael@0 1079 fi
michael@0 1080
michael@0 1081 if test -z "$GNU_CXX"; then
michael@0 1082 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
michael@0 1083 SOLARIS_SUNPRO_CXX=1
michael@0 1084 fi
michael@0 1085 fi
michael@0 1086 AC_SUBST(SOLARIS_SUNPRO_CC)
michael@0 1087 AC_SUBST(SOLARIS_SUNPRO_CXX)
michael@0 1088 ;;
michael@0 1089 esac
michael@0 1090
michael@0 1091 case "$OS_ARCH" in
michael@0 1092 WINNT)
michael@0 1093 if test -z "$CROSS_COMPILE" ; then
michael@0 1094 OS_TEST=`uname -p`
michael@0 1095 fi
michael@0 1096 ;;
michael@0 1097 Windows_NT)
michael@0 1098 #
michael@0 1099 # If uname -s returns "Windows_NT", we assume that we are using
michael@0 1100 # the uname.exe in MKS toolkit.
michael@0 1101 #
michael@0 1102 # The -r option of MKS uname only returns the major version number.
michael@0 1103 # So we need to use its -v option to get the minor version number.
michael@0 1104 # Moreover, it doesn't have the -p option, so we need to use uname -m.
michael@0 1105 #
michael@0 1106 OS_ARCH=WINNT
michael@0 1107 OS_TARGET=WINNT
michael@0 1108 OS_MINOR_RELEASE=`uname -v`
michael@0 1109 if test "$OS_MINOR_RELEASE" = "00"; then
michael@0 1110 OS_MINOR_RELEASE=0
michael@0 1111 fi
michael@0 1112 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
michael@0 1113 ;;
michael@0 1114 MINGW*_NT*)
michael@0 1115 #
michael@0 1116 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
michael@0 1117 # the uname.exe in the MSYS tools.
michael@0 1118 #
michael@0 1119 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
michael@0 1120 OS_ARCH=WINNT
michael@0 1121 OS_TARGET=WINNT
michael@0 1122 ;;
michael@0 1123 AIX)
michael@0 1124 OS_RELEASE=`uname -v`.`uname -r`
michael@0 1125 OS_TEST=${target_cpu}
michael@0 1126 ;;
michael@0 1127 Darwin)
michael@0 1128 case "${target_cpu}" in
michael@0 1129 powerpc*)
michael@0 1130 OS_TEST=ppc
michael@0 1131 ;;
michael@0 1132 i*86*)
michael@0 1133 OS_TEST=i386
michael@0 1134 ;;
michael@0 1135 x86_64)
michael@0 1136 OS_TEST=x86_64
michael@0 1137 ;;
michael@0 1138 *)
michael@0 1139 if test -z "$CROSS_COMPILE" ; then
michael@0 1140 OS_TEST=`uname -p`
michael@0 1141 fi
michael@0 1142 ;;
michael@0 1143 esac
michael@0 1144 ;;
michael@0 1145 esac
michael@0 1146
michael@0 1147 # Only set CPU_ARCH if we recognize the value of OS_TEST
michael@0 1148
michael@0 1149 case "$OS_TEST" in
michael@0 1150 *86 | i86pc)
michael@0 1151 CPU_ARCH=x86
michael@0 1152 ;;
michael@0 1153
michael@0 1154 powerpc64 | ppc64 | powerpc64le | ppc64le)
michael@0 1155 CPU_ARCH=ppc64
michael@0 1156 ;;
michael@0 1157
michael@0 1158 powerpc | ppc | rs6000)
michael@0 1159 CPU_ARCH=ppc
michael@0 1160 ;;
michael@0 1161
michael@0 1162 Alpha | alpha | ALPHA)
michael@0 1163 CPU_ARCH=Alpha
michael@0 1164 ;;
michael@0 1165
michael@0 1166 s390)
michael@0 1167 CPU_ARCH=s390
michael@0 1168 ;;
michael@0 1169
michael@0 1170 s390x)
michael@0 1171 CPU_ARCH=s390x
michael@0 1172 ;;
michael@0 1173
michael@0 1174 hppa* | parisc)
michael@0 1175 CPU_ARCH=hppa
michael@0 1176 ;;
michael@0 1177
michael@0 1178 sun4u | sparc*)
michael@0 1179 CPU_ARCH=sparc
michael@0 1180 ;;
michael@0 1181
michael@0 1182 x86_64 | ia64)
michael@0 1183 CPU_ARCH="$OS_TEST"
michael@0 1184 ;;
michael@0 1185
michael@0 1186 arm*)
michael@0 1187 CPU_ARCH=arm
michael@0 1188 ;;
michael@0 1189
michael@0 1190 mips|mipsel)
michael@0 1191 CPU_ARCH="mips"
michael@0 1192 ;;
michael@0 1193
michael@0 1194 aarch64*)
michael@0 1195 CPU_ARCH=aarch64
michael@0 1196 ;;
michael@0 1197 esac
michael@0 1198
michael@0 1199 if test -z "$OS_TARGET"; then
michael@0 1200 OS_TARGET=$OS_ARCH
michael@0 1201 fi
michael@0 1202 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
michael@0 1203
michael@0 1204 dnl Set INTEL_ARCHITECTURE if we're compiling for x86-32 or x86-64.
michael@0 1205 dnl ===============================================================
michael@0 1206 INTEL_ARCHITECTURE=
michael@0 1207 case "$OS_TEST" in
michael@0 1208 x86_64|i?86)
michael@0 1209 INTEL_ARCHITECTURE=1
michael@0 1210 esac
michael@0 1211
michael@0 1212 dnl Configure platform-specific CPU architecture compiler options.
michael@0 1213 dnl ==============================================================
michael@0 1214 MOZ_ARCH_OPTS
michael@0 1215
michael@0 1216 dnl =================================================================
michael@0 1217 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
michael@0 1218 dnl which is bad when cross compiling.
michael@0 1219 dnl =================================================================
michael@0 1220 if test "$COMPILE_ENVIRONMENT"; then
michael@0 1221 configure_static_assert_macros='
michael@0 1222 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
michael@0 1223 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
michael@0 1224 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
michael@0 1225 '
michael@0 1226
michael@0 1227 dnl test that the macros actually work:
michael@0 1228 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
michael@0 1229 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
michael@0 1230 [AC_LANG_SAVE
michael@0 1231 AC_LANG_C
michael@0 1232 ac_cv_static_assertion_macros_work="yes"
michael@0 1233 AC_TRY_COMPILE([$configure_static_assert_macros],
michael@0 1234 [CONFIGURE_STATIC_ASSERT(1)],
michael@0 1235 ,
michael@0 1236 ac_cv_static_assertion_macros_work="no")
michael@0 1237 AC_TRY_COMPILE([$configure_static_assert_macros],
michael@0 1238 [CONFIGURE_STATIC_ASSERT(0)],
michael@0 1239 ac_cv_static_assertion_macros_work="no",
michael@0 1240 )
michael@0 1241 AC_LANG_CPLUSPLUS
michael@0 1242 AC_TRY_COMPILE([$configure_static_assert_macros],
michael@0 1243 [CONFIGURE_STATIC_ASSERT(1)],
michael@0 1244 ,
michael@0 1245 ac_cv_static_assertion_macros_work="no")
michael@0 1246 AC_TRY_COMPILE([$configure_static_assert_macros],
michael@0 1247 [CONFIGURE_STATIC_ASSERT(0)],
michael@0 1248 ac_cv_static_assertion_macros_work="no",
michael@0 1249 )
michael@0 1250 AC_LANG_RESTORE
michael@0 1251 ])
michael@0 1252 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
michael@0 1253 if test "$ac_cv_static_assertion_macros_work" = "no"; then
michael@0 1254 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
michael@0 1255 fi
michael@0 1256 fi # COMPILE_ENVIRONMENT
michael@0 1257
michael@0 1258 dnl ========================================================
michael@0 1259 dnl Android libstdc++, placed here so it can use MOZ_ARCH
michael@0 1260 dnl computed above.
michael@0 1261 dnl ========================================================
michael@0 1262
michael@0 1263 MOZ_ANDROID_STLPORT
michael@0 1264
michael@0 1265 dnl ========================================================
michael@0 1266 dnl Suppress Clang Argument Warnings
michael@0 1267 dnl ========================================================
michael@0 1268 if test -n "$CLANG_CC"; then
michael@0 1269 _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
michael@0 1270 CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
michael@0 1271 fi
michael@0 1272 if test -n "$CLANG_CXX"; then
michael@0 1273 _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
michael@0 1274 fi
michael@0 1275
michael@0 1276 dnl ========================================================
michael@0 1277 dnl = Use Address Sanitizer
michael@0 1278 dnl ========================================================
michael@0 1279 MOZ_ARG_ENABLE_BOOL(address-sanitizer,
michael@0 1280 [ --enable-address-sanitizer Enable Address Sanitizer (default=no)],
michael@0 1281 MOZ_ASAN=1,
michael@0 1282 MOZ_ASAN= )
michael@0 1283 if test -n "$MOZ_ASAN"; then
michael@0 1284 MOZ_LLVM_HACKS=1
michael@0 1285 AC_DEFINE(MOZ_ASAN)
michael@0 1286 MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
michael@0 1287 fi
michael@0 1288 AC_SUBST(MOZ_ASAN)
michael@0 1289 AC_SUBST(LLVM_SYMBOLIZER)
michael@0 1290
michael@0 1291 dnl ========================================================
michael@0 1292 dnl = Enable hacks required for LLVM instrumentations
michael@0 1293 dnl ========================================================
michael@0 1294 MOZ_ARG_ENABLE_BOOL(llvm-hacks,
michael@0 1295 [ --enable-llvm-hacks Enable workarounds required for several LLVM instrumentations (default=no)],
michael@0 1296 MOZ_LLVM_HACKS=1,
michael@0 1297 MOZ_LLVM_HACKS= )
michael@0 1298 if test -n "$MOZ_LLVM_HACKS"; then
michael@0 1299 MOZ_NO_WLZDEFS=1
michael@0 1300 MOZ_CFLAGS_NSS=1
michael@0 1301 fi
michael@0 1302 AC_SUBST(MOZ_NO_WLZDEFS)
michael@0 1303 AC_SUBST(MOZ_CFLAGS_NSS)
michael@0 1304
michael@0 1305 dnl ========================================================
michael@0 1306 dnl GNU specific defaults
michael@0 1307 dnl ========================================================
michael@0 1308 if test "$GNU_CC"; then
michael@0 1309 MMX_FLAGS="-mmmx"
michael@0 1310 SSE_FLAGS="-msse"
michael@0 1311 SSE2_FLAGS="-msse2"
michael@0 1312 # Per bug 719659 comment 2, some of the headers on ancient build machines
michael@0 1313 # may require gnu89 inline semantics. But otherwise, we use C99.
michael@0 1314 # But on OS X we just use C99 plus GNU extensions, in order to fix
michael@0 1315 # bug 917526.
michael@0 1316 CFLAGS="$CFLAGS -std=gnu99"
michael@0 1317 if test "${OS_ARCH}" != Darwin; then
michael@0 1318 CFLAGS="$CFLAGS -fgnu89-inline"
michael@0 1319 fi
michael@0 1320 # FIXME: Let us build with strict aliasing. bug 414641.
michael@0 1321 CFLAGS="$CFLAGS -fno-strict-aliasing"
michael@0 1322 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@'
michael@0 1323 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@'
michael@0 1324 WARNINGS_AS_ERRORS='-Werror'
michael@0 1325 DSO_CFLAGS=''
michael@0 1326 DSO_PIC_CFLAGS='-fPIC'
michael@0 1327 ASFLAGS="$ASFLAGS -fPIC"
michael@0 1328 AC_MSG_CHECKING([for --noexecstack option to as])
michael@0 1329 _SAVE_CFLAGS=$CFLAGS
michael@0 1330 CFLAGS="$CFLAGS -Wa,--noexecstack"
michael@0 1331 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
michael@0 1332 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
michael@0 1333 AC_MSG_RESULT([no]))
michael@0 1334 CFLAGS=$_SAVE_CFLAGS
michael@0 1335 AC_MSG_CHECKING([for -z noexecstack option to ld])
michael@0 1336 _SAVE_LDFLAGS=$LDFLAGS
michael@0 1337 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
michael@0 1338 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
michael@0 1339 AC_MSG_RESULT([no])
michael@0 1340 LDFLAGS=$_SAVE_LDFLAGS)
michael@0 1341
michael@0 1342 AC_MSG_CHECKING([for -z text option to ld])
michael@0 1343 _SAVE_LDFLAGS=$LDFLAGS
michael@0 1344 LDFLAGS="$LDFLAGS -Wl,-z,text"
michael@0 1345 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
michael@0 1346 [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,text"],
michael@0 1347 AC_MSG_RESULT([no])
michael@0 1348 LDFLAGS=$_SAVE_LDFLAGS)
michael@0 1349
michael@0 1350 AC_MSG_CHECKING([for --build-id option to ld])
michael@0 1351 _SAVE_LDFLAGS=$LDFLAGS
michael@0 1352 LDFLAGS="$LDFLAGS -Wl,--build-id"
michael@0 1353 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
michael@0 1354 [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,--build-id"],
michael@0 1355 AC_MSG_RESULT([no])
michael@0 1356 LDFLAGS=$_SAVE_LDFLAGS)
michael@0 1357
michael@0 1358 AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
michael@0 1359 HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
michael@0 1360 _SAVE_LDFLAGS=$LDFLAGS
michael@0 1361 LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
michael@0 1362 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
michael@0 1363 [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
michael@0 1364 AC_MSG_RESULT([no]))
michael@0 1365 LDFLAGS=$_SAVE_LDFLAGS
michael@0 1366
michael@0 1367 # Check for -mssse3 on $CC
michael@0 1368 AC_MSG_CHECKING([if toolchain supports -mssse3 option])
michael@0 1369 HAVE_TOOLCHAIN_SUPPORT_MSSSE3=
michael@0 1370 _SAVE_CFLAGS=$CFLAGS
michael@0 1371 CFLAGS="$CFLAGS -mssse3"
michael@0 1372 AC_TRY_COMPILE([asm ("pmaddubsw %xmm2,%xmm3");],,AC_MSG_RESULT([yes])
michael@0 1373 [HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1],
michael@0 1374 AC_MSG_RESULT([no]))
michael@0 1375 CFLAGS=$_SAVE_CFLAGS
michael@0 1376
michael@0 1377 # Check for -msse4.1 on $CC
michael@0 1378 AC_MSG_CHECKING([if toolchain supports -msse4.1 option])
michael@0 1379 HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=
michael@0 1380 _SAVE_CFLAGS=$CFLAGS
michael@0 1381 CFLAGS="$CFLAGS -msse4.1"
michael@0 1382 AC_TRY_COMPILE([asm ("pmulld %xmm6,%xmm0");],,AC_MSG_RESULT([yes])
michael@0 1383 [HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1],
michael@0 1384 AC_MSG_RESULT([no]))
michael@0 1385 CFLAGS=$_SAVE_CFLAGS
michael@0 1386
michael@0 1387 case "${CPU_ARCH}" in
michael@0 1388 x86 | x86_64)
michael@0 1389 AC_MSG_CHECKING(for x86 AVX2 asm support in compiler)
michael@0 1390 AC_TRY_COMPILE([],
michael@0 1391 [asm volatile ("vpermq \$0xd8,%ymm0,%ymm0 \n");],
michael@0 1392 result="yes", result="no")
michael@0 1393 AC_MSG_RESULT("$result")
michael@0 1394 if test "$result" = "yes"; then
michael@0 1395 HAVE_X86_AVX2=1
michael@0 1396 AC_DEFINE(HAVE_X86_AVX2)
michael@0 1397 AC_SUBST(HAVE_X86_AVX2)
michael@0 1398 fi
michael@0 1399 esac
michael@0 1400
michael@0 1401 DSO_LDOPTS='-shared'
michael@0 1402 if test "$GCC_USE_GNU_LD"; then
michael@0 1403 # Some tools like ASan use a runtime library that is only
michael@0 1404 # linked against executables, so we must allow undefined
michael@0 1405 # symbols for shared objects in some cases.
michael@0 1406 if test -z "$MOZ_NO_WLZDEFS"; then
michael@0 1407 # Don't allow undefined symbols in libraries
michael@0 1408 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
michael@0 1409
michael@0 1410 # BSDs need `environ' exposed for posix_spawn (bug 753046)
michael@0 1411 case "$OS_TARGET" in
michael@0 1412 DragonFly|FreeBSD|NetBSD|OpenBSD)
michael@0 1413 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
michael@0 1414 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
michael@0 1415 else
michael@0 1416 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
michael@0 1417 fi
michael@0 1418 ;;
michael@0 1419 esac
michael@0 1420 fi
michael@0 1421 fi
michael@0 1422
michael@0 1423 # Turn on GNU-specific warnings:
michael@0 1424 # -Wall - turn on a lot of warnings
michael@0 1425 # -Wpointer-arith - good to have
michael@0 1426 # -Wdeclaration-after-statement - MSVC doesn't like these
michael@0 1427 # -Werror=return-type - catches missing returns, zero false positives
michael@0 1428 # -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size
michael@0 1429 # -Wtype-limits - catches overflow bugs, few false positives
michael@0 1430 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
michael@0 1431 # -Wsign-compare - catches comparison of signed and unsigned types
michael@0 1432 #
michael@0 1433 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
michael@0 1434 MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type)
michael@0 1435 MOZ_C_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_c_has_werror_int_to_pointer_cast)
michael@0 1436 MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits)
michael@0 1437 MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body)
michael@0 1438 MOZ_C_SUPPORTS_WARNING(-W, sign-compare, ac_c_has_sign_compare)
michael@0 1439
michael@0 1440 # Turn off the following warnings that -Wall turns on:
michael@0 1441 # -Wno-unused - lots of violations in third-party code
michael@0 1442 #
michael@0 1443 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused"
michael@0 1444
michael@0 1445 if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then
michael@0 1446 # Don't use -Wcast-align with ICC or clang
michael@0 1447 case "$CPU_ARCH" in
michael@0 1448 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
michael@0 1449 hppa | ia64 | sparc | arm)
michael@0 1450 ;;
michael@0 1451 *)
michael@0 1452 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
michael@0 1453 ;;
michael@0 1454 esac
michael@0 1455 fi
michael@0 1456
michael@0 1457 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
michael@0 1458 _USE_CPP_INCLUDE_FLAG=1
michael@0 1459 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
michael@0 1460
michael@0 1461 elif test "$SOLARIS_SUNPRO_CC"; then
michael@0 1462 DSO_CFLAGS=''
michael@0 1463 if test "$CPU_ARCH" = "sparc"; then
michael@0 1464 # for Sun Studio on Solaris/SPARC
michael@0 1465 DSO_PIC_CFLAGS='-xcode=pic32'
michael@0 1466 else
michael@0 1467 DSO_PIC_CFLAGS='-KPIC'
michael@0 1468 fi
michael@0 1469 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
michael@0 1470 else
michael@0 1471 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
michael@0 1472 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
michael@0 1473
michael@0 1474 DSO_LDOPTS='-shared'
michael@0 1475 if test "$GNU_LD"; then
michael@0 1476 # Don't allow undefined symbols in libraries
michael@0 1477 DSO_LDOPTS="$DSO_LDOPTS -z defs"
michael@0 1478 fi
michael@0 1479
michael@0 1480 DSO_CFLAGS=''
michael@0 1481 DSO_PIC_CFLAGS='-KPIC'
michael@0 1482 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
michael@0 1483 fi
michael@0 1484
michael@0 1485 if test "$GNU_CXX"; then
michael@0 1486 # FIXME: Let us build with strict aliasing. bug 414641.
michael@0 1487 CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
michael@0 1488
michael@0 1489 # Turn on GNU-specific warnings:
michael@0 1490 # -Wall - turn on a lot of warnings
michael@0 1491 # -Wpointer-arith - good to have
michael@0 1492 # -Woverloaded-virtual - ???
michael@0 1493 # -Werror=return-type - catches missing returns, zero false positives
michael@0 1494 # -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size
michael@0 1495 # -Wtype-limits - catches overflow bugs, few false positives
michael@0 1496 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
michael@0 1497 # -Wsign-compare - catches comparison of signed and unsigned types
michael@0 1498 #
michael@0 1499 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
michael@0 1500 MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
michael@0 1501 MOZ_CXX_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_cxx_has_werror_int_to_pointer_cast)
michael@0 1502 MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits)
michael@0 1503 MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
michael@0 1504 MOZ_CXX_SUPPORTS_WARNING(-W, sign-compare, ac_cxx_has_sign_compare)
michael@0 1505
michael@0 1506 # Turn off the following warnings that -Wall turns on:
michael@0 1507 # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently
michael@0 1508 # -Wno-inline-new-delete - we inline 'new' and 'delete' in mozalloc
michael@0 1509 # for performance reasons, and because GCC and clang accept it (though
michael@0 1510 # clang warns about it).
michael@0 1511 #
michael@0 1512 MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof)
michael@0 1513 MOZ_CXX_SUPPORTS_WARNING(-Wno-, inline-new-delete, ac_cxx_has_wno_inline_new_delete)
michael@0 1514
michael@0 1515 if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then
michael@0 1516 # Don't use -Wcast-align with ICC or clang
michael@0 1517 case "$CPU_ARCH" in
michael@0 1518 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
michael@0 1519 hppa | ia64 | sparc | arm)
michael@0 1520 ;;
michael@0 1521 *)
michael@0 1522 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
michael@0 1523 ;;
michael@0 1524 esac
michael@0 1525 fi
michael@0 1526
michael@0 1527 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
michael@0 1528 _USE_CPP_INCLUDE_FLAG=1
michael@0 1529
michael@0 1530 # Recent clang and gcc support C++11 deleted functions without warnings if
michael@0 1531 # compiling with -std=c++0x or -std=gnu++0x (or c++11 or gnu++11 in very new
michael@0 1532 # versions). We can't use -std=c++0x yet, so gcc's support must remain
michael@0 1533 # unused. But clang's warning can be disabled, so when compiling with clang
michael@0 1534 # we use it to opt out of the warning, enabling (macro-encapsulated) use of
michael@0 1535 # deleted function syntax.
michael@0 1536 if test "$CLANG_CXX"; then
michael@0 1537 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions"
michael@0 1538 MOZ_CXX_SUPPORTS_WARNING(-Wno-, extended-offsetof, ac_cxx_has_wno_extended_offsetof)
michael@0 1539 fi
michael@0 1540
michael@0 1541 else
michael@0 1542 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
michael@0 1543 fi
michael@0 1544
michael@0 1545 dnl gcc can come with its own linker so it is better to use the pass-thru calls
michael@0 1546 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
michael@0 1547 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
michael@0 1548 dnl normal behavior.
michael@0 1549 dnl ========================================================
michael@0 1550 MKSHLIB_FORCE_ALL=
michael@0 1551 MKSHLIB_UNFORCE_ALL=
michael@0 1552
michael@0 1553 if test "$COMPILE_ENVIRONMENT"; then
michael@0 1554 if test "$GNU_CC"; then
michael@0 1555 AC_MSG_CHECKING(whether ld has archive extraction flags)
michael@0 1556 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
michael@0 1557 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
michael@0 1558 ac_cv_mkshlib_force_and_unforce="no"
michael@0 1559 exec 3<&0 <<LOOP_INPUT
michael@0 1560 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
michael@0 1561 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
michael@0 1562 force="-Wl,-all"; unforce="-Wl,-none"
michael@0 1563 LOOP_INPUT
michael@0 1564 while read line
michael@0 1565 do
michael@0 1566 eval $line
michael@0 1567 LDFLAGS=$force
michael@0 1568 LIBS=$unforce
michael@0 1569 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
michael@0 1570 done
michael@0 1571 exec 0<&3 3<&-
michael@0 1572 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
michael@0 1573 ])
michael@0 1574 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
michael@0 1575 AC_MSG_RESULT(no)
michael@0 1576 else
michael@0 1577 AC_MSG_RESULT(yes)
michael@0 1578 eval $ac_cv_mkshlib_force_and_unforce
michael@0 1579 MKSHLIB_FORCE_ALL=$force
michael@0 1580 MKSHLIB_UNFORCE_ALL=$unforce
michael@0 1581 fi
michael@0 1582 fi # GNU_CC
michael@0 1583 fi # COMPILE_ENVIRONMENT
michael@0 1584
michael@0 1585 dnl ========================================================
michael@0 1586 dnl Checking for 64-bit OS
michael@0 1587 dnl ========================================================
michael@0 1588 if test "$COMPILE_ENVIRONMENT"; then
michael@0 1589 AC_LANG_SAVE
michael@0 1590 AC_LANG_C
michael@0 1591 AC_MSG_CHECKING(for 64-bit OS)
michael@0 1592 AC_TRY_COMPILE([$configure_static_assert_macros],
michael@0 1593 [CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
michael@0 1594 result="yes", result="no")
michael@0 1595 AC_MSG_RESULT("$result")
michael@0 1596 if test "$result" = "yes"; then
michael@0 1597 AC_DEFINE(HAVE_64BIT_OS)
michael@0 1598 HAVE_64BIT_OS=1
michael@0 1599 fi
michael@0 1600 AC_SUBST(HAVE_64BIT_OS)
michael@0 1601 AC_LANG_RESTORE
michael@0 1602 fi # COMPILE_ENVIRONMENT
michael@0 1603
michael@0 1604 dnl ========================================================
michael@0 1605 dnl = Use profiling compile flags
michael@0 1606 dnl ========================================================
michael@0 1607 MOZ_ARG_ENABLE_BOOL(profiling,
michael@0 1608 [ --enable-profiling Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
michael@0 1609 MOZ_PROFILING=1,
michael@0 1610 MOZ_PROFILING= )
michael@0 1611
michael@0 1612 dnl ========================================================
michael@0 1613 dnl = Turn on systrace for android/b2g.
michael@0 1614 dnl ========================================================
michael@0 1615 MOZ_ARG_ENABLE_BOOL(systrace,
michael@0 1616 [ --enable-systrace Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
michael@0 1617 MOZ_USE_SYSTRACE=1,
michael@0 1618 MOZ_USE_SYSTRACE= )
michael@0 1619 if test -n "$MOZ_USE_SYSTRACE"; then
michael@0 1620 AC_DEFINE(MOZ_USE_SYSTRACE)
michael@0 1621 fi
michael@0 1622
michael@0 1623 # For profiling builds keep the symbol information
michael@0 1624 if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
michael@0 1625 case "$OS_TARGET" in
michael@0 1626 Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
michael@0 1627 STRIP_FLAGS="--strip-debug"
michael@0 1628 ;;
michael@0 1629 esac
michael@0 1630 fi
michael@0 1631
michael@0 1632 dnl ========================================================
michael@0 1633 dnl = Use Valgrind
michael@0 1634 dnl ========================================================
michael@0 1635 MOZ_ARG_ENABLE_BOOL(valgrind,
michael@0 1636 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
michael@0 1637 MOZ_VALGRIND=1,
michael@0 1638 MOZ_VALGRIND= )
michael@0 1639 if test -n "$MOZ_VALGRIND"; then
michael@0 1640 MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
michael@0 1641 AC_MSG_ERROR(
michael@0 1642 [--enable-valgrind specified but Valgrind is not installed]))
michael@0 1643 AC_DEFINE(MOZ_VALGRIND)
michael@0 1644 fi
michael@0 1645 AC_SUBST(MOZ_VALGRIND)
michael@0 1646
michael@0 1647 dnl ========================================================
michael@0 1648 dnl jprof
michael@0 1649 dnl ========================================================
michael@0 1650 MOZ_ARG_ENABLE_BOOL(jprof,
michael@0 1651 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.],
michael@0 1652 MOZ_JPROF=1,
michael@0 1653 MOZ_JPROF= )
michael@0 1654 if test -n "$MOZ_JPROF"; then
michael@0 1655 MOZ_PROFILING=1
michael@0 1656 AC_DEFINE(MOZ_JPROF)
michael@0 1657 fi
michael@0 1658
michael@0 1659 dnl ========================================================
michael@0 1660 dnl SPS Profiler
michael@0 1661 dnl ========================================================
michael@0 1662 MOZ_ENABLE_PROFILER_SPS=1
michael@0 1663
michael@0 1664 case "${OS_TARGET}" in
michael@0 1665 Android)
michael@0 1666 case "${CPU_ARCH}" in
michael@0 1667 x86 | arm) ;;
michael@0 1668 *)
michael@0 1669 MOZ_ENABLE_PROFILER_SPS=
michael@0 1670 esac
michael@0 1671 ;;
michael@0 1672 Linux)
michael@0 1673 case "${CPU_ARCH}" in
michael@0 1674 x86 | x86_64) ;;
michael@0 1675 *)
michael@0 1676 MOZ_ENABLE_PROFILER_SPS=
michael@0 1677 esac
michael@0 1678 ;;
michael@0 1679 WINNT|Darwin) ;;
michael@0 1680 *)
michael@0 1681 MOZ_ENABLE_PROFILER_SPS=
michael@0 1682 ;;
michael@0 1683 esac
michael@0 1684
michael@0 1685 if test -n "$MOZ_ENABLE_PROFILER_SPS"; then
michael@0 1686 AC_DEFINE(MOZ_ENABLE_PROFILER_SPS)
michael@0 1687 fi
michael@0 1688
michael@0 1689 dnl ========================================================
michael@0 1690 dnl shark
michael@0 1691 dnl ========================================================
michael@0 1692 MOZ_ARG_ENABLE_BOOL(shark,
michael@0 1693 [ --enable-shark Enable shark remote profiling. Implies --enable-profiling.],
michael@0 1694 MOZ_SHARK=1,
michael@0 1695 MOZ_SHARK= )
michael@0 1696 if test -n "$MOZ_SHARK"; then
michael@0 1697 MOZ_PROFILING=1
michael@0 1698 AC_DEFINE(MOZ_SHARK)
michael@0 1699 fi
michael@0 1700
michael@0 1701 dnl ========================================================
michael@0 1702 dnl instruments
michael@0 1703 dnl ========================================================
michael@0 1704 MOZ_ARG_ENABLE_BOOL(instruments,
michael@0 1705 [ --enable-instruments Enable instruments remote profiling. Implies --enable-profiling.],
michael@0 1706 MOZ_INSTRUMENTS=1,
michael@0 1707 MOZ_INSTRUMENTS= )
michael@0 1708 if test -n "$MOZ_INSTRUMENTS"; then
michael@0 1709 MOZ_PROFILING=1
michael@0 1710 AC_DEFINE(MOZ_INSTRUMENTS)
michael@0 1711 fi
michael@0 1712
michael@0 1713 dnl ========================================================
michael@0 1714 dnl callgrind
michael@0 1715 dnl ========================================================
michael@0 1716 MOZ_ARG_ENABLE_BOOL(callgrind,
michael@0 1717 [ --enable-callgrind Enable callgrind profiling. Implies --enable-profiling.],
michael@0 1718 MOZ_CALLGRIND=1,
michael@0 1719 MOZ_CALLGRIND= )
michael@0 1720 if test -n "$MOZ_CALLGRIND"; then
michael@0 1721 MOZ_PROFILING=1
michael@0 1722 AC_DEFINE(MOZ_CALLGRIND)
michael@0 1723 fi
michael@0 1724
michael@0 1725 dnl ========================================================
michael@0 1726 dnl vtune
michael@0 1727 dnl ========================================================
michael@0 1728 MOZ_ARG_ENABLE_BOOL(vtune,
michael@0 1729 [ --enable-vtune Enable vtune profiling. Implies --enable-profiling.],
michael@0 1730 MOZ_VTUNE=1,
michael@0 1731 MOZ_VTUNE= )
michael@0 1732 if test -n "$MOZ_VTUNE"; then
michael@0 1733 MOZ_PROFILING=1
michael@0 1734 AC_DEFINE(MOZ_VTUNE)
michael@0 1735 fi
michael@0 1736
michael@0 1737 dnl ========================================================
michael@0 1738 dnl Profiling
michael@0 1739 dnl ========================================================
michael@0 1740 if test -n "$MOZ_PROFILING"; then
michael@0 1741 AC_DEFINE(MOZ_PROFILING)
michael@0 1742 fi
michael@0 1743
michael@0 1744 dnl ========================================================
michael@0 1745 dnl System overrides of the defaults for host
michael@0 1746 dnl ========================================================
michael@0 1747 case "$host" in
michael@0 1748 *mingw*)
michael@0 1749 if test -n "$_WIN32_MSVC"; then
michael@0 1750 HOST_AR=lib
michael@0 1751 HOST_AR_FLAGS='-NOLOGO -OUT:$@'
michael@0 1752 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo"
michael@0 1753 HOST_RANLIB='echo ranlib'
michael@0 1754 else
michael@0 1755 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
michael@0 1756 fi
michael@0 1757 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
michael@0 1758 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
michael@0 1759 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
michael@0 1760 HOST_BIN_SUFFIX=.exe
michael@0 1761 case "$host" in
michael@0 1762 *mingw*)
michael@0 1763 PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper"
michael@0 1764 ;;
michael@0 1765 esac
michael@0 1766
michael@0 1767 case "${host_cpu}" in
michael@0 1768 i*86)
michael@0 1769 if test -n "$_WIN32_MSVC"; then
michael@0 1770 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
michael@0 1771 fi
michael@0 1772 ;;
michael@0 1773 x86_64)
michael@0 1774 if test -n "$_WIN32_MSVC"; then
michael@0 1775 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
michael@0 1776 fi
michael@0 1777 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
michael@0 1778 ;;
michael@0 1779 esac
michael@0 1780 ;;
michael@0 1781
michael@0 1782 *-darwin*)
michael@0 1783 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
michael@0 1784 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
michael@0 1785 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
michael@0 1786 ;;
michael@0 1787
michael@0 1788 *-linux*|*-kfreebsd*-gnu|*-gnu*)
michael@0 1789 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
michael@0 1790 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
michael@0 1791 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
michael@0 1792 ;;
michael@0 1793
michael@0 1794 *)
michael@0 1795 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
michael@0 1796 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
michael@0 1797 ;;
michael@0 1798 esac
michael@0 1799
michael@0 1800 dnl Check for using a custom <inttypes.h> implementation
michael@0 1801 dnl ========================================================
michael@0 1802 AC_MSG_CHECKING(for custom <inttypes.h> implementation)
michael@0 1803 if test "$MOZ_CUSTOM_INTTYPES_H"; then
michael@0 1804 AC_DEFINE_UNQUOTED(MOZ_CUSTOM_INTTYPES_H, "$MOZ_CUSTOM_INTTYPES_H")
michael@0 1805 AC_MSG_RESULT(using $MOZ_CUSTOM_INTTYPES_H)
michael@0 1806 else
michael@0 1807 AC_MSG_RESULT(none specified)
michael@0 1808 fi
michael@0 1809
michael@0 1810 dnl Get mozilla version from central milestone file
michael@0 1811 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
michael@0 1812 MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
michael@0 1813 MOZILLA_SYMBOLVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion`
michael@0 1814
michael@0 1815 dnl Get version of various core apps from the version files.
michael@0 1816 FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
michael@0 1817
michael@0 1818 if test -z "$FIREFOX_VERSION"; then
michael@0 1819 AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
michael@0 1820 fi
michael@0 1821
michael@0 1822 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
michael@0 1823 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
michael@0 1824 AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
michael@0 1825 AC_SUBST(MOZILLA_SYMBOLVERSION)
michael@0 1826
michael@0 1827 MOZ_DOING_LTO(lto_is_enabled)
michael@0 1828
michael@0 1829 dnl ========================================================
michael@0 1830 dnl System overrides of the defaults for target
michael@0 1831 dnl ========================================================
michael@0 1832
michael@0 1833 case "$target" in
michael@0 1834 *-aix*)
michael@0 1835 AC_DEFINE(AIX)
michael@0 1836 if test ! "$GNU_CC"; then
michael@0 1837 if test ! "$HAVE_64BIT_OS"; then
michael@0 1838 # Compiling with Visual Age C++ object model compat is the
michael@0 1839 # default. To compile with object model ibm, add
michael@0 1840 # AIX_OBJMODEL=ibm to .mozconfig.
michael@0 1841 if test "$AIX_OBJMODEL" = "ibm"; then
michael@0 1842 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
michael@0 1843 else
michael@0 1844 AIX_OBJMODEL=compat
michael@0 1845 fi
michael@0 1846 else
michael@0 1847 AIX_OBJMODEL=compat
michael@0 1848 fi
michael@0 1849 AC_SUBST(AIX_OBJMODEL)
michael@0 1850 DSO_LDOPTS='-qmkshrobj=1'
michael@0 1851 DSO_CFLAGS='-qflag=w:w'
michael@0 1852 DSO_PIC_CFLAGS=
michael@0 1853 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
michael@0 1854 MOZ_FIX_LINK_PATHS=
michael@0 1855 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
michael@0 1856 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
michael@0 1857 if test "$COMPILE_ENVIRONMENT"; then
michael@0 1858 AC_LANG_SAVE
michael@0 1859 AC_LANG_CPLUSPLUS
michael@0 1860 AC_MSG_CHECKING([for IBM XLC/C++ compiler version >= 9.0.0.7])
michael@0 1861 AC_TRY_COMPILE([],
michael@0 1862 [#if (__IBMCPP__ < 900)
michael@0 1863 #error "Bad compiler"
michael@0 1864 #endif],
michael@0 1865 _BAD_COMPILER=,_BAD_COMPILER=1)
michael@0 1866 if test -n "$_BAD_COMPILER"; then
michael@0 1867 AC_MSG_RESULT([no])
michael@0 1868 AC_MSG_ERROR([IBM XLC/C++ 9.0.0.7 or higher is required to build.])
michael@0 1869 else
michael@0 1870 AC_MSG_RESULT([yes])
michael@0 1871 fi
michael@0 1872 AC_LANG_RESTORE
michael@0 1873 TARGET_COMPILER_ABI="ibmc"
michael@0 1874 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
michael@0 1875 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
michael@0 1876 fi
michael@0 1877 fi
michael@0 1878 case "${target_os}" in
michael@0 1879 aix4.1*)
michael@0 1880 DLL_SUFFIX='_shr.a'
michael@0 1881 ;;
michael@0 1882 esac
michael@0 1883 if test "$COMPILE_ENVIRONMENT"; then
michael@0 1884 MOZ_CHECK_HEADERS(sys/inttypes.h)
michael@0 1885 fi
michael@0 1886 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
michael@0 1887 ;;
michael@0 1888
michael@0 1889 *-darwin*)
michael@0 1890 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
michael@0 1891 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
michael@0 1892 MOZ_OPTIMIZE_FLAGS="-O3"
michael@0 1893 # Statically disable jemalloc on 10.5 and 32-bit 10.6. See bug 702250.
michael@0 1894 if test "$HAVE_64BIT_OS"; then
michael@0 1895 MOZ_MEMORY=1
michael@0 1896 fi
michael@0 1897 DLL_SUFFIX=".dylib"
michael@0 1898 DSO_LDOPTS=''
michael@0 1899 STRIP_FLAGS="$STRIP_FLAGS -x -S"
michael@0 1900 # Check whether we're targeting OS X or iOS
michael@0 1901 AC_CACHE_CHECK(for iOS target,
michael@0 1902 ac_cv_ios_target,
michael@0 1903 [AC_TRY_COMPILE([#include <TargetConditionals.h>
michael@0 1904 #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
michael@0 1905 #error not iOS
michael@0 1906 #endif],
michael@0 1907 [],
michael@0 1908 ac_cv_ios_target="yes",
michael@0 1909 ac_cv_ios_target="no")])
michael@0 1910 if test "$ac_cv_ios_target" = "yes"; then
michael@0 1911 AC_DEFINE(XP_IOS)
michael@0 1912 AC_DEFINE(XP_DARWIN)
michael@0 1913 _PLATFORM_DEFAULT_TOOLKIT='cairo-uikit'
michael@0 1914 else
michael@0 1915 AC_DEFINE(XP_MACOSX)
michael@0 1916 AC_DEFINE(XP_DARWIN)
michael@0 1917 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
michael@0 1918 # The ExceptionHandling framework is needed for Objective-C exception
michael@0 1919 # logging code in nsObjCExceptions.h. Currently we only use that in debug
michael@0 1920 # builds.
michael@0 1921 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
michael@0 1922 fi
michael@0 1923 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
michael@0 1924
michael@0 1925 if test "x$lto_is_enabled" = "xyes"; then
michael@0 1926 echo "Skipping -dead_strip because lto is enabled."
michael@0 1927 dnl DTrace and -dead_strip don't interact well. See bug 403132.
michael@0 1928 dnl ===================================================================
michael@0 1929 elif test "x$enable_dtrace" = "xyes"; then
michael@0 1930 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
michael@0 1931 else
michael@0 1932 dnl check for the presence of the -dead_strip linker flag
michael@0 1933 AC_MSG_CHECKING([for -dead_strip option to ld])
michael@0 1934 _SAVE_LDFLAGS=$LDFLAGS
michael@0 1935 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
michael@0 1936 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
michael@0 1937 if test -n "$_HAVE_DEAD_STRIP" ; then
michael@0 1938 AC_MSG_RESULT([yes])
michael@0 1939 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
michael@0 1940 else
michael@0 1941 AC_MSG_RESULT([no])
michael@0 1942 fi
michael@0 1943
michael@0 1944 LDFLAGS=$_SAVE_LDFLAGS
michael@0 1945 fi
michael@0 1946
michael@0 1947 dnl With newer linkers we need to pass -allow_heap_execute because of
michael@0 1948 dnl Microsoft Silverlight (5.1.10411.0 at least).
michael@0 1949 AC_MSG_CHECKING([for -allow_heap_execute option to ld])
michael@0 1950 _SAVE_LDFLAGS=$LDFLAGS
michael@0 1951 LDFLAGS="$LDFLAGS -Wl,-allow_heap_execute"
michael@0 1952 AC_TRY_LINK(,[return 0;],_HAVE_ALLOW_HEAP_EXECUTE=1,
michael@0 1953 _HAVE_ALLOW_HEAP_EXECUTE=)
michael@0 1954 if test -n "$_HAVE_ALLOW_HEAP_EXECUTE" ; then
michael@0 1955 AC_MSG_RESULT([yes])
michael@0 1956 MOZ_ALLOW_HEAP_EXECUTE_FLAGS="-Wl,-allow_heap_execute"
michael@0 1957 else
michael@0 1958 AC_MSG_RESULT([no])
michael@0 1959 fi
michael@0 1960 LDFLAGS=$_SAVE_LDFLAGS
michael@0 1961
michael@0 1962 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
michael@0 1963 ;;
michael@0 1964
michael@0 1965 ia64*-hpux*)
michael@0 1966 DLL_SUFFIX=".so"
michael@0 1967 if test ! "$GNU_CC"; then
michael@0 1968 DSO_LDOPTS='-b'
michael@0 1969 DSO_CFLAGS=""
michael@0 1970 DSO_PIC_CFLAGS=
michael@0 1971 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
michael@0 1972 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
michael@0 1973 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
michael@0 1974 else
michael@0 1975 DSO_LDOPTS='-b -E'
michael@0 1976 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
michael@0 1977 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
michael@0 1978 fi
michael@0 1979 MOZ_FIX_LINK_PATHS=
michael@0 1980 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
michael@0 1981 AC_DEFINE(_LARGEFILE64_SOURCE)
michael@0 1982 ;;
michael@0 1983
michael@0 1984 *-hpux*)
michael@0 1985 DLL_SUFFIX=".sl"
michael@0 1986 if test ! "$GNU_CC"; then
michael@0 1987 DSO_LDOPTS='-b -Wl,+s'
michael@0 1988 DSO_CFLAGS=""
michael@0 1989 DSO_PIC_CFLAGS="+Z"
michael@0 1990 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
michael@0 1991 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
michael@0 1992 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
michael@0 1993 else
michael@0 1994 DSO_LDOPTS='-b -E +s'
michael@0 1995 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
michael@0 1996 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
michael@0 1997 fi
michael@0 1998 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
michael@0 1999 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
michael@0 2000 ;;
michael@0 2001
michael@0 2002 *-android*|*-linuxandroid*)
michael@0 2003 AC_DEFINE(NO_PW_GECOS)
michael@0 2004 no_x=yes
michael@0 2005 if test -n "$gonkdir"; then
michael@0 2006 _PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
michael@0 2007 _PLATFORM_HAVE_RIL=1
michael@0 2008 MOZ_B2G_FM=1
michael@0 2009 MOZ_SYNTH_PICO=1
michael@0 2010 else
michael@0 2011 _PLATFORM_DEFAULT_TOOLKIT=cairo-android
michael@0 2012 MOZ_LINKER=1
michael@0 2013 fi
michael@0 2014 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
michael@0 2015
michael@0 2016 MOZ_GFX_OPTIMIZE_MOBILE=1
michael@0 2017 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions"
michael@0 2018 ;;
michael@0 2019
michael@0 2020 *-*linux*)
michael@0 2021 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
michael@0 2022 # Similarly for GNU_CXX and INTEL_CXX.
michael@0 2023 if test "$INTEL_CC" -o "$INTEL_CXX"; then
michael@0 2024 # -Os has been broken on Intel's C/C++ compilers for quite a
michael@0 2025 # while; Intel recommends against using it.
michael@0 2026 MOZ_OPTIMIZE_FLAGS="-O2"
michael@0 2027 elif test "$GNU_CC" -o "$GNU_CXX"; then
michael@0 2028 case $GCC_VERSION in
michael@0 2029 4.5.*)
michael@0 2030 # -Os is broken on gcc 4.5.x we need to tweak it to get good results.
michael@0 2031 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
michael@0 2032 esac
michael@0 2033 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
michael@0 2034 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK"
michael@0 2035 fi
michael@0 2036
michael@0 2037 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
michael@0 2038
michael@0 2039 MOZ_MEMORY=1
michael@0 2040
michael@0 2041 case "${target_cpu}" in
michael@0 2042 alpha*)
michael@0 2043 CFLAGS="$CFLAGS -mieee"
michael@0 2044 CXXFLAGS="$CXXFLAGS -mieee"
michael@0 2045 ;;
michael@0 2046 esac
michael@0 2047
michael@0 2048 if test -z "$MC"; then
michael@0 2049 MC=mc.exe
michael@0 2050 fi
michael@0 2051 ;;
michael@0 2052 *-mingw*)
michael@0 2053 DSO_CFLAGS=
michael@0 2054 DSO_PIC_CFLAGS=
michael@0 2055 DLL_SUFFIX=.dll
michael@0 2056 RC=rc.exe
michael@0 2057 MC=mc.exe
michael@0 2058 # certain versions of cygwin's makedepend barf on the
michael@0 2059 # #include <string> vs -I./dist/include/string issue so don't use it
michael@0 2060 XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/lib)'
michael@0 2061 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
michael@0 2062 CC="$CC -mwindows"
michael@0 2063 CXX="$CXX -mwindows"
michael@0 2064 CPP="$CPP -mwindows"
michael@0 2065 CFLAGS="$CFLAGS -mms-bitfields"
michael@0 2066 CXXFLAGS="$CXXFLAGS -mms-bitfields"
michael@0 2067 DSO_LDOPTS='-shared'
michael@0 2068 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
michael@0 2069 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
michael@0 2070 RC='$(WINDRES)'
michael@0 2071 # Use static libgcc and libstdc++
michael@0 2072 LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
michael@0 2073 NSPR_LDFLAGS="$NSPR_LDFLAGS -static-libgcc"
michael@0 2074 # Use temp file for windres (bug 213281)
michael@0 2075 RCFLAGS='-O coff --use-temp-file'
michael@0 2076 # mingw doesn't require kernel32, user32, and advapi32 explicitly
michael@0 2077 LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32 -lnetapi32"
michael@0 2078 MOZ_FIX_LINK_PATHS=
michael@0 2079 DLL_PREFIX=
michael@0 2080 IMPORT_LIB_SUFFIX=dll.a
michael@0 2081
michael@0 2082 # We use mix of both POSIX and Win32 printf format across the tree, so format
michael@0 2083 # warnings are useless on mingw.
michael@0 2084 MOZ_C_SUPPORTS_WARNING(-Wno-, format, ac_c_has_wno_format)
michael@0 2085 MOZ_CXX_SUPPORTS_WARNING(-Wno-, format, ac_cxx_has_wno_format)
michael@0 2086 else
michael@0 2087 TARGET_COMPILER_ABI=msvc
michael@0 2088 HOST_CC='$(CC)'
michael@0 2089 HOST_CXX='$(CXX)'
michael@0 2090 HOST_LD='$(LD)'
michael@0 2091 if test "$AS_BIN"; then
michael@0 2092 AS="$(basename "$AS_BIN")"
michael@0 2093 fi
michael@0 2094 AR='lib'
michael@0 2095 AR_FLAGS='-NOLOGO -OUT:$@'
michael@0 2096 AR_EXTRACT=
michael@0 2097 RANLIB='echo not_ranlib'
michael@0 2098 STRIP='echo not_strip'
michael@0 2099 PKG_SKIP_STRIP=1
michael@0 2100 XARGS=xargs
michael@0 2101 ZIP=zip
michael@0 2102 UNZIP=unzip
michael@0 2103 DOXYGEN=:
michael@0 2104 ASM_SUFFIX=asm
michael@0 2105 OBJ_SUFFIX=obj
michael@0 2106 LIB_SUFFIX=lib
michael@0 2107 DLL_PREFIX=
michael@0 2108 LIB_PREFIX=
michael@0 2109 IMPORT_LIB_SUFFIX=lib
michael@0 2110 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
michael@0 2111 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
michael@0 2112 MKSHLIB_FORCE_ALL=
michael@0 2113 MKSHLIB_UNFORCE_ALL=
michael@0 2114 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
michael@0 2115 _USE_CPP_INCLUDE_FLAG=1
michael@0 2116 _DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
michael@0 2117 _DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
michael@0 2118 CFLAGS="$CFLAGS -W3 -Gy"
michael@0 2119 CXXFLAGS="$CXXFLAGS -W3 -Gy"
michael@0 2120 if test "$_CC_SUITE" -ge "12"; then
michael@0 2121 dnl VS2013+ requires -FS when parallel building by make -jN.
michael@0 2122 dnl If nothing, compiler sometimes causes C1041 error.
michael@0 2123 dnl
michael@0 2124 dnl Visual Studio 2013 supports -Gw flags
michael@0 2125 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
michael@0 2126 CFLAGS="$CFLAGS -FS -Gw"
michael@0 2127 CXXFLAGS="$CXXFLAGS -FS -Gw"
michael@0 2128 fi
michael@0 2129 # khuey says we can safely ignore MSVC warning C4251
michael@0 2130 # MSVC warning C4244 (implicit type conversion may lose data) warns
michael@0 2131 # and requires workarounds for perfectly valid code. Also, GCC/clang
michael@0 2132 # don't warn about it by default. So for consistency/sanity, we turn
michael@0 2133 # it off on MSVC, too.
michael@0 2134 # MSVC warning C4345 warns of newly conformant behavior as of VS2003.
michael@0 2135 # MSVC warning C4351 warns of newly conformant behavior as of VS2005.
michael@0 2136 # MSVC warning C4482 warns when an enum value is refered specifing the
michael@0 2137 # name of the enum itself. This behavior is allowed in C++11, and the
michael@0 2138 # warning has been removed in VS2012.
michael@0 2139 # MSVC warning C4800 warns when a value is implicitly cast to bool,
michael@0 2140 # because this also forces narrowing to a single byte, which can be a
michael@0 2141 # perf hit. But this matters so little in practice (and often we want
michael@0 2142 # that behavior) that it's better to turn it off.
michael@0 2143 # MSVC warning C4819 warns some UTF-8 characters (e.g. copyright sign)
michael@0 2144 # on non-Western system locales even if it is in a comment.
michael@0 2145 CFLAGS="$CFLAGS -wd4244 -wd4819"
michael@0 2146 CXXFLAGS="$CXXFLAGS -wd4251 -wd4244 -wd4345 -wd4351 -wd4482 -wd4800 -wd4819"
michael@0 2147 # make 'foo == bar;' error out
michael@0 2148 CFLAGS="$CFLAGS -we4553"
michael@0 2149 CXXFLAGS="$CXXFLAGS -we4553"
michael@0 2150 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib netapi32.lib"
michael@0 2151 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
michael@0 2152 WARNINGS_AS_ERRORS='-WX'
michael@0 2153 MOZ_OPTIMIZE_FLAGS='-O1'
michael@0 2154 MOZ_FIX_LINK_PATHS=
michael@0 2155 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
michael@0 2156 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
michael@0 2157 if test -z "$DEVELOPER_OPTIONS"; then
michael@0 2158 LDFLAGS="$LDFLAGS -RELEASE"
michael@0 2159 fi
michael@0 2160 dnl For profile-guided optimization
michael@0 2161 PROFILE_GEN_CFLAGS="-GL"
michael@0 2162 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
michael@0 2163 dnl XXX: PGO builds can fail with warnings treated as errors,
michael@0 2164 dnl specifically "no profile data available" appears to be
michael@0 2165 dnl treated as an error sometimes. This might be a consequence
michael@0 2166 dnl of using WARNINGS_AS_ERRORS in some modules, combined
michael@0 2167 dnl with the linker doing most of the work in the whole-program
michael@0 2168 dnl optimization/PGO case. I think it's probably a compiler bug,
michael@0 2169 dnl but we work around it here.
michael@0 2170 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
michael@0 2171 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
michael@0 2172 dnl Probably also a compiler bug, but what can you do?
michael@0 2173 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
michael@0 2174 LDFLAGS="$LDFLAGS -DYNAMICBASE"
michael@0 2175 dnl Minimum reqiurement of Gecko is VS2010 or later which supports
michael@0 2176 dnl both SSSE3 and SSE4.1.
michael@0 2177 HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
michael@0 2178 HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1
michael@0 2179 fi
michael@0 2180 AC_DEFINE(HAVE_SNPRINTF)
michael@0 2181 AC_DEFINE(_WINDOWS)
michael@0 2182 AC_DEFINE(WIN32)
michael@0 2183 AC_DEFINE(XP_WIN)
michael@0 2184 AC_DEFINE(XP_WIN32)
michael@0 2185 AC_DEFINE(HW_THREADS)
michael@0 2186 AC_DEFINE(STDC_HEADERS)
michael@0 2187 AC_DEFINE(WIN32_LEAN_AND_MEAN)
michael@0 2188 TARGET_MD_ARCH=win32
michael@0 2189 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
michael@0 2190 BIN_SUFFIX='.exe'
michael@0 2191 MOZ_USER_DIR="Mozilla"
michael@0 2192
michael@0 2193 dnl Hardcode to win95 for now - cls
michael@0 2194 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
michael@0 2195
michael@0 2196 dnl set NO_X11 defines here as the general check is skipped on win32
michael@0 2197 no_x=yes
michael@0 2198 AC_DEFINE(NO_X11)
michael@0 2199
michael@0 2200 case "$host" in
michael@0 2201 *-mingw*)
michael@0 2202 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
michael@0 2203 if test -n "$L10NBASEDIR"; then
michael@0 2204 L10NBASEDIR=`cd $L10NBASEDIR && pwd -W`
michael@0 2205 fi
michael@0 2206 ;;
michael@0 2207 esac
michael@0 2208
michael@0 2209 case "$host" in
michael@0 2210 *-mingw*)
michael@0 2211 if test -z "$MOZ_TOOLS"; then
michael@0 2212 AC_MSG_ERROR([MOZ_TOOLS is not set])
michael@0 2213 fi
michael@0 2214 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
michael@0 2215 if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then
michael@0 2216 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
michael@0 2217 fi
michael@0 2218 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
michael@0 2219 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
michael@0 2220 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
michael@0 2221 fi
michael@0 2222 ;;
michael@0 2223 esac
michael@0 2224
michael@0 2225 case "$host_os" in
michael@0 2226 cygwin*|msvc*|mks*)
michael@0 2227 AC_MSG_ERROR([Using a Cygwin build environment is unsupported. Configure cannot check for presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
michael@0 2228 ;;
michael@0 2229 esac
michael@0 2230
michael@0 2231 case "$target" in
michael@0 2232 i*86-*)
michael@0 2233 if test "$HAVE_64BIT_OS"; then
michael@0 2234 AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
michael@0 2235 fi
michael@0 2236
michael@0 2237 if test -n "$GNU_CC"; then
michael@0 2238 CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
michael@0 2239 CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
michael@0 2240 LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup -Wl,--large-address-aware"
michael@0 2241 else
michael@0 2242 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
michael@0 2243 LDFLAGS="$LDFLAGS -SAFESEH"
michael@0 2244 fi
michael@0 2245
michael@0 2246 AC_DEFINE(_X86_)
michael@0 2247 ;;
michael@0 2248 x86_64-*)
michael@0 2249 if test -n "$_WIN32_MSVC"; then
michael@0 2250 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
michael@0 2251 fi
michael@0 2252 AC_DEFINE(_AMD64_)
michael@0 2253 ;;
michael@0 2254 *)
michael@0 2255 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
michael@0 2256 ;;
michael@0 2257 esac
michael@0 2258 ;;
michael@0 2259
michael@0 2260 *-netbsd*)
michael@0 2261 DSO_CFLAGS=''
michael@0 2262 CFLAGS="$CFLAGS -Dunix"
michael@0 2263 CXXFLAGS="$CXXFLAGS -Dunix"
michael@0 2264 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
michael@0 2265 DLL_SUFFIX=".so"
michael@0 2266 DSO_PIC_CFLAGS='-fPIC -DPIC'
michael@0 2267 DSO_LDOPTS='-shared'
michael@0 2268 BIN_FLAGS='-Wl,--export-dynamic'
michael@0 2269 else
michael@0 2270 DSO_PIC_CFLAGS='-fPIC -DPIC'
michael@0 2271 DLL_SUFFIX=".so.1.0"
michael@0 2272 DSO_LDOPTS='-shared'
michael@0 2273 fi
michael@0 2274 # This will fail on a.out systems prior to 1.5.1_ALPHA.
michael@0 2275 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
michael@0 2276 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
michael@0 2277 if test "$LIBRUNPATH"; then
michael@0 2278 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
michael@0 2279 fi
michael@0 2280 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@) -o $@'
michael@0 2281 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@)) -o $@'
michael@0 2282 ;;
michael@0 2283
michael@0 2284 *-openbsd*)
michael@0 2285 if test "$SO_VERSION"; then
michael@0 2286 DLL_SUFFIX=".so.$SO_VERSION"
michael@0 2287 else
michael@0 2288 DLL_SUFFIX=".so.1.0"
michael@0 2289 fi
michael@0 2290 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib'
michael@0 2291 DSO_CFLAGS=''
michael@0 2292 DSO_PIC_CFLAGS='-fPIC'
michael@0 2293 DSO_LDOPTS='-shared -fPIC'
michael@0 2294 if test "$LIBRUNPATH"; then
michael@0 2295 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
michael@0 2296 fi
michael@0 2297 ;;
michael@0 2298
michael@0 2299 *-solaris*)
michael@0 2300 AC_DEFINE(SOLARIS)
michael@0 2301 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
michael@0 2302 MOZ_FIX_LINK_PATHS=
michael@0 2303 # $ORIGIN/.. is for shared libraries under components/ to locate shared
michael@0 2304 # libraries one level up (e.g. libnspr4.so)
michael@0 2305 if test "$SOLARIS_SUNPRO_CC"; then
michael@0 2306 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs"
michael@0 2307 LIBS="-lCrun -lCstd -lc $LIBS"
michael@0 2308 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
michael@0 2309 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
michael@0 2310 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
michael@0 2311 LDFLAGS="-xildoff $LDFLAGS"
michael@0 2312 MMX_FLAGS="-xarch=mmx -xO4"
michael@0 2313 SSE_FLAGS="-xarch=sse"
michael@0 2314 SSE2_FLAGS="-xarch=ssei2 -xO4"
michael@0 2315 if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
michael@0 2316 _SAVE_LDFLAGS=$LDFLAGS
michael@0 2317 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
michael@0 2318 AC_TRY_LINK([#include <stdio.h>],
michael@0 2319 [printf("Hello World\n");],
michael@0 2320 ,
michael@0 2321 [LDFLAGS=$_SAVE_LDFLAGS])
michael@0 2322 fi
michael@0 2323 MOZ_OPTIMIZE_FLAGS="-xO4"
michael@0 2324 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
michael@0 2325 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@'
michael@0 2326 MKSHLIB_FORCE_ALL='-z allextract'
michael@0 2327 MKSHLIB_UNFORCE_ALL='-z defaultextract'
michael@0 2328 DSO_LDOPTS='-G'
michael@0 2329 AR_LIST="$AR t"
michael@0 2330 AR_EXTRACT="$AR x"
michael@0 2331 AR_DELETE="$AR d"
michael@0 2332 AR='$(CXX) -xar'
michael@0 2333 AR_FLAGS='-o $@'
michael@0 2334 AS='/usr/ccs/bin/as'
michael@0 2335 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
michael@0 2336 AS_DASH_C_FLAG=''
michael@0 2337 TARGET_COMPILER_ABI="sunc"
michael@0 2338 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
michael@0 2339 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
michael@0 2340 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
michael@0 2341 AC_LANG_SAVE
michael@0 2342 AC_LANG_CPLUSPLUS
michael@0 2343 AC_TRY_COMPILE([],
michael@0 2344 [#if (__SUNPRO_CC < 0x590)
michael@0 2345 #error "Denied"
michael@0 2346 #endif],
michael@0 2347 _BAD_COMPILER=,_BAD_COMPILER=1)
michael@0 2348 if test -n "$_BAD_COMPILER"; then
michael@0 2349 _res="no"
michael@0 2350 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
michael@0 2351 else
michael@0 2352 _res="yes"
michael@0 2353 fi
michael@0 2354 AC_TRY_COMPILE([],
michael@0 2355 [#if (__SUNPRO_CC >= 0x5100)
michael@0 2356 #error "Sun C++ 5.10 or above"
michael@0 2357 #endif],
michael@0 2358 _ABOVE_SS12U1=,_ABOVE_SS12U1=1)
michael@0 2359 if test "$_ABOVE_SS12U1"; then
michael@0 2360 # disable xannotate
michael@0 2361 CXXFLAGS="$CXXFLAGS -xannotate=no"
michael@0 2362 fi
michael@0 2363 AC_MSG_RESULT([$_res])
michael@0 2364 AC_LANG_RESTORE
michael@0 2365 else
michael@0 2366 LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs"
michael@0 2367 LIBS="-lc $LIBS"
michael@0 2368 MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract'
michael@0 2369 MKSHLIB_UNFORCE_ALL='-Wl,-z -Wl,defaultextract'
michael@0 2370 ASFLAGS="$ASFLAGS -fPIC"
michael@0 2371 DSO_LDOPTS='-shared'
michael@0 2372 WARNINGS_AS_ERRORS='-Werror'
michael@0 2373 _WARNINGS_CFLAGS=''
michael@0 2374 _WARNINGS_CXXFLAGS=''
michael@0 2375 if test "$OS_RELEASE" = "5.3"; then
michael@0 2376 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
michael@0 2377 fi
michael@0 2378 fi
michael@0 2379 if test "$OS_RELEASE" = "5.5.1"; then
michael@0 2380 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
michael@0 2381 fi
michael@0 2382 ;;
michael@0 2383
michael@0 2384 *-sunos*)
michael@0 2385 DSO_LDOPTS='-Bdynamic'
michael@0 2386 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
michael@0 2387 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
michael@0 2388 AC_DEFINE(SUNOS4)
michael@0 2389 AC_DEFINE(SPRINTF_RETURNS_STRING)
michael@0 2390 case "$(target_os)" in
michael@0 2391 sunos4.1*)
michael@0 2392 DLL_SUFFIX='.so.1.0'
michael@0 2393 ;;
michael@0 2394 esac
michael@0 2395 ;;
michael@0 2396
michael@0 2397 esac
michael@0 2398
michael@0 2399 AC_SUBST_LIST(MMX_FLAGS)
michael@0 2400 AC_SUBST_LIST(SSE_FLAGS)
michael@0 2401 AC_SUBST_LIST(SSE2_FLAGS)
michael@0 2402
michael@0 2403 case "$target" in
michael@0 2404 *-*linux*)
michael@0 2405 # Includes linux-android
michael@0 2406 AC_DEFINE(XP_LINUX)
michael@0 2407 ;;
michael@0 2408 esac
michael@0 2409
michael@0 2410 AC_SUBST(MOZ_LINKER)
michael@0 2411 if test -n "$MOZ_LINKER"; then
michael@0 2412 AC_DEFINE(MOZ_LINKER)
michael@0 2413 fi
michael@0 2414
michael@0 2415 dnl Only one oddball right now (QNX), but this gives us flexibility
michael@0 2416 dnl if any other platforms need to override this in the future.
michael@0 2417 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
michael@0 2418
michael@0 2419 dnl ========================================================
michael@0 2420 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
michael@0 2421 dnl by now will not have any way to link most binaries (tests
michael@0 2422 dnl as well as viewer, apprunner, etc.), because some symbols
michael@0 2423 dnl will be left out of the "composite" .so's by ld as unneeded.
michael@0 2424 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
michael@0 2425 dnl they can link in the static libs that provide the missing
michael@0 2426 dnl symbols.
michael@0 2427 dnl ========================================================
michael@0 2428 NO_LD_ARCHIVE_FLAGS=
michael@0 2429 if test -z "$MKSHLIB_FORCE_ALL" -o -z "$MKSHLIB_UNFORCE_ALL"; then
michael@0 2430 NO_LD_ARCHIVE_FLAGS=1
michael@0 2431 fi
michael@0 2432 case "$target" in
michael@0 2433 *-aix4.3*|*-aix5*)
michael@0 2434 NO_LD_ARCHIVE_FLAGS=
michael@0 2435 ;;
michael@0 2436 *-mingw*)
michael@0 2437 if test -z "$GNU_CC"; then
michael@0 2438 NO_LD_ARCHIVE_FLAGS=
michael@0 2439 fi
michael@0 2440 ;;
michael@0 2441 esac
michael@0 2442 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
michael@0 2443
michael@0 2444 dnl ========================================================
michael@0 2445 dnl = Flags to strip unused symbols from .so components and
michael@0 2446 dnl = to export jemalloc symbols when linking a program
michael@0 2447 dnl ========================================================
michael@0 2448 case "$target" in
michael@0 2449 *-linux*|*-kfreebsd*-gnu|*-gnu*)
michael@0 2450 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
michael@0 2451 ;;
michael@0 2452 *-solaris*)
michael@0 2453 if test -z "$GNU_CC"; then
michael@0 2454 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
michael@0 2455 else
michael@0 2456 if test -z "$GCC_USE_GNU_LD"; then
michael@0 2457 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
michael@0 2458 else
michael@0 2459 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
michael@0 2460 fi
michael@0 2461 fi
michael@0 2462 ;;
michael@0 2463 *-darwin*)
michael@0 2464 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
michael@0 2465 ;;
michael@0 2466 *-mingw*)
michael@0 2467 if test -n "$GNU_CC"; then
michael@0 2468 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
michael@0 2469 fi
michael@0 2470 ;;
michael@0 2471 esac
michael@0 2472
michael@0 2473 if test -z "$COMPILE_ENVIRONMENT"; then
michael@0 2474 SKIP_COMPILER_CHECKS=1
michael@0 2475 SKIP_LIBRARY_CHECKS=1
michael@0 2476 else
michael@0 2477 MOZ_COMPILER_OPTS
michael@0 2478 fi
michael@0 2479
michael@0 2480 if test -z "$SKIP_COMPILER_CHECKS"; then
michael@0 2481 dnl Checks for typedefs, structures, and compiler characteristics.
michael@0 2482 dnl ========================================================
michael@0 2483 AC_HEADER_STDC
michael@0 2484 AC_C_CONST
michael@0 2485 AC_TYPE_MODE_T
michael@0 2486 AC_TYPE_OFF_T
michael@0 2487 AC_TYPE_PID_T
michael@0 2488 AC_TYPE_SIZE_T
michael@0 2489 AC_LANG_CPLUSPLUS
michael@0 2490 AC_LANG_C
michael@0 2491 AC_MSG_CHECKING(for ssize_t)
michael@0 2492 AC_CACHE_VAL(ac_cv_type_ssize_t,
michael@0 2493 [AC_TRY_COMPILE([#include <stdio.h>
michael@0 2494 #include <sys/types.h>],
michael@0 2495 [ssize_t foo = 0;],
michael@0 2496 [ac_cv_type_ssize_t=true],
michael@0 2497 [ac_cv_type_ssize_t=false])])
michael@0 2498 if test "$ac_cv_type_ssize_t" = true ; then
michael@0 2499 AC_DEFINE(HAVE_SSIZE_T)
michael@0 2500 AC_MSG_RESULT(yes)
michael@0 2501 else
michael@0 2502 AC_MSG_RESULT(no)
michael@0 2503 fi
michael@0 2504 AC_STRUCT_ST_BLKSIZE
michael@0 2505 AC_MSG_CHECKING(for siginfo_t)
michael@0 2506 AC_CACHE_VAL(ac_cv_siginfo_t,
michael@0 2507 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
michael@0 2508 #include <signal.h>],
michael@0 2509 [siginfo_t* info;],
michael@0 2510 [ac_cv_siginfo_t=true],
michael@0 2511 [ac_cv_siginfo_t=false])])
michael@0 2512 if test "$ac_cv_siginfo_t" = true ; then
michael@0 2513 AC_DEFINE(HAVE_SIGINFO_T)
michael@0 2514 AC_MSG_RESULT(yes)
michael@0 2515 else
michael@0 2516 AC_MSG_RESULT(no)
michael@0 2517 fi
michael@0 2518
michael@0 2519 AC_LANG_CPLUSPLUS
michael@0 2520
michael@0 2521 MOZ_CXX11
michael@0 2522
michael@0 2523 AC_LANG_C
michael@0 2524
michael@0 2525 dnl Check for .hidden assembler directive and visibility attribute.
michael@0 2526 dnl Borrowed from glibc configure.in
michael@0 2527 dnl ===============================================================
michael@0 2528 if test "$GNU_CC"; then
michael@0 2529 AC_CACHE_CHECK(for visibility(hidden) attribute,
michael@0 2530 ac_cv_visibility_hidden,
michael@0 2531 [cat > conftest.c <<EOF
michael@0 2532 int foo __attribute__ ((visibility ("hidden"))) = 1;
michael@0 2533 EOF
michael@0 2534 ac_cv_visibility_hidden=no
michael@0 2535 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
michael@0 2536 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
michael@0 2537 ac_cv_visibility_hidden=yes
michael@0 2538 fi
michael@0 2539 fi
michael@0 2540 rm -f conftest.[cs]
michael@0 2541 ])
michael@0 2542 if test "$ac_cv_visibility_hidden" = "yes"; then
michael@0 2543 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
michael@0 2544
michael@0 2545 AC_CACHE_CHECK(for visibility(default) attribute,
michael@0 2546 ac_cv_visibility_default,
michael@0 2547 [cat > conftest.c <<EOF
michael@0 2548 int foo __attribute__ ((visibility ("default"))) = 1;
michael@0 2549 EOF
michael@0 2550 ac_cv_visibility_default=no
michael@0 2551 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
michael@0 2552 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
michael@0 2553 ac_cv_visibility_default=yes
michael@0 2554 fi
michael@0 2555 fi
michael@0 2556 rm -f conftest.[cs]
michael@0 2557 ])
michael@0 2558 if test "$ac_cv_visibility_default" = "yes"; then
michael@0 2559 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
michael@0 2560
michael@0 2561 AC_CACHE_CHECK(for visibility pragma support,
michael@0 2562 ac_cv_visibility_pragma,
michael@0 2563 [cat > conftest.c <<EOF
michael@0 2564 #pragma GCC visibility push(hidden)
michael@0 2565 int foo_hidden = 1;
michael@0 2566 #pragma GCC visibility push(default)
michael@0 2567 int foo_default = 1;
michael@0 2568 EOF
michael@0 2569 ac_cv_visibility_pragma=no
michael@0 2570 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
michael@0 2571 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
michael@0 2572 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
michael@0 2573 ac_cv_visibility_pragma=yes
michael@0 2574 fi
michael@0 2575 fi
michael@0 2576 fi
michael@0 2577 rm -f conftest.[cs]
michael@0 2578 ])
michael@0 2579 if test "$ac_cv_visibility_pragma" = "yes"; then
michael@0 2580 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
michael@0 2581 ac_cv_have_visibility_class_bug,
michael@0 2582 [cat > conftest.c <<EOF
michael@0 2583 #pragma GCC visibility push(hidden)
michael@0 2584 struct __attribute__ ((visibility ("default"))) TestStruct {
michael@0 2585 static void Init();
michael@0 2586 };
michael@0 2587 __attribute__ ((visibility ("default"))) void TestFunc() {
michael@0 2588 TestStruct::Init();
michael@0 2589 }
michael@0 2590 EOF
michael@0 2591 ac_cv_have_visibility_class_bug=no
michael@0 2592 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
michael@0 2593 ac_cv_have_visibility_class_bug=yes
michael@0 2594 else
michael@0 2595 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
michael@0 2596 ac_cv_have_visibility_class_bug=yes
michael@0 2597 fi
michael@0 2598 fi
michael@0 2599 rm -rf conftest.{c,S}
michael@0 2600 ])
michael@0 2601
michael@0 2602 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
michael@0 2603 ac_cv_have_visibility_builtin_bug,
michael@0 2604 [cat > conftest.c <<EOF
michael@0 2605 #pragma GCC visibility push(hidden)
michael@0 2606 #pragma GCC visibility push(default)
michael@0 2607 #include <string.h>
michael@0 2608 #pragma GCC visibility pop
michael@0 2609
michael@0 2610 __attribute__ ((visibility ("default"))) void Func() {
michael@0 2611 char c[[100]];
michael@0 2612 memset(c, 0, sizeof(c));
michael@0 2613 }
michael@0 2614 EOF
michael@0 2615 ac_cv_have_visibility_builtin_bug=no
michael@0 2616 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
michael@0 2617 ac_cv_have_visibility_builtin_bug=yes
michael@0 2618 else
michael@0 2619 if test `grep -c "@PLT" conftest.S` = 0; then
michael@0 2620 ac_cv_visibility_builtin_bug=yes
michael@0 2621 fi
michael@0 2622 fi
michael@0 2623 rm -f conftest.{c,S}
michael@0 2624 ])
michael@0 2625 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
michael@0 2626 "$ac_cv_have_visibility_class_bug" = "no"; then
michael@0 2627 VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
michael@0 2628 WRAP_SYSTEM_INCLUDES=1
michael@0 2629 STL_FLAGS='-I$(DIST)/stl_wrappers'
michael@0 2630 WRAP_STL_INCLUDES=1
michael@0 2631 else
michael@0 2632 VISIBILITY_FLAGS='-fvisibility=hidden'
michael@0 2633 fi # have visibility pragma bug
michael@0 2634 fi # have visibility pragma
michael@0 2635 fi # have visibility(default) attribute
michael@0 2636 fi # have visibility(hidden) attribute
michael@0 2637 fi # GNU_CC
michael@0 2638
michael@0 2639 # visibility hidden flag for Sun Studio on Solaris
michael@0 2640 if test "$SOLARIS_SUNPRO_CC"; then
michael@0 2641 VISIBILITY_FLAGS='-xldscope=hidden'
michael@0 2642 fi # Sun Studio on Solaris
michael@0 2643
michael@0 2644 AC_SUBST(WRAP_SYSTEM_INCLUDES)
michael@0 2645 AC_SUBST(VISIBILITY_FLAGS)
michael@0 2646
michael@0 2647 MOZ_GCC_PR49911
michael@0 2648 MOZ_GCC_PR39608
michael@0 2649 if test "$OS_TARGET" != WINNT; then
michael@0 2650 # Only run this test with clang on non-Windows platforms, because clang
michael@0 2651 # cannot do enough code gen for now to make this test work correctly.
michael@0 2652 MOZ_LLVM_PR8927
michael@0 2653 fi
michael@0 2654
michael@0 2655 dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
michael@0 2656 dnl ========================================================
michael@0 2657 if test "$GNU_CC"; then
michael@0 2658 CFLAGS_save="${CFLAGS}"
michael@0 2659 CFLAGS="${CFLAGS} -Werror"
michael@0 2660 AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute,
michael@0 2661 ac_cv_force_align_arg_pointer,
michael@0 2662 [AC_TRY_COMPILE([__attribute__ ((__force_align_arg_pointer__)) void test() {}],
michael@0 2663 [],
michael@0 2664 ac_cv_force_align_arg_pointer="yes",
michael@0 2665 ac_cv_force_align_arg_pointer="no")])
michael@0 2666 CFLAGS="${CFLAGS_save}"
michael@0 2667 if test "$ac_cv_force_align_arg_pointer" = "yes"; then
michael@0 2668 HAVE_GCC_ALIGN_ARG_POINTER=1
michael@0 2669 else
michael@0 2670 HAVE_GCC_ALIGN_ARG_POINTER=
michael@0 2671 fi
michael@0 2672 fi
michael@0 2673 AC_SUBST(HAVE_GCC_ALIGN_ARG_POINTER)
michael@0 2674
michael@0 2675 dnl Checks for header files.
michael@0 2676 dnl ========================================================
michael@0 2677 AC_HEADER_DIRENT
michael@0 2678 case "$target_os" in
michael@0 2679 freebsd*|openbsd*)
michael@0 2680 # for stuff like -lXshm
michael@0 2681 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
michael@0 2682 ;;
michael@0 2683 esac
michael@0 2684 MOZ_CHECK_COMMON_HEADERS
michael@0 2685
michael@0 2686 dnl These are all the places some variant of statfs can be hiding.
michael@0 2687 MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
michael@0 2688
michael@0 2689 dnl Quota support
michael@0 2690 MOZ_CHECK_HEADERS(sys/quota.h sys/sysmacros.h)
michael@0 2691 MOZ_CHECK_HEADERS([linux/quota.h],,,[#include <sys/socket.h>])
michael@0 2692
michael@0 2693 dnl SCTP support - needs various network include headers
michael@0 2694 MOZ_CHECK_HEADERS([linux/if_addr.h linux/rtnetlink.h],,,[#include <sys/socket.h>])
michael@0 2695
michael@0 2696 MOZ_CHECK_HEADERS(sys/types.h netinet/in.h byteswap.h)
michael@0 2697
michael@0 2698 dnl Check for sin_len and sin6_len - used by SCTP; only appears in Mac/*BSD generally
michael@0 2699 AC_CACHE_CHECK(for sockaddr_in.sin_len,
michael@0 2700 ac_cv_sockaddr_in_sin_len,
michael@0 2701 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
michael@0 2702 #include <sys/types.h>
michael@0 2703 #endif
michael@0 2704 #include <netinet/in.h>
michael@0 2705 struct sockaddr_in x;
michael@0 2706 void *foo = (void*) &x.sin_len;],
michael@0 2707 [],
michael@0 2708 [ac_cv_sockaddr_in_sin_len=true],
michael@0 2709 [ac_cv_sockaddr_in_sin_len=false])])
michael@0 2710 if test "$ac_cv_sockaddr_in_sin_len" = true ; then
michael@0 2711 AC_DEFINE(HAVE_SIN_LEN)
michael@0 2712 dnl HAVE_CONN_LEN must be the same as HAVE_SIN_LEN (and HAVE_SIN6_LEN too)
michael@0 2713 AC_DEFINE(HAVE_SCONN_LEN)
michael@0 2714 fi
michael@0 2715
michael@0 2716 AC_CACHE_CHECK(for sockaddr_in6.sin6_len,
michael@0 2717 ac_cv_sockaddr_in6_sin6_len,
michael@0 2718 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
michael@0 2719 #include <sys/types.h>
michael@0 2720 #endif
michael@0 2721 #include <netinet/in.h>
michael@0 2722 struct sockaddr_in6 x;
michael@0 2723 void *foo = (void*) &x.sin6_len;],
michael@0 2724 [],
michael@0 2725 [ac_cv_sockaddr_in6_sin6_len=true],
michael@0 2726 [ac_cv_sockaddr_in6_sin6_len=false])])
michael@0 2727 if test "$ac_cv_sockaddr_in6_sin6_len" = true ; then
michael@0 2728 AC_DEFINE(HAVE_SIN6_LEN)
michael@0 2729 fi
michael@0 2730
michael@0 2731 AC_CACHE_CHECK(for sockaddr.sa_len,
michael@0 2732 ac_cv_sockaddr_sa_len,
michael@0 2733 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
michael@0 2734 #include <sys/types.h>
michael@0 2735 #endif
michael@0 2736 #include <sys/socket.h>
michael@0 2737 struct sockaddr x;
michael@0 2738 void *foo = (void*) &x.sa_len;],
michael@0 2739 [],
michael@0 2740 [ac_cv_sockaddr_sa_len=true],
michael@0 2741 [ac_cv_sockaddr_sa_len=false])])
michael@0 2742 if test "$ac_cv_sockaddr_sa_len" = true ; then
michael@0 2743 AC_DEFINE(HAVE_SA_LEN)
michael@0 2744 fi
michael@0 2745
michael@0 2746 AC_ARG_ENABLE(dtrace,
michael@0 2747 [ --enable-dtrace build with dtrace support if available (default=no)],
michael@0 2748 [enable_dtrace="yes"],)
michael@0 2749 if test "x$enable_dtrace" = "xyes"; then
michael@0 2750 MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
michael@0 2751 if test -n "$HAVE_DTRACE"; then
michael@0 2752 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
michael@0 2753 else
michael@0 2754 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
michael@0 2755 fi
michael@0 2756 fi
michael@0 2757 AC_SUBST(HAVE_DTRACE)
michael@0 2758
michael@0 2759 case $target in
michael@0 2760 *-aix4.3*|*-aix5*)
michael@0 2761 ;;
michael@0 2762 *)
michael@0 2763 MOZ_CHECK_HEADERS(sys/cdefs.h)
michael@0 2764 ;;
michael@0 2765 esac
michael@0 2766
michael@0 2767 MOZ_LINUX_PERF_EVENT
michael@0 2768
michael@0 2769 dnl Checks for libraries.
michael@0 2770 dnl ========================================================
michael@0 2771 case $target in
michael@0 2772 *-hpux11.*)
michael@0 2773 ;;
michael@0 2774 *)
michael@0 2775 AC_CHECK_LIB(c_r, gethostbyname_r)
michael@0 2776 ;;
michael@0 2777 esac
michael@0 2778
michael@0 2779 dnl We don't want to link with libdl even if it's present on OS X, since
michael@0 2780 dnl it's not used and not part of the default installation. OS/2 has dlfcn
michael@0 2781 dnl in libc.
michael@0 2782 dnl We don't want to link against libm or libpthread on Darwin since
michael@0 2783 dnl they both are just symlinks to libSystem and explicitly linking
michael@0 2784 dnl against libSystem causes issues when debugging (see bug 299601).
michael@0 2785 case $target in
michael@0 2786 *-darwin*)
michael@0 2787 ;;
michael@0 2788 *)
michael@0 2789 AC_SEARCH_LIBS(dlopen, dl,
michael@0 2790 MOZ_CHECK_HEADER(dlfcn.h,
michael@0 2791 AC_DEFINE(HAVE_DLOPEN)))
michael@0 2792 ;;
michael@0 2793 esac
michael@0 2794
michael@0 2795 _SAVE_CFLAGS="$CFLAGS"
michael@0 2796 CFLAGS="$CFLAGS -D_GNU_SOURCE"
michael@0 2797 AC_CHECK_FUNCS(dladdr memmem)
michael@0 2798 CFLAGS="$_SAVE_CFLAGS"
michael@0 2799
michael@0 2800 if test ! "$GNU_CXX"; then
michael@0 2801
michael@0 2802 case $target in
michael@0 2803 *-aix*)
michael@0 2804 AC_CHECK_LIB(C_r, demangle)
michael@0 2805 ;;
michael@0 2806 *)
michael@0 2807 AC_CHECK_LIB(C, demangle)
michael@0 2808 ;;
michael@0 2809 esac
michael@0 2810 fi
michael@0 2811
michael@0 2812 AC_CHECK_LIB(socket, socket)
michael@0 2813
michael@0 2814 XLDFLAGS="$X_LIBS"
michael@0 2815 XLIBS="$X_EXTRA_LIBS"
michael@0 2816
michael@0 2817 dnl ========================================================
michael@0 2818 dnl Checks for X libraries.
michael@0 2819 dnl Ordering is important.
michael@0 2820 dnl Xt is dependent upon SM as of X11R6
michael@0 2821 dnl ========================================================
michael@0 2822 if test "$no_x" = "yes"; then
michael@0 2823 AC_DEFINE(NO_X11)
michael@0 2824 else
michael@0 2825 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
michael@0 2826 XLIBS="-lX11 $XLIBS"
michael@0 2827 _SAVE_LDFLAGS="$LDFLAGS"
michael@0 2828 LDFLAGS="$XLDFLAGS $LDFLAGS"
michael@0 2829 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
michael@0 2830 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
michael@0 2831 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
michael@0 2832 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
michael@0 2833
michael@0 2834 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
michael@0 2835 unset ac_cv_lib_Xt_XtFree
michael@0 2836 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
michael@0 2837 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
michael@0 2838 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
michael@0 2839 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
michael@0 2840 ])
michael@0 2841
michael@0 2842 # AIX needs the motif library linked before libXt to prevent
michael@0 2843 # crashes in plugins linked against Motif - Bug #98892
michael@0 2844 case "${target_os}" in
michael@0 2845 aix*)
michael@0 2846 XT_LIBS="-lXm $XT_LIBS"
michael@0 2847 ;;
michael@0 2848 esac
michael@0 2849
michael@0 2850 dnl ========================================================
michael@0 2851 dnl = Check for XShm
michael@0 2852 dnl ========================================================
michael@0 2853 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
michael@0 2854 $XLIBS $XEXT_LIBS)
michael@0 2855
michael@0 2856 dnl ========================================================
michael@0 2857 dnl = Check for Xss
michael@0 2858 dnl ========================================================
michael@0 2859 MOZ_CHECK_HEADER(X11/extensions/scrnsaver.h,
michael@0 2860 AC_CHECK_LIB(Xss, XScreenSaverQueryInfo,
michael@0 2861 [XSS_LIBS="-lXss $XEXT_LIBS $XLIBS"
michael@0 2862 AC_DEFINE(HAVE_LIBXSS)],, $XEXT_LIBS $XLIBS))
michael@0 2863
michael@0 2864 LDFLAGS="$_SAVE_LDFLAGS"
michael@0 2865 fi # $no_x
michael@0 2866
michael@0 2867 AC_SUBST(XCFLAGS)
michael@0 2868 AC_SUBST(XLDFLAGS)
michael@0 2869 AC_SUBST(XLIBS)
michael@0 2870 AC_SUBST(XEXT_LIBS)
michael@0 2871 AC_SUBST(XT_LIBS)
michael@0 2872 AC_SUBST(XSS_LIBS)
michael@0 2873
michael@0 2874 dnl ========================================================
michael@0 2875 dnl = pthread support
michael@0 2876 dnl = Start by checking whether the system support pthreads
michael@0 2877 dnl ========================================================
michael@0 2878 case "$target_os" in
michael@0 2879 darwin*)
michael@0 2880 MOZ_USE_PTHREADS=1
michael@0 2881 ;;
michael@0 2882 *)
michael@0 2883 MOZ_CHECK_PTHREADS(pthreads,
michael@0 2884 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
michael@0 2885 MOZ_CHECK_PTHREADS(pthread,
michael@0 2886 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
michael@0 2887 MOZ_CHECK_PTHREADS(c_r,
michael@0 2888 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
michael@0 2889 MOZ_CHECK_PTHREADS(c,
michael@0 2890 MOZ_USE_PTHREADS=1
michael@0 2891 )
michael@0 2892 )
michael@0 2893 )
michael@0 2894 )
michael@0 2895 ;;
michael@0 2896 esac
michael@0 2897
michael@0 2898 dnl ========================================================
michael@0 2899 dnl Check the command line for --with-pthreads
michael@0 2900 dnl ========================================================
michael@0 2901 MOZ_ARG_WITH_BOOL(pthreads,
michael@0 2902 [ --with-pthreads Force use of system pthread library with NSPR ],
michael@0 2903 [ if test "$MOZ_USE_PTHREADS"x = x; then
michael@0 2904 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
michael@0 2905 fi],
michael@0 2906 MOZ_USE_PTHREADS=
michael@0 2907 _PTHREAD_LDFLAGS=
michael@0 2908 )
michael@0 2909
michael@0 2910 dnl ========================================================
michael@0 2911 dnl Do the platform specific pthread hackery
michael@0 2912 dnl ========================================================
michael@0 2913 if test "$MOZ_USE_PTHREADS"x != x
michael@0 2914 then
michael@0 2915 dnl
michael@0 2916 dnl See if -pthread is supported.
michael@0 2917 dnl
michael@0 2918 rm -f conftest*
michael@0 2919 ac_cv_have_dash_pthread=no
michael@0 2920 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
michael@0 2921 echo 'int main() { return 0; }' | cat > conftest.c
michael@0 2922 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
michael@0 2923 if test $? -eq 0; then
michael@0 2924 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
michael@0 2925 ac_cv_have_dash_pthread=yes
michael@0 2926 case "$target_os" in
michael@0 2927 freebsd*)
michael@0 2928 # Freebsd doesn't use -pthread for compiles, it uses them for linking
michael@0 2929 ;;
michael@0 2930 *)
michael@0 2931 CFLAGS="$CFLAGS -pthread"
michael@0 2932 CXXFLAGS="$CXXFLAGS -pthread"
michael@0 2933 ;;
michael@0 2934 esac
michael@0 2935 fi
michael@0 2936 fi
michael@0 2937 rm -f conftest*
michael@0 2938 AC_MSG_RESULT($ac_cv_have_dash_pthread)
michael@0 2939
michael@0 2940 dnl
michael@0 2941 dnl See if -pthreads is supported.
michael@0 2942 dnl
michael@0 2943 ac_cv_have_dash_pthreads=no
michael@0 2944 if test "$ac_cv_have_dash_pthread" = "no"; then
michael@0 2945 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
michael@0 2946 echo 'int main() { return 0; }' | cat > conftest.c
michael@0 2947 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
michael@0 2948 if test $? -eq 0; then
michael@0 2949 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
michael@0 2950 ac_cv_have_dash_pthreads=yes
michael@0 2951 CFLAGS="$CFLAGS -pthreads"
michael@0 2952 CXXFLAGS="$CXXFLAGS -pthreads"
michael@0 2953 fi
michael@0 2954 fi
michael@0 2955 rm -f conftest*
michael@0 2956 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
michael@0 2957 fi
michael@0 2958
michael@0 2959 case "$target" in
michael@0 2960 *-*-freebsd*)
michael@0 2961 AC_DEFINE(_REENTRANT)
michael@0 2962 AC_DEFINE(_THREAD_SAFE)
michael@0 2963 dnl -pthread links in -lpthread, so don't specify it explicitly.
michael@0 2964 if test "$ac_cv_have_dash_pthread" = "yes"; then
michael@0 2965 _PTHREAD_LDFLAGS="-pthread"
michael@0 2966 fi
michael@0 2967 ;;
michael@0 2968
michael@0 2969 *-*-openbsd*|*-*-bsdi*)
michael@0 2970 AC_DEFINE(_REENTRANT)
michael@0 2971 AC_DEFINE(_THREAD_SAFE)
michael@0 2972 dnl -pthread links in -lc_r, so don't specify it explicitly.
michael@0 2973 if test "$ac_cv_have_dash_pthread" = "yes"; then
michael@0 2974 _PTHREAD_LDFLAGS="-pthread"
michael@0 2975 fi
michael@0 2976 ;;
michael@0 2977
michael@0 2978 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
michael@0 2979 AC_DEFINE(_REENTRANT)
michael@0 2980 ;;
michael@0 2981
michael@0 2982 *-aix4.3*|*-aix5*)
michael@0 2983 AC_DEFINE(_REENTRANT)
michael@0 2984 ;;
michael@0 2985
michael@0 2986 *-hpux11.*)
michael@0 2987 AC_DEFINE(_REENTRANT)
michael@0 2988 ;;
michael@0 2989
michael@0 2990 *-*-solaris*)
michael@0 2991 AC_DEFINE(_REENTRANT)
michael@0 2992 if test "$SOLARIS_SUNPRO_CC"; then
michael@0 2993 CFLAGS="$CFLAGS -mt"
michael@0 2994 CXXFLAGS="$CXXFLAGS -mt"
michael@0 2995 fi
michael@0 2996 ;;
michael@0 2997 esac
michael@0 2998 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
michael@0 2999 AC_SUBST(MOZ_USE_PTHREADS)
michael@0 3000 fi
michael@0 3001
michael@0 3002
michael@0 3003 dnl Checks for library functions.
michael@0 3004 dnl ========================================================
michael@0 3005 AC_PROG_GCC_TRADITIONAL
michael@0 3006 AC_FUNC_MEMCMP
michael@0 3007 AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r)
michael@0 3008
michael@0 3009 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
michael@0 3010 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
michael@0 3011 ac_cv_clock_monotonic,
michael@0 3012 [for libs in "" -lrt; do
michael@0 3013 _SAVE_LIBS="$LIBS"
michael@0 3014 LIBS="$LIBS $libs"
michael@0 3015 AC_TRY_LINK([#include <time.h>],
michael@0 3016 [ struct timespec ts;
michael@0 3017 clock_gettime(CLOCK_MONOTONIC, &ts); ],
michael@0 3018 ac_cv_clock_monotonic=$libs
michael@0 3019 LIBS="$_SAVE_LIBS"
michael@0 3020 break,
michael@0 3021 ac_cv_clock_monotonic=no)
michael@0 3022 LIBS="$_SAVE_LIBS"
michael@0 3023 done])
michael@0 3024 if test "$ac_cv_clock_monotonic" != "no"; then
michael@0 3025 HAVE_CLOCK_MONOTONIC=1
michael@0 3026 REALTIME_LIBS=$ac_cv_clock_monotonic
michael@0 3027 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
michael@0 3028 AC_SUBST(HAVE_CLOCK_MONOTONIC)
michael@0 3029 AC_SUBST(REALTIME_LIBS)
michael@0 3030 fi
michael@0 3031
michael@0 3032 dnl check for wcrtomb/mbrtowc
michael@0 3033 dnl =======================================================================
michael@0 3034 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
michael@0 3035 AC_LANG_SAVE
michael@0 3036 AC_LANG_CPLUSPLUS
michael@0 3037 AC_CACHE_CHECK(for wcrtomb,
michael@0 3038 ac_cv_have_wcrtomb,
michael@0 3039 [AC_TRY_LINK([#include <wchar.h>],
michael@0 3040 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
michael@0 3041 ac_cv_have_wcrtomb="yes",
michael@0 3042 ac_cv_have_wcrtomb="no")])
michael@0 3043 if test "$ac_cv_have_wcrtomb" = "yes"; then
michael@0 3044 AC_DEFINE(HAVE_WCRTOMB)
michael@0 3045 fi
michael@0 3046 AC_CACHE_CHECK(for mbrtowc,
michael@0 3047 ac_cv_have_mbrtowc,
michael@0 3048 [AC_TRY_LINK([#include <wchar.h>],
michael@0 3049 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
michael@0 3050 ac_cv_have_mbrtowc="yes",
michael@0 3051 ac_cv_have_mbrtowc="no")])
michael@0 3052 if test "$ac_cv_have_mbrtowc" = "yes"; then
michael@0 3053 AC_DEFINE(HAVE_MBRTOWC)
michael@0 3054 fi
michael@0 3055 AC_LANG_RESTORE
michael@0 3056 fi
michael@0 3057
michael@0 3058 AC_CACHE_CHECK(
michael@0 3059 [for res_ninit()],
michael@0 3060 ac_cv_func_res_ninit,
michael@0 3061 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
michael@0 3062 dnl no need for res_ninit() on NetBSD and OpenBSD
michael@0 3063 ac_cv_func_res_ninit=no
michael@0 3064 else
michael@0 3065 AC_TRY_LINK([
michael@0 3066 #ifdef linux
michael@0 3067 #define _BSD_SOURCE 1
michael@0 3068 #endif
michael@0 3069 #include <sys/types.h>
michael@0 3070 #include <netinet/in.h>
michael@0 3071 #include <arpa/nameser.h>
michael@0 3072 #include <resolv.h>
michael@0 3073 ],
michael@0 3074 [int foo = res_ninit(&_res);],
michael@0 3075 [ac_cv_func_res_ninit=yes],
michael@0 3076 [ac_cv_func_res_ninit=no])
michael@0 3077 fi
michael@0 3078 ])
michael@0 3079
michael@0 3080 if test "$ac_cv_func_res_ninit" = "yes"; then
michael@0 3081 AC_DEFINE(HAVE_RES_NINIT)
michael@0 3082 dnl must add the link line we do something as foolish as this... dougt
michael@0 3083 dnl else
michael@0 3084 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
michael@0 3085 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
michael@0 3086 fi
michael@0 3087
michael@0 3088 AC_LANG_CPLUSPLUS
michael@0 3089
michael@0 3090 case $target_os in
michael@0 3091 darwin*|mingw*)
michael@0 3092 ;;
michael@0 3093 *)
michael@0 3094
michael@0 3095 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
michael@0 3096 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
michael@0 3097 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
michael@0 3098 _SAVE_LIBS=$LIBS
michael@0 3099 LIBS="$LIBS $_ICONV_LIBS"
michael@0 3100 AC_CACHE_CHECK(
michael@0 3101 [for iconv()],
michael@0 3102 ac_cv_func_iconv,
michael@0 3103 [AC_TRY_LINK([
michael@0 3104 #include <stdlib.h>
michael@0 3105 #include <iconv.h>
michael@0 3106 ],
michael@0 3107 [
michael@0 3108 iconv_t h = iconv_open("", "");
michael@0 3109 iconv(h, NULL, NULL, NULL, NULL);
michael@0 3110 iconv_close(h);
michael@0 3111 ],
michael@0 3112 [ac_cv_func_iconv=yes],
michael@0 3113 [ac_cv_func_iconv=no]
michael@0 3114 )]
michael@0 3115 )
michael@0 3116 if test "$ac_cv_func_iconv" = "yes"; then
michael@0 3117 AC_DEFINE(HAVE_ICONV)
michael@0 3118 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
michael@0 3119 LIBICONV="$_ICONV_LIBS"
michael@0 3120 AC_CACHE_CHECK(
michael@0 3121 [for iconv() with const input],
michael@0 3122 ac_cv_func_const_iconv,
michael@0 3123 [AC_TRY_COMPILE([
michael@0 3124 #include <stdlib.h>
michael@0 3125 #include <iconv.h>
michael@0 3126 ],
michael@0 3127 [
michael@0 3128 const char *input = "testing";
michael@0 3129 iconv_t h = iconv_open("", "");
michael@0 3130 iconv(h, &input, NULL, NULL, NULL);
michael@0 3131 iconv_close(h);
michael@0 3132 ],
michael@0 3133 [ac_cv_func_const_iconv=yes],
michael@0 3134 [ac_cv_func_const_iconv=no]
michael@0 3135 )]
michael@0 3136 )
michael@0 3137 if test "$ac_cv_func_const_iconv" = "yes"; then
michael@0 3138 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
michael@0 3139 fi
michael@0 3140 fi
michael@0 3141 LIBS=$_SAVE_LIBS
michael@0 3142
michael@0 3143 ;;
michael@0 3144 esac
michael@0 3145
michael@0 3146 AM_LANGINFO_CODESET
michael@0 3147
michael@0 3148 AC_LANG_C
michael@0 3149
michael@0 3150 dnl **********************
michael@0 3151 dnl *** va_copy checks ***
michael@0 3152 AC_CACHE_CHECK([for an implementation of va_copy()],
michael@0 3153 ac_cv_va_copy,
michael@0 3154 [AC_TRY_COMPILE([#include <stdarg.h>
michael@0 3155 #include <stdlib.h>
michael@0 3156 void f (int i, ...) {
michael@0 3157 va_list args1, args2;
michael@0 3158 va_start (args1, i);
michael@0 3159 va_copy (args2, args1);
michael@0 3160 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
michael@0 3161 exit (1);
michael@0 3162 va_end (args1); va_end (args2);
michael@0 3163 }],
michael@0 3164 [f(0, 42); return 0],
michael@0 3165 [ac_cv_va_copy=yes],
michael@0 3166 [ac_cv_va_copy=no]
michael@0 3167 )]
michael@0 3168 )
michael@0 3169 AC_CACHE_CHECK([whether va_list can be copied by value],
michael@0 3170 ac_cv_va_val_copy,
michael@0 3171 [AC_TRY_COMPILE([#include <stdarg.h>
michael@0 3172 #include <stdlib.h>
michael@0 3173 void f (int i, ...) {
michael@0 3174 va_list args1, args2;
michael@0 3175 va_start (args1, i);
michael@0 3176 args2 = args1;
michael@0 3177 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
michael@0 3178 exit (1);
michael@0 3179 va_end (args1); va_end (args2);
michael@0 3180 }],
michael@0 3181 [f(0, 42); return 0],
michael@0 3182 [ac_cv_va_val_copy=yes],
michael@0 3183 [ac_cv_va_val_copy=no],
michael@0 3184 )]
michael@0 3185 )
michael@0 3186 if test "x$ac_cv_va_copy" = "xyes"; then
michael@0 3187 AC_DEFINE(VA_COPY, va_copy)
michael@0 3188 AC_DEFINE(HAVE_VA_COPY)
michael@0 3189 fi
michael@0 3190
michael@0 3191 if test "x$ac_cv_va_val_copy" = "xno"; then
michael@0 3192 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
michael@0 3193 fi
michael@0 3194
michael@0 3195 dnl ===================================================================
michael@0 3196 dnl ========================================================
michael@0 3197 dnl Put your C++ language/feature checks below
michael@0 3198 dnl ========================================================
michael@0 3199 AC_LANG_CPLUSPLUS
michael@0 3200
michael@0 3201 ARM_ABI_PREFIX=
michael@0 3202 if test "$GNU_CC"; then
michael@0 3203 if test "$CPU_ARCH" = "arm" ; then
michael@0 3204 AC_CACHE_CHECK(for ARM EABI,
michael@0 3205 ac_cv_gcc_arm_eabi,
michael@0 3206 [AC_TRY_COMPILE([],
michael@0 3207 [
michael@0 3208 #if defined(__ARM_EABI__)
michael@0 3209 return 0;
michael@0 3210 #else
michael@0 3211 #error Not ARM EABI.
michael@0 3212 #endif
michael@0 3213 ],
michael@0 3214 ac_cv_gcc_arm_eabi="yes",
michael@0 3215 ac_cv_gcc_arm_eabi="no")])
michael@0 3216 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
michael@0 3217 HAVE_ARM_EABI=1
michael@0 3218 ARM_ABI_PREFIX=eabi-
michael@0 3219 else
michael@0 3220 ARM_ABI_PREFIX=oabi-
michael@0 3221 fi
michael@0 3222 fi
michael@0 3223
michael@0 3224 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
michael@0 3225 fi
michael@0 3226
michael@0 3227 dnl Check to see if we can resolve ambiguity with |using|.
michael@0 3228 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
michael@0 3229 ac_cv_cpp_ambiguity_resolving_using,
michael@0 3230 [AC_TRY_COMPILE(class X {
michael@0 3231 public: int go(const X&) {return 3;}
michael@0 3232 int jo(const X&) {return 3;}
michael@0 3233 };
michael@0 3234 class Y : public X {
michael@0 3235 public: int go(int) {return 2;}
michael@0 3236 int jo(int) {return 2;}
michael@0 3237 using X::jo;
michael@0 3238 private: using X::go;
michael@0 3239 };,
michael@0 3240 X x; Y y; y.jo(x);,
michael@0 3241 ac_cv_cpp_ambiguity_resolving_using=yes,
michael@0 3242 ac_cv_cpp_ambiguity_resolving_using=no)])
michael@0 3243 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
michael@0 3244 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
michael@0 3245 fi
michael@0 3246
michael@0 3247 dnl See if a dynamic_cast to void* gives the most derived object.
michael@0 3248 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
michael@0 3249 ac_cv_cpp_dynamic_cast_void_ptr,
michael@0 3250 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
michael@0 3251 class Y { int j; public: virtual ~Y() { } };
michael@0 3252 class Z : public X, public Y { int k; };
michael@0 3253
michael@0 3254 int main() {
michael@0 3255 Z mdo;
michael@0 3256 X *subx = (X*)&mdo;
michael@0 3257 Y *suby = (Y*)&mdo;
michael@0 3258 return !((((void*)&mdo != (void*)subx) &&
michael@0 3259 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
michael@0 3260 (((void*)&mdo != (void*)suby) &&
michael@0 3261 ((void*)&mdo == dynamic_cast<void*>(suby))));
michael@0 3262 }],
michael@0 3263 ac_cv_cpp_dynamic_cast_void_ptr=yes,
michael@0 3264 ac_cv_cpp_dynamic_cast_void_ptr=no,
michael@0 3265 ac_cv_cpp_dynamic_cast_void_ptr=no)])
michael@0 3266 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
michael@0 3267 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
michael@0 3268 fi
michael@0 3269
michael@0 3270
michael@0 3271 dnl note that this one is reversed - if the test fails, then
michael@0 3272 dnl we require implementations of unused virtual methods. Which
michael@0 3273 dnl really blows because it means we'll have useless vtable
michael@0 3274 dnl bloat.
michael@0 3275 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
michael@0 3276 ac_cv_cpp_unused_required,
michael@0 3277 [AC_TRY_LINK(class X {private: virtual void never_called();};,
michael@0 3278 X x;,
michael@0 3279 ac_cv_cpp_unused_required=no,
michael@0 3280 ac_cv_cpp_unused_required=yes)])
michael@0 3281 if test "$ac_cv_cpp_unused_required" = yes ; then
michael@0 3282 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
michael@0 3283 fi
michael@0 3284
michael@0 3285
michael@0 3286 dnl Some compilers have trouble comparing a constant reference to a templatized
michael@0 3287 dnl class to zero, and require an explicit operator==() to be defined that takes
michael@0 3288 dnl an int. This test separates the strong from the weak.
michael@0 3289
michael@0 3290 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
michael@0 3291 ac_cv_trouble_comparing_to_zero,
michael@0 3292 [AC_TRY_COMPILE([#include <algorithm>
michael@0 3293 template <class T> class Foo {};
michael@0 3294 class T2;
michael@0 3295 template <class T> int operator==(const T2*, const T&) { return 0; }
michael@0 3296 template <class T> int operator!=(const T2*, const T&) { return 0; }],
michael@0 3297 [Foo<int> f; return (0 != f);],
michael@0 3298 ac_cv_trouble_comparing_to_zero=no,
michael@0 3299 ac_cv_trouble_comparing_to_zero=yes)])
michael@0 3300 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
michael@0 3301 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
michael@0 3302 fi
michael@0 3303
michael@0 3304 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
michael@0 3305 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
michael@0 3306 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
michael@0 3307 # linking XUL.
michael@0 3308 _SAVE_LDFLAGS=$LDFLAGS
michael@0 3309 LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
michael@0 3310 AC_CACHE_CHECK(for __thread keyword for TLS variables,
michael@0 3311 ac_cv_thread_keyword,
michael@0 3312 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
michael@0 3313 [return tlsIsMainThread;],
michael@0 3314 ac_cv_thread_keyword=yes,
michael@0 3315 ac_cv_thread_keyword=no)])
michael@0 3316 LDFLAGS=$_SAVE_LDFLAGS
michael@0 3317 # The custom dynamic linker doesn't support TLS variables
michael@0 3318 MOZ_TLS=
michael@0 3319 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
michael@0 3320 # mips builds fail with TLS variables because of a binutils bug.
michael@0 3321 # See bug 528687
michael@0 3322 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
michael@0 3323 case "${target}" in
michael@0 3324 mips*-*)
michael@0 3325 :
michael@0 3326 ;;
michael@0 3327 *-android*|*-linuxandroid*)
michael@0 3328 :
michael@0 3329 ;;
michael@0 3330 *-openbsd*)
michael@0 3331 :
michael@0 3332 ;;
michael@0 3333 *)
michael@0 3334 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
michael@0 3335 MOZ_TLS=1
michael@0 3336 ;;
michael@0 3337 esac
michael@0 3338 fi
michael@0 3339
michael@0 3340 dnl Using the custom linker on ARMv6 requires 16k alignment of ELF segments.
michael@0 3341 if test -n "$MOZ_LINKER"; then
michael@0 3342 if test "$CPU_ARCH" = arm; then
michael@0 3343 dnl When building for < ARMv7, we need to ensure 16k alignment of ELF segments
michael@0 3344 if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then
michael@0 3345 LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000"
michael@0 3346 _SUBDIR_LDFLAGS="$_SUBDIR_LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000"
michael@0 3347 fi
michael@0 3348 fi
michael@0 3349 fi
michael@0 3350
michael@0 3351 dnl The custom linker doesn't support text relocations, but NDK >= r6b
michael@0 3352 dnl creates some (http://code.google.com/p/android/issues/detail?id=23203)
michael@0 3353 dnl We however want to avoid these text relocations, and this can be done
michael@0 3354 dnl by making gcc not link crtbegin and crtend. In the broken NDKs, crtend
michael@0 3355 dnl doesn't contain anything at all, beside placeholders for some sections,
michael@0 3356 dnl and crtbegin only contains a finalizer function that calls
michael@0 3357 dnl __cxa_finalize. The custom linker actually takes care of calling
michael@0 3358 dnl __cxa_finalize when the library doesn't call it itself, which makes it
michael@0 3359 dnl safe not to link crtbegin. Besides, previous versions of the NDK didn't
michael@0 3360 dnl link crtbegin and crtend at all.
michael@0 3361 if test -n "$MOZ_LINKER" -a "$OS_TARGET" = "Android"; then
michael@0 3362 AC_CACHE_CHECK([whether the CRT objects have text relocations],
michael@0 3363 ac_cv_crt_has_text_relocations,
michael@0 3364 [echo 'int foo() { return 0; }' > conftest.cpp
michael@0 3365 if AC_TRY_COMMAND(${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5) &&
michael@0 3366 test -s conftest${DLL_SUFFIX}; then
michael@0 3367 if ${TOOLCHAIN_PREFIX}readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then
michael@0 3368 ac_cv_crt_has_text_relocations=yes
michael@0 3369 else
michael@0 3370 ac_cv_crt_has_text_relocations=no
michael@0 3371 fi
michael@0 3372 else
michael@0 3373 AC_ERROR([couldn't compile a simple C file])
michael@0 3374 fi
michael@0 3375 rm -rf conftest*])
michael@0 3376 if test "$ac_cv_crt_has_text_relocations" = yes; then
michael@0 3377 dnl While we want libraries to skip the CRT files, we don't want
michael@0 3378 dnl executables to be treated the same way. We thus set the flag
michael@0 3379 dnl in DSO_LDOPTS and not LDFLAGS. However, to pass it to nspr,
michael@0 3380 dnl we need to use LDFLAGS because nspr doesn't inherit DSO_LDOPTS.
michael@0 3381 dnl Using LDFLAGS in nspr is safe, since we only really build
michael@0 3382 dnl libraries there.
michael@0 3383 DSO_LDOPTS="$DSO_LDOPTS -nostartfiles"
michael@0 3384 NSPR_LDFLAGS="$NSPR_LDFLAGS -nostartfiles"
michael@0 3385 fi
michael@0 3386 fi
michael@0 3387
michael@0 3388 dnl Check for the existence of various allocation headers/functions
michael@0 3389
michael@0 3390 MALLOC_HEADERS="malloc.h malloc_np.h malloc/malloc.h sys/malloc.h"
michael@0 3391 MALLOC_H=
michael@0 3392
michael@0 3393 for file in $MALLOC_HEADERS; do
michael@0 3394 MOZ_CHECK_HEADER($file, [MALLOC_H=$file])
michael@0 3395 if test "$MALLOC_H" != ""; then
michael@0 3396 AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
michael@0 3397 break
michael@0 3398 fi
michael@0 3399 done
michael@0 3400
michael@0 3401 AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)
michael@0 3402
michael@0 3403 AC_CHECK_FUNCS(malloc_usable_size)
michael@0 3404
michael@0 3405 dnl See if compiler supports some gcc-style attributes
michael@0 3406
michael@0 3407 AC_CACHE_CHECK(for __attribute__((always_inline)),
michael@0 3408 ac_cv_attribute_always_inline,
michael@0 3409 [AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
michael@0 3410 [],
michael@0 3411 ac_cv_attribute_always_inline=yes,
michael@0 3412 ac_cv_attribute_always_inline=no)])
michael@0 3413
michael@0 3414 AC_CACHE_CHECK(for __attribute__((malloc)),
michael@0 3415 ac_cv_attribute_malloc,
michael@0 3416 [AC_TRY_COMPILE([void* f(int) __attribute__((malloc));],
michael@0 3417 [],
michael@0 3418 ac_cv_attribute_malloc=yes,
michael@0 3419 ac_cv_attribute_malloc=no)])
michael@0 3420
michael@0 3421 AC_CACHE_CHECK(for __attribute__((warn_unused_result)),
michael@0 3422 ac_cv_attribute_warn_unused,
michael@0 3423 [AC_TRY_COMPILE([int f(void) __attribute__((warn_unused_result));],
michael@0 3424 [],
michael@0 3425 ac_cv_attribute_warn_unused=yes,
michael@0 3426 ac_cv_attribute_warn_unused=no)])
michael@0 3427
michael@0 3428 dnl End of C++ language/feature checks
michael@0 3429 AC_LANG_C
michael@0 3430
michael@0 3431 dnl ========================================================
michael@0 3432 dnl = Internationalization checks
michael@0 3433 dnl ========================================================
michael@0 3434 dnl
michael@0 3435 dnl Internationalization and Locale support is different
michael@0 3436 dnl on various UNIX platforms. Checks for specific i18n
michael@0 3437 dnl features go here.
michael@0 3438
michael@0 3439 dnl check for LC_MESSAGES
michael@0 3440 AC_CACHE_CHECK(for LC_MESSAGES,
michael@0 3441 ac_cv_i18n_lc_messages,
michael@0 3442 [AC_TRY_COMPILE([#include <locale.h>],
michael@0 3443 [int category = LC_MESSAGES;],
michael@0 3444 ac_cv_i18n_lc_messages=yes,
michael@0 3445 ac_cv_i18n_lc_messages=no)])
michael@0 3446 if test "$ac_cv_i18n_lc_messages" = yes; then
michael@0 3447 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
michael@0 3448 fi
michael@0 3449
michael@0 3450 AC_HAVE_FUNCS(localeconv)
michael@0 3451 fi # ! SKIP_COMPILER_CHECKS
michael@0 3452
michael@0 3453 TARGET_XPCOM_ABI=
michael@0 3454 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
michael@0 3455 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
michael@0 3456 fi
michael@0 3457
michael@0 3458 dnl Mozilla specific options
michael@0 3459 dnl ========================================================
michael@0 3460 dnl The macros used for command line options
michael@0 3461 dnl are defined in build/autoconf/altoptions.m4.
michael@0 3462
michael@0 3463 dnl If the compiler supports these attributes, define them as
michael@0 3464 dnl convenience macros.
michael@0 3465 if test "$ac_cv_attribute_malloc" = yes ; then
michael@0 3466 AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))])
michael@0 3467 else
michael@0 3468 AC_DEFINE(NS_ATTR_MALLOC,)
michael@0 3469 fi
michael@0 3470
michael@0 3471 if test "$ac_cv_attribute_warn_unused" = yes ; then
michael@0 3472 AC_DEFINE(NS_WARN_UNUSED_RESULT, [__attribute__((warn_unused_result))])
michael@0 3473 else
michael@0 3474 AC_DEFINE(NS_WARN_UNUSED_RESULT,)
michael@0 3475 fi
michael@0 3476
michael@0 3477 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
michael@0 3478 dnl features that Windows actually does support.
michael@0 3479
michael@0 3480 if test -n "$SKIP_COMPILER_CHECKS"; then
michael@0 3481 dnl Windows has malloc.h
michael@0 3482 AC_DEFINE(MALLOC_H, [<malloc.h>])
michael@0 3483 AC_DEFINE(HAVE_FORCEINLINE)
michael@0 3484 AC_DEFINE(HAVE_LOCALECONV)
michael@0 3485 fi # SKIP_COMPILER_CHECKS
michael@0 3486
michael@0 3487 dnl ========================================================
michael@0 3488 dnl =
michael@0 3489 dnl = Check for external package dependencies
michael@0 3490 dnl =
michael@0 3491 dnl ========================================================
michael@0 3492 MOZ_ARG_HEADER(External Packages)
michael@0 3493
michael@0 3494 MOZ_ARG_WITH_STRING(libxul-sdk,
michael@0 3495 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
michael@0 3496 LIBXUL_SDK_DIR=$withval)
michael@0 3497
michael@0 3498 if test "$LIBXUL_SDK_DIR" = "yes"; then
michael@0 3499 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
michael@0 3500 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
michael@0 3501 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
michael@0 3502
michael@0 3503 if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
michael@0 3504 AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
michael@0 3505 fi
michael@0 3506
michael@0 3507 fi
michael@0 3508 AC_SUBST(LIBXUL_SDK)
michael@0 3509
michael@0 3510 if test -n "$LIBXUL_SDK"; then
michael@0 3511 LIBXUL_DIST="$LIBXUL_SDK"
michael@0 3512 else
michael@0 3513 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
michael@0 3514 fi
michael@0 3515 AC_SUBST(LIBXUL_DIST)
michael@0 3516
michael@0 3517 SYSTEM_LIBXUL=
michael@0 3518
michael@0 3519 MOZ_ARG_WITH_BOOL(system-libxul,
michael@0 3520 [ --with-system-libxul Use system installed libxul SDK],
michael@0 3521 SYSTEM_LIBXUL=1)
michael@0 3522
michael@0 3523 dnl ========================================================
michael@0 3524 dnl = If NSPR was not detected in the system,
michael@0 3525 dnl = use the one in the source tree (mozilla/nsprpub)
michael@0 3526 dnl ========================================================
michael@0 3527 MOZ_ARG_WITH_BOOL(system-nspr,
michael@0 3528 [ --with-system-nspr Use system installed NSPR],
michael@0 3529 _USE_SYSTEM_NSPR=1 )
michael@0 3530
michael@0 3531 if test -n "$_USE_SYSTEM_NSPR"; then
michael@0 3532 AM_PATH_NSPR(4.10.6, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
michael@0 3533 fi
michael@0 3534
michael@0 3535 if test -n "$MOZ_NATIVE_NSPR"; then
michael@0 3536 _SAVE_CFLAGS=$CFLAGS
michael@0 3537 CFLAGS="$CFLAGS $NSPR_CFLAGS"
michael@0 3538 AC_TRY_COMPILE([#include "prtypes.h"],
michael@0 3539 [#ifndef PR_STATIC_ASSERT
michael@0 3540 #error PR_STATIC_ASSERT not defined or requires including prtypes.h
michael@0 3541 #endif],
michael@0 3542 [MOZ_NATIVE_NSPR=1],
michael@0 3543 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it]))
michael@0 3544 AC_TRY_COMPILE([#include "prtypes.h"],
michael@0 3545 [#ifndef PR_UINT64
michael@0 3546 #error PR_UINT64 not defined or requires including prtypes.h
michael@0 3547 #endif],
michael@0 3548 [MOZ_NATIVE_NSPR=1],
michael@0 3549 AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
michael@0 3550 CFLAGS=$_SAVE_CFLAGS
michael@0 3551 else
michael@0 3552 if test -z "$LIBXUL_SDK"; then
michael@0 3553 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
michael@0 3554 if test -n "$GNU_CC"; then
michael@0 3555 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
michael@0 3556 else
michael@0 3557 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
michael@0 3558 fi
michael@0 3559 else
michael@0 3560 NSPR_CFLAGS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --includedir="${LIBXUL_DIST}/include/nspr" --cflags`
michael@0 3561 NSPR_LIBS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --libdir="${LIBXUL_DIST}"/lib --libs`
michael@0 3562 fi
michael@0 3563 fi
michael@0 3564
michael@0 3565 dnl set GRE_MILESTONE
michael@0 3566 dnl ========================================================
michael@0 3567 if test -n "$LIBXUL_SDK"; then
michael@0 3568 GRE_MILESTONE=`$PYTHON "$_topsrcdir"/config/printconfigsetting.py "$LIBXUL_DIST"/bin/platform.ini Build Milestone`
michael@0 3569 else
michael@0 3570 GRE_MILESTONE=`tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt`
michael@0 3571 fi
michael@0 3572 AC_SUBST(GRE_MILESTONE)
michael@0 3573
michael@0 3574 # set RELEASE_BUILD and NIGHTLY_BUILD variables depending on the cycle we're in
michael@0 3575 # The logic works like this:
michael@0 3576 # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
michael@0 3577 # - otherwise, we're building Release/Beta (define RELEASE_BUILD)
michael@0 3578 case "$GRE_MILESTONE" in
michael@0 3579 *a1*)
michael@0 3580 NIGHTLY_BUILD=1
michael@0 3581 AC_DEFINE(NIGHTLY_BUILD)
michael@0 3582 ;;
michael@0 3583 *)
michael@0 3584 RELEASE_BUILD=1
michael@0 3585 AC_DEFINE(RELEASE_BUILD)
michael@0 3586 ;;
michael@0 3587 esac
michael@0 3588 AC_SUBST(NIGHTLY_BUILD)
michael@0 3589 AC_SUBST(RELEASE_BUILD)
michael@0 3590
michael@0 3591 dnl ========================================================
michael@0 3592 dnl Disable compiling sources in unified mode.
michael@0 3593 dnl ========================================================
michael@0 3594
michael@0 3595 if test -z "$NIGHTLY_BUILD"; then
michael@0 3596 MOZ_DISABLE_UNIFIED_COMPILATION=1
michael@0 3597 fi
michael@0 3598
michael@0 3599 MOZ_ARG_DISABLE_BOOL(unified-compilation,
michael@0 3600 [ --disable-unified-compilation
michael@0 3601 Disable unified compilation of some C/C++ sources],
michael@0 3602 MOZ_DISABLE_UNIFIED_COMPILATION=1,
michael@0 3603 MOZ_DISABLE_UNIFIED_COMPILATION=)
michael@0 3604 AC_SUBST(MOZ_DISABLE_UNIFIED_COMPILATION)
michael@0 3605
michael@0 3606 dnl system libevent Support
michael@0 3607 dnl ========================================================
michael@0 3608 MOZ_ARG_WITH_STRING(system-libevent,
michael@0 3609 [ --with-system-libevent[=PFX]
michael@0 3610 Use system libevent [installed at prefix PFX]],
michael@0 3611 LIBEVENT_DIR=$withval)
michael@0 3612
michael@0 3613 _SAVE_CFLAGS=$CFLAGS
michael@0 3614 _SAVE_LDFLAGS=$LDFLAGS
michael@0 3615 _SAVE_LIBS=$LIBS
michael@0 3616 if test "$LIBEVENT_DIR" = yes; then
michael@0 3617 PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
michael@0 3618 MOZ_NATIVE_LIBEVENT=1,
michael@0 3619 LIBEVENT_DIR=/usr)
michael@0 3620 fi
michael@0 3621 if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
michael@0 3622 MOZ_NATIVE_LIBEVENT=
michael@0 3623 elif test -z "$MOZ_NATIVE_LIBEVENT"; then
michael@0 3624 CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
michael@0 3625 LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
michael@0 3626 MOZ_CHECK_HEADER(event.h,
michael@0 3627 [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
michael@0 3628 AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
michael@0 3629 fi],
michael@0 3630 AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
michael@0 3631 AC_CHECK_LIB(event, event_init,
michael@0 3632 [MOZ_NATIVE_LIBEVENT=1
michael@0 3633 MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
michael@0 3634 MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
michael@0 3635 [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
michael@0 3636 fi
michael@0 3637 CFLAGS=$_SAVE_CFLAGS
michael@0 3638 LDFLAGS=$_SAVE_LDFLAGS
michael@0 3639 LIBS=$_SAVE_LIBS
michael@0 3640
michael@0 3641 AC_SUBST(MOZ_NATIVE_LIBEVENT)
michael@0 3642 AC_SUBST(MOZ_LIBEVENT_CFLAGS)
michael@0 3643 AC_SUBST(MOZ_LIBEVENT_LIBS)
michael@0 3644
michael@0 3645 dnl ========================================================
michael@0 3646 dnl = If NSS was not detected in the system,
michael@0 3647 dnl = use the one in the source tree (mozilla/security/nss)
michael@0 3648 dnl ========================================================
michael@0 3649
michael@0 3650 MOZ_ARG_WITH_BOOL(system-nss,
michael@0 3651 [ --with-system-nss Use system installed NSS],
michael@0 3652 _USE_SYSTEM_NSS=1 )
michael@0 3653
michael@0 3654 if test -n "$_USE_SYSTEM_NSS"; then
michael@0 3655 AM_PATH_NSS(3.16.2.3, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
michael@0 3656 fi
michael@0 3657
michael@0 3658 if test -n "$MOZ_NATIVE_NSS"; then
michael@0 3659 NSS_LIBS="$NSS_LIBS -lcrmf"
michael@0 3660 else
michael@0 3661 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
michael@0 3662
michael@0 3663 if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT"; then
michael@0 3664 NSS_LIBS="\
michael@0 3665 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
michael@0 3666 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \
michael@0 3667 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \
michael@0 3668 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \
michael@0 3669 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)"
michael@0 3670 else
michael@0 3671 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
michael@0 3672 fi
michael@0 3673 fi
michael@0 3674
michael@0 3675 dnl ======================
michael@0 3676 dnl Detect yasm
michael@0 3677 dnl ======================
michael@0 3678
michael@0 3679 AC_MSG_CHECKING([for YASM assembler])
michael@0 3680 AC_CHECK_PROGS(YASM, yasm, "")
michael@0 3681
michael@0 3682 if test -n "$YASM"; then
michael@0 3683 dnl Pull out yasm's version string
michael@0 3684 YASM_VERSION=`yasm --version | $AWK '/^yasm/ { print $2 }'`
michael@0 3685 _YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'`
michael@0 3686 _YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'`
michael@0 3687 _YASM_RELEASE=` echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'`
michael@0 3688 _YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
michael@0 3689 fi
michael@0 3690
michael@0 3691 if test -z "$SKIP_LIBRARY_CHECKS"; then
michael@0 3692 dnl system JPEG support
michael@0 3693 dnl ========================================================
michael@0 3694 MOZ_ARG_WITH_STRING(system-jpeg,
michael@0 3695 [ --with-system-jpeg[=PFX]
michael@0 3696 Use system libjpeg [installed at prefix PFX]],
michael@0 3697 JPEG_DIR=$withval)
michael@0 3698
michael@0 3699 _SAVE_CFLAGS=$CFLAGS
michael@0 3700 _SAVE_LDFLAGS=$LDFLAGS
michael@0 3701 _SAVE_LIBS=$LIBS
michael@0 3702 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
michael@0 3703 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
michael@0 3704 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
michael@0 3705 fi
michael@0 3706 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
michael@0 3707 MOZ_NATIVE_JPEG=
michael@0 3708 else
michael@0 3709 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [MOZ_NATIVE_JPEG=1 MOZ_JPEG_LIBS="-ljpeg"], MOZ_NATIVE_JPEG=)
michael@0 3710 fi
michael@0 3711
michael@0 3712 if test "$MOZ_NATIVE_JPEG" = 1; then
michael@0 3713 AC_TRY_COMPILE([ #include <stdio.h>
michael@0 3714 #include <sys/types.h>
michael@0 3715 #include <jpeglib.h> ],
michael@0 3716 [ #if JPEG_LIB_VERSION < $MOZJPEG
michael@0 3717 #error "Insufficient JPEG library version ($MOZJPEG required)."
michael@0 3718 #endif
michael@0 3719 #ifndef JCS_EXTENSIONS
michael@0 3720 #error "libjpeg-turbo JCS_EXTENSIONS required"
michael@0 3721 #endif
michael@0 3722 ],
michael@0 3723 MOZ_NATIVE_JPEG=1,
michael@0 3724 AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
michael@0 3725 fi
michael@0 3726 CFLAGS=$_SAVE_CFLAGS
michael@0 3727 LDFLAGS=$_SAVE_LDFLAGS
michael@0 3728 LIBS=$_SAVE_LIBS
michael@0 3729
michael@0 3730 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$MOZ_NATIVE_JPEG" = 1; then
michael@0 3731 MOZ_JPEG_CFLAGS="-I${JPEG_DIR}/include"
michael@0 3732 MOZ_JPEG_LIBS="-L${JPEG_DIR}/lib ${MOZ_JPEG_LIBS}"
michael@0 3733 fi
michael@0 3734 fi # SKIP_LIBRARY_CHECKS
michael@0 3735
michael@0 3736 dnl system ZLIB support
michael@0 3737 dnl ========================================================
michael@0 3738 MOZ_ZLIB_CHECK([1.2.3])
michael@0 3739
michael@0 3740 if test "$MOZ_NATIVE_ZLIB" != 1; then
michael@0 3741 MOZ_ZLIB_CFLAGS="-I${_topsrcdir}/modules/zlib/src"
michael@0 3742 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,'"$MOZ_BUILD_ROOT"'/modules/zlib/src)'
michael@0 3743 fi
michael@0 3744
michael@0 3745 if test "$MOZ_LINKER" = 1 -a "$MOZ_NATIVE_ZLIB" != 1; then
michael@0 3746 AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib])
michael@0 3747 fi
michael@0 3748
michael@0 3749 MOZ_PNG_ARM_NEON=
michael@0 3750
michael@0 3751 if test -z "$SKIP_LIBRARY_CHECKS"; then
michael@0 3752 dnl system BZIP2 Support
michael@0 3753 dnl ========================================================
michael@0 3754 MOZ_ARG_WITH_STRING(system-bz2,
michael@0 3755 [ --with-system-bz2[=PFX]
michael@0 3756 Use system libbz2 [installed at prefix PFX]],
michael@0 3757 BZ2_DIR=$withval)
michael@0 3758
michael@0 3759 _SAVE_CFLAGS=$CFLAGS
michael@0 3760 _SAVE_LDFLAGS=$LDFLAGS
michael@0 3761 _SAVE_LIBS=$LIBS
michael@0 3762 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
michael@0 3763 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
michael@0 3764 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
michael@0 3765 fi
michael@0 3766 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
michael@0 3767 MOZ_NATIVE_BZ2=
michael@0 3768 else
michael@0 3769 AC_CHECK_LIB(bz2, BZ2_bzread, [MOZ_NATIVE_BZ2=1 MOZ_BZ2_LIBS="-lbz2"],
michael@0 3770 [MOZ_NATIVE_BZ2= MOZ_BZ2_CFLAGS= MOZ_BZ2_LIBS=])
michael@0 3771 fi
michael@0 3772 CFLAGS=$_SAVE_CFLAGS
michael@0 3773 LDFLAGS=$_SAVE_LDFLAGS
michael@0 3774 LIBS=$_SAVE_LIBS
michael@0 3775
michael@0 3776 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_NATIVE_BZ2" = 1; then
michael@0 3777 MOZ_BZ2_CFLAGS="-I${BZ2_DIR}/include"
michael@0 3778 MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
michael@0 3779 fi
michael@0 3780
michael@0 3781 dnl ========================================================
michael@0 3782 dnl system PNG Support
michael@0 3783 dnl ========================================================
michael@0 3784 MOZ_ARG_WITH_STRING(system-png,
michael@0 3785 [ --with-system-png[=PFX]
michael@0 3786 Use system libpng [installed at prefix PFX]],
michael@0 3787 PNG_DIR=$withval)
michael@0 3788
michael@0 3789 _SAVE_CFLAGS=$CFLAGS
michael@0 3790 _SAVE_LDFLAGS=$LDFLAGS
michael@0 3791 _SAVE_LIBS=$LIBS
michael@0 3792 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
michael@0 3793 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
michael@0 3794 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
michael@0 3795 fi
michael@0 3796 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
michael@0 3797 MOZ_NATIVE_PNG=
michael@0 3798 else
michael@0 3799 AC_CHECK_LIB(png, png_get_valid, [MOZ_NATIVE_PNG=1 MOZ_PNG_LIBS="-lpng"],
michael@0 3800 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
michael@0 3801 AC_CHECK_LIB(png, png_get_acTL, ,
michael@0 3802 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]))
michael@0 3803 fi
michael@0 3804 if test "$MOZ_NATIVE_PNG" = 1; then
michael@0 3805 AC_TRY_COMPILE([ #include <stdio.h>
michael@0 3806 #include <sys/types.h>
michael@0 3807 #include <png.h> ],
michael@0 3808 [ #if PNG_LIBPNG_VER < $MOZPNG
michael@0 3809 #error "Insufficient libpng version ($MOZPNG required)."
michael@0 3810 #endif
michael@0 3811 #ifndef PNG_UINT_31_MAX
michael@0 3812 #error "Insufficient libpng version."
michael@0 3813 #endif ],
michael@0 3814 MOZ_NATIVE_PNG=1,
michael@0 3815 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
michael@0 3816 fi
michael@0 3817 CFLAGS=$_SAVE_CFLAGS
michael@0 3818 LDFLAGS=$_SAVE_LDFLAGS
michael@0 3819 LIBS=$_SAVE_LIBS
michael@0 3820
michael@0 3821 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_NATIVE_PNG" = 1; then
michael@0 3822 MOZ_PNG_CFLAGS="-I${PNG_DIR}/include"
michael@0 3823 MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
michael@0 3824 fi
michael@0 3825
michael@0 3826 MOZ_PNG_ARM_NEON_CHECK=
michael@0 3827 if test "$MOZ_NATIVE_PNG" != 1 -a "$CPU_ARCH" = "arm" ; then
michael@0 3828 MOZ_ARG_ENABLE_STRING(png-arm-neon-support,
michael@0 3829 [ --enable-png-arm-neon-support=TYPE
michael@0 3830 Options include:
michael@0 3831 no
michael@0 3832 check (default)
michael@0 3833 nocheck (faster but unsafe)],
michael@0 3834 [MOZ_PNG_ARM_NEON_SUPPORT=$enableval ] )
michael@0 3835 case "$MOZ_PNG_ARM_NEON_SUPPORT" in
michael@0 3836 no)
michael@0 3837 # enable-png-arm-neon-support = no
michael@0 3838 ;;
michael@0 3839 nocheck)
michael@0 3840 # enable-png-arm-neon-support = nocheck
michael@0 3841 MOZ_PNG_ARM_NEON=1
michael@0 3842 ;;
michael@0 3843 *)
michael@0 3844 MOZ_PNG_ARM_NEON=1
michael@0 3845 MOZ_PNG_ARM_NEON_CHECK=1
michael@0 3846 ;;
michael@0 3847 esac
michael@0 3848 fi
michael@0 3849
michael@0 3850 AC_SUBST(MOZ_PNG_ARM_NEON_CHECK)
michael@0 3851
michael@0 3852 fi # SKIP_LIBRARY_CHECKS
michael@0 3853
michael@0 3854 AC_SUBST(MOZ_PNG_ARM_NEON)
michael@0 3855
michael@0 3856 dnl ========================================================
michael@0 3857 dnl system HunSpell Support
michael@0 3858 dnl ========================================================
michael@0 3859 MOZ_ARG_ENABLE_BOOL(system-hunspell,
michael@0 3860 [ --enable-system-hunspell
michael@0 3861 Use system hunspell (located with pkgconfig)],
michael@0 3862 MOZ_NATIVE_HUNSPELL=1 )
michael@0 3863
michael@0 3864 if test -n "$MOZ_NATIVE_HUNSPELL"; then
michael@0 3865 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
michael@0 3866 fi
michael@0 3867
michael@0 3868 AC_SUBST(MOZ_NATIVE_HUNSPELL)
michael@0 3869
michael@0 3870 dnl ========================================================
michael@0 3871 dnl system libffi Support
michael@0 3872 dnl ========================================================
michael@0 3873 MOZ_CONFIG_FFI()
michael@0 3874
michael@0 3875 if test -n "$MOZ_NATIVE_FFI"; then
michael@0 3876 MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
michael@0 3877 fi
michael@0 3878
michael@0 3879 # split JS out by default to avoid VS2005 PGO crash (bug 591836).
michael@0 3880 if test "$OS_ARCH" = "WINNT"; then
michael@0 3881 JS_SHARED_LIBRARY=1
michael@0 3882 fi
michael@0 3883
michael@0 3884 MOZ_ARG_ENABLE_BOOL(shared-js,
michael@0 3885 [ --enable-shared-js
michael@0 3886 Create a shared JavaScript library.],
michael@0 3887 JS_SHARED_LIBRARY=1,
michael@0 3888 JS_SHARED_LIBRARY=)
michael@0 3889
michael@0 3890 dnl ========================================================
michael@0 3891 dnl Java SDK support
michael@0 3892 dnl ========================================================
michael@0 3893
michael@0 3894 JAVA_BIN_PATH=
michael@0 3895 MOZ_ARG_WITH_STRING(java-bin-path,
michael@0 3896 [ --with-java-bin-path=dir
michael@0 3897 Location of Java binaries (java, javac, jar)],
michael@0 3898 JAVA_BIN_PATH=$withval)
michael@0 3899
michael@0 3900 dnl ========================================================
michael@0 3901 dnl =
michael@0 3902 dnl = Application
michael@0 3903 dnl =
michael@0 3904 dnl ========================================================
michael@0 3905
michael@0 3906 MOZ_ARG_HEADER(Application)
michael@0 3907
michael@0 3908 ENABLE_TESTS=1
michael@0 3909 ENABLE_SYSTEM_EXTENSION_DIRS=1
michael@0 3910 MOZ_BRANDING_DIRECTORY=
michael@0 3911 MOZ_OFFICIAL_BRANDING=
michael@0 3912 MOZ_FEEDS=1
michael@0 3913 MOZ_WEBAPP_RUNTIME=
michael@0 3914 MOZ_JSDEBUGGER=1
michael@0 3915 MOZ_AUTH_EXTENSION=1
michael@0 3916 MOZ_RAW=
michael@0 3917 MOZ_VORBIS=
michael@0 3918 MOZ_TREMOR=
michael@0 3919 MOZ_WAVE=1
michael@0 3920 MOZ_SAMPLE_TYPE_FLOAT32=
michael@0 3921 MOZ_SAMPLE_TYPE_S16=
michael@0 3922 MOZ_OPUS=1
michael@0 3923 MOZ_WEBM=1
michael@0 3924 MOZ_GSTREAMER=
michael@0 3925 MOZ_DIRECTSHOW=
michael@0 3926 MOZ_WMF=
michael@0 3927 MOZ_FMP4=
michael@0 3928 MOZ_FFMPEG=
michael@0 3929 MOZ_WEBRTC=1
michael@0 3930 MOZ_PEERCONNECTION=
michael@0 3931 MOZ_SRTP=
michael@0 3932 MOZ_WEBRTC_SIGNALING=
michael@0 3933 MOZ_WEBRTC_ASSERT_ALWAYS=1
michael@0 3934 MOZ_SCTP=
michael@0 3935 MOZ_MEDIA_PLUGINS=
michael@0 3936 MOZ_MEDIA_NAVIGATOR=
michael@0 3937 MOZ_OMX_PLUGIN=
michael@0 3938 MOZ_VPX=
michael@0 3939 MOZ_VPX_ERROR_CONCEALMENT=
michael@0 3940 MOZ_WEBSPEECH=1
michael@0 3941 VPX_AS=
michael@0 3942 VPX_ASFLAGS=
michael@0 3943 VPX_AS_DASH_C_FLAG=
michael@0 3944 VPX_AS_CONVERSION=
michael@0 3945 VPX_ASM_SUFFIX=
michael@0 3946 VPX_X86_ASM=
michael@0 3947 VPX_ARM_ASM=
michael@0 3948 LIBJPEG_TURBO_AS=
michael@0 3949 LIBJPEG_TURBO_ASFLAGS=
michael@0 3950 LIBJPEG_TURBO_X86_ASM=
michael@0 3951 LIBJPEG_TURBO_X64_ASM=
michael@0 3952 LIBJPEG_TURBO_ARM_ASM=
michael@0 3953 MOZ_PERMISSIONS=1
michael@0 3954 MOZ_PLACES=1
michael@0 3955 MOZ_SOCIAL=1
michael@0 3956 MOZ_PREF_EXTENSIONS=1
michael@0 3957 MOZ_PROFILELOCKING=1
michael@0 3958 MOZ_REFLOW_PERF=
michael@0 3959 MOZ_SAFE_BROWSING=
michael@0 3960 MOZ_HELP_VIEWER=
michael@0 3961 MOZ_SPELLCHECK=1
michael@0 3962 MOZ_ANDROID_OMTC=
michael@0 3963 MOZ_TOOLKIT_SEARCH=1
michael@0 3964 MOZ_UI_LOCALE=en-US
michael@0 3965 MOZ_UNIVERSALCHARDET=1
michael@0 3966 MOZ_URL_CLASSIFIER=
michael@0 3967 MOZ_XUL=1
michael@0 3968 MOZ_ZIPWRITER=1
michael@0 3969 NS_PRINTING=1
michael@0 3970 MOZ_PDF_PRINTING=
michael@0 3971 MOZ_DISABLE_CRYPTOLEGACY=
michael@0 3972 NSS_DISABLE_DBM=
michael@0 3973 NECKO_COOKIES=1
michael@0 3974 NECKO_PROTOCOLS_DEFAULT="about app data file ftp http res viewsource websocket wyciwyg device"
michael@0 3975 if test -n "$MOZ_RTSP"; then
michael@0 3976 NECKO_PROTOCOLS_DEFAULT="$NECKO_PROTOCOLS_DEFAULT rtsp"
michael@0 3977 fi
michael@0 3978 USE_ARM_KUSER=
michael@0 3979 BUILD_CTYPES=1
michael@0 3980 MOZ_USE_NATIVE_POPUP_WINDOWS=
michael@0 3981 MOZ_ANDROID_HISTORY=
michael@0 3982 MOZ_WEBSMS_BACKEND=
michael@0 3983 MOZ_ANDROID_BEAM=
michael@0 3984 MOZ_ANDROID_SYNTHAPKS=
michael@0 3985 ACCESSIBILITY=1
michael@0 3986 MOZ_TIME_MANAGER=
michael@0 3987 MOZ_PAY=
michael@0 3988 MOZ_AUDIO_CHANNEL_MANAGER=
michael@0 3989 NSS_NO_LIBPKIX=
michael@0 3990 MOZ_CONTENT_SANDBOX=
michael@0 3991 MOZ_CONTENT_SANDBOX_REPORTER=1
michael@0 3992
michael@0 3993 case "$target_os" in
michael@0 3994 mingw*)
michael@0 3995 NS_ENABLE_TSF=1
michael@0 3996 AC_DEFINE(NS_ENABLE_TSF)
michael@0 3997 ;;
michael@0 3998 esac
michael@0 3999
michael@0 4000 case "${target}" in
michael@0 4001 *-android*|*-linuxandroid*)
michael@0 4002 if test "$CPU_ARCH" = "arm" ; then
michael@0 4003 USE_ARM_KUSER=1
michael@0 4004 fi
michael@0 4005
michael@0 4006 NSS_DISABLE_DBM=1
michael@0 4007 MOZ_THEME_FASTSTRIPE=1
michael@0 4008 MOZ_TREE_FREETYPE=1
michael@0 4009 MOZ_MEMORY=1
michael@0 4010 MOZ_RAW=1
michael@0 4011 ;;
michael@0 4012
michael@0 4013 esac
michael@0 4014
michael@0 4015 MOZ_ARG_WITH_STRING(external-source-dir,
michael@0 4016 [ --with-external-source-dir=dir
michael@0 4017 External directory containing additional build files.],
michael@0 4018 [ EXTERNAL_SOURCE_DIR=$withval])
michael@0 4019 AC_SUBST(EXTERNAL_SOURCE_DIR)
michael@0 4020
michael@0 4021 MOZ_ARG_ENABLE_STRING(application,
michael@0 4022 [ --enable-application=APP
michael@0 4023 Options include:
michael@0 4024 browser (Firefox)
michael@0 4025 xulrunner
michael@0 4026 tools/update-packaging (AUS-related packaging tools)],
michael@0 4027 [ MOZ_BUILD_APP=$enableval ] )
michael@0 4028
michael@0 4029 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
michael@0 4030 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
michael@0 4031 XULRUNNER_STUB_NAME=$withval)
michael@0 4032
michael@0 4033 if test -z "$XULRUNNER_STUB_NAME"; then
michael@0 4034 case "$target_os" in
michael@0 4035 darwin*)
michael@0 4036 XULRUNNER_STUB_NAME=xulrunner
michael@0 4037 ;;
michael@0 4038 *)
michael@0 4039 XULRUNNER_STUB_NAME=xulrunner-stub
michael@0 4040 esac
michael@0 4041 fi
michael@0 4042 AC_SUBST(XULRUNNER_STUB_NAME)
michael@0 4043
michael@0 4044 AC_MSG_CHECKING([for application to build])
michael@0 4045 if test -z "$MOZ_BUILD_APP"; then
michael@0 4046 AC_MSG_RESULT([browser])
michael@0 4047 MOZ_BUILD_APP=browser
michael@0 4048 else
michael@0 4049 # "mobile" no longer exists.
michael@0 4050 if test "$MOZ_BUILD_APP" = "mobile" ; then
michael@0 4051 AC_MSG_RESULT([none])
michael@0 4052 AC_MSG_ERROR([--enable-application=mobile is no longer supported.])
michael@0 4053 fi
michael@0 4054 # We have a valid application only if it has a build.mk file in its top
michael@0 4055 # directory.
michael@0 4056 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
michael@0 4057 AC_MSG_RESULT([none])
michael@0 4058 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
michael@0 4059 else
michael@0 4060 AC_MSG_RESULT([$MOZ_BUILD_APP])
michael@0 4061 fi
michael@0 4062 fi
michael@0 4063
michael@0 4064 # The app update channel is 'default' when not supplied. The value is used in
michael@0 4065 # the application's confvars.sh so it must be set before confvars.sh is called.
michael@0 4066 MOZ_ARG_ENABLE_STRING([update-channel],
michael@0 4067 [ --enable-update-channel=CHANNEL
michael@0 4068 Select application update channel (default=default)],
michael@0 4069 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
michael@0 4070
michael@0 4071 if test -z "$MOZ_UPDATE_CHANNEL"; then
michael@0 4072 MOZ_UPDATE_CHANNEL=default
michael@0 4073 fi
michael@0 4074 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
michael@0 4075 AC_SUBST(MOZ_UPDATE_CHANNEL)
michael@0 4076
michael@0 4077 # Allow to specify a Mozilla API key file that contains the secret key to be
michael@0 4078 # used for various Mozilla API requests.
michael@0 4079 MOZ_ARG_WITH_STRING(mozilla-api-keyfile,
michael@0 4080 [ --with-mozilla-api-keyfile=file Use the secret key contained in the given keyfile for Mozilla API requests],
michael@0 4081 MOZ_MOZILLA_API_KEY=`cat $withval`)
michael@0 4082 if test -z "$MOZ_MOZILLA_API_KEY"; then
michael@0 4083 MOZ_MOZILLA_API_KEY=no-mozilla-api-key
michael@0 4084 fi
michael@0 4085 AC_SUBST(MOZ_MOZILLA_API_KEY)
michael@0 4086
michael@0 4087 # Allow to specify a Google API key file that contains the secret key to be
michael@0 4088 # used for various Google API requests.
michael@0 4089 MOZ_ARG_WITH_STRING(google-api-keyfile,
michael@0 4090 [ --with-google-api-keyfile=file Use the secret key contained in the given keyfile for Google API requests],
michael@0 4091 MOZ_GOOGLE_API_KEY=`cat $withval`)
michael@0 4092 if test -z "$MOZ_GOOGLE_API_KEY"; then
michael@0 4093 MOZ_GOOGLE_API_KEY=no-google-api-key
michael@0 4094 fi
michael@0 4095 AC_SUBST(MOZ_GOOGLE_API_KEY)
michael@0 4096
michael@0 4097 # Allow the application to influence configure with a confvars.sh script.
michael@0 4098 AC_MSG_CHECKING([if app-specific confvars.sh exists])
michael@0 4099 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
michael@0 4100 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
michael@0 4101 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
michael@0 4102 else
michael@0 4103 AC_MSG_RESULT([no])
michael@0 4104 fi
michael@0 4105
michael@0 4106 # Allow influencing configure with a defines.sh script.
michael@0 4107 . "${srcdir}/build/defines.sh"
michael@0 4108
michael@0 4109 # If we're not building a release build, define EARLY_BETA_OR_EARLIER if it is
michael@0 4110 # set in defines.sh
michael@0 4111 if test "$BUILDING_RELEASE"; then
michael@0 4112 # Override value in defines.sh, if any
michael@0 4113 EARLY_BETA_OR_EARLIER=
michael@0 4114 elif test "$EARLY_BETA_OR_EARLIER"; then
michael@0 4115 AC_DEFINE(EARLY_BETA_OR_EARLIER)
michael@0 4116 fi
michael@0 4117 AC_SUBST(EARLY_BETA_OR_EARLIER)
michael@0 4118
michael@0 4119 # Allow the application to provide a subconfigure script
michael@0 4120 if test -f "${srcdir}/${MOZ_BUILD_APP}/configure.in" ; then
michael@0 4121 do_output_subdirs() {
michael@0 4122 if test -n "$_subconfigure_subdirs"; then
michael@0 4123 AC_MSG_ERROR([Cannot specify more than one sub-sub-configure])
michael@0 4124 fi
michael@0 4125 _subconfigure_subdir="$1"
michael@0 4126 _subconfigure_config_args="$ac_configure_args"
michael@0 4127 }
michael@0 4128 tmpscript=`$PYTHON -c 'import os, tempfile; print tempfile.mktemp(prefix="subscript.").replace(os.sep, "/")'` || exit 1
michael@0 4129 m4 "${srcdir}/build/autoconf/subconfigure.m4" \
michael@0 4130 "${srcdir}/build/autoconf/altoptions.m4" \
michael@0 4131 "${srcdir}/${MOZ_BUILD_APP}/configure.in" > $tmpscript
michael@0 4132 . $tmpscript
michael@0 4133 rm -f $tmpscript
michael@0 4134 fi
michael@0 4135
michael@0 4136 # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
michael@0 4137 MOZ_ARG_WITH_STRING(app-name,
michael@0 4138 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
michael@0 4139 WITH_APP_NAME=$withval,
michael@0 4140 )
michael@0 4141
michael@0 4142 if test -n "$WITH_APP_NAME" ; then
michael@0 4143 MOZ_APP_NAME="$WITH_APP_NAME"
michael@0 4144 fi
michael@0 4145
michael@0 4146 MOZ_ARG_WITH_STRING(app-basename,
michael@0 4147 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
michael@0 4148 WITH_APP_BASENAME=$withval,
michael@0 4149 )
michael@0 4150
michael@0 4151 if test -n "$WITH_APP_BASENAME" ; then
michael@0 4152 MOZ_APP_BASENAME="$WITH_APP_BASENAME"
michael@0 4153 fi
michael@0 4154
michael@0 4155 # Now is a good time to test for logic errors, define mismatches, etc.
michael@0 4156 case "$MOZ_BUILD_APP" in
michael@0 4157 xulrunner)
michael@0 4158 if test "$LIBXUL_SDK"; then
michael@0 4159 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
michael@0 4160 fi
michael@0 4161 ;;
michael@0 4162 esac
michael@0 4163
michael@0 4164 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
michael@0 4165 # that haven't made a confvars.sh yet. Don't add new stuff here, use
michael@0 4166 # MOZ_BUILD_APP.
michael@0 4167 case "$MOZ_BUILD_APP" in
michael@0 4168 browser)
michael@0 4169 AC_DEFINE(MOZ_PHOENIX)
michael@0 4170 ;;
michael@0 4171
michael@0 4172 xulrunner)
michael@0 4173 AC_DEFINE(MOZ_XULRUNNER)
michael@0 4174 ;;
michael@0 4175 b2g)
michael@0 4176 AC_DEFINE(MOZ_B2G)
michael@0 4177 ;;
michael@0 4178 esac
michael@0 4179
michael@0 4180 AC_SUBST(MOZ_BUILD_APP)
michael@0 4181 AC_SUBST(MOZ_PHOENIX)
michael@0 4182 AC_SUBST(MOZ_XULRUNNER)
michael@0 4183 AC_SUBST(MOZ_B2G)
michael@0 4184 AC_SUBST(MOZ_B2G_VERSION)
michael@0 4185
michael@0 4186 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
michael@0 4187
michael@0 4188 dnl ========================================================
michael@0 4189 dnl Check android sdk version depending on mobile target
michael@0 4190 dnl ========================================================
michael@0 4191
michael@0 4192 if test -z "$gonkdir" ; then
michael@0 4193 # Minimum Android SDK API Level we require.
michael@0 4194 case "$MOZ_BUILD_APP" in
michael@0 4195 mobile/android)
michael@0 4196 android_min_api_level=16
michael@0 4197 case "$target" in
michael@0 4198 *-android*|*-linuxandroid*)
michael@0 4199 :
michael@0 4200 ;;
michael@0 4201 *)
michael@0 4202 AC_MSG_ERROR([You must specify --target=arm-linux-androideabi (or some other valid android target) when building with --enable-application=mobile/android. See https://wiki.mozilla.org/Mobile/Fennec/Android#Setup_Fennec_mozconfig for more information about the necessary options])
michael@0 4203 ;;
michael@0 4204 esac
michael@0 4205 ;;
michael@0 4206 esac
michael@0 4207
michael@0 4208 MOZ_ANDROID_SDK($android_min_api_level)
michael@0 4209 fi
michael@0 4210
michael@0 4211 dnl ========================================================
michael@0 4212 dnl =
michael@0 4213 dnl = Toolkit Options
michael@0 4214 dnl =
michael@0 4215 dnl ========================================================
michael@0 4216 MOZ_ARG_HEADER(Toolkit Options)
michael@0 4217
michael@0 4218 dnl ========================================================
michael@0 4219 dnl = Select the default toolkit
michael@0 4220 dnl ========================================================
michael@0 4221 MOZ_ARG_ENABLE_STRING(default-toolkit,
michael@0 4222 [ --enable-default-toolkit=TK
michael@0 4223 Select default toolkit
michael@0 4224 Platform specific defaults:
michael@0 4225 Mac OS X - cairo-cocoa
michael@0 4226 Win32 - cairo-windows
michael@0 4227 * - cairo-gtk2
michael@0 4228 * - cairo-gtk3
michael@0 4229 * - cairo-qt],
michael@0 4230 [ _DEFAULT_TOOLKIT=$enableval ],
michael@0 4231 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
michael@0 4232
michael@0 4233 if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
michael@0 4234 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
michael@0 4235 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
michael@0 4236 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk3" \
michael@0 4237 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
michael@0 4238 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
michael@0 4239 -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
michael@0 4240 -o "$_DEFAULT_TOOLKIT" = "cairo-android" \
michael@0 4241 -o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
michael@0 4242 then
michael@0 4243 dnl nglayout only supports building with one toolkit,
michael@0 4244 dnl so ignore everything after the first comma (",").
michael@0 4245 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
michael@0 4246 else
michael@0 4247 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
michael@0 4248 fi
michael@0 4249
michael@0 4250 MOZ_ARG_WITHOUT_BOOL(x,
michael@0 4251 [ --without-x Build without X11],
michael@0 4252 WITHOUT_X11=1)
michael@0 4253
michael@0 4254 dnl ========================================================
michael@0 4255 dnl = Enable the toolkit as needed =
michael@0 4256 dnl ========================================================
michael@0 4257
michael@0 4258 MOZ_WIDGET_GTK=
michael@0 4259
michael@0 4260 case "$MOZ_WIDGET_TOOLKIT" in
michael@0 4261
michael@0 4262 cairo-windows)
michael@0 4263 MOZ_WIDGET_TOOLKIT=windows
michael@0 4264 MOZ_WEBGL=1
michael@0 4265 MOZ_PDF_PRINTING=1
michael@0 4266 MOZ_INSTRUMENT_EVENT_LOOP=1
michael@0 4267 if test -n "$GNU_CC"; then
michael@0 4268 MOZ_FOLD_LIBS=
michael@0 4269 fi
michael@0 4270 ;;
michael@0 4271
michael@0 4272 cairo-gtk3)
michael@0 4273 MOZ_WIDGET_TOOLKIT=gtk3
michael@0 4274 MOZ_ENABLE_GTK=1
michael@0 4275 MOZ_ENABLE_GTK3=1
michael@0 4276 MOZ_ENABLE_XREMOTE=1
michael@0 4277 MOZ_WEBGL=1
michael@0 4278 MOZ_GL_DEFAULT_PROVIDER=GLX
michael@0 4279
michael@0 4280 AC_DEFINE(MOZ_X11)
michael@0 4281 MOZ_X11=1
michael@0 4282 USE_FC_FREETYPE=1
michael@0 4283
michael@0 4284 TK_CFLAGS='$(MOZ_GTK3_CFLAGS)'
michael@0 4285 TK_LIBS='$(MOZ_GTK3_LIBS)'
michael@0 4286 MOZ_WIDGET_GTK=3
michael@0 4287 AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK)
michael@0 4288 MOZ_PDF_PRINTING=1
michael@0 4289 MOZ_INSTRUMENT_EVENT_LOOP=1
michael@0 4290 ;;
michael@0 4291
michael@0 4292 cairo-gtk2|cairo-gtk2-x11)
michael@0 4293 MOZ_WIDGET_TOOLKIT=gtk2
michael@0 4294 MOZ_ENABLE_GTK=1
michael@0 4295 MOZ_ENABLE_GTK2=1
michael@0 4296 MOZ_ENABLE_XREMOTE=1
michael@0 4297 MOZ_WEBGL=1
michael@0 4298 MOZ_GL_DEFAULT_PROVIDER=GLX
michael@0 4299
michael@0 4300 AC_DEFINE(MOZ_X11)
michael@0 4301 MOZ_X11=1
michael@0 4302 USE_FC_FREETYPE=1
michael@0 4303
michael@0 4304 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
michael@0 4305 TK_LIBS='$(MOZ_GTK2_LIBS)'
michael@0 4306 AC_DEFINE(MOZ_WIDGET_GTK2)
michael@0 4307 MOZ_WIDGET_GTK=2
michael@0 4308 AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK)
michael@0 4309 MOZ_PDF_PRINTING=1
michael@0 4310 MOZ_INSTRUMENT_EVENT_LOOP=1
michael@0 4311 ;;
michael@0 4312
michael@0 4313 cairo-qt)
michael@0 4314 MOZ_WIDGET_TOOLKIT=qt
michael@0 4315 MOZ_ENABLE_QT=1
michael@0 4316 if test -z "$WITHOUT_X11"; then
michael@0 4317 MOZ_ENABLE_XREMOTE=1
michael@0 4318 MOZ_GL_DEFAULT_PROVIDER=GLX
michael@0 4319 MOZ_X11=1
michael@0 4320 AC_DEFINE(MOZ_X11)
michael@0 4321 XT_LIBS=
michael@0 4322 fi
michael@0 4323
michael@0 4324 MOZ_WEBGL=1
michael@0 4325 USE_FC_FREETYPE=1
michael@0 4326 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
michael@0 4327 TK_LIBS='$(MOZ_QT_LIBS)'
michael@0 4328 AC_DEFINE(MOZ_WIDGET_QT)
michael@0 4329 MOZ_PDF_PRINTING=1
michael@0 4330 AC_DEFINE(QT_NO_KEYWORDS)
michael@0 4331 ;;
michael@0 4332
michael@0 4333 cairo-cocoa)
michael@0 4334 MOZ_WIDGET_TOOLKIT=cocoa
michael@0 4335 AC_DEFINE(MOZ_WIDGET_COCOA)
michael@0 4336 LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
michael@0 4337 TK_LIBS='-framework CoreLocation -framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
michael@0 4338 TK_CFLAGS="-DNO_X11"
michael@0 4339 CFLAGS="$CFLAGS $TK_CFLAGS"
michael@0 4340 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
michael@0 4341 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL $(call EXPAND_LIBNAME_PATH,mozalloc,$(LIBXUL_DIST)/bin)'
michael@0 4342 MOZ_USER_DIR="Mozilla"
michael@0 4343 MOZ_FS_LAYOUT=bundle
michael@0 4344 MOZ_WEBGL=1
michael@0 4345 MOZ_INSTRUMENT_EVENT_LOOP=1
michael@0 4346 ;;
michael@0 4347
michael@0 4348 cairo-uikit)
michael@0 4349 MOZ_WIDGET_TOOLKIT=uikit
michael@0 4350 AC_DEFINE(MOZ_WIDGET_UIKIT)
michael@0 4351 LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
michael@0 4352 TK_CFLAGS="-DNO_X11"
michael@0 4353 TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
michael@0 4354 CFLAGS="$CFLAGS $TK_CFLAGS"
michael@0 4355 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
michael@0 4356 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL $(call EXPAND_LIBNAME_PATH,mozalloc,$(LIBXUL_DIST)/bin)'
michael@0 4357 MOZ_USER_DIR="Mozilla"
michael@0 4358 MOZ_FS_LAYOUT=bundle
michael@0 4359 ;;
michael@0 4360
michael@0 4361 cairo-android)
michael@0 4362 AC_DEFINE(MOZ_WIDGET_ANDROID)
michael@0 4363 MOZ_WIDGET_TOOLKIT=android
michael@0 4364 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
michael@0 4365 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
michael@0 4366 MOZ_WEBGL=1
michael@0 4367 MOZ_PDF_PRINTING=1
michael@0 4368 MOZ_INSTRUMENT_EVENT_LOOP=1
michael@0 4369 ;;
michael@0 4370
michael@0 4371 cairo-gonk)
michael@0 4372 XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/lib)'
michael@0 4373 AC_DEFINE(MOZ_WIDGET_GONK)
michael@0 4374 AC_DEFINE(MOZ_TOUCH)
michael@0 4375 MOZ_WIDGET_TOOLKIT=gonk
michael@0 4376 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
michael@0 4377 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
michael@0 4378 MOZ_WEBGL=1
michael@0 4379 MOZ_PDF_PRINTING=1
michael@0 4380 MOZ_TOUCH=1
michael@0 4381 MOZ_INSTRUMENT_EVENT_LOOP=1
michael@0 4382 ;;
michael@0 4383
michael@0 4384 esac
michael@0 4385
michael@0 4386 AC_SUBST(MOZ_PDF_PRINTING)
michael@0 4387 if test "$MOZ_PDF_PRINTING"; then
michael@0 4388 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
michael@0 4389 AC_DEFINE(MOZ_PDF_PRINTING)
michael@0 4390 fi
michael@0 4391
michael@0 4392 if test "$MOZ_ENABLE_XREMOTE"; then
michael@0 4393 AC_DEFINE(MOZ_ENABLE_XREMOTE)
michael@0 4394 fi
michael@0 4395
michael@0 4396 if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
michael@0 4397 AC_DEFINE(MOZ_INSTRUMENT_EVENT_LOOP)
michael@0 4398 fi
michael@0 4399
michael@0 4400 if test "$COMPILE_ENVIRONMENT"; then
michael@0 4401 if test "$MOZ_ENABLE_GTK3"; then
michael@0 4402 PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
michael@0 4403 fi
michael@0 4404 if test "$MOZ_ENABLE_GTK2"; then
michael@0 4405 if test "$MOZ_X11"; then
michael@0 4406 GDK_PACKAGES=gdk-x11-2.0
michael@0 4407 fi
michael@0 4408
michael@0 4409 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
michael@0 4410 fi
michael@0 4411
michael@0 4412 fi # COMPILE_ENVIRONMENT
michael@0 4413
michael@0 4414 AC_SUBST(MOZ_FS_LAYOUT)
michael@0 4415
michael@0 4416 dnl ========================================================
michael@0 4417 dnl Use ARM userspace kernel helpers; tell NSPR to enable
michael@0 4418 dnl their usage and use them in spidermonkey.
michael@0 4419 dnl ========================================================
michael@0 4420 MOZ_ARG_WITH_BOOL(arm-kuser,
michael@0 4421 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
michael@0 4422 USE_ARM_KUSER=1,)
michael@0 4423 if test -n "$USE_ARM_KUSER"; then
michael@0 4424 AC_DEFINE(USE_ARM_KUSER)
michael@0 4425 fi
michael@0 4426
michael@0 4427 dnl ========================================================
michael@0 4428 dnl = startup-notification support module
michael@0 4429 dnl ========================================================
michael@0 4430
michael@0 4431 if test "$MOZ_ENABLE_GTK"
michael@0 4432 then
michael@0 4433 MOZ_ENABLE_STARTUP_NOTIFICATION=
michael@0 4434
michael@0 4435 MOZ_ARG_ENABLE_BOOL(startup-notification,
michael@0 4436 [ --enable-startup-notification
michael@0 4437 Enable startup-notification support (default: disabled) ],
michael@0 4438 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
michael@0 4439 MOZ_ENABLE_STARTUP_NOTIFICATION=)
michael@0 4440 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
michael@0 4441 then
michael@0 4442 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
michael@0 4443 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
michael@0 4444 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
michael@0 4445 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
michael@0 4446 then
michael@0 4447 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
michael@0 4448 fi
michael@0 4449 MOZ_ENABLE_STARTUP_NOTIFICATION=
michael@0 4450 ])
michael@0 4451 fi
michael@0 4452
michael@0 4453 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
michael@0 4454 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
michael@0 4455 fi
michael@0 4456
michael@0 4457 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
michael@0 4458 fi
michael@0 4459 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
michael@0 4460 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
michael@0 4461 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
michael@0 4462
michael@0 4463 dnl ========================================================
michael@0 4464 dnl Disable printing
michael@0 4465 dnl ========================================================
michael@0 4466 MOZ_ARG_DISABLE_BOOL(printing,
michael@0 4467 [ --disable-printing Disable printing support],
michael@0 4468 NS_PRINTING=,
michael@0 4469 NS_PRINTING=1)
michael@0 4470
michael@0 4471 if test "$NS_PRINTING"; then
michael@0 4472 AC_DEFINE(NS_PRINTING)
michael@0 4473 AC_DEFINE(NS_PRINT_PREVIEW)
michael@0 4474 fi
michael@0 4475
michael@0 4476 dnl ========================================================
michael@0 4477 dnl = QT support
michael@0 4478 dnl ========================================================
michael@0 4479 if test "$MOZ_ENABLE_QT"
michael@0 4480 then
michael@0 4481 MOZ_ARG_WITH_STRING(qtdir,
michael@0 4482 [ --with-qtdir=\$dir Specify Qt directory ],
michael@0 4483 [ QTDIR=$withval])
michael@0 4484
michael@0 4485 if test -z "$QTDIR"; then
michael@0 4486 AC_CHECK_PROGS(HOST_QMAKE, $HOST_QMAKE qmake, "")
michael@0 4487 else
michael@0 4488 HOST_QMAKE="$QTDIR/bin/qmake"
michael@0 4489 fi
michael@0 4490 QT_VERSION=`$HOST_QMAKE -v | grep 'Using Qt version' | egrep -o '[[0-9]]+\.[[0-9]]+\.[[0-9]]+'`
michael@0 4491
michael@0 4492 if test -z "$QTDIR"; then
michael@0 4493 case $QT_VERSION in
michael@0 4494 5.*)
michael@0 4495 AC_MSG_RESULT("Using qt5: $QT_VERSION")
michael@0 4496 PKG_CHECK_MODULES(MOZ_QT, Qt5Gui Qt5Network Qt5Core Qt5Quick, ,
michael@0 4497 [
michael@0 4498 AC_MSG_ERROR([$MOZ_QT_PKG_ERRORS Need qtbase development packages, (On Ubuntu, you might try installing the packages qtbase5-dev libqt5opengl5-dev.)])
michael@0 4499 ])
michael@0 4500 QT5INCDIR=`pkg-config --variable=includedir Qt5Gui`
michael@0 4501 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QT5INCDIR/QtGui/$QT_VERSION/QtGui"
michael@0 4502 if test "$NS_PRINTING"; then
michael@0 4503 PKG_CHECK_MODULES(MOZ_QT_WIDGETS, Qt5PrintSupport, ,
michael@0 4504 [
michael@0 4505 AC_MSG_ERROR([$MOZ_QT_PKG_ERRORS Need qtbase widgets development package])
michael@0 4506 ])
michael@0 4507 MOZ_QT_LIBS="$MOZ_QT_LIBS $MOZ_QT_WIDGETS_LIBS"
michael@0 4508 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $MOZ_QT_WIDGETS_CFLAGS"
michael@0 4509 fi
michael@0 4510 ;;
michael@0 4511 *)
michael@0 4512 AC_MSG_ERROR([* * * Unsupported Qt Version: $QT_VERSION])
michael@0 4513 ;;
michael@0 4514 esac
michael@0 4515
michael@0 4516 AC_CHECK_PROGS(HOST_MOC, $MOC moc, "")
michael@0 4517 AC_CHECK_PROGS(HOST_RCC, $RCC rcc, "")
michael@0 4518 else
michael@0 4519 MOZ_QT_CFLAGS="-DQT_SHARED"
michael@0 4520 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
michael@0 4521 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
michael@0 4522 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
michael@0 4523 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
michael@0 4524 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
michael@0 4525 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDeclarative"
michael@0 4526 case $QT_VERSION in
michael@0 4527 5.*)
michael@0 4528 AC_MSG_RESULT("Using qt5: $QT_VERSION")
michael@0 4529 MOZ_QT_LIBS="$MOZ_QT_LIBS -L$QTDIR/lib/ -lQt5Gui -lQt5Network -lQt5Core -lQt5Xml"
michael@0 4530 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui/$QT_VERSION/QtGui"
michael@0 4531 if test "$NS_PRINTING"; then
michael@0 4532 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQt5Widgets -lQt5PrintSupport"
michael@0 4533 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport"
michael@0 4534 fi
michael@0 4535 ;;
michael@0 4536 *)
michael@0 4537 AC_MSG_ERROR([* * * Unsupported Qt Version: $QT_VERSION])
michael@0 4538 ;;
michael@0 4539 esac
michael@0 4540
michael@0 4541 HOST_MOC="$QTDIR/bin/moc"
michael@0 4542 HOST_RCC="$QTDIR/bin/rcc"
michael@0 4543 fi
michael@0 4544 if test -z "$HOST_MOC"; then
michael@0 4545 AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is incorrect])
michael@0 4546 fi
michael@0 4547 if test -z "$HOST_RCC"; then
michael@0 4548 AC_MSG_ERROR([No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is incorrect])
michael@0 4549 fi
michael@0 4550
michael@0 4551 MOC=$HOST_MOC
michael@0 4552 RCC=$HOST_RCC
michael@0 4553
michael@0 4554 MOZ_ENABLE_QMSYSTEM2=
michael@0 4555 PKG_CHECK_MODULES(_QMSYSTEM2, qmsystem2,
michael@0 4556 MOZ_ENABLE_QMSYSTEM2=1,
michael@0 4557 MOZ_ENABLE_QMSYSTEM2=)
michael@0 4558
michael@0 4559 if test "$MOZ_ENABLE_QMSYSTEM2"; then
michael@0 4560 MOZ_ENABLE_QMSYSTEM2=1
michael@0 4561 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QMSYSTEM2_CFLAGS"
michael@0 4562 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QMSYSTEM2_LIBS"
michael@0 4563 AC_DEFINE(MOZ_ENABLE_QMSYSTEM2)
michael@0 4564 fi
michael@0 4565
michael@0 4566 MOZ_ENABLE_QTNETWORK=
michael@0 4567 PKG_CHECK_MODULES(_QTNETWORK, QtNetwork >= 4.7,
michael@0 4568 MOZ_ENABLE_QTNETWORK=1,
michael@0 4569 MOZ_ENABLE_QTNETWORK=)
michael@0 4570
michael@0 4571 if test "$MOZ_ENABLE_QTNETWORK"; then
michael@0 4572 MOZ_ENABLE_QTNETWORK=1
michael@0 4573 AC_DEFINE(MOZ_ENABLE_QTNETWORK)
michael@0 4574 fi
michael@0 4575
michael@0 4576 MOZ_ENABLE_QTMOBILITY=
michael@0 4577 PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback QtLocation,
michael@0 4578 MOZ_ENABLE_QTMOBILITY=1,
michael@0 4579 MOZ_ENABLE_QTMOBILITY=)
michael@0 4580 if test "$MOZ_ENABLE_QTMOBILITY"; then
michael@0 4581 MOZ_ENABLE_QTMOBILITY=1
michael@0 4582 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
michael@0 4583 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
michael@0 4584 AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
michael@0 4585 AC_SUBST(MOZ_ENABLE_QTMOBILITY)
michael@0 4586 else
michael@0 4587 AC_CHECK_LIB(QtSensors, main, [
michael@0 4588 MOZ_ENABLE_QTMOBILITY=1
michael@0 4589 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMobility"
michael@0 4590 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtSensors"
michael@0 4591 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtFeedback"
michael@0 4592 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtLocation"
michael@0 4593 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation"
michael@0 4594 ])
michael@0 4595 fi
michael@0 4596
michael@0 4597 MOZ_ENABLE_QT5FEEDBACK=
michael@0 4598 PKG_CHECK_MODULES(_QT5FEEDBACK, Qt0Feedback,
michael@0 4599 MOZ_ENABLE_QT5FEEDBACK=1,
michael@0 4600 MOZ_ENABLE_QT5FEEDBACK=)
michael@0 4601 if test "$MOZ_ENABLE_QT5FEEDBACK"; then
michael@0 4602 MOZ_ENABLE_QT5FEEDBACK=1
michael@0 4603 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QT5FEEDBACK_CFLAGS"
michael@0 4604 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QT5FEEDBACK_LIBS"
michael@0 4605 AC_DEFINE(MOZ_ENABLE_QT5FEEDBACK)
michael@0 4606 AC_SUBST(MOZ_ENABLE_QT5FEEDBACK)
michael@0 4607 fi
michael@0 4608
michael@0 4609 MOZ_ENABLE_QT5GEOPOSITION=
michael@0 4610 PKG_CHECK_MODULES(_QT5GEOPOSITION, Qt5Positioning,
michael@0 4611 MOZ_ENABLE_QT5GEOPOSITION=1,
michael@0 4612 MOZ_ENABLE_QT5GEOPOSITION=)
michael@0 4613 if test "$MOZ_ENABLE_QT5GEOPOSITION"; then
michael@0 4614 MOZ_ENABLE_QT5GEOPOSITION=1
michael@0 4615 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QT5GEOPOSITION_CFLAGS"
michael@0 4616 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QT5GEOPOSITION_LIBS"
michael@0 4617 AC_DEFINE(MOZ_ENABLE_QT5GEOPOSITION)
michael@0 4618 AC_SUBST(MOZ_ENABLE_QT5GEOPOSITION)
michael@0 4619 fi
michael@0 4620
michael@0 4621 if test "$MOZ_ENABLE_CONTENTACTION"; then
michael@0 4622 MOZ_ENABLE_CONTENTACTION=1
michael@0 4623 AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
michael@0 4624 fi
michael@0 4625
michael@0 4626 MOZ_ENABLE_CONTENTACTION=
michael@0 4627 PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
michael@0 4628 if test "$MOZ_ENABLE_CONTENTACTION"; then
michael@0 4629 MOZ_ENABLE_CONTENTACTION=1
michael@0 4630 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_CONTENTACTION_CFLAGS"
michael@0 4631 MOZ_QT_LIBS="$MOZ_QT_LIBS $_CONTENTACTION_LIBS"
michael@0 4632 AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
michael@0 4633 AC_SUBST(MOZ_ENABLE_CONTENTACTION)
michael@0 4634 fi
michael@0 4635 fi
michael@0 4636
michael@0 4637 AC_SUBST(GTK_CONFIG)
michael@0 4638 AC_SUBST(TK_CFLAGS)
michael@0 4639 AC_SUBST(TK_LIBS)
michael@0 4640
michael@0 4641 AC_SUBST(MOZ_ENABLE_GTK2)
michael@0 4642 AC_SUBST(MOZ_ENABLE_GTK3)
michael@0 4643 AC_SUBST(MOZ_ENABLE_GTK)
michael@0 4644 AC_SUBST(MOZ_ENABLE_QT)
michael@0 4645 AC_SUBST(MOZ_ENABLE_QTNETWORK)
michael@0 4646 AC_SUBST(MOZ_ENABLE_QMSYSTEM2)
michael@0 4647 AC_SUBST(MOZ_ENABLE_QTMOBILITY)
michael@0 4648 AC_SUBST(MOZ_ENABLE_XREMOTE)
michael@0 4649 AC_SUBST(MOZ_GTK2_CFLAGS)
michael@0 4650 AC_SUBST(MOZ_GTK2_LIBS)
michael@0 4651 AC_SUBST(MOZ_GTK3_CFLAGS)
michael@0 4652 AC_SUBST(MOZ_GTK3_LIBS)
michael@0 4653 AC_SUBST(MOZ_WIDGET_GTK)
michael@0 4654 AC_SUBST(MOZ_QT_CFLAGS)
michael@0 4655 AC_SUBST(MOZ_QT_LIBS)
michael@0 4656
michael@0 4657 AC_SUBST(MOC)
michael@0 4658 AC_SUBST(RCC)
michael@0 4659
michael@0 4660 AC_SUBST(MOZ_X11)
michael@0 4661
michael@0 4662 dnl ========================================================
michael@0 4663 dnl =
michael@0 4664 dnl = Components & Features
michael@0 4665 dnl =
michael@0 4666 dnl ========================================================
michael@0 4667 MOZ_ARG_HEADER(Components and Features)
michael@0 4668
michael@0 4669 dnl ========================================================
michael@0 4670 dnl = Localization
michael@0 4671 dnl ========================================================
michael@0 4672 MOZ_ARG_ENABLE_STRING(ui-locale,
michael@0 4673 [ --enable-ui-locale=ab-CD
michael@0 4674 Select the user interface locale (default: en-US)],
michael@0 4675 MOZ_UI_LOCALE=$enableval )
michael@0 4676 AC_SUBST(MOZ_UI_LOCALE)
michael@0 4677
michael@0 4678 dnl ========================================================
michael@0 4679 dnl = Trademarked Branding
michael@0 4680 dnl ========================================================
michael@0 4681 MOZ_ARG_ENABLE_BOOL(official-branding,
michael@0 4682 [ --enable-official-branding
michael@0 4683 Enable Official mozilla.org Branding
michael@0 4684 Do not distribute builds with
michael@0 4685 --enable-official-branding unless you have
michael@0 4686 permission to use trademarks per
michael@0 4687 http://www.mozilla.org/foundation/trademarks/ .],
michael@0 4688 [
michael@0 4689 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
michael@0 4690 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
michael@0 4691 else
michael@0 4692 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
michael@0 4693 MOZ_OFFICIAL_BRANDING=1
michael@0 4694 fi
michael@0 4695 ], MOZ_OFFICIAL_BRANDING=)
michael@0 4696
michael@0 4697 AC_SUBST(MOZ_OFFICIAL_BRANDING)
michael@0 4698 if test -n "$MOZ_OFFICIAL_BRANDING"; then
michael@0 4699 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
michael@0 4700 fi
michael@0 4701
michael@0 4702 MOZ_ARG_WITH_STRING(branding,
michael@0 4703 [ --with-branding=dir Use branding from the specified directory.],
michael@0 4704 MOZ_BRANDING_DIRECTORY=$withval)
michael@0 4705
michael@0 4706 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
michael@0 4707 if test -z "$REAL_BRANDING_DIRECTORY"; then
michael@0 4708 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
michael@0 4709 fi
michael@0 4710
michael@0 4711 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
michael@0 4712 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
michael@0 4713 fi
michael@0 4714
michael@0 4715 AC_SUBST(MOZ_BRANDING_DIRECTORY)
michael@0 4716
michael@0 4717 dnl ========================================================
michael@0 4718 dnl = Distribution ID
michael@0 4719 dnl ========================================================
michael@0 4720 MOZ_ARG_WITH_STRING(distribution-id,
michael@0 4721 [ --with-distribution-id=ID
michael@0 4722 Set distribution-specific id (default=org.mozilla)],
michael@0 4723 [ val=`echo $withval`
michael@0 4724 MOZ_DISTRIBUTION_ID="$val"])
michael@0 4725
michael@0 4726 if test -z "$MOZ_DISTRIBUTION_ID"; then
michael@0 4727 MOZ_DISTRIBUTION_ID="org.mozilla"
michael@0 4728 fi
michael@0 4729
michael@0 4730 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
michael@0 4731 AC_SUBST(MOZ_DISTRIBUTION_ID)
michael@0 4732
michael@0 4733
michael@0 4734 dnl ========================================================
michael@0 4735 dnl = Pango
michael@0 4736 dnl ========================================================
michael@0 4737 if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT"
michael@0 4738 then
michael@0 4739 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
michael@0 4740
michael@0 4741 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
michael@0 4742 AC_SUBST(MOZ_PANGO_CFLAGS)
michael@0 4743 AC_SUBST(MOZ_PANGO_LIBS)
michael@0 4744 fi
michael@0 4745
michael@0 4746 dnl ========================================================
michael@0 4747 dnl = GnomeVFS, GIO and GConf support module
michael@0 4748 dnl ========================================================
michael@0 4749
michael@0 4750 if test "$MOZ_X11"
michael@0 4751 then
michael@0 4752 dnl build the GIO extension by default only when the
michael@0 4753 dnl GTK2 toolkit is in use.
michael@0 4754 if test "$MOZ_ENABLE_GTK"
michael@0 4755 then
michael@0 4756 MOZ_ENABLE_GIO=1
michael@0 4757 MOZ_ENABLE_GCONF=1
michael@0 4758 fi
michael@0 4759
michael@0 4760 dnl ========================================================
michael@0 4761 dnl = GnomeVFS support module
michael@0 4762 dnl ========================================================
michael@0 4763 MOZ_ARG_ENABLE_BOOL(gnomevfs,
michael@0 4764 [ --enable-gnomevfs Enable GnomeVFS support (default: disabled)],
michael@0 4765 MOZ_ENABLE_GNOMEVFS=force,
michael@0 4766 MOZ_ENABLE_GNOMEVFS=)
michael@0 4767
michael@0 4768 if test "$MOZ_ENABLE_GNOMEVFS"
michael@0 4769 then
michael@0 4770 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
michael@0 4771 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
michael@0 4772 MOZ_ENABLE_GNOMEVFS=1
michael@0 4773 AC_DEFINE(MOZ_ENABLE_GNOMEVFS)
michael@0 4774 ],[
michael@0 4775 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
michael@0 4776 then
michael@0 4777 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
michael@0 4778 fi
michael@0 4779 MOZ_ENABLE_GNOMEVFS=
michael@0 4780 ])
michael@0 4781 fi
michael@0 4782
michael@0 4783 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
michael@0 4784 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
michael@0 4785 AC_SUBST(MOZ_GNOMEVFS_LIBS)
michael@0 4786
michael@0 4787 dnl ========================================================
michael@0 4788 dnl = GIO support module
michael@0 4789 dnl ========================================================
michael@0 4790 MOZ_ARG_DISABLE_BOOL(gio,
michael@0 4791 [ --disable-gio Disable GIO support],
michael@0 4792 MOZ_ENABLE_GIO=,
michael@0 4793 MOZ_ENABLE_GIO=force)
michael@0 4794
michael@0 4795 if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK"
michael@0 4796 then
michael@0 4797 if test "$MOZ_ENABLE_GTK2"
michael@0 4798 then
michael@0 4799 PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, ,
michael@0 4800 [AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])])
michael@0 4801 fi
michael@0 4802 PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
michael@0 4803 MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
michael@0 4804 MOZ_ENABLE_GIO=1
michael@0 4805 AC_DEFINE(MOZ_ENABLE_GIO)
michael@0 4806 ],[
michael@0 4807 if test "$MOZ_ENABLE_GIO" = "force"
michael@0 4808 then
michael@0 4809 AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
michael@0 4810 fi
michael@0 4811 MOZ_ENABLE_GIO=
michael@0 4812 ])
michael@0 4813 fi
michael@0 4814
michael@0 4815 AC_SUBST(MOZ_ENABLE_GIO)
michael@0 4816 AC_SUBST(MOZ_GIO_CFLAGS)
michael@0 4817 AC_SUBST(MOZ_GIO_LIBS)
michael@0 4818
michael@0 4819 dnl ========================================================
michael@0 4820 dnl = GConf support module
michael@0 4821 dnl ========================================================
michael@0 4822 MOZ_ARG_DISABLE_BOOL(gconf,
michael@0 4823 [ --disable-gconf Disable Gconf support ],
michael@0 4824 MOZ_ENABLE_GCONF=,
michael@0 4825 MOZ_ENABLE_GCONF=force)
michael@0 4826
michael@0 4827 if test "$MOZ_ENABLE_GCONF"
michael@0 4828 then
michael@0 4829 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
michael@0 4830 MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0`
michael@0 4831 MOZ_ENABLE_GCONF=1
michael@0 4832 ],[
michael@0 4833 if test "$MOZ_ENABLE_GCONF" = "force"
michael@0 4834 then
michael@0 4835 AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
michael@0 4836 fi
michael@0 4837 MOZ_ENABLE_GCONF=
michael@0 4838 ])
michael@0 4839 fi
michael@0 4840
michael@0 4841 if test "$MOZ_ENABLE_GCONF"; then
michael@0 4842 AC_DEFINE(MOZ_ENABLE_GCONF)
michael@0 4843 fi
michael@0 4844
michael@0 4845 AC_SUBST(MOZ_ENABLE_GCONF)
michael@0 4846 AC_SUBST(MOZ_GCONF_CFLAGS)
michael@0 4847 AC_SUBST(MOZ_GCONF_LIBS)
michael@0 4848 fi
michael@0 4849
michael@0 4850 dnl ========================================================
michael@0 4851 dnl = libproxy support
michael@0 4852 dnl ========================================================
michael@0 4853
michael@0 4854 if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT"
michael@0 4855 then
michael@0 4856 MOZ_ENABLE_LIBPROXY=
michael@0 4857
michael@0 4858 MOZ_ARG_ENABLE_BOOL(libproxy,
michael@0 4859 [ --enable-libproxy Enable libproxy support ],
michael@0 4860 MOZ_ENABLE_LIBPROXY=1,
michael@0 4861 MOZ_ENABLE_LIBPROXY=)
michael@0 4862
michael@0 4863 if test "$MOZ_ENABLE_LIBPROXY"
michael@0 4864 then
michael@0 4865 PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
michael@0 4866 AC_DEFINE(MOZ_ENABLE_LIBPROXY)
michael@0 4867 fi
michael@0 4868 fi
michael@0 4869 AC_SUBST(MOZ_ENABLE_LIBPROXY)
michael@0 4870 AC_SUBST(MOZ_LIBPROXY_CFLAGS)
michael@0 4871 AC_SUBST(MOZ_LIBPROXY_LIBS)
michael@0 4872
michael@0 4873 dnl ========================================================
michael@0 4874 dnl = GNOME component (mozgnome)
michael@0 4875 dnl ========================================================
michael@0 4876
michael@0 4877 if test "$MOZ_ENABLE_GTK"
michael@0 4878 then
michael@0 4879 MOZ_ENABLE_GNOME_COMPONENT=1
michael@0 4880 fi
michael@0 4881 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
michael@0 4882
michael@0 4883 dnl ========================================================
michael@0 4884 dnl = libgnomeui support module
michael@0 4885 dnl ========================================================
michael@0 4886
michael@0 4887 if test "$MOZ_ENABLE_GTK"
michael@0 4888 then
michael@0 4889 MOZ_ARG_ENABLE_BOOL(gnomeui,
michael@0 4890 [ --enable-gnomeui Enable libgnomeui instead of GIO & GTK for icon theme support ],
michael@0 4891 MOZ_ENABLE_GNOMEUI=force,
michael@0 4892 MOZ_ENABLE_GNOMEUI=)
michael@0 4893
michael@0 4894 if test "$MOZ_ENABLE_GNOMEUI"
michael@0 4895 then
michael@0 4896 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
michael@0 4897 [
michael@0 4898 MOZ_ENABLE_GNOMEUI=1
michael@0 4899 ],[
michael@0 4900 if test "$MOZ_ENABLE_GNOMEUI" = "force"
michael@0 4901 then
michael@0 4902 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
michael@0 4903 fi
michael@0 4904 MOZ_ENABLE_GNOMEUI=
michael@0 4905 ])
michael@0 4906 fi
michael@0 4907
michael@0 4908 if test "$MOZ_ENABLE_GNOMEUI"; then
michael@0 4909 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
michael@0 4910 fi
michael@0 4911 fi
michael@0 4912
michael@0 4913 AC_SUBST(MOZ_ENABLE_GNOMEUI)
michael@0 4914 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
michael@0 4915
michael@0 4916 dnl ========================================================
michael@0 4917 dnl = dbus support
michael@0 4918 dnl ========================================================
michael@0 4919
michael@0 4920 if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT"
michael@0 4921 then
michael@0 4922 MOZ_ENABLE_DBUS=1
michael@0 4923
michael@0 4924 MOZ_ARG_DISABLE_BOOL(dbus,
michael@0 4925 [ --disable-dbus Disable dbus support ],
michael@0 4926 MOZ_ENABLE_DBUS=,
michael@0 4927 MOZ_ENABLE_DBUS=1)
michael@0 4928
michael@0 4929 if test "$MOZ_ENABLE_DBUS"
michael@0 4930 then
michael@0 4931 PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
michael@0 4932 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
michael@0 4933 AC_DEFINE(MOZ_ENABLE_DBUS)
michael@0 4934 fi
michael@0 4935 fi
michael@0 4936 AC_SUBST(MOZ_ENABLE_DBUS)
michael@0 4937 AC_SUBST(MOZ_DBUS_CFLAGS)
michael@0 4938 AC_SUBST(MOZ_DBUS_LIBS)
michael@0 4939 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
michael@0 4940 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
michael@0 4941
michael@0 4942 dnl ========================================================
michael@0 4943 dnl = Enable Android History instead of Places
michael@0 4944 dnl ========================================================
michael@0 4945 if test -n "$MOZ_ANDROID_HISTORY"; then
michael@0 4946 if test -z "$MOZ_PLACES"; then
michael@0 4947 AC_DEFINE(MOZ_ANDROID_HISTORY)
michael@0 4948 else
michael@0 4949 AC_MSG_ERROR([Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.])
michael@0 4950 fi
michael@0 4951 fi
michael@0 4952
michael@0 4953 dnl ========================================================
michael@0 4954 dnl = Build with the Android compositor
michael@0 4955 dnl ========================================================
michael@0 4956 if test -n "$MOZ_ANDROID_OMTC"; then
michael@0 4957 dnl Do this if defined in confvars.sh
michael@0 4958 AC_DEFINE(MOZ_ANDROID_OMTC)
michael@0 4959 fi
michael@0 4960
michael@0 4961 dnl ========================================================
michael@0 4962 dnl = Disable WebSMS backend
michael@0 4963 dnl ========================================================
michael@0 4964 MOZ_ARG_DISABLE_BOOL(websms-backend,
michael@0 4965 [ --disable-websms-backend
michael@0 4966 Disable WebSMS backend],
michael@0 4967 MOZ_WEBSMS_BACKEND=,
michael@0 4968 MOZ_WEBSMS_BACKEND=1)
michael@0 4969
michael@0 4970 if test -n "$MOZ_WEBSMS_BACKEND"; then
michael@0 4971 AC_DEFINE(MOZ_WEBSMS_BACKEND)
michael@0 4972 fi
michael@0 4973
michael@0 4974 dnl ========================================================
michael@0 4975 dnl = Enable NFC permission on Android
michael@0 4976 dnl ========================================================
michael@0 4977 if test -n "$MOZ_ANDROID_BEAM"; then
michael@0 4978 AC_DEFINE(MOZ_ANDROID_BEAM)
michael@0 4979 fi
michael@0 4980
michael@0 4981 dnl ========================================================
michael@0 4982 dnl = Synthesized Webapp APKs on Android
michael@0 4983 dnl ========================================================
michael@0 4984 MOZ_ARG_ENABLE_BOOL(android-synthapks,
michael@0 4985 [ --enable-android-synthapks Enable synthesized APKs],
michael@0 4986 MOZ_ANDROID_SYNTHAPKS=1,
michael@0 4987 MOZ_ANDROID_SYNTHAPKS=)
michael@0 4988
michael@0 4989 if test -n "$MOZ_ANDROID_SYNTHAPKS"; then
michael@0 4990 AC_DEFINE(MOZ_ANDROID_SYNTHAPKS)
michael@0 4991 fi
michael@0 4992
michael@0 4993 dnl ========================================================
michael@0 4994 dnl = JS Debugger XPCOM component (js/jsd)
michael@0 4995 dnl ========================================================
michael@0 4996 MOZ_ARG_DISABLE_BOOL(jsd,
michael@0 4997 [ --disable-jsd Disable JavaScript debug library],
michael@0 4998 MOZ_JSDEBUGGER=,
michael@0 4999 MOZ_JSDEBUGGER=1)
michael@0 5000
michael@0 5001
michael@0 5002 dnl ========================================================
michael@0 5003 dnl = Enable IPDL's "expensive" unit tests
michael@0 5004 dnl ========================================================
michael@0 5005 MOZ_IPDL_TESTS=
michael@0 5006
michael@0 5007 MOZ_ARG_ENABLE_BOOL(ipdl-tests,
michael@0 5008 [ --enable-ipdl-tests Enable expensive IPDL tests],
michael@0 5009 MOZ_IPDL_TESTS=1,
michael@0 5010 MOZ_IPDL_TESTS=)
michael@0 5011
michael@0 5012 if test -n "$MOZ_IPDL_TESTS"; then
michael@0 5013 AC_DEFINE(MOZ_IPDL_TESTS)
michael@0 5014 fi
michael@0 5015
michael@0 5016 AC_SUBST(MOZ_IPDL_TESTS)
michael@0 5017
michael@0 5018 dnl ========================================================
michael@0 5019 dnl = Disable building dbm
michael@0 5020 dnl ========================================================
michael@0 5021 MOZ_ARG_DISABLE_BOOL(dbm,
michael@0 5022 [ --disable-dbm Disable building dbm],
michael@0 5023 NSS_DISABLE_DBM=1,
michael@0 5024 NSS_DISABLE_DBM=)
michael@0 5025
michael@0 5026 dnl ========================================================
michael@0 5027 dnl accessibility support on by default on all platforms
michael@0 5028 dnl ========================================================
michael@0 5029 MOZ_ARG_DISABLE_BOOL(accessibility,
michael@0 5030 [ --disable-accessibility Disable accessibility support],
michael@0 5031 ACCESSIBILITY=,
michael@0 5032 ACCESSIBILITY=1 )
michael@0 5033 if test "$ACCESSIBILITY"; then
michael@0 5034 case "$target" in
michael@0 5035 *-mingw*)
michael@0 5036 if test -z "$MIDL"; then
michael@0 5037 if test "$GCC" != "yes"; then
michael@0 5038 AC_MSG_ERROR([MIDL could not be found. Building accessibility without MIDL is not supported.])
michael@0 5039 else
michael@0 5040 AC_MSG_ERROR([You have accessibility enabled, but widl could not be found. Add --disable-accessibility to your mozconfig or install widl. See https://developer.mozilla.org/en-US/docs/Cross_Compile_Mozilla_for_Mingw32 for details.])
michael@0 5041 fi
michael@0 5042 fi
michael@0 5043 esac
michael@0 5044 AC_DEFINE(ACCESSIBILITY)
michael@0 5045 fi
michael@0 5046
michael@0 5047 dnl ========================================================
michael@0 5048 dnl Accessibility is required for the linuxgl widget
michael@0 5049 dnl backend
michael@0 5050 dnl ========================================================
michael@0 5051 if test "${MOZ_WIDGET_TOOLKIT}" = "linuxgl" -a "$ACCESSIBILITY" != "1"; then
michael@0 5052 AC_MSG_ERROR(["Accessibility is required for the linuxgl widget backend"])
michael@0 5053 fi
michael@0 5054
michael@0 5055 dnl Turn off webrtc for OS's we don't handle yet, but allow
michael@0 5056 dnl --enable-webrtc to override. Can disable for everything in
michael@0 5057 dnl the master list above.
michael@0 5058 if test -n "$MOZ_WEBRTC"; then
michael@0 5059 case "$target" in
michael@0 5060 *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
michael@0 5061 dnl Leave enabled
michael@0 5062 ;;
michael@0 5063 *)
michael@0 5064 dnl default to disabled for all others
michael@0 5065 MOZ_WEBRTC=
michael@0 5066 ;;
michael@0 5067 esac
michael@0 5068 fi
michael@0 5069
michael@0 5070 AC_TRY_COMPILE([#include <linux/ethtool.h>],
michael@0 5071 [ struct ethtool_cmd cmd; cmd.speed_hi = 0; ],
michael@0 5072 MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI=1)
michael@0 5073
michael@0 5074 AC_SUBST(MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI)
michael@0 5075
michael@0 5076 # target_arch is from {ia32|x64|arm|ppc}
michael@0 5077 case "$CPU_ARCH" in
michael@0 5078 x86_64 | arm | x86 | ppc* | ia64)
michael@0 5079 :
michael@0 5080 ;;
michael@0 5081 *)
michael@0 5082 # unsupported arch for webrtc
michael@0 5083 MOZ_WEBRTC=
michael@0 5084 ;;
michael@0 5085
michael@0 5086 esac
michael@0 5087
michael@0 5088 dnl ========================================================
michael@0 5089 dnl = Disable WebRTC code
michael@0 5090 dnl ========================================================
michael@0 5091 MOZ_ARG_DISABLE_BOOL(webrtc,
michael@0 5092 [ --disable-webrtc Disable support for WebRTC],
michael@0 5093 MOZ_WEBRTC=,
michael@0 5094 MOZ_WEBRTC=1)
michael@0 5095
michael@0 5096 if test -n "$MOZ_WEBRTC"; then
michael@0 5097 AC_DEFINE(MOZ_WEBRTC)
michael@0 5098 dnl MOZ_WEBRTC_ASSERT_ALWAYS turns on a number of safety asserts in
michael@0 5099 dnl opt/production builds (via MOZ_CRASH())
michael@0 5100 AC_DEFINE(MOZ_WEBRTC_ASSERT_ALWAYS)
michael@0 5101 MOZ_RAW=1
michael@0 5102 MOZ_VPX=1
michael@0 5103 MOZ_VPX_ERROR_CONCEALMENT=1
michael@0 5104
michael@0 5105 dnl enable once Signaling lands
michael@0 5106 MOZ_WEBRTC_SIGNALING=1
michael@0 5107 AC_DEFINE(MOZ_WEBRTC_SIGNALING)
michael@0 5108 dnl enable once PeerConnection lands
michael@0 5109 MOZ_PEERCONNECTION=1
michael@0 5110 AC_DEFINE(MOZ_PEERCONNECTION)
michael@0 5111 MOZ_SCTP=1
michael@0 5112 MOZ_SRTP=1
michael@0 5113 AC_DEFINE(MOZ_SCTP)
michael@0 5114 AC_DEFINE(MOZ_SRTP)
michael@0 5115 else
michael@0 5116 MOZ_SYNTH_PICO=
michael@0 5117 fi
michael@0 5118
michael@0 5119 AC_SUBST(MOZ_WEBRTC)
michael@0 5120 AC_SUBST(MOZ_WEBRTC_LEAKING_TESTS)
michael@0 5121 AC_SUBST(MOZ_WEBRTC_SIGNALING)
michael@0 5122 AC_SUBST(MOZ_PEERCONNECTION)
michael@0 5123 AC_SUBST(MOZ_WEBRTC_ASSERT_ALWAYS)
michael@0 5124 AC_SUBST(MOZ_SCTP)
michael@0 5125 AC_SUBST(MOZ_SRTP)
michael@0 5126
michael@0 5127 dnl Use integers over floats for audio on B2G and Android
michael@0 5128 dnl (regarless of the CPU architecture, because audio
michael@0 5129 dnl backends for those platforms don't support floats. We also
michael@0 5130 dnl use integers on ARM with other OS, because it's more efficient.
michael@0 5131 if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then
michael@0 5132 MOZ_SAMPLE_TYPE_S16=1
michael@0 5133 AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
michael@0 5134 AC_SUBST(MOZ_SAMPLE_TYPE_S16)
michael@0 5135 else
michael@0 5136 MOZ_SAMPLE_TYPE_FLOAT32=1
michael@0 5137 AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32)
michael@0 5138 AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32)
michael@0 5139 fi
michael@0 5140
michael@0 5141 dnl ========================================================
michael@0 5142 dnl = Disable Speech API code
michael@0 5143 dnl ========================================================
michael@0 5144 MOZ_ARG_DISABLE_BOOL(webspeech,
michael@0 5145 [ --disable-webspeech Disable support for HTML Speech API],
michael@0 5146 MOZ_WEBSPEECH=,
michael@0 5147 MOZ_WEBSPEECH=1)
michael@0 5148
michael@0 5149 if test -n "$MOZ_WEBSPEECH"; then
michael@0 5150 AC_DEFINE(MOZ_WEBSPEECH)
michael@0 5151 fi
michael@0 5152
michael@0 5153 AC_SUBST(MOZ_WEBSPEECH)
michael@0 5154
michael@0 5155 dnl ========================================================
michael@0 5156 dnl = Enable Raw Codecs
michael@0 5157 dnl ========================================================
michael@0 5158 MOZ_ARG_ENABLE_BOOL(raw,
michael@0 5159 [ --enable-raw Enable support for RAW media],
michael@0 5160 MOZ_RAW=1,
michael@0 5161 MOZ_RAW=)
michael@0 5162
michael@0 5163 if test -n "$MOZ_RAW"; then
michael@0 5164 AC_DEFINE(MOZ_RAW)
michael@0 5165 fi
michael@0 5166
michael@0 5167 AC_SUBST(MOZ_RAW)
michael@0 5168
michael@0 5169 dnl Checks for __attribute__(aligned()) directive need by libogg
michael@0 5170 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
michael@0 5171 [ac_cv_c_attribute_aligned],
michael@0 5172 [ac_cv_c_attribute_aligned=0
michael@0 5173 CFLAGS_save="${CFLAGS}"
michael@0 5174 CFLAGS="${CFLAGS} -Werror"
michael@0 5175 for ac_cv_c_attr_align_try in 64 32 16 8; do
michael@0 5176 echo "trying $ac_cv_c_attr_align_try"
michael@0 5177 AC_TRY_COMPILE([],
michael@0 5178 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
michael@0 5179 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
michael@0 5180 if test "$ac_cv_c_attribute_aligned" != 0; then
michael@0 5181 break;
michael@0 5182 fi
michael@0 5183 done
michael@0 5184 CFLAGS="${CFLAGS_save}"])
michael@0 5185 if test "${ac_cv_c_attribute_aligned}" != "0"; then
michael@0 5186 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
michael@0 5187 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
michael@0 5188 fi
michael@0 5189
michael@0 5190 dnl ========================================================
michael@0 5191 dnl = Disable Opus audio codec support
michael@0 5192 dnl ========================================================
michael@0 5193 MOZ_ARG_DISABLE_BOOL(opus,
michael@0 5194 [ --disable-opus Disable support for Opus audio],
michael@0 5195 MOZ_OPUS=,
michael@0 5196 MOZ_OPUS=1)
michael@0 5197
michael@0 5198 dnl ========================================================
michael@0 5199 dnl = Disable VP8 decoder support
michael@0 5200 dnl ========================================================
michael@0 5201 MOZ_ARG_DISABLE_BOOL(webm,
michael@0 5202 [ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)],
michael@0 5203 MOZ_WEBM=,
michael@0 5204 MOZ_WEBM=1)
michael@0 5205
michael@0 5206 if test -n "$MOZ_WEBM"; then
michael@0 5207 AC_DEFINE(MOZ_WEBM)
michael@0 5208 MOZ_VPX=1
michael@0 5209 fi;
michael@0 5210
michael@0 5211 dnl ========================================================
michael@0 5212 dnl = DirectShow support
michael@0 5213 dnl ========================================================
michael@0 5214 if test "$OS_ARCH" = "WINNT"; then
michael@0 5215 dnl Enable DirectShow support by default.
michael@0 5216 MOZ_DIRECTSHOW=1
michael@0 5217 fi
michael@0 5218
michael@0 5219 MOZ_ARG_DISABLE_BOOL(directshow,
michael@0 5220 [ --disable-directshow Disable support for DirectShow],
michael@0 5221 MOZ_DIRECTSHOW=,
michael@0 5222 MOZ_DIRECTSHOW=1)
michael@0 5223
michael@0 5224 if test -n "$MOZ_DIRECTSHOW"; then
michael@0 5225 AC_DEFINE(MOZ_DIRECTSHOW)
michael@0 5226 fi;
michael@0 5227
michael@0 5228 dnl ========================================================
michael@0 5229 dnl = Windows Media Foundation support
michael@0 5230 dnl ========================================================
michael@0 5231 if test "$OS_ARCH" = "WINNT"; then
michael@0 5232 dnl Enable Windows Media Foundation support by default.
michael@0 5233 dnl Note our minimum SDK version is Windows 7 SDK, so we are (currently)
michael@0 5234 dnl guaranteed to have a recent-enough SDK to build WMF.
michael@0 5235 MOZ_WMF=1
michael@0 5236 fi
michael@0 5237
michael@0 5238 MOZ_ARG_DISABLE_BOOL(wmf,
michael@0 5239 [ --disable-wmf Disable support for Windows Media Foundation],
michael@0 5240 MOZ_WMF=,
michael@0 5241 MOZ_WMF=1)
michael@0 5242
michael@0 5243 if test -n "$MOZ_WMF"; then
michael@0 5244 AC_DEFINE(MOZ_WMF)
michael@0 5245 fi;
michael@0 5246
michael@0 5247 dnl ========================================================
michael@0 5248 dnl FFmpeg H264/AAC Decoding Support
michael@0 5249 dnl ========================================================
michael@0 5250 case "$OS_TARGET" in
michael@0 5251 WINNT|Darwin|Android)
michael@0 5252 ;;
michael@0 5253 *)
michael@0 5254 MOZ_FFMPEG=1
michael@0 5255 ;;
michael@0 5256 esac
michael@0 5257
michael@0 5258 MOZ_ARG_DISABLE_BOOL(ffmpeg,
michael@0 5259 [ --disable-ffmpeg Disable FFmpeg for fragmented H264/AAC decoding],
michael@0 5260 MOZ_FFMPEG=,
michael@0 5261 MOZ_FFMPEG=1
michael@0 5262 )
michael@0 5263
michael@0 5264 if test -n "$MOZ_FFMPEG"; then
michael@0 5265 AC_DEFINE(MOZ_FFMPEG)
michael@0 5266 fi;
michael@0 5267
michael@0 5268 dnl ========================================================
michael@0 5269 dnl = Built-in fragmented MP4 support.
michael@0 5270 dnl ========================================================
michael@0 5271 if test -n "$MOZ_WMF" -o -n "$MOZ_FFMPEG"; then
michael@0 5272 dnl Enable fragmented MP4 parser on Windows by default.
michael@0 5273 dnl We will also need to enable it on other platforms as we implement
michael@0 5274 dnl platform decoder support there too.
michael@0 5275 MOZ_FMP4=1
michael@0 5276 fi
michael@0 5277
michael@0 5278 MOZ_ARG_DISABLE_BOOL(fmp4,
michael@0 5279 [ --disable-fmp4 Disable support for in built Fragmented MP4 parsing],
michael@0 5280 MOZ_FMP4=,
michael@0 5281 MOZ_FMP4=1)
michael@0 5282
michael@0 5283 if test -n "$MOZ_FMP4"; then
michael@0 5284 AC_DEFINE(MOZ_FMP4)
michael@0 5285 fi;
michael@0 5286
michael@0 5287
michael@0 5288 dnl ========================================================
michael@0 5289 dnl = Enable media plugin support
michael@0 5290 dnl ========================================================
michael@0 5291 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
michael@0 5292 dnl Enable support on android by default
michael@0 5293 MOZ_MEDIA_PLUGINS=1
michael@0 5294 fi
michael@0 5295
michael@0 5296 MOZ_ARG_ENABLE_BOOL(media-plugins,
michael@0 5297 [ --enable-media-plugins Enable support for media plugins],
michael@0 5298 MOZ_MEDIA_PLUGINS=1,
michael@0 5299 MOZ_MEDIA_PLUGINS=)
michael@0 5300
michael@0 5301 if test -n "$MOZ_MEDIA_PLUGINS"; then
michael@0 5302 AC_DEFINE(MOZ_MEDIA_PLUGINS)
michael@0 5303 fi
michael@0 5304
michael@0 5305 dnl ========================================================
michael@0 5306 dnl = Disable platform MP3 decoder on OSX
michael@0 5307 dnl ========================================================
michael@0 5308 if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
michael@0 5309 MOZ_APPLEMEDIA=1
michael@0 5310 fi
michael@0 5311
michael@0 5312 MOZ_ARG_DISABLE_BOOL(apple-media,
michael@0 5313 [ --disable-apple-media Disable support for Apple AudioToolbox/VideoToolbox],
michael@0 5314 MOZ_APPLEMEDIA=,
michael@0 5315 MOZ_APPLEMEDIA=1)
michael@0 5316
michael@0 5317 if test -n "$MOZ_APPLEMEDIA"; then
michael@0 5318 AC_DEFINE(MOZ_APPLEMEDIA)
michael@0 5319 fi
michael@0 5320
michael@0 5321 dnl ========================================================
michael@0 5322 dnl = Enable getUserMedia support
michael@0 5323 dnl ========================================================
michael@0 5324 MOZ_ARG_ENABLE_BOOL(media-navigator,
michael@0 5325 [ --enable-media-navigator Enable support for getUserMedia],
michael@0 5326 MOZ_MEDIA_NAVIGATOR=1,
michael@0 5327 MOZ_MEDIA_NAVIGATOR=)
michael@0 5328
michael@0 5329 if test -n "$MOZ_MEDIA_NAVIGATOR"; then
michael@0 5330 AC_DEFINE(MOZ_MEDIA_NAVIGATOR)
michael@0 5331 fi
michael@0 5332
michael@0 5333 dnl ========================================================
michael@0 5334 dnl = Enable building OMX media plugin (B2G or Android)
michael@0 5335 dnl ========================================================
michael@0 5336 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
michael@0 5337 dnl Enable support on android by default
michael@0 5338 MOZ_OMX_PLUGIN=1
michael@0 5339 fi
michael@0 5340
michael@0 5341 MOZ_ARG_ENABLE_BOOL(omx-plugin,
michael@0 5342 [ --enable-omx-plugin Enable building OMX plugin (B2G)],
michael@0 5343 MOZ_OMX_PLUGIN=1,
michael@0 5344 MOZ_OMX_PLUGIN=)
michael@0 5345
michael@0 5346 if test -n "$MOZ_OMX_PLUGIN"; then
michael@0 5347 if test "$OS_TARGET" = "Android"; then
michael@0 5348 dnl Only allow building OMX plugin on Gonk (B2G) or Android
michael@0 5349 AC_DEFINE(MOZ_OMX_PLUGIN)
michael@0 5350 else
michael@0 5351 dnl fail if we're not building on Gonk or Android
michael@0 5352 AC_MSG_ERROR([OMX media plugin can only be built on B2G or Android])
michael@0 5353 fi
michael@0 5354 fi
michael@0 5355
michael@0 5356 dnl system libvpx Support
michael@0 5357 dnl ========================================================
michael@0 5358 MOZ_ARG_WITH_BOOL(system-libvpx,
michael@0 5359 [ --with-system-libvpx Use system libvpx (located with pkgconfig)],
michael@0 5360 MOZ_NATIVE_LIBVPX=1)
michael@0 5361
michael@0 5362 MOZ_LIBVPX_CFLAGS=
michael@0 5363 MOZ_LIBVPX_LIBS=
michael@0 5364
michael@0 5365 if test -n "$MOZ_VPX"; then
michael@0 5366 AC_DEFINE(MOZ_VPX)
michael@0 5367 if test -n "$MOZ_VPX_ERROR_CONCEALMENT" ; then
michael@0 5368 AC_DEFINE(MOZ_VPX_ERROR_CONCEALMENT)
michael@0 5369 fi
michael@0 5370
michael@0 5371 _SAVE_CFLAGS=$CFLAGS
michael@0 5372 _SAVE_LIBS=$LIBS
michael@0 5373 if test -n "$MOZ_NATIVE_LIBVPX"; then
michael@0 5374 dnl ============================
michael@0 5375 dnl === libvpx Version check ===
michael@0 5376 dnl ============================
michael@0 5377 dnl Check to see if we have a system libvpx package.
michael@0 5378 PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.3.0)
michael@0 5379
michael@0 5380 CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS"
michael@0 5381 LIBS="$LIBS $MOZ_LIBVPX_LIBS"
michael@0 5382
michael@0 5383 MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
michael@0 5384 [AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])])
michael@0 5385
michael@0 5386 AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
michael@0 5387 [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
michael@0 5388
michael@0 5389 MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h],
michael@0 5390 [AC_CHECK_FUNC(vpx_mem_set_functions)])
michael@0 5391 if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \
michael@0 5392 "$ac_cv_func_vpx_mem_set_functions" = no; then
michael@0 5393 AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING)
michael@0 5394 fi
michael@0 5395 fi
michael@0 5396 CFLAGS=$_SAVE_CFLAGS
michael@0 5397 LIBS=$_SAVE_LIBS
michael@0 5398 fi
michael@0 5399
michael@0 5400 AC_SUBST(MOZ_NATIVE_LIBVPX)
michael@0 5401 AC_SUBST(MOZ_LIBVPX_CFLAGS)
michael@0 5402 AC_SUBST(MOZ_LIBVPX_LIBS)
michael@0 5403
michael@0 5404 if test "$MOZ_WEBM"; then
michael@0 5405 if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then
michael@0 5406 MOZ_VORBIS=1
michael@0 5407 else
michael@0 5408 MOZ_TREMOR=1
michael@0 5409 fi
michael@0 5410 fi
michael@0 5411
michael@0 5412 if test -n "$MOZ_VPX" -a -z "$MOZ_NATIVE_LIBVPX"; then
michael@0 5413
michael@0 5414 dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
michael@0 5415 dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
michael@0 5416 dnl We currently require gcc on all arm platforms.
michael@0 5417 VPX_AS=$YASM
michael@0 5418 VPX_ASM_SUFFIX=asm
michael@0 5419 VPX_NEED_OBJ_INT_EXTRACT=
michael@0 5420
michael@0 5421 dnl See if we have assembly on this platform.
michael@0 5422 case "$OS_ARCH:$CPU_ARCH" in
michael@0 5423 Darwin:x86)
michael@0 5424 VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
michael@0 5425 VPX_X86_ASM=1
michael@0 5426 ;;
michael@0 5427 Darwin:x86_64)
michael@0 5428 VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC"
michael@0 5429 VPX_X86_ASM=1
michael@0 5430 ;;
michael@0 5431 WINNT:x86_64)
michael@0 5432 VPX_ASFLAGS="-f x64 -rnasm -pnasm"
michael@0 5433 VPX_X86_ASM=1
michael@0 5434 ;;
michael@0 5435 WINNT:x86)
michael@0 5436 dnl Check for yasm 1.1 or greater.
michael@0 5437 if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
michael@0 5438 AC_MSG_ERROR([yasm 1.1 or greater is required to build libvpx on Win32, but it appears not to be installed. Install it (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
michael@0 5439 elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
michael@0 5440 AC_MSG_ERROR([yasm 1.1 or greater is required to build libvpx on Win32, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION. Upgrade to the newest version (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
michael@0 5441 else
michael@0 5442 VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC"
michael@0 5443 VPX_X86_ASM=1
michael@0 5444 dnl The encoder needs obj_int_extract to get asm offsets.
michael@0 5445 fi
michael@0 5446 ;;
michael@0 5447 *:arm*)
michael@0 5448 if test -n "$GNU_AS" ; then
michael@0 5449 VPX_AS=$AS
michael@0 5450 dnl These flags are a lie; they're just used to enable the requisite
michael@0 5451 dnl opcodes; actual arch detection is done at runtime.
michael@0 5452 VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
michael@0 5453 VPX_DASH_C_FLAG="-c"
michael@0 5454 VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
michael@0 5455 VPX_ASM_SUFFIX="$ASM_SUFFIX"
michael@0 5456 VPX_ARM_ASM=1
michael@0 5457 fi
michael@0 5458 ;;
michael@0 5459 *:x86)
michael@0 5460 if $CC -E -dM -</dev/null | grep -q __ELF__; then
michael@0 5461 VPX_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC"
michael@0 5462 VPX_X86_ASM=1
michael@0 5463 fi
michael@0 5464 ;;
michael@0 5465 *:x86_64)
michael@0 5466 if $CC -E -dM -</dev/null | grep -q __ELF__; then
michael@0 5467 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
michael@0 5468 VPX_X86_ASM=1
michael@0 5469 fi
michael@0 5470 ;;
michael@0 5471 esac
michael@0 5472
michael@0 5473 if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
michael@0 5474 AC_MSG_ERROR([yasm is a required build tool for this architecture when webm is enabled. You may either install yasm or --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
michael@0 5475 fi
michael@0 5476
michael@0 5477 if test -z "$GNU_CC" -a -z "$INTEL_CC" -a -z "$CLANG_CC" ; then
michael@0 5478 dnl We prefer to get asm offsets using inline assembler, which the above
michael@0 5479 dnl compilers can do. When we're not using one of those, we have to fall
michael@0 5480 dnl back to obj_int_extract, which reads them from a compiled object
michael@0 5481 dnl file. Unfortunately, that only works if we're compiling on a system
michael@0 5482 dnl with the header files for the appropriate object file format.
michael@0 5483 VPX_NEED_OBJ_INT_EXTRACT=1
michael@0 5484 fi
michael@0 5485
michael@0 5486 if test -n "$VPX_X86_ASM"; then
michael@0 5487 AC_DEFINE(VPX_X86_ASM)
michael@0 5488 elif test -n "$VPX_ARM_ASM"; then
michael@0 5489 AC_DEFINE(VPX_ARM_ASM)
michael@0 5490 else
michael@0 5491 AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
michael@0 5492 fi
michael@0 5493 fi
michael@0 5494
michael@0 5495 dnl ========================================================
michael@0 5496 dnl = Disable Wave decoder support
michael@0 5497 dnl ========================================================
michael@0 5498 MOZ_ARG_DISABLE_BOOL(wave,
michael@0 5499 [ --disable-wave Disable Wave decoder support],
michael@0 5500 MOZ_WAVE=,
michael@0 5501 MOZ_WAVE=1)
michael@0 5502
michael@0 5503 if test -n "$MOZ_WAVE"; then
michael@0 5504 AC_DEFINE(MOZ_WAVE)
michael@0 5505 fi
michael@0 5506
michael@0 5507 dnl ========================================================
michael@0 5508 dnl = Handle dependent MEDIA defines
michael@0 5509 dnl ========================================================
michael@0 5510
michael@0 5511 if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
michael@0 5512 AC_MSG_ERROR([MOZ_VORBIS and MOZ_TREMOR are mutually exclusive! The build system should not allow them both to be set, but they are. Please file a bug at https://bugzilla.mozilla.org/])
michael@0 5513 fi
michael@0 5514
michael@0 5515 if test -n "$MOZ_WEBRTC" -a -z "$MOZ_OPUS"; then
michael@0 5516 AC_MSG_ERROR([MOZ_WEBRTC requires MOZ_OPUS which is disabled.])
michael@0 5517 fi
michael@0 5518
michael@0 5519 if test -n "$MOZ_VORBIS"; then
michael@0 5520 AC_DEFINE(MOZ_VORBIS)
michael@0 5521 fi
michael@0 5522
michael@0 5523 if test -n "$MOZ_TREMOR"; then
michael@0 5524 AC_DEFINE(MOZ_TREMOR)
michael@0 5525 # Tremor doesn't have an encoder.
michael@0 5526 MOZ_WEBM_ENCODER=
michael@0 5527 fi
michael@0 5528
michael@0 5529 if test -n "$MOZ_OPUS"; then
michael@0 5530 AC_DEFINE(MOZ_OPUS)
michael@0 5531 fi
michael@0 5532
michael@0 5533 if test -n "$MOZ_WEBM_ENCODER"; then
michael@0 5534 AC_DEFINE(MOZ_WEBM_ENCODER)
michael@0 5535 fi
michael@0 5536 AC_SUBST(MOZ_WEBM_ENCODER)
michael@0 5537
michael@0 5538 dnl ==================================
michael@0 5539 dnl = Check alsa availability on Linux
michael@0 5540 dnl ==================================
michael@0 5541
michael@0 5542 dnl If using Linux, ensure that the alsa library is available
michael@0 5543 if test "$OS_TARGET" = "Linux"; then
michael@0 5544 MOZ_ALSA=1
michael@0 5545 fi
michael@0 5546
michael@0 5547 MOZ_ARG_ENABLE_BOOL(alsa,
michael@0 5548 [ --enable-alsa Enable Alsa support (default on Linux)],
michael@0 5549 MOZ_ALSA=1,
michael@0 5550 MOZ_ALSA=)
michael@0 5551
michael@0 5552 if test -n "$MOZ_ALSA"; then
michael@0 5553 PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
michael@0 5554 [echo "$MOZ_ALSA_PKG_ERRORS"
michael@0 5555 AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
michael@0 5556 fi
michael@0 5557
michael@0 5558 AC_SUBST(MOZ_ALSA)
michael@0 5559 AC_SUBST(MOZ_ALSA_CFLAGS)
michael@0 5560 AC_SUBST(MOZ_ALSA_LIBS)
michael@0 5561
michael@0 5562 dnl ========================================================
michael@0 5563 dnl = Disable PulseAudio
michael@0 5564 dnl ========================================================
michael@0 5565
michael@0 5566 dnl If using Linux, ensure that the PA library is available
michael@0 5567 case "$OS_TARGET" in
michael@0 5568 WINNT|Darwin|Android|OpenBSD)
michael@0 5569 ;;
michael@0 5570 *)
michael@0 5571 if test -z "$MOZ_B2G"; then
michael@0 5572 MOZ_PULSEAUDIO=1
michael@0 5573 fi
michael@0 5574 ;;
michael@0 5575 esac
michael@0 5576
michael@0 5577 MOZ_ARG_DISABLE_BOOL(pulseaudio,
michael@0 5578 [ --disable-pulseaudio Disable PulseAudio support],
michael@0 5579 MOZ_PULSEAUDIO=,
michael@0 5580 MOZ_PULSEAUDIO=1)
michael@0 5581
michael@0 5582 if test -n "$MOZ_PULSEAUDIO"; then
michael@0 5583 if test -z "$gonkdir"; then
michael@0 5584 PKG_CHECK_MODULES(MOZ_PULSEAUDIO, libpulse, ,
michael@0 5585 [echo "$MOZ_PULSEAUDIO_PKG_ERRORS"
michael@0 5586 AC_MSG_ERROR([pulseaudio audio backend requires libpulse development package])])
michael@0 5587 else
michael@0 5588 MOZ_PULSEAUDIO_CFLAGS="-I$gonkdir/external/pulseaudio/pulseaudio/src"
michael@0 5589 fi
michael@0 5590 fi
michael@0 5591
michael@0 5592 AC_SUBST(MOZ_PULSEAUDIO)
michael@0 5593 AC_SUBST(MOZ_PULSEAUDIO_CFLAGS)
michael@0 5594
michael@0 5595 dnl ========================================================
michael@0 5596 dnl = Enable GStreamer
michael@0 5597 dnl ========================================================
michael@0 5598 case "$OS_TARGET" in
michael@0 5599 WINNT|Darwin|Android)
michael@0 5600 ;;
michael@0 5601 *)
michael@0 5602 MOZ_GSTREAMER=1
michael@0 5603 GST_API_VERSION=0.10
michael@0 5604 ;;
michael@0 5605 esac
michael@0 5606
michael@0 5607 MOZ_ARG_ENABLE_STRING(gstreamer,
michael@0 5608 [ --enable-gstreamer[=0.10] Enable GStreamer support],
michael@0 5609 [ MOZ_GSTREAMER=1
michael@0 5610 # API version, eg 0.10, 1.0 etc
michael@0 5611 if test -z "$enableval" -o "$enableval" = "yes"; then
michael@0 5612 GST_API_VERSION=0.10
michael@0 5613 elif test "$enableval" = "no"; then
michael@0 5614 MOZ_GSTREAMER=
michael@0 5615 else
michael@0 5616 GST_API_VERSION=$enableval
michael@0 5617 fi],
michael@0 5618 )
michael@0 5619
michael@0 5620 if test -n "$MOZ_GSTREAMER"; then
michael@0 5621 # core/base release number
michael@0 5622 if test "$GST_API_VERSION" = "1.0"; then
michael@0 5623 GST_VERSION=1.0
michael@0 5624 else
michael@0 5625 GST_VERSION=0.10.25
michael@0 5626 fi
michael@0 5627
michael@0 5628 PKG_CHECK_MODULES(GSTREAMER,
michael@0 5629 gstreamer-$GST_API_VERSION >= $GST_VERSION
michael@0 5630 gstreamer-app-$GST_API_VERSION
michael@0 5631 gstreamer-plugins-base-$GST_API_VERSION,
michael@0 5632 [_HAVE_GSTREAMER=1],
michael@0 5633 [_HAVE_GSTREAMER=])
michael@0 5634 if test -z "$_HAVE_GSTREAMER"; then
michael@0 5635 AC_MSG_ERROR([gstreamer and gstreamer-plugins-base development packages are needed to build gstreamer backend. Install them or disable gstreamer support with --disable-gstreamer])
michael@0 5636 fi
michael@0 5637
michael@0 5638 _SAVE_LDFLAGS=$LDFLAGS
michael@0 5639 LDFLAGS="$LDFLAGS $GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
michael@0 5640 AC_TRY_LINK(,[return 0;],_HAVE_LIBGSTVIDEO=1,_HAVE_LIBGSTVIDEO=)
michael@0 5641 if test -n "$_HAVE_LIBGSTVIDEO" ; then
michael@0 5642 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
michael@0 5643 else
michael@0 5644 AC_MSG_ERROR([gstreamer-plugins-base found, but no libgstvideo. Something has gone terribly wrong. Try reinstalling gstreamer-plugins-base; failing that, disable the gstreamer backend with --disable-gstreamer.])
michael@0 5645 fi
michael@0 5646 LDFLAGS=$_SAVE_LDFLAGS
michael@0 5647
michael@0 5648 AC_SUBST(GSTREAMER_CFLAGS)
michael@0 5649 AC_SUBST(GSTREAMER_LIBS)
michael@0 5650 fi
michael@0 5651
michael@0 5652 AC_SUBST(MOZ_GSTREAMER)
michael@0 5653 AC_SUBST(GST_API_VERSION)
michael@0 5654
michael@0 5655 if test -n "$MOZ_GSTREAMER"; then
michael@0 5656 AC_DEFINE(MOZ_GSTREAMER)
michael@0 5657 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION")
michael@0 5658 fi
michael@0 5659
michael@0 5660
michael@0 5661 dnl ========================================================
michael@0 5662 dnl Permissions System
michael@0 5663 dnl ========================================================
michael@0 5664 MOZ_ARG_DISABLE_BOOL(permissions,
michael@0 5665 [ --disable-permissions Disable permissions (popup and cookie blocking)],
michael@0 5666 MOZ_PERMISSIONS=,
michael@0 5667 MOZ_PERMISSIONS=1
michael@0 5668 )
michael@0 5669
michael@0 5670 dnl ========================================================
michael@0 5671 dnl Child permissions, currently only used for b2g
michael@0 5672 dnl ========================================================
michael@0 5673 if test -n "$MOZ_B2G"; then
michael@0 5674 if test -n "$MOZ_PERMISSIONS"; then
michael@0 5675 MOZ_CHILD_PERMISSIONS=1
michael@0 5676 else
michael@0 5677 AC_MSG_ERROR([You need to enable MOZ_PERMISSIONS for MOZ_CHILD_PERMISSIONS])
michael@0 5678 fi
michael@0 5679 fi
michael@0 5680 AC_SUBST(MOZ_CHILD_PERMISSIONS)
michael@0 5681
michael@0 5682 dnl ========================================================
michael@0 5683 dnl NegotiateAuth
michael@0 5684 dnl ========================================================
michael@0 5685 MOZ_ARG_DISABLE_BOOL(negotiateauth,
michael@0 5686 [ --disable-negotiateauth Disable GSS-API negotiation ],
michael@0 5687 MOZ_AUTH_EXTENSION=,
michael@0 5688 MOZ_AUTH_EXTENSION=1 )
michael@0 5689
michael@0 5690 dnl ========================================================
michael@0 5691 dnl Pref extensions (autoconfig)
michael@0 5692 dnl ========================================================
michael@0 5693 MOZ_ARG_DISABLE_BOOL(pref-extensions,
michael@0 5694 [ --disable-pref-extensions
michael@0 5695 Disable pref extensions such as autoconfig],
michael@0 5696 MOZ_PREF_EXTENSIONS=,
michael@0 5697 MOZ_PREF_EXTENSIONS=1 )
michael@0 5698
michael@0 5699 dnl ========================================================
michael@0 5700 dnl Searching of system directories for extensions.
michael@0 5701 dnl Note: this switch is meant to be used for test builds
michael@0 5702 dnl whose behavior should not depend on what happens to be
michael@0 5703 dnl installed on the local machine.
michael@0 5704 dnl ========================================================
michael@0 5705 MOZ_ARG_DISABLE_BOOL(system-extension-dirs,
michael@0 5706 [ --disable-system-extension-dirs
michael@0 5707 Disable searching system- and account-global
michael@0 5708 directories for extensions of any kind; use
michael@0 5709 only profile-specific extension directories],
michael@0 5710 ENABLE_SYSTEM_EXTENSION_DIRS=,
michael@0 5711 ENABLE_SYSTEM_EXTENSION_DIRS=1 )
michael@0 5712 if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then
michael@0 5713 AC_DEFINE(ENABLE_SYSTEM_EXTENSION_DIRS)
michael@0 5714 fi
michael@0 5715
michael@0 5716 dnl ========================================================
michael@0 5717 dnl = Universalchardet
michael@0 5718 dnl ========================================================
michael@0 5719 MOZ_ARG_DISABLE_BOOL(universalchardet,
michael@0 5720 [ --disable-universalchardet
michael@0 5721 Disable universal encoding detection],
michael@0 5722 MOZ_UNIVERSALCHARDET=,
michael@0 5723 MOZ_UNIVERSALCHARDET=1 )
michael@0 5724
michael@0 5725 if test -n "${JAVA_BIN_PATH}"; then
michael@0 5726 dnl Look for javac and jar in the specified path.
michael@0 5727 JAVA_PATH="$JAVA_BIN_PATH"
michael@0 5728 else
michael@0 5729 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
michael@0 5730 JAVA_PATH="$JAVA_HOME/bin:$PATH"
michael@0 5731 fi
michael@0 5732
michael@0 5733 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
michael@0 5734 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
michael@0 5735 MOZ_PATH_PROG(JAVAH, javah, :, [$JAVA_PATH])
michael@0 5736 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
michael@0 5737 MOZ_PATH_PROG(JARSIGNER, jarsigner, :, [$JAVA_PATH])
michael@0 5738 MOZ_PATH_PROG(KEYTOOL, keytool, :, [$JAVA_PATH])
michael@0 5739
michael@0 5740 if test -n "${JAVA_BIN_PATH}" -o \
michael@0 5741 \( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then
michael@0 5742 if test -z "$JAVA" -o "$JAVA" = ":"; then
michael@0 5743 AC_MSG_ERROR([The program java was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
michael@0 5744 fi
michael@0 5745 if test -z "$JAVAC" -o "$JAVAC" = ":"; then
michael@0 5746 AC_MSG_ERROR([The program javac was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
michael@0 5747 fi
michael@0 5748 if test -z "$JAVAH" -o "$JAVAH" = ":"; then
michael@0 5749 AC_MSG_ERROR([The program javah was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
michael@0 5750 fi
michael@0 5751 if test -z "$JAR" -o "$JAR" = ":"; then
michael@0 5752 AC_MSG_ERROR([The program jar was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
michael@0 5753 fi
michael@0 5754 if test -z "$JARSIGNER" -o "$JARSIGNER" = ":"; then
michael@0 5755 AC_MSG_ERROR([The program jarsigner was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
michael@0 5756 fi
michael@0 5757 if test -z "$KEYTOOL" -o "$KEYTOOL" = ":"; then
michael@0 5758 AC_MSG_ERROR([The program keytool was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
michael@0 5759 fi
michael@0 5760 fi
michael@0 5761
michael@0 5762 dnl ========================================================
michael@0 5763 dnl = ANGLE OpenGL->D3D translator for WebGL
michael@0 5764 dnl = * only applies to win32
michael@0 5765 dnl = * enabled by default (shipping build); requires explicit --disable to disable
michael@0 5766 dnl ========================================================
michael@0 5767 MOZ_ANGLE_RENDERER=
michael@0 5768 MOZ_DIRECTX_SDK_CPU_SUFFIX=
michael@0 5769 MOZ_DIRECTX_SDK_PATH=
michael@0 5770 MOZ_D3DCOMPILER_DLL=
michael@0 5771 MOZ_HAS_WINSDK_WITH_D3D=
michael@0 5772 MOZ_D3DCOMPILER_DLL_PATH=
michael@0 5773 MOZ_D3DCOMPILER_CAB=
michael@0 5774 case "$target_os" in
michael@0 5775 *mingw*)
michael@0 5776 MOZ_ANGLE_RENDERER=1
michael@0 5777 ;;
michael@0 5778 esac
michael@0 5779
michael@0 5780 # The DirectX SDK libraries are split into x86 and x64 sub-directories
michael@0 5781 case "${target_cpu}" in
michael@0 5782 i*86)
michael@0 5783 MOZ_DIRECTX_SDK_CPU_SUFFIX=x86
michael@0 5784 ;;
michael@0 5785 x86_64)
michael@0 5786 MOZ_DIRECTX_SDK_CPU_SUFFIX=x64
michael@0 5787 ;;
michael@0 5788 esac
michael@0 5789
michael@0 5790 MOZ_ARG_DISABLE_BOOL(webgl,
michael@0 5791 [ --disable-webgl Disable building of the WebGL implementation],
michael@0 5792 MOZ_WEBGL_DISABLED=1,
michael@0 5793 MOZ_WEBGL_DISABLED=)
michael@0 5794
michael@0 5795 MOZ_ARG_ENABLE_BOOL(winsdk-directx,
michael@0 5796 [ --enable-winsdk-directx use DirectX SDK in Windows SDK],
michael@0 5797 MOZ_WINSDK_DIRECTX=1,
michael@0 5798 MOZ_WINSDK_DIRECTX=)
michael@0 5799
michael@0 5800 if test -n "$MOZ_WEBGL_DISABLED"; then
michael@0 5801 MOZ_WEBGL=
michael@0 5802 MOZ_ANGLE_RENDERER=
michael@0 5803 fi
michael@0 5804
michael@0 5805 if test -n "$MOZ_WEBGL"; then
michael@0 5806 AC_DEFINE(MOZ_WEBGL)
michael@0 5807 fi
michael@0 5808
michael@0 5809 if test -n "$MOZ_WEBGL_CONFORMANT"; then
michael@0 5810 AC_DEFINE(MOZ_WEBGL_CONFORMANT)
michael@0 5811 fi
michael@0 5812
michael@0 5813
michael@0 5814 # Locate a DirectX SDK here so we can use it for both ANGLE and
michael@0 5815 # Joystick support.
michael@0 5816 if test "$OS_TARGET" = "WINNT" -a -z "$CROSS_COMPILE"; then
michael@0 5817 # Get the SDK path from the registry.
michael@0 5818 # First try to get the June 2010 SDK
michael@0 5819 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1`
michael@0 5820 if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then
michael@0 5821 # Otherwise just take whatever comes first
michael@0 5822 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
michael@0 5823 fi
michael@0 5824 MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'`
michael@0 5825
michael@0 5826 if test -n "$MOZ_DIRECTX_SDK_PATH" &&
michael@0 5827 test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
michael@0 5828 AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH])
michael@0 5829 else
michael@0 5830 AC_MSG_RESULT([Couldn't find the DirectX SDK.])
michael@0 5831 fi
michael@0 5832 fi
michael@0 5833
michael@0 5834 # On mingw, check if headers are provided by toolchain.
michael@0 5835 if test "$OS_TARGET" = "WINNT" -a -n "$GNU_CC"; then
michael@0 5836 MOZ_CHECK_HEADER(d3d10.h, MOZ_HAS_WINSDK_WITH_D3D=1)
michael@0 5837 fi
michael@0 5838
michael@0 5839 dnl ========================================================
michael@0 5840 dnl D3D compiler DLL
michael@0 5841 dnl ========================================================
michael@0 5842
michael@0 5843 if test -n "$MOZ_ANGLE_RENDERER"; then
michael@0 5844 # Check that our DirectX SDK is acceptable.
michael@0 5845 if test -n "$MOZ_DIRECTX_SDK_PATH"; then
michael@0 5846 if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then
michael@0 5847 AC_MSG_RESULT([Found the February 2010 DirectX SDK, which is unacceptable to ANGLE.])
michael@0 5848 MOZ_DIRECTX_SDK_PATH_BAD=1
michael@0 5849 fi
michael@0 5850
michael@0 5851 if test -n "$MOZ_DIRECTX_SDK_PATH" &&
michael@0 5852 test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h &&
michael@0 5853 test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
michael@0 5854 AC_MSG_RESULT([Found acceptable DirectX SDK for ANGLE.])
michael@0 5855 else
michael@0 5856 AC_MSG_RESULT([Found DirectX SDK is unacceptable for ANGLE.])
michael@0 5857 MOZ_DIRECTX_SDK_PATH_BAD=1
michael@0 5858 fi
michael@0 5859 fi
michael@0 5860
michael@0 5861 if test -n "$MOZ_DIRECTX_SDK_PATH_BAD"; then
michael@0 5862 AC_MSG_ERROR([Couldn't find an acceptable DirectX SDK for ANGLE. Either install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.])
michael@0 5863 fi
michael@0 5864
michael@0 5865 # Find a D3D compiler DLL in a Windows SDK.
michael@0 5866 MOZ_D3DCOMPILER_DLL=
michael@0 5867 if test -n "$MOZ_WINSDK_DIRECTX"; then
michael@0 5868 case "$MOZ_WINSDK_MAXVER" in
michael@0 5869 0x0603*)
michael@0 5870 MOZ_D3DCOMPILER_DLL=d3dcompiler_47.dll
michael@0 5871 AC_MSG_RESULT([Found D3D compiler in Windows SDK 8.1.])
michael@0 5872 ;;
michael@0 5873 0x0602*)
michael@0 5874 MOZ_D3DCOMPILER_DLL=d3dcompiler_46.dll
michael@0 5875 AC_MSG_RESULT([Found D3D compiler in Windows SDK 8.0.])
michael@0 5876 ;;
michael@0 5877 esac
michael@0 5878 fi
michael@0 5879
michael@0 5880 if test -n "$MOZ_D3DCOMPILER_DLL"; then
michael@0 5881 # We have a name, now track down the path.
michael@0 5882 if test -n "$WINDOWSSDKDIR"; then
michael@0 5883 MOZ_D3DCOMPILER_DLL_PATH="$WINDOWSSDKDIR/Redist/D3D/$MOZ_DIRECTX_SDK_CPU_SUFFIX/$MOZ_D3DCOMPILER_DLL"
michael@0 5884 if test -f "$MOZ_D3DCOMPILER_DLL_PATH"; then
michael@0 5885 MOZ_HAS_WINSDK_WITH_D3D=1
michael@0 5886 AC_MSG_RESULT([Found MOZ_D3DCOMPILER_DLL_PATH: $MOZ_D3DCOMPILER_DLL_PATH])
michael@0 5887 else
michael@0 5888 AC_MSG_RESULT([MOZ_D3DCOMPILER_DLL_PATH doesn't exist: $MOZ_D3DCOMPILER_DLL_PATH])
michael@0 5889 fi
michael@0 5890 else
michael@0 5891 AC_MSG_RESULT([WINDOWSSDKDIR is missing.])
michael@0 5892 fi
michael@0 5893 fi
michael@0 5894
michael@0 5895 # Find a D3D compiler DLL in the DirectX SDK, if we didn't find one already.
michael@0 5896 # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib
michael@0 5897 if test -z "$MOZ_HAS_WINSDK_WITH_D3D"; then
michael@0 5898 MOZ_D3DX9_VERSION=`dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[[0-9]][[0-9]]\.dll | head -n1 | sed 's/.*\([[0-9]][[0-9]]\).*/\\1/g'`
michael@0 5899
michael@0 5900 if test -n "$MOZ_D3DX9_VERSION" ; then
michael@0 5901 MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
michael@0 5902 MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll
michael@0 5903 else
michael@0 5904 AC_MSG_RESULT([Couldn't determine the D3DX9 version for the DirectX SDK.])
michael@0 5905 fi
michael@0 5906
michael@0 5907 if test -z "$MOZ_D3DCOMPILER_CAB"; then
michael@0 5908 AC_MSG_RESULT([Couldn't find a CAB containing the D3D compiler DLL.])
michael@0 5909 fi
michael@0 5910 fi
michael@0 5911
michael@0 5912 if test -z "$MOZ_D3DCOMPILER_DLL_PATH" -a -z "$MOZ_D3DCOMPILER_CAB" -a -z "$CROSS_COMPILE"; then
michael@0 5913 AC_MSG_ERROR([Couldn't find an acceptable D3D compiler DLL. Either install Windows SDK 8.0+ and reconfigure with --enable-winsdk-directx, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.])
michael@0 5914 fi
michael@0 5915 fi
michael@0 5916
michael@0 5917
michael@0 5918 dnl ========================================================
michael@0 5919 dnl Gamepad support
michael@0 5920 dnl ========================================================
michael@0 5921 MOZ_GAMEPAD=
michael@0 5922 MOZ_GAMEPAD_BACKEND=stub
michael@0 5923
michael@0 5924 # Gamepad DOM is built on supported platforms by default.
michael@0 5925 case "$OS_TARGET" in
michael@0 5926 Darwin|WINNT|Linux)
michael@0 5927 MOZ_GAMEPAD=1
michael@0 5928 ;;
michael@0 5929 *)
michael@0 5930 ;;
michael@0 5931 esac
michael@0 5932
michael@0 5933 MOZ_ARG_DISABLE_BOOL(gamepad,
michael@0 5934 [ --disable-gamepad Disable gamepad support],
michael@0 5935 MOZ_GAMEPAD=,
michael@0 5936 MOZ_GAMEPAD=1)
michael@0 5937
michael@0 5938 if test "$MOZ_GAMEPAD"; then
michael@0 5939 case "$OS_TARGET" in
michael@0 5940 Darwin)
michael@0 5941 MOZ_GAMEPAD_BACKEND=cocoa
michael@0 5942 ;;
michael@0 5943 WINNT)
michael@0 5944 if test -z "$MOZ_HAS_WINSDK_WITH_D3D"; then
michael@0 5945 if test -n "$MOZ_DIRECTX_SDK_PATH" ; then
michael@0 5946 if ! test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
michael@0 5947 MOZ_GAMEPAD=
michael@0 5948 fi
michael@0 5949 elif test "$GCC" != "yes"; then
michael@0 5950 MOZ_GAMEPAD=
michael@0 5951 fi
michael@0 5952 fi
michael@0 5953 if test -z "$MOZ_GAMEPAD"; then
michael@0 5954 AC_MSG_ERROR([Couldn't find the DirectX SDK, needed for gamepad support. Please install it or, reconfigure with --disable-gamepad to disable gamepad support.])
michael@0 5955 fi
michael@0 5956 MOZ_GAMEPAD_BACKEND=windows
michael@0 5957 ;;
michael@0 5958 Linux)
michael@0 5959 MOZ_CHECK_HEADER([linux/joystick.h])
michael@0 5960 if test "$ac_cv_header_linux_joystick_h" != "yes"; then
michael@0 5961 AC_MSG_ERROR([Can't find header linux/joystick.h, needed for gamepad support. Please install Linux kernel headers or reconfigure with --disable-gamepad to disable gamepad support.])
michael@0 5962 fi
michael@0 5963 MOZ_GAMEPAD_BACKEND=linux
michael@0 5964 ;;
michael@0 5965 *)
michael@0 5966 ;;
michael@0 5967 esac
michael@0 5968
michael@0 5969 AC_DEFINE(MOZ_GAMEPAD)
michael@0 5970 fi
michael@0 5971 AC_SUBST(MOZ_GAMEPAD)
michael@0 5972 AC_SUBST(MOZ_GAMEPAD_BACKEND)
michael@0 5973
michael@0 5974 dnl ========================================================
michael@0 5975 dnl = Breakpad crash reporting (on by default on supported platforms)
michael@0 5976 dnl ========================================================
michael@0 5977
michael@0 5978 case $target in
michael@0 5979 i?86-*-mingw*|x86_64-*-mingw*)
michael@0 5980 MOZ_CRASHREPORTER=1
michael@0 5981 ;;
michael@0 5982 i?86-apple-darwin*|x86_64-apple-darwin*)
michael@0 5983 MOZ_CRASHREPORTER=1
michael@0 5984 ;;
michael@0 5985 i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
michael@0 5986 if test "$MOZ_ENABLE_GTK"; then
michael@0 5987 MOZ_CRASHREPORTER=1
michael@0 5988 fi
michael@0 5989 ;;
michael@0 5990 *-android*|*-linuxandroid*)
michael@0 5991 MOZ_CRASHREPORTER=1
michael@0 5992 ;;
michael@0 5993 *solaris*)
michael@0 5994 MOZ_CRASHREPORTER=1
michael@0 5995 ;;
michael@0 5996 esac
michael@0 5997
michael@0 5998 MOZ_ARG_DISABLE_BOOL(crashreporter,
michael@0 5999 [ --disable-crashreporter Disable breakpad crash reporting],
michael@0 6000 [MOZ_CRASHREPORTER=],
michael@0 6001 [MOZ_CRASHREPORTER=F # Force enable breakpad])
michael@0 6002
michael@0 6003 if test "$OS_ARCH" != "$HOST_OS_ARCH" -a "$OS_ARCH" != "WINNT"; then
michael@0 6004 if test "$MOZ_CRASHREPORTER" = F; then
michael@0 6005 AC_MSG_ERROR([Cannot --enable-crashreporter, as breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH.])
michael@0 6006 fi
michael@0 6007 MOZ_CRASHREPORTER=
michael@0 6008 fi
michael@0 6009
michael@0 6010 if test -n "$MOZ_CRASHREPORTER"; then
michael@0 6011 AC_DEFINE(MOZ_CRASHREPORTER)
michael@0 6012
michael@0 6013 if test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS" && \
michael@0 6014 test -z "$SKIP_LIBRARY_CHECKS"; then
michael@0 6015 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
michael@0 6016 AC_SUBST(MOZ_GTHREAD_CFLAGS)
michael@0 6017 AC_SUBST(MOZ_GTHREAD_LIBS)
michael@0 6018 fi
michael@0 6019
michael@0 6020 if test "$OS_ARCH" = "WINNT"; then
michael@0 6021 if test -z "$HAVE_64BIT_OS"; then
michael@0 6022 MOZ_CRASHREPORTER_INJECTOR=1
michael@0 6023 AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR)
michael@0 6024 fi
michael@0 6025 fi
michael@0 6026 fi
michael@0 6027
michael@0 6028 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
michael@0 6029 [ --with-crashreporter-enable-percent=NN
michael@0 6030 Enable sending crash reports by default on NN% of users. (default=100)],
michael@0 6031 [ val=`echo $withval | sed 's/[^0-9]//g'`
michael@0 6032 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
michael@0 6033
michael@0 6034 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
michael@0 6035 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
michael@0 6036 fi
michael@0 6037 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
michael@0 6038
michael@0 6039 dnl ========================================================
michael@0 6040 dnl = libjpeg-turbo configuration
michael@0 6041 dnl ========================================================
michael@0 6042 MOZ_LIBJPEG_TURBO=
michael@0 6043 if test -z "$MOZ_NATIVE_JPEG"; then
michael@0 6044 MOZ_LIBJPEG_TURBO=1
michael@0 6045 fi
michael@0 6046
michael@0 6047 MOZ_ARG_DISABLE_BOOL(libjpeg_turbo,
michael@0 6048 [ --disable-libjpeg-turbo Disable optimized jpeg decoding routines],
michael@0 6049 MOZ_LIBJPEG_TURBO=,
michael@0 6050 MOZ_LIBJPEG_TURBO=1)
michael@0 6051
michael@0 6052 if test "$MOZ_NATIVE_JPEG" = 1 -a "$MOZ_LIBJPEG_TURBO" = 1; then
michael@0 6053 AC_MSG_ERROR([cannot use --with-system-jpeg with --enable-libjpeg-turbo.])
michael@0 6054 fi
michael@0 6055
michael@0 6056 dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
michael@0 6057 dnl files.
michael@0 6058
michael@0 6059 if test -n "$MOZ_LIBJPEG_TURBO"; then
michael@0 6060
michael@0 6061 dnl Do we support libjpeg-turbo on this platform?
michael@0 6062 case "$OS_ARCH:$OS_TEST" in
michael@0 6063 Darwin:i?86)
michael@0 6064 LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
michael@0 6065 LIBJPEG_TURBO_X86_ASM=1
michael@0 6066 ;;
michael@0 6067 Darwin:x86_64)
michael@0 6068 LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
michael@0 6069 LIBJPEG_TURBO_X64_ASM=1
michael@0 6070 ;;
michael@0 6071 WINNT:x86|WINNT:i?86)
michael@0 6072 LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
michael@0 6073 LIBJPEG_TURBO_X86_ASM=1
michael@0 6074 ;;
michael@0 6075 WINNT:x86_64)
michael@0 6076 LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
michael@0 6077 LIBJPEG_TURBO_X64_ASM=1
michael@0 6078 ;;
michael@0 6079 *:arm*)
michael@0 6080 LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
michael@0 6081 LIBJPEG_TURBO_ARM_ASM=1
michael@0 6082 ;;
michael@0 6083 *:x86|*:i?86)
michael@0 6084 if $CC -E -dM -</dev/null | grep -q __ELF__; then
michael@0 6085 LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
michael@0 6086 LIBJPEG_TURBO_X86_ASM=1
michael@0 6087 fi
michael@0 6088 ;;
michael@0 6089 *:x86_64)
michael@0 6090 if $CC -E -dM -</dev/null | grep -q __ELF__; then
michael@0 6091 LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
michael@0 6092 LIBJPEG_TURBO_X64_ASM=1
michael@0 6093 fi
michael@0 6094 ;;
michael@0 6095 esac
michael@0 6096
michael@0 6097 fi
michael@0 6098
michael@0 6099 dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines
michael@0 6100 dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if
michael@0 6101 dnl it doesn't exist or we have too old of a version.
michael@0 6102 if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
michael@0 6103 LIBJPEG_TURBO_AS=$YASM
michael@0 6104
michael@0 6105 if test -z "$LIBJPEG_TURBO_AS" ; then
michael@0 6106 AC_MSG_ERROR([Yasm is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you do not appear to have Yasm installed. Either install it or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder. See https://developer.mozilla.org/en/YASM for more details.])
michael@0 6107 fi
michael@0 6108
michael@0 6109 dnl Check that we have the right yasm version. We require 1.0.1 or newer
michael@0 6110 dnl on Linux and 1.1 or newer everywhere else.
michael@0 6111 if test "$OS_ARCH" = "Linux" ; then
michael@0 6112 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -eq "0" -a "$_YASM_RELEASE" -lt "1" \) ; then
michael@0 6113 AC_MSG_ERROR([Yasm 1.0.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.$_YASM_RELEASE. Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder. See https://developer.mozilla.org/en/YASM for more details.])
michael@0 6114 fi
michael@0 6115 else
michael@0 6116 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
michael@0 6117 AC_MSG_ERROR([Yasm 1.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION. Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder. See https://developer.mozilla.org/en/YASM for more details.])
michael@0 6118 fi
michael@0 6119 fi
michael@0 6120 fi
michael@0 6121
michael@0 6122 dnl If we're on an ARM system which supports libjpeg-turbo's asm routines and
michael@0 6123 dnl --disable-libjpeg-turbo wasn't passed, use the C compiler as the assembler.
michael@0 6124 if test -n "$LIBJPEG_TURBO_ARM_ASM" ; then
michael@0 6125 echo "Using $AS as the assembler for ARM code."
michael@0 6126 LIBJPEG_TURBO_AS=$AS
michael@0 6127 fi
michael@0 6128
michael@0 6129 if test -n "$LIBJPEG_TURBO_X86_ASM"; then
michael@0 6130 AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
michael@0 6131 elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
michael@0 6132 AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
michael@0 6133 elif test -n "$LIBJPEG_TURBO_ARM_ASM"; then
michael@0 6134 AC_DEFINE(LIBJPEG_TURBO_ARM_ASM)
michael@0 6135 elif test -n "$MOZ_LIBJPEG_TURBO"; then
michael@0 6136 dnl Warn if we're not building the optimized routines, even though the user
michael@0 6137 dnl didn't specify --disable-libjpeg-turbo.
michael@0 6138 AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.])
michael@0 6139 fi
michael@0 6140
michael@0 6141 dnl ========================================================
michael@0 6142 dnl = Enable compilation of specific extension modules
michael@0 6143 dnl ========================================================
michael@0 6144
michael@0 6145 MOZ_ARG_ENABLE_STRING(extensions,
michael@0 6146 [ --enable-extensions Enable extensions],
michael@0 6147 [ for option in `echo $enableval | sed 's/,/ /g'`; do
michael@0 6148 if test "$option" = "yes" -o "$option" = "all"; then
michael@0 6149 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
michael@0 6150 elif test "$option" = "no" -o "$option" = "none"; then
michael@0 6151 MOZ_EXTENSIONS=""
michael@0 6152 elif test "$option" = "default"; then
michael@0 6153 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
michael@0 6154 elif test `echo "$option" | grep -c \^-` != 0; then
michael@0 6155 option=`echo $option | sed 's/^-//'`
michael@0 6156 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
michael@0 6157 else
michael@0 6158 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
michael@0 6159 fi
michael@0 6160 done],
michael@0 6161 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
michael@0 6162
michael@0 6163 if test -z "$MOZ_ENABLE_GNOMEVFS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
michael@0 6164 # Suppress warning on non-X11 platforms
michael@0 6165 if test -n "$MOZ_X11"; then
michael@0 6166 AC_MSG_WARN([Removing gnomevfs from MOZ_EXTENSIONS due to no --enable-gnomevfs.])
michael@0 6167 fi
michael@0 6168 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
michael@0 6169 fi
michael@0 6170
michael@0 6171 dnl Do not build gnomevfs with libxul based apps
michael@0 6172 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
michael@0 6173 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
michael@0 6174 fi
michael@0 6175
michael@0 6176 if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
michael@0 6177 # Suppress warning on non-X11 platforms
michael@0 6178 if test -n "$MOZ_X11"; then
michael@0 6179 AC_MSG_WARN([Removing gio from MOZ_EXTENSIONS due to --disable-gio.])
michael@0 6180 fi
michael@0 6181 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
michael@0 6182 fi
michael@0 6183
michael@0 6184 dnl Do not build gio with libxul based apps
michael@0 6185 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
michael@0 6186 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
michael@0 6187 fi
michael@0 6188
michael@0 6189 if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
michael@0 6190 MOZ_GIO_COMPONENT=1
michael@0 6191 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
michael@0 6192 fi
michael@0 6193 AC_SUBST(MOZ_GIO_COMPONENT)
michael@0 6194
michael@0 6195 if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
michael@0 6196 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
michael@0 6197 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
michael@0 6198 fi
michael@0 6199
michael@0 6200 dnl Remove dupes
michael@0 6201 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
michael@0 6202
michael@0 6203 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
michael@0 6204 dnl when trying to build a nonexistent extension.
michael@0 6205 for extension in $MOZ_EXTENSIONS; do
michael@0 6206 if test ! -d "${srcdir}/extensions/${extension}"; then
michael@0 6207 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
michael@0 6208 fi
michael@0 6209 done
michael@0 6210
michael@0 6211 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
michael@0 6212 AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
michael@0 6213 fi
michael@0 6214
michael@0 6215 dnl ========================================================
michael@0 6216 dnl Build Freetype in the tree
michael@0 6217 dnl ========================================================
michael@0 6218 MOZ_ARG_ENABLE_BOOL(tree-freetype,
michael@0 6219 [ --enable-tree-freetype Enable Tree FreeType],
michael@0 6220 MOZ_TREE_FREETYPE=1,
michael@0 6221 MOZ_TREE_FREETYPE= )
michael@0 6222 if test -n "$MOZ_TREE_FREETYPE"; then
michael@0 6223 if test -n "$_WIN32_MSVC"; then
michael@0 6224 AC_ERROR("building with in-tree freetype is not supported on MSVC")
michael@0 6225 fi
michael@0 6226 AC_DEFINE(MOZ_TREE_FREETYPE)
michael@0 6227 AC_SUBST(MOZ_TREE_FREETYPE)
michael@0 6228 MOZ_ENABLE_CAIRO_FT=1
michael@0 6229 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
michael@0 6230 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
michael@0 6231 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
michael@0 6232 FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
michael@0 6233 CAIRO_FT_OSLIBS=''
michael@0 6234 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
michael@0 6235 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
michael@0 6236 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
michael@0 6237 AC_SUBST(CAIRO_FT_CFLAGS)
michael@0 6238 fi
michael@0 6239
michael@0 6240 dnl ========================================================
michael@0 6241 dnl Installer
michael@0 6242 dnl ========================================================
michael@0 6243 dnl Abort Windows build if the required major version and
michael@0 6244 dnl minimum minor version of Unicode NSIS isn't in the path
michael@0 6245 dnl (unless in case of cross compiling, for which Unicode
michael@0 6246 dnl is not yet sufficient).
michael@0 6247 if test "$OS_ARCH" = "WINNT"; then
michael@0 6248 MIN_NSIS_MAJOR_VER=2
michael@0 6249 MIN_NSIS_MINOR_VER=46
michael@0 6250 MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-3.0a2.exe makensisu-2.46.exe makensis)
michael@0 6251 if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then
michael@0 6252 AC_MSG_RESULT([yes])
michael@0 6253 MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null`
michael@0 6254 changequote(,)
michael@0 6255 MAKENSISU_PARSED_VER=`echo "$MAKENSISU_VER" | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\).*\-Unicode$/\1/g'`
michael@0 6256 changequote([,])
michael@0 6257 if test "$MAKENSISU_PARSED_VER" = ""; then
michael@0 6258 changequote(,)
michael@0 6259 MAKENSISU_PARSED_VER=`echo "$MAKENSISU_VER" | sed -e 's/^v\([0-9]\+\.[0-9]\+\).*$/\1/g'`
michael@0 6260 changequote([,])
michael@0 6261 fi
michael@0 6262 MAKENSISU_MAJOR_VER=0
michael@0 6263 MAKENSISU_MINOR_VER=0
michael@0 6264 if test ! "$MAKENSISU_PARSED_VER" = ""; then
michael@0 6265 MAKENSISU_MAJOR_VER=`echo $MAKENSISU_PARSED_VER | $AWK -F\. '{ print $1 }'`
michael@0 6266 MAKENSISU_MINOR_VER=`echo $MAKENSISU_PARSED_VER | $AWK -F\. '{ print $2 }'`
michael@0 6267 fi
michael@0 6268 AC_MSG_CHECKING([for Unicode NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater])
michael@0 6269 if test "$MAKENSISU_MAJOR_VER" -eq $MIN_NSIS_MAJOR_VER -a \
michael@0 6270 "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER ||
michael@0 6271 test "$MAKENSISU_MAJOR_VER" -gt $MIN_NSIS_MAJOR_VER; then
michael@0 6272 AC_MSG_RESULT([yes])
michael@0 6273 else
michael@0 6274 AC_MSG_RESULT([no])
michael@0 6275 if test -z "$CROSS_COMPILE"; then
michael@0 6276 AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS version $REQ_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater in your path.])
michael@0 6277 else
michael@0 6278 MAKENSISU=
michael@0 6279 fi
michael@0 6280 fi
michael@0 6281 elif test -z "$CROSS_COMPILE"; then
michael@0 6282 AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS version $REQ_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater in your path.])
michael@0 6283 else
michael@0 6284 MAKENSISU=
michael@0 6285 fi
michael@0 6286 fi
michael@0 6287
michael@0 6288 dnl ========================================================
michael@0 6289 dnl Web App Runtime
michael@0 6290 dnl ========================================================
michael@0 6291 MOZ_ARG_DISABLE_BOOL(webapp-runtime,
michael@0 6292 [ --disable-webapp-runtime Disable Web App Runtime],
michael@0 6293 MOZ_WEBAPP_RUNTIME=,
michael@0 6294 MOZ_WEBAPP_RUNTIME=1)
michael@0 6295 if test "$MOZ_WIDGET_TOOLKIT" != "windows" -a "$MOZ_WIDGET_TOOLKIT" != "cocoa" -a "$MOZ_WIDGET_TOOLKIT" != "gtk2"; then
michael@0 6296 MOZ_WEBAPP_RUNTIME=
michael@0 6297 fi
michael@0 6298 if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then
michael@0 6299 MOZ_WEBAPP_RUNTIME=
michael@0 6300 fi
michael@0 6301 AC_SUBST(MOZ_WEBAPP_RUNTIME)
michael@0 6302 if test "$MOZ_WEBAPP_RUNTIME"; then
michael@0 6303 AC_DEFINE(MOZ_WEBAPP_RUNTIME)
michael@0 6304 fi
michael@0 6305
michael@0 6306 AC_MSG_CHECKING([for tar archiver])
michael@0 6307 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
michael@0 6308 if test -z "$TAR"; then
michael@0 6309 AC_MSG_ERROR([no tar archiver found in \$PATH])
michael@0 6310 fi
michael@0 6311 AC_MSG_RESULT([$TAR])
michael@0 6312 AC_SUBST(TAR)
michael@0 6313
michael@0 6314 AC_MSG_CHECKING([for wget])
michael@0 6315 AC_CHECK_PROGS(WGET, wget, "")
michael@0 6316 AC_MSG_RESULT([$WGET])
michael@0 6317 AC_SUBST(WGET)
michael@0 6318
michael@0 6319 dnl ========================================================
michael@0 6320 dnl Signing
michael@0 6321 dnl ========================================================
michael@0 6322
michael@0 6323 if test -n "$MOZ_SIGN_CMD"; then
michael@0 6324 AC_DEFINE(MOZ_SIGNING)
michael@0 6325 fi
michael@0 6326
michael@0 6327 dnl ========================================================
michael@0 6328 dnl Maintenance Service
michael@0 6329 dnl ========================================================
michael@0 6330
michael@0 6331 MOZ_ARG_ENABLE_BOOL(maintenance-service,
michael@0 6332 [ --enable-maintenance-service Enable building of maintenanceservice],
michael@0 6333 MOZ_MAINTENANCE_SERVICE=1,
michael@0 6334 MOZ_MAINTENANCE_SERVICE= )
michael@0 6335
michael@0 6336 if test -n "$MOZ_MAINTENANCE_SERVICE"; then
michael@0 6337 if test "$OS_ARCH" = "WINNT"; then
michael@0 6338 AC_DEFINE(MOZ_MAINTENANCE_SERVICE)
michael@0 6339 else
michael@0 6340 AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target])
michael@0 6341 fi
michael@0 6342 fi
michael@0 6343
michael@0 6344 dnl ========================================================
michael@0 6345 dnl Verify MAR signatures
michael@0 6346 dnl ========================================================
michael@0 6347
michael@0 6348 MOZ_ARG_ENABLE_BOOL(verify-mar,
michael@0 6349 [ --enable-verify-mar Enable verifying MAR signatures],
michael@0 6350 MOZ_VERIFY_MAR_SIGNATURE=1,
michael@0 6351 MOZ_VERIFY_MAR_SIGNATURE= )
michael@0 6352
michael@0 6353 if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then
michael@0 6354 if test "$OS_ARCH" = "WINNT"; then
michael@0 6355 AC_DEFINE(MOZ_VERIFY_MAR_SIGNATURE)
michael@0 6356 else
michael@0 6357 AC_MSG_ERROR([Can only build with --enable-verify-mar with a Windows target])
michael@0 6358 fi
michael@0 6359 fi
michael@0 6360
michael@0 6361 dnl ========================================================
michael@0 6362 dnl Enable building the signmar program.
michael@0 6363 dnl This option is much different than the --enable-verify-mar option.
michael@0 6364 dnl --enable-verify-mar is for enabling the verification check on MAR
michael@0 6365 dnl files in the updater. The --enable-signmar option is for building
michael@0 6366 dnl the signmar program.
michael@0 6367 dnl ========================================================
michael@0 6368
michael@0 6369 MOZ_ARG_ENABLE_BOOL(signmar,
michael@0 6370 [ --enable-signmar Enable building the signmar program],
michael@0 6371 MOZ_ENABLE_SIGNMAR=1,
michael@0 6372 MOZ_ENABLE_SIGNMAR= )
michael@0 6373
michael@0 6374 if test -n "$MOZ_ENABLE_SIGNMAR"; then
michael@0 6375 AC_DEFINE(MOZ_ENABLE_SIGNMAR)
michael@0 6376 fi
michael@0 6377
michael@0 6378 dnl ========================================================
michael@0 6379 dnl Updater
michael@0 6380 dnl ========================================================
michael@0 6381
michael@0 6382 MOZ_ARG_DISABLE_BOOL(updater,
michael@0 6383 [ --disable-updater Disable building of updater],
michael@0 6384 MOZ_UPDATER=,
michael@0 6385 MOZ_UPDATER=1 )
michael@0 6386
michael@0 6387 if test -n "$MOZ_UPDATER"; then
michael@0 6388 AC_DEFINE(MOZ_UPDATER)
michael@0 6389 fi
michael@0 6390
michael@0 6391 # tools/update-packaging is not checked out by default.
michael@0 6392 MOZ_ARG_ENABLE_BOOL(update-packaging,
michael@0 6393 [ --enable-update-packaging
michael@0 6394 Enable tools/update-packaging],
michael@0 6395 MOZ_UPDATE_PACKAGING=1,
michael@0 6396 MOZ_UPDATE_PACKAGING= )
michael@0 6397 AC_SUBST(MOZ_UPDATE_PACKAGING)
michael@0 6398
michael@0 6399 dnl ========================================================
michael@0 6400 dnl Tor Additions
michael@0 6401 dnl ========================================================
michael@0 6402 MOZ_ARG_WITH_STRING(tor-browser-version,
michael@0 6403 [ --with-tor-browser-version=VERSION
michael@0 6404 Set Tor Browser version, e.g., 4.0b1],
michael@0 6405 TOR_BROWSER_VERSION="$withval")
michael@0 6406
michael@0 6407 MOZ_ARG_ENABLE_BOOL(tor-browser-update,
michael@0 6408 [ --enable-tor-browser-update
michael@0 6409 Enable Tor Browser update],
michael@0 6410 TOR_BROWSER_UPDATE=1,
michael@0 6411 TOR_BROWSER_UPDATE= )
michael@0 6412
michael@0 6413 if test -n "$TOR_BROWSER_UPDATE"; then
michael@0 6414 if test -z "$TOR_BROWSER_VERSION"; then
michael@0 6415 AC_MSG_ERROR([--enable-tor-browser-update requires --with-tor-browser-version.])
michael@0 6416 fi
michael@0 6417 AC_DEFINE(TOR_BROWSER_UPDATE)
michael@0 6418 fi
michael@0 6419
michael@0 6420 AC_DEFINE_UNQUOTED(TOR_BROWSER_VERSION,"$TOR_BROWSER_VERSION")
michael@0 6421 AC_SUBST(TOR_BROWSER_VERSION)
michael@0 6422 AC_SUBST(TOR_BROWSER_UPDATE)
michael@0 6423
michael@0 6424 dnl ========================================================
michael@0 6425 dnl build the tests by default
michael@0 6426 dnl ========================================================
michael@0 6427 MOZ_ARG_DISABLE_BOOL(tests,
michael@0 6428 [ --disable-tests Do not build test libraries & programs],
michael@0 6429 ENABLE_TESTS=,
michael@0 6430 ENABLE_TESTS=1 )
michael@0 6431
michael@0 6432 if test -n "$ENABLE_TESTS"; then
michael@0 6433 GTEST_HAS_RTTI=0
michael@0 6434 AC_DEFINE_UNQUOTED(GTEST_HAS_RTTI, 0)
michael@0 6435 AC_SUBST(GTEST_HAS_RTTI)
michael@0 6436 if test -n "$_WIN32_MSVC"; then
michael@0 6437 AC_DEFINE_UNQUOTED(_VARIADIC_MAX, 10)
michael@0 6438 fi
michael@0 6439 if test "${OS_TARGET}" = "Android"; then
michael@0 6440 AC_DEFINE(GTEST_OS_LINUX_ANDROID)
michael@0 6441 AC_DEFINE(GTEST_USE_OWN_TR1_TUPLE)
michael@0 6442 AC_DEFINE_UNQUOTED(GTEST_HAS_CLONE, 0)
michael@0 6443 AC_SUBST(GTEST_OS_LINUX_ANDROID)
michael@0 6444 AC_SUBST(GTEST_USE_OWN_TR1_TUPLE)
michael@0 6445 AC_SUBST(GTEST_HAS_CLONE)
michael@0 6446 fi
michael@0 6447 fi
michael@0 6448
michael@0 6449 dnl ========================================================
michael@0 6450 dnl parental controls (for Windows Vista)
michael@0 6451 dnl ========================================================
michael@0 6452 MOZ_ARG_DISABLE_BOOL(parental-controls,
michael@0 6453 [ --disable-parental-controls
michael@0 6454 Do not build parental controls],
michael@0 6455 MOZ_DISABLE_PARENTAL_CONTROLS=1,
michael@0 6456 MOZ_DISABLE_PARENTAL_CONTROLS=)
michael@0 6457 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
michael@0 6458 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
michael@0 6459 fi
michael@0 6460
michael@0 6461 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
michael@0 6462
michael@0 6463 dnl ========================================================
michael@0 6464 dnl = Disable DOMCrypto
michael@0 6465 dnl ========================================================
michael@0 6466 if test -n "$MOZ_DISABLE_CRYPTOLEGACY"; then
michael@0 6467 AC_DEFINE(MOZ_DISABLE_CRYPTOLEGACY)
michael@0 6468 fi
michael@0 6469 AC_SUBST(MOZ_DISABLE_CRYPTOLEGACY)
michael@0 6470
michael@0 6471 dnl ========================================================
michael@0 6472 dnl = Disable EV certificate verification
michael@0 6473 dnl ========================================================
michael@0 6474 if test -n "$MOZ_NO_EV_CERTS"; then
michael@0 6475 AC_DEFINE(MOZ_NO_EV_CERTS)
michael@0 6476 fi
michael@0 6477 AC_SUBST(MOZ_NO_EV_CERTS)
michael@0 6478
michael@0 6479 dnl ========================================================
michael@0 6480 dnl = Disable libpkix
michael@0 6481 dnl ========================================================
michael@0 6482 if test -n "$NSS_NO_LIBPKIX"; then
michael@0 6483 AC_DEFINE(NSS_NO_LIBPKIX)
michael@0 6484 fi
michael@0 6485 AC_SUBST(NSS_NO_LIBPKIX)
michael@0 6486
michael@0 6487 dnl ========================================================
michael@0 6488 dnl = Content process sandboxing
michael@0 6489 dnl ========================================================
michael@0 6490 if test -n "$gonkdir"; then
michael@0 6491 MOZ_CONTENT_SANDBOX=1
michael@0 6492 fi
michael@0 6493
michael@0 6494 MOZ_ARG_ENABLE_BOOL(content-sandbox,
michael@0 6495 [ --enable-content-sandbox Enable sandboxing support for content-processes],
michael@0 6496 MOZ_CONTENT_SANDBOX=1,
michael@0 6497 MOZ_CONTENT_SANDBOX=)
michael@0 6498
michael@0 6499 if test -n "$MOZ_CONTENT_SANDBOX"; then
michael@0 6500 AC_DEFINE(MOZ_CONTENT_SANDBOX)
michael@0 6501 fi
michael@0 6502
michael@0 6503 AC_SUBST(MOZ_CONTENT_SANDBOX)
michael@0 6504
michael@0 6505 MOZ_ARG_ENABLE_BOOL(content-sandbox-reporter,
michael@0 6506 [ --enable-content-sandbox-reporter Enable syscall reporter to troubleshoot syscalls denied by the content-processes sandbox],
michael@0 6507 MOZ_CONTENT_SANDBOX_REPORTER=1,
michael@0 6508 MOZ_CONTENT_SANDBOX_REPORTER=)
michael@0 6509
michael@0 6510 if test -n "$MOZ_CONTENT_SANDBOX_REPORTER"; then
michael@0 6511 AC_DEFINE(MOZ_CONTENT_SANDBOX_REPORTER)
michael@0 6512 fi
michael@0 6513
michael@0 6514 AC_SUBST(MOZ_CONTENT_SANDBOX_REPORTER)
michael@0 6515
michael@0 6516 dnl ========================================================
michael@0 6517 dnl =
michael@0 6518 dnl = Module specific options
michael@0 6519 dnl =
michael@0 6520 dnl ========================================================
michael@0 6521 MOZ_ARG_HEADER(Individual module options)
michael@0 6522
michael@0 6523 dnl ========================================================
michael@0 6524 dnl = Disable feed handling components
michael@0 6525 dnl ========================================================
michael@0 6526 MOZ_ARG_DISABLE_BOOL(feeds,
michael@0 6527 [ --disable-feeds Disable feed handling and processing components],
michael@0 6528 MOZ_FEEDS=,
michael@0 6529 MOZ_FEEDS=1 )
michael@0 6530 if test -n "$MOZ_FEEDS"; then
michael@0 6531 AC_DEFINE(MOZ_FEEDS)
michael@0 6532 else
michael@0 6533 if test "$MOZ_BUILD_APP" = "browser"; then
michael@0 6534 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
michael@0 6535 fi
michael@0 6536 fi
michael@0 6537
michael@0 6538 dnl ========================================================
michael@0 6539 dnl Check for sqlite
michael@0 6540 dnl ========================================================
michael@0 6541
michael@0 6542 MOZ_NATIVE_SQLITE=
michael@0 6543 MOZ_ARG_ENABLE_BOOL(system-sqlite,
michael@0 6544 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
michael@0 6545 MOZ_NATIVE_SQLITE=1,
michael@0 6546 MOZ_NATIVE_SQLITE= )
michael@0 6547
michael@0 6548 if test -z "$MOZ_NATIVE_SQLITE"
michael@0 6549 then
michael@0 6550 SQLITE_CFLAGS=
michael@0 6551 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
michael@0 6552 else
michael@0 6553 dnl ============================
michael@0 6554 dnl === SQLite Version check ===
michael@0 6555 dnl ============================
michael@0 6556 dnl Check to see if the system SQLite package is new enough.
michael@0 6557 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
michael@0 6558
michael@0 6559 dnl ==================================
michael@0 6560 dnl === SQLITE_SECURE_DELETE check ===
michael@0 6561 dnl ==================================
michael@0 6562 dnl Check to see if the system SQLite package is compiled with
michael@0 6563 dnl SQLITE_SECURE_DELETE enabled.
michael@0 6564 AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
michael@0 6565 _SAVE_CFLAGS="$CFLAGS"
michael@0 6566 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
michael@0 6567 _SAVE_LIBS="$LIBS"
michael@0 6568 LIBS="$LIBS $SQLITE_LIBS"
michael@0 6569 AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
michael@0 6570 AC_TRY_RUN([
michael@0 6571 #include "sqlite3.h"
michael@0 6572
michael@0 6573 int main(int argc, char **argv){
michael@0 6574 return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
michael@0 6575 }],
michael@0 6576 ac_cv_sqlite_secure_delete=yes,
michael@0 6577 ac_cv_sqlite_secure_delete=no,
michael@0 6578 ac_cv_sqlite_secure_delete=no
michael@0 6579 )
michael@0 6580 ])
michael@0 6581 AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
michael@0 6582 CFLAGS="$_SAVE_CFLAGS"
michael@0 6583 LIBS="$_SAVE_LIBS"
michael@0 6584 if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
michael@0 6585 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
michael@0 6586 fi
michael@0 6587
michael@0 6588 dnl ===============================
michael@0 6589 dnl === SQLITE_THREADSAFE check ===
michael@0 6590 dnl ===============================
michael@0 6591 dnl Check to see if the system SQLite package is compiled with
michael@0 6592 dnl SQLITE_THREADSAFE enabled.
michael@0 6593 AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
michael@0 6594 _SAVE_CFLAGS="$CFLAGS"
michael@0 6595 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
michael@0 6596 _SAVE_LIBS="$LIBS"
michael@0 6597 LIBS="$LIBS $SQLITE_LIBS"
michael@0 6598 AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
michael@0 6599 AC_TRY_RUN([
michael@0 6600 #include "sqlite3.h"
michael@0 6601
michael@0 6602 int main(int argc, char **argv){
michael@0 6603 return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
michael@0 6604 }],
michael@0 6605 ac_cv_sqlite_threadsafe=yes,
michael@0 6606 ac_cv_sqlite_threadsafe=no,
michael@0 6607 ac_cv_sqlite_threadsafe=no
michael@0 6608 )
michael@0 6609 ])
michael@0 6610 AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
michael@0 6611 CFLAGS="$_SAVE_CFLAGS"
michael@0 6612 LIBS="$_SAVE_LIBS"
michael@0 6613 if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
michael@0 6614 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
michael@0 6615 fi
michael@0 6616
michael@0 6617 dnl ================================
michael@0 6618 dnl === SQLITE_ENABLE_FTS3 check ===
michael@0 6619 dnl ================================
michael@0 6620 dnl check to see if the system SQLite package is compiled with
michael@0 6621 dnl SQLITE_ENABLE_FTS3 enabled.
michael@0 6622 AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
michael@0 6623 _SAVE_CFLAGS="$CFLAGS"
michael@0 6624 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
michael@0 6625 _SAVE_LIBS="$LIBS"
michael@0 6626 LIBS="$LIBS $SQLITE_LIBS"
michael@0 6627 AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
michael@0 6628 AC_TRY_RUN([
michael@0 6629 #include "sqlite3.h"
michael@0 6630
michael@0 6631 int main(int argc, char **argv){
michael@0 6632 return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
michael@0 6633 }],
michael@0 6634 ac_cv_sqlite_enable_fts3=yes,
michael@0 6635 ac_cv_sqlite_enable_fts3=no,
michael@0 6636 ac_cv_sqlite_enable_fts3=no
michael@0 6637 )
michael@0 6638 ])
michael@0 6639 AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
michael@0 6640 CFLAGS="$_SAVE_CFLAGS"
michael@0 6641 LIBS="$_SAVE_LIBS"
michael@0 6642 if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
michael@0 6643 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
michael@0 6644 fi
michael@0 6645
michael@0 6646 dnl =========================================
michael@0 6647 dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
michael@0 6648 dnl =========================================
michael@0 6649 dnl check to see if the system SQLite package is compiled with
michael@0 6650 dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
michael@0 6651 AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
michael@0 6652 _SAVE_CFLAGS="$CFLAGS"
michael@0 6653 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
michael@0 6654 _SAVE_LIBS="$LIBS"
michael@0 6655 LIBS="$LIBS $SQLITE_LIBS"
michael@0 6656 AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
michael@0 6657 AC_TRY_RUN([
michael@0 6658 #include "sqlite3.h"
michael@0 6659
michael@0 6660 int main(int argc, char **argv){
michael@0 6661 return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
michael@0 6662 }],
michael@0 6663 ac_cv_sqlite_enable_unlock_notify=yes,
michael@0 6664 ac_cv_sqlite_enable_unlock_notify=no,
michael@0 6665 ac_cv_sqlite_enable_unlock_notify=no
michael@0 6666 )
michael@0 6667 ])
michael@0 6668 AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
michael@0 6669 CFLAGS="$_SAVE_CFLAGS"
michael@0 6670 LIBS="$_SAVE_LIBS"
michael@0 6671 if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
michael@0 6672 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
michael@0 6673 fi
michael@0 6674 fi
michael@0 6675
michael@0 6676 if test -n "$MOZ_NATIVE_SQLITE"; then
michael@0 6677 AC_DEFINE(MOZ_NATIVE_SQLITE)
michael@0 6678 fi
michael@0 6679 AC_SUBST(MOZ_NATIVE_SQLITE)
michael@0 6680
michael@0 6681 dnl ========================================================
michael@0 6682 dnl = Enable help viewer (off by default)
michael@0 6683 dnl ========================================================
michael@0 6684 if test -n "$MOZ_HELP_VIEWER"; then
michael@0 6685 dnl Do this if defined in confvars.sh
michael@0 6686 AC_DEFINE(MOZ_HELP_VIEWER)
michael@0 6687 fi
michael@0 6688
michael@0 6689 dnl ========================================================
michael@0 6690 dnl = Enable safe browsing (anti-phishing)
michael@0 6691 dnl ========================================================
michael@0 6692 MOZ_ARG_ENABLE_BOOL(safe-browsing,
michael@0 6693 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
michael@0 6694 MOZ_SAFE_BROWSING=1,
michael@0 6695 MOZ_SAFE_BROWSING= )
michael@0 6696 if test -n "$MOZ_SAFE_BROWSING"; then
michael@0 6697 AC_DEFINE(MOZ_SAFE_BROWSING)
michael@0 6698 fi
michael@0 6699 AC_SUBST(MOZ_SAFE_BROWSING)
michael@0 6700
michael@0 6701 dnl ========================================================
michael@0 6702 dnl = Enable url-classifier
michael@0 6703 dnl ========================================================
michael@0 6704 dnl Implicitly enabled by default if building with safe-browsing
michael@0 6705 if test -n "$MOZ_SAFE_BROWSING"; then
michael@0 6706 MOZ_URL_CLASSIFIER=1
michael@0 6707 fi
michael@0 6708 MOZ_ARG_ENABLE_BOOL(url-classifier,
michael@0 6709 [ --enable-url-classifier Enable url classifier module],
michael@0 6710 MOZ_URL_CLASSIFIER=1,
michael@0 6711 MOZ_URL_CLASSIFIER= )
michael@0 6712 if test -n "$MOZ_URL_CLASSIFIER"; then
michael@0 6713 AC_DEFINE(MOZ_URL_CLASSIFIER)
michael@0 6714 fi
michael@0 6715 AC_SUBST(MOZ_URL_CLASSIFIER)
michael@0 6716
michael@0 6717 dnl ========================================================
michael@0 6718 dnl = Disable zipwriter
michael@0 6719 dnl ========================================================
michael@0 6720 MOZ_ARG_DISABLE_BOOL(zipwriter,
michael@0 6721 [ --disable-zipwriter Disable zipwriter component],
michael@0 6722 MOZ_ZIPWRITER=,
michael@0 6723 MOZ_ZIPWRITER=1 )
michael@0 6724 AC_SUBST(MOZ_ZIPWRITER)
michael@0 6725
michael@0 6726 dnl ========================================================
michael@0 6727 dnl GL provider
michael@0 6728 dnl ========================================================
michael@0 6729 MOZ_GL_PROVIDER=
michael@0 6730 MOZ_ARG_WITH_STRING(gl-provider,
michael@0 6731 [ --with-gl-provider=ID
michael@0 6732 Set GL provider backend type],
michael@0 6733 [ val=`echo $withval`
michael@0 6734 MOZ_GL_PROVIDER="$val"])
michael@0 6735
michael@0 6736 if test -n "$MOZ_GL_PROVIDER"; then
michael@0 6737 MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER
michael@0 6738 AC_SUBST(MOZ_GL_PROVIDER)
michael@0 6739 AC_DEFINE_UNQUOTED(MOZ_GL_PROVIDER, GLContextProvider$MOZ_GL_PROVIDER)
michael@0 6740 fi
michael@0 6741 AC_SUBST(MOZ_GL_DEFAULT_PROVIDER)
michael@0 6742 AC_DEFINE_UNQUOTED(GL_PROVIDER_$MOZ_GL_DEFAULT_PROVIDER)
michael@0 6743
michael@0 6744 dnl ========================================================
michael@0 6745 dnl = faststripe theme
michael@0 6746 dnl ========================================================
michael@0 6747 MOZ_ARG_ENABLE_BOOL(faststripe,
michael@0 6748 [ --enable-faststripe Use faststripe theme],
michael@0 6749 MOZ_THEME_FASTSTRIPE=1,
michael@0 6750 MOZ_THEME_FASTSTRIPE= )
michael@0 6751 AC_SUBST(MOZ_THEME_FASTSTRIPE)
michael@0 6752
michael@0 6753 dnl ========================================================
michael@0 6754 dnl =
michael@0 6755 dnl = Feature options that require extra sources to be pulled
michael@0 6756 dnl =
michael@0 6757 dnl ========================================================
michael@0 6758 dnl MOZ_ARG_HEADER(Features that require extra sources)
michael@0 6759
michael@0 6760 dnl ========================================================
michael@0 6761 dnl =
michael@0 6762 dnl = Runtime debugging and Optimization Options
michael@0 6763 dnl =
michael@0 6764 dnl ========================================================
michael@0 6765 MOZ_ARG_HEADER(Runtime debugging and Optimizations)
michael@0 6766
michael@0 6767 dnl ========================================================
michael@0 6768 dnl enable mobile optimizations
michael@0 6769 dnl ========================================================
michael@0 6770 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
michael@0 6771 [ --enable-mobile-optimize
michael@0 6772 Enable mobile optimizations],
michael@0 6773 MOZ_GFX_OPTIMIZE_MOBILE=1)
michael@0 6774
michael@0 6775 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
michael@0 6776
michael@0 6777 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
michael@0 6778 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
michael@0 6779 fi
michael@0 6780
michael@0 6781 dnl ========================================================
michael@0 6782 dnl = Enable code optimization. ON by default.
michael@0 6783 dnl ========================================================
michael@0 6784 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
michael@0 6785 MOZ_OPTIMIZE_FLAGS="-O"
michael@0 6786 fi
michael@0 6787
michael@0 6788 MOZ_ARG_ENABLE_STRING(optimize,
michael@0 6789 [ --disable-optimize Disable compiler optimization
michael@0 6790 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
michael@0 6791 [ if test "$enableval" != "no"; then
michael@0 6792 MOZ_OPTIMIZE=1
michael@0 6793 if test -n "$enableval" -a "$enableval" != "yes"; then
michael@0 6794 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
michael@0 6795 MOZ_OPTIMIZE=2
michael@0 6796 fi
michael@0 6797 else
michael@0 6798 MOZ_OPTIMIZE=
michael@0 6799 fi ], MOZ_OPTIMIZE=1)
michael@0 6800
michael@0 6801 MOZ_SET_FRAMEPTR_FLAGS
michael@0 6802
michael@0 6803 if test "$COMPILE_ENVIRONMENT"; then
michael@0 6804 if test -n "$MOZ_OPTIMIZE"; then
michael@0 6805 AC_MSG_CHECKING([for valid optimization flags])
michael@0 6806 _SAVE_CFLAGS=$CFLAGS
michael@0 6807 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
michael@0 6808 AC_TRY_COMPILE([#include <stdio.h>],
michael@0 6809 [printf("Hello World\n");],
michael@0 6810 _results=yes,
michael@0 6811 _results=no)
michael@0 6812 AC_MSG_RESULT([$_results])
michael@0 6813 if test "$_results" = "no"; then
michael@0 6814 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
michael@0 6815 fi
michael@0 6816 CFLAGS=$_SAVE_CFLAGS
michael@0 6817 fi
michael@0 6818 fi # COMPILE_ENVIRONMENT
michael@0 6819
michael@0 6820 AC_SUBST(MOZ_OPTIMIZE)
michael@0 6821 AC_SUBST(MOZ_FRAMEPTR_FLAGS)
michael@0 6822 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
michael@0 6823 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
michael@0 6824 AC_SUBST(MOZ_ALLOW_HEAP_EXECUTE_FLAGS)
michael@0 6825 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
michael@0 6826 AC_SUBST(MOZ_PGO)
michael@0 6827 AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS)
michael@0 6828
michael@0 6829 dnl ========================================================
michael@0 6830 dnl = Enable any treating of compile warnings as errors
michael@0 6831 dnl ========================================================
michael@0 6832 MOZ_ARG_ENABLE_BOOL(warnings-as-errors,
michael@0 6833 [ --enable-warnings-as-errors
michael@0 6834 Enable treating of warnings as errors],
michael@0 6835 MOZ_ENABLE_WARNINGS_AS_ERRORS=1,
michael@0 6836 MOZ_ENABLE_WARNINGS_AS_ERRORS=)
michael@0 6837 if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
michael@0 6838 WARNINGS_AS_ERRORS=''
michael@0 6839 elif test "$GNU_CC"; then
michael@0 6840 # Prevent the following GCC warnings from being treated as errors:
michael@0 6841 # -Wuninitialized - too many false positives
michael@0 6842 # -Wmaybe-uninitialized - too many false positives
michael@0 6843 # -Wdeprecated-declarations - we don't want our builds held hostage when a
michael@0 6844 # platform-specific API becomes deprecated.
michael@0 6845 MOZ_C_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_c_has_noerror_uninitialized)
michael@0 6846 MOZ_CXX_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_cxx_has_noerror_uninitialized)
michael@0 6847 MOZ_C_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_c_has_noerror_maybe_uninitialized)
michael@0 6848 MOZ_CXX_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_cxx_has_noerror_maybe_uninitialized)
michael@0 6849 MOZ_C_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_c_has_noerror_deprecated_declarations)
michael@0 6850 MOZ_CXX_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_cxx_has_noerror_deprecated_declarations)
michael@0 6851 fi
michael@0 6852
michael@0 6853 dnl ========================================================
michael@0 6854 dnl = Disable runtime logging checks
michael@0 6855 dnl ========================================================
michael@0 6856 MOZ_ARG_DISABLE_BOOL(logging,
michael@0 6857 [ --disable-logging Disable logging facilities],
michael@0 6858 NS_DISABLE_LOGGING=1,
michael@0 6859 NS_DISABLE_LOGGING= )
michael@0 6860 if test "$NS_DISABLE_LOGGING"; then
michael@0 6861 AC_DEFINE(NS_DISABLE_LOGGING)
michael@0 6862 else
michael@0 6863 AC_DEFINE(MOZ_LOGGING)
michael@0 6864 fi
michael@0 6865
michael@0 6866 dnl ========================================================
michael@0 6867 dnl = This will enable logging of addref, release, ctor, dtor.
michael@0 6868 dnl ========================================================
michael@0 6869 _ENABLE_LOGREFCNT=42
michael@0 6870 MOZ_ARG_ENABLE_BOOL(logrefcnt,
michael@0 6871 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
michael@0 6872 _ENABLE_LOGREFCNT=1,
michael@0 6873 _ENABLE_LOGREFCNT= )
michael@0 6874 if test "$_ENABLE_LOGREFCNT" = "1"; then
michael@0 6875 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
michael@0 6876 elif test -z "$_ENABLE_LOGREFCNT"; then
michael@0 6877 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
michael@0 6878 fi
michael@0 6879
michael@0 6880 dnl ========================================================
michael@0 6881 dnl moz_dump_painting
michael@0 6882 dnl ========================================================
michael@0 6883 MOZ_ARG_ENABLE_BOOL(dump-painting,
michael@0 6884 [ --enable-dump-painting Enable paint debugging.],
michael@0 6885 MOZ_DUMP_PAINTING=1,
michael@0 6886 MOZ_DUMP_PAINTING= )
michael@0 6887 if test -n "$MOZ_DUMP_PAINTING"; then
michael@0 6888 AC_DEFINE(MOZ_DUMP_PAINTING)
michael@0 6889 AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
michael@0 6890 fi
michael@0 6891 if test -n "$MOZ_DEBUG"; then
michael@0 6892 AC_DEFINE(MOZ_DUMP_PAINTING)
michael@0 6893 fi
michael@0 6894
michael@0 6895 dnl ========================================================
michael@0 6896 dnl = Enable trace malloc
michael@0 6897 dnl ========================================================
michael@0 6898 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
michael@0 6899 MOZ_ARG_ENABLE_BOOL(trace-malloc,
michael@0 6900 [ --enable-trace-malloc Enable malloc tracing; also disables DMD and jemalloc],
michael@0 6901 NS_TRACE_MALLOC=1,
michael@0 6902 NS_TRACE_MALLOC= )
michael@0 6903 if test "$NS_TRACE_MALLOC"; then
michael@0 6904 # Please, Mr. Linker Man, don't take away our symbol names
michael@0 6905 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
michael@0 6906 AC_DEFINE(NS_TRACE_MALLOC)
michael@0 6907 fi
michael@0 6908 AC_SUBST(NS_TRACE_MALLOC)
michael@0 6909
michael@0 6910 dnl ========================================================
michael@0 6911 dnl = Enable DMD
michael@0 6912 dnl ========================================================
michael@0 6913
michael@0 6914 MOZ_ARG_ENABLE_BOOL(dmd,
michael@0 6915 [ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc],
michael@0 6916 MOZ_DMD=1,
michael@0 6917 MOZ_DMD= )
michael@0 6918
michael@0 6919 dnl The two options are conflicting. Fails the configure to alert the user.
michael@0 6920 if test "$NS_TRACE_MALLOC" -a "$MOZ_DMD"; then
michael@0 6921 AC_MSG_ERROR([--enable-trace-malloc and --enable-dmd are conflicting options])
michael@0 6922 fi
michael@0 6923
michael@0 6924 if test "$MOZ_DMD"; then
michael@0 6925 AC_DEFINE(MOZ_DMD)
michael@0 6926
michael@0 6927 if test "${CPU_ARCH}" = "arm"; then
michael@0 6928 CFLAGS="$CFLAGS -funwind-tables"
michael@0 6929 CXXFLAGS="$CXXFLAGS -funwind-tables"
michael@0 6930 fi
michael@0 6931
michael@0 6932 MOZ_MEMORY=1 # DMD enables jemalloc
michael@0 6933 MOZ_REPLACE_MALLOC=1 # DMD enables replace-malloc
michael@0 6934 fi
michael@0 6935 AC_SUBST(MOZ_DMD)
michael@0 6936
michael@0 6937 dnl ========================================================
michael@0 6938 dnl = Enable jemalloc
michael@0 6939 dnl ========================================================
michael@0 6940 MOZ_ARG_ENABLE_BOOL(jemalloc,
michael@0 6941 [ --enable-jemalloc Replace memory allocator with jemalloc],
michael@0 6942 MOZ_MEMORY=1,
michael@0 6943 MOZ_MEMORY=)
michael@0 6944
michael@0 6945 if test "$NS_TRACE_MALLOC"; then
michael@0 6946 MOZ_MEMORY=
michael@0 6947 fi
michael@0 6948
michael@0 6949 if test "${OS_TARGET}" = "Android"; then
michael@0 6950 dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue
michael@0 6951 :
michael@0 6952 elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin"; then
michael@0 6953 dnl On Windows and OSX, we want to link all our binaries against mozglue
michael@0 6954 if test -z "$GNU_CC"; then
michael@0 6955 MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
michael@0 6956 else
michael@0 6957 MOZ_GLUE_LDFLAGS='-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
michael@0 6958 fi
michael@0 6959 else
michael@0 6960 dnl On other Unix systems, we only want to link executables against mozglue
michael@0 6961 MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
michael@0 6962 dnl On other Unix systems, where mozglue is a static library, jemalloc is
michael@0 6963 dnl separated for the SDK, so we need to add it here.
michael@0 6964 if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then
michael@0 6965 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)'
michael@0 6966 fi
michael@0 6967 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)'
michael@0 6968 if test -n "$GNU_CC"; then
michael@0 6969 dnl And we need mozglue symbols to be exported.
michael@0 6970 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
michael@0 6971 fi
michael@0 6972 if test "$MOZ_LINKER" = 1; then
michael@0 6973 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $MOZ_ZLIB_LIBS"
michael@0 6974 fi
michael@0 6975 fi
michael@0 6976
michael@0 6977 dnl ========================================================
michael@0 6978 dnl = Enable dynamic replacement of malloc implementation
michael@0 6979 dnl ========================================================
michael@0 6980 MOZ_ARG_ENABLE_BOOL(replace-malloc,
michael@0 6981 [ --enable-replace-malloc Enable ability to dynamically replace the malloc implementation],
michael@0 6982 MOZ_REPLACE_MALLOC=1,
michael@0 6983 MOZ_REPLACE_MALLOC= )
michael@0 6984
michael@0 6985 dnl The two options are conflicting. Fails the configure to alert the user.
michael@0 6986 if test "$NS_TRACE_MALLOC" -a "$MOZ_REPLACE_MALLOC"; then
michael@0 6987 AC_MSG_ERROR([--enable-trace-malloc and --enable-replace-malloc are conflicting options])
michael@0 6988 fi
michael@0 6989
michael@0 6990 if test -n "$MOZ_REPLACE_MALLOC" -a -z "$MOZ_MEMORY"; then
michael@0 6991 dnl We don't want to enable jemalloc unconditionally because it may be a
michael@0 6992 dnl deliberate choice not to enable it (bug 702250, for instance)
michael@0 6993 AC_MSG_ERROR([--enable-replace-malloc requires --enable-jemalloc])
michael@0 6994 elif test -n "$MOZ_REPLACE_MALLOC"; then
michael@0 6995 MOZ_NATIVE_JEMALLOC=
michael@0 6996
michael@0 6997 dnl Replace-malloc Mac linkage quirks
michael@0 6998 if test -n "$MACOSX_DEPLOYMENT_TARGET"; then
michael@0 6999 AC_CACHE_CHECK([how to do weak dynamic linking],
michael@0 7000 ac_cv_weak_dynamic_linking,
michael@0 7001 [echo 'extern void foo() __attribute__((weak_import));int bar() { if (foo) foo(); return 0; }' > conftest.c
michael@0 7002 if AC_TRY_COMMAND([${CC-cc} -o conftest${DLL_SUFFIX} $CFLAGS -dynamiclib $LDFLAGS -Wl,-U,_foo conftest.c $LIBS 1>&5]) &&
michael@0 7003 test -s conftest${DLL_SUFFIX}; then
michael@0 7004 dnl There are several ways the linker can put link edit rules in a binary:
michael@0 7005 dnl - classic info only (for OSX < 10.6)
michael@0 7006 dnl - dyld info only
michael@0 7007 dnl - both
michael@0 7008 if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO_ONLY" > /dev/null; then
michael@0 7009 _CLASSIC_INFO=
michael@0 7010 else
michael@0 7011 _CLASSIC_INFO=1
michael@0 7012 fi
michael@0 7013 if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO" > /dev/null; then
michael@0 7014 _DYLD_INFO=1
michael@0 7015 else
michael@0 7016 _DYLD_INFO=
michael@0 7017 fi
michael@0 7018 dnl With classic info, we need to build with -flat_namespace.
michael@0 7019 dnl With dyld info, Xcode 4.5 does the right thing without additional flags,
michael@0 7020 dnl but Xcode < 4.5 requires a dummy library and -flat_namespace because it
michael@0 7021 dnl forgets to set the weak flag in the dyld info.
michael@0 7022 dnl See http://glandium.org/blog/?p=2764 for more details.
michael@0 7023 dnl
michael@0 7024 dnl Values for ac_cv_weak_dynamic_linking, and subsequently
michael@0 7025 dnl MOZ_REPLACE_MALLOC_LINKAGE are thus:
michael@0 7026 dnl - "flat namespace" when -flat_namespace alone is needed
michael@0 7027 dnl - "dummy library" when a dummy library and -flat_namespace are needed
michael@0 7028 dnl - "compiler support" when nothing is needed
michael@0 7029 if test -n "$_DYLD_INFO" && dyldinfo -bind conftest${DLL_SUFFIX} 2> /dev/null | grep "_foo (weak import)" > /dev/null; then
michael@0 7030 if test -n "$_CLASSIC_INFO"; then
michael@0 7031 ac_cv_weak_dynamic_linking="flat namespace"
michael@0 7032 else
michael@0 7033 ac_cv_weak_dynamic_linking="compiler support"
michael@0 7034 fi
michael@0 7035 else
michael@0 7036 if test -n "$_DYLD_INFO"; then
michael@0 7037 ac_cv_weak_dynamic_linking="dummy library"
michael@0 7038 else
michael@0 7039 ac_cv_weak_dynamic_linking="flat namespace"
michael@0 7040 fi
michael@0 7041 fi
michael@0 7042 else
michael@0 7043 AC_ERROR([couldn't compile a simple C file])
michael@0 7044 fi
michael@0 7045 rm -rf conftest*])
michael@0 7046 MOZ_REPLACE_MALLOC_LINKAGE="$ac_cv_weak_dynamic_linking"
michael@0 7047 fi
michael@0 7048 fi
michael@0 7049 AC_SUBST(MOZ_REPLACE_MALLOC)
michael@0 7050 AC_SUBST(MOZ_REPLACE_MALLOC_LINKAGE)
michael@0 7051
michael@0 7052 dnl ========================================================
michael@0 7053 dnl = Jemalloc build setup
michael@0 7054 dnl ========================================================
michael@0 7055 if test -z "$MOZ_MEMORY"; then
michael@0 7056 if test -n "$MOZ_JEMALLOC3" -a -z "$MOZ_REPLACE_MALLOC"; then
michael@0 7057 MOZ_NATIVE_JEMALLOC=1
michael@0 7058 AC_CHECK_FUNCS(mallctl nallocm,,
michael@0 7059 [MOZ_NATIVE_JEMALLOC=
michael@0 7060 break])
michael@0 7061 if test -n "$MOZ_NATIVE_JEMALLOC"; then
michael@0 7062 MOZ_MEMORY=1
michael@0 7063 AC_DEFINE(MOZ_MEMORY)
michael@0 7064 AC_DEFINE(MOZ_JEMALLOC3)
michael@0 7065 AC_DEFINE(MOZ_NATIVE_JEMALLOC)
michael@0 7066 fi
michael@0 7067 fi
michael@0 7068 case "${target}" in
michael@0 7069 *-mingw*)
michael@0 7070 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
michael@0 7071 AC_MSG_WARN([When not building jemalloc, you need to set WIN32_REDIST_DIR to the path to the Visual C++ Redist (usually VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT, for VC++ v8) if you intend to distribute your build.])
michael@0 7072 fi
michael@0 7073 ;;
michael@0 7074 esac
michael@0 7075 else
michael@0 7076 AC_DEFINE(MOZ_MEMORY)
michael@0 7077 if test -n "$MOZ_JEMALLOC3"; then
michael@0 7078 AC_DEFINE(MOZ_JEMALLOC3)
michael@0 7079 fi
michael@0 7080 if test "x$MOZ_DEBUG" = "x1"; then
michael@0 7081 AC_DEFINE(MOZ_MEMORY_DEBUG)
michael@0 7082 fi
michael@0 7083 dnl The generic feature tests that determine how to compute ncpus are long and
michael@0 7084 dnl complicated. Therefore, simply define special cpp variables for the
michael@0 7085 dnl platforms we have special knowledge of.
michael@0 7086 case "${target}" in
michael@0 7087 *-darwin*)
michael@0 7088 AC_DEFINE(MOZ_MEMORY_DARWIN)
michael@0 7089 ;;
michael@0 7090 *-*freebsd*)
michael@0 7091 AC_DEFINE(MOZ_MEMORY_BSD)
michael@0 7092 ;;
michael@0 7093 *-android*|*-linuxandroid*)
michael@0 7094 AC_DEFINE(MOZ_MEMORY_LINUX)
michael@0 7095 AC_DEFINE(MOZ_MEMORY_ANDROID)
michael@0 7096 if test -z "$gonkdir"; then
michael@0 7097 _WRAP_MALLOC=1
michael@0 7098 else
michael@0 7099 AC_DEFINE(MOZ_MEMORY_GONK)
michael@0 7100 fi
michael@0 7101 MOZ_GLUE_LDFLAGS=
michael@0 7102 ;;
michael@0 7103 *-*linux*)
michael@0 7104 AC_DEFINE(MOZ_MEMORY_LINUX)
michael@0 7105 ;;
michael@0 7106 *-netbsd*)
michael@0 7107 AC_DEFINE(MOZ_MEMORY_BSD)
michael@0 7108 ;;
michael@0 7109 *-solaris*)
michael@0 7110 AC_DEFINE(MOZ_MEMORY_SOLARIS)
michael@0 7111 ;;
michael@0 7112 *-mingw*)
michael@0 7113 AC_DEFINE(MOZ_MEMORY_WINDOWS)
michael@0 7114 if test -z "$MOZ_DEBUG"; then
michael@0 7115 WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
michael@0 7116 else
michael@0 7117 WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
michael@0 7118 fi
michael@0 7119 dnl Look for a broken crtdll.obj
michael@0 7120 WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
michael@0 7121 lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
michael@0 7122 if grep -q '__imp__\{0,1\}free' crtdll.obj; then
michael@0 7123 MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
michael@0 7124 dnl Also pass this to NSPR/NSS
michael@0 7125 DLLFLAGS="$DLLFLAGS $MOZ_GLUE_LDFLAGS"
michael@0 7126 else
michael@0 7127 DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue"
michael@0 7128 fi
michael@0 7129 rm crtdll.obj
michael@0 7130
michael@0 7131 export DLLFLAGS
michael@0 7132 ;;
michael@0 7133 *)
michael@0 7134 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
michael@0 7135 ;;
michael@0 7136 esac
michael@0 7137 fi # MOZ_MEMORY
michael@0 7138 AC_SUBST(MOZ_MEMORY)
michael@0 7139 AC_SUBST(MOZ_JEMALLOC3)
michael@0 7140 AC_SUBST(MOZ_NATIVE_JEMALLOC)
michael@0 7141 AC_SUBST(MOZ_GLUE_LDFLAGS)
michael@0 7142 AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS)
michael@0 7143 AC_SUBST(WIN32_CRT_LIBS)
michael@0 7144 dnl Need to set this for make because NSS doesn't have configure
michael@0 7145 AC_SUBST(DLLFLAGS)
michael@0 7146
michael@0 7147 dnl We need to wrap dlopen and related functions on Android because we use
michael@0 7148 dnl our own linker.
michael@0 7149 if test "$OS_TARGET" = Android; then
michael@0 7150 WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue"
michael@0 7151 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv"
michael@0 7152 if test "$MOZ_WIDGET_TOOLKIT" = android; then
michael@0 7153 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
michael@0 7154 fi
michael@0 7155 if test -z "$gonkdir"; then
michael@0 7156 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise"
michael@0 7157 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=memccpy,--wrap=memchr,--wrap=memrchr,--wrap=memcmp,--wrap=memcpy,--wrap=memmove,--wrap=memset,--wrap=memmem,--wrap=memswap,--wrap=index,--wrap=strchr,--wrap=strrchr,--wrap=strlen,--wrap=strcmp,--wrap=strcpy,--wrap=strcat,--wrap=strcasecmp,--wrap=strncasecmp,--wrap=strstr,--wrap=strcasestr,--wrap=strtok,--wrap=strtok_r,--wrap=strerror,--wrap=strerror_r,--wrap=strnlen,--wrap=strncat,--wrap=strncmp,--wrap=strncpy,--wrap=strlcat,--wrap=strlcpy,--wrap=strcspn,--wrap=strpbrk,--wrap=strsep,--wrap=strspn,--wrap=strcoll,--wrap=strxfrm"
michael@0 7158 fi
michael@0 7159 if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then
michael@0 7160 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=pthread_create,--wrap=epoll_wait,--wrap=poll,--wrap=pthread_cond_timedwait,--wrap=__pthread_cond_timedwait,--wrap=pthread_cond_wait,--wrap=epoll_create,--wrap=epoll_ctl,--wrap=close,--wrap=pthread_key_create,--wrap=pthread_key_delete,--wrap=socketpair,--wrap=pthread_self,--wrap=pthread_mutex_lock,--wrap=pthread_join,--wrap=pipe,--wrap=pipe2,--wrap=tgkill"
michael@0 7161 fi
michael@0 7162 fi
michael@0 7163
michael@0 7164 dnl ========================================================
michael@0 7165 dnl = Use malloc wrapper lib
michael@0 7166 dnl ========================================================
michael@0 7167 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
michael@0 7168 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
michael@0 7169 _WRAP_MALLOC=1,
michael@0 7170 _WRAP_MALLOC= )
michael@0 7171
michael@0 7172 if test -n "$_WRAP_MALLOC"; then
michael@0 7173 if test -n "$GNU_CC"; then
michael@0 7174 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
michael@0 7175 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
michael@0 7176 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
michael@0 7177 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf"
michael@0 7178 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
michael@0 7179 dnl Wrap operator new and operator delete on Android.
michael@0 7180 if test "$OS_TARGET" = "Android"; then
michael@0 7181 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv"
michael@0 7182 dnl Wrap the nothrow variants too.
michael@0 7183 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_ZnwjRKSt9nothrow_t,--wrap=_ZnajRKSt9nothrow_t,--wrap=_ZdlPvRKSt9nothrow_t,--wrap=_ZdaPvRKSt9nothrow_t"
michael@0 7184 fi
michael@0 7185 else
michael@0 7186 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
michael@0 7187 fi
michael@0 7188 fi
michael@0 7189
michael@0 7190 dnl ========================================================
michael@0 7191 dnl = Location of malloc wrapper lib
michael@0 7192 dnl ========================================================
michael@0 7193 MOZ_ARG_WITH_STRING(wrap-malloc,
michael@0 7194 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
michael@0 7195 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
michael@0 7196
michael@0 7197 dnl ========================================================
michael@0 7198 dnl = Use JS Call tracing
michael@0 7199 dnl ========================================================
michael@0 7200 MOZ_ARG_ENABLE_BOOL(trace-jscalls,
michael@0 7201 [ --enable-trace-jscalls Enable JS call enter/exit callback (default=no)],
michael@0 7202 MOZ_TRACE_JSCALLS=1,
michael@0 7203 MOZ_TRACE_JSCALLS= )
michael@0 7204 if test -n "$MOZ_TRACE_JSCALLS"; then
michael@0 7205 AC_DEFINE(MOZ_TRACE_JSCALLS)
michael@0 7206 fi
michael@0 7207
michael@0 7208 dnl ========================================================
michael@0 7209 dnl JS opt-mode assertions and minidump instrumentation
michael@0 7210 dnl ========================================================
michael@0 7211 MOZ_ARG_ENABLE_BOOL(js-diagnostics,
michael@0 7212 [ --enable-js-diagnostics
michael@0 7213 Enable JS diagnostic assertions and breakpad data],
michael@0 7214 JS_CRASH_DIAGNOSTICS=1,
michael@0 7215 JS_CRASH_DIAGNOSTICS= )
michael@0 7216 if test -n "$JS_CRASH_DIAGNOSTICS"; then
michael@0 7217 AC_DEFINE(JS_CRASH_DIAGNOSTICS)
michael@0 7218 fi
michael@0 7219
michael@0 7220 MOZ_CHECK_CCACHE
michael@0 7221
michael@0 7222 dnl ========================================================
michael@0 7223 dnl = Enable static checking using gcc-dehydra
michael@0 7224 dnl ========================================================
michael@0 7225
michael@0 7226 MOZ_ARG_WITH_STRING(static-checking,
michael@0 7227 [ --with-static-checking=path/to/gcc_dehydra.so
michael@0 7228 Enable static checking of code using GCC-dehydra],
michael@0 7229 DEHYDRA_PATH=$withval,
michael@0 7230 DEHYDRA_PATH= )
michael@0 7231
michael@0 7232 if test -n "$DEHYDRA_PATH"; then
michael@0 7233 if test ! -f "$DEHYDRA_PATH"; then
michael@0 7234 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
michael@0 7235 fi
michael@0 7236 AC_DEFINE(NS_STATIC_CHECKING)
michael@0 7237 fi
michael@0 7238 AC_SUBST(DEHYDRA_PATH)
michael@0 7239
michael@0 7240 dnl ========================================================
michael@0 7241 dnl = Enable using the clang plugin to build
michael@0 7242 dnl ========================================================
michael@0 7243
michael@0 7244 MOZ_ARG_ENABLE_BOOL(clang-plugin,
michael@0 7245 [ --enable-clang-plugin Enable building with the mozilla clang plugin ],
michael@0 7246 ENABLE_CLANG_PLUGIN=1,
michael@0 7247 ENABLE_CLANG_PLUGIN= )
michael@0 7248 if test -n "$ENABLE_CLANG_PLUGIN"; then
michael@0 7249 if test -z "$CLANG_CC"; then
michael@0 7250 AC_MSG_ERROR([Can't use clang plugin without clang.])
michael@0 7251 fi
michael@0 7252 AC_DEFINE(MOZ_CLANG_PLUGIN)
michael@0 7253 fi
michael@0 7254
michael@0 7255 AC_SUBST(ENABLE_CLANG_PLUGIN)
michael@0 7256
michael@0 7257 dnl ========================================================
michael@0 7258 dnl = Enable stripping of libs & executables
michael@0 7259 dnl ========================================================
michael@0 7260 MOZ_ARG_ENABLE_BOOL(strip,
michael@0 7261 [ --enable-strip Enable stripping of libs & executables ],
michael@0 7262 ENABLE_STRIP=1,
michael@0 7263 ENABLE_STRIP= )
michael@0 7264
michael@0 7265 dnl ========================================================
michael@0 7266 dnl = Enable stripping of libs & executables when packaging
michael@0 7267 dnl ========================================================
michael@0 7268 MOZ_ARG_ENABLE_BOOL(install-strip,
michael@0 7269 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
michael@0 7270 PKG_SKIP_STRIP= ,
michael@0 7271 PKG_SKIP_STRIP=1)
michael@0 7272
michael@0 7273 dnl ========================================================
michael@0 7274 dnl = --disable-elf-hack
michael@0 7275 dnl ========================================================
michael@0 7276
michael@0 7277 USE_ELF_HACK=1
michael@0 7278 MOZ_ARG_DISABLE_BOOL(elf-hack,
michael@0 7279 [ --disable-elf-hack Disable elf hacks],
michael@0 7280 [USE_ELF_HACK=],
michael@0 7281 [USE_ELF_HACK=F # Force enable elf-hack])
michael@0 7282
michael@0 7283 # Disable elf hack for profiling because the built in profiler
michael@0 7284 # doesn't read the segments properly with elf hack. This is
michael@0 7285 # temporary and should be fixed soon in the profiler.
michael@0 7286 if test "$MOZ_PROFILING" = 1; then
michael@0 7287 if test "$USE_ELF_HACK" = F; then
michael@0 7288 AC_ERROR([--enable-elf-hack is not compatible with --enable-profiling])
michael@0 7289 fi
michael@0 7290 USE_ELF_HACK=
michael@0 7291 fi
michael@0 7292
michael@0 7293 # Only enable elfhack where supported
michael@0 7294 if test "$USE_ELF_HACK" = 1; then
michael@0 7295 case "${HOST_OS_ARCH},${OS_ARCH}" in
michael@0 7296 Linux,Linux)
michael@0 7297 case "${CPU_ARCH}" in
michael@0 7298 arm | x86 | x86_64)
michael@0 7299 USE_ELF_HACK=1
michael@0 7300 ;;
michael@0 7301 *)
michael@0 7302 USE_ELF_HACK=
michael@0 7303 ;;
michael@0 7304 esac
michael@0 7305 ;;
michael@0 7306 *)
michael@0 7307 USE_ELF_HACK=
michael@0 7308 ;;
michael@0 7309 esac
michael@0 7310 fi
michael@0 7311
michael@0 7312 if test -n "$COMPILE_ENVIRONMENT" -a -n "$USE_ELF_HACK"; then
michael@0 7313 dnl PT_GNU_RELRO segment makes the dynamic linker set a read-only flag on
michael@0 7314 dnl memory addresses it maps to. The result is that by the time elfhack
michael@0 7315 dnl kicks in, it is not possible to apply relocations because of that,
michael@0 7316 dnl thus elfhack effectively skips relocations inside the PT_GNU_RELRO
michael@0 7317 dnl segment. It makes elfhack mostly useless, so considering the problems
michael@0 7318 dnl we have we PT_GNU_RELRO (e.g. bug 664366), and until elfhack can deal
michael@0 7319 dnl with PT_GNU_RELRO segments, it's just simpler to disable elfhack when
michael@0 7320 dnl the linker creates PT_GNU_RELRO segments. However, when we do want
michael@0 7321 dnl elfhack enabled, disable PT_GNU_RELRO instead.
michael@0 7322 AC_CACHE_CHECK([whether linker creates PT_GNU_RELRO segments],
michael@0 7323 LINK_WITH_PT_GNU_RELRO,
michael@0 7324 [echo "int main() {return 0;}" > conftest.${ac_ext}
michael@0 7325 if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2) &&
michael@0 7326 test -s conftest${ac_exeext}; then
michael@0 7327 if ${TOOLCHAIN_PREFIX}readelf -l conftest${ac_exeext} | grep GNU_RELRO > /dev/null; then
michael@0 7328 LINK_WITH_PT_GNU_RELRO=yes
michael@0 7329 else
michael@0 7330 LINK_WITH_PT_GNU_RELRO=no
michael@0 7331 fi
michael@0 7332 else
michael@0 7333 dnl We really don't expect to get here, but just in case
michael@0 7334 AC_ERROR([couldn't compile a simple C file])
michael@0 7335 fi
michael@0 7336 rm -rf conftest*])
michael@0 7337 if test "$LINK_WITH_PT_GNU_RELRO" = yes; then
michael@0 7338 if test "$USE_ELF_HACK" = F; then
michael@0 7339 AC_MSG_CHECKING([for -z norelro option to ld])
michael@0 7340 _SAVE_LDFLAGS=$LDFLAGS
michael@0 7341 LDFLAGS="$LDFLAGS -Wl,-z,norelro"
michael@0 7342 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
michael@0 7343 [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,norelro"],
michael@0 7344 AC_ERROR([--enable-elf-hack is not compatible with a linker creating a PT_GNU_RELRO segment and that doesn't support the "-z norelro" option.]))
michael@0 7345 USE_ELF_HACK=1
michael@0 7346 else
michael@0 7347 AC_MSG_WARN([Disabling elfhack])
michael@0 7348 USE_ELF_HACK=
michael@0 7349 fi
michael@0 7350 fi
michael@0 7351 fi
michael@0 7352
michael@0 7353 dnl ========================================================
michael@0 7354 dnl = libstdc++ compatibility hacks
michael@0 7355 dnl ========================================================
michael@0 7356
michael@0 7357 STDCXX_COMPAT=
michael@0 7358 MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
michael@0 7359 [ --enable-stdcxx-compat Enable compatibility with older libstdc++],
michael@0 7360 STDCXX_COMPAT=1)
michael@0 7361
michael@0 7362 if test -n "$STDCXX_COMPAT"; then
michael@0 7363 eval $(CXX="$CXX" HOST_CXX="$HOST_CXX" $PYTHON -m mozbuild.configure.libstdcxx)
michael@0 7364 AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
michael@0 7365 AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
michael@0 7366 fi
michael@0 7367
michael@0 7368 dnl ========================================================
michael@0 7369 dnl =
michael@0 7370 dnl = Profiling and Instrumenting
michael@0 7371 dnl =
michael@0 7372 dnl ========================================================
michael@0 7373 MOZ_ARG_HEADER(Profiling and Instrumenting)
michael@0 7374
michael@0 7375 dnl ========================================================
michael@0 7376 dnl = Enable runtime visual profiling logger
michael@0 7377 dnl ========================================================
michael@0 7378 MOZ_ARG_ENABLE_BOOL(visual-event-tracer,
michael@0 7379 [ --enable-visual-event-tracer Enable visual event tracer instrumentation],
michael@0 7380 MOZ_VISUAL_EVENT_TRACER=1,
michael@0 7381 MOZ_VISUAL_EVENT_TRACER=)
michael@0 7382 if test -n "$MOZ_VISUAL_EVENT_TRACER"; then
michael@0 7383 AC_DEFINE(MOZ_VISUAL_EVENT_TRACER)
michael@0 7384 fi
michael@0 7385
michael@0 7386 dnl ========================================================
michael@0 7387 dnl = Enable TaskTracer
michael@0 7388 dnl ========================================================
michael@0 7389 MOZ_ARG_ENABLE_BOOL(tasktracer,
michael@0 7390 [ --enable-tasktracer Set compile flags necessary for using TaskTracer],
michael@0 7391 MOZ_TASK_TRACER=1,
michael@0 7392 MOZ_TASK_TRACER= )
michael@0 7393 if test "$MOZ_WIDGET_TOOLKIT" = "gonk" -a -n "$MOZ_TASK_TRACER"; then
michael@0 7394 AC_DEFINE(MOZ_TASK_TRACER)
michael@0 7395 AC_SUBST(MOZ_TASK_TRACER)
michael@0 7396 fi
michael@0 7397
michael@0 7398 dnl ========================================================
michael@0 7399 dnl Turn on reflow counting
michael@0 7400 dnl ========================================================
michael@0 7401 MOZ_ARG_ENABLE_BOOL(reflow-perf,
michael@0 7402 [ --enable-reflow-perf Enable reflow performance tracing],
michael@0 7403 MOZ_REFLOW_PERF=1,
michael@0 7404 MOZ_REFLOW_PERF= )
michael@0 7405 if test -n "$MOZ_REFLOW_PERF"; then
michael@0 7406 AC_DEFINE(MOZ_REFLOW_PERF)
michael@0 7407 fi
michael@0 7408
michael@0 7409 dnl ========================================================
michael@0 7410 dnl = Enable Radio Interface for B2G (Gonk usually)
michael@0 7411 dnl ========================================================
michael@0 7412 MOZ_ARG_ENABLE_BOOL(b2g-ril,
michael@0 7413 [ --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
michael@0 7414 MOZ_B2G_RIL=1,
michael@0 7415 MOZ_B2G_RIL=,
michael@0 7416 MOZ_B2G_RIL=$_PLATFORM_HAVE_RIL )
michael@0 7417 if test -n "$MOZ_B2G_RIL"; then
michael@0 7418 if test -n "$_PLATFORM_HAVE_RIL"; then
michael@0 7419 AC_DEFINE(MOZ_B2G_RIL)
michael@0 7420 else
michael@0 7421 AC_MSG_ERROR([b2g-ril cannot be enabled because target platform doesn't support it.])
michael@0 7422 fi
michael@0 7423 fi
michael@0 7424 AC_SUBST(MOZ_B2G_RIL)
michael@0 7425
michael@0 7426 dnl ========================================================
michael@0 7427 dnl = Enable Radio FM for B2G (Gonk usually)
michael@0 7428 dnl ========================================================
michael@0 7429 if test -n "$MOZ_B2G_FM"; then
michael@0 7430 AC_DEFINE(MOZ_B2G_FM)
michael@0 7431 fi
michael@0 7432 AC_SUBST(MOZ_B2G_FM)
michael@0 7433
michael@0 7434 dnl ========================================================
michael@0 7435 dnl = Enable Bluetooth Interface for B2G (Gonk usually)
michael@0 7436 dnl ========================================================
michael@0 7437 MOZ_ARG_ENABLE_BOOL(b2g-bt,
michael@0 7438 [ --enable-b2g-bt Set compile flags necessary for compiling Bluetooth API for B2G ],
michael@0 7439 MOZ_B2G_BT=1,
michael@0 7440 MOZ_B2G_BT= )
michael@0 7441 if test -n "$MOZ_B2G_BT"; then
michael@0 7442 AC_DEFINE(MOZ_B2G_BT)
michael@0 7443 fi
michael@0 7444 AC_SUBST(MOZ_B2G_BT)
michael@0 7445 AC_SUBST(MOZ_B2G_BT_BLUEZ)
michael@0 7446 AC_SUBST(MOZ_B2G_BT_BLUEDROID)
michael@0 7447
michael@0 7448 dnl ========================================================
michael@0 7449 dnl = Enable NFC Interface for B2G (Gonk usually)
michael@0 7450 dnl ========================================================
michael@0 7451 MOZ_ARG_ENABLE_BOOL(nfc,
michael@0 7452 [ --enable-nfc Set compile flags necessary for compiling NFC API ],
michael@0 7453 MOZ_NFC=1,
michael@0 7454 MOZ_NFC= )
michael@0 7455 if test -n "$MOZ_NFC"; then
michael@0 7456 AC_DEFINE(MOZ_NFC)
michael@0 7457 fi
michael@0 7458 AC_SUBST(MOZ_NFC)
michael@0 7459
michael@0 7460 dnl ========================================================
michael@0 7461 dnl = Enable Pico Speech Synthesis (Gonk usually)
michael@0 7462 dnl ========================================================
michael@0 7463 MOZ_ARG_ENABLE_BOOL(synth-pico,
michael@0 7464 [ --enable-synth-pico Set compile flags necessary for compiling Pico Web Speech API ],
michael@0 7465 MOZ_SYNTH_PICO=1,
michael@0 7466 MOZ_SYNTH_PICO= )
michael@0 7467 if test -n "$MOZ_SYNTH_PICO"; then
michael@0 7468 AC_DEFINE(MOZ_SYNTH_PICO)
michael@0 7469 fi
michael@0 7470 AC_SUBST(MOZ_SYNTH_PICO)
michael@0 7471
michael@0 7472 dnl ========================================================
michael@0 7473 dnl = Enable Support for Time Manager API
michael@0 7474 dnl ========================================================
michael@0 7475 if test -n "$MOZ_TIME_MANAGER"; then
michael@0 7476 AC_DEFINE(MOZ_TIME_MANAGER)
michael@0 7477 fi
michael@0 7478 AC_SUBST(MOZ_TIME_MANAGER)
michael@0 7479
michael@0 7480 dnl ========================================================
michael@0 7481 dnl = Enable Camera Interface for B2G (Gonk usually)
michael@0 7482 dnl ========================================================
michael@0 7483 MOZ_ARG_ENABLE_BOOL(b2g-camera,
michael@0 7484 [ --enable-b2g-camera Set compile flags necessary for compiling camera API for B2G ],
michael@0 7485 MOZ_B2G_CAMERA=1,
michael@0 7486 MOZ_B2G_CAMERA= )
michael@0 7487 if test -n "$MOZ_B2G_CAMERA"; then
michael@0 7488 AC_DEFINE(MOZ_B2G_CAMERA)
michael@0 7489 fi
michael@0 7490 AC_SUBST(MOZ_B2G_CAMERA)
michael@0 7491
michael@0 7492 dnl ========================================================
michael@0 7493 dnl = Enable Support B2G-specific changes to the NSS
michael@0 7494 dnl = certificate trust database.
michael@0 7495 dnl ========================================================
michael@0 7496 if test -n "$MOZ_B2G_CERTDATA"; then
michael@0 7497 AC_DEFINE(MOZ_B2G_CERTDATA)
michael@0 7498 fi
michael@0 7499 AC_SUBST(MOZ_B2G_CERTDATA)
michael@0 7500
michael@0 7501 dnl ========================================================
michael@0 7502 dnl = Enable Support for Payment API
michael@0 7503 dnl ========================================================
michael@0 7504 if test -n "$MOZ_PAY"; then
michael@0 7505 AC_DEFINE(MOZ_PAY)
michael@0 7506 fi
michael@0 7507 AC_SUBST(MOZ_PAY)
michael@0 7508
michael@0 7509 dnl ========================================================
michael@0 7510 dnl = Enable Browser Support for Activities
michael@0 7511 dnl ========================================================
michael@0 7512 if test -n "$MOZ_ACTIVITIES"; then
michael@0 7513 AC_DEFINE(MOZ_ACTIVITIES)
michael@0 7514 fi
michael@0 7515 AC_SUBST(MOZ_ACTIVITIES)
michael@0 7516
michael@0 7517 dnl ========================================================
michael@0 7518 dnl = Enable Support for AudioChannelManager API
michael@0 7519 dnl ========================================================
michael@0 7520 if test -n "$MOZ_AUDIO_CHANNEL_MANAGER"; then
michael@0 7521 AC_DEFINE(MOZ_AUDIO_CHANNEL_MANAGER)
michael@0 7522 fi
michael@0 7523 AC_SUBST(MOZ_AUDIO_CHANNEL_MANAGER)
michael@0 7524
michael@0 7525 dnl ========================================================
michael@0 7526 dnl = Enable Support for Firefox Accounts (services/fxaccounts)
michael@0 7527 dnl ========================================================
michael@0 7528 if test -n "$MOZ_SERVICES_FXACCOUNTS"; then
michael@0 7529 AC_DEFINE(MOZ_SERVICES_FXACCOUNTS)
michael@0 7530 fi
michael@0 7531 AC_SUBST(MOZ_SERVICES_FXACCOUNTS)
michael@0 7532
michael@0 7533 dnl ========================================================
michael@0 7534 dnl = Support for demangling undefined symbols
michael@0 7535 dnl ========================================================
michael@0 7536 if test -z "$SKIP_LIBRARY_CHECKS"; then
michael@0 7537 AC_LANG_SAVE
michael@0 7538 AC_LANG_CPLUSPLUS
michael@0 7539 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
michael@0 7540 AC_LANG_RESTORE
michael@0 7541 fi
michael@0 7542
michael@0 7543 # Demangle only for debug or trace-malloc or DMD builds
michael@0 7544 MOZ_DEMANGLE_SYMBOLS=
michael@0 7545 if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC" -o "$MOZ_DMD"; then
michael@0 7546 MOZ_DEMANGLE_SYMBOLS=1
michael@0 7547 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
michael@0 7548 fi
michael@0 7549 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
michael@0 7550
michael@0 7551 dnl ========================================================
michael@0 7552 dnl = Support for gcc stack unwinding (from gcc 3.3)
michael@0 7553 dnl ========================================================
michael@0 7554 if test -z "$SKIP_LIBRARY_CHECKS"; then
michael@0 7555 AC_LANG_SAVE
michael@0 7556 AC_LANG_CPLUSPLUS
michael@0 7557 MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
michael@0 7558 AC_LANG_RESTORE
michael@0 7559 fi
michael@0 7560
michael@0 7561 dnl ========================================================
michael@0 7562 dnl JIT observers
michael@0 7563 dnl ========================================================
michael@0 7564
michael@0 7565 MOZ_ARG_WITH_STRING(jitreport-granularity,
michael@0 7566 [ --jitreport-granularity=N
michael@0 7567 Default granularity at which to report JIT code
michael@0 7568 to external tools
michael@0 7569 0 - no info
michael@0 7570 1 - code ranges for whole functions only
michael@0 7571 2 - per-line information
michael@0 7572 3 - per-op information],
michael@0 7573 JITREPORT_GRANULARITY=$withval,
michael@0 7574 JITREPORT_GRANULARITY=3)
michael@0 7575
michael@0 7576 AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY)
michael@0 7577
michael@0 7578 dnl ========================================================
michael@0 7579 dnl =
michael@0 7580 dnl = Misc. Options
michael@0 7581 dnl =
michael@0 7582 dnl ========================================================
michael@0 7583 MOZ_ARG_HEADER(Misc. Options)
michael@0 7584
michael@0 7585 dnl ========================================================
michael@0 7586 dnl update xterm title
michael@0 7587 dnl ========================================================
michael@0 7588 MOZ_ARG_ENABLE_BOOL(xterm-updates,
michael@0 7589 [ --enable-xterm-updates Update XTERM titles with current command.],
michael@0 7590 MOZ_UPDATE_XTERM=1,
michael@0 7591 MOZ_UPDATE_XTERM= )
michael@0 7592
michael@0 7593 dnl =========================================================
michael@0 7594 dnl = Chrome format
michael@0 7595 dnl =========================================================
michael@0 7596 MOZ_ARG_ENABLE_STRING([chrome-format],
michael@0 7597 [ --enable-chrome-format=jar|flat|omni
michael@0 7598 Select FORMAT of chrome files during packaging],
michael@0 7599 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
michael@0 7600
michael@0 7601 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
michael@0 7602 MOZ_CHROME_FILE_FORMAT=jar
michael@0 7603 fi
michael@0 7604
michael@0 7605 if test "$MOZ_CHROME_FILE_FORMAT" = "symlink"; then
michael@0 7606 AC_MSG_ERROR([--enable-chrome-format=symlink has been deprecated. It is now used by default in $DIST/bin on platforms that support it])
michael@0 7607 fi
michael@0 7608
michael@0 7609 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
michael@0 7610 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
michael@0 7611 test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then
michael@0 7612 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, or omni])
michael@0 7613 fi
michael@0 7614
michael@0 7615 dnl =========================================================
michael@0 7616 dnl Omnijar packaging (bug 552121)
michael@0 7617 dnl =========================================================
michael@0 7618 dnl Omnijar packaging is compatible with flat packaging.
michael@0 7619 dnl In unpackaged builds, omnijar looks for files as if
michael@0 7620 dnl things were flat packaged. After packaging, all files
michael@0 7621 dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
michael@0 7622 dnl is set to flat since putting files into jars is only
michael@0 7623 dnl done during packaging with omnijar.
michael@0 7624 if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
michael@0 7625 MOZ_OMNIJAR=1
michael@0 7626 AC_DEFINE(MOZ_OMNIJAR)
michael@0 7627 fi
michael@0 7628 MOZ_PACKAGER_FORMAT="$MOZ_CHROME_FILE_FORMAT"
michael@0 7629 if test "$OS_ARCH" = "WINNT" -o "$MOZ_WIDGET_TOOLKIT" = "android"; then
michael@0 7630 MOZ_CHROME_FILE_FORMAT=flat
michael@0 7631 else
michael@0 7632 MOZ_CHROME_FILE_FORMAT=symlink
michael@0 7633 fi
michael@0 7634
michael@0 7635 if test "$MOZ_WIDGET_TOOLKIT" = "android"; then
michael@0 7636 dnl Fennec's static resources live in the assets/ folder of the
michael@0 7637 dnl APK. Adding a path to the name here works because we only
michael@0 7638 dnl have one omnijar file in the final package (which is not the
michael@0 7639 dnl case on desktop), and necessitates some contortions during
michael@0 7640 dnl packaging so that the resources in the omnijar are considered
michael@0 7641 dnl as rooted at / and not as rooted at assets/ (which again is
michael@0 7642 dnl not the case on desktop: there are omnijars rooted at webrtc/,
michael@0 7643 dnl etc). packager.mk handles changing the rooting of the single
michael@0 7644 dnl omnijar.
michael@0 7645 OMNIJAR_NAME=assets/omni.ja
michael@0 7646 else
michael@0 7647 OMNIJAR_NAME=omni.ja
michael@0 7648 fi
michael@0 7649
michael@0 7650 AC_SUBST(OMNIJAR_NAME)
michael@0 7651 AC_SUBST(MOZ_OMNIJAR)
michael@0 7652 AC_SUBST(MOZ_PACKAGER_FORMAT)
michael@0 7653
michael@0 7654 dnl ========================================================
michael@0 7655 dnl = Define default location for MOZILLA_FIVE_HOME
michael@0 7656 dnl ========================================================
michael@0 7657 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
michael@0 7658 [ --with-default-mozilla-five-home
michael@0 7659 Set the default value for MOZILLA_FIVE_HOME],
michael@0 7660 [ val=`echo $withval`
michael@0 7661 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
michael@0 7662
michael@0 7663 dnl ========================================================
michael@0 7664 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
michael@0 7665 dnl ========================================================
michael@0 7666 MOZ_ARG_WITH_STRING(user-appdir,
michael@0 7667 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
michael@0 7668 [ val=`echo $withval`
michael@0 7669 if echo "$val" | grep "\/" >/dev/null; then
michael@0 7670 AC_MSG_ERROR("Homedir must be single relative path.")
michael@0 7671 else
michael@0 7672 MOZ_USER_DIR="$val"
michael@0 7673 fi])
michael@0 7674
michael@0 7675 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
michael@0 7676
michael@0 7677 dnl ========================================================
michael@0 7678 dnl = Doxygen configuration
michael@0 7679 dnl ========================================================
michael@0 7680 dnl Use commas to specify multiple dirs to this arg
michael@0 7681 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
michael@0 7682 MOZ_ARG_WITH_STRING(doc-input-dirs,
michael@0 7683 [ --with-doc-input-dirs=DIRS
michael@0 7684 Header/idl dirs to create docs from],
michael@0 7685 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
michael@0 7686 AC_SUBST(MOZ_DOC_INPUT_DIRS)
michael@0 7687
michael@0 7688 dnl Use commas to specify multiple dirs to this arg
michael@0 7689 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
michael@0 7690 MOZ_ARG_WITH_STRING(doc-include-dirs,
michael@0 7691 [ --with-doc-include-dirs=DIRS
michael@0 7692 Include dirs to preprocess doc headers],
michael@0 7693 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
michael@0 7694 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
michael@0 7695
michael@0 7696 MOZ_DOC_OUTPUT_DIR='./dist/docs'
michael@0 7697 MOZ_ARG_WITH_STRING(doc-output-dir,
michael@0 7698 [ --with-doc-output-dir=DIR
michael@0 7699 Dir to generate docs into],
michael@0 7700 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
michael@0 7701 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
michael@0 7702
michael@0 7703 if test -z "$SKIP_COMPILER_CHECKS"; then
michael@0 7704 dnl ========================================================
michael@0 7705 dnl =
michael@0 7706 dnl = Compiler Options
michael@0 7707 dnl =
michael@0 7708 dnl ========================================================
michael@0 7709 MOZ_ARG_HEADER(Compiler Options)
michael@0 7710
michael@0 7711 dnl ========================================================
michael@0 7712 dnl Check for gcc -pipe support
michael@0 7713 dnl ========================================================
michael@0 7714 AC_MSG_CHECKING([for -pipe support])
michael@0 7715 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
michael@0 7716 dnl Any gcc that supports firefox supports -pipe.
michael@0 7717 CFLAGS="$CFLAGS -pipe"
michael@0 7718 CXXFLAGS="$CXXFLAGS -pipe"
michael@0 7719 AC_MSG_RESULT([yes])
michael@0 7720 else
michael@0 7721 AC_MSG_RESULT([no])
michael@0 7722 fi
michael@0 7723
michael@0 7724 dnl ========================================================
michael@0 7725 dnl Profile guided optimization (gcc checks)
michael@0 7726 dnl ========================================================
michael@0 7727 dnl Test for profiling options
michael@0 7728 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
michael@0 7729
michael@0 7730 _SAVE_CFLAGS="$CFLAGS"
michael@0 7731 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
michael@0 7732
michael@0 7733 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
michael@0 7734 AC_TRY_COMPILE([], [return 0;],
michael@0 7735 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
michael@0 7736 result="yes" ], result="no")
michael@0 7737 AC_MSG_RESULT([$result])
michael@0 7738
michael@0 7739 if test $result = "yes"; then
michael@0 7740 PROFILE_GEN_LDFLAGS="-fprofile-generate"
michael@0 7741 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
michael@0 7742 PROFILE_USE_LDFLAGS="-fprofile-use"
michael@0 7743 fi
michael@0 7744
michael@0 7745 CFLAGS="$_SAVE_CFLAGS"
michael@0 7746
michael@0 7747 if test -n "$INTEL_CC"; then
michael@0 7748 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
michael@0 7749 PROFILE_GEN_LDFLAGS=
michael@0 7750 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
michael@0 7751 PROFILE_USE_LDFLAGS=
michael@0 7752 fi
michael@0 7753
michael@0 7754 dnl Sun Studio on Solaris
michael@0 7755 if test "$SOLARIS_SUNPRO_CC"; then
michael@0 7756 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
michael@0 7757 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
michael@0 7758 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
michael@0 7759 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
michael@0 7760 fi
michael@0 7761
michael@0 7762 AC_SUBST(PROFILE_GEN_CFLAGS)
michael@0 7763 AC_SUBST(PROFILE_GEN_LDFLAGS)
michael@0 7764 AC_SUBST(PROFILE_USE_CFLAGS)
michael@0 7765 AC_SUBST(PROFILE_USE_LDFLAGS)
michael@0 7766
michael@0 7767 AC_LANG_CPLUSPLUS
michael@0 7768
michael@0 7769 dnl ========================================================
michael@0 7770 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
michael@0 7771 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
michael@0 7772 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
michael@0 7773 dnl ========================================================
michael@0 7774 _SAVE_CXXFLAGS=$CXXFLAGS
michael@0 7775 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
michael@0 7776 AC_CACHE_CHECK(for correct overload resolution with const and templates,
michael@0 7777 ac_nscap_nonconst_opeq_bug,
michael@0 7778 [AC_TRY_COMPILE([
michael@0 7779 template <class T>
michael@0 7780 class Pointer
michael@0 7781 {
michael@0 7782 public:
michael@0 7783 T* myPtr;
michael@0 7784 };
michael@0 7785
michael@0 7786 template <class T, class U>
michael@0 7787 int operator==(const Pointer<T>& rhs, U* lhs)
michael@0 7788 {
michael@0 7789 return rhs.myPtr == lhs;
michael@0 7790 }
michael@0 7791
michael@0 7792 template <class T, class U>
michael@0 7793 int operator==(const Pointer<T>& rhs, const U* lhs)
michael@0 7794 {
michael@0 7795 return rhs.myPtr == lhs;
michael@0 7796 }
michael@0 7797 ],
michael@0 7798 [
michael@0 7799 Pointer<int> foo;
michael@0 7800 const int* bar;
michael@0 7801 return foo == bar;
michael@0 7802 ],
michael@0 7803 ac_nscap_nonconst_opeq_bug="no",
michael@0 7804 ac_nscap_nonconst_opeq_bug="yes")])
michael@0 7805 CXXFLAGS="$_SAVE_CXXFLAGS"
michael@0 7806
michael@0 7807 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
michael@0 7808 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
michael@0 7809 fi
michael@0 7810 fi # ! SKIP_COMPILER_CHECKS
michael@0 7811
michael@0 7812 AC_DEFINE(CPP_THROW_NEW, [throw()])
michael@0 7813 AC_LANG_C
michael@0 7814
michael@0 7815 if test "$COMPILE_ENVIRONMENT"; then
michael@0 7816 MOZ_EXPAND_LIBS
michael@0 7817 fi # COMPILE_ENVIRONMENT
michael@0 7818
michael@0 7819 dnl ========================================================
michael@0 7820 dnl =
michael@0 7821 dnl = Build depencency options
michael@0 7822 dnl =
michael@0 7823 dnl ========================================================
michael@0 7824 MOZ_ARG_HEADER(Build dependencies)
michael@0 7825
michael@0 7826 if test "$GNU_CC" -a "$GNU_CXX"; then
michael@0 7827 _DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
michael@0 7828 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
michael@0 7829 elif test "$SOLARIS_SUNPRO_CC"; then
michael@0 7830 _DEPEND_CFLAGS=
michael@0 7831 else
michael@0 7832 dnl Don't override this for MSVC
michael@0 7833 if test -z "$_WIN32_MSVC"; then
michael@0 7834 _USE_CPP_INCLUDE_FLAG=
michael@0 7835 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
michael@0 7836 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
michael@0 7837 else
michael@0 7838 echo '#include <stdio.h>' > dummy-hello.c
michael@0 7839 changequote(,)
michael@0 7840 dnl This output is localized, split at the first double space or colon and space.
michael@0 7841 _CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*stdio.h\)$"
michael@0 7842 CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'`
michael@0 7843 _CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'`
michael@0 7844 changequote([,])
michael@0 7845 if ! test -e "$_CL_STDIO_PATH"; then
michael@0 7846 AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.])
michael@0 7847 fi
michael@0 7848 if test -z "$CL_INCLUDES_PREFIX"; then
michael@0 7849 AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
michael@0 7850 fi
michael@0 7851 AC_SUBST(CL_INCLUDES_PREFIX)
michael@0 7852 rm -f dummy-hello.c
michael@0 7853
michael@0 7854 dnl Make sure that the build system can handle non-ASCII characters
michael@0 7855 dnl in environment variables to prevent it from breaking silently on
michael@0 7856 dnl non-English systems.
michael@0 7857 NONASCII=$'\241\241'
michael@0 7858 AC_SUBST(NONASCII)
michael@0 7859 fi
michael@0 7860 fi
michael@0 7861
michael@0 7862 dnl ========================================================
michael@0 7863 dnl =
michael@0 7864 dnl = Static Build Options
michael@0 7865 dnl =
michael@0 7866 dnl ========================================================
michael@0 7867 MOZ_ARG_HEADER(Static build options)
michael@0 7868
michael@0 7869 AC_SUBST(LIBXUL_LIBS)
michael@0 7870 XPCOM_LIBS="$LIBXUL_LIBS"
michael@0 7871
michael@0 7872 if test "$OS_ARCH" = "WINNT"; then
michael@0 7873 GKMEDIAS_SHARED_LIBRARY=1
michael@0 7874 AC_DEFINE(GKMEDIAS_SHARED_LIBRARY)
michael@0 7875 fi
michael@0 7876 AC_SUBST(GKMEDIAS_SHARED_LIBRARY)
michael@0 7877
michael@0 7878 if test -z "$MOZ_NATIVE_ZLIB"; then
michael@0 7879 if test -n "$JS_SHARED_LIBRARY" -o "$GKMEDIAS_SHARED_LIBRARY"; then
michael@0 7880 ZLIB_IN_MOZGLUE=1
michael@0 7881 AC_DEFINE(ZLIB_IN_MOZGLUE)
michael@0 7882 fi
michael@0 7883 fi
michael@0 7884
michael@0 7885 AC_SUBST(ZLIB_IN_MOZGLUE)
michael@0 7886
michael@0 7887 dnl ========================================================
michael@0 7888 dnl =
michael@0 7889 dnl = Standalone module options
michael@0 7890 dnl =
michael@0 7891 dnl ========================================================
michael@0 7892 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
michael@0 7893
michael@0 7894 dnl Check for GLib.
michael@0 7895 dnl ========================================================
michael@0 7896
michael@0 7897 if test -z "$SKIP_PATH_CHECKS"; then
michael@0 7898 if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
michael@0 7899 if test "$MOZ_ENABLE_GTK" ; then
michael@0 7900 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
michael@0 7901 fi
michael@0 7902 fi
michael@0 7903 fi
michael@0 7904
michael@0 7905 if test -z "${GLIB_GMODULE_LIBS}" \
michael@0 7906 -a -n "${GLIB_CONFIG}"\
michael@0 7907 -a "${GLIB_CONFIG}" != no\
michael@0 7908 ; then
michael@0 7909 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
michael@0 7910 fi
michael@0 7911
michael@0 7912 AC_SUBST(GLIB_CFLAGS)
michael@0 7913 AC_SUBST(GLIB_LIBS)
michael@0 7914 AC_SUBST(GLIB_GMODULE_LIBS)
michael@0 7915
michael@0 7916 dnl ========================================================
michael@0 7917 dnl Graphics checks.
michael@0 7918 dnl ========================================================
michael@0 7919
michael@0 7920 if test "${OS_TARGET}" = "WINNT"; then
michael@0 7921 if $PERL -e "exit($MOZ_WINSDK_MAXVER < 0x06020000)"; then
michael@0 7922 MOZ_ENABLE_DIRECT2D1_1=1
michael@0 7923 AC_SUBST(MOZ_ENABLE_DIRECT2D1_1)
michael@0 7924 fi
michael@0 7925 fi
michael@0 7926
michael@0 7927 if test "${OS_TARGET}" = "WINNT" -o \
michael@0 7928 "${OS_ARCH}" = "Darwin" -o \
michael@0 7929 "${MOZ_WIDGET_TOOLKIT}" = "android" -o \
michael@0 7930 "${MOZ_WIDGET_TOOLKIT}" = "gonk" -o \
michael@0 7931 "${MOZ_WIDGET_TOOLKIT}" = "gtk2" -o \
michael@0 7932 "${MOZ_WIDGET_TOOLKIT}" = "gtk3"; then
michael@0 7933 case "${target_cpu}" in
michael@0 7934 i*86*|x86_64|arm)
michael@0 7935 MOZ_ENABLE_SKIA=1
michael@0 7936 ;;
michael@0 7937 *)
michael@0 7938 MOZ_ENABLE_SKIA=
michael@0 7939 ;;
michael@0 7940 esac
michael@0 7941 else
michael@0 7942 MOZ_ENABLE_SKIA=
michael@0 7943 fi
michael@0 7944
michael@0 7945 MOZ_ARG_ENABLE_BOOL(skia,
michael@0 7946 [ --enable-skia Enable use of Skia],
michael@0 7947 MOZ_ENABLE_SKIA=1,
michael@0 7948 MOZ_ENABLE_SKIA=)
michael@0 7949
michael@0 7950 if test "$USE_FC_FREETYPE"; then
michael@0 7951 if test "$COMPILE_ENVIRONMENT"; then
michael@0 7952 dnl ========================================================
michael@0 7953 dnl = Check for freetype2 and its functionality
michael@0 7954 dnl ========================================================
michael@0 7955 PKG_CHECK_MODULES(FT2, freetype2 >= 6.1.0, _HAVE_FREETYPE2=1, _HAVE_FREETYPE2=)
michael@0 7956
michael@0 7957 if test "$_HAVE_FREETYPE2"; then
michael@0 7958 _SAVE_LIBS="$LIBS"
michael@0 7959 _SAVE_CFLAGS="$CFLAGS"
michael@0 7960 LIBS="$LIBS $FT2_LIBS"
michael@0 7961 CFLAGS="$CFLAGS $FT2_CFLAGS"
michael@0 7962
michael@0 7963 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
michael@0 7964 ac_cv_member_FT_Bitmap_Size_y_ppem,
michael@0 7965 [AC_TRY_COMPILE([#include <ft2build.h>
michael@0 7966 #include FT_FREETYPE_H],
michael@0 7967 [FT_Bitmap_Size s;
michael@0 7968 if (sizeof s.y_ppem) return 0;
michael@0 7969 return 1],
michael@0 7970 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
michael@0 7971 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
michael@0 7972 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
michael@0 7973 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
michael@0 7974 else
michael@0 7975 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
michael@0 7976 fi
michael@0 7977 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
michael@0 7978 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
michael@0 7979 [FT_Bitmap_Size structure includes y_ppem field])
michael@0 7980
michael@0 7981 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table)
michael@0 7982
michael@0 7983 LIBS="$_SAVE_LIBS"
michael@0 7984 CFLAGS="$_SAVE_CFLAGS"
michael@0 7985 fi
michael@0 7986
michael@0 7987 _SAVE_CPPFLAGS="$CPPFLAGS"
michael@0 7988 CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
michael@0 7989 MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
michael@0 7990 [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
michael@0 7991 CPPFLAGS="$_SAVE_CPPFLAGS"
michael@0 7992 else
michael@0 7993 AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
michael@0 7994 fi
michael@0 7995
michael@0 7996 PKG_CHECK_MODULES(_FONTCONFIG, fontconfig,
michael@0 7997 [
michael@0 7998 if test "$MOZ_PANGO"; then
michael@0 7999 MOZ_PANGO_CFLAGS="$MOZ_PANGO_CFLAGS $_FONTCONFIG_CFLAGS"
michael@0 8000 MOZ_PANGO_LIBS="$MOZ_PANGO_LIBS $_FONTCONFIG_LIBS"
michael@0 8001 else
michael@0 8002 FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
michael@0 8003 FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
michael@0 8004 fi
michael@0 8005 ])
michael@0 8006 fi
michael@0 8007
michael@0 8008 dnl ========================================================
michael@0 8009 dnl Check for pixman and cairo
michael@0 8010 dnl ========================================================
michael@0 8011
michael@0 8012 if test "$MOZ_WIDGET_TOOLKIT" = "gtk3" ; then
michael@0 8013 # cairo-gtk3 can be build with system-cairo only
michael@0 8014 MOZ_TREE_CAIRO=
michael@0 8015 else
michael@0 8016 MOZ_TREE_CAIRO=1
michael@0 8017 fi
michael@0 8018
michael@0 8019 MOZ_ARG_ENABLE_BOOL(system-cairo,
michael@0 8020 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
michael@0 8021 MOZ_TREE_CAIRO=,
michael@0 8022 MOZ_TREE_CAIRO=1 )
michael@0 8023
michael@0 8024 MOZ_TREE_PIXMAN=1
michael@0 8025 MOZ_ARG_ENABLE_BOOL(system-pixman,
michael@0 8026 [ --enable-system-pixman Use system pixman (located with pkgconfig)],
michael@0 8027 MOZ_TREE_PIXMAN=,
michael@0 8028 MOZ_TREE_PIXMAN=force,
michael@0 8029 MOZ_TREE_PIXMAN=1 )
michael@0 8030
michael@0 8031 # System cairo depends on system pixman
michael@0 8032 if test "$MOZ_TREE_PIXMAN" = "force"; then
michael@0 8033 if test -z "$MOZ_TREE_CAIRO"; then
michael@0 8034 AC_MSG_ERROR([--disable-system-pixman is incompatible with --enable-system-cairo.])
michael@0 8035 else
michael@0 8036 MOZ_TREE_PIXMAN=1
michael@0 8037 fi
michael@0 8038 elif test -z "$MOZ_TREE_CAIRO"; then
michael@0 8039 MOZ_TREE_PIXMAN=
michael@0 8040 fi
michael@0 8041
michael@0 8042 if test "$MOZ_TREE_PIXMAN"; then
michael@0 8043 AC_DEFINE(MOZ_TREE_PIXMAN)
michael@0 8044 MOZ_PIXMAN_CFLAGS=""
michael@0 8045 MOZ_PIXMAN_LIBS='$(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
michael@0 8046 else
michael@0 8047 PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2)
michael@0 8048 MOZ_PIXMAN_CFLAGS="$PIXMAN_CFLAGS"
michael@0 8049 MOZ_PIXMAN_LIBS="$PIXMAN_LIBS"
michael@0 8050 fi
michael@0 8051 AC_SUBST(MOZ_PIXMAN_CFLAGS)
michael@0 8052 AC_SUBST(MOZ_PIXMAN_LIBS)
michael@0 8053
michael@0 8054 # Check for headers defining standard int types.
michael@0 8055 if test -n "$COMPILE_ENVIRONMENT"; then
michael@0 8056 MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
michael@0 8057 fi
michael@0 8058
michael@0 8059 if test "$MOZ_TREE_CAIRO"; then
michael@0 8060 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
michael@0 8061 AC_DEFINE(MOZ_TREE_CAIRO)
michael@0 8062
michael@0 8063 if test "$OS_ARCH" = "WINNT"; then
michael@0 8064 # For now we assume that we will have a uint64_t available through
michael@0 8065 # one of the above headers or mozstdint.h.
michael@0 8066 AC_DEFINE(HAVE_UINT64_T)
michael@0 8067 fi
michael@0 8068
michael@0 8069 # Define macros for cairo-features.h
michael@0 8070 TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1"
michael@0 8071 if test "$MOZ_X11"; then
michael@0 8072 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
michael@0 8073 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
michael@0 8074 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
michael@0 8075 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
michael@0 8076 MOZ_ENABLE_CAIRO_FT=1
michael@0 8077 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
michael@0 8078 fi
michael@0 8079 case "$MOZ_WIDGET_TOOLKIT" in
michael@0 8080 qt)
michael@0 8081 QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
michael@0 8082 ;;
michael@0 8083 cocoa | uikit)
michael@0 8084 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
michael@0 8085 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
michael@0 8086 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
michael@0 8087 ;;
michael@0 8088 windows)
michael@0 8089 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
michael@0 8090 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
michael@0 8091 if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
michael@0 8092 WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
michael@0 8093 WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
michael@0 8094 MOZ_ENABLE_D2D_SURFACE=1
michael@0 8095 MOZ_ENABLE_DWRITE_FONT=1
michael@0 8096 else
michael@0 8097 WIN32_DWRITE_FONT_FEATURE=
michael@0 8098 WIN32_D2D_SURFACE_FEATURE=
michael@0 8099 fi
michael@0 8100
michael@0 8101 MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
michael@0 8102
michael@0 8103 dnl D3D10 Layers depend on D2D Surfaces.
michael@0 8104 if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
michael@0 8105 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
michael@0 8106 fi
michael@0 8107 ;;
michael@0 8108 gtk3)
michael@0 8109 AC_MSG_ERROR([cairo-gtk3 toolkit is incompatible with in-tree cairo. Please add --enable-system-cairo to your build config.])
michael@0 8110 ;;
michael@0 8111 esac
michael@0 8112 if test "$USE_FC_FREETYPE"; then
michael@0 8113 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
michael@0 8114 fi
michael@0 8115 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
michael@0 8116 AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
michael@0 8117 AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
michael@0 8118 AC_SUBST(MOZ_ENABLE_D3D9_LAYER)
michael@0 8119 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
michael@0 8120 AC_SUBST(CAIRO_FT_CFLAGS)
michael@0 8121
michael@0 8122 AC_SUBST(PS_SURFACE_FEATURE)
michael@0 8123 AC_SUBST(PDF_SURFACE_FEATURE)
michael@0 8124 AC_SUBST(SVG_SURFACE_FEATURE)
michael@0 8125 AC_SUBST(XLIB_SURFACE_FEATURE)
michael@0 8126 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
michael@0 8127 AC_SUBST(QUARTZ_SURFACE_FEATURE)
michael@0 8128 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
michael@0 8129 AC_SUBST(WIN32_SURFACE_FEATURE)
michael@0 8130 AC_SUBST(OS2_SURFACE_FEATURE)
michael@0 8131 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
michael@0 8132 AC_SUBST(FT_FONT_FEATURE)
michael@0 8133 AC_SUBST(FC_FONT_FEATURE)
michael@0 8134 AC_SUBST(WIN32_FONT_FEATURE)
michael@0 8135 AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
michael@0 8136 AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
michael@0 8137 AC_SUBST(QUARTZ_FONT_FEATURE)
michael@0 8138 AC_SUBST(PNG_FUNCTIONS_FEATURE)
michael@0 8139 AC_SUBST(QT_SURFACE_FEATURE)
michael@0 8140 AC_SUBST(TEE_SURFACE_FEATURE)
michael@0 8141
michael@0 8142 MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
michael@0 8143
michael@0 8144 if test "$MOZ_X11"; then
michael@0 8145 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
michael@0 8146 fi
michael@0 8147
michael@0 8148 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
michael@0 8149 else
michael@0 8150 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
michael@0 8151 MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS"
michael@0 8152 MOZ_CAIRO_LIBS="$CAIRO_LIBS"
michael@0 8153 PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION)
michael@0 8154 if test "$MOZ_X11"; then
michael@0 8155 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
michael@0 8156 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
michael@0 8157 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_LIBS"
michael@0 8158 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
michael@0 8159 fi
michael@0 8160 fi
michael@0 8161
michael@0 8162 AC_SUBST(MOZ_TREE_CAIRO)
michael@0 8163 AC_SUBST(MOZ_CAIRO_CFLAGS)
michael@0 8164 AC_SUBST(MOZ_CAIRO_LIBS)
michael@0 8165 AC_SUBST(MOZ_CAIRO_OSLIBS)
michael@0 8166 AC_SUBST(MOZ_TREE_PIXMAN)
michael@0 8167
michael@0 8168 dnl ========================================================
michael@0 8169 dnl Skia
michael@0 8170 dnl ========================================================
michael@0 8171 if test "$MOZ_ENABLE_SKIA"; then
michael@0 8172 AC_DEFINE(MOZ_ENABLE_SKIA)
michael@0 8173 AC_DEFINE(USE_SKIA)
michael@0 8174 if test "${MOZ_WIDGET_TOOLKIT}" = "android" -o x"$MOZ_WIDGET_TOOLKIT" = x"gonk"; then
michael@0 8175 AC_DEFINE(SK_BUILD_FOR_ANDROID_NDK)
michael@0 8176 fi
michael@0 8177
michael@0 8178 if test "${CPU_ARCH}" != "ppc" -a "${CPU_ARCH}" != "ppc64" -a "${CPU_ARCH}" != "sparc" ; then
michael@0 8179 MOZ_ENABLE_SKIA_GPU=1
michael@0 8180 AC_DEFINE(USE_SKIA_GPU)
michael@0 8181 AC_SUBST(MOZ_ENABLE_SKIA_GPU)
michael@0 8182 fi
michael@0 8183 fi
michael@0 8184 AC_SUBST(MOZ_ENABLE_SKIA)
michael@0 8185
michael@0 8186 dnl ========================================================
michael@0 8187 dnl disable xul
michael@0 8188 dnl ========================================================
michael@0 8189 MOZ_ARG_DISABLE_BOOL(xul,
michael@0 8190 [ --disable-xul Disable XUL],
michael@0 8191 MOZ_XUL= )
michael@0 8192 if test "$MOZ_XUL"; then
michael@0 8193 AC_DEFINE(MOZ_XUL)
michael@0 8194 else
michael@0 8195 dnl remove extensions that require XUL
michael@0 8196 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
michael@0 8197 fi
michael@0 8198
michael@0 8199 AC_SUBST(MOZ_XUL)
michael@0 8200
michael@0 8201 dnl ========================================================
michael@0 8202 dnl disable profile locking
michael@0 8203 dnl do no use this in applications that can have more than
michael@0 8204 dnl one process accessing the profile directory.
michael@0 8205 dnl ========================================================
michael@0 8206 MOZ_ARG_DISABLE_BOOL(profilelocking,
michael@0 8207 [ --disable-profilelocking
michael@0 8208 Disable profile locking],
michael@0 8209 MOZ_PROFILELOCKING=,
michael@0 8210 MOZ_PROFILELOCKING=1 )
michael@0 8211 if test "$MOZ_PROFILELOCKING"; then
michael@0 8212 AC_DEFINE(MOZ_PROFILELOCKING)
michael@0 8213 fi
michael@0 8214
michael@0 8215 dnl ========================================================
michael@0 8216 dnl necko configuration options
michael@0 8217 dnl ========================================================
michael@0 8218
michael@0 8219 dnl
michael@0 8220 dnl option to disable various necko protocols
michael@0 8221 dnl
michael@0 8222 MOZ_ARG_ENABLE_STRING(necko-protocols,
michael@0 8223 [ --enable-necko-protocols[={http,ftp,default,all,none}]
michael@0 8224 Enable/disable specific protocol handlers],
michael@0 8225 [ for option in `echo $enableval | sed 's/,/ /g'`; do
michael@0 8226 if test "$option" = "yes" -o "$option" = "all"; then
michael@0 8227 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
michael@0 8228 elif test "$option" = "no" -o "$option" = "none"; then
michael@0 8229 NECKO_PROTOCOLS=""
michael@0 8230 elif test "$option" = "default"; then
michael@0 8231 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
michael@0 8232 elif test `echo "$option" | grep -c \^-` != 0; then
michael@0 8233 option=`echo $option | sed 's/^-//'`
michael@0 8234 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
michael@0 8235 else
michael@0 8236 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
michael@0 8237 fi
michael@0 8238 done],
michael@0 8239 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
michael@0 8240 dnl Remove dupes
michael@0 8241 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
michael@0 8242 AC_SUBST_SET(NECKO_PROTOCOLS)
michael@0 8243 for p in $NECKO_PROTOCOLS; do
michael@0 8244 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
michael@0 8245 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_PROTOCOL_$p"
michael@0 8246 done
michael@0 8247
michael@0 8248 dnl
michael@0 8249 dnl option to disable necko's wifi scanner
michael@0 8250 dnl
michael@0 8251
michael@0 8252 case "$OS_TARGET" in
michael@0 8253 Android)
michael@0 8254 if test -n "$gonkdir"; then
michael@0 8255 NECKO_WIFI=1
michael@0 8256 fi
michael@0 8257 ;;
michael@0 8258 Darwin|FreeBSD|SunOS|WINNT)
michael@0 8259 NECKO_WIFI=1
michael@0 8260 ;;
michael@0 8261 Linux)
michael@0 8262 NECKO_WIFI=1
michael@0 8263 NECKO_WIFI_DBUS=1
michael@0 8264 ;;
michael@0 8265 esac
michael@0 8266
michael@0 8267 MOZ_ARG_DISABLE_BOOL(necko-wifi,
michael@0 8268 [ --disable-necko-wifi Disable necko wifi scanner],
michael@0 8269 NECKO_WIFI=,
michael@0 8270 NECKO_WIFI=1)
michael@0 8271
michael@0 8272 if test "$NECKO_WIFI"; then
michael@0 8273 if test -z "$MOZ_ENABLE_DBUS" -a -n "$NECKO_WIFI_DBUS"; then
michael@0 8274 AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
michael@0 8275 fi
michael@0 8276 AC_DEFINE(NECKO_WIFI)
michael@0 8277 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
michael@0 8278 fi
michael@0 8279 AC_SUBST(NECKO_WIFI)
michael@0 8280 AC_SUBST(NECKO_WIFI_DBUS)
michael@0 8281
michael@0 8282 dnl
michael@0 8283 dnl option to disable cookies
michael@0 8284 dnl
michael@0 8285 MOZ_ARG_DISABLE_BOOL(cookies,
michael@0 8286 [ --disable-cookies Disable cookie support],
michael@0 8287 NECKO_COOKIES=,
michael@0 8288 NECKO_COOKIES=1)
michael@0 8289 AC_SUBST(NECKO_COOKIES)
michael@0 8290 if test "$NECKO_COOKIES"; then
michael@0 8291 AC_DEFINE(NECKO_COOKIES)
michael@0 8292 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
michael@0 8293 fi
michael@0 8294
michael@0 8295 dnl
michael@0 8296 dnl Always build Marionette if not Android or B2G
michael@0 8297 dnl
michael@0 8298 if test "$OS_TARGET" != Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
michael@0 8299 AC_DEFINE(ENABLE_MARIONETTE)
michael@0 8300 fi
michael@0 8301 AC_SUBST(ENABLE_MARIONETTE)
michael@0 8302 if test "$ENABLE_MARIONETTE"; then
michael@0 8303 AC_DEFINE(ENABLE_MARIONETTE)
michael@0 8304 fi
michael@0 8305
michael@0 8306 dnl
michael@0 8307 dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
michael@0 8308 dnl
michael@0 8309 MOZ_ARG_DISABLE_BOOL(ctypes,
michael@0 8310 [ --disable-ctypes Disable js-ctypes],
michael@0 8311 BUILD_CTYPES=,
michael@0 8312 BUILD_CTYPES=1)
michael@0 8313 AC_SUBST(BUILD_CTYPES)
michael@0 8314 if test "$BUILD_CTYPES"; then
michael@0 8315 AC_DEFINE(BUILD_CTYPES)
michael@0 8316 fi
michael@0 8317
michael@0 8318 dnl Build Places if required
michael@0 8319 if test "$MOZ_PLACES"; then
michael@0 8320 AC_DEFINE(MOZ_PLACES)
michael@0 8321 fi
michael@0 8322
michael@0 8323 dnl Build SocialAPI if required
michael@0 8324 if test "$MOZ_SOCIAL"; then
michael@0 8325 AC_DEFINE(MOZ_SOCIAL)
michael@0 8326 fi
michael@0 8327
michael@0 8328 dnl Build Common JS modules provided by services.
michael@0 8329 AC_SUBST(MOZ_SERVICES_COMMON)
michael@0 8330 if test -n "$MOZ_SERVICES_COMMON"; then
michael@0 8331 AC_DEFINE(MOZ_SERVICES_COMMON)
michael@0 8332 fi
michael@0 8333
michael@0 8334 dnl Build Services crypto component (used by Sync)
michael@0 8335 AC_SUBST(MOZ_SERVICES_CRYPTO)
michael@0 8336 if test -n "$MOZ_SERVICES_CRYPTO"; then
michael@0 8337 AC_DEFINE(MOZ_SERVICES_CRYPTO)
michael@0 8338 fi
michael@0 8339
michael@0 8340 dnl Build Firefox Health Reporter Service
michael@0 8341 AC_SUBST(MOZ_SERVICES_HEALTHREPORT)
michael@0 8342 if test -n "$MOZ_SERVICES_HEALTHREPORT"; then
michael@0 8343 AC_DEFINE(MOZ_SERVICES_HEALTHREPORT)
michael@0 8344 fi
michael@0 8345
michael@0 8346 dnl Build Services metrics component
michael@0 8347 AC_SUBST(MOZ_SERVICES_METRICS)
michael@0 8348 if test -n "$MOZ_SERVICES_METRICS"; then
michael@0 8349 AC_DEFINE(MOZ_SERVICES_METRICS)
michael@0 8350 fi
michael@0 8351
michael@0 8352 dnl Build Notifications if required
michael@0 8353 AC_SUBST(MOZ_SERVICES_NOTIFICATIONS)
michael@0 8354 if test -n "$MOZ_SERVICES_NOTIFICATIONS"; then
michael@0 8355 AC_DEFINE(MOZ_SERVICES_NOTIFICATIONS)
michael@0 8356 fi
michael@0 8357
michael@0 8358 dnl Build Sync Services if required
michael@0 8359 AC_SUBST(MOZ_SERVICES_SYNC)
michael@0 8360 if test -n "$MOZ_SERVICES_SYNC"; then
michael@0 8361 AC_DEFINE(MOZ_SERVICES_SYNC)
michael@0 8362 fi
michael@0 8363
michael@0 8364 dnl Build Captive Portal Detector if required
michael@0 8365 AC_SUBST(MOZ_CAPTIVEDETECT)
michael@0 8366 if test -n "$MOZ_CAPTIVEDETECT"; then
michael@0 8367 AC_DEFINE(MOZ_CAPTIVEDETECT)
michael@0 8368 fi
michael@0 8369
michael@0 8370 dnl ========================================================
michael@0 8371 if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC" -o "$MOZ_DMD"; then
michael@0 8372 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
michael@0 8373 fi
michael@0 8374
michael@0 8375 if test "$MOZ_APP_COMPONENT_INCLUDE"; then
michael@0 8376 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE")
michael@0 8377 fi
michael@0 8378
michael@0 8379 if test "$MOZ_APP_COMPONENT_MODULES"; then
michael@0 8380 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_MODULES, $MOZ_APP_COMPONENT_MODULES)
michael@0 8381 fi
michael@0 8382
michael@0 8383 dnl ========================================================
michael@0 8384 dnl =
michael@0 8385 dnl = Maintainer debug option (no --enable equivalent)
michael@0 8386 dnl =
michael@0 8387 dnl ========================================================
michael@0 8388
michael@0 8389 AC_SUBST(AR)
michael@0 8390 AC_SUBST(AR_FLAGS)
michael@0 8391 AC_SUBST(AR_LIST)
michael@0 8392 AC_SUBST(AR_EXTRACT)
michael@0 8393 AC_SUBST(AR_DELETE)
michael@0 8394 AC_SUBST(AS)
michael@0 8395 AC_SUBST(ASFLAGS)
michael@0 8396 AC_SUBST(AS_DASH_C_FLAG)
michael@0 8397 AC_SUBST(LD)
michael@0 8398 AC_SUBST(RC)
michael@0 8399 AC_SUBST(RCFLAGS)
michael@0 8400 AC_SUBST(MC)
michael@0 8401 AC_SUBST(WINDRES)
michael@0 8402 AC_SUBST(IMPLIB)
michael@0 8403 AC_SUBST(FILTER)
michael@0 8404 AC_SUBST(BIN_FLAGS)
michael@0 8405 AC_SUBST(MOZ_WIDGET_TOOLKIT)
michael@0 8406 AC_SUBST(MOZ_UPDATE_XTERM)
michael@0 8407 AC_SUBST(MOZ_AUTH_EXTENSION)
michael@0 8408 AC_SUBST(MOZ_PERMISSIONS)
michael@0 8409 AC_SUBST(MOZ_PREF_EXTENSIONS)
michael@0 8410 AC_SUBST(MOZ_JS_LIBS)
michael@0 8411 AC_SUBST(MOZ_DEBUG)
michael@0 8412 AC_SUBST(MOZ_DEBUG_SYMBOLS)
michael@0 8413 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
michael@0 8414 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
michael@0 8415 AC_SUBST(MOZ_DEBUG_LDFLAGS)
michael@0 8416 AC_SUBST(WARNINGS_AS_ERRORS)
michael@0 8417 AC_SUBST(MOZ_EXTENSIONS)
michael@0 8418 AC_SUBST(MOZ_JSDEBUGGER)
michael@0 8419 AC_SUBST(MOZ_ENABLE_PROFILER_SPS)
michael@0 8420 AC_SUBST(MOZ_JPROF)
michael@0 8421 AC_SUBST(MOZ_SHARK)
michael@0 8422 AC_SUBST(MOZ_INSTRUMENTS)
michael@0 8423 AC_SUBST(MOZ_CALLGRIND)
michael@0 8424 AC_SUBST(MOZ_VTUNE)
michael@0 8425 AC_SUBST(MOZ_PROFILING)
michael@0 8426 AC_SUBST(LIBICONV)
michael@0 8427 AC_SUBST(MOZ_PLACES)
michael@0 8428 AC_SUBST(MOZ_SOCIAL)
michael@0 8429 AC_SUBST(MOZ_TOOLKIT_SEARCH)
michael@0 8430 AC_SUBST(MOZ_FEEDS)
michael@0 8431 AC_SUBST(NS_PRINTING)
michael@0 8432 AC_SUBST(MOZ_WEBGL)
michael@0 8433 AC_SUBST(MOZ_HELP_VIEWER)
michael@0 8434 AC_SUBST(TOOLCHAIN_PREFIX)
michael@0 8435
michael@0 8436 AC_SUBST(JAVA)
michael@0 8437 AC_SUBST(JAVAC)
michael@0 8438 AC_SUBST(JAVAH)
michael@0 8439 AC_SUBST(JAR)
michael@0 8440 AC_SUBST(JARSIGNER)
michael@0 8441 AC_SUBST(KEYTOOL)
michael@0 8442
michael@0 8443 AC_SUBST(MOZ_PROFILELOCKING)
michael@0 8444
michael@0 8445 AC_SUBST(ENABLE_TESTS)
michael@0 8446 AC_SUBST(MOZ_UNIVERSALCHARDET)
michael@0 8447 AC_SUBST(ACCESSIBILITY)
michael@0 8448 AC_SUBST(MOZ_SPELLCHECK)
michael@0 8449 AC_SUBST(MOZ_ANDROID_OMTC)
michael@0 8450 AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
michael@0 8451 AC_SUBST(MOZ_CRASHREPORTER)
michael@0 8452 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
michael@0 8453 AC_SUBST(MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS)
michael@0 8454 AC_SUBST(MOZ_MAINTENANCE_SERVICE)
michael@0 8455 AC_SUBST(MOZ_STUB_INSTALLER)
michael@0 8456 AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
michael@0 8457 AC_SUBST(MOZ_ENABLE_SIGNMAR)
michael@0 8458 AC_SUBST(MOZ_UPDATER)
michael@0 8459
michael@0 8460 AC_SUBST(MOZ_ANGLE_RENDERER)
michael@0 8461 AC_SUBST(MOZ_DIRECTX_SDK_CPU_SUFFIX)
michael@0 8462 AC_SUBST(MOZ_DIRECTX_SDK_PATH)
michael@0 8463 AC_SUBST(MOZ_D3DCOMPILER_DLL)
michael@0 8464 AC_SUBST(MOZ_HAS_WINSDK_WITH_D3D)
michael@0 8465 AC_SUBST(MOZ_D3DCOMPILER_DLL_PATH)
michael@0 8466 AC_SUBST(MOZ_D3DCOMPILER_CAB)
michael@0 8467
michael@0 8468 AC_SUBST(MOZ_METRO)
michael@0 8469
michael@0 8470 AC_SUBST(MOZ_ANDROID_HISTORY)
michael@0 8471 AC_SUBST(MOZ_WEBSMS_BACKEND)
michael@0 8472 AC_SUBST(MOZ_ANDROID_BEAM)
michael@0 8473 AC_SUBST(MOZ_ANDROID_SYNTHAPKS)
michael@0 8474 AC_SUBST(MOZ_DISABLE_GECKOVIEW)
michael@0 8475 AC_SUBST(ENABLE_STRIP)
michael@0 8476 AC_SUBST(PKG_SKIP_STRIP)
michael@0 8477 AC_SUBST(STRIP_FLAGS)
michael@0 8478 AC_SUBST(USE_ELF_HACK)
michael@0 8479 AC_SUBST(INCREMENTAL_LINKER)
michael@0 8480 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
michael@0 8481 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
michael@0 8482
michael@0 8483 AC_SUBST(MOZ_FIX_LINK_PATHS)
michael@0 8484 AC_SUBST(XPCOM_LIBS)
michael@0 8485 AC_SUBST(XPCOM_FROZEN_LDOPTS)
michael@0 8486 AC_SUBST(XPCOM_GLUE_LDOPTS)
michael@0 8487 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
michael@0 8488 AC_SUBST(XPCOM_STATICRUNTIME_GLUE_LDOPTS)
michael@0 8489 AC_SUBST(XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS)
michael@0 8490
michael@0 8491 AC_SUBST(USE_DEPENDENT_LIBS)
michael@0 8492
michael@0 8493 AC_SUBST(MOZ_BUILD_ROOT)
michael@0 8494
michael@0 8495 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
michael@0 8496 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
michael@0 8497 AC_SUBST(MOZ_LINKER_EXTRACT)
michael@0 8498
michael@0 8499 AC_SUBST(MOZ_JSDOWNLOADS)
michael@0 8500 if test -n "$MOZ_JSDOWNLOADS"; then
michael@0 8501 AC_DEFINE(MOZ_JSDOWNLOADS)
michael@0 8502 fi
michael@0 8503
michael@0 8504 dnl ========================================================
michael@0 8505 dnl = Mac bundle name prefix
michael@0 8506 dnl ========================================================
michael@0 8507 MOZ_ARG_WITH_STRING(macbundlename-prefix,
michael@0 8508 [ --with-macbundlename-prefix=prefix
michael@0 8509 Prefix for MOZ_MACBUNDLE_NAME],
michael@0 8510 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
michael@0 8511
michael@0 8512 MOZ_MACBUNDLE_NAME=`echo $MOZ_APP_DISPLAYNAME | tr -d ' '`
michael@0 8513 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
michael@0 8514 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
michael@0 8515 fi
michael@0 8516
michael@0 8517 if test "$MOZ_DEBUG"; then
michael@0 8518 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}Debug.app
michael@0 8519 else
michael@0 8520 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
michael@0 8521 fi
michael@0 8522 AC_SUBST(MOZ_MACBUNDLE_NAME)
michael@0 8523
michael@0 8524 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
michael@0 8525 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr '[A-Z]' '[a-z]'`
michael@0 8526 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
michael@0 8527 if test "$MOZ_DEBUG"; then
michael@0 8528 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
michael@0 8529 fi
michael@0 8530
michael@0 8531 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
michael@0 8532 AC_SUBST(MOZ_MACBUNDLE_ID)
michael@0 8533
michael@0 8534 dnl ========================================================
michael@0 8535 dnl = Child Process Name for IPC
michael@0 8536 dnl ========================================================
michael@0 8537 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
michael@0 8538 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
michael@0 8539 else
michael@0 8540 # We want to let Android unpack the file at install time, but it only does
michael@0 8541 # so if the file is named libsomething.so. The lib/ path is also required
michael@0 8542 # because the unpacked file will be under the lib/ subdirectory and will
michael@0 8543 # need to be executed from that path.
michael@0 8544 MOZ_CHILD_PROCESS_NAME="lib/libplugin-container.so"
michael@0 8545 fi
michael@0 8546 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
michael@0 8547
michael@0 8548 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
michael@0 8549 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
michael@0 8550
michael@0 8551 # The following variables are available to branding and application
michael@0 8552 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
michael@0 8553 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
michael@0 8554 # impacts profile location and user-visible fields.
michael@0 8555 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
michael@0 8556 # versions of a given application (e.g. Aurora and Firefox both use
michael@0 8557 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
michael@0 8558 # for application.ini's "Name" field, which controls profile location in
michael@0 8559 # the absence of a "Profile" field (see below), and various system
michael@0 8560 # integration hooks (Unix remoting, Windows MessageWindow name, etc.)
michael@0 8561 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
michael@0 8562 # Mac Bundle name, Updater, Installer), it is typically used for nightly
michael@0 8563 # builds (e.g. Aurora for Firefox).
michael@0 8564 # - MOZ_APP_VERSION: Defines the application version number.
michael@0 8565 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
michael@0 8566 # defaults to a lowercase form of MOZ_APP_BASENAME.
michael@0 8567 # - MOZ_APP_PROFILE: When set, used for application.ini's
michael@0 8568 # "Profile" field, which controls profile location.
michael@0 8569 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
michael@0 8570 # crash reporter server url.
michael@0 8571 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
michael@0 8572 # - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.
michael@0 8573
michael@0 8574 if test -z "$MOZ_APP_NAME"; then
michael@0 8575 MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
michael@0 8576 fi
michael@0 8577
michael@0 8578 # For extensions and langpacks, we require a max version that is compatible
michael@0 8579 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
michael@0 8580 # 24.0a1 and 24.0a2 aren't affected
michael@0 8581 # 24.0 becomes 24.*
michael@0 8582 # 24.1.1 becomes 24.*
michael@0 8583 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
michael@0 8584 if test -z "$IS_ALPHA"; then
michael@0 8585 changequote(,)
michael@0 8586 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
michael@0 8587 changequote([,])
michael@0 8588 else
michael@0 8589 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
michael@0 8590 fi
michael@0 8591
michael@0 8592 MOZ_B2G_VERSION=${MOZ_B2G_VERSION:-"1.0.0"}
michael@0 8593 AC_DEFINE_UNQUOTED(MOZ_B2G_VERSION,"$MOZ_B2G_VERSION")
michael@0 8594 AC_DEFINE_UNQUOTED(MOZ_B2G_OS_NAME,"$MOZ_B2G_OS_NAME")
michael@0 8595
michael@0 8596 AC_SUBST(MOZ_APP_NAME)
michael@0 8597 AC_SUBST(MOZ_APP_DISPLAYNAME)
michael@0 8598 AC_SUBST(MOZ_APP_BASENAME)
michael@0 8599 AC_SUBST(MOZ_APP_VENDOR)
michael@0 8600 AC_SUBST(MOZ_APP_PROFILE)
michael@0 8601 AC_SUBST(MOZ_APP_ID)
michael@0 8602 AC_SUBST(MAR_CHANNEL_ID)
michael@0 8603 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
michael@0 8604 AC_SUBST(MOZ_PROFILE_MIGRATOR)
michael@0 8605 AC_SUBST(MOZ_EXTENSION_MANAGER)
michael@0 8606 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
michael@0 8607 AC_SUBST(MOZ_APP_UA_NAME)
michael@0 8608 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
michael@0 8609 AC_SUBST(MOZ_APP_VERSION)
michael@0 8610 AC_SUBST(MOZ_APP_MAXVERSION)
michael@0 8611 AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION)
michael@0 8612 AC_SUBST(FIREFOX_VERSION)
michael@0 8613 AC_SUBST(MOZ_UA_OS_AGNOSTIC)
michael@0 8614 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
michael@0 8615 AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
michael@0 8616 fi
michael@0 8617
michael@0 8618 AC_SUBST(MOZ_APP_STATIC_INI)
michael@0 8619
michael@0 8620 AC_SUBST(MOZ_PKG_SPECIAL)
michael@0 8621
michael@0 8622 AC_SUBST(MOZILLA_OFFICIAL)
michael@0 8623
michael@0 8624 AC_DEFINE_UNQUOTED(MOZ_TELEMETRY_DISPLAY_REV, 2)
michael@0 8625 AC_SUBST(MOZ_TELEMETRY_DISPLAY_REV)
michael@0 8626
michael@0 8627 if test "$MOZ_TELEMETRY_REPORTING"; then
michael@0 8628 AC_DEFINE(MOZ_TELEMETRY_REPORTING)
michael@0 8629
michael@0 8630 # Enable Telemetry by default for nightly and aurora channels
michael@0 8631 if test -z "$RELEASE_BUILD"; then
michael@0 8632 AC_DEFINE(MOZ_TELEMETRY_ON_BY_DEFAULT)
michael@0 8633 fi
michael@0 8634 fi
michael@0 8635
michael@0 8636 dnl If we have any service that uploads data (and requires data submission
michael@0 8637 dnl policy alert), set MOZ_DATA_REPORTING.
michael@0 8638 dnl We need SUBST for build system and DEFINE for xul preprocessor.
michael@0 8639 if test -n "$MOZ_TELEMETRY_REPORTING" || test -n "$MOZ_SERVICES_HEALTHREPORT" || test -n "$MOZ_CRASHREPORTER"; then
michael@0 8640 MOZ_DATA_REPORTING=1
michael@0 8641 AC_DEFINE(MOZ_DATA_REPORTING)
michael@0 8642 AC_SUBST(MOZ_DATA_REPORTING)
michael@0 8643 fi
michael@0 8644
michael@0 8645 dnl win32 options
michael@0 8646 AC_SUBST(MOZ_BROWSE_INFO)
michael@0 8647 AC_SUBST(MOZ_TOOLS_DIR)
michael@0 8648 AC_SUBST(WIN32_REDIST_DIR)
michael@0 8649 AC_SUBST(MAKENSISU)
michael@0 8650
michael@0 8651 dnl Echo the CFLAGS to remove extra whitespace.
michael@0 8652 CFLAGS=`echo \
michael@0 8653 $_WARNINGS_CFLAGS \
michael@0 8654 $CFLAGS`
michael@0 8655
michael@0 8656 CXXFLAGS=`echo \
michael@0 8657 $_WARNINGS_CXXFLAGS \
michael@0 8658 $CXXFLAGS`
michael@0 8659
michael@0 8660 COMPILE_CFLAGS=`echo \
michael@0 8661 $_DEFINES_CFLAGS \
michael@0 8662 $_DEPEND_CFLAGS \
michael@0 8663 $COMPILE_CFLAGS`
michael@0 8664
michael@0 8665 COMPILE_CXXFLAGS=`echo \
michael@0 8666 $_DEFINES_CXXFLAGS \
michael@0 8667 $_DEPEND_CFLAGS \
michael@0 8668 $COMPILE_CXXFLAGS`
michael@0 8669
michael@0 8670 HOST_CFLAGS=`echo \
michael@0 8671 $HOST_CFLAGS \
michael@0 8672 $_DEPEND_CFLAGS`
michael@0 8673
michael@0 8674 HOST_CXXFLAGS=`echo \
michael@0 8675 $HOST_CXXFLAGS \
michael@0 8676 $_DEPEND_CFLAGS`
michael@0 8677
michael@0 8678 AC_SUBST(SYSTEM_LIBXUL)
michael@0 8679 AC_SUBST(MOZ_NATIVE_JPEG)
michael@0 8680 AC_SUBST(MOZ_NATIVE_PNG)
michael@0 8681 AC_SUBST(MOZ_NATIVE_BZ2)
michael@0 8682
michael@0 8683 AC_SUBST(MOZ_JPEG_CFLAGS)
michael@0 8684 AC_SUBST(MOZ_JPEG_LIBS)
michael@0 8685 AC_SUBST(MOZ_BZ2_CFLAGS)
michael@0 8686 AC_SUBST(MOZ_BZ2_LIBS)
michael@0 8687 AC_SUBST(MOZ_PNG_CFLAGS)
michael@0 8688 AC_SUBST(MOZ_PNG_LIBS)
michael@0 8689
michael@0 8690 if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then
michael@0 8691 export MOZ_NUWA_PROCESS
michael@0 8692 AC_DEFINE(MOZ_NUWA_PROCESS)
michael@0 8693 fi
michael@0 8694 AC_SUBST(MOZ_NUWA_PROCESS)
michael@0 8695
michael@0 8696 AC_SUBST(NSPR_CFLAGS)
michael@0 8697 AC_SUBST(NSPR_LIBS)
michael@0 8698 AC_SUBST(MOZ_NATIVE_NSPR)
michael@0 8699
michael@0 8700 AC_SUBST(NSS_CFLAGS)
michael@0 8701 AC_SUBST(NSS_LIBS)
michael@0 8702 AC_SUBST(MOZ_NATIVE_NSS)
michael@0 8703 AC_SUBST(NSS_DISABLE_DBM)
michael@0 8704
michael@0 8705 OS_CFLAGS="$CFLAGS"
michael@0 8706 OS_CXXFLAGS="$CXXFLAGS"
michael@0 8707 OS_CPPFLAGS="$CPPFLAGS"
michael@0 8708 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
michael@0 8709 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
michael@0 8710 OS_LDFLAGS="$LDFLAGS"
michael@0 8711 OS_LIBS="$LIBS"
michael@0 8712 AC_SUBST(OS_CFLAGS)
michael@0 8713 AC_SUBST(OS_CXXFLAGS)
michael@0 8714 AC_SUBST(OS_CPPFLAGS)
michael@0 8715 AC_SUBST(OS_COMPILE_CFLAGS)
michael@0 8716 AC_SUBST(OS_COMPILE_CXXFLAGS)
michael@0 8717 AC_SUBST(OS_LDFLAGS)
michael@0 8718 AC_SUBST(OS_LIBS)
michael@0 8719 AC_SUBST(CROSS_COMPILE)
michael@0 8720 AC_SUBST(WCHAR_CFLAGS)
michael@0 8721
michael@0 8722 AC_SUBST(HOST_CC)
michael@0 8723 AC_SUBST(HOST_CXX)
michael@0 8724 AC_SUBST(HOST_CFLAGS)
michael@0 8725 AC_SUBST(HOST_CXXFLAGS)
michael@0 8726 AC_SUBST(HOST_LDFLAGS)
michael@0 8727 AC_SUBST(HOST_OPTIMIZE_FLAGS)
michael@0 8728 AC_SUBST(HOST_AR)
michael@0 8729 AC_SUBST(HOST_AR_FLAGS)
michael@0 8730 AC_SUBST(HOST_LD)
michael@0 8731 AC_SUBST(HOST_RANLIB)
michael@0 8732 AC_SUBST(HOST_NSPR_MDCPUCFG)
michael@0 8733 AC_SUBST(HOST_BIN_SUFFIX)
michael@0 8734 AC_SUBST(HOST_OS_ARCH)
michael@0 8735
michael@0 8736 AC_SUBST(TARGET_CPU)
michael@0 8737 AC_SUBST(TARGET_VENDOR)
michael@0 8738 AC_SUBST(TARGET_OS)
michael@0 8739 AC_SUBST(TARGET_NSPR_MDCPUCFG)
michael@0 8740 AC_SUBST(TARGET_MD_ARCH)
michael@0 8741 AC_SUBST(TARGET_XPCOM_ABI)
michael@0 8742 AC_SUBST(OS_TARGET)
michael@0 8743 AC_SUBST(OS_ARCH)
michael@0 8744 AC_SUBST(OS_RELEASE)
michael@0 8745 AC_SUBST(OS_TEST)
michael@0 8746 AC_SUBST(CPU_ARCH)
michael@0 8747 AC_SUBST(INTEL_ARCHITECTURE)
michael@0 8748 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
michael@0 8749 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
michael@0 8750
michael@0 8751 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
michael@0 8752
michael@0 8753 AC_SUBST(WRAP_LDFLAGS)
michael@0 8754 AC_SUBST(MKSHLIB)
michael@0 8755 AC_SUBST(MKCSHLIB)
michael@0 8756 AC_SUBST(MKSHLIB_FORCE_ALL)
michael@0 8757 AC_SUBST(MKSHLIB_UNFORCE_ALL)
michael@0 8758 AC_SUBST(DSO_CFLAGS)
michael@0 8759 AC_SUBST(DSO_PIC_CFLAGS)
michael@0 8760 AC_SUBST(DSO_LDOPTS)
michael@0 8761 AC_SUBST(LIB_PREFIX)
michael@0 8762 AC_SUBST(DLL_PREFIX)
michael@0 8763 AC_SUBST(DLL_SUFFIX)
michael@0 8764 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
michael@0 8765 AC_SUBST(LIB_SUFFIX)
michael@0 8766 AC_SUBST(OBJ_SUFFIX)
michael@0 8767 AC_SUBST(BIN_SUFFIX)
michael@0 8768 AC_SUBST(ASM_SUFFIX)
michael@0 8769 AC_SUBST(IMPORT_LIB_SUFFIX)
michael@0 8770 AC_SUBST(USE_N32)
michael@0 8771 AC_SUBST(CC_VERSION)
michael@0 8772 AC_SUBST(CXX_VERSION)
michael@0 8773 AC_SUBST(MSMANIFEST_TOOL)
michael@0 8774 AC_SUBST(NS_ENABLE_TSF)
michael@0 8775 AC_SUBST(MOZ_NSS_PATCH)
michael@0 8776 AC_SUBST(MOZ_APP_COMPONENT_LIBS)
michael@0 8777 AC_SUBST(MOZ_APP_EXTRA_LIBS)
michael@0 8778
michael@0 8779 AC_SUBST(MOZ_WAVE)
michael@0 8780 AC_SUBST(MOZ_VORBIS)
michael@0 8781 AC_SUBST(MOZ_TREMOR)
michael@0 8782 AC_SUBST(MOZ_OPUS)
michael@0 8783 AC_SUBST(MOZ_WEBM)
michael@0 8784 AC_SUBST(MOZ_WMF)
michael@0 8785 AC_SUBST(MOZ_FFMPEG)
michael@0 8786 AC_SUBST(MOZ_FMP4)
michael@0 8787 AC_SUBST(MOZ_DIRECTSHOW)
michael@0 8788 AC_SUBST(MOZ_MEDIA_PLUGINS)
michael@0 8789 AC_SUBST(MOZ_APPLEMEDIA)
michael@0 8790 AC_SUBST(MOZ_OMX_PLUGIN)
michael@0 8791 AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
michael@0 8792 AC_SUBST(MOZ_VPX)
michael@0 8793 AC_SUBST(VPX_AS)
michael@0 8794 AC_SUBST(VPX_ASFLAGS)
michael@0 8795 AC_SUBST(VPX_DASH_C_FLAG)
michael@0 8796 AC_SUBST(VPX_AS_CONVERSION)
michael@0 8797 AC_SUBST(VPX_ASM_SUFFIX)
michael@0 8798 AC_SUBST(VPX_X86_ASM)
michael@0 8799 AC_SUBST(VPX_ARM_ASM)
michael@0 8800 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
michael@0 8801 AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
michael@0 8802 AC_SUBST(LIBJPEG_TURBO_AS)
michael@0 8803 AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
michael@0 8804 AC_SUBST(LIBJPEG_TURBO_X86_ASM)
michael@0 8805 AC_SUBST(LIBJPEG_TURBO_X64_ASM)
michael@0 8806 AC_SUBST(LIBJPEG_TURBO_ARM_ASM)
michael@0 8807
michael@0 8808 AC_SUBST(MOZ_PACKAGE_JSSHELL)
michael@0 8809 AC_SUBST(MOZ_FOLD_LIBS)
michael@0 8810
michael@0 8811 AC_SUBST(MOZ_ENABLE_SZIP)
michael@0 8812 AC_SUBST(MOZ_SZIP_FLAGS)
michael@0 8813
michael@0 8814 if test "$MOZ_DEBUG"; then
michael@0 8815 MOZ_EM_DEBUG=1
michael@0 8816 fi
michael@0 8817 AC_SUBST(MOZ_EM_DEBUG)
michael@0 8818
michael@0 8819 if test -n "$COMPILE_ENVIRONMENT"; then
michael@0 8820 AC_CHECK_FUNCS(posix_fadvise posix_fallocate)
michael@0 8821
michael@0 8822 dnl Check for missing components
michael@0 8823 if test "$MOZ_X11"; then
michael@0 8824 if test "$WITHOUT_X11"; then
michael@0 8825 AC_MSG_ERROR([--without-x specified and MOZ_X11 still defined])
michael@0 8826 fi
michael@0 8827 dnl ====================================================
michael@0 8828 dnl = Check if X headers exist
michael@0 8829 dnl ====================================================
michael@0 8830 _SAVE_CFLAGS=$CFLAGS
michael@0 8831 CFLAGS="$CFLAGS $XCFLAGS"
michael@0 8832 AC_TRY_COMPILE([
michael@0 8833 #include <stdio.h>
michael@0 8834 #include <stdlib.h>
michael@0 8835 #include <X11/Xlib.h>
michael@0 8836 #include <X11/Intrinsic.h>
michael@0 8837 #include <X11/extensions/XShm.h>
michael@0 8838 ],
michael@0 8839 [
michael@0 8840 Display *dpy = 0;
michael@0 8841 if ((dpy = XOpenDisplay(NULL)) == NULL) {
michael@0 8842 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
michael@0 8843 exit(1);
michael@0 8844 }
michael@0 8845 ], [],
michael@0 8846 [ AC_MSG_ERROR([Can't find X headers (install libxt-dev (Debian/Ubuntu), libXt-devel (Fedora), or xorg-x11-libXt-devel (SuSE)).]) ])
michael@0 8847 CFLAGS="$_SAVE_CFLAGS"
michael@0 8848
michael@0 8849 if test -n "$MISSING_X"; then
michael@0 8850 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
michael@0 8851 fi
michael@0 8852
michael@0 8853 fi # MOZ_X11
michael@0 8854
michael@0 8855 fi # COMPILE_ENVIRONMENT
michael@0 8856
michael@0 8857 dnl Set various defines and substitutions
michael@0 8858 dnl ========================================================
michael@0 8859
michael@0 8860 if test "$OS_ARCH" != "WINNT"; then
michael@0 8861 AC_DEFINE(XP_UNIX)
michael@0 8862 fi
michael@0 8863
michael@0 8864 if test "$MOZ_DEBUG"; then
michael@0 8865 AC_DEFINE(MOZ_REFLOW_PERF)
michael@0 8866 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
michael@0 8867 fi
michael@0 8868
michael@0 8869 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then
michael@0 8870 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
michael@0 8871 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
michael@0 8872 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
michael@0 8873 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
michael@0 8874 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
michael@0 8875 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
michael@0 8876 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
michael@0 8877 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
michael@0 8878 fi
michael@0 8879
michael@0 8880 if test "$MOZ_DEBUG"; then
michael@0 8881 A11Y_LOG=1
michael@0 8882 fi
michael@0 8883 case "$MOZ_UPDATE_CHANNEL" in
michael@0 8884 aurora|beta|release|esr)
michael@0 8885 ;;
michael@0 8886 *)
michael@0 8887 A11Y_LOG=1
michael@0 8888 ;;
michael@0 8889 esac
michael@0 8890 AC_SUBST(A11Y_LOG)
michael@0 8891 if test -n "$A11Y_LOG"; then
michael@0 8892 AC_DEFINE(A11Y_LOG)
michael@0 8893 fi
michael@0 8894
michael@0 8895 AC_SUBST(MOZILLA_VERSION)
michael@0 8896
michael@0 8897 AC_SUBST(ac_configure_args)
michael@0 8898
michael@0 8899 dnl Spit out some output
michael@0 8900 dnl ========================================================
michael@0 8901
michael@0 8902 dnl The following defines are used by xpcom
michael@0 8903 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
michael@0 8904 CPP_THROW_NEW
michael@0 8905 HAVE_CPP_AMBIGUITY_RESOLVING_USING
michael@0 8906 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
michael@0 8907 HAVE_CPP_PARTIAL_SPECIALIZATION
michael@0 8908 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
michael@0 8909 NEED_CPP_UNUSED_IMPLEMENTATIONS
michael@0 8910 HAVE_GETPAGESIZE
michael@0 8911 HAVE_ICONV
michael@0 8912 HAVE_ICONV_WITH_CONST_INPUT
michael@0 8913 HAVE_MBRTOWC
michael@0 8914 HAVE_WCRTOMB
michael@0 8915 HAVE_STATVFS64
michael@0 8916 HAVE_STATVFS
michael@0 8917 HAVE_STATFS64
michael@0 8918 HAVE_STATFS
michael@0 8919 HAVE_SYS_STATVFS_H
michael@0 8920 HAVE_SYS_STATFS_H
michael@0 8921 HAVE_SYS_VFS_H
michael@0 8922 HAVE_SYS_MOUNT_H
michael@0 8923 "
michael@0 8924
michael@0 8925 AC_SUBST(STLPORT_LIBS)
michael@0 8926
michael@0 8927 dnl ========================================================
michael@0 8928 dnl ICU Support
michael@0 8929 dnl ========================================================
michael@0 8930
michael@0 8931 if test "$MOZ_BUILD_APP" = "browser"; then
michael@0 8932 _INTL_API=yes
michael@0 8933 else
michael@0 8934 # Internationalization isn't built or exposed by default in non-desktop
michael@0 8935 # builds. Bugs to enable:
michael@0 8936 #
michael@0 8937 # Android: bug 864843
michael@0 8938 # B2G: bug 866301
michael@0 8939 _INTL_API=no
michael@0 8940 fi
michael@0 8941
michael@0 8942 MOZ_CONFIG_ICU()
michael@0 8943
michael@0 8944 if test -n "$MOZ_NATIVE_ICU"; then
michael@0 8945 MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
michael@0 8946 fi
michael@0 8947
michael@0 8948 if test -n "$JS_SHARED_LIBRARY"; then
michael@0 8949 MOZ_JS_LIBS="$MOZ_JS_SHARED_LIBS"
michael@0 8950 else
michael@0 8951 MOZ_JS_LIBS="$MOZ_JS_STATIC_LIBS"
michael@0 8952 AC_DEFINE(MOZ_STATIC_JS)
michael@0 8953 fi
michael@0 8954 AC_SUBST(JS_SHARED_LIBRARY)
michael@0 8955
michael@0 8956 MOZ_CREATE_CONFIG_STATUS()
michael@0 8957
michael@0 8958 # No need to run subconfigures when building with LIBXUL_SDK_DIR
michael@0 8959 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
michael@0 8960 MOZ_SUBCONFIGURE_ICU()
michael@0 8961 MOZ_SUBCONFIGURE_FFI()
michael@0 8962 fi
michael@0 8963
michael@0 8964 # Hack around an Apple bug that affects the egrep that comes with OS X 10.7.
michael@0 8965 # "env ARCHPREFERENCE=i386,x86_64 arch egrep" first tries to use the 32-bit
michael@0 8966 # Intel part of the egrep fat binary, even on 64-bit systems, and falls back on
michael@0 8967 # the 64-bit part if it's not a fat binary, as can happen with MacPorts. We
michael@0 8968 # (apparently) only need this hack when egrep's "pattern" is particularly long
michael@0 8969 # (as in the following code) and the first egrep on our $PATH is Apple's. See
michael@0 8970 # bug 655339.
michael@0 8971 case "$host" in
michael@0 8972 *-apple-darwin11*)
michael@0 8973 FIXED_EGREP="env ARCHPREFERENCE=i386,x86_64 arch egrep"
michael@0 8974 ;;
michael@0 8975 *)
michael@0 8976 FIXED_EGREP="egrep"
michael@0 8977 ;;
michael@0 8978 esac
michael@0 8979
michael@0 8980 # Run jemalloc configure script
michael@0 8981
michael@0 8982 if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_MEMORY" && test -n "$MOZ_JEMALLOC3" -o -n "$MOZ_REPLACE_MALLOC"; then
michael@0 8983 ac_configure_args="--build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_"
michael@0 8984 if test -n "$MOZ_REPLACE_MALLOC"; then
michael@0 8985 # When using replace_malloc, we always want memalign and valloc exported from jemalloc.
michael@0 8986 ac_configure_args="$ac_configure_args ac_cv_func_memalign=yes"
michael@0 8987 ac_configure_args="$ac_configure_args ac_cv_func_valloc=yes"
michael@0 8988 fi
michael@0 8989 if test -n "$MOZ_JEMALLOC3"; then
michael@0 8990 case "${OS_ARCH}" in
michael@0 8991 WINNT|Darwin)
michael@0 8992 # We want jemalloc functions to be kept hidden on both Mac and Windows
michael@0 8993 # See memory/build/mozmemory_wrap.h for details.
michael@0 8994 ac_configure_args="$ac_configure_args --without-export"
michael@0 8995 ;;
michael@0 8996 esac
michael@0 8997 elif test "${OS_ARCH}" = Darwin; then
michael@0 8998 # When building as a replace-malloc lib, disabling the zone allocator
michael@0 8999 # forces to use pthread_atfork.
michael@0 9000 ac_configure_args="$ac_configure_args --disable-zone-allocator"
michael@0 9001 fi
michael@0 9002 _MANGLE="malloc posix_memalign aligned_alloc calloc realloc free memalign valloc malloc_usable_size"
michael@0 9003 JEMALLOC_WRAPPER=
michael@0 9004 if test -z "$MOZ_REPLACE_MALLOC"; then
michael@0 9005 case "$OS_ARCH" in
michael@0 9006 Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
michael@0 9007 MANGLE=$_MANGLE
michael@0 9008 ;;
michael@0 9009 esac
michael@0 9010 elif test -z "$MOZ_JEMALLOC3"; then
michael@0 9011 MANGLE=$_MANGLE
michael@0 9012 JEMALLOC_WRAPPER=replace_
michael@0 9013 fi
michael@0 9014 if test -n "$MANGLE"; then
michael@0 9015 MANGLED=
michael@0 9016 if test -n "$_WRAP_MALLOC" -a -z "$JEMALLOC_WRAPPER"; then
michael@0 9017 JEMALLOC_WRAPPER=__wrap_
michael@0 9018 fi
michael@0 9019 for mangle in ${MANGLE}; do
michael@0 9020 if test -n "$MANGLED"; then
michael@0 9021 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED"
michael@0 9022 else
michael@0 9023 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle"
michael@0 9024 fi
michael@0 9025 done
michael@0 9026 ac_configure_args="$ac_configure_args --with-mangling=$MANGLED"
michael@0 9027 fi
michael@0 9028 unset CONFIG_FILES
michael@0 9029 if test -z "$MOZ_TLS"; then
michael@0 9030 ac_configure_args="$ac_configure_args --disable-tls"
michael@0 9031 fi
michael@0 9032 EXTRA_CFLAGS="$CFLAGS"
michael@0 9033 for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
michael@0 9034 ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
michael@0 9035 done
michael@0 9036 if test "$CROSS_COMPILE"; then
michael@0 9037 ac_configure_args="$ac_configure_args je_cv_static_page_shift=12"
michael@0 9038 fi
michael@0 9039 _save_cache_file="$cache_file"
michael@0 9040 cache_file=$_objdir/memory/jemalloc/src/config.cache
michael@0 9041
michael@0 9042 if ! test -e memory/jemalloc; then
michael@0 9043 mkdir -p memory/jemalloc
michael@0 9044 fi
michael@0 9045
michael@0 9046 AC_OUTPUT_SUBDIRS(memory/jemalloc/src)
michael@0 9047 cache_file="$_save_cache_file"
michael@0 9048 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
michael@0 9049 fi
michael@0 9050
michael@0 9051 # Run freetype configure script
michael@0 9052
michael@0 9053 if test "$MOZ_TREE_FREETYPE"; then
michael@0 9054 export CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS -std=c99"
michael@0 9055 export CPPFLAGS="$CPPFLAGS $MOZ_DEBUG_FLAGS"
michael@0 9056 export CXXFLAGS="$CXXFLAGS $MOZ_DEBUG_FLAGS"
michael@0 9057 export LDFLAGS="$LDFLAGS $MOZ_DEBUG_LDFLAGS"
michael@0 9058 # Spaces in the *_CFLAGS and *_LIBS variables are intentionally placed
michael@0 9059 # to force freetype to use our settings rather than autodetecting
michael@0 9060 export LIBPNG_CFLAGS="$MOZ_PNG_CFLAGS "
michael@0 9061 export LIBPNG_LIBS="$MOZ_PNG_LIBS "
michael@0 9062 export ZLIB_CFLAGS="$MOZ_ZLIB_CFLAGS "
michael@0 9063 export ZLIB_LIBS="$MOZ_ZLIB_LIBS "
michael@0 9064 export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
michael@0 9065 ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes --with-zlib=yes --without-bzip2 --with-png=yes --without-harfbuzz"
michael@0 9066
michael@0 9067 if ! test -e modules; then
michael@0 9068 mkdir modules
michael@0 9069 fi
michael@0 9070 # Only export CC, CXX and RANLIB for the subconfigure, and avoid spilling
michael@0 9071 # that further down the road.
michael@0 9072 (export CC CXX RANLIB;
michael@0 9073 AC_OUTPUT_SUBDIRS(modules/freetype2)
michael@0 9074 ) || exit 1
michael@0 9075 fi
michael@0 9076
michael@0 9077 if test -z "$direct_nspr_config"; then
michael@0 9078 dnl ========================================================
michael@0 9079 dnl = Setup a nice relatively clean build environment for
michael@0 9080 dnl = sub-configures.
michael@0 9081 dnl ========================================================
michael@0 9082 CC="$_SUBDIR_CC"
michael@0 9083 CXX="$_SUBDIR_CXX"
michael@0 9084 CFLAGS="$_SUBDIR_CFLAGS"
michael@0 9085 CPPFLAGS="$_SUBDIR_CPPFLAGS"
michael@0 9086 CXXFLAGS="$_SUBDIR_CXXFLAGS"
michael@0 9087 LDFLAGS="$_SUBDIR_LDFLAGS"
michael@0 9088 HOST_CC="$_SUBDIR_HOST_CC"
michael@0 9089 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
michael@0 9090 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
michael@0 9091 RC=
michael@0 9092 fi
michael@0 9093
michael@0 9094 unset MAKEFILES
michael@0 9095 unset CONFIG_FILES
michael@0 9096
michael@0 9097 # Run all configure scripts specified by a subconfigure
michael@0 9098 if test -n "$_subconfigure_subdir"; then
michael@0 9099 _save_ac_configure_args="$ac_configure_args"
michael@0 9100 ac_configure_args="$_subconfigure_config_args"
michael@0 9101 AC_OUTPUT_SUBDIRS("$_subconfigure_subdir")
michael@0 9102 ac_configure_args="$_save_ac_configure_args"
michael@0 9103 fi
michael@0 9104
michael@0 9105 # No need to run subconfigures when building with LIBXUL_SDK_DIR
michael@0 9106 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
michael@0 9107
michael@0 9108 export WRAP_LDFLAGS
michael@0 9109
michael@0 9110 if test -n "$_WRAP_MALLOC"; then
michael@0 9111 # Avoid doubling wrap malloc arguments
michael@0 9112 _SUBDIR_CONFIG_ARGS="`echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'`"
michael@0 9113 fi
michael@0 9114
michael@0 9115 if test -z "$MOZ_NATIVE_NSPR"; then
michael@0 9116 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
michael@0 9117 if test -z "$MOZ_DEBUG"; then
michael@0 9118 ac_configure_args="$ac_configure_args --disable-debug"
michael@0 9119 else
michael@0 9120 ac_configure_args="$ac_configure_args --enable-debug"
michael@0 9121 fi
michael@0 9122 if test "$MOZ_OPTIMIZE" = "1"; then
michael@0 9123 ac_configure_args="$ac_configure_args --enable-optimize"
michael@0 9124 elif test -z "$MOZ_OPTIMIZE"; then
michael@0 9125 ac_configure_args="$ac_configure_args --disable-optimize"
michael@0 9126 fi
michael@0 9127 if test -n "$HAVE_64BIT_OS"; then
michael@0 9128 ac_configure_args="$ac_configure_args --enable-64bit"
michael@0 9129 fi
michael@0 9130 if test -n "$USE_ARM_KUSER"; then
michael@0 9131 ac_configure_args="$ac_configure_args --with-arm-kuser"
michael@0 9132 fi
michael@0 9133 # A configure script generated by autoconf 2.68 does not allow the cached
michael@0 9134 # values of "precious" variables such as CFLAGS and LDFLAGS to differ from
michael@0 9135 # the values passed to the configure script. Since we modify CFLAGS and
michael@0 9136 # LDFLAGS before passing them to NSPR's configure script, we cannot share
michael@0 9137 # config.cache with NSPR. As a result, we cannot pass AS, CC, CXX, etc. to
michael@0 9138 # NSPR via a shared config.cache file and must pass them to NSPR on the
michael@0 9139 # configure command line.
michael@0 9140 for var in AS CC CXX CPP LD AR RANLIB STRIP; do
michael@0 9141 ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
michael@0 9142 done
michael@0 9143 # A configure script generated by autoconf 2.68 warns if --host is
michael@0 9144 # specified but --build isn't. So we always pass --build to NSPR's
michael@0 9145 # configure script.
michael@0 9146 ac_configure_args="$ac_configure_args --build=$build"
michael@0 9147 ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_ARGS"
michael@0 9148
michael@0 9149 # Save these, so we can mess with them for the subconfigure ..
michael@0 9150 _SAVE_CFLAGS="$CFLAGS"
michael@0 9151 _SAVE_CPPFLAGS="$CPPFLAGS"
michael@0 9152 _SAVE_LDFLAGS="$LDFLAGS"
michael@0 9153
michael@0 9154 if test -n "$MOZ_LINKER" -a "$ac_cv_func_dladdr" = no ; then
michael@0 9155 # dladdr is supported by the new linker, even when the system linker doesn't
michael@0 9156 # support it. Trick nspr into using dladdr when it's not supported.
michael@0 9157 export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
michael@0 9158 fi
michael@0 9159 export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS"
michael@0 9160 export CFLAGS="$CFLAGS $MOZ_FRAMEPTR_FLAGS"
michael@0 9161
michael@0 9162 # Use a separate cache file for NSPR since it uses autoconf 2.68.
michael@0 9163 _save_cache_file="$cache_file"
michael@0 9164 cache_file=$_objdir/nsprpub/config.cache
michael@0 9165
michael@0 9166 AC_OUTPUT_SUBDIRS(nsprpub)
michael@0 9167
michael@0 9168 # .. and restore them
michael@0 9169 cache_file="$_save_cache_file"
michael@0 9170 CFLAGS="$_SAVE_CFLAGS"
michael@0 9171 CPPFLAGS="$_SAVE_CPPFLAGS"
michael@0 9172 LDFLAGS="$_SAVE_LDFLAGS"
michael@0 9173
michael@0 9174 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
michael@0 9175 fi
michael@0 9176
michael@0 9177 dnl ========================================================
michael@0 9178 dnl = Setup a nice relatively clean build environment for
michael@0 9179 dnl = sub-configures.
michael@0 9180 dnl ========================================================
michael@0 9181 CC="$_SUBDIR_CC"
michael@0 9182 CXX="$_SUBDIR_CXX"
michael@0 9183 CFLAGS="$_SUBDIR_CFLAGS"
michael@0 9184 CPPFLAGS="$_SUBDIR_CPPFLAGS"
michael@0 9185 CXXFLAGS="$_SUBDIR_CXXFLAGS"
michael@0 9186 LDFLAGS="$_SUBDIR_LDFLAGS"
michael@0 9187 HOST_CC="$_SUBDIR_HOST_CC"
michael@0 9188 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
michael@0 9189 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
michael@0 9190 RC=
michael@0 9191
michael@0 9192 if test -n "$ENABLE_CLANG_PLUGIN"; then
michael@0 9193 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
michael@0 9194 AC_OUTPUT_SUBDIRS(build/clang-plugin)
michael@0 9195 fi
michael@0 9196
michael@0 9197
michael@0 9198 # Run the SpiderMonkey 'configure' script.
michael@0 9199 dist=$MOZ_BUILD_ROOT/dist
michael@0 9200 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
michael@0 9201 ac_configure_args="$ac_configure_args --enable-threadsafe"
michael@0 9202
michael@0 9203 if test "$_INTL_API" = no; then
michael@0 9204 ac_configure_args="$ac_configure_args --without-intl-api"
michael@0 9205 fi
michael@0 9206
michael@0 9207 if test "$BUILD_CTYPES"; then
michael@0 9208 # Build js-ctypes on the platforms we can.
michael@0 9209 ac_configure_args="$ac_configure_args --enable-ctypes"
michael@0 9210 fi
michael@0 9211 if test -z "$JS_SHARED_LIBRARY" ; then
michael@0 9212 ac_configure_args="$ac_configure_args --disable-shared-js"
michael@0 9213 if test -n "$MOZ_DISABLE_EXPORT_JS"; then
michael@0 9214 ac_configure_args="$ac_configure_args --disable-export-js"
michael@0 9215 fi
michael@0 9216 fi
michael@0 9217 if test -z "$MOZ_NATIVE_NSPR"; then
michael@0 9218 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
michael@0 9219 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
michael@0 9220 fi
michael@0 9221 ac_configure_args="$ac_configure_args --prefix=$dist"
michael@0 9222 if test "$MOZ_MEMORY"; then
michael@0 9223 ac_configure_args="$ac_configure_args --enable-jemalloc"
michael@0 9224 fi
michael@0 9225 if test -n "$MOZ_GLUE_LDFLAGS"; then
michael@0 9226 export MOZ_GLUE_LDFLAGS
michael@0 9227 fi
michael@0 9228 if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then
michael@0 9229 export MOZ_GLUE_PROGRAM_LDFLAGS
michael@0 9230 fi
michael@0 9231 if test -n "$ZLIB_IN_MOZGLUE"; then
michael@0 9232 MOZ_ZLIB_LIBS=
michael@0 9233 fi
michael@0 9234 export MOZ_NATIVE_ZLIB
michael@0 9235 export MOZ_ZLIB_CFLAGS
michael@0 9236 export MOZ_ZLIB_LIBS
michael@0 9237 export MOZ_APP_NAME
michael@0 9238 export DONT_POPULATE_VIRTUALENV=1
michael@0 9239 export PYTHON
michael@0 9240 export MOZILLA_CENTRAL_PATH=$_topsrcdir
michael@0 9241 export STLPORT_CPPFLAGS
michael@0 9242 export STLPORT_LDFLAGS
michael@0 9243 export STLPORT_LIBS
michael@0 9244 export JS_STANDALONE=no
michael@0 9245 export MOZ_LINKER
michael@0 9246 export ZLIB_IN_MOZGLUE
michael@0 9247
michael@0 9248 if ! test -e js; then
michael@0 9249 mkdir js
michael@0 9250 fi
michael@0 9251
michael@0 9252 AC_OUTPUT_SUBDIRS(js/src)
michael@0 9253 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
michael@0 9254
michael@0 9255 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
michael@0 9256
michael@0 9257 export WRITE_MOZINFO=1
michael@0 9258 dnl we need to run config.status after js/src subconfigure because we're
michael@0 9259 dnl traversing its moz.build and we need its config.status for that.
michael@0 9260 dnl However, writing our own config.status needs to happen before
michael@0 9261 dnl subconfigures because the setup surrounding subconfigures alters
michael@0 9262 dnl many AC_SUBSTed variables.
michael@0 9263 MOZ_RUN_CONFIG_STATUS()
michael@0 9264 unset WRITE_MOZINFO

mercurial