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
135 LIBNOTIFY_VERSION=0.4
139 dnl Set various checks
140 dnl ========================================================
144 dnl Initialize the Pthread test variables early so they can be
145 dnl overridden by each platform.
146 dnl ========================================================
150 dnl Do not allow a separate objdir build if a srcdir build exists.
151 dnl ==============================================================
152 _topsrcdir=`cd \`dirname $0\`; pwd`
155 if test "$_topsrcdir" != "$_objdir"
157 # Check for a couple representative files in the source tree
159 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
160 if test -f $file; then
161 _conflict_files="$_conflict_files $file"
164 if test "$_conflict_files"; then
166 echo "* Your source tree contains these files:"
167 for file in $_conflict_files; do
171 * This indicates that you previously built in the source tree.
172 * A source tree build can confuse the separate objdir build.
174 * To clean up the source tree:
185 dnl Default to MSVC for win32
186 dnl ==============================================================
187 if test -z "$CROSS_COMPILE"; then
189 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
191 if test -z "$CC"; then CC=cl; fi
192 if test -z "$CXX"; then CXX=cl; fi
193 if test -z "$CPP"; then CPP="cl -E -nologo"; fi
194 if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
195 if test -z "$LD"; then LD=link; fi
196 if test -z "$AS"; then AS=ml; fi
197 if test -z "$MIDL"; then MIDL=midl; fi
202 COMPILE_ENVIRONMENT=1
203 MOZ_ARG_ENABLE_BOOL(compile-environment,
204 [ --disable-compile-environment
205 Disable compiler/library checks.],
206 COMPILE_ENVIRONMENT=1,
207 COMPILE_ENVIRONMENT= )
209 MOZ_ARG_WITH_STRING(l10n-base,
210 [ --with-l10n-base=DIR path to l10n repositories],
211 L10NBASEDIR=$withval)
212 if test ! -z "$L10NBASEDIR"; then
213 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
214 AC_MSG_ERROR([--with-l10n-base must specify a path])
215 elif test -d "$L10NBASEDIR"; then
216 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
218 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
221 AC_SUBST(L10NBASEDIR)
223 dnl ========================================================
224 dnl Checks for compilers.
225 dnl ========================================================
226 dnl Set CROSS_COMPILE in the environment when running configure
227 dnl to use the cross-compile setup for now
228 dnl ========================================================
230 if test "$COMPILE_ENVIRONMENT"; then
232 dnl Do some special WinCE toolchain stuff
236 MOZ_ARG_WITH_STRING(wince-sdk,
237 [ --with-wince-sdk=WINCE_SDK
238 The path to the windows mobile sdk],
242 mk_add_options WINCE=1
244 echo -----------------------------------------------------------------------------
245 echo Building Windows CE Shunt Library and Tool Chain
252 rm -f $srcdir/build/wince/shunt/include/windows.h
254 echo -n "#define TOPSRCDIR \"" > $srcdir/build/wince/tools/topsrcdir.h
255 echo `cd "$_topsrcdir" && pwd -W | tr '\n' '\"'` >> $srcdir/build/wince/tools/topsrcdir.h
256 make -C $srcdir/build/wince/tools
258 echo "#include \"$WINCE_SDK/windows.h\"" > $srcdir/build/wince/shunt/include/windows.h
259 echo "#define GetProcAddress GetProcAddressA" >> $srcdir/build/wince/shunt/include/windows.h
260 echo -----------------------------------------------------------------------------
265 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
266 echo "cross compiling from $host to $target"
270 _SAVE_CFLAGS="$CFLAGS"
271 _SAVE_LDFLAGS="$LDFLAGS"
273 AC_MSG_CHECKING([for host c compiler])
274 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
275 if test -z "$HOST_CC"; then
276 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
278 AC_MSG_RESULT([$HOST_CC])
279 AC_MSG_CHECKING([for host c++ compiler])
280 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
281 if test -z "$HOST_CXX"; then
282 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
284 AC_MSG_RESULT([$HOST_CXX])
286 if test -z "$HOST_CFLAGS"; then
287 HOST_CFLAGS="$CFLAGS"
289 if test -z "$HOST_CXXFLAGS"; then
290 HOST_CXXFLAGS="$CXXFLAGS"
292 if test -z "$HOST_LDFLAGS"; then
293 HOST_LDFLAGS="$LDFLAGS"
295 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
296 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
298 CFLAGS="$HOST_CFLAGS"
299 LDFLAGS="$HOST_LDFLAGS"
301 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
302 AC_TRY_COMPILE([], [return(0);],
303 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
304 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
307 CFLAGS="$HOST_CXXFLAGS"
309 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
310 AC_TRY_COMPILE([], [return(0);],
311 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
312 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
316 LDFLAGS=$_SAVE_LDFLAGS
318 case "$build:$target" in
319 powerpc-apple-darwin8*:i?86-apple-darwin*)
320 dnl The Darwin cross compiler doesn't necessarily point itself at a
321 dnl root that has libraries for the proper architecture, it defaults
322 dnl to the system root. The libraries in the system root on current
323 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
324 dnl checks will fail. Fake a working SDK in that case.
326 _SAVE_CXXFLAGS=$CXXLAGS
327 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
328 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
332 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
335 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
339 case "$build:$target" in
340 powerpc-apple-darwin8*:i?86-apple-darwin*)
341 dnl Revert the changes made above. From this point on, the target
342 dnl compiler will never be used without applying the SDK to CFLAGS
343 dnl (see --with-macos-sdk below).
345 CXXFLAGS=$_SAVE_CXXFLAGS
349 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
350 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
351 AC_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
352 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
353 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
354 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
355 AC_DEFINE(CROSS_COMPILE)
360 AC_PATH_PROGS(AS, $AS as, $CC)
361 AC_CHECK_PROGS(AR, ar, :)
362 AC_CHECK_PROGS(LD, ld, :)
363 AC_CHECK_PROGS(STRIP, strip, :)
364 AC_CHECK_PROGS(WINDRES, windres, :)
365 if test -z "$HOST_CC"; then
368 if test -z "$HOST_CFLAGS"; then
369 HOST_CFLAGS="$CFLAGS"
371 if test -z "$HOST_CXX"; then
374 if test -z "$HOST_CXXFLAGS"; then
375 HOST_CXXFLAGS="$CXXFLAGS"
377 if test -z "$HOST_LDFLAGS"; then
378 HOST_LDFLAGS="$LDFLAGS"
380 if test -z "$HOST_RANLIB"; then
381 HOST_RANLIB="$RANLIB"
383 if test -z "$HOST_AR"; then
394 if test "$GCC" = "yes"; then
396 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
398 if test "$GXX" = "yes"; then
400 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
402 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
405 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
408 if test "$GNU_CC"; then
409 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
416 if test "$GCC" = yes; then
417 if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
422 if test "$GXX" = yes; then
423 if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
428 dnl Special win32 checks
429 dnl ========================================================
435 if test -n "$GNU_CC"; then
443 MOZ_ARG_WITH_STRING(windows-version,
444 [ --with-windows-version=WINVER
445 Minimum Windows version (WINVER) to support
456 AC_MSG_ERROR([Invalid value --with-windows-version, must be 400, 500 or 501]);
462 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
463 if test "$GCC" != "yes"; then
464 # Check to see if we are really running in a msvc environemnt
466 AC_CHECK_PROGS(MIDL, midl)
468 # Make sure compilers are valid
469 CFLAGS="$CFLAGS -TC -nologo"
470 CXXFLAGS="$CXXFLAGS -TP -nologo"
473 AC_TRY_COMPILE([#include <stdio.h>],
474 [ printf("Hello World\n"); ],,
475 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
478 AC_TRY_COMPILE([#include <new.h>],
479 [ unsigned *test = new unsigned(42); ],,
480 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
484 _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
487 # Determine compiler version
488 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
489 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
490 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
491 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
492 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
493 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
495 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
496 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
498 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
499 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
501 if test "$_CC_MAJOR_VERSION" = "12"; then
503 elif test "$_CC_MAJOR_VERSION" = "13"; then
505 elif test "$_CC_MAJOR_VERSION" = "14"; then
507 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
508 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
509 dnl so be very specific here!
510 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
511 if test $_CC_RELEASE -gt 50727; then
513 elif test $_CC_BUILD -ge 762; then
516 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
517 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
518 elif test "$_CC_MAJOR_VERSION" = "15"; then
520 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
521 LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
523 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
524 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
526 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
529 _MOZ_RTTI_FLAGS_ON='-GR'
530 _MOZ_RTTI_FLAGS_OFF='-GR-'
531 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
532 _MOZ_EXCEPTIONS_FLAGS_OFF=''
534 if test -n "$WIN32_REDIST_DIR"; then
535 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
539 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
540 if test "$_CC_SUITE" -ge "8"; then
542 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
545 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
546 if test -n "$MSMT_TOOL"; then
547 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
548 if test -z "$MSMANIFEST_TOOL_VERSION"; then
549 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
554 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
558 # Check linker version
559 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
560 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
561 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
562 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
567 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
568 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
569 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
570 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
571 # Add flags if necessary
572 AC_MSG_CHECKING([for midl flags])
575 if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
576 # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
577 # MIDL version 7.00.0500 or later has no problem.
578 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
579 AC_MSG_RESULT([need -env win32])
581 AC_MSG_RESULT([none needed])
585 AC_MSG_RESULT([none needed])
589 unset _MSVC_VER_FILTER
592 # Check w32api version
593 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
594 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
595 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
596 AC_TRY_COMPILE([#include <w32api.h>],
597 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
598 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
599 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
600 #error "test failed."
602 , [ res=yes ], [ res=no ])
603 AC_MSG_RESULT([$res])
604 if test "$res" != "yes"; then
605 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
607 # Check windres version
608 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
609 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
610 AC_MSG_RESULT([$_WINDRES_VERSION])
611 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
612 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
613 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
614 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
615 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
616 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
617 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
618 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
619 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
620 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
621 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
622 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
624 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
628 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
629 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
630 # Require OS features provided by IE 5.0
631 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
635 dnl Test breaks icc on OS/2 && MSVC
636 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
638 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
642 CC="${srcdir}/build/hcc '$CC'"
643 CXX="${srcdir}/build/hcpp '$CXX'"
650 if test -n "$_WIN32_MSVC"; then
652 SKIP_COMPILER_CHECKS=1
653 SKIP_LIBRARY_CHECKS=1
655 # Since we're skipping compiler and library checks, hard-code
662 AC_DEFINE(HAVE_SETBUF)
663 AC_DEFINE(HAVE_ISATTY)
668 fi # COMPILE_ENVIRONMENT
680 dnl ========================================================
681 dnl Checks for programs.
682 dnl ========================================================
685 AC_PATH_PROGS(PERL, $PERL perl5 perl )
686 if test -z "$PERL" || test "$PERL" = ":"; then
687 AC_MSG_ERROR([perl not found in \$PATH])
690 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
691 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
692 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
694 AC_MSG_RESULT([$_perl_version])
696 if test "$_perl_res" != 0; then
697 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
701 AC_MSG_CHECKING([for full perl installation])
702 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
704 if test "$_perl_res" != 0; then
706 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
711 AC_PATH_PROGS(PYTHON, $PYTHON python)
712 if test -z "$PYTHON"; then
713 AC_MSG_ERROR([python was not found in \$PATH])
716 AC_PATH_PROGS(NSINSTALL_BIN, nsinstall )
717 if test -z "$COMPILE_ENVIRONMENT"; then
718 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
719 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
722 AC_SUBST(NSINSTALL_BIN)
724 AC_PATH_PROG(DOXYGEN, doxygen, :)
725 AC_PATH_PROG(WHOAMI, whoami, :)
726 AC_PATH_PROG(AUTOCONF, autoconf, :)
727 AC_PATH_PROG(UNZIP, unzip, :)
728 AC_PATH_PROGS(ZIP, zip)
729 if test -z "$ZIP" || test "$ZIP" = ":"; then
730 AC_MSG_ERROR([zip not found in \$PATH])
732 AC_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
733 AC_PATH_PROG(XARGS, xargs)
734 if test -z "$XARGS" || test "$XARGS" = ":"; then
735 AC_MSG_ERROR([xargs not found in \$PATH .])
738 if test "$COMPILE_ENVIRONMENT"; then
740 dnl ========================================================
741 dnl = Mac OS X toolchain support
742 dnl ========================================================
746 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
747 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
748 dnl the environment and includedir purposes (when using an SDK, below),
749 dnl but remember the full version number for the libdir (SDK).
751 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
752 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
754 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
755 dnl Bug 280479, but this keeps popping up in bug 292530 too because
756 dnl 4.0.0/4061 is the default compiler in Tiger.
758 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
760 if test "$GCC_BUILD" = "4061" ; then
761 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
762 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
763 from building Mozilla. Upgrade to Xcode 2.1 or later.])
767 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
768 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
769 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
770 AC_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
775 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
777 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
783 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
784 dnl it has moved into /usr/bin.
785 AC_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
789 AC_SUBST(GCC_VERSION)
790 AC_SUBST(XCODEBUILD_VERSION)
791 AC_SUBST(HAS_XCODE_2_1)
793 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
794 dnl that a universal binary is being produced.
795 AC_SUBST(UNIVERSAL_BINARY)
797 dnl ========================================================
798 dnl Check for MacOS deployment target version
799 dnl ========================================================
801 MOZ_ARG_ENABLE_STRING(macos-target,
802 [ --enable-macos-target=VER (default=10.4)
803 Set the minimum MacOS version needed at runtime],
804 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
808 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
809 dnl Use the specified value
810 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
811 AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
812 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
813 dnl No value specified on the command line or in the environment,
814 dnl use the lesser of the application's minimum or the architecture's
816 export MACOSX_DEPLOYMENT_TARGET=10.4
821 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
823 dnl ========================================================
824 dnl = Mac OS X SDK support
825 dnl ========================================================
828 MOZ_ARG_WITH_STRING(macos-sdk,
829 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
830 MACOS_SDK_DIR=$withval)
832 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
833 dnl NEXT_ROOT will be set and exported only if it's needed.
834 AC_SUBST(MACOS_SDK_DIR)
837 if test "$MACOS_SDK_DIR"; then
838 dnl Sync this section with the ones in NSPR and NSS.
839 dnl Changes to the cross environment here need to be accounted for in
840 dnl the libIDL checks (below) and xpidl build.
842 if test ! -d "$MACOS_SDK_DIR"; then
843 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
844 specify a valid SDK. SDKs are installed when the optional cross-development
845 tools are selected during the Xcode/Developer Tools installation.])
848 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
849 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
850 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"
851 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
852 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
854 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"
856 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
857 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
859 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
860 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
861 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
863 dnl ld support for -syslibroot is compiler-agnostic, but only available
864 dnl on Tiger. Although it's possible to switch on the build host's
865 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
866 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
867 dnl set because both the compiler and linker use it.
868 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"
869 export NEXT_ROOT=$MACOS_SDK_DIR
871 if test -n "$CROSS_COMPILE" ; then
872 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
873 dnl the build host. HOST_CXX is presently unused.
874 HOST_CC="NEXT_ROOT= $HOST_CC"
875 HOST_CXX="NEXT_ROOT= $HOST_CXX"
878 dnl gcc >= 4.0 uses different paths than above, but knows how to find
880 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
881 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
883 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
884 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
885 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
887 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
888 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
889 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
890 dnl be ignored and cause warnings when -syslibroot is specified.
891 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
892 dnl the -isysroot it receives, so this is only needed with 4.0.0.
893 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
898 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
900 AC_TRY_COMPILE([#include <new>
901 int main() { return 0; }],
905 AC_MSG_RESULT($result)
907 if test "$result" = "no" ; then
908 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
912 fi # COMPILE_ENVIRONMENT
914 dnl Be sure the make we use is GNU make.
915 dnl on win32, gmake.exe is the generally the wrong version
917 cygwin*|mingw*|mks*|msvc*)
918 AC_PATH_PROGS(MAKE, $MAKE make gmake, :)
921 AC_PATH_PROGS(MAKE, $MAKE gmake make, :)
924 _make_try=`$MAKE --version 2>/dev/null | grep GNU`
925 if test ! "$_make_try"
928 echo "*** $MAKE is not GNU Make. You will not be able to build Mozilla without GNU Make."
932 dnl Now exit if version if < MAKE_VERSION
934 echo 'all: ; @echo $(MAKE_VERSION)' > dummy.mk
935 _make_vers=`$MAKE --no-print-directory -f dummy.mk all 2>/dev/null`
937 _MAKE_MAJOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $1 }'`
938 _MAKE_MINOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $2 }'`
939 MAKE_MAJOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $1 }'`
940 MAKE_MINOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $2 }'`
941 if test "$_MAKE_MAJOR_VERSION" -lt "$MAKE_MAJOR_VERSION" || \
942 test "$_MAKE_MAJOR_VERSION" = "$MAKE_MAJOR_VERSION" -a \
943 "$_MAKE_MINOR_VERSION" -lt "$MAKE_MINOR_VERSION"; then
944 AC_MSG_ERROR([GNU Make $MAKE_VERSION or higher is required to build Mozilla.])
948 if test "$COMPILE_ENVIRONMENT"; then
952 dnl Check in X11 include directory too.
953 if test "$no_x" != "yes"; then
954 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
959 fi # COMPILE_ENVIRONMENT
961 dnl ========================================================
962 dnl set the defaults first
963 dnl ========================================================
982 MOZ_USER_DIR=".mozilla"
984 HOST_AR_FLAGS='$(AR_FLAGS)'
987 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
989 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
991 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
993 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
995 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
996 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
997 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
998 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
999 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1000 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1001 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1003 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1004 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
1006 USE_DEPENDENT_LIBS=1
1008 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1009 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
1011 MOZ_ENABLE_POSTSCRIPT=1
1013 if test -n "$CROSS_COMPILE"; then
1014 OS_TARGET="${target_os}"
1015 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1017 case "${target_os}" in
1018 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1019 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1020 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1021 mingw*) OS_ARCH=WINNT ;;
1022 wince*) OS_ARCH=WINCE ;;
1023 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1026 OS_TARGET=`uname -s`
1027 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1028 OS_RELEASE=`uname -r`
1031 # Before this used `uname -m` when not cross compiling
1032 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1033 OS_TEST="${target_cpu}"
1037 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1039 #######################################################################
1040 # Master "Core Components" macros for getting the OS target #
1041 #######################################################################
1044 # Note: OS_TARGET should be specified on the command line for gmake.
1045 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
1046 # The difference between the Win95 target and the WinNT target is that
1047 # the WinNT target uses Windows NT specific features not available
1048 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
1049 # at lesser performance (the Win95 target uses threads; the WinNT target
1052 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1053 # cross-compilation.
1057 # The following hack allows one to build on a WIN95 machine (as if
1058 # s/he were cross-compiling on a WINNT host for a WIN95 target).
1059 # It also accomodates for MKS's uname.exe. If you never intend
1060 # to do development on a WIN95 machine, you don't need this hack.
1075 CYGWIN_9*|CYGWIN_ME*)
1076 OS_ARCH='CYGWIN_NT-4.0'
1082 # Define and override various archtecture-specific variables, including
1091 case "$HOST_OS_ARCH" in
1092 cygwin*|mingw*|mks*|msvc*)
1111 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1114 HOST_OS_ARCH=UNIXWARE
1126 HOST_OS_ARCH=OpenVMS
1136 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1140 HOST_OS_ARCH=UNIXWARE
1150 # If uname -s returns "Windows_NT", we assume that we are using
1151 # the uname.exe in MKS toolkit.
1153 # The -r option of MKS uname only returns the major version number.
1154 # So we need to use its -v option to get the minor version number.
1155 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1159 OS_MINOR_RELEASE=`uname -v`
1160 if test "$OS_MINOR_RELEASE" = "00"; then
1163 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1165 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1167 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1168 # the uname.exe in the Cygwin tools.
1169 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1170 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1171 # the uname.exe in the GNU-Win32 tools.
1172 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1173 # the uname.exe in the MSYS tools.
1175 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1180 OS_RELEASE=`uname -v`.`uname -r`
1181 OS_TEST=${target_cpu}
1193 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1197 OS_RELEASE=`uname -v`
1221 OS_RELEASE=`uname -v`
1227 OS_RELEASE=`uname -v`
1230 if test "$OS_TARGET" != "NTO"; then
1232 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1241 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1247 OS_RELEASE=`uname -v`
1254 case "${target_cpu}" in
1265 if test -z "$CROSS_COMPILE" ; then
1273 if test "$OS_ARCH" = "NCR"; then
1275 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1279 # Only set CPU_ARCH if we recognize the value of OS_TEST
1286 powerpc* | ppc | rs6000)
1290 Alpha | alpha | ALPHA)
1307 if test -z "$OS_TARGET"; then
1310 if test "$OS_TARGET" = "WIN95"; then
1313 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1315 dnl ========================================================
1316 dnl GNU specific defaults
1317 dnl ========================================================
1318 if test "$GNU_CC"; then
1319 # FIXME: Let us build with strict aliasing. bug 414641.
1320 CFLAGS="$CFLAGS -fno-strict-aliasing"
1321 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1322 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1323 DSO_LDOPTS='-shared'
1324 if test "$GCC_USE_GNU_LD"; then
1325 # Don't allow undefined symbols in libraries
1326 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1328 WARNINGS_AS_ERRORS='-Werror'
1330 DSO_PIC_CFLAGS='-fPIC'
1331 ASFLAGS="$ASFLAGS -fPIC"
1332 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1333 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1334 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1335 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1337 # Turn on GNU specific features
1338 # -Wall - turn on all warnings
1339 # -pedantic - make compiler warn about non-ANSI stuff, and
1340 # be a little bit stricter
1341 # Warnings slamm took out for now (these were giving more noise than help):
1342 # -Wbad-function-cast - warns when casting a function to a new return type
1343 # -Wshadow - removed because it generates more noise than help --pete
1344 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1345 if test -z "$INTEL_CC"; then
1346 # Don't use -Wcast-align with ICC
1348 # And don't use it on hppa, ia64, sparc, since it's noisy there
1349 hppa | ia64 | sparc)
1352 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1357 dnl Turn pedantic on but disable the warnings for long long
1360 if test -z "$INTEL_CC"; then
1361 _IGNORE_LONG_LONG_WARNINGS=1
1362 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1364 _IGNORE_LONG_LONG_WARNINGS=
1368 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1369 _USE_CPP_INCLUDE_FLAG=1
1371 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1372 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1374 DSO_LDOPTS='-shared'
1375 if test "$GNU_LD"; then
1376 # Don't allow undefined symbols in libraries
1377 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1381 DSO_PIC_CFLAGS='-KPIC'
1382 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1385 if test "$GNU_CXX"; then
1386 # FIXME: Let us build with strict aliasing. bug 414641.
1387 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1388 # Turn on GNU specific features
1389 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1390 if test -z "$INTEL_CC"; then
1391 # Don't use -Wcast-align with ICC
1393 # And don't use it on hppa, ia64, sparc, since it's noisy there
1394 hppa | ia64 | sparc)
1397 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1402 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1403 _USE_CPP_INCLUDE_FLAG=1
1405 AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1406 ac_has_wno_invalid_offsetof,
1410 _SAVE_CXXFLAGS="$CXXFLAGS"
1411 CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1414 ac_has_wno_invalid_offsetof="yes",
1415 ac_has_wno_invalid_offsetof="no")
1416 CXXFLAGS="$_SAVE_CXXFLAGS"
1419 if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1420 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1423 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1426 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1427 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1428 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1429 dnl normal behavior.
1430 dnl ========================================================
1432 MKSHLIB_UNFORCE_ALL=
1434 if test "$COMPILE_ENVIRONMENT"; then
1435 if test "$GNU_CC"; then
1436 AC_MSG_CHECKING(whether ld has archive extraction flags)
1437 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1438 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1439 ac_cv_mkshlib_force_and_unforce="no"
1440 exec 3<&0 <<LOOP_INPUT
1441 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1442 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1443 force="-Wl,-all"; unforce="-Wl,-none"
1450 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1453 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1455 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1459 eval $ac_cv_mkshlib_force_and_unforce
1460 MKSHLIB_FORCE_ALL=$force
1461 MKSHLIB_UNFORCE_ALL=$unforce
1464 fi # COMPILE_ENVIRONMENT
1466 dnl =================================================================
1467 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1468 dnl which is bad when cross compiling.
1469 dnl =================================================================
1470 if test "$COMPILE_ENVIRONMENT"; then
1471 configure_static_assert_macros='
1472 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1473 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1474 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1477 dnl test that the macros actually work:
1478 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1479 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1482 ac_cv_static_assertion_macros_work="yes"
1483 AC_TRY_COMPILE([$configure_static_assert_macros],
1484 [CONFIGURE_STATIC_ASSERT(1)],
1486 ac_cv_static_assertion_macros_work="no")
1487 AC_TRY_COMPILE([$configure_static_assert_macros],
1488 [CONFIGURE_STATIC_ASSERT(0)],
1489 ac_cv_static_assertion_macros_work="no",
1492 AC_TRY_COMPILE([$configure_static_assert_macros],
1493 [CONFIGURE_STATIC_ASSERT(1)],
1495 ac_cv_static_assertion_macros_work="no")
1496 AC_TRY_COMPILE([$configure_static_assert_macros],
1497 [CONFIGURE_STATIC_ASSERT(0)],
1498 ac_cv_static_assertion_macros_work="no",
1502 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1503 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1504 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1506 fi # COMPILE_ENVIRONMENT
1508 dnl ========================================================
1509 dnl Checking for 64-bit OS
1510 dnl ========================================================
1511 if test "$COMPILE_ENVIRONMENT"; then
1514 AC_MSG_CHECKING(for 64-bit OS)
1515 AC_TRY_COMPILE([$configure_static_assert_macros],
1516 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1517 result="yes", result="no")
1518 AC_MSG_RESULT("$result")
1519 if test "$result" = "yes"; then
1520 AC_DEFINE(HAVE_64BIT_OS)
1523 AC_SUBST(HAVE_64BIT_OS)
1525 fi # COMPILE_ENVIRONMENT
1527 dnl ========================================================
1528 dnl Enable high-memory support on OS/2 by default.
1529 dnl ========================================================
1530 MOZ_OS2_HIGH_MEMORY=1
1531 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1532 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1533 MOZ_OS2_HIGH_MEMORY=,
1534 MOZ_OS2_HIGH_MEMORY=1 )
1535 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1537 dnl ========================================================
1538 dnl System overrides of the defaults for host
1539 dnl ========================================================
1542 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1543 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1544 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1547 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1548 if test -n "$_WIN32_MSVC"; then
1550 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1551 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1552 HOST_RANLIB='echo ranlib'
1554 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1556 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1557 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1558 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1559 HOST_BIN_SUFFIX=.exe
1562 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1565 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1566 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1568 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1570 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1572 PERL="${CYGWIN_WRAPPER} $PERL"
1575 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1576 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1583 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1584 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1585 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1586 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1587 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
1590 *-linux*|*-kfreebsd*-gnu)
1591 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1592 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1593 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1597 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1598 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1599 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1600 HOST_BIN_SUFFIX=.exe
1605 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1606 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1607 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1611 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1612 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1616 dnl Get mozilla version from central milestone file
1617 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1619 dnl Get version of various core apps from the version files.
1620 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1622 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1623 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1625 dnl ========================================================
1626 dnl System overrides of the defaults for target
1627 dnl ========================================================
1632 if test ! "$GNU_CC"; then
1633 if test ! "$HAVE_64BIT_OS"; then
1634 # Compiling with Visual Age C++ object model compat is the
1635 # default. To compile with object model ibm, add
1636 # AIX_OBJMODEL=ibm to .mozconfig.
1637 if test "$AIX_OBJMODEL" = "ibm"; then
1638 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1645 AC_SUBST(AIX_OBJMODEL)
1646 DSO_LDOPTS='-qmkshrobj=1'
1647 DSO_CFLAGS='-qflag=w:w'
1649 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1650 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1652 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1653 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1654 if test "$COMPILE_ENVIRONMENT"; then
1657 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
1659 [#if (__IBMCPP__ < 600)
1660 #error "Bad compiler"
1662 _BAD_COMPILER=,_BAD_COMPILER=1)
1663 if test -n "$_BAD_COMPILER"; then
1665 AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
1667 AC_MSG_RESULT([yes])
1670 TARGET_COMPILER_ABI="ibmc"
1671 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1672 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1675 case "${target_os}" in
1680 if test "$COMPILE_ENVIRONMENT"; then
1681 AC_CHECK_HEADERS(sys/inttypes.h)
1683 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1688 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1689 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1690 DSO_LDOPTS='-nostart'
1691 TK_LIBS='-lbe -lroot'
1693 if test "$COMPILE_ENVIRONMENT"; then
1694 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1695 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1697 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1698 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1701 MOZ_USER_DIR="Mozilla"
1705 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1707 _IGNORE_LONG_LONG_WARNINGS=
1715 _WARNINGS_CFLAGS="-Wall"
1716 _WARNINGS_CXXFLAGS="-Wall"
1717 # The test above doesn't work properly, at least on 3.1.
1718 MKSHLIB_FORCE_ALL=''
1719 MKSHLIB_UNFORCE_ALL=''
1725 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1726 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1727 MOZ_OPTIMIZE_FLAGS="-O2"
1729 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1730 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1733 STRIP="$STRIP -x -S"
1734 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1735 MOZ_ENABLE_POSTSCRIPT=
1736 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1737 LDFLAGS="$LDFLAGS -framework Cocoa"
1738 # The ExceptionHandling framework is needed for Objective-C exception
1739 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1741 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1742 # set MACOSX to generate lib/mac/MoreFiles/Makefile
1745 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1746 dnl ===================================================================
1747 if test "x$enable_dtrace" = "xyes"; then
1748 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1750 dnl check for the presence of the -dead_strip linker flag
1751 AC_MSG_CHECKING([for -dead_strip option to ld])
1752 _SAVE_LDFLAGS=$LDFLAGS
1753 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1754 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1755 if test -n "$_HAVE_DEAD_STRIP" ; then
1756 AC_MSG_RESULT([yes])
1757 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1762 LDFLAGS=$_SAVE_LDFLAGS
1767 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1768 DLL_SUFFIX=".so.1.0"
1769 DSO_LDOPTS="-shared"
1771 if test ! "$GNU_CC"; then
1772 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1774 # Can't have force w/o an unforce.
1775 # # Hack for FreeBSD 2.2
1776 # if test -z "$MKSHLIB_FORCE_ALL"; then
1777 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1778 # MKSHLIB_UNFORCE_ALL=''
1784 if test ! "$GNU_CC"; then
1785 DSO_LDOPTS='-b -Wl,+s'
1788 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1789 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1790 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1792 DSO_LDOPTS='-b -E +s'
1793 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1794 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1796 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1797 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1802 DSO_LDOPTS='-elf -shared'
1804 if test "$GNU_CC"; then
1805 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1806 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1807 MKSHLIB_FORCE_ALL='-Wl,-all'
1808 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1809 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1811 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1812 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1813 MKSHLIB_FORCE_ALL='-all'
1814 MKSHLIB_UNFORCE_ALL='-none'
1820 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1821 dnl compile and link using -n32
1823 TARGET_COMPILER_ABI=n32
1824 DSO_LDOPTS='-elf -shared'
1825 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1826 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1827 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1828 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1829 if test "$GNU_CC"; then
1830 MKSHLIB_FORCE_ALL='-Wl,-all'
1831 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1832 _WARNINGS_CFLAGS="-Wall"
1833 _WARNINGS_CXXFLAGS="-Wall"
1834 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1836 MKSHLIB_FORCE_ALL='-all'
1837 MKSHLIB_UNFORCE_ALL='-none'
1843 CFLAGS="$CFLAGS -woff 3262 -G 4"
1844 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1845 if test -n "$USE_N32"; then
1846 ASFLAGS="$ASFLAGS -n32"
1847 CFLAGS="$CFLAGS -n32"
1848 CXXFLAGS="$CXXFLAGS -n32"
1849 LDFLAGS="$LDFLAGS -n32"
1851 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1852 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1855 if test -z "$GNU_CXX"; then
1861 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
1862 # Similarly for GNU_CXX and INTEL_CXX.
1863 if test "$INTEL_CC" || test "$INTEL_CXX"; then
1864 # -Os has been broken on Intel's C/C++ compilers for quite a
1865 # while; Intel recommends against using it.
1866 MOZ_OPTIMIZE_FLAGS="-O2"
1867 MOZ_DEBUG_FLAGS="-g -fno-inline"
1868 elif test "$GNU_CC" || test "$GNU_CXX"; then
1869 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
1870 case $GCC_VERSION in
1872 # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
1873 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
1875 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
1876 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1877 # and that combo is not yet good at
1878 # debugging inlined functions (even
1879 # when using DWARF2 as the debugging
1883 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1887 case "${target_cpu}" in
1889 CFLAGS="$CFLAGS -mieee"
1890 CXXFLAGS="$CXXFLAGS -mieee"
1894 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1897 MOZ_DEBUG_FLAGS="-g" # We want inlining
1904 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1906 AR_EXTRACT="$AR -extract"
1908 AR_FLAGS='-OUT:"$@"'
1910 if test "$AS_BIN"; then
1917 if test -z "$RC"; then
1920 # certain versions of cygwin's makedepend barf on the
1921 # #include <string> vs -I./dist/include/string issue so don't use it
1927 HOST_AR='lib -OUT:$@'
1928 HOST_RANLIB='echo ranlib'
1929 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
1932 WARNINGS_AS_ERRORS='-WX'
1933 MOZ_OPTIMIZE_FLAGS='-O1'
1934 AR_FLAGS='-NOLOGO -OUT:"$@"'
1936 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
1937 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
1940 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
1941 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1943 IMPORT_LIB_SUFFIX=lib
1945 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1948 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1949 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1951 MKSHLIB_UNFORCE_ALL=
1952 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1953 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1954 MOZ_DEBUG_FLAGS='-Zi'
1955 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1957 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1958 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1960 RANLIB='echo not_ranlib'
1961 STRIP='echo not_strip'
1962 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
1965 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1967 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
1968 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
1972 AC_DEFINE(HAVE_SNPRINTF)
1978 AC_DEFINE(HW_THREADS)
1979 AC_DEFINE(STDC_HEADERS)
1980 AC_DEFINE(NEW_H, <new>)
1981 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1983 TARGET_MD_ARCH=win32
1984 _PLATFORM_DEFAULT_TOOLKIT='windows'
1987 MOZ_ENABLE_POSTSCRIPT=
1988 MOZ_USER_DIR="Mozilla"
1992 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1997 # certain versions of cygwin's makedepend barf on the
1998 # #include <string> vs -I./dist/include/string issue so don't use it
2000 if test -n "$GNU_CC"; then
2001 CC="$CC -mno-cygwin"
2002 CXX="$CXX -mno-cygwin"
2003 CPP="$CPP -mno-cygwin"
2004 CFLAGS="$CFLAGS -mms-bitfields"
2005 CXXFLAGS="$CXXFLAGS -mms-bitfields"
2006 DSO_LDOPTS='-shared'
2007 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2008 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2010 # Use temp file for windres (bug 213281)
2011 RCFLAGS='-O coff --use-temp-file'
2012 # mingw doesn't require kernel32, user32, and advapi32 explicitly
2013 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
2014 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
2016 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
2017 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
2019 IMPORT_LIB_SUFFIX=dll.a
2021 TARGET_COMPILER_ABI=msvc
2025 AR='lib -NOLOGO -OUT:"$@"'
2027 RANLIB='echo not_ranlib'
2028 STRIP='echo not_strip'
2033 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2038 IMPORT_LIB_SUFFIX=lib
2039 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2040 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2042 MKSHLIB_UNFORCE_ALL=
2043 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2044 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2045 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2046 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2047 MOZ_DEBUG_FLAGS='-Zi'
2048 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2049 WARNINGS_AS_ERRORS='-WX'
2050 MOZ_OPTIMIZE_FLAGS='-O1'
2051 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2053 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2054 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2055 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2056 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2057 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2058 if test $_MSC_VER -ge 1400; then
2059 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
2060 dnl For profile-guided optimization
2061 PROFILE_GEN_CFLAGS="-GL"
2062 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2063 dnl XXX: PGO builds can fail with warnings treated as errors,
2064 dnl specifically "no profile data available" appears to be
2065 dnl treated as an error sometimes. This might be a consequence
2066 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2067 dnl with the linker doing most of the work in the whole-program
2068 dnl optimization/PGO case. I think it's probably a compiler bug,
2069 dnl but we work around it here.
2070 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2071 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2072 dnl Probably also a compiler bug, but what can you do?
2073 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2074 if test -n "$_USE_DYNAMICBASE"; then
2075 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2079 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2080 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2081 AC_DEFINE(HAVE_SNPRINTF)
2087 AC_DEFINE(HW_THREADS)
2088 AC_DEFINE(STDC_HEADERS)
2089 AC_DEFINE(NEW_H, <new>)
2090 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2091 TARGET_MD_ARCH=win32
2092 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2095 MOZ_ENABLE_POSTSCRIPT=
2096 MOZ_USER_DIR="Mozilla"
2098 dnl Hardcode to win95 for now - cls
2099 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2101 dnl set NO_X11 defines here as the general check is skipped on win32
2105 dnl MinGW/MSYS doesn't provide or need cygpath
2110 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2112 *-cygwin*|*-msvc*|*-mks*)
2113 CYGPATH_W="cygpath -a -w"
2114 CYGPATH_S="sed -e s|\\\\|/|g"
2115 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2119 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2121 if test -z "$MOZ_TOOLS"; then
2122 AC_MSG_ERROR([MOZ_TOOLS is not set])
2125 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
2126 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2127 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2129 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
2130 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2132 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2134 if test -n "$GLIB_PREFIX"; then
2135 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
2136 if test "$?" = "0"; then
2137 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
2138 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
2140 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
2142 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
2145 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
2147 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
2148 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
2150 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
2151 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
2152 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
2153 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
2154 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
2156 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
2159 if test -n "$LIBIDL_PREFIX"; then
2160 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
2161 if test "$?" = "0"; then
2162 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2163 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2165 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2167 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2170 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2172 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2173 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2175 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2176 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2177 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2179 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2180 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2182 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2184 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2187 *) # else cross-compiling
2188 if test -n "$GLIB_PREFIX"; then
2189 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2190 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2191 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2192 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2193 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2195 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2198 if test -n "$LIBIDL_PREFIX"; then
2199 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2200 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2201 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2203 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2204 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2206 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2209 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2216 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])
2220 AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
2224 AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2240 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2247 CFLAGS="$CFLAGS -Dunix"
2248 CXXFLAGS="$CXXFLAGS -Dunix"
2249 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2251 DSO_PIC_CFLAGS='-fPIC -DPIC'
2252 DSO_LDOPTS='-shared'
2253 BIN_FLAGS='-Wl,--export-dynamic'
2255 DSO_PIC_CFLAGS='-fPIC -DPIC'
2256 DLL_SUFFIX=".so.1.0"
2257 DSO_LDOPTS='-shared'
2259 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2260 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2261 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2262 if test "$LIBRUNPATH"; then
2263 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2265 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2266 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2271 AC_DEFINE(_QNX_SOURCE)
2274 WARNINGS_AS_ERRORS=''
2275 MOZ_OPTIMIZE_FLAGS="-O"
2276 MOZ_DEBUG_FLAGS="-gstabs"
2279 LIBS="$LIBS -lsocket -lstdc++"
2280 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2281 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2282 if test "$with_x" != "yes"
2284 _PLATFORM_DEFAULT_TOOLKIT="photon"
2285 TK_CFLAGS='-I/usr/include/photon'
2288 case "${target_cpu}" in
2290 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2293 case "${host_cpu}" in
2301 DLL_SUFFIX=".so.1.0"
2303 DSO_PIC_CFLAGS='-fPIC'
2304 DSO_LDOPTS='-shared -fPIC'
2305 if test "$LIBRUNPATH"; then
2306 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2311 AC_DEFINE(NO_PW_GECOS)
2312 AC_DEFINE(NO_UDSOCK)
2313 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2315 MKSHLIB_FORCE_ALL='-all'
2316 MKSHLIB_UNFORCE_ALL='-none'
2318 AS_DASH_C_FLAG='-Wc/names=as_is'
2320 DSO_LDOPTS='-shared -auto_symvec'
2322 MOZ_DEBUG_LDFLAGS='-g'
2324 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2325 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2330 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2331 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2334 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2335 AC_DEFINE(TCPV40HDRS)
2342 IMPORT_LIB_SUFFIX=lib
2346 CFLAGS="$CFLAGS -Zomf"
2347 CXXFLAGS="$CXXFLAGS -Zomf"
2349 BIN_FLAGS='-Zlinker /ST:0x100000'
2353 WARNINGS_AS_ERRORS='-Werror'
2354 MOZ_DEBUG_FLAGS="-g -fno-inline"
2355 MOZ_OPTIMIZE_FLAGS="-O2"
2356 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2357 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2358 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2359 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2361 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2362 MOZ_ENABLE_POSTSCRIPT=
2365 MOZ_USER_DIR="Mozilla"
2367 if test "$MOZTOOLS"; then
2368 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2370 AC_MSG_ERROR([MOZTOOLS is not set])
2372 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2373 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2374 LDFLAGS="$LDFLAGS -Zhigh-mem"
2375 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2376 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2379 # GCC for OS/2 currently predefines these, but we don't want them
2380 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2381 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2383 AC_CACHE_CHECK(for __declspec(dllexport),
2385 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2387 ac_os2_declspec="yes",
2388 ac_os2_declspec="no")])
2389 if test "$ac_os2_declspec" = "yes"; then
2391 MOZ_OS2_USE_DECLSPEC='1'
2396 if test "$GNU_CC"; then
2397 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2398 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2401 MOZ_DEBUG_FLAGS='-g'
2402 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2403 CFLAGS="$CFLAGS -ieee"
2404 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2405 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2408 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2409 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2410 MKSHLIB_FORCE_ALL='-all'
2411 MKSHLIB_UNFORCE_ALL='-none'
2412 dnl Might fix the libxpcom.so breakage on this platform as well....
2413 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2414 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2416 if test -z "$GNU_CXX"; then
2419 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2423 DIRENT_INO=d_stat.st_ino
2424 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2425 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2426 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2427 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2428 AC_DEFINE(STDC_HEADERS)
2429 if test "$no_x" = "yes"; then
2430 _PLATFORM_DEFAULT_TOOLKIT='photon'
2431 TK_CFLAGS='-I/usr/nto/include/photon'
2432 TK_LIBS='-lphoton -lphrender'
2437 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2438 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2439 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2440 if test ! "$GNU_CC"; then
2445 dnl the qsort routine under solaris is faulty
2448 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2450 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2451 # libraries one level up (e.g. libnspr4.so)
2452 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2453 LIBS="-lCrun -lCstd $LIBS"
2455 if test -z "$GNU_CC"; then
2458 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2460 if test "$CPU_ARCH" != "sparc"; then
2461 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2462 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2464 # Do not use -xbuiltin on SPARC to get around a bug of compiler
2465 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%none"
2466 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%none -features=tmplife -norunpath"
2469 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2470 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2471 _SAVE_LDFLAGS=$LDFLAGS
2472 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2473 AC_TRY_LINK([#include <stdio.h>],
2474 [printf("Hello World\n");],
2476 [LDFLAGS=$_SAVE_LDFLAGS])
2478 WARNINGS_AS_ERRORS='-Werror'
2479 MOZ_OPTIMIZE_FLAGS="-xO4"
2480 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2481 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2482 MKSHLIB_FORCE_ALL='-z allextract'
2483 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2484 DSO_LDOPTS='-G -z muldefs'
2490 AS='/usr/ccs/bin/as'
2491 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2493 TARGET_COMPILER_ABI="sunc"
2494 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2495 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2496 AC_MSG_CHECKING([for Forte compiler version >= WS6U2])
2500 [#if (__SUNPRO_CC < 0x530)
2503 _BAD_COMPILER=,_BAD_COMPILER=1)
2504 if test -n "$_BAD_COMPILER"; then
2506 AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .])
2510 AC_MSG_RESULT([$_res])
2513 ASFLAGS="$ASFLAGS -fPIC"
2516 _WARNINGS_CXXFLAGS=''
2517 if test "$OS_RELEASE" = "5.3"; then
2518 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2521 if test "$OS_RELEASE" = "5.5.1"; then
2522 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2527 DSO_LDOPTS='-Bdynamic'
2528 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2529 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2531 AC_DEFINE(SPRINTF_RETURNS_STRING)
2532 case "$(target_os)" in
2534 DLL_SUFFIX='.so.1.0'
2540 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2544 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2549 dnl Only one oddball right now (QNX), but this gives us flexibility
2550 dnl if any other platforms need to override this in the future.
2551 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2553 dnl ========================================================
2554 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2555 dnl by now will not have any way to link most binaries (tests
2556 dnl as well as viewer, apprunner, etc.), because some symbols
2557 dnl will be left out of the "composite" .so's by ld as unneeded.
2558 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2559 dnl they can link in the static libs that provide the missing
2561 dnl ========================================================
2562 NO_LD_ARCHIVE_FLAGS=
2563 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2564 NO_LD_ARCHIVE_FLAGS=1
2568 NO_LD_ARCHIVE_FLAGS=
2571 NO_LD_ARCHIVE_FLAGS=
2574 NO_LD_ARCHIVE_FLAGS=
2576 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2577 if test -z "$GNU_CC"; then
2578 NO_LD_ARCHIVE_FLAGS=
2582 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2585 dnl Indicate that platform requires special thread safe
2586 dnl locking when starting up the OJI JVM
2587 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2588 dnl ========================================================
2591 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2595 dnl ========================================================
2596 dnl = Flags to strip unused symbols from .so components
2597 dnl ========================================================
2599 *-linux*|*-kfreebsd*-gnu)
2600 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2603 if test -z "$GNU_CC"; then
2604 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2606 if test -z "$GCC_USE_GNU_LD"; then
2607 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2609 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2614 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2617 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2619 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2620 if test -n "$GNU_CC"; then
2621 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2626 if test -z "$COMPILE_ENVIRONMENT"; then
2627 SKIP_COMPILER_CHECKS=1
2628 SKIP_LIBRARY_CHECKS=1
2631 if test -z "$SKIP_COMPILER_CHECKS"; then
2632 dnl Checks for typedefs, structures, and compiler characteristics.
2633 dnl ========================================================
2641 AC_STRUCT_ST_BLKSIZE
2642 AC_MSG_CHECKING(for siginfo_t)
2643 AC_CACHE_VAL(ac_cv_siginfo_t,
2644 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2645 #include <signal.h>],
2647 [ac_cv_siginfo_t=true],
2648 [ac_cv_siginfo_t=false])])
2649 if test "$ac_cv_siginfo_t" = true ; then
2650 AC_DEFINE(HAVE_SIGINFO_T)
2656 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2657 dnl ========================================================
2658 AC_MSG_CHECKING(for int16_t)
2659 AC_CACHE_VAL(ac_cv_int16_t,
2660 [AC_TRY_COMPILE([#include <stdio.h>
2661 #include <sys/types.h>],
2663 [ac_cv_int16_t=true],
2664 [ac_cv_int16_t=false])])
2665 if test "$ac_cv_int16_t" = true ; then
2666 AC_DEFINE(HAVE_INT16_T)
2671 AC_MSG_CHECKING(for int32_t)
2672 AC_CACHE_VAL(ac_cv_int32_t,
2673 [AC_TRY_COMPILE([#include <stdio.h>
2674 #include <sys/types.h>],
2676 [ac_cv_int32_t=true],
2677 [ac_cv_int32_t=false])])
2678 if test "$ac_cv_int32_t" = true ; then
2679 AC_DEFINE(HAVE_INT32_T)
2684 AC_MSG_CHECKING(for int64_t)
2685 AC_CACHE_VAL(ac_cv_int64_t,
2686 [AC_TRY_COMPILE([#include <stdio.h>
2687 #include <sys/types.h>],
2689 [ac_cv_int64_t=true],
2690 [ac_cv_int64_t=false])])
2691 if test "$ac_cv_int64_t" = true ; then
2692 AC_DEFINE(HAVE_INT64_T)
2697 AC_MSG_CHECKING(for int64)
2698 AC_CACHE_VAL(ac_cv_int64,
2699 [AC_TRY_COMPILE([#include <stdio.h>
2700 #include <sys/types.h>],
2703 [ac_cv_int64=false])])
2704 if test "$ac_cv_int64" = true ; then
2705 AC_DEFINE(HAVE_INT64)
2710 AC_MSG_CHECKING(for uint)
2711 AC_CACHE_VAL(ac_cv_uint,
2712 [AC_TRY_COMPILE([#include <stdio.h>
2713 #include <sys/types.h>],
2716 [ac_cv_uint=false])])
2717 if test "$ac_cv_uint" = true ; then
2718 AC_DEFINE(HAVE_UINT)
2723 AC_MSG_CHECKING(for uint_t)
2724 AC_CACHE_VAL(ac_cv_uint_t,
2725 [AC_TRY_COMPILE([#include <stdio.h>
2726 #include <sys/types.h>],
2728 [ac_cv_uint_t=true],
2729 [ac_cv_uint_t=false])])
2730 if test "$ac_cv_uint_t" = true ; then
2731 AC_DEFINE(HAVE_UINT_T)
2736 AC_MSG_CHECKING(for uint16_t)
2737 AC_CACHE_VAL(ac_cv_uint16_t,
2738 [AC_TRY_COMPILE([#include <stdio.h>
2739 #include <sys/types.h>],
2740 [uint16_t foo = 0;],
2741 [ac_cv_uint16_t=true],
2742 [ac_cv_uint16_t=false])])
2743 if test "$ac_cv_uint16_t" = true ; then
2744 AC_DEFINE(HAVE_UINT16_T)
2750 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2751 dnl are defined when compiling C++ but not C. Since the result of this
2752 dnl test is used only in C++, do it in C++.
2755 AC_MSG_CHECKING(for uname.domainname)
2756 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2757 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2758 [ struct utsname *res; char *domain;
2759 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2760 [ac_cv_have_uname_domainname_field=true],
2761 [ac_cv_have_uname_domainname_field=false])])
2763 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2764 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2770 AC_MSG_CHECKING(for uname.__domainname)
2771 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2772 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2773 [ struct utsname *res; char *domain;
2774 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2775 [ac_cv_have_uname_us_domainname_field=true],
2776 [ac_cv_have_uname_us_domainname_field=false])])
2778 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2779 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2787 dnl Check for usable wchar_t (2 bytes, unsigned)
2788 dnl (we really don't need the unsignedness check anymore)
2789 dnl ========================================================
2791 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2792 ac_cv_have_usable_wchar_v2,
2793 [AC_TRY_COMPILE([#include <stddef.h>
2794 $configure_static_assert_macros],
2795 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2796 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2797 ac_cv_have_usable_wchar_v2="yes",
2798 ac_cv_have_usable_wchar_v2="no")])
2799 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2800 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2801 HAVE_CPP_2BYTE_WCHAR_T=1
2803 dnl This is really gcc-only
2804 dnl Do this test using CXX only since some versions of gcc
2805 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2806 dnl only have short-wchar support for c++.
2807 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2811 _SAVE_CXXFLAGS=$CXXFLAGS
2812 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2814 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2815 ac_cv_have_usable_wchar_option_v2,
2816 [AC_TRY_LINK([#include <stddef.h>
2817 $configure_static_assert_macros],
2818 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2819 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2820 ac_cv_have_usable_wchar_option_v2="yes",
2821 ac_cv_have_usable_wchar_option_v2="no")])
2823 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2824 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2825 HAVE_CPP_2BYTE_WCHAR_T=1
2826 WCHAR_CFLAGS="-fshort-wchar"
2828 CXXFLAGS=$_SAVE_CXXFLAGS
2833 dnl Check for .hidden assembler directive and visibility attribute.
2834 dnl Borrowed from glibc configure.in
2835 dnl ===============================================================
2836 if test "$GNU_CC"; then
2837 AC_CACHE_CHECK(for visibility(hidden) attribute,
2838 ac_cv_visibility_hidden,
2839 [cat > conftest.c <<EOF
2840 int foo __attribute__ ((visibility ("hidden"))) = 1;
2842 ac_cv_visibility_hidden=no
2843 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2844 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2845 ac_cv_visibility_hidden=yes
2850 if test "$ac_cv_visibility_hidden" = "yes"; then
2851 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2853 AC_CACHE_CHECK(for visibility(default) attribute,
2854 ac_cv_visibility_default,
2855 [cat > conftest.c <<EOF
2856 int foo __attribute__ ((visibility ("default"))) = 1;
2858 ac_cv_visibility_default=no
2859 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2860 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2861 ac_cv_visibility_default=yes
2866 if test "$ac_cv_visibility_default" = "yes"; then
2867 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2869 AC_CACHE_CHECK(for visibility pragma support,
2870 ac_cv_visibility_pragma,
2871 [cat > conftest.c <<EOF
2872 #pragma GCC visibility push(hidden)
2874 #pragma GCC visibility push(default)
2875 int foo_default = 1;
2877 ac_cv_visibility_pragma=no
2878 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2879 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2880 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2881 ac_cv_visibility_pragma=yes
2887 if test "$ac_cv_visibility_pragma" = "yes"; then
2888 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2889 ac_cv_have_visibility_class_bug,
2890 [cat > conftest.c <<EOF
2891 #pragma GCC visibility push(hidden)
2892 struct __attribute__ ((visibility ("default"))) TestStruct {
2895 __attribute__ ((visibility ("default"))) void TestFunc() {
2899 ac_cv_have_visibility_class_bug=no
2900 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2901 ac_cv_have_visibility_class_bug=yes
2903 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2904 ac_cv_have_visibility_class_bug=yes
2907 rm -rf conftest.{c,S}
2910 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2911 ac_cv_have_visibility_builtin_bug,
2912 [cat > conftest.c <<EOF
2913 #pragma GCC visibility push(hidden)
2914 #pragma GCC visibility push(default)
2916 #pragma GCC visibility pop
2918 __attribute__ ((visibility ("default"))) void Func() {
2920 memset(c, 0, sizeof(c));
2923 ac_cv_have_visibility_builtin_bug=no
2924 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2925 ac_cv_have_visibility_builtin_bug=yes
2927 if test `grep -c "@PLT" conftest.S` = 0; then
2928 ac_cv_visibility_builtin_bug=yes
2931 rm -f conftest.{c,S}
2933 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2934 "$ac_cv_have_visibility_class_bug" = "no"; then
2935 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2936 WRAP_SYSTEM_INCLUDES=1
2938 VISIBILITY_FLAGS='-fvisibility=hidden'
2939 fi # have visibility pragma bug
2940 fi # have visibility pragma
2941 fi # have visibility(default) attribute
2942 fi # have visibility(hidden) attribute
2945 # visibility hidden flag for Sun Studio on Solaris
2946 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
2947 VISIBILITY_FLAGS='-xldscope=hidden'
2948 fi # Sun Studio on Solaris
2950 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2951 AC_SUBST(VISIBILITY_FLAGS)
2953 dnl Checks for header files.
2954 dnl ========================================================
2956 case "$target_os" in
2958 # for stuff like -lXshm
2959 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2962 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
2963 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
2964 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
2965 AC_CHECK_HEADERS(malloc.h)
2966 AC_CHECK_HEADERS(X11/XKBlib.h)
2967 AC_CHECK_HEADERS(io.h)
2969 dnl These are all the places some variant of statfs can be hiding.
2970 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2972 dnl Try for MMX support
2973 dnl NB - later gcc versions require -mmmx for this header to be successfully
2974 dnl included (or another option which implies it, such as -march=pentium-mmx)
2975 AC_CHECK_HEADERS(mmintrin.h)
2977 dnl Check whether the compiler supports the new-style C++ standard
2978 dnl library headers (i.e. <new>) or needs the old "new.h"
2981 AC_CHECK_HEADER(new, [NEW_H=new])
2982 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2985 AC_ARG_ENABLE(dtrace,
2986 [ --enable-dtrace build with dtrace support if available (default=no)],
2987 [enable_dtrace="yes"],)
2988 if test "x$enable_dtrace" = "xyes"; then
2989 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2990 if test -n "$HAVE_DTRACE"; then
2991 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
2993 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
2996 AC_SUBST(HAVE_DTRACE)
3002 AC_CHECK_HEADERS(sys/cdefs.h)
3006 dnl Checks for libraries.
3007 dnl ========================================================
3012 AC_CHECK_LIB(c_r, gethostbyname_r)
3016 dnl We don't want to link with libdl even if it's present on OS X, since
3017 dnl it's not used and not part of the default installation.
3018 dnl The same goes for BeOS.
3019 dnl We don't want to link against libm or libpthread on Darwin since
3020 dnl they both are just symlinks to libSystem and explicitly linking
3021 dnl against libSystem causes issues when debugging (see bug 299601).
3028 AC_CHECK_LIB(m, atan)
3029 AC_CHECK_LIB(dl, dlopen,
3030 AC_CHECK_HEADER(dlfcn.h,
3032 AC_DEFINE(HAVE_LIBDL)))
3036 _SAVE_CFLAGS="$CFLAGS"
3037 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3038 AC_CHECK_FUNCS(dladdr)
3039 CFLAGS="$_SAVE_CFLAGS"
3041 if test ! "$GNU_CXX"; then
3045 AC_CHECK_LIB(C_r, demangle)
3048 AC_CHECK_LIB(C, demangle)
3052 AC_CHECK_LIB(socket, socket)
3055 XLIBS="$X_EXTRA_LIBS"
3057 dnl ========================================================
3058 dnl Checks for X libraries.
3059 dnl Ordering is important.
3060 dnl Xt is dependent upon SM as of X11R6
3061 dnl ========================================================
3062 if test "$no_x" = "yes"; then
3065 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3066 XLIBS="-lX11 $XLIBS"
3067 _SAVE_LDFLAGS="$LDFLAGS"
3068 LDFLAGS="$XLDFLAGS $LDFLAGS"
3069 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3070 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3071 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3072 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3075 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3076 unset ac_cv_lib_Xt_XtFree
3077 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3078 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3079 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3080 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3083 # AIX needs the motif library linked before libXt to prevent
3084 # crashes in plugins linked against Motif - Bug #98892
3085 case "${target_os}" in
3087 XT_LIBS="-lXm $XT_LIBS"
3091 dnl ========================================================
3092 dnl = Check for XShm
3093 dnl ========================================================
3094 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3096 AC_CHECK_HEADER(X11/extensions/XShm.h)
3097 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3098 test -n "$_HAVE_XSHM_XEXT"; then
3099 AC_DEFINE(HAVE_XSHM)
3102 dnl ========================================================
3104 dnl ========================================================
3105 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3107 AC_CHECK_HEADER(X11/extensions/XIElib.h)
3109 if test "$MOZ_XIE_LIBS"; then
3110 dnl ====================================================
3111 dnl = If XIE is present and is desired, turn it on
3112 dnl ====================================================
3122 LDFLAGS="$_SAVE_LDFLAGS"
3124 dnl ========================================================
3125 dnl = Check for freetype2 and its functionality
3126 dnl ========================================================
3127 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3129 if test "$_HAVE_FREETYPE2"; then
3131 _SAVE_CFLAGS="$CFLAGS"
3132 LIBS="$LIBS $FT2_LIBS"
3133 CFLAGS="$CFLAGS $FT2_CFLAGS"
3135 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3136 ac_cv_member_FT_Bitmap_Size_y_ppem,
3137 [AC_TRY_COMPILE([#include <ft2build.h>
3138 #include FT_FREETYPE_H],
3140 if (sizeof s.y_ppem) return 0;
3142 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3143 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3144 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3145 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3147 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3149 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3150 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3151 [FT_Bitmap_Size structure includes y_ppem field])
3153 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3156 CFLAGS="$_SAVE_CFLAGS"
3166 AC_MSG_CHECKING(for ARM SIMD support)
3168 [asm("uqadd8 r1, r1, r2");],
3169 result="yes", result="no")
3170 AC_MSG_RESULT("$result")
3171 if test "$result" = "yes"; then
3172 AC_DEFINE(HAVE_ARM_SIMD)
3175 AC_SUBST(HAVE_ARM_SIMD)
3177 dnl ========================================================
3178 dnl = pthread support
3179 dnl = Start by checking whether the system support pthreads
3180 dnl ========================================================
3181 case "$target_os" in
3186 MOZ_CHECK_PTHREADS(pthreads,
3187 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3188 MOZ_CHECK_PTHREADS(pthread,
3189 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3190 MOZ_CHECK_PTHREADS(c_r,
3191 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3192 MOZ_CHECK_PTHREADS(c,
3201 dnl ========================================================
3202 dnl Check the command line for --with-pthreads
3203 dnl ========================================================
3204 MOZ_ARG_WITH_BOOL(pthreads,
3205 [ --with-pthreads Force use of system pthread library with NSPR ],
3206 [ if test "$USE_PTHREADS"x = x; then
3207 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3213 dnl ========================================================
3214 dnl Do the platform specific pthread hackery
3215 dnl ========================================================
3216 if test "$USE_PTHREADS"x != x
3219 dnl See if -pthread is supported.
3222 ac_cv_have_dash_pthread=no
3223 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3224 echo 'int main() { return 0; }' | cat > conftest.c
3225 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3226 if test $? -eq 0; then
3227 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3228 ac_cv_have_dash_pthread=yes
3229 case "$target_os" in
3231 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3234 CFLAGS="$CFLAGS -pthread"
3235 CXXFLAGS="$CXXFLAGS -pthread"
3241 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3244 dnl See if -pthreads is supported.
3246 ac_cv_have_dash_pthreads=no
3247 if test "$ac_cv_have_dash_pthread" = "no"; then
3248 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3249 echo 'int main() { return 0; }' | cat > conftest.c
3250 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3251 if test $? -eq 0; then
3252 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3253 ac_cv_have_dash_pthreads=yes
3254 CFLAGS="$CFLAGS -pthreads"
3255 CXXFLAGS="$CXXFLAGS -pthreads"
3259 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3264 AC_DEFINE(_REENTRANT)
3265 AC_DEFINE(_THREAD_SAFE)
3266 dnl -pthread links in -lc_r, so don't specify it explicitly.
3267 if test "$ac_cv_have_dash_pthread" = "yes"; then
3268 _PTHREAD_LDFLAGS="-pthread"
3270 _PTHREAD_LDFLAGS="-lc_r"
3274 *-*-openbsd*|*-*-bsdi*)
3275 AC_DEFINE(_REENTRANT)
3276 AC_DEFINE(_THREAD_SAFE)
3277 dnl -pthread links in -lc_r, so don't specify it explicitly.
3278 if test "$ac_cv_have_dash_pthread" = "yes"; then
3279 _PTHREAD_LDFLAGS="-pthread"
3283 *-*-linux*|*-*-kfreebsd*-gnu)
3284 AC_DEFINE(_REENTRANT)
3288 AC_DEFINE(_REENTRANT)
3292 AC_DEFINE(_REENTRANT)
3296 AC_DEFINE(_REENTRANT)
3300 AC_DEFINE(_REENTRANT)
3304 AC_DEFINE(_REENTRANT)
3305 if test ! "$GNU_CC"; then
3306 CFLAGS="$CFLAGS -mt"
3307 CXXFLAGS="$CXXFLAGS -mt"
3311 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3314 dnl ========================================================
3315 dnl See if mmap sees writes
3316 dnl For cross compiling, just define it as no, which is a safe default
3317 dnl ========================================================
3318 AC_MSG_CHECKING(whether mmap() sees write()s)
3324 #include <sys/mman.h>
3325 #include <sys/types.h>
3326 #include <sys/stat.h>
3329 char fname[] = "conftest.file";
3330 char zbuff[1024]; /* Fractional page is probably worst case */
3337 fd = open(fname, O_RDWR | O_CREAT, 0660);
3340 write(fd, zbuff, sizeof(zbuff));
3341 lseek(fd, 0, SEEK_SET);
3342 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3343 if(map==(char*)-1) return 2;
3344 for(i=0; fname[i]; i++) {
3345 int rc = write(fd, &fname[i], 1);
3346 if(map[i]!=fname[i]) return 4;
3353 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3355 AC_MSG_RESULT("$result")
3357 if test "$result" = "no"; then
3358 AC_DEFINE(MMAP_MISSES_WRITES)
3362 dnl Checks for library functions.
3363 dnl ========================================================
3364 AC_PROG_GCC_TRADITIONAL
3366 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3367 AC_CHECK_FUNCS(flockfile getpagesize)
3368 AC_CHECK_FUNCS(localtime_r strtok_r)
3370 dnl check for wcrtomb/mbrtowc
3371 dnl =======================================================================
3372 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3375 AC_CACHE_CHECK(for wcrtomb,
3377 [AC_TRY_LINK([#include <wchar.h>],
3378 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3379 ac_cv_have_wcrtomb="yes",
3380 ac_cv_have_wcrtomb="no")])
3381 if test "$ac_cv_have_wcrtomb" = "yes"; then
3382 AC_DEFINE(HAVE_WCRTOMB)
3384 AC_CACHE_CHECK(for mbrtowc,
3386 [AC_TRY_LINK([#include <wchar.h>],
3387 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3388 ac_cv_have_mbrtowc="yes",
3389 ac_cv_have_mbrtowc="no")])
3390 if test "$ac_cv_have_mbrtowc" = "yes"; then
3391 AC_DEFINE(HAVE_MBRTOWC)
3398 ac_cv_func_res_ninit,
3401 #define _BSD_SOURCE 1
3405 [int foo = res_ninit(&_res);],
3406 [ac_cv_func_res_ninit=yes],
3407 [ac_cv_func_res_ninit=no])
3410 if test "$ac_cv_func_res_ninit" = "yes"; then
3411 AC_DEFINE(HAVE_RES_NINIT)
3412 dnl must add the link line we do something as foolish as this... dougt
3414 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3415 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3420 [for gnu_get_libc_version()],
3421 ac_cv_func_gnu_get_libc_version,
3423 #ifdef HAVE_GNU_LIBC_VERSION_H
3424 #include <gnu/libc-version.h>
3427 [const char *glibc_version = gnu_get_libc_version();],
3428 [ac_cv_func_gnu_get_libc_version=yes],
3429 [ac_cv_func_gnu_get_libc_version=no]
3433 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3434 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3438 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3442 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3443 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3444 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3446 LIBS="$LIBS $_ICONV_LIBS"
3455 iconv_t h = iconv_open("", "");
3456 iconv(h, NULL, NULL, NULL, NULL);
3459 [ac_cv_func_iconv=yes],
3460 [ac_cv_func_iconv=no]
3463 if test "$ac_cv_func_iconv" = "yes"; then
3464 AC_DEFINE(HAVE_ICONV)
3465 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3466 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3467 LIBICONV="$_ICONV_LIBS"
3469 [for iconv() with const input],
3470 ac_cv_func_const_iconv,
3476 const char *input = "testing";
3477 iconv_t h = iconv_open("", "");
3478 iconv(h, &input, NULL, NULL, NULL);
3481 [ac_cv_func_const_iconv=yes],
3482 [ac_cv_func_const_iconv=no]
3485 if test "$ac_cv_func_const_iconv" = "yes"; then
3486 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3498 dnl **********************
3499 dnl *** va_copy checks ***
3500 dnl **********************
3501 dnl we currently check for all three va_copy possibilities, so we get
3502 dnl all results in config.log for bug reports.
3503 AC_MSG_CHECKING(for an implementation of va_copy())
3504 AC_CACHE_VAL(ac_cv_va_copy,[
3507 void f (int i, ...) {
3508 va_list args1, args2;
3509 va_start (args1, i);
3510 va_copy (args2, args1);
3511 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3513 va_end (args1); va_end (args2);
3515 int main() { f (0, 42); return 0; }],
3521 AC_MSG_RESULT($ac_cv_va_copy)
3522 AC_MSG_CHECKING(for an implementation of __va_copy())
3523 AC_CACHE_VAL(ac_cv___va_copy,[
3526 void f (int i, ...) {
3527 va_list args1, args2;
3528 va_start (args1, i);
3529 __va_copy (args2, args1);
3530 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3532 va_end (args1); va_end (args2);
3534 int main() { f (0, 42); return 0; }],
3535 ac_cv___va_copy=yes,
3540 AC_MSG_RESULT($ac_cv___va_copy)
3541 AC_MSG_CHECKING(whether va_lists can be copied by value)
3542 AC_CACHE_VAL(ac_cv_va_val_copy,[
3545 void f (int i, ...) {
3546 va_list args1, args2;
3547 va_start (args1, i);
3549 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3551 va_end (args1); va_end (args2);
3553 int main() { f (0, 42); return 0; }],
3554 ac_cv_va_val_copy=yes,
3555 ac_cv_va_val_copy=no,
3556 ac_cv_va_val_copy=yes
3559 if test "x$ac_cv_va_copy" = "xyes"; then
3560 AC_DEFINE(VA_COPY, va_copy)
3561 AC_DEFINE(HAVE_VA_COPY)
3562 elif test "x$ac_cv___va_copy" = "xyes"; then
3563 AC_DEFINE(VA_COPY, __va_copy)
3564 AC_DEFINE(HAVE_VA_COPY)
3567 if test "x$ac_cv_va_val_copy" = "xno"; then
3568 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3570 AC_MSG_RESULT($ac_cv_va_val_copy)
3572 dnl Check for dll-challenged libc's.
3573 dnl This check is apparently only needed for Linux.
3576 dnl ===================================================================
3579 rm -rf conftest* _conftest
3581 cat >> conftest.C <<\EOF
3586 void __dump_link_map(void) {
3587 struct link_map *map = _dl_loaded;
3588 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3591 dlopen("./conftest1.so",RTLD_LAZY);
3592 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3593 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3594 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3598 /* _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).*/
3599 int main() { printf("./conftest1.so\n"); }
3603 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3605 cat >> conftest1.C <<\EOF
3607 void foo(void) {printf("foo in dll called\n");}
3609 ${CXX-g++} -fPIC -c -g conftest1.C
3610 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3611 ${CXX-g++} -g conftest.C -o conftest -ldl
3612 cp -f conftest1.so conftest _conftest
3614 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3617 echo "*** Your libc has a bug that can result in loading the same dynamic"
3618 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3619 echo "*** or later. However, if you choose not to upgrade, the only effect"
3620 echo "*** will be excessive memory usage at runtime."
3624 rm -rf conftest* _conftest
3625 dnl ===================================================================
3629 dnl ===================================================================
3630 dnl ========================================================
3631 dnl By default, turn rtti and exceptions off on g++/egcs
3632 dnl ========================================================
3633 if test "$GNU_CXX"; then
3635 AC_MSG_CHECKING(for C++ exceptions flag)
3637 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3638 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3639 [echo "int main() { return 0; }" | cat > conftest.C
3641 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3643 if egrep "warning.*renamed" conftest.out >/dev/null; then
3644 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3646 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3651 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3652 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3653 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3656 dnl ========================================================
3657 dnl Put your C++ language/feature checks below
3658 dnl ========================================================
3662 if test "$GNU_CC"; then
3663 AC_CACHE_CHECK(for gcc 3.0 ABI,
3664 ac_cv_gcc_three_abi,
3667 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3673 ac_cv_gcc_three_abi="yes",
3674 ac_cv_gcc_three_abi="no")])
3675 if test "$ac_cv_gcc_three_abi" = "yes"; then
3676 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3679 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3682 AC_SUBST(HAVE_GCC3_ABI)
3685 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3687 [AC_TRY_COMPILE(class X {
3688 public: explicit X(int i) : i_(i) {}
3692 ac_cv_cpp_explicit=yes,
3693 ac_cv_cpp_explicit=no)])
3694 if test "$ac_cv_cpp_explicit" = yes ; then
3695 AC_DEFINE(HAVE_CPP_EXPLICIT)
3698 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3700 [AC_TRY_COMPILE(class param {
3702 typedef unsigned long num_type;
3705 template <class T> class tplt {
3707 typedef typename T::num_type t_num_type;
3708 t_num_type foo(typename T::num_type num) {
3714 ac_cv_cpp_typename=yes,
3715 ac_cv_cpp_typename=no)])
3716 if test "$ac_cv_cpp_typename" = yes ; then
3717 AC_DEFINE(HAVE_CPP_TYPENAME)
3720 dnl Check for support of modern template specialization syntax
3721 dnl Test code and requirement from scc@netscape.com.
3722 dnl Autoconf cut-and-paste job by waterson@netscape.com
3723 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3724 ac_cv_cpp_modern_specialize_template_syntax,
3725 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3727 template <> struct X<Y> { double a; };,
3730 ac_cv_cpp_modern_specialize_template_syntax=yes,
3731 ac_cv_cpp_modern_specialize_template_syntax=no)])
3732 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3733 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3737 dnl Some compilers support only full specialization, and some don't.
3738 AC_CACHE_CHECK(whether partial template specialization works,
3739 ac_cv_cpp_partial_specialization,
3740 [AC_TRY_COMPILE(template <class T> class Foo {};
3741 template <class T> class Foo<T*> {};,
3743 ac_cv_cpp_partial_specialization=yes,
3744 ac_cv_cpp_partial_specialization=no)])
3745 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3746 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3749 dnl Some compilers have limited support for operators with templates;
3750 dnl specifically, it is necessary to define derived operators when a base
3751 dnl class's operator declaration should suffice.
3752 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3753 ac_cv_need_derived_template_operators,
3754 [AC_TRY_COMPILE([template <class T> class Base { };
3756 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3757 template <class T> class Derived : public Base<T> { };],
3758 [Derived<char> a, b;
3759 Base<char> c = a + b;
3761 ac_cv_need_derived_template_operators=no,
3762 ac_cv_need_derived_template_operators=yes)])
3763 if test "$ac_cv_need_derived_template_operators" = yes ; then
3764 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3768 dnl Some compilers have trouble detecting that a template class
3769 dnl that derives from another template is actually an instance
3770 dnl of the base class. This test checks for that.
3771 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3772 ac_cv_need_cpp_template_cast_to_base,
3773 [AC_TRY_COMPILE([template <class T> class Base { };
3774 template <class T> class Derived : public Base<T> { };
3775 template <class T> int foo(const Base<T>&) { return 0; }],
3776 [Derived<char> bar; return foo(bar);],
3777 ac_cv_need_cpp_template_cast_to_base=no,
3778 ac_cv_need_cpp_template_cast_to_base=yes)])
3779 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3780 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3783 dnl Some compilers have trouble resolving the ambiguity between two
3784 dnl functions whose arguments differ only by cv-qualifications.
3785 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3786 ac_cv_can_resolve_const_ambiguity,
3788 template <class T> class ptrClass {
3792 template <class T> T* a(ptrClass<T> *arg) {
3797 const T* a(const ptrClass<T> *arg) {
3803 ac_cv_can_resolve_const_ambiguity=yes,
3804 ac_cv_can_resolve_const_ambiguity=no)])
3805 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3806 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3810 dnl We don't do exceptions on unix. The only reason this used to be here
3811 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3812 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3813 dnl So im commenting this out until someone writes some artificial
3814 dnl intelligence to detect not only if the compiler has exceptions, but if
3815 dnl they are enabled as well.
3817 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3818 dnl ac_cv_cpp_exceptions,
3819 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3820 dnl static void F() { throw X(); },
3821 dnl try { F(); } catch(X & e) { },
3822 dnl ac_cv_cpp_exceptions=yes,
3823 dnl ac_cv_cpp_exceptions=no)])
3824 dnl if test $ac_cv_cpp_exceptions = yes ; then
3825 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3828 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3829 dnl supports it well enough to allow us to use it to change access, but not
3830 dnl to resolve ambiguity. The next two tests determine how well the |using|
3831 dnl keyword is supported.
3833 dnl Check to see if we can change access with |using|. Test both a
3834 dnl legal and an illegal example.
3835 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3836 ac_cv_cpp_access_changing_using2,
3838 class A { protected: int foo() { return 0; } };
3839 class B : public A { public: using A::foo; };,
3840 B b; return b.foo();,
3842 class A { public: int foo() { return 1; } };
3843 class B : public A { private: using A::foo; };,
3844 B b; return b.foo();,
3845 ac_cv_cpp_access_changing_using2=no,
3846 ac_cv_cpp_access_changing_using2=yes)],
3847 ac_cv_cpp_access_changing_using2=no)])
3848 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3849 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3852 dnl Check to see if we can resolve ambiguity with |using|.
3853 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3854 ac_cv_cpp_ambiguity_resolving_using,
3855 [AC_TRY_COMPILE(class X {
3856 public: int go(const X&) {return 3;}
3857 int jo(const X&) {return 3;}
3859 class Y : public X {
3860 public: int go(int) {return 2;}
3861 int jo(int) {return 2;}
3863 private: using X::go;
3866 ac_cv_cpp_ambiguity_resolving_using=yes,
3867 ac_cv_cpp_ambiguity_resolving_using=no)])
3868 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3869 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3872 dnl Check to see if the |std| namespace is supported. If so, we'll want
3873 dnl to qualify any standard library calls with "std::" to ensure that
3874 dnl those functions can be resolved.
3875 AC_CACHE_CHECK(for \"std::\" namespace,
3876 ac_cv_cpp_namespace_std,
3877 [AC_TRY_COMPILE([#include <algorithm>],
3878 [return std::min(0, 1);],
3879 ac_cv_cpp_namespace_std=yes,
3880 ac_cv_cpp_namespace_std=no)])
3881 if test "$ac_cv_cpp_namespace_std" = yes ; then
3882 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3885 dnl Older compilers are overly ambitious with respect to using the standard
3886 dnl template library's |operator!=()| when |operator==()| is defined. In
3887 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3888 dnl ambiguity at compile-time. This test checks for that case.
3889 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3890 ac_cv_cpp_unambiguous_std_notequal,
3891 [AC_TRY_COMPILE([#include <algorithm>
3893 int operator==(const T1&, const T1&) { return 0; }
3894 int operator!=(const T1&, const T1&) { return 0; }],
3895 [T1 a,b; return a != b;],
3896 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3897 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3898 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3899 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
3903 AC_CACHE_CHECK(for C++ reinterpret_cast,
3904 ac_cv_cpp_reinterpret_cast,
3905 [AC_TRY_COMPILE(struct X { int i; };
3906 struct Y { int i; };,
3907 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
3908 ac_cv_cpp_reinterpret_cast=yes,
3909 ac_cv_cpp_reinterpret_cast=no)])
3910 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
3911 AC_DEFINE(HAVE_CPP_NEW_CASTS)
3914 dnl See if a dynamic_cast to void* gives the most derived object.
3915 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3916 ac_cv_cpp_dynamic_cast_void_ptr,
3917 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3918 class Y { int j; public: virtual ~Y() { } };
3919 class Z : public X, public Y { int k; };
3925 return !((((void*)&mdo != (void*)subx) &&
3926 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3927 (((void*)&mdo != (void*)suby) &&
3928 ((void*)&mdo == dynamic_cast<void*>(suby))));
3930 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3931 ac_cv_cpp_dynamic_cast_void_ptr=no,
3932 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3933 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3934 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3938 dnl note that this one is reversed - if the test fails, then
3939 dnl we require implementations of unused virtual methods. Which
3940 dnl really blows because it means we'll have useless vtable
3942 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3943 ac_cv_cpp_unused_required,
3944 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3946 ac_cv_cpp_unused_required=no,
3947 ac_cv_cpp_unused_required=yes)])
3948 if test "$ac_cv_cpp_unused_required" = yes ; then
3949 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3953 dnl Some compilers have trouble comparing a constant reference to a templatized
3954 dnl class to zero, and require an explicit operator==() to be defined that takes
3955 dnl an int. This test separates the strong from the weak.
3957 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3958 ac_cv_trouble_comparing_to_zero,
3959 [AC_TRY_COMPILE([#include <algorithm>
3960 template <class T> class Foo {};
3962 template <class T> int operator==(const T2*, const T&) { return 0; }
3963 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3964 [Foo<int> f; return (0 != f);],
3965 ac_cv_trouble_comparing_to_zero=no,
3966 ac_cv_trouble_comparing_to_zero=yes)])
3967 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3968 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3973 dnl End of C++ language/feature checks
3976 dnl ========================================================
3977 dnl = Internationalization checks
3978 dnl ========================================================
3980 dnl Internationalization and Locale support is different
3981 dnl on various UNIX platforms. Checks for specific i18n
3982 dnl features go here.
3984 dnl check for LC_MESSAGES
3985 AC_CACHE_CHECK(for LC_MESSAGES,
3986 ac_cv_i18n_lc_messages,
3987 [AC_TRY_COMPILE([#include <locale.h>],
3988 [int category = LC_MESSAGES;],
3989 ac_cv_i18n_lc_messages=yes,
3990 ac_cv_i18n_lc_messages=no)])
3991 if test "$ac_cv_i18n_lc_messages" = yes; then
3992 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3995 fi # SKIP_COMPILER_CHECKS
3998 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3999 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4002 dnl Mozilla specific options
4003 dnl ========================================================
4004 dnl The macros used for command line options
4005 dnl are defined in build/autoconf/altoptions.m4.
4008 dnl ========================================================
4010 dnl = Check for external package dependencies
4012 dnl ========================================================
4013 MOZ_ARG_HEADER(External Packages)
4017 MOZ_ARG_WITH_STRING(libxul-sdk,
4018 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4019 LIBXUL_SDK_DIR=$withval)
4021 if test "$LIBXUL_SDK_DIR" = "yes"; then
4022 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4023 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4024 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4026 if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
4027 AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
4032 AC_SUBST(LIBXUL_SDK)
4034 if test -n "$LIBXUL_SDK"; then
4035 LIBXUL_DIST="$LIBXUL_SDK"
4037 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4039 AC_SUBST(LIBXUL_DIST)
4043 MOZ_ARG_WITH_BOOL(system-libxul,
4044 [ --with-system-libxul Use system installed libxul SDK],
4047 if test -n "$SYSTEM_LIBXUL" && test -z "$MOZ_ENABLE_LIBXUL"; then
4048 AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4051 dnl ========================================================
4052 dnl = If NSPR was not detected in the system,
4053 dnl = use the one in the source tree (mozilla/nsprpub)
4054 dnl ========================================================
4055 MOZ_ARG_WITH_BOOL(system-nspr,
4056 [ --with-system-nspr Use system installed NSPR],
4057 _USE_SYSTEM_NSPR=1 )
4059 if test -n "$_USE_SYSTEM_NSPR"; then
4060 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
4063 if test -n "$MOZ_NATIVE_NSPR"; then
4064 _SAVE_CFLAGS=$CFLAGS
4065 CFLAGS="$CFLAGS $NSPR_CFLAGS"
4066 AC_TRY_COMPILE([#include "prlog.h"],
4067 [#ifndef PR_STATIC_ASSERT
4068 #error PR_STATIC_ASSERT not defined
4070 [MOZ_NATIVE_NSPR=1],
4071 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
4072 CFLAGS=$_SAVE_CFLAGS
4074 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4075 if test "$OS_ARCH" = "WINCE"; then
4076 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4077 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4078 elif test "$OS_ARCH" = "WINNT"; then
4079 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4080 if test -n "$GNU_CC"; then
4081 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4083 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4086 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4090 dnl ========================================================
4091 dnl = If NSS was not detected in the system,
4092 dnl = use the one in the source tree (mozilla/security/nss)
4093 dnl ========================================================
4095 MOZ_ARG_WITH_BOOL(system-nss,
4096 [ --with-system-nss Use system installed NSS],
4099 if test -n "$_USE_SYSTEM_NSS"; then
4100 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
4103 if test -n "$MOZ_NATIVE_NSS"; then
4104 NSS_LIBS="$NSS_LIBS -lcrmf"
4106 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4108 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4109 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4110 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4111 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4112 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX) \
4113 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
4115 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4117 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4118 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4119 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4120 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4121 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4122 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
4124 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
4128 if test -z "$SKIP_LIBRARY_CHECKS"; then
4129 dnl system JPEG support
4130 dnl ========================================================
4131 MOZ_ARG_WITH_STRING(system-jpeg,
4132 [ --with-system-jpeg[=PFX]
4133 Use system libjpeg [installed at prefix PFX]],
4136 _SAVE_CFLAGS=$CFLAGS
4137 _SAVE_LDFLAGS=$LDFLAGS
4139 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4140 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4141 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4143 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4146 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4149 if test "$SYSTEM_JPEG" = 1; then
4150 LIBS="$JPEG_LIBS $LIBS"
4151 AC_TRY_COMPILE([ #include <stdio.h>
4152 #include <sys/types.h>
4153 #include <jpeglib.h> ],
4154 [ #if JPEG_LIB_VERSION < $MOZJPEG
4155 #error "Insufficient JPEG library version ($MOZJPEG required)."
4158 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4160 CFLAGS=$_SAVE_CFLAGS
4161 LDFLAGS=$_SAVE_LDFLAGS
4164 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4165 JPEG_CFLAGS="-I${JPEG_DIR}/include"
4166 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4169 dnl system ZLIB support
4170 dnl ========================================================
4171 MOZ_ARG_WITH_STRING(system-zlib,
4172 [ --with-system-zlib[=PFX]
4173 Use system libz [installed at prefix PFX]],
4176 _SAVE_CFLAGS=$CFLAGS
4177 _SAVE_LDFLAGS=$LDFLAGS
4179 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4180 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4181 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4183 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4186 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4187 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4189 if test "$SYSTEM_ZLIB" = 1; then
4190 LIBS="$ZLIB_LIBS $LIBS"
4191 AC_TRY_COMPILE([ #include <stdio.h>
4193 #include <zlib.h> ],
4194 [ #if ZLIB_VERNUM < $MOZZLIB
4195 #error "Insufficient zlib version ($MOZZLIB required)."
4198 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4200 CFLAGS=$_SAVE_CFLAGS
4201 LDFLAGS=$_SAVE_LDFLAGS
4204 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4205 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4206 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4209 dnl system BZIP2 Support
4210 dnl ========================================================
4211 MOZ_ARG_WITH_STRING(system-bz2,
4212 [ --with-system-bz2[=PFX]
4213 Use system libbz2 [installed at prefix PFX]],
4216 _SAVE_CFLAGS=$CFLAGS
4217 _SAVE_LDFLAGS=$LDFLAGS
4219 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4220 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4221 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4223 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4226 AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4227 [SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
4229 CFLAGS=$_SAVE_CFLAGS
4230 LDFLAGS=$_SAVE_LDFLAGS
4233 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4234 BZ2_CFLAGS="-I${BZ2_DIR}/include"
4235 BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4238 dnl system PNG Support
4239 dnl ========================================================
4240 MOZ_ARG_WITH_STRING(system-png,
4241 [ --with-system-png[=PFX]
4242 Use system libpng [installed at prefix PFX]],
4245 _SAVE_CFLAGS=$CFLAGS
4246 _SAVE_LDFLAGS=$LDFLAGS
4248 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4249 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4250 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4251 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4252 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4254 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4257 _SAVE_PNG_LIBS=$PNG_LIBS
4258 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4259 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4261 AC_CHECK_LIB(png, png_get_acTL, ,
4262 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4265 if test "$SYSTEM_PNG" = 1; then
4266 LIBS="$PNG_LIBS $LIBS"
4267 AC_TRY_COMPILE([ #include <stdio.h>
4268 #include <sys/types.h>
4270 [ #if PNG_LIBPNG_VER < $MOZPNG
4271 #error "Insufficient libpng version ($MOZPNG required)."
4273 #ifndef PNG_UINT_31_MAX
4274 #error "Insufficient libpng version."
4277 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4279 CFLAGS=$_SAVE_CFLAGS
4280 LDFLAGS=$_SAVE_LDFLAGS
4283 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4284 PNG_CFLAGS="-I${PNG_DIR}/include"
4285 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4288 fi # SKIP_LIBRARY_CHECKS
4290 dnl system HunSpell Support
4291 dnl ========================================================
4292 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4293 [ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4296 if test -n "$SYSTEM_HUNSPELL"; then
4297 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4300 AC_SUBST(SYSTEM_HUNSPELL)
4302 dnl ========================================================
4303 dnl Java SDK support
4304 dnl ========================================================
4306 MOZ_ARG_WITH_STRING(java-include-path,
4307 [ --with-java-include-path=dir Location of Java SDK headers],
4308 JAVA_INCLUDE_PATH=$withval)
4311 MOZ_ARG_WITH_STRING(java-bin-path,
4312 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4313 JAVA_BIN_PATH=$withval)
4315 dnl ========================================================
4316 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4317 dnl their usage and use them in spidermonkey.
4318 dnl ========================================================
4319 MOZ_ARG_WITH_BOOL(arm-kuser,
4320 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4323 if test -n "$USE_ARM_KUSER"; then
4324 AC_DEFINE(USE_ARM_KUSER)
4327 dnl ========================================================
4331 dnl ========================================================
4333 MOZ_ARG_HEADER(Application)
4337 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4338 MOZ_BRANDING_DIRECTORY=
4339 MOZ_DBGRINFO_MODULES=
4342 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4343 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4350 MOZ_AUTH_EXTENSION=1
4351 MOZ_NO_ACTIVEX_SUPPORT=1
4352 MOZ_NO_INSPECTOR_APIS=
4353 MOZ_NO_XPCOM_OBSOLETE=
4362 MOZ_PLAINTEXT_EDITOR_ONLY=
4364 MOZ_PREF_EXTENSIONS=1
4365 MOZ_PROFILELOCKING=1
4367 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4369 MOZ_PYTHON_DEBUG_SUFFIX=
4370 MOZ_PYTHON_DLL_SUFFIX=
4371 MOZ_PYTHON_INCLUDES=
4375 MOZ_PYTHON_VER_DOTTED=
4381 MOZ_STATIC_MAIL_BUILD=
4386 MOZ_UNIVERSALCHARDET=1
4388 MOZ_USE_NATIVE_UCONV=
4390 MOZ_XPFE_COMPONENTS=1
4392 MOZ_XSLT_STANDALONE=
4399 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4400 NECKO_SMALL_BUFFERS=
4401 XPC_IDISPATCH_SUPPORT=
4404 case "$target_os" in
4413 case "$target_os" in
4414 msvc*|mks*|cygwin*|mingw*)
4415 if test -z "$GNU_CC"; then
4416 XPC_IDISPATCH_SUPPORT=1
4417 MOZ_NO_ACTIVEX_SUPPORT=
4418 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4423 MOZ_ARG_ENABLE_STRING(application,
4424 [ --enable-application=APP
4428 content/xslt (Standalone Transformiix XSLT)
4429 netwerk (Standalone Necko)
4430 tools/update-packaging (AUS-related packaging tools)
4431 standalone (use this for standalone
4432 xpcom/xpconnect or to manually drive a build)],
4433 [ MOZ_BUILD_APP=$enableval ] )
4435 MOZ_EMBEDDING_PROFILE=default
4436 MOZ_ARG_WITH_STRING(embedding-profile,
4437 [ --with-embedding-profile=default|basic|minimal
4438 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4439 [ MOZ_EMBEDDING_PROFILE=$withval ])
4441 case "$MOZ_EMBEDDING_PROFILE" in
4443 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4444 MOZ_EMBEDDING_LEVEL_BASIC=1
4445 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4446 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4447 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4448 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4452 MOZ_EMBEDDING_LEVEL_DEFAULT=
4453 MOZ_EMBEDDING_LEVEL_BASIC=1
4454 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4455 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4456 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4458 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4460 MOZ_ENABLE_POSTSCRIPT=
4461 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4462 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4463 MOZ_IMG_ENCODERS_DEFAULT=
4469 MOZ_NO_ACTIVEX_SUPPORT=1
4470 MOZ_NO_INSPECTOR_APIS=1
4471 MOZ_NO_XPCOM_OBSOLETE=1
4474 MOZ_PLAINTEXT_EDITOR_ONLY=1
4476 MOZ_PREF_EXTENSIONS=
4480 MOZ_UNIVERSALCHARDET=
4482 MOZ_USE_NATIVE_UCONV=
4484 MOZ_XPFE_COMPONENTS=
4489 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4490 NECKO_SMALL_BUFFERS=1
4491 NS_DISABLE_LOGGING=1
4496 MOZ_EMBEDDING_LEVEL_DEFAULT=
4497 MOZ_EMBEDDING_LEVEL_BASIC=
4498 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4499 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4501 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4503 MOZ_ENABLE_POSTSCRIPT=
4504 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4505 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4506 MOZ_IMG_ENCODERS_DEFAULT=
4512 MOZ_NO_ACTIVEX_SUPPORT=1
4513 MOZ_NO_INSPECTOR_APIS=1
4514 MOZ_NO_XPCOM_OBSOLETE=1
4517 MOZ_PLAINTEXT_EDITOR_ONLY=1
4519 MOZ_PREF_EXTENSIONS=
4525 MOZ_UNIVERSALCHARDET=
4527 MOZ_USE_NATIVE_UCONV=1
4529 MOZ_XPFE_COMPONENTS=
4536 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4537 NECKO_SMALL_BUFFERS=1
4538 NS_DISABLE_LOGGING=1
4543 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4547 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4548 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4549 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4551 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4552 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4553 XULRUNNER_STUB_NAME=$withval)
4555 if test -z "$XULRUNNER_STUB_NAME"; then
4556 case "$target_os" in
4558 XULRUNNER_STUB_NAME=xulrunner
4561 XULRUNNER_STUB_NAME=xulrunner-stub
4564 AC_SUBST(XULRUNNER_STUB_NAME)
4566 if test -z "$MOZ_BUILD_APP"; then
4567 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4569 # We have a valid application only if it has a build.mk file in its top
4571 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4572 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4576 # Allow the application to influence configure with a confvars.sh script.
4578 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4579 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4580 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4581 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4586 # Now is a good time to test for logic errors, define mismatches, etc.
4587 case "$MOZ_BUILD_APP" in
4589 if test "$LIBXUL_SDK"; then
4590 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4595 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4596 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4598 case "$MOZ_BUILD_APP" in
4600 AC_DEFINE(MOZ_PHOENIX)
4604 AC_DEFINE(MOZ_XULRUNNER)
4612 MOZ_APP_NAME=mozilla
4613 MOZ_APP_DISPLAYNAME=Mozilla
4614 MOZ_APP_VERSION=$MOZILLA_VERSION
4619 AC_SUBST(MOZ_BUILD_APP)
4620 AC_SUBST(MOZ_PHOENIX)
4621 AC_SUBST(MOZ_XULRUNNER)
4623 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4625 dnl ========================================================
4627 dnl = Toolkit Options
4629 dnl ========================================================
4630 MOZ_ARG_HEADER(Toolkit Options)
4632 dnl ========================================================
4633 dnl = Select the default toolkit
4634 dnl ========================================================
4635 MOZ_ARG_ENABLE_STRING(default-toolkit,
4636 [ --enable-default-toolkit=TK
4637 Select default toolkit
4638 Platform specific defaults:
4640 Mac OS X - cairo-cocoa
4641 Neutrino/QNX - photon
4643 Win32 - cairo-windows
4645 Gtk2 with DirectFB - cairo-gtk2-dfb
4648 [ _DEFAULT_TOOLKIT=$enableval ],
4649 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4651 if test "$_DEFAULT_TOOLKIT" = "photon" \
4652 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4653 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4654 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
4655 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4656 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4657 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4658 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4659 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4661 dnl nglayout only supports building with one toolkit,
4662 dnl so ignore everything after the first comma (",").
4663 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4665 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4668 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4670 dnl ========================================================
4671 dnl = Enable the toolkit as needed =
4672 dnl ========================================================
4674 case "$MOZ_WIDGET_TOOLKIT" in
4677 AC_DEFINE(MOZ_WIDGET_PHOTON)
4681 MOZ_WIDGET_TOOLKIT=windows
4682 MOZ_GFX_TOOLKIT=cairo
4685 cairo-gtk2|cairo-gtk2-x11)
4686 MOZ_WIDGET_TOOLKIT=gtk2
4687 MOZ_GFX_TOOLKIT=cairo
4689 MOZ_ENABLE_XREMOTE=1
4694 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4695 TK_LIBS='$(MOZ_GTK2_LIBS)'
4696 AC_DEFINE(MOZ_WIDGET_GTK2)
4700 MOZ_WIDGET_TOOLKIT=gtk2
4701 MOZ_GFX_TOOLKIT=cairo
4707 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4708 TK_LIBS='$(MOZ_GTK2_LIBS)'
4709 AC_DEFINE(MOZ_WIDGET_GTK2)
4710 if test "$no_x" != "yes"; then
4711 AC_MSG_WARN([Disabling X when DirectFB is specified.])
4717 MOZ_WIDGET_TOOLKIT=qt
4718 MOZ_GFX_TOOLKIT=cairo
4720 MOZ_ENABLE_XREMOTE=1
4727 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4728 TK_LIBS='$(MOZ_QT_LIBS)'
4729 AC_DEFINE(MOZ_WIDGET_QT)
4733 MOZ_WIDGET_TOOLKIT=beos
4734 MOZ_GFX_TOOLKIT=cairo
4735 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4736 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4740 MOZ_WIDGET_TOOLKIT=os2
4741 MOZ_GFX_TOOLKIT=cairo
4742 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4743 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4747 MOZ_WIDGET_TOOLKIT=cocoa
4748 AC_DEFINE(MOZ_WIDGET_COCOA)
4750 MOZ_GFX_TOOLKIT=cairo
4751 MOZ_USER_DIR="Mozilla"
4752 AC_DEFINE(XP_MACOSX)
4753 AC_DEFINE(TARGET_CARBON)
4754 AC_DEFINE(TARGET_API_MAC_CARBON)
4755 TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
4756 TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
4757 CFLAGS="$CFLAGS $TK_CFLAGS"
4758 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4762 if test "$MOZ_ENABLE_XREMOTE"; then
4763 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4766 if test "$COMPILE_ENVIRONMENT"; then
4767 if test "$MOZ_ENABLE_GTK2"; then
4768 if test "$MOZ_X11"; then
4769 GDK_PACKAGES=gdk-x11-2.0
4770 elif test "$MOZ_DFB"; then
4771 PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
4772 GDK_PACKAGES=directfb
4775 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4778 fi # COMPILE_ENVIRONMENT
4780 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4782 dnl ========================================================
4783 dnl = startup-notification support module
4784 dnl ========================================================
4786 if test "$MOZ_ENABLE_GTK2"
4788 MOZ_ENABLE_STARTUP_NOTIFICATION=
4790 MOZ_ARG_ENABLE_BOOL(startup-notification,
4791 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4792 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4793 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4794 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4796 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4797 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4798 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4799 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4801 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4803 MOZ_ENABLE_STARTUP_NOTIFICATION=
4807 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4808 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4811 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4813 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4814 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4815 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4817 dnl ========================================================
4819 dnl ========================================================
4820 if test "$MOZ_ENABLE_QT"
4822 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtUiTools QtCore)
4823 AC_SUBST(MOZ_QT_CFLAGS)
4824 AC_SUBST(MOZ_QT_LIBS)
4826 MOZ_ARG_WITH_STRING(qtdir,
4827 [ --with-qtdir=\$dir Specify Qt directory ],
4830 if test -z "$QTDIR"; then
4833 QTINCDIR="/include/qt"
4834 if test ! -d "$QTDIR$QTINCDIR"; then
4835 QTINCDIR="/include/X11/qt"
4837 if test ! -d "$QTDIR$QTINCDIR"; then
4841 if test -x "$QTDIR/bin/moc-qt4"; then
4842 HOST_MOC="$QTDIR/bin/moc-qt4"
4844 if test -x "$QTDIR/bin/moc"; then
4845 HOST_MOC="$QTDIR/bin/moc"
4847 AC_CHECK_PROGS(HOST_MOC, moc, "")
4850 if test -z "$HOST_MOC"; then
4851 AC_MSG_ERROR([no acceptable moc preprocessor found])
4856 AC_SUBST(GTK_CONFIG)
4860 AC_SUBST(MOZ_ENABLE_GTK2)
4861 AC_SUBST(MOZ_ENABLE_PHOTON)
4862 AC_SUBST(MOZ_ENABLE_COCOA)
4863 AC_SUBST(MOZ_ENABLE_QT)
4864 AC_SUBST(MOZ_ENABLE_XREMOTE)
4865 AC_SUBST(MOZ_GTK2_CFLAGS)
4866 AC_SUBST(MOZ_GTK2_LIBS)
4867 AC_SUBST(MOZ_QT_CFLAGS)
4868 AC_SUBST(MOZ_QT_LIBS)
4875 dnl ========================================================
4877 dnl = Components & Features
4879 dnl ========================================================
4880 MOZ_ARG_HEADER(Components and Features)
4882 dnl ========================================================
4884 dnl ========================================================
4885 MOZ_ARG_ENABLE_STRING(ui-locale,
4886 [ --enable-ui-locale=ab-CD
4887 Select the user interface locale (default: en-US)],
4888 MOZ_UI_LOCALE=$enableval )
4889 AC_SUBST(MOZ_UI_LOCALE)
4891 dnl ========================================================
4892 dnl = Trademarked Branding
4893 dnl ========================================================
4894 MOZ_ARG_ENABLE_BOOL(official-branding,
4895 [ --enable-official-branding Enable Official mozilla.org Branding
4896 Do not distribute builds with
4897 --enable-official-branding unless you have
4898 permission to use trademarks per
4899 http://www.mozilla.org/foundation/trademarks/ .],
4900 [case "$MOZ_BUILD_APP" in
4902 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
4903 MOZ_APP_DISPLAYNAME=Firefox
4907 AC_MSG_ERROR([Official branding is only available for Firefox.])
4911 MOZ_ARG_WITH_STRING(branding,
4912 [ --with-branding=dir Use branding from the specified directory.],
4913 MOZ_BRANDING_DIRECTORY=$withval)
4915 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4916 if test -z "$REAL_BRANDING_DIRECTORY"; then
4917 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4920 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4921 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
4924 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4926 dnl ========================================================
4927 dnl = Distribution ID
4928 dnl ========================================================
4929 MOZ_ARG_WITH_STRING(distribution-id,
4930 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
4931 [ val=`echo $withval`
4932 MOZ_DISTRIBUTION_ID="$val"])
4934 if test -z "$MOZ_DISTRIBUTION_ID"; then
4935 MOZ_DISTRIBUTION_ID="org.mozilla"
4938 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4939 AC_SUBST(MOZ_DISTRIBUTION_ID)
4942 dnl ========================================================
4943 dnl complex text support off by default
4944 dnl ========================================================
4946 MOZ_ARG_DISABLE_BOOL(pango,
4947 [ --disable-pango Disable usage of Pango ],
4952 dnl ========================================================
4954 dnl ========================================================
4955 if test "$MOZ_ENABLE_GTK2"
4959 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
4961 if test "$MOZ_PANGO"
4963 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
4964 AC_SUBST(MOZ_PANGO_CFLAGS)
4965 AC_SUBST(MOZ_PANGO_LIBS)
4966 AC_DEFINE(MOZ_PANGO)
4968 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
4969 AC_SUBST(MOZ_PANGO_CFLAGS)
4970 AC_SUBST(MOZ_PANGO_LIBS)
4972 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
4973 AC_SUBST(FT2_CFLAGS)
4978 dnl ========================================================
4979 dnl = PostScript print module
4980 dnl ========================================================
4981 MOZ_ARG_DISABLE_BOOL(postscript,
4982 [ --disable-postscript Disable PostScript printing support ],
4983 MOZ_ENABLE_POSTSCRIPT=,
4984 MOZ_ENABLE_POSTSCRIPT=1 )
4986 dnl ========================================================
4987 dnl = GnomeVFS support module
4988 dnl ========================================================
4992 dnl build the gnomevfs extension by default only when the
4993 dnl GTK2 toolkit is in use.
4994 if test "$MOZ_ENABLE_GTK2"
4996 MOZ_ENABLE_GNOMEVFS=1
4998 MOZ_ENABLE_LIBGNOME=1
5001 MOZ_ARG_DISABLE_BOOL(gnomevfs,
5002 [ --disable-gnomevfs Disable GnomeVFS support ],
5003 MOZ_ENABLE_GNOMEVFS=,
5004 MOZ_ENABLE_GNOMEVFS=force)
5006 if test "$MOZ_ENABLE_GNOMEVFS"
5008 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5009 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5010 MOZ_ENABLE_GNOMEVFS=1
5012 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5014 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5016 MOZ_ENABLE_GNOMEVFS=
5020 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5021 AC_SUBST(MOZ_GNOMEVFS_LIBS)
5023 if test "$MOZ_ENABLE_GCONF"
5025 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
5026 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5033 if test "$MOZ_ENABLE_GCONF"; then
5034 AC_DEFINE(MOZ_ENABLE_GCONF)
5037 AC_SUBST(MOZ_ENABLE_GCONF)
5038 AC_SUBST(MOZ_GCONF_CFLAGS)
5039 AC_SUBST(MOZ_GCONF_LIBS)
5041 if test "$MOZ_ENABLE_LIBGNOME"
5043 PKG_CHECK_MODULES(MOZ_LIBGNOME, libgnome-2.0 >= $LIBGNOME_VERSION,[
5044 MOZ_LIBGNOME_LIBS=`echo $MOZ_LIBGNOME_LIBS | sed 's/-llinc\>//'`
5045 MOZ_ENABLE_LIBGNOME=1
5047 MOZ_ENABLE_LIBGNOME=
5051 AC_SUBST(MOZ_LIBGNOME_CFLAGS)
5052 AC_SUBST(MOZ_LIBGNOME_LIBS)
5054 # The GNOME component is built if gtk2, gconf, gnome-vfs, and libgnome
5055 # are all available.
5057 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
5058 "$MOZ_ENABLE_GNOMEVFS" -a "$MOZ_ENABLE_LIBGNOME"; then
5059 MOZ_ENABLE_GNOME_COMPONENT=1
5061 MOZ_ENABLE_GNOME_COMPONENT=
5064 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5067 dnl ========================================================
5068 dnl = libgnomeui support module
5069 dnl ========================================================
5071 if test "$MOZ_ENABLE_GTK2"
5073 MOZ_ENABLE_GNOMEUI=1
5075 MOZ_ARG_DISABLE_BOOL(gnomeui,
5076 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5077 MOZ_ENABLE_GNOMEUI=,
5078 MOZ_ENABLE_GNOMEUI=force)
5080 if test "$MOZ_ENABLE_GNOMEUI"
5082 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5084 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5085 MOZ_ENABLE_GNOMEUI=1
5087 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5089 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5095 if test "$MOZ_ENABLE_GNOMEUI"; then
5096 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5099 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5100 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5101 AC_SUBST(MOZ_GNOMEUI_LIBS)
5103 dnl ========================================================
5105 dnl ========================================================
5107 if test "$MOZ_ENABLE_GTK2" || test "$MOZ_ENABLE_QT"
5111 MOZ_ARG_DISABLE_BOOL(dbus,
5112 [ --disable-dbus Disable dbus support ],
5116 if test "$MOZ_ENABLE_DBUS"
5118 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5119 AC_DEFINE(MOZ_ENABLE_DBUS)
5122 AC_SUBST(MOZ_ENABLE_DBUS)
5123 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5124 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5126 dnl ========================================================
5127 dnl = libnotify support
5128 dnl ========================================================
5130 MOZ_ARG_ENABLE_BOOL(libnotify,
5131 [ --enable-libnotify Enable libnotify support ],
5132 MOZ_ENABLE_LIBNOTIFY=1,
5133 MOZ_ENABLE_LIBNOTIFY=)
5135 if test "$MOZ_ENABLE_GTK2"
5137 if test "$MOZ_ENABLE_LIBNOTIFY"
5139 AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5143 if test -z "$SKIP_LIBRARY_CHECKS"
5145 if test "$MOZ_ENABLE_GTK2"
5147 if test "$MOZ_ENABLE_LIBNOTIFY"
5149 PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5153 AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5154 AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5155 AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5157 dnl ========================================================
5158 dnl = Build Personal Security Manager
5159 dnl ========================================================
5160 MOZ_ARG_DISABLE_BOOL(crypto,
5161 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5165 dnl ========================================================
5166 dnl = JS Debugger XPCOM component (js/jsd)
5167 dnl ========================================================
5168 MOZ_ARG_DISABLE_BOOL(jsd,
5169 [ --disable-jsd Disable JavaScript debug library],
5174 dnl ========================================================
5175 dnl = Disable plugin support
5176 dnl ========================================================
5177 MOZ_ARG_DISABLE_BOOL(plugins,
5178 [ --disable-plugins Disable plugins support],
5182 dnl ========================================================
5183 dnl = Disable building dbm
5184 dnl ========================================================
5185 MOZ_ARG_DISABLE_BOOL(dbm,
5186 [ --disable-dbm Disable building dbm],
5190 dnl ========================================================
5191 dnl = Open JVM Interface (OJI) support
5192 dnl ========================================================
5193 MOZ_ARG_DISABLE_BOOL(oji,
5194 [ --disable-oji Disable Open JVM Integration support],
5197 if test -n "$MOZ_OJI"; then
5201 dnl bi-directional support always on
5205 dnl ========================================================
5206 dnl view source support on by default
5207 dnl ========================================================
5208 MOZ_ARG_DISABLE_BOOL(view-source,
5209 [ --disable-view-source Disable view source support],
5212 if test "$MOZ_VIEW_SOURCE"; then
5213 AC_DEFINE(MOZ_VIEW_SOURCE)
5217 dnl ========================================================
5218 dnl accessibility support on by default on all platforms
5220 dnl ========================================================
5221 MOZ_ARG_DISABLE_BOOL(accessibility,
5222 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5225 if test "$ACCESSIBILITY"; then
5226 AC_DEFINE(ACCESSIBILITY)
5229 if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5231 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5232 if test "$ac_cv_header_atlbase_h" = "no"; then
5233 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.])
5235 if test "$ac_cv_header_oleacc_idl" = "no"; then
5236 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.])
5242 dnl ========================================================
5243 dnl xpfe/components on by default
5244 dnl ========================================================
5245 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5246 [ --disable-xpfe-components
5247 Disable xpfe components],
5248 MOZ_XPFE_COMPONENTS=,
5249 MOZ_XPFE_COMPONENTS=1 )
5251 dnl ========================================================
5252 dnl xpinstall support on by default
5253 dnl ========================================================
5254 MOZ_ARG_DISABLE_BOOL(xpinstall,
5255 [ --disable-xpinstall Disable xpinstall support],
5258 if test "$MOZ_XPINSTALL"; then
5259 AC_DEFINE(MOZ_XPINSTALL)
5262 dnl ========================================================
5263 dnl xpcom js loader support on by default
5264 dnl ========================================================
5265 MOZ_ARG_DISABLE_BOOL(jsloader,
5266 [ --disable-jsloader Disable xpcom js loader support],
5269 if test "$MOZ_JSLOADER"; then
5270 AC_DEFINE(MOZ_JSLOADER)
5273 dnl ========================================================
5274 dnl Disable printing
5275 dnl ========================================================
5276 MOZ_ARG_DISABLE_BOOL(printing,
5277 [ --disable-printing Disable printing support],
5281 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
5282 AC_MSG_WARN([Printing does not work with Qt at this time. Omitting printing support.])
5286 if test "$NS_PRINTING"; then
5287 AC_DEFINE(NS_PRINTING)
5288 AC_DEFINE(NS_PRINT_PREVIEW)
5291 dnl ========================================================
5292 dnl use native unicode converters
5293 dnl ========================================================
5294 MOZ_ARG_ENABLE_BOOL(native-uconv,
5295 [ --enable-native-uconv Enable iconv support],
5296 MOZ_USE_NATIVE_UCONV=1,
5297 MOZ_USE_NATIVE_UCONV= )
5298 if test "$MOZ_USE_NATIVE_UCONV"; then
5299 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5301 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5302 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5306 dnl ========================================================
5307 dnl Libeditor can be build as plaintext-only,
5308 dnl or as a full html and text editing component.
5309 dnl We build both by default.
5310 dnl ========================================================
5311 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5312 [ --enable-plaintext-editor-only
5313 Allow only plaintext editing],
5314 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5315 MOZ_PLAINTEXT_EDITOR_ONLY= )
5316 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5317 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5319 dnl ========================================================
5320 dnl = Drop XPCOM Obsolete library
5321 dnl ========================================================
5322 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5323 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5324 MOZ_NO_XPCOM_OBSOLETE=1,
5325 MOZ_NO_XPCOM_OBSOLETE=)
5327 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5328 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5331 dnl ========================================================
5332 dnl = Disable Fast Load
5333 dnl ========================================================
5334 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5335 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5339 AC_SUBST(MOZ_NO_FAST_LOAD)
5341 if test -n "$MOZ_NO_FAST_LOAD"; then
5342 AC_DEFINE(MOZ_NO_FAST_LOAD)
5345 dnl ========================================================
5346 dnl = Disable Ogg Codecs
5347 dnl ========================================================
5348 MOZ_ARG_DISABLE_BOOL(ogg,
5349 [ --disable-ogg Disable Ogg Codec support],
5355 if test -n "$MOZ_OGG"; then
5361 dnl ========================================================
5362 dnl = Disable Wave decoder support
5363 dnl ========================================================
5364 MOZ_ARG_DISABLE_BOOL(wave,
5365 [ --disable-wave Disable Wave decoder support],
5371 if test -n "$MOZ_WAVE"; then
5377 dnl ========================================================
5378 dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
5379 dnl ========================================================
5381 AC_SUBST(MOZ_SYDNEYAUDIO)
5383 if test -n "$MOZ_SYDNEYAUDIO"; then
5384 AC_DEFINE(MOZ_SYDNEYAUDIO)
5389 if test -n "$MOZ_MEDIA"; then
5390 AC_DEFINE(MOZ_MEDIA)
5393 dnl ========================================================
5394 dnl = Check alsa availability on Linux if using sydneyaudio
5395 dnl ========================================================
5397 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5398 if test "$COMPILE_ENVIRONMENT"; then
5399 if test -n "$MOZ_SYDNEYAUDIO"; then
5400 case "$target_os" in
5402 AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
5408 dnl ========================================================
5409 dnl Permissions System
5410 dnl ========================================================
5411 MOZ_ARG_DISABLE_BOOL(permissions,
5412 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5417 dnl ========================================================
5419 dnl ========================================================
5420 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5421 [ --disable-negotiateauth Disable GSS-API negotiation ],
5422 MOZ_AUTH_EXTENSION=,
5423 MOZ_AUTH_EXTENSION=1 )
5425 dnl ========================================================
5427 dnl ========================================================
5428 MOZ_ARG_DISABLE_BOOL(xtf,
5429 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5432 if test "$MOZ_XTF"; then
5436 dnl ========================================================
5438 dnl ========================================================
5439 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5440 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5441 MOZ_NO_INSPECTOR_APIS=1,
5442 MOZ_NO_INSPECTOR_APIS= )
5444 dnl ========================================================
5445 dnl Pref extensions (autoconfig and system-pref)
5446 dnl ========================================================
5447 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5448 [ --disable-pref-extensions
5449 Disable pref extensions such as autoconfig and
5451 MOZ_PREF_EXTENSIONS=,
5452 MOZ_PREF_EXTENSIONS=1 )
5454 dnl ========================================================
5455 dnl = Universalchardet
5456 dnl ========================================================
5457 MOZ_ARG_DISABLE_BOOL(universalchardet,
5458 [ --disable-universalchardet
5459 Disable universal encoding detection],
5460 MOZ_UNIVERSALCHARDET=,
5461 MOZ_UNIVERSALCHARDET=1 )
5463 dnl ========================================================
5465 dnl ========================================================
5466 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5467 [ --enable-javaxpcom
5468 Enable Java-XPCOM bridge],
5472 if test -n "${MOZ_JAVAXPCOM}"; then
5475 if test -n "$JAVA_HOME"; then
5476 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5480 if test -n "$JAVA_HOME"; then
5481 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5486 if test -n "${JAVA_INCLUDE_PATH}"; then
5487 dnl Make sure jni.h exists in the given include path.
5488 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5489 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5492 case "$target_os" in
5494 dnl Default to java system location
5495 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5499 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5502 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5503 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.])
5507 if test -n "${JAVA_BIN_PATH}"; then
5508 dnl Look for javac and jar in the specified path.
5509 JAVA_PATH="$JAVA_BIN_PATH"
5511 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5512 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5515 AC_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5516 AC_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5517 AC_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5518 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5519 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.])
5523 dnl ========================================================
5524 dnl = Breakpad crash reporting (on by default on supported platforms)
5525 dnl ========================================================
5527 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5528 || test "$OS_ARCH" = "Darwin" \
5529 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
5530 || test "$OS_ARCH" = "SunOS") \
5531 && test -z "$HAVE_64BIT_OS"; then
5535 MOZ_ARG_DISABLE_BOOL(crashreporter,
5536 [ --disable-crashreporter Disable breakpad crash reporting],
5538 MOZ_CRASHREPORTER=1)
5540 if test -n "$MOZ_CRASHREPORTER"; then
5541 AC_DEFINE(MOZ_CRASHREPORTER)
5543 if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
5544 test -z "$SKIP_LIBRARY_CHECKS"; then
5545 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5546 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5547 AC_SUBST(MOZ_GTHREAD_LIBS)
5549 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.])])
5553 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5554 [ --with-crashreporter-enable-percent=NN Enable sending crash reports by default on NN% of users. (default=100)],
5555 [ val=`echo $withval | sed 's/[^0-9]//g'`
5556 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5558 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5559 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5561 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5563 dnl ========================================================
5564 dnl = Enable compilation of specific extension modules
5565 dnl ========================================================
5567 MOZ_ARG_ENABLE_STRING(extensions,
5568 [ --enable-extensions Enable extensions],
5569 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5570 if test "$option" = "yes" || test "$option" = "all"; then
5571 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5572 elif test "$option" = "no" || test "$option" = "none"; then
5574 elif test "$option" = "default"; then
5575 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5576 elif test `echo "$option" | grep -c \^-` != 0; then
5577 option=`echo $option | sed 's/^-//'`
5578 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5580 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5583 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5585 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5586 # Suppress warning on non-X11 platforms
5587 if test -n "$MOZ_X11"; then
5588 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5590 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5593 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5594 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5595 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5598 dnl This might be temporary: build tridentprofile only on Windows
5599 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5600 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5601 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5604 dnl cookie must be built before tridentprofile. put it at list's end.
5605 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5606 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5607 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5610 dnl xforms requires xtf and schema-validation
5611 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5612 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5613 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5615 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5616 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5617 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5620 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5621 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5622 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5625 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5626 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5627 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5630 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5631 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5632 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5635 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5636 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5637 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5640 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5641 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5642 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5645 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5646 AC_MSG_WARN([spellcheck is no longer an extension.])
5647 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5650 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5651 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5652 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5656 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5658 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5659 dnl when trying to build a non-existent extension.
5660 for extension in $MOZ_EXTENSIONS; do
5661 if test ! -d "${srcdir}/extensions/${extension}"; then
5662 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5667 dnl ========================================================
5669 dnl ========================================================
5670 case "$MOZ_WIDGET_TOOLKIT" in
5671 beos|windows|os2|mac|cocoa)
5674 if test -z "$MOZ_ENABLE_GTK2" && test -z "$MOZ_ENABLE_QT"; then
5675 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5680 MOZ_ARG_ENABLE_STRING(image-decoders,
5681 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5682 Enable specific image decoders],
5683 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5684 if test "$option" = "yes" || test "$option" = "all"; then
5685 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5686 elif test "$option" = "no" || test "$option" = "none"; then
5688 elif test "$option" = "default"; then
5689 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5690 elif test `echo "$option" | grep -c \^-` != 0; then
5691 option=`echo $option | sed 's/^-//'`
5692 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5694 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5697 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5699 dnl Dupes are removed in the encoder section because it will also add decoders
5701 dnl ========================================================
5703 dnl ========================================================
5704 MOZ_ARG_ENABLE_STRING(image-encoders,
5705 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5706 Enable specific image encoders],
5707 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5708 if test "$option" = "yes" || test "$option" = "all"; then
5709 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5710 elif test "$option" = "no" || test "$option" = "none"; then
5713 elif test "$option" = "default"; then
5714 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5715 elif test `echo "$option" | grep -c \^-` != 0; then
5716 option=`echo $option | sed 's/^-//'`
5717 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5719 addencoder="$option"
5721 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5723 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5726 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5727 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5729 dnl ========================================================
5730 dnl MathML on by default
5731 dnl ========================================================
5732 MOZ_ARG_DISABLE_BOOL(mathml,
5733 [ --disable-mathml Disable MathML support],
5736 if test "$MOZ_MATHML"; then
5737 AC_DEFINE(MOZ_MATHML)
5740 dnl ========================================================
5742 dnl ========================================================
5743 MOZ_ARG_DISABLE_BOOL(canvas,
5744 [ --disable-canvas Disable html:canvas feature],
5746 MOZ_ENABLE_CANVAS=1 )
5747 if test -n "$MOZ_ENABLE_CANVAS"; then
5748 AC_DEFINE(MOZ_ENABLE_CANVAS)
5750 AC_SUBST(MOZ_ENABLE_CANVAS)
5752 dnl ========================================================
5754 dnl ========================================================
5755 MOZ_ARG_DISABLE_BOOL(svg,
5756 [ --disable-svg Disable SVG support],
5759 if test -n "$MOZ_SVG"; then
5763 dnl ========================================================
5765 dnl ========================================================
5766 MOZ_ARG_ENABLE_BOOL(smil,
5767 [ --enable-smil Enable SMIL animation support],
5770 if test -n "$MOZ_SMIL"; then
5774 dnl ========================================================
5775 dnl Build Freetype in the tree
5776 dnl ========================================================
5777 MOZ_ARG_ENABLE_BOOL(tree-freetype,
5778 [ --enable-tree-freetype Enable Tree FreeType],
5779 MOZ_TREE_FREETYPE=1,
5780 MOZ_TREE_FREETYPE= )
5781 if test -n "$MOZ_TREE_FREETYPE"; then
5782 AC_DEFINE(MOZ_TREE_FREETYPE)
5783 AC_SUBST(MOZ_TREE_FREETYPE)
5784 MOZ_ENABLE_CAIRO_FT=1
5785 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
5786 FC_FONT_FEATURE="#define CAIRO_DISABLE_FONTCONFIG 1"
5787 FT2_CFLAGS="-I${topsrcdir}/modules/freetype2/include"
5788 CAIRO_FT_CFLAGS="-I${topsrcdir}/modules/freetype2/include"
5789 FT2_LIBS="${LIBXUL_DIST}/lib/freetype2.lib"
5790 CAIRO_FT_LIBS = "${LIBXUL_DIST}/lib/freetype2.lib"
5791 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
5792 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
5793 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
5794 AC_SUBST(CAIRO_FT_CFLAGS)
5798 dnl ========================================================
5800 dnl ========================================================
5801 case "$target_os" in
5802 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5807 MOZ_ARG_DISABLE_BOOL(installer,
5808 [ --disable-installer Disable building of installer],
5811 if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
5812 # Disable installer for Windows builds that use the new toolkit if NSIS
5813 # isn't in the path.
5814 AC_PATH_PROGS(MAKENSIS, makensis)
5815 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5816 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5818 # The Windows build for NSIS requires the iconv command line utility to
5819 # convert the charset of the locale files.
5820 AC_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5821 if test -z "$HOST_ICONV"; then
5822 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5826 # Automatically disable installer if xpinstall isn't built
5827 if test -z "$MOZ_XPINSTALL"; then
5830 AC_SUBST(MOZ_INSTALLER)
5832 AC_MSG_CHECKING([for tar archiver])
5833 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
5834 if test -z "$TAR"; then
5835 AC_MSG_ERROR([no tar archiver found in \$PATH])
5837 AC_MSG_RESULT([$TAR])
5840 AC_MSG_CHECKING([for wget])
5841 AC_CHECK_PROGS(WGET, wget, "")
5842 AC_MSG_RESULT([$WGET])
5845 dnl ========================================================
5847 dnl ========================================================
5849 MOZ_ARG_DISABLE_BOOL(updater,
5850 [ --disable-updater Disable building of updater],
5853 AC_SUBST(MOZ_UPDATER)
5855 # app update channel is 'default' when not supplied.
5856 MOZ_ARG_ENABLE_STRING([update-channel],
5857 [ --enable-update-channel=CHANNEL
5858 Select application update channel (default=default)],
5859 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
5861 if test -z "$MOZ_UPDATE_CHANNEL"; then
5862 MOZ_UPDATE_CHANNEL=default
5864 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5866 # tools/update-packaging is not checked out by default.
5867 MOZ_ARG_ENABLE_BOOL(update-packaging,
5868 [ --enable-update-packaging
5869 Enable tools/update-packaging],
5870 MOZ_UPDATE_PACKAGING=1,
5871 MOZ_UPDATE_PACKAGING= )
5872 AC_SUBST(MOZ_UPDATE_PACKAGING)
5874 dnl ========================================================
5876 dnl ========================================================
5878 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
5879 [ --disable-xpconnect-idispatch
5880 Disable building of xpconnect support for IDispatch
5882 XPC_IDISPATCH_SUPPORT=,
5883 XPC_IDISPATCH_SUPPORT=1)
5884 AC_SUBST(XPC_IDISPATCH_SUPPORT)
5886 MOZ_ARG_DISABLE_BOOL(activex,
5887 [ --disable-activex Disable building of ActiveX control (win32 only)],
5888 MOZ_NO_ACTIVEX_SUPPORT=1,
5889 MOZ_NO_ACTIVEX_SUPPORT= )
5890 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
5892 MOZ_ARG_DISABLE_BOOL(activex-scripting,
5893 [ --disable-activex-scripting
5894 Disable building of ActiveX scripting support (win32)],
5895 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
5896 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
5897 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
5899 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
5901 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
5904 if test "$COMPILE_ENVIRONMENT" = "1"; then
5905 if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
5907 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5908 if test "$ac_cv_header_atlbase_h" = "no"; then
5909 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.])
5916 dnl ========================================================
5918 dnl ========================================================
5919 MOZ_ARG_ENABLE_BOOL(leaky,
5920 [ --enable-leaky Build leaky memory tool],
5925 dnl ========================================================
5927 dnl ========================================================
5928 MOZ_ARG_ENABLE_BOOL(xpctools,
5929 [ --enable-xpctools Build JS profiling tool],
5934 dnl ========================================================
5935 dnl build the tests by default
5936 dnl ========================================================
5937 MOZ_ARG_DISABLE_BOOL(tests,
5938 [ --disable-tests Do not build test libraries & programs],
5942 dnl ========================================================
5943 dnl parental controls (for Windows Vista)
5944 dnl ========================================================
5945 MOZ_ARG_DISABLE_BOOL(parental-controls,
5946 [ --disable-parental-controls
5947 Do not build parental controls],
5948 MOZ_DISABLE_PARENTAL_CONTROLS=1,
5949 MOZ_DISABLE_PARENTAL_CONTROLS=)
5950 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
5951 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
5954 dnl ========================================================
5955 dnl Vista SDK specific api
5956 dnl ========================================================
5957 MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
5958 [ --disable-vista-sdk-requirements
5959 Do not build Vista SDK specific code],
5960 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
5961 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
5962 if test -n "$COMPILE_ENVIRONMENT"; then
5963 if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
5964 AC_MSG_WARN([Resulting builds will not be compatible with Windows Vista. (bug 428970)])
5965 AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
5966 if test -z "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
5967 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
5969 MOZ_DISABLE_PARENTAL_CONTROLS=1
5972 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5973 if test "$ac_cv_header_wpcapi_h" = "no"; then
5974 AC_MSG_ERROR([System header wpcapi.h is not available. See updated http://developer.mozilla.org/en/docs/wpcapi.h for details on fixing this problem.])
5980 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
5981 AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
5983 dnl ========================================================
5985 dnl = Module specific options
5987 dnl ========================================================
5988 MOZ_ARG_HEADER(Individual module options)
5990 dnl ========================================================
5991 dnl = Enable Lea malloc in xpcom. OFF by default.
5992 dnl ========================================================
5993 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
5994 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
5997 if test -n "$XPCOM_USE_LEA"; then
5998 AC_DEFINE(XPCOM_USE_LEA)
6001 dnl ========================================================
6002 dnl = Enable places (new history/bookmarks)
6003 dnl ========================================================
6004 MOZ_ARG_ENABLE_BOOL(places,
6005 [ --enable-places Enable 'places' bookmark/history implementation],
6008 if test -n "$MOZ_PLACES"; then
6009 AC_DEFINE(MOZ_PLACES)
6010 if test -z "$MOZ_MAIL_NEWS"; then
6015 if test "$MOZ_BUILD_APP" = "browser"; then
6016 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
6020 dnl ========================================================
6021 dnl = Disable feed handling components
6022 dnl ========================================================
6023 MOZ_ARG_DISABLE_BOOL(feeds,
6024 [ --disable-feeds Disable feed handling and processing components],
6027 if test -n "$MOZ_FEEDS"; then
6028 AC_DEFINE(MOZ_FEEDS)
6030 if test "$MOZ_BUILD_APP" = "browser"; then
6031 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6035 dnl ========================================================
6036 dnl = Enable mozStorage
6037 dnl ========================================================
6038 dnl Implicitly enabled by default if building calendar or places
6039 MOZ_ARG_ENABLE_BOOL(storage,
6040 [ --enable-storage Enable mozStorage module and related components],
6043 if test -n "$MOZ_STORAGE"; then
6044 AC_DEFINE(MOZ_STORAGE)
6047 dnl ========================================================
6048 dnl Check for sqlite
6049 dnl ========================================================
6052 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6053 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6054 MOZ_NATIVE_SQLITE=1,
6055 MOZ_NATIVE_SQLITE= )
6057 if test -z "$MOZ_NATIVE_SQLITE"
6060 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
6062 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6065 AC_SUBST(MOZ_NATIVE_SQLITE)
6067 dnl ========================================================
6068 dnl = Enable help viewer (off by default)
6069 dnl ========================================================
6070 MOZ_ARG_ENABLE_BOOL(help-viewer,
6071 [ --enable-help-viewer Enable help viewer],
6074 if test -n "$MOZ_HELP_VIEWER"; then
6075 AC_DEFINE(MOZ_HELP_VIEWER)
6077 AC_SUBST(MOZ_HELP_VIEWER)
6078 if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
6079 AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
6082 dnl ========================================================
6083 dnl = Enable safe browsing (anti-phishing)
6084 dnl ========================================================
6085 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6086 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6087 MOZ_SAFE_BROWSING=1,
6088 MOZ_SAFE_BROWSING= )
6089 if test -n "$MOZ_SAFE_BROWSING"; then
6090 AC_DEFINE(MOZ_SAFE_BROWSING)
6092 AC_SUBST(MOZ_SAFE_BROWSING)
6094 dnl ========================================================
6095 dnl = Enable url-classifier
6096 dnl ========================================================
6097 dnl Implicitly enabled by default if building with safe-browsing
6098 if test -n "$MOZ_SAFE_BROWSING"; then
6099 MOZ_URL_CLASSIFIER=1
6101 MOZ_ARG_ENABLE_BOOL(url-classifier,
6102 [ --enable-url-classifier Enable url classifier module],
6103 MOZ_URL_CLASSIFIER=1,
6104 MOZ_URL_CLASSIFIER= )
6105 if test -n "$MOZ_URL_CLASSIFIER"; then
6106 AC_DEFINE(MOZ_URL_CLASSIFIER)
6108 AC_SUBST(MOZ_URL_CLASSIFIER)
6110 dnl ========================================================
6111 dnl = Disable zipwriter
6112 dnl ========================================================
6113 MOZ_ARG_DISABLE_BOOL(zipwriter,
6114 [ --disable-zipwriter Disable zipwriter component],
6117 AC_SUBST(MOZ_ZIPWRITER)
6119 dnl ========================================================
6120 dnl = Enable Ultrasparc specific optimizations for JS
6121 dnl ========================================================
6122 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
6123 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
6124 JS_ULTRASPARC_OPTS=1,
6125 JS_ULTRASPARC_OPTS= )
6127 dnl only enable option for ultrasparcs
6128 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
6129 "$OS_TEST" != "sun4u"; then
6132 AC_SUBST(JS_ULTRASPARC_OPTS)
6134 dnl ========================================================
6135 dnl = Hildon and OSSO checks
6136 dnl ========================================================
6137 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime,
6138 MOZ_PLATFORM_HILDON=1,
6139 MOZ_PLATFORM_HILDON=)
6140 if test $MOZ_PLATFORM_HILDON; then
6141 AC_DEFINE(MOZ_PLATFORM_HILDON)
6143 AC_SUBST(LIBHILDONMIME_CFLAGS)
6144 AC_SUBST(LIBHILDONMIME_LIBS)
6146 PKG_CHECK_MODULES(LIBOSSO,libosso,
6150 if test $NS_OSSO; then
6151 if test -z "$MOZ_ENABLE_DBUS"; then
6152 AC_MSG_ERROR([DBus is required when building for OSSO])
6155 dnl XXX this should go somewhere else; it's not just for OSSO
6156 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6158 AC_SUBST(LIBOSSO_CFLAGS)
6159 AC_SUBST(LIBOSSO_LIBS)
6161 PKG_CHECK_MODULES(MOZ_LOCATION, [liblocation gpsbt],
6162 NS_MAEMO_LOCATION=1,
6165 if test $NS_MAEMO_LOCATION; then
6166 AC_DEFINE(NS_MAEMO_LOCATION)
6169 AC_SUBST(MOZ_LOCATION_CFLAGS)
6170 AC_SUBST(MOZ_LOCATION_LIBS)
6172 dnl ========================================================
6174 dnl = Feature options that require extra sources to be pulled
6176 dnl ========================================================
6177 dnl MOZ_ARG_HEADER(Features that require extra sources)
6179 dnl ========================================================
6181 dnl = Debugging Options
6183 dnl ========================================================
6184 MOZ_ARG_HEADER(Debugging and Optimizations)
6186 dnl ========================================================
6187 dnl = Disable building with debug info.
6188 dnl = Debugging is OFF by default
6189 dnl ========================================================
6190 if test -z "$MOZ_DEBUG_FLAGS"
6194 if test "$GNU_CC"; then
6195 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
6196 case "$GCC_VERSION" in
6201 MOZ_DEBUG_FLAGS="-g"
6205 MOZ_DEBUG_FLAGS="-g"
6209 MOZ_DEBUG_FLAGS="-g"
6214 MOZ_ARG_ENABLE_STRING(debug,
6215 [ --enable-debug[=DBG] Enable building with developer debug info
6216 (Using compiler flags DBG)],
6217 [ if test "$enableval" != "no"; then
6219 if test -n "$enableval" && test "$enableval" != "yes"; then
6220 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6227 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
6228 case "${target_os}" in
6230 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
6232 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6233 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
6236 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
6239 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
6241 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6243 if test -n "$MOZ_DEBUG"; then
6244 AC_MSG_CHECKING([for valid debug flags])
6245 _SAVE_CFLAGS=$CFLAGS
6246 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6247 AC_TRY_COMPILE([#include <stdio.h>],
6248 [printf("Hello World\n");],
6251 AC_MSG_RESULT([$_results])
6252 if test "$_results" = "no"; then
6253 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6255 CFLAGS=$_SAVE_CFLAGS
6258 dnl ========================================================
6259 dnl = Enable code optimization. ON by default.
6260 dnl ========================================================
6261 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6262 MOZ_OPTIMIZE_FLAGS="-O"
6265 MOZ_ARG_ENABLE_STRING(optimize,
6266 [ --disable-optimize Disable compiler optimization
6267 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6268 [ if test "$enableval" != "no"; then
6270 if test -n "$enableval" && test "$enableval" != "yes"; then
6271 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6276 fi ], MOZ_OPTIMIZE=1)
6278 if test "$COMPILE_ENVIRONMENT"; then
6279 if test -n "$MOZ_OPTIMIZE"; then
6280 AC_MSG_CHECKING([for valid optimization flags])
6281 _SAVE_CFLAGS=$CFLAGS
6282 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6283 AC_TRY_COMPILE([#include <stdio.h>],
6284 [printf("Hello World\n");],
6287 AC_MSG_RESULT([$_results])
6288 if test "$_results" = "no"; then
6289 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6291 CFLAGS=$_SAVE_CFLAGS
6293 fi # COMPILE_ENVIRONMENT
6295 AC_SUBST(MOZ_OPTIMIZE)
6296 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6297 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6298 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6300 dnl ========================================================
6301 dnl = Enable/disable debug for specific modules only
6302 dnl = module names beginning with ^ will be disabled
6303 dnl ========================================================
6304 MOZ_ARG_ENABLE_STRING(debug-modules,
6305 [ --enable-debug-modules Enable/disable debug info for specific modules],
6306 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6308 dnl ========================================================
6309 dnl = Enable/disable generation of debugger info for specific modules only
6310 dnl = the special module name ALL_MODULES can be used to denote all modules
6311 dnl = module names beginning with ^ will be disabled
6312 dnl ========================================================
6313 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6314 [ --enable-debugger-info-modules
6315 Enable/disable debugger info for specific modules],
6316 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6317 dnl note that the list of module names is reversed as it is copied
6318 dnl this is important, as it will allow config.mk to interpret stuff like
6319 dnl "^ALL_MODULES xpcom" properly
6320 if test "$i" = "no"; then
6323 if test "$i" = "yes"; then
6326 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6329 dnl ========================================================
6330 dnl Enable garbage collector
6331 dnl ========================================================
6332 MOZ_ARG_ENABLE_BOOL(boehm,
6333 [ --enable-boehm Enable the Boehm Garbage Collector],
6336 if test -n "$GC_LEAK_DETECTOR"; then
6337 AC_DEFINE(GC_LEAK_DETECTOR)
6340 dnl ========================================================
6341 dnl Disable runtime logging checks
6342 dnl ========================================================
6343 MOZ_ARG_DISABLE_BOOL(logging,
6344 [ --disable-logging Disable logging facilities],
6345 NS_DISABLE_LOGGING=1,
6346 NS_DISABLE_LOGGING= )
6347 if test "$NS_DISABLE_LOGGING"; then
6348 AC_DEFINE(NS_DISABLE_LOGGING)
6350 AC_DEFINE(MOZ_LOGGING)
6353 dnl ========================================================
6354 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6355 dnl ========================================================
6356 _ENABLE_LOGREFCNT=42
6357 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6358 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6359 _ENABLE_LOGREFCNT=1,
6360 _ENABLE_LOGREFCNT= )
6361 if test "$_ENABLE_LOGREFCNT" = "1"; then
6362 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6363 elif test -z "$_ENABLE_LOGREFCNT"; then
6364 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6367 dnl ========================================================
6368 dnl = Enable trace malloc
6369 dnl ========================================================
6370 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6371 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6372 [ --enable-trace-malloc Enable malloc tracing],
6375 if test "$NS_TRACE_MALLOC"; then
6376 # Please, Mr. Linker Man, don't take away our symbol names
6377 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6379 AC_DEFINE(NS_TRACE_MALLOC)
6381 AC_SUBST(NS_TRACE_MALLOC)
6383 dnl ========================================================
6384 dnl = Enable jemalloc
6385 dnl ========================================================
6386 MOZ_ARG_ENABLE_BOOL(jemalloc,
6387 [ --enable-jemalloc Replace memory allocator with jemalloc],
6391 if test "$NS_TRACE_MALLOC"; then
6395 if test "$MOZ_MEMORY"; then
6397 dnl Don't try to run compiler tests on Windows
6398 if test "$OS_ARCH" = "WINNT"; then
6399 if test -z "$HAVE_64BIT_OS"; then
6400 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6402 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6405 AC_CHECK_SIZEOF([int *], [4])
6406 case "${ac_cv_sizeof_int_p}" in
6408 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6411 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6414 AC_MSG_ERROR([Unexpected pointer size])
6419 AC_DEFINE(MOZ_MEMORY)
6420 if test "x$MOZ_DEBUG" = "x1"; then
6421 AC_DEFINE(MOZ_MEMORY_DEBUG)
6423 dnl The generic feature tests that determine how to compute ncpus are long and
6424 dnl complicated. Therefore, simply define special cpp variables for the
6425 dnl platforms we have special knowledge of.
6426 case "${target_os}" in
6428 AC_DEFINE(MOZ_MEMORY_DARWIN)
6431 AC_DEFINE(MOZ_MEMORY_BSD)
6434 AC_DEFINE(MOZ_MEMORY_LINUX)
6437 AC_DEFINE(MOZ_MEMORY_BSD)
6440 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6442 msvc*|mks*|cygwin*|mingw*)
6443 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6444 dnl XXX: should test for vc8sp1 here, otherwise patching the crt src
6445 dnl will fail miserably
6446 if test "$_CC_SUITE" -lt "8"; then
6447 AC_MSG_ERROR([Building jemalloc requires Visual C++ 2005 or better])
6449 if test -z "$WIN32_CRT_SRC_DIR" -a -z "$WIN32_CUSTOM_CRT_DIR"; then
6450 if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6451 AC_MSG_ERROR([When building jemalloc, either set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src), or set WIN32_CUSTOM_CRT_DIR to the path to a folder containing a pre-built CRT DLL.])
6453 WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6456 if test -z "$WIN32_CRT_SRC_DIR"; then
6458 WIN32_CUSTOM_CRT_DIR=`cd "$WIN32_CUSTOM_CRT_DIR" && pwd`
6459 _WIN_UNIX_CRT_PATH="$WIN32_CUSTOM_CRT_DIR"
6461 # CRT source directory
6462 WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd`
6463 _CRT_BASE_DIR=`basename "$WIN32_CRT_SRC_DIR"`
6464 _WIN_UNIX_CRT_PATH="$_objdir/memory/jemalloc/$_CRT_BASE_DIR/build/intel"
6466 dnl need win32 paths in LIB, hence this python abuse. extra brackets
6468 _WIN_CRT_PATH=[`$PYTHON -c 'import sys, os.path; print os.path.normpath(sys.argv[1])' "$_WIN_UNIX_CRT_PATH"`]
6469 MOZ_LIB="$_WIN_CRT_PATH;$LIB"
6470 dnl Needs to be in PATH too, since our tools will wind up linked against it.
6471 dnl This needs to be unix style.
6472 MOZ_PATH="$PATH:$_WIN_UNIX_CRT_PATH"
6473 dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6474 AC_DEFINE(_STATIC_CPPLIB)
6475 dnl Don't generate a manifest, since we're linking to a custom CRT.
6476 LDFLAGS="$LDFLAGS -MANIFEST:NO"
6477 dnl Also pass this to NSPR/NSS
6478 DLLFLAGS="$DLLFLAGS -MANIFEST:NO"
6482 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6486 AC_ARG_WITH([valgrind],
6487 [ --with-valgrind Enable valgrind integration hooks],
6488 [enable_valgrind="yes"], [enable_valgrind="no"])
6489 AC_CHECK_HEADER([valgrind/valgrind.h], [], [enable_valgrind="no"])
6490 if test "x$enable_valgrind" = "xyes" ; then
6491 AC_DEFINE(MOZ_VALGRIND)
6494 AC_SUBST(MOZ_MEMORY)
6495 AC_SUBST(WIN32_CRT_SRC_DIR)
6496 AC_SUBST(WIN32_CUSTOM_CRT_DIR)
6499 dnl Need to set this for make because NSS doesn't have configure
6502 dnl ========================================================
6503 dnl = Use malloc wrapper lib
6504 dnl ========================================================
6505 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6506 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6510 if test -n "$_WRAP_MALLOC"; then
6511 if test "$GNU_CC"; then
6512 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"
6513 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6517 dnl ========================================================
6518 dnl = Location of malloc wrapper lib
6519 dnl ========================================================
6520 MOZ_ARG_WITH_STRING(wrap-malloc,
6521 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6522 WRAP_MALLOC_LIB=$withval)
6524 dnl ========================================================
6525 dnl = Use Electric Fence
6526 dnl ========================================================
6527 MOZ_ARG_ENABLE_BOOL(efence,
6528 [ --enable-efence Link with Electric Fence],
6531 if test -n "$_ENABLE_EFENCE"; then
6532 AC_CHECK_LIB(efence,malloc)
6535 dnl ========================================================
6537 dnl ========================================================
6538 MOZ_ARG_ENABLE_BOOL(jprof,
6539 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6542 if test -n "$MOZ_JPROF"; then
6543 AC_DEFINE(MOZ_JPROF)
6546 dnl ========================================================
6548 dnl ========================================================
6549 MOZ_ARG_ENABLE_BOOL(shark,
6550 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6553 if test -n "$MOZ_SHARK"; then
6554 AC_DEFINE(MOZ_SHARK)
6557 dnl ========================================================
6559 dnl ========================================================
6560 MOZ_ARG_ENABLE_BOOL(callgrind,
6561 [ --enable-callgrind Enable callgrind profiling],
6564 if test -n "$MOZ_CALLGRIND"; then
6565 AC_DEFINE(MOZ_CALLGRIND)
6568 dnl ========================================================
6570 dnl ========================================================
6571 MOZ_ARG_ENABLE_BOOL(vtune,
6572 [ --enable-vtune Enable vtune profiling],
6575 if test -n "$MOZ_VTUNE"; then
6576 AC_DEFINE(MOZ_VTUNE)
6579 dnl ========================================================
6580 dnl Zealous JavaScript GC
6581 dnl ========================================================
6582 MOZ_ARG_ENABLE_BOOL(gczeal,
6583 [ --enable-gczeal Enable zealous JavaScript GCing],
6586 if test -n "$JS_GC_ZEAL"; then
6587 AC_DEFINE(JS_GC_ZEAL)
6590 dnl ========================================================
6591 dnl = Enable static checking using gcc-dehydra
6592 dnl ========================================================
6594 MOZ_ARG_WITH_STRING(static-checking,
6595 [ --with-static-checking=path/to/gcc_dehydra.so
6596 Enable static checking of code using GCC-dehydra],
6597 DEHYDRA_PATH=$withval,
6600 if test -n "$DEHYDRA_PATH"; then
6601 if ! test -f "$DEHYDRA_PATH"; then
6602 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
6604 AC_DEFINE(NS_STATIC_CHECKING)
6606 AC_SUBST(DEHYDRA_PATH)
6608 dnl ========================================================
6609 dnl = Enable stripping of libs & executables
6610 dnl ========================================================
6611 MOZ_ARG_ENABLE_BOOL(strip,
6612 [ --enable-strip Enable stripping of libs & executables ],
6616 dnl ========================================================
6617 dnl = Enable stripping of libs & executables when packaging
6618 dnl ========================================================
6619 MOZ_ARG_ENABLE_BOOL(install-strip,
6620 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6624 dnl ========================================================
6625 dnl = --enable-elf-dynstr-gc
6626 dnl ========================================================
6627 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6628 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6629 USE_ELF_DYNSTR_GC=1,
6630 USE_ELF_DYNSTR_GC= )
6632 dnl ========================================================
6633 dnl = --enable-old-abi-compat-wrappers
6634 dnl ========================================================
6635 dnl on x86 linux, the current builds of some popular plugins (notably
6636 dnl flashplayer and real) expect a few builtin symbols from libgcc
6637 dnl which were available in some older versions of gcc. However,
6638 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6639 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6640 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6641 dnl to true on x86 linux, and false everywhere else.
6644 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6645 [ --enable-old-abi-compat-wrappers
6646 Support old GCC ABI symbols to ease the pain
6647 of the linux compiler change],
6648 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6649 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6650 if test "$COMPILE_ENVIRONMENT"; then
6651 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6654 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6656 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6658 fi # COMPILE_ENVIRONMENT
6660 dnl ========================================================
6662 dnl = Profiling and Instrumenting
6664 dnl ========================================================
6665 MOZ_ARG_HEADER(Profiling and Instrumenting)
6667 dnl ========================================================
6668 dnl = Enable timeline service, which provides lightweight
6669 dnl = instrumentation of mozilla for performance measurement.
6670 dnl = Timeline is off by default.
6671 dnl ========================================================
6672 MOZ_ARG_ENABLE_BOOL(timeline,
6673 [ --enable-timeline Enable timeline services ],
6676 if test -n "$MOZ_TIMELINE"; then
6677 AC_DEFINE(MOZ_TIMELINE)
6680 dnl ========================================================
6681 dnl Turn on reflow counting
6682 dnl ========================================================
6683 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6684 [ --enable-reflow-perf Enable reflow performance tracing],
6687 if test -n "$MOZ_REFLOW_PREF"; then
6688 AC_DEFINE(MOZ_REFLOW_PREF)
6690 AC_SUBST(MOZ_REFLOW_PERF)
6692 dnl ========================================================
6693 dnl Enable performance metrics.
6694 dnl ========================================================
6695 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6696 [ --enable-perf-metrics Enable performance metrics],
6699 if test -n "$MOZ_PERF_METRICS"; then
6700 AC_DEFINE(MOZ_PERF_METRICS)
6703 dnl ========================================================
6704 dnl Enable code size metrics.
6705 dnl ========================================================
6706 MOZ_ARG_ENABLE_BOOL(codesighs,
6707 [ --enable-codesighs Enable code size analysis tools],
6708 _ENABLE_CODESIGHS=1,
6709 _ENABLE_CODESIGHS= )
6710 if test -n "$_ENABLE_CODESIGHS"; then
6711 if test -d $srcdir/tools/codesighs; then
6714 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6718 dnl ========================================================
6719 dnl = Add support for Eazel profiler
6720 dnl ========================================================
6721 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6722 [ --enable-eazel-profiler-support
6723 Enable Corel/Eazel profiler support],
6724 ENABLE_EAZEL_PROFILER=1,
6725 ENABLE_EAZEL_PROFILER= )
6726 if test -n "$ENABLE_EAZEL_PROFILER"; then
6727 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6729 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6730 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6731 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6734 MOZ_ARG_ENABLE_STRING(profile-modules,
6735 [ --enable-profile-modules
6736 Enable/disable profiling for specific modules],
6737 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6739 MOZ_ARG_ENABLE_BOOL(insure,
6740 [ --enable-insure Enable insure++ instrumentation (linux only)],
6743 if test -n "$_ENABLE_INSURE"; then
6747 MOZ_INSURE_EXCLUDE_DIRS="config"
6750 MOZ_ARG_WITH_STRING(insure-dirs,
6751 [ --with-insure-dirs=DIRS
6752 Dirs to instrument with insure ],
6753 MOZ_INSURE_DIRS=$withval )
6755 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6756 [ --with-insure-exclude-dirs=DIRS
6757 Dirs to not instrument with insure ],
6758 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6760 dnl ========================================================
6761 dnl = Support for Quantify (Windows)
6762 dnl ========================================================
6763 MOZ_ARG_ENABLE_BOOL(quantify,
6764 [ --enable-quantify Enable Quantify support (Windows only) ],
6768 dnl ========================================================
6769 dnl = Support for demangling undefined symbols
6770 dnl ========================================================
6771 if test -z "$SKIP_LIBRARY_CHECKS"; then
6774 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6778 # Demangle only for debug or trace-malloc builds
6779 MOZ_DEMANGLE_SYMBOLS=
6780 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6781 MOZ_DEMANGLE_SYMBOLS=1
6782 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6784 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6786 dnl ========================================================
6787 dnl = Support for gcc stack unwinding (from gcc 3.3)
6788 dnl ========================================================
6789 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6790 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6793 dnl ========================================================
6797 dnl ========================================================
6798 MOZ_ARG_HEADER(Misc. Options)
6800 dnl ========================================================
6801 dnl update xterm title
6802 dnl ========================================================
6803 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6804 [ --enable-xterm-updates Update XTERM titles with current command.],
6808 dnl =========================================================
6810 dnl =========================================================
6811 MOZ_ARG_ENABLE_STRING([chrome-format],
6812 [ --enable-chrome-format=jar|flat|both|symlink
6813 Select FORMAT of chrome files (default=jar)],
6814 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6816 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6817 MOZ_CHROME_FILE_FORMAT=jar
6820 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6821 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6822 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6823 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6824 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6827 dnl ========================================================
6828 dnl = Define default location for MOZILLA_FIVE_HOME
6829 dnl ========================================================
6830 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6831 [ --with-default-mozilla-five-home
6832 Set the default value for MOZILLA_FIVE_HOME],
6833 [ val=`echo $withval`
6834 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
6836 dnl ========================================================
6837 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
6838 dnl ========================================================
6839 MOZ_ARG_WITH_STRING(user-appdir,
6840 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
6841 [ val=`echo $withval`
6842 if echo "$val" | grep "\/" >/dev/null; then
6843 AC_MSG_ERROR("Homedir must be single relative path.")
6848 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
6850 dnl ========================================================
6851 dnl = Doxygen configuration
6852 dnl ========================================================
6853 dnl Use commas to specify multiple dirs to this arg
6854 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
6855 MOZ_ARG_WITH_STRING(doc-input-dirs,
6856 [ --with-doc-input-dirs=DIRS
6857 Header/idl dirs to create docs from],
6858 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6859 AC_SUBST(MOZ_DOC_INPUT_DIRS)
6861 dnl Use commas to specify multiple dirs to this arg
6862 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
6863 MOZ_ARG_WITH_STRING(doc-include-dirs,
6864 [ --with-doc-include-dirs=DIRS
6865 Include dirs to preprocess doc headers],
6866 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6867 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
6869 MOZ_DOC_OUTPUT_DIR='./dist/docs'
6870 MOZ_ARG_WITH_STRING(doc-output-dir,
6871 [ --with-doc-output-dir=DIR
6872 Dir to generate docs into],
6873 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
6874 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
6876 if test -z "$SKIP_COMPILER_CHECKS"; then
6877 dnl ========================================================
6879 dnl = Compiler Options
6881 dnl ========================================================
6882 MOZ_ARG_HEADER(Compiler Options)
6884 dnl ========================================================
6885 dnl Check for gcc -pipe support
6886 dnl ========================================================
6887 AC_MSG_CHECKING([for gcc -pipe support])
6888 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
6889 echo '#include <stdio.h>' > dummy-hello.c
6890 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
6891 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
6892 cat dummy-hello.s | ${AS_BIN} -o dummy-hello.S - 2>&5
6893 if test $? = 0; then
6898 if test "$_res_as_stdin" = "yes"; then
6899 _SAVE_CFLAGS=$CFLAGS
6900 CFLAGS="$CFLAGS -pipe"
6901 AC_TRY_COMPILE( [ #include <stdio.h> ],
6902 [printf("Hello World\n");],
6903 [_res_gcc_pipe="yes"],
6904 [_res_gcc_pipe="no"] )
6905 CFLAGS=$_SAVE_CFLAGS
6907 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
6909 CFLAGS="$CFLAGS -pipe"
6910 CXXFLAGS="$CXXFLAGS -pipe"
6914 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
6915 AC_MSG_RESULT([$_res])
6920 dnl pass -Wno-long-long to the compiler
6921 MOZ_ARG_ENABLE_BOOL(long-long-warning,
6922 [ --enable-long-long-warning
6923 Warn about use of non-ANSI long long type],
6924 _IGNORE_LONG_LONG_WARNINGS=,
6925 _IGNORE_LONG_LONG_WARNINGS=1)
6927 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
6928 _SAVE_CFLAGS="$CFLAGS"
6929 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
6930 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
6931 AC_TRY_COMPILE([], [return(0);],
6932 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6933 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6934 result="yes" ], result="no")
6935 AC_MSG_RESULT([$result])
6936 CFLAGS="$_SAVE_CFLAGS"
6939 dnl ========================================================
6940 dnl Profile guided optimization
6941 dnl ========================================================
6942 dnl Test for profiling options
6943 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
6944 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
6946 dnl Provide a switch to disable PGO even when called via profiledbuild.
6947 MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
6948 [ --disable-profile-guided-optimization
6949 Don't build with PGO even if called via make profiledbuild],
6950 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
6951 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
6953 AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
6955 _SAVE_CFLAGS="$CFLAGS"
6956 CFLAGS="$CFLAGS -fprofile-generate"
6958 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
6959 AC_TRY_COMPILE([], [return 0;],
6960 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
6961 result="yes" ], result="no")
6962 AC_MSG_RESULT([$result])
6964 if test $result = "yes"; then
6965 PROFILE_GEN_LDFLAGS="-fprofile-generate"
6966 PROFILE_USE_CFLAGS="-fprofile-use"
6967 PROFILE_USE_LDFLAGS="-fprofile-use"
6969 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
6970 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
6971 AC_TRY_COMPILE([], [return 0;],
6972 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
6973 result="yes" ], result="no")
6974 AC_MSG_RESULT([$result])
6975 if test $result = "yes"; then
6976 PROFILE_USE_CFLAGS="-fbranch-probabilities"
6978 # don't really care, this is an old GCC
6979 PROFILE_GEN_LDFLAGS=
6980 PROFILE_USE_LDFLAGS=
6983 CFLAGS="$_SAVE_CFLAGS"
6985 if test -n "$INTEL_CC"; then
6986 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
6987 PROFILE_GEN_LDFLAGS=
6988 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
6989 PROFILE_USE_LDFLAGS=
6992 dnl Sun Studio on Solaris
6993 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6994 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
6995 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
6996 if test "$CPU_ARCH" != "sparc"; then
6997 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
6998 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7000 PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7001 PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7005 AC_SUBST(PROFILE_GEN_CFLAGS)
7006 AC_SUBST(PROFILE_GEN_LDFLAGS)
7007 AC_SUBST(PROFILE_USE_CFLAGS)
7008 AC_SUBST(PROFILE_USE_LDFLAGS)
7012 dnl ========================================================
7013 dnl Test for -pedantic bustage
7014 dnl ========================================================
7015 MOZ_ARG_DISABLE_BOOL(pedantic,
7016 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7018 if test "$_PEDANTIC"; then
7019 _SAVE_CXXFLAGS=$CXXFLAGS
7020 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7021 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7022 AC_TRY_COMPILE([$configure_static_assert_macros],
7023 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7024 result="no", result="yes" )
7025 AC_MSG_RESULT([$result])
7026 CXXFLAGS="$_SAVE_CXXFLAGS"
7030 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
7031 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7034 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7039 dnl ========================================================
7040 dnl Test for correct temporary object destruction order
7041 dnl ========================================================
7042 dnl We want to make sure the compiler follows the C++ spec here as
7043 dnl xpcom and the string classes depend on it (bug 235381).
7044 AC_MSG_CHECKING([for correct temporary object destruction order])
7045 AC_TRY_RUN([ class A {
7046 public: A(int& x) : mValue(x) {}
7048 operator char**() { return 0; }
7049 private: int& mValue;
7051 void func(char **arg) {}
7062 result="yes", result="no", result="maybe")
7063 AC_MSG_RESULT([$result])
7065 if test "$result" = "no"; then
7066 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
7069 dnl ========================================================
7070 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7071 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7072 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7073 dnl ========================================================
7074 _SAVE_CXXFLAGS=$CXXFLAGS
7075 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7076 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7077 ac_nscap_nonconst_opeq_bug,
7086 template <class T, class U>
7087 int operator==(const Pointer<T>& rhs, U* lhs)
7089 return rhs.myPtr == lhs;
7092 template <class T, class U>
7093 int operator==(const Pointer<T>& rhs, const U* lhs)
7095 return rhs.myPtr == lhs;
7103 ac_nscap_nonconst_opeq_bug="no",
7104 ac_nscap_nonconst_opeq_bug="yes")])
7105 CXXFLAGS="$_SAVE_CXXFLAGS"
7107 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7108 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7110 fi # SKIP_COMPILER_CHECKS
7112 dnl ========================================================
7114 dnl Should be smarter and check that the compiler does indeed have rtti
7115 dnl ========================================================
7116 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
7117 [ --enable-cpp-rtti Enable C++ RTTI ],
7118 [ _MOZ_USE_RTTI=1 ],
7121 if test "$_MOZ_USE_RTTI"; then
7122 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
7124 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
7127 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
7129 dnl ========================================================
7130 dnl C++ exceptions (g++/egcs only - for now)
7131 dnl Should be smarter and check that the compiler does indeed have exceptions
7132 dnl ========================================================
7133 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
7134 [ --enable-cpp-exceptions Enable C++ exceptions ],
7135 [ _MOZ_CPP_EXCEPTIONS=1 ],
7136 [ _MOZ_CPP_EXCEPTIONS= ])
7138 if test "$_MOZ_CPP_EXCEPTIONS"; then
7139 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
7141 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
7144 # Irix & OSF native compilers do not like exception declarations
7145 # when exceptions are disabled
7146 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
7147 AC_DEFINE(CPP_THROW_NEW, [])
7149 AC_DEFINE(CPP_THROW_NEW, [throw()])
7153 dnl ========================================================
7155 dnl = Build depencency options
7157 dnl ========================================================
7158 MOZ_ARG_HEADER(Build dependencies)
7160 dnl ========================================================
7161 dnl = Do not auto generate dependency info
7162 dnl ========================================================
7164 MOZ_ARG_DISABLE_BOOL(auto-deps,
7165 [ --disable-auto-deps Do not automatically generate dependency info],
7169 if test -n "$MOZ_AUTO_DEPS"; then
7170 dnl ========================================================
7171 dnl = Use mkdepend instead of $CC -MD for dependency generation
7172 dnl ========================================================
7174 MOZ_ARG_DISABLE_BOOL(md,
7175 [ --disable-md Do not use compiler-based dependencies ],
7178 [dnl Default is to turn on -MD if using GNU-compatible compilers
7179 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
7182 dnl Default is to use -xM if using Sun Studio on Solaris
7183 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
7186 if test "$_cpp_md_flag"; then
7188 if test "$OS_ARCH" = "OpenVMS"; then
7189 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
7191 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
7193 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7194 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
7199 _USE_CPP_INCLUDE_FLAG=
7200 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7201 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7205 AC_SUBST(MOZ_AUTO_DEPS)
7206 AC_SUBST(COMPILER_DEPEND)
7210 dnl ========================================================
7212 dnl = Static Build Options
7214 dnl ========================================================
7215 MOZ_ARG_HEADER(Static build options)
7217 MOZ_ARG_ENABLE_BOOL(static,
7218 [ --enable-static Enable building of internal static libs],
7219 BUILD_STATIC_LIBS=1,
7222 dnl Disable libxul in debug builds, but not for xulrunner.
7223 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
7227 MOZ_ARG_ENABLE_BOOL(libxul,
7228 [ --enable-libxul Enable building of libxul],
7229 MOZ_ENABLE_LIBXUL=1,
7232 if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
7233 AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME. You probably want --enable-libxul.])
7236 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
7237 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
7240 if test -n "$MOZ_ENABLE_LIBXUL"; then
7241 XPCOM_LIBS="$LIBXUL_LIBS"
7242 AC_DEFINE(MOZ_ENABLE_LIBXUL)
7244 if test -n "$BUILD_STATIC_LIBS"; then
7245 AC_DEFINE(MOZ_STATIC_BUILD)
7247 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
7250 dnl ========================================================
7252 dnl = Standalone module options
7254 dnl ========================================================
7255 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7257 dnl Check for GLib and libIDL.
7258 dnl ========================================================
7259 case "$target_os" in
7260 msvc*|mks*|cygwin*|mingw*|wince*)
7261 SKIP_IDL_CHECK="yes"
7268 if test -z "$COMPILE_ENVIRONMENT"; then
7269 SKIP_IDL_CHECK="yes"
7272 dnl = Allow users to disable libIDL checking for standalone modules
7273 MOZ_ARG_WITHOUT_BOOL(libIDL,
7274 [ --without-libIDL Skip check for libIDL (standalone modules only)],
7275 SKIP_IDL_CHECK="yes")
7277 if test "$SKIP_IDL_CHECK" = "no"
7280 if test "$MACOS_SDK_DIR"; then
7281 dnl xpidl, and therefore libIDL, is only needed on the build host.
7282 dnl Don't build it against the SDK, as that causes problems.
7283 _MACSAVE_CFLAGS="$CFLAGS"
7284 _MACSAVE_LIBS="$LIBS"
7285 _MACSAVE_LDFLAGS="$LDFLAGS"
7286 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
7288 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"`
7289 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
7290 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
7295 if test "$MOZ_ENABLE_GTK2"; then
7296 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
7298 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
7299 dnl to either libIDL1 or libIDL2.
7300 if test -z "$_LIBIDL_FOUND"; then
7301 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
7302 if test -z "$_LIBIDL_FOUND"; then
7303 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
7307 dnl If we don't have a libIDL config program & not cross-compiling,
7308 dnl look for orbit-config instead.
7310 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
7311 AC_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
7312 if test -n "$ORBIT_CONFIG"; then
7313 AC_MSG_CHECKING([for ORBit libIDL usability])
7314 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
7315 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
7316 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
7317 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
7318 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
7319 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
7321 _SAVE_CFLAGS="$CFLAGS"
7323 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
7324 LIBS="$LIBIDL_LIBS $LIBS"
7327 #include <libIDL/IDL.h>
7330 s=strdup(IDL_get_libver_string());
7343 AC_MSG_RESULT($result)
7344 CFLAGS="$_SAVE_CFLAGS"
7348 if test -z "$_LIBIDL_FOUND"; then
7349 AC_MSG_ERROR([libIDL not found.
7350 libIDL $LIBIDL_VERSION or higher is required.])
7352 if test "$MACOS_SDK_DIR"; then
7353 CFLAGS="$_MACSAVE_CFLAGS"
7354 LIBS="$_MACSAVE_LIBS"
7355 LDFLAGS="$_MACSAVE_LDFLAGS"
7356 if test -n "$_MACSAVE_NEXT_ROOT" ; then
7357 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
7362 if test -n "$CROSS_COMPILE"; then
7363 if test -z "$HOST_LIBIDL_CONFIG"; then
7364 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
7366 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
7367 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
7368 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
7370 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
7371 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
7375 if test -z "$SKIP_PATH_CHECKS"; then
7376 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
7377 if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" ; then
7378 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7380 AM_PATH_GLIB(${GLIB_VERSION})
7385 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
7386 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7389 AC_SUBST(LIBIDL_CFLAGS)
7390 AC_SUBST(LIBIDL_LIBS)
7391 AC_SUBST(STATIC_LIBIDL)
7392 AC_SUBST(GLIB_CFLAGS)
7394 AC_SUBST(GLIB_GMODULE_LIBS)
7395 AC_SUBST(HOST_LIBIDL_CONFIG)
7396 AC_SUBST(HOST_LIBIDL_CFLAGS)
7397 AC_SUBST(HOST_LIBIDL_LIBS)
7399 dnl ========================================================
7401 dnl ========================================================
7402 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7405 MOZ_ARG_ENABLE_BOOL(system-cairo,
7406 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7410 # Check for headers defining standard int types.
7411 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7413 if test "$MOZ_TREE_CAIRO"; then
7414 AC_DEFINE(MOZ_TREE_CAIRO)
7416 # For now we assume that we will have a uint64_t available through
7417 # one of the above headers or mozstdint.h.
7418 AC_DEFINE(HAVE_UINT64_T)
7420 # Define macros for cairo-features.h
7421 if test "$MOZ_X11"; then
7422 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7423 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7424 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7425 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7426 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7427 MOZ_ENABLE_CAIRO_FT=1
7428 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7430 if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
7431 QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
7433 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7434 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7435 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7436 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7438 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7439 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7440 if test -z "$WINCE"; then
7441 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7445 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7447 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7448 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7449 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7450 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7451 MOZ_ENABLE_CAIRO_FT=1
7452 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7453 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7455 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7456 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7457 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7458 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7459 MOZ_ENABLE_CAIRO_FT=1
7461 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7462 AC_SUBST(CAIRO_FT_CFLAGS)
7464 if test "$MOZ_DEBUG"; then
7465 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7467 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7470 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7472 AC_SUBST(PS_SURFACE_FEATURE)
7473 AC_SUBST(PDF_SURFACE_FEATURE)
7474 AC_SUBST(SVG_SURFACE_FEATURE)
7475 AC_SUBST(XLIB_SURFACE_FEATURE)
7476 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7477 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7478 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7479 AC_SUBST(XCB_SURFACE_FEATURE)
7480 AC_SUBST(WIN32_SURFACE_FEATURE)
7481 AC_SUBST(OS2_SURFACE_FEATURE)
7482 AC_SUBST(BEOS_SURFACE_FEATURE)
7483 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7484 AC_SUBST(FT_FONT_FEATURE)
7485 AC_SUBST(FC_FONT_FEATURE)
7486 AC_SUBST(WIN32_FONT_FEATURE)
7487 AC_SUBST(QUARTZ_FONT_FEATURE)
7488 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7489 AC_SUBST(QPAINTER_SURFACE_FEATURE)
7491 if test "$_WIN32_MSVC"; then
7492 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7494 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"
7496 if test "$MOZ_X11"; then
7497 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7501 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7502 mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
7505 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7506 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7507 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7508 if test "$MOZ_X11"; then
7509 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7510 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7511 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7515 AC_SUBST(MOZ_TREE_CAIRO)
7516 AC_SUBST(MOZ_CAIRO_CFLAGS)
7517 AC_SUBST(MOZ_CAIRO_LIBS)
7519 dnl ========================================================
7521 dnl ========================================================
7524 if test "$_WIN32_MSVC"; then
7525 if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
7526 LCMS_CFLAGS=-DLCMS_DLL
7528 LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
7530 LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
7533 AC_SUBST(LCMS_CFLAGS)
7536 dnl ========================================================
7538 dnl ========================================================
7539 MOZ_ARG_DISABLE_BOOL(xul,
7540 [ --disable-xul Disable XUL],
7542 if test "$MOZ_XUL"; then
7545 dnl remove extensions that require XUL
7546 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7551 dnl ========================================================
7552 dnl Two ways to enable Python support:
7553 dnl --enable-extensions=python # select all available.
7554 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7556 dnl --enable-extensions=python/xpcom,... # select individual ones
7558 dnl If either is used, we locate the Python to use.
7559 dnl ========================================================
7561 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7562 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7563 dnl Allow PYTHON to point to the Python interpreter to use
7564 dnl (note that it must be the python executable - which we
7565 dnl run to locate the relevant paths etc)
7566 dnl If not set, we use whatever Python we can find.
7568 dnl Ask Python what its version number is
7570 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7571 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7573 dnl Ask for the Python "prefix" (ie, home/source dir)
7574 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7575 dnl Setup the include and library directories.
7576 if test "$OS_ARCH" = "WINNT"; then
7577 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7578 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7579 dnl Binary trees have "include" for .h, and "libs" for .lib
7580 dnl We add 'em both - along with quotes, to handle spaces.
7581 MOZ_PYTHON_DLL_SUFFIX=.pyd
7582 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7583 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7585 dnl Non-Windows include and libs
7586 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7587 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7588 dnl Check for dynamic Python lib
7589 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7590 dnl - core, xpcom loader, pydom etc) all need to share Python.
7591 dnl - Python 2.3's std --enable-shared configure option will
7592 dnl create a libpython2.3.so.1.0. We should first try this
7593 dnl dotted versioned .so file because this is the one that
7594 dnl the PyXPCOM build mechanics tries to link to.
7595 dnl XXX Should find a better way than hardcoding "1.0".
7596 dnl - Python developement tree dir layouts are NOT allowed here
7597 dnl because the PyXPCOM build just dies on it later anyway.
7598 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7599 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7600 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7601 elif test -f "$MOZ_PYTHON_PREFIX/lib64/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7602 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib64 -lpython$MOZ_PYTHON_VER_DOTTED"
7603 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7604 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7605 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7606 dnl Don't Python development tree directory layout.
7607 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7608 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.])
7609 elif test "$OS_ARCH" = "Darwin"; then
7610 dnl We do Darwin last, so if a custom non-framework build of
7611 dnl python is used on OSX, then it will be picked up first by
7612 dnl the logic above.
7613 MOZ_PYTHON_LIBS="-framework Python"
7615 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7617 if test "$OS_ARCH" = "Linux"; then
7618 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7621 dnl Handle "_d" on Windows
7622 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7623 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7625 MOZ_PYTHON_DEBUG_SUFFIX=
7627 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7630 dnl If the user asks for the 'python' extension, then we add
7631 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7632 dnl Note the careful regex - it must match 'python' followed by anything
7633 dnl other than a '/', including the end-of-string.
7634 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7635 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7636 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7639 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7640 dnl command-line, but not yet
7641 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7642 AC_SUBST(MOZ_PYTHON)
7643 AC_SUBST(MOZ_PYTHON_PREFIX)
7644 AC_SUBST(MOZ_PYTHON_INCLUDES)
7645 AC_SUBST(MOZ_PYTHON_LIBS)
7646 AC_SUBST(MOZ_PYTHON_VER)
7647 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7648 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7649 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7651 dnl ========================================================
7652 dnl disable profile locking
7653 dnl do no use this in applications that can have more than
7654 dnl one process accessing the profile directory.
7655 dnl ========================================================
7656 MOZ_ARG_DISABLE_BOOL(profilelocking,
7657 [ --disable-profilelocking Disable profile locking],
7658 MOZ_PROFILELOCKING=,
7659 MOZ_PROFILELOCKING=1 )
7660 if test "$MOZ_PROFILELOCKING"; then
7661 AC_DEFINE(MOZ_PROFILELOCKING)
7664 dnl ========================================================
7665 dnl disable rdf services
7666 dnl ========================================================
7667 MOZ_ARG_DISABLE_BOOL(rdf,
7668 [ --disable-rdf Disable RDF],
7670 if test "$MOZ_RDF"; then
7676 dnl ========================================================
7677 dnl necko configuration options
7678 dnl ========================================================
7681 dnl option to disable various necko protocols
7683 MOZ_ARG_ENABLE_STRING(necko-protocols,
7684 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7685 Enable/disable specific protocol handlers],
7686 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7687 if test "$option" = "yes" || test "$option" = "all"; then
7688 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7689 elif test "$option" = "no" || test "$option" = "none"; then
7691 elif test "$option" = "default"; then
7692 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7693 elif test `echo "$option" | grep -c \^-` != 0; then
7694 option=`echo $option | sed 's/^-//'`
7695 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7697 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7700 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7702 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7703 AC_SUBST(NECKO_PROTOCOLS)
7704 for p in $NECKO_PROTOCOLS; do
7705 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7709 dnl option to disable necko's disk cache
7711 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7712 [ --disable-necko-disk-cache
7713 Disable necko disk cache],
7716 AC_SUBST(NECKO_DISK_CACHE)
7717 if test "$NECKO_DISK_CACHE"; then
7718 AC_DEFINE(NECKO_DISK_CACHE)
7722 dnl option to minimize size of necko's i/o buffers
7724 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7725 [ --enable-necko-small-buffers
7726 Minimize size of necko's i/o buffers],
7727 NECKO_SMALL_BUFFERS=1,
7728 NECKO_SMALL_BUFFERS=)
7729 AC_SUBST(NECKO_SMALL_BUFFERS)
7730 if test "$NECKO_SMALL_BUFFERS"; then
7731 AC_DEFINE(NECKO_SMALL_BUFFERS)
7735 dnl option to disable cookies
7737 MOZ_ARG_DISABLE_BOOL(cookies,
7738 [ --disable-cookies Disable cookie support],
7741 AC_SUBST(NECKO_COOKIES)
7742 if test "$NECKO_COOKIES"; then
7743 AC_DEFINE(NECKO_COOKIES)
7746 dnl NECKO_ configuration options are not global
7747 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7749 dnl Only build Mork if it's required
7751 if test "$MOZ_MORK"; then
7755 dnl Build the lightweight Mork reader if required
7756 AC_SUBST(MOZ_MORKREADER)
7757 if test "$MOZ_MORKREADER"; then
7758 AC_DEFINE(MOZ_MORKREADER)
7761 dnl ========================================================
7762 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7763 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7766 dnl ========================================================
7768 dnl = Maintainer debug option (no --enable equivalent)
7770 dnl ========================================================
7775 AC_SUBST(AR_EXTRACT)
7779 AC_SUBST(AS_DASH_C_FLAG)
7784 AC_SUBST(USE_SHORT_LIBNAME)
7788 AC_SUBST(NS_USE_NATIVE)
7789 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7790 AC_SUBST(MOZ_GFX_TOOLKIT)
7791 AC_SUBST(MOZ_UPDATE_XTERM)
7793 AC_SUBST(MOZ_PLATFORM_HILDON)
7795 AC_SUBST(NS_MAEMO_LOCATION)
7796 AC_SUBST(MOZ_AUTH_EXTENSION)
7797 AC_SUBST(MOZ_MATHML)
7798 AC_SUBST(MOZ_PERMISSIONS)
7800 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7801 AC_SUBST(MOZ_PREF_EXTENSIONS)
7804 AC_SUBST(MOZ_XSLT_STANDALONE)
7805 AC_SUBST(MOZ_JS_LIBS)
7808 AC_SUBST(MOZ_DEBUG_MODULES)
7809 AC_SUBST(MOZ_PROFILE_MODULES)
7810 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7811 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7812 AC_SUBST(MOZ_DEBUG_FLAGS)
7813 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7814 AC_SUBST(WARNINGS_AS_ERRORS)
7815 AC_SUBST(MOZ_DBGRINFO_MODULES)
7816 AC_SUBST(MOZ_EXTENSIONS)
7817 AC_SUBST(MOZ_IMG_DECODERS)
7818 AC_SUBST(MOZ_IMG_ENCODERS)
7819 AC_SUBST(MOZ_JSDEBUGGER)
7821 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7822 AC_SUBST(MOZ_PLUGINS)
7823 AC_SUBST(ENABLE_EAZEL_PROFILER)
7824 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7825 AC_SUBST(EAZEL_PROFILER_LIBS)
7826 AC_SUBST(MOZ_PERF_METRICS)
7827 AC_SUBST(GC_LEAK_DETECTOR)
7828 AC_SUBST(MOZ_LOG_REFCNT)
7832 AC_SUBST(MOZ_CALLGRIND)
7834 AC_SUBST(MOZ_XPCTOOLS)
7835 AC_SUBST(MOZ_JSLOADER)
7836 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7837 AC_SUBST(MOZ_INSURE)
7838 AC_SUBST(MOZ_INSURE_DIRS)
7839 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7840 AC_SUBST(MOZ_QUANTIFY)
7841 AC_SUBST(MOZ_INSURIFYING)
7843 AC_SUBST(MOZ_PLACES)
7844 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7845 AC_SUBST(MOZ_STORAGE)
7847 AC_SUBST(NS_PRINTING)
7849 AC_SUBST(MOZ_JAVAXPCOM)
7850 AC_SUBST(JAVA_INCLUDE_PATH)
7855 AC_SUBST(MOZ_PROFILELOCKING)
7858 AC_SUBST(MOZ_XIE_LIBS)
7859 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
7861 AC_SUBST(XPCOM_USE_LEA)
7862 AC_SUBST(BUILD_STATIC_LIBS)
7863 AC_SUBST(MOZ_ENABLE_LIBXUL)
7864 AC_SUBST(ENABLE_TESTS)
7866 AC_SUBST(MOZ_UNIVERSALCHARDET)
7867 AC_SUBST(ACCESSIBILITY)
7868 AC_SUBST(MOZ_XPINSTALL)
7869 AC_SUBST(MOZ_VIEW_SOURCE)
7870 AC_SUBST(MOZ_SPELLCHECK)
7871 AC_SUBST(MOZ_XPFE_COMPONENTS)
7872 AC_SUBST(MOZ_USER_DIR)
7873 AC_SUBST(MOZ_CRASHREPORTER)
7875 AC_SUBST(ENABLE_STRIP)
7876 AC_SUBST(PKG_SKIP_STRIP)
7877 AC_SUBST(USE_ELF_DYNSTR_GC)
7878 AC_SUBST(INCREMENTAL_LINKER)
7879 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
7880 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
7881 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
7883 AC_SUBST(MOZ_FIX_LINK_PATHS)
7884 AC_SUBST(XPCOM_LIBS)
7885 AC_SUBST(XPCOM_FROZEN_LDOPTS)
7886 AC_SUBST(XPCOM_GLUE_LDOPTS)
7887 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
7889 AC_SUBST(USE_DEPENDENT_LIBS)
7891 AC_SUBST(MOZ_BUILD_ROOT)
7892 AC_SUBST(MOZ_OS2_TOOLS)
7893 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
7895 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
7896 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
7897 AC_SUBST(MOZ_TIMELINE)
7900 AC_SUBST(TARGET_DEVICE)
7902 AC_SUBST(MOZ_APP_NAME)
7903 AC_SUBST(MOZ_APP_DISPLAYNAME)
7904 AC_SUBST(MOZ_APP_VERSION)
7905 AC_SUBST(FIREFOX_VERSION)
7907 AC_SUBST(MOZ_PKG_SPECIAL)
7909 AC_SUBST(MOZILLA_OFFICIAL)
7910 AC_SUBST(BUILD_OFFICIAL)
7911 AC_SUBST(MOZ_MILESTONE_RELEASE)
7914 AC_SUBST(MOZ_PROFILE)
7915 AC_SUBST(MOZ_DEBUG_SYMBOLS)
7916 AC_SUBST(MOZ_MAPINFO)
7917 AC_SUBST(MOZ_BROWSE_INFO)
7918 AC_SUBST(MOZ_TOOLS_DIR)
7919 AC_SUBST(CYGWIN_WRAPPER)
7921 AC_SUBST(WIN32_REDIST_DIR)
7924 dnl Echo the CFLAGS to remove extra whitespace.
7931 $_MOZ_EXCEPTIONS_FLAGS \
7932 $_WARNINGS_CXXFLAGS \
7935 COMPILE_CFLAGS=`echo \
7940 COMPILE_CXXFLAGS=`echo \
7941 $_DEFINES_CXXFLAGS \
7945 AC_SUBST(SYSTEM_MAKEDEPEND)
7946 AC_SUBST(SYSTEM_LIBXUL)
7947 AC_SUBST(SYSTEM_JPEG)
7948 AC_SUBST(SYSTEM_PNG)
7949 AC_SUBST(SYSTEM_ZLIB)
7950 AC_SUBST(SYSTEM_BZ2)
7952 AC_SUBST(JPEG_CFLAGS)
7954 AC_SUBST(ZLIB_CFLAGS)
7956 AC_SUBST(BZ2_CFLAGS)
7958 AC_SUBST(PNG_CFLAGS)
7961 AC_SUBST(MOZ_JPEG_CFLAGS)
7962 AC_SUBST(MOZ_JPEG_LIBS)
7963 AC_SUBST(MOZ_ZLIB_CFLAGS)
7964 AC_SUBST(MOZ_ZLIB_LIBS)
7965 AC_SUBST(MOZ_BZ2_CFLAGS)
7966 AC_SUBST(MOZ_BZ2_LIBS)
7967 AC_SUBST(MOZ_PNG_CFLAGS)
7968 AC_SUBST(MOZ_PNG_LIBS)
7970 AC_SUBST(NSPR_CFLAGS)
7972 AC_SUBST(MOZ_NATIVE_NSPR)
7974 AC_SUBST(NSS_CFLAGS)
7976 AC_SUBST(NSS_DEP_LIBS)
7977 AC_SUBST(MOZ_NATIVE_NSS)
7978 AC_SUBST(NSS_DISABLE_DBM)
7983 AC_SUBST(COMPILE_CFLAGS)
7984 AC_SUBST(COMPILE_CXXFLAGS)
7987 AC_SUBST(CROSS_COMPILE)
7988 AC_SUBST(WCHAR_CFLAGS)
7992 AC_SUBST(HOST_CFLAGS)
7993 AC_SUBST(HOST_CXXFLAGS)
7994 AC_SUBST(HOST_OPTIMIZE_FLAGS)
7996 AC_SUBST(HOST_AR_FLAGS)
7998 AC_SUBST(HOST_RANLIB)
7999 AC_SUBST(HOST_NSPR_MDCPUCFG)
8000 AC_SUBST(HOST_BIN_SUFFIX)
8001 AC_SUBST(HOST_OS_ARCH)
8003 AC_SUBST(TARGET_CPU)
8004 AC_SUBST(TARGET_VENDOR)
8006 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8007 AC_SUBST(TARGET_MD_ARCH)
8008 AC_SUBST(TARGET_XPCOM_ABI)
8011 AC_SUBST(OS_RELEASE)
8014 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
8015 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8017 AC_SUBST(WRAP_MALLOC_CFLAGS)
8018 AC_SUBST(WRAP_MALLOC_LIB)
8021 AC_SUBST(MKSHLIB_FORCE_ALL)
8022 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8023 AC_SUBST(DSO_CFLAGS)
8024 AC_SUBST(DSO_PIC_CFLAGS)
8025 AC_SUBST(DSO_LDOPTS)
8026 AC_SUBST(LIB_PREFIX)
8027 AC_SUBST(DLL_PREFIX)
8028 AC_SUBST(DLL_SUFFIX)
8029 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8030 AC_SUBST(LIB_SUFFIX)
8031 AC_SUBST(OBJ_SUFFIX)
8032 AC_SUBST(BIN_SUFFIX)
8033 AC_SUBST(ASM_SUFFIX)
8034 AC_SUBST(IMPORT_LIB_SUFFIX)
8036 AC_SUBST(CC_VERSION)
8037 AC_SUBST(CXX_VERSION)
8038 AC_SUBST(MSMANIFEST_TOOL)
8040 if test "$USING_HCC"; then
8041 CC='${topsrcdir}/build/hcc'
8043 CXX='${topsrcdir}/build/hcpp'
8044 CXX="$CXX '$_OLDCXX'"
8049 dnl Check for missing components
8050 if test "$COMPILE_ENVIRONMENT"; then
8051 if test "$MOZ_X11"; then
8052 dnl ====================================================
8053 dnl = Check if X headers exist
8054 dnl ====================================================
8055 _SAVE_CFLAGS=$CFLAGS
8056 CFLAGS="$CFLAGS $XCFLAGS"
8060 #include <X11/Xlib.h>
8061 #include <X11/Intrinsic.h>
8065 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8066 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8070 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8071 CFLAGS="$_SAVE_CFLAGS"
8073 if test ! -z "$MISSING_X"; then
8074 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8078 fi # COMPILE_ENVIRONMENT
8080 dnl Set various defines and substitutions
8081 dnl ========================================================
8083 if test "$OS_ARCH" = "BeOS"; then
8086 elif test "$OS_ARCH" = "Darwin"; then
8088 AC_DEFINE(UNIX_ASYNC_DNS)
8090 elif test "$OS_ARCH" = "OpenVMS"; then
8092 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
8094 AC_DEFINE(UNIX_ASYNC_DNS)
8097 AC_SUBST(MOZ_MOVEMAIL)
8099 if test "$MOZ_DEBUG"; then
8100 AC_DEFINE(MOZ_REFLOW_PERF)
8101 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8104 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8105 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8106 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8107 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8108 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8109 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8110 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8111 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8112 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8115 # Used for LD_LIBRARY_PATH of run_viewer target
8117 for lib_arg in $NSPR_LIBS $TK_LIBS; do
8119 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
8125 dnl ========================================================
8126 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
8127 dnl ========================================================
8130 WIN_TOP_SRC=`cd $srcdir; pwd -W`
8133 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
8134 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
8135 CC="\$(CYGWIN_WRAPPER) $CC"
8136 CXX="\$(CYGWIN_WRAPPER) $CXX"
8137 CPP="\$(CYGWIN_WRAPPER) $CPP"
8138 LD="\$(CYGWIN_WRAPPER) $LD"
8139 AS="\$(CYGWIN_WRAPPER) $AS"
8140 RC="\$(CYGWIN_WRAPPER) $RC"
8141 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
8142 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
8143 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
8147 AC_SUBST(CYGDRIVE_MOUNT)
8148 AC_SUBST(WIN_TOP_SRC)
8150 AC_SUBST(MOZILLA_VERSION)
8152 AC_SUBST(ac_configure_args)
8154 dnl Spit out some output
8155 dnl ========================================================
8157 dnl The following defines are used by xpcom
8158 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8160 HAVE_CPP_2BYTE_WCHAR_T
8161 HAVE_CPP_ACCESS_CHANGING_USING
8162 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8164 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8166 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8167 HAVE_CPP_NAMESPACE_STD
8169 HAVE_CPP_PARTIAL_SPECIALIZATION
8170 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8172 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
8174 NEED_CPP_UNUSED_IMPLEMENTATIONS
8178 HAVE_ICONV_WITH_CONST_INPUT
8186 netwerk/necko-config.h
8187 xpcom/xpcom-config.h
8188 xpcom/xpcom-private.h
8191 # Save the defines header file before autoconf removes it.
8192 # (Do not add AC_DEFINE calls after this line.)
8193 _CONFIG_TMP=confdefs-tmp.h
8194 _CONFIG_DEFS_H=mozilla-config.h
8196 cat > $_CONFIG_TMP <<\EOF
8197 /* List of defines generated by configure. Included with preprocessor flag,
8198 * -include, to avoid long list of -D defines on the compile command-line.
8202 #ifndef _MOZILLA_CONFIG_H_
8203 #define _MOZILLA_CONFIG_H_
8206 _EGREP_PATTERN='^#define ('
8207 if test -n "$_NON_GLOBAL_ACDEFINES"; then
8208 for f in $_NON_GLOBAL_ACDEFINES; do
8209 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
8212 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
8214 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
8216 cat >> $_CONFIG_TMP <<\EOF
8218 #endif /* _MOZILLA_CONFIG_H_ */
8222 # Only write mozilla-config.h when something changes (or it doesn't exist)
8223 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
8226 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
8227 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
8229 echo ==== $_CONFIG_DEFS_H =================================
8233 dnl Probably shouldn't call this manually but we always want the output of DEFS
8234 rm -f confdefs.h.save
8235 mv confdefs.h confdefs.h.save
8236 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
8237 AC_OUTPUT_MAKE_DEFS()
8239 AC_SUBST(MOZ_DEFINES)
8241 mv confdefs.h.save confdefs.h
8243 dnl Load the list of Makefiles to generate.
8244 dnl To add new Makefiles, edit allmakefiles.sh.
8245 dnl allmakefiles.sh sets the variable, MAKEFILES.
8246 . ${srcdir}/allmakefiles.sh
8248 dnl Run a perl script to quickly create the makefiles.
8249 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
8250 dnl for the files it cannot handle correctly. This way, config.status
8251 dnl will handle these files.
8252 dnl If it fails, nothing is set and config.status will run as usual.
8254 dnl This does not change the $MAKEFILES variable.
8256 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
8258 if test -z "${AS_PERL}"; then
8259 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
8261 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
8266 echo $MAKEFILES > unallmakefiles
8268 AC_OUTPUT($MAKEFILES)
8270 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
8271 if test "$CAIRO_FEATURES_H"; then
8272 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
8273 mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
8275 rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
8279 dnl ========================================================
8280 dnl = Setup a nice relatively clean build environment for
8281 dnl = sub-configures.
8282 dnl ========================================================
8285 CFLAGS="$_SUBDIR_CFLAGS"
8286 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8287 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8288 LDFLAGS="$_SUBDIR_LDFLAGS"
8289 HOST_CC="$_SUBDIR_HOST_CC"
8290 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8291 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8297 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8298 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8300 if test -z "$MOZ_NATIVE_NSPR"; then
8301 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8302 if test -z "$MOZ_DEBUG"; then
8303 ac_configure_args="$ac_configure_args --disable-debug"
8305 if test "$MOZ_OPTIMIZE" = "1"; then
8306 ac_configure_args="$ac_configure_args --enable-optimize"
8308 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8309 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8311 if test -n "$HAVE_64BIT_OS"; then
8312 ac_configure_args="$ac_configure_args --enable-64bit"
8314 if test -n "$USE_ARM_KUSER"; then
8315 ac_configure_args="$ac_configure_args --with-arm-kuser"
8317 AC_OUTPUT_SUBDIRS(nsprpub)
8318 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8321 if test -z "$MOZ_NATIVE_NSPR"; then
8322 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8323 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8324 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8325 NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
8326 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
8327 NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
8328 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
8330 rm -f config/autoconf.mk.bak
8333 # Run the SpiderMonkey 'configure' script.
8334 dist=$MOZ_BUILD_ROOT/dist
8335 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8336 ac_configure_args="$ac_configure_args --enable-threadsafe"
8337 if test -z "$MOZ_NATIVE_NSPR"; then
8338 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8339 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8341 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8342 ac_configure_args="$ac_configure_args --includedir=$dist/include"
8343 ac_configure_args="$ac_configure_args --bindir=$dist/bin"
8344 ac_configure_args="$ac_configure_args --libdir=$dist/lib"
8345 ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
8346 if test "$MOZ_MEMORY"; then
8347 ac_configure_args="$ac_configure_args --enable-jemalloc"
8349 AC_OUTPUT_SUBDIRS(js/src)
8350 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8352 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR