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
134 SQLITE_VERSION=3.6.10
135 LIBNOTIFY_VERSION=0.4
139 dnl Set various checks
140 dnl ========================================================
144 dnl Initialize the Pthread test variables early so they can be
145 dnl overridden by each platform.
146 dnl ========================================================
150 dnl Do not allow a separate objdir build if a srcdir build exists.
151 dnl ==============================================================
152 _topsrcdir=`cd \`dirname $0\`; pwd`
155 if test "$_topsrcdir" != "$_objdir"
157 # Check for a couple representative files in the source tree
159 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
160 if test -f $file; then
161 _conflict_files="$_conflict_files $file"
164 if test "$_conflict_files"; then
166 echo "* Your source tree contains these files:"
167 for file in $_conflict_files; do
171 * This indicates that you previously built in the source tree.
172 * A source tree build can confuse the separate objdir build.
174 * To clean up the source tree:
185 dnl Default to MSVC for win32
186 dnl ==============================================================
187 if test -z "$CROSS_COMPILE"; then
189 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
191 if test -z "$CC"; then CC=cl; fi
192 if test -z "$CXX"; then CXX=cl; fi
193 if test -z "$CPP"; then CPP="cl -E -nologo"; fi
194 if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
195 if test -z "$LD"; then LD=link; fi
196 if test -z "$AS"; then AS=ml; fi
197 if test -z "$MIDL"; then MIDL=midl; fi
202 COMPILE_ENVIRONMENT=1
203 MOZ_ARG_ENABLE_BOOL(compile-environment,
204 [ --disable-compile-environment
205 Disable compiler/library checks.],
206 COMPILE_ENVIRONMENT=1,
207 COMPILE_ENVIRONMENT= )
209 MOZ_ARG_WITH_STRING(l10n-base,
210 [ --with-l10n-base=DIR path to l10n repositories],
211 L10NBASEDIR=$withval)
212 if test ! -z "$L10NBASEDIR"; then
213 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
214 AC_MSG_ERROR([--with-l10n-base must specify a path])
215 elif test -d "$L10NBASEDIR"; then
216 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
218 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
221 AC_SUBST(L10NBASEDIR)
223 dnl ========================================================
224 dnl Checks for compilers.
225 dnl ========================================================
226 dnl Set CROSS_COMPILE in the environment when running configure
227 dnl to use the cross-compile setup for now
228 dnl ========================================================
230 if test "$COMPILE_ENVIRONMENT"; then
232 dnl Do some special WinCE toolchain stuff
236 MOZ_ARG_WITH_STRING(wince-sdk,
237 [ --with-wince-sdk=WINCE_SDK_DIR
238 The path to the Windows CE SDK],
239 WINCE_SDK_DIR=$withval)
241 dnl Default to Windows Mobile components enabled
242 WINCE_WINDOWS_MOBILE=1
244 MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
245 [ --disable-windows-mobile-components
246 Disable Windows Mobile specific components from CE build],
247 WINCE_WINDOWS_MOBILE=,
248 WINCE_WINDOWS_MOBILE=1)
250 if test "$WINCE_WINDOWS_MOBILE"; then
251 AC_DEFINE(WINCE_WINDOWS_MOBILE)
258 echo -----------------------------------------------------------------------------
259 echo Building Windows CE Shunt Library and Tool Chain
267 make WINCE_SDK_DIR="$WINCE_SDK_DIR" TOPSRCDIR="$srcdir" OBJDIR="$_pwdw" -C $srcdir/build/wince/tools
269 CC="$_pwd/dist/sdk/bin/arm-wince-gcc"
270 CXX="$_pwd/dist/sdk/bin/arm-wince-gcc"
271 CPP="$_pwd/dist/sdk/bin/arm-wince-gcc -E -nologo"
272 CXXCPP="$_pwd/dist/sdk/bin/arm-wince-gcc -TP -E -nologo"
273 LD="$_pwd/dist/sdk/bin/arm-wince-link"
274 AR="$_pwd/dist/sdk/bin/arm-wince-lib"
275 AS="$_pwd/dist/sdk/bin/arm-wince-as"
276 RC="$_pwd/dist/sdk/bin/arm-wince-res"
279 echo -----------------------------------------------------------------------------
284 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
285 echo "cross compiling from $host to $target"
289 _SAVE_CFLAGS="$CFLAGS"
290 _SAVE_LDFLAGS="$LDFLAGS"
292 AC_MSG_CHECKING([for host c compiler])
293 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
294 if test -z "$HOST_CC"; then
295 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
297 AC_MSG_RESULT([$HOST_CC])
298 AC_MSG_CHECKING([for host c++ compiler])
299 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
300 if test -z "$HOST_CXX"; then
301 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
303 AC_MSG_RESULT([$HOST_CXX])
305 if test -z "$HOST_CFLAGS"; then
306 HOST_CFLAGS="$CFLAGS"
308 if test -z "$HOST_CXXFLAGS"; then
309 HOST_CXXFLAGS="$CXXFLAGS"
311 if test -z "$HOST_LDFLAGS"; then
312 HOST_LDFLAGS="$LDFLAGS"
314 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
315 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
317 CFLAGS="$HOST_CFLAGS"
318 LDFLAGS="$HOST_LDFLAGS"
320 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
321 AC_TRY_COMPILE([], [return(0);],
322 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
323 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
326 CFLAGS="$HOST_CXXFLAGS"
328 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
329 AC_TRY_COMPILE([], [return(0);],
330 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
331 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
335 LDFLAGS=$_SAVE_LDFLAGS
337 case "$build:$target" in
338 powerpc-apple-darwin8*:i?86-apple-darwin*)
339 dnl The Darwin cross compiler doesn't necessarily point itself at a
340 dnl root that has libraries for the proper architecture, it defaults
341 dnl to the system root. The libraries in the system root on current
342 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
343 dnl checks will fail. Fake a working SDK in that case.
345 _SAVE_CXXFLAGS=$CXXLAGS
346 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
347 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
351 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
354 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
358 case "$build:$target" in
359 powerpc-apple-darwin8*:i?86-apple-darwin*)
360 dnl Revert the changes made above. From this point on, the target
361 dnl compiler will never be used without applying the SDK to CFLAGS
362 dnl (see --with-macos-sdk below).
364 CXXFLAGS=$_SAVE_CXXFLAGS
368 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
369 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
370 MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
371 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
372 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
373 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
374 AC_DEFINE(CROSS_COMPILE)
379 MOZ_PATH_PROGS(AS, $AS as, $CC)
380 AC_CHECK_PROGS(AR, ar, :)
381 AC_CHECK_PROGS(LD, ld, :)
382 AC_CHECK_PROGS(STRIP, strip, :)
383 AC_CHECK_PROGS(WINDRES, windres, :)
384 if test -z "$HOST_CC"; then
387 if test -z "$HOST_CFLAGS"; then
388 HOST_CFLAGS="$CFLAGS"
390 if test -z "$HOST_CXX"; then
393 if test -z "$HOST_CXXFLAGS"; then
394 HOST_CXXFLAGS="$CXXFLAGS"
396 if test -z "$HOST_LDFLAGS"; then
397 HOST_LDFLAGS="$LDFLAGS"
399 if test -z "$HOST_RANLIB"; then
400 HOST_RANLIB="$RANLIB"
402 if test -z "$HOST_AR"; then
413 if test "$GCC" = "yes"; then
415 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
417 if test "$GXX" = "yes"; then
419 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
421 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
424 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
427 if test "$GNU_CC"; then
428 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
435 if test "$GCC" = yes; then
436 if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
441 if test "$GXX" = yes; then
442 if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
447 dnl Special win32 checks
448 dnl ========================================================
454 if test -n "$GNU_CC"; then
462 MOZ_ARG_WITH_STRING(windows-version,
463 [ --with-windows-version=WINVER
464 Minimum Windows version (WINVER) to support
475 AC_MSG_ERROR([Invalid value --with-windows-version, must be 400, 500 or 501]);
481 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
482 if test "$GCC" != "yes"; then
483 # Check to see if we are really running in a msvc environemnt
485 AC_CHECK_PROGS(MIDL, midl)
487 # Make sure compilers are valid
488 CFLAGS="$CFLAGS -TC -nologo"
489 CXXFLAGS="$CXXFLAGS -TP -nologo"
492 AC_TRY_COMPILE([#include <stdio.h>],
493 [ printf("Hello World\n"); ],,
494 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
497 AC_TRY_COMPILE([#include <new.h>],
498 [ unsigned *test = new unsigned(42); ],,
499 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
503 _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
506 # Determine compiler version
507 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
508 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
509 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
510 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
511 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
512 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
514 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
515 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
517 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
518 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
520 if test "$_CC_MAJOR_VERSION" = "12"; then
522 elif test "$_CC_MAJOR_VERSION" = "13"; then
524 elif test "$_CC_MAJOR_VERSION" = "14"; then
526 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
527 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
528 dnl so be very specific here!
529 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
530 if test $_CC_RELEASE -gt 50727; then
532 elif test $_CC_BUILD -ge 762; then
535 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
536 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
537 elif test "$_CC_MAJOR_VERSION" = "15"; then
539 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
540 LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
542 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
543 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
545 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
548 _MOZ_RTTI_FLAGS_ON='-GR'
549 _MOZ_RTTI_FLAGS_OFF='-GR-'
550 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
551 _MOZ_EXCEPTIONS_FLAGS_OFF=''
553 if test -n "$WIN32_REDIST_DIR"; then
554 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
558 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
559 if test "$_CC_SUITE" -ge "8"; then
561 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
564 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
565 if test -n "$MSMT_TOOL"; then
566 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
567 if test -z "$MSMANIFEST_TOOL_VERSION"; then
568 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
573 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
577 # Check linker version
578 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
579 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
580 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
581 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
586 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
587 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
588 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
589 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
590 # Add flags if necessary
591 AC_MSG_CHECKING([for midl flags])
594 if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
595 # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
596 # MIDL version 7.00.0500 or later has no problem.
597 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
598 AC_MSG_RESULT([need -env win32])
600 AC_MSG_RESULT([none needed])
604 AC_MSG_RESULT([none needed])
608 # Identify which version of the SDK we're building with
609 # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
611 AC_CHECK_HEADERS([winsdkver.h])
612 if test "$ac_cv_header_winsdkver_h" = "yes"; then
613 # Get the highest _WIN32_WINNT and NTDDI versions supported
614 # Take the higher of the two
615 # This is done because the Windows 7 beta SDK reports its
616 # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
617 AC_CACHE_CHECK(for highest Windows version supported by this SDK,
619 [cat > conftest.h <<EOF
620 #include <winsdkver.h>
621 #include <sdkddkver.h>
623 #if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
624 #define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
626 #define WINSDK_MAXVER NTDDI_MAXVER
631 ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
634 MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
636 # The Vista SDK is the only one to have sdkddkver.h but not
638 AC_CHECK_HEADERS([sdkddkver.h])
639 if test "$ac_cv_header_sdkddkver_h" = "yes"; then
640 MOZ_WINSDK_MAXVER=0x06000000
642 # Assume the Server 2003 Platform SDK
643 MOZ_WINSDK_MAXVER=0x05020000
647 unset _MSVC_VER_FILTER
650 # Check w32api version
651 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
652 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
653 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
654 AC_TRY_COMPILE([#include <w32api.h>],
655 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
656 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
657 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
658 #error "test failed."
660 , [ res=yes ], [ res=no ])
661 AC_MSG_RESULT([$res])
662 if test "$res" != "yes"; then
663 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
665 # Check windres version
666 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
667 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
668 AC_MSG_RESULT([$_WINDRES_VERSION])
669 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
670 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
671 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
672 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
673 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
674 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
675 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
676 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
677 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
678 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
679 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
680 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
682 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
685 # Server 2003 is the highest version supported
686 MOZ_WINSDK_MAXVER=0x05020000
689 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
690 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
691 # Require OS features provided by IE 5.0
692 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
696 dnl Test breaks icc on OS/2 && MSVC
697 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
699 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
703 CC="${srcdir}/build/hcc '$CC'"
704 CXX="${srcdir}/build/hcpp '$CXX'"
711 if test -n "$_WIN32_MSVC"; then
713 SKIP_COMPILER_CHECKS=1
714 SKIP_LIBRARY_CHECKS=1
716 # Since we're skipping compiler and library checks, hard-code
723 AC_DEFINE(HAVE_SETBUF)
724 AC_DEFINE(HAVE_ISATTY)
729 fi # COMPILE_ENVIRONMENT
741 dnl ========================================================
742 dnl Checks for programs.
743 dnl ========================================================
746 MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
747 if test -z "$PERL" || test "$PERL" = ":"; then
748 AC_MSG_ERROR([perl not found in \$PATH])
751 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
752 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
753 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
755 AC_MSG_RESULT([$_perl_version])
757 if test "$_perl_res" != 0; then
758 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
762 AC_MSG_CHECKING([for full perl installation])
763 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
765 if test "$_perl_res" != 0; then
767 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
772 MOZ_PATH_PROGS(PYTHON, $PYTHON python)
773 if test -z "$PYTHON"; then
774 AC_MSG_ERROR([python was not found in \$PATH])
777 MOZ_PATH_PROGS(NSINSTALL_BIN, nsinstall )
778 if test -z "$COMPILE_ENVIRONMENT"; then
779 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
780 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
783 AC_SUBST(NSINSTALL_BIN)
785 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
786 MOZ_PATH_PROG(WHOAMI, whoami, :)
787 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
788 MOZ_PATH_PROG(UNZIP, unzip, :)
789 MOZ_PATH_PROGS(ZIP, zip)
790 if test -z "$ZIP" || test "$ZIP" = ":"; then
791 AC_MSG_ERROR([zip not found in \$PATH])
793 MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
794 MOZ_PATH_PROG(XARGS, xargs)
795 if test -z "$XARGS" || test "$XARGS" = ":"; then
796 AC_MSG_ERROR([xargs not found in \$PATH .])
799 if test "$COMPILE_ENVIRONMENT"; then
801 dnl ========================================================
802 dnl = Mac OS X toolchain support
803 dnl ========================================================
807 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
808 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
809 dnl the environment and includedir purposes (when using an SDK, below),
810 dnl but remember the full version number for the libdir (SDK).
812 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
813 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
815 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
816 dnl Bug 280479, but this keeps popping up in bug 292530 too because
817 dnl 4.0.0/4061 is the default compiler in Tiger.
819 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
821 if test "$GCC_BUILD" = "4061" ; then
822 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
823 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
824 from building Mozilla. Upgrade to Xcode 2.1 or later.])
828 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
829 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
830 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
831 MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
836 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
838 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
844 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
845 dnl it has moved into /usr/bin.
846 MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
850 AC_SUBST(GCC_VERSION)
851 AC_SUBST(XCODEBUILD_VERSION)
852 AC_SUBST(HAS_XCODE_2_1)
854 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
855 dnl that a universal binary is being produced.
856 AC_SUBST(UNIVERSAL_BINARY)
858 dnl ========================================================
859 dnl Check for MacOS deployment target version
860 dnl ========================================================
862 MOZ_ARG_ENABLE_STRING(macos-target,
863 [ --enable-macos-target=VER (default=10.4)
864 Set the minimum MacOS version needed at runtime],
865 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
869 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
870 dnl Use the specified value
871 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
872 AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
873 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
874 dnl No value specified on the command line or in the environment,
875 dnl use the lesser of the application's minimum or the architecture's
877 export MACOSX_DEPLOYMENT_TARGET=10.4
882 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
884 dnl ========================================================
885 dnl = Mac OS X SDK support
886 dnl ========================================================
889 MOZ_ARG_WITH_STRING(macos-sdk,
890 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
891 MACOS_SDK_DIR=$withval)
893 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
894 dnl NEXT_ROOT will be set and exported only if it's needed.
895 AC_SUBST(MACOS_SDK_DIR)
898 if test "$MACOS_SDK_DIR"; then
899 dnl Sync this section with the ones in NSPR and NSS.
900 dnl Changes to the cross environment here need to be accounted for in
901 dnl the libIDL checks (below) and xpidl build.
903 if test ! -d "$MACOS_SDK_DIR"; then
904 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
905 specify a valid SDK. SDKs are installed when the optional cross-development
906 tools are selected during the Xcode/Developer Tools installation.])
909 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
910 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
911 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"
912 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
913 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
915 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"
917 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
918 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
920 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
921 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
922 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
924 dnl ld support for -syslibroot is compiler-agnostic, but only available
925 dnl on Tiger. Although it's possible to switch on the build host's
926 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
927 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
928 dnl set because both the compiler and linker use it.
929 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"
930 export NEXT_ROOT=$MACOS_SDK_DIR
932 if test -n "$CROSS_COMPILE" ; then
933 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
934 dnl the build host. HOST_CXX is presently unused.
935 HOST_CC="NEXT_ROOT= $HOST_CC"
936 HOST_CXX="NEXT_ROOT= $HOST_CXX"
939 dnl gcc >= 4.0 uses different paths than above, but knows how to find
941 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
942 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
944 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
945 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
946 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
948 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
949 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
950 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
951 dnl be ignored and cause warnings when -syslibroot is specified.
952 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
953 dnl the -isysroot it receives, so this is only needed with 4.0.0.
954 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
959 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
961 AC_TRY_COMPILE([#include <new>
962 int main() { return 0; }],
966 AC_MSG_RESULT($result)
968 if test "$result" = "no" ; then
969 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
973 fi # COMPILE_ENVIRONMENT
975 dnl Be sure the make we use is GNU make.
976 dnl on win32, gmake.exe is the generally the wrong version
978 cygwin*|mingw*|mks*|msvc*)
979 MOZ_PATH_PROGS(MAKE, $MAKE make gmake, :)
982 MOZ_PATH_PROGS(MAKE, $MAKE gmake make, :)
985 _make_try=`$MAKE --version 2>/dev/null | grep GNU`
986 if test ! "$_make_try"
989 echo "*** $MAKE is not GNU Make. You will not be able to build Mozilla without GNU Make."
993 dnl Now exit if version if < MAKE_VERSION
995 echo 'all: ; @echo $(MAKE_VERSION)' > dummy.mk
996 _make_vers=`$MAKE --no-print-directory -f dummy.mk all 2>/dev/null`
998 _MAKE_MAJOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $1 }'`
999 _MAKE_MINOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $2 }'`
1000 MAKE_MAJOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $1 }'`
1001 MAKE_MINOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $2 }'`
1002 if test "$_MAKE_MAJOR_VERSION" -lt "$MAKE_MAJOR_VERSION" || \
1003 test "$_MAKE_MAJOR_VERSION" = "$MAKE_MAJOR_VERSION" -a \
1004 "$_MAKE_MINOR_VERSION" -lt "$MAKE_MINOR_VERSION"; then
1005 AC_MSG_ERROR([GNU Make $MAKE_VERSION or higher is required to build Mozilla.])
1009 if test "$COMPILE_ENVIRONMENT"; then
1013 dnl Check in X11 include directory too.
1014 if test "$no_x" != "yes"; then
1015 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1020 fi # COMPILE_ENVIRONMENT
1022 dnl ========================================================
1023 dnl set the defaults first
1024 dnl ========================================================
1028 AR_EXTRACT='$(AR) x'
1043 MOZ_USER_DIR=".mozilla"
1045 HOST_AR_FLAGS='$(AR_FLAGS)'
1048 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
1050 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
1052 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1054 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
1056 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
1057 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
1058 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1059 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
1060 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1061 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1062 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1064 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1065 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
1067 USE_DEPENDENT_LIBS=1
1069 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1070 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
1072 MOZ_ENABLE_POSTSCRIPT=1
1074 if test -n "$CROSS_COMPILE"; then
1075 OS_TARGET="${target_os}"
1076 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1078 case "${target_os}" in
1079 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1080 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1081 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1082 mingw*) OS_ARCH=WINNT ;;
1083 wince*) OS_ARCH=WINCE ;;
1084 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1087 OS_TARGET=`uname -s`
1088 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1089 OS_RELEASE=`uname -r`
1092 # Before this used `uname -m` when not cross compiling
1093 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1094 OS_TEST="${target_cpu}"
1098 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1100 #######################################################################
1101 # Master "Core Components" macros for getting the OS target #
1102 #######################################################################
1105 # Note: OS_TARGET should be specified on the command line for gmake.
1106 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
1107 # The difference between the Win95 target and the WinNT target is that
1108 # the WinNT target uses Windows NT specific features not available
1109 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
1110 # at lesser performance (the Win95 target uses threads; the WinNT target
1113 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1114 # cross-compilation.
1118 # The following hack allows one to build on a WIN95 machine (as if
1119 # s/he were cross-compiling on a WINNT host for a WIN95 target).
1120 # It also accomodates for MKS's uname.exe. If you never intend
1121 # to do development on a WIN95 machine, you don't need this hack.
1136 CYGWIN_9*|CYGWIN_ME*)
1137 OS_ARCH='CYGWIN_NT-4.0'
1143 # Define and override various archtecture-specific variables, including
1152 case "$HOST_OS_ARCH" in
1153 cygwin*|mingw*|mks*|msvc*)
1163 if test -z "$GNU_CC"; then
1164 if test "`$_SUBDIR_CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1169 if test -z "$GNU_CXX"; then
1170 if test "`$_SUBDIR_CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1171 SOLARIS_SUNPRO_CXX=1
1174 AC_SUBST(SOLARIS_SUNPRO_CC)
1175 AC_SUBST(SOLARIS_SUNPRO_CXX)
1187 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1190 HOST_OS_ARCH=UNIXWARE
1202 HOST_OS_ARCH=OpenVMS
1212 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1216 HOST_OS_ARCH=UNIXWARE
1226 # If uname -s returns "Windows_NT", we assume that we are using
1227 # the uname.exe in MKS toolkit.
1229 # The -r option of MKS uname only returns the major version number.
1230 # So we need to use its -v option to get the minor version number.
1231 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1235 OS_MINOR_RELEASE=`uname -v`
1236 if test "$OS_MINOR_RELEASE" = "00"; then
1239 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1241 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1243 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1244 # the uname.exe in the Cygwin tools.
1245 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1246 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1247 # the uname.exe in the GNU-Win32 tools.
1248 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1249 # the uname.exe in the MSYS tools.
1251 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1256 OS_RELEASE=`uname -v`.`uname -r`
1257 OS_TEST=${target_cpu}
1269 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1273 OS_RELEASE=`uname -v`
1297 OS_RELEASE=`uname -v`
1303 OS_RELEASE=`uname -v`
1306 if test "$OS_TARGET" != "NTO"; then
1308 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1317 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1323 OS_RELEASE=`uname -v`
1330 case "${target_cpu}" in
1341 if test -z "$CROSS_COMPILE" ; then
1349 if test "$OS_ARCH" = "NCR"; then
1351 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1355 # Only set CPU_ARCH if we recognize the value of OS_TEST
1362 powerpc* | ppc | rs6000)
1366 Alpha | alpha | ALPHA)
1383 if test -z "$OS_TARGET"; then
1386 if test "$OS_TARGET" = "WIN95"; then
1389 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1391 dnl ========================================================
1392 dnl GNU specific defaults
1393 dnl ========================================================
1394 if test "$GNU_CC"; then
1395 # FIXME: Let us build with strict aliasing. bug 414641.
1396 CFLAGS="$CFLAGS -fno-strict-aliasing"
1397 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1398 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1399 DSO_LDOPTS='-shared'
1400 if test "$GCC_USE_GNU_LD"; then
1401 # Don't allow undefined symbols in libraries
1402 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1404 WARNINGS_AS_ERRORS='-Werror'
1406 DSO_PIC_CFLAGS='-fPIC'
1407 ASFLAGS="$ASFLAGS -fPIC"
1408 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1409 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1410 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1411 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1413 # Turn on GNU specific features
1414 # -Wall - turn on all warnings
1415 # -pedantic - make compiler warn about non-ANSI stuff, and
1416 # be a little bit stricter
1417 # Warnings slamm took out for now (these were giving more noise than help):
1418 # -Wbad-function-cast - warns when casting a function to a new return type
1419 # -Wshadow - removed because it generates more noise than help --pete
1420 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1421 if test -z "$INTEL_CC"; then
1422 # Don't use -Wcast-align with ICC
1424 # And don't use it on hppa, ia64, sparc, since it's noisy there
1425 hppa | ia64 | sparc)
1428 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1433 dnl Turn pedantic on but disable the warnings for long long
1436 if test -z "$INTEL_CC"; then
1437 _IGNORE_LONG_LONG_WARNINGS=1
1438 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1440 _IGNORE_LONG_LONG_WARNINGS=
1444 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1445 _USE_CPP_INCLUDE_FLAG=1
1446 elif test "$SOLARIS_SUNPRO_CC"; then
1447 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1448 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1450 DSO_LDOPTS='-shared'
1451 if test "$GNU_LD"; then
1452 # Don't allow undefined symbols in libraries
1453 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1457 if test "$CPU_ARCH" = "sparc"; then
1458 # for Sun Studio on Solaris/SPARC
1459 DSO_PIC_CFLAGS='-xcode=pic32'
1461 DSO_PIC_CFLAGS='-KPIC'
1463 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1465 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1466 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1468 DSO_LDOPTS='-shared'
1469 if test "$GNU_LD"; then
1470 # Don't allow undefined symbols in libraries
1471 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1475 DSO_PIC_CFLAGS='-KPIC'
1476 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1479 if test "$GNU_CXX"; then
1480 # FIXME: Let us build with strict aliasing. bug 414641.
1481 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1482 # Turn on GNU specific features
1483 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1484 if test -z "$INTEL_CC"; then
1485 # Don't use -Wcast-align with ICC
1487 # And don't use it on hppa, ia64, sparc, since it's noisy there
1488 hppa | ia64 | sparc)
1491 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1496 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1497 _USE_CPP_INCLUDE_FLAG=1
1499 AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1500 ac_has_wno_invalid_offsetof,
1504 _SAVE_CXXFLAGS="$CXXFLAGS"
1505 CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1508 ac_has_wno_invalid_offsetof="yes",
1509 ac_has_wno_invalid_offsetof="no")
1510 CXXFLAGS="$_SAVE_CXXFLAGS"
1513 if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1514 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1517 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1520 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1521 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1522 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1523 dnl normal behavior.
1524 dnl ========================================================
1526 MKSHLIB_UNFORCE_ALL=
1528 if test "$COMPILE_ENVIRONMENT"; then
1529 if test "$GNU_CC"; then
1530 AC_MSG_CHECKING(whether ld has archive extraction flags)
1531 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1532 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1533 ac_cv_mkshlib_force_and_unforce="no"
1534 exec 3<&0 <<LOOP_INPUT
1535 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1536 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1537 force="-Wl,-all"; unforce="-Wl,-none"
1544 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1547 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1549 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1553 eval $ac_cv_mkshlib_force_and_unforce
1554 MKSHLIB_FORCE_ALL=$force
1555 MKSHLIB_UNFORCE_ALL=$unforce
1558 fi # COMPILE_ENVIRONMENT
1560 dnl =================================================================
1561 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1562 dnl which is bad when cross compiling.
1563 dnl =================================================================
1564 if test "$COMPILE_ENVIRONMENT"; then
1565 configure_static_assert_macros='
1566 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1567 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1568 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1571 dnl test that the macros actually work:
1572 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1573 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1576 ac_cv_static_assertion_macros_work="yes"
1577 AC_TRY_COMPILE([$configure_static_assert_macros],
1578 [CONFIGURE_STATIC_ASSERT(1)],
1580 ac_cv_static_assertion_macros_work="no")
1581 AC_TRY_COMPILE([$configure_static_assert_macros],
1582 [CONFIGURE_STATIC_ASSERT(0)],
1583 ac_cv_static_assertion_macros_work="no",
1586 AC_TRY_COMPILE([$configure_static_assert_macros],
1587 [CONFIGURE_STATIC_ASSERT(1)],
1589 ac_cv_static_assertion_macros_work="no")
1590 AC_TRY_COMPILE([$configure_static_assert_macros],
1591 [CONFIGURE_STATIC_ASSERT(0)],
1592 ac_cv_static_assertion_macros_work="no",
1596 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1597 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1598 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1600 fi # COMPILE_ENVIRONMENT
1602 dnl ========================================================
1603 dnl Checking for 64-bit OS
1604 dnl ========================================================
1605 if test "$COMPILE_ENVIRONMENT"; then
1608 AC_MSG_CHECKING(for 64-bit OS)
1609 AC_TRY_COMPILE([$configure_static_assert_macros],
1610 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1611 result="yes", result="no")
1612 AC_MSG_RESULT("$result")
1613 if test "$result" = "yes"; then
1614 AC_DEFINE(HAVE_64BIT_OS)
1617 AC_SUBST(HAVE_64BIT_OS)
1619 fi # COMPILE_ENVIRONMENT
1621 dnl ========================================================
1622 dnl Enable high-memory support on OS/2 by default.
1623 dnl ========================================================
1624 MOZ_OS2_HIGH_MEMORY=1
1625 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1626 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1627 MOZ_OS2_HIGH_MEMORY=,
1628 MOZ_OS2_HIGH_MEMORY=1 )
1629 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1631 dnl ========================================================
1632 dnl System overrides of the defaults for host
1633 dnl ========================================================
1636 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1637 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1638 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1641 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1642 if test -n "$_WIN32_MSVC"; then
1644 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1645 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1646 HOST_RANLIB='echo ranlib'
1648 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1650 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1651 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1652 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1653 HOST_BIN_SUFFIX=.exe
1656 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1659 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1660 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1662 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1664 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1666 PERL="${CYGWIN_WRAPPER} $PERL"
1669 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1670 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1677 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1678 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1679 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1680 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1681 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
1684 *-linux*|*-kfreebsd*-gnu)
1685 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1686 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1687 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1691 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1692 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1693 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1694 HOST_BIN_SUFFIX=.exe
1699 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1700 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1701 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1705 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1706 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1710 dnl Get mozilla version from central milestone file
1711 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1713 dnl Get version of various core apps from the version files.
1714 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1716 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1717 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1719 dnl ========================================================
1720 dnl System overrides of the defaults for target
1721 dnl ========================================================
1726 if test ! "$GNU_CC"; then
1727 if test ! "$HAVE_64BIT_OS"; then
1728 # Compiling with Visual Age C++ object model compat is the
1729 # default. To compile with object model ibm, add
1730 # AIX_OBJMODEL=ibm to .mozconfig.
1731 if test "$AIX_OBJMODEL" = "ibm"; then
1732 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1739 AC_SUBST(AIX_OBJMODEL)
1740 DSO_LDOPTS='-qmkshrobj=1'
1741 DSO_CFLAGS='-qflag=w:w'
1743 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1744 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1746 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1747 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1748 if test "$COMPILE_ENVIRONMENT"; then
1751 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
1753 [#if (__IBMCPP__ < 600)
1754 #error "Bad compiler"
1756 _BAD_COMPILER=,_BAD_COMPILER=1)
1757 if test -n "$_BAD_COMPILER"; then
1759 AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
1761 AC_MSG_RESULT([yes])
1764 TARGET_COMPILER_ABI="ibmc"
1765 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1766 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1769 case "${target_os}" in
1774 if test "$COMPILE_ENVIRONMENT"; then
1775 AC_CHECK_HEADERS(sys/inttypes.h)
1777 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1782 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1783 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1784 DSO_LDOPTS='-nostart'
1785 TK_LIBS='-lbe -lroot'
1787 if test "$COMPILE_ENVIRONMENT"; then
1788 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1789 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1791 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1792 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1795 MOZ_USER_DIR="Mozilla"
1799 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1801 _IGNORE_LONG_LONG_WARNINGS=
1809 _WARNINGS_CFLAGS="-Wall"
1810 _WARNINGS_CXXFLAGS="-Wall"
1811 # The test above doesn't work properly, at least on 3.1.
1812 MKSHLIB_FORCE_ALL=''
1813 MKSHLIB_UNFORCE_ALL=''
1819 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1820 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1821 MOZ_OPTIMIZE_FLAGS="-O2"
1823 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1824 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1827 STRIP="$STRIP -x -S"
1828 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1829 MOZ_ENABLE_POSTSCRIPT=
1830 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1831 LDFLAGS="$LDFLAGS -framework Cocoa"
1832 # The ExceptionHandling framework is needed for Objective-C exception
1833 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1835 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1836 # set MACOSX to generate lib/mac/MoreFiles/Makefile
1839 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1840 dnl ===================================================================
1841 if test "x$enable_dtrace" = "xyes"; then
1842 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1844 dnl check for the presence of the -dead_strip linker flag
1845 AC_MSG_CHECKING([for -dead_strip option to ld])
1846 _SAVE_LDFLAGS=$LDFLAGS
1847 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1848 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1849 if test -n "$_HAVE_DEAD_STRIP" ; then
1850 AC_MSG_RESULT([yes])
1851 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1856 LDFLAGS=$_SAVE_LDFLAGS
1861 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1862 DLL_SUFFIX=".so.1.0"
1863 DSO_LDOPTS="-shared"
1865 if test ! "$GNU_CC"; then
1866 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1868 # Can't have force w/o an unforce.
1869 # # Hack for FreeBSD 2.2
1870 # if test -z "$MKSHLIB_FORCE_ALL"; then
1871 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1872 # MKSHLIB_UNFORCE_ALL=''
1878 if test ! "$GNU_CC"; then
1879 DSO_LDOPTS='-b -Wl,+s'
1882 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1883 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1884 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1886 DSO_LDOPTS='-b -E +s'
1887 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1888 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1890 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1891 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1896 DSO_LDOPTS='-elf -shared'
1898 if test "$GNU_CC"; then
1899 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1900 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1901 MKSHLIB_FORCE_ALL='-Wl,-all'
1902 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1903 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1905 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1906 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1907 MKSHLIB_FORCE_ALL='-all'
1908 MKSHLIB_UNFORCE_ALL='-none'
1914 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1915 dnl compile and link using -n32
1917 TARGET_COMPILER_ABI=n32
1918 DSO_LDOPTS='-elf -shared'
1919 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1920 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1921 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1922 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1923 if test "$GNU_CC"; then
1924 MKSHLIB_FORCE_ALL='-Wl,-all'
1925 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1926 _WARNINGS_CFLAGS="-Wall"
1927 _WARNINGS_CXXFLAGS="-Wall"
1928 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1930 MKSHLIB_FORCE_ALL='-all'
1931 MKSHLIB_UNFORCE_ALL='-none'
1937 CFLAGS="$CFLAGS -woff 3262 -G 4"
1938 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1939 if test -n "$USE_N32"; then
1940 ASFLAGS="$ASFLAGS -n32"
1941 CFLAGS="$CFLAGS -n32"
1942 CXXFLAGS="$CXXFLAGS -n32"
1943 LDFLAGS="$LDFLAGS -n32"
1945 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1946 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1949 if test -z "$GNU_CXX"; then
1955 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
1956 # Similarly for GNU_CXX and INTEL_CXX.
1957 if test "$INTEL_CC" || test "$INTEL_CXX"; then
1958 # -Os has been broken on Intel's C/C++ compilers for quite a
1959 # while; Intel recommends against using it.
1960 MOZ_OPTIMIZE_FLAGS="-O2"
1961 MOZ_DEBUG_FLAGS="-g -fno-inline"
1962 elif test "$GNU_CC" || test "$GNU_CXX"; then
1963 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
1964 case $GCC_VERSION in
1966 # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
1967 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
1969 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
1970 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1971 # and that combo is not yet good at
1972 # debugging inlined functions (even
1973 # when using DWARF2 as the debugging
1977 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1981 case "${target_cpu}" in
1983 CFLAGS="$CFLAGS -mieee"
1984 CXXFLAGS="$CXXFLAGS -mieee"
1988 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1991 MOZ_DEBUG_FLAGS="-g" # We want inlining
1998 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
2000 AR_EXTRACT="$AR -extract"
2002 AR_FLAGS='-OUT:"$@"'
2004 if test "$AS_BIN"; then
2011 if test -z "$RC"; then
2014 # certain versions of cygwin's makedepend barf on the
2015 # #include <string> vs -I./dist/include/string issue so don't use it
2021 HOST_AR='lib -OUT:$@'
2022 HOST_RANLIB='echo ranlib'
2023 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
2026 WARNINGS_AS_ERRORS='-WX'
2027 MOZ_OPTIMIZE_FLAGS='-Ox'
2028 AR_FLAGS='-NOLOGO -OUT:"$@"'
2030 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2031 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2034 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
2035 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2037 IMPORT_LIB_SUFFIX=lib
2039 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2042 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2043 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2045 MKSHLIB_UNFORCE_ALL=
2046 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2047 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2048 MOZ_DEBUG_FLAGS='-Zi'
2049 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2051 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2052 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2054 RANLIB='echo not_ranlib'
2055 STRIP='echo not_strip'
2056 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
2059 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2061 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
2062 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
2066 AC_DEFINE(HAVE_SNPRINTF)
2072 AC_DEFINE(HW_THREADS)
2073 AC_DEFINE(STDC_HEADERS)
2074 AC_DEFINE(NEW_H, <new>)
2075 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2077 TARGET_MD_ARCH=win32
2078 _PLATFORM_DEFAULT_TOOLKIT='windows'
2081 MOZ_ENABLE_POSTSCRIPT=
2082 MOZ_USER_DIR="Mozilla"
2084 MOZ_GFX_OPTIMIZE_MOBILE=1
2086 # Sanity check for WINCE_WINDOWS_MOBILE
2087 # XXX disabled until we can fix the mobile tinderbox
2088 ##if test "$WINCE_WINDOWS_MOBILE"; then
2089 ## AC_CHECK_HEADER(tpcshell.h, [],
2090 ## AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
2095 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2100 # certain versions of cygwin's makedepend barf on the
2101 # #include <string> vs -I./dist/include/string issue so don't use it
2103 if test -n "$GNU_CC"; then
2104 CC="$CC -mno-cygwin"
2105 CXX="$CXX -mno-cygwin"
2106 CPP="$CPP -mno-cygwin"
2107 CFLAGS="$CFLAGS -mms-bitfields"
2108 CXXFLAGS="$CXXFLAGS -mms-bitfields"
2109 DSO_LDOPTS='-shared'
2110 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2111 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2113 # Use temp file for windres (bug 213281)
2114 RCFLAGS='-O coff --use-temp-file'
2115 # mingw doesn't require kernel32, user32, and advapi32 explicitly
2116 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
2117 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
2119 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
2120 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
2122 IMPORT_LIB_SUFFIX=dll.a
2124 TARGET_COMPILER_ABI=msvc
2128 AR='lib -NOLOGO -OUT:"$@"'
2130 RANLIB='echo not_ranlib'
2131 STRIP='echo not_strip'
2136 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2141 IMPORT_LIB_SUFFIX=lib
2142 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2143 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2145 MKSHLIB_UNFORCE_ALL=
2146 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2147 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2148 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2149 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2150 MOZ_DEBUG_FLAGS='-Zi'
2151 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2152 WARNINGS_AS_ERRORS='-WX'
2153 MOZ_OPTIMIZE_FLAGS='-O1'
2154 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2156 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2157 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2158 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2159 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2160 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2161 if test $_MSC_VER -ge 1400; then
2162 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
2163 dnl For profile-guided optimization
2164 PROFILE_GEN_CFLAGS="-GL"
2165 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2166 dnl XXX: PGO builds can fail with warnings treated as errors,
2167 dnl specifically "no profile data available" appears to be
2168 dnl treated as an error sometimes. This might be a consequence
2169 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2170 dnl with the linker doing most of the work in the whole-program
2171 dnl optimization/PGO case. I think it's probably a compiler bug,
2172 dnl but we work around it here.
2173 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2174 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2175 dnl Probably also a compiler bug, but what can you do?
2176 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2177 if test -n "$_USE_DYNAMICBASE"; then
2178 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2182 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2183 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2184 AC_DEFINE(HAVE_SNPRINTF)
2190 AC_DEFINE(HW_THREADS)
2191 AC_DEFINE(STDC_HEADERS)
2192 AC_DEFINE(NEW_H, <new>)
2193 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2194 TARGET_MD_ARCH=win32
2195 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2198 MOZ_ENABLE_POSTSCRIPT=
2199 MOZ_USER_DIR="Mozilla"
2201 dnl Hardcode to win95 for now - cls
2202 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2204 dnl set NO_X11 defines here as the general check is skipped on win32
2208 dnl MinGW/MSYS doesn't provide or need cygpath
2213 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2215 *-cygwin*|*-msvc*|*-mks*)
2216 CYGPATH_W="cygpath -a -w"
2217 CYGPATH_S="sed -e s|\\\\|/|g"
2218 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2222 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2224 if test -z "$MOZ_TOOLS"; then
2225 AC_MSG_ERROR([MOZ_TOOLS is not set])
2228 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2229 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2230 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2232 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2233 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2234 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2236 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2238 if test -n "$GLIB_PREFIX"; then
2239 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
2240 if test "$?" = "0"; then
2241 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
2242 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
2244 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
2246 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
2249 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
2251 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
2252 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
2254 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
2255 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
2256 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
2257 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
2258 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
2260 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
2263 if test -n "$LIBIDL_PREFIX"; then
2264 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd -W`
2265 if test "$?" = "0"; then
2266 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2267 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2269 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2271 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2274 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2276 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2277 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2279 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2280 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2281 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2283 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2284 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2286 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2288 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2291 *) # else cross-compiling
2292 if test -n "$GLIB_PREFIX"; then
2293 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2294 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2295 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2296 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2297 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2299 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2302 if test -n "$LIBIDL_PREFIX"; then
2303 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2304 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2305 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2307 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2308 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2310 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2313 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2320 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])
2324 AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
2328 AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2344 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2351 CFLAGS="$CFLAGS -Dunix"
2352 CXXFLAGS="$CXXFLAGS -Dunix"
2353 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2355 DSO_PIC_CFLAGS='-fPIC -DPIC'
2356 DSO_LDOPTS='-shared'
2357 BIN_FLAGS='-Wl,--export-dynamic'
2359 DSO_PIC_CFLAGS='-fPIC -DPIC'
2360 DLL_SUFFIX=".so.1.0"
2361 DSO_LDOPTS='-shared'
2363 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2364 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2365 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2366 if test "$LIBRUNPATH"; then
2367 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2369 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2370 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2375 AC_DEFINE(_QNX_SOURCE)
2378 WARNINGS_AS_ERRORS=''
2379 MOZ_OPTIMIZE_FLAGS="-O"
2380 MOZ_DEBUG_FLAGS="-gstabs"
2383 LIBS="$LIBS -lsocket -lstdc++"
2384 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2385 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2386 if test "$with_x" != "yes"
2388 _PLATFORM_DEFAULT_TOOLKIT="photon"
2389 TK_CFLAGS='-I/usr/include/photon'
2392 case "${target_cpu}" in
2394 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2397 case "${host_cpu}" in
2405 DLL_SUFFIX=".so.1.0"
2407 DSO_PIC_CFLAGS='-fPIC'
2408 DSO_LDOPTS='-shared -fPIC'
2409 if test "$LIBRUNPATH"; then
2410 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2415 AC_DEFINE(NO_PW_GECOS)
2416 AC_DEFINE(NO_UDSOCK)
2417 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2419 MKSHLIB_FORCE_ALL='-all'
2420 MKSHLIB_UNFORCE_ALL='-none'
2422 AS_DASH_C_FLAG='-Wc/names=as_is'
2424 DSO_LDOPTS='-shared -auto_symvec'
2426 MOZ_DEBUG_LDFLAGS='-g'
2428 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2429 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2434 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2435 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2438 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2439 AC_DEFINE(TCPV40HDRS)
2446 IMPORT_LIB_SUFFIX=lib
2450 CFLAGS="$CFLAGS -Zomf"
2451 CXXFLAGS="$CXXFLAGS -Zomf"
2453 BIN_FLAGS='-Zlinker /ST:0x100000'
2457 WARNINGS_AS_ERRORS='-Werror'
2458 MOZ_DEBUG_FLAGS="-g -fno-inline"
2459 MOZ_OPTIMIZE_FLAGS="-O2"
2460 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2461 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2462 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2463 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2465 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2466 MOZ_ENABLE_POSTSCRIPT=
2469 MOZ_USER_DIR="Mozilla"
2471 if test "$MOZTOOLS"; then
2472 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2474 AC_MSG_ERROR([MOZTOOLS is not set])
2476 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2477 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2478 LDFLAGS="$LDFLAGS -Zhigh-mem"
2479 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2480 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2483 # GCC for OS/2 currently predefines these, but we don't want them
2484 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2485 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2487 AC_CACHE_CHECK(for __declspec(dllexport),
2489 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2491 ac_os2_declspec="yes",
2492 ac_os2_declspec="no")])
2493 if test "$ac_os2_declspec" = "yes"; then
2495 MOZ_OS2_USE_DECLSPEC='1'
2500 if test "$GNU_CC"; then
2501 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2502 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2505 MOZ_DEBUG_FLAGS='-g'
2506 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2507 CFLAGS="$CFLAGS -ieee"
2508 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2509 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2512 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2513 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2514 MKSHLIB_FORCE_ALL='-all'
2515 MKSHLIB_UNFORCE_ALL='-none'
2516 dnl Might fix the libxpcom.so breakage on this platform as well....
2517 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2518 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2520 if test -z "$GNU_CXX"; then
2523 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2527 DIRENT_INO=d_stat.st_ino
2528 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2529 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2530 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2531 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2532 AC_DEFINE(STDC_HEADERS)
2533 if test "$no_x" = "yes"; then
2534 _PLATFORM_DEFAULT_TOOLKIT='photon'
2535 TK_CFLAGS='-I/usr/nto/include/photon'
2536 TK_LIBS='-lphoton -lphrender'
2541 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2542 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2543 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2544 if test ! "$GNU_CC"; then
2549 dnl the qsort routine under solaris is faulty
2552 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2554 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2555 # libraries one level up (e.g. libnspr4.so)
2556 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2558 if test "$SOLARIS_SUNPRO_CC"; then
2559 LIBS="-lCrun -lCstd $LIBS"
2562 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2563 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2564 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2565 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2566 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2567 _SAVE_LDFLAGS=$LDFLAGS
2568 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2569 AC_TRY_LINK([#include <stdio.h>],
2570 [printf("Hello World\n");],
2572 [LDFLAGS=$_SAVE_LDFLAGS])
2574 WARNINGS_AS_ERRORS='-Werror'
2575 MOZ_OPTIMIZE_FLAGS="-xO4"
2576 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2577 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2578 MKSHLIB_FORCE_ALL='-z allextract'
2579 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2580 DSO_LDOPTS='-G -z muldefs'
2586 AS='/usr/ccs/bin/as'
2587 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2589 TARGET_COMPILER_ABI="sunc"
2590 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2591 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2592 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2596 [#if (__SUNPRO_CC < 0x590)
2599 _BAD_COMPILER=,_BAD_COMPILER=1)
2600 if test -n "$_BAD_COMPILER"; then
2602 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2606 AC_MSG_RESULT([$_res])
2609 ASFLAGS="$ASFLAGS -fPIC"
2612 _WARNINGS_CXXFLAGS=''
2613 if test "$OS_RELEASE" = "5.3"; then
2614 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2617 if test "$OS_RELEASE" = "5.5.1"; then
2618 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2623 DSO_LDOPTS='-Bdynamic'
2624 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2625 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2627 AC_DEFINE(SPRINTF_RETURNS_STRING)
2628 case "$(target_os)" in
2630 DLL_SUFFIX='.so.1.0'
2636 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2640 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2645 dnl Only one oddball right now (QNX), but this gives us flexibility
2646 dnl if any other platforms need to override this in the future.
2647 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2649 dnl ========================================================
2650 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2651 dnl by now will not have any way to link most binaries (tests
2652 dnl as well as viewer, apprunner, etc.), because some symbols
2653 dnl will be left out of the "composite" .so's by ld as unneeded.
2654 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2655 dnl they can link in the static libs that provide the missing
2657 dnl ========================================================
2658 NO_LD_ARCHIVE_FLAGS=
2659 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2660 NO_LD_ARCHIVE_FLAGS=1
2664 NO_LD_ARCHIVE_FLAGS=
2667 NO_LD_ARCHIVE_FLAGS=
2670 NO_LD_ARCHIVE_FLAGS=
2672 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2673 if test -z "$GNU_CC"; then
2674 NO_LD_ARCHIVE_FLAGS=
2678 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2681 dnl Indicate that platform requires special thread safe
2682 dnl locking when starting up the OJI JVM
2683 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2684 dnl ========================================================
2687 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2691 dnl ========================================================
2692 dnl = Flags to strip unused symbols from .so components
2693 dnl ========================================================
2695 *-linux*|*-kfreebsd*-gnu)
2696 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2699 if test -z "$GNU_CC"; then
2700 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2702 if test -z "$GCC_USE_GNU_LD"; then
2703 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2705 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2710 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2713 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2715 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2716 if test -n "$GNU_CC"; then
2717 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2722 if test -z "$COMPILE_ENVIRONMENT"; then
2723 SKIP_COMPILER_CHECKS=1
2724 SKIP_LIBRARY_CHECKS=1
2727 if test -z "$SKIP_COMPILER_CHECKS"; then
2728 dnl Checks for typedefs, structures, and compiler characteristics.
2729 dnl ========================================================
2737 AC_STRUCT_ST_BLKSIZE
2738 AC_MSG_CHECKING(for siginfo_t)
2739 AC_CACHE_VAL(ac_cv_siginfo_t,
2740 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2741 #include <signal.h>],
2743 [ac_cv_siginfo_t=true],
2744 [ac_cv_siginfo_t=false])])
2745 if test "$ac_cv_siginfo_t" = true ; then
2746 AC_DEFINE(HAVE_SIGINFO_T)
2752 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2753 dnl ========================================================
2754 AC_MSG_CHECKING(for int16_t)
2755 AC_CACHE_VAL(ac_cv_int16_t,
2756 [AC_TRY_COMPILE([#include <stdio.h>
2757 #include <sys/types.h>],
2759 [ac_cv_int16_t=true],
2760 [ac_cv_int16_t=false])])
2761 if test "$ac_cv_int16_t" = true ; then
2762 AC_DEFINE(HAVE_INT16_T)
2767 AC_MSG_CHECKING(for int32_t)
2768 AC_CACHE_VAL(ac_cv_int32_t,
2769 [AC_TRY_COMPILE([#include <stdio.h>
2770 #include <sys/types.h>],
2772 [ac_cv_int32_t=true],
2773 [ac_cv_int32_t=false])])
2774 if test "$ac_cv_int32_t" = true ; then
2775 AC_DEFINE(HAVE_INT32_T)
2780 AC_MSG_CHECKING(for int64_t)
2781 AC_CACHE_VAL(ac_cv_int64_t,
2782 [AC_TRY_COMPILE([#include <stdio.h>
2783 #include <sys/types.h>],
2785 [ac_cv_int64_t=true],
2786 [ac_cv_int64_t=false])])
2787 if test "$ac_cv_int64_t" = true ; then
2788 AC_DEFINE(HAVE_INT64_T)
2793 AC_MSG_CHECKING(for int64)
2794 AC_CACHE_VAL(ac_cv_int64,
2795 [AC_TRY_COMPILE([#include <stdio.h>
2796 #include <sys/types.h>],
2799 [ac_cv_int64=false])])
2800 if test "$ac_cv_int64" = true ; then
2801 AC_DEFINE(HAVE_INT64)
2806 AC_MSG_CHECKING(for uint)
2807 AC_CACHE_VAL(ac_cv_uint,
2808 [AC_TRY_COMPILE([#include <stdio.h>
2809 #include <sys/types.h>],
2812 [ac_cv_uint=false])])
2813 if test "$ac_cv_uint" = true ; then
2814 AC_DEFINE(HAVE_UINT)
2819 AC_MSG_CHECKING(for uint_t)
2820 AC_CACHE_VAL(ac_cv_uint_t,
2821 [AC_TRY_COMPILE([#include <stdio.h>
2822 #include <sys/types.h>],
2824 [ac_cv_uint_t=true],
2825 [ac_cv_uint_t=false])])
2826 if test "$ac_cv_uint_t" = true ; then
2827 AC_DEFINE(HAVE_UINT_T)
2832 AC_MSG_CHECKING(for uint16_t)
2833 AC_CACHE_VAL(ac_cv_uint16_t,
2834 [AC_TRY_COMPILE([#include <stdio.h>
2835 #include <sys/types.h>],
2836 [uint16_t foo = 0;],
2837 [ac_cv_uint16_t=true],
2838 [ac_cv_uint16_t=false])])
2839 if test "$ac_cv_uint16_t" = true ; then
2840 AC_DEFINE(HAVE_UINT16_T)
2846 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2847 dnl are defined when compiling C++ but not C. Since the result of this
2848 dnl test is used only in C++, do it in C++.
2851 AC_MSG_CHECKING(for uname.domainname)
2852 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2853 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2854 [ struct utsname *res; char *domain;
2855 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2856 [ac_cv_have_uname_domainname_field=true],
2857 [ac_cv_have_uname_domainname_field=false])])
2859 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2860 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2866 AC_MSG_CHECKING(for uname.__domainname)
2867 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2868 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2869 [ struct utsname *res; char *domain;
2870 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2871 [ac_cv_have_uname_us_domainname_field=true],
2872 [ac_cv_have_uname_us_domainname_field=false])])
2874 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2875 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2883 dnl Check for usable wchar_t (2 bytes, unsigned)
2884 dnl (we really don't need the unsignedness check anymore)
2885 dnl ========================================================
2887 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2888 ac_cv_have_usable_wchar_v2,
2889 [AC_TRY_COMPILE([#include <stddef.h>
2890 $configure_static_assert_macros],
2891 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2892 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2893 ac_cv_have_usable_wchar_v2="yes",
2894 ac_cv_have_usable_wchar_v2="no")])
2895 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2896 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2897 HAVE_CPP_2BYTE_WCHAR_T=1
2899 dnl This is really gcc-only
2900 dnl Do this test using CXX only since some versions of gcc
2901 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2902 dnl only have short-wchar support for c++.
2903 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2907 _SAVE_CXXFLAGS=$CXXFLAGS
2908 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2910 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2911 ac_cv_have_usable_wchar_option_v2,
2912 [AC_TRY_LINK([#include <stddef.h>
2913 $configure_static_assert_macros],
2914 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2915 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2916 ac_cv_have_usable_wchar_option_v2="yes",
2917 ac_cv_have_usable_wchar_option_v2="no")])
2919 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2920 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2921 HAVE_CPP_2BYTE_WCHAR_T=1
2922 WCHAR_CFLAGS="-fshort-wchar"
2924 CXXFLAGS=$_SAVE_CXXFLAGS
2929 dnl Check for .hidden assembler directive and visibility attribute.
2930 dnl Borrowed from glibc configure.in
2931 dnl ===============================================================
2932 if test "$GNU_CC"; then
2933 AC_CACHE_CHECK(for visibility(hidden) attribute,
2934 ac_cv_visibility_hidden,
2935 [cat > conftest.c <<EOF
2936 int foo __attribute__ ((visibility ("hidden"))) = 1;
2938 ac_cv_visibility_hidden=no
2939 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2940 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2941 ac_cv_visibility_hidden=yes
2946 if test "$ac_cv_visibility_hidden" = "yes"; then
2947 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2949 AC_CACHE_CHECK(for visibility(default) attribute,
2950 ac_cv_visibility_default,
2951 [cat > conftest.c <<EOF
2952 int foo __attribute__ ((visibility ("default"))) = 1;
2954 ac_cv_visibility_default=no
2955 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2956 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2957 ac_cv_visibility_default=yes
2962 if test "$ac_cv_visibility_default" = "yes"; then
2963 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2965 AC_CACHE_CHECK(for visibility pragma support,
2966 ac_cv_visibility_pragma,
2967 [cat > conftest.c <<EOF
2968 #pragma GCC visibility push(hidden)
2970 #pragma GCC visibility push(default)
2971 int foo_default = 1;
2973 ac_cv_visibility_pragma=no
2974 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2975 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2976 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2977 ac_cv_visibility_pragma=yes
2983 if test "$ac_cv_visibility_pragma" = "yes"; then
2984 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2985 ac_cv_have_visibility_class_bug,
2986 [cat > conftest.c <<EOF
2987 #pragma GCC visibility push(hidden)
2988 struct __attribute__ ((visibility ("default"))) TestStruct {
2991 __attribute__ ((visibility ("default"))) void TestFunc() {
2995 ac_cv_have_visibility_class_bug=no
2996 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2997 ac_cv_have_visibility_class_bug=yes
2999 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
3000 ac_cv_have_visibility_class_bug=yes
3003 rm -rf conftest.{c,S}
3006 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
3007 ac_cv_have_visibility_builtin_bug,
3008 [cat > conftest.c <<EOF
3009 #pragma GCC visibility push(hidden)
3010 #pragma GCC visibility push(default)
3012 #pragma GCC visibility pop
3014 __attribute__ ((visibility ("default"))) void Func() {
3016 memset(c, 0, sizeof(c));
3019 ac_cv_have_visibility_builtin_bug=no
3020 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3021 ac_cv_have_visibility_builtin_bug=yes
3023 if test `grep -c "@PLT" conftest.S` = 0; then
3024 ac_cv_visibility_builtin_bug=yes
3027 rm -f conftest.{c,S}
3029 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
3030 "$ac_cv_have_visibility_class_bug" = "no"; then
3031 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
3032 WRAP_SYSTEM_INCLUDES=1
3034 VISIBILITY_FLAGS='-fvisibility=hidden'
3035 fi # have visibility pragma bug
3036 fi # have visibility pragma
3037 fi # have visibility(default) attribute
3038 fi # have visibility(hidden) attribute
3041 # visibility hidden flag for Sun Studio on Solaris
3042 if test "$SOLARIS_SUNPRO_CC"; then
3043 VISIBILITY_FLAGS='-xldscope=hidden'
3044 fi # Sun Studio on Solaris
3046 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3047 AC_SUBST(VISIBILITY_FLAGS)
3049 dnl Checks for header files.
3050 dnl ========================================================
3052 case "$target_os" in
3054 # for stuff like -lXshm
3055 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3058 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3059 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3060 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3061 AC_CHECK_HEADERS(malloc.h)
3062 AC_CHECK_HEADERS(X11/XKBlib.h)
3063 AC_CHECK_HEADERS(io.h)
3065 dnl These are all the places some variant of statfs can be hiding.
3066 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3068 dnl Try for MMX support
3069 dnl NB - later gcc versions require -mmmx for this header to be successfully
3070 dnl included (or another option which implies it, such as -march=pentium-mmx)
3071 AC_CHECK_HEADERS(mmintrin.h)
3073 dnl Check whether the compiler supports the new-style C++ standard
3074 dnl library headers (i.e. <new>) or needs the old "new.h"
3077 AC_CHECK_HEADER(new, [NEW_H=new])
3078 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
3081 AC_ARG_ENABLE(dtrace,
3082 [ --enable-dtrace build with dtrace support if available (default=no)],
3083 [enable_dtrace="yes"],)
3084 if test "x$enable_dtrace" = "xyes"; then
3085 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
3086 if test -n "$HAVE_DTRACE"; then
3087 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3089 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3092 AC_SUBST(HAVE_DTRACE)
3098 AC_CHECK_HEADERS(sys/cdefs.h)
3102 dnl Checks for libraries.
3103 dnl ========================================================
3108 AC_CHECK_LIB(c_r, gethostbyname_r)
3112 dnl We don't want to link with libdl even if it's present on OS X, since
3113 dnl it's not used and not part of the default installation.
3114 dnl The same goes for BeOS.
3115 dnl We don't want to link against libm or libpthread on Darwin since
3116 dnl they both are just symlinks to libSystem and explicitly linking
3117 dnl against libSystem causes issues when debugging (see bug 299601).
3124 AC_CHECK_LIB(m, atan)
3125 AC_CHECK_LIB(dl, dlopen,
3126 AC_CHECK_HEADER(dlfcn.h,
3128 AC_DEFINE(HAVE_LIBDL)))
3132 _SAVE_CFLAGS="$CFLAGS"
3133 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3134 AC_CHECK_FUNCS(dladdr)
3135 CFLAGS="$_SAVE_CFLAGS"
3137 if test ! "$GNU_CXX"; then
3141 AC_CHECK_LIB(C_r, demangle)
3144 AC_CHECK_LIB(C, demangle)
3148 AC_CHECK_LIB(socket, socket)
3151 XLIBS="$X_EXTRA_LIBS"
3153 dnl ========================================================
3154 dnl Checks for X libraries.
3155 dnl Ordering is important.
3156 dnl Xt is dependent upon SM as of X11R6
3157 dnl ========================================================
3158 if test "$no_x" = "yes"; then
3161 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3162 XLIBS="-lX11 $XLIBS"
3163 _SAVE_LDFLAGS="$LDFLAGS"
3164 LDFLAGS="$XLDFLAGS $LDFLAGS"
3165 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3166 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3167 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3168 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3171 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3172 unset ac_cv_lib_Xt_XtFree
3173 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3174 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3175 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3176 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3179 # AIX needs the motif library linked before libXt to prevent
3180 # crashes in plugins linked against Motif - Bug #98892
3181 case "${target_os}" in
3183 XT_LIBS="-lXm $XT_LIBS"
3187 dnl ========================================================
3188 dnl = Check for XShm
3189 dnl ========================================================
3190 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3192 AC_CHECK_HEADER(X11/extensions/XShm.h)
3193 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3194 test -n "$_HAVE_XSHM_XEXT"; then
3195 AC_DEFINE(HAVE_XSHM)
3198 dnl ========================================================
3200 dnl ========================================================
3201 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3203 AC_CHECK_HEADER(X11/extensions/XIElib.h)
3205 if test "$MOZ_XIE_LIBS"; then
3206 dnl ====================================================
3207 dnl = If XIE is present and is desired, turn it on
3208 dnl ====================================================
3218 LDFLAGS="$_SAVE_LDFLAGS"
3220 dnl ========================================================
3221 dnl = Check for freetype2 and its functionality
3222 dnl ========================================================
3223 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3225 if test "$_HAVE_FREETYPE2"; then
3227 _SAVE_CFLAGS="$CFLAGS"
3228 LIBS="$LIBS $FT2_LIBS"
3229 CFLAGS="$CFLAGS $FT2_CFLAGS"
3231 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3232 ac_cv_member_FT_Bitmap_Size_y_ppem,
3233 [AC_TRY_COMPILE([#include <ft2build.h>
3234 #include FT_FREETYPE_H],
3236 if (sizeof s.y_ppem) return 0;
3238 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3239 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3240 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3241 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3243 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3245 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3246 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3247 [FT_Bitmap_Size structure includes y_ppem field])
3249 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3252 CFLAGS="$_SAVE_CFLAGS"
3263 AC_MSG_CHECKING(for ARM SIMD support)
3265 [asm("uqadd8 r1, r1, r2");],
3266 result="yes", result="no")
3267 AC_MSG_RESULT("$result")
3268 if test "$result" = "yes"; then
3269 AC_DEFINE(HAVE_ARM_SIMD)
3272 AC_SUBST(HAVE_ARM_SIMD)
3274 dnl ========================================================
3275 dnl = pthread support
3276 dnl = Start by checking whether the system support pthreads
3277 dnl ========================================================
3278 case "$target_os" in
3283 MOZ_CHECK_PTHREADS(pthreads,
3284 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3285 MOZ_CHECK_PTHREADS(pthread,
3286 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3287 MOZ_CHECK_PTHREADS(c_r,
3288 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3289 MOZ_CHECK_PTHREADS(c,
3298 dnl ========================================================
3299 dnl Check the command line for --with-pthreads
3300 dnl ========================================================
3301 MOZ_ARG_WITH_BOOL(pthreads,
3302 [ --with-pthreads Force use of system pthread library with NSPR ],
3303 [ if test "$USE_PTHREADS"x = x; then
3304 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3310 dnl ========================================================
3311 dnl Do the platform specific pthread hackery
3312 dnl ========================================================
3313 if test "$USE_PTHREADS"x != x
3316 dnl See if -pthread is supported.
3319 ac_cv_have_dash_pthread=no
3320 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3321 echo 'int main() { return 0; }' | cat > conftest.c
3322 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3323 if test $? -eq 0; then
3324 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3325 ac_cv_have_dash_pthread=yes
3326 case "$target_os" in
3328 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3331 CFLAGS="$CFLAGS -pthread"
3332 CXXFLAGS="$CXXFLAGS -pthread"
3338 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3341 dnl See if -pthreads is supported.
3343 ac_cv_have_dash_pthreads=no
3344 if test "$ac_cv_have_dash_pthread" = "no"; then
3345 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3346 echo 'int main() { return 0; }' | cat > conftest.c
3347 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3348 if test $? -eq 0; then
3349 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3350 ac_cv_have_dash_pthreads=yes
3351 CFLAGS="$CFLAGS -pthreads"
3352 CXXFLAGS="$CXXFLAGS -pthreads"
3356 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3361 AC_DEFINE(_REENTRANT)
3362 AC_DEFINE(_THREAD_SAFE)
3363 dnl -pthread links in -lc_r, so don't specify it explicitly.
3364 if test "$ac_cv_have_dash_pthread" = "yes"; then
3365 _PTHREAD_LDFLAGS="-pthread"
3367 _PTHREAD_LDFLAGS="-lc_r"
3371 *-*-openbsd*|*-*-bsdi*)
3372 AC_DEFINE(_REENTRANT)
3373 AC_DEFINE(_THREAD_SAFE)
3374 dnl -pthread links in -lc_r, so don't specify it explicitly.
3375 if test "$ac_cv_have_dash_pthread" = "yes"; then
3376 _PTHREAD_LDFLAGS="-pthread"
3380 *-*-linux*|*-*-kfreebsd*-gnu)
3381 AC_DEFINE(_REENTRANT)
3385 AC_DEFINE(_REENTRANT)
3389 AC_DEFINE(_REENTRANT)
3393 AC_DEFINE(_REENTRANT)
3397 AC_DEFINE(_REENTRANT)
3401 AC_DEFINE(_REENTRANT)
3402 if test "$SOLARIS_SUNPRO_CC"; then
3403 CFLAGS="$CFLAGS -mt"
3404 CXXFLAGS="$CXXFLAGS -mt"
3408 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3411 dnl ========================================================
3412 dnl See if mmap sees writes
3413 dnl For cross compiling, just define it as no, which is a safe default
3414 dnl ========================================================
3415 AC_MSG_CHECKING(whether mmap() sees write()s)
3421 #include <sys/mman.h>
3422 #include <sys/types.h>
3423 #include <sys/stat.h>
3426 char fname[] = "conftest.file";
3427 char zbuff[1024]; /* Fractional page is probably worst case */
3434 fd = open(fname, O_RDWR | O_CREAT, 0660);
3437 write(fd, zbuff, sizeof(zbuff));
3438 lseek(fd, 0, SEEK_SET);
3439 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3440 if(map==(char*)-1) return 2;
3441 for(i=0; fname[i]; i++) {
3442 int rc = write(fd, &fname[i], 1);
3443 if(map[i]!=fname[i]) return 4;
3450 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3452 AC_MSG_RESULT("$result")
3454 if test "$result" = "no"; then
3455 AC_DEFINE(MMAP_MISSES_WRITES)
3459 dnl Checks for library functions.
3460 dnl ========================================================
3461 AC_PROG_GCC_TRADITIONAL
3463 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3464 AC_CHECK_FUNCS(flockfile getpagesize)
3465 AC_CHECK_FUNCS(localtime_r strtok_r)
3467 dnl check for wcrtomb/mbrtowc
3468 dnl =======================================================================
3469 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3472 AC_CACHE_CHECK(for wcrtomb,
3474 [AC_TRY_LINK([#include <wchar.h>],
3475 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3476 ac_cv_have_wcrtomb="yes",
3477 ac_cv_have_wcrtomb="no")])
3478 if test "$ac_cv_have_wcrtomb" = "yes"; then
3479 AC_DEFINE(HAVE_WCRTOMB)
3481 AC_CACHE_CHECK(for mbrtowc,
3483 [AC_TRY_LINK([#include <wchar.h>],
3484 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3485 ac_cv_have_mbrtowc="yes",
3486 ac_cv_have_mbrtowc="no")])
3487 if test "$ac_cv_have_mbrtowc" = "yes"; then
3488 AC_DEFINE(HAVE_MBRTOWC)
3495 ac_cv_func_res_ninit,
3498 #define _BSD_SOURCE 1
3502 [int foo = res_ninit(&_res);],
3503 [ac_cv_func_res_ninit=yes],
3504 [ac_cv_func_res_ninit=no])
3507 if test "$ac_cv_func_res_ninit" = "yes"; then
3508 AC_DEFINE(HAVE_RES_NINIT)
3509 dnl must add the link line we do something as foolish as this... dougt
3511 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3512 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3517 [for gnu_get_libc_version()],
3518 ac_cv_func_gnu_get_libc_version,
3520 #ifdef HAVE_GNU_LIBC_VERSION_H
3521 #include <gnu/libc-version.h>
3524 [const char *glibc_version = gnu_get_libc_version();],
3525 [ac_cv_func_gnu_get_libc_version=yes],
3526 [ac_cv_func_gnu_get_libc_version=no]
3530 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3531 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3535 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3539 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3540 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3541 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3543 LIBS="$LIBS $_ICONV_LIBS"
3552 iconv_t h = iconv_open("", "");
3553 iconv(h, NULL, NULL, NULL, NULL);
3556 [ac_cv_func_iconv=yes],
3557 [ac_cv_func_iconv=no]
3560 if test "$ac_cv_func_iconv" = "yes"; then
3561 AC_DEFINE(HAVE_ICONV)
3562 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3563 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3564 LIBICONV="$_ICONV_LIBS"
3566 [for iconv() with const input],
3567 ac_cv_func_const_iconv,
3573 const char *input = "testing";
3574 iconv_t h = iconv_open("", "");
3575 iconv(h, &input, NULL, NULL, NULL);
3578 [ac_cv_func_const_iconv=yes],
3579 [ac_cv_func_const_iconv=no]
3582 if test "$ac_cv_func_const_iconv" = "yes"; then
3583 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3595 dnl **********************
3596 dnl *** va_copy checks ***
3597 dnl **********************
3598 dnl we currently check for all three va_copy possibilities, so we get
3599 dnl all results in config.log for bug reports.
3600 AC_MSG_CHECKING(for an implementation of va_copy())
3601 AC_CACHE_VAL(ac_cv_va_copy,[
3604 void f (int i, ...) {
3605 va_list args1, args2;
3606 va_start (args1, i);
3607 va_copy (args2, args1);
3608 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3610 va_end (args1); va_end (args2);
3612 int main() { f (0, 42); return 0; }],
3618 AC_MSG_RESULT($ac_cv_va_copy)
3619 AC_MSG_CHECKING(for an implementation of __va_copy())
3620 AC_CACHE_VAL(ac_cv___va_copy,[
3623 void f (int i, ...) {
3624 va_list args1, args2;
3625 va_start (args1, i);
3626 __va_copy (args2, args1);
3627 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3629 va_end (args1); va_end (args2);
3631 int main() { f (0, 42); return 0; }],
3632 ac_cv___va_copy=yes,
3637 AC_MSG_RESULT($ac_cv___va_copy)
3638 AC_MSG_CHECKING(whether va_lists can be copied by value)
3639 AC_CACHE_VAL(ac_cv_va_val_copy,[
3642 void f (int i, ...) {
3643 va_list args1, args2;
3644 va_start (args1, i);
3646 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3648 va_end (args1); va_end (args2);
3650 int main() { f (0, 42); return 0; }],
3651 ac_cv_va_val_copy=yes,
3652 ac_cv_va_val_copy=no,
3653 ac_cv_va_val_copy=yes
3656 if test "x$ac_cv_va_copy" = "xyes"; then
3657 AC_DEFINE(VA_COPY, va_copy)
3658 AC_DEFINE(HAVE_VA_COPY)
3659 elif test "x$ac_cv___va_copy" = "xyes"; then
3660 AC_DEFINE(VA_COPY, __va_copy)
3661 AC_DEFINE(HAVE_VA_COPY)
3664 if test "x$ac_cv_va_val_copy" = "xno"; then
3665 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3667 AC_MSG_RESULT($ac_cv_va_val_copy)
3669 dnl Check for dll-challenged libc's.
3670 dnl This check is apparently only needed for Linux.
3673 dnl ===================================================================
3676 rm -rf conftest* _conftest
3678 cat >> conftest.C <<\EOF
3683 void __dump_link_map(void) {
3684 struct link_map *map = _dl_loaded;
3685 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3688 dlopen("./conftest1.so",RTLD_LAZY);
3689 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3690 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3691 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3695 /* _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).*/
3696 int main() { printf("./conftest1.so\n"); }
3700 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3702 cat >> conftest1.C <<\EOF
3704 void foo(void) {printf("foo in dll called\n");}
3706 ${CXX-g++} -fPIC -c -g conftest1.C
3707 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3708 ${CXX-g++} -g conftest.C -o conftest -ldl
3709 cp -f conftest1.so conftest _conftest
3711 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3714 echo "*** Your libc has a bug that can result in loading the same dynamic"
3715 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3716 echo "*** or later. However, if you choose not to upgrade, the only effect"
3717 echo "*** will be excessive memory usage at runtime."
3721 rm -rf conftest* _conftest
3722 dnl ===================================================================
3726 dnl ===================================================================
3727 dnl ========================================================
3728 dnl By default, turn rtti and exceptions off on g++/egcs
3729 dnl ========================================================
3730 if test "$GNU_CXX"; then
3732 AC_MSG_CHECKING(for C++ exceptions flag)
3734 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3735 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3736 [echo "int main() { return 0; }" | cat > conftest.C
3738 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3740 if egrep "warning.*renamed" conftest.out >/dev/null; then
3741 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3743 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3748 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3749 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3750 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3753 dnl ========================================================
3754 dnl Put your C++ language/feature checks below
3755 dnl ========================================================
3759 if test "$GNU_CC"; then
3760 AC_CACHE_CHECK(for gcc 3.0 ABI,
3761 ac_cv_gcc_three_abi,
3764 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3770 ac_cv_gcc_three_abi="yes",
3771 ac_cv_gcc_three_abi="no")])
3772 if test "$ac_cv_gcc_three_abi" = "yes"; then
3773 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3776 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3779 AC_SUBST(HAVE_GCC3_ABI)
3782 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3784 [AC_TRY_COMPILE(class X {
3785 public: explicit X(int i) : i_(i) {}
3789 ac_cv_cpp_explicit=yes,
3790 ac_cv_cpp_explicit=no)])
3791 if test "$ac_cv_cpp_explicit" = yes ; then
3792 AC_DEFINE(HAVE_CPP_EXPLICIT)
3795 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3797 [AC_TRY_COMPILE(class param {
3799 typedef unsigned long num_type;
3802 template <class T> class tplt {
3804 typedef typename T::num_type t_num_type;
3805 t_num_type foo(typename T::num_type num) {
3811 ac_cv_cpp_typename=yes,
3812 ac_cv_cpp_typename=no)])
3813 if test "$ac_cv_cpp_typename" = yes ; then
3814 AC_DEFINE(HAVE_CPP_TYPENAME)
3817 dnl Check for support of modern template specialization syntax
3818 dnl Test code and requirement from scc@netscape.com.
3819 dnl Autoconf cut-and-paste job by waterson@netscape.com
3820 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3821 ac_cv_cpp_modern_specialize_template_syntax,
3822 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3824 template <> struct X<Y> { double a; };,
3827 ac_cv_cpp_modern_specialize_template_syntax=yes,
3828 ac_cv_cpp_modern_specialize_template_syntax=no)])
3829 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3830 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3834 dnl Some compilers support only full specialization, and some don't.
3835 AC_CACHE_CHECK(whether partial template specialization works,
3836 ac_cv_cpp_partial_specialization,
3837 [AC_TRY_COMPILE(template <class T> class Foo {};
3838 template <class T> class Foo<T*> {};,
3840 ac_cv_cpp_partial_specialization=yes,
3841 ac_cv_cpp_partial_specialization=no)])
3842 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3843 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3846 dnl Some compilers have limited support for operators with templates;
3847 dnl specifically, it is necessary to define derived operators when a base
3848 dnl class's operator declaration should suffice.
3849 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3850 ac_cv_need_derived_template_operators,
3851 [AC_TRY_COMPILE([template <class T> class Base { };
3853 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3854 template <class T> class Derived : public Base<T> { };],
3855 [Derived<char> a, b;
3856 Base<char> c = a + b;
3858 ac_cv_need_derived_template_operators=no,
3859 ac_cv_need_derived_template_operators=yes)])
3860 if test "$ac_cv_need_derived_template_operators" = yes ; then
3861 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3865 dnl Some compilers have trouble detecting that a template class
3866 dnl that derives from another template is actually an instance
3867 dnl of the base class. This test checks for that.
3868 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3869 ac_cv_need_cpp_template_cast_to_base,
3870 [AC_TRY_COMPILE([template <class T> class Base { };
3871 template <class T> class Derived : public Base<T> { };
3872 template <class T> int foo(const Base<T>&) { return 0; }],
3873 [Derived<char> bar; return foo(bar);],
3874 ac_cv_need_cpp_template_cast_to_base=no,
3875 ac_cv_need_cpp_template_cast_to_base=yes)])
3876 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3877 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3880 dnl Some compilers have trouble resolving the ambiguity between two
3881 dnl functions whose arguments differ only by cv-qualifications.
3882 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3883 ac_cv_can_resolve_const_ambiguity,
3885 template <class T> class ptrClass {
3889 template <class T> T* a(ptrClass<T> *arg) {
3894 const T* a(const ptrClass<T> *arg) {
3900 ac_cv_can_resolve_const_ambiguity=yes,
3901 ac_cv_can_resolve_const_ambiguity=no)])
3902 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3903 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3907 dnl We don't do exceptions on unix. The only reason this used to be here
3908 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3909 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3910 dnl So im commenting this out until someone writes some artificial
3911 dnl intelligence to detect not only if the compiler has exceptions, but if
3912 dnl they are enabled as well.
3914 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3915 dnl ac_cv_cpp_exceptions,
3916 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3917 dnl static void F() { throw X(); },
3918 dnl try { F(); } catch(X & e) { },
3919 dnl ac_cv_cpp_exceptions=yes,
3920 dnl ac_cv_cpp_exceptions=no)])
3921 dnl if test $ac_cv_cpp_exceptions = yes ; then
3922 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3925 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3926 dnl supports it well enough to allow us to use it to change access, but not
3927 dnl to resolve ambiguity. The next two tests determine how well the |using|
3928 dnl keyword is supported.
3930 dnl Check to see if we can change access with |using|. Test both a
3931 dnl legal and an illegal example.
3932 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3933 ac_cv_cpp_access_changing_using2,
3935 class A { protected: int foo() { return 0; } };
3936 class B : public A { public: using A::foo; };,
3937 B b; return b.foo();,
3939 class A { public: int foo() { return 1; } };
3940 class B : public A { private: using A::foo; };,
3941 B b; return b.foo();,
3942 ac_cv_cpp_access_changing_using2=no,
3943 ac_cv_cpp_access_changing_using2=yes)],
3944 ac_cv_cpp_access_changing_using2=no)])
3945 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3946 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3949 dnl Check to see if we can resolve ambiguity with |using|.
3950 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3951 ac_cv_cpp_ambiguity_resolving_using,
3952 [AC_TRY_COMPILE(class X {
3953 public: int go(const X&) {return 3;}
3954 int jo(const X&) {return 3;}
3956 class Y : public X {
3957 public: int go(int) {return 2;}
3958 int jo(int) {return 2;}
3960 private: using X::go;
3963 ac_cv_cpp_ambiguity_resolving_using=yes,
3964 ac_cv_cpp_ambiguity_resolving_using=no)])
3965 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3966 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3969 dnl Check to see if the |std| namespace is supported. If so, we'll want
3970 dnl to qualify any standard library calls with "std::" to ensure that
3971 dnl those functions can be resolved.
3972 AC_CACHE_CHECK(for \"std::\" namespace,
3973 ac_cv_cpp_namespace_std,
3974 [AC_TRY_COMPILE([#include <algorithm>],
3975 [return std::min(0, 1);],
3976 ac_cv_cpp_namespace_std=yes,
3977 ac_cv_cpp_namespace_std=no)])
3978 if test "$ac_cv_cpp_namespace_std" = yes ; then
3979 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3982 dnl Older compilers are overly ambitious with respect to using the standard
3983 dnl template library's |operator!=()| when |operator==()| is defined. In
3984 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3985 dnl ambiguity at compile-time. This test checks for that case.
3986 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3987 ac_cv_cpp_unambiguous_std_notequal,
3988 [AC_TRY_COMPILE([#include <algorithm>
3990 int operator==(const T1&, const T1&) { return 0; }
3991 int operator!=(const T1&, const T1&) { return 0; }],
3992 [T1 a,b; return a != b;],
3993 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3994 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3995 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3996 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
4000 AC_CACHE_CHECK(for C++ reinterpret_cast,
4001 ac_cv_cpp_reinterpret_cast,
4002 [AC_TRY_COMPILE(struct X { int i; };
4003 struct Y { int i; };,
4004 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
4005 ac_cv_cpp_reinterpret_cast=yes,
4006 ac_cv_cpp_reinterpret_cast=no)])
4007 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
4008 AC_DEFINE(HAVE_CPP_NEW_CASTS)
4011 dnl See if a dynamic_cast to void* gives the most derived object.
4012 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
4013 ac_cv_cpp_dynamic_cast_void_ptr,
4014 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
4015 class Y { int j; public: virtual ~Y() { } };
4016 class Z : public X, public Y { int k; };
4022 return !((((void*)&mdo != (void*)subx) &&
4023 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
4024 (((void*)&mdo != (void*)suby) &&
4025 ((void*)&mdo == dynamic_cast<void*>(suby))));
4027 ac_cv_cpp_dynamic_cast_void_ptr=yes,
4028 ac_cv_cpp_dynamic_cast_void_ptr=no,
4029 ac_cv_cpp_dynamic_cast_void_ptr=no)])
4030 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
4031 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
4035 dnl note that this one is reversed - if the test fails, then
4036 dnl we require implementations of unused virtual methods. Which
4037 dnl really blows because it means we'll have useless vtable
4039 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
4040 ac_cv_cpp_unused_required,
4041 [AC_TRY_LINK(class X {private: virtual void never_called();};,
4043 ac_cv_cpp_unused_required=no,
4044 ac_cv_cpp_unused_required=yes)])
4045 if test "$ac_cv_cpp_unused_required" = yes ; then
4046 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
4050 dnl Some compilers have trouble comparing a constant reference to a templatized
4051 dnl class to zero, and require an explicit operator==() to be defined that takes
4052 dnl an int. This test separates the strong from the weak.
4054 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
4055 ac_cv_trouble_comparing_to_zero,
4056 [AC_TRY_COMPILE([#include <algorithm>
4057 template <class T> class Foo {};
4059 template <class T> int operator==(const T2*, const T&) { return 0; }
4060 template <class T> int operator!=(const T2*, const T&) { return 0; }],
4061 [Foo<int> f; return (0 != f);],
4062 ac_cv_trouble_comparing_to_zero=no,
4063 ac_cv_trouble_comparing_to_zero=yes)])
4064 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
4065 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
4070 dnl End of C++ language/feature checks
4073 dnl ========================================================
4074 dnl = Internationalization checks
4075 dnl ========================================================
4077 dnl Internationalization and Locale support is different
4078 dnl on various UNIX platforms. Checks for specific i18n
4079 dnl features go here.
4081 dnl check for LC_MESSAGES
4082 AC_CACHE_CHECK(for LC_MESSAGES,
4083 ac_cv_i18n_lc_messages,
4084 [AC_TRY_COMPILE([#include <locale.h>],
4085 [int category = LC_MESSAGES;],
4086 ac_cv_i18n_lc_messages=yes,
4087 ac_cv_i18n_lc_messages=no)])
4088 if test "$ac_cv_i18n_lc_messages" = yes; then
4089 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
4092 fi # SKIP_COMPILER_CHECKS
4095 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
4096 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4099 dnl Mozilla specific options
4100 dnl ========================================================
4101 dnl The macros used for command line options
4102 dnl are defined in build/autoconf/altoptions.m4.
4105 dnl ========================================================
4107 dnl = Check for external package dependencies
4109 dnl ========================================================
4110 MOZ_ARG_HEADER(External Packages)
4114 MOZ_ARG_WITH_STRING(libxul-sdk,
4115 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4116 LIBXUL_SDK_DIR=$withval)
4118 if test "$LIBXUL_SDK_DIR" = "yes"; then
4119 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4120 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4121 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4123 if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
4124 AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
4129 AC_SUBST(LIBXUL_SDK)
4131 if test -n "$LIBXUL_SDK"; then
4132 LIBXUL_DIST="$LIBXUL_SDK"
4134 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4136 AC_SUBST(LIBXUL_DIST)
4140 MOZ_ARG_WITH_BOOL(system-libxul,
4141 [ --with-system-libxul Use system installed libxul SDK],
4144 if test -n "$SYSTEM_LIBXUL" && test -z "$MOZ_ENABLE_LIBXUL"; then
4145 AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4148 dnl ========================================================
4149 dnl = If NSPR was not detected in the system,
4150 dnl = use the one in the source tree (mozilla/nsprpub)
4151 dnl ========================================================
4152 MOZ_ARG_WITH_BOOL(system-nspr,
4153 [ --with-system-nspr Use system installed NSPR],
4154 _USE_SYSTEM_NSPR=1 )
4156 if test -n "$_USE_SYSTEM_NSPR"; then
4157 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
4160 if test -n "$MOZ_NATIVE_NSPR"; then
4161 _SAVE_CFLAGS=$CFLAGS
4162 CFLAGS="$CFLAGS $NSPR_CFLAGS"
4163 AC_TRY_COMPILE([#include "prlog.h"],
4164 [#ifndef PR_STATIC_ASSERT
4165 #error PR_STATIC_ASSERT not defined
4167 [MOZ_NATIVE_NSPR=1],
4168 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
4169 CFLAGS=$_SAVE_CFLAGS
4171 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4172 if test "$OS_ARCH" = "WINCE"; then
4173 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4174 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4175 elif test "$OS_ARCH" = "WINNT"; then
4176 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4177 if test -n "$GNU_CC"; then
4178 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4180 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4183 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4187 dnl ========================================================
4188 dnl = If NSS was not detected in the system,
4189 dnl = use the one in the source tree (mozilla/security/nss)
4190 dnl ========================================================
4192 MOZ_ARG_WITH_BOOL(system-nss,
4193 [ --with-system-nss Use system installed NSS],
4196 if test -n "$_USE_SYSTEM_NSS"; then
4197 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
4200 if test -n "$MOZ_NATIVE_NSS"; then
4201 NSS_LIBS="$NSS_LIBS -lcrmf"
4203 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4205 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4206 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4207 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4208 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4209 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX) \
4210 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
4212 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4214 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4215 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4216 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4217 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4218 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4219 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
4221 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
4225 if test -z "$SKIP_LIBRARY_CHECKS"; then
4226 dnl system JPEG support
4227 dnl ========================================================
4228 MOZ_ARG_WITH_STRING(system-jpeg,
4229 [ --with-system-jpeg[=PFX]
4230 Use system libjpeg [installed at prefix PFX]],
4233 _SAVE_CFLAGS=$CFLAGS
4234 _SAVE_LDFLAGS=$LDFLAGS
4236 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4237 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4238 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4240 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4243 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4246 if test "$SYSTEM_JPEG" = 1; then
4247 LIBS="$JPEG_LIBS $LIBS"
4248 AC_TRY_COMPILE([ #include <stdio.h>
4249 #include <sys/types.h>
4250 #include <jpeglib.h> ],
4251 [ #if JPEG_LIB_VERSION < $MOZJPEG
4252 #error "Insufficient JPEG library version ($MOZJPEG required)."
4255 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4257 CFLAGS=$_SAVE_CFLAGS
4258 LDFLAGS=$_SAVE_LDFLAGS
4261 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4262 JPEG_CFLAGS="-I${JPEG_DIR}/include"
4263 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4266 dnl system ZLIB support
4267 dnl ========================================================
4268 MOZ_ARG_WITH_STRING(system-zlib,
4269 [ --with-system-zlib[=PFX]
4270 Use system libz [installed at prefix PFX]],
4273 _SAVE_CFLAGS=$CFLAGS
4274 _SAVE_LDFLAGS=$LDFLAGS
4276 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4277 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4278 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4280 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4283 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4284 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4286 if test "$SYSTEM_ZLIB" = 1; then
4287 LIBS="$ZLIB_LIBS $LIBS"
4288 AC_TRY_COMPILE([ #include <stdio.h>
4290 #include <zlib.h> ],
4291 [ #if ZLIB_VERNUM < $MOZZLIB
4292 #error "Insufficient zlib version ($MOZZLIB required)."
4295 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4297 CFLAGS=$_SAVE_CFLAGS
4298 LDFLAGS=$_SAVE_LDFLAGS
4301 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4302 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4303 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4306 dnl system BZIP2 Support
4307 dnl ========================================================
4308 MOZ_ARG_WITH_STRING(system-bz2,
4309 [ --with-system-bz2[=PFX]
4310 Use system libbz2 [installed at prefix PFX]],
4313 _SAVE_CFLAGS=$CFLAGS
4314 _SAVE_LDFLAGS=$LDFLAGS
4316 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4317 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4318 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4320 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4323 AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4324 [SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
4326 CFLAGS=$_SAVE_CFLAGS
4327 LDFLAGS=$_SAVE_LDFLAGS
4330 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4331 BZ2_CFLAGS="-I${BZ2_DIR}/include"
4332 BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4335 dnl system PNG Support
4336 dnl ========================================================
4337 MOZ_ARG_WITH_STRING(system-png,
4338 [ --with-system-png[=PFX]
4339 Use system libpng [installed at prefix PFX]],
4342 _SAVE_CFLAGS=$CFLAGS
4343 _SAVE_LDFLAGS=$LDFLAGS
4345 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4346 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4347 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4348 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4349 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4351 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4354 _SAVE_PNG_LIBS=$PNG_LIBS
4355 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4356 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4358 AC_CHECK_LIB(png, png_get_acTL, ,
4359 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4362 if test "$SYSTEM_PNG" = 1; then
4363 LIBS="$PNG_LIBS $LIBS"
4364 AC_TRY_COMPILE([ #include <stdio.h>
4365 #include <sys/types.h>
4367 [ #if PNG_LIBPNG_VER < $MOZPNG
4368 #error "Insufficient libpng version ($MOZPNG required)."
4370 #ifndef PNG_UINT_31_MAX
4371 #error "Insufficient libpng version."
4374 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4376 CFLAGS=$_SAVE_CFLAGS
4377 LDFLAGS=$_SAVE_LDFLAGS
4380 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4381 PNG_CFLAGS="-I${PNG_DIR}/include"
4382 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4385 fi # SKIP_LIBRARY_CHECKS
4387 dnl system HunSpell Support
4388 dnl ========================================================
4389 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4390 [ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4393 if test -n "$SYSTEM_HUNSPELL"; then
4394 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4397 AC_SUBST(SYSTEM_HUNSPELL)
4399 dnl ========================================================
4400 dnl Java SDK support
4401 dnl ========================================================
4403 MOZ_ARG_WITH_STRING(java-include-path,
4404 [ --with-java-include-path=dir Location of Java SDK headers],
4405 JAVA_INCLUDE_PATH=$withval)
4408 MOZ_ARG_WITH_STRING(java-bin-path,
4409 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4410 JAVA_BIN_PATH=$withval)
4412 dnl ========================================================
4413 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4414 dnl their usage and use them in spidermonkey.
4415 dnl ========================================================
4416 MOZ_ARG_WITH_BOOL(arm-kuser,
4417 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4420 if test -n "$USE_ARM_KUSER"; then
4421 AC_DEFINE(USE_ARM_KUSER)
4424 dnl ========================================================
4428 dnl ========================================================
4430 MOZ_ARG_HEADER(Application)
4434 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4435 MOZ_BRANDING_DIRECTORY=
4436 MOZ_DBGRINFO_MODULES=
4439 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4440 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4447 MOZ_AUTH_EXTENSION=1
4448 MOZ_NO_ACTIVEX_SUPPORT=1
4449 MOZ_NO_INSPECTOR_APIS=
4450 MOZ_NO_XPCOM_OBSOLETE=
4459 MOZ_PLAINTEXT_EDITOR_ONLY=
4461 MOZ_PREF_EXTENSIONS=1
4462 MOZ_PROFILELOCKING=1
4464 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4466 MOZ_PYTHON_DEBUG_SUFFIX=
4467 MOZ_PYTHON_DLL_SUFFIX=
4468 MOZ_PYTHON_INCLUDES=
4472 MOZ_PYTHON_VER_DOTTED=
4478 MOZ_STATIC_MAIL_BUILD=
4483 MOZ_UNIVERSALCHARDET=1
4485 MOZ_USE_NATIVE_UCONV=
4487 MOZ_XPFE_COMPONENTS=1
4489 MOZ_XSLT_STANDALONE=
4497 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4498 NECKO_SMALL_BUFFERS=
4499 XPC_IDISPATCH_SUPPORT=
4502 case "$target_os" in
4511 case "$target_os" in
4512 msvc*|mks*|cygwin*|mingw*)
4513 if test -z "$GNU_CC"; then
4514 XPC_IDISPATCH_SUPPORT=1
4515 MOZ_NO_ACTIVEX_SUPPORT=
4516 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4521 MOZ_ARG_ENABLE_STRING(application,
4522 [ --enable-application=APP
4526 content/xslt (Standalone Transformiix XSLT)
4527 netwerk (Standalone Necko)
4528 tools/update-packaging (AUS-related packaging tools)
4529 standalone (use this for standalone
4530 xpcom/xpconnect or to manually drive a build)],
4531 [ MOZ_BUILD_APP=$enableval ] )
4533 MOZ_EMBEDDING_PROFILE=default
4534 MOZ_ARG_WITH_STRING(embedding-profile,
4535 [ --with-embedding-profile=default|basic|minimal
4536 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4537 [ MOZ_EMBEDDING_PROFILE=$withval ])
4539 case "$MOZ_EMBEDDING_PROFILE" in
4541 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4542 MOZ_EMBEDDING_LEVEL_BASIC=1
4543 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4544 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4545 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4546 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4550 MOZ_EMBEDDING_LEVEL_DEFAULT=
4551 MOZ_EMBEDDING_LEVEL_BASIC=1
4552 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4553 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4554 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4556 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4558 MOZ_ENABLE_POSTSCRIPT=
4559 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4560 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4561 MOZ_IMG_ENCODERS_DEFAULT=
4567 MOZ_NO_ACTIVEX_SUPPORT=1
4568 MOZ_NO_INSPECTOR_APIS=1
4569 MOZ_NO_XPCOM_OBSOLETE=1
4572 MOZ_PLAINTEXT_EDITOR_ONLY=1
4574 MOZ_PREF_EXTENSIONS=
4578 MOZ_UNIVERSALCHARDET=
4580 MOZ_USE_NATIVE_UCONV=
4582 MOZ_XPFE_COMPONENTS=
4587 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4588 NECKO_SMALL_BUFFERS=1
4589 NS_DISABLE_LOGGING=1
4594 MOZ_EMBEDDING_LEVEL_DEFAULT=
4595 MOZ_EMBEDDING_LEVEL_BASIC=
4596 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4597 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4599 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4601 MOZ_ENABLE_POSTSCRIPT=
4602 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4603 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4604 MOZ_IMG_ENCODERS_DEFAULT=
4610 MOZ_NO_ACTIVEX_SUPPORT=1
4611 MOZ_NO_INSPECTOR_APIS=1
4612 MOZ_NO_XPCOM_OBSOLETE=1
4615 MOZ_PLAINTEXT_EDITOR_ONLY=1
4617 MOZ_PREF_EXTENSIONS=
4623 MOZ_UNIVERSALCHARDET=
4625 MOZ_USE_NATIVE_UCONV=1
4627 MOZ_XPFE_COMPONENTS=
4634 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4635 NECKO_SMALL_BUFFERS=1
4636 NS_DISABLE_LOGGING=1
4641 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4645 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4646 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4647 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4649 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4650 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4651 XULRUNNER_STUB_NAME=$withval)
4653 if test -z "$XULRUNNER_STUB_NAME"; then
4654 case "$target_os" in
4656 XULRUNNER_STUB_NAME=xulrunner
4659 XULRUNNER_STUB_NAME=xulrunner-stub
4662 AC_SUBST(XULRUNNER_STUB_NAME)
4664 if test -z "$MOZ_BUILD_APP"; then
4665 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4667 # We have a valid application only if it has a build.mk file in its top
4669 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4670 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4674 # Allow the application to influence configure with a confvars.sh script.
4676 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4677 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4678 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4679 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4684 # Now is a good time to test for logic errors, define mismatches, etc.
4685 case "$MOZ_BUILD_APP" in
4687 if test "$LIBXUL_SDK"; then
4688 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4693 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4694 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4696 case "$MOZ_BUILD_APP" in
4698 AC_DEFINE(MOZ_PHOENIX)
4702 AC_DEFINE(MOZ_XULRUNNER)
4710 MOZ_APP_NAME=mozilla
4711 MOZ_APP_DISPLAYNAME=Mozilla
4712 MOZ_APP_VERSION=$MOZILLA_VERSION
4717 AC_SUBST(MOZ_BUILD_APP)
4718 AC_SUBST(MOZ_PHOENIX)
4719 AC_SUBST(MOZ_XULRUNNER)
4721 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4723 dnl ========================================================
4725 dnl = Toolkit Options
4727 dnl ========================================================
4728 MOZ_ARG_HEADER(Toolkit Options)
4730 dnl ========================================================
4731 dnl = Select the default toolkit
4732 dnl ========================================================
4733 MOZ_ARG_ENABLE_STRING(default-toolkit,
4734 [ --enable-default-toolkit=TK
4735 Select default toolkit
4736 Platform specific defaults:
4738 Mac OS X - cairo-cocoa
4739 Neutrino/QNX - photon
4741 Win32 - cairo-windows
4743 Gtk2 with DirectFB - cairo-gtk2-dfb
4746 [ _DEFAULT_TOOLKIT=$enableval ],
4747 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4749 if test "$_DEFAULT_TOOLKIT" = "photon" \
4750 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4751 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4752 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
4753 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4754 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4755 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4756 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4757 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4759 dnl nglayout only supports building with one toolkit,
4760 dnl so ignore everything after the first comma (",").
4761 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4763 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4766 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4768 dnl ========================================================
4769 dnl = Enable the toolkit as needed =
4770 dnl ========================================================
4772 case "$MOZ_WIDGET_TOOLKIT" in
4775 AC_DEFINE(MOZ_WIDGET_PHOTON)
4779 MOZ_WIDGET_TOOLKIT=windows
4780 MOZ_GFX_TOOLKIT=cairo
4783 cairo-gtk2|cairo-gtk2-x11)
4784 MOZ_WIDGET_TOOLKIT=gtk2
4785 MOZ_GFX_TOOLKIT=cairo
4787 MOZ_ENABLE_XREMOTE=1
4792 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4793 TK_LIBS='$(MOZ_GTK2_LIBS)'
4794 AC_DEFINE(MOZ_WIDGET_GTK2)
4798 MOZ_WIDGET_TOOLKIT=gtk2
4799 MOZ_GFX_TOOLKIT=cairo
4805 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4806 TK_LIBS='$(MOZ_GTK2_LIBS)'
4807 AC_DEFINE(MOZ_WIDGET_GTK2)
4808 if test "$no_x" != "yes"; then
4809 AC_MSG_WARN([Disabling X when DirectFB is specified.])
4815 MOZ_WIDGET_TOOLKIT=qt
4816 MOZ_GFX_TOOLKIT=cairo
4818 MOZ_ENABLE_XREMOTE=1
4825 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4826 TK_LIBS='$(MOZ_QT_LIBS)'
4827 AC_DEFINE(MOZ_WIDGET_QT)
4831 MOZ_WIDGET_TOOLKIT=beos
4832 MOZ_GFX_TOOLKIT=cairo
4833 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4834 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4838 MOZ_WIDGET_TOOLKIT=os2
4839 MOZ_GFX_TOOLKIT=cairo
4840 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4841 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4845 MOZ_WIDGET_TOOLKIT=cocoa
4846 AC_DEFINE(MOZ_WIDGET_COCOA)
4848 MOZ_GFX_TOOLKIT=cairo
4849 MOZ_USER_DIR="Mozilla"
4850 AC_DEFINE(XP_MACOSX)
4851 AC_DEFINE(TARGET_CARBON)
4852 AC_DEFINE(TARGET_API_MAC_CARBON)
4853 TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
4854 TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
4855 CFLAGS="$CFLAGS $TK_CFLAGS"
4856 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4860 if test "$MOZ_ENABLE_XREMOTE"; then
4861 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4864 if test "$COMPILE_ENVIRONMENT"; then
4865 if test "$MOZ_ENABLE_GTK2"; then
4866 if test "$MOZ_X11"; then
4867 GDK_PACKAGES=gdk-x11-2.0
4868 elif test "$MOZ_DFB"; then
4869 PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
4870 GDK_PACKAGES=directfb
4873 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4876 fi # COMPILE_ENVIRONMENT
4878 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4880 dnl ========================================================
4881 dnl = startup-notification support module
4882 dnl ========================================================
4884 if test "$MOZ_ENABLE_GTK2"
4886 MOZ_ENABLE_STARTUP_NOTIFICATION=
4888 MOZ_ARG_ENABLE_BOOL(startup-notification,
4889 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4890 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4891 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4892 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4894 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4895 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4896 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4897 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4899 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4901 MOZ_ENABLE_STARTUP_NOTIFICATION=
4905 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4906 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4909 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4911 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4912 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4913 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4915 dnl ========================================================
4917 dnl ========================================================
4918 if test "$MOZ_ENABLE_QT"
4920 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtUiTools QtCore)
4921 AC_SUBST(MOZ_QT_CFLAGS)
4922 AC_SUBST(MOZ_QT_LIBS)
4924 MOZ_ARG_WITH_STRING(qtdir,
4925 [ --with-qtdir=\$dir Specify Qt directory ],
4928 if test -z "$QTDIR"; then
4931 QTINCDIR="/include/qt"
4932 if test ! -d "$QTDIR$QTINCDIR"; then
4933 QTINCDIR="/include/X11/qt"
4935 if test ! -d "$QTDIR$QTINCDIR"; then
4939 if test -x "$QTDIR/bin/moc-qt4"; then
4940 HOST_MOC="$QTDIR/bin/moc-qt4"
4942 if test -x "$QTDIR/bin/moc"; then
4943 HOST_MOC="$QTDIR/bin/moc"
4945 AC_CHECK_PROGS(HOST_MOC, moc, "")
4948 if test -z "$HOST_MOC"; then
4949 AC_MSG_ERROR([no acceptable moc preprocessor found])
4954 AC_SUBST(GTK_CONFIG)
4958 AC_SUBST(MOZ_ENABLE_GTK2)
4959 AC_SUBST(MOZ_ENABLE_PHOTON)
4960 AC_SUBST(MOZ_ENABLE_COCOA)
4961 AC_SUBST(MOZ_ENABLE_QT)
4962 AC_SUBST(MOZ_ENABLE_XREMOTE)
4963 AC_SUBST(MOZ_GTK2_CFLAGS)
4964 AC_SUBST(MOZ_GTK2_LIBS)
4965 AC_SUBST(MOZ_QT_CFLAGS)
4966 AC_SUBST(MOZ_QT_LIBS)
4973 dnl ========================================================
4975 dnl = Components & Features
4977 dnl ========================================================
4978 MOZ_ARG_HEADER(Components and Features)
4980 dnl ========================================================
4982 dnl ========================================================
4983 MOZ_ARG_ENABLE_STRING(ui-locale,
4984 [ --enable-ui-locale=ab-CD
4985 Select the user interface locale (default: en-US)],
4986 MOZ_UI_LOCALE=$enableval )
4987 AC_SUBST(MOZ_UI_LOCALE)
4989 dnl ========================================================
4990 dnl = Trademarked Branding
4991 dnl ========================================================
4992 MOZ_ARG_ENABLE_BOOL(official-branding,
4993 [ --enable-official-branding Enable Official mozilla.org Branding
4994 Do not distribute builds with
4995 --enable-official-branding unless you have
4996 permission to use trademarks per
4997 http://www.mozilla.org/foundation/trademarks/ .],
4998 [case "$MOZ_BUILD_APP" in
5000 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
5001 MOZ_APP_DISPLAYNAME=Firefox
5005 AC_MSG_ERROR([Official branding is only available for Firefox.])
5009 MOZ_ARG_WITH_STRING(branding,
5010 [ --with-branding=dir Use branding from the specified directory.],
5011 MOZ_BRANDING_DIRECTORY=$withval)
5013 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
5014 if test -z "$REAL_BRANDING_DIRECTORY"; then
5015 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5018 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
5019 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
5022 AC_SUBST(MOZ_BRANDING_DIRECTORY)
5024 dnl ========================================================
5025 dnl = Distribution ID
5026 dnl ========================================================
5027 MOZ_ARG_WITH_STRING(distribution-id,
5028 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
5029 [ val=`echo $withval`
5030 MOZ_DISTRIBUTION_ID="$val"])
5032 if test -z "$MOZ_DISTRIBUTION_ID"; then
5033 MOZ_DISTRIBUTION_ID="org.mozilla"
5036 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
5037 AC_SUBST(MOZ_DISTRIBUTION_ID)
5040 dnl ========================================================
5041 dnl complex text support off by default
5042 dnl ========================================================
5044 MOZ_ARG_DISABLE_BOOL(pango,
5045 [ --disable-pango Disable usage of Pango ],
5050 dnl ========================================================
5052 dnl ========================================================
5053 if test "$MOZ_ENABLE_GTK2"
5057 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5059 if test "$MOZ_PANGO"
5061 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5062 AC_SUBST(MOZ_PANGO_CFLAGS)
5063 AC_SUBST(MOZ_PANGO_LIBS)
5064 AC_DEFINE(MOZ_PANGO)
5066 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5067 AC_SUBST(MOZ_PANGO_CFLAGS)
5068 AC_SUBST(MOZ_PANGO_LIBS)
5070 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5071 AC_SUBST(FT2_CFLAGS)
5076 dnl ========================================================
5077 dnl = PostScript print module
5078 dnl ========================================================
5079 MOZ_ARG_DISABLE_BOOL(postscript,
5080 [ --disable-postscript Disable PostScript printing support ],
5081 MOZ_ENABLE_POSTSCRIPT=,
5082 MOZ_ENABLE_POSTSCRIPT=1 )
5084 dnl ========================================================
5085 dnl = GnomeVFS support module
5086 dnl ========================================================
5090 dnl build the gnomevfs extension by default only when the
5091 dnl GTK2 toolkit is in use.
5092 if test "$MOZ_ENABLE_GTK2"
5094 MOZ_ENABLE_GNOMEVFS=1
5098 MOZ_ARG_DISABLE_BOOL(gnomevfs,
5099 [ --disable-gnomevfs Disable GnomeVFS support ],
5100 MOZ_ENABLE_GNOMEVFS=,
5101 MOZ_ENABLE_GNOMEVFS=force)
5103 if test "$MOZ_ENABLE_GNOMEVFS"
5105 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5106 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5107 MOZ_ENABLE_GNOMEVFS=1
5109 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5111 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5113 MOZ_ENABLE_GNOMEVFS=
5117 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
5118 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5119 AC_SUBST(MOZ_GNOMEVFS_LIBS)
5121 if test "$MOZ_ENABLE_GCONF"
5123 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
5124 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5131 if test "$MOZ_ENABLE_GCONF"; then
5132 AC_DEFINE(MOZ_ENABLE_GCONF)
5135 AC_SUBST(MOZ_ENABLE_GCONF)
5136 AC_SUBST(MOZ_GCONF_CFLAGS)
5137 AC_SUBST(MOZ_GCONF_LIBS)
5139 # The GNOME component is built if gtk2, gconf and gnome-vfs
5140 # are all available.
5142 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
5143 "$MOZ_ENABLE_GNOMEVFS"; then
5144 MOZ_ENABLE_GNOME_COMPONENT=1
5146 MOZ_ENABLE_GNOME_COMPONENT=
5149 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5152 dnl ========================================================
5153 dnl = libgnomeui support module
5154 dnl ========================================================
5156 if test "$MOZ_ENABLE_GTK2"
5158 MOZ_ENABLE_GNOMEUI=1
5160 MOZ_ARG_DISABLE_BOOL(gnomeui,
5161 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5162 MOZ_ENABLE_GNOMEUI=,
5163 MOZ_ENABLE_GNOMEUI=force)
5165 if test "$MOZ_ENABLE_GNOMEUI"
5167 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5169 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5170 MOZ_ENABLE_GNOMEUI=1
5172 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5174 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5180 if test "$MOZ_ENABLE_GNOMEUI"; then
5181 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5184 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5185 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5186 AC_SUBST(MOZ_GNOMEUI_LIBS)
5188 dnl ========================================================
5190 dnl ========================================================
5192 if test "$MOZ_ENABLE_GTK2" || test "$MOZ_ENABLE_QT"
5196 MOZ_ARG_DISABLE_BOOL(dbus,
5197 [ --disable-dbus Disable dbus support ],
5201 if test "$MOZ_ENABLE_DBUS"
5203 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5204 AC_DEFINE(MOZ_ENABLE_DBUS)
5207 AC_SUBST(MOZ_ENABLE_DBUS)
5208 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5209 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5211 dnl ========================================================
5212 dnl = libnotify support
5213 dnl ========================================================
5215 MOZ_ARG_ENABLE_BOOL(libnotify,
5216 [ --enable-libnotify Enable libnotify support ],
5217 MOZ_ENABLE_LIBNOTIFY=1,
5218 MOZ_ENABLE_LIBNOTIFY=)
5220 if test "$MOZ_ENABLE_GTK2"
5222 if test "$MOZ_ENABLE_LIBNOTIFY"
5224 AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5228 if test -z "$SKIP_LIBRARY_CHECKS"
5230 if test "$MOZ_ENABLE_GTK2"
5232 if test "$MOZ_ENABLE_LIBNOTIFY"
5234 PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5238 AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5239 AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5240 AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5242 dnl ========================================================
5243 dnl = Build Personal Security Manager
5244 dnl ========================================================
5245 MOZ_ARG_DISABLE_BOOL(crypto,
5246 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5250 dnl ========================================================
5251 dnl = JS Debugger XPCOM component (js/jsd)
5252 dnl ========================================================
5253 MOZ_ARG_DISABLE_BOOL(jsd,
5254 [ --disable-jsd Disable JavaScript debug library],
5259 dnl ========================================================
5260 dnl = Disable plugin support
5261 dnl ========================================================
5262 MOZ_ARG_DISABLE_BOOL(plugins,
5263 [ --disable-plugins Disable plugins support],
5267 dnl ========================================================
5268 dnl = Disable building dbm
5269 dnl ========================================================
5270 MOZ_ARG_DISABLE_BOOL(dbm,
5271 [ --disable-dbm Disable building dbm],
5275 dnl ========================================================
5276 dnl = Open JVM Interface (OJI) support
5277 dnl ========================================================
5278 MOZ_ARG_DISABLE_BOOL(oji,
5279 [ --disable-oji Disable Open JVM Integration support],
5282 if test -n "$MOZ_OJI"; then
5286 dnl bi-directional support always on
5290 dnl ========================================================
5291 dnl view source support on by default
5292 dnl ========================================================
5293 MOZ_ARG_DISABLE_BOOL(view-source,
5294 [ --disable-view-source Disable view source support],
5297 if test "$MOZ_VIEW_SOURCE"; then
5298 AC_DEFINE(MOZ_VIEW_SOURCE)
5302 dnl ========================================================
5303 dnl accessibility support on by default on all platforms
5305 dnl ========================================================
5306 MOZ_ARG_DISABLE_BOOL(accessibility,
5307 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5310 if test "$ACCESSIBILITY"; then
5311 AC_DEFINE(ACCESSIBILITY)
5314 if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5316 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5317 if test "$ac_cv_header_atlbase_h" = "no"; then
5318 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.])
5320 if test "$ac_cv_header_oleacc_idl" = "no"; then
5321 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.])
5327 dnl ========================================================
5328 dnl xpfe/components on by default
5329 dnl ========================================================
5330 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5331 [ --disable-xpfe-components
5332 Disable xpfe components],
5333 MOZ_XPFE_COMPONENTS=,
5334 MOZ_XPFE_COMPONENTS=1 )
5336 dnl ========================================================
5337 dnl xpinstall support on by default
5338 dnl ========================================================
5339 MOZ_ARG_DISABLE_BOOL(xpinstall,
5340 [ --disable-xpinstall Disable xpinstall support],
5343 if test "$MOZ_XPINSTALL"; then
5344 AC_DEFINE(MOZ_XPINSTALL)
5347 dnl ========================================================
5348 dnl xpcom js loader support on by default
5349 dnl ========================================================
5350 MOZ_ARG_DISABLE_BOOL(jsloader,
5351 [ --disable-jsloader Disable xpcom js loader support],
5354 if test "$MOZ_JSLOADER"; then
5355 AC_DEFINE(MOZ_JSLOADER)
5358 dnl ========================================================
5359 dnl Disable printing
5360 dnl ========================================================
5361 MOZ_ARG_DISABLE_BOOL(printing,
5362 [ --disable-printing Disable printing support],
5366 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
5367 AC_MSG_WARN([Printing does not work with Qt at this time. Omitting printing support.])
5371 if test "$NS_PRINTING"; then
5372 AC_DEFINE(NS_PRINTING)
5373 AC_DEFINE(NS_PRINT_PREVIEW)
5376 dnl ========================================================
5377 dnl use native unicode converters
5378 dnl ========================================================
5379 MOZ_ARG_ENABLE_BOOL(native-uconv,
5380 [ --enable-native-uconv Enable iconv support],
5381 MOZ_USE_NATIVE_UCONV=1,
5382 MOZ_USE_NATIVE_UCONV= )
5383 if test "$MOZ_USE_NATIVE_UCONV"; then
5384 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5386 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5387 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5391 dnl ========================================================
5392 dnl Libeditor can be build as plaintext-only,
5393 dnl or as a full html and text editing component.
5394 dnl We build both by default.
5395 dnl ========================================================
5396 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5397 [ --enable-plaintext-editor-only
5398 Allow only plaintext editing],
5399 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5400 MOZ_PLAINTEXT_EDITOR_ONLY= )
5401 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5402 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5404 dnl ========================================================
5405 dnl = Drop XPCOM Obsolete library
5406 dnl ========================================================
5407 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5408 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5409 MOZ_NO_XPCOM_OBSOLETE=1,
5410 MOZ_NO_XPCOM_OBSOLETE=)
5412 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5413 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5416 dnl ========================================================
5417 dnl = Disable Fast Load
5418 dnl ========================================================
5419 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5420 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5424 AC_SUBST(MOZ_NO_FAST_LOAD)
5426 if test -n "$MOZ_NO_FAST_LOAD"; then
5427 AC_DEFINE(MOZ_NO_FAST_LOAD)
5430 dnl ========================================================
5431 dnl = Disable Ogg Codecs
5432 dnl ========================================================
5433 MOZ_ARG_DISABLE_BOOL(ogg,
5434 [ --disable-ogg Disable Ogg Codec support],
5440 if test -n "$MOZ_OGG"; then
5446 dnl ========================================================
5447 dnl = Disable Wave decoder support
5448 dnl ========================================================
5449 MOZ_ARG_DISABLE_BOOL(wave,
5450 [ --disable-wave Disable Wave decoder support],
5456 if test -n "$MOZ_WAVE"; then
5462 dnl ========================================================
5463 dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
5464 dnl ========================================================
5466 AC_SUBST(MOZ_SYDNEYAUDIO)
5468 if test -n "$MOZ_SYDNEYAUDIO"; then
5469 AC_DEFINE(MOZ_SYDNEYAUDIO)
5474 if test -n "$MOZ_MEDIA"; then
5475 AC_DEFINE(MOZ_MEDIA)
5478 dnl ========================================================
5479 dnl = Check alsa availability on Linux if using sydneyaudio
5480 dnl ========================================================
5482 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5483 if test "$COMPILE_ENVIRONMENT"; then
5484 if test -n "$MOZ_SYDNEYAUDIO"; then
5485 case "$target_os" in
5487 AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
5493 dnl ========================================================
5494 dnl Permissions System
5495 dnl ========================================================
5496 MOZ_ARG_DISABLE_BOOL(permissions,
5497 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5502 dnl ========================================================
5504 dnl ========================================================
5505 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5506 [ --disable-negotiateauth Disable GSS-API negotiation ],
5507 MOZ_AUTH_EXTENSION=,
5508 MOZ_AUTH_EXTENSION=1 )
5510 dnl ========================================================
5512 dnl ========================================================
5513 MOZ_ARG_DISABLE_BOOL(xtf,
5514 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5517 if test "$MOZ_XTF"; then
5521 dnl ========================================================
5523 dnl ========================================================
5524 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5525 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5526 MOZ_NO_INSPECTOR_APIS=1,
5527 MOZ_NO_INSPECTOR_APIS= )
5529 dnl ========================================================
5530 dnl Pref extensions (autoconfig and system-pref)
5531 dnl ========================================================
5532 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5533 [ --disable-pref-extensions
5534 Disable pref extensions such as autoconfig and
5536 MOZ_PREF_EXTENSIONS=,
5537 MOZ_PREF_EXTENSIONS=1 )
5539 dnl ========================================================
5540 dnl = Universalchardet
5541 dnl ========================================================
5542 MOZ_ARG_DISABLE_BOOL(universalchardet,
5543 [ --disable-universalchardet
5544 Disable universal encoding detection],
5545 MOZ_UNIVERSALCHARDET=,
5546 MOZ_UNIVERSALCHARDET=1 )
5548 dnl ========================================================
5550 dnl ========================================================
5551 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5552 [ --enable-javaxpcom
5553 Enable Java-XPCOM bridge],
5557 if test -n "${MOZ_JAVAXPCOM}"; then
5560 if test -n "$JAVA_HOME"; then
5561 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5565 if test -n "$JAVA_HOME"; then
5566 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5571 if test -n "${JAVA_INCLUDE_PATH}"; then
5572 dnl Make sure jni.h exists in the given include path.
5573 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5574 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5577 case "$target_os" in
5579 dnl Default to java system location
5580 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5584 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5587 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5588 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.])
5592 if test -n "${JAVA_BIN_PATH}"; then
5593 dnl Look for javac and jar in the specified path.
5594 JAVA_PATH="$JAVA_BIN_PATH"
5596 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5597 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5600 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5601 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5602 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5603 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5604 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.])
5608 dnl ========================================================
5609 dnl = Breakpad crash reporting (on by default on supported platforms)
5610 dnl ========================================================
5612 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5613 || test "$OS_ARCH" = "Darwin" \
5614 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
5615 || test "$OS_ARCH" = "SunOS") \
5616 && test -z "$HAVE_64BIT_OS"; then
5620 MOZ_ARG_DISABLE_BOOL(crashreporter,
5621 [ --disable-crashreporter Disable breakpad crash reporting],
5623 MOZ_CRASHREPORTER=1)
5625 if test -n "$MOZ_CRASHREPORTER"; then
5626 AC_DEFINE(MOZ_CRASHREPORTER)
5628 if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
5629 test -z "$SKIP_LIBRARY_CHECKS"; then
5630 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5631 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5632 AC_SUBST(MOZ_GTHREAD_LIBS)
5634 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.])])
5638 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5639 [ --with-crashreporter-enable-percent=NN Enable sending crash reports by default on NN% of users. (default=100)],
5640 [ val=`echo $withval | sed 's/[^0-9]//g'`
5641 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5643 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5644 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5646 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5648 dnl ========================================================
5649 dnl = Enable compilation of specific extension modules
5650 dnl ========================================================
5652 MOZ_ARG_ENABLE_STRING(extensions,
5653 [ --enable-extensions Enable extensions],
5654 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5655 if test "$option" = "yes" || test "$option" = "all"; then
5656 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5657 elif test "$option" = "no" || test "$option" = "none"; then
5659 elif test "$option" = "default"; then
5660 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5661 elif test `echo "$option" | grep -c \^-` != 0; then
5662 option=`echo $option | sed 's/^-//'`
5663 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5665 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5668 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5670 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5671 # Suppress warning on non-X11 platforms
5672 if test -n "$MOZ_X11"; then
5673 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5675 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5678 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5679 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5680 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5683 dnl This might be temporary: build tridentprofile only on Windows
5684 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5685 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5686 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5689 dnl cookie must be built before tridentprofile. put it at list's end.
5690 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5691 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5692 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5695 dnl xforms requires xtf and schema-validation
5696 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5697 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5698 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5700 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5701 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5702 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5705 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5706 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5707 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5710 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5711 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5712 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5715 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5716 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5717 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5720 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5721 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5722 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5725 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5726 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5727 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5730 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5731 AC_MSG_WARN([spellcheck is no longer an extension.])
5732 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5735 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5736 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5737 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5741 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5743 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5744 dnl when trying to build a non-existent extension.
5745 for extension in $MOZ_EXTENSIONS; do
5746 if test ! -d "${srcdir}/extensions/${extension}"; then
5747 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5752 dnl ========================================================
5754 dnl ========================================================
5755 case "$MOZ_WIDGET_TOOLKIT" in
5756 beos|windows|os2|mac|cocoa)
5759 if test -z "$MOZ_ENABLE_GTK2" && test -z "$MOZ_ENABLE_QT"; then
5760 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5765 MOZ_ARG_ENABLE_STRING(image-decoders,
5766 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5767 Enable specific image decoders],
5768 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5769 if test "$option" = "yes" || test "$option" = "all"; then
5770 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5771 elif test "$option" = "no" || test "$option" = "none"; then
5773 elif test "$option" = "default"; then
5774 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5775 elif test `echo "$option" | grep -c \^-` != 0; then
5776 option=`echo $option | sed 's/^-//'`
5777 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5779 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5782 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5784 dnl Dupes are removed in the encoder section because it will also add decoders
5786 dnl ========================================================
5788 dnl ========================================================
5789 MOZ_ARG_ENABLE_STRING(image-encoders,
5790 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5791 Enable specific image encoders],
5792 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5793 if test "$option" = "yes" || test "$option" = "all"; then
5794 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5795 elif test "$option" = "no" || test "$option" = "none"; then
5798 elif test "$option" = "default"; then
5799 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5800 elif test `echo "$option" | grep -c \^-` != 0; then
5801 option=`echo $option | sed 's/^-//'`
5802 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5804 addencoder="$option"
5806 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5808 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5811 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5812 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5814 dnl ========================================================
5815 dnl MathML on by default
5816 dnl ========================================================
5817 MOZ_ARG_DISABLE_BOOL(mathml,
5818 [ --disable-mathml Disable MathML support],
5821 if test "$MOZ_MATHML"; then
5822 AC_DEFINE(MOZ_MATHML)
5825 dnl ========================================================
5827 dnl ========================================================
5828 MOZ_ARG_DISABLE_BOOL(canvas,
5829 [ --disable-canvas Disable html:canvas feature],
5831 MOZ_ENABLE_CANVAS=1 )
5832 if test -n "$MOZ_ENABLE_CANVAS"; then
5833 AC_DEFINE(MOZ_ENABLE_CANVAS)
5835 AC_SUBST(MOZ_ENABLE_CANVAS)
5837 dnl ========================================================
5839 dnl ========================================================
5840 MOZ_ARG_DISABLE_BOOL(svg,
5841 [ --disable-svg Disable SVG support],
5844 if test -n "$MOZ_SVG"; then
5848 dnl ========================================================
5850 dnl ========================================================
5852 MOZ_ARG_DISABLE_BOOL(smil,
5853 [ --disable-smil Disable SMIL animation support],
5856 # Automatically disable SMIL if SVG is disabled
5857 if test -z "$MOZ_SVG"; then
5860 if test -n "$MOZ_SMIL"; then
5864 dnl ========================================================
5865 dnl Build Freetype in the tree
5866 dnl ========================================================
5867 MOZ_ARG_ENABLE_BOOL(tree-freetype,
5868 [ --enable-tree-freetype Enable Tree FreeType],
5869 MOZ_TREE_FREETYPE=1,
5870 MOZ_TREE_FREETYPE= )
5871 if test -n "$MOZ_TREE_FREETYPE"; then
5872 AC_DEFINE(MOZ_TREE_FREETYPE)
5873 AC_SUBST(MOZ_TREE_FREETYPE)
5874 MOZ_ENABLE_CAIRO_FT=1
5875 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
5876 FC_FONT_FEATURE="#define CAIRO_DISABLE_FONTCONFIG 1"
5877 FT2_CFLAGS="-I${topsrcdir}/modules/freetype2/include"
5878 CAIRO_FT_CFLAGS="-I${topsrcdir}/modules/freetype2/include"
5879 FT2_LIBS="${LIBXUL_DIST}/lib/freetype2.lib"
5880 CAIRO_FT_LIBS = "${LIBXUL_DIST}/lib/freetype2.lib"
5881 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
5882 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
5883 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
5884 AC_SUBST(CAIRO_FT_CFLAGS)
5888 dnl ========================================================
5890 dnl ========================================================
5891 case "$target_os" in
5892 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5897 MOZ_ARG_DISABLE_BOOL(installer,
5898 [ --disable-installer Disable building of installer],
5901 if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
5902 # Disable installer for Windows builds that use the new toolkit if NSIS
5903 # isn't in the path.
5904 MOZ_PATH_PROGS(MAKENSIS, makensis)
5905 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5906 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5908 # The Windows build for NSIS requires the iconv command line utility to
5909 # convert the charset of the locale files.
5910 MOZ_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5911 if test -z "$HOST_ICONV"; then
5912 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5916 # Automatically disable installer if xpinstall isn't built
5917 if test -z "$MOZ_XPINSTALL"; then
5920 AC_SUBST(MOZ_INSTALLER)
5922 AC_MSG_CHECKING([for tar archiver])
5923 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
5924 if test -z "$TAR"; then
5925 AC_MSG_ERROR([no tar archiver found in \$PATH])
5927 AC_MSG_RESULT([$TAR])
5930 AC_MSG_CHECKING([for wget])
5931 AC_CHECK_PROGS(WGET, wget, "")
5932 AC_MSG_RESULT([$WGET])
5935 dnl ========================================================
5937 dnl ========================================================
5939 MOZ_ARG_DISABLE_BOOL(updater,
5940 [ --disable-updater Disable building of updater],
5943 AC_SUBST(MOZ_UPDATER)
5945 # app update channel is 'default' when not supplied.
5946 MOZ_ARG_ENABLE_STRING([update-channel],
5947 [ --enable-update-channel=CHANNEL
5948 Select application update channel (default=default)],
5949 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
5951 if test -z "$MOZ_UPDATE_CHANNEL"; then
5952 MOZ_UPDATE_CHANNEL=default
5954 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5956 # tools/update-packaging is not checked out by default.
5957 MOZ_ARG_ENABLE_BOOL(update-packaging,
5958 [ --enable-update-packaging
5959 Enable tools/update-packaging],
5960 MOZ_UPDATE_PACKAGING=1,
5961 MOZ_UPDATE_PACKAGING= )
5962 AC_SUBST(MOZ_UPDATE_PACKAGING)
5964 dnl ========================================================
5966 dnl ========================================================
5968 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
5969 [ --disable-xpconnect-idispatch
5970 Disable building of xpconnect support for IDispatch
5972 XPC_IDISPATCH_SUPPORT=,
5973 XPC_IDISPATCH_SUPPORT=1)
5974 AC_SUBST(XPC_IDISPATCH_SUPPORT)
5976 MOZ_ARG_DISABLE_BOOL(activex,
5977 [ --disable-activex Disable building of ActiveX control (win32 only)],
5978 MOZ_NO_ACTIVEX_SUPPORT=1,
5979 MOZ_NO_ACTIVEX_SUPPORT= )
5980 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
5982 MOZ_ARG_DISABLE_BOOL(activex-scripting,
5983 [ --disable-activex-scripting
5984 Disable building of ActiveX scripting support (win32)],
5985 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
5986 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
5987 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
5989 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
5991 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
5994 if test "$COMPILE_ENVIRONMENT" = "1"; then
5995 if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
5997 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5998 if test "$ac_cv_header_atlbase_h" = "no"; then
5999 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.])
6006 dnl ========================================================
6008 dnl ========================================================
6009 MOZ_ARG_ENABLE_BOOL(leaky,
6010 [ --enable-leaky Build leaky memory tool],
6015 dnl ========================================================
6017 dnl ========================================================
6018 MOZ_ARG_ENABLE_BOOL(xpctools,
6019 [ --enable-xpctools Build JS profiling tool],
6024 dnl ========================================================
6025 dnl build the tests by default
6026 dnl ========================================================
6027 MOZ_ARG_DISABLE_BOOL(tests,
6028 [ --disable-tests Do not build test libraries & programs],
6032 dnl ========================================================
6033 dnl parental controls (for Windows Vista)
6034 dnl ========================================================
6035 MOZ_ARG_DISABLE_BOOL(parental-controls,
6036 [ --disable-parental-controls
6037 Do not build parental controls],
6038 MOZ_DISABLE_PARENTAL_CONTROLS=1,
6039 MOZ_DISABLE_PARENTAL_CONTROLS=)
6040 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6041 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6044 dnl ========================================================
6045 dnl Vista SDK specific api
6046 dnl ========================================================
6047 MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
6048 [ --disable-vista-sdk-requirements
6049 Do not build Vista SDK specific code],
6050 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
6051 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
6052 if test -n "$COMPILE_ENVIRONMENT"; then
6053 if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
6054 AC_MSG_WARN([Resulting builds will not be compatible with Windows Vista. (bug 428970)])
6055 AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
6056 if test -z "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6057 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6059 MOZ_DISABLE_PARENTAL_CONTROLS=1
6062 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
6063 if test "$ac_cv_header_wpcapi_h" = "no"; then
6064 AC_MSG_ERROR([System header wpcapi.h is not available. See updated http://developer.mozilla.org/en/docs/wpcapi.h for details on fixing this problem.])
6070 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6071 AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
6073 dnl ========================================================
6075 dnl = Module specific options
6077 dnl ========================================================
6078 MOZ_ARG_HEADER(Individual module options)
6080 dnl ========================================================
6081 dnl = Enable Lea malloc in xpcom. OFF by default.
6082 dnl ========================================================
6083 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
6084 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
6087 if test -n "$XPCOM_USE_LEA"; then
6088 AC_DEFINE(XPCOM_USE_LEA)
6091 dnl ========================================================
6092 dnl = Enable places (new history/bookmarks)
6093 dnl ========================================================
6094 MOZ_ARG_ENABLE_BOOL(places,
6095 [ --enable-places Enable 'places' bookmark/history implementation],
6098 if test -n "$MOZ_PLACES"; then
6099 AC_DEFINE(MOZ_PLACES)
6100 if test -z "$MOZ_MAIL_NEWS"; then
6105 if test "$MOZ_BUILD_APP" = "browser"; then
6106 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
6110 dnl ========================================================
6111 dnl = Disable feed handling components
6112 dnl ========================================================
6113 MOZ_ARG_DISABLE_BOOL(feeds,
6114 [ --disable-feeds Disable feed handling and processing components],
6117 if test -n "$MOZ_FEEDS"; then
6118 AC_DEFINE(MOZ_FEEDS)
6120 if test "$MOZ_BUILD_APP" = "browser"; then
6121 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6125 dnl ========================================================
6126 dnl = Enable mozStorage
6127 dnl ========================================================
6128 dnl Implicitly enabled by default if building calendar or places
6129 MOZ_ARG_ENABLE_BOOL(storage,
6130 [ --enable-storage Enable mozStorage module and related components],
6133 if test -n "$MOZ_STORAGE"; then
6134 AC_DEFINE(MOZ_STORAGE)
6137 dnl ========================================================
6138 dnl Check for sqlite
6139 dnl ========================================================
6142 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6143 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6144 MOZ_NATIVE_SQLITE=1,
6145 MOZ_NATIVE_SQLITE= )
6147 if test -z "$MOZ_NATIVE_SQLITE"
6150 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
6152 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6155 AC_SUBST(MOZ_NATIVE_SQLITE)
6157 dnl ========================================================
6158 dnl = Enable help viewer (off by default)
6159 dnl ========================================================
6160 MOZ_ARG_ENABLE_BOOL(help-viewer,
6161 [ --enable-help-viewer Enable help viewer],
6164 if test -n "$MOZ_HELP_VIEWER"; then
6165 AC_DEFINE(MOZ_HELP_VIEWER)
6167 AC_SUBST(MOZ_HELP_VIEWER)
6168 if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
6169 AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
6172 dnl ========================================================
6173 dnl = Enable safe browsing (anti-phishing)
6174 dnl ========================================================
6175 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6176 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6177 MOZ_SAFE_BROWSING=1,
6178 MOZ_SAFE_BROWSING= )
6179 if test -n "$MOZ_SAFE_BROWSING"; then
6180 AC_DEFINE(MOZ_SAFE_BROWSING)
6182 AC_SUBST(MOZ_SAFE_BROWSING)
6184 dnl ========================================================
6185 dnl = Enable url-classifier
6186 dnl ========================================================
6187 dnl Implicitly enabled by default if building with safe-browsing
6188 if test -n "$MOZ_SAFE_BROWSING"; then
6189 MOZ_URL_CLASSIFIER=1
6191 MOZ_ARG_ENABLE_BOOL(url-classifier,
6192 [ --enable-url-classifier Enable url classifier module],
6193 MOZ_URL_CLASSIFIER=1,
6194 MOZ_URL_CLASSIFIER= )
6195 if test -n "$MOZ_URL_CLASSIFIER"; then
6196 AC_DEFINE(MOZ_URL_CLASSIFIER)
6198 AC_SUBST(MOZ_URL_CLASSIFIER)
6200 dnl ========================================================
6201 dnl = Disable zipwriter
6202 dnl ========================================================
6203 MOZ_ARG_DISABLE_BOOL(zipwriter,
6204 [ --disable-zipwriter Disable zipwriter component],
6207 AC_SUBST(MOZ_ZIPWRITER)
6209 dnl ========================================================
6210 dnl = Enable Ultrasparc specific optimizations for JS
6211 dnl ========================================================
6212 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
6213 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
6214 JS_ULTRASPARC_OPTS=1,
6215 JS_ULTRASPARC_OPTS= )
6217 dnl only enable option for ultrasparcs
6218 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
6219 "$OS_TEST" != "sun4u"; then
6222 AC_SUBST(JS_ULTRASPARC_OPTS)
6224 dnl ========================================================
6225 dnl = Hildon and OSSO checks
6226 dnl ========================================================
6227 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime,
6228 MOZ_PLATFORM_HILDON=1,
6229 MOZ_PLATFORM_HILDON=)
6230 if test $MOZ_PLATFORM_HILDON; then
6231 AC_DEFINE(MOZ_PLATFORM_HILDON)
6232 X11_COMPOSITED_PLUGINS="yes"
6234 AC_SUBST(LIBHILDONMIME_CFLAGS)
6235 AC_SUBST(LIBHILDONMIME_LIBS)
6237 if test "$X11_COMPOSITED_PLUGINS" = "yes"; then
6238 dnl if we have Xcomposite we should also have Xdamage and Xfixes
6239 AC_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6240 [AC_MSG_ERROR([Couldn't find X11/extentsions/Xdamage.h which is required for composited plugins.])])
6241 AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6242 [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6244 AC_SUBST(XCOMPOSITE_LIBS)
6246 PKG_CHECK_MODULES(LIBOSSO,libosso,
6250 if test $NS_OSSO; then
6251 if test -z "$MOZ_ENABLE_DBUS"; then
6252 AC_MSG_ERROR([DBus is required when building for OSSO])
6255 MOZ_GFX_OPTIMIZE_MOBILE=1
6257 AC_SUBST(LIBOSSO_CFLAGS)
6258 AC_SUBST(LIBOSSO_LIBS)
6260 PKG_CHECK_MODULES(MOZ_LOCATION, [liblocation gpsbt],
6261 NS_MAEMO_LOCATION=1,
6264 if test $NS_MAEMO_LOCATION; then
6265 AC_DEFINE(NS_MAEMO_LOCATION)
6268 AC_SUBST(MOZ_LOCATION_CFLAGS)
6269 AC_SUBST(MOZ_LOCATION_LIBS)
6271 dnl ========================================================
6273 dnl = Feature options that require extra sources to be pulled
6275 dnl ========================================================
6276 dnl MOZ_ARG_HEADER(Features that require extra sources)
6278 dnl ========================================================
6280 dnl = Debugging Options
6282 dnl ========================================================
6283 MOZ_ARG_HEADER(Debugging and Optimizations)
6285 dnl ========================================================
6286 dnl = Disable building with debug info.
6287 dnl = Debugging is OFF by default
6288 dnl ========================================================
6289 if test -z "$MOZ_DEBUG_FLAGS"
6293 if test "$GNU_CC"; then
6294 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
6295 case "$GCC_VERSION" in
6300 MOZ_DEBUG_FLAGS="-g"
6304 MOZ_DEBUG_FLAGS="-g"
6308 MOZ_DEBUG_FLAGS="-g"
6313 MOZ_ARG_ENABLE_STRING(debug,
6314 [ --enable-debug[=DBG] Enable building with developer debug info
6315 (Using compiler flags DBG)],
6316 [ if test "$enableval" != "no"; then
6318 if test -n "$enableval" && test "$enableval" != "yes"; then
6319 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6326 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
6327 case "${target_os}" in
6329 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
6331 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6332 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
6335 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
6338 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
6340 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6342 if test -n "$MOZ_DEBUG"; then
6343 AC_MSG_CHECKING([for valid debug flags])
6344 _SAVE_CFLAGS=$CFLAGS
6345 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6346 AC_TRY_COMPILE([#include <stdio.h>],
6347 [printf("Hello World\n");],
6350 AC_MSG_RESULT([$_results])
6351 if test "$_results" = "no"; then
6352 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6354 CFLAGS=$_SAVE_CFLAGS
6357 dnl ========================================================
6358 dnl enable mobile optimizations
6359 dnl ========================================================
6360 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6361 [ --enable-mobile-optimize Enable mobile optimizations],
6362 MOZ_GFX_OPTIMIZE_MOBILE=1)
6364 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6366 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6367 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6370 dnl ========================================================
6371 dnl = Enable code optimization. ON by default.
6372 dnl ========================================================
6373 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6374 MOZ_OPTIMIZE_FLAGS="-O"
6377 MOZ_ARG_ENABLE_STRING(optimize,
6378 [ --disable-optimize Disable compiler optimization
6379 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6380 [ if test "$enableval" != "no"; then
6382 if test -n "$enableval" && test "$enableval" != "yes"; then
6383 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6388 fi ], MOZ_OPTIMIZE=1)
6390 if test "$COMPILE_ENVIRONMENT"; then
6391 if test -n "$MOZ_OPTIMIZE"; then
6392 AC_MSG_CHECKING([for valid optimization flags])
6393 _SAVE_CFLAGS=$CFLAGS
6394 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6395 AC_TRY_COMPILE([#include <stdio.h>],
6396 [printf("Hello World\n");],
6399 AC_MSG_RESULT([$_results])
6400 if test "$_results" = "no"; then
6401 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6403 CFLAGS=$_SAVE_CFLAGS
6405 fi # COMPILE_ENVIRONMENT
6407 AC_SUBST(MOZ_OPTIMIZE)
6408 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6409 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6410 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6412 dnl ========================================================
6413 dnl = Enable/disable debug for specific modules only
6414 dnl = module names beginning with ^ will be disabled
6415 dnl ========================================================
6416 MOZ_ARG_ENABLE_STRING(debug-modules,
6417 [ --enable-debug-modules Enable/disable debug info for specific modules],
6418 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6420 dnl ========================================================
6421 dnl = Enable/disable generation of debugger info for specific modules only
6422 dnl = the special module name ALL_MODULES can be used to denote all modules
6423 dnl = module names beginning with ^ will be disabled
6424 dnl ========================================================
6425 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6426 [ --enable-debugger-info-modules
6427 Enable/disable debugger info for specific modules],
6428 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6429 dnl note that the list of module names is reversed as it is copied
6430 dnl this is important, as it will allow config.mk to interpret stuff like
6431 dnl "^ALL_MODULES xpcom" properly
6432 if test "$i" = "no"; then
6435 if test "$i" = "yes"; then
6438 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6441 dnl ========================================================
6442 dnl Enable garbage collector
6443 dnl ========================================================
6444 MOZ_ARG_ENABLE_BOOL(boehm,
6445 [ --enable-boehm Enable the Boehm Garbage Collector],
6448 if test -n "$GC_LEAK_DETECTOR"; then
6449 AC_DEFINE(GC_LEAK_DETECTOR)
6452 dnl ========================================================
6453 dnl Disable runtime logging checks
6454 dnl ========================================================
6455 MOZ_ARG_DISABLE_BOOL(logging,
6456 [ --disable-logging Disable logging facilities],
6457 NS_DISABLE_LOGGING=1,
6458 NS_DISABLE_LOGGING= )
6459 if test "$NS_DISABLE_LOGGING"; then
6460 AC_DEFINE(NS_DISABLE_LOGGING)
6462 AC_DEFINE(MOZ_LOGGING)
6465 dnl ========================================================
6466 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6467 dnl ========================================================
6468 _ENABLE_LOGREFCNT=42
6469 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6470 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6471 _ENABLE_LOGREFCNT=1,
6472 _ENABLE_LOGREFCNT= )
6473 if test "$_ENABLE_LOGREFCNT" = "1"; then
6474 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6475 elif test -z "$_ENABLE_LOGREFCNT"; then
6476 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6479 dnl ========================================================
6480 dnl = Enable trace malloc
6481 dnl ========================================================
6482 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6483 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6484 [ --enable-trace-malloc Enable malloc tracing],
6487 if test "$NS_TRACE_MALLOC"; then
6488 # Please, Mr. Linker Man, don't take away our symbol names
6489 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6491 AC_DEFINE(NS_TRACE_MALLOC)
6493 AC_SUBST(NS_TRACE_MALLOC)
6495 dnl ========================================================
6496 dnl = Enable jemalloc
6497 dnl ========================================================
6498 MOZ_ARG_ENABLE_BOOL(jemalloc,
6499 [ --enable-jemalloc Replace memory allocator with jemalloc],
6503 if test "$NS_TRACE_MALLOC"; then
6507 if test "$MOZ_MEMORY"; then
6509 dnl Don't try to run compiler tests on Windows
6510 if test "$OS_ARCH" = "WINNT"; then
6511 if test -z "$HAVE_64BIT_OS"; then
6512 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6514 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6517 AC_CHECK_SIZEOF([int *], [4])
6518 case "${ac_cv_sizeof_int_p}" in
6520 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6523 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6526 AC_MSG_ERROR([Unexpected pointer size])
6531 AC_DEFINE(MOZ_MEMORY)
6532 if test "x$MOZ_DEBUG" = "x1"; then
6533 AC_DEFINE(MOZ_MEMORY_DEBUG)
6535 dnl The generic feature tests that determine how to compute ncpus are long and
6536 dnl complicated. Therefore, simply define special cpp variables for the
6537 dnl platforms we have special knowledge of.
6538 case "${target_os}" in
6540 AC_DEFINE(MOZ_MEMORY_DARWIN)
6543 AC_DEFINE(MOZ_MEMORY_BSD)
6546 AC_DEFINE(MOZ_MEMORY_LINUX)
6549 AC_DEFINE(MOZ_MEMORY_BSD)
6552 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6554 msvc*|mks*|cygwin*|mingw*)
6555 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6556 dnl XXX: should test for vc8sp1 here, otherwise patching the crt src
6557 dnl will fail miserably
6558 if test "$_CC_SUITE" -lt "8"; then
6559 AC_MSG_ERROR([Building jemalloc requires Visual C++ 2005 or better])
6561 if test -z "$WIN32_CRT_SRC_DIR" -a -z "$WIN32_CUSTOM_CRT_DIR"; then
6562 if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6563 AC_MSG_ERROR([When building jemalloc, either set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src), or set WIN32_CUSTOM_CRT_DIR to the path to a folder containing a pre-built CRT DLL.])
6565 WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6568 if test -z "$WIN32_CRT_SRC_DIR"; then
6570 WIN32_CUSTOM_CRT_DIR=`cd "$WIN32_CUSTOM_CRT_DIR" && pwd`
6571 _WIN_UNIX_CRT_PATH="$WIN32_CUSTOM_CRT_DIR"
6573 # CRT source directory
6574 WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd`
6575 _CRT_BASE_DIR=`basename "$WIN32_CRT_SRC_DIR"`
6576 _WIN_UNIX_CRT_PATH="$_objdir/memory/jemalloc/$_CRT_BASE_DIR/build/intel"
6578 dnl need win32 paths in LIB, hence this python abuse. extra brackets
6580 _WIN_CRT_PATH=[`$PYTHON -c 'import sys, os.path; print os.path.normpath(sys.argv[1])' "$_WIN_UNIX_CRT_PATH"`]
6581 MOZ_LIB="$_WIN_CRT_PATH;$LIB"
6582 dnl Needs to be in PATH too, since our tools will wind up linked against it.
6583 dnl This needs to be unix style.
6584 MOZ_PATH="$PATH:$_WIN_UNIX_CRT_PATH"
6585 dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6586 AC_DEFINE(_STATIC_CPPLIB)
6587 dnl Don't generate a manifest, since we're linking to a custom CRT.
6588 LDFLAGS="$LDFLAGS -MANIFEST:NO"
6589 dnl Also pass this to NSPR/NSS
6590 DLLFLAGS="$DLLFLAGS -MANIFEST:NO"
6594 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6598 AC_SUBST(MOZ_MEMORY)
6599 AC_SUBST(WIN32_CRT_SRC_DIR)
6600 AC_SUBST(WIN32_CUSTOM_CRT_DIR)
6603 dnl Need to set this for make because NSS doesn't have configure
6606 dnl ========================================================
6607 dnl = Use malloc wrapper lib
6608 dnl ========================================================
6609 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6610 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6614 if test -n "$_WRAP_MALLOC"; then
6615 if test "$GNU_CC"; then
6616 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"
6617 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6621 dnl ========================================================
6622 dnl = Location of malloc wrapper lib
6623 dnl ========================================================
6624 MOZ_ARG_WITH_STRING(wrap-malloc,
6625 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6626 WRAP_MALLOC_LIB=$withval)
6628 dnl ========================================================
6630 dnl ========================================================
6631 MOZ_ARG_ENABLE_BOOL(valgrind,
6632 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
6635 if test -n "$MOZ_VALGRIND"; then
6636 AC_CHECK_HEADER([valgrind/valgrind.h], [],
6638 [--enable-valgrind specified but Valgrind is not installed]))
6639 AC_DEFINE(MOZ_VALGRIND)
6642 dnl ========================================================
6643 dnl = Use Electric Fence
6644 dnl ========================================================
6645 MOZ_ARG_ENABLE_BOOL(efence,
6646 [ --enable-efence Link with Electric Fence],
6649 if test -n "$_ENABLE_EFENCE"; then
6650 AC_CHECK_LIB(efence,malloc)
6653 dnl ========================================================
6655 dnl ========================================================
6656 MOZ_ARG_ENABLE_BOOL(jprof,
6657 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6660 if test -n "$MOZ_JPROF"; then
6661 AC_DEFINE(MOZ_JPROF)
6664 dnl ========================================================
6666 dnl ========================================================
6667 MOZ_ARG_ENABLE_BOOL(shark,
6668 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6671 if test -n "$MOZ_SHARK"; then
6672 AC_DEFINE(MOZ_SHARK)
6675 dnl ========================================================
6677 dnl ========================================================
6678 MOZ_ARG_ENABLE_BOOL(callgrind,
6679 [ --enable-callgrind Enable callgrind profiling],
6682 if test -n "$MOZ_CALLGRIND"; then
6683 AC_DEFINE(MOZ_CALLGRIND)
6686 dnl ========================================================
6688 dnl ========================================================
6689 MOZ_ARG_ENABLE_BOOL(vtune,
6690 [ --enable-vtune Enable vtune profiling],
6693 if test -n "$MOZ_VTUNE"; then
6694 AC_DEFINE(MOZ_VTUNE)
6697 dnl ========================================================
6698 dnl Zealous JavaScript GC
6699 dnl ========================================================
6700 MOZ_ARG_ENABLE_BOOL(gczeal,
6701 [ --enable-gczeal Enable zealous JavaScript GCing],
6704 if test -n "$JS_GC_ZEAL"; then
6705 AC_DEFINE(JS_GC_ZEAL)
6708 dnl ========================================================
6709 dnl = Enable static checking using gcc-dehydra
6710 dnl ========================================================
6712 MOZ_ARG_WITH_STRING(static-checking,
6713 [ --with-static-checking=path/to/gcc_dehydra.so
6714 Enable static checking of code using GCC-dehydra],
6715 DEHYDRA_PATH=$withval,
6718 if test -n "$DEHYDRA_PATH"; then
6719 if test ! -f "$DEHYDRA_PATH"; then
6720 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
6722 AC_DEFINE(NS_STATIC_CHECKING)
6724 AC_SUBST(DEHYDRA_PATH)
6726 dnl ========================================================
6727 dnl = Enable stripping of libs & executables
6728 dnl ========================================================
6729 MOZ_ARG_ENABLE_BOOL(strip,
6730 [ --enable-strip Enable stripping of libs & executables ],
6734 dnl ========================================================
6735 dnl = Enable stripping of libs & executables when packaging
6736 dnl ========================================================
6737 MOZ_ARG_ENABLE_BOOL(install-strip,
6738 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6742 dnl ========================================================
6743 dnl = --enable-elf-dynstr-gc
6744 dnl ========================================================
6745 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6746 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6747 USE_ELF_DYNSTR_GC=1,
6748 USE_ELF_DYNSTR_GC= )
6750 dnl ========================================================
6751 dnl = --enable-old-abi-compat-wrappers
6752 dnl ========================================================
6753 dnl on x86 linux, the current builds of some popular plugins (notably
6754 dnl flashplayer and real) expect a few builtin symbols from libgcc
6755 dnl which were available in some older versions of gcc. However,
6756 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6757 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6758 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6759 dnl to true on x86 linux, and false everywhere else.
6762 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6763 [ --enable-old-abi-compat-wrappers
6764 Support old GCC ABI symbols to ease the pain
6765 of the linux compiler change],
6766 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6767 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6768 if test "$COMPILE_ENVIRONMENT"; then
6769 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6772 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6774 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6776 fi # COMPILE_ENVIRONMENT
6778 dnl ========================================================
6780 dnl = Profiling and Instrumenting
6782 dnl ========================================================
6783 MOZ_ARG_HEADER(Profiling and Instrumenting)
6785 dnl ========================================================
6786 dnl = Enable timeline service, which provides lightweight
6787 dnl = instrumentation of mozilla for performance measurement.
6788 dnl = Timeline is off by default.
6789 dnl ========================================================
6790 MOZ_ARG_ENABLE_BOOL(timeline,
6791 [ --enable-timeline Enable timeline services ],
6794 if test -n "$MOZ_TIMELINE"; then
6795 AC_DEFINE(MOZ_TIMELINE)
6798 dnl ========================================================
6799 dnl Turn on reflow counting
6800 dnl ========================================================
6801 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6802 [ --enable-reflow-perf Enable reflow performance tracing],
6805 if test -n "$MOZ_REFLOW_PREF"; then
6806 AC_DEFINE(MOZ_REFLOW_PREF)
6808 AC_SUBST(MOZ_REFLOW_PERF)
6810 dnl ========================================================
6811 dnl Enable performance metrics.
6812 dnl ========================================================
6813 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6814 [ --enable-perf-metrics Enable performance metrics],
6817 if test -n "$MOZ_PERF_METRICS"; then
6818 AC_DEFINE(MOZ_PERF_METRICS)
6821 dnl ========================================================
6822 dnl Enable code size metrics.
6823 dnl ========================================================
6824 MOZ_ARG_ENABLE_BOOL(codesighs,
6825 [ --enable-codesighs Enable code size analysis tools],
6826 _ENABLE_CODESIGHS=1,
6827 _ENABLE_CODESIGHS= )
6828 if test -n "$_ENABLE_CODESIGHS"; then
6829 if test -d $srcdir/tools/codesighs; then
6832 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6836 dnl ========================================================
6837 dnl = Add support for Eazel profiler
6838 dnl ========================================================
6839 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6840 [ --enable-eazel-profiler-support
6841 Enable Corel/Eazel profiler support],
6842 ENABLE_EAZEL_PROFILER=1,
6843 ENABLE_EAZEL_PROFILER= )
6844 if test -n "$ENABLE_EAZEL_PROFILER"; then
6845 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6847 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6848 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6849 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6852 MOZ_ARG_ENABLE_STRING(profile-modules,
6853 [ --enable-profile-modules
6854 Enable/disable profiling for specific modules],
6855 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6857 MOZ_ARG_ENABLE_BOOL(insure,
6858 [ --enable-insure Enable insure++ instrumentation (linux only)],
6861 if test -n "$_ENABLE_INSURE"; then
6865 MOZ_INSURE_EXCLUDE_DIRS="config"
6868 MOZ_ARG_WITH_STRING(insure-dirs,
6869 [ --with-insure-dirs=DIRS
6870 Dirs to instrument with insure ],
6871 MOZ_INSURE_DIRS=$withval )
6873 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6874 [ --with-insure-exclude-dirs=DIRS
6875 Dirs to not instrument with insure ],
6876 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6878 dnl ========================================================
6879 dnl = Support for Quantify (Windows)
6880 dnl ========================================================
6881 MOZ_ARG_ENABLE_BOOL(quantify,
6882 [ --enable-quantify Enable Quantify support (Windows only) ],
6886 dnl ========================================================
6887 dnl = Support for demangling undefined symbols
6888 dnl ========================================================
6889 if test -z "$SKIP_LIBRARY_CHECKS"; then
6892 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6896 # Demangle only for debug or trace-malloc builds
6897 MOZ_DEMANGLE_SYMBOLS=
6898 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6899 MOZ_DEMANGLE_SYMBOLS=1
6900 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6902 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6904 dnl ========================================================
6905 dnl = Support for gcc stack unwinding (from gcc 3.3)
6906 dnl ========================================================
6907 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6908 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6911 dnl ========================================================
6915 dnl ========================================================
6916 MOZ_ARG_HEADER(Misc. Options)
6918 dnl ========================================================
6919 dnl update xterm title
6920 dnl ========================================================
6921 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6922 [ --enable-xterm-updates Update XTERM titles with current command.],
6926 dnl =========================================================
6928 dnl =========================================================
6929 MOZ_ARG_ENABLE_STRING([chrome-format],
6930 [ --enable-chrome-format=jar|flat|both|symlink
6931 Select FORMAT of chrome files (default=jar)],
6932 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6934 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6935 MOZ_CHROME_FILE_FORMAT=jar
6938 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6939 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6940 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6941 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6942 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6945 dnl ========================================================
6946 dnl = Define default location for MOZILLA_FIVE_HOME
6947 dnl ========================================================
6948 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6949 [ --with-default-mozilla-five-home
6950 Set the default value for MOZILLA_FIVE_HOME],
6951 [ val=`echo $withval`
6952 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
6954 dnl ========================================================
6955 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
6956 dnl ========================================================
6957 MOZ_ARG_WITH_STRING(user-appdir,
6958 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
6959 [ val=`echo $withval`
6960 if echo "$val" | grep "\/" >/dev/null; then
6961 AC_MSG_ERROR("Homedir must be single relative path.")
6966 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
6968 dnl ========================================================
6969 dnl = Doxygen configuration
6970 dnl ========================================================
6971 dnl Use commas to specify multiple dirs to this arg
6972 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
6973 MOZ_ARG_WITH_STRING(doc-input-dirs,
6974 [ --with-doc-input-dirs=DIRS
6975 Header/idl dirs to create docs from],
6976 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6977 AC_SUBST(MOZ_DOC_INPUT_DIRS)
6979 dnl Use commas to specify multiple dirs to this arg
6980 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
6981 MOZ_ARG_WITH_STRING(doc-include-dirs,
6982 [ --with-doc-include-dirs=DIRS
6983 Include dirs to preprocess doc headers],
6984 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6985 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
6987 MOZ_DOC_OUTPUT_DIR='./dist/docs'
6988 MOZ_ARG_WITH_STRING(doc-output-dir,
6989 [ --with-doc-output-dir=DIR
6990 Dir to generate docs into],
6991 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
6992 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
6994 if test -z "$SKIP_COMPILER_CHECKS"; then
6995 dnl ========================================================
6997 dnl = Compiler Options
6999 dnl ========================================================
7000 MOZ_ARG_HEADER(Compiler Options)
7002 dnl ========================================================
7003 dnl Check for gcc -pipe support
7004 dnl ========================================================
7005 AC_MSG_CHECKING([for gcc -pipe support])
7006 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
7007 echo '#include <stdio.h>' > dummy-hello.c
7008 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7009 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7010 cat dummy-hello.s | ${AS_BIN} -o dummy-hello.S - 2>&5
7011 if test $? = 0; then
7016 if test "$_res_as_stdin" = "yes"; then
7017 _SAVE_CFLAGS=$CFLAGS
7018 CFLAGS="$CFLAGS -pipe"
7019 AC_TRY_COMPILE( [ #include <stdio.h> ],
7020 [printf("Hello World\n");],
7021 [_res_gcc_pipe="yes"],
7022 [_res_gcc_pipe="no"] )
7023 CFLAGS=$_SAVE_CFLAGS
7025 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
7027 CFLAGS="$CFLAGS -pipe"
7028 CXXFLAGS="$CXXFLAGS -pipe"
7032 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7033 AC_MSG_RESULT([$_res])
7038 dnl pass -Wno-long-long to the compiler
7039 MOZ_ARG_ENABLE_BOOL(long-long-warning,
7040 [ --enable-long-long-warning
7041 Warn about use of non-ANSI long long type],
7042 _IGNORE_LONG_LONG_WARNINGS=,
7043 _IGNORE_LONG_LONG_WARNINGS=1)
7045 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
7046 _SAVE_CFLAGS="$CFLAGS"
7047 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
7048 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
7049 AC_TRY_COMPILE([], [return(0);],
7050 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7051 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7052 result="yes" ], result="no")
7053 AC_MSG_RESULT([$result])
7054 CFLAGS="$_SAVE_CFLAGS"
7057 dnl ========================================================
7058 dnl Profile guided optimization
7059 dnl ========================================================
7060 dnl Test for profiling options
7061 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
7062 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7064 dnl Provide a switch to disable PGO even when called via profiledbuild.
7065 MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
7066 [ --disable-profile-guided-optimization
7067 Don't build with PGO even if called via make profiledbuild],
7068 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
7069 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
7071 AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
7073 _SAVE_CFLAGS="$CFLAGS"
7074 CFLAGS="$CFLAGS -fprofile-generate"
7076 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7077 AC_TRY_COMPILE([], [return 0;],
7078 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7079 result="yes" ], result="no")
7080 AC_MSG_RESULT([$result])
7082 if test $result = "yes"; then
7083 PROFILE_GEN_LDFLAGS="-fprofile-generate"
7084 PROFILE_USE_CFLAGS="-fprofile-use"
7085 PROFILE_USE_LDFLAGS="-fprofile-use"
7087 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
7088 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
7089 AC_TRY_COMPILE([], [return 0;],
7090 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
7091 result="yes" ], result="no")
7092 AC_MSG_RESULT([$result])
7093 if test $result = "yes"; then
7094 PROFILE_USE_CFLAGS="-fbranch-probabilities"
7096 # don't really care, this is an old GCC
7097 PROFILE_GEN_LDFLAGS=
7098 PROFILE_USE_LDFLAGS=
7101 CFLAGS="$_SAVE_CFLAGS"
7103 if test -n "$INTEL_CC"; then
7104 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7105 PROFILE_GEN_LDFLAGS=
7106 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7107 PROFILE_USE_LDFLAGS=
7110 dnl Sun Studio on Solaris
7111 if test "$SOLARIS_SUNPRO_CC"; then
7112 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7113 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7114 if test "$CPU_ARCH" != "sparc"; then
7115 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7116 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7118 PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7119 PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7123 AC_SUBST(PROFILE_GEN_CFLAGS)
7124 AC_SUBST(PROFILE_GEN_LDFLAGS)
7125 AC_SUBST(PROFILE_USE_CFLAGS)
7126 AC_SUBST(PROFILE_USE_LDFLAGS)
7130 dnl ========================================================
7131 dnl Test for -pedantic bustage
7132 dnl ========================================================
7133 MOZ_ARG_DISABLE_BOOL(pedantic,
7134 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7136 if test "$_PEDANTIC"; then
7137 _SAVE_CXXFLAGS=$CXXFLAGS
7138 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7139 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7140 AC_TRY_COMPILE([$configure_static_assert_macros],
7141 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7142 result="no", result="yes" )
7143 AC_MSG_RESULT([$result])
7144 CXXFLAGS="$_SAVE_CXXFLAGS"
7148 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
7149 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7152 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7157 dnl ========================================================
7158 dnl Test for correct temporary object destruction order
7159 dnl ========================================================
7160 dnl We want to make sure the compiler follows the C++ spec here as
7161 dnl xpcom and the string classes depend on it (bug 235381).
7162 AC_MSG_CHECKING([for correct temporary object destruction order])
7163 AC_TRY_RUN([ class A {
7164 public: A(int& x) : mValue(x) {}
7166 operator char**() { return 0; }
7167 private: int& mValue;
7169 void func(char **arg) {}
7180 result="yes", result="no", result="maybe")
7181 AC_MSG_RESULT([$result])
7183 if test "$result" = "no"; then
7184 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
7187 dnl ========================================================
7188 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7189 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7190 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7191 dnl ========================================================
7192 _SAVE_CXXFLAGS=$CXXFLAGS
7193 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7194 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7195 ac_nscap_nonconst_opeq_bug,
7204 template <class T, class U>
7205 int operator==(const Pointer<T>& rhs, U* lhs)
7207 return rhs.myPtr == lhs;
7210 template <class T, class U>
7211 int operator==(const Pointer<T>& rhs, const U* lhs)
7213 return rhs.myPtr == lhs;
7221 ac_nscap_nonconst_opeq_bug="no",
7222 ac_nscap_nonconst_opeq_bug="yes")])
7223 CXXFLAGS="$_SAVE_CXXFLAGS"
7225 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7226 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7228 fi # SKIP_COMPILER_CHECKS
7230 dnl ========================================================
7232 dnl Should be smarter and check that the compiler does indeed have rtti
7233 dnl ========================================================
7234 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
7235 [ --enable-cpp-rtti Enable C++ RTTI ],
7236 [ _MOZ_USE_RTTI=1 ],
7239 if test "$_MOZ_USE_RTTI"; then
7240 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
7242 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
7245 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
7247 dnl ========================================================
7248 dnl C++ exceptions (g++/egcs only - for now)
7249 dnl Should be smarter and check that the compiler does indeed have exceptions
7250 dnl ========================================================
7251 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
7252 [ --enable-cpp-exceptions Enable C++ exceptions ],
7253 [ _MOZ_CPP_EXCEPTIONS=1 ],
7254 [ _MOZ_CPP_EXCEPTIONS= ])
7256 if test "$_MOZ_CPP_EXCEPTIONS"; then
7257 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
7259 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
7262 # Irix & OSF native compilers do not like exception declarations
7263 # when exceptions are disabled
7264 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
7265 AC_DEFINE(CPP_THROW_NEW, [])
7267 AC_DEFINE(CPP_THROW_NEW, [throw()])
7271 dnl ========================================================
7273 dnl = Build depencency options
7275 dnl ========================================================
7276 MOZ_ARG_HEADER(Build dependencies)
7278 dnl ========================================================
7279 dnl = Do not auto generate dependency info
7280 dnl ========================================================
7282 MOZ_ARG_DISABLE_BOOL(auto-deps,
7283 [ --disable-auto-deps Do not automatically generate dependency info],
7287 if test -n "$MOZ_AUTO_DEPS"; then
7288 dnl ========================================================
7289 dnl = Use mkdepend instead of $CC -MD for dependency generation
7290 dnl ========================================================
7292 MOZ_ARG_DISABLE_BOOL(md,
7293 [ --disable-md Do not use compiler-based dependencies ],
7296 [dnl Default is to turn on -MD if using GNU-compatible compilers
7297 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
7300 dnl Default is to use -xM if using Sun Studio on Solaris
7301 if test "$SOLARIS_SUNPRO_CC"; then
7304 if test "$_cpp_md_flag"; then
7306 if test "$OS_ARCH" = "OpenVMS"; then
7307 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
7309 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
7311 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7312 if test "$SOLARIS_SUNPRO_CC"; then
7317 _USE_CPP_INCLUDE_FLAG=
7318 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7319 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7323 AC_SUBST(MOZ_AUTO_DEPS)
7324 AC_SUBST(COMPILER_DEPEND)
7328 dnl ========================================================
7330 dnl = Static Build Options
7332 dnl ========================================================
7333 MOZ_ARG_HEADER(Static build options)
7335 MOZ_ARG_ENABLE_BOOL(static,
7336 [ --enable-static Enable building of internal static libs],
7337 BUILD_STATIC_LIBS=1,
7340 dnl Disable libxul in debug builds, but not for xulrunner.
7341 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
7345 MOZ_ARG_ENABLE_BOOL(libxul,
7346 [ --enable-libxul Enable building of libxul],
7347 MOZ_ENABLE_LIBXUL=1,
7350 if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
7351 AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME. You probably want --enable-libxul.])
7354 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
7355 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
7358 AC_SUBST(LIBXUL_LIBS)
7360 if test -n "$MOZ_ENABLE_LIBXUL"; then
7361 XPCOM_LIBS="$LIBXUL_LIBS"
7362 AC_DEFINE(MOZ_ENABLE_LIBXUL)
7364 if test -n "$BUILD_STATIC_LIBS"; then
7365 AC_DEFINE(MOZ_STATIC_BUILD)
7367 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
7370 dnl ========================================================
7372 dnl = Standalone module options
7374 dnl ========================================================
7375 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7377 dnl Check for GLib and libIDL.
7378 dnl ========================================================
7379 case "$target_os" in
7380 msvc*|mks*|cygwin*|mingw*|wince*)
7381 SKIP_IDL_CHECK="yes"
7388 if test -z "$COMPILE_ENVIRONMENT"; then
7389 SKIP_IDL_CHECK="yes"
7392 dnl = Allow users to disable libIDL checking for standalone modules
7393 MOZ_ARG_WITHOUT_BOOL(libIDL,
7394 [ --without-libIDL Skip check for libIDL (standalone modules only)],
7395 SKIP_IDL_CHECK="yes")
7397 if test "$SKIP_IDL_CHECK" = "no"
7400 if test "$MACOS_SDK_DIR"; then
7401 dnl xpidl, and therefore libIDL, is only needed on the build host.
7402 dnl Don't build it against the SDK, as that causes problems.
7403 _MACSAVE_CFLAGS="$CFLAGS"
7404 _MACSAVE_LIBS="$LIBS"
7405 _MACSAVE_LDFLAGS="$LDFLAGS"
7406 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
7408 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"`
7409 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
7410 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
7415 if test "$MOZ_ENABLE_GTK2"; then
7416 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
7418 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
7419 dnl to either libIDL1 or libIDL2.
7420 if test -z "$_LIBIDL_FOUND"; then
7421 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
7422 if test -z "$_LIBIDL_FOUND"; then
7423 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
7427 dnl If we don't have a libIDL config program & not cross-compiling,
7428 dnl look for orbit-config instead.
7430 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
7431 MOZ_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
7432 if test -n "$ORBIT_CONFIG"; then
7433 AC_MSG_CHECKING([for ORBit libIDL usability])
7434 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
7435 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
7436 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
7437 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
7438 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
7439 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
7441 _SAVE_CFLAGS="$CFLAGS"
7443 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
7444 LIBS="$LIBIDL_LIBS $LIBS"
7447 #include <libIDL/IDL.h>
7450 s=strdup(IDL_get_libver_string());
7463 AC_MSG_RESULT($result)
7464 CFLAGS="$_SAVE_CFLAGS"
7468 if test -z "$_LIBIDL_FOUND"; then
7469 AC_MSG_ERROR([libIDL not found.
7470 libIDL $LIBIDL_VERSION or higher is required.])
7472 if test "$MACOS_SDK_DIR"; then
7473 CFLAGS="$_MACSAVE_CFLAGS"
7474 LIBS="$_MACSAVE_LIBS"
7475 LDFLAGS="$_MACSAVE_LDFLAGS"
7476 if test -n "$_MACSAVE_NEXT_ROOT" ; then
7477 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
7482 if test -n "$CROSS_COMPILE"; then
7483 if test -z "$HOST_LIBIDL_CONFIG"; then
7484 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
7486 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
7487 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
7488 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
7490 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
7491 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
7495 if test -z "$SKIP_PATH_CHECKS"; then
7496 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
7497 if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" ; then
7498 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7500 AM_PATH_GLIB(${GLIB_VERSION})
7505 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
7506 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7509 AC_SUBST(LIBIDL_CFLAGS)
7510 AC_SUBST(LIBIDL_LIBS)
7511 AC_SUBST(STATIC_LIBIDL)
7512 AC_SUBST(GLIB_CFLAGS)
7514 AC_SUBST(GLIB_GMODULE_LIBS)
7515 AC_SUBST(HOST_LIBIDL_CONFIG)
7516 AC_SUBST(HOST_LIBIDL_CFLAGS)
7517 AC_SUBST(HOST_LIBIDL_LIBS)
7519 dnl ========================================================
7521 dnl ========================================================
7522 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7525 MOZ_ARG_ENABLE_BOOL(system-cairo,
7526 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7530 # Check for headers defining standard int types.
7531 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7533 if test "$MOZ_TREE_CAIRO"; then
7534 AC_DEFINE(MOZ_TREE_CAIRO)
7536 # For now we assume that we will have a uint64_t available through
7537 # one of the above headers or mozstdint.h.
7538 AC_DEFINE(HAVE_UINT64_T)
7540 # Define macros for cairo-features.h
7541 if test "$MOZ_X11"; then
7542 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7543 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7544 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7545 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7546 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7547 MOZ_ENABLE_CAIRO_FT=1
7548 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7550 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
7551 QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
7553 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7554 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7555 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7556 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7558 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7559 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7560 if test -z "$WINCE"; then
7561 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7565 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7567 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7568 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7569 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7570 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7571 MOZ_ENABLE_CAIRO_FT=1
7572 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7573 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7575 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7576 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7577 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7578 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7579 MOZ_ENABLE_CAIRO_FT=1
7581 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7582 AC_SUBST(CAIRO_FT_CFLAGS)
7584 if test "$MOZ_DEBUG"; then
7585 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7587 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7590 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7592 AC_SUBST(PS_SURFACE_FEATURE)
7593 AC_SUBST(PDF_SURFACE_FEATURE)
7594 AC_SUBST(SVG_SURFACE_FEATURE)
7595 AC_SUBST(XLIB_SURFACE_FEATURE)
7596 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7597 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7598 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7599 AC_SUBST(XCB_SURFACE_FEATURE)
7600 AC_SUBST(WIN32_SURFACE_FEATURE)
7601 AC_SUBST(OS2_SURFACE_FEATURE)
7602 AC_SUBST(BEOS_SURFACE_FEATURE)
7603 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7604 AC_SUBST(FT_FONT_FEATURE)
7605 AC_SUBST(FC_FONT_FEATURE)
7606 AC_SUBST(WIN32_FONT_FEATURE)
7607 AC_SUBST(QUARTZ_FONT_FEATURE)
7608 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7609 AC_SUBST(QPAINTER_SURFACE_FEATURE)
7611 if test "$_WIN32_MSVC"; then
7612 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7614 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"
7616 if test "$MOZ_X11"; then
7617 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7621 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7622 mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
7625 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7626 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7627 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7628 if test "$MOZ_X11"; then
7629 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7630 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7631 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7635 AC_SUBST(MOZ_TREE_CAIRO)
7636 AC_SUBST(MOZ_CAIRO_CFLAGS)
7637 AC_SUBST(MOZ_CAIRO_LIBS)
7639 dnl ========================================================
7641 dnl ========================================================
7644 if test "$_WIN32_MSVC"; then
7645 if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
7646 LCMS_CFLAGS=-DLCMS_DLL
7648 LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
7650 LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
7653 AC_SUBST(LCMS_CFLAGS)
7656 dnl ========================================================
7658 dnl ========================================================
7659 MOZ_ARG_DISABLE_BOOL(xul,
7660 [ --disable-xul Disable XUL],
7662 if test "$MOZ_XUL"; then
7665 dnl remove extensions that require XUL
7666 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7671 dnl ========================================================
7672 dnl Two ways to enable Python support:
7673 dnl --enable-extensions=python # select all available.
7674 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7676 dnl --enable-extensions=python/xpcom,... # select individual ones
7678 dnl If either is used, we locate the Python to use.
7679 dnl ========================================================
7681 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7682 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7683 dnl Allow PYTHON to point to the Python interpreter to use
7684 dnl (note that it must be the python executable - which we
7685 dnl run to locate the relevant paths etc)
7686 dnl If not set, we use whatever Python we can find.
7688 dnl Ask Python what its version number is
7690 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7691 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7693 dnl Ask for the Python "prefix" (ie, home/source dir)
7694 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7695 dnl Setup the include and library directories.
7696 if test "$OS_ARCH" = "WINNT"; then
7697 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7698 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7699 dnl Binary trees have "include" for .h, and "libs" for .lib
7700 dnl We add 'em both - along with quotes, to handle spaces.
7701 MOZ_PYTHON_DLL_SUFFIX=.pyd
7702 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7703 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7705 dnl Non-Windows include and libs
7706 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7707 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7708 dnl Check for dynamic Python lib
7709 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7710 dnl - core, xpcom loader, pydom etc) all need to share Python.
7711 dnl - Python 2.3's std --enable-shared configure option will
7712 dnl create a libpython2.3.so.1.0. We should first try this
7713 dnl dotted versioned .so file because this is the one that
7714 dnl the PyXPCOM build mechanics tries to link to.
7715 dnl XXX Should find a better way than hardcoding "1.0".
7716 dnl - Python developement tree dir layouts are NOT allowed here
7717 dnl because the PyXPCOM build just dies on it later anyway.
7718 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7719 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7720 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7721 elif test -f "$MOZ_PYTHON_PREFIX/lib64/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7722 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib64 -lpython$MOZ_PYTHON_VER_DOTTED"
7723 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7724 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7725 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7726 dnl Don't Python development tree directory layout.
7727 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7728 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.])
7729 elif test "$OS_ARCH" = "Darwin"; then
7730 dnl We do Darwin last, so if a custom non-framework build of
7731 dnl python is used on OSX, then it will be picked up first by
7732 dnl the logic above.
7733 MOZ_PYTHON_LIBS="-framework Python"
7735 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7737 if test "$OS_ARCH" = "Linux"; then
7738 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7741 dnl Handle "_d" on Windows
7742 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7743 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7745 MOZ_PYTHON_DEBUG_SUFFIX=
7747 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7750 dnl If the user asks for the 'python' extension, then we add
7751 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7752 dnl Note the careful regex - it must match 'python' followed by anything
7753 dnl other than a '/', including the end-of-string.
7754 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7755 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7756 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7759 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7760 dnl command-line, but not yet
7761 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7762 AC_SUBST(MOZ_PYTHON)
7763 AC_SUBST(MOZ_PYTHON_PREFIX)
7764 AC_SUBST(MOZ_PYTHON_INCLUDES)
7765 AC_SUBST(MOZ_PYTHON_LIBS)
7766 AC_SUBST(MOZ_PYTHON_VER)
7767 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7768 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7769 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7771 dnl ========================================================
7772 dnl disable profile locking
7773 dnl do no use this in applications that can have more than
7774 dnl one process accessing the profile directory.
7775 dnl ========================================================
7776 MOZ_ARG_DISABLE_BOOL(profilelocking,
7777 [ --disable-profilelocking Disable profile locking],
7778 MOZ_PROFILELOCKING=,
7779 MOZ_PROFILELOCKING=1 )
7780 if test "$MOZ_PROFILELOCKING"; then
7781 AC_DEFINE(MOZ_PROFILELOCKING)
7784 dnl ========================================================
7785 dnl disable rdf services
7786 dnl ========================================================
7787 MOZ_ARG_DISABLE_BOOL(rdf,
7788 [ --disable-rdf Disable RDF],
7790 if test "$MOZ_RDF"; then
7796 dnl ========================================================
7797 dnl necko configuration options
7798 dnl ========================================================
7801 dnl option to disable various necko protocols
7803 MOZ_ARG_ENABLE_STRING(necko-protocols,
7804 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7805 Enable/disable specific protocol handlers],
7806 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7807 if test "$option" = "yes" || test "$option" = "all"; then
7808 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7809 elif test "$option" = "no" || test "$option" = "none"; then
7811 elif test "$option" = "default"; then
7812 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7813 elif test `echo "$option" | grep -c \^-` != 0; then
7814 option=`echo $option | sed 's/^-//'`
7815 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7817 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7820 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7822 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7823 AC_SUBST(NECKO_PROTOCOLS)
7824 for p in $NECKO_PROTOCOLS; do
7825 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7829 dnl option to disable necko's disk cache
7831 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7832 [ --disable-necko-disk-cache
7833 Disable necko disk cache],
7836 AC_SUBST(NECKO_DISK_CACHE)
7837 if test "$NECKO_DISK_CACHE"; then
7838 AC_DEFINE(NECKO_DISK_CACHE)
7842 dnl option to disable necko's wifi scanner
7844 MOZ_ARG_DISABLE_BOOL(necko-wifi,
7845 [ --disable-necko-wifi Disable necko wifi scanner],
7849 if test "$NECKO_WIFI"; then
7851 if test "$OS_ARCH" = "Linux"; then
7852 AC_CHECK_HEADER([iwlib.h])
7853 if test "$ac_cv_header_iwlib_h" = "yes"; then
7856 elif test "$OS_ARCH" = "Darwin"; then
7858 elif test "$OS_ARCH" = "WINNT"; then
7861 AC_MSG_WARN([Necko WiFi scanning not supported on your platform.])
7863 AC_SUBST(NECKO_WIFI)
7865 if test "$NECKO_WIFI"; then
7866 AC_DEFINE(NECKO_WIFI)
7870 AC_SUBST(NECKO_WIFI)
7874 dnl option to minimize size of necko's i/o buffers
7876 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7877 [ --enable-necko-small-buffers
7878 Minimize size of necko's i/o buffers],
7879 NECKO_SMALL_BUFFERS=1,
7880 NECKO_SMALL_BUFFERS=)
7881 AC_SUBST(NECKO_SMALL_BUFFERS)
7882 if test "$NECKO_SMALL_BUFFERS"; then
7883 AC_DEFINE(NECKO_SMALL_BUFFERS)
7887 dnl option to disable cookies
7889 MOZ_ARG_DISABLE_BOOL(cookies,
7890 [ --disable-cookies Disable cookie support],
7893 AC_SUBST(NECKO_COOKIES)
7894 if test "$NECKO_COOKIES"; then
7895 AC_DEFINE(NECKO_COOKIES)
7898 dnl NECKO_ configuration options are not global
7899 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7901 dnl Only build Mork if it's required
7903 if test "$MOZ_MORK"; then
7907 dnl Build the lightweight Mork reader if required
7908 AC_SUBST(MOZ_MORKREADER)
7909 if test "$MOZ_MORKREADER"; then
7910 AC_DEFINE(MOZ_MORKREADER)
7913 dnl ========================================================
7914 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7915 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7918 dnl ========================================================
7920 dnl = Maintainer debug option (no --enable equivalent)
7922 dnl ========================================================
7927 AC_SUBST(AR_EXTRACT)
7931 AC_SUBST(AS_DASH_C_FLAG)
7936 AC_SUBST(USE_SHORT_LIBNAME)
7940 AC_SUBST(NS_USE_NATIVE)
7941 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7942 AC_SUBST(MOZ_GFX_TOOLKIT)
7943 AC_SUBST(MOZ_UPDATE_XTERM)
7945 AC_SUBST(MOZ_PLATFORM_HILDON)
7947 AC_SUBST(NS_MAEMO_LOCATION)
7948 AC_SUBST(MOZ_AUTH_EXTENSION)
7949 AC_SUBST(MOZ_MATHML)
7950 AC_SUBST(MOZ_PERMISSIONS)
7952 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7953 AC_SUBST(MOZ_PREF_EXTENSIONS)
7956 AC_SUBST(MOZ_XSLT_STANDALONE)
7957 AC_SUBST(MOZ_JS_LIBS)
7960 AC_SUBST(MOZ_DEBUG_MODULES)
7961 AC_SUBST(MOZ_PROFILE_MODULES)
7962 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7963 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7964 AC_SUBST(MOZ_DEBUG_FLAGS)
7965 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7966 AC_SUBST(WARNINGS_AS_ERRORS)
7967 AC_SUBST(MOZ_DBGRINFO_MODULES)
7968 AC_SUBST(MOZ_EXTENSIONS)
7969 AC_SUBST(MOZ_IMG_DECODERS)
7970 AC_SUBST(MOZ_IMG_ENCODERS)
7971 AC_SUBST(MOZ_JSDEBUGGER)
7973 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7974 AC_SUBST(MOZ_PLUGINS)
7975 AC_SUBST(ENABLE_EAZEL_PROFILER)
7976 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7977 AC_SUBST(EAZEL_PROFILER_LIBS)
7978 AC_SUBST(MOZ_PERF_METRICS)
7979 AC_SUBST(GC_LEAK_DETECTOR)
7980 AC_SUBST(MOZ_LOG_REFCNT)
7984 AC_SUBST(MOZ_CALLGRIND)
7986 AC_SUBST(MOZ_XPCTOOLS)
7987 AC_SUBST(MOZ_JSLOADER)
7988 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7989 AC_SUBST(MOZ_INSURE)
7990 AC_SUBST(MOZ_INSURE_DIRS)
7991 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7992 AC_SUBST(MOZ_QUANTIFY)
7993 AC_SUBST(MOZ_INSURIFYING)
7995 AC_SUBST(MOZ_PLACES)
7996 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7997 AC_SUBST(MOZ_STORAGE)
7999 AC_SUBST(NS_PRINTING)
8001 AC_SUBST(MOZ_JAVAXPCOM)
8002 AC_SUBST(JAVA_INCLUDE_PATH)
8007 AC_SUBST(MOZ_PROFILELOCKING)
8010 AC_SUBST(MOZ_XIE_LIBS)
8011 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
8013 AC_SUBST(XPCOM_USE_LEA)
8014 AC_SUBST(BUILD_STATIC_LIBS)
8015 AC_SUBST(MOZ_ENABLE_LIBXUL)
8016 AC_SUBST(ENABLE_TESTS)
8018 AC_SUBST(MOZ_UNIVERSALCHARDET)
8019 AC_SUBST(ACCESSIBILITY)
8020 AC_SUBST(MOZ_XPINSTALL)
8021 AC_SUBST(MOZ_VIEW_SOURCE)
8022 AC_SUBST(MOZ_SPELLCHECK)
8023 AC_SUBST(MOZ_XPFE_COMPONENTS)
8024 AC_SUBST(MOZ_USER_DIR)
8025 AC_SUBST(MOZ_CRASHREPORTER)
8027 AC_SUBST(ENABLE_STRIP)
8028 AC_SUBST(PKG_SKIP_STRIP)
8029 AC_SUBST(USE_ELF_DYNSTR_GC)
8030 AC_SUBST(INCREMENTAL_LINKER)
8031 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8032 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8033 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
8035 AC_SUBST(MOZ_FIX_LINK_PATHS)
8036 AC_SUBST(XPCOM_LIBS)
8037 AC_SUBST(XPCOM_FROZEN_LDOPTS)
8038 AC_SUBST(XPCOM_GLUE_LDOPTS)
8039 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8041 AC_SUBST(USE_DEPENDENT_LIBS)
8043 AC_SUBST(MOZ_BUILD_ROOT)
8044 AC_SUBST(MOZ_OS2_TOOLS)
8045 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
8047 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8048 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8049 AC_SUBST(MOZ_TIMELINE)
8051 AC_SUBST(WINCE_SDK_DIR)
8053 AC_SUBST(MOZ_APP_NAME)
8054 AC_SUBST(MOZ_APP_DISPLAYNAME)
8055 AC_SUBST(MOZ_APP_VERSION)
8056 AC_SUBST(FIREFOX_VERSION)
8058 AC_SUBST(MOZ_PKG_SPECIAL)
8060 AC_SUBST(MOZILLA_OFFICIAL)
8061 AC_SUBST(BUILD_OFFICIAL)
8062 AC_SUBST(MOZ_MILESTONE_RELEASE)
8065 AC_SUBST(MOZ_PROFILE)
8066 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8067 AC_SUBST(MOZ_MAPINFO)
8068 AC_SUBST(MOZ_BROWSE_INFO)
8069 AC_SUBST(MOZ_TOOLS_DIR)
8070 AC_SUBST(CYGWIN_WRAPPER)
8072 AC_SUBST(WIN32_REDIST_DIR)
8076 AC_SUBST(WINCE_WINDOWS_MOBILE)
8078 dnl Echo the CFLAGS to remove extra whitespace.
8085 $_MOZ_EXCEPTIONS_FLAGS \
8086 $_WARNINGS_CXXFLAGS \
8089 COMPILE_CFLAGS=`echo \
8094 COMPILE_CXXFLAGS=`echo \
8095 $_DEFINES_CXXFLAGS \
8099 AC_SUBST(SYSTEM_MAKEDEPEND)
8100 AC_SUBST(SYSTEM_LIBXUL)
8101 AC_SUBST(SYSTEM_JPEG)
8102 AC_SUBST(SYSTEM_PNG)
8103 AC_SUBST(SYSTEM_ZLIB)
8104 AC_SUBST(SYSTEM_BZ2)
8106 AC_SUBST(JPEG_CFLAGS)
8108 AC_SUBST(ZLIB_CFLAGS)
8110 AC_SUBST(BZ2_CFLAGS)
8112 AC_SUBST(PNG_CFLAGS)
8115 AC_SUBST(MOZ_JPEG_CFLAGS)
8116 AC_SUBST(MOZ_JPEG_LIBS)
8117 AC_SUBST(MOZ_ZLIB_CFLAGS)
8118 AC_SUBST(MOZ_ZLIB_LIBS)
8119 AC_SUBST(MOZ_BZ2_CFLAGS)
8120 AC_SUBST(MOZ_BZ2_LIBS)
8121 AC_SUBST(MOZ_PNG_CFLAGS)
8122 AC_SUBST(MOZ_PNG_LIBS)
8124 AC_SUBST(NSPR_CFLAGS)
8126 AC_SUBST(MOZ_NATIVE_NSPR)
8128 AC_SUBST(NSS_CFLAGS)
8130 AC_SUBST(NSS_DEP_LIBS)
8131 AC_SUBST(MOZ_NATIVE_NSS)
8132 AC_SUBST(NSS_DISABLE_DBM)
8137 AC_SUBST(COMPILE_CFLAGS)
8138 AC_SUBST(COMPILE_CXXFLAGS)
8141 AC_SUBST(CROSS_COMPILE)
8142 AC_SUBST(WCHAR_CFLAGS)
8146 AC_SUBST(HOST_CFLAGS)
8147 AC_SUBST(HOST_CXXFLAGS)
8148 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8150 AC_SUBST(HOST_AR_FLAGS)
8152 AC_SUBST(HOST_RANLIB)
8153 AC_SUBST(HOST_NSPR_MDCPUCFG)
8154 AC_SUBST(HOST_BIN_SUFFIX)
8155 AC_SUBST(HOST_OS_ARCH)
8157 AC_SUBST(TARGET_CPU)
8158 AC_SUBST(TARGET_VENDOR)
8160 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8161 AC_SUBST(TARGET_MD_ARCH)
8162 AC_SUBST(TARGET_XPCOM_ABI)
8165 AC_SUBST(OS_RELEASE)
8168 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
8169 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8171 AC_SUBST(WRAP_MALLOC_CFLAGS)
8172 AC_SUBST(WRAP_MALLOC_LIB)
8175 AC_SUBST(MKSHLIB_FORCE_ALL)
8176 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8177 AC_SUBST(DSO_CFLAGS)
8178 AC_SUBST(DSO_PIC_CFLAGS)
8179 AC_SUBST(DSO_LDOPTS)
8180 AC_SUBST(LIB_PREFIX)
8181 AC_SUBST(DLL_PREFIX)
8182 AC_SUBST(DLL_SUFFIX)
8183 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8184 AC_SUBST(LIB_SUFFIX)
8185 AC_SUBST(OBJ_SUFFIX)
8186 AC_SUBST(BIN_SUFFIX)
8187 AC_SUBST(ASM_SUFFIX)
8188 AC_SUBST(IMPORT_LIB_SUFFIX)
8190 AC_SUBST(CC_VERSION)
8191 AC_SUBST(CXX_VERSION)
8192 AC_SUBST(MSMANIFEST_TOOL)
8194 if test "$USING_HCC"; then
8195 CC='${topsrcdir}/build/hcc'
8197 CXX='${topsrcdir}/build/hcpp'
8198 CXX="$CXX '$_OLDCXX'"
8203 dnl Check for missing components
8204 if test "$COMPILE_ENVIRONMENT"; then
8205 if test "$MOZ_X11"; then
8206 dnl ====================================================
8207 dnl = Check if X headers exist
8208 dnl ====================================================
8209 _SAVE_CFLAGS=$CFLAGS
8210 CFLAGS="$CFLAGS $XCFLAGS"
8214 #include <X11/Xlib.h>
8215 #include <X11/Intrinsic.h>
8219 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8220 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8224 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8225 CFLAGS="$_SAVE_CFLAGS"
8227 if test ! -z "$MISSING_X"; then
8228 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8232 fi # COMPILE_ENVIRONMENT
8234 dnl Set various defines and substitutions
8235 dnl ========================================================
8237 if test "$OS_ARCH" = "BeOS"; then
8240 elif test "$OS_ARCH" = "Darwin"; then
8242 AC_DEFINE(UNIX_ASYNC_DNS)
8244 elif test "$OS_ARCH" = "OpenVMS"; then
8246 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
8248 AC_DEFINE(UNIX_ASYNC_DNS)
8251 AC_SUBST(MOZ_MOVEMAIL)
8253 if test "$MOZ_DEBUG"; then
8254 AC_DEFINE(MOZ_REFLOW_PERF)
8255 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8258 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8259 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8260 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8261 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8262 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8263 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8264 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8265 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8266 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8269 # Used for LD_LIBRARY_PATH of run_viewer target
8271 for lib_arg in $NSPR_LIBS $TK_LIBS; do
8273 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
8279 dnl ========================================================
8280 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
8281 dnl ========================================================
8284 WIN_TOP_SRC=`cd $srcdir; pwd -W`
8287 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
8288 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
8289 CC="\$(CYGWIN_WRAPPER) $CC"
8290 CXX="\$(CYGWIN_WRAPPER) $CXX"
8291 CPP="\$(CYGWIN_WRAPPER) $CPP"
8292 LD="\$(CYGWIN_WRAPPER) $LD"
8293 AS="\$(CYGWIN_WRAPPER) $AS"
8294 RC="\$(CYGWIN_WRAPPER) $RC"
8295 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
8296 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
8297 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
8301 AC_SUBST(CYGDRIVE_MOUNT)
8302 AC_SUBST(WIN_TOP_SRC)
8304 AC_SUBST(MOZILLA_VERSION)
8306 AC_SUBST(ac_configure_args)
8308 dnl Spit out some output
8309 dnl ========================================================
8311 dnl The following defines are used by xpcom
8312 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8314 HAVE_CPP_2BYTE_WCHAR_T
8315 HAVE_CPP_ACCESS_CHANGING_USING
8316 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8318 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8320 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8321 HAVE_CPP_NAMESPACE_STD
8323 HAVE_CPP_PARTIAL_SPECIALIZATION
8324 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8326 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
8328 NEED_CPP_UNUSED_IMPLEMENTATIONS
8332 HAVE_ICONV_WITH_CONST_INPUT
8340 netwerk/necko-config.h
8341 xpcom/xpcom-config.h
8342 xpcom/xpcom-private.h
8345 # Save the defines header file before autoconf removes it.
8346 # (Do not add AC_DEFINE calls after this line.)
8347 _CONFIG_TMP=confdefs-tmp.h
8348 _CONFIG_DEFS_H=mozilla-config.h
8350 cat > $_CONFIG_TMP <<\EOF
8351 /* List of defines generated by configure. Included with preprocessor flag,
8352 * -include, to avoid long list of -D defines on the compile command-line.
8356 #ifndef _MOZILLA_CONFIG_H_
8357 #define _MOZILLA_CONFIG_H_
8360 _EGREP_PATTERN='^#define ('
8361 if test -n "$_NON_GLOBAL_ACDEFINES"; then
8362 for f in $_NON_GLOBAL_ACDEFINES; do
8363 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
8366 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
8368 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
8370 cat >> $_CONFIG_TMP <<\EOF
8372 #endif /* _MOZILLA_CONFIG_H_ */
8376 # Only write mozilla-config.h when something changes (or it doesn't exist)
8377 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
8380 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
8381 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
8383 echo ==== $_CONFIG_DEFS_H =================================
8387 dnl Probably shouldn't call this manually but we always want the output of DEFS
8388 rm -f confdefs.h.save
8389 mv confdefs.h confdefs.h.save
8390 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
8391 AC_OUTPUT_MAKE_DEFS()
8393 AC_SUBST(MOZ_DEFINES)
8395 mv confdefs.h.save confdefs.h
8397 dnl Load the list of Makefiles to generate.
8398 dnl To add new Makefiles, edit allmakefiles.sh.
8399 dnl allmakefiles.sh sets the variable, MAKEFILES.
8400 . ${srcdir}/allmakefiles.sh
8402 dnl Run a perl script to quickly create the makefiles.
8403 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
8404 dnl for the files it cannot handle correctly. This way, config.status
8405 dnl will handle these files.
8406 dnl If it fails, nothing is set and config.status will run as usual.
8408 dnl This does not change the $MAKEFILES variable.
8410 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
8412 if test -z "${AS_PERL}"; then
8413 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
8415 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
8420 echo $MAKEFILES > unallmakefiles
8422 mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
8424 AC_OUTPUT($MAKEFILES)
8426 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
8427 if test "$CAIRO_FEATURES_H"; then
8428 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
8429 echo "$CAIRO_FEATURES_H is unchanged"
8430 mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
8432 rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
8436 dnl ========================================================
8437 dnl = Setup a nice relatively clean build environment for
8438 dnl = sub-configures.
8439 dnl ========================================================
8442 CFLAGS="$_SUBDIR_CFLAGS"
8443 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8444 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8445 LDFLAGS="$_SUBDIR_LDFLAGS"
8446 HOST_CC="$_SUBDIR_HOST_CC"
8447 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8448 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8454 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8455 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8457 if test -z "$MOZ_NATIVE_NSPR"; then
8458 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8459 if test -z "$MOZ_DEBUG"; then
8460 ac_configure_args="$ac_configure_args --disable-debug"
8462 if test "$MOZ_OPTIMIZE" = "1"; then
8463 ac_configure_args="$ac_configure_args --enable-optimize"
8465 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8466 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8468 if test -n "$HAVE_64BIT_OS"; then
8469 ac_configure_args="$ac_configure_args --enable-64bit"
8471 if test -n "$USE_ARM_KUSER"; then
8472 ac_configure_args="$ac_configure_args --with-arm-kuser"
8474 AC_OUTPUT_SUBDIRS(nsprpub)
8475 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8478 if test -z "$MOZ_NATIVE_NSPR"; then
8479 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8480 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8481 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8482 NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
8483 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
8484 NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
8485 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
8487 rm -f config/autoconf.mk.bak
8490 # Run the SpiderMonkey 'configure' script.
8491 dist=$MOZ_BUILD_ROOT/dist
8492 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8493 ac_configure_args="$ac_configure_args --enable-threadsafe"
8494 if test -z "$MOZ_NATIVE_NSPR"; then
8495 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8496 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8498 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8499 ac_configure_args="$ac_configure_args --includedir=$dist/include"
8500 ac_configure_args="$ac_configure_args --bindir=$dist/bin"
8501 ac_configure_args="$ac_configure_args --libdir=$dist/lib"
8502 ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
8503 if test "$MOZ_MEMORY"; then
8504 ac_configure_args="$ac_configure_args --enable-jemalloc"
8506 AC_OUTPUT_SUBDIRS(js/src)
8507 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8509 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
8511 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
8512 dnl Needs to be at the end to respect possible changes from NSPR configure
8513 if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
8514 echo "config/autoconf.mk is unchanged"
8515 mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
8517 rm -f config/autoconf.mk.orig 2> /dev/null