1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2 dnl vi: set tabstop=4 shiftwidth=4 expandtab:
3 dnl ***** BEGIN LICENSE BLOCK *****
4 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 dnl The contents of this file are subject to the Mozilla Public License Version
7 dnl 1.1 (the "License"); you may not use this file except in compliance with
8 dnl the License. You may obtain a copy of the License at
9 dnl http://www.mozilla.org/MPL/
11 dnl Software distributed under the License is distributed on an "AS IS" basis,
12 dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 dnl for the specific language governing rights and limitations under the
16 dnl The Original Code is this file as it was released upon August 6, 1998.
18 dnl The Initial Developer of the Original Code is
19 dnl Christopher Seawood.
20 dnl Portions created by the Initial Developer are Copyright (C) 1998-2001
21 dnl the Initial Developer. All Rights Reserved.
24 dnl Jamie Zawinski <jwz@jwz.org>
25 dnl gettimeofday args check
26 dnl Christopher Blizzard <blizzard@appliedtheory.com>
27 dnl gnomefe update & enable-pthreads
28 dnl Ramiro Estrugo <ramiro@netscape.com>
29 dnl X11 makedepend support
31 dnl Henry Sobotka <sobotka@axess.com>
33 dnl Dan Mosedale <dmose@mozilla.org>
35 dnl Seth Spitzer <sspitzer@netscape.com>
37 dnl Benjamin Smedberg <benjamin@smedbergs.us>
38 dnl Howard Chu <hyc@symas.com>
40 dnl Mark Mentovai <mark@moxienet.com>:
41 dnl Mac OS X 10.4 support
42 dnl Giorgio Maone <g.maone@informaction.com>
43 dnl MSVC l10n compatible version check
44 dnl Ben Turner <mozilla@songbirdnest.com>
46 dnl Alternatively, the contents of this file may be used under the terms of
47 dnl either the GNU General Public License Version 2 or later (the "GPL"), or
48 dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
49 dnl in which case the provisions of the GPL or the LGPL are applicable instead
50 dnl of those above. If you wish to allow use of your version of this file only
51 dnl under the terms of either the GPL or the LGPL, and not to allow others to
52 dnl use your version of this file under the terms of the MPL, indicate your
53 dnl decision by deleting the provisions above and replace them with the notice
54 dnl and other provisions required by the GPL or the LGPL. If you do not delete
55 dnl the provisions above, a recipient may use your version of this file under
56 dnl the terms of any one of the MPL, the GPL or the LGPL.
58 dnl ***** END LICENSE BLOCK *****
60 dnl Process this file with autoconf to produce a configure script.
61 dnl ========================================================
64 AC_INIT(config/config.mk)
65 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
67 TARGET_CPU="${target_cpu}"
68 TARGET_VENDOR="${target_vendor}"
69 TARGET_OS="${target_os}"
72 MOZ_DEB_TIMESTAMP=`date +"%a, %d %b %Y %T %z" 2>&1`
73 AC_SUBST(MOZ_DEB_TIMESTAMP)
76 dnl ========================================================
78 dnl = Don't change the following two lines. Doing so breaks:
80 dnl = CFLAGS="-foo" ./configure
82 dnl ========================================================
84 CPPFLAGS="${CPPFLAGS=}"
85 CXXFLAGS="${CXXFLAGS=}"
87 HOST_CFLAGS="${HOST_CFLAGS=}"
88 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
89 HOST_LDFLAGS="${HOST_LDFLAGS=}"
91 dnl ========================================================
92 dnl = Preserve certain environment flags passed to configure
93 dnl = We want sub projects to receive the same flags
94 dnl = untainted by this configure script
95 dnl ========================================================
98 _SUBDIR_CFLAGS="$CFLAGS"
99 _SUBDIR_CPPFLAGS="$CPPFLAGS"
100 _SUBDIR_CXXFLAGS="$CXXFLAGS"
101 _SUBDIR_LDFLAGS="$LDFLAGS"
102 _SUBDIR_HOST_CC="$HOST_CC"
103 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
104 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
105 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
106 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
108 dnl Set the version number of the libs included with mozilla
109 dnl ========================================================
116 dnl Set the minimum version of toolkit libs used by mozilla
117 dnl ========================================================
125 WINDRES_VERSION=2.14.90
128 GNOMEUI_VERSION=2.2.0
131 STARTUP_NOTIFICATION_VERSION=0.8
133 SQLITE_VERSION=3.6.14.2
134 LIBNOTIFY_VERSION=0.4
138 dnl Set various checks
139 dnl ========================================================
143 dnl Initialize the Pthread test variables early so they can be
144 dnl overridden by each platform.
145 dnl ========================================================
149 dnl Do not allow a separate objdir build if a srcdir build exists.
150 dnl ==============================================================
151 _topsrcdir=`cd \`dirname $0\`; pwd`
154 if test "$_topsrcdir" != "$_objdir"
156 # Check for a couple representative files in the source tree
158 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
159 if test -f $file; then
160 _conflict_files="$_conflict_files $file"
163 if test "$_conflict_files"; then
165 echo "* Your source tree contains these files:"
166 for file in $_conflict_files; do
170 * This indicates that you previously built in the source tree.
171 * A source tree build can confuse the separate objdir build.
173 * To clean up the source tree:
184 dnl Default to MSVC for win32
185 dnl ==============================================================
186 if test -z "$CROSS_COMPILE"; then
188 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
189 if test -z "$CC"; then CC=cl; fi
190 if test -z "$CXX"; then CXX=cl; fi
191 if test -z "$CPP"; then CPP="cl -E -nologo"; fi
192 if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
193 if test -z "$LD"; then LD=link; fi
194 if test -z "$AS"; then AS=ml; fi
195 if test -z "$MIDL"; then MIDL=midl; fi
200 COMPILE_ENVIRONMENT=1
201 MOZ_ARG_ENABLE_BOOL(compile-environment,
202 [ --disable-compile-environment
203 Disable compiler/library checks.],
204 COMPILE_ENVIRONMENT=1,
205 COMPILE_ENVIRONMENT= )
206 AC_SUBST(COMPILE_ENVIRONMENT)
208 MOZ_ARG_WITH_STRING(l10n-base,
209 [ --with-l10n-base=DIR path to l10n repositories],
210 L10NBASEDIR=$withval)
211 if test ! -z "$L10NBASEDIR"; then
212 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
213 AC_MSG_ERROR([--with-l10n-base must specify a path])
214 elif test -d "$L10NBASEDIR"; then
215 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
217 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
220 AC_SUBST(L10NBASEDIR)
222 dnl Check for Perl first -- needed for win32 SDK checks
223 MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
224 if test -z "$PERL" || test "$PERL" = ":"; then
225 AC_MSG_ERROR([perl not found in \$PATH])
228 dnl ========================================================
229 dnl Checks for compilers.
230 dnl ========================================================
231 dnl Set CROSS_COMPILE in the environment when running configure
232 dnl to use the cross-compile setup for now
233 dnl ========================================================
235 if test "$COMPILE_ENVIRONMENT"; then
237 dnl Do some special WinCE toolchain stuff
241 MOZ_ARG_WITH_STRING(wince-sdk,
242 [ --with-wince-sdk=WINCE_SDK_DIR
243 The path to the Windows CE SDK],
244 WINCE_SDK_DIR=$withval)
246 MOZ_ARG_WITH_STRING(ogles-sdk,
247 [ --with-ogles-sdk=OGLES_SDK_DIR
248 The path to the OGLES SDK],
249 OGLES_SDK_DIR=$withval)
251 dnl Default to Windows Mobile components enabled
252 WINCE_WINDOWS_MOBILE=1
254 MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
255 [ --disable-windows-mobile-components
256 Disable Windows Mobile specific components from CE build],
257 WINCE_WINDOWS_MOBILE=,
258 WINCE_WINDOWS_MOBILE=1)
260 if test "$WINCE_WINDOWS_MOBILE"; then
261 AC_DEFINE(WINCE_WINDOWS_MOBILE)
268 echo -----------------------------------------------------------------------------
269 echo Building Windows CE Shunt Library and Tool Chain
277 make OGLES_SDK_DIR="$OGLES_SDK_DIR" WINCE_SDK_DIR="$WINCE_SDK_DIR" TOPSRCDIR="$_topsrcdir" OBJDIR="$_pwdw" -C $srcdir/build/wince/tools
279 CC="$_pwd/dist/sdk/bin/arm-wince-gcc"
280 CXX="$_pwd/dist/sdk/bin/arm-wince-gcc"
281 CPP="$_pwd/dist/sdk/bin/arm-wince-gcc -E -nologo"
282 CXXCPP="$_pwd/dist/sdk/bin/arm-wince-gcc -TP -E -nologo"
283 LD="$_pwd/dist/sdk/bin/arm-wince-link"
284 AR="$_pwd/dist/sdk/bin/arm-wince-lib"
285 AS="$_pwd/dist/sdk/bin/arm-wince-as"
286 RC="$_pwd/dist/sdk/bin/arm-wince-res"
289 echo -----------------------------------------------------------------------------
294 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
295 echo "cross compiling from $host to $target"
299 _SAVE_CFLAGS="$CFLAGS"
300 _SAVE_LDFLAGS="$LDFLAGS"
302 AC_MSG_CHECKING([for host c compiler])
303 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
304 if test -z "$HOST_CC"; then
305 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
307 AC_MSG_RESULT([$HOST_CC])
308 AC_MSG_CHECKING([for host c++ compiler])
309 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
310 if test -z "$HOST_CXX"; then
311 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
313 AC_MSG_RESULT([$HOST_CXX])
315 if test -z "$HOST_CFLAGS"; then
316 HOST_CFLAGS="$CFLAGS"
318 if test -z "$HOST_CXXFLAGS"; then
319 HOST_CXXFLAGS="$CXXFLAGS"
321 if test -z "$HOST_LDFLAGS"; then
322 HOST_LDFLAGS="$LDFLAGS"
324 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
325 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
327 CFLAGS="$HOST_CFLAGS"
328 LDFLAGS="$HOST_LDFLAGS"
330 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
331 AC_TRY_COMPILE([], [return(0);],
332 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
333 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
336 CFLAGS="$HOST_CXXFLAGS"
338 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
339 AC_TRY_COMPILE([], [return(0);],
340 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
341 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
345 LDFLAGS=$_SAVE_LDFLAGS
347 case "$build:$target" in
348 powerpc-apple-darwin8*:i?86-apple-darwin*)
349 dnl The Darwin cross compiler doesn't necessarily point itself at a
350 dnl root that has libraries for the proper architecture, it defaults
351 dnl to the system root. The libraries in the system root on current
352 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
353 dnl checks will fail. Fake a working SDK in that case.
355 _SAVE_CXXFLAGS=$CXXLAGS
356 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
357 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
361 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
364 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
368 case "$build:$target" in
369 powerpc-apple-darwin8*:i?86-apple-darwin*)
370 dnl Revert the changes made above. From this point on, the target
371 dnl compiler will never be used without applying the SDK to CFLAGS
372 dnl (see --with-macos-sdk below).
374 CXXFLAGS=$_SAVE_CXXFLAGS
378 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
379 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
380 MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
381 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
382 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
383 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
384 AC_DEFINE(CROSS_COMPILE)
389 MOZ_PATH_PROGS(AS, $AS as, $CC)
390 AC_CHECK_PROGS(AR, ar, :)
391 AC_CHECK_PROGS(LD, ld, :)
392 AC_CHECK_PROGS(STRIP, strip, :)
393 AC_CHECK_PROGS(WINDRES, windres, :)
394 if test -z "$HOST_CC"; then
397 if test -z "$HOST_CFLAGS"; then
398 HOST_CFLAGS="$CFLAGS"
400 if test -z "$HOST_CXX"; then
403 if test -z "$HOST_CXXFLAGS"; then
404 HOST_CXXFLAGS="$CXXFLAGS"
406 if test -z "$HOST_LDFLAGS"; then
407 HOST_LDFLAGS="$LDFLAGS"
409 if test -z "$HOST_RANLIB"; then
410 HOST_RANLIB="$RANLIB"
412 if test -z "$HOST_AR"; then
423 if test "$GCC" = "yes"; then
425 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
427 if test "$GXX" = "yes"; then
429 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
431 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
434 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
437 if test "$GNU_CC"; then
438 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
445 if test "$GCC" = yes; then
446 if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
451 if test "$GXX" = yes; then
452 if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
457 dnl Special win32 checks
458 dnl ========================================================
464 if test -n "$GNU_CC"; then
472 dnl Target the Windows Vista SDK by default
475 MOZ_ARG_WITH_STRING(windows-version,
476 [ --with-windows-version=WINSDK_TARGETVER
477 Highest Windows version to target using this SDK
478 502: Windows Server 2003
481 WINSDK_TARGETVER=$withval)
483 case "$WINSDK_TARGETVER" in
485 MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
489 AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
494 dnl Vista SDK specific api (deprecated)
495 MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
496 [ --disable-vista-sdk-requirements
497 Do not build Vista SDK specific code],
498 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
499 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
500 if test -n "$COMPILE_ENVIRONMENT"; then
501 if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
502 AC_MSG_WARN([--disable-vista-sdk-requirements is deprecated, use --with-windows-version=502 instead])
503 MOZ_WINSDK_TARGETVER=05020000
506 if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
507 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1
508 AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
509 # We can't build parental controls either
510 MOZ_DISABLE_PARENTAL_CONTROLS=1
514 AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
517 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
518 if test "$GCC" != "yes"; then
519 # Check to see if we are really running in a msvc environemnt
521 AC_CHECK_PROGS(MIDL, midl)
523 # Make sure compilers are valid
524 CFLAGS="$CFLAGS -TC -nologo"
525 CXXFLAGS="$CXXFLAGS -TP -nologo"
528 AC_TRY_COMPILE([#include <stdio.h>],
529 [ printf("Hello World\n"); ],,
530 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
533 AC_TRY_COMPILE([#include <new.h>],
534 [ unsigned *test = new unsigned(42); ],,
535 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
539 _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
542 # Determine compiler version
543 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
544 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
545 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
546 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
547 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
548 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
550 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
551 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
553 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
554 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
556 if test "$_CC_MAJOR_VERSION" = "12"; then
558 elif test "$_CC_MAJOR_VERSION" = "13"; then
560 elif test "$_CC_MAJOR_VERSION" = "14"; then
562 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
563 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
564 dnl so be very specific here!
565 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
566 if test $_CC_RELEASE -gt 50727; then
568 elif test $_CC_BUILD -ge 762; then
571 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
572 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
573 elif test "$_CC_MAJOR_VERSION" = "15"; then
575 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
576 LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
578 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
579 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
581 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
584 _MOZ_RTTI_FLAGS_ON='-GR'
585 _MOZ_RTTI_FLAGS_OFF='-GR-'
586 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
587 _MOZ_EXCEPTIONS_FLAGS_OFF=''
589 if test -n "$WIN32_REDIST_DIR"; then
590 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
594 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
595 if test "$_CC_SUITE" -ge "8"; then
597 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
600 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
601 if test -n "$MSMT_TOOL"; then
602 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
603 if test -z "$MSMANIFEST_TOOL_VERSION"; then
604 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
609 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
613 # Check linker version
614 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
615 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
616 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
617 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
622 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
623 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
624 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
625 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
626 # Add flags if necessary
627 AC_MSG_CHECKING([for midl flags])
630 if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
631 # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
632 # MIDL version 7.00.0500 or later has no problem.
633 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
634 AC_MSG_RESULT([need -env win32])
636 AC_MSG_RESULT([none needed])
640 AC_MSG_RESULT([none needed])
644 # Identify which version of the SDK we're building with
645 # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
647 AC_CHECK_HEADERS([winsdkver.h])
648 if test "$ac_cv_header_winsdkver_h" = "yes"; then
649 # Get the highest _WIN32_WINNT and NTDDI versions supported
650 # Take the higher of the two
651 # This is done because the Windows 7 beta SDK reports its
652 # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
653 AC_CACHE_CHECK(for highest Windows version supported by this SDK,
655 [cat > conftest.h <<EOF
656 #include <winsdkver.h>
657 #include <sdkddkver.h>
659 #if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
660 #define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
662 #define WINSDK_MAXVER NTDDI_MAXVER
667 ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
670 MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
672 # The Vista SDK is the only one to have sdkddkver.h but not
674 AC_CHECK_HEADERS([sdkddkver.h])
675 if test "$ac_cv_header_sdkddkver_h" = "yes"; then
676 MOZ_WINSDK_MAXVER=0x06000000
678 # Assume the Server 2003 Platform SDK
679 MOZ_WINSDK_MAXVER=0x05020000
683 unset _MSVC_VER_FILTER
686 # Check w32api version
687 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
688 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
689 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
690 AC_TRY_COMPILE([#include <w32api.h>],
691 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
692 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
693 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
694 #error "test failed."
696 , [ res=yes ], [ res=no ])
697 AC_MSG_RESULT([$res])
698 if test "$res" != "yes"; then
699 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
701 # Check windres version
702 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
703 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
704 AC_MSG_RESULT([$_WINDRES_VERSION])
705 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
706 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
707 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
708 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
709 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
710 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
711 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
712 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
713 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
714 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
715 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
716 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
718 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
721 # Server 2003 is the highest version supported
722 MOZ_WINSDK_MAXVER=0x05020000
725 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
726 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
727 # Require OS features provided by IE 5.0
728 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
730 # If the maximum version supported by this SDK is lower than the target
732 AC_MSG_CHECKING([for Windows SDK being recent enough])
733 if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
737 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. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
740 AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
741 # Definitions matching sdkddkver.h
742 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
743 AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
744 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
748 dnl Test breaks icc on OS/2 && MSVC
749 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
751 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
755 CC="${srcdir}/build/hcc '$CC'"
756 CXX="${srcdir}/build/hcpp '$CXX'"
763 if test -n "$_WIN32_MSVC"; then
765 SKIP_COMPILER_CHECKS=1
766 SKIP_LIBRARY_CHECKS=1
768 # Since we're skipping compiler and library checks, hard-code
775 AC_DEFINE(HAVE_SETBUF)
776 AC_DEFINE(HAVE_ISATTY)
781 fi # COMPILE_ENVIRONMENT
793 dnl ========================================================
794 dnl Checks for programs.
795 dnl ========================================================
799 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
800 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
801 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
803 AC_MSG_RESULT([$_perl_version])
805 if test "$_perl_res" != 0; then
806 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
810 AC_MSG_CHECKING([for full perl installation])
811 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
813 if test "$_perl_res" != 0; then
815 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
820 MOZ_PATH_PROGS(PYTHON, $PYTHON python2.5 python2.4 python)
821 if test -z "$PYTHON"; then
822 AC_MSG_ERROR([python was not found in \$PATH])
825 if test -z "$COMPILE_ENVIRONMENT"; then
826 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
828 AC_SUBST(NSINSTALL_BIN)
830 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
831 MOZ_PATH_PROG(WHOAMI, whoami, :)
832 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
833 MOZ_PATH_PROG(UNZIP, unzip, :)
834 MOZ_PATH_PROGS(ZIP, zip)
835 if test -z "$ZIP" || test "$ZIP" = ":"; then
836 AC_MSG_ERROR([zip not found in \$PATH])
838 MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
839 MOZ_PATH_PROG(XARGS, xargs)
840 if test -z "$XARGS" || test "$XARGS" = ":"; then
841 AC_MSG_ERROR([xargs not found in \$PATH .])
844 if test "$COMPILE_ENVIRONMENT"; then
846 dnl ========================================================
847 dnl = Mac OS X toolchain support
848 dnl ========================================================
852 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
853 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
854 dnl the environment and includedir purposes (when using an SDK, below),
855 dnl but remember the full version number for the libdir (SDK).
857 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
858 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
860 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
861 dnl Bug 280479, but this keeps popping up in bug 292530 too because
862 dnl 4.0.0/4061 is the default compiler in Tiger.
864 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
866 if test "$GCC_BUILD" = "4061" ; then
867 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
868 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
869 from building Mozilla. Upgrade to Xcode 2.1 or later.])
873 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
874 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
875 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
876 MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
881 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
883 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
889 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
890 dnl it has moved into /usr/bin.
891 MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
895 AC_SUBST(GCC_VERSION)
896 AC_SUBST(XCODEBUILD_VERSION)
897 AC_SUBST(HAS_XCODE_2_1)
899 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
900 dnl that a universal binary is being produced.
901 AC_SUBST(UNIVERSAL_BINARY)
903 dnl ========================================================
904 dnl Check for MacOS deployment target version
905 dnl ========================================================
907 MOZ_ARG_ENABLE_STRING(macos-target,
908 [ --enable-macos-target=VER (default=10.4)
909 Set the minimum MacOS version needed at runtime],
910 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
914 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
915 dnl Use the specified value
916 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
917 AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
918 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
919 dnl No value specified on the command line or in the environment,
920 dnl use architecture minimum.
921 case "${target_cpu}" in
923 export MACOSX_DEPLOYMENT_TARGET=10.5
926 export MACOSX_DEPLOYMENT_TARGET=10.4
933 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
935 dnl ========================================================
936 dnl = Mac OS X SDK support
937 dnl ========================================================
940 MOZ_ARG_WITH_STRING(macos-sdk,
941 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
942 MACOS_SDK_DIR=$withval)
944 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
945 dnl NEXT_ROOT will be set and exported only if it's needed.
946 AC_SUBST(MACOS_SDK_DIR)
949 if test "$MACOS_SDK_DIR"; then
950 dnl Sync this section with the ones in NSPR and NSS.
951 dnl Changes to the cross environment here need to be accounted for in
952 dnl the libIDL checks (below) and xpidl build.
954 if test ! -d "$MACOS_SDK_DIR"; then
955 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
956 specify a valid SDK. SDKs are installed when the optional cross-development
957 tools are selected during the Xcode/Developer Tools installation.])
960 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
961 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
962 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include -F${MACOS_SDK_DIR}/System/Library/Frameworks"
963 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
964 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
966 SDK_CXX_INCLUDE="-I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++ -I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin -I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward"
968 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
969 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
971 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
972 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
973 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
975 dnl ld support for -syslibroot is compiler-agnostic, but only available
976 dnl on Tiger. Although it's possible to switch on the build host's
977 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
978 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
979 dnl set because both the compiler and linker use it.
980 LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib $LIBS"
981 export NEXT_ROOT=$MACOS_SDK_DIR
983 if test -n "$CROSS_COMPILE" ; then
984 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
985 dnl the build host. HOST_CXX is presently unused.
986 HOST_CC="NEXT_ROOT= $HOST_CC"
987 HOST_CXX="NEXT_ROOT= $HOST_CXX"
990 dnl gcc >= 4.0 uses different paths than above, but knows how to find
992 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
993 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
995 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
996 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
997 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
999 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
1000 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
1001 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
1002 dnl be ignored and cause warnings when -syslibroot is specified.
1003 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
1004 dnl the -isysroot it receives, so this is only needed with 4.0.0.
1005 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1010 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
1012 AC_TRY_COMPILE([#include <new>
1013 int main() { return 0; }],
1017 AC_MSG_RESULT($result)
1019 if test "$result" = "no" ; then
1020 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
1024 fi # COMPILE_ENVIRONMENT
1026 dnl Be sure the make we use is GNU make.
1027 dnl on win32, gmake.exe is the generally the wrong version
1028 if test -n "$MAKE"; then
1029 if test `echo $MAKE | grep -c make.py` != 1; then
1035 cygwin*|mingw*|mks*|msvc*)
1036 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
1039 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
1042 if test "$GMAKE" = ":"; then
1043 AC_MSG_ERROR([GNU make not found])
1047 if test "$COMPILE_ENVIRONMENT"; then
1051 dnl Check in X11 include directory too.
1052 if test "$no_x" != "yes"; then
1053 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1058 fi # COMPILE_ENVIRONMENT
1060 dnl ========================================================
1061 dnl set the defaults first
1062 dnl ========================================================
1066 AR_EXTRACT='$(AR) x'
1081 MOZ_USER_DIR=".mozilla"
1083 HOST_AR_FLAGS='$(AR_FLAGS)'
1086 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
1088 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
1090 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1092 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
1094 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
1095 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
1096 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1097 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
1098 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1099 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1100 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1104 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1105 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
1107 USE_DEPENDENT_LIBS=1
1109 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1110 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
1112 MOZ_ENABLE_POSTSCRIPT=1
1114 if test -n "$CROSS_COMPILE"; then
1115 OS_TARGET="${target_os}"
1116 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1118 case "${target_os}" in
1119 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1120 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1121 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1122 mingw*) OS_ARCH=WINNT ;;
1123 wince*) OS_ARCH=WINCE ;;
1124 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1127 OS_TARGET=`uname -s`
1128 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1129 OS_RELEASE=`uname -r`
1132 # Before this used `uname -m` when not cross compiling
1133 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1134 OS_TEST="${target_cpu}"
1138 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1140 #######################################################################
1141 # Master "Core Components" macros for getting the OS target #
1142 #######################################################################
1145 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1146 # cross-compilation.
1150 # Define and override various archtecture-specific variables, including
1159 case "$HOST_OS_ARCH" in
1160 cygwin*|mingw*|mks*|msvc*)
1170 if test -z "$GNU_CC"; then
1171 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1176 if test -z "$GNU_CXX"; then
1177 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1178 SOLARIS_SUNPRO_CXX=1
1181 AC_SUBST(SOLARIS_SUNPRO_CC)
1182 AC_SUBST(SOLARIS_SUNPRO_CXX)
1194 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1197 HOST_OS_ARCH=UNIXWARE
1209 HOST_OS_ARCH=OpenVMS
1219 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1223 HOST_OS_ARCH=UNIXWARE
1233 # If uname -s returns "Windows_NT", we assume that we are using
1234 # the uname.exe in MKS toolkit.
1236 # The -r option of MKS uname only returns the major version number.
1237 # So we need to use its -v option to get the minor version number.
1238 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1242 OS_MINOR_RELEASE=`uname -v`
1243 if test "$OS_MINOR_RELEASE" = "00"; then
1246 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1248 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1250 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1251 # the uname.exe in the Cygwin tools.
1252 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1253 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1254 # the uname.exe in the GNU-Win32 tools.
1255 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1256 # the uname.exe in the MSYS tools.
1258 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1263 OS_RELEASE=`uname -v`.`uname -r`
1264 OS_TEST=${target_cpu}
1276 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1280 OS_RELEASE=`uname -v`
1304 OS_RELEASE=`uname -v`
1310 OS_RELEASE=`uname -v`
1313 if test "$OS_TARGET" != "NTO"; then
1315 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1324 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1330 OS_RELEASE=`uname -v`
1337 case "${target_cpu}" in
1348 if test -z "$CROSS_COMPILE" ; then
1356 if test "$OS_ARCH" = "NCR"; then
1358 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1362 # Only set CPU_ARCH if we recognize the value of OS_TEST
1369 powerpc* | ppc | rs6000)
1373 Alpha | alpha | ALPHA)
1390 if test "$OS_TARGET" == "WINCE"; then
1396 if test -z "$OS_TARGET"; then
1399 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1401 dnl ========================================================
1402 dnl GNU specific defaults
1403 dnl ========================================================
1404 if test "$GNU_CC"; then
1405 # FIXME: Let us build with strict aliasing. bug 414641.
1406 CFLAGS="$CFLAGS -fno-strict-aliasing"
1407 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1408 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1409 DSO_LDOPTS='-shared'
1410 if test "$GCC_USE_GNU_LD"; then
1411 # Don't allow undefined symbols in libraries
1412 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1414 WARNINGS_AS_ERRORS='-Werror'
1416 DSO_PIC_CFLAGS='-fPIC'
1417 ASFLAGS="$ASFLAGS -fPIC"
1418 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1419 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1420 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1421 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1423 # Turn on GNU specific features
1424 # -Wall - turn on all warnings
1425 # -pedantic - make compiler warn about non-ANSI stuff, and
1426 # be a little bit stricter
1427 # Warnings slamm took out for now (these were giving more noise than help):
1428 # -Wbad-function-cast - warns when casting a function to a new return type
1429 # -Wshadow - removed because it generates more noise than help --pete
1430 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1431 if test -z "$INTEL_CC"; then
1432 # Don't use -Wcast-align with ICC
1434 # And don't use it on hppa, ia64, sparc, since it's noisy there
1435 hppa | ia64 | sparc)
1438 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1443 dnl Turn pedantic on but disable the warnings for long long
1446 if test -z "$INTEL_CC"; then
1447 _IGNORE_LONG_LONG_WARNINGS=1
1448 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1450 _IGNORE_LONG_LONG_WARNINGS=
1454 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1455 _USE_CPP_INCLUDE_FLAG=1
1456 elif test "$SOLARIS_SUNPRO_CC"; then
1457 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1458 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1460 DSO_LDOPTS='-shared'
1461 if test "$GNU_LD"; then
1462 # Don't allow undefined symbols in libraries
1463 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1467 if test "$CPU_ARCH" = "sparc"; then
1468 # for Sun Studio on Solaris/SPARC
1469 DSO_PIC_CFLAGS='-xcode=pic32'
1471 DSO_PIC_CFLAGS='-KPIC'
1473 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1475 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1476 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1478 DSO_LDOPTS='-shared'
1479 if test "$GNU_LD"; then
1480 # Don't allow undefined symbols in libraries
1481 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1485 DSO_PIC_CFLAGS='-KPIC'
1486 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1489 if test "$GNU_CXX"; then
1490 # FIXME: Let us build with strict aliasing. bug 414641.
1491 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1492 # Turn on GNU specific features
1493 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1494 if test -z "$INTEL_CC"; then
1495 # Don't use -Wcast-align with ICC
1497 # And don't use it on hppa, ia64, sparc, since it's noisy there
1498 hppa | ia64 | sparc)
1501 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1506 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1507 _USE_CPP_INCLUDE_FLAG=1
1509 AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1510 ac_has_wno_invalid_offsetof,
1514 _SAVE_CXXFLAGS="$CXXFLAGS"
1515 CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1518 ac_has_wno_invalid_offsetof="yes",
1519 ac_has_wno_invalid_offsetof="no")
1520 CXXFLAGS="$_SAVE_CXXFLAGS"
1523 if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1524 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1527 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1530 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1531 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1532 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1533 dnl normal behavior.
1534 dnl ========================================================
1536 MKSHLIB_UNFORCE_ALL=
1538 if test "$COMPILE_ENVIRONMENT"; then
1539 if test "$GNU_CC"; then
1540 AC_MSG_CHECKING(whether ld has archive extraction flags)
1541 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1542 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1543 ac_cv_mkshlib_force_and_unforce="no"
1544 exec 3<&0 <<LOOP_INPUT
1545 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1546 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1547 force="-Wl,-all"; unforce="-Wl,-none"
1554 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1557 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1559 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1563 eval $ac_cv_mkshlib_force_and_unforce
1564 MKSHLIB_FORCE_ALL=$force
1565 MKSHLIB_UNFORCE_ALL=$unforce
1568 fi # COMPILE_ENVIRONMENT
1570 dnl =================================================================
1571 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1572 dnl which is bad when cross compiling.
1573 dnl =================================================================
1574 if test "$COMPILE_ENVIRONMENT"; then
1575 configure_static_assert_macros='
1576 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1577 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1578 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1581 dnl test that the macros actually work:
1582 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1583 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1586 ac_cv_static_assertion_macros_work="yes"
1587 AC_TRY_COMPILE([$configure_static_assert_macros],
1588 [CONFIGURE_STATIC_ASSERT(1)],
1590 ac_cv_static_assertion_macros_work="no")
1591 AC_TRY_COMPILE([$configure_static_assert_macros],
1592 [CONFIGURE_STATIC_ASSERT(0)],
1593 ac_cv_static_assertion_macros_work="no",
1596 AC_TRY_COMPILE([$configure_static_assert_macros],
1597 [CONFIGURE_STATIC_ASSERT(1)],
1599 ac_cv_static_assertion_macros_work="no")
1600 AC_TRY_COMPILE([$configure_static_assert_macros],
1601 [CONFIGURE_STATIC_ASSERT(0)],
1602 ac_cv_static_assertion_macros_work="no",
1606 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1607 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1608 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1610 fi # COMPILE_ENVIRONMENT
1612 dnl ========================================================
1613 dnl Checking for 64-bit OS
1614 dnl ========================================================
1615 if test "$COMPILE_ENVIRONMENT"; then
1618 AC_MSG_CHECKING(for 64-bit OS)
1619 AC_TRY_COMPILE([$configure_static_assert_macros],
1620 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1621 result="yes", result="no")
1622 AC_MSG_RESULT("$result")
1623 if test "$result" = "yes"; then
1624 AC_DEFINE(HAVE_64BIT_OS)
1627 AC_SUBST(HAVE_64BIT_OS)
1629 fi # COMPILE_ENVIRONMENT
1631 dnl ========================================================
1632 dnl Enable high-memory support on OS/2 by default.
1633 dnl ========================================================
1634 MOZ_OS2_HIGH_MEMORY=1
1635 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1636 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1637 MOZ_OS2_HIGH_MEMORY=,
1638 MOZ_OS2_HIGH_MEMORY=1 )
1639 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1641 dnl ========================================================
1642 dnl System overrides of the defaults for host
1643 dnl ========================================================
1646 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1647 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1648 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1651 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1652 # we need Python 2.5 on Windows
1654 if test -n "$_WIN32_MSVC"; then
1656 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1657 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1658 HOST_RANLIB='echo ranlib'
1660 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1662 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1663 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1664 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1665 HOST_BIN_SUFFIX=.exe
1668 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1671 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1672 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1674 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1676 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1678 PERL="${CYGWIN_WRAPPER} $PERL"
1681 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1682 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1689 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1690 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1691 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1692 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1695 *-linux*|*-kfreebsd*-gnu)
1696 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1697 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1698 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1702 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1703 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1704 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1705 HOST_BIN_SUFFIX=.exe
1710 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1711 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1712 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1716 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1717 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1721 dnl We require version 2.4 or newer of Python to build,
1722 dnl and 2.5 or newer on Windows.
1723 AC_MSG_CHECKING([for minimum required Python version >= $PYTHON_VERSION])
1725 $PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION
1728 if test "$_python_res" != 0; then
1729 AC_MSG_ERROR([Python $PYTHON_VERSION or higher is required.])
1731 AC_MSG_RESULT([yes])
1733 dnl Get mozilla version from central milestone file
1734 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1736 dnl Get version of various core apps from the version files.
1737 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1739 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1740 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1742 dnl ========================================================
1743 dnl System overrides of the defaults for target
1744 dnl ========================================================
1749 if test ! "$GNU_CC"; then
1750 if test ! "$HAVE_64BIT_OS"; then
1751 # Compiling with Visual Age C++ object model compat is the
1752 # default. To compile with object model ibm, add
1753 # AIX_OBJMODEL=ibm to .mozconfig.
1754 if test "$AIX_OBJMODEL" = "ibm"; then
1755 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1762 AC_SUBST(AIX_OBJMODEL)
1763 DSO_LDOPTS='-qmkshrobj=1'
1764 DSO_CFLAGS='-qflag=w:w'
1766 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1767 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1769 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1770 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1771 if test "$COMPILE_ENVIRONMENT"; then
1774 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
1776 [#if (__IBMCPP__ < 600)
1777 #error "Bad compiler"
1779 _BAD_COMPILER=,_BAD_COMPILER=1)
1780 if test -n "$_BAD_COMPILER"; then
1782 AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
1784 AC_MSG_RESULT([yes])
1787 TARGET_COMPILER_ABI="ibmc"
1788 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1789 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1792 case "${target_os}" in
1797 if test "$COMPILE_ENVIRONMENT"; then
1798 AC_CHECK_HEADERS(sys/inttypes.h)
1800 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1805 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1806 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1807 DSO_LDOPTS='-nostart'
1808 TK_LIBS='-lbe -lroot'
1810 if test "$COMPILE_ENVIRONMENT"; then
1811 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1812 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1814 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1815 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1818 MOZ_USER_DIR="Mozilla"
1822 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1824 _IGNORE_LONG_LONG_WARNINGS=
1832 _WARNINGS_CFLAGS="-Wall"
1833 _WARNINGS_CXXFLAGS="-Wall"
1834 # The test above doesn't work properly, at least on 3.1.
1835 MKSHLIB_FORCE_ALL=''
1836 MKSHLIB_UNFORCE_ALL=''
1842 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1843 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1844 MOZ_OPTIMIZE_FLAGS="-O3"
1846 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1847 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1850 STRIP="$STRIP -x -S"
1851 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1852 MOZ_ENABLE_POSTSCRIPT=
1853 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1854 # The ExceptionHandling framework is needed for Objective-C exception
1855 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1857 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1859 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1860 dnl ===================================================================
1861 if test "x$enable_dtrace" = "xyes"; then
1862 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1864 dnl check for the presence of the -dead_strip linker flag
1865 AC_MSG_CHECKING([for -dead_strip option to ld])
1866 _SAVE_LDFLAGS=$LDFLAGS
1867 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1868 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1869 if test -n "$_HAVE_DEAD_STRIP" ; then
1870 AC_MSG_RESULT([yes])
1871 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1876 LDFLAGS=$_SAVE_LDFLAGS
1881 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1882 DLL_SUFFIX=".so.1.0"
1883 DSO_LDOPTS="-shared"
1885 if test ! "$GNU_CC"; then
1886 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1888 # Can't have force w/o an unforce.
1889 # # Hack for FreeBSD 2.2
1890 # if test -z "$MKSHLIB_FORCE_ALL"; then
1891 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1892 # MKSHLIB_UNFORCE_ALL=''
1898 if test ! "$GNU_CC"; then
1899 DSO_LDOPTS='-b -Wl,+s'
1902 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1903 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1904 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1906 DSO_LDOPTS='-b -E +s'
1907 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1908 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1910 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1911 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1916 DSO_LDOPTS='-elf -shared'
1918 if test "$GNU_CC"; then
1919 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1920 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1921 MKSHLIB_FORCE_ALL='-Wl,-all'
1922 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1923 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1925 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1926 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1927 MKSHLIB_FORCE_ALL='-all'
1928 MKSHLIB_UNFORCE_ALL='-none'
1934 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1935 dnl compile and link using -n32
1937 TARGET_COMPILER_ABI=n32
1938 DSO_LDOPTS='-elf -shared'
1939 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1940 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1941 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1942 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1943 if test "$GNU_CC"; then
1944 MKSHLIB_FORCE_ALL='-Wl,-all'
1945 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1946 _WARNINGS_CFLAGS="-Wall"
1947 _WARNINGS_CXXFLAGS="-Wall"
1948 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1950 MKSHLIB_FORCE_ALL='-all'
1951 MKSHLIB_UNFORCE_ALL='-none'
1957 CFLAGS="$CFLAGS -woff 3262 -G 4"
1958 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1959 if test -n "$USE_N32"; then
1960 ASFLAGS="$ASFLAGS -n32"
1961 CFLAGS="$CFLAGS -n32"
1962 CXXFLAGS="$CXXFLAGS -n32"
1963 LDFLAGS="$LDFLAGS -n32"
1965 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1966 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1969 if test -z "$GNU_CXX"; then
1975 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
1976 # Similarly for GNU_CXX and INTEL_CXX.
1977 if test "$INTEL_CC" || test "$INTEL_CXX"; then
1978 # -Os has been broken on Intel's C/C++ compilers for quite a
1979 # while; Intel recommends against using it.
1980 MOZ_OPTIMIZE_FLAGS="-O2"
1981 MOZ_DEBUG_FLAGS="-g -fno-inline"
1982 elif test "$GNU_CC" || test "$GNU_CXX"; then
1983 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
1984 case $GCC_VERSION in
1986 # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
1987 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
1989 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
1990 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1991 # and that combo is not yet good at
1992 # debugging inlined functions (even
1993 # when using DWARF2 as the debugging
1997 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2001 case "${target_cpu}" in
2003 CFLAGS="$CFLAGS -mieee"
2004 CXXFLAGS="$CXXFLAGS -mieee"
2008 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
2011 MOZ_DEBUG_FLAGS="-g" # We want inlining
2017 TARGET_COMPILER_ABI=msvc
2018 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
2020 AR_EXTRACT="$AR -extract"
2022 AR_FLAGS='-OUT:"$@"'
2024 if test "$AS_BIN"; then
2031 if test -z "$RC"; then
2034 # certain versions of cygwin's makedepend barf on the
2035 # #include <string> vs -I./dist/include/string issue so don't use it
2041 HOST_AR='lib -OUT:$@'
2042 HOST_RANLIB='echo ranlib'
2043 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
2046 WARNINGS_AS_ERRORS='-WX'
2047 MOZ_OPTIMIZE_FLAGS='-Ox'
2048 AR_FLAGS='-NOLOGO -OUT:"$@"'
2050 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2051 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2054 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
2055 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2057 IMPORT_LIB_SUFFIX=lib
2059 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2062 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2063 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2065 MKSHLIB_UNFORCE_ALL=
2066 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2067 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2068 MOZ_DEBUG_FLAGS='-Zi'
2069 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2071 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2072 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2074 RANLIB='echo not_ranlib'
2075 STRIP='echo not_strip'
2076 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
2079 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2081 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
2082 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
2086 AC_DEFINE(HAVE_SNPRINTF)
2092 AC_DEFINE(HW_THREADS)
2093 AC_DEFINE(STDC_HEADERS)
2094 AC_DEFINE(NEW_H, <new>)
2095 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2096 AC_DEFINE(HAVE_LOCALTIME_R)
2098 TARGET_MD_ARCH=win32
2099 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2102 MOZ_ENABLE_POSTSCRIPT=
2103 MOZ_USER_DIR="Mozilla"
2105 MOZ_GFX_OPTIMIZE_MOBILE=1
2107 # Sanity check for WINCE_WINDOWS_MOBILE
2108 # XXX disabled until we can fix the mobile tinderbox
2109 ##if test "$WINCE_WINDOWS_MOBILE"; then
2110 ## AC_CHECK_HEADER(tpcshell.h, [],
2111 ## AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
2116 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2121 # certain versions of cygwin's makedepend barf on the
2122 # #include <string> vs -I./dist/include/string issue so don't use it
2124 if test -n "$GNU_CC"; then
2125 CC="$CC -mno-cygwin"
2126 CXX="$CXX -mno-cygwin"
2127 CPP="$CPP -mno-cygwin"
2128 CFLAGS="$CFLAGS -mms-bitfields"
2129 CXXFLAGS="$CXXFLAGS -mms-bitfields"
2130 DSO_LDOPTS='-shared'
2131 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2132 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2134 # Use temp file for windres (bug 213281)
2135 RCFLAGS='-O coff --use-temp-file'
2136 # mingw doesn't require kernel32, user32, and advapi32 explicitly
2137 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
2138 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
2140 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
2141 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
2143 IMPORT_LIB_SUFFIX=dll.a
2145 TARGET_COMPILER_ABI=msvc
2149 AR='lib -NOLOGO -OUT:"$@"'
2151 RANLIB='echo not_ranlib'
2152 STRIP='echo not_strip'
2157 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2162 IMPORT_LIB_SUFFIX=lib
2163 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2164 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2166 MKSHLIB_UNFORCE_ALL=
2167 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2168 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2169 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2170 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2171 MOZ_DEBUG_FLAGS='-Zi'
2172 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2173 WARNINGS_AS_ERRORS='-WX'
2174 MOZ_OPTIMIZE_FLAGS='-O1'
2175 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2177 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2178 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2179 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2180 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2181 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2182 if test $_MSC_VER -ge 1400; then
2183 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
2184 dnl For profile-guided optimization
2185 PROFILE_GEN_CFLAGS="-GL"
2186 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2187 dnl XXX: PGO builds can fail with warnings treated as errors,
2188 dnl specifically "no profile data available" appears to be
2189 dnl treated as an error sometimes. This might be a consequence
2190 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2191 dnl with the linker doing most of the work in the whole-program
2192 dnl optimization/PGO case. I think it's probably a compiler bug,
2193 dnl but we work around it here.
2194 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2195 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2196 dnl Probably also a compiler bug, but what can you do?
2197 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2198 if test -n "$_USE_DYNAMICBASE"; then
2199 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2203 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2204 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2205 AC_DEFINE(HAVE_SNPRINTF)
2211 AC_DEFINE(HW_THREADS)
2212 AC_DEFINE(STDC_HEADERS)
2213 AC_DEFINE(NEW_H, <new>)
2214 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2215 TARGET_MD_ARCH=win32
2216 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2219 MOZ_ENABLE_POSTSCRIPT=
2220 MOZ_USER_DIR="Mozilla"
2222 dnl Hardcode to win95 for now - cls
2223 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2225 dnl set NO_X11 defines here as the general check is skipped on win32
2229 dnl MinGW/MSYS doesn't provide or need cygpath
2234 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2236 *-cygwin*|*-msvc*|*-mks*)
2237 CYGPATH_W="cygpath -a -w"
2238 CYGPATH_S="sed -e s|\\\\|/|g"
2239 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2243 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2245 if test -z "$MOZ_TOOLS"; then
2246 AC_MSG_ERROR([MOZ_TOOLS is not set])
2249 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2250 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2251 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2253 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2254 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2255 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2257 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2259 if test -n "$GLIB_PREFIX"; then
2260 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
2261 if test "$?" = "0"; then
2262 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
2263 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
2265 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
2267 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
2270 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
2272 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
2273 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
2275 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
2276 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
2277 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
2278 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
2279 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
2281 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
2284 if test -n "$LIBIDL_PREFIX"; then
2285 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd -W`
2286 if test "$?" = "0"; then
2287 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2288 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2290 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2292 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2295 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2297 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2298 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2300 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2301 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2302 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2304 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2305 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2307 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2309 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2312 *) # else cross-compiling
2313 if test -n "$GLIB_PREFIX"; then
2314 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2315 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2316 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2317 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2318 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2320 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2323 if test -n "$LIBIDL_PREFIX"; then
2324 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2325 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2326 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2328 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2329 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2331 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2334 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2341 AC_MSG_WARN([Using a cygwin build environment is unsupported. Configure cannot check for the presence of necessary headers. Please upgrade to MozillaBuild; see http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites])
2345 AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
2349 AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2365 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2372 CFLAGS="$CFLAGS -Dunix"
2373 CXXFLAGS="$CXXFLAGS -Dunix"
2374 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2376 DSO_PIC_CFLAGS='-fPIC -DPIC'
2377 DSO_LDOPTS='-shared'
2378 BIN_FLAGS='-Wl,--export-dynamic'
2380 DSO_PIC_CFLAGS='-fPIC -DPIC'
2381 DLL_SUFFIX=".so.1.0"
2382 DSO_LDOPTS='-shared'
2384 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2385 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2386 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2387 if test "$LIBRUNPATH"; then
2388 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2390 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2391 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2396 AC_DEFINE(_QNX_SOURCE)
2399 WARNINGS_AS_ERRORS=''
2400 MOZ_OPTIMIZE_FLAGS="-O"
2401 MOZ_DEBUG_FLAGS="-gstabs"
2404 LIBS="$LIBS -lsocket -lstdc++"
2405 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2406 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2407 if test "$with_x" != "yes"
2409 _PLATFORM_DEFAULT_TOOLKIT="photon"
2410 TK_CFLAGS='-I/usr/include/photon'
2413 case "${target_cpu}" in
2415 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2418 case "${host_cpu}" in
2426 DLL_SUFFIX=".so.1.0"
2428 DSO_PIC_CFLAGS='-fPIC'
2429 DSO_LDOPTS='-shared -fPIC'
2430 if test "$LIBRUNPATH"; then
2431 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2436 AC_DEFINE(NO_PW_GECOS)
2437 AC_DEFINE(NO_UDSOCK)
2438 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2440 MKSHLIB_FORCE_ALL='-all'
2441 MKSHLIB_UNFORCE_ALL='-none'
2443 AS_DASH_C_FLAG='-Wc/names=as_is'
2445 DSO_LDOPTS='-shared -auto_symvec'
2447 MOZ_DEBUG_LDFLAGS='-g'
2449 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2450 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2455 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2456 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2459 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2460 AC_DEFINE(TCPV40HDRS)
2467 IMPORT_LIB_SUFFIX=lib
2471 CFLAGS="$CFLAGS -Zomf"
2472 CXXFLAGS="$CXXFLAGS -Zomf"
2474 BIN_FLAGS='-Zlinker /ST:0x100000'
2478 WARNINGS_AS_ERRORS='-Werror'
2479 MOZ_DEBUG_FLAGS="-g -fno-inline"
2480 MOZ_OPTIMIZE_FLAGS="-O2"
2481 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2482 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2483 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2484 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2486 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2487 MOZ_ENABLE_POSTSCRIPT=
2490 MOZ_USER_DIR="Mozilla"
2492 if test "$MOZTOOLS"; then
2493 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2495 AC_MSG_ERROR([MOZTOOLS is not set])
2497 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2498 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2499 LDFLAGS="$LDFLAGS -Zhigh-mem"
2500 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2501 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2504 # GCC for OS/2 currently predefines these, but we don't want them
2505 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2506 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2508 AC_CACHE_CHECK(for __declspec(dllexport),
2510 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2512 ac_os2_declspec="yes",
2513 ac_os2_declspec="no")])
2514 if test "$ac_os2_declspec" = "yes"; then
2516 MOZ_OS2_USE_DECLSPEC='1'
2521 if test "$GNU_CC"; then
2522 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2523 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2526 MOZ_DEBUG_FLAGS='-g'
2527 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2528 CFLAGS="$CFLAGS -ieee"
2529 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2530 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2533 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2534 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2535 MKSHLIB_FORCE_ALL='-all'
2536 MKSHLIB_UNFORCE_ALL='-none'
2537 dnl Might fix the libxpcom.so breakage on this platform as well....
2538 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2539 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2541 if test -z "$GNU_CXX"; then
2544 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2548 DIRENT_INO=d_stat.st_ino
2549 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2550 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2551 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2552 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2553 AC_DEFINE(STDC_HEADERS)
2554 if test "$no_x" = "yes"; then
2555 _PLATFORM_DEFAULT_TOOLKIT='photon'
2556 TK_CFLAGS='-I/usr/nto/include/photon'
2557 TK_LIBS='-lphoton -lphrender'
2562 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2563 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2564 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2565 if test ! "$GNU_CC"; then
2570 dnl the qsort routine under solaris is faulty
2573 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2575 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2576 # libraries one level up (e.g. libnspr4.so)
2577 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2579 if test "$SOLARIS_SUNPRO_CC"; then
2580 LIBS="-lCrun -lCstd $LIBS"
2583 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2584 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2585 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2586 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2587 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2588 _SAVE_LDFLAGS=$LDFLAGS
2589 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2590 AC_TRY_LINK([#include <stdio.h>],
2591 [printf("Hello World\n");],
2593 [LDFLAGS=$_SAVE_LDFLAGS])
2595 WARNINGS_AS_ERRORS='-Werror'
2596 MOZ_OPTIMIZE_FLAGS="-xO4"
2597 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2598 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2599 MKSHLIB_FORCE_ALL='-z allextract'
2600 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2601 DSO_LDOPTS='-G -z muldefs'
2607 AS='/usr/ccs/bin/as'
2608 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2610 TARGET_COMPILER_ABI="sunc"
2611 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2612 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2613 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2617 [#if (__SUNPRO_CC < 0x590)
2620 _BAD_COMPILER=,_BAD_COMPILER=1)
2621 if test -n "$_BAD_COMPILER"; then
2623 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2627 AC_MSG_RESULT([$_res])
2630 ASFLAGS="$ASFLAGS -fPIC"
2633 _WARNINGS_CXXFLAGS=''
2634 if test "$OS_RELEASE" = "5.3"; then
2635 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2638 if test "$OS_RELEASE" = "5.5.1"; then
2639 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2644 DSO_LDOPTS='-Bdynamic'
2645 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2646 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2648 AC_DEFINE(SPRINTF_RETURNS_STRING)
2649 case "$(target_os)" in
2651 DLL_SUFFIX='.so.1.0'
2657 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2661 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2666 dnl Only one oddball right now (QNX), but this gives us flexibility
2667 dnl if any other platforms need to override this in the future.
2668 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2670 dnl ========================================================
2671 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2672 dnl by now will not have any way to link most binaries (tests
2673 dnl as well as viewer, apprunner, etc.), because some symbols
2674 dnl will be left out of the "composite" .so's by ld as unneeded.
2675 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2676 dnl they can link in the static libs that provide the missing
2678 dnl ========================================================
2679 NO_LD_ARCHIVE_FLAGS=
2680 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2681 NO_LD_ARCHIVE_FLAGS=1
2685 NO_LD_ARCHIVE_FLAGS=
2688 NO_LD_ARCHIVE_FLAGS=
2691 NO_LD_ARCHIVE_FLAGS=
2693 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2694 if test -z "$GNU_CC"; then
2695 NO_LD_ARCHIVE_FLAGS=
2699 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2701 dnl ========================================================
2702 dnl = Flags to strip unused symbols from .so components
2703 dnl ========================================================
2705 *-linux*|*-kfreebsd*-gnu)
2706 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2709 if test -z "$GNU_CC"; then
2710 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2712 if test -z "$GCC_USE_GNU_LD"; then
2713 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2715 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2720 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2723 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2725 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2726 if test -n "$GNU_CC"; then
2727 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2732 if test -z "$COMPILE_ENVIRONMENT"; then
2733 SKIP_COMPILER_CHECKS=1
2734 SKIP_LIBRARY_CHECKS=1
2737 if test -z "$SKIP_COMPILER_CHECKS"; then
2738 dnl Checks for typedefs, structures, and compiler characteristics.
2739 dnl ========================================================
2747 AC_STRUCT_ST_BLKSIZE
2748 AC_MSG_CHECKING(for siginfo_t)
2749 AC_CACHE_VAL(ac_cv_siginfo_t,
2750 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2751 #include <signal.h>],
2753 [ac_cv_siginfo_t=true],
2754 [ac_cv_siginfo_t=false])])
2755 if test "$ac_cv_siginfo_t" = true ; then
2756 AC_DEFINE(HAVE_SIGINFO_T)
2762 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2763 dnl ========================================================
2764 AC_MSG_CHECKING(for int16_t)
2765 AC_CACHE_VAL(ac_cv_int16_t,
2766 [AC_TRY_COMPILE([#include <stdio.h>
2767 #include <sys/types.h>],
2769 [ac_cv_int16_t=true],
2770 [ac_cv_int16_t=false])])
2771 if test "$ac_cv_int16_t" = true ; then
2772 AC_DEFINE(HAVE_INT16_T)
2777 AC_MSG_CHECKING(for int32_t)
2778 AC_CACHE_VAL(ac_cv_int32_t,
2779 [AC_TRY_COMPILE([#include <stdio.h>
2780 #include <sys/types.h>],
2782 [ac_cv_int32_t=true],
2783 [ac_cv_int32_t=false])])
2784 if test "$ac_cv_int32_t" = true ; then
2785 AC_DEFINE(HAVE_INT32_T)
2790 AC_MSG_CHECKING(for int64_t)
2791 AC_CACHE_VAL(ac_cv_int64_t,
2792 [AC_TRY_COMPILE([#include <stdio.h>
2793 #include <sys/types.h>],
2795 [ac_cv_int64_t=true],
2796 [ac_cv_int64_t=false])])
2797 if test "$ac_cv_int64_t" = true ; then
2798 AC_DEFINE(HAVE_INT64_T)
2803 AC_MSG_CHECKING(for int64)
2804 AC_CACHE_VAL(ac_cv_int64,
2805 [AC_TRY_COMPILE([#include <stdio.h>
2806 #include <sys/types.h>],
2809 [ac_cv_int64=false])])
2810 if test "$ac_cv_int64" = true ; then
2811 AC_DEFINE(HAVE_INT64)
2816 AC_MSG_CHECKING(for uint)
2817 AC_CACHE_VAL(ac_cv_uint,
2818 [AC_TRY_COMPILE([#include <stdio.h>
2819 #include <sys/types.h>],
2822 [ac_cv_uint=false])])
2823 if test "$ac_cv_uint" = true ; then
2824 AC_DEFINE(HAVE_UINT)
2829 AC_MSG_CHECKING(for uint_t)
2830 AC_CACHE_VAL(ac_cv_uint_t,
2831 [AC_TRY_COMPILE([#include <stdio.h>
2832 #include <sys/types.h>],
2834 [ac_cv_uint_t=true],
2835 [ac_cv_uint_t=false])])
2836 if test "$ac_cv_uint_t" = true ; then
2837 AC_DEFINE(HAVE_UINT_T)
2842 AC_MSG_CHECKING(for uint16_t)
2843 AC_CACHE_VAL(ac_cv_uint16_t,
2844 [AC_TRY_COMPILE([#include <stdio.h>
2845 #include <sys/types.h>],
2846 [uint16_t foo = 0;],
2847 [ac_cv_uint16_t=true],
2848 [ac_cv_uint16_t=false])])
2849 if test "$ac_cv_uint16_t" = true ; then
2850 AC_DEFINE(HAVE_UINT16_T)
2856 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2857 dnl are defined when compiling C++ but not C. Since the result of this
2858 dnl test is used only in C++, do it in C++.
2861 AC_MSG_CHECKING(for uname.domainname)
2862 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2863 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2864 [ struct utsname *res; char *domain;
2865 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2866 [ac_cv_have_uname_domainname_field=true],
2867 [ac_cv_have_uname_domainname_field=false])])
2869 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2870 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2876 AC_MSG_CHECKING(for uname.__domainname)
2877 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2878 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2879 [ struct utsname *res; char *domain;
2880 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2881 [ac_cv_have_uname_us_domainname_field=true],
2882 [ac_cv_have_uname_us_domainname_field=false])])
2884 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2885 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2893 dnl Check for usable char16_t (2 bytes, unsigned)
2894 dnl (we might not need the unsignedness check anymore)
2895 AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
2896 ac_cv_have_usable_char16_t,
2897 [AC_TRY_COMPILE([$configure_static_assert_macros],
2898 [CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
2899 CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
2900 CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
2901 CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
2902 CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
2903 ac_cv_have_usable_char16_t="yes",
2904 ac_cv_have_usable_char16_t="no")])
2905 if test "$ac_cv_have_usable_char16_t" = "yes"; then
2906 AC_DEFINE(HAVE_CPP_CHAR16_T)
2910 dnl Check for usable wchar_t (2 bytes, unsigned)
2911 dnl (we really don't need the unsignedness check anymore)
2912 dnl ========================================================
2914 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2915 ac_cv_have_usable_wchar_v2,
2916 [AC_TRY_COMPILE([#include <stddef.h>
2917 $configure_static_assert_macros],
2918 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2919 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2920 ac_cv_have_usable_wchar_v2="yes",
2921 ac_cv_have_usable_wchar_v2="no")])
2922 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2923 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2924 HAVE_CPP_2BYTE_WCHAR_T=1
2925 elif test "$ac_cv_have_usable_char16_t" != "yes"; then
2926 dnl This is really gcc-only
2927 dnl Do this test using CXX only since some versions of gcc
2928 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2929 dnl only have short-wchar support for c++.
2930 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2932 _SAVE_CXXFLAGS=$CXXFLAGS
2933 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2935 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2936 ac_cv_have_usable_wchar_option_v2,
2937 [AC_TRY_LINK([#include <stddef.h>
2938 $configure_static_assert_macros],
2939 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2940 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2941 ac_cv_have_usable_wchar_option_v2="yes",
2942 ac_cv_have_usable_wchar_option_v2="no")])
2944 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2945 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2946 HAVE_CPP_2BYTE_WCHAR_T=1
2947 WCHAR_CFLAGS="-fshort-wchar"
2949 CXXFLAGS=$_SAVE_CXXFLAGS
2955 dnl Check for .hidden assembler directive and visibility attribute.
2956 dnl Borrowed from glibc configure.in
2957 dnl ===============================================================
2958 if test "$GNU_CC"; then
2959 AC_CACHE_CHECK(for visibility(hidden) attribute,
2960 ac_cv_visibility_hidden,
2961 [cat > conftest.c <<EOF
2962 int foo __attribute__ ((visibility ("hidden"))) = 1;
2964 ac_cv_visibility_hidden=no
2965 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2966 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2967 ac_cv_visibility_hidden=yes
2972 if test "$ac_cv_visibility_hidden" = "yes"; then
2973 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2975 AC_CACHE_CHECK(for visibility(default) attribute,
2976 ac_cv_visibility_default,
2977 [cat > conftest.c <<EOF
2978 int foo __attribute__ ((visibility ("default"))) = 1;
2980 ac_cv_visibility_default=no
2981 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2982 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2983 ac_cv_visibility_default=yes
2988 if test "$ac_cv_visibility_default" = "yes"; then
2989 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2991 AC_CACHE_CHECK(for visibility pragma support,
2992 ac_cv_visibility_pragma,
2993 [cat > conftest.c <<EOF
2994 #pragma GCC visibility push(hidden)
2996 #pragma GCC visibility push(default)
2997 int foo_default = 1;
2999 ac_cv_visibility_pragma=no
3000 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3001 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
3002 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
3003 ac_cv_visibility_pragma=yes
3009 if test "$ac_cv_visibility_pragma" = "yes"; then
3010 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
3011 ac_cv_have_visibility_class_bug,
3012 [cat > conftest.c <<EOF
3013 #pragma GCC visibility push(hidden)
3014 struct __attribute__ ((visibility ("default"))) TestStruct {
3017 __attribute__ ((visibility ("default"))) void TestFunc() {
3021 ac_cv_have_visibility_class_bug=no
3022 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3023 ac_cv_have_visibility_class_bug=yes
3025 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
3026 ac_cv_have_visibility_class_bug=yes
3029 rm -rf conftest.{c,S}
3032 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
3033 ac_cv_have_visibility_builtin_bug,
3034 [cat > conftest.c <<EOF
3035 #pragma GCC visibility push(hidden)
3036 #pragma GCC visibility push(default)
3038 #pragma GCC visibility pop
3040 __attribute__ ((visibility ("default"))) void Func() {
3042 memset(c, 0, sizeof(c));
3045 ac_cv_have_visibility_builtin_bug=no
3046 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3047 ac_cv_have_visibility_builtin_bug=yes
3049 if test `grep -c "@PLT" conftest.S` = 0; then
3050 ac_cv_visibility_builtin_bug=yes
3053 rm -f conftest.{c,S}
3055 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
3056 "$ac_cv_have_visibility_class_bug" = "no"; then
3057 VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
3058 WRAP_SYSTEM_INCLUDES=1
3060 VISIBILITY_FLAGS='-fvisibility=hidden'
3061 fi # have visibility pragma bug
3062 fi # have visibility pragma
3063 fi # have visibility(default) attribute
3064 fi # have visibility(hidden) attribute
3067 # visibility hidden flag for Sun Studio on Solaris
3068 if test "$SOLARIS_SUNPRO_CC"; then
3069 VISIBILITY_FLAGS='-xldscope=hidden'
3070 fi # Sun Studio on Solaris
3072 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3073 AC_SUBST(VISIBILITY_FLAGS)
3075 dnl Checks for header files.
3076 dnl ========================================================
3078 case "$target_os" in
3080 # for stuff like -lXshm
3081 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3084 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3085 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3086 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3087 AC_CHECK_HEADERS(malloc.h)
3088 AC_CHECK_HEADERS(X11/XKBlib.h)
3089 AC_CHECK_HEADERS(io.h)
3091 dnl These are all the places some variant of statfs can be hiding.
3092 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3094 dnl Try for MMX support
3095 dnl NB - later gcc versions require -mmmx for this header to be successfully
3096 dnl included (or another option which implies it, such as -march=pentium-mmx)
3097 AC_CHECK_HEADERS(mmintrin.h)
3099 dnl Check whether the compiler supports the new-style C++ standard
3100 dnl library headers (i.e. <new>) or needs the old "new.h"
3103 AC_CHECK_HEADER(new, [NEW_H=new])
3104 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
3107 AC_ARG_ENABLE(dtrace,
3108 [ --enable-dtrace build with dtrace support if available (default=no)],
3109 [enable_dtrace="yes"],)
3110 if test "x$enable_dtrace" = "xyes"; then
3111 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
3112 if test -n "$HAVE_DTRACE"; then
3113 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3115 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3118 AC_SUBST(HAVE_DTRACE)
3124 AC_CHECK_HEADERS(sys/cdefs.h)
3128 dnl Checks for libraries.
3129 dnl ========================================================
3134 AC_CHECK_LIB(c_r, gethostbyname_r)
3138 dnl We don't want to link with libdl even if it's present on OS X, since
3139 dnl it's not used and not part of the default installation.
3140 dnl The same goes for BeOS.
3141 dnl We don't want to link against libm or libpthread on Darwin since
3142 dnl they both are just symlinks to libSystem and explicitly linking
3143 dnl against libSystem causes issues when debugging (see bug 299601).
3150 AC_CHECK_LIB(m, atan)
3151 AC_CHECK_LIB(dl, dlopen,
3152 AC_CHECK_HEADER(dlfcn.h,
3154 AC_DEFINE(HAVE_LIBDL)))
3158 _SAVE_CFLAGS="$CFLAGS"
3159 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3160 AC_CHECK_FUNCS(dladdr)
3161 CFLAGS="$_SAVE_CFLAGS"
3163 if test ! "$GNU_CXX"; then
3167 AC_CHECK_LIB(C_r, demangle)
3170 AC_CHECK_LIB(C, demangle)
3174 AC_CHECK_LIB(socket, socket)
3176 dnl ========================================================
3177 dnl Check whether we can compile code for Core Text
3178 dnl (Mac OS X 10.5 or later)
3179 dnl ========================================================
3182 AC_MSG_CHECKING([for Core Text])
3183 AC_TRY_COMPILE([#include <ApplicationServices/ApplicationServices.h>],
3184 [CTLineRef lineRef;],
3185 ac_cv_have_core_text="yes",
3186 ac_cv_have_core_text="no")
3187 AC_MSG_RESULT([$ac_cv_have_core_text])
3189 case "${target_cpu}" in
3195 MOZ_ARG_ENABLE_BOOL(coretext,
3196 [ --enable-coretext Use CoreText instead of ATSUI for text rendering],
3200 if test -n "$MOZ_CORETEXT"; then
3201 if test "$ac_cv_have_core_text" = "no"; then
3202 AC_MSG_ERROR([--enable-coretext requires MacOS SDK 10.5 or newer])
3204 AC_DEFINE(MOZ_CORETEXT)
3209 AC_SUBST(MOZ_CORETEXT)
3212 XLIBS="$X_EXTRA_LIBS"
3214 dnl ========================================================
3215 dnl Checks for X libraries.
3216 dnl Ordering is important.
3217 dnl Xt is dependent upon SM as of X11R6
3218 dnl ========================================================
3219 if test "$no_x" = "yes"; then
3222 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3223 XLIBS="-lX11 $XLIBS"
3224 _SAVE_LDFLAGS="$LDFLAGS"
3225 LDFLAGS="$XLDFLAGS $LDFLAGS"
3226 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3227 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3228 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3229 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3231 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3232 unset ac_cv_lib_Xt_XtFree
3233 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3234 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3235 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3236 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3239 # AIX needs the motif library linked before libXt to prevent
3240 # crashes in plugins linked against Motif - Bug #98892
3241 case "${target_os}" in
3243 XT_LIBS="-lXm $XT_LIBS"
3247 dnl ========================================================
3248 dnl = Check for XShm
3249 dnl ========================================================
3250 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3252 AC_CHECK_HEADER(X11/extensions/XShm.h)
3253 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3254 test -n "$_HAVE_XSHM_XEXT"; then
3255 AC_DEFINE(HAVE_XSHM)
3258 dnl ========================================================
3260 dnl ========================================================
3261 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3263 AC_CHECK_HEADER(X11/extensions/XIElib.h)
3265 if test "$MOZ_XIE_LIBS"; then
3266 dnl ====================================================
3267 dnl = If XIE is present and is desired, turn it on
3268 dnl ====================================================
3278 LDFLAGS="$_SAVE_LDFLAGS"
3280 dnl ========================================================
3281 dnl = Check for freetype2 and its functionality
3282 dnl ========================================================
3283 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3285 if test "$_HAVE_FREETYPE2"; then
3287 _SAVE_CFLAGS="$CFLAGS"
3288 LIBS="$LIBS $FT2_LIBS"
3289 CFLAGS="$CFLAGS $FT2_CFLAGS"
3291 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3292 ac_cv_member_FT_Bitmap_Size_y_ppem,
3293 [AC_TRY_COMPILE([#include <ft2build.h>
3294 #include FT_FREETYPE_H],
3296 if (sizeof s.y_ppem) return 0;
3298 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3299 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3300 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3301 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3303 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3305 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3306 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3307 [FT_Bitmap_Size structure includes y_ppem field])
3309 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3312 CFLAGS="$_SAVE_CFLAGS"
3323 AC_MSG_CHECKING(for ARM SIMD support in compiler)
3325 [asm("uqadd8 r1, r1, r2");],
3326 result="yes", result="no")
3327 AC_MSG_RESULT("$result")
3328 if test "$result" = "yes"; then
3329 AC_DEFINE(HAVE_ARM_SIMD)
3332 AC_SUBST(HAVE_ARM_SIMD)
3334 AC_MSG_CHECKING(for ARM NEON support in compiler)
3335 _SAVE_CFLAGS="$CFLAGS"
3336 if test "$GNU_CC"; then
3337 # gcc needs -mfpu=neon to recognize NEON instructions
3338 CFLAGS="$CFLAGS -mfpu=neon"
3341 [asm("vadd.i8 d0, d0, d0");],
3342 result="yes", result="no")
3343 AC_MSG_RESULT("$result")
3344 if test "$result" = "yes"; then
3345 AC_DEFINE(HAVE_ARM_NEON)
3348 CFLAGS="$_SAVE_CFLAGS"
3349 AC_SUBST(HAVE_ARM_NEON)
3351 dnl ========================================================
3352 dnl = pthread support
3353 dnl = Start by checking whether the system support pthreads
3354 dnl ========================================================
3355 case "$target_os" in
3360 MOZ_CHECK_PTHREADS(pthreads,
3361 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3362 MOZ_CHECK_PTHREADS(pthread,
3363 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3364 MOZ_CHECK_PTHREADS(c_r,
3365 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3366 MOZ_CHECK_PTHREADS(c,
3375 dnl ========================================================
3376 dnl Check the command line for --with-pthreads
3377 dnl ========================================================
3378 MOZ_ARG_WITH_BOOL(pthreads,
3379 [ --with-pthreads Force use of system pthread library with NSPR ],
3380 [ if test "$USE_PTHREADS"x = x; then
3381 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3387 dnl ========================================================
3388 dnl Do the platform specific pthread hackery
3389 dnl ========================================================
3390 if test "$USE_PTHREADS"x != x
3393 dnl See if -pthread is supported.
3396 ac_cv_have_dash_pthread=no
3397 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3398 echo 'int main() { return 0; }' | cat > conftest.c
3399 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3400 if test $? -eq 0; then
3401 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3402 ac_cv_have_dash_pthread=yes
3403 case "$target_os" in
3405 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3408 CFLAGS="$CFLAGS -pthread"
3409 CXXFLAGS="$CXXFLAGS -pthread"
3415 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3418 dnl See if -pthreads is supported.
3420 ac_cv_have_dash_pthreads=no
3421 if test "$ac_cv_have_dash_pthread" = "no"; then
3422 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3423 echo 'int main() { return 0; }' | cat > conftest.c
3424 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3425 if test $? -eq 0; then
3426 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3427 ac_cv_have_dash_pthreads=yes
3428 CFLAGS="$CFLAGS -pthreads"
3429 CXXFLAGS="$CXXFLAGS -pthreads"
3433 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3438 AC_DEFINE(_REENTRANT)
3439 AC_DEFINE(_THREAD_SAFE)
3440 dnl -pthread links in -lc_r, so don't specify it explicitly.
3441 if test "$ac_cv_have_dash_pthread" = "yes"; then
3442 _PTHREAD_LDFLAGS="-pthread"
3444 _PTHREAD_LDFLAGS="-lc_r"
3448 *-*-openbsd*|*-*-bsdi*)
3449 AC_DEFINE(_REENTRANT)
3450 AC_DEFINE(_THREAD_SAFE)
3451 dnl -pthread links in -lc_r, so don't specify it explicitly.
3452 if test "$ac_cv_have_dash_pthread" = "yes"; then
3453 _PTHREAD_LDFLAGS="-pthread"
3457 *-*-linux*|*-*-kfreebsd*-gnu)
3458 AC_DEFINE(_REENTRANT)
3462 AC_DEFINE(_REENTRANT)
3466 AC_DEFINE(_REENTRANT)
3470 AC_DEFINE(_REENTRANT)
3474 AC_DEFINE(_REENTRANT)
3478 AC_DEFINE(_REENTRANT)
3479 if test "$SOLARIS_SUNPRO_CC"; then
3480 CFLAGS="$CFLAGS -mt"
3481 CXXFLAGS="$CXXFLAGS -mt"
3485 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3488 dnl ========================================================
3489 dnl See if mmap sees writes
3490 dnl For cross compiling, just define it as no, which is a safe default
3491 dnl ========================================================
3492 AC_MSG_CHECKING(whether mmap() sees write()s)
3498 #include <sys/mman.h>
3499 #include <sys/types.h>
3500 #include <sys/stat.h>
3503 char fname[] = "conftest.file";
3504 char zbuff[1024]; /* Fractional page is probably worst case */
3511 fd = open(fname, O_RDWR | O_CREAT, 0660);
3514 write(fd, zbuff, sizeof(zbuff));
3515 lseek(fd, 0, SEEK_SET);
3516 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3517 if(map==(char*)-1) return 2;
3518 for(i=0; fname[i]; i++) {
3519 int rc = write(fd, &fname[i], 1);
3520 if(map[i]!=fname[i]) return 4;
3527 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3529 AC_MSG_RESULT("$result")
3531 if test "$result" = "no"; then
3532 AC_DEFINE(MMAP_MISSES_WRITES)
3536 dnl Checks for library functions.
3537 dnl ========================================================
3538 AC_PROG_GCC_TRADITIONAL
3540 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3541 AC_CHECK_FUNCS(flockfile getpagesize)
3542 AC_CHECK_FUNCS(localtime_r strtok_r)
3544 dnl check for wcrtomb/mbrtowc
3545 dnl =======================================================================
3546 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3549 AC_CACHE_CHECK(for wcrtomb,
3551 [AC_TRY_LINK([#include <wchar.h>],
3552 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3553 ac_cv_have_wcrtomb="yes",
3554 ac_cv_have_wcrtomb="no")])
3555 if test "$ac_cv_have_wcrtomb" = "yes"; then
3556 AC_DEFINE(HAVE_WCRTOMB)
3558 AC_CACHE_CHECK(for mbrtowc,
3560 [AC_TRY_LINK([#include <wchar.h>],
3561 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3562 ac_cv_have_mbrtowc="yes",
3563 ac_cv_have_mbrtowc="no")])
3564 if test "$ac_cv_have_mbrtowc" = "yes"; then
3565 AC_DEFINE(HAVE_MBRTOWC)
3572 ac_cv_func_res_ninit,
3575 #define _BSD_SOURCE 1
3579 [int foo = res_ninit(&_res);],
3580 [ac_cv_func_res_ninit=yes],
3581 [ac_cv_func_res_ninit=no])
3584 if test "$ac_cv_func_res_ninit" = "yes"; then
3585 AC_DEFINE(HAVE_RES_NINIT)
3586 dnl must add the link line we do something as foolish as this... dougt
3588 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3589 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3594 [for gnu_get_libc_version()],
3595 ac_cv_func_gnu_get_libc_version,
3597 #ifdef HAVE_GNU_LIBC_VERSION_H
3598 #include <gnu/libc-version.h>
3601 [const char *glibc_version = gnu_get_libc_version();],
3602 [ac_cv_func_gnu_get_libc_version=yes],
3603 [ac_cv_func_gnu_get_libc_version=no]
3607 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3608 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3612 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3616 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3617 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3618 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3620 LIBS="$LIBS $_ICONV_LIBS"
3629 iconv_t h = iconv_open("", "");
3630 iconv(h, NULL, NULL, NULL, NULL);
3633 [ac_cv_func_iconv=yes],
3634 [ac_cv_func_iconv=no]
3637 if test "$ac_cv_func_iconv" = "yes"; then
3638 AC_DEFINE(HAVE_ICONV)
3639 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3640 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3641 LIBICONV="$_ICONV_LIBS"
3643 [for iconv() with const input],
3644 ac_cv_func_const_iconv,
3650 const char *input = "testing";
3651 iconv_t h = iconv_open("", "");
3652 iconv(h, &input, NULL, NULL, NULL);
3655 [ac_cv_func_const_iconv=yes],
3656 [ac_cv_func_const_iconv=no]
3659 if test "$ac_cv_func_const_iconv" = "yes"; then
3660 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3672 dnl **********************
3673 dnl *** va_copy checks ***
3674 dnl **********************
3675 dnl we currently check for all three va_copy possibilities, so we get
3676 dnl all results in config.log for bug reports.
3677 AC_MSG_CHECKING(for an implementation of va_copy())
3678 AC_CACHE_VAL(ac_cv_va_copy,[
3681 void f (int i, ...) {
3682 va_list args1, args2;
3683 va_start (args1, i);
3684 va_copy (args2, args1);
3685 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3687 va_end (args1); va_end (args2);
3689 int main() { f (0, 42); return 0; }],
3695 AC_MSG_RESULT($ac_cv_va_copy)
3696 AC_MSG_CHECKING(for an implementation of __va_copy())
3697 AC_CACHE_VAL(ac_cv___va_copy,[
3700 void f (int i, ...) {
3701 va_list args1, args2;
3702 va_start (args1, i);
3703 __va_copy (args2, args1);
3704 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3706 va_end (args1); va_end (args2);
3708 int main() { f (0, 42); return 0; }],
3709 ac_cv___va_copy=yes,
3714 AC_MSG_RESULT($ac_cv___va_copy)
3715 AC_MSG_CHECKING(whether va_lists can be copied by value)
3716 AC_CACHE_VAL(ac_cv_va_val_copy,[
3719 void f (int i, ...) {
3720 va_list args1, args2;
3721 va_start (args1, i);
3723 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3725 va_end (args1); va_end (args2);
3727 int main() { f (0, 42); return 0; }],
3728 ac_cv_va_val_copy=yes,
3729 ac_cv_va_val_copy=no,
3730 ac_cv_va_val_copy=yes
3733 if test "x$ac_cv_va_copy" = "xyes"; then
3734 AC_DEFINE(VA_COPY, va_copy)
3735 AC_DEFINE(HAVE_VA_COPY)
3736 elif test "x$ac_cv___va_copy" = "xyes"; then
3737 AC_DEFINE(VA_COPY, __va_copy)
3738 AC_DEFINE(HAVE_VA_COPY)
3741 if test "x$ac_cv_va_val_copy" = "xno"; then
3742 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3744 AC_MSG_RESULT($ac_cv_va_val_copy)
3746 dnl Check for dll-challenged libc's.
3747 dnl This check is apparently only needed for Linux.
3750 dnl ===================================================================
3753 rm -rf conftest* _conftest
3755 cat >> conftest.C <<\EOF
3760 void __dump_link_map(void) {
3761 struct link_map *map = _dl_loaded;
3762 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3765 dlopen("./conftest1.so",RTLD_LAZY);
3766 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3767 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3768 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3772 /* _dl_loaded isn't defined, so this should be either a libc5 (glibc1) system, or a glibc2 system that doesn't have the multiple load bug (i.e., RH6.0).*/
3773 int main() { printf("./conftest1.so\n"); }
3777 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3779 cat >> conftest1.C <<\EOF
3781 void foo(void) {printf("foo in dll called\n");}
3783 ${CXX-g++} -fPIC -c -g conftest1.C
3784 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3785 ${CXX-g++} -g conftest.C -o conftest -ldl
3786 cp -f conftest1.so conftest _conftest
3788 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3791 echo "*** Your libc has a bug that can result in loading the same dynamic"
3792 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3793 echo "*** or later. However, if you choose not to upgrade, the only effect"
3794 echo "*** will be excessive memory usage at runtime."
3798 rm -rf conftest* _conftest
3799 dnl ===================================================================
3803 dnl ===================================================================
3804 dnl ========================================================
3805 dnl By default, turn rtti and exceptions off on g++/egcs
3806 dnl ========================================================
3807 if test "$GNU_CXX"; then
3809 AC_MSG_CHECKING(for C++ exceptions flag)
3811 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3812 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3813 [echo "int main() { return 0; }" | cat > conftest.C
3815 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3817 if egrep "warning.*renamed" conftest.out >/dev/null; then
3818 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3820 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3825 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3826 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3827 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3830 dnl ========================================================
3831 dnl Put your C++ language/feature checks below
3832 dnl ========================================================
3836 if test "$GNU_CC"; then
3837 AC_CACHE_CHECK(for gcc 3.0 ABI,
3838 ac_cv_gcc_three_abi,
3841 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3847 ac_cv_gcc_three_abi="yes",
3848 ac_cv_gcc_three_abi="no")])
3849 if test "$ac_cv_gcc_three_abi" = "yes"; then
3850 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3853 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3856 AC_SUBST(HAVE_GCC3_ABI)
3859 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3861 [AC_TRY_COMPILE(class X {
3862 public: explicit X(int i) : i_(i) {}
3866 ac_cv_cpp_explicit=yes,
3867 ac_cv_cpp_explicit=no)])
3868 if test "$ac_cv_cpp_explicit" = yes ; then
3869 AC_DEFINE(HAVE_CPP_EXPLICIT)
3872 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3874 [AC_TRY_COMPILE(class param {
3876 typedef unsigned long num_type;
3879 template <class T> class tplt {
3881 typedef typename T::num_type t_num_type;
3882 t_num_type foo(typename T::num_type num) {
3888 ac_cv_cpp_typename=yes,
3889 ac_cv_cpp_typename=no)])
3890 if test "$ac_cv_cpp_typename" = yes ; then
3891 AC_DEFINE(HAVE_CPP_TYPENAME)
3894 dnl Check for support of modern template specialization syntax
3895 dnl Test code and requirement from scc@netscape.com.
3896 dnl Autoconf cut-and-paste job by waterson@netscape.com
3897 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3898 ac_cv_cpp_modern_specialize_template_syntax,
3899 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3901 template <> struct X<Y> { double a; };,
3904 ac_cv_cpp_modern_specialize_template_syntax=yes,
3905 ac_cv_cpp_modern_specialize_template_syntax=no)])
3906 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3907 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3911 dnl Some compilers support only full specialization, and some don't.
3912 AC_CACHE_CHECK(whether partial template specialization works,
3913 ac_cv_cpp_partial_specialization,
3914 [AC_TRY_COMPILE(template <class T> class Foo {};
3915 template <class T> class Foo<T*> {};,
3917 ac_cv_cpp_partial_specialization=yes,
3918 ac_cv_cpp_partial_specialization=no)])
3919 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3920 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3923 dnl Some compilers have limited support for operators with templates;
3924 dnl specifically, it is necessary to define derived operators when a base
3925 dnl class's operator declaration should suffice.
3926 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3927 ac_cv_need_derived_template_operators,
3928 [AC_TRY_COMPILE([template <class T> class Base { };
3930 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3931 template <class T> class Derived : public Base<T> { };],
3932 [Derived<char> a, b;
3933 Base<char> c = a + b;
3935 ac_cv_need_derived_template_operators=no,
3936 ac_cv_need_derived_template_operators=yes)])
3937 if test "$ac_cv_need_derived_template_operators" = yes ; then
3938 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3942 dnl Some compilers have trouble detecting that a template class
3943 dnl that derives from another template is actually an instance
3944 dnl of the base class. This test checks for that.
3945 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3946 ac_cv_need_cpp_template_cast_to_base,
3947 [AC_TRY_COMPILE([template <class T> class Base { };
3948 template <class T> class Derived : public Base<T> { };
3949 template <class T> int foo(const Base<T>&) { return 0; }],
3950 [Derived<char> bar; return foo(bar);],
3951 ac_cv_need_cpp_template_cast_to_base=no,
3952 ac_cv_need_cpp_template_cast_to_base=yes)])
3953 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3954 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3957 dnl Some compilers have trouble resolving the ambiguity between two
3958 dnl functions whose arguments differ only by cv-qualifications.
3959 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3960 ac_cv_can_resolve_const_ambiguity,
3962 template <class T> class ptrClass {
3966 template <class T> T* a(ptrClass<T> *arg) {
3971 const T* a(const ptrClass<T> *arg) {
3977 ac_cv_can_resolve_const_ambiguity=yes,
3978 ac_cv_can_resolve_const_ambiguity=no)])
3979 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3980 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3984 dnl We don't do exceptions on unix. The only reason this used to be here
3985 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3986 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3987 dnl So im commenting this out until someone writes some artificial
3988 dnl intelligence to detect not only if the compiler has exceptions, but if
3989 dnl they are enabled as well.
3991 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3992 dnl ac_cv_cpp_exceptions,
3993 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3994 dnl static void F() { throw X(); },
3995 dnl try { F(); } catch(X & e) { },
3996 dnl ac_cv_cpp_exceptions=yes,
3997 dnl ac_cv_cpp_exceptions=no)])
3998 dnl if test $ac_cv_cpp_exceptions = yes ; then
3999 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
4002 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
4003 dnl supports it well enough to allow us to use it to change access, but not
4004 dnl to resolve ambiguity. The next two tests determine how well the |using|
4005 dnl keyword is supported.
4007 dnl Check to see if we can change access with |using|. Test both a
4008 dnl legal and an illegal example.
4009 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
4010 ac_cv_cpp_access_changing_using2,
4012 class A { protected: int foo() { return 0; } };
4013 class B : public A { public: using A::foo; };,
4014 B b; return b.foo();,
4016 class A { public: int foo() { return 1; } };
4017 class B : public A { private: using A::foo; };,
4018 B b; return b.foo();,
4019 ac_cv_cpp_access_changing_using2=no,
4020 ac_cv_cpp_access_changing_using2=yes)],
4021 ac_cv_cpp_access_changing_using2=no)])
4022 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
4023 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
4026 dnl Check to see if we can resolve ambiguity with |using|.
4027 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
4028 ac_cv_cpp_ambiguity_resolving_using,
4029 [AC_TRY_COMPILE(class X {
4030 public: int go(const X&) {return 3;}
4031 int jo(const X&) {return 3;}
4033 class Y : public X {
4034 public: int go(int) {return 2;}
4035 int jo(int) {return 2;}
4037 private: using X::go;
4040 ac_cv_cpp_ambiguity_resolving_using=yes,
4041 ac_cv_cpp_ambiguity_resolving_using=no)])
4042 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
4043 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
4046 dnl Check to see if the |std| namespace is supported. If so, we'll want
4047 dnl to qualify any standard library calls with "std::" to ensure that
4048 dnl those functions can be resolved.
4049 AC_CACHE_CHECK(for \"std::\" namespace,
4050 ac_cv_cpp_namespace_std,
4051 [AC_TRY_COMPILE([#include <algorithm>],
4052 [return std::min(0, 1);],
4053 ac_cv_cpp_namespace_std=yes,
4054 ac_cv_cpp_namespace_std=no)])
4055 if test "$ac_cv_cpp_namespace_std" = yes ; then
4056 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
4059 dnl Older compilers are overly ambitious with respect to using the standard
4060 dnl template library's |operator!=()| when |operator==()| is defined. In
4061 dnl which case, defining |operator!=()| in addition to |operator==()| causes
4062 dnl ambiguity at compile-time. This test checks for that case.
4063 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
4064 ac_cv_cpp_unambiguous_std_notequal,
4065 [AC_TRY_COMPILE([#include <algorithm>
4067 int operator==(const T1&, const T1&) { return 0; }
4068 int operator!=(const T1&, const T1&) { return 0; }],
4069 [T1 a,b; return a != b;],
4070 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
4071 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
4072 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
4073 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
4077 AC_CACHE_CHECK(for C++ reinterpret_cast,
4078 ac_cv_cpp_reinterpret_cast,
4079 [AC_TRY_COMPILE(struct X { int i; };
4080 struct Y { int i; };,
4081 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
4082 ac_cv_cpp_reinterpret_cast=yes,
4083 ac_cv_cpp_reinterpret_cast=no)])
4084 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
4085 AC_DEFINE(HAVE_CPP_NEW_CASTS)
4088 dnl See if a dynamic_cast to void* gives the most derived object.
4089 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
4090 ac_cv_cpp_dynamic_cast_void_ptr,
4091 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
4092 class Y { int j; public: virtual ~Y() { } };
4093 class Z : public X, public Y { int k; };
4099 return !((((void*)&mdo != (void*)subx) &&
4100 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
4101 (((void*)&mdo != (void*)suby) &&
4102 ((void*)&mdo == dynamic_cast<void*>(suby))));
4104 ac_cv_cpp_dynamic_cast_void_ptr=yes,
4105 ac_cv_cpp_dynamic_cast_void_ptr=no,
4106 ac_cv_cpp_dynamic_cast_void_ptr=no)])
4107 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
4108 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
4112 dnl note that this one is reversed - if the test fails, then
4113 dnl we require implementations of unused virtual methods. Which
4114 dnl really blows because it means we'll have useless vtable
4116 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
4117 ac_cv_cpp_unused_required,
4118 [AC_TRY_LINK(class X {private: virtual void never_called();};,
4120 ac_cv_cpp_unused_required=no,
4121 ac_cv_cpp_unused_required=yes)])
4122 if test "$ac_cv_cpp_unused_required" = yes ; then
4123 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
4127 dnl Some compilers have trouble comparing a constant reference to a templatized
4128 dnl class to zero, and require an explicit operator==() to be defined that takes
4129 dnl an int. This test separates the strong from the weak.
4131 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
4132 ac_cv_trouble_comparing_to_zero,
4133 [AC_TRY_COMPILE([#include <algorithm>
4134 template <class T> class Foo {};
4136 template <class T> int operator==(const T2*, const T&) { return 0; }
4137 template <class T> int operator!=(const T2*, const T&) { return 0; }],
4138 [Foo<int> f; return (0 != f);],
4139 ac_cv_trouble_comparing_to_zero=no,
4140 ac_cv_trouble_comparing_to_zero=yes)])
4141 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
4142 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
4147 dnl End of C++ language/feature checks
4150 dnl ========================================================
4151 dnl = Internationalization checks
4152 dnl ========================================================
4154 dnl Internationalization and Locale support is different
4155 dnl on various UNIX platforms. Checks for specific i18n
4156 dnl features go here.
4158 dnl check for LC_MESSAGES
4159 AC_CACHE_CHECK(for LC_MESSAGES,
4160 ac_cv_i18n_lc_messages,
4161 [AC_TRY_COMPILE([#include <locale.h>],
4162 [int category = LC_MESSAGES;],
4163 ac_cv_i18n_lc_messages=yes,
4164 ac_cv_i18n_lc_messages=no)])
4165 if test "$ac_cv_i18n_lc_messages" = yes; then
4166 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
4169 fi # SKIP_COMPILER_CHECKS
4172 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
4173 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4176 dnl Mozilla specific options
4177 dnl ========================================================
4178 dnl The macros used for command line options
4179 dnl are defined in build/autoconf/altoptions.m4.
4182 dnl ========================================================
4184 dnl = Check for external package dependencies
4186 dnl ========================================================
4187 MOZ_ARG_HEADER(External Packages)
4191 MOZ_ARG_WITH_STRING(libxul-sdk,
4192 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4193 LIBXUL_SDK_DIR=$withval)
4195 if test "$LIBXUL_SDK_DIR" = "yes"; then
4196 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4197 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4198 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4200 if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
4201 AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
4206 AC_SUBST(LIBXUL_SDK)
4208 if test -n "$LIBXUL_SDK"; then
4209 LIBXUL_DIST="$LIBXUL_SDK"
4211 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4213 AC_SUBST(LIBXUL_DIST)
4217 MOZ_ARG_WITH_BOOL(system-libxul,
4218 [ --with-system-libxul Use system installed libxul SDK],
4221 if test -n "$SYSTEM_LIBXUL" && test -z "$MOZ_ENABLE_LIBXUL"; then
4222 AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4225 dnl ========================================================
4226 dnl = If NSPR was not detected in the system,
4227 dnl = use the one in the source tree (mozilla/nsprpub)
4228 dnl ========================================================
4229 MOZ_ARG_WITH_BOOL(system-nspr,
4230 [ --with-system-nspr Use system installed NSPR],
4231 _USE_SYSTEM_NSPR=1 )
4233 if test -n "$_USE_SYSTEM_NSPR"; then
4234 AM_PATH_NSPR(4.8.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
4237 if test -n "$MOZ_NATIVE_NSPR"; then
4238 _SAVE_CFLAGS=$CFLAGS
4239 CFLAGS="$CFLAGS $NSPR_CFLAGS"
4240 AC_TRY_COMPILE([#include "prlog.h"],
4241 [#ifndef PR_STATIC_ASSERT
4242 #error PR_STATIC_ASSERT not defined
4244 [MOZ_NATIVE_NSPR=1],
4245 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
4246 CFLAGS=$_SAVE_CFLAGS
4248 if test "$OS_ARCH" = "WINCE"; then
4249 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4250 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4251 elif test "$OS_ARCH" = "WINNT"; then
4252 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4253 if test -n "$GNU_CC"; then
4254 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4256 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4259 NSPR_CFLAGS='`$(LIBXUL_DIST)/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4260 NSPR_LIBS='`$(LIBXUL_DIST)/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4264 dnl ========================================================
4265 dnl = If NSS was not detected in the system,
4266 dnl = use the one in the source tree (mozilla/security/nss)
4267 dnl ========================================================
4269 MOZ_ARG_WITH_BOOL(system-nss,
4270 [ --with-system-nss Use system installed NSS],
4273 if test -n "$_USE_SYSTEM_NSS"; then
4274 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
4277 if test -n "$MOZ_NATIVE_NSS"; then
4278 NSS_LIBS="$NSS_LIBS -lcrmf"
4280 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4282 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4283 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4284 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4285 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4286 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX) \
4287 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
4289 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4291 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4292 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4293 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4294 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4295 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4296 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
4298 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
4302 if test -z "$SKIP_LIBRARY_CHECKS"; then
4303 dnl system JPEG support
4304 dnl ========================================================
4305 MOZ_ARG_WITH_STRING(system-jpeg,
4306 [ --with-system-jpeg[=PFX]
4307 Use system libjpeg [installed at prefix PFX]],
4310 _SAVE_CFLAGS=$CFLAGS
4311 _SAVE_LDFLAGS=$LDFLAGS
4313 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4314 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4315 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4317 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4320 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4323 if test "$SYSTEM_JPEG" = 1; then
4324 LIBS="$JPEG_LIBS $LIBS"
4325 AC_TRY_COMPILE([ #include <stdio.h>
4326 #include <sys/types.h>
4327 #include <jpeglib.h> ],
4328 [ #if JPEG_LIB_VERSION < $MOZJPEG
4329 #error "Insufficient JPEG library version ($MOZJPEG required)."
4332 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4334 CFLAGS=$_SAVE_CFLAGS
4335 LDFLAGS=$_SAVE_LDFLAGS
4338 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4339 JPEG_CFLAGS="-I${JPEG_DIR}/include"
4340 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4343 dnl system ZLIB support
4344 dnl ========================================================
4345 MOZ_ARG_WITH_STRING(system-zlib,
4346 [ --with-system-zlib[=PFX]
4347 Use system libz [installed at prefix PFX]],
4350 _SAVE_CFLAGS=$CFLAGS
4351 _SAVE_LDFLAGS=$LDFLAGS
4353 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4354 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4355 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4357 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4360 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4361 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4363 if test "$SYSTEM_ZLIB" = 1; then
4364 LIBS="$ZLIB_LIBS $LIBS"
4365 AC_TRY_COMPILE([ #include <stdio.h>
4367 #include <zlib.h> ],
4368 [ #if ZLIB_VERNUM < $MOZZLIB
4369 #error "Insufficient zlib version ($MOZZLIB required)."
4372 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4374 CFLAGS=$_SAVE_CFLAGS
4375 LDFLAGS=$_SAVE_LDFLAGS
4378 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4379 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4380 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4383 dnl system BZIP2 Support
4384 dnl ========================================================
4385 MOZ_ARG_WITH_STRING(system-bz2,
4386 [ --with-system-bz2[=PFX]
4387 Use system libbz2 [installed at prefix PFX]],
4390 _SAVE_CFLAGS=$CFLAGS
4391 _SAVE_LDFLAGS=$LDFLAGS
4393 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4394 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4395 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4397 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4400 AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4401 [SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
4403 CFLAGS=$_SAVE_CFLAGS
4404 LDFLAGS=$_SAVE_LDFLAGS
4407 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4408 BZ2_CFLAGS="-I${BZ2_DIR}/include"
4409 BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4412 dnl system PNG Support
4413 dnl ========================================================
4414 MOZ_ARG_WITH_STRING(system-png,
4415 [ --with-system-png[=PFX]
4416 Use system libpng [installed at prefix PFX]],
4419 _SAVE_CFLAGS=$CFLAGS
4420 _SAVE_LDFLAGS=$LDFLAGS
4422 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4423 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4424 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4425 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4426 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4428 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4431 _SAVE_PNG_LIBS=$PNG_LIBS
4432 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4433 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4435 AC_CHECK_LIB(png, png_get_acTL, ,
4436 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4439 if test "$SYSTEM_PNG" = 1; then
4440 LIBS="$PNG_LIBS $LIBS"
4441 AC_TRY_COMPILE([ #include <stdio.h>
4442 #include <sys/types.h>
4444 [ #if PNG_LIBPNG_VER < $MOZPNG
4445 #error "Insufficient libpng version ($MOZPNG required)."
4447 #ifndef PNG_UINT_31_MAX
4448 #error "Insufficient libpng version."
4451 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4453 CFLAGS=$_SAVE_CFLAGS
4454 LDFLAGS=$_SAVE_LDFLAGS
4457 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4458 PNG_CFLAGS="-I${PNG_DIR}/include"
4459 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4462 fi # SKIP_LIBRARY_CHECKS
4464 dnl system HunSpell Support
4465 dnl ========================================================
4466 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4467 [ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4470 if test -n "$SYSTEM_HUNSPELL"; then
4471 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4474 AC_SUBST(SYSTEM_HUNSPELL)
4476 dnl ========================================================
4477 dnl Java SDK support
4478 dnl ========================================================
4480 MOZ_ARG_WITH_STRING(java-include-path,
4481 [ --with-java-include-path=dir Location of Java SDK headers],
4482 JAVA_INCLUDE_PATH=$withval)
4485 MOZ_ARG_WITH_STRING(java-bin-path,
4486 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4487 JAVA_BIN_PATH=$withval)
4489 dnl ========================================================
4490 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4491 dnl their usage and use them in spidermonkey.
4492 dnl ========================================================
4493 MOZ_ARG_WITH_BOOL(arm-kuser,
4494 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4497 if test -n "$USE_ARM_KUSER"; then
4498 AC_DEFINE(USE_ARM_KUSER)
4501 dnl ========================================================
4505 dnl ========================================================
4507 MOZ_ARG_HEADER(Application)
4511 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4512 MOZ_BRANDING_DIRECTORY=
4513 MOZ_DBGRINFO_MODULES=
4515 MOZ_ENABLE_CANVAS3D=
4517 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon"
4518 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4525 MOZ_AUTH_EXTENSION=1
4526 MOZ_NO_ACTIVEX_SUPPORT=1
4527 MOZ_NO_INSPECTOR_APIS=
4528 MOZ_NO_XPCOM_OBSOLETE=
4536 MOZ_PLAINTEXT_EDITOR_ONLY=
4538 MOZ_PREF_EXTENSIONS=1
4539 MOZ_PROFILELOCKING=1
4541 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4543 MOZ_PYTHON_DEBUG_SUFFIX=
4544 MOZ_PYTHON_DLL_SUFFIX=
4545 MOZ_PYTHON_INCLUDES=
4549 MOZ_PYTHON_VER_DOTTED=
4556 MOZ_STATIC_MAIL_BUILD=
4561 MOZ_UNIVERSALCHARDET=1
4563 MOZ_USE_NATIVE_UCONV=
4565 MOZ_XPFE_COMPONENTS=1
4567 MOZ_XSLT_STANDALONE=
4575 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4576 NECKO_SMALL_BUFFERS=
4577 XPC_IDISPATCH_SUPPORT=
4580 case "$target_os" in
4589 case "$target_os" in
4590 msvc*|mks*|cygwin*|mingw*)
4591 if test -z "$GNU_CC"; then
4592 XPC_IDISPATCH_SUPPORT=1
4593 MOZ_NO_ACTIVEX_SUPPORT=
4598 MOZ_ARG_ENABLE_STRING(application,
4599 [ --enable-application=APP
4603 content/xslt (Standalone Transformiix XSLT)
4604 netwerk (Standalone Necko)
4605 tools/update-packaging (AUS-related packaging tools)
4606 standalone (use this for standalone
4607 xpcom/xpconnect or to manually drive a build)],
4608 [ MOZ_BUILD_APP=$enableval ] )
4610 MOZ_EMBEDDING_PROFILE=default
4611 MOZ_ARG_WITH_STRING(embedding-profile,
4612 [ --with-embedding-profile=default|basic|minimal
4613 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4614 [ MOZ_EMBEDDING_PROFILE=$withval ])
4616 case "$MOZ_EMBEDDING_PROFILE" in
4618 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4619 MOZ_EMBEDDING_LEVEL_BASIC=1
4620 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4621 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4622 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4623 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4627 MOZ_EMBEDDING_LEVEL_DEFAULT=
4628 MOZ_EMBEDDING_LEVEL_BASIC=1
4629 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4630 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4631 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4633 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4635 MOZ_ENABLE_POSTSCRIPT=
4636 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4637 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4638 MOZ_IMG_ENCODERS_DEFAULT=
4644 MOZ_NO_ACTIVEX_SUPPORT=1
4645 MOZ_NO_INSPECTOR_APIS=1
4646 MOZ_NO_XPCOM_OBSOLETE=1
4648 MOZ_PLAINTEXT_EDITOR_ONLY=1
4650 MOZ_PREF_EXTENSIONS=
4654 MOZ_UNIVERSALCHARDET=
4656 MOZ_USE_NATIVE_UCONV=
4658 MOZ_XPFE_COMPONENTS=
4663 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4664 NECKO_SMALL_BUFFERS=1
4665 NS_DISABLE_LOGGING=1
4670 MOZ_EMBEDDING_LEVEL_DEFAULT=
4671 MOZ_EMBEDDING_LEVEL_BASIC=
4672 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4673 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4675 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4677 MOZ_ENABLE_POSTSCRIPT=
4678 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4679 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4680 MOZ_IMG_ENCODERS_DEFAULT=
4686 MOZ_NO_ACTIVEX_SUPPORT=1
4687 MOZ_NO_INSPECTOR_APIS=1
4688 MOZ_NO_XPCOM_OBSOLETE=1
4690 MOZ_PLAINTEXT_EDITOR_ONLY=1
4692 MOZ_PREF_EXTENSIONS=
4698 MOZ_UNIVERSALCHARDET=
4700 MOZ_USE_NATIVE_UCONV=1
4702 MOZ_XPFE_COMPONENTS=
4709 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4710 NECKO_SMALL_BUFFERS=1
4711 NS_DISABLE_LOGGING=1
4716 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4720 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4721 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4722 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4724 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4725 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4726 XULRUNNER_STUB_NAME=$withval)
4728 if test -z "$XULRUNNER_STUB_NAME"; then
4729 case "$target_os" in
4731 XULRUNNER_STUB_NAME=xulrunner
4734 XULRUNNER_STUB_NAME=xulrunner-stub
4737 AC_SUBST(XULRUNNER_STUB_NAME)
4739 if test -z "$MOZ_BUILD_APP"; then
4740 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4742 # We have a valid application only if it has a build.mk file in its top
4744 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4745 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4749 # Allow the application to influence configure with a confvars.sh script.
4751 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4752 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4753 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4754 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4759 # Now is a good time to test for logic errors, define mismatches, etc.
4760 case "$MOZ_BUILD_APP" in
4762 if test "$LIBXUL_SDK"; then
4763 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4768 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4769 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4771 case "$MOZ_BUILD_APP" in
4773 AC_DEFINE(MOZ_PHOENIX)
4777 AC_DEFINE(MOZ_XULRUNNER)
4785 MOZ_APP_NAME=mozilla
4786 MOZ_APP_DISPLAYNAME=Mozilla
4787 MOZ_APP_VERSION=$MOZILLA_VERSION
4792 AC_SUBST(MOZ_BUILD_APP)
4793 AC_SUBST(MOZ_PHOENIX)
4794 AC_SUBST(MOZ_XULRUNNER)
4796 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4798 dnl ========================================================
4800 dnl = Toolkit Options
4802 dnl ========================================================
4803 MOZ_ARG_HEADER(Toolkit Options)
4805 dnl ========================================================
4806 dnl = Select the default toolkit
4807 dnl ========================================================
4808 MOZ_ARG_ENABLE_STRING(default-toolkit,
4809 [ --enable-default-toolkit=TK
4810 Select default toolkit
4811 Platform specific defaults:
4813 Mac OS X - cairo-cocoa
4814 Neutrino/QNX - photon
4816 Win32/WinCE - cairo-windows
4817 Gtk2 with DirectFB - cairo-gtk2-dfb
4820 [ _DEFAULT_TOOLKIT=$enableval ],
4821 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4823 if test "$_DEFAULT_TOOLKIT" = "photon" \
4824 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4825 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4826 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
4827 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4828 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4829 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4830 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4831 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4833 dnl nglayout only supports building with one toolkit,
4834 dnl so ignore everything after the first comma (",").
4835 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4837 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4840 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4842 dnl ========================================================
4843 dnl = Enable the toolkit as needed =
4844 dnl ========================================================
4846 case "$MOZ_WIDGET_TOOLKIT" in
4849 AC_DEFINE(MOZ_WIDGET_PHOTON)
4853 MOZ_WIDGET_TOOLKIT=windows
4854 MOZ_GFX_TOOLKIT=cairo
4857 cairo-gtk2|cairo-gtk2-x11)
4858 MOZ_WIDGET_TOOLKIT=gtk2
4859 MOZ_GFX_TOOLKIT=cairo
4861 MOZ_ENABLE_XREMOTE=1
4866 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4867 TK_LIBS='$(MOZ_GTK2_LIBS)'
4868 AC_DEFINE(MOZ_WIDGET_GTK2)
4872 MOZ_WIDGET_TOOLKIT=gtk2
4873 MOZ_GFX_TOOLKIT=cairo
4879 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4880 TK_LIBS='$(MOZ_GTK2_LIBS)'
4881 AC_DEFINE(MOZ_WIDGET_GTK2)
4882 if test "$no_x" != "yes"; then
4883 AC_MSG_WARN([Disabling X when DirectFB is specified.])
4889 MOZ_WIDGET_TOOLKIT=qt
4890 MOZ_GFX_TOOLKIT=cairo
4892 MOZ_ENABLE_XREMOTE=1
4899 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4900 TK_LIBS='$(MOZ_QT_LIBS)'
4901 AC_DEFINE(MOZ_WIDGET_QT)
4905 MOZ_WIDGET_TOOLKIT=beos
4906 MOZ_GFX_TOOLKIT=cairo
4907 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4908 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4912 MOZ_WIDGET_TOOLKIT=os2
4913 MOZ_GFX_TOOLKIT=cairo
4914 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4915 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4919 MOZ_WIDGET_TOOLKIT=cocoa
4920 AC_DEFINE(MOZ_WIDGET_COCOA)
4922 MOZ_GFX_TOOLKIT=cairo
4923 MOZ_USER_DIR="Mozilla"
4924 AC_DEFINE(XP_MACOSX)
4925 AC_DEFINE(TARGET_CARBON)
4926 AC_DEFINE(TARGET_API_MAC_CARBON)
4927 TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
4928 TK_CFLAGS="-DNO_X11"
4929 LDFLAGS="$LDFLAGS -framework Cocoa"
4930 CFLAGS="$CFLAGS $TK_CFLAGS"
4931 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4932 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
4933 MOZ_FS_LAYOUT=bundle
4937 if test "$MOZ_ENABLE_XREMOTE"; then
4938 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4941 if test "$COMPILE_ENVIRONMENT"; then
4942 if test "$MOZ_ENABLE_GTK2"; then
4943 if test "$MOZ_X11"; then
4944 GDK_PACKAGES=gdk-x11-2.0
4945 elif test "$MOZ_DFB"; then
4946 PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
4947 GDK_PACKAGES=directfb
4950 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4953 fi # COMPILE_ENVIRONMENT
4955 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4956 AC_SUBST(MOZ_FS_LAYOUT)
4958 dnl ========================================================
4959 dnl = startup-notification support module
4960 dnl ========================================================
4962 if test "$MOZ_ENABLE_GTK2"
4964 MOZ_ENABLE_STARTUP_NOTIFICATION=
4966 MOZ_ARG_ENABLE_BOOL(startup-notification,
4967 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4968 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4969 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4970 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4972 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4973 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4974 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4975 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4977 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4979 MOZ_ENABLE_STARTUP_NOTIFICATION=
4983 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4984 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4987 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4989 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4990 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4991 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4993 dnl ========================================================
4995 dnl ========================================================
4996 if test "$MOZ_ENABLE_QT"
4998 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtUiTools QtCore)
4999 AC_SUBST(MOZ_QT_CFLAGS)
5000 AC_SUBST(MOZ_QT_LIBS)
5002 MOZ_ARG_WITH_STRING(qtdir,
5003 [ --with-qtdir=\$dir Specify Qt directory ],
5006 if test -z "$QTDIR"; then
5009 QTINCDIR="/include/qt"
5010 if test ! -d "$QTDIR$QTINCDIR"; then
5011 QTINCDIR="/include/X11/qt"
5013 if test ! -d "$QTDIR$QTINCDIR"; then
5017 if test -x "$QTDIR/bin/moc-qt4"; then
5018 HOST_MOC="$QTDIR/bin/moc-qt4"
5020 if test -x "$QTDIR/bin/moc"; then
5021 HOST_MOC="$QTDIR/bin/moc"
5023 AC_CHECK_PROGS(HOST_MOC, moc, "")
5026 if test -z "$HOST_MOC"; then
5027 AC_MSG_ERROR([no acceptable moc preprocessor found])
5032 AC_SUBST(GTK_CONFIG)
5036 AC_SUBST(MOZ_ENABLE_GTK2)
5037 AC_SUBST(MOZ_ENABLE_PHOTON)
5038 AC_SUBST(MOZ_ENABLE_COCOA)
5039 AC_SUBST(MOZ_ENABLE_QT)
5040 AC_SUBST(MOZ_ENABLE_XREMOTE)
5041 AC_SUBST(MOZ_GTK2_CFLAGS)
5042 AC_SUBST(MOZ_GTK2_LIBS)
5043 AC_SUBST(MOZ_QT_CFLAGS)
5044 AC_SUBST(MOZ_QT_LIBS)
5051 dnl ========================================================
5053 dnl = Components & Features
5055 dnl ========================================================
5056 MOZ_ARG_HEADER(Components and Features)
5058 dnl ========================================================
5060 dnl ========================================================
5061 MOZ_ARG_ENABLE_STRING(ui-locale,
5062 [ --enable-ui-locale=ab-CD
5063 Select the user interface locale (default: en-US)],
5064 MOZ_UI_LOCALE=$enableval )
5065 AC_SUBST(MOZ_UI_LOCALE)
5067 dnl ========================================================
5068 dnl = Trademarked Branding
5069 dnl ========================================================
5070 MOZ_ARG_ENABLE_BOOL(official-branding,
5071 [ --enable-official-branding Enable Official mozilla.org Branding
5072 Do not distribute builds with
5073 --enable-official-branding unless you have
5074 permission to use trademarks per
5075 http://www.mozilla.org/foundation/trademarks/ .],
5076 [case "$MOZ_BUILD_APP" in
5078 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
5079 MOZ_APP_DISPLAYNAME=Firefox
5083 AC_MSG_ERROR([Official branding is only available for Firefox.])
5087 MOZ_ARG_WITH_STRING(branding,
5088 [ --with-branding=dir Use branding from the specified directory.],
5089 MOZ_BRANDING_DIRECTORY=$withval)
5091 dnl For Firefox, we always want MOZ_BRANDING_DIRECTORY to point somewhere, so
5092 dnl if it's not set make it point to the default branding location now. Other
5093 dnl products need MOZ_BRANDING_DIRECTORY to NOT be set, in order to use their
5094 dnl default branding (ie, only set it when using non-default branding).
5095 if test "$MOZ_BUILD_APP" = "browser" -a -z "$MOZ_BRANDING_DIRECTORY"; then
5096 MOZ_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5099 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
5100 if test -z "$REAL_BRANDING_DIRECTORY"; then
5101 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5104 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
5105 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
5108 AC_SUBST(MOZ_BRANDING_DIRECTORY)
5110 dnl ========================================================
5111 dnl = Distribution ID
5112 dnl ========================================================
5113 MOZ_ARG_WITH_STRING(distribution-id,
5114 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
5115 [ val=`echo $withval`
5116 MOZ_DISTRIBUTION_ID="$val"])
5118 if test -z "$MOZ_DISTRIBUTION_ID"; then
5119 MOZ_DISTRIBUTION_ID="org.mozilla"
5122 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
5123 AC_SUBST(MOZ_DISTRIBUTION_ID)
5126 dnl ========================================================
5127 dnl complex text support off by default
5128 dnl ========================================================
5130 MOZ_ARG_DISABLE_BOOL(pango,
5131 [ --disable-pango Disable usage of Pango ],
5136 dnl ========================================================
5138 dnl ========================================================
5139 if test "$MOZ_ENABLE_GTK2"
5143 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5145 if test "$MOZ_PANGO"
5147 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5148 AC_SUBST(MOZ_PANGO_CFLAGS)
5149 AC_SUBST(MOZ_PANGO_LIBS)
5150 AC_DEFINE(MOZ_PANGO)
5152 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5153 AC_SUBST(MOZ_PANGO_CFLAGS)
5154 AC_SUBST(MOZ_PANGO_LIBS)
5156 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5157 AC_SUBST(FT2_CFLAGS)
5162 dnl ========================================================
5163 dnl = PostScript print module
5164 dnl ========================================================
5165 MOZ_ARG_DISABLE_BOOL(postscript,
5166 [ --disable-postscript Disable PostScript printing support ],
5167 MOZ_ENABLE_POSTSCRIPT=,
5168 MOZ_ENABLE_POSTSCRIPT=1 )
5170 dnl ========================================================
5171 dnl = GnomeVFS support module
5172 dnl ========================================================
5176 dnl build the gnomevfs extension by default only when the
5177 dnl GTK2 toolkit is in use.
5178 if test "$MOZ_ENABLE_GTK2"
5180 MOZ_ENABLE_GNOMEVFS=1
5184 MOZ_ARG_DISABLE_BOOL(gnomevfs,
5185 [ --disable-gnomevfs Disable GnomeVFS support ],
5186 MOZ_ENABLE_GNOMEVFS=,
5187 MOZ_ENABLE_GNOMEVFS=force)
5189 if test "$MOZ_ENABLE_GNOMEVFS"
5191 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5192 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5193 MOZ_ENABLE_GNOMEVFS=1
5195 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5197 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5199 MOZ_ENABLE_GNOMEVFS=
5203 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
5204 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5205 AC_SUBST(MOZ_GNOMEVFS_LIBS)
5207 if test "$MOZ_ENABLE_GCONF"
5209 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
5210 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5217 if test "$MOZ_ENABLE_GCONF"; then
5218 AC_DEFINE(MOZ_ENABLE_GCONF)
5221 AC_SUBST(MOZ_ENABLE_GCONF)
5222 AC_SUBST(MOZ_GCONF_CFLAGS)
5223 AC_SUBST(MOZ_GCONF_LIBS)
5225 # The GNOME component is built if gtk2, gconf and gnome-vfs
5226 # are all available.
5228 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
5229 "$MOZ_ENABLE_GNOMEVFS"; then
5230 MOZ_ENABLE_GNOME_COMPONENT=1
5232 MOZ_ENABLE_GNOME_COMPONENT=
5235 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5238 dnl ========================================================
5239 dnl = libgnomeui support module
5240 dnl ========================================================
5242 if test "$MOZ_ENABLE_GTK2"
5244 MOZ_ENABLE_GNOMEUI=1
5246 MOZ_ARG_DISABLE_BOOL(gnomeui,
5247 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5248 MOZ_ENABLE_GNOMEUI=,
5249 MOZ_ENABLE_GNOMEUI=force)
5251 if test "$MOZ_ENABLE_GNOMEUI"
5253 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5255 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5256 MOZ_ENABLE_GNOMEUI=1
5258 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5260 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5266 if test "$MOZ_ENABLE_GNOMEUI"; then
5267 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5270 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5271 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5272 AC_SUBST(MOZ_GNOMEUI_LIBS)
5274 dnl ========================================================
5276 dnl ========================================================
5278 if test "$MOZ_ENABLE_GTK2" || test "$MOZ_ENABLE_QT"
5282 MOZ_ARG_DISABLE_BOOL(dbus,
5283 [ --disable-dbus Disable dbus support ],
5287 if test "$MOZ_ENABLE_DBUS"
5289 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5290 AC_DEFINE(MOZ_ENABLE_DBUS)
5293 AC_SUBST(MOZ_ENABLE_DBUS)
5294 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5295 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5297 dnl ========================================================
5298 dnl = libnotify support
5299 dnl ========================================================
5301 if test "$MOZ_ENABLE_GTK2"
5303 MOZ_ENABLE_LIBNOTIFY=1
5305 MOZ_ARG_DISABLE_BOOL(libnotify,
5306 [ --disable-libnotify Disable libnotify support ],
5307 MOZ_ENABLE_LIBNOTIFY=,
5308 MOZ_ENABLE_LIBNOTIFY=1)
5310 if test "$MOZ_ENABLE_LIBNOTIFY"
5312 AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5316 if test -z "$SKIP_LIBRARY_CHECKS"
5318 if test "$MOZ_ENABLE_GTK2"
5320 if test "$MOZ_ENABLE_LIBNOTIFY"
5322 PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5326 AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5327 AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5328 AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5330 dnl ========================================================
5331 dnl = Build Personal Security Manager
5332 dnl ========================================================
5333 MOZ_ARG_DISABLE_BOOL(crypto,
5334 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5338 dnl ========================================================
5339 dnl = JS Debugger XPCOM component (js/jsd)
5340 dnl ========================================================
5341 MOZ_ARG_DISABLE_BOOL(jsd,
5342 [ --disable-jsd Disable JavaScript debug library],
5347 dnl ========================================================
5348 dnl = Disable plugin support
5349 dnl ========================================================
5350 MOZ_ARG_DISABLE_BOOL(plugins,
5351 [ --disable-plugins Disable plugins support],
5355 dnl ========================================================
5356 dnl = Disable building dbm
5357 dnl ========================================================
5358 MOZ_ARG_DISABLE_BOOL(dbm,
5359 [ --disable-dbm Disable building dbm],
5363 dnl bi-directional support always on
5367 dnl ========================================================
5368 dnl view source support on by default
5369 dnl ========================================================
5370 MOZ_ARG_DISABLE_BOOL(view-source,
5371 [ --disable-view-source Disable view source support],
5374 if test "$MOZ_VIEW_SOURCE"; then
5375 AC_DEFINE(MOZ_VIEW_SOURCE)
5379 dnl ========================================================
5380 dnl accessibility support on by default on all platforms
5382 dnl ========================================================
5383 MOZ_ARG_DISABLE_BOOL(accessibility,
5384 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5387 if test "$ACCESSIBILITY"; then
5388 AC_DEFINE(ACCESSIBILITY)
5391 if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5393 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5394 if test "$ac_cv_header_atlbase_h" = "no"; then
5395 AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
5397 if test "$ac_cv_header_oleacc_idl" = "no"; then
5398 AC_MSG_ERROR([System header oleacc.idl is not available. See http://developer.mozilla.org/en/docs/oleacc.idl for details on fixing this problem.])
5404 dnl ========================================================
5405 dnl xpfe/components on by default
5406 dnl ========================================================
5407 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5408 [ --disable-xpfe-components
5409 Disable xpfe components],
5410 MOZ_XPFE_COMPONENTS=,
5411 MOZ_XPFE_COMPONENTS=1 )
5413 dnl ========================================================
5414 dnl xpinstall support on by default
5415 dnl ========================================================
5416 MOZ_ARG_DISABLE_BOOL(xpinstall,
5417 [ --disable-xpinstall Disable xpinstall support],
5420 if test "$MOZ_XPINSTALL"; then
5421 AC_DEFINE(MOZ_XPINSTALL)
5424 dnl ========================================================
5425 dnl xpcom js loader support on by default
5426 dnl ========================================================
5427 MOZ_ARG_DISABLE_BOOL(jsloader,
5428 [ --disable-jsloader Disable xpcom js loader support],
5431 if test "$MOZ_JSLOADER"; then
5432 AC_DEFINE(MOZ_JSLOADER)
5435 dnl ========================================================
5436 dnl Disable printing
5437 dnl ========================================================
5438 MOZ_ARG_DISABLE_BOOL(printing,
5439 [ --disable-printing Disable printing support],
5443 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
5444 AC_MSG_WARN([Printing does not work with Qt at this time. Omitting printing support.])
5448 if test "$NS_PRINTING"; then
5449 AC_DEFINE(NS_PRINTING)
5450 AC_DEFINE(NS_PRINT_PREVIEW)
5453 dnl ========================================================
5454 dnl use native unicode converters
5455 dnl ========================================================
5456 MOZ_ARG_ENABLE_BOOL(native-uconv,
5457 [ --enable-native-uconv Enable iconv support],
5458 MOZ_USE_NATIVE_UCONV=1,
5459 MOZ_USE_NATIVE_UCONV= )
5460 if test "$MOZ_USE_NATIVE_UCONV"; then
5461 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5463 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5464 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5468 dnl ========================================================
5469 dnl Libeditor can be build as plaintext-only,
5470 dnl or as a full html and text editing component.
5471 dnl We build both by default.
5472 dnl ========================================================
5473 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5474 [ --enable-plaintext-editor-only
5475 Allow only plaintext editing],
5476 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5477 MOZ_PLAINTEXT_EDITOR_ONLY= )
5478 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5479 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5481 dnl ========================================================
5482 dnl = Drop XPCOM Obsolete library
5483 dnl ========================================================
5484 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5485 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5486 MOZ_NO_XPCOM_OBSOLETE=1,
5487 MOZ_NO_XPCOM_OBSOLETE=)
5489 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5490 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5493 dnl ========================================================
5494 dnl = Disable Fast Load
5495 dnl ========================================================
5496 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5497 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5501 AC_SUBST(MOZ_NO_FAST_LOAD)
5503 if test -n "$MOZ_NO_FAST_LOAD"; then
5504 AC_DEFINE(MOZ_NO_FAST_LOAD)
5507 dnl ========================================================
5508 dnl = Disable Ogg Codecs
5509 dnl ========================================================
5510 MOZ_ARG_DISABLE_BOOL(ogg,
5511 [ --disable-ogg Disable Ogg Codec support],
5517 if test -n "$MOZ_OGG"; then
5522 dnl Checks for __attribute__(aligned()) directive
5523 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5524 [ac_cv_c_attribute_aligned],
5525 [ac_cv_c_attribute_aligned=0
5526 CFLAGS_save="${CFLAGS}"
5527 CFLAGS="${CFLAGS} -Werror"
5528 for ac_cv_c_attr_align_try in 64 32 16 8; do
5529 echo "trying $ac_cv_c_attr_align_try"
5531 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5532 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5533 if test "$ac_cv_c_attribute_aligned" != 0; then
5537 CFLAGS="${CFLAGS_save}"])
5538 if test "${ac_cv_c_attribute_aligned}" != "0"; then
5539 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5540 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5544 dnl ========================================================
5545 dnl = Disable Wave decoder support
5546 dnl ========================================================
5547 MOZ_ARG_DISABLE_BOOL(wave,
5548 [ --disable-wave Disable Wave decoder support],
5554 if test -n "$MOZ_WAVE"; then
5560 dnl ========================================================
5561 dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
5562 dnl ========================================================
5564 AC_SUBST(MOZ_SYDNEYAUDIO)
5566 if test -n "$MOZ_SYDNEYAUDIO"; then
5567 AC_DEFINE(MOZ_SYDNEYAUDIO)
5572 if test -n "$MOZ_MEDIA"; then
5573 AC_DEFINE(MOZ_MEDIA)
5576 dnl ========================================================
5577 dnl = Check alsa availability on Linux if using sydneyaudio
5578 dnl ========================================================
5580 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5581 if test "$COMPILE_ENVIRONMENT"; then
5582 if test -n "$MOZ_SYDNEYAUDIO"; then
5583 case "$target_os" in
5585 AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
5591 dnl ========================================================
5593 dnl ========================================================
5594 AC_ARG_ENABLE(splashscreen,
5595 [ --enable-splashscreen display splashscreen while loading (default=no)],
5596 [enable_splash="yes"],[enable_splash=""])
5597 if test "x$enable_splash" = "xyes"; then
5599 AC_DEFINE(MOZ_SPLASHSCREEN)
5601 AC_SUBST(MOZ_SPLASHSCREEN)
5603 dnl ========================================================
5604 dnl Permissions System
5605 dnl ========================================================
5606 MOZ_ARG_DISABLE_BOOL(permissions,
5607 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5612 dnl ========================================================
5614 dnl ========================================================
5615 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5616 [ --disable-negotiateauth Disable GSS-API negotiation ],
5617 MOZ_AUTH_EXTENSION=,
5618 MOZ_AUTH_EXTENSION=1 )
5620 dnl ========================================================
5622 dnl ========================================================
5623 MOZ_ARG_DISABLE_BOOL(xtf,
5624 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5627 if test "$MOZ_XTF"; then
5631 dnl ========================================================
5633 dnl ========================================================
5634 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5635 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5636 MOZ_NO_INSPECTOR_APIS=1,
5637 MOZ_NO_INSPECTOR_APIS= )
5639 dnl ========================================================
5640 dnl Pref extensions (autoconfig and system-pref)
5641 dnl ========================================================
5642 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5643 [ --disable-pref-extensions
5644 Disable pref extensions such as autoconfig and
5646 MOZ_PREF_EXTENSIONS=,
5647 MOZ_PREF_EXTENSIONS=1 )
5649 dnl ========================================================
5650 dnl = Universalchardet
5651 dnl ========================================================
5652 MOZ_ARG_DISABLE_BOOL(universalchardet,
5653 [ --disable-universalchardet
5654 Disable universal encoding detection],
5655 MOZ_UNIVERSALCHARDET=,
5656 MOZ_UNIVERSALCHARDET=1 )
5658 dnl ========================================================
5660 dnl ========================================================
5661 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5662 [ --enable-javaxpcom
5663 Enable Java-XPCOM bridge],
5667 if test -n "${MOZ_JAVAXPCOM}"; then
5670 if test -n "$JAVA_HOME"; then
5671 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5675 if test -n "$JAVA_HOME"; then
5676 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5681 if test -n "${JAVA_INCLUDE_PATH}"; then
5682 dnl Make sure jni.h exists in the given include path.
5683 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5684 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5687 case "$target_os" in
5689 dnl Default to java system location
5690 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5694 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5697 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5698 AC_MSG_ERROR([The header jni.h was not found. Set \$JAVA_HOME to your java sdk directory, use --with-java-bin-path={java-bin-dir}, or reconfigure with --disable-javaxpcom.])
5702 if test -n "${JAVA_BIN_PATH}"; then
5703 dnl Look for javac and jar in the specified path.
5704 JAVA_PATH="$JAVA_BIN_PATH"
5706 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5707 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5710 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5711 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5712 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5713 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5714 AC_MSG_ERROR([The programs java, javac and jar were not found. Set \$JAVA_HOME to your java sdk directory, use --with-java-bin-path={java-bin-dir}, or reconfigure with --disable-javaxpcom.])
5718 dnl ========================================================
5719 dnl = Breakpad crash reporting (on by default on supported platforms)
5720 dnl ========================================================
5722 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5723 || test "$OS_ARCH" = "Darwin" \
5724 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
5725 || test "$OS_ARCH" = "SunOS") \
5726 && test -z "$HAVE_64BIT_OS"; then
5730 MOZ_ARG_DISABLE_BOOL(crashreporter,
5731 [ --disable-crashreporter Disable breakpad crash reporting],
5733 MOZ_CRASHREPORTER=1)
5735 if test -n "$MOZ_CRASHREPORTER"; then
5736 AC_DEFINE(MOZ_CRASHREPORTER)
5738 if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
5739 test -z "$SKIP_LIBRARY_CHECKS"; then
5740 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5741 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5742 AC_SUBST(MOZ_GTHREAD_LIBS)
5744 AC_CHECK_HEADERS([curl/curl.h], [], [AC_MSG_ERROR([Couldn't find curl/curl.h which is required for the crash reporter. Use --disable-crashreporter to disable the crash reporter.])])
5748 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5749 [ --with-crashreporter-enable-percent=NN Enable sending crash reports by default on NN% of users. (default=100)],
5750 [ val=`echo $withval | sed 's/[^0-9]//g'`
5751 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5753 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5754 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5756 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5758 dnl ========================================================
5759 dnl = Enable compilation of specific extension modules
5760 dnl ========================================================
5762 MOZ_ARG_ENABLE_STRING(extensions,
5763 [ --enable-extensions Enable extensions],
5764 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5765 if test "$option" = "yes" || test "$option" = "all"; then
5766 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5767 elif test "$option" = "no" || test "$option" = "none"; then
5769 elif test "$option" = "default"; then
5770 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5771 elif test `echo "$option" | grep -c \^-` != 0; then
5772 option=`echo $option | sed 's/^-//'`
5773 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5775 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5778 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5780 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5781 # Suppress warning on non-X11 platforms
5782 if test -n "$MOZ_X11"; then
5783 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5785 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5788 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5789 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5790 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5793 dnl This might be temporary: build tridentprofile only on Windows
5794 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5795 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5796 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5799 dnl cookie must be built before tridentprofile. put it at list's end.
5800 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5801 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5802 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5805 dnl xforms requires xtf and schema-validation
5806 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5807 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5808 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5810 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5811 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5812 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5815 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5816 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5817 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5820 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5821 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5822 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5825 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5826 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5827 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5830 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5831 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5832 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5835 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5836 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5837 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5840 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5841 AC_MSG_WARN([spellcheck is no longer an extension.])
5842 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5845 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5846 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5847 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5851 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5853 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5854 dnl when trying to build a non-existent extension.
5855 for extension in $MOZ_EXTENSIONS; do
5856 if test ! -d "${srcdir}/extensions/${extension}"; then
5857 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5862 dnl ========================================================
5864 dnl ========================================================
5865 case "$MOZ_WIDGET_TOOLKIT" in
5866 beos|windows|os2|mac|cocoa)
5869 if test -z "$MOZ_ENABLE_GTK2" && test -z "$MOZ_ENABLE_QT"; then
5870 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5875 MOZ_ARG_ENABLE_STRING(image-decoders,
5876 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5877 Enable specific image decoders],
5878 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5879 if test "$option" = "yes" || test "$option" = "all"; then
5880 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5881 elif test "$option" = "no" || test "$option" = "none"; then
5883 elif test "$option" = "default"; then
5884 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5885 elif test `echo "$option" | grep -c \^-` != 0; then
5886 option=`echo $option | sed 's/^-//'`
5887 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5889 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5892 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5894 dnl Dupes are removed in the encoder section because it will also add decoders
5896 dnl ========================================================
5898 dnl ========================================================
5899 MOZ_ARG_ENABLE_STRING(image-encoders,
5900 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5901 Enable specific image encoders],
5902 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5903 if test "$option" = "yes" || test "$option" = "all"; then
5904 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5905 elif test "$option" = "no" || test "$option" = "none"; then
5908 elif test "$option" = "default"; then
5909 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5910 elif test `echo "$option" | grep -c \^-` != 0; then
5911 option=`echo $option | sed 's/^-//'`
5912 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5914 addencoder="$option"
5916 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5918 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5921 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5922 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5924 dnl ========================================================
5925 dnl MathML on by default
5926 dnl ========================================================
5927 MOZ_ARG_DISABLE_BOOL(mathml,
5928 [ --disable-mathml Disable MathML support],
5931 if test "$MOZ_MATHML"; then
5932 AC_DEFINE(MOZ_MATHML)
5935 dnl ========================================================
5937 dnl ========================================================
5938 MOZ_ARG_DISABLE_BOOL(canvas,
5939 [ --disable-canvas Disable html:canvas feature],
5941 MOZ_ENABLE_CANVAS=1 )
5942 if test -n "$MOZ_ENABLE_CANVAS"; then
5943 AC_DEFINE(MOZ_ENABLE_CANVAS)
5945 AC_SUBST(MOZ_ENABLE_CANVAS)
5947 MOZ_ARG_ENABLE_BOOL(canvas3d,
5948 [ --enable-canvas3d Enable canvas 3D context],
5949 MOZ_ENABLE_CANVAS3D=1,
5950 MOZ_ENABLE_CANVAS3D= )
5951 if test -n "$MOZ_ENABLE_CANVAS3D"; then
5952 AC_DEFINE(MOZ_ENABLE_CANVAS3D)
5954 AC_SUBST(MOZ_ENABLE_CANVAS3D)
5956 dnl ========================================================
5958 dnl ========================================================
5959 MOZ_ARG_DISABLE_BOOL(svg,
5960 [ --disable-svg Disable SVG support],
5963 if test -n "$MOZ_SVG"; then
5967 dnl ========================================================
5969 dnl ========================================================
5971 MOZ_ARG_DISABLE_BOOL(smil,
5972 [ --disable-smil Disable SMIL animation support],
5975 # Automatically disable SMIL if SVG is disabled
5976 if test -z "$MOZ_SVG"; then
5979 if test -n "$MOZ_SMIL"; then
5983 dnl ========================================================
5984 dnl Build Freetype in the tree
5985 dnl ========================================================
5986 MOZ_ARG_ENABLE_BOOL(tree-freetype,
5987 [ --enable-tree-freetype Enable Tree FreeType],
5988 MOZ_TREE_FREETYPE=1,
5989 MOZ_TREE_FREETYPE= )
5990 if test -n "$MOZ_TREE_FREETYPE"; then
5991 AC_DEFINE(MOZ_TREE_FREETYPE)
5992 AC_SUBST(MOZ_TREE_FREETYPE)
5993 MOZ_ENABLE_CAIRO_FT=1
5994 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
5995 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5996 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5997 FT2_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5998 CAIRO_FT_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5999 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
6000 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
6001 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
6002 AC_SUBST(CAIRO_FT_CFLAGS)
6006 dnl ========================================================
6008 dnl ========================================================
6009 case "$target_os" in
6010 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6015 MOZ_ARG_DISABLE_BOOL(installer,
6016 [ --disable-installer Disable building of installer],
6019 if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
6020 # Disable installer for Windows builds that use the new toolkit if NSIS
6021 # isn't in the path.
6022 MOZ_PATH_PROGS(MAKENSIS, makensis)
6023 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
6024 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
6026 # The Windows build for NSIS requires the iconv command line utility to
6027 # convert the charset of the locale files.
6028 MOZ_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
6029 if test -z "$HOST_ICONV"; then
6030 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
6034 # Automatically disable installer if xpinstall isn't built
6035 if test -z "$MOZ_XPINSTALL"; then
6038 AC_SUBST(MOZ_INSTALLER)
6040 AC_MSG_CHECKING([for tar archiver])
6041 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6042 if test -z "$TAR"; then
6043 AC_MSG_ERROR([no tar archiver found in \$PATH])
6045 AC_MSG_RESULT([$TAR])
6048 AC_MSG_CHECKING([for wget])
6049 AC_CHECK_PROGS(WGET, wget, "")
6050 AC_MSG_RESULT([$WGET])
6053 dnl ========================================================
6055 dnl ========================================================
6057 MOZ_ARG_DISABLE_BOOL(updater,
6058 [ --disable-updater Disable building of updater],
6061 AC_SUBST(MOZ_UPDATER)
6063 # app update channel is 'default' when not supplied.
6064 MOZ_ARG_ENABLE_STRING([update-channel],
6065 [ --enable-update-channel=CHANNEL
6066 Select application update channel (default=default)],
6067 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6069 if test -z "$MOZ_UPDATE_CHANNEL"; then
6070 MOZ_UPDATE_CHANNEL=default
6072 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6074 # tools/update-packaging is not checked out by default.
6075 MOZ_ARG_ENABLE_BOOL(update-packaging,
6076 [ --enable-update-packaging
6077 Enable tools/update-packaging],
6078 MOZ_UPDATE_PACKAGING=1,
6079 MOZ_UPDATE_PACKAGING= )
6080 AC_SUBST(MOZ_UPDATE_PACKAGING)
6082 dnl ========================================================
6084 dnl ========================================================
6086 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
6087 [ --disable-xpconnect-idispatch
6088 Disable building of xpconnect support for IDispatch
6090 XPC_IDISPATCH_SUPPORT=,
6091 XPC_IDISPATCH_SUPPORT=1)
6092 AC_SUBST(XPC_IDISPATCH_SUPPORT)
6094 MOZ_ARG_DISABLE_BOOL(activex,
6095 [ --disable-activex Disable building of ActiveX control (win32 only)],
6096 MOZ_NO_ACTIVEX_SUPPORT=1,
6097 MOZ_NO_ACTIVEX_SUPPORT= )
6098 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
6100 MOZ_ARG_ENABLE_BOOL(activex-scripting,
6101 [ --enable-activex-scripting
6102 Enable building of ActiveX scripting support (win32)],
6103 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1,
6104 MOZ_ACTIVEX_SCRIPTING_SUPPORT=)
6105 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
6107 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
6109 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
6112 if test "$COMPILE_ENVIRONMENT" = "1"; then
6113 if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
6115 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
6116 if test "$ac_cv_header_atlbase_h" = "no"; then
6117 AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
6124 dnl ========================================================
6126 dnl ========================================================
6127 MOZ_ARG_ENABLE_BOOL(leaky,
6128 [ --enable-leaky Build leaky memory tool],
6133 dnl ========================================================
6135 dnl ========================================================
6136 MOZ_ARG_ENABLE_BOOL(xpctools,
6137 [ --enable-xpctools Build JS profiling tool],
6142 dnl ========================================================
6143 dnl build the tests by default
6144 dnl ========================================================
6145 MOZ_ARG_DISABLE_BOOL(tests,
6146 [ --disable-tests Do not build test libraries & programs],
6150 dnl ========================================================
6151 dnl parental controls (for Windows Vista)
6152 dnl ========================================================
6153 MOZ_ARG_DISABLE_BOOL(parental-controls,
6154 [ --disable-parental-controls
6155 Do not build parental controls],
6156 MOZ_DISABLE_PARENTAL_CONTROLS=1,
6157 MOZ_DISABLE_PARENTAL_CONTROLS=)
6158 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6159 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6162 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6164 dnl ========================================================
6166 dnl = Module specific options
6168 dnl ========================================================
6169 MOZ_ARG_HEADER(Individual module options)
6171 dnl ========================================================
6172 dnl = Enable Lea malloc in xpcom. OFF by default.
6173 dnl ========================================================
6174 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
6175 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
6178 if test -n "$XPCOM_USE_LEA"; then
6179 AC_DEFINE(XPCOM_USE_LEA)
6182 dnl ========================================================
6183 dnl = Enable places (new history/bookmarks)
6184 dnl ========================================================
6185 MOZ_ARG_ENABLE_BOOL(places,
6186 [ --enable-places Enable 'places' bookmark/history implementation],
6189 if test -n "$MOZ_PLACES"; then
6190 AC_DEFINE(MOZ_PLACES)
6191 if test -z "$MOZ_MAIL_NEWS"; then
6196 if test "$MOZ_BUILD_APP" = "browser"; then
6197 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
6201 dnl ========================================================
6202 dnl = Disable feed handling components
6203 dnl ========================================================
6204 MOZ_ARG_DISABLE_BOOL(feeds,
6205 [ --disable-feeds Disable feed handling and processing components],
6208 if test -n "$MOZ_FEEDS"; then
6209 AC_DEFINE(MOZ_FEEDS)
6211 if test "$MOZ_BUILD_APP" = "browser"; then
6212 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6216 dnl ========================================================
6217 dnl = Enable mozStorage
6218 dnl ========================================================
6219 dnl Implicitly enabled by default if building calendar or places
6220 MOZ_ARG_ENABLE_BOOL(storage,
6221 [ --enable-storage Enable mozStorage module and related components],
6224 if test -n "$MOZ_STORAGE"; then
6225 AC_DEFINE(MOZ_STORAGE)
6228 dnl ========================================================
6229 dnl Check for sqlite
6230 dnl ========================================================
6233 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6234 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6235 MOZ_NATIVE_SQLITE=1,
6236 MOZ_NATIVE_SQLITE= )
6238 if test -z "$MOZ_NATIVE_SQLITE"
6241 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
6243 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6246 AC_SUBST(MOZ_NATIVE_SQLITE)
6248 dnl ========================================================
6249 dnl = Enable help viewer (off by default)
6250 dnl ========================================================
6251 MOZ_ARG_ENABLE_BOOL(help-viewer,
6252 [ --enable-help-viewer Enable help viewer],
6255 if test -n "$MOZ_HELP_VIEWER"; then
6256 AC_DEFINE(MOZ_HELP_VIEWER)
6258 AC_SUBST(MOZ_HELP_VIEWER)
6259 if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
6260 AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
6263 dnl ========================================================
6264 dnl = Enable safe browsing (anti-phishing)
6265 dnl ========================================================
6266 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6267 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6268 MOZ_SAFE_BROWSING=1,
6269 MOZ_SAFE_BROWSING= )
6270 if test -n "$MOZ_SAFE_BROWSING"; then
6271 AC_DEFINE(MOZ_SAFE_BROWSING)
6273 AC_SUBST(MOZ_SAFE_BROWSING)
6275 dnl ========================================================
6276 dnl = Enable url-classifier
6277 dnl ========================================================
6278 dnl Implicitly enabled by default if building with safe-browsing
6279 if test -n "$MOZ_SAFE_BROWSING"; then
6280 MOZ_URL_CLASSIFIER=1
6282 MOZ_ARG_ENABLE_BOOL(url-classifier,
6283 [ --enable-url-classifier Enable url classifier module],
6284 MOZ_URL_CLASSIFIER=1,
6285 MOZ_URL_CLASSIFIER= )
6286 if test -n "$MOZ_URL_CLASSIFIER"; then
6287 AC_DEFINE(MOZ_URL_CLASSIFIER)
6289 AC_SUBST(MOZ_URL_CLASSIFIER)
6291 dnl ========================================================
6292 dnl = Disable zipwriter
6293 dnl ========================================================
6294 MOZ_ARG_DISABLE_BOOL(zipwriter,
6295 [ --disable-zipwriter Disable zipwriter component],
6298 AC_SUBST(MOZ_ZIPWRITER)
6300 dnl ========================================================
6301 dnl = Hildon and OSSO checks
6302 dnl ========================================================
6303 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime,
6304 MOZ_PLATFORM_HILDON=1,
6305 MOZ_PLATFORM_HILDON=)
6306 if test $MOZ_PLATFORM_HILDON; then
6307 AC_DEFINE(MOZ_PLATFORM_HILDON)
6308 X11_COMPOSITED_PLUGINS="yes"
6310 AC_SUBST(LIBHILDONMIME_CFLAGS)
6311 AC_SUBST(LIBHILDONMIME_LIBS)
6313 if test "$X11_COMPOSITED_PLUGINS" = "yes"; then
6314 dnl if we have Xcomposite we should also have Xdamage and Xfixes
6315 AC_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6316 [AC_MSG_ERROR([Couldn't find X11/extentsions/Xdamage.h which is required for composited plugins.])])
6317 AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6318 [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6320 AC_SUBST(XCOMPOSITE_LIBS)
6322 PKG_CHECK_MODULES(LIBOSSO,libosso,
6326 if test $NS_OSSO; then
6327 if test -z "$MOZ_ENABLE_DBUS"; then
6328 AC_MSG_ERROR([DBus is required when building for OSSO])
6331 MOZ_GFX_OPTIMIZE_MOBILE=1
6333 AC_SUBST(LIBOSSO_CFLAGS)
6334 AC_SUBST(LIBOSSO_LIBS)
6336 PKG_CHECK_MODULES(MOZ_LOCATION, [liblocation gpsbt],
6337 NS_MAEMO_LOCATION=1,
6340 if test $NS_MAEMO_LOCATION; then
6341 AC_DEFINE(NS_MAEMO_LOCATION)
6344 AC_SUBST(MOZ_LOCATION_CFLAGS)
6345 AC_SUBST(MOZ_LOCATION_LIBS)
6347 dnl ========================================================
6348 dnl = faststripe theme
6349 dnl ========================================================
6350 MOZ_ARG_ENABLE_BOOL(faststripe,
6351 [ --enable-faststripe Use faststripe theme],
6352 MOZ_THEME_FASTSTRIPE=1,
6353 MOZ_THEME_FASTSTRIPE= )
6354 AC_SUBST(MOZ_THEME_FASTSTRIPE)
6356 dnl ========================================================
6358 dnl = Feature options that require extra sources to be pulled
6360 dnl ========================================================
6361 dnl MOZ_ARG_HEADER(Features that require extra sources)
6363 dnl ========================================================
6365 dnl = Debugging Options
6367 dnl ========================================================
6368 MOZ_ARG_HEADER(Debugging and Optimizations)
6370 dnl ========================================================
6371 dnl = Disable building with debug info.
6372 dnl = Debugging is OFF by default
6373 dnl ========================================================
6374 if test -z "$MOZ_DEBUG_FLAGS"
6378 if test "$GNU_CC"; then
6379 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
6380 case "$GCC_VERSION" in
6385 MOZ_DEBUG_FLAGS="-g"
6389 MOZ_DEBUG_FLAGS="-g"
6393 MOZ_DEBUG_FLAGS="-g"
6398 MOZ_ARG_ENABLE_STRING(debug,
6399 [ --enable-debug[=DBG] Enable building with developer debug info
6400 (Using compiler flags DBG)],
6401 [ if test "$enableval" != "no"; then
6403 if test -n "$enableval" && test "$enableval" != "yes"; then
6404 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6411 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
6412 case "${target_os}" in
6414 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
6416 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6417 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
6420 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
6423 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
6425 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6427 if test -n "$MOZ_DEBUG"; then
6428 AC_MSG_CHECKING([for valid debug flags])
6429 _SAVE_CFLAGS=$CFLAGS
6430 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6431 AC_TRY_COMPILE([#include <stdio.h>],
6432 [printf("Hello World\n");],
6435 AC_MSG_RESULT([$_results])
6436 if test "$_results" = "no"; then
6437 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6439 CFLAGS=$_SAVE_CFLAGS
6442 dnl ========================================================
6443 dnl enable mobile optimizations
6444 dnl ========================================================
6445 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6446 [ --enable-mobile-optimize Enable mobile optimizations],
6447 MOZ_GFX_OPTIMIZE_MOBILE=1)
6449 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6451 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6452 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6455 dnl ========================================================
6456 dnl = Enable code optimization. ON by default.
6457 dnl ========================================================
6458 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6459 MOZ_OPTIMIZE_FLAGS="-O"
6462 MOZ_ARG_ENABLE_STRING(optimize,
6463 [ --disable-optimize Disable compiler optimization
6464 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6465 [ if test "$enableval" != "no"; then
6467 if test -n "$enableval" && test "$enableval" != "yes"; then
6468 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6473 fi ], MOZ_OPTIMIZE=1)
6475 if test "$COMPILE_ENVIRONMENT"; then
6476 if test -n "$MOZ_OPTIMIZE"; then
6477 AC_MSG_CHECKING([for valid optimization flags])
6478 _SAVE_CFLAGS=$CFLAGS
6479 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6480 AC_TRY_COMPILE([#include <stdio.h>],
6481 [printf("Hello World\n");],
6484 AC_MSG_RESULT([$_results])
6485 if test "$_results" = "no"; then
6486 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6488 CFLAGS=$_SAVE_CFLAGS
6490 fi # COMPILE_ENVIRONMENT
6492 AC_SUBST(MOZ_OPTIMIZE)
6493 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6494 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6495 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6497 dnl ========================================================
6498 dnl = Enable/disable debug for specific modules only
6499 dnl = module names beginning with ^ will be disabled
6500 dnl ========================================================
6501 MOZ_ARG_ENABLE_STRING(debug-modules,
6502 [ --enable-debug-modules Enable/disable debug info for specific modules],
6503 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6505 dnl ========================================================
6506 dnl = Enable/disable generation of debugger info for specific modules only
6507 dnl = the special module name ALL_MODULES can be used to denote all modules
6508 dnl = module names beginning with ^ will be disabled
6509 dnl ========================================================
6510 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6511 [ --enable-debugger-info-modules
6512 Enable/disable debugger info for specific modules],
6513 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6514 dnl note that the list of module names is reversed as it is copied
6515 dnl this is important, as it will allow config.mk to interpret stuff like
6516 dnl "^ALL_MODULES xpcom" properly
6517 if test "$i" = "no"; then
6520 if test "$i" = "yes"; then
6523 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6526 dnl ========================================================
6527 dnl Enable garbage collector
6528 dnl ========================================================
6529 MOZ_ARG_ENABLE_BOOL(boehm,
6530 [ --enable-boehm Enable the Boehm Garbage Collector],
6533 if test -n "$GC_LEAK_DETECTOR"; then
6534 AC_DEFINE(GC_LEAK_DETECTOR)
6537 dnl ========================================================
6538 dnl Disable runtime logging checks
6539 dnl ========================================================
6540 MOZ_ARG_DISABLE_BOOL(logging,
6541 [ --disable-logging Disable logging facilities],
6542 NS_DISABLE_LOGGING=1,
6543 NS_DISABLE_LOGGING= )
6544 if test "$NS_DISABLE_LOGGING"; then
6545 AC_DEFINE(NS_DISABLE_LOGGING)
6547 AC_DEFINE(MOZ_LOGGING)
6550 dnl ========================================================
6551 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6552 dnl ========================================================
6553 _ENABLE_LOGREFCNT=42
6554 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6555 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6556 _ENABLE_LOGREFCNT=1,
6557 _ENABLE_LOGREFCNT= )
6558 if test "$_ENABLE_LOGREFCNT" = "1"; then
6559 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6560 elif test -z "$_ENABLE_LOGREFCNT"; then
6561 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6564 dnl ========================================================
6565 dnl = Enable trace malloc
6566 dnl ========================================================
6567 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6568 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6569 [ --enable-trace-malloc Enable malloc tracing],
6572 if test "$NS_TRACE_MALLOC"; then
6573 # Please, Mr. Linker Man, don't take away our symbol names
6574 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6576 AC_DEFINE(NS_TRACE_MALLOC)
6578 AC_SUBST(NS_TRACE_MALLOC)
6580 dnl ========================================================
6581 dnl = Enable jemalloc
6582 dnl ========================================================
6583 MOZ_ARG_ENABLE_BOOL(jemalloc,
6584 [ --enable-jemalloc Replace memory allocator with jemalloc],
6588 if test "$NS_TRACE_MALLOC"; then
6592 if test "$MOZ_MEMORY"; then
6594 dnl Don't try to run compiler tests on Windows
6595 if test "$OS_ARCH" = "WINNT"; then
6596 if test -z "$HAVE_64BIT_OS"; then
6597 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6599 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6602 AC_CHECK_SIZEOF([int *], [4])
6603 case "${ac_cv_sizeof_int_p}" in
6605 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6608 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6611 AC_MSG_ERROR([Unexpected pointer size])
6616 AC_DEFINE(MOZ_MEMORY)
6617 if test "x$MOZ_DEBUG" = "x1"; then
6618 AC_DEFINE(MOZ_MEMORY_DEBUG)
6620 dnl The generic feature tests that determine how to compute ncpus are long and
6621 dnl complicated. Therefore, simply define special cpp variables for the
6622 dnl platforms we have special knowledge of.
6623 case "${target_os}" in
6625 AC_DEFINE(MOZ_MEMORY_DARWIN)
6628 AC_DEFINE(MOZ_MEMORY_BSD)
6631 AC_DEFINE(MOZ_MEMORY_LINUX)
6634 AC_DEFINE(MOZ_MEMORY_BSD)
6637 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6639 msvc*|mks*|cygwin*|mingw*)
6640 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6641 dnl This is sort of awful. Will revisit if we add support for more versions
6642 if test "$CC_VERSION" != "14.00.50727.762"; then
6643 AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 currently.])
6645 if test -z "$WIN32_CRT_SRC_DIR"; then
6646 if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6647 AC_MSG_ERROR([When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you).])
6649 WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6653 if test ! -d "$WIN32_CRT_SRC_DIR"; then
6654 AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
6656 WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
6657 _objdir_win=`pwd -W`
6658 WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/intel"
6659 dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6660 AC_DEFINE(_STATIC_CPPLIB)
6661 MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -DEFAULTLIB:mozcrt19"
6662 dnl Also pass this to NSPR/NSS
6663 DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
6667 AC_DEFINE(MOZ_MEMORY_WINCE)
6668 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6669 if test -z "$WINCE_WINDOWS_MOBILE"; then
6670 AC_DEFINE(MOZ_MEMORY_WINCE6)
6674 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6678 AC_SUBST(MOZ_MEMORY)
6679 AC_SUBST(MOZ_MEMORY_LDFLAGS)
6680 AC_SUBST(WIN32_CRT_SRC_DIR)
6681 dnl Need to set this for make because NSS doesn't have configure
6684 dnl ========================================================
6685 dnl = Use malloc wrapper lib
6686 dnl ========================================================
6687 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6688 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6692 if test -n "$_WRAP_MALLOC"; then
6693 if test "$GNU_CC"; then
6694 WRAP_MALLOC_CFLAGS="${LDFLAGS} -Wl,--wrap -Wl,malloc -Wl,--wrap -Wl,free -Wl,--wrap -Wl,realloc -Wl,--wrap -Wl,__builtin_new -Wl,--wrap -Wl,__builtin_vec_new -Wl,--wrap -Wl,__builtin_delete -Wl,--wrap -Wl,__builtin_vec_delete -Wl,--wrap -Wl,PR_Free -Wl,--wrap -Wl,PR_Malloc -Wl,--wrap -Wl,PR_Calloc -Wl,--wrap -Wl,PR_Realloc"
6695 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6699 dnl ========================================================
6700 dnl = Location of malloc wrapper lib
6701 dnl ========================================================
6702 MOZ_ARG_WITH_STRING(wrap-malloc,
6703 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6704 WRAP_MALLOC_LIB=$withval)
6706 dnl ========================================================
6708 dnl ========================================================
6709 MOZ_ARG_ENABLE_BOOL(valgrind,
6710 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
6713 if test -n "$MOZ_VALGRIND"; then
6714 AC_CHECK_HEADER([valgrind/valgrind.h], [],
6716 [--enable-valgrind specified but Valgrind is not installed]))
6717 AC_DEFINE(MOZ_VALGRIND)
6720 dnl ========================================================
6721 dnl = Use Electric Fence
6722 dnl ========================================================
6723 MOZ_ARG_ENABLE_BOOL(efence,
6724 [ --enable-efence Link with Electric Fence],
6727 if test -n "$_ENABLE_EFENCE"; then
6728 AC_CHECK_LIB(efence,malloc)
6731 dnl ========================================================
6733 dnl ========================================================
6734 MOZ_ARG_ENABLE_BOOL(jprof,
6735 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6738 if test -n "$MOZ_JPROF"; then
6739 AC_DEFINE(MOZ_JPROF)
6742 dnl ========================================================
6744 dnl ========================================================
6745 MOZ_ARG_ENABLE_BOOL(shark,
6746 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6749 if test -n "$MOZ_SHARK"; then
6750 AC_DEFINE(MOZ_SHARK)
6753 dnl ========================================================
6755 dnl ========================================================
6756 MOZ_ARG_ENABLE_BOOL(callgrind,
6757 [ --enable-callgrind Enable callgrind profiling],
6760 if test -n "$MOZ_CALLGRIND"; then
6761 AC_DEFINE(MOZ_CALLGRIND)
6764 dnl ========================================================
6766 dnl ========================================================
6767 MOZ_ARG_ENABLE_BOOL(vtune,
6768 [ --enable-vtune Enable vtune profiling],
6771 if test -n "$MOZ_VTUNE"; then
6772 AC_DEFINE(MOZ_VTUNE)
6775 dnl ========================================================
6776 dnl Zealous JavaScript GC
6777 dnl ========================================================
6778 MOZ_ARG_ENABLE_BOOL(gczeal,
6779 [ --enable-gczeal Enable zealous JavaScript GCing],
6782 if test -n "$JS_GC_ZEAL"; then
6783 AC_DEFINE(JS_GC_ZEAL)
6786 dnl ========================================================
6787 dnl = Enable static checking using gcc-dehydra
6788 dnl ========================================================
6790 MOZ_ARG_WITH_STRING(static-checking,
6791 [ --with-static-checking=path/to/gcc_dehydra.so
6792 Enable static checking of code using GCC-dehydra],
6793 DEHYDRA_PATH=$withval,
6796 if test -n "$DEHYDRA_PATH"; then
6797 if test ! -f "$DEHYDRA_PATH"; then
6798 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
6800 AC_DEFINE(NS_STATIC_CHECKING)
6802 AC_SUBST(DEHYDRA_PATH)
6804 dnl ========================================================
6805 dnl = Enable stripping of libs & executables
6806 dnl ========================================================
6807 MOZ_ARG_ENABLE_BOOL(strip,
6808 [ --enable-strip Enable stripping of libs & executables ],
6812 dnl ========================================================
6813 dnl = Enable stripping of libs & executables when packaging
6814 dnl ========================================================
6815 MOZ_ARG_ENABLE_BOOL(install-strip,
6816 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6820 dnl ========================================================
6821 dnl = --enable-elf-dynstr-gc
6822 dnl ========================================================
6823 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6824 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6825 USE_ELF_DYNSTR_GC=1,
6826 USE_ELF_DYNSTR_GC= )
6828 dnl ========================================================
6829 dnl = --enable-old-abi-compat-wrappers
6830 dnl ========================================================
6831 dnl on x86 linux, the current builds of some popular plugins (notably
6832 dnl flashplayer and real) expect a few builtin symbols from libgcc
6833 dnl which were available in some older versions of gcc. However,
6834 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6835 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6836 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6837 dnl to true on x86 linux, and false everywhere else.
6840 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6841 [ --enable-old-abi-compat-wrappers
6842 Support old GCC ABI symbols to ease the pain
6843 of the linux compiler change],
6844 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6845 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6846 if test "$COMPILE_ENVIRONMENT"; then
6847 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6850 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6852 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6854 fi # COMPILE_ENVIRONMENT
6856 dnl ========================================================
6858 dnl = Profiling and Instrumenting
6860 dnl ========================================================
6861 MOZ_ARG_HEADER(Profiling and Instrumenting)
6863 dnl ========================================================
6864 dnl = Enable timeline service, which provides lightweight
6865 dnl = instrumentation of mozilla for performance measurement.
6866 dnl = Timeline is off by default.
6867 dnl ========================================================
6868 MOZ_ARG_ENABLE_BOOL(timeline,
6869 [ --enable-timeline Enable timeline services ],
6872 if test -n "$MOZ_TIMELINE"; then
6873 AC_DEFINE(MOZ_TIMELINE)
6876 dnl ========================================================
6877 dnl Turn on reflow counting
6878 dnl ========================================================
6879 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6880 [ --enable-reflow-perf Enable reflow performance tracing],
6883 if test -n "$MOZ_REFLOW_PERF"; then
6884 AC_DEFINE(MOZ_REFLOW_PERF)
6887 dnl ========================================================
6888 dnl Enable performance metrics.
6889 dnl ========================================================
6890 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6891 [ --enable-perf-metrics Enable performance metrics],
6894 if test -n "$MOZ_PERF_METRICS"; then
6895 AC_DEFINE(MOZ_PERF_METRICS)
6898 dnl ========================================================
6899 dnl Enable code size metrics.
6900 dnl ========================================================
6901 MOZ_ARG_ENABLE_BOOL(codesighs,
6902 [ --enable-codesighs Enable code size analysis tools],
6903 _ENABLE_CODESIGHS=1,
6904 _ENABLE_CODESIGHS= )
6905 if test -n "$_ENABLE_CODESIGHS"; then
6906 if test -d $srcdir/tools/codesighs; then
6909 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6913 dnl ========================================================
6914 dnl = Add support for Eazel profiler
6915 dnl ========================================================
6916 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6917 [ --enable-eazel-profiler-support
6918 Enable Corel/Eazel profiler support],
6919 ENABLE_EAZEL_PROFILER=1,
6920 ENABLE_EAZEL_PROFILER= )
6921 if test -n "$ENABLE_EAZEL_PROFILER"; then
6922 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6924 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6925 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6926 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6929 MOZ_ARG_ENABLE_STRING(profile-modules,
6930 [ --enable-profile-modules
6931 Enable/disable profiling for specific modules],
6932 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6934 MOZ_ARG_ENABLE_BOOL(insure,
6935 [ --enable-insure Enable insure++ instrumentation (linux only)],
6938 if test -n "$_ENABLE_INSURE"; then
6942 MOZ_INSURE_EXCLUDE_DIRS="config"
6945 MOZ_ARG_WITH_STRING(insure-dirs,
6946 [ --with-insure-dirs=DIRS
6947 Dirs to instrument with insure ],
6948 MOZ_INSURE_DIRS=$withval )
6950 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6951 [ --with-insure-exclude-dirs=DIRS
6952 Dirs to not instrument with insure ],
6953 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6955 dnl ========================================================
6956 dnl = Support for Quantify (Windows)
6957 dnl ========================================================
6958 MOZ_ARG_ENABLE_BOOL(quantify,
6959 [ --enable-quantify Enable Quantify support (Windows only) ],
6963 dnl ========================================================
6964 dnl = Support for demangling undefined symbols
6965 dnl ========================================================
6966 if test -z "$SKIP_LIBRARY_CHECKS"; then
6969 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6973 # Demangle only for debug or trace-malloc builds
6974 MOZ_DEMANGLE_SYMBOLS=
6975 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6976 MOZ_DEMANGLE_SYMBOLS=1
6977 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6979 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6981 dnl ========================================================
6982 dnl = Support for gcc stack unwinding (from gcc 3.3)
6983 dnl ========================================================
6984 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6985 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6988 dnl ========================================================
6992 dnl ========================================================
6993 MOZ_ARG_HEADER(Misc. Options)
6995 dnl ========================================================
6996 dnl update xterm title
6997 dnl ========================================================
6998 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6999 [ --enable-xterm-updates Update XTERM titles with current command.],
7003 dnl =========================================================
7005 dnl =========================================================
7006 MOZ_ARG_ENABLE_STRING([chrome-format],
7007 [ --enable-chrome-format=jar|flat|both|symlink
7008 Select FORMAT of chrome files (default=jar)],
7009 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7011 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7012 MOZ_CHROME_FILE_FORMAT=jar
7015 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
7016 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7017 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7018 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
7019 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
7022 dnl ========================================================
7023 dnl = Define default location for MOZILLA_FIVE_HOME
7024 dnl ========================================================
7025 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7026 [ --with-default-mozilla-five-home
7027 Set the default value for MOZILLA_FIVE_HOME],
7028 [ val=`echo $withval`
7029 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7031 dnl ========================================================
7032 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7033 dnl ========================================================
7034 MOZ_ARG_WITH_STRING(user-appdir,
7035 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7036 [ val=`echo $withval`
7037 if echo "$val" | grep "\/" >/dev/null; then
7038 AC_MSG_ERROR("Homedir must be single relative path.")
7043 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7045 dnl ========================================================
7046 dnl = Doxygen configuration
7047 dnl ========================================================
7048 dnl Use commas to specify multiple dirs to this arg
7049 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7050 MOZ_ARG_WITH_STRING(doc-input-dirs,
7051 [ --with-doc-input-dirs=DIRS
7052 Header/idl dirs to create docs from],
7053 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7054 AC_SUBST(MOZ_DOC_INPUT_DIRS)
7056 dnl Use commas to specify multiple dirs to this arg
7057 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7058 MOZ_ARG_WITH_STRING(doc-include-dirs,
7059 [ --with-doc-include-dirs=DIRS
7060 Include dirs to preprocess doc headers],
7061 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7062 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7064 MOZ_DOC_OUTPUT_DIR='./dist/docs'
7065 MOZ_ARG_WITH_STRING(doc-output-dir,
7066 [ --with-doc-output-dir=DIR
7067 Dir to generate docs into],
7068 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
7069 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7071 if test -z "$SKIP_COMPILER_CHECKS"; then
7072 dnl ========================================================
7074 dnl = Compiler Options
7076 dnl ========================================================
7077 MOZ_ARG_HEADER(Compiler Options)
7079 dnl ========================================================
7080 dnl Check for gcc -pipe support
7081 dnl ========================================================
7082 AC_MSG_CHECKING([for gcc -pipe support])
7083 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
7084 echo '#include <stdio.h>' > dummy-hello.c
7085 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7086 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7087 cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
7088 if test $? = 0; then
7093 if test "$_res_as_stdin" = "yes"; then
7094 _SAVE_CFLAGS=$CFLAGS
7095 CFLAGS="$CFLAGS -pipe"
7096 AC_TRY_COMPILE( [ #include <stdio.h> ],
7097 [printf("Hello World\n");],
7098 [_res_gcc_pipe="yes"],
7099 [_res_gcc_pipe="no"] )
7100 CFLAGS=$_SAVE_CFLAGS
7102 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
7104 CFLAGS="$CFLAGS -pipe"
7105 CXXFLAGS="$CXXFLAGS -pipe"
7109 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7110 AC_MSG_RESULT([$_res])
7115 dnl pass -Wno-long-long to the compiler
7116 MOZ_ARG_ENABLE_BOOL(long-long-warning,
7117 [ --enable-long-long-warning
7118 Warn about use of non-ANSI long long type],
7119 _IGNORE_LONG_LONG_WARNINGS=,
7120 _IGNORE_LONG_LONG_WARNINGS=1)
7122 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
7123 _SAVE_CFLAGS="$CFLAGS"
7124 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
7125 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
7126 AC_TRY_COMPILE([], [return(0);],
7127 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7128 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7129 result="yes" ], result="no")
7130 AC_MSG_RESULT([$result])
7131 CFLAGS="$_SAVE_CFLAGS"
7134 dnl ========================================================
7135 dnl Profile guided optimization
7136 dnl ========================================================
7137 dnl Test for profiling options
7138 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
7139 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7141 dnl Provide a switch to disable PGO even when called via profiledbuild.
7142 MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
7143 [ --disable-profile-guided-optimization
7144 Don't build with PGO even if called via make profiledbuild],
7145 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
7146 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
7148 AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
7150 _SAVE_CFLAGS="$CFLAGS"
7151 CFLAGS="$CFLAGS -fprofile-generate"
7153 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7154 AC_TRY_COMPILE([], [return 0;],
7155 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7156 result="yes" ], result="no")
7157 AC_MSG_RESULT([$result])
7159 if test $result = "yes"; then
7160 PROFILE_GEN_LDFLAGS="-fprofile-generate"
7161 PROFILE_USE_CFLAGS="-fprofile-use"
7162 PROFILE_USE_LDFLAGS="-fprofile-use"
7164 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
7165 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
7166 AC_TRY_COMPILE([], [return 0;],
7167 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
7168 result="yes" ], result="no")
7169 AC_MSG_RESULT([$result])
7170 if test $result = "yes"; then
7171 PROFILE_USE_CFLAGS="-fbranch-probabilities"
7173 # don't really care, this is an old GCC
7174 PROFILE_GEN_LDFLAGS=
7175 PROFILE_USE_LDFLAGS=
7178 CFLAGS="$_SAVE_CFLAGS"
7180 if test -n "$INTEL_CC"; then
7181 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7182 PROFILE_GEN_LDFLAGS=
7183 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7184 PROFILE_USE_LDFLAGS=
7187 dnl Sun Studio on Solaris
7188 if test "$SOLARIS_SUNPRO_CC"; then
7189 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7190 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7191 if test "$CPU_ARCH" != "sparc"; then
7192 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7193 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7195 PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7196 PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7200 AC_SUBST(PROFILE_GEN_CFLAGS)
7201 AC_SUBST(PROFILE_GEN_LDFLAGS)
7202 AC_SUBST(PROFILE_USE_CFLAGS)
7203 AC_SUBST(PROFILE_USE_LDFLAGS)
7207 dnl ========================================================
7208 dnl Test for -pedantic bustage
7209 dnl ========================================================
7210 MOZ_ARG_DISABLE_BOOL(pedantic,
7211 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7213 if test "$_PEDANTIC"; then
7214 _SAVE_CXXFLAGS=$CXXFLAGS
7215 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7216 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7217 AC_TRY_COMPILE([$configure_static_assert_macros],
7218 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7219 result="no", result="yes" )
7220 AC_MSG_RESULT([$result])
7221 CXXFLAGS="$_SAVE_CXXFLAGS"
7225 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
7226 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7229 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7234 dnl ========================================================
7235 dnl Test for correct temporary object destruction order
7236 dnl ========================================================
7237 dnl We want to make sure the compiler follows the C++ spec here as
7238 dnl xpcom and the string classes depend on it (bug 235381).
7239 AC_MSG_CHECKING([for correct temporary object destruction order])
7240 AC_TRY_RUN([ class A {
7241 public: A(int& x) : mValue(x) {}
7243 operator char**() { return 0; }
7244 private: int& mValue;
7246 void func(char **arg) {}
7257 result="yes", result="no", result="maybe")
7258 AC_MSG_RESULT([$result])
7260 if test "$result" = "no"; then
7261 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
7264 dnl ========================================================
7265 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7266 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7267 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7268 dnl ========================================================
7269 _SAVE_CXXFLAGS=$CXXFLAGS
7270 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7271 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7272 ac_nscap_nonconst_opeq_bug,
7281 template <class T, class U>
7282 int operator==(const Pointer<T>& rhs, U* lhs)
7284 return rhs.myPtr == lhs;
7287 template <class T, class U>
7288 int operator==(const Pointer<T>& rhs, const U* lhs)
7290 return rhs.myPtr == lhs;
7298 ac_nscap_nonconst_opeq_bug="no",
7299 ac_nscap_nonconst_opeq_bug="yes")])
7300 CXXFLAGS="$_SAVE_CXXFLAGS"
7302 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7303 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7305 fi # SKIP_COMPILER_CHECKS
7307 dnl ========================================================
7309 dnl Should be smarter and check that the compiler does indeed have rtti
7310 dnl ========================================================
7311 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
7312 [ --enable-cpp-rtti Enable C++ RTTI ],
7313 [ _MOZ_USE_RTTI=1 ],
7316 if test "$_MOZ_USE_RTTI"; then
7317 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
7319 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
7322 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
7324 dnl ========================================================
7325 dnl C++ exceptions (g++/egcs only - for now)
7326 dnl Should be smarter and check that the compiler does indeed have exceptions
7327 dnl ========================================================
7328 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
7329 [ --enable-cpp-exceptions Enable C++ exceptions ],
7330 [ _MOZ_CPP_EXCEPTIONS=1 ],
7331 [ _MOZ_CPP_EXCEPTIONS= ])
7333 if test "$_MOZ_CPP_EXCEPTIONS"; then
7334 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
7336 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
7339 AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
7341 # Irix & OSF native compilers do not like exception declarations
7342 # when exceptions are disabled
7343 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
7344 AC_DEFINE(CPP_THROW_NEW, [])
7346 AC_DEFINE(CPP_THROW_NEW, [throw()])
7350 dnl ========================================================
7352 dnl = Build depencency options
7354 dnl ========================================================
7355 MOZ_ARG_HEADER(Build dependencies)
7357 dnl ========================================================
7358 dnl = Do not auto generate dependency info
7359 dnl ========================================================
7361 MOZ_ARG_DISABLE_BOOL(auto-deps,
7362 [ --disable-auto-deps Do not automatically generate dependency info],
7366 if test -n "$MOZ_AUTO_DEPS"; then
7367 dnl ========================================================
7368 dnl = Use mkdepend instead of $CC -MD for dependency generation
7369 dnl ========================================================
7371 MOZ_ARG_DISABLE_BOOL(md,
7372 [ --disable-md Do not use compiler-based dependencies ],
7375 [dnl Default is to turn on -MD if using GNU-compatible compilers
7376 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
7379 dnl Default is to use -xM if using Sun Studio on Solaris
7380 if test "$SOLARIS_SUNPRO_CC"; then
7383 if test "$_cpp_md_flag"; then
7385 if test "$OS_ARCH" = "OpenVMS"; then
7386 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
7388 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
7390 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7391 if test "$SOLARIS_SUNPRO_CC"; then
7396 _USE_CPP_INCLUDE_FLAG=
7397 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7398 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7402 AC_SUBST(MOZ_AUTO_DEPS)
7403 AC_SUBST(COMPILER_DEPEND)
7407 dnl ========================================================
7409 dnl = Static Build Options
7411 dnl ========================================================
7412 MOZ_ARG_HEADER(Static build options)
7414 MOZ_ARG_ENABLE_BOOL(static,
7415 [ --enable-static Enable building of internal static libs],
7416 BUILD_STATIC_LIBS=1,
7419 dnl Disable libxul in debug builds, but not for xulrunner.
7420 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
7424 MOZ_ARG_ENABLE_BOOL(libxul,
7425 [ --enable-libxul Enable building of libxul],
7426 MOZ_ENABLE_LIBXUL=1,
7429 if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
7430 AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME. You probably want --enable-libxul.])
7433 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
7434 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
7437 AC_SUBST(LIBXUL_LIBS)
7439 if test -n "$MOZ_ENABLE_LIBXUL"; then
7440 XPCOM_LIBS="$LIBXUL_LIBS"
7441 AC_DEFINE(MOZ_ENABLE_LIBXUL)
7443 if test -n "$BUILD_STATIC_LIBS"; then
7444 AC_DEFINE(MOZ_STATIC_BUILD)
7446 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
7449 dnl ========================================================
7451 dnl = Standalone module options
7453 dnl ========================================================
7454 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7456 dnl Check for GLib and libIDL.
7457 dnl ========================================================
7458 case "$target_os" in
7459 msvc*|mks*|cygwin*|mingw*|wince*)
7460 SKIP_IDL_CHECK="yes"
7467 if test -z "$COMPILE_ENVIRONMENT"; then
7468 SKIP_IDL_CHECK="yes"
7471 dnl = Allow users to disable libIDL checking for standalone modules
7472 MOZ_ARG_WITHOUT_BOOL(libIDL,
7473 [ --without-libIDL Skip check for libIDL (standalone modules only)],
7474 SKIP_IDL_CHECK="yes")
7476 if test "$SKIP_IDL_CHECK" = "no"
7479 if test "$MACOS_SDK_DIR"; then
7480 dnl xpidl, and therefore libIDL, is only needed on the build host.
7481 dnl Don't build it against the SDK, as that causes problems.
7482 _MACSAVE_CFLAGS="$CFLAGS"
7483 _MACSAVE_LIBS="$LIBS"
7484 _MACSAVE_LDFLAGS="$LDFLAGS"
7485 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
7487 CFLAGS=`echo $CFLAGS|sed -E -e "s%((-I|-isystem )${MACOS_SDK_DIR}/usr/(include|lib/gcc)[^ ]*)|-F${MACOS_SDK_DIR}(/System)?/Library/Frameworks[^ ]*|-nostdinc[^ ]*|-isysroot ${MACOS_SDK_DIR}%%g"`
7488 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
7489 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
7494 if test "$MOZ_ENABLE_GTK2"; then
7495 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
7497 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
7498 dnl to either libIDL1 or libIDL2.
7499 if test -z "$_LIBIDL_FOUND"; then
7500 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
7501 if test -z "$_LIBIDL_FOUND"; then
7502 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
7506 dnl If we don't have a libIDL config program & not cross-compiling,
7507 dnl look for orbit-config instead.
7509 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
7510 MOZ_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
7511 if test -n "$ORBIT_CONFIG"; then
7512 AC_MSG_CHECKING([for ORBit libIDL usability])
7513 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
7514 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
7515 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
7516 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
7517 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
7518 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
7520 _SAVE_CFLAGS="$CFLAGS"
7522 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
7523 LIBS="$LIBIDL_LIBS $LIBS"
7526 #include <libIDL/IDL.h>
7529 s=strdup(IDL_get_libver_string());
7542 AC_MSG_RESULT($result)
7543 CFLAGS="$_SAVE_CFLAGS"
7547 if test -z "$_LIBIDL_FOUND"; then
7548 AC_MSG_ERROR([libIDL not found.
7549 libIDL $LIBIDL_VERSION or higher is required.])
7551 if test "$MACOS_SDK_DIR"; then
7552 CFLAGS="$_MACSAVE_CFLAGS"
7553 LIBS="$_MACSAVE_LIBS"
7554 LDFLAGS="$_MACSAVE_LDFLAGS"
7555 if test -n "$_MACSAVE_NEXT_ROOT" ; then
7556 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
7561 if test -n "$CROSS_COMPILE"; then
7562 if test -z "$HOST_LIBIDL_CONFIG"; then
7563 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
7565 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
7566 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
7567 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
7569 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
7570 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
7574 if test -z "$SKIP_PATH_CHECKS"; then
7575 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
7576 if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" ; then
7577 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7579 AM_PATH_GLIB(${GLIB_VERSION})
7584 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
7585 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7588 AC_SUBST(LIBIDL_CFLAGS)
7589 AC_SUBST(LIBIDL_LIBS)
7590 AC_SUBST(STATIC_LIBIDL)
7591 AC_SUBST(GLIB_CFLAGS)
7593 AC_SUBST(GLIB_GMODULE_LIBS)
7594 AC_SUBST(HOST_LIBIDL_CONFIG)
7595 AC_SUBST(HOST_LIBIDL_CFLAGS)
7596 AC_SUBST(HOST_LIBIDL_LIBS)
7598 dnl ========================================================
7600 dnl ========================================================
7601 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7604 MOZ_ARG_ENABLE_BOOL(system-cairo,
7605 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7609 # Check for headers defining standard int types.
7610 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7612 if test "$MOZ_TREE_CAIRO"; then
7613 AC_DEFINE(MOZ_TREE_CAIRO)
7615 # For now we assume that we will have a uint64_t available through
7616 # one of the above headers or mozstdint.h.
7617 AC_DEFINE(HAVE_UINT64_T)
7619 # Define macros for cairo-features.h
7620 if test "$MOZ_X11"; then
7621 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7622 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7623 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7624 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7625 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7626 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7627 MOZ_ENABLE_CAIRO_FT=1
7628 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7630 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
7631 QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
7633 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7634 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7635 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7636 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7638 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7639 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7640 if test -z "$WINCE"; then
7641 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7646 AC_TRY_COMPILE([#include <ddraw.h>], [int foo = DDLOCK_WAITNOTBUSY;], HAS_DDRAW=1, HAS_DDRAW=)
7647 if test -z "$HAS_DDRAW"; then
7648 AC_MSG_WARN([DirectDraw ddraw.h header not found or it's missing DDLOCK_WAITNOTBUSY, disabling DirectDraw surface. If you have an older SDK (such as the CE5 SDK), try copying in ddraw.lib and ddraw.h from the WM6 SDK.])
7649 DDRAW_SURFACE_FEATURE=
7651 DDRAW_SURFACE_FEATURE="#define CAIRO_HAS_DDRAW_SURFACE 1"
7654 if test -z "$OGLES_SDK_DIR"; then
7655 OGLES_SURFACE_FEATURE=
7658 #include <EGL/egl.h>
7659 #include <EGL/eglext.h>
7660 #include <GLES2/gl2.h>
7661 #include <GLES2/gl2ext.h>
7662 ], [ EGLDisplay _cairo_ddraw_egl_dpy = EGL_NO_DISPLAY;], HAS_OGLES=1, HAS_OGLES=)
7663 if test -z "$HAS_OGLES"; then
7664 AC_MSG_WARN([OpenGL ES2 headers not found, disabling OpenGL acceleration surfaces.])
7665 OGLES_SURFACE_FEATURE=
7667 OGLES_SURFACE_FEATURE="#define CAIRO_DDRAW_USE_GL 1"
7671 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7673 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7674 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7675 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7676 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7677 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7678 MOZ_ENABLE_CAIRO_FT=1
7679 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7680 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7682 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7683 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7684 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7685 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7686 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7687 MOZ_ENABLE_CAIRO_FT=1
7689 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7690 AC_SUBST(CAIRO_FT_CFLAGS)
7693 if test "$MOZ_DEBUG"; then
7694 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7696 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7699 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7701 AC_SUBST(PS_SURFACE_FEATURE)
7702 AC_SUBST(PDF_SURFACE_FEATURE)
7703 AC_SUBST(SVG_SURFACE_FEATURE)
7704 AC_SUBST(XLIB_SURFACE_FEATURE)
7705 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7706 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7707 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7708 AC_SUBST(XCB_SURFACE_FEATURE)
7709 AC_SUBST(WIN32_SURFACE_FEATURE)
7710 AC_SUBST(DDRAW_SURFACE_FEATURE)
7711 AC_SUBST(OGLES_SURFACE_FEATURE)
7712 AC_SUBST(OS2_SURFACE_FEATURE)
7713 AC_SUBST(BEOS_SURFACE_FEATURE)
7714 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7715 AC_SUBST(FT_FONT_FEATURE)
7716 AC_SUBST(FC_FONT_FEATURE)
7717 AC_SUBST(WIN32_FONT_FEATURE)
7718 AC_SUBST(QUARTZ_FONT_FEATURE)
7719 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7720 AC_SUBST(QPAINTER_SURFACE_FEATURE)
7722 if test "$_WIN32_MSVC"; then
7723 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7725 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/$(LIB_PREFIX)mozcairo.$(LIB_SUFFIX) $(DEPTH)/gfx/cairo/libpixman/src/$(LIB_PREFIX)mozlibpixman.$(LIB_SUFFIX)'" $CAIRO_FT_LIBS"
7727 if test "$MOZ_X11"; then
7728 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7732 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7733 mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
7736 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7737 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7738 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7739 if test "$MOZ_X11"; then
7740 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7741 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7742 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7746 AC_SUBST(MOZ_TREE_CAIRO)
7747 AC_SUBST(MOZ_CAIRO_CFLAGS)
7748 AC_SUBST(MOZ_CAIRO_LIBS)
7751 dnl ========================================================
7753 QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
7756 dnl ========================================================
7758 dnl ========================================================
7759 MOZ_ARG_DISABLE_BOOL(xul,
7760 [ --disable-xul Disable XUL],
7762 if test "$MOZ_XUL"; then
7765 dnl remove extensions that require XUL
7766 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7771 dnl ========================================================
7772 dnl Two ways to enable Python support:
7773 dnl --enable-extensions=python # select all available.
7774 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7776 dnl --enable-extensions=python/xpcom,... # select individual ones
7778 dnl If either is used, we locate the Python to use.
7779 dnl ========================================================
7781 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7782 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7783 dnl Allow PYTHON to point to the Python interpreter to use
7784 dnl (note that it must be the python executable - which we
7785 dnl run to locate the relevant paths etc)
7786 dnl If not set, we use whatever Python we can find.
7788 dnl Ask Python what its version number is
7790 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7791 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7793 dnl Ask for the Python "prefix" (ie, home/source dir)
7794 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7795 dnl Setup the include and library directories.
7796 if test "$OS_ARCH" = "WINNT"; then
7797 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7798 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7799 dnl Binary trees have "include" for .h, and "libs" for .lib
7800 dnl We add 'em both - along with quotes, to handle spaces.
7801 MOZ_PYTHON_DLL_SUFFIX=.pyd
7802 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7803 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7805 dnl Non-Windows include and libs
7806 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7807 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7808 dnl Check for dynamic Python lib
7809 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7810 dnl - core, xpcom loader, pydom etc) all need to share Python.
7811 dnl - Python 2.3's std --enable-shared configure option will
7812 dnl create a libpython2.3.so.1.0. We should first try this
7813 dnl dotted versioned .so file because this is the one that
7814 dnl the PyXPCOM build mechanics tries to link to.
7815 dnl XXX Should find a better way than hardcoding "1.0".
7816 dnl - Python developement tree dir layouts are NOT allowed here
7817 dnl because the PyXPCOM build just dies on it later anyway.
7818 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7819 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7820 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7821 elif test -f "$MOZ_PYTHON_PREFIX/lib64/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7822 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib64 -lpython$MOZ_PYTHON_VER_DOTTED"
7823 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7824 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7825 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7826 dnl Don't Python development tree directory layout.
7827 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7828 AC_MSG_ERROR([The Python at $MOZ_PYTHON_PREFIX looks like a dev tree. The PyXPCOM build cannot handle this yet. You must 'make install' Python and use the installed tree.])
7829 elif test "$OS_ARCH" = "Darwin"; then
7830 dnl We do Darwin last, so if a custom non-framework build of
7831 dnl python is used on OSX, then it will be picked up first by
7832 dnl the logic above.
7833 MOZ_PYTHON_LIBS="-framework Python"
7835 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7837 if test "$OS_ARCH" = "Linux"; then
7838 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7841 dnl Handle "_d" on Windows
7842 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7843 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7845 MOZ_PYTHON_DEBUG_SUFFIX=
7847 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7850 dnl If the user asks for the 'python' extension, then we add
7851 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7852 dnl Note the careful regex - it must match 'python' followed by anything
7853 dnl other than a '/', including the end-of-string.
7854 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7855 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7856 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7859 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7860 dnl command-line, but not yet
7861 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7862 AC_SUBST(MOZ_PYTHON)
7863 AC_SUBST(MOZ_PYTHON_PREFIX)
7864 AC_SUBST(MOZ_PYTHON_INCLUDES)
7865 AC_SUBST(MOZ_PYTHON_LIBS)
7866 AC_SUBST(MOZ_PYTHON_VER)
7867 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7868 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7869 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7871 dnl ========================================================
7872 dnl disable profile locking
7873 dnl do no use this in applications that can have more than
7874 dnl one process accessing the profile directory.
7875 dnl ========================================================
7876 MOZ_ARG_DISABLE_BOOL(profilelocking,
7877 [ --disable-profilelocking Disable profile locking],
7878 MOZ_PROFILELOCKING=,
7879 MOZ_PROFILELOCKING=1 )
7880 if test "$MOZ_PROFILELOCKING"; then
7881 AC_DEFINE(MOZ_PROFILELOCKING)
7884 dnl ========================================================
7885 dnl disable rdf services
7886 dnl ========================================================
7887 MOZ_ARG_DISABLE_BOOL(rdf,
7888 [ --disable-rdf Disable RDF],
7890 if test "$MOZ_RDF"; then
7896 dnl ========================================================
7897 dnl necko configuration options
7898 dnl ========================================================
7901 dnl option to disable various necko protocols
7903 MOZ_ARG_ENABLE_STRING(necko-protocols,
7904 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7905 Enable/disable specific protocol handlers],
7906 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7907 if test "$option" = "yes" || test "$option" = "all"; then
7908 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7909 elif test "$option" = "no" || test "$option" = "none"; then
7911 elif test "$option" = "default"; then
7912 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7913 elif test `echo "$option" | grep -c \^-` != 0; then
7914 option=`echo $option | sed 's/^-//'`
7915 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7917 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7920 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7922 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7923 AC_SUBST(NECKO_PROTOCOLS)
7924 for p in $NECKO_PROTOCOLS; do
7925 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7929 dnl option to disable necko's disk cache
7931 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7932 [ --disable-necko-disk-cache
7933 Disable necko disk cache],
7936 AC_SUBST(NECKO_DISK_CACHE)
7937 if test "$NECKO_DISK_CACHE"; then
7938 AC_DEFINE(NECKO_DISK_CACHE)
7942 dnl option to disable necko's wifi scanner
7944 MOZ_ARG_DISABLE_BOOL(necko-wifi,
7945 [ --disable-necko-wifi Disable necko wifi scanner],
7949 if test "$NECKO_WIFI"; then
7951 if test "$OS_ARCH" = "Linux"; then
7952 AC_CHECK_HEADER([iwlib.h])
7953 if test "$ac_cv_header_iwlib_h" = "yes"; then
7956 AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora)); use --disable-necko-wifi to disable])
7958 elif test "$OS_ARCH" = "Darwin"; then
7960 elif test "$OS_ARCH" = "WINNT"; then
7962 elif test "$OS_ARCH" = "WINCE"; then
7964 elif test "$OS_ARCH" = "OS2"; then
7965 dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
7968 AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
7970 AC_SUBST(NECKO_WIFI)
7972 if test "$NECKO_WIFI"; then
7973 AC_DEFINE(NECKO_WIFI)
7977 AC_SUBST(NECKO_WIFI)
7981 dnl option to minimize size of necko's i/o buffers
7983 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7984 [ --enable-necko-small-buffers
7985 Minimize size of necko's i/o buffers],
7986 NECKO_SMALL_BUFFERS=1,
7987 NECKO_SMALL_BUFFERS=)
7988 AC_SUBST(NECKO_SMALL_BUFFERS)
7989 if test "$NECKO_SMALL_BUFFERS"; then
7990 AC_DEFINE(NECKO_SMALL_BUFFERS)
7994 dnl option to disable cookies
7996 MOZ_ARG_DISABLE_BOOL(cookies,
7997 [ --disable-cookies Disable cookie support],
8000 AC_SUBST(NECKO_COOKIES)
8001 if test "$NECKO_COOKIES"; then
8002 AC_DEFINE(NECKO_COOKIES)
8005 dnl NECKO_ configuration options are not global
8006 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
8008 dnl Only build Mork if it's required
8010 if test "$MOZ_MORK"; then
8014 dnl Build the lightweight Mork reader if required
8015 AC_SUBST(MOZ_MORKREADER)
8016 if test "$MOZ_MORKREADER"; then
8017 AC_DEFINE(MOZ_MORKREADER)
8020 dnl ========================================================
8021 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
8022 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
8025 dnl ========================================================
8027 dnl = Maintainer debug option (no --enable equivalent)
8029 dnl ========================================================
8034 AC_SUBST(AR_EXTRACT)
8038 AC_SUBST(AS_DASH_C_FLAG)
8043 AC_SUBST(USE_SHORT_LIBNAME)
8047 AC_SUBST(NS_USE_NATIVE)
8048 AC_SUBST(MOZ_WIDGET_TOOLKIT)
8049 AC_SUBST(MOZ_GFX_TOOLKIT)
8050 AC_SUBST(MOZ_UPDATE_XTERM)
8052 AC_SUBST(MOZ_PLATFORM_HILDON)
8054 AC_SUBST(NS_MAEMO_LOCATION)
8055 AC_SUBST(MOZ_AUTH_EXTENSION)
8056 AC_SUBST(MOZ_MATHML)
8057 AC_SUBST(MOZ_PERMISSIONS)
8059 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
8060 AC_SUBST(MOZ_PREF_EXTENSIONS)
8063 AC_SUBST(MOZ_XSLT_STANDALONE)
8064 AC_SUBST(MOZ_JS_LIBS)
8067 AC_SUBST(MOZ_DEBUG_MODULES)
8068 AC_SUBST(MOZ_PROFILE_MODULES)
8069 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8070 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8071 AC_SUBST(MOZ_DEBUG_FLAGS)
8072 AC_SUBST(MOZ_DEBUG_LDFLAGS)
8073 AC_SUBST(WARNINGS_AS_ERRORS)
8074 AC_SUBST(MOZ_DBGRINFO_MODULES)
8075 AC_SUBST(MOZ_EXTENSIONS)
8076 AC_SUBST(MOZ_IMG_DECODERS)
8077 AC_SUBST(MOZ_IMG_ENCODERS)
8078 AC_SUBST(MOZ_JSDEBUGGER)
8079 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
8080 AC_SUBST(MOZ_PLUGINS)
8081 AC_SUBST(ENABLE_EAZEL_PROFILER)
8082 AC_SUBST(EAZEL_PROFILER_CFLAGS)
8083 AC_SUBST(EAZEL_PROFILER_LIBS)
8084 AC_SUBST(MOZ_PERF_METRICS)
8085 AC_SUBST(GC_LEAK_DETECTOR)
8086 AC_SUBST(MOZ_LOG_REFCNT)
8090 AC_SUBST(MOZ_CALLGRIND)
8092 AC_SUBST(MOZ_XPCTOOLS)
8093 AC_SUBST(MOZ_JSLOADER)
8094 AC_SUBST(MOZ_USE_NATIVE_UCONV)
8095 AC_SUBST(MOZ_INSURE)
8096 AC_SUBST(MOZ_INSURE_DIRS)
8097 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
8098 AC_SUBST(MOZ_QUANTIFY)
8099 AC_SUBST(MOZ_INSURIFYING)
8101 AC_SUBST(MOZ_PLACES)
8102 AC_SUBST(MOZ_PLACES_BOOKMARKS)
8103 AC_SUBST(MOZ_STORAGE)
8105 AC_SUBST(NS_PRINTING)
8107 AC_SUBST(MOZ_JAVAXPCOM)
8108 AC_SUBST(JAVA_INCLUDE_PATH)
8113 AC_SUBST(MOZ_PROFILELOCKING)
8116 AC_SUBST(MOZ_XIE_LIBS)
8117 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
8119 AC_SUBST(XPCOM_USE_LEA)
8120 AC_SUBST(BUILD_STATIC_LIBS)
8121 AC_SUBST(MOZ_ENABLE_LIBXUL)
8122 AC_SUBST(ENABLE_TESTS)
8124 AC_SUBST(MOZ_UNIVERSALCHARDET)
8125 AC_SUBST(ACCESSIBILITY)
8126 AC_SUBST(MOZ_XPINSTALL)
8127 AC_SUBST(MOZ_VIEW_SOURCE)
8128 AC_SUBST(MOZ_SPELLCHECK)
8129 AC_SUBST(MOZ_XPFE_COMPONENTS)
8130 AC_SUBST(MOZ_USER_DIR)
8131 AC_SUBST(MOZ_CRASHREPORTER)
8133 AC_SUBST(ENABLE_STRIP)
8134 AC_SUBST(PKG_SKIP_STRIP)
8135 AC_SUBST(USE_ELF_DYNSTR_GC)
8136 AC_SUBST(INCREMENTAL_LINKER)
8137 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8138 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8139 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
8141 AC_SUBST(MOZ_FIX_LINK_PATHS)
8142 AC_SUBST(XPCOM_LIBS)
8143 AC_SUBST(XPCOM_FROZEN_LDOPTS)
8144 AC_SUBST(XPCOM_GLUE_LDOPTS)
8145 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8147 AC_SUBST(USE_DEPENDENT_LIBS)
8149 AC_SUBST(MOZ_BUILD_ROOT)
8150 AC_SUBST(MOZ_OS2_TOOLS)
8151 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
8153 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8154 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8155 AC_SUBST(MOZ_TIMELINE)
8156 AC_SUBST(OGLES_SDK_DIR)
8158 AC_SUBST(MOZ_APP_NAME)
8159 AC_SUBST(MOZ_APP_DISPLAYNAME)
8160 AC_SUBST(MOZ_APP_VERSION)
8161 AC_SUBST(FIREFOX_VERSION)
8163 AC_SUBST(MOZ_PKG_SPECIAL)
8165 AC_SUBST(MOZILLA_OFFICIAL)
8168 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8169 AC_SUBST(MOZ_MAPINFO)
8170 AC_SUBST(MOZ_BROWSE_INFO)
8171 AC_SUBST(MOZ_TOOLS_DIR)
8172 AC_SUBST(CYGWIN_WRAPPER)
8174 AC_SUBST(WIN32_REDIST_DIR)
8178 AC_SUBST(WINCE_SDK_DIR)
8179 AC_SUBST(WINCE_WINDOWS_MOBILE)
8181 dnl Echo the CFLAGS to remove extra whitespace.
8188 $_MOZ_EXCEPTIONS_FLAGS \
8189 $_WARNINGS_CXXFLAGS \
8192 COMPILE_CFLAGS=`echo \
8197 COMPILE_CXXFLAGS=`echo \
8198 $_DEFINES_CXXFLAGS \
8202 AC_SUBST(SYSTEM_MAKEDEPEND)
8203 AC_SUBST(SYSTEM_LIBXUL)
8204 AC_SUBST(SYSTEM_JPEG)
8205 AC_SUBST(SYSTEM_PNG)
8206 AC_SUBST(SYSTEM_ZLIB)
8207 AC_SUBST(SYSTEM_BZ2)
8209 AC_SUBST(JPEG_CFLAGS)
8211 AC_SUBST(ZLIB_CFLAGS)
8213 AC_SUBST(BZ2_CFLAGS)
8215 AC_SUBST(PNG_CFLAGS)
8218 AC_SUBST(MOZ_JPEG_CFLAGS)
8219 AC_SUBST(MOZ_JPEG_LIBS)
8220 AC_SUBST(MOZ_ZLIB_CFLAGS)
8221 AC_SUBST(MOZ_ZLIB_LIBS)
8222 AC_SUBST(MOZ_BZ2_CFLAGS)
8223 AC_SUBST(MOZ_BZ2_LIBS)
8224 AC_SUBST(MOZ_PNG_CFLAGS)
8225 AC_SUBST(MOZ_PNG_LIBS)
8227 AC_SUBST(NSPR_CFLAGS)
8229 AC_SUBST(MOZ_NATIVE_NSPR)
8231 AC_SUBST(NSS_CFLAGS)
8233 AC_SUBST(NSS_DEP_LIBS)
8234 AC_SUBST(MOZ_NATIVE_NSS)
8235 AC_SUBST(NSS_DISABLE_DBM)
8240 AC_SUBST(COMPILE_CFLAGS)
8241 AC_SUBST(COMPILE_CXXFLAGS)
8244 AC_SUBST(CROSS_COMPILE)
8245 AC_SUBST(WCHAR_CFLAGS)
8249 AC_SUBST(HOST_CFLAGS)
8250 AC_SUBST(HOST_CXXFLAGS)
8251 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8253 AC_SUBST(HOST_AR_FLAGS)
8255 AC_SUBST(HOST_RANLIB)
8256 AC_SUBST(HOST_NSPR_MDCPUCFG)
8257 AC_SUBST(HOST_BIN_SUFFIX)
8258 AC_SUBST(HOST_OS_ARCH)
8260 AC_SUBST(TARGET_CPU)
8261 AC_SUBST(TARGET_VENDOR)
8263 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8264 AC_SUBST(TARGET_MD_ARCH)
8265 AC_SUBST(TARGET_XPCOM_ABI)
8268 AC_SUBST(OS_RELEASE)
8271 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
8272 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8274 AC_SUBST(WRAP_MALLOC_CFLAGS)
8275 AC_SUBST(WRAP_MALLOC_LIB)
8278 AC_SUBST(MKSHLIB_FORCE_ALL)
8279 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8280 AC_SUBST(DSO_CFLAGS)
8281 AC_SUBST(DSO_PIC_CFLAGS)
8282 AC_SUBST(DSO_LDOPTS)
8283 AC_SUBST(LIB_PREFIX)
8284 AC_SUBST(DLL_PREFIX)
8285 AC_SUBST(DLL_SUFFIX)
8286 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8287 AC_SUBST(LIB_SUFFIX)
8288 AC_SUBST(OBJ_SUFFIX)
8289 AC_SUBST(BIN_SUFFIX)
8290 AC_SUBST(ASM_SUFFIX)
8291 AC_SUBST(IMPORT_LIB_SUFFIX)
8293 AC_SUBST(CC_VERSION)
8294 AC_SUBST(CXX_VERSION)
8295 AC_SUBST(MSMANIFEST_TOOL)
8297 if test "$USING_HCC"; then
8298 CC='${topsrcdir}/build/hcc'
8300 CXX='${topsrcdir}/build/hcpp'
8301 CXX="$CXX '$_OLDCXX'"
8306 dnl Check for missing components
8307 if test "$COMPILE_ENVIRONMENT"; then
8308 if test "$MOZ_X11"; then
8309 dnl ====================================================
8310 dnl = Check if X headers exist
8311 dnl ====================================================
8312 _SAVE_CFLAGS=$CFLAGS
8313 CFLAGS="$CFLAGS $XCFLAGS"
8317 #include <X11/Xlib.h>
8318 #include <X11/Intrinsic.h>
8322 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8323 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8327 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8328 CFLAGS="$_SAVE_CFLAGS"
8330 if test ! -z "$MISSING_X"; then
8331 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8335 fi # COMPILE_ENVIRONMENT
8337 dnl Set various defines and substitutions
8338 dnl ========================================================
8340 if test "$OS_ARCH" = "BeOS"; then
8343 elif test "$OS_ARCH" = "Darwin"; then
8345 AC_DEFINE(UNIX_ASYNC_DNS)
8347 elif test "$OS_ARCH" = "OpenVMS"; then
8349 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
8351 AC_DEFINE(UNIX_ASYNC_DNS)
8354 AC_SUBST(MOZ_MOVEMAIL)
8356 if test "$MOZ_DEBUG"; then
8357 AC_DEFINE(MOZ_REFLOW_PERF)
8358 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8361 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8362 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8363 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8364 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8365 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8366 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8367 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8368 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8369 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8372 dnl ========================================================
8373 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
8374 dnl ========================================================
8377 WIN_TOP_SRC=`cd $srcdir; pwd -W`
8380 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
8381 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
8382 CC="\$(CYGWIN_WRAPPER) $CC"
8383 CXX="\$(CYGWIN_WRAPPER) $CXX"
8384 CPP="\$(CYGWIN_WRAPPER) $CPP"
8385 LD="\$(CYGWIN_WRAPPER) $LD"
8386 AS="\$(CYGWIN_WRAPPER) $AS"
8387 RC="\$(CYGWIN_WRAPPER) $RC"
8388 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
8389 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
8390 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
8394 AC_SUBST(CYGDRIVE_MOUNT)
8395 AC_SUBST(WIN_TOP_SRC)
8397 AC_SUBST(MOZILLA_VERSION)
8399 AC_SUBST(ac_configure_args)
8401 dnl Spit out some output
8402 dnl ========================================================
8404 dnl The following defines are used by xpcom
8405 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8407 HAVE_CPP_2BYTE_WCHAR_T
8408 HAVE_CPP_ACCESS_CHANGING_USING
8409 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8412 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8414 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8415 HAVE_CPP_NAMESPACE_STD
8417 HAVE_CPP_PARTIAL_SPECIALIZATION
8418 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8420 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
8422 NEED_CPP_UNUSED_IMPLEMENTATIONS
8426 HAVE_ICONV_WITH_CONST_INPUT
8434 netwerk/necko-config.h
8435 xpcom/xpcom-config.h
8436 xpcom/xpcom-private.h
8439 # Save the defines header file before autoconf removes it.
8440 # (Do not add AC_DEFINE calls after this line.)
8441 _CONFIG_TMP=confdefs-tmp.h
8442 _CONFIG_DEFS_H=mozilla-config.h
8444 cat > $_CONFIG_TMP <<\EOF
8445 /* List of defines generated by configure. Included with preprocessor flag,
8446 * -include, to avoid long list of -D defines on the compile command-line.
8450 #ifndef _MOZILLA_CONFIG_H_
8451 #define _MOZILLA_CONFIG_H_
8454 _EGREP_PATTERN='^#define ('
8455 if test -n "$_NON_GLOBAL_ACDEFINES"; then
8456 for f in $_NON_GLOBAL_ACDEFINES; do
8457 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
8460 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
8462 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
8464 cat >> $_CONFIG_TMP <<\EOF
8466 #endif /* _MOZILLA_CONFIG_H_ */
8470 # Only write mozilla-config.h when something changes (or it doesn't exist)
8471 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
8474 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
8475 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
8477 echo ==== $_CONFIG_DEFS_H =================================
8481 dnl Probably shouldn't call this manually but we always want the output of DEFS
8482 rm -f confdefs.h.save
8483 mv confdefs.h confdefs.h.save
8484 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
8485 AC_OUTPUT_MAKE_DEFS()
8487 AC_SUBST(MOZ_DEFINES)
8489 mv confdefs.h.save confdefs.h
8491 dnl Load the list of Makefiles to generate.
8492 dnl To add new Makefiles, edit allmakefiles.sh.
8493 dnl allmakefiles.sh sets the variable, MAKEFILES.
8494 . ${srcdir}/allmakefiles.sh
8496 dnl Run a perl script to quickly create the makefiles.
8497 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
8498 dnl for the files it cannot handle correctly. This way, config.status
8499 dnl will handle these files.
8500 dnl If it fails, nothing is set and config.status will run as usual.
8502 dnl This does not change the $MAKEFILES variable.
8504 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
8506 if test -z "${AS_PERL}"; then
8507 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
8509 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
8514 echo $MAKEFILES > unallmakefiles
8516 mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
8518 AC_OUTPUT($MAKEFILES)
8520 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
8521 if test "$CAIRO_FEATURES_H"; then
8522 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
8523 echo "$CAIRO_FEATURES_H is unchanged"
8524 mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
8526 rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
8530 dnl ========================================================
8531 dnl = Setup a nice relatively clean build environment for
8532 dnl = sub-configures.
8533 dnl ========================================================
8536 CFLAGS="$_SUBDIR_CFLAGS"
8537 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8538 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8539 LDFLAGS="$_SUBDIR_LDFLAGS"
8540 HOST_CC="$_SUBDIR_HOST_CC"
8541 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8542 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8548 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8549 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8551 if test -z "$MOZ_NATIVE_NSPR"; then
8552 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8553 if test -z "$MOZ_DEBUG"; then
8554 ac_configure_args="$ac_configure_args --disable-debug"
8556 if test "$MOZ_OPTIMIZE" = "1"; then
8557 ac_configure_args="$ac_configure_args --enable-optimize"
8559 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8560 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8562 if test -n "$HAVE_64BIT_OS"; then
8563 ac_configure_args="$ac_configure_args --enable-64bit"
8565 if test -n "$USE_ARM_KUSER"; then
8566 ac_configure_args="$ac_configure_args --with-arm-kuser"
8568 AC_OUTPUT_SUBDIRS(nsprpub)
8569 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8572 if test -z "$MOZ_NATIVE_NSPR"; then
8573 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8574 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8575 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8576 NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
8577 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
8578 NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
8579 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
8581 rm -f config/autoconf.mk.bak
8584 # Run the SpiderMonkey 'configure' script.
8585 dist=$MOZ_BUILD_ROOT/dist
8586 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8587 ac_configure_args="$ac_configure_args --enable-threadsafe"
8588 if test -z "$MOZ_NATIVE_NSPR"; then
8589 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8590 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8592 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8593 ac_configure_args="$ac_configure_args --includedir=$dist/include"
8594 ac_configure_args="$ac_configure_args --bindir=$dist/bin"
8595 ac_configure_args="$ac_configure_args --libdir=$dist/lib"
8596 ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
8597 if test "$MOZ_MEMORY"; then
8598 ac_configure_args="$ac_configure_args --enable-jemalloc"
8599 if test -n "$MOZ_MEMORY_LDFLAGS"; then
8600 export MOZ_MEMORY_LDFLAGS
8603 AC_OUTPUT_SUBDIRS(js/src)
8604 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8606 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
8608 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
8609 dnl Needs to be at the end to respect possible changes from NSPR configure
8610 if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
8611 echo "config/autoconf.mk is unchanged"
8612 mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
8614 rm -f config/autoconf.mk.orig 2> /dev/null