1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2 dnl vi: set tabstop=4 shiftwidth=4 expandtab:
3 dnl ***** BEGIN LICENSE BLOCK *****
4 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 dnl The contents of this file are subject to the Mozilla Public License Version
7 dnl 1.1 (the "License"); you may not use this file except in compliance with
8 dnl the License. You may obtain a copy of the License at
9 dnl http://www.mozilla.org/MPL/
11 dnl Software distributed under the License is distributed on an "AS IS" basis,
12 dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 dnl for the specific language governing rights and limitations under the
16 dnl The Original Code is this file as it was released upon August 6, 1998.
18 dnl The Initial Developer of the Original Code is
19 dnl Christopher Seawood.
20 dnl Portions created by the Initial Developer are Copyright (C) 1998-2001
21 dnl the Initial Developer. All Rights Reserved.
24 dnl Jamie Zawinski <jwz@jwz.org>
25 dnl gettimeofday args check
26 dnl Christopher Blizzard <blizzard@appliedtheory.com>
27 dnl gnomefe update & enable-pthreads
28 dnl Ramiro Estrugo <ramiro@netscape.com>
29 dnl X11 makedepend support
31 dnl Henry Sobotka <sobotka@axess.com>
33 dnl Dan Mosedale <dmose@mozilla.org>
35 dnl Seth Spitzer <sspitzer@netscape.com>
37 dnl Benjamin Smedberg <benjamin@smedbergs.us>
38 dnl Howard Chu <hyc@symas.com>
40 dnl Mark Mentovai <mark@moxienet.com>:
41 dnl Mac OS X 10.4 support
42 dnl Giorgio Maone <g.maone@informaction.com>
43 dnl MSVC l10n compatible version check
44 dnl Ben Turner <mozilla@songbirdnest.com>
46 dnl Alternatively, the contents of this file may be used under the terms of
47 dnl either the GNU General Public License Version 2 or later (the "GPL"), or
48 dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
49 dnl in which case the provisions of the GPL or the LGPL are applicable instead
50 dnl of those above. If you wish to allow use of your version of this file only
51 dnl under the terms of either the GPL or the LGPL, and not to allow others to
52 dnl use your version of this file under the terms of the MPL, indicate your
53 dnl decision by deleting the provisions above and replace them with the notice
54 dnl and other provisions required by the GPL or the LGPL. If you do not delete
55 dnl the provisions above, a recipient may use your version of this file under
56 dnl the terms of any one of the MPL, the GPL or the LGPL.
58 dnl ***** END LICENSE BLOCK *****
60 dnl Process this file with autoconf to produce a configure script.
61 dnl ========================================================
64 AC_INIT(config/config.mk)
65 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
67 TARGET_CPU="${target_cpu}"
68 TARGET_VENDOR="${target_vendor}"
69 TARGET_OS="${target_os}"
72 MOZ_DEB_TIMESTAMP=`date +"%a, %d %b %Y %T %z" 2>&1`
73 AC_SUBST(MOZ_DEB_TIMESTAMP)
76 dnl ========================================================
78 dnl = Don't change the following two lines. Doing so breaks:
80 dnl = CFLAGS="-foo" ./configure
82 dnl ========================================================
84 CPPFLAGS="${CPPFLAGS=}"
85 CXXFLAGS="${CXXFLAGS=}"
87 HOST_CFLAGS="${HOST_CFLAGS=}"
88 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
89 HOST_LDFLAGS="${HOST_LDFLAGS=}"
91 dnl ========================================================
92 dnl = Preserve certain environment flags passed to configure
93 dnl = We want sub projects to receive the same flags
94 dnl = untainted by this configure script
95 dnl ========================================================
98 _SUBDIR_CFLAGS="$CFLAGS"
99 _SUBDIR_CPPFLAGS="$CPPFLAGS"
100 _SUBDIR_CXXFLAGS="$CXXFLAGS"
101 _SUBDIR_LDFLAGS="$LDFLAGS"
102 _SUBDIR_HOST_CC="$HOST_CC"
103 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
104 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
105 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
106 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
108 dnl Set the version number of the libs included with mozilla
109 dnl ========================================================
116 dnl Set the minimum version of toolkit libs used by mozilla
117 dnl ========================================================
125 WINDRES_VERSION=2.14.90
128 GNOMEUI_VERSION=2.2.0
131 STARTUP_NOTIFICATION_VERSION=0.8
133 SQLITE_VERSION=3.6.16
134 LIBNOTIFY_VERSION=0.4
138 dnl Set various checks
139 dnl ========================================================
143 dnl Initialize the Pthread test variables early so they can be
144 dnl overridden by each platform.
145 dnl ========================================================
149 dnl Do not allow a separate objdir build if a srcdir build exists.
150 dnl ==============================================================
151 _topsrcdir=`cd \`dirname $0\`; pwd`
154 if test "$_topsrcdir" != "$_objdir"
156 # Check for a couple representative files in the source tree
158 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
159 if test -f $file; then
160 _conflict_files="$_conflict_files $file"
163 if test "$_conflict_files"; then
165 echo "* Your source tree contains these files:"
166 for file in $_conflict_files; do
170 * This indicates that you previously built in the source tree.
171 * A source tree build can confuse the separate objdir build.
173 * To clean up the source tree:
184 dnl Default to MSVC for win32
185 dnl ==============================================================
186 if test -z "$CROSS_COMPILE"; then
188 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
189 if test -z "$CC"; then CC=cl; fi
190 if test -z "$CXX"; then CXX=cl; fi
191 if test -z "$CPP"; then CPP="cl -E -nologo"; fi
192 if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
193 if test -z "$LD"; then LD=link; fi
194 if test -z "$AS"; then AS=ml; fi
195 if test -z "$MIDL"; then MIDL=midl; fi
200 COMPILE_ENVIRONMENT=1
201 MOZ_ARG_ENABLE_BOOL(compile-environment,
202 [ --disable-compile-environment
203 Disable compiler/library checks.],
204 COMPILE_ENVIRONMENT=1,
205 COMPILE_ENVIRONMENT= )
206 AC_SUBST(COMPILE_ENVIRONMENT)
208 MOZ_ARG_WITH_STRING(l10n-base,
209 [ --with-l10n-base=DIR path to l10n repositories],
210 L10NBASEDIR=$withval)
211 if test ! -z "$L10NBASEDIR"; then
212 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
213 AC_MSG_ERROR([--with-l10n-base must specify a path])
214 elif test -d "$L10NBASEDIR"; then
215 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
217 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
220 AC_SUBST(L10NBASEDIR)
222 dnl Check for Perl first -- needed for win32 SDK checks
223 MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
224 if test -z "$PERL" || test "$PERL" = ":"; then
225 AC_MSG_ERROR([perl not found in \$PATH])
228 dnl ========================================================
229 dnl Checks for compilers.
230 dnl ========================================================
231 dnl Set CROSS_COMPILE in the environment when running configure
232 dnl to use the cross-compile setup for now
233 dnl ========================================================
235 if test "$COMPILE_ENVIRONMENT"; then
237 dnl Do some special WinCE toolchain stuff
241 MOZ_ARG_WITH_STRING(wince-sdk,
242 [ --with-wince-sdk=WINCE_SDK_DIR
243 The path to the Windows CE SDK],
244 WINCE_SDK_DIR=$withval)
246 MOZ_ARG_WITH_STRING(ogles-sdk,
247 [ --with-ogles-sdk=OGLES_SDK_DIR
248 The path to the OGLES SDK],
249 OGLES_SDK_DIR=$withval)
251 dnl Default to Windows Mobile components enabled
252 WINCE_WINDOWS_MOBILE=1
254 MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
255 [ --disable-windows-mobile-components
256 Disable Windows Mobile specific components from CE build],
257 WINCE_WINDOWS_MOBILE=,
258 WINCE_WINDOWS_MOBILE=1)
260 if test "$WINCE_WINDOWS_MOBILE"; then
261 AC_DEFINE(WINCE_WINDOWS_MOBILE)
268 echo -----------------------------------------------------------------------------
269 echo Building Windows CE Shunt Library and Tool Chain
277 make OGLES_SDK_DIR="$OGLES_SDK_DIR" WINCE_SDK_DIR="$WINCE_SDK_DIR" TOPSRCDIR="$_topsrcdir" OBJDIR="$_pwdw" -C $srcdir/build/wince/tools
279 CC="$_pwd/dist/sdk/bin/arm-wince-gcc"
280 CXX="$_pwd/dist/sdk/bin/arm-wince-gcc"
281 CPP="$_pwd/dist/sdk/bin/arm-wince-gcc -E -nologo"
282 CXXCPP="$_pwd/dist/sdk/bin/arm-wince-gcc -TP -E -nologo"
283 LD="$_pwd/dist/sdk/bin/arm-wince-link"
284 AR="$_pwd/dist/sdk/bin/arm-wince-lib"
285 AS="$_pwd/dist/sdk/bin/arm-wince-as"
286 RC="$_pwd/dist/sdk/bin/arm-wince-res"
289 echo -----------------------------------------------------------------------------
294 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
295 echo "cross compiling from $host to $target"
299 _SAVE_CFLAGS="$CFLAGS"
300 _SAVE_LDFLAGS="$LDFLAGS"
302 AC_MSG_CHECKING([for host c compiler])
303 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
304 if test -z "$HOST_CC"; then
305 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
307 AC_MSG_RESULT([$HOST_CC])
308 AC_MSG_CHECKING([for host c++ compiler])
309 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
310 if test -z "$HOST_CXX"; then
311 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
313 AC_MSG_RESULT([$HOST_CXX])
315 if test -z "$HOST_CFLAGS"; then
316 HOST_CFLAGS="$CFLAGS"
318 if test -z "$HOST_CXXFLAGS"; then
319 HOST_CXXFLAGS="$CXXFLAGS"
321 if test -z "$HOST_LDFLAGS"; then
322 HOST_LDFLAGS="$LDFLAGS"
324 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
325 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
327 CFLAGS="$HOST_CFLAGS"
328 LDFLAGS="$HOST_LDFLAGS"
330 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
331 AC_TRY_COMPILE([], [return(0);],
332 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
333 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
336 CFLAGS="$HOST_CXXFLAGS"
338 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
339 AC_TRY_COMPILE([], [return(0);],
340 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
341 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
345 LDFLAGS=$_SAVE_LDFLAGS
347 case "$build:$target" in
348 powerpc-apple-darwin8*:i?86-apple-darwin*)
349 dnl The Darwin cross compiler doesn't necessarily point itself at a
350 dnl root that has libraries for the proper architecture, it defaults
351 dnl to the system root. The libraries in the system root on current
352 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
353 dnl checks will fail. Fake a working SDK in that case.
355 _SAVE_CXXFLAGS=$CXXLAGS
356 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
357 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
361 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
364 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
368 case "$build:$target" in
369 powerpc-apple-darwin8*:i?86-apple-darwin*)
370 dnl Revert the changes made above. From this point on, the target
371 dnl compiler will never be used without applying the SDK to CFLAGS
372 dnl (see --with-macos-sdk below).
374 CXXFLAGS=$_SAVE_CXXFLAGS
378 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
379 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
380 MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
381 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
382 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
383 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
384 AC_DEFINE(CROSS_COMPILE)
389 MOZ_PATH_PROGS(AS, $AS as, $CC)
390 AC_CHECK_PROGS(AR, ar, :)
391 AC_CHECK_PROGS(LD, ld, :)
392 AC_CHECK_PROGS(STRIP, strip, :)
393 AC_CHECK_PROGS(WINDRES, windres, :)
394 if test -z "$HOST_CC"; then
397 if test -z "$HOST_CFLAGS"; then
398 HOST_CFLAGS="$CFLAGS"
400 if test -z "$HOST_CXX"; then
403 if test -z "$HOST_CXXFLAGS"; then
404 HOST_CXXFLAGS="$CXXFLAGS"
406 if test -z "$HOST_LDFLAGS"; then
407 HOST_LDFLAGS="$LDFLAGS"
409 if test -z "$HOST_RANLIB"; then
410 HOST_RANLIB="$RANLIB"
412 if test -z "$HOST_AR"; then
423 if test "$GCC" = "yes"; then
425 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
427 if test "$GXX" = "yes"; then
429 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
431 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
434 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
437 if test "$GNU_CC"; then
438 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
445 if test "$GCC" = yes; then
446 if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
451 if test "$GXX" = yes; then
452 if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
457 dnl Special win32 checks
458 dnl ========================================================
464 if test -n "$GNU_CC"; then
472 dnl Target the Windows Vista SDK by default
475 MOZ_ARG_WITH_STRING(windows-version,
476 [ --with-windows-version=WINSDK_TARGETVER
477 Highest Windows version to target using this SDK
478 502: Windows Server 2003
481 WINSDK_TARGETVER=$withval)
483 case "$WINSDK_TARGETVER" in
485 MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
489 AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
494 dnl Vista SDK specific api (deprecated)
495 MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
496 [ --disable-vista-sdk-requirements
497 Do not build Vista SDK specific code],
498 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
499 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
500 if test -n "$COMPILE_ENVIRONMENT"; then
501 if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
502 AC_MSG_WARN([--disable-vista-sdk-requirements is deprecated, use --with-windows-version=502 instead])
503 MOZ_WINSDK_TARGETVER=05020000
506 if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
507 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1
508 AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
509 # We can't build parental controls either
510 MOZ_DISABLE_PARENTAL_CONTROLS=1
514 AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
517 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
518 if test "$GCC" != "yes"; then
519 # Check to see if we are really running in a msvc environemnt
521 AC_CHECK_PROGS(MIDL, midl)
523 # Make sure compilers are valid
524 CFLAGS="$CFLAGS -TC -nologo"
525 CXXFLAGS="$CXXFLAGS -TP -nologo"
528 AC_TRY_COMPILE([#include <stdio.h>],
529 [ printf("Hello World\n"); ],,
530 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
533 AC_TRY_COMPILE([#include <new.h>],
534 [ unsigned *test = new unsigned(42); ],,
535 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
539 _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
542 # Determine compiler version
543 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
544 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
545 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
546 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
547 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
548 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
550 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
551 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
553 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
554 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
556 if test "$_CC_MAJOR_VERSION" = "13"; then
558 elif test "$_CC_MAJOR_VERSION" = "14"; then
560 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
561 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
562 dnl so be very specific here!
563 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
564 if test $_CC_RELEASE -gt 50727; then
566 elif test $_CC_BUILD -ge 762; then
569 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
570 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
571 elif test "$_CC_MAJOR_VERSION" = "15"; then
573 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
574 LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
576 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
577 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
579 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
582 _MOZ_RTTI_FLAGS_ON='-GR'
583 _MOZ_RTTI_FLAGS_OFF='-GR-'
584 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
585 _MOZ_EXCEPTIONS_FLAGS_OFF=''
587 if test -n "$WIN32_REDIST_DIR"; then
588 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
592 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
593 if test "$_CC_SUITE" -ge "8"; then
595 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
598 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
599 if test -n "$MSMT_TOOL"; then
600 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
601 if test -z "$MSMANIFEST_TOOL_VERSION"; then
602 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
607 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
611 # Check linker version
612 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
613 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
614 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
615 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
620 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
621 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
622 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
623 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
624 # Add flags if necessary
625 AC_MSG_CHECKING([for midl flags])
628 if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
629 # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
630 # MIDL version 7.00.0500 or later has no problem.
631 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
632 AC_MSG_RESULT([need -env win32])
634 AC_MSG_RESULT([none needed])
638 AC_MSG_RESULT([none needed])
642 # Identify which version of the SDK we're building with
643 # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
645 AC_CHECK_HEADERS([winsdkver.h])
646 if test "$ac_cv_header_winsdkver_h" = "yes"; then
647 # Get the highest _WIN32_WINNT and NTDDI versions supported
648 # Take the higher of the two
649 # This is done because the Windows 7 beta SDK reports its
650 # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
651 AC_CACHE_CHECK(for highest Windows version supported by this SDK,
653 [cat > conftest.h <<EOF
654 #include <winsdkver.h>
655 #include <sdkddkver.h>
657 #if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
658 #define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
660 #define WINSDK_MAXVER NTDDI_MAXVER
665 ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
668 MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
670 # The Vista SDK is the only one to have sdkddkver.h but not
672 AC_CHECK_HEADERS([sdkddkver.h])
673 if test "$ac_cv_header_sdkddkver_h" = "yes"; then
674 MOZ_WINSDK_MAXVER=0x06000000
676 # Assume the Server 2003 Platform SDK
677 MOZ_WINSDK_MAXVER=0x05020000
681 unset _MSVC_VER_FILTER
684 # Check w32api version
685 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
686 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
687 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
688 AC_TRY_COMPILE([#include <w32api.h>],
689 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
690 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
691 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
692 #error "test failed."
694 , [ res=yes ], [ res=no ])
695 AC_MSG_RESULT([$res])
696 if test "$res" != "yes"; then
697 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
699 # Check windres version
700 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
701 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
702 AC_MSG_RESULT([$_WINDRES_VERSION])
703 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
704 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
705 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
706 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
707 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
708 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
709 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
710 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
711 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
712 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
713 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
714 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
716 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
719 # Server 2003 is the highest version supported
720 MOZ_WINSDK_MAXVER=0x05020000
723 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
724 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
725 # Require OS features provided by IE 5.0
726 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
728 # If the maximum version supported by this SDK is lower than the target
730 AC_MSG_CHECKING([for Windows SDK being recent enough])
731 if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
735 AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
738 AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
739 # Definitions matching sdkddkver.h
740 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
741 AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
742 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
746 dnl Test breaks icc on OS/2 && MSVC
747 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
749 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
753 CC="${srcdir}/build/hcc '$CC'"
754 CXX="${srcdir}/build/hcpp '$CXX'"
761 if test -n "$_WIN32_MSVC"; then
763 SKIP_COMPILER_CHECKS=1
764 SKIP_LIBRARY_CHECKS=1
766 # Since we're skipping compiler and library checks, hard-code
773 AC_DEFINE(HAVE_SETBUF)
774 AC_DEFINE(HAVE_ISATTY)
779 fi # COMPILE_ENVIRONMENT
791 dnl ========================================================
792 dnl Checks for programs.
793 dnl ========================================================
797 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
798 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
799 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
801 AC_MSG_RESULT([$_perl_version])
803 if test "$_perl_res" != 0; then
804 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
808 AC_MSG_CHECKING([for full perl installation])
809 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
811 if test "$_perl_res" != 0; then
813 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
818 MOZ_PATH_PROGS(PYTHON, $PYTHON python2.5 python2.4 python)
819 if test -z "$PYTHON"; then
820 AC_MSG_ERROR([python was not found in \$PATH])
823 if test -z "$COMPILE_ENVIRONMENT"; then
824 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
826 AC_SUBST(NSINSTALL_BIN)
828 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
829 MOZ_PATH_PROG(WHOAMI, whoami, :)
830 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
831 MOZ_PATH_PROG(UNZIP, unzip, :)
832 MOZ_PATH_PROGS(ZIP, zip)
833 if test -z "$ZIP" || test "$ZIP" = ":"; then
834 AC_MSG_ERROR([zip not found in \$PATH])
836 MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
837 MOZ_PATH_PROG(XARGS, xargs)
838 if test -z "$XARGS" || test "$XARGS" = ":"; then
839 AC_MSG_ERROR([xargs not found in \$PATH .])
842 if test "$COMPILE_ENVIRONMENT"; then
844 dnl ========================================================
845 dnl = Mac OS X toolchain support
846 dnl ========================================================
850 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
851 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
852 dnl the environment and includedir purposes (when using an SDK, below),
853 dnl but remember the full version number for the libdir (SDK).
855 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
856 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
858 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
859 dnl Bug 280479, but this keeps popping up in bug 292530 too because
860 dnl 4.0.0/4061 is the default compiler in Tiger.
862 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
864 if test "$GCC_BUILD" = "4061" ; then
865 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
866 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
867 from building Mozilla. Upgrade to Xcode 2.1 or later.])
871 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
872 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
873 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
874 MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
879 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
881 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
887 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
888 dnl it has moved into /usr/bin.
889 MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
893 AC_SUBST(GCC_VERSION)
894 AC_SUBST(XCODEBUILD_VERSION)
895 AC_SUBST(HAS_XCODE_2_1)
897 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
898 dnl that a universal binary is being produced.
899 AC_SUBST(UNIVERSAL_BINARY)
901 dnl ========================================================
902 dnl Check for MacOS deployment target version
903 dnl ========================================================
905 MOZ_ARG_ENABLE_STRING(macos-target,
906 [ --enable-macos-target=VER (default=10.4)
907 Set the minimum MacOS version needed at runtime],
908 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
912 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
913 dnl Use the specified value
914 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
915 AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
916 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
917 dnl No value specified on the command line or in the environment,
918 dnl use architecture minimum.
919 case "${target_cpu}" in
921 export MACOSX_DEPLOYMENT_TARGET=10.5
924 export MACOSX_DEPLOYMENT_TARGET=10.4
931 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
933 dnl ========================================================
934 dnl = Mac OS X SDK support
935 dnl ========================================================
938 MOZ_ARG_WITH_STRING(macos-sdk,
939 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
940 MACOS_SDK_DIR=$withval)
942 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
943 dnl NEXT_ROOT will be set and exported only if it's needed.
944 AC_SUBST(MACOS_SDK_DIR)
947 if test "$MACOS_SDK_DIR"; then
948 dnl Sync this section with the ones in NSPR and NSS.
949 dnl Changes to the cross environment here need to be accounted for in
950 dnl the libIDL checks (below) and xpidl build.
952 if test ! -d "$MACOS_SDK_DIR"; then
953 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
954 specify a valid SDK. SDKs are installed when the optional cross-development
955 tools are selected during the Xcode/Developer Tools installation.])
958 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
959 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
960 AC_MSG_ERROR([You need to upgrade the compiler version to 4.x])
962 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
963 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
965 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
966 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
967 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
969 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
970 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
971 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
972 dnl be ignored and cause warnings when -syslibroot is specified.
973 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
974 dnl the -isysroot it receives, so this is only needed with 4.0.0.
975 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
980 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
982 AC_TRY_COMPILE([#include <new>
983 int main() { return 0; }],
987 AC_MSG_RESULT($result)
989 if test "$result" = "no" ; then
990 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
994 fi # COMPILE_ENVIRONMENT
996 dnl Be sure the make we use is GNU make.
997 dnl on win32, gmake.exe is the generally the wrong version
998 if test -n "$MAKE"; then
999 if test `echo $MAKE | grep -c make.py` != 1; then
1005 cygwin*|mingw*|mks*|msvc*)
1006 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
1009 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
1012 if test "$GMAKE" = ":"; then
1013 AC_MSG_ERROR([GNU make not found])
1017 if test "$COMPILE_ENVIRONMENT"; then
1021 dnl Check in X11 include directory too.
1022 if test "$no_x" != "yes"; then
1023 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1028 fi # COMPILE_ENVIRONMENT
1030 dnl ========================================================
1031 dnl set the defaults first
1032 dnl ========================================================
1036 AR_EXTRACT='$(AR) x'
1051 MOZ_USER_DIR=".mozilla"
1053 HOST_AR_FLAGS='$(AR_FLAGS)'
1056 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
1058 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
1060 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1062 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
1064 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
1065 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
1066 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1067 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
1068 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1069 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1070 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1074 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1075 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
1077 USE_DEPENDENT_LIBS=1
1079 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1080 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
1082 MOZ_ENABLE_POSTSCRIPT=1
1084 if test -n "$CROSS_COMPILE"; then
1085 OS_TARGET="${target_os}"
1086 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1088 case "${target_os}" in
1089 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1090 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1091 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1092 mingw*) OS_ARCH=WINNT ;;
1093 wince*) OS_ARCH=WINCE ;;
1094 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1097 OS_TARGET=`uname -s`
1098 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1099 OS_RELEASE=`uname -r`
1102 # Before this used `uname -m` when not cross compiling
1103 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1104 OS_TEST="${target_cpu}"
1108 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1110 #######################################################################
1111 # Master "Core Components" macros for getting the OS target #
1112 #######################################################################
1115 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1116 # cross-compilation.
1120 # Define and override various archtecture-specific variables, including
1129 case "$HOST_OS_ARCH" in
1130 cygwin*|mingw*|mks*|msvc*)
1140 if test -z "$GNU_CC"; then
1141 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1146 if test -z "$GNU_CXX"; then
1147 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1148 SOLARIS_SUNPRO_CXX=1
1151 AC_SUBST(SOLARIS_SUNPRO_CC)
1152 AC_SUBST(SOLARIS_SUNPRO_CXX)
1164 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1167 HOST_OS_ARCH=UNIXWARE
1179 HOST_OS_ARCH=OpenVMS
1189 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1193 HOST_OS_ARCH=UNIXWARE
1203 # If uname -s returns "Windows_NT", we assume that we are using
1204 # the uname.exe in MKS toolkit.
1206 # The -r option of MKS uname only returns the major version number.
1207 # So we need to use its -v option to get the minor version number.
1208 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1212 OS_MINOR_RELEASE=`uname -v`
1213 if test "$OS_MINOR_RELEASE" = "00"; then
1216 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1218 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1220 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1221 # the uname.exe in the Cygwin tools.
1222 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1223 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1224 # the uname.exe in the GNU-Win32 tools.
1225 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1226 # the uname.exe in the MSYS tools.
1228 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1233 OS_RELEASE=`uname -v`.`uname -r`
1234 OS_TEST=${target_cpu}
1246 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1250 OS_RELEASE=`uname -v`
1274 OS_RELEASE=`uname -v`
1280 OS_RELEASE=`uname -v`
1283 if test "$OS_TARGET" != "NTO"; then
1285 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1294 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1300 OS_RELEASE=`uname -v`
1307 case "${target_cpu}" in
1318 if test -z "$CROSS_COMPILE" ; then
1326 if test "$OS_ARCH" = "NCR"; then
1328 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1332 # Only set CPU_ARCH if we recognize the value of OS_TEST
1339 powerpc* | ppc | rs6000)
1343 Alpha | alpha | ALPHA)
1360 if test "$OS_TARGET" == "WINCE"; then
1366 if test -z "$OS_TARGET"; then
1369 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1371 dnl ========================================================
1372 dnl GNU specific defaults
1373 dnl ========================================================
1374 if test "$GNU_CC"; then
1375 # FIXME: Let us build with strict aliasing. bug 414641.
1376 CFLAGS="$CFLAGS -fno-strict-aliasing"
1377 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1378 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1379 DSO_LDOPTS='-shared'
1380 if test "$GCC_USE_GNU_LD"; then
1381 # Don't allow undefined symbols in libraries
1382 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1384 WARNINGS_AS_ERRORS='-Werror'
1386 DSO_PIC_CFLAGS='-fPIC'
1387 ASFLAGS="$ASFLAGS -fPIC"
1388 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1389 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1390 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1391 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1393 # Turn on GNU specific features
1394 # -Wall - turn on all warnings
1395 # -pedantic - make compiler warn about non-ANSI stuff, and
1396 # be a little bit stricter
1397 # Warnings slamm took out for now (these were giving more noise than help):
1398 # -Wbad-function-cast - warns when casting a function to a new return type
1399 # -Wshadow - removed because it generates more noise than help --pete
1400 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1401 if test -z "$INTEL_CC"; then
1402 # Don't use -Wcast-align with ICC
1404 # And don't use it on hppa, ia64, sparc, since it's noisy there
1405 hppa | ia64 | sparc)
1408 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1413 dnl Turn pedantic on but disable the warnings for long long
1416 if test -z "$INTEL_CC"; then
1417 _IGNORE_LONG_LONG_WARNINGS=1
1418 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1420 _IGNORE_LONG_LONG_WARNINGS=
1424 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1425 _USE_CPP_INCLUDE_FLAG=1
1426 elif test "$SOLARIS_SUNPRO_CC"; then
1427 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1428 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1430 DSO_LDOPTS='-shared'
1431 if test "$GNU_LD"; then
1432 # Don't allow undefined symbols in libraries
1433 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1437 if test "$CPU_ARCH" = "sparc"; then
1438 # for Sun Studio on Solaris/SPARC
1439 DSO_PIC_CFLAGS='-xcode=pic32'
1441 DSO_PIC_CFLAGS='-KPIC'
1443 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1445 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1446 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1448 DSO_LDOPTS='-shared'
1449 if test "$GNU_LD"; then
1450 # Don't allow undefined symbols in libraries
1451 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1455 DSO_PIC_CFLAGS='-KPIC'
1456 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1459 if test "$GNU_CXX"; then
1460 # FIXME: Let us build with strict aliasing. bug 414641.
1461 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1462 # Turn on GNU specific features
1463 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1464 if test -z "$INTEL_CC"; then
1465 # Don't use -Wcast-align with ICC
1467 # And don't use it on hppa, ia64, sparc, since it's noisy there
1468 hppa | ia64 | sparc)
1471 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1476 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1477 _USE_CPP_INCLUDE_FLAG=1
1479 AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1480 ac_has_wno_invalid_offsetof,
1484 _SAVE_CXXFLAGS="$CXXFLAGS"
1485 CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1488 ac_has_wno_invalid_offsetof="yes",
1489 ac_has_wno_invalid_offsetof="no")
1490 CXXFLAGS="$_SAVE_CXXFLAGS"
1493 if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1494 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1497 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1500 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1501 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1502 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1503 dnl normal behavior.
1504 dnl ========================================================
1506 MKSHLIB_UNFORCE_ALL=
1508 if test "$COMPILE_ENVIRONMENT"; then
1509 if test "$GNU_CC"; then
1510 AC_MSG_CHECKING(whether ld has archive extraction flags)
1511 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1512 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1513 ac_cv_mkshlib_force_and_unforce="no"
1514 exec 3<&0 <<LOOP_INPUT
1515 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1516 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1517 force="-Wl,-all"; unforce="-Wl,-none"
1524 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1527 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1529 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1533 eval $ac_cv_mkshlib_force_and_unforce
1534 MKSHLIB_FORCE_ALL=$force
1535 MKSHLIB_UNFORCE_ALL=$unforce
1538 fi # COMPILE_ENVIRONMENT
1540 dnl =================================================================
1541 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1542 dnl which is bad when cross compiling.
1543 dnl =================================================================
1544 if test "$COMPILE_ENVIRONMENT"; then
1545 configure_static_assert_macros='
1546 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1547 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1548 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1551 dnl test that the macros actually work:
1552 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1553 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1556 ac_cv_static_assertion_macros_work="yes"
1557 AC_TRY_COMPILE([$configure_static_assert_macros],
1558 [CONFIGURE_STATIC_ASSERT(1)],
1560 ac_cv_static_assertion_macros_work="no")
1561 AC_TRY_COMPILE([$configure_static_assert_macros],
1562 [CONFIGURE_STATIC_ASSERT(0)],
1563 ac_cv_static_assertion_macros_work="no",
1566 AC_TRY_COMPILE([$configure_static_assert_macros],
1567 [CONFIGURE_STATIC_ASSERT(1)],
1569 ac_cv_static_assertion_macros_work="no")
1570 AC_TRY_COMPILE([$configure_static_assert_macros],
1571 [CONFIGURE_STATIC_ASSERT(0)],
1572 ac_cv_static_assertion_macros_work="no",
1576 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1577 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1578 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1580 fi # COMPILE_ENVIRONMENT
1582 dnl ========================================================
1583 dnl Checking for 64-bit OS
1584 dnl ========================================================
1585 if test "$COMPILE_ENVIRONMENT"; then
1588 AC_MSG_CHECKING(for 64-bit OS)
1589 AC_TRY_COMPILE([$configure_static_assert_macros],
1590 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1591 result="yes", result="no")
1592 AC_MSG_RESULT("$result")
1593 if test "$result" = "yes"; then
1594 AC_DEFINE(HAVE_64BIT_OS)
1597 AC_SUBST(HAVE_64BIT_OS)
1599 fi # COMPILE_ENVIRONMENT
1601 dnl ========================================================
1602 dnl Enable high-memory support on OS/2 by default.
1603 dnl ========================================================
1604 MOZ_OS2_HIGH_MEMORY=1
1605 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1606 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1607 MOZ_OS2_HIGH_MEMORY=,
1608 MOZ_OS2_HIGH_MEMORY=1 )
1609 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1611 dnl ========================================================
1612 dnl System overrides of the defaults for host
1613 dnl ========================================================
1616 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1617 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1618 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1621 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1622 # we need Python 2.5 on Windows
1624 if test -n "$_WIN32_MSVC"; then
1626 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1627 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1628 HOST_RANLIB='echo ranlib'
1630 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1632 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1633 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1634 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1635 HOST_BIN_SUFFIX=.exe
1638 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1641 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1642 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1644 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1646 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1648 PERL="${CYGWIN_WRAPPER} $PERL"
1651 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1652 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1659 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1660 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1661 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1662 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1665 *-linux*|*-kfreebsd*-gnu)
1666 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1667 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1668 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1672 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1673 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1674 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1675 HOST_BIN_SUFFIX=.exe
1680 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1681 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1682 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1686 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1687 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1691 dnl We require version 2.4 or newer of Python to build,
1692 dnl and 2.5 or newer on Windows.
1693 AC_MSG_CHECKING([for minimum required Python version >= $PYTHON_VERSION])
1695 $PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION
1698 if test "$_python_res" != 0; then
1699 AC_MSG_ERROR([Python $PYTHON_VERSION or higher is required.])
1701 AC_MSG_RESULT([yes])
1703 dnl Get mozilla version from central milestone file
1704 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1706 dnl Get version of various core apps from the version files.
1707 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1709 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1710 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1712 dnl ========================================================
1713 dnl System overrides of the defaults for target
1714 dnl ========================================================
1719 if test ! "$GNU_CC"; then
1720 if test ! "$HAVE_64BIT_OS"; then
1721 # Compiling with Visual Age C++ object model compat is the
1722 # default. To compile with object model ibm, add
1723 # AIX_OBJMODEL=ibm to .mozconfig.
1724 if test "$AIX_OBJMODEL" = "ibm"; then
1725 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1732 AC_SUBST(AIX_OBJMODEL)
1733 DSO_LDOPTS='-qmkshrobj=1'
1734 DSO_CFLAGS='-qflag=w:w'
1736 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1737 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1739 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1740 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1741 if test "$COMPILE_ENVIRONMENT"; then
1744 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
1746 [#if (__IBMCPP__ < 600)
1747 #error "Bad compiler"
1749 _BAD_COMPILER=,_BAD_COMPILER=1)
1750 if test -n "$_BAD_COMPILER"; then
1752 AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
1754 AC_MSG_RESULT([yes])
1757 TARGET_COMPILER_ABI="ibmc"
1758 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1759 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1762 case "${target_os}" in
1767 if test "$COMPILE_ENVIRONMENT"; then
1768 AC_CHECK_HEADERS(sys/inttypes.h)
1770 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1775 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1776 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1777 DSO_LDOPTS='-nostart'
1778 TK_LIBS='-lbe -lroot'
1780 if test "$COMPILE_ENVIRONMENT"; then
1781 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1782 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1784 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1785 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1788 MOZ_USER_DIR="Mozilla"
1792 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1794 _IGNORE_LONG_LONG_WARNINGS=
1802 _WARNINGS_CFLAGS="-Wall"
1803 _WARNINGS_CXXFLAGS="-Wall"
1804 # The test above doesn't work properly, at least on 3.1.
1805 MKSHLIB_FORCE_ALL=''
1806 MKSHLIB_UNFORCE_ALL=''
1812 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1813 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1814 MOZ_OPTIMIZE_FLAGS="-O3"
1816 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1817 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1820 STRIP="$STRIP -x -S"
1821 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1822 MOZ_ENABLE_POSTSCRIPT=
1823 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1824 # The ExceptionHandling framework is needed for Objective-C exception
1825 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1827 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1829 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1830 dnl ===================================================================
1831 if test "x$enable_dtrace" = "xyes"; then
1832 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1834 dnl check for the presence of the -dead_strip linker flag
1835 AC_MSG_CHECKING([for -dead_strip option to ld])
1836 _SAVE_LDFLAGS=$LDFLAGS
1837 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1838 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1839 if test -n "$_HAVE_DEAD_STRIP" ; then
1840 AC_MSG_RESULT([yes])
1841 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1846 LDFLAGS=$_SAVE_LDFLAGS
1851 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1852 DLL_SUFFIX=".so.1.0"
1853 DSO_LDOPTS="-shared"
1855 if test ! "$GNU_CC"; then
1856 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1858 # Can't have force w/o an unforce.
1859 # # Hack for FreeBSD 2.2
1860 # if test -z "$MKSHLIB_FORCE_ALL"; then
1861 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1862 # MKSHLIB_UNFORCE_ALL=''
1868 if test ! "$GNU_CC"; then
1869 DSO_LDOPTS='-b -Wl,+s'
1872 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1873 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1874 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1876 DSO_LDOPTS='-b -E +s'
1877 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1878 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1880 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1881 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1886 DSO_LDOPTS='-elf -shared'
1888 if test "$GNU_CC"; then
1889 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1890 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1891 MKSHLIB_FORCE_ALL='-Wl,-all'
1892 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1893 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1895 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1896 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1897 MKSHLIB_FORCE_ALL='-all'
1898 MKSHLIB_UNFORCE_ALL='-none'
1904 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1905 dnl compile and link using -n32
1907 TARGET_COMPILER_ABI=n32
1908 DSO_LDOPTS='-elf -shared'
1909 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1910 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1911 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1912 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1913 if test "$GNU_CC"; then
1914 MKSHLIB_FORCE_ALL='-Wl,-all'
1915 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1916 _WARNINGS_CFLAGS="-Wall"
1917 _WARNINGS_CXXFLAGS="-Wall"
1918 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1920 MKSHLIB_FORCE_ALL='-all'
1921 MKSHLIB_UNFORCE_ALL='-none'
1927 CFLAGS="$CFLAGS -woff 3262 -G 4"
1928 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1929 if test -n "$USE_N32"; then
1930 ASFLAGS="$ASFLAGS -n32"
1931 CFLAGS="$CFLAGS -n32"
1932 CXXFLAGS="$CXXFLAGS -n32"
1933 LDFLAGS="$LDFLAGS -n32"
1935 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1936 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1939 if test -z "$GNU_CXX"; then
1945 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
1946 # Similarly for GNU_CXX and INTEL_CXX.
1947 if test "$INTEL_CC" || test "$INTEL_CXX"; then
1948 # -Os has been broken on Intel's C/C++ compilers for quite a
1949 # while; Intel recommends against using it.
1950 MOZ_OPTIMIZE_FLAGS="-O2"
1951 MOZ_DEBUG_FLAGS="-g -fno-inline"
1952 elif test "$GNU_CC" || test "$GNU_CXX"; then
1953 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
1954 case $GCC_VERSION in
1956 # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
1957 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
1959 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
1960 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1961 # and that combo is not yet good at
1962 # debugging inlined functions (even
1963 # when using DWARF2 as the debugging
1967 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1971 case "${target_cpu}" in
1973 CFLAGS="$CFLAGS -mieee"
1974 CXXFLAGS="$CXXFLAGS -mieee"
1978 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1981 MOZ_DEBUG_FLAGS="-g" # We want inlining
1987 TARGET_COMPILER_ABI=msvc
1988 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1990 AR_EXTRACT="$AR -extract"
1992 AR_FLAGS='-OUT:"$@"'
1994 if test "$AS_BIN"; then
2001 if test -z "$RC"; then
2004 # certain versions of cygwin's makedepend barf on the
2005 # #include <string> vs -I./dist/include/string issue so don't use it
2011 HOST_AR='lib -OUT:$@'
2012 HOST_RANLIB='echo ranlib'
2013 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
2016 WARNINGS_AS_ERRORS='-WX'
2017 MOZ_OPTIMIZE_FLAGS='-Ox'
2018 AR_FLAGS='-NOLOGO -OUT:"$@"'
2020 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2021 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2024 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
2025 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2027 IMPORT_LIB_SUFFIX=lib
2029 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2032 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2033 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2035 MKSHLIB_UNFORCE_ALL=
2036 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2037 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2038 MOZ_DEBUG_FLAGS='-Zi'
2039 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2041 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2042 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2044 RANLIB='echo not_ranlib'
2045 STRIP='echo not_strip'
2046 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
2049 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2051 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
2052 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
2056 AC_DEFINE(HAVE_SNPRINTF)
2061 AC_DEFINE(HW_THREADS)
2062 AC_DEFINE(STDC_HEADERS)
2063 AC_DEFINE(NEW_H, <new>)
2064 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2065 AC_DEFINE(HAVE_LOCALTIME_R)
2067 TARGET_MD_ARCH=win32
2068 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2071 MOZ_ENABLE_POSTSCRIPT=
2072 MOZ_USER_DIR="Mozilla"
2074 MOZ_GFX_OPTIMIZE_MOBILE=1
2076 # Sanity check for WINCE_WINDOWS_MOBILE
2077 # XXX disabled until we can fix the mobile tinderbox
2078 ##if test "$WINCE_WINDOWS_MOBILE"; then
2079 ## AC_CHECK_HEADER(tpcshell.h, [],
2080 ## AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
2085 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2090 # certain versions of cygwin's makedepend barf on the
2091 # #include <string> vs -I./dist/include/string issue so don't use it
2093 if test -n "$GNU_CC"; then
2094 CC="$CC -mno-cygwin"
2095 CXX="$CXX -mno-cygwin"
2096 CPP="$CPP -mno-cygwin"
2097 CFLAGS="$CFLAGS -mms-bitfields"
2098 CXXFLAGS="$CXXFLAGS -mms-bitfields"
2099 DSO_LDOPTS='-shared'
2100 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2101 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2103 # Use temp file for windres (bug 213281)
2104 RCFLAGS='-O coff --use-temp-file'
2105 # mingw doesn't require kernel32, user32, and advapi32 explicitly
2106 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
2107 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
2109 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
2110 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
2112 IMPORT_LIB_SUFFIX=dll.a
2114 TARGET_COMPILER_ABI=msvc
2118 AR='lib -NOLOGO -OUT:"$@"'
2120 RANLIB='echo not_ranlib'
2121 STRIP='echo not_strip'
2126 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2131 IMPORT_LIB_SUFFIX=lib
2132 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2133 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2135 MKSHLIB_UNFORCE_ALL=
2136 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2137 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2138 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2139 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2140 MOZ_DEBUG_FLAGS='-Zi'
2141 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2142 WARNINGS_AS_ERRORS='-WX'
2143 MOZ_OPTIMIZE_FLAGS='-O1'
2144 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2146 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2147 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2148 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2149 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2150 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2151 if test $_MSC_VER -ge 1400; then
2152 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
2153 dnl For profile-guided optimization
2154 PROFILE_GEN_CFLAGS="-GL"
2155 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2156 dnl XXX: PGO builds can fail with warnings treated as errors,
2157 dnl specifically "no profile data available" appears to be
2158 dnl treated as an error sometimes. This might be a consequence
2159 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2160 dnl with the linker doing most of the work in the whole-program
2161 dnl optimization/PGO case. I think it's probably a compiler bug,
2162 dnl but we work around it here.
2163 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2164 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2165 dnl Probably also a compiler bug, but what can you do?
2166 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2167 if test -n "$_USE_DYNAMICBASE"; then
2168 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2172 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2173 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2174 AC_DEFINE(HAVE_SNPRINTF)
2179 AC_DEFINE(HW_THREADS)
2180 AC_DEFINE(STDC_HEADERS)
2181 AC_DEFINE(NEW_H, <new>)
2182 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2183 TARGET_MD_ARCH=win32
2184 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2187 MOZ_ENABLE_POSTSCRIPT=
2188 MOZ_USER_DIR="Mozilla"
2190 dnl Hardcode to win95 for now - cls
2191 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2193 dnl set NO_X11 defines here as the general check is skipped on win32
2197 dnl MinGW/MSYS doesn't provide or need cygpath
2202 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2204 *-cygwin*|*-msvc*|*-mks*)
2205 CYGPATH_W="cygpath -a -w"
2206 CYGPATH_S="sed -e s|\\\\|/|g"
2207 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2211 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2213 if test -z "$MOZ_TOOLS"; then
2214 AC_MSG_ERROR([MOZ_TOOLS is not set])
2217 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2218 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2219 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2221 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2222 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2223 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2225 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2227 if test -n "$GLIB_PREFIX"; then
2228 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
2229 if test "$?" = "0"; then
2230 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
2231 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
2233 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
2235 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
2238 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
2240 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
2241 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
2243 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
2244 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
2245 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
2246 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
2247 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
2249 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
2252 if test -n "$LIBIDL_PREFIX"; then
2253 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd -W`
2254 if test "$?" = "0"; then
2255 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2256 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2258 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2260 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2263 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2265 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2266 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2268 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2269 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2270 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2272 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2273 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2275 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2277 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2280 *) # else cross-compiling
2281 if test -n "$GLIB_PREFIX"; then
2282 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2283 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2284 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2285 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2286 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2288 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2291 if test -n "$LIBIDL_PREFIX"; then
2292 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2293 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2294 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2296 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2297 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2299 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2302 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2309 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])
2313 AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
2317 AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2333 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2340 CFLAGS="$CFLAGS -Dunix"
2341 CXXFLAGS="$CXXFLAGS -Dunix"
2342 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2344 DSO_PIC_CFLAGS='-fPIC -DPIC'
2345 DSO_LDOPTS='-shared'
2346 BIN_FLAGS='-Wl,--export-dynamic'
2348 DSO_PIC_CFLAGS='-fPIC -DPIC'
2349 DLL_SUFFIX=".so.1.0"
2350 DSO_LDOPTS='-shared'
2352 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2353 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2354 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2355 if test "$LIBRUNPATH"; then
2356 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2358 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2359 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2364 AC_DEFINE(_QNX_SOURCE)
2367 WARNINGS_AS_ERRORS=''
2368 MOZ_OPTIMIZE_FLAGS="-O"
2369 MOZ_DEBUG_FLAGS="-gstabs"
2372 LIBS="$LIBS -lsocket -lstdc++"
2373 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2374 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2375 if test "$with_x" != "yes"
2377 _PLATFORM_DEFAULT_TOOLKIT="photon"
2378 TK_CFLAGS='-I/usr/include/photon'
2381 case "${target_cpu}" in
2383 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2386 case "${host_cpu}" in
2394 DLL_SUFFIX=".so.1.0"
2396 DSO_PIC_CFLAGS='-fPIC'
2397 DSO_LDOPTS='-shared -fPIC'
2398 if test "$LIBRUNPATH"; then
2399 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2404 AC_DEFINE(NO_PW_GECOS)
2405 AC_DEFINE(NO_UDSOCK)
2406 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2408 MKSHLIB_FORCE_ALL='-all'
2409 MKSHLIB_UNFORCE_ALL='-none'
2411 AS_DASH_C_FLAG='-Wc/names=as_is'
2413 DSO_LDOPTS='-shared -auto_symvec'
2415 MOZ_DEBUG_LDFLAGS='-g'
2417 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2418 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2423 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2424 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2427 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2428 AC_DEFINE(TCPV40HDRS)
2435 IMPORT_LIB_SUFFIX=lib
2439 CFLAGS="$CFLAGS -Zomf"
2440 CXXFLAGS="$CXXFLAGS -Zomf"
2442 BIN_FLAGS='-Zlinker /ST:0x100000'
2446 WARNINGS_AS_ERRORS='-Werror'
2447 MOZ_DEBUG_FLAGS="-g -fno-inline"
2448 MOZ_OPTIMIZE_FLAGS="-O2"
2449 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2450 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2451 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2452 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2454 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2455 MOZ_ENABLE_POSTSCRIPT=
2458 MOZ_USER_DIR="Mozilla"
2460 if test "$MOZTOOLS"; then
2461 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2463 AC_MSG_ERROR([MOZTOOLS is not set])
2465 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2466 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2467 LDFLAGS="$LDFLAGS -Zhigh-mem"
2468 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2469 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2472 # GCC for OS/2 currently predefines these, but we don't want them
2473 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2474 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2476 AC_CACHE_CHECK(for __declspec(dllexport),
2478 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2480 ac_os2_declspec="yes",
2481 ac_os2_declspec="no")])
2482 if test "$ac_os2_declspec" = "yes"; then
2484 MOZ_OS2_USE_DECLSPEC='1'
2489 if test "$GNU_CC"; then
2490 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2491 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2494 MOZ_DEBUG_FLAGS='-g'
2495 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2496 CFLAGS="$CFLAGS -ieee"
2497 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2498 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2501 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2502 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2503 MKSHLIB_FORCE_ALL='-all'
2504 MKSHLIB_UNFORCE_ALL='-none'
2505 dnl Might fix the libxpcom.so breakage on this platform as well....
2506 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2507 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2509 if test -z "$GNU_CXX"; then
2512 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2516 DIRENT_INO=d_stat.st_ino
2517 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2518 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2519 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2520 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2521 AC_DEFINE(STDC_HEADERS)
2522 if test "$no_x" = "yes"; then
2523 _PLATFORM_DEFAULT_TOOLKIT='photon'
2524 TK_CFLAGS='-I/usr/nto/include/photon'
2525 TK_LIBS='-lphoton -lphrender'
2530 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2531 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2532 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2533 if test ! "$GNU_CC"; then
2538 dnl the qsort routine under solaris is faulty
2541 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2543 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2544 # libraries one level up (e.g. libnspr4.so)
2545 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2547 if test "$SOLARIS_SUNPRO_CC"; then
2548 LIBS="-lCrun -lCstd $LIBS"
2551 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2552 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2553 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2554 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2555 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2556 _SAVE_LDFLAGS=$LDFLAGS
2557 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2558 AC_TRY_LINK([#include <stdio.h>],
2559 [printf("Hello World\n");],
2561 [LDFLAGS=$_SAVE_LDFLAGS])
2563 WARNINGS_AS_ERRORS='-Werror'
2564 MOZ_OPTIMIZE_FLAGS="-xO4"
2565 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2566 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2567 MKSHLIB_FORCE_ALL='-z allextract'
2568 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2569 DSO_LDOPTS='-G -z muldefs'
2575 AS='/usr/ccs/bin/as'
2576 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2578 TARGET_COMPILER_ABI="sunc"
2579 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2580 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2581 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2585 [#if (__SUNPRO_CC < 0x590)
2588 _BAD_COMPILER=,_BAD_COMPILER=1)
2589 if test -n "$_BAD_COMPILER"; then
2591 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2595 AC_MSG_RESULT([$_res])
2598 ASFLAGS="$ASFLAGS -fPIC"
2601 _WARNINGS_CXXFLAGS=''
2602 if test "$OS_RELEASE" = "5.3"; then
2603 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2606 if test "$OS_RELEASE" = "5.5.1"; then
2607 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2612 DSO_LDOPTS='-Bdynamic'
2613 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2614 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2616 AC_DEFINE(SPRINTF_RETURNS_STRING)
2617 case "$(target_os)" in
2619 DLL_SUFFIX='.so.1.0'
2625 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2629 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2634 dnl Only one oddball right now (QNX), but this gives us flexibility
2635 dnl if any other platforms need to override this in the future.
2636 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2638 dnl ========================================================
2639 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2640 dnl by now will not have any way to link most binaries (tests
2641 dnl as well as viewer, apprunner, etc.), because some symbols
2642 dnl will be left out of the "composite" .so's by ld as unneeded.
2643 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2644 dnl they can link in the static libs that provide the missing
2646 dnl ========================================================
2647 NO_LD_ARCHIVE_FLAGS=
2648 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2649 NO_LD_ARCHIVE_FLAGS=1
2653 NO_LD_ARCHIVE_FLAGS=
2656 NO_LD_ARCHIVE_FLAGS=
2659 NO_LD_ARCHIVE_FLAGS=
2661 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2662 if test -z "$GNU_CC"; then
2663 NO_LD_ARCHIVE_FLAGS=
2667 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2669 dnl ========================================================
2670 dnl = Flags to strip unused symbols from .so components
2671 dnl ========================================================
2673 *-linux*|*-kfreebsd*-gnu)
2674 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2677 if test -z "$GNU_CC"; then
2678 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2680 if test -z "$GCC_USE_GNU_LD"; then
2681 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2683 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2688 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2691 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2693 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2694 if test -n "$GNU_CC"; then
2695 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2700 if test -z "$COMPILE_ENVIRONMENT"; then
2701 SKIP_COMPILER_CHECKS=1
2702 SKIP_LIBRARY_CHECKS=1
2705 if test -z "$SKIP_COMPILER_CHECKS"; then
2706 dnl Checks for typedefs, structures, and compiler characteristics.
2707 dnl ========================================================
2715 AC_STRUCT_ST_BLKSIZE
2716 AC_MSG_CHECKING(for siginfo_t)
2717 AC_CACHE_VAL(ac_cv_siginfo_t,
2718 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2719 #include <signal.h>],
2721 [ac_cv_siginfo_t=true],
2722 [ac_cv_siginfo_t=false])])
2723 if test "$ac_cv_siginfo_t" = true ; then
2724 AC_DEFINE(HAVE_SIGINFO_T)
2730 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2731 dnl ========================================================
2732 AC_MSG_CHECKING(for int16_t)
2733 AC_CACHE_VAL(ac_cv_int16_t,
2734 [AC_TRY_COMPILE([#include <stdio.h>
2735 #include <sys/types.h>],
2737 [ac_cv_int16_t=true],
2738 [ac_cv_int16_t=false])])
2739 if test "$ac_cv_int16_t" = true ; then
2740 AC_DEFINE(HAVE_INT16_T)
2745 AC_MSG_CHECKING(for int32_t)
2746 AC_CACHE_VAL(ac_cv_int32_t,
2747 [AC_TRY_COMPILE([#include <stdio.h>
2748 #include <sys/types.h>],
2750 [ac_cv_int32_t=true],
2751 [ac_cv_int32_t=false])])
2752 if test "$ac_cv_int32_t" = true ; then
2753 AC_DEFINE(HAVE_INT32_T)
2758 AC_MSG_CHECKING(for int64_t)
2759 AC_CACHE_VAL(ac_cv_int64_t,
2760 [AC_TRY_COMPILE([#include <stdio.h>
2761 #include <sys/types.h>],
2763 [ac_cv_int64_t=true],
2764 [ac_cv_int64_t=false])])
2765 if test "$ac_cv_int64_t" = true ; then
2766 AC_DEFINE(HAVE_INT64_T)
2771 AC_MSG_CHECKING(for int64)
2772 AC_CACHE_VAL(ac_cv_int64,
2773 [AC_TRY_COMPILE([#include <stdio.h>
2774 #include <sys/types.h>],
2777 [ac_cv_int64=false])])
2778 if test "$ac_cv_int64" = true ; then
2779 AC_DEFINE(HAVE_INT64)
2784 AC_MSG_CHECKING(for uint)
2785 AC_CACHE_VAL(ac_cv_uint,
2786 [AC_TRY_COMPILE([#include <stdio.h>
2787 #include <sys/types.h>],
2790 [ac_cv_uint=false])])
2791 if test "$ac_cv_uint" = true ; then
2792 AC_DEFINE(HAVE_UINT)
2797 AC_MSG_CHECKING(for uint_t)
2798 AC_CACHE_VAL(ac_cv_uint_t,
2799 [AC_TRY_COMPILE([#include <stdio.h>
2800 #include <sys/types.h>],
2802 [ac_cv_uint_t=true],
2803 [ac_cv_uint_t=false])])
2804 if test "$ac_cv_uint_t" = true ; then
2805 AC_DEFINE(HAVE_UINT_T)
2810 AC_MSG_CHECKING(for uint16_t)
2811 AC_CACHE_VAL(ac_cv_uint16_t,
2812 [AC_TRY_COMPILE([#include <stdio.h>
2813 #include <sys/types.h>],
2814 [uint16_t foo = 0;],
2815 [ac_cv_uint16_t=true],
2816 [ac_cv_uint16_t=false])])
2817 if test "$ac_cv_uint16_t" = true ; then
2818 AC_DEFINE(HAVE_UINT16_T)
2824 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2825 dnl are defined when compiling C++ but not C. Since the result of this
2826 dnl test is used only in C++, do it in C++.
2829 AC_MSG_CHECKING(for uname.domainname)
2830 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2831 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2832 [ struct utsname *res; char *domain;
2833 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2834 [ac_cv_have_uname_domainname_field=true],
2835 [ac_cv_have_uname_domainname_field=false])])
2837 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2838 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2844 AC_MSG_CHECKING(for uname.__domainname)
2845 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2846 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2847 [ struct utsname *res; char *domain;
2848 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2849 [ac_cv_have_uname_us_domainname_field=true],
2850 [ac_cv_have_uname_us_domainname_field=false])])
2852 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2853 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2861 dnl Check for usable char16_t (2 bytes, unsigned)
2862 dnl (we might not need the unsignedness check anymore)
2863 AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
2864 ac_cv_have_usable_char16_t,
2865 [AC_TRY_COMPILE([$configure_static_assert_macros],
2866 [CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
2867 CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
2868 CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
2869 CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
2870 CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
2871 ac_cv_have_usable_char16_t="yes",
2872 ac_cv_have_usable_char16_t="no")])
2873 if test "$ac_cv_have_usable_char16_t" = "yes"; then
2874 AC_DEFINE(HAVE_CPP_CHAR16_T)
2878 dnl Check for usable wchar_t (2 bytes, unsigned)
2879 dnl (we really don't need the unsignedness check anymore)
2880 dnl ========================================================
2882 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2883 ac_cv_have_usable_wchar_v2,
2884 [AC_TRY_COMPILE([#include <stddef.h>
2885 $configure_static_assert_macros],
2886 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2887 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2888 ac_cv_have_usable_wchar_v2="yes",
2889 ac_cv_have_usable_wchar_v2="no")])
2890 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2891 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2892 HAVE_CPP_2BYTE_WCHAR_T=1
2893 elif test "$ac_cv_have_usable_char16_t" != "yes"; then
2894 dnl This is really gcc-only
2895 dnl Do this test using CXX only since some versions of gcc
2896 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2897 dnl only have short-wchar support for c++.
2898 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2900 _SAVE_CXXFLAGS=$CXXFLAGS
2901 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2903 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2904 ac_cv_have_usable_wchar_option_v2,
2905 [AC_TRY_LINK([#include <stddef.h>
2906 $configure_static_assert_macros],
2907 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2908 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2909 ac_cv_have_usable_wchar_option_v2="yes",
2910 ac_cv_have_usable_wchar_option_v2="no")])
2912 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2913 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2914 HAVE_CPP_2BYTE_WCHAR_T=1
2915 WCHAR_CFLAGS="-fshort-wchar"
2917 CXXFLAGS=$_SAVE_CXXFLAGS
2923 dnl Check for .hidden assembler directive and visibility attribute.
2924 dnl Borrowed from glibc configure.in
2925 dnl ===============================================================
2926 if test "$GNU_CC"; then
2927 AC_CACHE_CHECK(for visibility(hidden) attribute,
2928 ac_cv_visibility_hidden,
2929 [cat > conftest.c <<EOF
2930 int foo __attribute__ ((visibility ("hidden"))) = 1;
2932 ac_cv_visibility_hidden=no
2933 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2934 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2935 ac_cv_visibility_hidden=yes
2940 if test "$ac_cv_visibility_hidden" = "yes"; then
2941 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2943 AC_CACHE_CHECK(for visibility(default) attribute,
2944 ac_cv_visibility_default,
2945 [cat > conftest.c <<EOF
2946 int foo __attribute__ ((visibility ("default"))) = 1;
2948 ac_cv_visibility_default=no
2949 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2950 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2951 ac_cv_visibility_default=yes
2956 if test "$ac_cv_visibility_default" = "yes"; then
2957 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2959 AC_CACHE_CHECK(for visibility pragma support,
2960 ac_cv_visibility_pragma,
2961 [cat > conftest.c <<EOF
2962 #pragma GCC visibility push(hidden)
2964 #pragma GCC visibility push(default)
2965 int foo_default = 1;
2967 ac_cv_visibility_pragma=no
2968 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2969 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2970 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2971 ac_cv_visibility_pragma=yes
2977 if test "$ac_cv_visibility_pragma" = "yes"; then
2978 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2979 ac_cv_have_visibility_class_bug,
2980 [cat > conftest.c <<EOF
2981 #pragma GCC visibility push(hidden)
2982 struct __attribute__ ((visibility ("default"))) TestStruct {
2985 __attribute__ ((visibility ("default"))) void TestFunc() {
2989 ac_cv_have_visibility_class_bug=no
2990 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2991 ac_cv_have_visibility_class_bug=yes
2993 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2994 ac_cv_have_visibility_class_bug=yes
2997 rm -rf conftest.{c,S}
3000 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
3001 ac_cv_have_visibility_builtin_bug,
3002 [cat > conftest.c <<EOF
3003 #pragma GCC visibility push(hidden)
3004 #pragma GCC visibility push(default)
3006 #pragma GCC visibility pop
3008 __attribute__ ((visibility ("default"))) void Func() {
3010 memset(c, 0, sizeof(c));
3013 ac_cv_have_visibility_builtin_bug=no
3014 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3015 ac_cv_have_visibility_builtin_bug=yes
3017 if test `grep -c "@PLT" conftest.S` = 0; then
3018 ac_cv_visibility_builtin_bug=yes
3021 rm -f conftest.{c,S}
3023 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
3024 "$ac_cv_have_visibility_class_bug" = "no"; then
3025 VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
3026 WRAP_SYSTEM_INCLUDES=1
3028 VISIBILITY_FLAGS='-fvisibility=hidden'
3029 fi # have visibility pragma bug
3030 fi # have visibility pragma
3031 fi # have visibility(default) attribute
3032 fi # have visibility(hidden) attribute
3035 # visibility hidden flag for Sun Studio on Solaris
3036 if test "$SOLARIS_SUNPRO_CC"; then
3037 VISIBILITY_FLAGS='-xldscope=hidden'
3038 fi # Sun Studio on Solaris
3040 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3041 AC_SUBST(VISIBILITY_FLAGS)
3043 dnl Checks for header files.
3044 dnl ========================================================
3046 case "$target_os" in
3048 # for stuff like -lXshm
3049 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3052 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3053 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3054 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3055 AC_CHECK_HEADERS(malloc.h)
3056 AC_CHECK_HEADERS(X11/XKBlib.h)
3057 AC_CHECK_HEADERS(io.h)
3059 dnl These are all the places some variant of statfs can be hiding.
3060 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3062 dnl Try for MMX support
3063 dnl NB - later gcc versions require -mmmx for this header to be successfully
3064 dnl included (or another option which implies it, such as -march=pentium-mmx)
3065 AC_CHECK_HEADERS(mmintrin.h)
3067 dnl Check whether the compiler supports the new-style C++ standard
3068 dnl library headers (i.e. <new>) or needs the old "new.h"
3071 AC_CHECK_HEADER(new, [NEW_H=new])
3072 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
3075 AC_ARG_ENABLE(dtrace,
3076 [ --enable-dtrace build with dtrace support if available (default=no)],
3077 [enable_dtrace="yes"],)
3078 if test "x$enable_dtrace" = "xyes"; then
3079 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
3080 if test -n "$HAVE_DTRACE"; then
3081 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3083 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3086 AC_SUBST(HAVE_DTRACE)
3092 AC_CHECK_HEADERS(sys/cdefs.h)
3096 dnl Checks for libraries.
3097 dnl ========================================================
3102 AC_CHECK_LIB(c_r, gethostbyname_r)
3106 dnl We don't want to link with libdl even if it's present on OS X, since
3107 dnl it's not used and not part of the default installation.
3108 dnl The same goes for BeOS.
3109 dnl We don't want to link against libm or libpthread on Darwin since
3110 dnl they both are just symlinks to libSystem and explicitly linking
3111 dnl against libSystem causes issues when debugging (see bug 299601).
3118 AC_CHECK_LIB(m, atan)
3119 AC_CHECK_LIB(dl, dlopen,
3120 AC_CHECK_HEADER(dlfcn.h,
3122 AC_DEFINE(HAVE_LIBDL)))
3126 _SAVE_CFLAGS="$CFLAGS"
3127 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3128 AC_CHECK_FUNCS(dladdr)
3129 CFLAGS="$_SAVE_CFLAGS"
3131 if test ! "$GNU_CXX"; then
3135 AC_CHECK_LIB(C_r, demangle)
3138 AC_CHECK_LIB(C, demangle)
3142 AC_CHECK_LIB(socket, socket)
3144 dnl ========================================================
3145 dnl Check whether we can compile code for Core Text
3146 dnl (Mac OS X 10.5 or later)
3147 dnl ========================================================
3150 AC_MSG_CHECKING([for Core Text])
3151 AC_TRY_COMPILE([#include <ApplicationServices/ApplicationServices.h>],
3152 [CTLineRef lineRef;],
3153 ac_cv_have_core_text="yes",
3154 ac_cv_have_core_text="no")
3155 AC_MSG_RESULT([$ac_cv_have_core_text])
3157 case "${target_cpu}" in
3163 MOZ_ARG_ENABLE_BOOL(coretext,
3164 [ --enable-coretext Use CoreText instead of ATSUI for text rendering],
3168 if test -n "$MOZ_CORETEXT"; then
3169 if test "$ac_cv_have_core_text" = "no"; then
3170 AC_MSG_ERROR([--enable-coretext requires MacOS SDK 10.5 or newer])
3172 AC_DEFINE(MOZ_CORETEXT)
3177 AC_SUBST(MOZ_CORETEXT)
3180 XLIBS="$X_EXTRA_LIBS"
3182 dnl ========================================================
3183 dnl Checks for X libraries.
3184 dnl Ordering is important.
3185 dnl Xt is dependent upon SM as of X11R6
3186 dnl ========================================================
3187 if test "$no_x" = "yes"; then
3190 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3191 XLIBS="-lX11 $XLIBS"
3192 _SAVE_LDFLAGS="$LDFLAGS"
3193 LDFLAGS="$XLDFLAGS $LDFLAGS"
3194 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3195 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3196 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3197 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3199 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3200 unset ac_cv_lib_Xt_XtFree
3201 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3202 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3203 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3204 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3207 # AIX needs the motif library linked before libXt to prevent
3208 # crashes in plugins linked against Motif - Bug #98892
3209 case "${target_os}" in
3211 XT_LIBS="-lXm $XT_LIBS"
3215 dnl ========================================================
3216 dnl = Check for XShm
3217 dnl ========================================================
3218 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3220 AC_CHECK_HEADER(X11/extensions/XShm.h)
3221 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3222 test -n "$_HAVE_XSHM_XEXT"; then
3223 AC_DEFINE(HAVE_XSHM)
3226 dnl ========================================================
3228 dnl ========================================================
3229 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3231 AC_CHECK_HEADER(X11/extensions/XIElib.h)
3233 if test "$MOZ_XIE_LIBS"; then
3234 dnl ====================================================
3235 dnl = If XIE is present and is desired, turn it on
3236 dnl ====================================================
3246 LDFLAGS="$_SAVE_LDFLAGS"
3248 dnl ========================================================
3249 dnl = Check for freetype2 and its functionality
3250 dnl ========================================================
3251 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3253 if test "$_HAVE_FREETYPE2"; then
3255 _SAVE_CFLAGS="$CFLAGS"
3256 LIBS="$LIBS $FT2_LIBS"
3257 CFLAGS="$CFLAGS $FT2_CFLAGS"
3259 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3260 ac_cv_member_FT_Bitmap_Size_y_ppem,
3261 [AC_TRY_COMPILE([#include <ft2build.h>
3262 #include FT_FREETYPE_H],
3264 if (sizeof s.y_ppem) return 0;
3266 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3267 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3268 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3269 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3271 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3273 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3274 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3275 [FT_Bitmap_Size structure includes y_ppem field])
3277 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3280 CFLAGS="$_SAVE_CFLAGS"
3291 AC_MSG_CHECKING(for ARM SIMD support in compiler)
3293 [asm("uqadd8 r1, r1, r2");],
3294 result="yes", result="no")
3295 AC_MSG_RESULT("$result")
3296 if test "$result" = "yes"; then
3297 AC_DEFINE(HAVE_ARM_SIMD)
3300 AC_SUBST(HAVE_ARM_SIMD)
3302 AC_MSG_CHECKING(for ARM NEON support in compiler)
3303 _SAVE_CFLAGS="$CFLAGS"
3304 if test "$GNU_CC"; then
3305 # gcc needs -mfpu=neon to recognize NEON instructions
3306 CFLAGS="$CFLAGS -mfpu=neon"
3309 [asm("vadd.i8 d0, d0, d0");],
3310 result="yes", result="no")
3311 AC_MSG_RESULT("$result")
3312 if test "$result" = "yes"; then
3313 AC_DEFINE(HAVE_ARM_NEON)
3316 CFLAGS="$_SAVE_CFLAGS"
3317 AC_SUBST(HAVE_ARM_NEON)
3319 dnl ========================================================
3320 dnl = pthread support
3321 dnl = Start by checking whether the system support pthreads
3322 dnl ========================================================
3323 case "$target_os" in
3328 MOZ_CHECK_PTHREADS(pthreads,
3329 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3330 MOZ_CHECK_PTHREADS(pthread,
3331 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3332 MOZ_CHECK_PTHREADS(c_r,
3333 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3334 MOZ_CHECK_PTHREADS(c,
3343 dnl ========================================================
3344 dnl Check the command line for --with-pthreads
3345 dnl ========================================================
3346 MOZ_ARG_WITH_BOOL(pthreads,
3347 [ --with-pthreads Force use of system pthread library with NSPR ],
3348 [ if test "$USE_PTHREADS"x = x; then
3349 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3355 dnl ========================================================
3356 dnl Do the platform specific pthread hackery
3357 dnl ========================================================
3358 if test "$USE_PTHREADS"x != x
3361 dnl See if -pthread is supported.
3364 ac_cv_have_dash_pthread=no
3365 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3366 echo 'int main() { return 0; }' | cat > conftest.c
3367 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3368 if test $? -eq 0; then
3369 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3370 ac_cv_have_dash_pthread=yes
3371 case "$target_os" in
3373 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3376 CFLAGS="$CFLAGS -pthread"
3377 CXXFLAGS="$CXXFLAGS -pthread"
3383 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3386 dnl See if -pthreads is supported.
3388 ac_cv_have_dash_pthreads=no
3389 if test "$ac_cv_have_dash_pthread" = "no"; then
3390 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3391 echo 'int main() { return 0; }' | cat > conftest.c
3392 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3393 if test $? -eq 0; then
3394 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3395 ac_cv_have_dash_pthreads=yes
3396 CFLAGS="$CFLAGS -pthreads"
3397 CXXFLAGS="$CXXFLAGS -pthreads"
3401 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3406 AC_DEFINE(_REENTRANT)
3407 AC_DEFINE(_THREAD_SAFE)
3408 dnl -pthread links in -lc_r, so don't specify it explicitly.
3409 if test "$ac_cv_have_dash_pthread" = "yes"; then
3410 _PTHREAD_LDFLAGS="-pthread"
3412 _PTHREAD_LDFLAGS="-lc_r"
3416 *-*-openbsd*|*-*-bsdi*)
3417 AC_DEFINE(_REENTRANT)
3418 AC_DEFINE(_THREAD_SAFE)
3419 dnl -pthread links in -lc_r, so don't specify it explicitly.
3420 if test "$ac_cv_have_dash_pthread" = "yes"; then
3421 _PTHREAD_LDFLAGS="-pthread"
3425 *-*-linux*|*-*-kfreebsd*-gnu)
3426 AC_DEFINE(_REENTRANT)
3430 AC_DEFINE(_REENTRANT)
3434 AC_DEFINE(_REENTRANT)
3438 AC_DEFINE(_REENTRANT)
3442 AC_DEFINE(_REENTRANT)
3446 AC_DEFINE(_REENTRANT)
3447 if test "$SOLARIS_SUNPRO_CC"; then
3448 CFLAGS="$CFLAGS -mt"
3449 CXXFLAGS="$CXXFLAGS -mt"
3453 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3456 dnl ========================================================
3457 dnl See if mmap sees writes
3458 dnl For cross compiling, just define it as no, which is a safe default
3459 dnl ========================================================
3460 AC_MSG_CHECKING(whether mmap() sees write()s)
3466 #include <sys/mman.h>
3467 #include <sys/types.h>
3468 #include <sys/stat.h>
3471 char fname[] = "conftest.file";
3472 char zbuff[1024]; /* Fractional page is probably worst case */
3479 fd = open(fname, O_RDWR | O_CREAT, 0660);
3482 write(fd, zbuff, sizeof(zbuff));
3483 lseek(fd, 0, SEEK_SET);
3484 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3485 if(map==(char*)-1) return 2;
3486 for(i=0; fname[i]; i++) {
3487 int rc = write(fd, &fname[i], 1);
3488 if(map[i]!=fname[i]) return 4;
3495 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3497 AC_MSG_RESULT("$result")
3499 if test "$result" = "no"; then
3500 AC_DEFINE(MMAP_MISSES_WRITES)
3504 dnl Checks for library functions.
3505 dnl ========================================================
3506 AC_PROG_GCC_TRADITIONAL
3508 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3509 AC_CHECK_FUNCS(flockfile getpagesize)
3510 AC_CHECK_FUNCS(localtime_r strtok_r)
3512 dnl check for wcrtomb/mbrtowc
3513 dnl =======================================================================
3514 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3517 AC_CACHE_CHECK(for wcrtomb,
3519 [AC_TRY_LINK([#include <wchar.h>],
3520 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3521 ac_cv_have_wcrtomb="yes",
3522 ac_cv_have_wcrtomb="no")])
3523 if test "$ac_cv_have_wcrtomb" = "yes"; then
3524 AC_DEFINE(HAVE_WCRTOMB)
3526 AC_CACHE_CHECK(for mbrtowc,
3528 [AC_TRY_LINK([#include <wchar.h>],
3529 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3530 ac_cv_have_mbrtowc="yes",
3531 ac_cv_have_mbrtowc="no")])
3532 if test "$ac_cv_have_mbrtowc" = "yes"; then
3533 AC_DEFINE(HAVE_MBRTOWC)
3540 ac_cv_func_res_ninit,
3543 #define _BSD_SOURCE 1
3547 [int foo = res_ninit(&_res);],
3548 [ac_cv_func_res_ninit=yes],
3549 [ac_cv_func_res_ninit=no])
3552 if test "$ac_cv_func_res_ninit" = "yes"; then
3553 AC_DEFINE(HAVE_RES_NINIT)
3554 dnl must add the link line we do something as foolish as this... dougt
3556 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3557 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3562 [for gnu_get_libc_version()],
3563 ac_cv_func_gnu_get_libc_version,
3565 #ifdef HAVE_GNU_LIBC_VERSION_H
3566 #include <gnu/libc-version.h>
3569 [const char *glibc_version = gnu_get_libc_version();],
3570 [ac_cv_func_gnu_get_libc_version=yes],
3571 [ac_cv_func_gnu_get_libc_version=no]
3575 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3576 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3580 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3584 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3585 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3586 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3588 LIBS="$LIBS $_ICONV_LIBS"
3597 iconv_t h = iconv_open("", "");
3598 iconv(h, NULL, NULL, NULL, NULL);
3601 [ac_cv_func_iconv=yes],
3602 [ac_cv_func_iconv=no]
3605 if test "$ac_cv_func_iconv" = "yes"; then
3606 AC_DEFINE(HAVE_ICONV)
3607 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3608 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3609 LIBICONV="$_ICONV_LIBS"
3611 [for iconv() with const input],
3612 ac_cv_func_const_iconv,
3618 const char *input = "testing";
3619 iconv_t h = iconv_open("", "");
3620 iconv(h, &input, NULL, NULL, NULL);
3623 [ac_cv_func_const_iconv=yes],
3624 [ac_cv_func_const_iconv=no]
3627 if test "$ac_cv_func_const_iconv" = "yes"; then
3628 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3640 dnl **********************
3641 dnl *** va_copy checks ***
3642 dnl **********************
3643 dnl we currently check for all three va_copy possibilities, so we get
3644 dnl all results in config.log for bug reports.
3645 AC_MSG_CHECKING(for an implementation of va_copy())
3646 AC_CACHE_VAL(ac_cv_va_copy,[
3649 void f (int i, ...) {
3650 va_list args1, args2;
3651 va_start (args1, i);
3652 va_copy (args2, args1);
3653 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3655 va_end (args1); va_end (args2);
3657 int main() { f (0, 42); return 0; }],
3663 AC_MSG_RESULT($ac_cv_va_copy)
3664 AC_MSG_CHECKING(for an implementation of __va_copy())
3665 AC_CACHE_VAL(ac_cv___va_copy,[
3668 void f (int i, ...) {
3669 va_list args1, args2;
3670 va_start (args1, i);
3671 __va_copy (args2, args1);
3672 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3674 va_end (args1); va_end (args2);
3676 int main() { f (0, 42); return 0; }],
3677 ac_cv___va_copy=yes,
3682 AC_MSG_RESULT($ac_cv___va_copy)
3683 AC_MSG_CHECKING(whether va_lists can be copied by value)
3684 AC_CACHE_VAL(ac_cv_va_val_copy,[
3687 void f (int i, ...) {
3688 va_list args1, args2;
3689 va_start (args1, i);
3691 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3693 va_end (args1); va_end (args2);
3695 int main() { f (0, 42); return 0; }],
3696 ac_cv_va_val_copy=yes,
3697 ac_cv_va_val_copy=no,
3698 ac_cv_va_val_copy=yes
3701 if test "x$ac_cv_va_copy" = "xyes"; then
3702 AC_DEFINE(VA_COPY, va_copy)
3703 AC_DEFINE(HAVE_VA_COPY)
3704 elif test "x$ac_cv___va_copy" = "xyes"; then
3705 AC_DEFINE(VA_COPY, __va_copy)
3706 AC_DEFINE(HAVE_VA_COPY)
3709 if test "x$ac_cv_va_val_copy" = "xno"; then
3710 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3712 AC_MSG_RESULT($ac_cv_va_val_copy)
3714 dnl Check for dll-challenged libc's.
3715 dnl This check is apparently only needed for Linux.
3718 dnl ===================================================================
3721 rm -rf conftest* _conftest
3723 cat >> conftest.C <<\EOF
3728 void __dump_link_map(void) {
3729 struct link_map *map = _dl_loaded;
3730 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3733 dlopen("./conftest1.so",RTLD_LAZY);
3734 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3735 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3736 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3740 /* _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).*/
3741 int main() { printf("./conftest1.so\n"); }
3745 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3747 cat >> conftest1.C <<\EOF
3749 void foo(void) {printf("foo in dll called\n");}
3751 ${CXX-g++} -fPIC -c -g conftest1.C
3752 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3753 ${CXX-g++} -g conftest.C -o conftest -ldl
3754 cp -f conftest1.so conftest _conftest
3756 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3759 echo "*** Your libc has a bug that can result in loading the same dynamic"
3760 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3761 echo "*** or later. However, if you choose not to upgrade, the only effect"
3762 echo "*** will be excessive memory usage at runtime."
3766 rm -rf conftest* _conftest
3767 dnl ===================================================================
3771 dnl ===================================================================
3772 dnl ========================================================
3773 dnl By default, turn rtti and exceptions off on g++/egcs
3774 dnl ========================================================
3775 if test "$GNU_CXX"; then
3777 AC_MSG_CHECKING(for C++ exceptions flag)
3779 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3780 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3781 [echo "int main() { return 0; }" | cat > conftest.C
3783 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3785 if egrep "warning.*renamed" conftest.out >/dev/null; then
3786 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3788 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3793 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3794 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3795 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3798 dnl ========================================================
3799 dnl Put your C++ language/feature checks below
3800 dnl ========================================================
3804 if test "$GNU_CC"; then
3805 AC_CACHE_CHECK(for gcc 3.0 ABI,
3806 ac_cv_gcc_three_abi,
3809 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3815 ac_cv_gcc_three_abi="yes",
3816 ac_cv_gcc_three_abi="no")])
3817 if test "$ac_cv_gcc_three_abi" = "yes"; then
3818 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3821 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3824 AC_SUBST(HAVE_GCC3_ABI)
3827 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3829 [AC_TRY_COMPILE(class X {
3830 public: explicit X(int i) : i_(i) {}
3834 ac_cv_cpp_explicit=yes,
3835 ac_cv_cpp_explicit=no)])
3836 if test "$ac_cv_cpp_explicit" = yes ; then
3837 AC_DEFINE(HAVE_CPP_EXPLICIT)
3840 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3842 [AC_TRY_COMPILE(class param {
3844 typedef unsigned long num_type;
3847 template <class T> class tplt {
3849 typedef typename T::num_type t_num_type;
3850 t_num_type foo(typename T::num_type num) {
3856 ac_cv_cpp_typename=yes,
3857 ac_cv_cpp_typename=no)])
3858 if test "$ac_cv_cpp_typename" = yes ; then
3859 AC_DEFINE(HAVE_CPP_TYPENAME)
3862 dnl Check for support of modern template specialization syntax
3863 dnl Test code and requirement from scc@netscape.com.
3864 dnl Autoconf cut-and-paste job by waterson@netscape.com
3865 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3866 ac_cv_cpp_modern_specialize_template_syntax,
3867 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3869 template <> struct X<Y> { double a; };,
3872 ac_cv_cpp_modern_specialize_template_syntax=yes,
3873 ac_cv_cpp_modern_specialize_template_syntax=no)])
3874 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3875 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3879 dnl Some compilers support only full specialization, and some don't.
3880 AC_CACHE_CHECK(whether partial template specialization works,
3881 ac_cv_cpp_partial_specialization,
3882 [AC_TRY_COMPILE(template <class T> class Foo {};
3883 template <class T> class Foo<T*> {};,
3885 ac_cv_cpp_partial_specialization=yes,
3886 ac_cv_cpp_partial_specialization=no)])
3887 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3888 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3891 dnl Some compilers have limited support for operators with templates;
3892 dnl specifically, it is necessary to define derived operators when a base
3893 dnl class's operator declaration should suffice.
3894 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3895 ac_cv_need_derived_template_operators,
3896 [AC_TRY_COMPILE([template <class T> class Base { };
3898 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3899 template <class T> class Derived : public Base<T> { };],
3900 [Derived<char> a, b;
3901 Base<char> c = a + b;
3903 ac_cv_need_derived_template_operators=no,
3904 ac_cv_need_derived_template_operators=yes)])
3905 if test "$ac_cv_need_derived_template_operators" = yes ; then
3906 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3910 dnl Some compilers have trouble detecting that a template class
3911 dnl that derives from another template is actually an instance
3912 dnl of the base class. This test checks for that.
3913 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3914 ac_cv_need_cpp_template_cast_to_base,
3915 [AC_TRY_COMPILE([template <class T> class Base { };
3916 template <class T> class Derived : public Base<T> { };
3917 template <class T> int foo(const Base<T>&) { return 0; }],
3918 [Derived<char> bar; return foo(bar);],
3919 ac_cv_need_cpp_template_cast_to_base=no,
3920 ac_cv_need_cpp_template_cast_to_base=yes)])
3921 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3922 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3925 dnl Some compilers have trouble resolving the ambiguity between two
3926 dnl functions whose arguments differ only by cv-qualifications.
3927 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3928 ac_cv_can_resolve_const_ambiguity,
3930 template <class T> class ptrClass {
3934 template <class T> T* a(ptrClass<T> *arg) {
3939 const T* a(const ptrClass<T> *arg) {
3945 ac_cv_can_resolve_const_ambiguity=yes,
3946 ac_cv_can_resolve_const_ambiguity=no)])
3947 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3948 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3952 dnl We don't do exceptions on unix. The only reason this used to be here
3953 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3954 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3955 dnl So im commenting this out until someone writes some artificial
3956 dnl intelligence to detect not only if the compiler has exceptions, but if
3957 dnl they are enabled as well.
3959 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3960 dnl ac_cv_cpp_exceptions,
3961 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3962 dnl static void F() { throw X(); },
3963 dnl try { F(); } catch(X & e) { },
3964 dnl ac_cv_cpp_exceptions=yes,
3965 dnl ac_cv_cpp_exceptions=no)])
3966 dnl if test $ac_cv_cpp_exceptions = yes ; then
3967 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3970 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3971 dnl supports it well enough to allow us to use it to change access, but not
3972 dnl to resolve ambiguity. The next two tests determine how well the |using|
3973 dnl keyword is supported.
3975 dnl Check to see if we can change access with |using|. Test both a
3976 dnl legal and an illegal example.
3977 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3978 ac_cv_cpp_access_changing_using2,
3980 class A { protected: int foo() { return 0; } };
3981 class B : public A { public: using A::foo; };,
3982 B b; return b.foo();,
3984 class A { public: int foo() { return 1; } };
3985 class B : public A { private: using A::foo; };,
3986 B b; return b.foo();,
3987 ac_cv_cpp_access_changing_using2=no,
3988 ac_cv_cpp_access_changing_using2=yes)],
3989 ac_cv_cpp_access_changing_using2=no)])
3990 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3991 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3994 dnl Check to see if we can resolve ambiguity with |using|.
3995 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3996 ac_cv_cpp_ambiguity_resolving_using,
3997 [AC_TRY_COMPILE(class X {
3998 public: int go(const X&) {return 3;}
3999 int jo(const X&) {return 3;}
4001 class Y : public X {
4002 public: int go(int) {return 2;}
4003 int jo(int) {return 2;}
4005 private: using X::go;
4008 ac_cv_cpp_ambiguity_resolving_using=yes,
4009 ac_cv_cpp_ambiguity_resolving_using=no)])
4010 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
4011 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
4014 dnl Check to see if the |std| namespace is supported. If so, we'll want
4015 dnl to qualify any standard library calls with "std::" to ensure that
4016 dnl those functions can be resolved.
4017 AC_CACHE_CHECK(for \"std::\" namespace,
4018 ac_cv_cpp_namespace_std,
4019 [AC_TRY_COMPILE([#include <algorithm>],
4020 [return std::min(0, 1);],
4021 ac_cv_cpp_namespace_std=yes,
4022 ac_cv_cpp_namespace_std=no)])
4023 if test "$ac_cv_cpp_namespace_std" = yes ; then
4024 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
4027 dnl Older compilers are overly ambitious with respect to using the standard
4028 dnl template library's |operator!=()| when |operator==()| is defined. In
4029 dnl which case, defining |operator!=()| in addition to |operator==()| causes
4030 dnl ambiguity at compile-time. This test checks for that case.
4031 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
4032 ac_cv_cpp_unambiguous_std_notequal,
4033 [AC_TRY_COMPILE([#include <algorithm>
4035 int operator==(const T1&, const T1&) { return 0; }
4036 int operator!=(const T1&, const T1&) { return 0; }],
4037 [T1 a,b; return a != b;],
4038 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
4039 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
4040 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
4041 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
4045 AC_CACHE_CHECK(for C++ reinterpret_cast,
4046 ac_cv_cpp_reinterpret_cast,
4047 [AC_TRY_COMPILE(struct X { int i; };
4048 struct Y { int i; };,
4049 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
4050 ac_cv_cpp_reinterpret_cast=yes,
4051 ac_cv_cpp_reinterpret_cast=no)])
4052 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
4053 AC_DEFINE(HAVE_CPP_NEW_CASTS)
4056 dnl See if a dynamic_cast to void* gives the most derived object.
4057 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
4058 ac_cv_cpp_dynamic_cast_void_ptr,
4059 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
4060 class Y { int j; public: virtual ~Y() { } };
4061 class Z : public X, public Y { int k; };
4067 return !((((void*)&mdo != (void*)subx) &&
4068 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
4069 (((void*)&mdo != (void*)suby) &&
4070 ((void*)&mdo == dynamic_cast<void*>(suby))));
4072 ac_cv_cpp_dynamic_cast_void_ptr=yes,
4073 ac_cv_cpp_dynamic_cast_void_ptr=no,
4074 ac_cv_cpp_dynamic_cast_void_ptr=no)])
4075 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
4076 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
4080 dnl note that this one is reversed - if the test fails, then
4081 dnl we require implementations of unused virtual methods. Which
4082 dnl really blows because it means we'll have useless vtable
4084 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
4085 ac_cv_cpp_unused_required,
4086 [AC_TRY_LINK(class X {private: virtual void never_called();};,
4088 ac_cv_cpp_unused_required=no,
4089 ac_cv_cpp_unused_required=yes)])
4090 if test "$ac_cv_cpp_unused_required" = yes ; then
4091 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
4095 dnl Some compilers have trouble comparing a constant reference to a templatized
4096 dnl class to zero, and require an explicit operator==() to be defined that takes
4097 dnl an int. This test separates the strong from the weak.
4099 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
4100 ac_cv_trouble_comparing_to_zero,
4101 [AC_TRY_COMPILE([#include <algorithm>
4102 template <class T> class Foo {};
4104 template <class T> int operator==(const T2*, const T&) { return 0; }
4105 template <class T> int operator!=(const T2*, const T&) { return 0; }],
4106 [Foo<int> f; return (0 != f);],
4107 ac_cv_trouble_comparing_to_zero=no,
4108 ac_cv_trouble_comparing_to_zero=yes)])
4109 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
4110 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
4115 dnl End of C++ language/feature checks
4118 dnl ========================================================
4119 dnl = Internationalization checks
4120 dnl ========================================================
4122 dnl Internationalization and Locale support is different
4123 dnl on various UNIX platforms. Checks for specific i18n
4124 dnl features go here.
4126 dnl check for LC_MESSAGES
4127 AC_CACHE_CHECK(for LC_MESSAGES,
4128 ac_cv_i18n_lc_messages,
4129 [AC_TRY_COMPILE([#include <locale.h>],
4130 [int category = LC_MESSAGES;],
4131 ac_cv_i18n_lc_messages=yes,
4132 ac_cv_i18n_lc_messages=no)])
4133 if test "$ac_cv_i18n_lc_messages" = yes; then
4134 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
4137 fi # SKIP_COMPILER_CHECKS
4140 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
4141 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4144 dnl Mozilla specific options
4145 dnl ========================================================
4146 dnl The macros used for command line options
4147 dnl are defined in build/autoconf/altoptions.m4.
4150 dnl ========================================================
4152 dnl = Check for external package dependencies
4154 dnl ========================================================
4155 MOZ_ARG_HEADER(External Packages)
4159 MOZ_ARG_WITH_STRING(libxul-sdk,
4160 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4161 LIBXUL_SDK_DIR=$withval)
4163 if test "$LIBXUL_SDK_DIR" = "yes"; then
4164 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4165 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4166 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4168 if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
4169 AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
4174 AC_SUBST(LIBXUL_SDK)
4176 if test -n "$LIBXUL_SDK"; then
4177 LIBXUL_DIST="$LIBXUL_SDK"
4179 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4181 AC_SUBST(LIBXUL_DIST)
4185 MOZ_ARG_WITH_BOOL(system-libxul,
4186 [ --with-system-libxul Use system installed libxul SDK],
4189 if test -n "$SYSTEM_LIBXUL" && test -z "$MOZ_ENABLE_LIBXUL"; then
4190 AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4193 dnl ========================================================
4194 dnl = If NSPR was not detected in the system,
4195 dnl = use the one in the source tree (mozilla/nsprpub)
4196 dnl ========================================================
4197 MOZ_ARG_WITH_BOOL(system-nspr,
4198 [ --with-system-nspr Use system installed NSPR],
4199 _USE_SYSTEM_NSPR=1 )
4201 if test -n "$_USE_SYSTEM_NSPR"; then
4202 AM_PATH_NSPR(4.8.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
4205 if test -n "$MOZ_NATIVE_NSPR"; then
4206 _SAVE_CFLAGS=$CFLAGS
4207 CFLAGS="$CFLAGS $NSPR_CFLAGS"
4208 AC_TRY_COMPILE([#include "prlog.h"],
4209 [#ifndef PR_STATIC_ASSERT
4210 #error PR_STATIC_ASSERT not defined
4212 [MOZ_NATIVE_NSPR=1],
4213 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
4214 CFLAGS=$_SAVE_CFLAGS
4216 if test "$OS_ARCH" = "WINCE"; then
4217 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4218 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4219 elif test "$OS_ARCH" = "WINNT"; then
4220 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4221 if test -n "$GNU_CC"; then
4222 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4224 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4227 NSPR_CFLAGS='`$(LIBXUL_DIST)/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4228 NSPR_LIBS='`$(LIBXUL_DIST)/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4232 dnl ========================================================
4233 dnl = If NSS was not detected in the system,
4234 dnl = use the one in the source tree (mozilla/security/nss)
4235 dnl ========================================================
4237 MOZ_ARG_WITH_BOOL(system-nss,
4238 [ --with-system-nss Use system installed NSS],
4241 if test -n "$_USE_SYSTEM_NSS"; then
4242 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
4245 if test -n "$MOZ_NATIVE_NSS"; then
4246 NSS_LIBS="$NSS_LIBS -lcrmf"
4248 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4250 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4251 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4252 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4253 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4254 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX) \
4255 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
4257 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4259 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4260 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4261 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4262 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4263 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4264 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
4266 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
4270 if test -z "$SKIP_LIBRARY_CHECKS"; then
4271 dnl system JPEG support
4272 dnl ========================================================
4273 MOZ_ARG_WITH_STRING(system-jpeg,
4274 [ --with-system-jpeg[=PFX]
4275 Use system libjpeg [installed at prefix PFX]],
4278 _SAVE_CFLAGS=$CFLAGS
4279 _SAVE_LDFLAGS=$LDFLAGS
4281 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4282 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4283 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4285 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4288 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4291 if test "$SYSTEM_JPEG" = 1; then
4292 LIBS="$JPEG_LIBS $LIBS"
4293 AC_TRY_COMPILE([ #include <stdio.h>
4294 #include <sys/types.h>
4295 #include <jpeglib.h> ],
4296 [ #if JPEG_LIB_VERSION < $MOZJPEG
4297 #error "Insufficient JPEG library version ($MOZJPEG required)."
4300 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4302 CFLAGS=$_SAVE_CFLAGS
4303 LDFLAGS=$_SAVE_LDFLAGS
4306 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4307 JPEG_CFLAGS="-I${JPEG_DIR}/include"
4308 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4311 dnl system ZLIB support
4312 dnl ========================================================
4313 MOZ_ARG_WITH_STRING(system-zlib,
4314 [ --with-system-zlib[=PFX]
4315 Use system libz [installed at prefix PFX]],
4318 _SAVE_CFLAGS=$CFLAGS
4319 _SAVE_LDFLAGS=$LDFLAGS
4321 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4322 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4323 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4325 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4328 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4329 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4331 if test "$SYSTEM_ZLIB" = 1; then
4332 LIBS="$ZLIB_LIBS $LIBS"
4333 AC_TRY_COMPILE([ #include <stdio.h>
4335 #include <zlib.h> ],
4336 [ #if ZLIB_VERNUM < $MOZZLIB
4337 #error "Insufficient zlib version ($MOZZLIB required)."
4340 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4342 CFLAGS=$_SAVE_CFLAGS
4343 LDFLAGS=$_SAVE_LDFLAGS
4346 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4347 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4348 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4351 dnl system BZIP2 Support
4352 dnl ========================================================
4353 MOZ_ARG_WITH_STRING(system-bz2,
4354 [ --with-system-bz2[=PFX]
4355 Use system libbz2 [installed at prefix PFX]],
4358 _SAVE_CFLAGS=$CFLAGS
4359 _SAVE_LDFLAGS=$LDFLAGS
4361 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4362 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4363 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4365 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4368 AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4369 [SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
4371 CFLAGS=$_SAVE_CFLAGS
4372 LDFLAGS=$_SAVE_LDFLAGS
4375 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4376 BZ2_CFLAGS="-I${BZ2_DIR}/include"
4377 BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4380 dnl system PNG Support
4381 dnl ========================================================
4382 MOZ_ARG_WITH_STRING(system-png,
4383 [ --with-system-png[=PFX]
4384 Use system libpng [installed at prefix PFX]],
4387 _SAVE_CFLAGS=$CFLAGS
4388 _SAVE_LDFLAGS=$LDFLAGS
4390 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4391 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4392 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4393 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4394 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4396 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4399 _SAVE_PNG_LIBS=$PNG_LIBS
4400 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4401 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4403 AC_CHECK_LIB(png, png_get_acTL, ,
4404 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4407 if test "$SYSTEM_PNG" = 1; then
4408 LIBS="$PNG_LIBS $LIBS"
4409 AC_TRY_COMPILE([ #include <stdio.h>
4410 #include <sys/types.h>
4412 [ #if PNG_LIBPNG_VER < $MOZPNG
4413 #error "Insufficient libpng version ($MOZPNG required)."
4415 #ifndef PNG_UINT_31_MAX
4416 #error "Insufficient libpng version."
4419 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4421 CFLAGS=$_SAVE_CFLAGS
4422 LDFLAGS=$_SAVE_LDFLAGS
4425 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4426 PNG_CFLAGS="-I${PNG_DIR}/include"
4427 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4430 fi # SKIP_LIBRARY_CHECKS
4432 dnl system HunSpell Support
4433 dnl ========================================================
4434 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4435 [ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4438 if test -n "$SYSTEM_HUNSPELL"; then
4439 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4442 AC_SUBST(SYSTEM_HUNSPELL)
4444 dnl ========================================================
4445 dnl Java SDK support
4446 dnl ========================================================
4448 MOZ_ARG_WITH_STRING(java-include-path,
4449 [ --with-java-include-path=dir Location of Java SDK headers],
4450 JAVA_INCLUDE_PATH=$withval)
4453 MOZ_ARG_WITH_STRING(java-bin-path,
4454 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4455 JAVA_BIN_PATH=$withval)
4457 dnl ========================================================
4458 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4459 dnl their usage and use them in spidermonkey.
4460 dnl ========================================================
4461 MOZ_ARG_WITH_BOOL(arm-kuser,
4462 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4465 if test -n "$USE_ARM_KUSER"; then
4466 AC_DEFINE(USE_ARM_KUSER)
4469 dnl ========================================================
4473 dnl ========================================================
4475 MOZ_ARG_HEADER(Application)
4479 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4480 MOZ_BRANDING_DIRECTORY=
4481 MOZ_DBGRINFO_MODULES=
4483 MOZ_ENABLE_CANVAS3D=
4485 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon"
4486 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4493 MOZ_AUTH_EXTENSION=1
4494 MOZ_NO_ACTIVEX_SUPPORT=1
4495 MOZ_NO_INSPECTOR_APIS=
4496 MOZ_NO_XPCOM_OBSOLETE=
4504 MOZ_PLAINTEXT_EDITOR_ONLY=
4506 MOZ_PREF_EXTENSIONS=1
4507 MOZ_PROFILELOCKING=1
4515 MOZ_STATIC_MAIL_BUILD=
4520 MOZ_UNIVERSALCHARDET=1
4522 MOZ_USE_NATIVE_UCONV=
4524 MOZ_XPFE_COMPONENTS=1
4526 MOZ_XSLT_STANDALONE=
4534 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4535 NECKO_SMALL_BUFFERS=
4536 XPC_IDISPATCH_SUPPORT=
4539 case "$target_os" in
4548 case "$target_os" in
4549 msvc*|mks*|cygwin*|mingw*)
4550 if test -z "$GNU_CC"; then
4551 XPC_IDISPATCH_SUPPORT=1
4552 MOZ_NO_ACTIVEX_SUPPORT=
4557 MOZ_ARG_ENABLE_STRING(application,
4558 [ --enable-application=APP
4562 content/xslt (Standalone Transformiix XSLT)
4563 netwerk (Standalone Necko)
4564 tools/update-packaging (AUS-related packaging tools)
4565 standalone (use this for standalone
4566 xpcom/xpconnect or to manually drive a build)],
4567 [ MOZ_BUILD_APP=$enableval ] )
4569 MOZ_EMBEDDING_PROFILE=default
4570 MOZ_ARG_WITH_STRING(embedding-profile,
4571 [ --with-embedding-profile=default|basic|minimal
4572 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4573 [ MOZ_EMBEDDING_PROFILE=$withval ])
4575 case "$MOZ_EMBEDDING_PROFILE" in
4577 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4578 MOZ_EMBEDDING_LEVEL_BASIC=1
4579 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4580 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4581 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4582 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4586 MOZ_EMBEDDING_LEVEL_DEFAULT=
4587 MOZ_EMBEDDING_LEVEL_BASIC=1
4588 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4589 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4590 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4592 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4594 MOZ_ENABLE_POSTSCRIPT=
4595 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4596 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4597 MOZ_IMG_ENCODERS_DEFAULT=
4603 MOZ_NO_ACTIVEX_SUPPORT=1
4604 MOZ_NO_INSPECTOR_APIS=1
4605 MOZ_NO_XPCOM_OBSOLETE=1
4607 MOZ_PLAINTEXT_EDITOR_ONLY=1
4609 MOZ_PREF_EXTENSIONS=
4613 MOZ_UNIVERSALCHARDET=
4615 MOZ_USE_NATIVE_UCONV=
4617 MOZ_XPFE_COMPONENTS=
4622 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4623 NECKO_SMALL_BUFFERS=1
4624 NS_DISABLE_LOGGING=1
4629 MOZ_EMBEDDING_LEVEL_DEFAULT=
4630 MOZ_EMBEDDING_LEVEL_BASIC=
4631 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4632 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4634 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4636 MOZ_ENABLE_POSTSCRIPT=
4637 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4638 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4639 MOZ_IMG_ENCODERS_DEFAULT=
4645 MOZ_NO_ACTIVEX_SUPPORT=1
4646 MOZ_NO_INSPECTOR_APIS=1
4647 MOZ_NO_XPCOM_OBSOLETE=1
4649 MOZ_PLAINTEXT_EDITOR_ONLY=1
4651 MOZ_PREF_EXTENSIONS=
4657 MOZ_UNIVERSALCHARDET=
4659 MOZ_USE_NATIVE_UCONV=1
4661 MOZ_XPFE_COMPONENTS=
4668 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4669 NECKO_SMALL_BUFFERS=1
4670 NS_DISABLE_LOGGING=1
4675 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4679 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4680 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4681 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4683 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4684 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4685 XULRUNNER_STUB_NAME=$withval)
4687 if test -z "$XULRUNNER_STUB_NAME"; then
4688 case "$target_os" in
4690 XULRUNNER_STUB_NAME=xulrunner
4693 XULRUNNER_STUB_NAME=xulrunner-stub
4696 AC_SUBST(XULRUNNER_STUB_NAME)
4698 if test -z "$MOZ_BUILD_APP"; then
4699 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4701 # We have a valid application only if it has a build.mk file in its top
4703 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4704 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4708 # Allow the application to influence configure with a confvars.sh script.
4710 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4711 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4712 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4713 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4718 # Now is a good time to test for logic errors, define mismatches, etc.
4719 case "$MOZ_BUILD_APP" in
4721 if test "$LIBXUL_SDK"; then
4722 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4727 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4728 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4730 case "$MOZ_BUILD_APP" in
4732 AC_DEFINE(MOZ_PHOENIX)
4736 AC_DEFINE(MOZ_XULRUNNER)
4744 MOZ_APP_NAME=mozilla
4745 MOZ_APP_DISPLAYNAME=Mozilla
4746 MOZ_APP_VERSION=$MOZILLA_VERSION
4751 AC_SUBST(MOZ_BUILD_APP)
4752 AC_SUBST(MOZ_PHOENIX)
4753 AC_SUBST(MOZ_XULRUNNER)
4755 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4757 dnl ========================================================
4759 dnl = Toolkit Options
4761 dnl ========================================================
4762 MOZ_ARG_HEADER(Toolkit Options)
4764 dnl ========================================================
4765 dnl = Select the default toolkit
4766 dnl ========================================================
4767 MOZ_ARG_ENABLE_STRING(default-toolkit,
4768 [ --enable-default-toolkit=TK
4769 Select default toolkit
4770 Platform specific defaults:
4772 Mac OS X - cairo-cocoa
4773 Neutrino/QNX - photon
4775 Win32/WinCE - cairo-windows
4776 Gtk2 with DirectFB - cairo-gtk2-dfb
4779 [ _DEFAULT_TOOLKIT=$enableval ],
4780 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4782 if test "$_DEFAULT_TOOLKIT" = "photon" \
4783 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4784 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4785 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
4786 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4787 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4788 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4789 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4790 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4792 dnl nglayout only supports building with one toolkit,
4793 dnl so ignore everything after the first comma (",").
4794 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4796 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4799 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4801 dnl ========================================================
4802 dnl = Enable the toolkit as needed =
4803 dnl ========================================================
4805 case "$MOZ_WIDGET_TOOLKIT" in
4808 AC_DEFINE(MOZ_WIDGET_PHOTON)
4812 MOZ_WIDGET_TOOLKIT=windows
4813 MOZ_GFX_TOOLKIT=cairo
4816 cairo-gtk2|cairo-gtk2-x11)
4817 MOZ_WIDGET_TOOLKIT=gtk2
4818 MOZ_GFX_TOOLKIT=cairo
4820 MOZ_ENABLE_XREMOTE=1
4825 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4826 TK_LIBS='$(MOZ_GTK2_LIBS)'
4827 AC_DEFINE(MOZ_WIDGET_GTK2)
4831 MOZ_WIDGET_TOOLKIT=gtk2
4832 MOZ_GFX_TOOLKIT=cairo
4838 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4839 TK_LIBS='$(MOZ_GTK2_LIBS)'
4840 AC_DEFINE(MOZ_WIDGET_GTK2)
4841 if test "$no_x" != "yes"; then
4842 AC_MSG_WARN([Disabling X when DirectFB is specified.])
4848 MOZ_WIDGET_TOOLKIT=qt
4849 MOZ_GFX_TOOLKIT=cairo
4851 MOZ_ENABLE_XREMOTE=1
4858 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4859 TK_LIBS='$(MOZ_QT_LIBS)'
4860 AC_DEFINE(MOZ_WIDGET_QT)
4864 MOZ_WIDGET_TOOLKIT=beos
4865 MOZ_GFX_TOOLKIT=cairo
4866 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4867 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4871 MOZ_WIDGET_TOOLKIT=os2
4872 MOZ_GFX_TOOLKIT=cairo
4873 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4874 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4878 MOZ_WIDGET_TOOLKIT=cocoa
4879 AC_DEFINE(MOZ_WIDGET_COCOA)
4881 MOZ_GFX_TOOLKIT=cairo
4882 MOZ_USER_DIR="Mozilla"
4883 AC_DEFINE(XP_MACOSX)
4884 AC_DEFINE(TARGET_CARBON)
4885 AC_DEFINE(TARGET_API_MAC_CARBON)
4886 TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
4887 TK_CFLAGS="-DNO_X11"
4888 LDFLAGS="$LDFLAGS -framework Cocoa"
4889 CFLAGS="$CFLAGS $TK_CFLAGS"
4890 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4891 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
4892 MOZ_FS_LAYOUT=bundle
4896 if test "$MOZ_ENABLE_XREMOTE"; then
4897 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4900 if test "$COMPILE_ENVIRONMENT"; then
4901 if test "$MOZ_ENABLE_GTK2"; then
4902 if test "$MOZ_X11"; then
4903 GDK_PACKAGES=gdk-x11-2.0
4904 elif test "$MOZ_DFB"; then
4905 PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
4906 GDK_PACKAGES=directfb
4909 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4912 fi # COMPILE_ENVIRONMENT
4914 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4915 AC_SUBST(MOZ_FS_LAYOUT)
4917 dnl ========================================================
4918 dnl = startup-notification support module
4919 dnl ========================================================
4921 if test "$MOZ_ENABLE_GTK2"
4923 MOZ_ENABLE_STARTUP_NOTIFICATION=
4925 MOZ_ARG_ENABLE_BOOL(startup-notification,
4926 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4927 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4928 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4929 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4931 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4932 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4933 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4934 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4936 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4938 MOZ_ENABLE_STARTUP_NOTIFICATION=
4942 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4943 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4946 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4948 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4949 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4950 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4952 dnl ========================================================
4954 dnl ========================================================
4955 if test "$MOZ_ENABLE_QT"
4957 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtUiTools QtCore)
4958 AC_SUBST(MOZ_QT_CFLAGS)
4959 AC_SUBST(MOZ_QT_LIBS)
4961 MOZ_ARG_WITH_STRING(qtdir,
4962 [ --with-qtdir=\$dir Specify Qt directory ],
4965 if test -z "$QTDIR"; then
4968 QTINCDIR="/include/qt"
4969 if test ! -d "$QTDIR$QTINCDIR"; then
4970 QTINCDIR="/include/X11/qt"
4972 if test ! -d "$QTDIR$QTINCDIR"; then
4976 if test -x "$QTDIR/bin/moc-qt4"; then
4977 HOST_MOC="$QTDIR/bin/moc-qt4"
4979 if test -x "$QTDIR/bin/moc"; then
4980 HOST_MOC="$QTDIR/bin/moc"
4982 AC_CHECK_PROGS(HOST_MOC, moc, "")
4985 if test -z "$HOST_MOC"; then
4986 AC_MSG_ERROR([no acceptable moc preprocessor found])
4991 AC_SUBST(GTK_CONFIG)
4995 AC_SUBST(MOZ_ENABLE_GTK2)
4996 AC_SUBST(MOZ_ENABLE_PHOTON)
4997 AC_SUBST(MOZ_ENABLE_COCOA)
4998 AC_SUBST(MOZ_ENABLE_QT)
4999 AC_SUBST(MOZ_ENABLE_XREMOTE)
5000 AC_SUBST(MOZ_GTK2_CFLAGS)
5001 AC_SUBST(MOZ_GTK2_LIBS)
5002 AC_SUBST(MOZ_QT_CFLAGS)
5003 AC_SUBST(MOZ_QT_LIBS)
5010 dnl ========================================================
5012 dnl = Components & Features
5014 dnl ========================================================
5015 MOZ_ARG_HEADER(Components and Features)
5017 dnl ========================================================
5019 dnl ========================================================
5020 MOZ_ARG_ENABLE_STRING(ui-locale,
5021 [ --enable-ui-locale=ab-CD
5022 Select the user interface locale (default: en-US)],
5023 MOZ_UI_LOCALE=$enableval )
5024 AC_SUBST(MOZ_UI_LOCALE)
5026 dnl ========================================================
5027 dnl = Trademarked Branding
5028 dnl ========================================================
5029 MOZ_ARG_ENABLE_BOOL(official-branding,
5030 [ --enable-official-branding Enable Official mozilla.org Branding
5031 Do not distribute builds with
5032 --enable-official-branding unless you have
5033 permission to use trademarks per
5034 http://www.mozilla.org/foundation/trademarks/ .],
5035 [case "$MOZ_BUILD_APP" in
5037 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
5038 MOZ_APP_DISPLAYNAME=Firefox
5042 AC_MSG_ERROR([Official branding is only available for Firefox.])
5046 MOZ_ARG_WITH_STRING(branding,
5047 [ --with-branding=dir Use branding from the specified directory.],
5048 MOZ_BRANDING_DIRECTORY=$withval)
5050 dnl For Firefox, we always want MOZ_BRANDING_DIRECTORY to point somewhere, so
5051 dnl if it's not set make it point to the default branding location now. Other
5052 dnl products need MOZ_BRANDING_DIRECTORY to NOT be set, in order to use their
5053 dnl default branding (ie, only set it when using non-default branding).
5054 if test "$MOZ_BUILD_APP" = "browser" -a -z "$MOZ_BRANDING_DIRECTORY"; then
5055 MOZ_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5058 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
5059 if test -z "$REAL_BRANDING_DIRECTORY"; then
5060 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5063 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
5064 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
5067 AC_SUBST(MOZ_BRANDING_DIRECTORY)
5069 dnl ========================================================
5070 dnl = Distribution ID
5071 dnl ========================================================
5072 MOZ_ARG_WITH_STRING(distribution-id,
5073 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
5074 [ val=`echo $withval`
5075 MOZ_DISTRIBUTION_ID="$val"])
5077 if test -z "$MOZ_DISTRIBUTION_ID"; then
5078 MOZ_DISTRIBUTION_ID="org.mozilla"
5081 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
5082 AC_SUBST(MOZ_DISTRIBUTION_ID)
5085 dnl ========================================================
5086 dnl complex text support off by default
5087 dnl ========================================================
5089 MOZ_ARG_DISABLE_BOOL(pango,
5090 [ --disable-pango Disable usage of Pango ],
5095 dnl ========================================================
5097 dnl ========================================================
5098 if test "$MOZ_ENABLE_GTK2"
5102 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5104 if test "$MOZ_PANGO"
5106 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5107 AC_SUBST(MOZ_PANGO_CFLAGS)
5108 AC_SUBST(MOZ_PANGO_LIBS)
5109 AC_DEFINE(MOZ_PANGO)
5111 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5112 AC_SUBST(MOZ_PANGO_CFLAGS)
5113 AC_SUBST(MOZ_PANGO_LIBS)
5115 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5116 AC_SUBST(FT2_CFLAGS)
5121 dnl ========================================================
5122 dnl = PostScript print module
5123 dnl ========================================================
5124 MOZ_ARG_DISABLE_BOOL(postscript,
5125 [ --disable-postscript Disable PostScript printing support ],
5126 MOZ_ENABLE_POSTSCRIPT=,
5127 MOZ_ENABLE_POSTSCRIPT=1 )
5129 dnl ========================================================
5130 dnl = GnomeVFS support module
5131 dnl ========================================================
5135 dnl build the gnomevfs extension by default only when the
5136 dnl GTK2 toolkit is in use.
5137 if test "$MOZ_ENABLE_GTK2"
5139 MOZ_ENABLE_GNOMEVFS=1
5143 MOZ_ARG_DISABLE_BOOL(gnomevfs,
5144 [ --disable-gnomevfs Disable GnomeVFS support ],
5145 MOZ_ENABLE_GNOMEVFS=,
5146 MOZ_ENABLE_GNOMEVFS=force)
5148 if test "$MOZ_ENABLE_GNOMEVFS"
5150 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5151 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5152 MOZ_ENABLE_GNOMEVFS=1
5154 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5156 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5158 MOZ_ENABLE_GNOMEVFS=
5162 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
5163 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5164 AC_SUBST(MOZ_GNOMEVFS_LIBS)
5166 if test "$MOZ_ENABLE_GCONF"
5168 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
5169 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5176 if test "$MOZ_ENABLE_GCONF"; then
5177 AC_DEFINE(MOZ_ENABLE_GCONF)
5180 AC_SUBST(MOZ_ENABLE_GCONF)
5181 AC_SUBST(MOZ_GCONF_CFLAGS)
5182 AC_SUBST(MOZ_GCONF_LIBS)
5184 # The GNOME component is built if gtk2, gconf and gnome-vfs
5185 # are all available.
5187 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
5188 "$MOZ_ENABLE_GNOMEVFS"; then
5189 MOZ_ENABLE_GNOME_COMPONENT=1
5191 MOZ_ENABLE_GNOME_COMPONENT=
5194 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5197 dnl ========================================================
5198 dnl = libgnomeui support module
5199 dnl ========================================================
5201 if test "$MOZ_ENABLE_GTK2"
5203 MOZ_ENABLE_GNOMEUI=1
5205 MOZ_ARG_DISABLE_BOOL(gnomeui,
5206 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5207 MOZ_ENABLE_GNOMEUI=,
5208 MOZ_ENABLE_GNOMEUI=force)
5210 if test "$MOZ_ENABLE_GNOMEUI"
5212 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5214 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5215 MOZ_ENABLE_GNOMEUI=1
5217 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5219 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5225 if test "$MOZ_ENABLE_GNOMEUI"; then
5226 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5229 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5230 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5231 AC_SUBST(MOZ_GNOMEUI_LIBS)
5233 dnl ========================================================
5235 dnl ========================================================
5237 if test "$MOZ_ENABLE_GTK2" || test "$MOZ_ENABLE_QT"
5241 MOZ_ARG_DISABLE_BOOL(dbus,
5242 [ --disable-dbus Disable dbus support ],
5246 if test "$MOZ_ENABLE_DBUS"
5248 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5249 AC_DEFINE(MOZ_ENABLE_DBUS)
5252 AC_SUBST(MOZ_ENABLE_DBUS)
5253 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5254 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5256 dnl ========================================================
5257 dnl = libnotify support
5258 dnl ========================================================
5260 if test "$MOZ_ENABLE_GTK2"
5262 MOZ_ENABLE_LIBNOTIFY=1
5264 MOZ_ARG_DISABLE_BOOL(libnotify,
5265 [ --disable-libnotify Disable libnotify support ],
5266 MOZ_ENABLE_LIBNOTIFY=,
5267 MOZ_ENABLE_LIBNOTIFY=1)
5269 if test "$MOZ_ENABLE_LIBNOTIFY"
5271 AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5275 if test -z "$SKIP_LIBRARY_CHECKS"
5277 if test "$MOZ_ENABLE_GTK2"
5279 if test "$MOZ_ENABLE_LIBNOTIFY"
5281 PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5285 AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5286 AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5287 AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5289 dnl ========================================================
5290 dnl = Build Personal Security Manager
5291 dnl ========================================================
5292 MOZ_ARG_DISABLE_BOOL(crypto,
5293 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5297 dnl ========================================================
5298 dnl = JS Debugger XPCOM component (js/jsd)
5299 dnl ========================================================
5300 MOZ_ARG_DISABLE_BOOL(jsd,
5301 [ --disable-jsd Disable JavaScript debug library],
5306 dnl ========================================================
5307 dnl = Disable plugin support
5308 dnl ========================================================
5309 MOZ_ARG_DISABLE_BOOL(plugins,
5310 [ --disable-plugins Disable plugins support],
5314 dnl ========================================================
5315 dnl = Disable building dbm
5316 dnl ========================================================
5317 MOZ_ARG_DISABLE_BOOL(dbm,
5318 [ --disable-dbm Disable building dbm],
5322 dnl bi-directional support always on
5326 dnl ========================================================
5327 dnl view source support on by default
5328 dnl ========================================================
5329 MOZ_ARG_DISABLE_BOOL(view-source,
5330 [ --disable-view-source Disable view source support],
5333 if test "$MOZ_VIEW_SOURCE"; then
5334 AC_DEFINE(MOZ_VIEW_SOURCE)
5338 dnl ========================================================
5339 dnl accessibility support on by default on all platforms
5341 dnl ========================================================
5342 MOZ_ARG_DISABLE_BOOL(accessibility,
5343 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5346 if test "$ACCESSIBILITY"; then
5347 AC_DEFINE(ACCESSIBILITY)
5350 if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5352 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5353 if test "$ac_cv_header_atlbase_h" = "no"; then
5354 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.])
5356 if test "$ac_cv_header_oleacc_idl" = "no"; then
5357 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.])
5363 dnl ========================================================
5364 dnl xpfe/components on by default
5365 dnl ========================================================
5366 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5367 [ --disable-xpfe-components
5368 Disable xpfe components],
5369 MOZ_XPFE_COMPONENTS=,
5370 MOZ_XPFE_COMPONENTS=1 )
5372 dnl ========================================================
5373 dnl xpinstall support on by default
5374 dnl ========================================================
5375 MOZ_ARG_DISABLE_BOOL(xpinstall,
5376 [ --disable-xpinstall Disable xpinstall support],
5379 if test "$MOZ_XPINSTALL"; then
5380 AC_DEFINE(MOZ_XPINSTALL)
5383 dnl ========================================================
5384 dnl xpcom js loader support on by default
5385 dnl ========================================================
5386 MOZ_ARG_DISABLE_BOOL(jsloader,
5387 [ --disable-jsloader Disable xpcom js loader support],
5390 if test "$MOZ_JSLOADER"; then
5391 AC_DEFINE(MOZ_JSLOADER)
5394 dnl ========================================================
5395 dnl Disable printing
5396 dnl ========================================================
5397 MOZ_ARG_DISABLE_BOOL(printing,
5398 [ --disable-printing Disable printing support],
5402 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
5403 AC_MSG_WARN([Printing does not work with Qt at this time. Omitting printing support.])
5407 if test "$NS_PRINTING"; then
5408 AC_DEFINE(NS_PRINTING)
5409 AC_DEFINE(NS_PRINT_PREVIEW)
5412 dnl ========================================================
5413 dnl use native unicode converters
5414 dnl ========================================================
5415 MOZ_ARG_ENABLE_BOOL(native-uconv,
5416 [ --enable-native-uconv Enable iconv support],
5417 MOZ_USE_NATIVE_UCONV=1,
5418 MOZ_USE_NATIVE_UCONV= )
5419 if test "$MOZ_USE_NATIVE_UCONV"; then
5420 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5422 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5423 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5427 dnl ========================================================
5428 dnl Libeditor can be build as plaintext-only,
5429 dnl or as a full html and text editing component.
5430 dnl We build both by default.
5431 dnl ========================================================
5432 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5433 [ --enable-plaintext-editor-only
5434 Allow only plaintext editing],
5435 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5436 MOZ_PLAINTEXT_EDITOR_ONLY= )
5437 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5438 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5440 dnl ========================================================
5441 dnl = Drop XPCOM Obsolete library
5442 dnl ========================================================
5443 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5444 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5445 MOZ_NO_XPCOM_OBSOLETE=1,
5446 MOZ_NO_XPCOM_OBSOLETE=)
5448 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5449 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5452 dnl ========================================================
5453 dnl = Disable Fast Load
5454 dnl ========================================================
5455 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5456 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5460 AC_SUBST(MOZ_NO_FAST_LOAD)
5462 if test -n "$MOZ_NO_FAST_LOAD"; then
5463 AC_DEFINE(MOZ_NO_FAST_LOAD)
5466 dnl ========================================================
5467 dnl = Disable Ogg Codecs
5468 dnl ========================================================
5469 MOZ_ARG_DISABLE_BOOL(ogg,
5470 [ --disable-ogg Disable Ogg Codec support],
5476 if test -n "$MOZ_OGG"; then
5481 dnl Checks for __attribute__(aligned()) directive
5482 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5483 [ac_cv_c_attribute_aligned],
5484 [ac_cv_c_attribute_aligned=0
5485 CFLAGS_save="${CFLAGS}"
5486 CFLAGS="${CFLAGS} -Werror"
5487 for ac_cv_c_attr_align_try in 64 32 16 8; do
5488 echo "trying $ac_cv_c_attr_align_try"
5490 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5491 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5492 if test "$ac_cv_c_attribute_aligned" != 0; then
5496 CFLAGS="${CFLAGS_save}"])
5497 if test "${ac_cv_c_attribute_aligned}" != "0"; then
5498 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5499 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5503 dnl ========================================================
5504 dnl = Disable Wave decoder support
5505 dnl ========================================================
5506 MOZ_ARG_DISABLE_BOOL(wave,
5507 [ --disable-wave Disable Wave decoder support],
5513 if test -n "$MOZ_WAVE"; then
5519 dnl ========================================================
5520 dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
5521 dnl ========================================================
5523 AC_SUBST(MOZ_SYDNEYAUDIO)
5525 if test -n "$MOZ_SYDNEYAUDIO"; then
5526 AC_DEFINE(MOZ_SYDNEYAUDIO)
5531 if test -n "$MOZ_MEDIA"; then
5532 AC_DEFINE(MOZ_MEDIA)
5535 dnl ========================================================
5536 dnl = Check alsa availability on Linux if using sydneyaudio
5537 dnl ========================================================
5539 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5540 if test "$COMPILE_ENVIRONMENT"; then
5541 if test -n "$MOZ_SYDNEYAUDIO"; then
5542 case "$target_os" in
5544 AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
5550 dnl ========================================================
5552 dnl ========================================================
5553 AC_ARG_ENABLE(splashscreen,
5554 [ --enable-splashscreen display splashscreen while loading (default=no)],
5555 [enable_splash="yes"],[enable_splash=""])
5556 if test "x$enable_splash" = "xyes"; then
5558 AC_DEFINE(MOZ_SPLASHSCREEN)
5560 AC_SUBST(MOZ_SPLASHSCREEN)
5562 dnl ========================================================
5563 dnl Permissions System
5564 dnl ========================================================
5565 MOZ_ARG_DISABLE_BOOL(permissions,
5566 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5571 dnl ========================================================
5573 dnl ========================================================
5574 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5575 [ --disable-negotiateauth Disable GSS-API negotiation ],
5576 MOZ_AUTH_EXTENSION=,
5577 MOZ_AUTH_EXTENSION=1 )
5579 dnl ========================================================
5581 dnl ========================================================
5582 MOZ_ARG_DISABLE_BOOL(xtf,
5583 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5586 if test "$MOZ_XTF"; then
5590 dnl ========================================================
5592 dnl ========================================================
5593 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5594 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5595 MOZ_NO_INSPECTOR_APIS=1,
5596 MOZ_NO_INSPECTOR_APIS= )
5598 dnl ========================================================
5599 dnl Pref extensions (autoconfig and system-pref)
5600 dnl ========================================================
5601 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5602 [ --disable-pref-extensions
5603 Disable pref extensions such as autoconfig and
5605 MOZ_PREF_EXTENSIONS=,
5606 MOZ_PREF_EXTENSIONS=1 )
5608 dnl ========================================================
5609 dnl = Universalchardet
5610 dnl ========================================================
5611 MOZ_ARG_DISABLE_BOOL(universalchardet,
5612 [ --disable-universalchardet
5613 Disable universal encoding detection],
5614 MOZ_UNIVERSALCHARDET=,
5615 MOZ_UNIVERSALCHARDET=1 )
5617 dnl ========================================================
5619 dnl ========================================================
5620 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5621 [ --enable-javaxpcom
5622 Enable Java-XPCOM bridge],
5626 if test -n "${MOZ_JAVAXPCOM}"; then
5629 if test -n "$JAVA_HOME"; then
5630 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5634 if test -n "$JAVA_HOME"; then
5635 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5640 if test -n "${JAVA_INCLUDE_PATH}"; then
5641 dnl Make sure jni.h exists in the given include path.
5642 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5643 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5646 case "$target_os" in
5648 dnl Default to java system location
5649 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5653 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5656 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5657 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.])
5661 if test -n "${JAVA_BIN_PATH}"; then
5662 dnl Look for javac and jar in the specified path.
5663 JAVA_PATH="$JAVA_BIN_PATH"
5665 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5666 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5669 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5670 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5671 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5672 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5673 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.])
5677 dnl ========================================================
5678 dnl = Breakpad crash reporting (on by default on supported platforms)
5679 dnl ========================================================
5681 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5682 || test "$OS_ARCH" = "Darwin" \
5683 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
5684 || test "$OS_ARCH" = "SunOS") \
5685 && test -z "$HAVE_64BIT_OS"; then
5689 MOZ_ARG_DISABLE_BOOL(crashreporter,
5690 [ --disable-crashreporter Disable breakpad crash reporting],
5692 MOZ_CRASHREPORTER=1)
5694 if test -n "$MOZ_CRASHREPORTER"; then
5695 AC_DEFINE(MOZ_CRASHREPORTER)
5697 if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
5698 test -z "$SKIP_LIBRARY_CHECKS"; then
5699 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5700 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5701 AC_SUBST(MOZ_GTHREAD_LIBS)
5703 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.])])
5707 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5708 [ --with-crashreporter-enable-percent=NN Enable sending crash reports by default on NN% of users. (default=100)],
5709 [ val=`echo $withval | sed 's/[^0-9]//g'`
5710 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5712 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5713 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5715 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5717 dnl ========================================================
5718 dnl = Enable compilation of specific extension modules
5719 dnl ========================================================
5721 MOZ_ARG_ENABLE_STRING(extensions,
5722 [ --enable-extensions Enable extensions],
5723 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5724 if test "$option" = "yes" || test "$option" = "all"; then
5725 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5726 elif test "$option" = "no" || test "$option" = "none"; then
5728 elif test "$option" = "default"; then
5729 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5730 elif test `echo "$option" | grep -c \^-` != 0; then
5731 option=`echo $option | sed 's/^-//'`
5732 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5734 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5737 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5739 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5740 # Suppress warning on non-X11 platforms
5741 if test -n "$MOZ_X11"; then
5742 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5744 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5747 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5748 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5749 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5752 dnl This might be temporary: build tridentprofile only on Windows
5753 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5754 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5755 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5758 dnl cookie must be built before tridentprofile. put it at list's end.
5759 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5760 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5761 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5764 dnl xforms requires xtf and schema-validation
5765 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5766 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5767 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5769 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5770 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5771 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5774 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5775 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5776 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5779 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5780 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5781 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5784 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5785 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5786 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5789 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5790 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5791 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5794 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5795 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5796 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5799 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5800 AC_MSG_WARN([spellcheck is no longer an extension.])
5801 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5804 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5805 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5806 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5810 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5812 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5813 dnl when trying to build a non-existent extension.
5814 for extension in $MOZ_EXTENSIONS; do
5815 if test ! -d "${srcdir}/extensions/${extension}"; then
5816 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5821 dnl ========================================================
5823 dnl ========================================================
5824 case "$MOZ_WIDGET_TOOLKIT" in
5825 beos|windows|os2|mac|cocoa)
5828 if test -z "$MOZ_ENABLE_GTK2" && test -z "$MOZ_ENABLE_QT"; then
5829 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5834 MOZ_ARG_ENABLE_STRING(image-decoders,
5835 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5836 Enable specific image decoders],
5837 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5838 if test "$option" = "yes" || test "$option" = "all"; then
5839 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5840 elif test "$option" = "no" || test "$option" = "none"; then
5842 elif test "$option" = "default"; then
5843 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5844 elif test `echo "$option" | grep -c \^-` != 0; then
5845 option=`echo $option | sed 's/^-//'`
5846 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5848 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5851 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5853 dnl Dupes are removed in the encoder section because it will also add decoders
5855 dnl ========================================================
5857 dnl ========================================================
5858 MOZ_ARG_ENABLE_STRING(image-encoders,
5859 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5860 Enable specific image encoders],
5861 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5862 if test "$option" = "yes" || test "$option" = "all"; then
5863 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5864 elif test "$option" = "no" || test "$option" = "none"; then
5867 elif test "$option" = "default"; then
5868 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5869 elif test `echo "$option" | grep -c \^-` != 0; then
5870 option=`echo $option | sed 's/^-//'`
5871 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5873 addencoder="$option"
5875 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5877 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5880 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5881 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5883 dnl ========================================================
5884 dnl MathML on by default
5885 dnl ========================================================
5886 MOZ_ARG_DISABLE_BOOL(mathml,
5887 [ --disable-mathml Disable MathML support],
5890 if test "$MOZ_MATHML"; then
5891 AC_DEFINE(MOZ_MATHML)
5894 dnl ========================================================
5896 dnl ========================================================
5897 MOZ_ARG_DISABLE_BOOL(canvas,
5898 [ --disable-canvas Disable html:canvas feature],
5900 MOZ_ENABLE_CANVAS=1 )
5901 if test -n "$MOZ_ENABLE_CANVAS"; then
5902 AC_DEFINE(MOZ_ENABLE_CANVAS)
5904 AC_SUBST(MOZ_ENABLE_CANVAS)
5906 MOZ_ARG_ENABLE_BOOL(canvas3d,
5907 [ --enable-canvas3d Enable canvas 3D context],
5908 MOZ_ENABLE_CANVAS3D=1,
5909 MOZ_ENABLE_CANVAS3D= )
5910 if test -n "$MOZ_ENABLE_CANVAS3D"; then
5911 AC_DEFINE(MOZ_ENABLE_CANVAS3D)
5913 AC_SUBST(MOZ_ENABLE_CANVAS3D)
5915 dnl ========================================================
5917 dnl ========================================================
5918 MOZ_ARG_DISABLE_BOOL(svg,
5919 [ --disable-svg Disable SVG support],
5922 if test -n "$MOZ_SVG"; then
5926 dnl ========================================================
5928 dnl ========================================================
5930 MOZ_ARG_DISABLE_BOOL(smil,
5931 [ --disable-smil Disable SMIL animation support],
5934 # Automatically disable SMIL if SVG is disabled
5935 if test -z "$MOZ_SVG"; then
5938 if test -n "$MOZ_SMIL"; then
5942 dnl ========================================================
5943 dnl Build Freetype in the tree
5944 dnl ========================================================
5945 MOZ_ARG_ENABLE_BOOL(tree-freetype,
5946 [ --enable-tree-freetype Enable Tree FreeType],
5947 MOZ_TREE_FREETYPE=1,
5948 MOZ_TREE_FREETYPE= )
5949 if test -n "$MOZ_TREE_FREETYPE"; then
5950 AC_DEFINE(MOZ_TREE_FREETYPE)
5951 AC_SUBST(MOZ_TREE_FREETYPE)
5952 MOZ_ENABLE_CAIRO_FT=1
5953 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
5954 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5955 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5956 FT2_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5957 CAIRO_FT_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5958 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
5959 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
5960 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
5961 AC_SUBST(CAIRO_FT_CFLAGS)
5965 dnl ========================================================
5967 dnl ========================================================
5968 case "$target_os" in
5969 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5974 MOZ_ARG_DISABLE_BOOL(installer,
5975 [ --disable-installer Disable building of installer],
5978 if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
5979 # Disable installer for Windows builds that use the new toolkit if NSIS
5980 # isn't in the path.
5981 MOZ_PATH_PROGS(MAKENSIS, makensis)
5982 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5983 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5985 # The Windows build for NSIS requires the iconv command line utility to
5986 # convert the charset of the locale files.
5987 MOZ_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5988 if test -z "$HOST_ICONV"; then
5989 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5993 # Automatically disable installer if xpinstall isn't built
5994 if test -z "$MOZ_XPINSTALL"; then
5997 AC_SUBST(MOZ_INSTALLER)
5999 AC_MSG_CHECKING([for tar archiver])
6000 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6001 if test -z "$TAR"; then
6002 AC_MSG_ERROR([no tar archiver found in \$PATH])
6004 AC_MSG_RESULT([$TAR])
6007 AC_MSG_CHECKING([for wget])
6008 AC_CHECK_PROGS(WGET, wget, "")
6009 AC_MSG_RESULT([$WGET])
6012 dnl ========================================================
6014 dnl ========================================================
6016 MOZ_ARG_DISABLE_BOOL(updater,
6017 [ --disable-updater Disable building of updater],
6020 AC_SUBST(MOZ_UPDATER)
6022 # app update channel is 'default' when not supplied.
6023 MOZ_ARG_ENABLE_STRING([update-channel],
6024 [ --enable-update-channel=CHANNEL
6025 Select application update channel (default=default)],
6026 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6028 if test -z "$MOZ_UPDATE_CHANNEL"; then
6029 MOZ_UPDATE_CHANNEL=default
6031 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6033 # tools/update-packaging is not checked out by default.
6034 MOZ_ARG_ENABLE_BOOL(update-packaging,
6035 [ --enable-update-packaging
6036 Enable tools/update-packaging],
6037 MOZ_UPDATE_PACKAGING=1,
6038 MOZ_UPDATE_PACKAGING= )
6039 AC_SUBST(MOZ_UPDATE_PACKAGING)
6041 dnl ========================================================
6043 dnl ========================================================
6045 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
6046 [ --disable-xpconnect-idispatch
6047 Disable building of xpconnect support for IDispatch
6049 XPC_IDISPATCH_SUPPORT=,
6050 XPC_IDISPATCH_SUPPORT=1)
6051 AC_SUBST(XPC_IDISPATCH_SUPPORT)
6053 MOZ_ARG_DISABLE_BOOL(activex,
6054 [ --disable-activex Disable building of ActiveX control (win32 only)],
6055 MOZ_NO_ACTIVEX_SUPPORT=1,
6056 MOZ_NO_ACTIVEX_SUPPORT= )
6057 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
6059 MOZ_ARG_ENABLE_BOOL(activex-scripting,
6060 [ --enable-activex-scripting
6061 Enable building of ActiveX scripting support (win32)],
6062 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1,
6063 MOZ_ACTIVEX_SCRIPTING_SUPPORT=)
6064 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
6066 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
6068 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
6071 if test "$COMPILE_ENVIRONMENT" = "1"; then
6072 if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
6074 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
6075 if test "$ac_cv_header_atlbase_h" = "no"; then
6076 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.])
6083 dnl ========================================================
6085 dnl ========================================================
6086 MOZ_ARG_ENABLE_BOOL(leaky,
6087 [ --enable-leaky Build leaky memory tool],
6092 dnl ========================================================
6094 dnl ========================================================
6095 MOZ_ARG_ENABLE_BOOL(xpctools,
6096 [ --enable-xpctools Build JS profiling tool],
6101 dnl ========================================================
6102 dnl build the tests by default
6103 dnl ========================================================
6104 MOZ_ARG_DISABLE_BOOL(tests,
6105 [ --disable-tests Do not build test libraries & programs],
6109 dnl ========================================================
6110 dnl parental controls (for Windows Vista)
6111 dnl ========================================================
6112 MOZ_ARG_DISABLE_BOOL(parental-controls,
6113 [ --disable-parental-controls
6114 Do not build parental controls],
6115 MOZ_DISABLE_PARENTAL_CONTROLS=1,
6116 MOZ_DISABLE_PARENTAL_CONTROLS=)
6117 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6118 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6121 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6123 dnl ========================================================
6125 dnl = Module specific options
6127 dnl ========================================================
6128 MOZ_ARG_HEADER(Individual module options)
6130 dnl ========================================================
6131 dnl = Enable Lea malloc in xpcom. OFF by default.
6132 dnl ========================================================
6133 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
6134 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
6137 if test -n "$XPCOM_USE_LEA"; then
6138 AC_DEFINE(XPCOM_USE_LEA)
6141 dnl ========================================================
6142 dnl = Enable places (new history/bookmarks)
6143 dnl ========================================================
6144 MOZ_ARG_ENABLE_BOOL(places,
6145 [ --enable-places Enable 'places' bookmark/history implementation],
6148 if test -n "$MOZ_PLACES"; then
6149 AC_DEFINE(MOZ_PLACES)
6150 if test -z "$MOZ_MAIL_NEWS"; then
6155 if test "$MOZ_BUILD_APP" = "browser"; then
6156 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
6160 dnl ========================================================
6161 dnl = Disable feed handling components
6162 dnl ========================================================
6163 MOZ_ARG_DISABLE_BOOL(feeds,
6164 [ --disable-feeds Disable feed handling and processing components],
6167 if test -n "$MOZ_FEEDS"; then
6168 AC_DEFINE(MOZ_FEEDS)
6170 if test "$MOZ_BUILD_APP" = "browser"; then
6171 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6175 dnl ========================================================
6176 dnl = Enable mozStorage
6177 dnl ========================================================
6178 dnl Implicitly enabled by default if building calendar or places
6179 MOZ_ARG_ENABLE_BOOL(storage,
6180 [ --enable-storage Enable mozStorage module and related components],
6183 if test -n "$MOZ_STORAGE"; then
6184 AC_DEFINE(MOZ_STORAGE)
6187 dnl ========================================================
6188 dnl Check for sqlite
6189 dnl ========================================================
6192 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6193 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6194 MOZ_NATIVE_SQLITE=1,
6195 MOZ_NATIVE_SQLITE= )
6197 if test -z "$MOZ_NATIVE_SQLITE"
6200 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
6202 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6205 AC_SUBST(MOZ_NATIVE_SQLITE)
6207 dnl ========================================================
6208 dnl = Enable help viewer (off by default)
6209 dnl ========================================================
6210 MOZ_ARG_ENABLE_BOOL(help-viewer,
6211 [ --enable-help-viewer Enable help viewer],
6214 if test -n "$MOZ_HELP_VIEWER"; then
6215 AC_DEFINE(MOZ_HELP_VIEWER)
6217 AC_SUBST(MOZ_HELP_VIEWER)
6218 if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
6219 AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
6222 dnl ========================================================
6223 dnl = Enable safe browsing (anti-phishing)
6224 dnl ========================================================
6225 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6226 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6227 MOZ_SAFE_BROWSING=1,
6228 MOZ_SAFE_BROWSING= )
6229 if test -n "$MOZ_SAFE_BROWSING"; then
6230 AC_DEFINE(MOZ_SAFE_BROWSING)
6232 AC_SUBST(MOZ_SAFE_BROWSING)
6234 dnl ========================================================
6235 dnl = Enable url-classifier
6236 dnl ========================================================
6237 dnl Implicitly enabled by default if building with safe-browsing
6238 if test -n "$MOZ_SAFE_BROWSING"; then
6239 MOZ_URL_CLASSIFIER=1
6241 MOZ_ARG_ENABLE_BOOL(url-classifier,
6242 [ --enable-url-classifier Enable url classifier module],
6243 MOZ_URL_CLASSIFIER=1,
6244 MOZ_URL_CLASSIFIER= )
6245 if test -n "$MOZ_URL_CLASSIFIER"; then
6246 AC_DEFINE(MOZ_URL_CLASSIFIER)
6248 AC_SUBST(MOZ_URL_CLASSIFIER)
6250 dnl ========================================================
6251 dnl = Disable zipwriter
6252 dnl ========================================================
6253 MOZ_ARG_DISABLE_BOOL(zipwriter,
6254 [ --disable-zipwriter Disable zipwriter component],
6257 AC_SUBST(MOZ_ZIPWRITER)
6259 dnl ========================================================
6260 dnl = Hildon and OSSO checks
6261 dnl ========================================================
6262 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime,
6263 MOZ_PLATFORM_HILDON=1,
6264 MOZ_PLATFORM_HILDON=)
6265 if test $MOZ_PLATFORM_HILDON; then
6266 AC_DEFINE(MOZ_PLATFORM_HILDON)
6267 X11_COMPOSITED_PLUGINS="yes"
6269 AC_SUBST(LIBHILDONMIME_CFLAGS)
6270 AC_SUBST(LIBHILDONMIME_LIBS)
6272 if test "$X11_COMPOSITED_PLUGINS" = "yes"; then
6273 dnl if we have Xcomposite we should also have Xdamage and Xfixes
6274 AC_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6275 [AC_MSG_ERROR([Couldn't find X11/extentsions/Xdamage.h which is required for composited plugins.])])
6276 AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6277 [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6279 AC_SUBST(XCOMPOSITE_LIBS)
6281 PKG_CHECK_MODULES(LIBOSSO,libosso,
6285 if test $NS_OSSO; then
6286 if test -z "$MOZ_ENABLE_DBUS"; then
6287 AC_MSG_ERROR([DBus is required when building for OSSO])
6290 MOZ_GFX_OPTIMIZE_MOBILE=1
6292 AC_SUBST(LIBOSSO_CFLAGS)
6293 AC_SUBST(LIBOSSO_LIBS)
6295 PKG_CHECK_MODULES(MOZ_LOCATION, [liblocation gpsbt],
6296 NS_MAEMO_LOCATION=1,
6299 if test $NS_MAEMO_LOCATION; then
6300 AC_DEFINE(NS_MAEMO_LOCATION)
6303 AC_SUBST(MOZ_LOCATION_CFLAGS)
6304 AC_SUBST(MOZ_LOCATION_LIBS)
6306 dnl ========================================================
6307 dnl = faststripe theme
6308 dnl ========================================================
6309 MOZ_ARG_ENABLE_BOOL(faststripe,
6310 [ --enable-faststripe Use faststripe theme],
6311 MOZ_THEME_FASTSTRIPE=1,
6312 MOZ_THEME_FASTSTRIPE= )
6313 AC_SUBST(MOZ_THEME_FASTSTRIPE)
6315 dnl ========================================================
6317 dnl = Feature options that require extra sources to be pulled
6319 dnl ========================================================
6320 dnl MOZ_ARG_HEADER(Features that require extra sources)
6322 dnl ========================================================
6324 dnl = Debugging Options
6326 dnl ========================================================
6327 MOZ_ARG_HEADER(Debugging and Optimizations)
6329 dnl ========================================================
6330 dnl = Disable building with debug info.
6331 dnl = Debugging is OFF by default
6332 dnl ========================================================
6333 if test -z "$MOZ_DEBUG_FLAGS"
6337 if test "$GNU_CC"; then
6338 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
6339 case "$GCC_VERSION" in
6344 MOZ_DEBUG_FLAGS="-g"
6348 MOZ_DEBUG_FLAGS="-g"
6352 MOZ_DEBUG_FLAGS="-g"
6357 MOZ_ARG_ENABLE_STRING(debug,
6358 [ --enable-debug[=DBG] Enable building with developer debug info
6359 (Using compiler flags DBG)],
6360 [ if test "$enableval" != "no"; then
6362 if test -n "$enableval" && test "$enableval" != "yes"; then
6363 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6370 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
6371 case "${target_os}" in
6373 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
6375 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6376 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
6379 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
6382 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
6384 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6386 if test -n "$MOZ_DEBUG"; then
6387 AC_MSG_CHECKING([for valid debug flags])
6388 _SAVE_CFLAGS=$CFLAGS
6389 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6390 AC_TRY_COMPILE([#include <stdio.h>],
6391 [printf("Hello World\n");],
6394 AC_MSG_RESULT([$_results])
6395 if test "$_results" = "no"; then
6396 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6398 CFLAGS=$_SAVE_CFLAGS
6401 dnl ========================================================
6402 dnl enable mobile optimizations
6403 dnl ========================================================
6404 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6405 [ --enable-mobile-optimize Enable mobile optimizations],
6406 MOZ_GFX_OPTIMIZE_MOBILE=1)
6408 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6410 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6411 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6414 dnl ========================================================
6415 dnl = Enable code optimization. ON by default.
6416 dnl ========================================================
6417 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6418 MOZ_OPTIMIZE_FLAGS="-O"
6421 MOZ_ARG_ENABLE_STRING(optimize,
6422 [ --disable-optimize Disable compiler optimization
6423 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6424 [ if test "$enableval" != "no"; then
6426 if test -n "$enableval" && test "$enableval" != "yes"; then
6427 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6432 fi ], MOZ_OPTIMIZE=1)
6434 if test "$COMPILE_ENVIRONMENT"; then
6435 if test -n "$MOZ_OPTIMIZE"; then
6436 AC_MSG_CHECKING([for valid optimization flags])
6437 _SAVE_CFLAGS=$CFLAGS
6438 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6439 AC_TRY_COMPILE([#include <stdio.h>],
6440 [printf("Hello World\n");],
6443 AC_MSG_RESULT([$_results])
6444 if test "$_results" = "no"; then
6445 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6447 CFLAGS=$_SAVE_CFLAGS
6449 fi # COMPILE_ENVIRONMENT
6451 AC_SUBST(MOZ_OPTIMIZE)
6452 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6453 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6454 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6456 dnl ========================================================
6457 dnl = Enable/disable debug for specific modules only
6458 dnl = module names beginning with ^ will be disabled
6459 dnl ========================================================
6460 MOZ_ARG_ENABLE_STRING(debug-modules,
6461 [ --enable-debug-modules Enable/disable debug info for specific modules],
6462 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6464 dnl ========================================================
6465 dnl = Enable/disable generation of debugger info for specific modules only
6466 dnl = the special module name ALL_MODULES can be used to denote all modules
6467 dnl = module names beginning with ^ will be disabled
6468 dnl ========================================================
6469 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6470 [ --enable-debugger-info-modules
6471 Enable/disable debugger info for specific modules],
6472 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6473 dnl note that the list of module names is reversed as it is copied
6474 dnl this is important, as it will allow config.mk to interpret stuff like
6475 dnl "^ALL_MODULES xpcom" properly
6476 if test "$i" = "no"; then
6479 if test "$i" = "yes"; then
6482 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6485 dnl ========================================================
6486 dnl Enable garbage collector
6487 dnl ========================================================
6488 MOZ_ARG_ENABLE_BOOL(boehm,
6489 [ --enable-boehm Enable the Boehm Garbage Collector],
6492 if test -n "$GC_LEAK_DETECTOR"; then
6493 AC_DEFINE(GC_LEAK_DETECTOR)
6496 dnl ========================================================
6497 dnl Disable runtime logging checks
6498 dnl ========================================================
6499 MOZ_ARG_DISABLE_BOOL(logging,
6500 [ --disable-logging Disable logging facilities],
6501 NS_DISABLE_LOGGING=1,
6502 NS_DISABLE_LOGGING= )
6503 if test "$NS_DISABLE_LOGGING"; then
6504 AC_DEFINE(NS_DISABLE_LOGGING)
6506 AC_DEFINE(MOZ_LOGGING)
6509 dnl ========================================================
6510 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6511 dnl ========================================================
6512 _ENABLE_LOGREFCNT=42
6513 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6514 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6515 _ENABLE_LOGREFCNT=1,
6516 _ENABLE_LOGREFCNT= )
6517 if test "$_ENABLE_LOGREFCNT" = "1"; then
6518 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6519 elif test -z "$_ENABLE_LOGREFCNT"; then
6520 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6523 dnl ========================================================
6524 dnl = Enable trace malloc
6525 dnl ========================================================
6526 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6527 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6528 [ --enable-trace-malloc Enable malloc tracing],
6531 if test "$NS_TRACE_MALLOC"; then
6532 # Please, Mr. Linker Man, don't take away our symbol names
6533 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6535 AC_DEFINE(NS_TRACE_MALLOC)
6537 AC_SUBST(NS_TRACE_MALLOC)
6539 dnl ========================================================
6540 dnl = Enable jemalloc
6541 dnl ========================================================
6542 MOZ_ARG_ENABLE_BOOL(jemalloc,
6543 [ --enable-jemalloc Replace memory allocator with jemalloc],
6547 if test "$NS_TRACE_MALLOC"; then
6551 if test "$MOZ_MEMORY"; then
6553 dnl Don't try to run compiler tests on Windows
6554 if test "$OS_ARCH" = "WINNT"; then
6555 if test -z "$HAVE_64BIT_OS"; then
6556 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6558 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6561 AC_CHECK_SIZEOF([int *], [4])
6562 case "${ac_cv_sizeof_int_p}" in
6564 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6567 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6570 AC_MSG_ERROR([Unexpected pointer size])
6575 AC_DEFINE(MOZ_MEMORY)
6576 if test "x$MOZ_DEBUG" = "x1"; then
6577 AC_DEFINE(MOZ_MEMORY_DEBUG)
6579 dnl The generic feature tests that determine how to compute ncpus are long and
6580 dnl complicated. Therefore, simply define special cpp variables for the
6581 dnl platforms we have special knowledge of.
6582 case "${target_os}" in
6584 AC_DEFINE(MOZ_MEMORY_DARWIN)
6587 AC_DEFINE(MOZ_MEMORY_BSD)
6590 AC_DEFINE(MOZ_MEMORY_LINUX)
6593 AC_DEFINE(MOZ_MEMORY_BSD)
6596 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6598 msvc*|mks*|cygwin*|mingw*)
6599 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6600 dnl This is sort of awful. Will revisit if we add support for more versions
6601 if test "$CC_VERSION" != "14.00.50727.762"; then
6602 AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 currently.])
6604 if test -z "$WIN32_CRT_SRC_DIR"; then
6605 if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6606 AC_MSG_ERROR([When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you).])
6608 WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6612 if test ! -d "$WIN32_CRT_SRC_DIR"; then
6613 AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
6615 WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
6616 _objdir_win=`pwd -W`
6617 WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/intel"
6618 dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6619 AC_DEFINE(_STATIC_CPPLIB)
6620 MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -DEFAULTLIB:mozcrt19"
6621 dnl Also pass this to NSPR/NSS
6622 DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
6626 AC_DEFINE(MOZ_MEMORY_WINCE)
6627 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6628 if test -z "$WINCE_WINDOWS_MOBILE"; then
6629 AC_DEFINE(MOZ_MEMORY_WINCE6)
6633 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6637 AC_SUBST(MOZ_MEMORY)
6638 AC_SUBST(MOZ_MEMORY_LDFLAGS)
6639 AC_SUBST(WIN32_CRT_SRC_DIR)
6640 dnl Need to set this for make because NSS doesn't have configure
6643 dnl ========================================================
6644 dnl = Use malloc wrapper lib
6645 dnl ========================================================
6646 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6647 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6651 if test -n "$_WRAP_MALLOC"; then
6652 if test "$GNU_CC"; then
6653 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"
6654 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6658 dnl ========================================================
6659 dnl = Location of malloc wrapper lib
6660 dnl ========================================================
6661 MOZ_ARG_WITH_STRING(wrap-malloc,
6662 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6663 WRAP_MALLOC_LIB=$withval)
6665 dnl ========================================================
6667 dnl ========================================================
6668 MOZ_ARG_ENABLE_BOOL(tracevis,
6669 [ --enable-tracevis Enable TraceVis tracing tool (default=no)],
6672 if test -n "$MOZ_TRACEVIS"; then
6673 AC_DEFINE(MOZ_TRACEVIS)
6676 dnl ========================================================
6678 dnl ========================================================
6679 MOZ_ARG_ENABLE_BOOL(valgrind,
6680 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
6683 if test -n "$MOZ_VALGRIND"; then
6684 AC_CHECK_HEADER([valgrind/valgrind.h], [],
6686 [--enable-valgrind specified but Valgrind is not installed]))
6687 AC_DEFINE(MOZ_VALGRIND)
6690 dnl ========================================================
6691 dnl = Use Electric Fence
6692 dnl ========================================================
6693 MOZ_ARG_ENABLE_BOOL(efence,
6694 [ --enable-efence Link with Electric Fence],
6697 if test -n "$_ENABLE_EFENCE"; then
6698 AC_CHECK_LIB(efence,malloc)
6701 dnl ========================================================
6703 dnl ========================================================
6704 MOZ_ARG_ENABLE_BOOL(jprof,
6705 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6708 if test -n "$MOZ_JPROF"; then
6709 AC_DEFINE(MOZ_JPROF)
6712 dnl ========================================================
6714 dnl ========================================================
6715 MOZ_ARG_ENABLE_BOOL(shark,
6716 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6719 if test -n "$MOZ_SHARK"; then
6720 AC_DEFINE(MOZ_SHARK)
6723 dnl ========================================================
6725 dnl ========================================================
6726 MOZ_ARG_ENABLE_BOOL(callgrind,
6727 [ --enable-callgrind Enable callgrind profiling],
6730 if test -n "$MOZ_CALLGRIND"; then
6731 AC_DEFINE(MOZ_CALLGRIND)
6734 dnl ========================================================
6736 dnl ========================================================
6737 MOZ_ARG_ENABLE_BOOL(vtune,
6738 [ --enable-vtune Enable vtune profiling],
6741 if test -n "$MOZ_VTUNE"; then
6742 AC_DEFINE(MOZ_VTUNE)
6745 dnl ========================================================
6746 dnl Zealous JavaScript GC
6747 dnl ========================================================
6748 MOZ_ARG_ENABLE_BOOL(gczeal,
6749 [ --enable-gczeal Enable zealous JavaScript GCing],
6752 if test -n "$JS_GC_ZEAL"; then
6753 AC_DEFINE(JS_GC_ZEAL)
6756 dnl ========================================================
6757 dnl = Enable static checking using gcc-dehydra
6758 dnl ========================================================
6760 MOZ_ARG_WITH_STRING(static-checking,
6761 [ --with-static-checking=path/to/gcc_dehydra.so
6762 Enable static checking of code using GCC-dehydra],
6763 DEHYDRA_PATH=$withval,
6766 if test -n "$DEHYDRA_PATH"; then
6767 if test ! -f "$DEHYDRA_PATH"; then
6768 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
6770 AC_DEFINE(NS_STATIC_CHECKING)
6772 AC_SUBST(DEHYDRA_PATH)
6774 dnl ========================================================
6775 dnl = Enable stripping of libs & executables
6776 dnl ========================================================
6777 MOZ_ARG_ENABLE_BOOL(strip,
6778 [ --enable-strip Enable stripping of libs & executables ],
6782 dnl ========================================================
6783 dnl = Enable stripping of libs & executables when packaging
6784 dnl ========================================================
6785 MOZ_ARG_ENABLE_BOOL(install-strip,
6786 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6790 dnl ========================================================
6791 dnl = --enable-elf-dynstr-gc
6792 dnl ========================================================
6793 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6794 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6795 USE_ELF_DYNSTR_GC=1,
6796 USE_ELF_DYNSTR_GC= )
6798 dnl ========================================================
6799 dnl = --enable-old-abi-compat-wrappers
6800 dnl ========================================================
6801 dnl on x86 linux, the current builds of some popular plugins (notably
6802 dnl flashplayer and real) expect a few builtin symbols from libgcc
6803 dnl which were available in some older versions of gcc. However,
6804 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6805 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6806 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6807 dnl to true on x86 linux, and false everywhere else.
6810 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6811 [ --enable-old-abi-compat-wrappers
6812 Support old GCC ABI symbols to ease the pain
6813 of the linux compiler change],
6814 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6815 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6816 if test "$COMPILE_ENVIRONMENT"; then
6817 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6820 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6822 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6824 fi # COMPILE_ENVIRONMENT
6826 dnl ========================================================
6828 dnl = Profiling and Instrumenting
6830 dnl ========================================================
6831 MOZ_ARG_HEADER(Profiling and Instrumenting)
6833 dnl ========================================================
6834 dnl = Enable timeline service, which provides lightweight
6835 dnl = instrumentation of mozilla for performance measurement.
6836 dnl = Timeline is off by default.
6837 dnl ========================================================
6838 MOZ_ARG_ENABLE_BOOL(timeline,
6839 [ --enable-timeline Enable timeline services ],
6842 if test -n "$MOZ_TIMELINE"; then
6843 AC_DEFINE(MOZ_TIMELINE)
6846 dnl ========================================================
6847 dnl Turn on reflow counting
6848 dnl ========================================================
6849 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6850 [ --enable-reflow-perf Enable reflow performance tracing],
6853 if test -n "$MOZ_REFLOW_PERF"; then
6854 AC_DEFINE(MOZ_REFLOW_PERF)
6857 dnl ========================================================
6858 dnl Enable performance metrics.
6859 dnl ========================================================
6860 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6861 [ --enable-perf-metrics Enable performance metrics],
6864 if test -n "$MOZ_PERF_METRICS"; then
6865 AC_DEFINE(MOZ_PERF_METRICS)
6868 dnl ========================================================
6869 dnl Enable code size metrics.
6870 dnl ========================================================
6871 MOZ_ARG_ENABLE_BOOL(codesighs,
6872 [ --enable-codesighs Enable code size analysis tools],
6873 _ENABLE_CODESIGHS=1,
6874 _ENABLE_CODESIGHS= )
6875 if test -n "$_ENABLE_CODESIGHS"; then
6876 if test -d $srcdir/tools/codesighs; then
6879 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6883 dnl ========================================================
6884 dnl = Add support for Eazel profiler
6885 dnl ========================================================
6886 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6887 [ --enable-eazel-profiler-support
6888 Enable Corel/Eazel profiler support],
6889 ENABLE_EAZEL_PROFILER=1,
6890 ENABLE_EAZEL_PROFILER= )
6891 if test -n "$ENABLE_EAZEL_PROFILER"; then
6892 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6894 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6895 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6896 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6899 MOZ_ARG_ENABLE_STRING(profile-modules,
6900 [ --enable-profile-modules
6901 Enable/disable profiling for specific modules],
6902 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6904 MOZ_ARG_ENABLE_BOOL(insure,
6905 [ --enable-insure Enable insure++ instrumentation (linux only)],
6908 if test -n "$_ENABLE_INSURE"; then
6912 MOZ_INSURE_EXCLUDE_DIRS="config"
6915 MOZ_ARG_WITH_STRING(insure-dirs,
6916 [ --with-insure-dirs=DIRS
6917 Dirs to instrument with insure ],
6918 MOZ_INSURE_DIRS=$withval )
6920 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6921 [ --with-insure-exclude-dirs=DIRS
6922 Dirs to not instrument with insure ],
6923 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6925 dnl ========================================================
6926 dnl = Support for Quantify (Windows)
6927 dnl ========================================================
6928 MOZ_ARG_ENABLE_BOOL(quantify,
6929 [ --enable-quantify Enable Quantify support (Windows only) ],
6933 dnl ========================================================
6934 dnl = Support for demangling undefined symbols
6935 dnl ========================================================
6936 if test -z "$SKIP_LIBRARY_CHECKS"; then
6939 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6943 # Demangle only for debug or trace-malloc builds
6944 MOZ_DEMANGLE_SYMBOLS=
6945 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6946 MOZ_DEMANGLE_SYMBOLS=1
6947 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6949 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6951 dnl ========================================================
6952 dnl = Support for gcc stack unwinding (from gcc 3.3)
6953 dnl ========================================================
6954 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6955 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6958 dnl ========================================================
6962 dnl ========================================================
6963 MOZ_ARG_HEADER(Misc. Options)
6965 dnl ========================================================
6966 dnl update xterm title
6967 dnl ========================================================
6968 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6969 [ --enable-xterm-updates Update XTERM titles with current command.],
6973 dnl =========================================================
6975 dnl =========================================================
6976 MOZ_ARG_ENABLE_STRING([chrome-format],
6977 [ --enable-chrome-format=jar|flat|both|symlink
6978 Select FORMAT of chrome files (default=jar)],
6979 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6981 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6982 MOZ_CHROME_FILE_FORMAT=jar
6985 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6986 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6987 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6988 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6989 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6992 dnl ========================================================
6993 dnl = Define default location for MOZILLA_FIVE_HOME
6994 dnl ========================================================
6995 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6996 [ --with-default-mozilla-five-home
6997 Set the default value for MOZILLA_FIVE_HOME],
6998 [ val=`echo $withval`
6999 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7001 dnl ========================================================
7002 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7003 dnl ========================================================
7004 MOZ_ARG_WITH_STRING(user-appdir,
7005 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7006 [ val=`echo $withval`
7007 if echo "$val" | grep "\/" >/dev/null; then
7008 AC_MSG_ERROR("Homedir must be single relative path.")
7013 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7015 dnl ========================================================
7016 dnl = Doxygen configuration
7017 dnl ========================================================
7018 dnl Use commas to specify multiple dirs to this arg
7019 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7020 MOZ_ARG_WITH_STRING(doc-input-dirs,
7021 [ --with-doc-input-dirs=DIRS
7022 Header/idl dirs to create docs from],
7023 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7024 AC_SUBST(MOZ_DOC_INPUT_DIRS)
7026 dnl Use commas to specify multiple dirs to this arg
7027 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7028 MOZ_ARG_WITH_STRING(doc-include-dirs,
7029 [ --with-doc-include-dirs=DIRS
7030 Include dirs to preprocess doc headers],
7031 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7032 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7034 MOZ_DOC_OUTPUT_DIR='./dist/docs'
7035 MOZ_ARG_WITH_STRING(doc-output-dir,
7036 [ --with-doc-output-dir=DIR
7037 Dir to generate docs into],
7038 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
7039 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7041 if test -z "$SKIP_COMPILER_CHECKS"; then
7042 dnl ========================================================
7044 dnl = Compiler Options
7046 dnl ========================================================
7047 MOZ_ARG_HEADER(Compiler Options)
7049 dnl ========================================================
7050 dnl Check for gcc -pipe support
7051 dnl ========================================================
7052 AC_MSG_CHECKING([for gcc -pipe support])
7053 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
7054 echo '#include <stdio.h>' > dummy-hello.c
7055 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7056 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7057 cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
7058 if test $? = 0; then
7063 if test "$_res_as_stdin" = "yes"; then
7064 _SAVE_CFLAGS=$CFLAGS
7065 CFLAGS="$CFLAGS -pipe"
7066 AC_TRY_COMPILE( [ #include <stdio.h> ],
7067 [printf("Hello World\n");],
7068 [_res_gcc_pipe="yes"],
7069 [_res_gcc_pipe="no"] )
7070 CFLAGS=$_SAVE_CFLAGS
7072 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
7074 CFLAGS="$CFLAGS -pipe"
7075 CXXFLAGS="$CXXFLAGS -pipe"
7079 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7080 AC_MSG_RESULT([$_res])
7085 dnl pass -Wno-long-long to the compiler
7086 MOZ_ARG_ENABLE_BOOL(long-long-warning,
7087 [ --enable-long-long-warning
7088 Warn about use of non-ANSI long long type],
7089 _IGNORE_LONG_LONG_WARNINGS=,
7090 _IGNORE_LONG_LONG_WARNINGS=1)
7092 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
7093 _SAVE_CFLAGS="$CFLAGS"
7094 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
7095 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
7096 AC_TRY_COMPILE([], [return(0);],
7097 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7098 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7099 result="yes" ], result="no")
7100 AC_MSG_RESULT([$result])
7101 CFLAGS="$_SAVE_CFLAGS"
7104 dnl ========================================================
7105 dnl Profile guided optimization
7106 dnl ========================================================
7107 dnl Test for profiling options
7108 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
7109 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7111 dnl Provide a switch to disable PGO even when called via profiledbuild.
7112 MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
7113 [ --disable-profile-guided-optimization
7114 Don't build with PGO even if called via make profiledbuild],
7115 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
7116 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
7118 AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
7120 _SAVE_CFLAGS="$CFLAGS"
7121 CFLAGS="$CFLAGS -fprofile-generate"
7123 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7124 AC_TRY_COMPILE([], [return 0;],
7125 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7126 result="yes" ], result="no")
7127 AC_MSG_RESULT([$result])
7129 if test $result = "yes"; then
7130 PROFILE_GEN_LDFLAGS="-fprofile-generate"
7131 PROFILE_USE_CFLAGS="-fprofile-use"
7132 PROFILE_USE_LDFLAGS="-fprofile-use"
7134 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
7135 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
7136 AC_TRY_COMPILE([], [return 0;],
7137 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
7138 result="yes" ], result="no")
7139 AC_MSG_RESULT([$result])
7140 if test $result = "yes"; then
7141 PROFILE_USE_CFLAGS="-fbranch-probabilities"
7143 # don't really care, this is an old GCC
7144 PROFILE_GEN_LDFLAGS=
7145 PROFILE_USE_LDFLAGS=
7148 CFLAGS="$_SAVE_CFLAGS"
7150 if test -n "$INTEL_CC"; then
7151 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7152 PROFILE_GEN_LDFLAGS=
7153 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7154 PROFILE_USE_LDFLAGS=
7157 dnl Sun Studio on Solaris
7158 if test "$SOLARIS_SUNPRO_CC"; then
7159 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7160 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7161 if test "$CPU_ARCH" != "sparc"; then
7162 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7163 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7165 PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7166 PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7170 AC_SUBST(PROFILE_GEN_CFLAGS)
7171 AC_SUBST(PROFILE_GEN_LDFLAGS)
7172 AC_SUBST(PROFILE_USE_CFLAGS)
7173 AC_SUBST(PROFILE_USE_LDFLAGS)
7177 dnl ========================================================
7178 dnl Test for -pedantic bustage
7179 dnl ========================================================
7180 MOZ_ARG_DISABLE_BOOL(pedantic,
7181 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7183 if test "$_PEDANTIC"; then
7184 _SAVE_CXXFLAGS=$CXXFLAGS
7185 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7186 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7187 AC_TRY_COMPILE([$configure_static_assert_macros],
7188 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7189 result="no", result="yes" )
7190 AC_MSG_RESULT([$result])
7191 CXXFLAGS="$_SAVE_CXXFLAGS"
7195 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
7196 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7199 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7204 dnl ========================================================
7205 dnl Test for correct temporary object destruction order
7206 dnl ========================================================
7207 dnl We want to make sure the compiler follows the C++ spec here as
7208 dnl xpcom and the string classes depend on it (bug 235381).
7209 AC_MSG_CHECKING([for correct temporary object destruction order])
7210 AC_TRY_RUN([ class A {
7211 public: A(int& x) : mValue(x) {}
7213 operator char**() { return 0; }
7214 private: int& mValue;
7216 void func(char **arg) {}
7227 result="yes", result="no", result="maybe")
7228 AC_MSG_RESULT([$result])
7230 if test "$result" = "no"; then
7231 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
7234 dnl ========================================================
7235 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7236 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7237 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7238 dnl ========================================================
7239 _SAVE_CXXFLAGS=$CXXFLAGS
7240 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7241 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7242 ac_nscap_nonconst_opeq_bug,
7251 template <class T, class U>
7252 int operator==(const Pointer<T>& rhs, U* lhs)
7254 return rhs.myPtr == lhs;
7257 template <class T, class U>
7258 int operator==(const Pointer<T>& rhs, const U* lhs)
7260 return rhs.myPtr == lhs;
7268 ac_nscap_nonconst_opeq_bug="no",
7269 ac_nscap_nonconst_opeq_bug="yes")])
7270 CXXFLAGS="$_SAVE_CXXFLAGS"
7272 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7273 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7275 fi # SKIP_COMPILER_CHECKS
7277 dnl ========================================================
7279 dnl Should be smarter and check that the compiler does indeed have rtti
7280 dnl ========================================================
7281 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
7282 [ --enable-cpp-rtti Enable C++ RTTI ],
7283 [ _MOZ_USE_RTTI=1 ],
7286 if test "$_MOZ_USE_RTTI"; then
7287 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
7289 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
7292 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
7294 dnl ========================================================
7295 dnl C++ exceptions (g++/egcs only - for now)
7296 dnl Should be smarter and check that the compiler does indeed have exceptions
7297 dnl ========================================================
7298 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
7299 [ --enable-cpp-exceptions Enable C++ exceptions ],
7300 [ _MOZ_CPP_EXCEPTIONS=1 ],
7301 [ _MOZ_CPP_EXCEPTIONS= ])
7303 if test "$_MOZ_CPP_EXCEPTIONS"; then
7304 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
7306 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
7309 AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
7311 # Irix & OSF native compilers do not like exception declarations
7312 # when exceptions are disabled
7313 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
7314 AC_DEFINE(CPP_THROW_NEW, [])
7316 AC_DEFINE(CPP_THROW_NEW, [throw()])
7320 dnl ========================================================
7322 dnl = Build depencency options
7324 dnl ========================================================
7325 MOZ_ARG_HEADER(Build dependencies)
7327 dnl ========================================================
7328 dnl = Do not auto generate dependency info
7329 dnl ========================================================
7331 MOZ_ARG_DISABLE_BOOL(auto-deps,
7332 [ --disable-auto-deps Do not automatically generate dependency info],
7336 if test -n "$MOZ_AUTO_DEPS"; then
7337 dnl ========================================================
7338 dnl = Use mkdepend instead of $CC -MD for dependency generation
7339 dnl ========================================================
7341 MOZ_ARG_DISABLE_BOOL(md,
7342 [ --disable-md Do not use compiler-based dependencies ],
7345 [dnl Default is to turn on -MD if using GNU-compatible compilers
7346 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
7349 dnl Default is to use -xM if using Sun Studio on Solaris
7350 if test "$SOLARIS_SUNPRO_CC"; then
7353 if test "$_cpp_md_flag"; then
7355 if test "$OS_ARCH" = "OpenVMS"; then
7356 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
7358 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
7360 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7361 if test "$SOLARIS_SUNPRO_CC"; then
7366 _USE_CPP_INCLUDE_FLAG=
7367 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7368 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7372 AC_SUBST(MOZ_AUTO_DEPS)
7373 AC_SUBST(COMPILER_DEPEND)
7377 dnl ========================================================
7379 dnl = Static Build Options
7381 dnl ========================================================
7382 MOZ_ARG_HEADER(Static build options)
7384 MOZ_ARG_ENABLE_BOOL(static,
7385 [ --enable-static Enable building of internal static libs],
7386 BUILD_STATIC_LIBS=1,
7389 dnl Disable libxul in debug builds, but not for xulrunner.
7390 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
7394 MOZ_ARG_ENABLE_BOOL(libxul,
7395 [ --enable-libxul Enable building of libxul],
7396 MOZ_ENABLE_LIBXUL=1,
7399 if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
7400 AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME. You probably want --enable-libxul.])
7403 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
7404 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
7407 AC_SUBST(LIBXUL_LIBS)
7409 if test -n "$MOZ_ENABLE_LIBXUL"; then
7410 XPCOM_LIBS="$LIBXUL_LIBS"
7411 AC_DEFINE(MOZ_ENABLE_LIBXUL)
7413 if test -n "$BUILD_STATIC_LIBS"; then
7414 AC_DEFINE(MOZ_STATIC_BUILD)
7416 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
7419 dnl ========================================================
7421 dnl = Standalone module options
7423 dnl ========================================================
7424 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7426 dnl Check for GLib and libIDL.
7427 dnl ========================================================
7428 case "$target_os" in
7429 msvc*|mks*|cygwin*|mingw*|wince*)
7430 SKIP_IDL_CHECK="yes"
7437 if test -z "$COMPILE_ENVIRONMENT"; then
7438 SKIP_IDL_CHECK="yes"
7441 dnl = Allow users to disable libIDL checking for standalone modules
7442 MOZ_ARG_WITHOUT_BOOL(libIDL,
7443 [ --without-libIDL Skip check for libIDL (standalone modules only)],
7444 SKIP_IDL_CHECK="yes")
7446 if test "$SKIP_IDL_CHECK" = "no"
7449 if test "$MACOS_SDK_DIR"; then
7450 dnl xpidl, and therefore libIDL, is only needed on the build host.
7451 dnl Don't build it against the SDK, as that causes problems.
7452 _MACSAVE_CFLAGS="$CFLAGS"
7453 _MACSAVE_LIBS="$LIBS"
7454 _MACSAVE_LDFLAGS="$LDFLAGS"
7455 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
7457 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"`
7458 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
7459 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
7464 if test "$MOZ_ENABLE_GTK2"; then
7465 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
7467 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
7468 dnl to either libIDL1 or libIDL2.
7469 if test -z "$_LIBIDL_FOUND"; then
7470 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
7471 if test -z "$_LIBIDL_FOUND"; then
7472 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
7476 dnl If we don't have a libIDL config program & not cross-compiling,
7477 dnl look for orbit-config instead.
7479 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
7480 MOZ_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
7481 if test -n "$ORBIT_CONFIG"; then
7482 AC_MSG_CHECKING([for ORBit libIDL usability])
7483 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
7484 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
7485 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
7486 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
7487 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
7488 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
7490 _SAVE_CFLAGS="$CFLAGS"
7492 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
7493 LIBS="$LIBIDL_LIBS $LIBS"
7496 #include <libIDL/IDL.h>
7499 s=strdup(IDL_get_libver_string());
7512 AC_MSG_RESULT($result)
7513 CFLAGS="$_SAVE_CFLAGS"
7517 if test -z "$_LIBIDL_FOUND"; then
7518 AC_MSG_ERROR([libIDL not found.
7519 libIDL $LIBIDL_VERSION or higher is required.])
7521 if test "$MACOS_SDK_DIR"; then
7522 CFLAGS="$_MACSAVE_CFLAGS"
7523 LIBS="$_MACSAVE_LIBS"
7524 LDFLAGS="$_MACSAVE_LDFLAGS"
7525 if test -n "$_MACSAVE_NEXT_ROOT" ; then
7526 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
7531 if test -n "$CROSS_COMPILE"; then
7532 if test -z "$HOST_LIBIDL_CONFIG"; then
7533 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
7535 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
7536 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
7537 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
7539 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
7540 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
7544 if test -z "$SKIP_PATH_CHECKS"; then
7545 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
7546 if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" ; then
7547 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7549 AM_PATH_GLIB(${GLIB_VERSION})
7554 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
7555 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7558 AC_SUBST(LIBIDL_CFLAGS)
7559 AC_SUBST(LIBIDL_LIBS)
7560 AC_SUBST(STATIC_LIBIDL)
7561 AC_SUBST(GLIB_CFLAGS)
7563 AC_SUBST(GLIB_GMODULE_LIBS)
7564 AC_SUBST(HOST_LIBIDL_CONFIG)
7565 AC_SUBST(HOST_LIBIDL_CFLAGS)
7566 AC_SUBST(HOST_LIBIDL_LIBS)
7568 dnl ========================================================
7570 dnl ========================================================
7571 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7574 MOZ_ARG_ENABLE_BOOL(system-cairo,
7575 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7579 # Check for headers defining standard int types.
7580 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7582 if test "$MOZ_TREE_CAIRO"; then
7583 AC_DEFINE(MOZ_TREE_CAIRO)
7585 # For now we assume that we will have a uint64_t available through
7586 # one of the above headers or mozstdint.h.
7587 AC_DEFINE(HAVE_UINT64_T)
7589 # Define macros for cairo-features.h
7590 if test "$MOZ_X11"; then
7591 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7592 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7593 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7594 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7595 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7596 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7597 MOZ_ENABLE_CAIRO_FT=1
7598 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7600 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
7601 QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
7603 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7604 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7605 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7606 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7608 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7609 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7610 if test -z "$WINCE"; then
7611 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7616 AC_TRY_COMPILE([#include <ddraw.h>], [int foo = DDLOCK_WAITNOTBUSY;], HAS_DDRAW=1, HAS_DDRAW=)
7617 if test -z "$HAS_DDRAW"; then
7618 AC_MSG_WARN([DirectDraw ddraw.h header not found or it's missing DDLOCK_WAITNOTBUSY, disabling DirectDraw surface. If you have an older SDK (such as the CE5 SDK), try copying in ddraw.lib and ddraw.h from the WM6 SDK.])
7619 DDRAW_SURFACE_FEATURE=
7621 DDRAW_SURFACE_FEATURE="#define CAIRO_HAS_DDRAW_SURFACE 1"
7624 if test -z "$OGLES_SDK_DIR"; then
7625 OGLES_SURFACE_FEATURE=
7628 #include <EGL/egl.h>
7629 #include <EGL/eglext.h>
7630 #include <GLES2/gl2.h>
7631 #include <GLES2/gl2ext.h>
7632 ], [ EGLDisplay _cairo_ddraw_egl_dpy = EGL_NO_DISPLAY;], HAS_OGLES=1, HAS_OGLES=)
7633 if test -z "$HAS_OGLES"; then
7634 AC_MSG_WARN([OpenGL ES2 headers not found, disabling OpenGL acceleration surfaces.])
7635 OGLES_SURFACE_FEATURE=
7637 OGLES_SURFACE_FEATURE="#define CAIRO_DDRAW_USE_GL 1"
7641 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7643 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7644 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7645 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7646 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7647 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7648 MOZ_ENABLE_CAIRO_FT=1
7649 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7650 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7652 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7653 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7654 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7655 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7656 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7657 MOZ_ENABLE_CAIRO_FT=1
7659 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7660 AC_SUBST(CAIRO_FT_CFLAGS)
7663 if test "$MOZ_DEBUG"; then
7664 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7666 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7669 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7671 AC_SUBST(PS_SURFACE_FEATURE)
7672 AC_SUBST(PDF_SURFACE_FEATURE)
7673 AC_SUBST(SVG_SURFACE_FEATURE)
7674 AC_SUBST(XLIB_SURFACE_FEATURE)
7675 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7676 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7677 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7678 AC_SUBST(XCB_SURFACE_FEATURE)
7679 AC_SUBST(WIN32_SURFACE_FEATURE)
7680 AC_SUBST(DDRAW_SURFACE_FEATURE)
7681 AC_SUBST(OGLES_SURFACE_FEATURE)
7682 AC_SUBST(OS2_SURFACE_FEATURE)
7683 AC_SUBST(BEOS_SURFACE_FEATURE)
7684 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7685 AC_SUBST(FT_FONT_FEATURE)
7686 AC_SUBST(FC_FONT_FEATURE)
7687 AC_SUBST(WIN32_FONT_FEATURE)
7688 AC_SUBST(QUARTZ_FONT_FEATURE)
7689 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7690 AC_SUBST(QPAINTER_SURFACE_FEATURE)
7692 if test "$_WIN32_MSVC"; then
7693 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7695 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"
7697 if test "$MOZ_X11"; then
7698 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7702 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7703 mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
7706 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7707 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7708 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7709 if test "$MOZ_X11"; then
7710 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7711 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7712 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7716 AC_SUBST(MOZ_TREE_CAIRO)
7717 AC_SUBST(MOZ_CAIRO_CFLAGS)
7718 AC_SUBST(MOZ_CAIRO_LIBS)
7721 dnl ========================================================
7723 QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
7726 dnl ========================================================
7728 dnl ========================================================
7729 MOZ_ARG_DISABLE_BOOL(xul,
7730 [ --disable-xul Disable XUL],
7732 if test "$MOZ_XUL"; then
7735 dnl remove extensions that require XUL
7736 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7741 dnl ========================================================
7742 dnl disable profile locking
7743 dnl do no use this in applications that can have more than
7744 dnl one process accessing the profile directory.
7745 dnl ========================================================
7746 MOZ_ARG_DISABLE_BOOL(profilelocking,
7747 [ --disable-profilelocking Disable profile locking],
7748 MOZ_PROFILELOCKING=,
7749 MOZ_PROFILELOCKING=1 )
7750 if test "$MOZ_PROFILELOCKING"; then
7751 AC_DEFINE(MOZ_PROFILELOCKING)
7754 dnl ========================================================
7755 dnl disable rdf services
7756 dnl ========================================================
7757 MOZ_ARG_DISABLE_BOOL(rdf,
7758 [ --disable-rdf Disable RDF],
7760 if test "$MOZ_RDF"; then
7766 dnl ========================================================
7767 dnl necko configuration options
7768 dnl ========================================================
7771 dnl option to disable various necko protocols
7773 MOZ_ARG_ENABLE_STRING(necko-protocols,
7774 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7775 Enable/disable specific protocol handlers],
7776 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7777 if test "$option" = "yes" || test "$option" = "all"; then
7778 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7779 elif test "$option" = "no" || test "$option" = "none"; then
7781 elif test "$option" = "default"; then
7782 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7783 elif test `echo "$option" | grep -c \^-` != 0; then
7784 option=`echo $option | sed 's/^-//'`
7785 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7787 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7790 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7792 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7793 AC_SUBST(NECKO_PROTOCOLS)
7794 for p in $NECKO_PROTOCOLS; do
7795 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7799 dnl option to disable necko's disk cache
7801 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7802 [ --disable-necko-disk-cache
7803 Disable necko disk cache],
7806 AC_SUBST(NECKO_DISK_CACHE)
7807 if test "$NECKO_DISK_CACHE"; then
7808 AC_DEFINE(NECKO_DISK_CACHE)
7812 dnl option to disable necko's wifi scanner
7814 MOZ_ARG_DISABLE_BOOL(necko-wifi,
7815 [ --disable-necko-wifi Disable necko wifi scanner],
7819 if test "$NECKO_WIFI"; then
7821 if test "$OS_ARCH" = "Linux"; then
7822 AC_CHECK_HEADER([iwlib.h])
7823 if test "$ac_cv_header_iwlib_h" = "yes"; then
7826 AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora)); use --disable-necko-wifi to disable])
7828 elif test "$OS_ARCH" = "Darwin"; then
7830 elif test "$OS_ARCH" = "WINNT"; then
7832 elif test "$OS_ARCH" = "WINCE"; then
7834 elif test "$OS_ARCH" = "OS2"; then
7835 dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
7838 AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
7840 AC_SUBST(NECKO_WIFI)
7842 if test "$NECKO_WIFI"; then
7843 AC_DEFINE(NECKO_WIFI)
7847 AC_SUBST(NECKO_WIFI)
7851 dnl option to minimize size of necko's i/o buffers
7853 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7854 [ --enable-necko-small-buffers
7855 Minimize size of necko's i/o buffers],
7856 NECKO_SMALL_BUFFERS=1,
7857 NECKO_SMALL_BUFFERS=)
7858 AC_SUBST(NECKO_SMALL_BUFFERS)
7859 if test "$NECKO_SMALL_BUFFERS"; then
7860 AC_DEFINE(NECKO_SMALL_BUFFERS)
7864 dnl option to disable cookies
7866 MOZ_ARG_DISABLE_BOOL(cookies,
7867 [ --disable-cookies Disable cookie support],
7870 AC_SUBST(NECKO_COOKIES)
7871 if test "$NECKO_COOKIES"; then
7872 AC_DEFINE(NECKO_COOKIES)
7875 dnl NECKO_ configuration options are not global
7876 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7878 dnl Only build Mork if it's required
7880 if test "$MOZ_MORK"; then
7884 dnl Build the lightweight Mork reader if required
7885 AC_SUBST(MOZ_MORKREADER)
7886 if test "$MOZ_MORKREADER"; then
7887 AC_DEFINE(MOZ_MORKREADER)
7890 dnl ========================================================
7891 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7892 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7895 dnl ========================================================
7897 dnl = Maintainer debug option (no --enable equivalent)
7899 dnl ========================================================
7904 AC_SUBST(AR_EXTRACT)
7908 AC_SUBST(AS_DASH_C_FLAG)
7913 AC_SUBST(USE_SHORT_LIBNAME)
7917 AC_SUBST(NS_USE_NATIVE)
7918 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7919 AC_SUBST(MOZ_GFX_TOOLKIT)
7920 AC_SUBST(MOZ_UPDATE_XTERM)
7922 AC_SUBST(MOZ_PLATFORM_HILDON)
7924 AC_SUBST(NS_MAEMO_LOCATION)
7925 AC_SUBST(MOZ_AUTH_EXTENSION)
7926 AC_SUBST(MOZ_MATHML)
7927 AC_SUBST(MOZ_PERMISSIONS)
7929 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7930 AC_SUBST(MOZ_PREF_EXTENSIONS)
7933 AC_SUBST(MOZ_XSLT_STANDALONE)
7934 AC_SUBST(MOZ_JS_LIBS)
7937 AC_SUBST(MOZ_DEBUG_MODULES)
7938 AC_SUBST(MOZ_PROFILE_MODULES)
7939 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7940 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7941 AC_SUBST(MOZ_DEBUG_FLAGS)
7942 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7943 AC_SUBST(WARNINGS_AS_ERRORS)
7944 AC_SUBST(MOZ_DBGRINFO_MODULES)
7945 AC_SUBST(MOZ_EXTENSIONS)
7946 AC_SUBST(MOZ_IMG_DECODERS)
7947 AC_SUBST(MOZ_IMG_ENCODERS)
7948 AC_SUBST(MOZ_JSDEBUGGER)
7949 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7950 AC_SUBST(MOZ_PLUGINS)
7951 AC_SUBST(ENABLE_EAZEL_PROFILER)
7952 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7953 AC_SUBST(EAZEL_PROFILER_LIBS)
7954 AC_SUBST(MOZ_PERF_METRICS)
7955 AC_SUBST(GC_LEAK_DETECTOR)
7956 AC_SUBST(MOZ_LOG_REFCNT)
7960 AC_SUBST(MOZ_CALLGRIND)
7962 AC_SUBST(MOZ_XPCTOOLS)
7963 AC_SUBST(MOZ_JSLOADER)
7964 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7965 AC_SUBST(MOZ_INSURE)
7966 AC_SUBST(MOZ_INSURE_DIRS)
7967 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7968 AC_SUBST(MOZ_QUANTIFY)
7969 AC_SUBST(MOZ_INSURIFYING)
7971 AC_SUBST(MOZ_PLACES)
7972 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7973 AC_SUBST(MOZ_STORAGE)
7975 AC_SUBST(NS_PRINTING)
7977 AC_SUBST(MOZ_JAVAXPCOM)
7978 AC_SUBST(JAVA_INCLUDE_PATH)
7983 AC_SUBST(MOZ_PROFILELOCKING)
7986 AC_SUBST(MOZ_XIE_LIBS)
7987 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
7989 AC_SUBST(XPCOM_USE_LEA)
7990 AC_SUBST(BUILD_STATIC_LIBS)
7991 AC_SUBST(MOZ_ENABLE_LIBXUL)
7992 AC_SUBST(ENABLE_TESTS)
7994 AC_SUBST(MOZ_UNIVERSALCHARDET)
7995 AC_SUBST(ACCESSIBILITY)
7996 AC_SUBST(MOZ_XPINSTALL)
7997 AC_SUBST(MOZ_VIEW_SOURCE)
7998 AC_SUBST(MOZ_SPELLCHECK)
7999 AC_SUBST(MOZ_XPFE_COMPONENTS)
8000 AC_SUBST(MOZ_USER_DIR)
8001 AC_SUBST(MOZ_CRASHREPORTER)
8003 AC_SUBST(ENABLE_STRIP)
8004 AC_SUBST(PKG_SKIP_STRIP)
8005 AC_SUBST(USE_ELF_DYNSTR_GC)
8006 AC_SUBST(INCREMENTAL_LINKER)
8007 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8008 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8009 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
8011 AC_SUBST(MOZ_FIX_LINK_PATHS)
8012 AC_SUBST(XPCOM_LIBS)
8013 AC_SUBST(XPCOM_FROZEN_LDOPTS)
8014 AC_SUBST(XPCOM_GLUE_LDOPTS)
8015 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8017 AC_SUBST(USE_DEPENDENT_LIBS)
8019 AC_SUBST(MOZ_BUILD_ROOT)
8020 AC_SUBST(MOZ_OS2_TOOLS)
8021 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
8023 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8024 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8025 AC_SUBST(MOZ_TIMELINE)
8026 AC_SUBST(OGLES_SDK_DIR)
8028 AC_SUBST(MOZ_APP_NAME)
8029 AC_SUBST(MOZ_APP_DISPLAYNAME)
8030 AC_SUBST(MOZ_APP_VERSION)
8031 AC_SUBST(FIREFOX_VERSION)
8033 AC_SUBST(MOZ_PKG_SPECIAL)
8035 AC_SUBST(MOZILLA_OFFICIAL)
8038 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8039 AC_SUBST(MOZ_MAPINFO)
8040 AC_SUBST(MOZ_BROWSE_INFO)
8041 AC_SUBST(MOZ_TOOLS_DIR)
8042 AC_SUBST(CYGWIN_WRAPPER)
8044 AC_SUBST(WIN32_REDIST_DIR)
8048 AC_SUBST(WINCE_SDK_DIR)
8049 AC_SUBST(WINCE_WINDOWS_MOBILE)
8051 dnl Echo the CFLAGS to remove extra whitespace.
8058 $_MOZ_EXCEPTIONS_FLAGS \
8059 $_WARNINGS_CXXFLAGS \
8062 COMPILE_CFLAGS=`echo \
8067 COMPILE_CXXFLAGS=`echo \
8068 $_DEFINES_CXXFLAGS \
8072 AC_SUBST(SYSTEM_MAKEDEPEND)
8073 AC_SUBST(SYSTEM_LIBXUL)
8074 AC_SUBST(SYSTEM_JPEG)
8075 AC_SUBST(SYSTEM_PNG)
8076 AC_SUBST(SYSTEM_ZLIB)
8077 AC_SUBST(SYSTEM_BZ2)
8079 AC_SUBST(JPEG_CFLAGS)
8081 AC_SUBST(ZLIB_CFLAGS)
8083 AC_SUBST(BZ2_CFLAGS)
8085 AC_SUBST(PNG_CFLAGS)
8088 AC_SUBST(MOZ_JPEG_CFLAGS)
8089 AC_SUBST(MOZ_JPEG_LIBS)
8090 AC_SUBST(MOZ_ZLIB_CFLAGS)
8091 AC_SUBST(MOZ_ZLIB_LIBS)
8092 AC_SUBST(MOZ_BZ2_CFLAGS)
8093 AC_SUBST(MOZ_BZ2_LIBS)
8094 AC_SUBST(MOZ_PNG_CFLAGS)
8095 AC_SUBST(MOZ_PNG_LIBS)
8097 AC_SUBST(NSPR_CFLAGS)
8099 AC_SUBST(MOZ_NATIVE_NSPR)
8101 AC_SUBST(NSS_CFLAGS)
8103 AC_SUBST(NSS_DEP_LIBS)
8104 AC_SUBST(MOZ_NATIVE_NSS)
8105 AC_SUBST(NSS_DISABLE_DBM)
8110 AC_SUBST(COMPILE_CFLAGS)
8111 AC_SUBST(COMPILE_CXXFLAGS)
8114 AC_SUBST(CROSS_COMPILE)
8115 AC_SUBST(WCHAR_CFLAGS)
8119 AC_SUBST(HOST_CFLAGS)
8120 AC_SUBST(HOST_CXXFLAGS)
8121 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8123 AC_SUBST(HOST_AR_FLAGS)
8125 AC_SUBST(HOST_RANLIB)
8126 AC_SUBST(HOST_NSPR_MDCPUCFG)
8127 AC_SUBST(HOST_BIN_SUFFIX)
8128 AC_SUBST(HOST_OS_ARCH)
8130 AC_SUBST(TARGET_CPU)
8131 AC_SUBST(TARGET_VENDOR)
8133 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8134 AC_SUBST(TARGET_MD_ARCH)
8135 AC_SUBST(TARGET_XPCOM_ABI)
8138 AC_SUBST(OS_RELEASE)
8141 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
8142 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8144 AC_SUBST(WRAP_MALLOC_CFLAGS)
8145 AC_SUBST(WRAP_MALLOC_LIB)
8148 AC_SUBST(MKSHLIB_FORCE_ALL)
8149 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8150 AC_SUBST(DSO_CFLAGS)
8151 AC_SUBST(DSO_PIC_CFLAGS)
8152 AC_SUBST(DSO_LDOPTS)
8153 AC_SUBST(LIB_PREFIX)
8154 AC_SUBST(DLL_PREFIX)
8155 AC_SUBST(DLL_SUFFIX)
8156 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8157 AC_SUBST(LIB_SUFFIX)
8158 AC_SUBST(OBJ_SUFFIX)
8159 AC_SUBST(BIN_SUFFIX)
8160 AC_SUBST(ASM_SUFFIX)
8161 AC_SUBST(IMPORT_LIB_SUFFIX)
8163 AC_SUBST(CC_VERSION)
8164 AC_SUBST(CXX_VERSION)
8165 AC_SUBST(MSMANIFEST_TOOL)
8167 if test "$USING_HCC"; then
8168 CC='${topsrcdir}/build/hcc'
8170 CXX='${topsrcdir}/build/hcpp'
8171 CXX="$CXX '$_OLDCXX'"
8176 dnl Check for missing components
8177 if test "$COMPILE_ENVIRONMENT"; then
8178 if test "$MOZ_X11"; then
8179 dnl ====================================================
8180 dnl = Check if X headers exist
8181 dnl ====================================================
8182 _SAVE_CFLAGS=$CFLAGS
8183 CFLAGS="$CFLAGS $XCFLAGS"
8187 #include <X11/Xlib.h>
8188 #include <X11/Intrinsic.h>
8192 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8193 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8197 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8198 CFLAGS="$_SAVE_CFLAGS"
8200 if test ! -z "$MISSING_X"; then
8201 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8205 fi # COMPILE_ENVIRONMENT
8207 dnl Set various defines and substitutions
8208 dnl ========================================================
8210 if test "$OS_ARCH" = "BeOS"; then
8213 elif test "$OS_ARCH" = "Darwin"; then
8215 AC_DEFINE(UNIX_ASYNC_DNS)
8217 elif test "$OS_ARCH" = "OpenVMS"; then
8219 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
8221 AC_DEFINE(UNIX_ASYNC_DNS)
8224 AC_SUBST(MOZ_MOVEMAIL)
8226 if test "$MOZ_DEBUG"; then
8227 AC_DEFINE(MOZ_REFLOW_PERF)
8228 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8231 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8232 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8233 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8234 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8235 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8236 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8237 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8238 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8239 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8242 dnl ========================================================
8243 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
8244 dnl ========================================================
8247 WIN_TOP_SRC=`cd $srcdir; pwd -W`
8250 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
8251 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
8252 CC="\$(CYGWIN_WRAPPER) $CC"
8253 CXX="\$(CYGWIN_WRAPPER) $CXX"
8254 CPP="\$(CYGWIN_WRAPPER) $CPP"
8255 LD="\$(CYGWIN_WRAPPER) $LD"
8256 AS="\$(CYGWIN_WRAPPER) $AS"
8257 RC="\$(CYGWIN_WRAPPER) $RC"
8258 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
8259 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
8260 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
8264 AC_SUBST(CYGDRIVE_MOUNT)
8265 AC_SUBST(WIN_TOP_SRC)
8267 AC_SUBST(MOZILLA_VERSION)
8269 AC_SUBST(ac_configure_args)
8271 dnl Spit out some output
8272 dnl ========================================================
8274 dnl The following defines are used by xpcom
8275 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8277 HAVE_CPP_2BYTE_WCHAR_T
8278 HAVE_CPP_ACCESS_CHANGING_USING
8279 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8282 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8284 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8285 HAVE_CPP_NAMESPACE_STD
8287 HAVE_CPP_PARTIAL_SPECIALIZATION
8288 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8290 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
8292 NEED_CPP_UNUSED_IMPLEMENTATIONS
8296 HAVE_ICONV_WITH_CONST_INPUT
8304 netwerk/necko-config.h
8305 xpcom/xpcom-config.h
8306 xpcom/xpcom-private.h
8309 # Save the defines header file before autoconf removes it.
8310 # (Do not add AC_DEFINE calls after this line.)
8311 _CONFIG_TMP=confdefs-tmp.h
8312 _CONFIG_DEFS_H=mozilla-config.h
8314 cat > $_CONFIG_TMP <<\EOF
8315 /* List of defines generated by configure. Included with preprocessor flag,
8316 * -include, to avoid long list of -D defines on the compile command-line.
8320 #ifndef _MOZILLA_CONFIG_H_
8321 #define _MOZILLA_CONFIG_H_
8324 _EGREP_PATTERN='^#define ('
8325 if test -n "$_NON_GLOBAL_ACDEFINES"; then
8326 for f in $_NON_GLOBAL_ACDEFINES; do
8327 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
8330 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
8332 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
8334 cat >> $_CONFIG_TMP <<\EOF
8336 #endif /* _MOZILLA_CONFIG_H_ */
8340 # Only write mozilla-config.h when something changes (or it doesn't exist)
8341 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
8344 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
8345 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
8347 echo ==== $_CONFIG_DEFS_H =================================
8351 dnl Probably shouldn't call this manually but we always want the output of DEFS
8352 rm -f confdefs.h.save
8353 mv confdefs.h confdefs.h.save
8354 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
8355 AC_OUTPUT_MAKE_DEFS()
8357 AC_SUBST(MOZ_DEFINES)
8359 mv confdefs.h.save confdefs.h
8361 dnl Load the list of Makefiles to generate.
8362 dnl To add new Makefiles, edit allmakefiles.sh.
8363 dnl allmakefiles.sh sets the variable, MAKEFILES.
8364 . ${srcdir}/allmakefiles.sh
8366 dnl Run a perl script to quickly create the makefiles.
8367 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
8368 dnl for the files it cannot handle correctly. This way, config.status
8369 dnl will handle these files.
8370 dnl If it fails, nothing is set and config.status will run as usual.
8372 dnl This does not change the $MAKEFILES variable.
8374 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
8376 if test -z "${AS_PERL}"; then
8377 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
8379 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
8384 echo $MAKEFILES > unallmakefiles
8386 mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
8388 AC_OUTPUT($MAKEFILES)
8390 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
8391 if test "$CAIRO_FEATURES_H"; then
8392 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
8393 echo "$CAIRO_FEATURES_H is unchanged"
8394 mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
8396 rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
8400 dnl ========================================================
8401 dnl = Setup a nice relatively clean build environment for
8402 dnl = sub-configures.
8403 dnl ========================================================
8406 CFLAGS="$_SUBDIR_CFLAGS"
8407 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8408 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8409 LDFLAGS="$_SUBDIR_LDFLAGS"
8410 HOST_CC="$_SUBDIR_HOST_CC"
8411 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8412 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8418 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8419 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8421 if test -z "$MOZ_NATIVE_NSPR"; then
8422 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8423 if test -z "$MOZ_DEBUG"; then
8424 ac_configure_args="$ac_configure_args --disable-debug"
8426 if test "$MOZ_OPTIMIZE" = "1"; then
8427 ac_configure_args="$ac_configure_args --enable-optimize"
8429 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8430 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8432 if test -n "$HAVE_64BIT_OS"; then
8433 ac_configure_args="$ac_configure_args --enable-64bit"
8435 if test -n "$USE_ARM_KUSER"; then
8436 ac_configure_args="$ac_configure_args --with-arm-kuser"
8438 AC_OUTPUT_SUBDIRS(nsprpub)
8439 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8442 if test -z "$MOZ_NATIVE_NSPR"; then
8443 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8444 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8445 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8446 NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
8447 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
8448 NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
8449 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
8451 rm -f config/autoconf.mk.bak
8454 # Run the SpiderMonkey 'configure' script.
8455 dist=$MOZ_BUILD_ROOT/dist
8456 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8457 ac_configure_args="$ac_configure_args --enable-threadsafe"
8458 if test -z "$MOZ_NATIVE_NSPR"; then
8459 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8460 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8462 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8463 ac_configure_args="$ac_configure_args --includedir=$dist/include"
8464 ac_configure_args="$ac_configure_args --bindir=$dist/bin"
8465 ac_configure_args="$ac_configure_args --libdir=$dist/lib"
8466 ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
8467 if test "$MOZ_MEMORY"; then
8468 ac_configure_args="$ac_configure_args --enable-jemalloc"
8469 if test -n "$MOZ_MEMORY_LDFLAGS"; then
8470 export MOZ_MEMORY_LDFLAGS
8473 AC_OUTPUT_SUBDIRS(js/src)
8474 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8476 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
8478 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
8479 dnl Needs to be at the end to respect possible changes from NSPR configure
8480 if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
8481 echo "config/autoconf.mk is unchanged"
8482 mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
8484 rm -f config/autoconf.mk.orig 2> /dev/null