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.10
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= )
207 MOZ_ARG_WITH_STRING(l10n-base,
208 [ --with-l10n-base=DIR path to l10n repositories],
209 L10NBASEDIR=$withval)
210 if test ! -z "$L10NBASEDIR"; then
211 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
212 AC_MSG_ERROR([--with-l10n-base must specify a path])
213 elif test -d "$L10NBASEDIR"; then
214 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
216 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
219 AC_SUBST(L10NBASEDIR)
221 dnl Check for Perl first -- needed for win32 SDK checks
222 MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
223 if test -z "$PERL" || test "$PERL" = ":"; then
224 AC_MSG_ERROR([perl not found in \$PATH])
227 dnl ========================================================
228 dnl Checks for compilers.
229 dnl ========================================================
230 dnl Set CROSS_COMPILE in the environment when running configure
231 dnl to use the cross-compile setup for now
232 dnl ========================================================
234 if test "$COMPILE_ENVIRONMENT"; then
236 dnl Do some special WinCE toolchain stuff
240 MOZ_ARG_WITH_STRING(wince-sdk,
241 [ --with-wince-sdk=WINCE_SDK_DIR
242 The path to the Windows CE SDK],
243 WINCE_SDK_DIR=$withval)
245 dnl Default to Windows Mobile components enabled
246 WINCE_WINDOWS_MOBILE=1
248 MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
249 [ --disable-windows-mobile-components
250 Disable Windows Mobile specific components from CE build],
251 WINCE_WINDOWS_MOBILE=,
252 WINCE_WINDOWS_MOBILE=1)
254 if test "$WINCE_WINDOWS_MOBILE"; then
255 AC_DEFINE(WINCE_WINDOWS_MOBILE)
262 echo -----------------------------------------------------------------------------
263 echo Building Windows CE Shunt Library and Tool Chain
271 make WINCE_SDK_DIR="$WINCE_SDK_DIR" TOPSRCDIR="$_topsrcdir" OBJDIR="$_pwdw" -C $srcdir/build/wince/tools
273 CC="$_pwd/dist/sdk/bin/arm-wince-gcc"
274 CXX="$_pwd/dist/sdk/bin/arm-wince-gcc"
275 CPP="$_pwd/dist/sdk/bin/arm-wince-gcc -E -nologo"
276 CXXCPP="$_pwd/dist/sdk/bin/arm-wince-gcc -TP -E -nologo"
277 LD="$_pwd/dist/sdk/bin/arm-wince-link"
278 AR="$_pwd/dist/sdk/bin/arm-wince-lib"
279 AS="$_pwd/dist/sdk/bin/arm-wince-as"
280 RC="$_pwd/dist/sdk/bin/arm-wince-res"
283 echo -----------------------------------------------------------------------------
288 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
289 echo "cross compiling from $host to $target"
293 _SAVE_CFLAGS="$CFLAGS"
294 _SAVE_LDFLAGS="$LDFLAGS"
296 AC_MSG_CHECKING([for host c compiler])
297 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
298 if test -z "$HOST_CC"; then
299 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
301 AC_MSG_RESULT([$HOST_CC])
302 AC_MSG_CHECKING([for host c++ compiler])
303 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
304 if test -z "$HOST_CXX"; then
305 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
307 AC_MSG_RESULT([$HOST_CXX])
309 if test -z "$HOST_CFLAGS"; then
310 HOST_CFLAGS="$CFLAGS"
312 if test -z "$HOST_CXXFLAGS"; then
313 HOST_CXXFLAGS="$CXXFLAGS"
315 if test -z "$HOST_LDFLAGS"; then
316 HOST_LDFLAGS="$LDFLAGS"
318 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
319 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
321 CFLAGS="$HOST_CFLAGS"
322 LDFLAGS="$HOST_LDFLAGS"
324 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
325 AC_TRY_COMPILE([], [return(0);],
326 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
327 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
330 CFLAGS="$HOST_CXXFLAGS"
332 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
333 AC_TRY_COMPILE([], [return(0);],
334 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
335 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
339 LDFLAGS=$_SAVE_LDFLAGS
341 case "$build:$target" in
342 powerpc-apple-darwin8*:i?86-apple-darwin*)
343 dnl The Darwin cross compiler doesn't necessarily point itself at a
344 dnl root that has libraries for the proper architecture, it defaults
345 dnl to the system root. The libraries in the system root on current
346 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
347 dnl checks will fail. Fake a working SDK in that case.
349 _SAVE_CXXFLAGS=$CXXLAGS
350 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
351 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
355 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
358 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
362 case "$build:$target" in
363 powerpc-apple-darwin8*:i?86-apple-darwin*)
364 dnl Revert the changes made above. From this point on, the target
365 dnl compiler will never be used without applying the SDK to CFLAGS
366 dnl (see --with-macos-sdk below).
368 CXXFLAGS=$_SAVE_CXXFLAGS
372 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
373 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
374 MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
375 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
376 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
377 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
378 AC_DEFINE(CROSS_COMPILE)
383 MOZ_PATH_PROGS(AS, $AS as, $CC)
384 AC_CHECK_PROGS(AR, ar, :)
385 AC_CHECK_PROGS(LD, ld, :)
386 AC_CHECK_PROGS(STRIP, strip, :)
387 AC_CHECK_PROGS(WINDRES, windres, :)
388 if test -z "$HOST_CC"; then
391 if test -z "$HOST_CFLAGS"; then
392 HOST_CFLAGS="$CFLAGS"
394 if test -z "$HOST_CXX"; then
397 if test -z "$HOST_CXXFLAGS"; then
398 HOST_CXXFLAGS="$CXXFLAGS"
400 if test -z "$HOST_LDFLAGS"; then
401 HOST_LDFLAGS="$LDFLAGS"
403 if test -z "$HOST_RANLIB"; then
404 HOST_RANLIB="$RANLIB"
406 if test -z "$HOST_AR"; then
417 if test "$GCC" = "yes"; then
419 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
421 if test "$GXX" = "yes"; then
423 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
425 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
428 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
431 if test "$GNU_CC"; then
432 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
439 if test "$GCC" = yes; then
440 if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
445 if test "$GXX" = yes; then
446 if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
451 dnl Special win32 checks
452 dnl ========================================================
458 if test -n "$GNU_CC"; then
466 dnl Target the Windows Vista SDK by default
469 MOZ_ARG_WITH_STRING(windows-version,
470 [ --with-windows-version=WINSDK_TARGETVER
471 Highest Windows version to target using this SDK
472 502: Windows Server 2003
475 WINSDK_TARGETVER=$withval)
477 case "$WINSDK_TARGETVER" in
479 MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
483 AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
488 dnl Vista SDK specific api (deprecated)
489 MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
490 [ --disable-vista-sdk-requirements
491 Do not build Vista SDK specific code],
492 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
493 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
494 if test -n "$COMPILE_ENVIRONMENT"; then
495 if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
496 AC_MSG_WARN([--disable-vista-sdk-requirements is deprecated, use --with-windows-version=502 instead])
497 MOZ_WINSDK_TARGETVER=05020000
500 if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
501 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1
502 AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
503 # We can't build parental controls either
504 MOZ_DISABLE_PARENTAL_CONTROLS=1
508 AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
511 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
512 if test "$GCC" != "yes"; then
513 # Check to see if we are really running in a msvc environemnt
515 AC_CHECK_PROGS(MIDL, midl)
517 # Make sure compilers are valid
518 CFLAGS="$CFLAGS -TC -nologo"
519 CXXFLAGS="$CXXFLAGS -TP -nologo"
522 AC_TRY_COMPILE([#include <stdio.h>],
523 [ printf("Hello World\n"); ],,
524 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
527 AC_TRY_COMPILE([#include <new.h>],
528 [ unsigned *test = new unsigned(42); ],,
529 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
533 _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
536 # Determine compiler version
537 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
538 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
539 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
540 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
541 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
542 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
544 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
545 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
547 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
548 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
550 if test "$_CC_MAJOR_VERSION" = "12"; then
552 elif test "$_CC_MAJOR_VERSION" = "13"; then
554 elif test "$_CC_MAJOR_VERSION" = "14"; then
556 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
557 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
558 dnl so be very specific here!
559 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
560 if test $_CC_RELEASE -gt 50727; then
562 elif test $_CC_BUILD -ge 762; then
565 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
566 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
567 elif test "$_CC_MAJOR_VERSION" = "15"; then
569 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
570 LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
572 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
573 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
575 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
578 _MOZ_RTTI_FLAGS_ON='-GR'
579 _MOZ_RTTI_FLAGS_OFF='-GR-'
580 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
581 _MOZ_EXCEPTIONS_FLAGS_OFF=''
583 if test -n "$WIN32_REDIST_DIR"; then
584 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
588 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
589 if test "$_CC_SUITE" -ge "8"; then
591 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
594 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
595 if test -n "$MSMT_TOOL"; then
596 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
597 if test -z "$MSMANIFEST_TOOL_VERSION"; then
598 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
603 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
607 # Check linker version
608 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
609 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
610 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
611 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
616 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
617 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
618 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
619 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
620 # Add flags if necessary
621 AC_MSG_CHECKING([for midl flags])
624 if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
625 # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
626 # MIDL version 7.00.0500 or later has no problem.
627 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
628 AC_MSG_RESULT([need -env win32])
630 AC_MSG_RESULT([none needed])
634 AC_MSG_RESULT([none needed])
638 # Identify which version of the SDK we're building with
639 # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
641 AC_CHECK_HEADERS([winsdkver.h])
642 if test "$ac_cv_header_winsdkver_h" = "yes"; then
643 # Get the highest _WIN32_WINNT and NTDDI versions supported
644 # Take the higher of the two
645 # This is done because the Windows 7 beta SDK reports its
646 # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
647 AC_CACHE_CHECK(for highest Windows version supported by this SDK,
649 [cat > conftest.h <<EOF
650 #include <winsdkver.h>
651 #include <sdkddkver.h>
653 #if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
654 #define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
656 #define WINSDK_MAXVER NTDDI_MAXVER
661 ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
664 MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
666 # The Vista SDK is the only one to have sdkddkver.h but not
668 AC_CHECK_HEADERS([sdkddkver.h])
669 if test "$ac_cv_header_sdkddkver_h" = "yes"; then
670 MOZ_WINSDK_MAXVER=0x06000000
672 # Assume the Server 2003 Platform SDK
673 MOZ_WINSDK_MAXVER=0x05020000
677 unset _MSVC_VER_FILTER
680 # Check w32api version
681 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
682 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
683 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
684 AC_TRY_COMPILE([#include <w32api.h>],
685 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
686 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
687 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
688 #error "test failed."
690 , [ res=yes ], [ res=no ])
691 AC_MSG_RESULT([$res])
692 if test "$res" != "yes"; then
693 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
695 # Check windres version
696 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
697 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
698 AC_MSG_RESULT([$_WINDRES_VERSION])
699 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
700 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
701 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
702 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
703 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
704 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
705 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
706 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
707 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
708 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
709 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
710 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
712 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
715 # Server 2003 is the highest version supported
716 MOZ_WINSDK_MAXVER=0x05020000
719 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
720 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
721 # Require OS features provided by IE 5.0
722 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
724 # If the maximum version supported by this SDK is lower than the target
726 AC_MSG_CHECKING([for Windows SDK being recent enough])
727 if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
731 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.])
734 AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
735 # Definitions matching sdkddkver.h
736 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
737 AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
738 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
742 dnl Test breaks icc on OS/2 && MSVC
743 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
745 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
749 CC="${srcdir}/build/hcc '$CC'"
750 CXX="${srcdir}/build/hcpp '$CXX'"
757 if test -n "$_WIN32_MSVC"; then
759 SKIP_COMPILER_CHECKS=1
760 SKIP_LIBRARY_CHECKS=1
762 # Since we're skipping compiler and library checks, hard-code
769 AC_DEFINE(HAVE_SETBUF)
770 AC_DEFINE(HAVE_ISATTY)
775 fi # COMPILE_ENVIRONMENT
787 dnl ========================================================
788 dnl Checks for programs.
789 dnl ========================================================
793 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
794 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
795 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
797 AC_MSG_RESULT([$_perl_version])
799 if test "$_perl_res" != 0; then
800 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
804 AC_MSG_CHECKING([for full perl installation])
805 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
807 if test "$_perl_res" != 0; then
809 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
814 MOZ_PATH_PROGS(PYTHON, $PYTHON python2.5 python2.4 python)
815 if test -z "$PYTHON"; then
816 AC_MSG_ERROR([python was not found in \$PATH])
819 MOZ_PATH_PROGS(NSINSTALL_BIN, nsinstall )
820 if test -z "$COMPILE_ENVIRONMENT"; then
821 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
822 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
825 AC_SUBST(NSINSTALL_BIN)
827 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
828 MOZ_PATH_PROG(WHOAMI, whoami, :)
829 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
830 MOZ_PATH_PROG(UNZIP, unzip, :)
831 MOZ_PATH_PROGS(ZIP, zip)
832 if test -z "$ZIP" || test "$ZIP" = ":"; then
833 AC_MSG_ERROR([zip not found in \$PATH])
835 MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
836 MOZ_PATH_PROG(XARGS, xargs)
837 if test -z "$XARGS" || test "$XARGS" = ":"; then
838 AC_MSG_ERROR([xargs not found in \$PATH .])
841 if test "$COMPILE_ENVIRONMENT"; then
843 dnl ========================================================
844 dnl = Mac OS X toolchain support
845 dnl ========================================================
849 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
850 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
851 dnl the environment and includedir purposes (when using an SDK, below),
852 dnl but remember the full version number for the libdir (SDK).
854 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
855 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
857 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
858 dnl Bug 280479, but this keeps popping up in bug 292530 too because
859 dnl 4.0.0/4061 is the default compiler in Tiger.
861 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
863 if test "$GCC_BUILD" = "4061" ; then
864 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
865 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
866 from building Mozilla. Upgrade to Xcode 2.1 or later.])
870 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
871 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
872 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
873 MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
878 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
880 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
886 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
887 dnl it has moved into /usr/bin.
888 MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
892 AC_SUBST(GCC_VERSION)
893 AC_SUBST(XCODEBUILD_VERSION)
894 AC_SUBST(HAS_XCODE_2_1)
896 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
897 dnl that a universal binary is being produced.
898 AC_SUBST(UNIVERSAL_BINARY)
900 dnl ========================================================
901 dnl Check for MacOS deployment target version
902 dnl ========================================================
904 MOZ_ARG_ENABLE_STRING(macos-target,
905 [ --enable-macos-target=VER (default=10.4)
906 Set the minimum MacOS version needed at runtime],
907 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
911 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
912 dnl Use the specified value
913 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
914 AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
915 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
916 dnl No value specified on the command line or in the environment,
917 dnl use architecture minimum.
918 case "${target_cpu}" in
920 export MACOSX_DEPLOYMENT_TARGET=10.5
923 export MACOSX_DEPLOYMENT_TARGET=10.4
930 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
932 dnl ========================================================
933 dnl = Mac OS X SDK support
934 dnl ========================================================
937 MOZ_ARG_WITH_STRING(macos-sdk,
938 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
939 MACOS_SDK_DIR=$withval)
941 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
942 dnl NEXT_ROOT will be set and exported only if it's needed.
943 AC_SUBST(MACOS_SDK_DIR)
946 if test "$MACOS_SDK_DIR"; then
947 dnl Sync this section with the ones in NSPR and NSS.
948 dnl Changes to the cross environment here need to be accounted for in
949 dnl the libIDL checks (below) and xpidl build.
951 if test ! -d "$MACOS_SDK_DIR"; then
952 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
953 specify a valid SDK. SDKs are installed when the optional cross-development
954 tools are selected during the Xcode/Developer Tools installation.])
957 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
958 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
959 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include -F${MACOS_SDK_DIR}/System/Library/Frameworks"
960 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
961 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
963 SDK_CXX_INCLUDE="-I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++ -I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin -I${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward"
965 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
966 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
968 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
969 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
970 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
972 dnl ld support for -syslibroot is compiler-agnostic, but only available
973 dnl on Tiger. Although it's possible to switch on the build host's
974 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
975 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
976 dnl set because both the compiler and linker use it.
977 LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib $LIBS"
978 export NEXT_ROOT=$MACOS_SDK_DIR
980 if test -n "$CROSS_COMPILE" ; then
981 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
982 dnl the build host. HOST_CXX is presently unused.
983 HOST_CC="NEXT_ROOT= $HOST_CC"
984 HOST_CXX="NEXT_ROOT= $HOST_CXX"
987 dnl gcc >= 4.0 uses different paths than above, but knows how to find
989 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
990 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
992 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
993 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
994 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
996 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
997 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
998 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
999 dnl be ignored and cause warnings when -syslibroot is specified.
1000 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
1001 dnl the -isysroot it receives, so this is only needed with 4.0.0.
1002 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1007 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
1009 AC_TRY_COMPILE([#include <new>
1010 int main() { return 0; }],
1014 AC_MSG_RESULT($result)
1016 if test "$result" = "no" ; then
1017 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
1021 fi # COMPILE_ENVIRONMENT
1023 dnl Be sure the make we use is GNU make.
1024 dnl on win32, gmake.exe is the generally the wrong version
1025 if test -n "$MAKE"; then
1026 if test `echo $MAKE | grep -c make.py` != 1; then
1032 cygwin*|mingw*|mks*|msvc*)
1033 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
1036 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
1039 if test "$GMAKE" = ":"; then
1040 AC_MSG_ERROR([GNU make not found])
1044 if test "$COMPILE_ENVIRONMENT"; then
1048 dnl Check in X11 include directory too.
1049 if test "$no_x" != "yes"; then
1050 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1055 fi # COMPILE_ENVIRONMENT
1057 dnl ========================================================
1058 dnl set the defaults first
1059 dnl ========================================================
1063 AR_EXTRACT='$(AR) x'
1078 MOZ_USER_DIR=".mozilla"
1080 HOST_AR_FLAGS='$(AR_FLAGS)'
1083 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
1085 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
1087 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1089 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
1091 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
1092 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
1093 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1094 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
1095 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1096 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1097 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1101 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1102 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
1104 USE_DEPENDENT_LIBS=1
1106 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1107 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
1109 MOZ_ENABLE_POSTSCRIPT=1
1111 if test -n "$CROSS_COMPILE"; then
1112 OS_TARGET="${target_os}"
1113 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1115 case "${target_os}" in
1116 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1117 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1118 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1119 mingw*) OS_ARCH=WINNT ;;
1120 wince*) OS_ARCH=WINCE ;;
1121 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1124 OS_TARGET=`uname -s`
1125 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1126 OS_RELEASE=`uname -r`
1129 # Before this used `uname -m` when not cross compiling
1130 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1131 OS_TEST="${target_cpu}"
1135 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1137 #######################################################################
1138 # Master "Core Components" macros for getting the OS target #
1139 #######################################################################
1142 # Note: OS_TARGET should be specified on the command line for gmake.
1143 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
1144 # The difference between the Win95 target and the WinNT target is that
1145 # the WinNT target uses Windows NT specific features not available
1146 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
1147 # at lesser performance (the Win95 target uses threads; the WinNT target
1150 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1151 # cross-compilation.
1155 # The following hack allows one to build on a WIN95 machine (as if
1156 # s/he were cross-compiling on a WINNT host for a WIN95 target).
1157 # It also accomodates for MKS's uname.exe. If you never intend
1158 # to do development on a WIN95 machine, you don't need this hack.
1173 CYGWIN_9*|CYGWIN_ME*)
1174 OS_ARCH='CYGWIN_NT-4.0'
1180 # Define and override various archtecture-specific variables, including
1189 case "$HOST_OS_ARCH" in
1190 cygwin*|mingw*|mks*|msvc*)
1200 if test -z "$GNU_CC"; then
1201 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1206 if test -z "$GNU_CXX"; then
1207 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1208 SOLARIS_SUNPRO_CXX=1
1211 AC_SUBST(SOLARIS_SUNPRO_CC)
1212 AC_SUBST(SOLARIS_SUNPRO_CXX)
1224 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1227 HOST_OS_ARCH=UNIXWARE
1239 HOST_OS_ARCH=OpenVMS
1249 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1253 HOST_OS_ARCH=UNIXWARE
1263 # If uname -s returns "Windows_NT", we assume that we are using
1264 # the uname.exe in MKS toolkit.
1266 # The -r option of MKS uname only returns the major version number.
1267 # So we need to use its -v option to get the minor version number.
1268 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1272 OS_MINOR_RELEASE=`uname -v`
1273 if test "$OS_MINOR_RELEASE" = "00"; then
1276 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1278 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1280 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1281 # the uname.exe in the Cygwin tools.
1282 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1283 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1284 # the uname.exe in the GNU-Win32 tools.
1285 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1286 # the uname.exe in the MSYS tools.
1288 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1293 OS_RELEASE=`uname -v`.`uname -r`
1294 OS_TEST=${target_cpu}
1306 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1310 OS_RELEASE=`uname -v`
1334 OS_RELEASE=`uname -v`
1340 OS_RELEASE=`uname -v`
1343 if test "$OS_TARGET" != "NTO"; then
1345 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1354 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1360 OS_RELEASE=`uname -v`
1367 case "${target_cpu}" in
1378 if test -z "$CROSS_COMPILE" ; then
1386 if test "$OS_ARCH" = "NCR"; then
1388 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1392 # Only set CPU_ARCH if we recognize the value of OS_TEST
1399 powerpc* | ppc | rs6000)
1403 Alpha | alpha | ALPHA)
1420 if test -z "$OS_TARGET"; then
1423 if test "$OS_TARGET" = "WIN95"; then
1426 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1428 dnl ========================================================
1429 dnl GNU specific defaults
1430 dnl ========================================================
1431 if test "$GNU_CC"; then
1432 # FIXME: Let us build with strict aliasing. bug 414641.
1433 CFLAGS="$CFLAGS -fno-strict-aliasing"
1434 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1435 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1436 DSO_LDOPTS='-shared'
1437 if test "$GCC_USE_GNU_LD"; then
1438 # Don't allow undefined symbols in libraries
1439 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1441 WARNINGS_AS_ERRORS='-Werror'
1443 DSO_PIC_CFLAGS='-fPIC'
1444 ASFLAGS="$ASFLAGS -fPIC"
1445 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1446 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1447 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1448 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1450 # Turn on GNU specific features
1451 # -Wall - turn on all warnings
1452 # -pedantic - make compiler warn about non-ANSI stuff, and
1453 # be a little bit stricter
1454 # Warnings slamm took out for now (these were giving more noise than help):
1455 # -Wbad-function-cast - warns when casting a function to a new return type
1456 # -Wshadow - removed because it generates more noise than help --pete
1457 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1458 if test -z "$INTEL_CC"; then
1459 # Don't use -Wcast-align with ICC
1461 # And don't use it on hppa, ia64, sparc, since it's noisy there
1462 hppa | ia64 | sparc)
1465 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1470 dnl Turn pedantic on but disable the warnings for long long
1473 if test -z "$INTEL_CC"; then
1474 _IGNORE_LONG_LONG_WARNINGS=1
1475 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1477 _IGNORE_LONG_LONG_WARNINGS=
1481 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1482 _USE_CPP_INCLUDE_FLAG=1
1483 elif test "$SOLARIS_SUNPRO_CC"; then
1484 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1485 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1487 DSO_LDOPTS='-shared'
1488 if test "$GNU_LD"; then
1489 # Don't allow undefined symbols in libraries
1490 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1494 if test "$CPU_ARCH" = "sparc"; then
1495 # for Sun Studio on Solaris/SPARC
1496 DSO_PIC_CFLAGS='-xcode=pic32'
1498 DSO_PIC_CFLAGS='-KPIC'
1500 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1502 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1503 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1505 DSO_LDOPTS='-shared'
1506 if test "$GNU_LD"; then
1507 # Don't allow undefined symbols in libraries
1508 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1512 DSO_PIC_CFLAGS='-KPIC'
1513 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1516 if test "$GNU_CXX"; then
1517 # FIXME: Let us build with strict aliasing. bug 414641.
1518 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1519 # Turn on GNU specific features
1520 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1521 if test -z "$INTEL_CC"; then
1522 # Don't use -Wcast-align with ICC
1524 # And don't use it on hppa, ia64, sparc, since it's noisy there
1525 hppa | ia64 | sparc)
1528 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1533 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1534 _USE_CPP_INCLUDE_FLAG=1
1536 AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1537 ac_has_wno_invalid_offsetof,
1541 _SAVE_CXXFLAGS="$CXXFLAGS"
1542 CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1545 ac_has_wno_invalid_offsetof="yes",
1546 ac_has_wno_invalid_offsetof="no")
1547 CXXFLAGS="$_SAVE_CXXFLAGS"
1550 if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1551 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1554 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1557 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1558 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1559 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1560 dnl normal behavior.
1561 dnl ========================================================
1563 MKSHLIB_UNFORCE_ALL=
1565 if test "$COMPILE_ENVIRONMENT"; then
1566 if test "$GNU_CC"; then
1567 AC_MSG_CHECKING(whether ld has archive extraction flags)
1568 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1569 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1570 ac_cv_mkshlib_force_and_unforce="no"
1571 exec 3<&0 <<LOOP_INPUT
1572 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1573 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1574 force="-Wl,-all"; unforce="-Wl,-none"
1581 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1584 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1586 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1590 eval $ac_cv_mkshlib_force_and_unforce
1591 MKSHLIB_FORCE_ALL=$force
1592 MKSHLIB_UNFORCE_ALL=$unforce
1595 fi # COMPILE_ENVIRONMENT
1597 dnl =================================================================
1598 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1599 dnl which is bad when cross compiling.
1600 dnl =================================================================
1601 if test "$COMPILE_ENVIRONMENT"; then
1602 configure_static_assert_macros='
1603 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1604 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1605 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1608 dnl test that the macros actually work:
1609 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1610 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1613 ac_cv_static_assertion_macros_work="yes"
1614 AC_TRY_COMPILE([$configure_static_assert_macros],
1615 [CONFIGURE_STATIC_ASSERT(1)],
1617 ac_cv_static_assertion_macros_work="no")
1618 AC_TRY_COMPILE([$configure_static_assert_macros],
1619 [CONFIGURE_STATIC_ASSERT(0)],
1620 ac_cv_static_assertion_macros_work="no",
1623 AC_TRY_COMPILE([$configure_static_assert_macros],
1624 [CONFIGURE_STATIC_ASSERT(1)],
1626 ac_cv_static_assertion_macros_work="no")
1627 AC_TRY_COMPILE([$configure_static_assert_macros],
1628 [CONFIGURE_STATIC_ASSERT(0)],
1629 ac_cv_static_assertion_macros_work="no",
1633 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1634 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1635 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1637 fi # COMPILE_ENVIRONMENT
1639 dnl ========================================================
1640 dnl Checking for 64-bit OS
1641 dnl ========================================================
1642 if test "$COMPILE_ENVIRONMENT"; then
1645 AC_MSG_CHECKING(for 64-bit OS)
1646 AC_TRY_COMPILE([$configure_static_assert_macros],
1647 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1648 result="yes", result="no")
1649 AC_MSG_RESULT("$result")
1650 if test "$result" = "yes"; then
1651 AC_DEFINE(HAVE_64BIT_OS)
1654 AC_SUBST(HAVE_64BIT_OS)
1656 fi # COMPILE_ENVIRONMENT
1658 dnl ========================================================
1659 dnl Enable high-memory support on OS/2 by default.
1660 dnl ========================================================
1661 MOZ_OS2_HIGH_MEMORY=1
1662 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1663 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1664 MOZ_OS2_HIGH_MEMORY=,
1665 MOZ_OS2_HIGH_MEMORY=1 )
1666 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1668 dnl ========================================================
1669 dnl System overrides of the defaults for host
1670 dnl ========================================================
1673 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1674 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1675 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1678 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1679 # we need Python 2.5 on Windows
1681 if test -n "$_WIN32_MSVC"; then
1683 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1684 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1685 HOST_RANLIB='echo ranlib'
1687 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1689 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1690 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1691 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1692 HOST_BIN_SUFFIX=.exe
1695 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1698 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1699 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1701 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1703 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1705 PERL="${CYGWIN_WRAPPER} $PERL"
1708 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1709 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1716 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1717 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1718 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1719 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1722 *-linux*|*-kfreebsd*-gnu)
1723 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1724 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1725 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1729 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1730 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1731 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1732 HOST_BIN_SUFFIX=.exe
1737 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1738 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1739 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1743 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1744 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1748 dnl We require version 2.4 or newer of Python to build,
1749 dnl and 2.5 or newer on Windows.
1750 AC_MSG_CHECKING([for minimum required Python version >= $PYTHON_VERSION])
1752 $PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION
1755 if test "$_python_res" != 0; then
1756 AC_MSG_ERROR([Python $PYTHON_VERSION or higher is required.])
1758 AC_MSG_RESULT([yes])
1760 dnl Get mozilla version from central milestone file
1761 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1763 dnl Get version of various core apps from the version files.
1764 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1766 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1767 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1769 dnl ========================================================
1770 dnl System overrides of the defaults for target
1771 dnl ========================================================
1776 if test ! "$GNU_CC"; then
1777 if test ! "$HAVE_64BIT_OS"; then
1778 # Compiling with Visual Age C++ object model compat is the
1779 # default. To compile with object model ibm, add
1780 # AIX_OBJMODEL=ibm to .mozconfig.
1781 if test "$AIX_OBJMODEL" = "ibm"; then
1782 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1789 AC_SUBST(AIX_OBJMODEL)
1790 DSO_LDOPTS='-qmkshrobj=1'
1791 DSO_CFLAGS='-qflag=w:w'
1793 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1794 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1796 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1797 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1798 if test "$COMPILE_ENVIRONMENT"; then
1801 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
1803 [#if (__IBMCPP__ < 600)
1804 #error "Bad compiler"
1806 _BAD_COMPILER=,_BAD_COMPILER=1)
1807 if test -n "$_BAD_COMPILER"; then
1809 AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
1811 AC_MSG_RESULT([yes])
1814 TARGET_COMPILER_ABI="ibmc"
1815 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1816 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1819 case "${target_os}" in
1824 if test "$COMPILE_ENVIRONMENT"; then
1825 AC_CHECK_HEADERS(sys/inttypes.h)
1827 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1832 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1833 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1834 DSO_LDOPTS='-nostart'
1835 TK_LIBS='-lbe -lroot'
1837 if test "$COMPILE_ENVIRONMENT"; then
1838 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1839 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1841 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1842 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1845 MOZ_USER_DIR="Mozilla"
1849 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1851 _IGNORE_LONG_LONG_WARNINGS=
1859 _WARNINGS_CFLAGS="-Wall"
1860 _WARNINGS_CXXFLAGS="-Wall"
1861 # The test above doesn't work properly, at least on 3.1.
1862 MKSHLIB_FORCE_ALL=''
1863 MKSHLIB_UNFORCE_ALL=''
1869 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1870 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1871 MOZ_OPTIMIZE_FLAGS="-O3"
1873 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1874 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1877 STRIP="$STRIP -x -S"
1878 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1879 MOZ_ENABLE_POSTSCRIPT=
1880 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1881 # The ExceptionHandling framework is needed for Objective-C exception
1882 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1884 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1886 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1887 dnl ===================================================================
1888 if test "x$enable_dtrace" = "xyes"; then
1889 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1891 dnl check for the presence of the -dead_strip linker flag
1892 AC_MSG_CHECKING([for -dead_strip option to ld])
1893 _SAVE_LDFLAGS=$LDFLAGS
1894 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1895 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1896 if test -n "$_HAVE_DEAD_STRIP" ; then
1897 AC_MSG_RESULT([yes])
1898 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1903 LDFLAGS=$_SAVE_LDFLAGS
1908 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1909 DLL_SUFFIX=".so.1.0"
1910 DSO_LDOPTS="-shared"
1912 if test ! "$GNU_CC"; then
1913 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1915 # Can't have force w/o an unforce.
1916 # # Hack for FreeBSD 2.2
1917 # if test -z "$MKSHLIB_FORCE_ALL"; then
1918 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1919 # MKSHLIB_UNFORCE_ALL=''
1925 if test ! "$GNU_CC"; then
1926 DSO_LDOPTS='-b -Wl,+s'
1929 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1930 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1931 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1933 DSO_LDOPTS='-b -E +s'
1934 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1935 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1937 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1938 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1943 DSO_LDOPTS='-elf -shared'
1945 if test "$GNU_CC"; then
1946 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1947 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1948 MKSHLIB_FORCE_ALL='-Wl,-all'
1949 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1950 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1952 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1953 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1954 MKSHLIB_FORCE_ALL='-all'
1955 MKSHLIB_UNFORCE_ALL='-none'
1961 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1962 dnl compile and link using -n32
1964 TARGET_COMPILER_ABI=n32
1965 DSO_LDOPTS='-elf -shared'
1966 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1967 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1968 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1969 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1970 if test "$GNU_CC"; then
1971 MKSHLIB_FORCE_ALL='-Wl,-all'
1972 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1973 _WARNINGS_CFLAGS="-Wall"
1974 _WARNINGS_CXXFLAGS="-Wall"
1975 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1977 MKSHLIB_FORCE_ALL='-all'
1978 MKSHLIB_UNFORCE_ALL='-none'
1984 CFLAGS="$CFLAGS -woff 3262 -G 4"
1985 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1986 if test -n "$USE_N32"; then
1987 ASFLAGS="$ASFLAGS -n32"
1988 CFLAGS="$CFLAGS -n32"
1989 CXXFLAGS="$CXXFLAGS -n32"
1990 LDFLAGS="$LDFLAGS -n32"
1992 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1993 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1996 if test -z "$GNU_CXX"; then
2002 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
2003 # Similarly for GNU_CXX and INTEL_CXX.
2004 if test "$INTEL_CC" || test "$INTEL_CXX"; then
2005 # -Os has been broken on Intel's C/C++ compilers for quite a
2006 # while; Intel recommends against using it.
2007 MOZ_OPTIMIZE_FLAGS="-O2"
2008 MOZ_DEBUG_FLAGS="-g -fno-inline"
2009 elif test "$GNU_CC" || test "$GNU_CXX"; then
2010 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2011 case $GCC_VERSION in
2013 # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
2014 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
2016 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
2017 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
2018 # and that combo is not yet good at
2019 # debugging inlined functions (even
2020 # when using DWARF2 as the debugging
2024 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2028 case "${target_cpu}" in
2030 CFLAGS="$CFLAGS -mieee"
2031 CXXFLAGS="$CXXFLAGS -mieee"
2035 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
2038 MOZ_DEBUG_FLAGS="-g" # We want inlining
2045 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
2047 AR_EXTRACT="$AR -extract"
2049 AR_FLAGS='-OUT:"$@"'
2051 if test "$AS_BIN"; then
2058 if test -z "$RC"; then
2061 # certain versions of cygwin's makedepend barf on the
2062 # #include <string> vs -I./dist/include/string issue so don't use it
2068 HOST_AR='lib -OUT:$@'
2069 HOST_RANLIB='echo ranlib'
2070 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
2073 WARNINGS_AS_ERRORS='-WX'
2074 MOZ_OPTIMIZE_FLAGS='-Ox'
2075 AR_FLAGS='-NOLOGO -OUT:"$@"'
2077 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2078 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2081 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
2082 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2084 IMPORT_LIB_SUFFIX=lib
2086 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2089 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2090 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2092 MKSHLIB_UNFORCE_ALL=
2093 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2094 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2095 MOZ_DEBUG_FLAGS='-Zi'
2096 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2098 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2099 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2101 RANLIB='echo not_ranlib'
2102 STRIP='echo not_strip'
2103 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
2106 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2108 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
2109 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
2113 AC_DEFINE(HAVE_SNPRINTF)
2119 AC_DEFINE(HW_THREADS)
2120 AC_DEFINE(STDC_HEADERS)
2121 AC_DEFINE(NEW_H, <new>)
2122 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2123 AC_DEFINE(HAVE_LOCALTIME_R)
2125 TARGET_MD_ARCH=win32
2126 _PLATFORM_DEFAULT_TOOLKIT='windows'
2129 MOZ_ENABLE_POSTSCRIPT=
2130 MOZ_USER_DIR="Mozilla"
2132 MOZ_GFX_OPTIMIZE_MOBILE=1
2134 # Sanity check for WINCE_WINDOWS_MOBILE
2135 # XXX disabled until we can fix the mobile tinderbox
2136 ##if test "$WINCE_WINDOWS_MOBILE"; then
2137 ## AC_CHECK_HEADER(tpcshell.h, [],
2138 ## AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
2143 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2148 # certain versions of cygwin's makedepend barf on the
2149 # #include <string> vs -I./dist/include/string issue so don't use it
2151 if test -n "$GNU_CC"; then
2152 CC="$CC -mno-cygwin"
2153 CXX="$CXX -mno-cygwin"
2154 CPP="$CPP -mno-cygwin"
2155 CFLAGS="$CFLAGS -mms-bitfields"
2156 CXXFLAGS="$CXXFLAGS -mms-bitfields"
2157 DSO_LDOPTS='-shared'
2158 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2159 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2161 # Use temp file for windres (bug 213281)
2162 RCFLAGS='-O coff --use-temp-file'
2163 # mingw doesn't require kernel32, user32, and advapi32 explicitly
2164 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
2165 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
2167 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
2168 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
2170 IMPORT_LIB_SUFFIX=dll.a
2172 TARGET_COMPILER_ABI=msvc
2176 AR='lib -NOLOGO -OUT:"$@"'
2178 RANLIB='echo not_ranlib'
2179 STRIP='echo not_strip'
2184 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2189 IMPORT_LIB_SUFFIX=lib
2190 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2191 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2193 MKSHLIB_UNFORCE_ALL=
2194 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2195 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2196 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2197 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2198 MOZ_DEBUG_FLAGS='-Zi'
2199 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2200 WARNINGS_AS_ERRORS='-WX'
2201 MOZ_OPTIMIZE_FLAGS='-O1'
2202 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2204 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2205 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2206 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2207 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2208 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2209 if test $_MSC_VER -ge 1400; then
2210 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
2211 dnl For profile-guided optimization
2212 PROFILE_GEN_CFLAGS="-GL"
2213 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2214 dnl XXX: PGO builds can fail with warnings treated as errors,
2215 dnl specifically "no profile data available" appears to be
2216 dnl treated as an error sometimes. This might be a consequence
2217 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2218 dnl with the linker doing most of the work in the whole-program
2219 dnl optimization/PGO case. I think it's probably a compiler bug,
2220 dnl but we work around it here.
2221 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2222 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2223 dnl Probably also a compiler bug, but what can you do?
2224 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2225 if test -n "$_USE_DYNAMICBASE"; then
2226 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2230 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2231 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2232 AC_DEFINE(HAVE_SNPRINTF)
2238 AC_DEFINE(HW_THREADS)
2239 AC_DEFINE(STDC_HEADERS)
2240 AC_DEFINE(NEW_H, <new>)
2241 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2242 TARGET_MD_ARCH=win32
2243 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2246 MOZ_ENABLE_POSTSCRIPT=
2247 MOZ_USER_DIR="Mozilla"
2249 dnl Hardcode to win95 for now - cls
2250 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2252 dnl set NO_X11 defines here as the general check is skipped on win32
2256 dnl MinGW/MSYS doesn't provide or need cygpath
2261 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2263 *-cygwin*|*-msvc*|*-mks*)
2264 CYGPATH_W="cygpath -a -w"
2265 CYGPATH_S="sed -e s|\\\\|/|g"
2266 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2270 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2272 if test -z "$MOZ_TOOLS"; then
2273 AC_MSG_ERROR([MOZ_TOOLS is not set])
2276 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2277 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2278 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2280 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2281 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2282 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2284 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2286 if test -n "$GLIB_PREFIX"; then
2287 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
2288 if test "$?" = "0"; then
2289 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
2290 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
2292 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
2294 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
2297 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
2299 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
2300 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
2302 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
2303 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
2304 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
2305 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
2306 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
2308 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
2311 if test -n "$LIBIDL_PREFIX"; then
2312 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd -W`
2313 if test "$?" = "0"; then
2314 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2315 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2317 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2319 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2322 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2324 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2325 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2327 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2328 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2329 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2331 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2332 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2334 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2336 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2339 *) # else cross-compiling
2340 if test -n "$GLIB_PREFIX"; then
2341 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2342 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2343 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2344 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2345 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2347 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2350 if test -n "$LIBIDL_PREFIX"; then
2351 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2352 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2353 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2355 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2356 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2358 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2361 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2368 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])
2372 AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
2376 AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2392 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2399 CFLAGS="$CFLAGS -Dunix"
2400 CXXFLAGS="$CXXFLAGS -Dunix"
2401 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2403 DSO_PIC_CFLAGS='-fPIC -DPIC'
2404 DSO_LDOPTS='-shared'
2405 BIN_FLAGS='-Wl,--export-dynamic'
2407 DSO_PIC_CFLAGS='-fPIC -DPIC'
2408 DLL_SUFFIX=".so.1.0"
2409 DSO_LDOPTS='-shared'
2411 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2412 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2413 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2414 if test "$LIBRUNPATH"; then
2415 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2417 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2418 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2423 AC_DEFINE(_QNX_SOURCE)
2426 WARNINGS_AS_ERRORS=''
2427 MOZ_OPTIMIZE_FLAGS="-O"
2428 MOZ_DEBUG_FLAGS="-gstabs"
2431 LIBS="$LIBS -lsocket -lstdc++"
2432 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2433 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2434 if test "$with_x" != "yes"
2436 _PLATFORM_DEFAULT_TOOLKIT="photon"
2437 TK_CFLAGS='-I/usr/include/photon'
2440 case "${target_cpu}" in
2442 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2445 case "${host_cpu}" in
2453 DLL_SUFFIX=".so.1.0"
2455 DSO_PIC_CFLAGS='-fPIC'
2456 DSO_LDOPTS='-shared -fPIC'
2457 if test "$LIBRUNPATH"; then
2458 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2463 AC_DEFINE(NO_PW_GECOS)
2464 AC_DEFINE(NO_UDSOCK)
2465 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2467 MKSHLIB_FORCE_ALL='-all'
2468 MKSHLIB_UNFORCE_ALL='-none'
2470 AS_DASH_C_FLAG='-Wc/names=as_is'
2472 DSO_LDOPTS='-shared -auto_symvec'
2474 MOZ_DEBUG_LDFLAGS='-g'
2476 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2477 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2482 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2483 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2486 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2487 AC_DEFINE(TCPV40HDRS)
2494 IMPORT_LIB_SUFFIX=lib
2498 CFLAGS="$CFLAGS -Zomf"
2499 CXXFLAGS="$CXXFLAGS -Zomf"
2501 BIN_FLAGS='-Zlinker /ST:0x100000'
2505 WARNINGS_AS_ERRORS='-Werror'
2506 MOZ_DEBUG_FLAGS="-g -fno-inline"
2507 MOZ_OPTIMIZE_FLAGS="-O2"
2508 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2509 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2510 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2511 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2513 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2514 MOZ_ENABLE_POSTSCRIPT=
2517 MOZ_USER_DIR="Mozilla"
2519 if test "$MOZTOOLS"; then
2520 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2522 AC_MSG_ERROR([MOZTOOLS is not set])
2524 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2525 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2526 LDFLAGS="$LDFLAGS -Zhigh-mem"
2527 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2528 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2531 # GCC for OS/2 currently predefines these, but we don't want them
2532 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2533 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2535 AC_CACHE_CHECK(for __declspec(dllexport),
2537 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2539 ac_os2_declspec="yes",
2540 ac_os2_declspec="no")])
2541 if test "$ac_os2_declspec" = "yes"; then
2543 MOZ_OS2_USE_DECLSPEC='1'
2548 if test "$GNU_CC"; then
2549 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2550 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2553 MOZ_DEBUG_FLAGS='-g'
2554 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2555 CFLAGS="$CFLAGS -ieee"
2556 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2557 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2560 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2561 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2562 MKSHLIB_FORCE_ALL='-all'
2563 MKSHLIB_UNFORCE_ALL='-none'
2564 dnl Might fix the libxpcom.so breakage on this platform as well....
2565 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2566 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2568 if test -z "$GNU_CXX"; then
2571 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2575 DIRENT_INO=d_stat.st_ino
2576 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2577 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2578 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2579 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2580 AC_DEFINE(STDC_HEADERS)
2581 if test "$no_x" = "yes"; then
2582 _PLATFORM_DEFAULT_TOOLKIT='photon'
2583 TK_CFLAGS='-I/usr/nto/include/photon'
2584 TK_LIBS='-lphoton -lphrender'
2589 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2590 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2591 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2592 if test ! "$GNU_CC"; then
2597 dnl the qsort routine under solaris is faulty
2600 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2602 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2603 # libraries one level up (e.g. libnspr4.so)
2604 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2606 if test "$SOLARIS_SUNPRO_CC"; then
2607 LIBS="-lCrun -lCstd $LIBS"
2610 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2611 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2612 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2613 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2614 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2615 _SAVE_LDFLAGS=$LDFLAGS
2616 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2617 AC_TRY_LINK([#include <stdio.h>],
2618 [printf("Hello World\n");],
2620 [LDFLAGS=$_SAVE_LDFLAGS])
2622 WARNINGS_AS_ERRORS='-Werror'
2623 MOZ_OPTIMIZE_FLAGS="-xO4"
2624 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2625 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2626 MKSHLIB_FORCE_ALL='-z allextract'
2627 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2628 DSO_LDOPTS='-G -z muldefs'
2634 AS='/usr/ccs/bin/as'
2635 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2637 TARGET_COMPILER_ABI="sunc"
2638 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2639 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2640 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2644 [#if (__SUNPRO_CC < 0x590)
2647 _BAD_COMPILER=,_BAD_COMPILER=1)
2648 if test -n "$_BAD_COMPILER"; then
2650 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2654 AC_MSG_RESULT([$_res])
2657 ASFLAGS="$ASFLAGS -fPIC"
2660 _WARNINGS_CXXFLAGS=''
2661 if test "$OS_RELEASE" = "5.3"; then
2662 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2665 if test "$OS_RELEASE" = "5.5.1"; then
2666 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2671 DSO_LDOPTS='-Bdynamic'
2672 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2673 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2675 AC_DEFINE(SPRINTF_RETURNS_STRING)
2676 case "$(target_os)" in
2678 DLL_SUFFIX='.so.1.0'
2684 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2688 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2693 dnl Only one oddball right now (QNX), but this gives us flexibility
2694 dnl if any other platforms need to override this in the future.
2695 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2697 dnl ========================================================
2698 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2699 dnl by now will not have any way to link most binaries (tests
2700 dnl as well as viewer, apprunner, etc.), because some symbols
2701 dnl will be left out of the "composite" .so's by ld as unneeded.
2702 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2703 dnl they can link in the static libs that provide the missing
2705 dnl ========================================================
2706 NO_LD_ARCHIVE_FLAGS=
2707 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2708 NO_LD_ARCHIVE_FLAGS=1
2712 NO_LD_ARCHIVE_FLAGS=
2715 NO_LD_ARCHIVE_FLAGS=
2718 NO_LD_ARCHIVE_FLAGS=
2720 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2721 if test -z "$GNU_CC"; then
2722 NO_LD_ARCHIVE_FLAGS=
2726 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2728 dnl ========================================================
2729 dnl = Flags to strip unused symbols from .so components
2730 dnl ========================================================
2732 *-linux*|*-kfreebsd*-gnu)
2733 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2736 if test -z "$GNU_CC"; then
2737 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2739 if test -z "$GCC_USE_GNU_LD"; then
2740 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2742 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2747 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2750 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2752 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2753 if test -n "$GNU_CC"; then
2754 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2759 if test -z "$COMPILE_ENVIRONMENT"; then
2760 SKIP_COMPILER_CHECKS=1
2761 SKIP_LIBRARY_CHECKS=1
2764 if test -z "$SKIP_COMPILER_CHECKS"; then
2765 dnl Checks for typedefs, structures, and compiler characteristics.
2766 dnl ========================================================
2774 AC_STRUCT_ST_BLKSIZE
2775 AC_MSG_CHECKING(for siginfo_t)
2776 AC_CACHE_VAL(ac_cv_siginfo_t,
2777 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2778 #include <signal.h>],
2780 [ac_cv_siginfo_t=true],
2781 [ac_cv_siginfo_t=false])])
2782 if test "$ac_cv_siginfo_t" = true ; then
2783 AC_DEFINE(HAVE_SIGINFO_T)
2789 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2790 dnl ========================================================
2791 AC_MSG_CHECKING(for int16_t)
2792 AC_CACHE_VAL(ac_cv_int16_t,
2793 [AC_TRY_COMPILE([#include <stdio.h>
2794 #include <sys/types.h>],
2796 [ac_cv_int16_t=true],
2797 [ac_cv_int16_t=false])])
2798 if test "$ac_cv_int16_t" = true ; then
2799 AC_DEFINE(HAVE_INT16_T)
2804 AC_MSG_CHECKING(for int32_t)
2805 AC_CACHE_VAL(ac_cv_int32_t,
2806 [AC_TRY_COMPILE([#include <stdio.h>
2807 #include <sys/types.h>],
2809 [ac_cv_int32_t=true],
2810 [ac_cv_int32_t=false])])
2811 if test "$ac_cv_int32_t" = true ; then
2812 AC_DEFINE(HAVE_INT32_T)
2817 AC_MSG_CHECKING(for int64_t)
2818 AC_CACHE_VAL(ac_cv_int64_t,
2819 [AC_TRY_COMPILE([#include <stdio.h>
2820 #include <sys/types.h>],
2822 [ac_cv_int64_t=true],
2823 [ac_cv_int64_t=false])])
2824 if test "$ac_cv_int64_t" = true ; then
2825 AC_DEFINE(HAVE_INT64_T)
2830 AC_MSG_CHECKING(for int64)
2831 AC_CACHE_VAL(ac_cv_int64,
2832 [AC_TRY_COMPILE([#include <stdio.h>
2833 #include <sys/types.h>],
2836 [ac_cv_int64=false])])
2837 if test "$ac_cv_int64" = true ; then
2838 AC_DEFINE(HAVE_INT64)
2843 AC_MSG_CHECKING(for uint)
2844 AC_CACHE_VAL(ac_cv_uint,
2845 [AC_TRY_COMPILE([#include <stdio.h>
2846 #include <sys/types.h>],
2849 [ac_cv_uint=false])])
2850 if test "$ac_cv_uint" = true ; then
2851 AC_DEFINE(HAVE_UINT)
2856 AC_MSG_CHECKING(for uint_t)
2857 AC_CACHE_VAL(ac_cv_uint_t,
2858 [AC_TRY_COMPILE([#include <stdio.h>
2859 #include <sys/types.h>],
2861 [ac_cv_uint_t=true],
2862 [ac_cv_uint_t=false])])
2863 if test "$ac_cv_uint_t" = true ; then
2864 AC_DEFINE(HAVE_UINT_T)
2869 AC_MSG_CHECKING(for uint16_t)
2870 AC_CACHE_VAL(ac_cv_uint16_t,
2871 [AC_TRY_COMPILE([#include <stdio.h>
2872 #include <sys/types.h>],
2873 [uint16_t foo = 0;],
2874 [ac_cv_uint16_t=true],
2875 [ac_cv_uint16_t=false])])
2876 if test "$ac_cv_uint16_t" = true ; then
2877 AC_DEFINE(HAVE_UINT16_T)
2883 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2884 dnl are defined when compiling C++ but not C. Since the result of this
2885 dnl test is used only in C++, do it in C++.
2888 AC_MSG_CHECKING(for uname.domainname)
2889 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2890 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2891 [ struct utsname *res; char *domain;
2892 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2893 [ac_cv_have_uname_domainname_field=true],
2894 [ac_cv_have_uname_domainname_field=false])])
2896 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2897 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2903 AC_MSG_CHECKING(for uname.__domainname)
2904 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2905 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2906 [ struct utsname *res; char *domain;
2907 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2908 [ac_cv_have_uname_us_domainname_field=true],
2909 [ac_cv_have_uname_us_domainname_field=false])])
2911 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2912 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2920 dnl Check for usable wchar_t (2 bytes, unsigned)
2921 dnl (we really don't need the unsignedness check anymore)
2922 dnl ========================================================
2924 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2925 ac_cv_have_usable_wchar_v2,
2926 [AC_TRY_COMPILE([#include <stddef.h>
2927 $configure_static_assert_macros],
2928 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2929 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2930 ac_cv_have_usable_wchar_v2="yes",
2931 ac_cv_have_usable_wchar_v2="no")])
2932 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2933 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2934 HAVE_CPP_2BYTE_WCHAR_T=1
2936 dnl This is really gcc-only
2937 dnl Do this test using CXX only since some versions of gcc
2938 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2939 dnl only have short-wchar support for c++.
2940 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2944 _SAVE_CXXFLAGS=$CXXFLAGS
2945 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2947 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2948 ac_cv_have_usable_wchar_option_v2,
2949 [AC_TRY_LINK([#include <stddef.h>
2950 $configure_static_assert_macros],
2951 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2952 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2953 ac_cv_have_usable_wchar_option_v2="yes",
2954 ac_cv_have_usable_wchar_option_v2="no")])
2956 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2957 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2958 HAVE_CPP_2BYTE_WCHAR_T=1
2959 WCHAR_CFLAGS="-fshort-wchar"
2961 CXXFLAGS=$_SAVE_CXXFLAGS
2966 dnl Check for .hidden assembler directive and visibility attribute.
2967 dnl Borrowed from glibc configure.in
2968 dnl ===============================================================
2969 if test "$GNU_CC"; then
2970 AC_CACHE_CHECK(for visibility(hidden) attribute,
2971 ac_cv_visibility_hidden,
2972 [cat > conftest.c <<EOF
2973 int foo __attribute__ ((visibility ("hidden"))) = 1;
2975 ac_cv_visibility_hidden=no
2976 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2977 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2978 ac_cv_visibility_hidden=yes
2983 if test "$ac_cv_visibility_hidden" = "yes"; then
2984 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2986 AC_CACHE_CHECK(for visibility(default) attribute,
2987 ac_cv_visibility_default,
2988 [cat > conftest.c <<EOF
2989 int foo __attribute__ ((visibility ("default"))) = 1;
2991 ac_cv_visibility_default=no
2992 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2993 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2994 ac_cv_visibility_default=yes
2999 if test "$ac_cv_visibility_default" = "yes"; then
3000 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
3002 AC_CACHE_CHECK(for visibility pragma support,
3003 ac_cv_visibility_pragma,
3004 [cat > conftest.c <<EOF
3005 #pragma GCC visibility push(hidden)
3007 #pragma GCC visibility push(default)
3008 int foo_default = 1;
3010 ac_cv_visibility_pragma=no
3011 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3012 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
3013 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
3014 ac_cv_visibility_pragma=yes
3020 if test "$ac_cv_visibility_pragma" = "yes"; then
3021 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
3022 ac_cv_have_visibility_class_bug,
3023 [cat > conftest.c <<EOF
3024 #pragma GCC visibility push(hidden)
3025 struct __attribute__ ((visibility ("default"))) TestStruct {
3028 __attribute__ ((visibility ("default"))) void TestFunc() {
3032 ac_cv_have_visibility_class_bug=no
3033 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3034 ac_cv_have_visibility_class_bug=yes
3036 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
3037 ac_cv_have_visibility_class_bug=yes
3040 rm -rf conftest.{c,S}
3043 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
3044 ac_cv_have_visibility_builtin_bug,
3045 [cat > conftest.c <<EOF
3046 #pragma GCC visibility push(hidden)
3047 #pragma GCC visibility push(default)
3049 #pragma GCC visibility pop
3051 __attribute__ ((visibility ("default"))) void Func() {
3053 memset(c, 0, sizeof(c));
3056 ac_cv_have_visibility_builtin_bug=no
3057 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3058 ac_cv_have_visibility_builtin_bug=yes
3060 if test `grep -c "@PLT" conftest.S` = 0; then
3061 ac_cv_visibility_builtin_bug=yes
3064 rm -f conftest.{c,S}
3066 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
3067 "$ac_cv_have_visibility_class_bug" = "no"; then
3068 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
3069 WRAP_SYSTEM_INCLUDES=1
3071 VISIBILITY_FLAGS='-fvisibility=hidden'
3072 fi # have visibility pragma bug
3073 fi # have visibility pragma
3074 fi # have visibility(default) attribute
3075 fi # have visibility(hidden) attribute
3078 # visibility hidden flag for Sun Studio on Solaris
3079 if test "$SOLARIS_SUNPRO_CC"; then
3080 VISIBILITY_FLAGS='-xldscope=hidden'
3081 fi # Sun Studio on Solaris
3083 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3084 AC_SUBST(VISIBILITY_FLAGS)
3086 dnl Checks for header files.
3087 dnl ========================================================
3089 case "$target_os" in
3091 # for stuff like -lXshm
3092 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3095 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3096 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3097 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3098 AC_CHECK_HEADERS(malloc.h)
3099 AC_CHECK_HEADERS(X11/XKBlib.h)
3100 AC_CHECK_HEADERS(io.h)
3102 dnl These are all the places some variant of statfs can be hiding.
3103 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3105 dnl Try for MMX support
3106 dnl NB - later gcc versions require -mmmx for this header to be successfully
3107 dnl included (or another option which implies it, such as -march=pentium-mmx)
3108 AC_CHECK_HEADERS(mmintrin.h)
3110 dnl Check whether the compiler supports the new-style C++ standard
3111 dnl library headers (i.e. <new>) or needs the old "new.h"
3114 AC_CHECK_HEADER(new, [NEW_H=new])
3115 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
3118 AC_ARG_ENABLE(dtrace,
3119 [ --enable-dtrace build with dtrace support if available (default=no)],
3120 [enable_dtrace="yes"],)
3121 if test "x$enable_dtrace" = "xyes"; then
3122 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
3123 if test -n "$HAVE_DTRACE"; then
3124 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3126 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3129 AC_SUBST(HAVE_DTRACE)
3135 AC_CHECK_HEADERS(sys/cdefs.h)
3139 dnl Checks for libraries.
3140 dnl ========================================================
3145 AC_CHECK_LIB(c_r, gethostbyname_r)
3149 dnl We don't want to link with libdl even if it's present on OS X, since
3150 dnl it's not used and not part of the default installation.
3151 dnl The same goes for BeOS.
3152 dnl We don't want to link against libm or libpthread on Darwin since
3153 dnl they both are just symlinks to libSystem and explicitly linking
3154 dnl against libSystem causes issues when debugging (see bug 299601).
3161 AC_CHECK_LIB(m, atan)
3162 AC_CHECK_LIB(dl, dlopen,
3163 AC_CHECK_HEADER(dlfcn.h,
3165 AC_DEFINE(HAVE_LIBDL)))
3169 _SAVE_CFLAGS="$CFLAGS"
3170 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3171 AC_CHECK_FUNCS(dladdr)
3172 CFLAGS="$_SAVE_CFLAGS"
3174 if test ! "$GNU_CXX"; then
3178 AC_CHECK_LIB(C_r, demangle)
3181 AC_CHECK_LIB(C, demangle)
3185 AC_CHECK_LIB(socket, socket)
3187 dnl ========================================================
3188 dnl Check whether we can compile code for Core Text
3189 dnl (Mac OS X 10.5 or later)
3190 dnl ========================================================
3193 AC_MSG_CHECKING([for Core Text])
3194 AC_TRY_COMPILE([#include <ApplicationServices/ApplicationServices.h>],
3195 [CTLineRef lineRef;],
3196 ac_cv_have_core_text="yes",
3197 ac_cv_have_core_text="no")
3198 AC_MSG_RESULT([$ac_cv_have_core_text])
3200 case "${target_cpu}" in
3206 MOZ_ARG_ENABLE_BOOL(coretext,
3207 [ --enable-coretext Use CoreText instead of ATSUI for text rendering],
3211 if test -n "$MOZ_CORETEXT"; then
3212 if test "$ac_cv_have_core_text" = "no"; then
3213 AC_MSG_ERROR([--enable-coretext requires MacOS SDK 10.5 or newer])
3215 AC_DEFINE(MOZ_CORETEXT)
3220 AC_SUBST(MOZ_CORETEXT)
3223 XLIBS="$X_EXTRA_LIBS"
3225 dnl ========================================================
3226 dnl Checks for X libraries.
3227 dnl Ordering is important.
3228 dnl Xt is dependent upon SM as of X11R6
3229 dnl ========================================================
3230 if test "$no_x" = "yes"; then
3233 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3234 XLIBS="-lX11 $XLIBS"
3235 _SAVE_LDFLAGS="$LDFLAGS"
3236 LDFLAGS="$XLDFLAGS $LDFLAGS"
3237 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3238 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3239 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3240 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3243 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3244 unset ac_cv_lib_Xt_XtFree
3245 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3246 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3247 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3248 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3251 # AIX needs the motif library linked before libXt to prevent
3252 # crashes in plugins linked against Motif - Bug #98892
3253 case "${target_os}" in
3255 XT_LIBS="-lXm $XT_LIBS"
3259 dnl ========================================================
3260 dnl = Check for XShm
3261 dnl ========================================================
3262 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3264 AC_CHECK_HEADER(X11/extensions/XShm.h)
3265 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3266 test -n "$_HAVE_XSHM_XEXT"; then
3267 AC_DEFINE(HAVE_XSHM)
3270 dnl ========================================================
3272 dnl ========================================================
3273 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3275 AC_CHECK_HEADER(X11/extensions/XIElib.h)
3277 if test "$MOZ_XIE_LIBS"; then
3278 dnl ====================================================
3279 dnl = If XIE is present and is desired, turn it on
3280 dnl ====================================================
3290 LDFLAGS="$_SAVE_LDFLAGS"
3292 dnl ========================================================
3293 dnl = Check for freetype2 and its functionality
3294 dnl ========================================================
3295 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3297 if test "$_HAVE_FREETYPE2"; then
3299 _SAVE_CFLAGS="$CFLAGS"
3300 LIBS="$LIBS $FT2_LIBS"
3301 CFLAGS="$CFLAGS $FT2_CFLAGS"
3303 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3304 ac_cv_member_FT_Bitmap_Size_y_ppem,
3305 [AC_TRY_COMPILE([#include <ft2build.h>
3306 #include FT_FREETYPE_H],
3308 if (sizeof s.y_ppem) return 0;
3310 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3311 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3312 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3313 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3315 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3317 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3318 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3319 [FT_Bitmap_Size structure includes y_ppem field])
3321 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3324 CFLAGS="$_SAVE_CFLAGS"
3335 AC_MSG_CHECKING(for ARM SIMD support in compiler)
3337 [asm("uqadd8 r1, r1, r2");],
3338 result="yes", result="no")
3339 AC_MSG_RESULT("$result")
3340 if test "$result" = "yes"; then
3341 AC_DEFINE(HAVE_ARM_SIMD)
3344 AC_SUBST(HAVE_ARM_SIMD)
3346 AC_MSG_CHECKING(for ARM NEON support in compiler)
3347 _SAVE_CFLAGS="$CFLAGS"
3348 if test "$GNU_CC"; then
3349 # gcc needs -mfpu=neon to recognize NEON instructions
3350 CFLAGS="$CFLAGS -mfpu=neon"
3353 [asm("vadd.i8 d0, d0, d0");],
3354 result="yes", result="no")
3355 AC_MSG_RESULT("$result")
3356 if test "$result" = "yes"; then
3357 AC_DEFINE(HAVE_ARM_NEON)
3360 CFLAGS="$_SAVE_CFLAGS"
3361 AC_SUBST(HAVE_ARM_NEON)
3363 dnl ========================================================
3364 dnl = pthread support
3365 dnl = Start by checking whether the system support pthreads
3366 dnl ========================================================
3367 case "$target_os" in
3372 MOZ_CHECK_PTHREADS(pthreads,
3373 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3374 MOZ_CHECK_PTHREADS(pthread,
3375 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3376 MOZ_CHECK_PTHREADS(c_r,
3377 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3378 MOZ_CHECK_PTHREADS(c,
3387 dnl ========================================================
3388 dnl Check the command line for --with-pthreads
3389 dnl ========================================================
3390 MOZ_ARG_WITH_BOOL(pthreads,
3391 [ --with-pthreads Force use of system pthread library with NSPR ],
3392 [ if test "$USE_PTHREADS"x = x; then
3393 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3399 dnl ========================================================
3400 dnl Do the platform specific pthread hackery
3401 dnl ========================================================
3402 if test "$USE_PTHREADS"x != x
3405 dnl See if -pthread is supported.
3408 ac_cv_have_dash_pthread=no
3409 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3410 echo 'int main() { return 0; }' | cat > conftest.c
3411 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3412 if test $? -eq 0; then
3413 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3414 ac_cv_have_dash_pthread=yes
3415 case "$target_os" in
3417 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3420 CFLAGS="$CFLAGS -pthread"
3421 CXXFLAGS="$CXXFLAGS -pthread"
3427 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3430 dnl See if -pthreads is supported.
3432 ac_cv_have_dash_pthreads=no
3433 if test "$ac_cv_have_dash_pthread" = "no"; then
3434 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3435 echo 'int main() { return 0; }' | cat > conftest.c
3436 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3437 if test $? -eq 0; then
3438 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3439 ac_cv_have_dash_pthreads=yes
3440 CFLAGS="$CFLAGS -pthreads"
3441 CXXFLAGS="$CXXFLAGS -pthreads"
3445 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3450 AC_DEFINE(_REENTRANT)
3451 AC_DEFINE(_THREAD_SAFE)
3452 dnl -pthread links in -lc_r, so don't specify it explicitly.
3453 if test "$ac_cv_have_dash_pthread" = "yes"; then
3454 _PTHREAD_LDFLAGS="-pthread"
3456 _PTHREAD_LDFLAGS="-lc_r"
3460 *-*-openbsd*|*-*-bsdi*)
3461 AC_DEFINE(_REENTRANT)
3462 AC_DEFINE(_THREAD_SAFE)
3463 dnl -pthread links in -lc_r, so don't specify it explicitly.
3464 if test "$ac_cv_have_dash_pthread" = "yes"; then
3465 _PTHREAD_LDFLAGS="-pthread"
3469 *-*-linux*|*-*-kfreebsd*-gnu)
3470 AC_DEFINE(_REENTRANT)
3474 AC_DEFINE(_REENTRANT)
3478 AC_DEFINE(_REENTRANT)
3482 AC_DEFINE(_REENTRANT)
3486 AC_DEFINE(_REENTRANT)
3490 AC_DEFINE(_REENTRANT)
3491 if test "$SOLARIS_SUNPRO_CC"; then
3492 CFLAGS="$CFLAGS -mt"
3493 CXXFLAGS="$CXXFLAGS -mt"
3497 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3500 dnl ========================================================
3501 dnl See if mmap sees writes
3502 dnl For cross compiling, just define it as no, which is a safe default
3503 dnl ========================================================
3504 AC_MSG_CHECKING(whether mmap() sees write()s)
3510 #include <sys/mman.h>
3511 #include <sys/types.h>
3512 #include <sys/stat.h>
3515 char fname[] = "conftest.file";
3516 char zbuff[1024]; /* Fractional page is probably worst case */
3523 fd = open(fname, O_RDWR | O_CREAT, 0660);
3526 write(fd, zbuff, sizeof(zbuff));
3527 lseek(fd, 0, SEEK_SET);
3528 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3529 if(map==(char*)-1) return 2;
3530 for(i=0; fname[i]; i++) {
3531 int rc = write(fd, &fname[i], 1);
3532 if(map[i]!=fname[i]) return 4;
3539 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3541 AC_MSG_RESULT("$result")
3543 if test "$result" = "no"; then
3544 AC_DEFINE(MMAP_MISSES_WRITES)
3548 dnl Checks for library functions.
3549 dnl ========================================================
3550 AC_PROG_GCC_TRADITIONAL
3552 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3553 AC_CHECK_FUNCS(flockfile getpagesize)
3554 AC_CHECK_FUNCS(localtime_r strtok_r)
3556 dnl check for wcrtomb/mbrtowc
3557 dnl =======================================================================
3558 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3561 AC_CACHE_CHECK(for wcrtomb,
3563 [AC_TRY_LINK([#include <wchar.h>],
3564 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3565 ac_cv_have_wcrtomb="yes",
3566 ac_cv_have_wcrtomb="no")])
3567 if test "$ac_cv_have_wcrtomb" = "yes"; then
3568 AC_DEFINE(HAVE_WCRTOMB)
3570 AC_CACHE_CHECK(for mbrtowc,
3572 [AC_TRY_LINK([#include <wchar.h>],
3573 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3574 ac_cv_have_mbrtowc="yes",
3575 ac_cv_have_mbrtowc="no")])
3576 if test "$ac_cv_have_mbrtowc" = "yes"; then
3577 AC_DEFINE(HAVE_MBRTOWC)
3584 ac_cv_func_res_ninit,
3587 #define _BSD_SOURCE 1
3591 [int foo = res_ninit(&_res);],
3592 [ac_cv_func_res_ninit=yes],
3593 [ac_cv_func_res_ninit=no])
3596 if test "$ac_cv_func_res_ninit" = "yes"; then
3597 AC_DEFINE(HAVE_RES_NINIT)
3598 dnl must add the link line we do something as foolish as this... dougt
3600 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3601 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3606 [for gnu_get_libc_version()],
3607 ac_cv_func_gnu_get_libc_version,
3609 #ifdef HAVE_GNU_LIBC_VERSION_H
3610 #include <gnu/libc-version.h>
3613 [const char *glibc_version = gnu_get_libc_version();],
3614 [ac_cv_func_gnu_get_libc_version=yes],
3615 [ac_cv_func_gnu_get_libc_version=no]
3619 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3620 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3624 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3628 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3629 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3630 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3632 LIBS="$LIBS $_ICONV_LIBS"
3641 iconv_t h = iconv_open("", "");
3642 iconv(h, NULL, NULL, NULL, NULL);
3645 [ac_cv_func_iconv=yes],
3646 [ac_cv_func_iconv=no]
3649 if test "$ac_cv_func_iconv" = "yes"; then
3650 AC_DEFINE(HAVE_ICONV)
3651 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3652 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3653 LIBICONV="$_ICONV_LIBS"
3655 [for iconv() with const input],
3656 ac_cv_func_const_iconv,
3662 const char *input = "testing";
3663 iconv_t h = iconv_open("", "");
3664 iconv(h, &input, NULL, NULL, NULL);
3667 [ac_cv_func_const_iconv=yes],
3668 [ac_cv_func_const_iconv=no]
3671 if test "$ac_cv_func_const_iconv" = "yes"; then
3672 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3684 dnl **********************
3685 dnl *** va_copy checks ***
3686 dnl **********************
3687 dnl we currently check for all three va_copy possibilities, so we get
3688 dnl all results in config.log for bug reports.
3689 AC_MSG_CHECKING(for an implementation of va_copy())
3690 AC_CACHE_VAL(ac_cv_va_copy,[
3693 void f (int i, ...) {
3694 va_list args1, args2;
3695 va_start (args1, i);
3696 va_copy (args2, args1);
3697 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3699 va_end (args1); va_end (args2);
3701 int main() { f (0, 42); return 0; }],
3707 AC_MSG_RESULT($ac_cv_va_copy)
3708 AC_MSG_CHECKING(for an implementation of __va_copy())
3709 AC_CACHE_VAL(ac_cv___va_copy,[
3712 void f (int i, ...) {
3713 va_list args1, args2;
3714 va_start (args1, i);
3715 __va_copy (args2, args1);
3716 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3718 va_end (args1); va_end (args2);
3720 int main() { f (0, 42); return 0; }],
3721 ac_cv___va_copy=yes,
3726 AC_MSG_RESULT($ac_cv___va_copy)
3727 AC_MSG_CHECKING(whether va_lists can be copied by value)
3728 AC_CACHE_VAL(ac_cv_va_val_copy,[
3731 void f (int i, ...) {
3732 va_list args1, args2;
3733 va_start (args1, i);
3735 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3737 va_end (args1); va_end (args2);
3739 int main() { f (0, 42); return 0; }],
3740 ac_cv_va_val_copy=yes,
3741 ac_cv_va_val_copy=no,
3742 ac_cv_va_val_copy=yes
3745 if test "x$ac_cv_va_copy" = "xyes"; then
3746 AC_DEFINE(VA_COPY, va_copy)
3747 AC_DEFINE(HAVE_VA_COPY)
3748 elif test "x$ac_cv___va_copy" = "xyes"; then
3749 AC_DEFINE(VA_COPY, __va_copy)
3750 AC_DEFINE(HAVE_VA_COPY)
3753 if test "x$ac_cv_va_val_copy" = "xno"; then
3754 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3756 AC_MSG_RESULT($ac_cv_va_val_copy)
3758 dnl Check for dll-challenged libc's.
3759 dnl This check is apparently only needed for Linux.
3762 dnl ===================================================================
3765 rm -rf conftest* _conftest
3767 cat >> conftest.C <<\EOF
3772 void __dump_link_map(void) {
3773 struct link_map *map = _dl_loaded;
3774 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3777 dlopen("./conftest1.so",RTLD_LAZY);
3778 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3779 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3780 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3784 /* _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).*/
3785 int main() { printf("./conftest1.so\n"); }
3789 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3791 cat >> conftest1.C <<\EOF
3793 void foo(void) {printf("foo in dll called\n");}
3795 ${CXX-g++} -fPIC -c -g conftest1.C
3796 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3797 ${CXX-g++} -g conftest.C -o conftest -ldl
3798 cp -f conftest1.so conftest _conftest
3800 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3803 echo "*** Your libc has a bug that can result in loading the same dynamic"
3804 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3805 echo "*** or later. However, if you choose not to upgrade, the only effect"
3806 echo "*** will be excessive memory usage at runtime."
3810 rm -rf conftest* _conftest
3811 dnl ===================================================================
3815 dnl ===================================================================
3816 dnl ========================================================
3817 dnl By default, turn rtti and exceptions off on g++/egcs
3818 dnl ========================================================
3819 if test "$GNU_CXX"; then
3821 AC_MSG_CHECKING(for C++ exceptions flag)
3823 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3824 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3825 [echo "int main() { return 0; }" | cat > conftest.C
3827 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3829 if egrep "warning.*renamed" conftest.out >/dev/null; then
3830 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3832 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3837 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3838 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3839 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3842 dnl ========================================================
3843 dnl Put your C++ language/feature checks below
3844 dnl ========================================================
3848 if test "$GNU_CC"; then
3849 AC_CACHE_CHECK(for gcc 3.0 ABI,
3850 ac_cv_gcc_three_abi,
3853 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3859 ac_cv_gcc_three_abi="yes",
3860 ac_cv_gcc_three_abi="no")])
3861 if test "$ac_cv_gcc_three_abi" = "yes"; then
3862 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3865 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3868 AC_SUBST(HAVE_GCC3_ABI)
3871 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3873 [AC_TRY_COMPILE(class X {
3874 public: explicit X(int i) : i_(i) {}
3878 ac_cv_cpp_explicit=yes,
3879 ac_cv_cpp_explicit=no)])
3880 if test "$ac_cv_cpp_explicit" = yes ; then
3881 AC_DEFINE(HAVE_CPP_EXPLICIT)
3884 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3886 [AC_TRY_COMPILE(class param {
3888 typedef unsigned long num_type;
3891 template <class T> class tplt {
3893 typedef typename T::num_type t_num_type;
3894 t_num_type foo(typename T::num_type num) {
3900 ac_cv_cpp_typename=yes,
3901 ac_cv_cpp_typename=no)])
3902 if test "$ac_cv_cpp_typename" = yes ; then
3903 AC_DEFINE(HAVE_CPP_TYPENAME)
3906 dnl Check for support of modern template specialization syntax
3907 dnl Test code and requirement from scc@netscape.com.
3908 dnl Autoconf cut-and-paste job by waterson@netscape.com
3909 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3910 ac_cv_cpp_modern_specialize_template_syntax,
3911 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3913 template <> struct X<Y> { double a; };,
3916 ac_cv_cpp_modern_specialize_template_syntax=yes,
3917 ac_cv_cpp_modern_specialize_template_syntax=no)])
3918 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3919 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3923 dnl Some compilers support only full specialization, and some don't.
3924 AC_CACHE_CHECK(whether partial template specialization works,
3925 ac_cv_cpp_partial_specialization,
3926 [AC_TRY_COMPILE(template <class T> class Foo {};
3927 template <class T> class Foo<T*> {};,
3929 ac_cv_cpp_partial_specialization=yes,
3930 ac_cv_cpp_partial_specialization=no)])
3931 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3932 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3935 dnl Some compilers have limited support for operators with templates;
3936 dnl specifically, it is necessary to define derived operators when a base
3937 dnl class's operator declaration should suffice.
3938 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3939 ac_cv_need_derived_template_operators,
3940 [AC_TRY_COMPILE([template <class T> class Base { };
3942 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3943 template <class T> class Derived : public Base<T> { };],
3944 [Derived<char> a, b;
3945 Base<char> c = a + b;
3947 ac_cv_need_derived_template_operators=no,
3948 ac_cv_need_derived_template_operators=yes)])
3949 if test "$ac_cv_need_derived_template_operators" = yes ; then
3950 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3954 dnl Some compilers have trouble detecting that a template class
3955 dnl that derives from another template is actually an instance
3956 dnl of the base class. This test checks for that.
3957 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3958 ac_cv_need_cpp_template_cast_to_base,
3959 [AC_TRY_COMPILE([template <class T> class Base { };
3960 template <class T> class Derived : public Base<T> { };
3961 template <class T> int foo(const Base<T>&) { return 0; }],
3962 [Derived<char> bar; return foo(bar);],
3963 ac_cv_need_cpp_template_cast_to_base=no,
3964 ac_cv_need_cpp_template_cast_to_base=yes)])
3965 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3966 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3969 dnl Some compilers have trouble resolving the ambiguity between two
3970 dnl functions whose arguments differ only by cv-qualifications.
3971 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3972 ac_cv_can_resolve_const_ambiguity,
3974 template <class T> class ptrClass {
3978 template <class T> T* a(ptrClass<T> *arg) {
3983 const T* a(const ptrClass<T> *arg) {
3989 ac_cv_can_resolve_const_ambiguity=yes,
3990 ac_cv_can_resolve_const_ambiguity=no)])
3991 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3992 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3996 dnl We don't do exceptions on unix. The only reason this used to be here
3997 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3998 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3999 dnl So im commenting this out until someone writes some artificial
4000 dnl intelligence to detect not only if the compiler has exceptions, but if
4001 dnl they are enabled as well.
4003 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
4004 dnl ac_cv_cpp_exceptions,
4005 dnl [AC_TRY_COMPILE(class X { public: X() {} };
4006 dnl static void F() { throw X(); },
4007 dnl try { F(); } catch(X & e) { },
4008 dnl ac_cv_cpp_exceptions=yes,
4009 dnl ac_cv_cpp_exceptions=no)])
4010 dnl if test $ac_cv_cpp_exceptions = yes ; then
4011 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
4014 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
4015 dnl supports it well enough to allow us to use it to change access, but not
4016 dnl to resolve ambiguity. The next two tests determine how well the |using|
4017 dnl keyword is supported.
4019 dnl Check to see if we can change access with |using|. Test both a
4020 dnl legal and an illegal example.
4021 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
4022 ac_cv_cpp_access_changing_using2,
4024 class A { protected: int foo() { return 0; } };
4025 class B : public A { public: using A::foo; };,
4026 B b; return b.foo();,
4028 class A { public: int foo() { return 1; } };
4029 class B : public A { private: using A::foo; };,
4030 B b; return b.foo();,
4031 ac_cv_cpp_access_changing_using2=no,
4032 ac_cv_cpp_access_changing_using2=yes)],
4033 ac_cv_cpp_access_changing_using2=no)])
4034 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
4035 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
4038 dnl Check to see if we can resolve ambiguity with |using|.
4039 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
4040 ac_cv_cpp_ambiguity_resolving_using,
4041 [AC_TRY_COMPILE(class X {
4042 public: int go(const X&) {return 3;}
4043 int jo(const X&) {return 3;}
4045 class Y : public X {
4046 public: int go(int) {return 2;}
4047 int jo(int) {return 2;}
4049 private: using X::go;
4052 ac_cv_cpp_ambiguity_resolving_using=yes,
4053 ac_cv_cpp_ambiguity_resolving_using=no)])
4054 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
4055 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
4058 dnl Check to see if the |std| namespace is supported. If so, we'll want
4059 dnl to qualify any standard library calls with "std::" to ensure that
4060 dnl those functions can be resolved.
4061 AC_CACHE_CHECK(for \"std::\" namespace,
4062 ac_cv_cpp_namespace_std,
4063 [AC_TRY_COMPILE([#include <algorithm>],
4064 [return std::min(0, 1);],
4065 ac_cv_cpp_namespace_std=yes,
4066 ac_cv_cpp_namespace_std=no)])
4067 if test "$ac_cv_cpp_namespace_std" = yes ; then
4068 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
4071 dnl Older compilers are overly ambitious with respect to using the standard
4072 dnl template library's |operator!=()| when |operator==()| is defined. In
4073 dnl which case, defining |operator!=()| in addition to |operator==()| causes
4074 dnl ambiguity at compile-time. This test checks for that case.
4075 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
4076 ac_cv_cpp_unambiguous_std_notequal,
4077 [AC_TRY_COMPILE([#include <algorithm>
4079 int operator==(const T1&, const T1&) { return 0; }
4080 int operator!=(const T1&, const T1&) { return 0; }],
4081 [T1 a,b; return a != b;],
4082 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
4083 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
4084 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
4085 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
4089 AC_CACHE_CHECK(for C++ reinterpret_cast,
4090 ac_cv_cpp_reinterpret_cast,
4091 [AC_TRY_COMPILE(struct X { int i; };
4092 struct Y { int i; };,
4093 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
4094 ac_cv_cpp_reinterpret_cast=yes,
4095 ac_cv_cpp_reinterpret_cast=no)])
4096 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
4097 AC_DEFINE(HAVE_CPP_NEW_CASTS)
4100 dnl See if a dynamic_cast to void* gives the most derived object.
4101 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
4102 ac_cv_cpp_dynamic_cast_void_ptr,
4103 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
4104 class Y { int j; public: virtual ~Y() { } };
4105 class Z : public X, public Y { int k; };
4111 return !((((void*)&mdo != (void*)subx) &&
4112 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
4113 (((void*)&mdo != (void*)suby) &&
4114 ((void*)&mdo == dynamic_cast<void*>(suby))));
4116 ac_cv_cpp_dynamic_cast_void_ptr=yes,
4117 ac_cv_cpp_dynamic_cast_void_ptr=no,
4118 ac_cv_cpp_dynamic_cast_void_ptr=no)])
4119 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
4120 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
4124 dnl note that this one is reversed - if the test fails, then
4125 dnl we require implementations of unused virtual methods. Which
4126 dnl really blows because it means we'll have useless vtable
4128 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
4129 ac_cv_cpp_unused_required,
4130 [AC_TRY_LINK(class X {private: virtual void never_called();};,
4132 ac_cv_cpp_unused_required=no,
4133 ac_cv_cpp_unused_required=yes)])
4134 if test "$ac_cv_cpp_unused_required" = yes ; then
4135 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
4139 dnl Some compilers have trouble comparing a constant reference to a templatized
4140 dnl class to zero, and require an explicit operator==() to be defined that takes
4141 dnl an int. This test separates the strong from the weak.
4143 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
4144 ac_cv_trouble_comparing_to_zero,
4145 [AC_TRY_COMPILE([#include <algorithm>
4146 template <class T> class Foo {};
4148 template <class T> int operator==(const T2*, const T&) { return 0; }
4149 template <class T> int operator!=(const T2*, const T&) { return 0; }],
4150 [Foo<int> f; return (0 != f);],
4151 ac_cv_trouble_comparing_to_zero=no,
4152 ac_cv_trouble_comparing_to_zero=yes)])
4153 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
4154 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
4159 dnl End of C++ language/feature checks
4162 dnl ========================================================
4163 dnl = Internationalization checks
4164 dnl ========================================================
4166 dnl Internationalization and Locale support is different
4167 dnl on various UNIX platforms. Checks for specific i18n
4168 dnl features go here.
4170 dnl check for LC_MESSAGES
4171 AC_CACHE_CHECK(for LC_MESSAGES,
4172 ac_cv_i18n_lc_messages,
4173 [AC_TRY_COMPILE([#include <locale.h>],
4174 [int category = LC_MESSAGES;],
4175 ac_cv_i18n_lc_messages=yes,
4176 ac_cv_i18n_lc_messages=no)])
4177 if test "$ac_cv_i18n_lc_messages" = yes; then
4178 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
4181 fi # SKIP_COMPILER_CHECKS
4184 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
4185 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4188 dnl Mozilla specific options
4189 dnl ========================================================
4190 dnl The macros used for command line options
4191 dnl are defined in build/autoconf/altoptions.m4.
4194 dnl ========================================================
4196 dnl = Check for external package dependencies
4198 dnl ========================================================
4199 MOZ_ARG_HEADER(External Packages)
4203 MOZ_ARG_WITH_STRING(libxul-sdk,
4204 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4205 LIBXUL_SDK_DIR=$withval)
4207 if test "$LIBXUL_SDK_DIR" = "yes"; then
4208 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4209 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4210 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4212 if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
4213 AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
4218 AC_SUBST(LIBXUL_SDK)
4220 if test -n "$LIBXUL_SDK"; then
4221 LIBXUL_DIST="$LIBXUL_SDK"
4223 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4225 AC_SUBST(LIBXUL_DIST)
4229 MOZ_ARG_WITH_BOOL(system-libxul,
4230 [ --with-system-libxul Use system installed libxul SDK],
4233 if test -n "$SYSTEM_LIBXUL" && test -z "$MOZ_ENABLE_LIBXUL"; then
4234 AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4237 dnl ========================================================
4238 dnl = If NSPR was not detected in the system,
4239 dnl = use the one in the source tree (mozilla/nsprpub)
4240 dnl ========================================================
4241 MOZ_ARG_WITH_BOOL(system-nspr,
4242 [ --with-system-nspr Use system installed NSPR],
4243 _USE_SYSTEM_NSPR=1 )
4245 if test -n "$_USE_SYSTEM_NSPR"; then
4246 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
4249 if test -n "$MOZ_NATIVE_NSPR"; then
4250 _SAVE_CFLAGS=$CFLAGS
4251 CFLAGS="$CFLAGS $NSPR_CFLAGS"
4252 AC_TRY_COMPILE([#include "prlog.h"],
4253 [#ifndef PR_STATIC_ASSERT
4254 #error PR_STATIC_ASSERT not defined
4256 [MOZ_NATIVE_NSPR=1],
4257 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
4258 CFLAGS=$_SAVE_CFLAGS
4260 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4261 if test "$OS_ARCH" = "WINCE"; then
4262 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4263 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4264 elif test "$OS_ARCH" = "WINNT"; then
4265 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4266 if test -n "$GNU_CC"; then
4267 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4269 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4272 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4276 dnl ========================================================
4277 dnl = If NSS was not detected in the system,
4278 dnl = use the one in the source tree (mozilla/security/nss)
4279 dnl ========================================================
4281 MOZ_ARG_WITH_BOOL(system-nss,
4282 [ --with-system-nss Use system installed NSS],
4285 if test -n "$_USE_SYSTEM_NSS"; then
4286 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
4289 if test -n "$MOZ_NATIVE_NSS"; then
4290 NSS_LIBS="$NSS_LIBS -lcrmf"
4292 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4294 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4295 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4296 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4297 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4298 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX) \
4299 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
4301 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4303 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4304 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4305 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4306 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4307 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4308 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
4310 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
4314 if test -z "$SKIP_LIBRARY_CHECKS"; then
4315 dnl system JPEG support
4316 dnl ========================================================
4317 MOZ_ARG_WITH_STRING(system-jpeg,
4318 [ --with-system-jpeg[=PFX]
4319 Use system libjpeg [installed at prefix PFX]],
4322 _SAVE_CFLAGS=$CFLAGS
4323 _SAVE_LDFLAGS=$LDFLAGS
4325 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4326 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4327 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4329 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4332 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4335 if test "$SYSTEM_JPEG" = 1; then
4336 LIBS="$JPEG_LIBS $LIBS"
4337 AC_TRY_COMPILE([ #include <stdio.h>
4338 #include <sys/types.h>
4339 #include <jpeglib.h> ],
4340 [ #if JPEG_LIB_VERSION < $MOZJPEG
4341 #error "Insufficient JPEG library version ($MOZJPEG required)."
4344 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4346 CFLAGS=$_SAVE_CFLAGS
4347 LDFLAGS=$_SAVE_LDFLAGS
4350 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4351 JPEG_CFLAGS="-I${JPEG_DIR}/include"
4352 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4355 dnl system ZLIB support
4356 dnl ========================================================
4357 MOZ_ARG_WITH_STRING(system-zlib,
4358 [ --with-system-zlib[=PFX]
4359 Use system libz [installed at prefix PFX]],
4362 _SAVE_CFLAGS=$CFLAGS
4363 _SAVE_LDFLAGS=$LDFLAGS
4365 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4366 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4367 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4369 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4372 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4373 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4375 if test "$SYSTEM_ZLIB" = 1; then
4376 LIBS="$ZLIB_LIBS $LIBS"
4377 AC_TRY_COMPILE([ #include <stdio.h>
4379 #include <zlib.h> ],
4380 [ #if ZLIB_VERNUM < $MOZZLIB
4381 #error "Insufficient zlib version ($MOZZLIB required)."
4384 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4386 CFLAGS=$_SAVE_CFLAGS
4387 LDFLAGS=$_SAVE_LDFLAGS
4390 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4391 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4392 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4395 dnl system BZIP2 Support
4396 dnl ========================================================
4397 MOZ_ARG_WITH_STRING(system-bz2,
4398 [ --with-system-bz2[=PFX]
4399 Use system libbz2 [installed at prefix PFX]],
4402 _SAVE_CFLAGS=$CFLAGS
4403 _SAVE_LDFLAGS=$LDFLAGS
4405 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4406 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4407 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4409 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4412 AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4413 [SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
4415 CFLAGS=$_SAVE_CFLAGS
4416 LDFLAGS=$_SAVE_LDFLAGS
4419 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4420 BZ2_CFLAGS="-I${BZ2_DIR}/include"
4421 BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4424 dnl system PNG Support
4425 dnl ========================================================
4426 MOZ_ARG_WITH_STRING(system-png,
4427 [ --with-system-png[=PFX]
4428 Use system libpng [installed at prefix PFX]],
4431 _SAVE_CFLAGS=$CFLAGS
4432 _SAVE_LDFLAGS=$LDFLAGS
4434 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4435 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4436 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4437 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4438 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4440 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4443 _SAVE_PNG_LIBS=$PNG_LIBS
4444 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4445 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4447 AC_CHECK_LIB(png, png_get_acTL, ,
4448 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4451 if test "$SYSTEM_PNG" = 1; then
4452 LIBS="$PNG_LIBS $LIBS"
4453 AC_TRY_COMPILE([ #include <stdio.h>
4454 #include <sys/types.h>
4456 [ #if PNG_LIBPNG_VER < $MOZPNG
4457 #error "Insufficient libpng version ($MOZPNG required)."
4459 #ifndef PNG_UINT_31_MAX
4460 #error "Insufficient libpng version."
4463 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4465 CFLAGS=$_SAVE_CFLAGS
4466 LDFLAGS=$_SAVE_LDFLAGS
4469 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4470 PNG_CFLAGS="-I${PNG_DIR}/include"
4471 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4474 fi # SKIP_LIBRARY_CHECKS
4476 dnl system HunSpell Support
4477 dnl ========================================================
4478 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4479 [ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4482 if test -n "$SYSTEM_HUNSPELL"; then
4483 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4486 AC_SUBST(SYSTEM_HUNSPELL)
4488 dnl ========================================================
4489 dnl Java SDK support
4490 dnl ========================================================
4492 MOZ_ARG_WITH_STRING(java-include-path,
4493 [ --with-java-include-path=dir Location of Java SDK headers],
4494 JAVA_INCLUDE_PATH=$withval)
4497 MOZ_ARG_WITH_STRING(java-bin-path,
4498 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4499 JAVA_BIN_PATH=$withval)
4501 dnl ========================================================
4502 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4503 dnl their usage and use them in spidermonkey.
4504 dnl ========================================================
4505 MOZ_ARG_WITH_BOOL(arm-kuser,
4506 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4509 if test -n "$USE_ARM_KUSER"; then
4510 AC_DEFINE(USE_ARM_KUSER)
4513 dnl ========================================================
4517 dnl ========================================================
4519 MOZ_ARG_HEADER(Application)
4523 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4524 MOZ_BRANDING_DIRECTORY=
4525 MOZ_DBGRINFO_MODULES=
4528 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4529 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4536 MOZ_AUTH_EXTENSION=1
4537 MOZ_NO_ACTIVEX_SUPPORT=1
4538 MOZ_NO_INSPECTOR_APIS=
4539 MOZ_NO_XPCOM_OBSOLETE=
4547 MOZ_PLAINTEXT_EDITOR_ONLY=
4549 MOZ_PREF_EXTENSIONS=1
4550 MOZ_PROFILELOCKING=1
4552 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4554 MOZ_PYTHON_DEBUG_SUFFIX=
4555 MOZ_PYTHON_DLL_SUFFIX=
4556 MOZ_PYTHON_INCLUDES=
4560 MOZ_PYTHON_VER_DOTTED=
4566 MOZ_STATIC_MAIL_BUILD=
4571 MOZ_UNIVERSALCHARDET=1
4573 MOZ_USE_NATIVE_UCONV=
4575 MOZ_XPFE_COMPONENTS=1
4577 MOZ_XSLT_STANDALONE=
4585 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4586 NECKO_SMALL_BUFFERS=
4587 XPC_IDISPATCH_SUPPORT=
4590 case "$target_os" in
4599 case "$target_os" in
4600 msvc*|mks*|cygwin*|mingw*)
4601 if test -z "$GNU_CC"; then
4602 XPC_IDISPATCH_SUPPORT=1
4603 MOZ_NO_ACTIVEX_SUPPORT=
4604 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4609 MOZ_ARG_ENABLE_STRING(application,
4610 [ --enable-application=APP
4614 content/xslt (Standalone Transformiix XSLT)
4615 netwerk (Standalone Necko)
4616 tools/update-packaging (AUS-related packaging tools)
4617 standalone (use this for standalone
4618 xpcom/xpconnect or to manually drive a build)],
4619 [ MOZ_BUILD_APP=$enableval ] )
4621 MOZ_EMBEDDING_PROFILE=default
4622 MOZ_ARG_WITH_STRING(embedding-profile,
4623 [ --with-embedding-profile=default|basic|minimal
4624 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4625 [ MOZ_EMBEDDING_PROFILE=$withval ])
4627 case "$MOZ_EMBEDDING_PROFILE" in
4629 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4630 MOZ_EMBEDDING_LEVEL_BASIC=1
4631 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4632 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4633 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4634 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4638 MOZ_EMBEDDING_LEVEL_DEFAULT=
4639 MOZ_EMBEDDING_LEVEL_BASIC=1
4640 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4641 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4642 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4644 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4646 MOZ_ENABLE_POSTSCRIPT=
4647 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4648 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4649 MOZ_IMG_ENCODERS_DEFAULT=
4655 MOZ_NO_ACTIVEX_SUPPORT=1
4656 MOZ_NO_INSPECTOR_APIS=1
4657 MOZ_NO_XPCOM_OBSOLETE=1
4659 MOZ_PLAINTEXT_EDITOR_ONLY=1
4661 MOZ_PREF_EXTENSIONS=
4665 MOZ_UNIVERSALCHARDET=
4667 MOZ_USE_NATIVE_UCONV=
4669 MOZ_XPFE_COMPONENTS=
4674 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4675 NECKO_SMALL_BUFFERS=1
4676 NS_DISABLE_LOGGING=1
4681 MOZ_EMBEDDING_LEVEL_DEFAULT=
4682 MOZ_EMBEDDING_LEVEL_BASIC=
4683 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4684 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4686 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4688 MOZ_ENABLE_POSTSCRIPT=
4689 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4690 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4691 MOZ_IMG_ENCODERS_DEFAULT=
4697 MOZ_NO_ACTIVEX_SUPPORT=1
4698 MOZ_NO_INSPECTOR_APIS=1
4699 MOZ_NO_XPCOM_OBSOLETE=1
4701 MOZ_PLAINTEXT_EDITOR_ONLY=1
4703 MOZ_PREF_EXTENSIONS=
4709 MOZ_UNIVERSALCHARDET=
4711 MOZ_USE_NATIVE_UCONV=1
4713 MOZ_XPFE_COMPONENTS=
4720 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4721 NECKO_SMALL_BUFFERS=1
4722 NS_DISABLE_LOGGING=1
4727 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4731 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4732 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4733 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4735 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4736 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4737 XULRUNNER_STUB_NAME=$withval)
4739 if test -z "$XULRUNNER_STUB_NAME"; then
4740 case "$target_os" in
4742 XULRUNNER_STUB_NAME=xulrunner
4745 XULRUNNER_STUB_NAME=xulrunner-stub
4748 AC_SUBST(XULRUNNER_STUB_NAME)
4750 if test -z "$MOZ_BUILD_APP"; then
4751 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4753 # We have a valid application only if it has a build.mk file in its top
4755 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4756 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4760 # Allow the application to influence configure with a confvars.sh script.
4762 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4763 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4764 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4765 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4770 # Now is a good time to test for logic errors, define mismatches, etc.
4771 case "$MOZ_BUILD_APP" in
4773 if test "$LIBXUL_SDK"; then
4774 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4779 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4780 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4782 case "$MOZ_BUILD_APP" in
4784 AC_DEFINE(MOZ_PHOENIX)
4788 AC_DEFINE(MOZ_XULRUNNER)
4796 MOZ_APP_NAME=mozilla
4797 MOZ_APP_DISPLAYNAME=Mozilla
4798 MOZ_APP_VERSION=$MOZILLA_VERSION
4803 AC_SUBST(MOZ_BUILD_APP)
4804 AC_SUBST(MOZ_PHOENIX)
4805 AC_SUBST(MOZ_XULRUNNER)
4807 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4809 dnl ========================================================
4811 dnl = Toolkit Options
4813 dnl ========================================================
4814 MOZ_ARG_HEADER(Toolkit Options)
4816 dnl ========================================================
4817 dnl = Select the default toolkit
4818 dnl ========================================================
4819 MOZ_ARG_ENABLE_STRING(default-toolkit,
4820 [ --enable-default-toolkit=TK
4821 Select default toolkit
4822 Platform specific defaults:
4824 Mac OS X - cairo-cocoa
4825 Neutrino/QNX - photon
4827 Win32 - cairo-windows
4829 Gtk2 with DirectFB - cairo-gtk2-dfb
4832 [ _DEFAULT_TOOLKIT=$enableval ],
4833 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4835 if test "$_DEFAULT_TOOLKIT" = "photon" \
4836 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4837 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4838 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
4839 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4840 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4841 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4842 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4843 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4845 dnl nglayout only supports building with one toolkit,
4846 dnl so ignore everything after the first comma (",").
4847 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4849 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4852 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4854 dnl ========================================================
4855 dnl = Enable the toolkit as needed =
4856 dnl ========================================================
4858 case "$MOZ_WIDGET_TOOLKIT" in
4861 AC_DEFINE(MOZ_WIDGET_PHOTON)
4865 MOZ_WIDGET_TOOLKIT=windows
4866 MOZ_GFX_TOOLKIT=cairo
4869 cairo-gtk2|cairo-gtk2-x11)
4870 MOZ_WIDGET_TOOLKIT=gtk2
4871 MOZ_GFX_TOOLKIT=cairo
4873 MOZ_ENABLE_XREMOTE=1
4878 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4879 TK_LIBS='$(MOZ_GTK2_LIBS)'
4880 AC_DEFINE(MOZ_WIDGET_GTK2)
4884 MOZ_WIDGET_TOOLKIT=gtk2
4885 MOZ_GFX_TOOLKIT=cairo
4891 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4892 TK_LIBS='$(MOZ_GTK2_LIBS)'
4893 AC_DEFINE(MOZ_WIDGET_GTK2)
4894 if test "$no_x" != "yes"; then
4895 AC_MSG_WARN([Disabling X when DirectFB is specified.])
4901 MOZ_WIDGET_TOOLKIT=qt
4902 MOZ_GFX_TOOLKIT=cairo
4904 MOZ_ENABLE_XREMOTE=1
4911 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4912 TK_LIBS='$(MOZ_QT_LIBS)'
4913 AC_DEFINE(MOZ_WIDGET_QT)
4917 MOZ_WIDGET_TOOLKIT=beos
4918 MOZ_GFX_TOOLKIT=cairo
4919 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4920 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4924 MOZ_WIDGET_TOOLKIT=os2
4925 MOZ_GFX_TOOLKIT=cairo
4926 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4927 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4931 MOZ_WIDGET_TOOLKIT=cocoa
4932 AC_DEFINE(MOZ_WIDGET_COCOA)
4934 MOZ_GFX_TOOLKIT=cairo
4935 MOZ_USER_DIR="Mozilla"
4936 AC_DEFINE(XP_MACOSX)
4937 AC_DEFINE(TARGET_CARBON)
4938 AC_DEFINE(TARGET_API_MAC_CARBON)
4939 TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
4940 TK_CFLAGS="-DNO_X11"
4941 LDFLAGS="$LDFLAGS -framework Cocoa"
4942 CFLAGS="$CFLAGS $TK_CFLAGS"
4943 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4944 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
4945 MOZ_FS_LAYOUT=bundle
4949 if test "$MOZ_ENABLE_XREMOTE"; then
4950 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4953 if test "$COMPILE_ENVIRONMENT"; then
4954 if test "$MOZ_ENABLE_GTK2"; then
4955 if test "$MOZ_X11"; then
4956 GDK_PACKAGES=gdk-x11-2.0
4957 elif test "$MOZ_DFB"; then
4958 PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
4959 GDK_PACKAGES=directfb
4962 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4965 fi # COMPILE_ENVIRONMENT
4967 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4968 AC_SUBST(MOZ_FS_LAYOUT)
4970 dnl ========================================================
4971 dnl = startup-notification support module
4972 dnl ========================================================
4974 if test "$MOZ_ENABLE_GTK2"
4976 MOZ_ENABLE_STARTUP_NOTIFICATION=
4978 MOZ_ARG_ENABLE_BOOL(startup-notification,
4979 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4980 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4981 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4982 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4984 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4985 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4986 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4987 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4989 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4991 MOZ_ENABLE_STARTUP_NOTIFICATION=
4995 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4996 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4999 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
5001 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
5002 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
5003 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
5005 dnl ========================================================
5007 dnl ========================================================
5008 if test "$MOZ_ENABLE_QT"
5010 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtUiTools QtCore)
5011 AC_SUBST(MOZ_QT_CFLAGS)
5012 AC_SUBST(MOZ_QT_LIBS)
5014 MOZ_ARG_WITH_STRING(qtdir,
5015 [ --with-qtdir=\$dir Specify Qt directory ],
5018 if test -z "$QTDIR"; then
5021 QTINCDIR="/include/qt"
5022 if test ! -d "$QTDIR$QTINCDIR"; then
5023 QTINCDIR="/include/X11/qt"
5025 if test ! -d "$QTDIR$QTINCDIR"; then
5029 if test -x "$QTDIR/bin/moc-qt4"; then
5030 HOST_MOC="$QTDIR/bin/moc-qt4"
5032 if test -x "$QTDIR/bin/moc"; then
5033 HOST_MOC="$QTDIR/bin/moc"
5035 AC_CHECK_PROGS(HOST_MOC, moc, "")
5038 if test -z "$HOST_MOC"; then
5039 AC_MSG_ERROR([no acceptable moc preprocessor found])
5044 AC_SUBST(GTK_CONFIG)
5048 AC_SUBST(MOZ_ENABLE_GTK2)
5049 AC_SUBST(MOZ_ENABLE_PHOTON)
5050 AC_SUBST(MOZ_ENABLE_COCOA)
5051 AC_SUBST(MOZ_ENABLE_QT)
5052 AC_SUBST(MOZ_ENABLE_XREMOTE)
5053 AC_SUBST(MOZ_GTK2_CFLAGS)
5054 AC_SUBST(MOZ_GTK2_LIBS)
5055 AC_SUBST(MOZ_QT_CFLAGS)
5056 AC_SUBST(MOZ_QT_LIBS)
5063 dnl ========================================================
5065 dnl = Components & Features
5067 dnl ========================================================
5068 MOZ_ARG_HEADER(Components and Features)
5070 dnl ========================================================
5072 dnl ========================================================
5073 MOZ_ARG_ENABLE_STRING(ui-locale,
5074 [ --enable-ui-locale=ab-CD
5075 Select the user interface locale (default: en-US)],
5076 MOZ_UI_LOCALE=$enableval )
5077 AC_SUBST(MOZ_UI_LOCALE)
5079 dnl ========================================================
5080 dnl = Trademarked Branding
5081 dnl ========================================================
5082 MOZ_ARG_ENABLE_BOOL(official-branding,
5083 [ --enable-official-branding Enable Official mozilla.org Branding
5084 Do not distribute builds with
5085 --enable-official-branding unless you have
5086 permission to use trademarks per
5087 http://www.mozilla.org/foundation/trademarks/ .],
5088 [case "$MOZ_BUILD_APP" in
5090 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
5091 MOZ_APP_DISPLAYNAME=Firefox
5095 AC_MSG_ERROR([Official branding is only available for Firefox.])
5099 MOZ_ARG_WITH_STRING(branding,
5100 [ --with-branding=dir Use branding from the specified directory.],
5101 MOZ_BRANDING_DIRECTORY=$withval)
5103 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
5104 if test -z "$REAL_BRANDING_DIRECTORY"; then
5105 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5108 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
5109 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
5112 AC_SUBST(MOZ_BRANDING_DIRECTORY)
5114 dnl ========================================================
5115 dnl = Distribution ID
5116 dnl ========================================================
5117 MOZ_ARG_WITH_STRING(distribution-id,
5118 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
5119 [ val=`echo $withval`
5120 MOZ_DISTRIBUTION_ID="$val"])
5122 if test -z "$MOZ_DISTRIBUTION_ID"; then
5123 MOZ_DISTRIBUTION_ID="org.mozilla"
5126 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
5127 AC_SUBST(MOZ_DISTRIBUTION_ID)
5130 dnl ========================================================
5131 dnl complex text support off by default
5132 dnl ========================================================
5134 MOZ_ARG_DISABLE_BOOL(pango,
5135 [ --disable-pango Disable usage of Pango ],
5140 dnl ========================================================
5142 dnl ========================================================
5143 if test "$MOZ_ENABLE_GTK2"
5147 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5149 if test "$MOZ_PANGO"
5151 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5152 AC_SUBST(MOZ_PANGO_CFLAGS)
5153 AC_SUBST(MOZ_PANGO_LIBS)
5154 AC_DEFINE(MOZ_PANGO)
5156 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5157 AC_SUBST(MOZ_PANGO_CFLAGS)
5158 AC_SUBST(MOZ_PANGO_LIBS)
5160 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5161 AC_SUBST(FT2_CFLAGS)
5166 dnl ========================================================
5167 dnl = PostScript print module
5168 dnl ========================================================
5169 MOZ_ARG_DISABLE_BOOL(postscript,
5170 [ --disable-postscript Disable PostScript printing support ],
5171 MOZ_ENABLE_POSTSCRIPT=,
5172 MOZ_ENABLE_POSTSCRIPT=1 )
5174 dnl ========================================================
5175 dnl = GnomeVFS support module
5176 dnl ========================================================
5180 dnl build the gnomevfs extension by default only when the
5181 dnl GTK2 toolkit is in use.
5182 if test "$MOZ_ENABLE_GTK2"
5184 MOZ_ENABLE_GNOMEVFS=1
5188 MOZ_ARG_DISABLE_BOOL(gnomevfs,
5189 [ --disable-gnomevfs Disable GnomeVFS support ],
5190 MOZ_ENABLE_GNOMEVFS=,
5191 MOZ_ENABLE_GNOMEVFS=force)
5193 if test "$MOZ_ENABLE_GNOMEVFS"
5195 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5196 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5197 MOZ_ENABLE_GNOMEVFS=1
5199 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5201 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5203 MOZ_ENABLE_GNOMEVFS=
5207 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
5208 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5209 AC_SUBST(MOZ_GNOMEVFS_LIBS)
5211 if test "$MOZ_ENABLE_GCONF"
5213 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
5214 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5221 if test "$MOZ_ENABLE_GCONF"; then
5222 AC_DEFINE(MOZ_ENABLE_GCONF)
5225 AC_SUBST(MOZ_ENABLE_GCONF)
5226 AC_SUBST(MOZ_GCONF_CFLAGS)
5227 AC_SUBST(MOZ_GCONF_LIBS)
5229 # The GNOME component is built if gtk2, gconf and gnome-vfs
5230 # are all available.
5232 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
5233 "$MOZ_ENABLE_GNOMEVFS"; then
5234 MOZ_ENABLE_GNOME_COMPONENT=1
5236 MOZ_ENABLE_GNOME_COMPONENT=
5239 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5242 dnl ========================================================
5243 dnl = libgnomeui support module
5244 dnl ========================================================
5246 if test "$MOZ_ENABLE_GTK2"
5248 MOZ_ENABLE_GNOMEUI=1
5250 MOZ_ARG_DISABLE_BOOL(gnomeui,
5251 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5252 MOZ_ENABLE_GNOMEUI=,
5253 MOZ_ENABLE_GNOMEUI=force)
5255 if test "$MOZ_ENABLE_GNOMEUI"
5257 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5259 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5260 MOZ_ENABLE_GNOMEUI=1
5262 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5264 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5270 if test "$MOZ_ENABLE_GNOMEUI"; then
5271 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5274 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5275 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5276 AC_SUBST(MOZ_GNOMEUI_LIBS)
5278 dnl ========================================================
5280 dnl ========================================================
5282 if test "$MOZ_ENABLE_GTK2" || test "$MOZ_ENABLE_QT"
5286 MOZ_ARG_DISABLE_BOOL(dbus,
5287 [ --disable-dbus Disable dbus support ],
5291 if test "$MOZ_ENABLE_DBUS"
5293 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5294 AC_DEFINE(MOZ_ENABLE_DBUS)
5297 AC_SUBST(MOZ_ENABLE_DBUS)
5298 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5299 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5301 dnl ========================================================
5302 dnl = libnotify support
5303 dnl ========================================================
5305 if test "$MOZ_ENABLE_GTK2"
5307 MOZ_ENABLE_LIBNOTIFY=1
5309 MOZ_ARG_DISABLE_BOOL(libnotify,
5310 [ --disable-libnotify Disable libnotify support ],
5311 MOZ_ENABLE_LIBNOTIFY=,
5312 MOZ_ENABLE_LIBNOTIFY=1)
5314 if test "$MOZ_ENABLE_LIBNOTIFY"
5316 AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5320 if test -z "$SKIP_LIBRARY_CHECKS"
5322 if test "$MOZ_ENABLE_GTK2"
5324 if test "$MOZ_ENABLE_LIBNOTIFY"
5326 PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5330 AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5331 AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5332 AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5334 dnl ========================================================
5335 dnl = Build Personal Security Manager
5336 dnl ========================================================
5337 MOZ_ARG_DISABLE_BOOL(crypto,
5338 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5342 dnl ========================================================
5343 dnl = JS Debugger XPCOM component (js/jsd)
5344 dnl ========================================================
5345 MOZ_ARG_DISABLE_BOOL(jsd,
5346 [ --disable-jsd Disable JavaScript debug library],
5351 dnl ========================================================
5352 dnl = Disable plugin support
5353 dnl ========================================================
5354 MOZ_ARG_DISABLE_BOOL(plugins,
5355 [ --disable-plugins Disable plugins support],
5359 dnl ========================================================
5360 dnl = Disable building dbm
5361 dnl ========================================================
5362 MOZ_ARG_DISABLE_BOOL(dbm,
5363 [ --disable-dbm Disable building dbm],
5367 dnl bi-directional support always on
5371 dnl ========================================================
5372 dnl view source support on by default
5373 dnl ========================================================
5374 MOZ_ARG_DISABLE_BOOL(view-source,
5375 [ --disable-view-source Disable view source support],
5378 if test "$MOZ_VIEW_SOURCE"; then
5379 AC_DEFINE(MOZ_VIEW_SOURCE)
5383 dnl ========================================================
5384 dnl accessibility support on by default on all platforms
5386 dnl ========================================================
5387 MOZ_ARG_DISABLE_BOOL(accessibility,
5388 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5391 if test "$ACCESSIBILITY"; then
5392 AC_DEFINE(ACCESSIBILITY)
5395 if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5397 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5398 if test "$ac_cv_header_atlbase_h" = "no"; then
5399 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.])
5401 if test "$ac_cv_header_oleacc_idl" = "no"; then
5402 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.])
5408 dnl ========================================================
5409 dnl xpfe/components on by default
5410 dnl ========================================================
5411 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5412 [ --disable-xpfe-components
5413 Disable xpfe components],
5414 MOZ_XPFE_COMPONENTS=,
5415 MOZ_XPFE_COMPONENTS=1 )
5417 dnl ========================================================
5418 dnl xpinstall support on by default
5419 dnl ========================================================
5420 MOZ_ARG_DISABLE_BOOL(xpinstall,
5421 [ --disable-xpinstall Disable xpinstall support],
5424 if test "$MOZ_XPINSTALL"; then
5425 AC_DEFINE(MOZ_XPINSTALL)
5428 dnl ========================================================
5429 dnl xpcom js loader support on by default
5430 dnl ========================================================
5431 MOZ_ARG_DISABLE_BOOL(jsloader,
5432 [ --disable-jsloader Disable xpcom js loader support],
5435 if test "$MOZ_JSLOADER"; then
5436 AC_DEFINE(MOZ_JSLOADER)
5439 dnl ========================================================
5440 dnl Disable printing
5441 dnl ========================================================
5442 MOZ_ARG_DISABLE_BOOL(printing,
5443 [ --disable-printing Disable printing support],
5447 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
5448 AC_MSG_WARN([Printing does not work with Qt at this time. Omitting printing support.])
5452 if test "$NS_PRINTING"; then
5453 AC_DEFINE(NS_PRINTING)
5454 AC_DEFINE(NS_PRINT_PREVIEW)
5457 dnl ========================================================
5458 dnl use native unicode converters
5459 dnl ========================================================
5460 MOZ_ARG_ENABLE_BOOL(native-uconv,
5461 [ --enable-native-uconv Enable iconv support],
5462 MOZ_USE_NATIVE_UCONV=1,
5463 MOZ_USE_NATIVE_UCONV= )
5464 if test "$MOZ_USE_NATIVE_UCONV"; then
5465 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5467 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5468 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5472 dnl ========================================================
5473 dnl Libeditor can be build as plaintext-only,
5474 dnl or as a full html and text editing component.
5475 dnl We build both by default.
5476 dnl ========================================================
5477 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5478 [ --enable-plaintext-editor-only
5479 Allow only plaintext editing],
5480 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5481 MOZ_PLAINTEXT_EDITOR_ONLY= )
5482 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5483 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5485 dnl ========================================================
5486 dnl = Drop XPCOM Obsolete library
5487 dnl ========================================================
5488 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5489 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5490 MOZ_NO_XPCOM_OBSOLETE=1,
5491 MOZ_NO_XPCOM_OBSOLETE=)
5493 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5494 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5497 dnl ========================================================
5498 dnl = Disable Fast Load
5499 dnl ========================================================
5500 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5501 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5505 AC_SUBST(MOZ_NO_FAST_LOAD)
5507 if test -n "$MOZ_NO_FAST_LOAD"; then
5508 AC_DEFINE(MOZ_NO_FAST_LOAD)
5511 dnl ========================================================
5512 dnl = Disable Ogg Codecs
5513 dnl ========================================================
5514 MOZ_ARG_DISABLE_BOOL(ogg,
5515 [ --disable-ogg Disable Ogg Codec support],
5521 if test -n "$MOZ_OGG"; then
5526 dnl Checks for __attribute__(aligned()) directive
5527 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5528 [ac_cv_c_attribute_aligned],
5529 [ac_cv_c_attribute_aligned=0
5530 CFLAGS_save="${CFLAGS}"
5531 CFLAGS="${CFLAGS} -Werror"
5532 for ac_cv_c_attr_align_try in 64 32 16 8; do
5533 echo "trying $ac_cv_c_attr_align_try"
5535 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5536 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5537 if test "$ac_cv_c_attribute_aligned" != 0; then
5541 CFLAGS="${CFLAGS_save}"])
5542 if test "${ac_cv_c_attribute_aligned}" != "0"; then
5543 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5544 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5548 dnl ========================================================
5549 dnl = Disable Wave decoder support
5550 dnl ========================================================
5551 MOZ_ARG_DISABLE_BOOL(wave,
5552 [ --disable-wave Disable Wave decoder support],
5558 if test -n "$MOZ_WAVE"; then
5564 dnl ========================================================
5565 dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
5566 dnl ========================================================
5568 AC_SUBST(MOZ_SYDNEYAUDIO)
5570 if test -n "$MOZ_SYDNEYAUDIO"; then
5571 AC_DEFINE(MOZ_SYDNEYAUDIO)
5576 if test -n "$MOZ_MEDIA"; then
5577 AC_DEFINE(MOZ_MEDIA)
5580 dnl ========================================================
5581 dnl = Check alsa availability on Linux if using sydneyaudio
5582 dnl ========================================================
5584 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5585 if test "$COMPILE_ENVIRONMENT"; then
5586 if test -n "$MOZ_SYDNEYAUDIO"; then
5587 case "$target_os" in
5589 AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
5595 dnl ========================================================
5596 dnl Permissions System
5597 dnl ========================================================
5598 MOZ_ARG_DISABLE_BOOL(permissions,
5599 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5604 dnl ========================================================
5606 dnl ========================================================
5607 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5608 [ --disable-negotiateauth Disable GSS-API negotiation ],
5609 MOZ_AUTH_EXTENSION=,
5610 MOZ_AUTH_EXTENSION=1 )
5612 dnl ========================================================
5614 dnl ========================================================
5615 MOZ_ARG_DISABLE_BOOL(xtf,
5616 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5619 if test "$MOZ_XTF"; then
5623 dnl ========================================================
5625 dnl ========================================================
5626 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5627 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5628 MOZ_NO_INSPECTOR_APIS=1,
5629 MOZ_NO_INSPECTOR_APIS= )
5631 dnl ========================================================
5632 dnl Pref extensions (autoconfig and system-pref)
5633 dnl ========================================================
5634 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5635 [ --disable-pref-extensions
5636 Disable pref extensions such as autoconfig and
5638 MOZ_PREF_EXTENSIONS=,
5639 MOZ_PREF_EXTENSIONS=1 )
5641 dnl ========================================================
5642 dnl = Universalchardet
5643 dnl ========================================================
5644 MOZ_ARG_DISABLE_BOOL(universalchardet,
5645 [ --disable-universalchardet
5646 Disable universal encoding detection],
5647 MOZ_UNIVERSALCHARDET=,
5648 MOZ_UNIVERSALCHARDET=1 )
5650 dnl ========================================================
5652 dnl ========================================================
5653 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5654 [ --enable-javaxpcom
5655 Enable Java-XPCOM bridge],
5659 if test -n "${MOZ_JAVAXPCOM}"; then
5662 if test -n "$JAVA_HOME"; then
5663 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5667 if test -n "$JAVA_HOME"; then
5668 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5673 if test -n "${JAVA_INCLUDE_PATH}"; then
5674 dnl Make sure jni.h exists in the given include path.
5675 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5676 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5679 case "$target_os" in
5681 dnl Default to java system location
5682 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5686 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5689 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5690 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.])
5694 if test -n "${JAVA_BIN_PATH}"; then
5695 dnl Look for javac and jar in the specified path.
5696 JAVA_PATH="$JAVA_BIN_PATH"
5698 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5699 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5702 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5703 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5704 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5705 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5706 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.])
5710 dnl ========================================================
5711 dnl = Breakpad crash reporting (on by default on supported platforms)
5712 dnl ========================================================
5714 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5715 || test "$OS_ARCH" = "Darwin" \
5716 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
5717 || test "$OS_ARCH" = "SunOS") \
5718 && test -z "$HAVE_64BIT_OS"; then
5722 MOZ_ARG_DISABLE_BOOL(crashreporter,
5723 [ --disable-crashreporter Disable breakpad crash reporting],
5725 MOZ_CRASHREPORTER=1)
5727 if test -n "$MOZ_CRASHREPORTER"; then
5728 AC_DEFINE(MOZ_CRASHREPORTER)
5730 if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
5731 test -z "$SKIP_LIBRARY_CHECKS"; then
5732 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5733 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5734 AC_SUBST(MOZ_GTHREAD_LIBS)
5736 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.])])
5740 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5741 [ --with-crashreporter-enable-percent=NN Enable sending crash reports by default on NN% of users. (default=100)],
5742 [ val=`echo $withval | sed 's/[^0-9]//g'`
5743 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5745 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5746 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5748 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5750 dnl ========================================================
5751 dnl = Enable compilation of specific extension modules
5752 dnl ========================================================
5754 MOZ_ARG_ENABLE_STRING(extensions,
5755 [ --enable-extensions Enable extensions],
5756 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5757 if test "$option" = "yes" || test "$option" = "all"; then
5758 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5759 elif test "$option" = "no" || test "$option" = "none"; then
5761 elif test "$option" = "default"; then
5762 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5763 elif test `echo "$option" | grep -c \^-` != 0; then
5764 option=`echo $option | sed 's/^-//'`
5765 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5767 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5770 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5772 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5773 # Suppress warning on non-X11 platforms
5774 if test -n "$MOZ_X11"; then
5775 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5777 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5780 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5781 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5782 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5785 dnl This might be temporary: build tridentprofile only on Windows
5786 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5787 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5788 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5791 dnl cookie must be built before tridentprofile. put it at list's end.
5792 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5793 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5794 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5797 dnl xforms requires xtf and schema-validation
5798 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5799 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5800 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5802 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5803 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5804 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5807 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5808 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5809 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5812 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5813 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5814 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5817 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5818 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5819 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5822 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5823 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5824 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5827 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5828 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5829 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5832 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5833 AC_MSG_WARN([spellcheck is no longer an extension.])
5834 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5837 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5838 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5839 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5843 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5845 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5846 dnl when trying to build a non-existent extension.
5847 for extension in $MOZ_EXTENSIONS; do
5848 if test ! -d "${srcdir}/extensions/${extension}"; then
5849 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5854 dnl ========================================================
5856 dnl ========================================================
5857 case "$MOZ_WIDGET_TOOLKIT" in
5858 beos|windows|os2|mac|cocoa)
5861 if test -z "$MOZ_ENABLE_GTK2" && test -z "$MOZ_ENABLE_QT"; then
5862 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5867 MOZ_ARG_ENABLE_STRING(image-decoders,
5868 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5869 Enable specific image decoders],
5870 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5871 if test "$option" = "yes" || test "$option" = "all"; then
5872 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5873 elif test "$option" = "no" || test "$option" = "none"; then
5875 elif test "$option" = "default"; then
5876 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5877 elif test `echo "$option" | grep -c \^-` != 0; then
5878 option=`echo $option | sed 's/^-//'`
5879 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5881 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5884 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5886 dnl Dupes are removed in the encoder section because it will also add decoders
5888 dnl ========================================================
5890 dnl ========================================================
5891 MOZ_ARG_ENABLE_STRING(image-encoders,
5892 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5893 Enable specific image encoders],
5894 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5895 if test "$option" = "yes" || test "$option" = "all"; then
5896 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5897 elif test "$option" = "no" || test "$option" = "none"; then
5900 elif test "$option" = "default"; then
5901 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5902 elif test `echo "$option" | grep -c \^-` != 0; then
5903 option=`echo $option | sed 's/^-//'`
5904 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5906 addencoder="$option"
5908 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5910 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5913 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5914 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5916 dnl ========================================================
5917 dnl MathML on by default
5918 dnl ========================================================
5919 MOZ_ARG_DISABLE_BOOL(mathml,
5920 [ --disable-mathml Disable MathML support],
5923 if test "$MOZ_MATHML"; then
5924 AC_DEFINE(MOZ_MATHML)
5927 dnl ========================================================
5929 dnl ========================================================
5930 MOZ_ARG_DISABLE_BOOL(canvas,
5931 [ --disable-canvas Disable html:canvas feature],
5933 MOZ_ENABLE_CANVAS=1 )
5934 if test -n "$MOZ_ENABLE_CANVAS"; then
5935 AC_DEFINE(MOZ_ENABLE_CANVAS)
5937 AC_SUBST(MOZ_ENABLE_CANVAS)
5939 dnl ========================================================
5941 dnl ========================================================
5942 MOZ_ARG_DISABLE_BOOL(svg,
5943 [ --disable-svg Disable SVG support],
5946 if test -n "$MOZ_SVG"; then
5950 dnl ========================================================
5952 dnl ========================================================
5954 MOZ_ARG_DISABLE_BOOL(smil,
5955 [ --disable-smil Disable SMIL animation support],
5958 # Automatically disable SMIL if SVG is disabled
5959 if test -z "$MOZ_SVG"; then
5962 if test -n "$MOZ_SMIL"; then
5966 dnl ========================================================
5967 dnl Build Freetype in the tree
5968 dnl ========================================================
5969 MOZ_ARG_ENABLE_BOOL(tree-freetype,
5970 [ --enable-tree-freetype Enable Tree FreeType],
5971 MOZ_TREE_FREETYPE=1,
5972 MOZ_TREE_FREETYPE= )
5973 if test -n "$MOZ_TREE_FREETYPE"; then
5974 AC_DEFINE(MOZ_TREE_FREETYPE)
5975 AC_SUBST(MOZ_TREE_FREETYPE)
5976 MOZ_ENABLE_CAIRO_FT=1
5977 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
5978 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5979 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5980 FT2_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5981 CAIRO_FT_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5982 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
5983 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
5984 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
5985 AC_SUBST(CAIRO_FT_CFLAGS)
5989 dnl ========================================================
5991 dnl ========================================================
5992 case "$target_os" in
5993 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5998 MOZ_ARG_DISABLE_BOOL(installer,
5999 [ --disable-installer Disable building of installer],
6002 if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
6003 # Disable installer for Windows builds that use the new toolkit if NSIS
6004 # isn't in the path.
6005 MOZ_PATH_PROGS(MAKENSIS, makensis)
6006 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
6007 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
6009 # The Windows build for NSIS requires the iconv command line utility to
6010 # convert the charset of the locale files.
6011 MOZ_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
6012 if test -z "$HOST_ICONV"; then
6013 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
6017 # Automatically disable installer if xpinstall isn't built
6018 if test -z "$MOZ_XPINSTALL"; then
6021 AC_SUBST(MOZ_INSTALLER)
6023 AC_MSG_CHECKING([for tar archiver])
6024 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6025 if test -z "$TAR"; then
6026 AC_MSG_ERROR([no tar archiver found in \$PATH])
6028 AC_MSG_RESULT([$TAR])
6031 AC_MSG_CHECKING([for wget])
6032 AC_CHECK_PROGS(WGET, wget, "")
6033 AC_MSG_RESULT([$WGET])
6036 dnl ========================================================
6038 dnl ========================================================
6040 MOZ_ARG_DISABLE_BOOL(updater,
6041 [ --disable-updater Disable building of updater],
6044 AC_SUBST(MOZ_UPDATER)
6046 # app update channel is 'default' when not supplied.
6047 MOZ_ARG_ENABLE_STRING([update-channel],
6048 [ --enable-update-channel=CHANNEL
6049 Select application update channel (default=default)],
6050 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6052 if test -z "$MOZ_UPDATE_CHANNEL"; then
6053 MOZ_UPDATE_CHANNEL=default
6055 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6057 # tools/update-packaging is not checked out by default.
6058 MOZ_ARG_ENABLE_BOOL(update-packaging,
6059 [ --enable-update-packaging
6060 Enable tools/update-packaging],
6061 MOZ_UPDATE_PACKAGING=1,
6062 MOZ_UPDATE_PACKAGING= )
6063 AC_SUBST(MOZ_UPDATE_PACKAGING)
6065 dnl ========================================================
6067 dnl ========================================================
6069 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
6070 [ --disable-xpconnect-idispatch
6071 Disable building of xpconnect support for IDispatch
6073 XPC_IDISPATCH_SUPPORT=,
6074 XPC_IDISPATCH_SUPPORT=1)
6075 AC_SUBST(XPC_IDISPATCH_SUPPORT)
6077 MOZ_ARG_DISABLE_BOOL(activex,
6078 [ --disable-activex Disable building of ActiveX control (win32 only)],
6079 MOZ_NO_ACTIVEX_SUPPORT=1,
6080 MOZ_NO_ACTIVEX_SUPPORT= )
6081 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
6083 MOZ_ARG_DISABLE_BOOL(activex-scripting,
6084 [ --disable-activex-scripting
6085 Disable building of ActiveX scripting support (win32)],
6086 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
6087 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
6088 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
6090 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
6092 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
6095 if test "$COMPILE_ENVIRONMENT" = "1"; then
6096 if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
6098 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
6099 if test "$ac_cv_header_atlbase_h" = "no"; then
6100 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.])
6107 dnl ========================================================
6109 dnl ========================================================
6110 MOZ_ARG_ENABLE_BOOL(leaky,
6111 [ --enable-leaky Build leaky memory tool],
6116 dnl ========================================================
6118 dnl ========================================================
6119 MOZ_ARG_ENABLE_BOOL(xpctools,
6120 [ --enable-xpctools Build JS profiling tool],
6125 dnl ========================================================
6126 dnl build the tests by default
6127 dnl ========================================================
6128 MOZ_ARG_DISABLE_BOOL(tests,
6129 [ --disable-tests Do not build test libraries & programs],
6133 dnl ========================================================
6134 dnl parental controls (for Windows Vista)
6135 dnl ========================================================
6136 MOZ_ARG_DISABLE_BOOL(parental-controls,
6137 [ --disable-parental-controls
6138 Do not build parental controls],
6139 MOZ_DISABLE_PARENTAL_CONTROLS=1,
6140 MOZ_DISABLE_PARENTAL_CONTROLS=)
6141 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6142 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6145 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6147 dnl ========================================================
6149 dnl = Module specific options
6151 dnl ========================================================
6152 MOZ_ARG_HEADER(Individual module options)
6154 dnl ========================================================
6155 dnl = Enable Lea malloc in xpcom. OFF by default.
6156 dnl ========================================================
6157 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
6158 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
6161 if test -n "$XPCOM_USE_LEA"; then
6162 AC_DEFINE(XPCOM_USE_LEA)
6165 dnl ========================================================
6166 dnl = Enable places (new history/bookmarks)
6167 dnl ========================================================
6168 MOZ_ARG_ENABLE_BOOL(places,
6169 [ --enable-places Enable 'places' bookmark/history implementation],
6172 if test -n "$MOZ_PLACES"; then
6173 AC_DEFINE(MOZ_PLACES)
6174 if test -z "$MOZ_MAIL_NEWS"; then
6179 if test "$MOZ_BUILD_APP" = "browser"; then
6180 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
6184 dnl ========================================================
6185 dnl = Disable feed handling components
6186 dnl ========================================================
6187 MOZ_ARG_DISABLE_BOOL(feeds,
6188 [ --disable-feeds Disable feed handling and processing components],
6191 if test -n "$MOZ_FEEDS"; then
6192 AC_DEFINE(MOZ_FEEDS)
6194 if test "$MOZ_BUILD_APP" = "browser"; then
6195 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6199 dnl ========================================================
6200 dnl = Enable mozStorage
6201 dnl ========================================================
6202 dnl Implicitly enabled by default if building calendar or places
6203 MOZ_ARG_ENABLE_BOOL(storage,
6204 [ --enable-storage Enable mozStorage module and related components],
6207 if test -n "$MOZ_STORAGE"; then
6208 AC_DEFINE(MOZ_STORAGE)
6211 dnl ========================================================
6212 dnl Check for sqlite
6213 dnl ========================================================
6216 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6217 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6218 MOZ_NATIVE_SQLITE=1,
6219 MOZ_NATIVE_SQLITE= )
6221 if test -z "$MOZ_NATIVE_SQLITE"
6224 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
6226 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6229 AC_SUBST(MOZ_NATIVE_SQLITE)
6231 dnl ========================================================
6232 dnl = Enable help viewer (off by default)
6233 dnl ========================================================
6234 MOZ_ARG_ENABLE_BOOL(help-viewer,
6235 [ --enable-help-viewer Enable help viewer],
6238 if test -n "$MOZ_HELP_VIEWER"; then
6239 AC_DEFINE(MOZ_HELP_VIEWER)
6241 AC_SUBST(MOZ_HELP_VIEWER)
6242 if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
6243 AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
6246 dnl ========================================================
6247 dnl = Enable safe browsing (anti-phishing)
6248 dnl ========================================================
6249 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6250 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6251 MOZ_SAFE_BROWSING=1,
6252 MOZ_SAFE_BROWSING= )
6253 if test -n "$MOZ_SAFE_BROWSING"; then
6254 AC_DEFINE(MOZ_SAFE_BROWSING)
6256 AC_SUBST(MOZ_SAFE_BROWSING)
6258 dnl ========================================================
6259 dnl = Enable url-classifier
6260 dnl ========================================================
6261 dnl Implicitly enabled by default if building with safe-browsing
6262 if test -n "$MOZ_SAFE_BROWSING"; then
6263 MOZ_URL_CLASSIFIER=1
6265 MOZ_ARG_ENABLE_BOOL(url-classifier,
6266 [ --enable-url-classifier Enable url classifier module],
6267 MOZ_URL_CLASSIFIER=1,
6268 MOZ_URL_CLASSIFIER= )
6269 if test -n "$MOZ_URL_CLASSIFIER"; then
6270 AC_DEFINE(MOZ_URL_CLASSIFIER)
6272 AC_SUBST(MOZ_URL_CLASSIFIER)
6274 dnl ========================================================
6275 dnl = Disable zipwriter
6276 dnl ========================================================
6277 MOZ_ARG_DISABLE_BOOL(zipwriter,
6278 [ --disable-zipwriter Disable zipwriter component],
6281 AC_SUBST(MOZ_ZIPWRITER)
6283 dnl ========================================================
6284 dnl = Enable Ultrasparc specific optimizations for JS
6285 dnl ========================================================
6286 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
6287 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
6288 JS_ULTRASPARC_OPTS=1,
6289 JS_ULTRASPARC_OPTS= )
6291 dnl only enable option for ultrasparcs
6292 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
6293 "$OS_TEST" != "sun4u"; then
6296 AC_SUBST(JS_ULTRASPARC_OPTS)
6298 dnl ========================================================
6299 dnl = Hildon and OSSO checks
6300 dnl ========================================================
6301 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime,
6302 MOZ_PLATFORM_HILDON=1,
6303 MOZ_PLATFORM_HILDON=)
6304 if test $MOZ_PLATFORM_HILDON; then
6305 AC_DEFINE(MOZ_PLATFORM_HILDON)
6306 X11_COMPOSITED_PLUGINS="yes"
6308 AC_SUBST(LIBHILDONMIME_CFLAGS)
6309 AC_SUBST(LIBHILDONMIME_LIBS)
6311 if test "$X11_COMPOSITED_PLUGINS" = "yes"; then
6312 dnl if we have Xcomposite we should also have Xdamage and Xfixes
6313 AC_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6314 [AC_MSG_ERROR([Couldn't find X11/extentsions/Xdamage.h which is required for composited plugins.])])
6315 AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6316 [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6318 AC_SUBST(XCOMPOSITE_LIBS)
6320 PKG_CHECK_MODULES(LIBOSSO,libosso,
6324 if test $NS_OSSO; then
6325 if test -z "$MOZ_ENABLE_DBUS"; then
6326 AC_MSG_ERROR([DBus is required when building for OSSO])
6329 MOZ_GFX_OPTIMIZE_MOBILE=1
6331 AC_SUBST(LIBOSSO_CFLAGS)
6332 AC_SUBST(LIBOSSO_LIBS)
6334 PKG_CHECK_MODULES(MOZ_LOCATION, [liblocation gpsbt],
6335 NS_MAEMO_LOCATION=1,
6338 if test $NS_MAEMO_LOCATION; then
6339 AC_DEFINE(NS_MAEMO_LOCATION)
6342 AC_SUBST(MOZ_LOCATION_CFLAGS)
6343 AC_SUBST(MOZ_LOCATION_LIBS)
6345 dnl ========================================================
6346 dnl = faststripe theme
6347 dnl ========================================================
6348 MOZ_ARG_ENABLE_BOOL(faststripe,
6349 [ --enable-faststripe Use faststripe theme],
6350 MOZ_THEME_FASTSTRIPE=1,
6351 MOZ_THEME_FASTSTRIPE= )
6352 AC_SUBST(MOZ_THEME_FASTSTRIPE)
6354 dnl ========================================================
6356 dnl = Feature options that require extra sources to be pulled
6358 dnl ========================================================
6359 dnl MOZ_ARG_HEADER(Features that require extra sources)
6361 dnl ========================================================
6363 dnl = Debugging Options
6365 dnl ========================================================
6366 MOZ_ARG_HEADER(Debugging and Optimizations)
6368 dnl ========================================================
6369 dnl = Disable building with debug info.
6370 dnl = Debugging is OFF by default
6371 dnl ========================================================
6372 if test -z "$MOZ_DEBUG_FLAGS"
6376 if test "$GNU_CC"; then
6377 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
6378 case "$GCC_VERSION" in
6383 MOZ_DEBUG_FLAGS="-g"
6387 MOZ_DEBUG_FLAGS="-g"
6391 MOZ_DEBUG_FLAGS="-g"
6396 MOZ_ARG_ENABLE_STRING(debug,
6397 [ --enable-debug[=DBG] Enable building with developer debug info
6398 (Using compiler flags DBG)],
6399 [ if test "$enableval" != "no"; then
6401 if test -n "$enableval" && test "$enableval" != "yes"; then
6402 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6409 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
6410 case "${target_os}" in
6412 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
6414 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6415 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
6418 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
6421 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
6423 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6425 if test -n "$MOZ_DEBUG"; then
6426 AC_MSG_CHECKING([for valid debug flags])
6427 _SAVE_CFLAGS=$CFLAGS
6428 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6429 AC_TRY_COMPILE([#include <stdio.h>],
6430 [printf("Hello World\n");],
6433 AC_MSG_RESULT([$_results])
6434 if test "$_results" = "no"; then
6435 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6437 CFLAGS=$_SAVE_CFLAGS
6440 dnl ========================================================
6441 dnl enable mobile optimizations
6442 dnl ========================================================
6443 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6444 [ --enable-mobile-optimize Enable mobile optimizations],
6445 MOZ_GFX_OPTIMIZE_MOBILE=1)
6447 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6449 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6450 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6453 dnl ========================================================
6454 dnl = Enable code optimization. ON by default.
6455 dnl ========================================================
6456 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6457 MOZ_OPTIMIZE_FLAGS="-O"
6460 MOZ_ARG_ENABLE_STRING(optimize,
6461 [ --disable-optimize Disable compiler optimization
6462 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6463 [ if test "$enableval" != "no"; then
6465 if test -n "$enableval" && test "$enableval" != "yes"; then
6466 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6471 fi ], MOZ_OPTIMIZE=1)
6473 if test "$COMPILE_ENVIRONMENT"; then
6474 if test -n "$MOZ_OPTIMIZE"; then
6475 AC_MSG_CHECKING([for valid optimization flags])
6476 _SAVE_CFLAGS=$CFLAGS
6477 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6478 AC_TRY_COMPILE([#include <stdio.h>],
6479 [printf("Hello World\n");],
6482 AC_MSG_RESULT([$_results])
6483 if test "$_results" = "no"; then
6484 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6486 CFLAGS=$_SAVE_CFLAGS
6488 fi # COMPILE_ENVIRONMENT
6490 AC_SUBST(MOZ_OPTIMIZE)
6491 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6492 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6493 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6495 dnl ========================================================
6496 dnl = Enable/disable debug for specific modules only
6497 dnl = module names beginning with ^ will be disabled
6498 dnl ========================================================
6499 MOZ_ARG_ENABLE_STRING(debug-modules,
6500 [ --enable-debug-modules Enable/disable debug info for specific modules],
6501 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6503 dnl ========================================================
6504 dnl = Enable/disable generation of debugger info for specific modules only
6505 dnl = the special module name ALL_MODULES can be used to denote all modules
6506 dnl = module names beginning with ^ will be disabled
6507 dnl ========================================================
6508 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6509 [ --enable-debugger-info-modules
6510 Enable/disable debugger info for specific modules],
6511 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6512 dnl note that the list of module names is reversed as it is copied
6513 dnl this is important, as it will allow config.mk to interpret stuff like
6514 dnl "^ALL_MODULES xpcom" properly
6515 if test "$i" = "no"; then
6518 if test "$i" = "yes"; then
6521 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6524 dnl ========================================================
6525 dnl Enable garbage collector
6526 dnl ========================================================
6527 MOZ_ARG_ENABLE_BOOL(boehm,
6528 [ --enable-boehm Enable the Boehm Garbage Collector],
6531 if test -n "$GC_LEAK_DETECTOR"; then
6532 AC_DEFINE(GC_LEAK_DETECTOR)
6535 dnl ========================================================
6536 dnl Disable runtime logging checks
6537 dnl ========================================================
6538 MOZ_ARG_DISABLE_BOOL(logging,
6539 [ --disable-logging Disable logging facilities],
6540 NS_DISABLE_LOGGING=1,
6541 NS_DISABLE_LOGGING= )
6542 if test "$NS_DISABLE_LOGGING"; then
6543 AC_DEFINE(NS_DISABLE_LOGGING)
6545 AC_DEFINE(MOZ_LOGGING)
6548 dnl ========================================================
6549 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6550 dnl ========================================================
6551 _ENABLE_LOGREFCNT=42
6552 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6553 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6554 _ENABLE_LOGREFCNT=1,
6555 _ENABLE_LOGREFCNT= )
6556 if test "$_ENABLE_LOGREFCNT" = "1"; then
6557 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6558 elif test -z "$_ENABLE_LOGREFCNT"; then
6559 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6562 dnl ========================================================
6563 dnl = Enable trace malloc
6564 dnl ========================================================
6565 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6566 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6567 [ --enable-trace-malloc Enable malloc tracing],
6570 if test "$NS_TRACE_MALLOC"; then
6571 # Please, Mr. Linker Man, don't take away our symbol names
6572 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6574 AC_DEFINE(NS_TRACE_MALLOC)
6576 AC_SUBST(NS_TRACE_MALLOC)
6578 dnl ========================================================
6579 dnl = Enable jemalloc
6580 dnl ========================================================
6581 MOZ_ARG_ENABLE_BOOL(jemalloc,
6582 [ --enable-jemalloc Replace memory allocator with jemalloc],
6586 if test "$NS_TRACE_MALLOC"; then
6590 if test "$MOZ_MEMORY"; then
6592 dnl Don't try to run compiler tests on Windows
6593 if test "$OS_ARCH" = "WINNT"; then
6594 if test -z "$HAVE_64BIT_OS"; then
6595 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6597 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6600 AC_CHECK_SIZEOF([int *], [4])
6601 case "${ac_cv_sizeof_int_p}" in
6603 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6606 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6609 AC_MSG_ERROR([Unexpected pointer size])
6614 AC_DEFINE(MOZ_MEMORY)
6615 if test "x$MOZ_DEBUG" = "x1"; then
6616 AC_DEFINE(MOZ_MEMORY_DEBUG)
6618 dnl The generic feature tests that determine how to compute ncpus are long and
6619 dnl complicated. Therefore, simply define special cpp variables for the
6620 dnl platforms we have special knowledge of.
6621 case "${target_os}" in
6623 AC_DEFINE(MOZ_MEMORY_DARWIN)
6626 AC_DEFINE(MOZ_MEMORY_BSD)
6629 AC_DEFINE(MOZ_MEMORY_LINUX)
6632 AC_DEFINE(MOZ_MEMORY_BSD)
6635 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6637 msvc*|mks*|cygwin*|mingw*)
6638 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6639 dnl This is sort of awful. Will revisit if we add support for more versions
6640 if test "$CC_VERSION" != "14.00.50727.762"; then
6641 AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 currently.])
6643 if test -z "$WIN32_CRT_SRC_DIR"; then
6644 if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6645 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).])
6647 WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6651 if test ! -d "$WIN32_CRT_SRC_DIR"; then
6652 AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
6654 WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
6655 _objdir_win=`pwd -W`
6656 WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/intel"
6657 dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6658 AC_DEFINE(_STATIC_CPPLIB)
6659 MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -DEFAULTLIB:mozcrt19"
6660 dnl Also pass this to NSPR/NSS
6661 DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
6665 AC_DEFINE(MOZ_MEMORY_WINCE)
6666 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6667 if test -z "$WINCE_WINDOWS_MOBILE"; then
6668 AC_DEFINE(MOZ_MEMORY_WINCE6)
6672 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6676 AC_SUBST(MOZ_MEMORY)
6677 AC_SUBST(MOZ_MEMORY_LDFLAGS)
6678 AC_SUBST(WIN32_CRT_SRC_DIR)
6679 dnl Need to set this for make because NSS doesn't have configure
6682 dnl ========================================================
6683 dnl = Use malloc wrapper lib
6684 dnl ========================================================
6685 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6686 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6690 if test -n "$_WRAP_MALLOC"; then
6691 if test "$GNU_CC"; then
6692 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"
6693 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6697 dnl ========================================================
6698 dnl = Location of malloc wrapper lib
6699 dnl ========================================================
6700 MOZ_ARG_WITH_STRING(wrap-malloc,
6701 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6702 WRAP_MALLOC_LIB=$withval)
6704 dnl ========================================================
6706 dnl ========================================================
6707 MOZ_ARG_ENABLE_BOOL(valgrind,
6708 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
6711 if test -n "$MOZ_VALGRIND"; then
6712 AC_CHECK_HEADER([valgrind/valgrind.h], [],
6714 [--enable-valgrind specified but Valgrind is not installed]))
6715 AC_DEFINE(MOZ_VALGRIND)
6718 dnl ========================================================
6719 dnl = Use Electric Fence
6720 dnl ========================================================
6721 MOZ_ARG_ENABLE_BOOL(efence,
6722 [ --enable-efence Link with Electric Fence],
6725 if test -n "$_ENABLE_EFENCE"; then
6726 AC_CHECK_LIB(efence,malloc)
6729 dnl ========================================================
6731 dnl ========================================================
6732 MOZ_ARG_ENABLE_BOOL(jprof,
6733 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6736 if test -n "$MOZ_JPROF"; then
6737 AC_DEFINE(MOZ_JPROF)
6740 dnl ========================================================
6742 dnl ========================================================
6743 MOZ_ARG_ENABLE_BOOL(shark,
6744 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6747 if test -n "$MOZ_SHARK"; then
6748 AC_DEFINE(MOZ_SHARK)
6751 dnl ========================================================
6753 dnl ========================================================
6754 MOZ_ARG_ENABLE_BOOL(callgrind,
6755 [ --enable-callgrind Enable callgrind profiling],
6758 if test -n "$MOZ_CALLGRIND"; then
6759 AC_DEFINE(MOZ_CALLGRIND)
6762 dnl ========================================================
6764 dnl ========================================================
6765 MOZ_ARG_ENABLE_BOOL(vtune,
6766 [ --enable-vtune Enable vtune profiling],
6769 if test -n "$MOZ_VTUNE"; then
6770 AC_DEFINE(MOZ_VTUNE)
6773 dnl ========================================================
6774 dnl Zealous JavaScript GC
6775 dnl ========================================================
6776 MOZ_ARG_ENABLE_BOOL(gczeal,
6777 [ --enable-gczeal Enable zealous JavaScript GCing],
6780 if test -n "$JS_GC_ZEAL"; then
6781 AC_DEFINE(JS_GC_ZEAL)
6784 dnl ========================================================
6785 dnl = Enable static checking using gcc-dehydra
6786 dnl ========================================================
6788 MOZ_ARG_WITH_STRING(static-checking,
6789 [ --with-static-checking=path/to/gcc_dehydra.so
6790 Enable static checking of code using GCC-dehydra],
6791 DEHYDRA_PATH=$withval,
6794 if test -n "$DEHYDRA_PATH"; then
6795 if test ! -f "$DEHYDRA_PATH"; then
6796 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
6798 AC_DEFINE(NS_STATIC_CHECKING)
6800 AC_SUBST(DEHYDRA_PATH)
6802 dnl ========================================================
6803 dnl = Enable stripping of libs & executables
6804 dnl ========================================================
6805 MOZ_ARG_ENABLE_BOOL(strip,
6806 [ --enable-strip Enable stripping of libs & executables ],
6810 dnl ========================================================
6811 dnl = Enable stripping of libs & executables when packaging
6812 dnl ========================================================
6813 MOZ_ARG_ENABLE_BOOL(install-strip,
6814 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6818 dnl ========================================================
6819 dnl = --enable-elf-dynstr-gc
6820 dnl ========================================================
6821 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6822 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6823 USE_ELF_DYNSTR_GC=1,
6824 USE_ELF_DYNSTR_GC= )
6826 dnl ========================================================
6827 dnl = --enable-old-abi-compat-wrappers
6828 dnl ========================================================
6829 dnl on x86 linux, the current builds of some popular plugins (notably
6830 dnl flashplayer and real) expect a few builtin symbols from libgcc
6831 dnl which were available in some older versions of gcc. However,
6832 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6833 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6834 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6835 dnl to true on x86 linux, and false everywhere else.
6838 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6839 [ --enable-old-abi-compat-wrappers
6840 Support old GCC ABI symbols to ease the pain
6841 of the linux compiler change],
6842 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6843 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6844 if test "$COMPILE_ENVIRONMENT"; then
6845 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6848 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6850 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6852 fi # COMPILE_ENVIRONMENT
6854 dnl ========================================================
6856 dnl = Profiling and Instrumenting
6858 dnl ========================================================
6859 MOZ_ARG_HEADER(Profiling and Instrumenting)
6861 dnl ========================================================
6862 dnl = Enable timeline service, which provides lightweight
6863 dnl = instrumentation of mozilla for performance measurement.
6864 dnl = Timeline is off by default.
6865 dnl ========================================================
6866 MOZ_ARG_ENABLE_BOOL(timeline,
6867 [ --enable-timeline Enable timeline services ],
6870 if test -n "$MOZ_TIMELINE"; then
6871 AC_DEFINE(MOZ_TIMELINE)
6874 dnl ========================================================
6875 dnl Turn on reflow counting
6876 dnl ========================================================
6877 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6878 [ --enable-reflow-perf Enable reflow performance tracing],
6881 if test -n "$MOZ_REFLOW_PERF"; then
6882 AC_DEFINE(MOZ_REFLOW_PERF)
6885 dnl ========================================================
6886 dnl Enable performance metrics.
6887 dnl ========================================================
6888 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6889 [ --enable-perf-metrics Enable performance metrics],
6892 if test -n "$MOZ_PERF_METRICS"; then
6893 AC_DEFINE(MOZ_PERF_METRICS)
6896 dnl ========================================================
6897 dnl Enable code size metrics.
6898 dnl ========================================================
6899 MOZ_ARG_ENABLE_BOOL(codesighs,
6900 [ --enable-codesighs Enable code size analysis tools],
6901 _ENABLE_CODESIGHS=1,
6902 _ENABLE_CODESIGHS= )
6903 if test -n "$_ENABLE_CODESIGHS"; then
6904 if test -d $srcdir/tools/codesighs; then
6907 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6911 dnl ========================================================
6912 dnl = Add support for Eazel profiler
6913 dnl ========================================================
6914 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6915 [ --enable-eazel-profiler-support
6916 Enable Corel/Eazel profiler support],
6917 ENABLE_EAZEL_PROFILER=1,
6918 ENABLE_EAZEL_PROFILER= )
6919 if test -n "$ENABLE_EAZEL_PROFILER"; then
6920 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6922 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6923 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6924 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6927 MOZ_ARG_ENABLE_STRING(profile-modules,
6928 [ --enable-profile-modules
6929 Enable/disable profiling for specific modules],
6930 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6932 MOZ_ARG_ENABLE_BOOL(insure,
6933 [ --enable-insure Enable insure++ instrumentation (linux only)],
6936 if test -n "$_ENABLE_INSURE"; then
6940 MOZ_INSURE_EXCLUDE_DIRS="config"
6943 MOZ_ARG_WITH_STRING(insure-dirs,
6944 [ --with-insure-dirs=DIRS
6945 Dirs to instrument with insure ],
6946 MOZ_INSURE_DIRS=$withval )
6948 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6949 [ --with-insure-exclude-dirs=DIRS
6950 Dirs to not instrument with insure ],
6951 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6953 dnl ========================================================
6954 dnl = Support for Quantify (Windows)
6955 dnl ========================================================
6956 MOZ_ARG_ENABLE_BOOL(quantify,
6957 [ --enable-quantify Enable Quantify support (Windows only) ],
6961 dnl ========================================================
6962 dnl = Support for demangling undefined symbols
6963 dnl ========================================================
6964 if test -z "$SKIP_LIBRARY_CHECKS"; then
6967 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6971 # Demangle only for debug or trace-malloc builds
6972 MOZ_DEMANGLE_SYMBOLS=
6973 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6974 MOZ_DEMANGLE_SYMBOLS=1
6975 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6977 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6979 dnl ========================================================
6980 dnl = Support for gcc stack unwinding (from gcc 3.3)
6981 dnl ========================================================
6982 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6983 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6986 dnl ========================================================
6990 dnl ========================================================
6991 MOZ_ARG_HEADER(Misc. Options)
6993 dnl ========================================================
6994 dnl update xterm title
6995 dnl ========================================================
6996 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6997 [ --enable-xterm-updates Update XTERM titles with current command.],
7001 dnl =========================================================
7003 dnl =========================================================
7004 MOZ_ARG_ENABLE_STRING([chrome-format],
7005 [ --enable-chrome-format=jar|flat|both|symlink
7006 Select FORMAT of chrome files (default=jar)],
7007 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7009 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7010 MOZ_CHROME_FILE_FORMAT=jar
7013 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
7014 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7015 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7016 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
7017 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
7020 dnl ========================================================
7021 dnl = Define default location for MOZILLA_FIVE_HOME
7022 dnl ========================================================
7023 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7024 [ --with-default-mozilla-five-home
7025 Set the default value for MOZILLA_FIVE_HOME],
7026 [ val=`echo $withval`
7027 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7029 dnl ========================================================
7030 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7031 dnl ========================================================
7032 MOZ_ARG_WITH_STRING(user-appdir,
7033 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7034 [ val=`echo $withval`
7035 if echo "$val" | grep "\/" >/dev/null; then
7036 AC_MSG_ERROR("Homedir must be single relative path.")
7041 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7043 dnl ========================================================
7044 dnl = Doxygen configuration
7045 dnl ========================================================
7046 dnl Use commas to specify multiple dirs to this arg
7047 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7048 MOZ_ARG_WITH_STRING(doc-input-dirs,
7049 [ --with-doc-input-dirs=DIRS
7050 Header/idl dirs to create docs from],
7051 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7052 AC_SUBST(MOZ_DOC_INPUT_DIRS)
7054 dnl Use commas to specify multiple dirs to this arg
7055 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7056 MOZ_ARG_WITH_STRING(doc-include-dirs,
7057 [ --with-doc-include-dirs=DIRS
7058 Include dirs to preprocess doc headers],
7059 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7060 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7062 MOZ_DOC_OUTPUT_DIR='./dist/docs'
7063 MOZ_ARG_WITH_STRING(doc-output-dir,
7064 [ --with-doc-output-dir=DIR
7065 Dir to generate docs into],
7066 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
7067 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7069 if test -z "$SKIP_COMPILER_CHECKS"; then
7070 dnl ========================================================
7072 dnl = Compiler Options
7074 dnl ========================================================
7075 MOZ_ARG_HEADER(Compiler Options)
7077 dnl ========================================================
7078 dnl Check for gcc -pipe support
7079 dnl ========================================================
7080 AC_MSG_CHECKING([for gcc -pipe support])
7081 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
7082 echo '#include <stdio.h>' > dummy-hello.c
7083 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7084 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7085 cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
7086 if test $? = 0; then
7091 if test "$_res_as_stdin" = "yes"; then
7092 _SAVE_CFLAGS=$CFLAGS
7093 CFLAGS="$CFLAGS -pipe"
7094 AC_TRY_COMPILE( [ #include <stdio.h> ],
7095 [printf("Hello World\n");],
7096 [_res_gcc_pipe="yes"],
7097 [_res_gcc_pipe="no"] )
7098 CFLAGS=$_SAVE_CFLAGS
7100 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
7102 CFLAGS="$CFLAGS -pipe"
7103 CXXFLAGS="$CXXFLAGS -pipe"
7107 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7108 AC_MSG_RESULT([$_res])
7113 dnl pass -Wno-long-long to the compiler
7114 MOZ_ARG_ENABLE_BOOL(long-long-warning,
7115 [ --enable-long-long-warning
7116 Warn about use of non-ANSI long long type],
7117 _IGNORE_LONG_LONG_WARNINGS=,
7118 _IGNORE_LONG_LONG_WARNINGS=1)
7120 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
7121 _SAVE_CFLAGS="$CFLAGS"
7122 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
7123 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
7124 AC_TRY_COMPILE([], [return(0);],
7125 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7126 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7127 result="yes" ], result="no")
7128 AC_MSG_RESULT([$result])
7129 CFLAGS="$_SAVE_CFLAGS"
7132 dnl ========================================================
7133 dnl Profile guided optimization
7134 dnl ========================================================
7135 dnl Test for profiling options
7136 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
7137 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7139 dnl Provide a switch to disable PGO even when called via profiledbuild.
7140 MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
7141 [ --disable-profile-guided-optimization
7142 Don't build with PGO even if called via make profiledbuild],
7143 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
7144 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
7146 AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
7148 _SAVE_CFLAGS="$CFLAGS"
7149 CFLAGS="$CFLAGS -fprofile-generate"
7151 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7152 AC_TRY_COMPILE([], [return 0;],
7153 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7154 result="yes" ], result="no")
7155 AC_MSG_RESULT([$result])
7157 if test $result = "yes"; then
7158 PROFILE_GEN_LDFLAGS="-fprofile-generate"
7159 PROFILE_USE_CFLAGS="-fprofile-use"
7160 PROFILE_USE_LDFLAGS="-fprofile-use"
7162 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
7163 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
7164 AC_TRY_COMPILE([], [return 0;],
7165 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
7166 result="yes" ], result="no")
7167 AC_MSG_RESULT([$result])
7168 if test $result = "yes"; then
7169 PROFILE_USE_CFLAGS="-fbranch-probabilities"
7171 # don't really care, this is an old GCC
7172 PROFILE_GEN_LDFLAGS=
7173 PROFILE_USE_LDFLAGS=
7176 CFLAGS="$_SAVE_CFLAGS"
7178 if test -n "$INTEL_CC"; then
7179 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7180 PROFILE_GEN_LDFLAGS=
7181 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7182 PROFILE_USE_LDFLAGS=
7185 dnl Sun Studio on Solaris
7186 if test "$SOLARIS_SUNPRO_CC"; then
7187 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7188 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7189 if test "$CPU_ARCH" != "sparc"; then
7190 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7191 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7193 PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7194 PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7198 AC_SUBST(PROFILE_GEN_CFLAGS)
7199 AC_SUBST(PROFILE_GEN_LDFLAGS)
7200 AC_SUBST(PROFILE_USE_CFLAGS)
7201 AC_SUBST(PROFILE_USE_LDFLAGS)
7205 dnl ========================================================
7206 dnl Test for -pedantic bustage
7207 dnl ========================================================
7208 MOZ_ARG_DISABLE_BOOL(pedantic,
7209 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7211 if test "$_PEDANTIC"; then
7212 _SAVE_CXXFLAGS=$CXXFLAGS
7213 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7214 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7215 AC_TRY_COMPILE([$configure_static_assert_macros],
7216 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7217 result="no", result="yes" )
7218 AC_MSG_RESULT([$result])
7219 CXXFLAGS="$_SAVE_CXXFLAGS"
7223 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
7224 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7227 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7232 dnl ========================================================
7233 dnl Test for correct temporary object destruction order
7234 dnl ========================================================
7235 dnl We want to make sure the compiler follows the C++ spec here as
7236 dnl xpcom and the string classes depend on it (bug 235381).
7237 AC_MSG_CHECKING([for correct temporary object destruction order])
7238 AC_TRY_RUN([ class A {
7239 public: A(int& x) : mValue(x) {}
7241 operator char**() { return 0; }
7242 private: int& mValue;
7244 void func(char **arg) {}
7255 result="yes", result="no", result="maybe")
7256 AC_MSG_RESULT([$result])
7258 if test "$result" = "no"; then
7259 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
7262 dnl ========================================================
7263 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7264 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7265 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7266 dnl ========================================================
7267 _SAVE_CXXFLAGS=$CXXFLAGS
7268 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7269 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7270 ac_nscap_nonconst_opeq_bug,
7279 template <class T, class U>
7280 int operator==(const Pointer<T>& rhs, U* lhs)
7282 return rhs.myPtr == lhs;
7285 template <class T, class U>
7286 int operator==(const Pointer<T>& rhs, const U* lhs)
7288 return rhs.myPtr == lhs;
7296 ac_nscap_nonconst_opeq_bug="no",
7297 ac_nscap_nonconst_opeq_bug="yes")])
7298 CXXFLAGS="$_SAVE_CXXFLAGS"
7300 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7301 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7303 fi # SKIP_COMPILER_CHECKS
7305 dnl ========================================================
7307 dnl Should be smarter and check that the compiler does indeed have rtti
7308 dnl ========================================================
7309 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
7310 [ --enable-cpp-rtti Enable C++ RTTI ],
7311 [ _MOZ_USE_RTTI=1 ],
7314 if test "$_MOZ_USE_RTTI"; then
7315 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
7317 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
7320 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
7322 dnl ========================================================
7323 dnl C++ exceptions (g++/egcs only - for now)
7324 dnl Should be smarter and check that the compiler does indeed have exceptions
7325 dnl ========================================================
7326 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
7327 [ --enable-cpp-exceptions Enable C++ exceptions ],
7328 [ _MOZ_CPP_EXCEPTIONS=1 ],
7329 [ _MOZ_CPP_EXCEPTIONS= ])
7331 if test "$_MOZ_CPP_EXCEPTIONS"; then
7332 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
7334 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
7337 # Irix & OSF native compilers do not like exception declarations
7338 # when exceptions are disabled
7339 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
7340 AC_DEFINE(CPP_THROW_NEW, [])
7342 AC_DEFINE(CPP_THROW_NEW, [throw()])
7346 dnl ========================================================
7348 dnl = Build depencency options
7350 dnl ========================================================
7351 MOZ_ARG_HEADER(Build dependencies)
7353 dnl ========================================================
7354 dnl = Do not auto generate dependency info
7355 dnl ========================================================
7357 MOZ_ARG_DISABLE_BOOL(auto-deps,
7358 [ --disable-auto-deps Do not automatically generate dependency info],
7362 if test -n "$MOZ_AUTO_DEPS"; then
7363 dnl ========================================================
7364 dnl = Use mkdepend instead of $CC -MD for dependency generation
7365 dnl ========================================================
7367 MOZ_ARG_DISABLE_BOOL(md,
7368 [ --disable-md Do not use compiler-based dependencies ],
7371 [dnl Default is to turn on -MD if using GNU-compatible compilers
7372 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
7375 dnl Default is to use -xM if using Sun Studio on Solaris
7376 if test "$SOLARIS_SUNPRO_CC"; then
7379 if test "$_cpp_md_flag"; then
7381 if test "$OS_ARCH" = "OpenVMS"; then
7382 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
7384 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
7386 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7387 if test "$SOLARIS_SUNPRO_CC"; then
7392 _USE_CPP_INCLUDE_FLAG=
7393 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7394 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7398 AC_SUBST(MOZ_AUTO_DEPS)
7399 AC_SUBST(COMPILER_DEPEND)
7403 dnl ========================================================
7405 dnl = Static Build Options
7407 dnl ========================================================
7408 MOZ_ARG_HEADER(Static build options)
7410 MOZ_ARG_ENABLE_BOOL(static,
7411 [ --enable-static Enable building of internal static libs],
7412 BUILD_STATIC_LIBS=1,
7415 dnl Disable libxul in debug builds, but not for xulrunner.
7416 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
7420 MOZ_ARG_ENABLE_BOOL(libxul,
7421 [ --enable-libxul Enable building of libxul],
7422 MOZ_ENABLE_LIBXUL=1,
7425 if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
7426 AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME. You probably want --enable-libxul.])
7429 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
7430 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
7433 AC_SUBST(LIBXUL_LIBS)
7435 if test -n "$MOZ_ENABLE_LIBXUL"; then
7436 XPCOM_LIBS="$LIBXUL_LIBS"
7437 AC_DEFINE(MOZ_ENABLE_LIBXUL)
7439 if test -n "$BUILD_STATIC_LIBS"; then
7440 AC_DEFINE(MOZ_STATIC_BUILD)
7442 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
7445 dnl ========================================================
7447 dnl = Standalone module options
7449 dnl ========================================================
7450 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7452 dnl Check for GLib and libIDL.
7453 dnl ========================================================
7454 case "$target_os" in
7455 msvc*|mks*|cygwin*|mingw*|wince*)
7456 SKIP_IDL_CHECK="yes"
7463 if test -z "$COMPILE_ENVIRONMENT"; then
7464 SKIP_IDL_CHECK="yes"
7467 dnl = Allow users to disable libIDL checking for standalone modules
7468 MOZ_ARG_WITHOUT_BOOL(libIDL,
7469 [ --without-libIDL Skip check for libIDL (standalone modules only)],
7470 SKIP_IDL_CHECK="yes")
7472 if test "$SKIP_IDL_CHECK" = "no"
7475 if test "$MACOS_SDK_DIR"; then
7476 dnl xpidl, and therefore libIDL, is only needed on the build host.
7477 dnl Don't build it against the SDK, as that causes problems.
7478 _MACSAVE_CFLAGS="$CFLAGS"
7479 _MACSAVE_LIBS="$LIBS"
7480 _MACSAVE_LDFLAGS="$LDFLAGS"
7481 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
7483 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"`
7484 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
7485 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
7490 if test "$MOZ_ENABLE_GTK2"; then
7491 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
7493 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
7494 dnl to either libIDL1 or libIDL2.
7495 if test -z "$_LIBIDL_FOUND"; then
7496 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
7497 if test -z "$_LIBIDL_FOUND"; then
7498 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
7502 dnl If we don't have a libIDL config program & not cross-compiling,
7503 dnl look for orbit-config instead.
7505 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
7506 MOZ_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
7507 if test -n "$ORBIT_CONFIG"; then
7508 AC_MSG_CHECKING([for ORBit libIDL usability])
7509 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
7510 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
7511 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
7512 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
7513 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
7514 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
7516 _SAVE_CFLAGS="$CFLAGS"
7518 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
7519 LIBS="$LIBIDL_LIBS $LIBS"
7522 #include <libIDL/IDL.h>
7525 s=strdup(IDL_get_libver_string());
7538 AC_MSG_RESULT($result)
7539 CFLAGS="$_SAVE_CFLAGS"
7543 if test -z "$_LIBIDL_FOUND"; then
7544 AC_MSG_ERROR([libIDL not found.
7545 libIDL $LIBIDL_VERSION or higher is required.])
7547 if test "$MACOS_SDK_DIR"; then
7548 CFLAGS="$_MACSAVE_CFLAGS"
7549 LIBS="$_MACSAVE_LIBS"
7550 LDFLAGS="$_MACSAVE_LDFLAGS"
7551 if test -n "$_MACSAVE_NEXT_ROOT" ; then
7552 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
7557 if test -n "$CROSS_COMPILE"; then
7558 if test -z "$HOST_LIBIDL_CONFIG"; then
7559 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
7561 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
7562 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
7563 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
7565 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
7566 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
7570 if test -z "$SKIP_PATH_CHECKS"; then
7571 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
7572 if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" ; then
7573 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7575 AM_PATH_GLIB(${GLIB_VERSION})
7580 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
7581 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7584 AC_SUBST(LIBIDL_CFLAGS)
7585 AC_SUBST(LIBIDL_LIBS)
7586 AC_SUBST(STATIC_LIBIDL)
7587 AC_SUBST(GLIB_CFLAGS)
7589 AC_SUBST(GLIB_GMODULE_LIBS)
7590 AC_SUBST(HOST_LIBIDL_CONFIG)
7591 AC_SUBST(HOST_LIBIDL_CFLAGS)
7592 AC_SUBST(HOST_LIBIDL_LIBS)
7594 dnl ========================================================
7596 dnl ========================================================
7597 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7600 MOZ_ARG_ENABLE_BOOL(system-cairo,
7601 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7605 # Check for headers defining standard int types.
7606 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7608 if test "$MOZ_TREE_CAIRO"; then
7609 AC_DEFINE(MOZ_TREE_CAIRO)
7611 # For now we assume that we will have a uint64_t available through
7612 # one of the above headers or mozstdint.h.
7613 AC_DEFINE(HAVE_UINT64_T)
7615 # Define macros for cairo-features.h
7616 if test "$MOZ_X11"; then
7617 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7618 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7619 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7620 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7621 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7622 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7623 MOZ_ENABLE_CAIRO_FT=1
7624 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7626 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
7627 QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
7629 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7630 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7631 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7632 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7634 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7635 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7636 if test -z "$WINCE"; then
7637 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7638 DDRAW_SURFACE_FEATURE=
7642 AC_TRY_COMPILE([#include <ddraw.h>], [int foo = DDLOCK_WAITNOTBUSY;], HAS_DDRAW=1, HAS_DDRAW=)
7643 if test -z "$HAS_DDRAW"; then
7644 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.])
7645 DDRAW_SURFACE_FEATURE=
7647 DDRAW_SURFACE_FEATURE="#define CAIRO_HAS_DDRAW_SURFACE 1"
7650 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7652 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7653 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7654 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7655 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7656 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7657 MOZ_ENABLE_CAIRO_FT=1
7658 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7659 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7661 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7662 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7663 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7664 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7665 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7666 MOZ_ENABLE_CAIRO_FT=1
7668 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7669 AC_SUBST(CAIRO_FT_CFLAGS)
7671 if test "$MOZ_DEBUG"; then
7672 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7674 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7677 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7679 AC_SUBST(PS_SURFACE_FEATURE)
7680 AC_SUBST(PDF_SURFACE_FEATURE)
7681 AC_SUBST(SVG_SURFACE_FEATURE)
7682 AC_SUBST(XLIB_SURFACE_FEATURE)
7683 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7684 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7685 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7686 AC_SUBST(XCB_SURFACE_FEATURE)
7687 AC_SUBST(WIN32_SURFACE_FEATURE)
7688 AC_SUBST(DDRAW_SURFACE_FEATURE)
7689 AC_SUBST(OS2_SURFACE_FEATURE)
7690 AC_SUBST(BEOS_SURFACE_FEATURE)
7691 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7692 AC_SUBST(FT_FONT_FEATURE)
7693 AC_SUBST(FC_FONT_FEATURE)
7694 AC_SUBST(WIN32_FONT_FEATURE)
7695 AC_SUBST(QUARTZ_FONT_FEATURE)
7696 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7697 AC_SUBST(QPAINTER_SURFACE_FEATURE)
7699 if test "$_WIN32_MSVC"; then
7700 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7702 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"
7704 if test "$MOZ_X11"; then
7705 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7709 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7710 mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
7713 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7714 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7715 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7716 if test "$MOZ_X11"; then
7717 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7718 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7719 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7723 AC_SUBST(MOZ_TREE_CAIRO)
7724 AC_SUBST(MOZ_CAIRO_CFLAGS)
7725 AC_SUBST(MOZ_CAIRO_LIBS)
7728 dnl ========================================================
7730 QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
7733 dnl ========================================================
7735 dnl ========================================================
7736 MOZ_ARG_DISABLE_BOOL(xul,
7737 [ --disable-xul Disable XUL],
7739 if test "$MOZ_XUL"; then
7742 dnl remove extensions that require XUL
7743 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7748 dnl ========================================================
7749 dnl Two ways to enable Python support:
7750 dnl --enable-extensions=python # select all available.
7751 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7753 dnl --enable-extensions=python/xpcom,... # select individual ones
7755 dnl If either is used, we locate the Python to use.
7756 dnl ========================================================
7758 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7759 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7760 dnl Allow PYTHON to point to the Python interpreter to use
7761 dnl (note that it must be the python executable - which we
7762 dnl run to locate the relevant paths etc)
7763 dnl If not set, we use whatever Python we can find.
7765 dnl Ask Python what its version number is
7767 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7768 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7770 dnl Ask for the Python "prefix" (ie, home/source dir)
7771 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7772 dnl Setup the include and library directories.
7773 if test "$OS_ARCH" = "WINNT"; then
7774 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7775 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7776 dnl Binary trees have "include" for .h, and "libs" for .lib
7777 dnl We add 'em both - along with quotes, to handle spaces.
7778 MOZ_PYTHON_DLL_SUFFIX=.pyd
7779 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7780 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7782 dnl Non-Windows include and libs
7783 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7784 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7785 dnl Check for dynamic Python lib
7786 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7787 dnl - core, xpcom loader, pydom etc) all need to share Python.
7788 dnl - Python 2.3's std --enable-shared configure option will
7789 dnl create a libpython2.3.so.1.0. We should first try this
7790 dnl dotted versioned .so file because this is the one that
7791 dnl the PyXPCOM build mechanics tries to link to.
7792 dnl XXX Should find a better way than hardcoding "1.0".
7793 dnl - Python developement tree dir layouts are NOT allowed here
7794 dnl because the PyXPCOM build just dies on it later anyway.
7795 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7796 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7797 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7798 elif test -f "$MOZ_PYTHON_PREFIX/lib64/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7799 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib64 -lpython$MOZ_PYTHON_VER_DOTTED"
7800 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7801 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7802 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7803 dnl Don't Python development tree directory layout.
7804 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7805 AC_MSG_ERROR([The Python at $MOZ_PYTHON_PREFIX looks like a dev tree. The PyXPCOM build cannot handle this yet. You must 'make install' Python and use the installed tree.])
7806 elif test "$OS_ARCH" = "Darwin"; then
7807 dnl We do Darwin last, so if a custom non-framework build of
7808 dnl python is used on OSX, then it will be picked up first by
7809 dnl the logic above.
7810 MOZ_PYTHON_LIBS="-framework Python"
7812 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7814 if test "$OS_ARCH" = "Linux"; then
7815 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7818 dnl Handle "_d" on Windows
7819 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7820 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7822 MOZ_PYTHON_DEBUG_SUFFIX=
7824 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7827 dnl If the user asks for the 'python' extension, then we add
7828 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7829 dnl Note the careful regex - it must match 'python' followed by anything
7830 dnl other than a '/', including the end-of-string.
7831 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7832 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7833 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7836 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7837 dnl command-line, but not yet
7838 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7839 AC_SUBST(MOZ_PYTHON)
7840 AC_SUBST(MOZ_PYTHON_PREFIX)
7841 AC_SUBST(MOZ_PYTHON_INCLUDES)
7842 AC_SUBST(MOZ_PYTHON_LIBS)
7843 AC_SUBST(MOZ_PYTHON_VER)
7844 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7845 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7846 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7848 dnl ========================================================
7849 dnl disable profile locking
7850 dnl do no use this in applications that can have more than
7851 dnl one process accessing the profile directory.
7852 dnl ========================================================
7853 MOZ_ARG_DISABLE_BOOL(profilelocking,
7854 [ --disable-profilelocking Disable profile locking],
7855 MOZ_PROFILELOCKING=,
7856 MOZ_PROFILELOCKING=1 )
7857 if test "$MOZ_PROFILELOCKING"; then
7858 AC_DEFINE(MOZ_PROFILELOCKING)
7861 dnl ========================================================
7862 dnl disable rdf services
7863 dnl ========================================================
7864 MOZ_ARG_DISABLE_BOOL(rdf,
7865 [ --disable-rdf Disable RDF],
7867 if test "$MOZ_RDF"; then
7873 dnl ========================================================
7874 dnl necko configuration options
7875 dnl ========================================================
7878 dnl option to disable various necko protocols
7880 MOZ_ARG_ENABLE_STRING(necko-protocols,
7881 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7882 Enable/disable specific protocol handlers],
7883 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7884 if test "$option" = "yes" || test "$option" = "all"; then
7885 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7886 elif test "$option" = "no" || test "$option" = "none"; then
7888 elif test "$option" = "default"; then
7889 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7890 elif test `echo "$option" | grep -c \^-` != 0; then
7891 option=`echo $option | sed 's/^-//'`
7892 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7894 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7897 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7899 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7900 AC_SUBST(NECKO_PROTOCOLS)
7901 for p in $NECKO_PROTOCOLS; do
7902 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7906 dnl option to disable necko's disk cache
7908 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7909 [ --disable-necko-disk-cache
7910 Disable necko disk cache],
7913 AC_SUBST(NECKO_DISK_CACHE)
7914 if test "$NECKO_DISK_CACHE"; then
7915 AC_DEFINE(NECKO_DISK_CACHE)
7919 dnl option to disable necko's wifi scanner
7921 MOZ_ARG_DISABLE_BOOL(necko-wifi,
7922 [ --disable-necko-wifi Disable necko wifi scanner],
7926 if test "$NECKO_WIFI"; then
7928 if test "$OS_ARCH" = "Linux"; then
7929 AC_CHECK_HEADER([iwlib.h])
7930 if test "$ac_cv_header_iwlib_h" = "yes"; then
7933 elif test "$OS_ARCH" = "Darwin"; then
7935 elif test "$OS_ARCH" = "WINNT"; then
7937 elif test "$OS_ARCH" = "WINCE"; then
7940 AC_MSG_WARN([Necko WiFi scanning not supported on your platform.])
7942 AC_SUBST(NECKO_WIFI)
7944 if test "$NECKO_WIFI"; then
7945 AC_DEFINE(NECKO_WIFI)
7949 AC_SUBST(NECKO_WIFI)
7953 dnl option to minimize size of necko's i/o buffers
7955 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7956 [ --enable-necko-small-buffers
7957 Minimize size of necko's i/o buffers],
7958 NECKO_SMALL_BUFFERS=1,
7959 NECKO_SMALL_BUFFERS=)
7960 AC_SUBST(NECKO_SMALL_BUFFERS)
7961 if test "$NECKO_SMALL_BUFFERS"; then
7962 AC_DEFINE(NECKO_SMALL_BUFFERS)
7966 dnl option to disable cookies
7968 MOZ_ARG_DISABLE_BOOL(cookies,
7969 [ --disable-cookies Disable cookie support],
7972 AC_SUBST(NECKO_COOKIES)
7973 if test "$NECKO_COOKIES"; then
7974 AC_DEFINE(NECKO_COOKIES)
7977 dnl NECKO_ configuration options are not global
7978 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7980 dnl Only build Mork if it's required
7982 if test "$MOZ_MORK"; then
7986 dnl Build the lightweight Mork reader if required
7987 AC_SUBST(MOZ_MORKREADER)
7988 if test "$MOZ_MORKREADER"; then
7989 AC_DEFINE(MOZ_MORKREADER)
7992 dnl ========================================================
7993 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7994 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7997 dnl ========================================================
7999 dnl = Maintainer debug option (no --enable equivalent)
8001 dnl ========================================================
8006 AC_SUBST(AR_EXTRACT)
8010 AC_SUBST(AS_DASH_C_FLAG)
8015 AC_SUBST(USE_SHORT_LIBNAME)
8019 AC_SUBST(NS_USE_NATIVE)
8020 AC_SUBST(MOZ_WIDGET_TOOLKIT)
8021 AC_SUBST(MOZ_GFX_TOOLKIT)
8022 AC_SUBST(MOZ_UPDATE_XTERM)
8024 AC_SUBST(MOZ_PLATFORM_HILDON)
8026 AC_SUBST(NS_MAEMO_LOCATION)
8027 AC_SUBST(MOZ_AUTH_EXTENSION)
8028 AC_SUBST(MOZ_MATHML)
8029 AC_SUBST(MOZ_PERMISSIONS)
8031 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
8032 AC_SUBST(MOZ_PREF_EXTENSIONS)
8035 AC_SUBST(MOZ_XSLT_STANDALONE)
8036 AC_SUBST(MOZ_JS_LIBS)
8039 AC_SUBST(MOZ_DEBUG_MODULES)
8040 AC_SUBST(MOZ_PROFILE_MODULES)
8041 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8042 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8043 AC_SUBST(MOZ_DEBUG_FLAGS)
8044 AC_SUBST(MOZ_DEBUG_LDFLAGS)
8045 AC_SUBST(WARNINGS_AS_ERRORS)
8046 AC_SUBST(MOZ_DBGRINFO_MODULES)
8047 AC_SUBST(MOZ_EXTENSIONS)
8048 AC_SUBST(MOZ_IMG_DECODERS)
8049 AC_SUBST(MOZ_IMG_ENCODERS)
8050 AC_SUBST(MOZ_JSDEBUGGER)
8051 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
8052 AC_SUBST(MOZ_PLUGINS)
8053 AC_SUBST(ENABLE_EAZEL_PROFILER)
8054 AC_SUBST(EAZEL_PROFILER_CFLAGS)
8055 AC_SUBST(EAZEL_PROFILER_LIBS)
8056 AC_SUBST(MOZ_PERF_METRICS)
8057 AC_SUBST(GC_LEAK_DETECTOR)
8058 AC_SUBST(MOZ_LOG_REFCNT)
8062 AC_SUBST(MOZ_CALLGRIND)
8064 AC_SUBST(MOZ_XPCTOOLS)
8065 AC_SUBST(MOZ_JSLOADER)
8066 AC_SUBST(MOZ_USE_NATIVE_UCONV)
8067 AC_SUBST(MOZ_INSURE)
8068 AC_SUBST(MOZ_INSURE_DIRS)
8069 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
8070 AC_SUBST(MOZ_QUANTIFY)
8071 AC_SUBST(MOZ_INSURIFYING)
8073 AC_SUBST(MOZ_PLACES)
8074 AC_SUBST(MOZ_PLACES_BOOKMARKS)
8075 AC_SUBST(MOZ_STORAGE)
8077 AC_SUBST(NS_PRINTING)
8079 AC_SUBST(MOZ_JAVAXPCOM)
8080 AC_SUBST(JAVA_INCLUDE_PATH)
8085 AC_SUBST(MOZ_PROFILELOCKING)
8088 AC_SUBST(MOZ_XIE_LIBS)
8089 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
8091 AC_SUBST(XPCOM_USE_LEA)
8092 AC_SUBST(BUILD_STATIC_LIBS)
8093 AC_SUBST(MOZ_ENABLE_LIBXUL)
8094 AC_SUBST(ENABLE_TESTS)
8096 AC_SUBST(MOZ_UNIVERSALCHARDET)
8097 AC_SUBST(ACCESSIBILITY)
8098 AC_SUBST(MOZ_XPINSTALL)
8099 AC_SUBST(MOZ_VIEW_SOURCE)
8100 AC_SUBST(MOZ_SPELLCHECK)
8101 AC_SUBST(MOZ_XPFE_COMPONENTS)
8102 AC_SUBST(MOZ_USER_DIR)
8103 AC_SUBST(MOZ_CRASHREPORTER)
8105 AC_SUBST(ENABLE_STRIP)
8106 AC_SUBST(PKG_SKIP_STRIP)
8107 AC_SUBST(USE_ELF_DYNSTR_GC)
8108 AC_SUBST(INCREMENTAL_LINKER)
8109 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8110 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8111 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
8113 AC_SUBST(MOZ_FIX_LINK_PATHS)
8114 AC_SUBST(XPCOM_LIBS)
8115 AC_SUBST(XPCOM_FROZEN_LDOPTS)
8116 AC_SUBST(XPCOM_GLUE_LDOPTS)
8117 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8119 AC_SUBST(USE_DEPENDENT_LIBS)
8121 AC_SUBST(MOZ_BUILD_ROOT)
8122 AC_SUBST(MOZ_OS2_TOOLS)
8123 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
8125 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8126 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8127 AC_SUBST(MOZ_TIMELINE)
8129 AC_SUBST(WINCE_SDK_DIR)
8131 AC_SUBST(MOZ_APP_NAME)
8132 AC_SUBST(MOZ_APP_DISPLAYNAME)
8133 AC_SUBST(MOZ_APP_VERSION)
8134 AC_SUBST(FIREFOX_VERSION)
8136 AC_SUBST(MOZ_PKG_SPECIAL)
8138 AC_SUBST(MOZILLA_OFFICIAL)
8139 AC_SUBST(BUILD_OFFICIAL)
8140 AC_SUBST(MOZ_MILESTONE_RELEASE)
8143 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8144 AC_SUBST(MOZ_MAPINFO)
8145 AC_SUBST(MOZ_BROWSE_INFO)
8146 AC_SUBST(MOZ_TOOLS_DIR)
8147 AC_SUBST(CYGWIN_WRAPPER)
8149 AC_SUBST(WIN32_REDIST_DIR)
8153 AC_SUBST(WINCE_WINDOWS_MOBILE)
8155 dnl Echo the CFLAGS to remove extra whitespace.
8162 $_MOZ_EXCEPTIONS_FLAGS \
8163 $_WARNINGS_CXXFLAGS \
8166 COMPILE_CFLAGS=`echo \
8171 COMPILE_CXXFLAGS=`echo \
8172 $_DEFINES_CXXFLAGS \
8176 AC_SUBST(SYSTEM_MAKEDEPEND)
8177 AC_SUBST(SYSTEM_LIBXUL)
8178 AC_SUBST(SYSTEM_JPEG)
8179 AC_SUBST(SYSTEM_PNG)
8180 AC_SUBST(SYSTEM_ZLIB)
8181 AC_SUBST(SYSTEM_BZ2)
8183 AC_SUBST(JPEG_CFLAGS)
8185 AC_SUBST(ZLIB_CFLAGS)
8187 AC_SUBST(BZ2_CFLAGS)
8189 AC_SUBST(PNG_CFLAGS)
8192 AC_SUBST(MOZ_JPEG_CFLAGS)
8193 AC_SUBST(MOZ_JPEG_LIBS)
8194 AC_SUBST(MOZ_ZLIB_CFLAGS)
8195 AC_SUBST(MOZ_ZLIB_LIBS)
8196 AC_SUBST(MOZ_BZ2_CFLAGS)
8197 AC_SUBST(MOZ_BZ2_LIBS)
8198 AC_SUBST(MOZ_PNG_CFLAGS)
8199 AC_SUBST(MOZ_PNG_LIBS)
8201 AC_SUBST(NSPR_CFLAGS)
8203 AC_SUBST(MOZ_NATIVE_NSPR)
8205 AC_SUBST(NSS_CFLAGS)
8207 AC_SUBST(NSS_DEP_LIBS)
8208 AC_SUBST(MOZ_NATIVE_NSS)
8209 AC_SUBST(NSS_DISABLE_DBM)
8214 AC_SUBST(COMPILE_CFLAGS)
8215 AC_SUBST(COMPILE_CXXFLAGS)
8218 AC_SUBST(CROSS_COMPILE)
8219 AC_SUBST(WCHAR_CFLAGS)
8223 AC_SUBST(HOST_CFLAGS)
8224 AC_SUBST(HOST_CXXFLAGS)
8225 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8227 AC_SUBST(HOST_AR_FLAGS)
8229 AC_SUBST(HOST_RANLIB)
8230 AC_SUBST(HOST_NSPR_MDCPUCFG)
8231 AC_SUBST(HOST_BIN_SUFFIX)
8232 AC_SUBST(HOST_OS_ARCH)
8234 AC_SUBST(TARGET_CPU)
8235 AC_SUBST(TARGET_VENDOR)
8237 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8238 AC_SUBST(TARGET_MD_ARCH)
8239 AC_SUBST(TARGET_XPCOM_ABI)
8242 AC_SUBST(OS_RELEASE)
8245 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
8246 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8248 AC_SUBST(WRAP_MALLOC_CFLAGS)
8249 AC_SUBST(WRAP_MALLOC_LIB)
8252 AC_SUBST(MKSHLIB_FORCE_ALL)
8253 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8254 AC_SUBST(DSO_CFLAGS)
8255 AC_SUBST(DSO_PIC_CFLAGS)
8256 AC_SUBST(DSO_LDOPTS)
8257 AC_SUBST(LIB_PREFIX)
8258 AC_SUBST(DLL_PREFIX)
8259 AC_SUBST(DLL_SUFFIX)
8260 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8261 AC_SUBST(LIB_SUFFIX)
8262 AC_SUBST(OBJ_SUFFIX)
8263 AC_SUBST(BIN_SUFFIX)
8264 AC_SUBST(ASM_SUFFIX)
8265 AC_SUBST(IMPORT_LIB_SUFFIX)
8267 AC_SUBST(CC_VERSION)
8268 AC_SUBST(CXX_VERSION)
8269 AC_SUBST(MSMANIFEST_TOOL)
8271 if test "$USING_HCC"; then
8272 CC='${topsrcdir}/build/hcc'
8274 CXX='${topsrcdir}/build/hcpp'
8275 CXX="$CXX '$_OLDCXX'"
8280 dnl Check for missing components
8281 if test "$COMPILE_ENVIRONMENT"; then
8282 if test "$MOZ_X11"; then
8283 dnl ====================================================
8284 dnl = Check if X headers exist
8285 dnl ====================================================
8286 _SAVE_CFLAGS=$CFLAGS
8287 CFLAGS="$CFLAGS $XCFLAGS"
8291 #include <X11/Xlib.h>
8292 #include <X11/Intrinsic.h>
8296 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8297 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8301 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8302 CFLAGS="$_SAVE_CFLAGS"
8304 if test ! -z "$MISSING_X"; then
8305 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8309 fi # COMPILE_ENVIRONMENT
8311 dnl Set various defines and substitutions
8312 dnl ========================================================
8314 if test "$OS_ARCH" = "BeOS"; then
8317 elif test "$OS_ARCH" = "Darwin"; then
8319 AC_DEFINE(UNIX_ASYNC_DNS)
8321 elif test "$OS_ARCH" = "OpenVMS"; then
8323 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
8325 AC_DEFINE(UNIX_ASYNC_DNS)
8328 AC_SUBST(MOZ_MOVEMAIL)
8330 if test "$MOZ_DEBUG"; then
8331 AC_DEFINE(MOZ_REFLOW_PERF)
8332 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8335 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8336 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8337 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8338 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8339 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8340 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8341 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8342 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8343 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8346 # Used for LD_LIBRARY_PATH of run_viewer target
8348 for lib_arg in $NSPR_LIBS $TK_LIBS; do
8350 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
8356 dnl ========================================================
8357 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
8358 dnl ========================================================
8361 WIN_TOP_SRC=`cd $srcdir; pwd -W`
8364 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
8365 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
8366 CC="\$(CYGWIN_WRAPPER) $CC"
8367 CXX="\$(CYGWIN_WRAPPER) $CXX"
8368 CPP="\$(CYGWIN_WRAPPER) $CPP"
8369 LD="\$(CYGWIN_WRAPPER) $LD"
8370 AS="\$(CYGWIN_WRAPPER) $AS"
8371 RC="\$(CYGWIN_WRAPPER) $RC"
8372 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
8373 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
8374 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
8378 AC_SUBST(CYGDRIVE_MOUNT)
8379 AC_SUBST(WIN_TOP_SRC)
8381 AC_SUBST(MOZILLA_VERSION)
8383 AC_SUBST(ac_configure_args)
8385 dnl Spit out some output
8386 dnl ========================================================
8388 dnl The following defines are used by xpcom
8389 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8391 HAVE_CPP_2BYTE_WCHAR_T
8392 HAVE_CPP_ACCESS_CHANGING_USING
8393 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8395 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8397 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8398 HAVE_CPP_NAMESPACE_STD
8400 HAVE_CPP_PARTIAL_SPECIALIZATION
8401 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8403 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
8405 NEED_CPP_UNUSED_IMPLEMENTATIONS
8409 HAVE_ICONV_WITH_CONST_INPUT
8417 netwerk/necko-config.h
8418 xpcom/xpcom-config.h
8419 xpcom/xpcom-private.h
8422 # Save the defines header file before autoconf removes it.
8423 # (Do not add AC_DEFINE calls after this line.)
8424 _CONFIG_TMP=confdefs-tmp.h
8425 _CONFIG_DEFS_H=mozilla-config.h
8427 cat > $_CONFIG_TMP <<\EOF
8428 /* List of defines generated by configure. Included with preprocessor flag,
8429 * -include, to avoid long list of -D defines on the compile command-line.
8433 #ifndef _MOZILLA_CONFIG_H_
8434 #define _MOZILLA_CONFIG_H_
8437 _EGREP_PATTERN='^#define ('
8438 if test -n "$_NON_GLOBAL_ACDEFINES"; then
8439 for f in $_NON_GLOBAL_ACDEFINES; do
8440 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
8443 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
8445 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
8447 cat >> $_CONFIG_TMP <<\EOF
8449 #endif /* _MOZILLA_CONFIG_H_ */
8453 # Only write mozilla-config.h when something changes (or it doesn't exist)
8454 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
8457 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
8458 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
8460 echo ==== $_CONFIG_DEFS_H =================================
8464 dnl Probably shouldn't call this manually but we always want the output of DEFS
8465 rm -f confdefs.h.save
8466 mv confdefs.h confdefs.h.save
8467 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
8468 AC_OUTPUT_MAKE_DEFS()
8470 AC_SUBST(MOZ_DEFINES)
8472 mv confdefs.h.save confdefs.h
8474 dnl Load the list of Makefiles to generate.
8475 dnl To add new Makefiles, edit allmakefiles.sh.
8476 dnl allmakefiles.sh sets the variable, MAKEFILES.
8477 . ${srcdir}/allmakefiles.sh
8479 dnl Run a perl script to quickly create the makefiles.
8480 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
8481 dnl for the files it cannot handle correctly. This way, config.status
8482 dnl will handle these files.
8483 dnl If it fails, nothing is set and config.status will run as usual.
8485 dnl This does not change the $MAKEFILES variable.
8487 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
8489 if test -z "${AS_PERL}"; then
8490 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
8492 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
8497 echo $MAKEFILES > unallmakefiles
8499 mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
8501 AC_OUTPUT($MAKEFILES)
8503 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
8504 if test "$CAIRO_FEATURES_H"; then
8505 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
8506 echo "$CAIRO_FEATURES_H is unchanged"
8507 mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
8509 rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
8513 dnl ========================================================
8514 dnl = Setup a nice relatively clean build environment for
8515 dnl = sub-configures.
8516 dnl ========================================================
8519 CFLAGS="$_SUBDIR_CFLAGS"
8520 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8521 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8522 LDFLAGS="$_SUBDIR_LDFLAGS"
8523 HOST_CC="$_SUBDIR_HOST_CC"
8524 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8525 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8531 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8532 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8534 if test -z "$MOZ_NATIVE_NSPR"; then
8535 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8536 if test -z "$MOZ_DEBUG"; then
8537 ac_configure_args="$ac_configure_args --disable-debug"
8539 if test "$MOZ_OPTIMIZE" = "1"; then
8540 ac_configure_args="$ac_configure_args --enable-optimize"
8542 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8543 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8545 if test -n "$HAVE_64BIT_OS"; then
8546 ac_configure_args="$ac_configure_args --enable-64bit"
8548 if test -n "$USE_ARM_KUSER"; then
8549 ac_configure_args="$ac_configure_args --with-arm-kuser"
8551 AC_OUTPUT_SUBDIRS(nsprpub)
8552 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8555 if test -z "$MOZ_NATIVE_NSPR"; then
8556 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8557 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8558 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8559 NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
8560 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
8561 NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
8562 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
8564 rm -f config/autoconf.mk.bak
8567 # Run the SpiderMonkey 'configure' script.
8568 dist=$MOZ_BUILD_ROOT/dist
8569 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8570 ac_configure_args="$ac_configure_args --enable-threadsafe"
8571 if test -z "$MOZ_NATIVE_NSPR"; then
8572 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8573 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8575 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8576 ac_configure_args="$ac_configure_args --includedir=$dist/include"
8577 ac_configure_args="$ac_configure_args --bindir=$dist/bin"
8578 ac_configure_args="$ac_configure_args --libdir=$dist/lib"
8579 ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
8580 if test "$MOZ_MEMORY"; then
8581 ac_configure_args="$ac_configure_args --enable-jemalloc"
8582 if test -n "$MOZ_MEMORY_LDFLAGS"; then
8583 export MOZ_MEMORY_LDFLAGS
8586 AC_OUTPUT_SUBDIRS(js/src)
8587 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8589 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
8591 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
8592 dnl Needs to be at the end to respect possible changes from NSPR configure
8593 if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
8594 echo "config/autoconf.mk is unchanged"
8595 mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
8597 rm -f config/autoconf.mk.orig 2> /dev/null