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}"
71 dnl ========================================================
73 dnl = Don't change the following two lines. Doing so breaks:
75 dnl = CFLAGS="-foo" ./configure
77 dnl ========================================================
79 CPPFLAGS="${CPPFLAGS=}"
80 CXXFLAGS="${CXXFLAGS=}"
82 HOST_CFLAGS="${HOST_CFLAGS=}"
83 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
84 HOST_LDFLAGS="${HOST_LDFLAGS=}"
86 dnl ========================================================
87 dnl = Preserve certain environment flags passed to configure
88 dnl = We want sub projects to receive the same flags
89 dnl = untainted by this configure script
90 dnl ========================================================
93 _SUBDIR_CFLAGS="$CFLAGS"
94 _SUBDIR_CPPFLAGS="$CPPFLAGS"
95 _SUBDIR_CXXFLAGS="$CXXFLAGS"
96 _SUBDIR_LDFLAGS="$LDFLAGS"
97 _SUBDIR_HOST_CC="$HOST_CC"
98 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
99 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
100 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
101 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
103 dnl Set the version number of the libs included with mozilla
104 dnl ========================================================
111 dnl Set the minimum version of toolkit libs used by mozilla
112 dnl ========================================================
122 WINDRES_VERSION=2.14.90
125 GNOMEUI_VERSION=2.2.0
128 STARTUP_NOTIFICATION_VERSION=0.8
135 dnl Set various checks
136 dnl ========================================================
140 dnl Initialize the Pthread test variables early so they can be
141 dnl overridden by each platform.
142 dnl ========================================================
146 dnl Do not allow a separate objdir build if a srcdir build exists.
147 dnl ==============================================================
148 _topsrcdir=`cd \`dirname $0\`; pwd`
151 if test "$_topsrcdir" != "$_objdir"
153 # Check for a couple representative files in the source tree
155 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
156 if test -f $file; then
157 _conflict_files="$_conflict_files $file"
160 if test "$_conflict_files"; then
162 echo "* Your source tree contains these files:"
163 for file in $_conflict_files; do
167 * This indicates that you previously built in the source tree.
168 * A source tree build can confuse the separate objdir build.
170 * To clean up the source tree:
181 dnl Default to MSVC for win32
182 dnl ==============================================================
183 if test -z "$CROSS_COMPILE"; then
185 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
187 if test -z "$CC"; then CC=cl; fi
188 if test -z "$CXX"; then CXX=cl; fi
189 if test -z "$CPP"; then CPP=cl; fi
190 if test -z "$LD"; then LD=link; fi
191 if test -z "$AS"; then AS=ml; fi
192 if test -z "$MIDL"; then MIDL=midl; fi
197 COMPILE_ENVIRONMENT=1
198 MOZ_ARG_ENABLE_BOOL(compile-environment,
199 [ --disable-compile-environment
200 Disable compiler/library checks.],
201 COMPILE_ENVIRONMENT=1,
202 COMPILE_ENVIRONMENT= )
204 dnl ========================================================
205 dnl Checks for compilers.
206 dnl ========================================================
207 dnl Set CROSS_COMPILE in the environment when running configure
208 dnl to use the cross-compile setup for now
209 dnl ========================================================
211 if test "$COMPILE_ENVIRONMENT"; then
213 dnl Do some special WinCE toolchain stuff
216 echo -----------------------------------------------------------------------------
217 echo Building Windows CE Shunt Library and Tool Chain
218 echo -----------------------------------------------------------------------------
222 echo -n "#define TOPSRCDIR \"" > $srcdir/build/wince/tools/topsrcdir.h
223 echo `cd "$_topsrcdir" && pwd -W | tr '\n' '\"'` >> $srcdir/build/wince/tools/topsrcdir.h
224 make -C $srcdir/build/wince/tools
225 echo -----------------------------------------------------------------------------
229 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
230 echo "cross compiling from $host to $target"
234 _SAVE_CFLAGS="$CFLAGS"
235 _SAVE_LDFLAGS="$LDFLAGS"
237 AC_MSG_CHECKING([for host c compiler])
238 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
239 if test -z "$HOST_CC"; then
240 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
242 AC_MSG_RESULT([$HOST_CC])
243 AC_MSG_CHECKING([for host c++ compiler])
244 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
245 if test -z "$HOST_CXX"; then
246 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
248 AC_MSG_RESULT([$HOST_CXX])
250 if test -z "$HOST_CFLAGS"; then
251 HOST_CFLAGS="$CFLAGS"
253 if test -z "$HOST_CXXFLAGS"; then
254 HOST_CXXFLAGS="$CXXFLAGS"
256 if test -z "$HOST_LDFLAGS"; then
257 HOST_LDFLAGS="$LDFLAGS"
259 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
260 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
262 CFLAGS="$HOST_CFLAGS"
263 LDFLAGS="$HOST_LDFLAGS"
265 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
266 AC_TRY_COMPILE([], [return(0);],
267 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
268 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
271 CFLAGS="$HOST_CXXFLAGS"
273 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
274 AC_TRY_COMPILE([], [return(0);],
275 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
276 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
280 LDFLAGS=$_SAVE_LDFLAGS
282 case "$build:$target" in
283 powerpc-apple-darwin8*:i?86-apple-darwin*)
284 dnl The Darwin cross compiler doesn't necessarily point itself at a
285 dnl root that has libraries for the proper architecture, it defaults
286 dnl to the system root. The libraries in the system root on current
287 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
288 dnl checks will fail. Fake a working SDK in that case.
290 _SAVE_CXXFLAGS=$CXXLAGS
291 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
292 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
296 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
299 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
303 case "$build:$target" in
304 powerpc-apple-darwin8*:i?86-apple-darwin*)
305 dnl Revert the changes made above. From this point on, the target
306 dnl compiler will never be used without applying the SDK to CFLAGS
307 dnl (see --with-macos-sdk below).
309 CXXFLAGS=$_SAVE_CXXFLAGS
313 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
314 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
315 AC_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
316 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
317 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
318 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
319 AC_DEFINE(CROSS_COMPILE)
324 AC_PATH_PROGS(AS, $AS as, $CC)
325 AC_CHECK_PROGS(AR, ar, :)
326 AC_CHECK_PROGS(LD, ld, :)
327 AC_CHECK_PROGS(STRIP, strip, :)
328 AC_CHECK_PROGS(WINDRES, windres, :)
329 if test -z "$HOST_CC"; then
332 if test -z "$HOST_CFLAGS"; then
333 HOST_CFLAGS="$CFLAGS"
335 if test -z "$HOST_CXX"; then
338 if test -z "$HOST_CXXFLAGS"; then
339 HOST_CXXFLAGS="$CXXFLAGS"
341 if test -z "$HOST_LDFLAGS"; then
342 HOST_LDFLAGS="$LDFLAGS"
344 if test -z "$HOST_RANLIB"; then
345 HOST_RANLIB="$RANLIB"
347 if test -z "$HOST_AR"; then
358 if test "$GCC" = "yes"; then
360 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
362 if test "$GXX" = "yes"; then
364 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
366 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
369 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
372 if test "$GNU_CC"; then
373 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
378 dnl Special win32 checks
379 dnl ========================================================
385 if test -n "$GNU_CC"; then
393 MOZ_ARG_WITH_STRING(windows-version,
394 [ --with-windows-version=WINVER
395 Minimum Windows version (WINVER) to support
406 AC_MSG_ERROR([Invalid value --with-windows-version, must be 400, 500 or 501]);
412 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
413 if test "$GCC" != "yes"; then
414 # Check to see if we are really running in a msvc environemnt
416 AC_CHECK_PROGS(MIDL, midl)
418 # Make sure compilers are valid
419 CFLAGS="$CFLAGS -TC -nologo"
420 CXXFLAGS="$CXXFLAGS -TP -nologo"
423 AC_TRY_COMPILE([#include <stdio.h>],
424 [ printf("Hello World\n"); ],,
425 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
428 AC_TRY_COMPILE([#include <new.h>],
429 [ unsigned *test = new unsigned(42); ],,
430 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
434 _MSVC_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
437 # Determine compiler version
438 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
439 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
440 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
441 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
443 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
444 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
446 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
447 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
449 if test "$_CC_MAJOR_VERSION" = "12"; then
451 elif test "$_CC_MAJOR_VERSION" = "13"; then
453 elif test "$_CC_MAJOR_VERSION" = "14"; then
455 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
456 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
457 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
458 elif test "$_CC_MAJOR_VERSION" = "15"; then
460 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
461 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
462 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
464 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
467 _MOZ_RTTI_FLAGS_ON='-GR'
468 _MOZ_RTTI_FLAGS_OFF='-GR-'
469 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
470 _MOZ_EXCEPTIONS_FLAGS_OFF=''
472 if test -n "$WIN32_REDIST_DIR"; then
473 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
477 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
478 if test "$_CC_SUITE" -ge "8"; then
480 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
483 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
484 if test -n "$MSMT_TOOL"; then
485 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
486 if test -z "$MSMANIFEST_TOOL_VERSION"; then
487 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
492 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
496 # Check linker version
497 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
498 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
499 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
500 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
505 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
506 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
507 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
508 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
509 # Add flags if necessary
510 AC_MSG_CHECKING([for midl flags])
511 if test \( "$_MIDL_MAJOR_VERSION" -gt "6" \) -o \( "$_MIDL_MAJOR_VERSION" = "6" -a "$_MIDL_MINOR_VERSION" -gt "0" \) -o \( "$_MIDL_MAJOR_VERSION" = "6" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" -gt "359" \); then
512 # Starting with MIDL version 6.0.359, the MIDL compiler
513 # generates /Oicf /robust stubs by default, which is not
514 # compatible with versions of Windows older than Win2k.
515 # This switches us back to the old behaviour. When we drop
516 # support for Windows older than Win2k, we should remove
518 MIDL_FLAGS="${MIDL_FLAGS} -no_robust"
519 AC_MSG_RESULT([need -no_robust])
521 MIDL_FLAGS="${MIDL_FLAGS}"
522 AC_MSG_RESULT([none needed])
525 unset _MSVC_VER_FILTER
528 # Check w32api version
529 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
530 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
531 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
532 AC_TRY_COMPILE([#include <w32api.h>],
533 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
534 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
535 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
536 #error "test failed."
538 , [ res=yes ], [ res=no ])
539 AC_MSG_RESULT([$res])
540 if test "$res" != "yes"; then
541 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
543 # Check windres version
544 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
545 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
546 AC_MSG_RESULT([$_WINDRES_VERSION])
547 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
548 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
549 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
550 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
551 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
552 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
553 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
554 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
555 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
556 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
557 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
558 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
560 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
564 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
565 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
566 # Require OS features provided by IE 5.0
567 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
571 if test -n "$_WIN32_MSVC"; then
573 SKIP_COMPILER_CHECKS=1
574 SKIP_LIBRARY_CHECKS=1
575 AC_CHECK_HEADERS(mmintrin.h)
578 dnl Test breaks icc on OS/2 && MSVC
579 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
581 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
585 CC="${srcdir}/build/hcc '$CC'"
586 CXX="${srcdir}/build/hcpp '$CXX'"
593 fi # COMPILE_ENVIRONMENT
603 dnl ========================================================
604 dnl Checks for programs.
605 dnl ========================================================
608 AC_PATH_PROGS(PERL, $PERL perl5 perl )
609 if test -z "$PERL" || test "$PERL" = ":"; then
610 AC_MSG_ERROR([perl not found in \$PATH])
613 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
614 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
615 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
617 AC_MSG_RESULT([$_perl_version])
619 if test "$_perl_res" != 0; then
620 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
624 AC_MSG_CHECKING([for full perl installation])
625 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
627 if test "$_perl_res" != 0; then
629 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
634 AC_PATH_PROGS(PYTHON, $PYTHON python)
635 if test -z "$PYTHON"; then
636 AC_MSG_ERROR([python was not found in \$PATH])
638 echo PYTHON="$PYTHON"
640 AC_PATH_PROGS(NSINSTALL_BIN, nsinstall )
641 if test -z "$COMPILE_ENVIRONMENT"; then
642 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
643 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
646 AC_SUBST(NSINSTALL_BIN)
648 AC_PATH_PROG(DOXYGEN, doxygen, :)
649 AC_PATH_PROG(WHOAMI, whoami, :)
650 AC_PATH_PROG(AUTOCONF, autoconf, :)
651 AC_PATH_PROG(UNZIP, unzip, :)
652 AC_PATH_PROGS(ZIP, zip)
653 if test -z "$ZIP" || test "$ZIP" = ":"; then
654 AC_MSG_ERROR([zip not found in \$PATH])
656 AC_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
657 AC_PATH_PROG(XARGS, xargs)
658 if test -z "$XARGS" || test "$XARGS" = ":"; then
659 AC_MSG_ERROR([xargs not found in \$PATH .])
662 if test "$COMPILE_ENVIRONMENT"; then
664 dnl ========================================================
665 dnl = Mac OS X toolchain support
666 dnl ========================================================
670 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
671 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
672 dnl the environment and includedir purposes (when using an SDK, below),
673 dnl but remember the full version number for the libdir (SDK).
675 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
676 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
678 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
679 dnl Bug 280479, but this keeps popping up in bug 292530 too because
680 dnl 4.0.0/4061 is the default compiler in Tiger.
682 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
684 if test "$GCC_BUILD" = "4061" ; then
685 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
686 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
687 from building Mozilla. Upgrade to Xcode 2.1 or later.])
691 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
692 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
693 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
694 AC_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
699 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
701 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
707 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
708 dnl it has moved into /usr/bin.
709 AC_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
713 AC_SUBST(GCC_VERSION)
714 AC_SUBST(XCODEBUILD_VERSION)
715 AC_SUBST(HAS_XCODE_2_1)
717 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
718 dnl that a universal binary is being produced.
719 AC_SUBST(UNIVERSAL_BINARY)
721 dnl ========================================================
722 dnl Check for MacOS deployment target version
723 dnl ========================================================
725 MOZ_ARG_ENABLE_STRING(macos-target,
726 [ --enable-macos-target=VER (default=10.4)
727 Set the minimum MacOS version needed at runtime],
728 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
732 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
733 dnl Use the specified value
734 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
735 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
736 dnl No value specified on the command line or in the environment,
737 dnl use the lesser of the application's minimum or the architecture's
739 export MACOSX_DEPLOYMENT_TARGET=10.4
744 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
746 dnl ========================================================
747 dnl = Mac OS X SDK support
748 dnl ========================================================
751 MOZ_ARG_WITH_STRING(macos-sdk,
752 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
753 MACOS_SDK_DIR=$withval)
755 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
756 dnl NEXT_ROOT will be set and exported only if it's needed.
757 AC_SUBST(MACOS_SDK_DIR)
760 if test "$MACOS_SDK_DIR"; then
761 dnl Sync this section with the ones in NSPR and NSS.
762 dnl Changes to the cross environment here need to be accounted for in
763 dnl the libIDL checks (below) and xpidl build.
765 if test ! -d "$MACOS_SDK_DIR"; then
766 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
767 specify a valid SDK. SDKs are installed when the optional cross-development
768 tools are selected during the Xcode/Developer Tools installation.])
771 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
772 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
773 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"
774 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
775 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
777 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"
779 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
780 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
782 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
783 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
784 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
786 dnl ld support for -syslibroot is compiler-agnostic, but only available
787 dnl on Tiger. Although it's possible to switch on the build host's
788 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
789 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
790 dnl set because both the compiler and linker use it.
791 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"
792 export NEXT_ROOT=$MACOS_SDK_DIR
794 if test -n "$CROSS_COMPILE" ; then
795 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
796 dnl the build host. HOST_CXX is presently unused.
797 HOST_CC="NEXT_ROOT= $HOST_CC"
798 HOST_CXX="NEXT_ROOT= $HOST_CXX"
801 dnl gcc >= 4.0 uses different paths than above, but knows how to find
803 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
804 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
806 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
807 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
808 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
810 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
811 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
812 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
813 dnl be ignored and cause warnings when -syslibroot is specified.
814 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
815 dnl the -isysroot it receives, so this is only needed with 4.0.0.
816 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
821 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
823 AC_TRY_COMPILE([#include <new>
824 int main() { return 0; }],
828 AC_MSG_RESULT($result)
830 if test "$result" = "no" ; then
831 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
835 fi # COMPILE_ENVIRONMENT
837 dnl Be sure the make we use is GNU make.
838 dnl on win32, gmake.exe is the generally the wrong version
840 cygwin*|mingw*|mks*|msvc*)
841 AC_PATH_PROGS(MAKE, $MAKE make gmake, :)
844 AC_PATH_PROGS(MAKE, $MAKE gmake make, :)
847 _make_try=`$MAKE --version 2>/dev/null | grep GNU`
848 if test ! "$_make_try"
851 echo "*** $MAKE is not GNU Make. You will not be able to build Mozilla without GNU Make."
855 dnl Now exit if version if < MAKE_VERSION
857 echo 'all: ; @echo $(MAKE_VERSION)' > dummy.mk
858 _make_vers=`$MAKE --no-print-directory -f dummy.mk all 2>/dev/null`
860 _MAKE_MAJOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $1 }'`
861 _MAKE_MINOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $2 }'`
862 MAKE_MAJOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $1 }'`
863 MAKE_MINOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $2 }'`
864 if test "$_MAKE_MAJOR_VERSION" -lt "$MAKE_MAJOR_VERSION" || \
865 test "$_MAKE_MAJOR_VERSION" = "$MAKE_MAJOR_VERSION" -a \
866 "$_MAKE_MINOR_VERSION" -lt "$MAKE_MINOR_VERSION"; then
867 AC_MSG_ERROR([GNU Make $MAKE_VERSION or higher is required to build Mozilla.])
871 if test "$COMPILE_ENVIRONMENT"; then
875 dnl Check in X11 include directory too.
876 if test "$no_x" != "yes"; then
877 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
882 fi # COMPILE_ENVIRONMENT
884 dnl ========================================================
885 dnl set the defaults first
886 dnl ========================================================
905 MOZ_USER_DIR=".mozilla"
907 HOST_AR_FLAGS='$(AR_FLAGS)'
910 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
912 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
914 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
916 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
917 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
918 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
919 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
920 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
921 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
922 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
924 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
925 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
929 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
930 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
932 MOZ_ENABLE_POSTSCRIPT=1
934 if test -n "$CROSS_COMPILE"; then
935 OS_TARGET="${target_os}"
936 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
938 case "${target_os}" in
939 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
940 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
941 mingw*) OS_ARCH=WINNT ;;
942 wince*) OS_ARCH=WINCE ;;
943 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
947 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
948 OS_RELEASE=`uname -r`
951 # Before this used `uname -m` when not cross compiling
952 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
953 OS_TEST="${target_cpu}"
957 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
959 #######################################################################
960 # Master "Core Components" macros for getting the OS target #
961 #######################################################################
964 # Note: OS_TARGET should be specified on the command line for gmake.
965 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
966 # The difference between the Win95 target and the WinNT target is that
967 # the WinNT target uses Windows NT specific features not available
968 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
969 # at lesser performance (the Win95 target uses threads; the WinNT target
972 # When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
973 # is built. See: win16_3.11.mk for lots more about the Win16 target.
975 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
980 # The following hack allows one to build on a WIN95 machine (as if
981 # s/he were cross-compiling on a WINNT host for a WIN95 target).
982 # It also accomodates for MKS's uname.exe. If you never intend
983 # to do development on a WIN95 machine, you don't need this hack.
998 CYGWIN_9*|CYGWIN_ME*)
999 OS_ARCH='CYGWIN_NT-4.0'
1005 # Define and override various archtecture-specific variables, including
1014 case "$HOST_OS_ARCH" in
1015 cygwin*|mingw*|mks*|msvc*)
1034 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1037 HOST_OS_ARCH=UNIXWARE
1049 HOST_OS_ARCH=OpenVMS
1059 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1063 HOST_OS_ARCH=UNIXWARE
1073 # If uname -s returns "Windows_NT", we assume that we are using
1074 # the uname.exe in MKS toolkit.
1076 # The -r option of MKS uname only returns the major version number.
1077 # So we need to use its -v option to get the minor version number.
1078 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1082 OS_MINOR_RELEASE=`uname -v`
1083 if test "$OS_MINOR_RELEASE" = "00"; then
1086 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1088 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1090 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1091 # the uname.exe in the Cygwin tools.
1092 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1093 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1094 # the uname.exe in the GNU-Win32 tools.
1095 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1096 # the uname.exe in the MSYS tools.
1098 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1103 OS_RELEASE=`uname -v`.`uname -r`
1116 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1120 OS_RELEASE=`uname -v`
1144 OS_RELEASE=`uname -v`
1150 OS_RELEASE=`uname -v`
1153 if test "$OS_TARGET" != "NTO"; then
1155 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1164 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1170 OS_RELEASE=`uname -v`
1177 case "${target_cpu}" in
1185 if test -z "$CROSS_COMPILE" ; then
1193 if test "$OS_ARCH" = "NCR"; then
1195 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1199 # Only set CPU_ARCH if we recognize the value of OS_TEST
1210 Alpha | alpha | ALPHA)
1218 x86_64 | sparc | ppc | ia64)
1223 if test -z "$OS_TARGET"; then
1226 if test "$OS_TARGET" = "WIN95"; then
1229 if test "$OS_TARGET" = "WIN16"; then
1232 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1234 dnl ========================================================
1235 dnl GNU specific defaults
1236 dnl ========================================================
1237 if test "$GNU_CC"; then
1238 # FIXME: Let us build with strict aliasing. bug 414641.
1239 CFLAGS="$CFLAGS -fno-strict-aliasing"
1240 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1241 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1242 DSO_LDOPTS='-shared'
1243 if test "$GCC_USE_GNU_LD"; then
1244 # Don't allow undefined symbols in libraries
1245 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1247 WARNINGS_AS_ERRORS='-Werror'
1249 DSO_PIC_CFLAGS='-fPIC'
1250 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1251 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1252 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1253 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1255 # Turn on GNU specific features
1256 # -Wall - turn on all warnings
1257 # -pedantic - make compiler warn about non-ANSI stuff, and
1258 # be a little bit stricter
1259 # Warnings slamm took out for now (these were giving more noise than help):
1260 # -Wbad-function-cast - warns when casting a function to a new return type
1261 # -Wconversion - complained when char's or short's were used a function args
1262 # -Wshadow - removed because it generates more noise than help --pete
1263 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1264 if test "$CPU_ARCH" != "ia64"; then
1265 # only use -Wcast-align for non-ia64, it's noisy on that platform
1266 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1269 dnl Turn pedantic on but disable the warnings for long long
1271 _IGNORE_LONG_LONG_WARNINGS=1
1273 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1274 _USE_CPP_INCLUDE_FLAG=1
1276 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1277 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1279 DSO_LDOPTS='-shared'
1280 if test "$GNU_LD"; then
1281 # Don't allow undefined symbols in libraries
1282 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1286 DSO_PIC_CFLAGS='-KPIC'
1287 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1290 if test "$GNU_CXX"; then
1291 # FIXME: Let us build with strict aliasing. bug 414641.
1292 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1293 # Turn on GNU specific features
1294 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1295 if test "$CPU_ARCH" != "ia64"; then
1296 # only use -Wcast-align for non-ia64, it's noisy on that platform
1297 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1300 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1301 _USE_CPP_INCLUDE_FLAG=1
1303 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1306 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1307 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1308 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1309 dnl normal behavior.
1310 dnl ========================================================
1312 MKSHLIB_UNFORCE_ALL=
1314 if test "$COMPILE_ENVIRONMENT"; then
1315 if test "$GNU_CC"; then
1316 AC_MSG_CHECKING(whether ld has archive extraction flags)
1317 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1318 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1319 ac_cv_mkshlib_force_and_unforce="no"
1320 exec 3<&0 <<LOOP_INPUT
1321 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1322 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1323 force="-Wl,-all"; unforce="-Wl,-none"
1330 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1333 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1335 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1339 eval $ac_cv_mkshlib_force_and_unforce
1340 MKSHLIB_FORCE_ALL=$force
1341 MKSHLIB_UNFORCE_ALL=$unforce
1344 fi # COMPILE_ENVIRONMENT
1346 dnl =================================================================
1347 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1348 dnl which is bad when cross compiling.
1349 dnl =================================================================
1350 if test "$COMPILE_ENVIRONMENT"; then
1351 configure_static_assert_macros='
1352 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1353 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1354 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1357 dnl test that the macros actually work:
1358 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1359 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1362 ac_cv_static_assertion_macros_work="yes"
1363 AC_TRY_COMPILE([$configure_static_assert_macros],
1364 [CONFIGURE_STATIC_ASSERT(1)],
1366 ac_cv_static_assertion_macros_work="no")
1367 AC_TRY_COMPILE([$configure_static_assert_macros],
1368 [CONFIGURE_STATIC_ASSERT(0)],
1369 ac_cv_static_assertion_macros_work="no",
1372 AC_TRY_COMPILE([$configure_static_assert_macros],
1373 [CONFIGURE_STATIC_ASSERT(1)],
1375 ac_cv_static_assertion_macros_work="no")
1376 AC_TRY_COMPILE([$configure_static_assert_macros],
1377 [CONFIGURE_STATIC_ASSERT(0)],
1378 ac_cv_static_assertion_macros_work="no",
1382 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1383 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1384 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1387 fi # COMPILE_ENVIRONMENT
1389 dnl ========================================================
1390 dnl Checking for 64-bit OS
1391 dnl ========================================================
1392 if test "$COMPILE_ENVIRONMENT"; then
1395 AC_MSG_CHECKING(for 64-bit OS)
1396 AC_TRY_COMPILE([$configure_static_assert_macros],
1397 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1398 result="yes", result="no")
1399 AC_MSG_RESULT("$result")
1400 if test "$result" = "yes"; then
1401 AC_DEFINE(HAVE_64BIT_OS)
1404 AC_SUBST(HAVE_64BIT_OS)
1406 fi # COMPILE_ENVIRONMENT
1408 dnl ========================================================
1409 dnl Enable high-memory support on OS/2, disabled by default
1410 dnl ========================================================
1411 MOZ_ARG_ENABLE_BOOL(os2-high-mem,
1412 [ --enable-os2-high-mem Enable high-memory support on OS/2],
1413 MOZ_OS2_HIGH_MEMORY=1,
1414 MOZ_OS2_HIGH_MEMORY= )
1415 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1417 dnl ========================================================
1418 dnl System overrides of the defaults for host
1419 dnl ========================================================
1422 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1423 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1424 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1427 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1428 if test -n "$_WIN32_MSVC"; then
1430 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1431 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1432 HOST_RANLIB='echo ranlib'
1434 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1436 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1437 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1438 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1439 HOST_BIN_SUFFIX=.exe
1442 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1445 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1446 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1448 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1450 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1452 PERL="${CYGWIN_WRAPPER} $PERL"
1455 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1456 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1463 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1464 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1465 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1466 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1467 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
1471 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1472 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1473 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1477 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1478 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1479 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1480 HOST_BIN_SUFFIX=.exe
1485 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1486 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1487 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1491 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1492 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1496 dnl Get mozilla version from central milestone file
1497 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1499 dnl Get version of various core apps from the version files.
1500 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1501 THUNDERBIRD_VERSION=`cat $topsrcdir/mail/config/version.txt`
1502 SUNBIRD_VERSION=`cat $topsrcdir/calendar/sunbird/config/version.txt`
1503 SEAMONKEY_VERSION=`cat $topsrcdir/suite/config/version.txt`
1505 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1506 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1508 dnl ========================================================
1509 dnl System overrides of the defaults for target
1510 dnl ========================================================
1515 if test ! "$GNU_CC"; then
1516 if test ! "$HAVE_64BIT_OS"; then
1517 # Compiling with Visual Age C++ object model compat is the
1518 # default. To compile with object model ibm, add
1519 # AIX_OBJMODEL=ibm to .mozconfig.
1520 if test "$AIX_OBJMODEL" = "ibm"; then
1521 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1528 AC_SUBST(AIX_OBJMODEL)
1529 DSO_LDOPTS='-qmkshrobj=1'
1530 DSO_CFLAGS='-qflag=w:w'
1532 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1533 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1535 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1536 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1537 if test "$COMPILE_ENVIRONMENT"; then
1540 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 5.0.2.0])
1542 [#if (__IBMCPP__ < 502)
1543 #error "Bad compiler"
1545 _BAD_COMPILER=,_BAD_COMPILER=1)
1546 if test -n "$_BAD_COMPILER"; then
1548 AC_MSG_ERROR([VisualAge C++ version 5.0.2.0 or higher is required to build.])
1550 AC_MSG_RESULT([yes])
1553 TARGET_COMPILER_ABI="ibmc"
1554 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1555 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1558 case "${target_os}" in
1563 if test "$COMPILE_ENVIRONMENT"; then
1564 AC_CHECK_HEADERS(sys/inttypes.h)
1566 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1571 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1572 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1573 DSO_LDOPTS='-nostart'
1574 TK_LIBS='-lbe -lroot'
1576 if test "$COMPILE_ENVIRONMENT"; then
1577 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1578 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1580 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1581 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1584 MOZ_USER_DIR="Mozilla"
1588 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1590 _IGNORE_LONG_LONG_WARNINGS=
1598 _WARNINGS_CFLAGS="-Wall"
1599 _WARNINGS_CXXFLAGS="-Wall"
1600 # The test above doesn't work properly, at least on 3.1.
1601 MKSHLIB_FORCE_ALL=''
1602 MKSHLIB_UNFORCE_ALL=''
1608 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1609 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1610 MOZ_OPTIMIZE_FLAGS="-O2"
1612 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1613 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1616 STRIP="$STRIP -x -S"
1617 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1618 MOZ_ENABLE_POSTSCRIPT=
1619 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1620 # set MACOSX to generate lib/mac/MoreFiles/Makefile
1623 dnl check for the presence of the -dead_strip linker flag
1624 AC_MSG_CHECKING([for -dead_strip option to ld])
1625 _SAVE_LDFLAGS=$LDFLAGS
1626 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1627 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1628 if test -n "$_HAVE_DEAD_STRIP" ; then
1629 AC_MSG_RESULT([yes])
1630 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1634 LDFLAGS=$_SAVE_LDFLAGS
1638 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
1639 DLL_SUFFIX=".so.1.0"
1640 DSO_LDOPTS="-shared"
1642 if test ! "$GNU_CC"; then
1643 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1645 # Can't have force w/o an unforce.
1646 # # Hack for FreeBSD 2.2
1647 # if test -z "$MKSHLIB_FORCE_ALL"; then
1648 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1649 # MKSHLIB_UNFORCE_ALL=''
1655 if test ! "$GNU_CC"; then
1656 DSO_LDOPTS='-b -Wl,+s'
1659 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1660 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1661 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1663 DSO_LDOPTS='-b -E +s'
1664 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1665 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1667 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1668 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1673 DSO_LDOPTS='-elf -shared'
1675 if test "$GNU_CC"; then
1676 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1677 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1678 MKSHLIB_FORCE_ALL='-Wl,-all'
1679 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1680 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1682 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1683 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1684 MKSHLIB_FORCE_ALL='-all'
1685 MKSHLIB_UNFORCE_ALL='-none'
1691 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1692 dnl compile and link using -n32
1694 TARGET_COMPILER_ABI=n32
1695 DSO_LDOPTS='-elf -shared'
1696 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1697 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1698 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1699 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1700 if test "$GNU_CC"; then
1701 MKSHLIB_FORCE_ALL='-Wl,-all'
1702 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1703 _WARNINGS_CFLAGS="-Wall"
1704 _WARNINGS_CXXFLAGS="-Wall"
1705 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1707 MKSHLIB_FORCE_ALL='-all'
1708 MKSHLIB_UNFORCE_ALL='-none'
1714 CFLAGS="$CFLAGS -woff 3262 -G 4"
1715 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1716 if test -n "$USE_N32"; then
1717 ASFLAGS="$ASFLAGS -n32"
1718 CFLAGS="$CFLAGS -n32"
1719 CXXFLAGS="$CXXFLAGS -n32"
1720 LDFLAGS="$LDFLAGS -n32"
1722 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1723 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1726 if test -z "$GNU_CXX"; then
1732 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1733 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions"
1734 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1735 # and that combo is not yet good at
1736 # debugging inlined functions (even
1737 # when using DWARF2 as the debugging
1742 case "${target_cpu}" in
1744 CFLAGS="$CFLAGS -mieee"
1745 CXXFLAGS="$CXXFLAGS -mieee"
1749 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1752 CFLAGS="$CFLAGS -Wa,-xgot"
1753 CXXFLAGS="$CXXFLAGS -Wa,-xgot"
1760 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1762 AR_EXTRACT="$AR -extract"
1764 AR_FLAGS='-OUT:"$@"'
1771 # certain versions of cygwin's makedepend barf on the
1772 # #include <string> vs -I./dist/include/string issue so don't use it
1778 HOST_AR='lib -OUT:$@'
1779 HOST_RANLIB='echo ranlib'
1780 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
1783 WARNINGS_AS_ERRORS='-WX'
1784 MOZ_OPTIMIZE_FLAGS='-O1'
1785 AR_FLAGS='-NOLOGO -OUT:"$@"'
1787 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1788 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1791 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
1792 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1794 IMPORT_LIB_SUFFIX=lib
1796 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1799 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1800 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1802 MKSHLIB_UNFORCE_ALL=
1803 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1804 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1805 MOZ_DEBUG_FLAGS='-Zi'
1806 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1808 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1809 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1811 RANLIB='echo not_ranlib'
1812 STRIP='echo not_strip'
1813 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
1816 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1818 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
1819 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
1822 AC_DEFINE(HAVE_SNPRINTF)
1828 AC_DEFINE(HW_THREADS)
1829 AC_DEFINE(STDC_HEADERS)
1830 AC_DEFINE(NEW_H, <new>)
1831 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1833 TARGET_MD_ARCH=win32
1834 _PLATFORM_DEFAULT_TOOLKIT='windows'
1837 MOZ_ENABLE_POSTSCRIPT=
1838 MOZ_USER_DIR="Mozilla"
1842 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1847 # certain versions of cygwin's makedepend barf on the
1848 # #include <string> vs -I./dist/include/string issue so don't use it
1850 if test -n "$GNU_CC"; then
1851 CC="$CC -mno-cygwin"
1852 CXX="$CXX -mno-cygwin"
1853 CPP="$CPP -mno-cygwin"
1854 CFLAGS="$CFLAGS -mms-bitfields"
1855 CXXFLAGS="$CXXFLAGS -mms-bitfields"
1856 DSO_LDOPTS='-shared'
1857 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1858 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1860 # Use temp file for windres (bug 213281)
1861 RCFLAGS='-O coff --use-temp-file'
1862 # mingw doesn't require kernel32, user32, and advapi32 explicitly
1863 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
1864 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
1866 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
1867 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
1869 IMPORT_LIB_SUFFIX=dll.a
1871 TARGET_COMPILER_ABI=msvc
1875 AR='lib -NOLOGO -OUT:"$@"'
1877 RANLIB='echo not_ranlib'
1878 STRIP='echo not_strip'
1883 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1888 IMPORT_LIB_SUFFIX=lib
1889 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1890 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1892 MKSHLIB_UNFORCE_ALL=
1893 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
1894 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1895 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1896 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
1897 MOZ_DEBUG_FLAGS='-Zi'
1898 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1899 WARNINGS_AS_ERRORS='-WX'
1900 MOZ_OPTIMIZE_FLAGS='-O1'
1901 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1903 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1904 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1905 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1906 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1907 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1908 if test $_MSC_VER -ge 1400; then
1909 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
1910 # For profile-guided optimization
1911 PROFILE_GEN_CFLAGS="-GL"
1912 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1913 PROFILE_USE_CFLAGS="-GL"
1914 #XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul
1915 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1918 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
1919 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
1920 AC_DEFINE(HAVE_SNPRINTF)
1926 AC_DEFINE(HW_THREADS)
1927 AC_DEFINE(STDC_HEADERS)
1928 AC_DEFINE(NEW_H, <new>)
1929 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1930 TARGET_MD_ARCH=win32
1931 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
1934 MOZ_ENABLE_POSTSCRIPT=
1935 MOZ_USER_DIR="Mozilla"
1937 dnl Hardcode to win95 for now - cls
1938 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
1940 dnl set NO_X11 defines here as the general check is skipped on win32
1944 dnl MinGW/MSYS doesn't provide or need cygpath
1949 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
1951 *-cygwin*|*-msvc*|*-mks*)
1952 CYGPATH_W="cygpath -a -w"
1953 CYGPATH_S="sed -e s|\\\\|/|g"
1954 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
1958 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1960 if test -z "$MOZ_TOOLS"; then
1961 AC_MSG_ERROR([MOZ_TOOLS is not set])
1964 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
1965 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
1966 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
1968 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
1969 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
1971 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
1973 if test -n "$GLIB_PREFIX"; then
1974 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
1975 if test "$?" = "0"; then
1976 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
1977 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
1979 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
1981 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
1984 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
1986 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
1987 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
1989 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
1990 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
1991 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
1992 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
1993 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
1995 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
1998 if test -n "$LIBIDL_PREFIX"; then
1999 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
2000 if test "$?" = "0"; then
2001 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2002 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2004 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2006 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2009 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2011 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2012 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2014 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2015 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2016 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2018 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2019 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2021 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2023 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2026 *) # else cross-compiling
2027 if test -n "$GLIB_PREFIX"; then
2028 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2029 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2030 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2031 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2032 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2034 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2037 if test -n "$LIBIDL_PREFIX"; then
2038 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2039 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2040 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2042 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2043 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2045 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2048 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2063 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2070 CFLAGS="$CFLAGS -Dunix"
2071 CXXFLAGS="$CXXFLAGS -Dunix"
2072 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2074 DSO_PIC_CFLAGS='-fPIC -DPIC'
2075 DSO_LDOPTS='-shared'
2076 BIN_FLAGS='-Wl,--export-dynamic'
2078 DSO_PIC_CFLAGS='-fPIC -DPIC'
2079 DLL_SUFFIX=".so.1.0"
2080 DSO_LDOPTS='-shared'
2082 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2083 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2084 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2085 if test "$LIBRUNPATH"; then
2086 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2088 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2089 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2094 AC_DEFINE(_QNX_SOURCE)
2097 WARNINGS_AS_ERRORS=''
2098 MOZ_OPTIMIZE_FLAGS="-O"
2099 MOZ_DEBUG_FLAGS="-gstabs"
2102 LIBS="$LIBS -lsocket -lstdc++"
2103 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2104 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2105 if test "$with_x" != "yes"
2107 _PLATFORM_DEFAULT_TOOLKIT="photon"
2108 TK_CFLAGS='-I/usr/include/photon'
2111 case "${target_cpu}" in
2113 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2116 case "${host_cpu}" in
2124 DLL_SUFFIX=".so.1.0"
2126 DSO_PIC_CFLAGS='-fPIC'
2127 DSO_LDOPTS='-shared -fPIC'
2128 if test "$LIBRUNPATH"; then
2129 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2134 AC_DEFINE(NO_PW_GECOS)
2135 AC_DEFINE(NO_UDSOCK)
2136 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2138 MKSHLIB_FORCE_ALL='-all'
2139 MKSHLIB_UNFORCE_ALL='-none'
2141 AS_DASH_C_FLAG='-Wc/names=as_is'
2143 DSO_LDOPTS='-shared -auto_symvec'
2145 MOZ_DEBUG_LDFLAGS='-g'
2147 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2148 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2153 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2154 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2162 IMPORT_LIB_SUFFIX=lib
2165 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2166 MOZ_ENABLE_POSTSCRIPT=
2169 MOZ_USER_DIR="Mozilla"
2171 if test "$MOZTOOLS"; then
2172 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2174 AC_MSG_ERROR([MOZTOOLS is not set])
2178 if test -n "$GNU_CC"; then
2180 AC_DEFINE(XP_OS2_EMX)
2181 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2182 AC_DEFINE(TCPV40HDRS)
2185 CFLAGS="$CFLAGS -Zomf"
2186 CXXFLAGS="$CXXFLAGS -Zomf"
2188 BIN_FLAGS='-Zlinker /ST:0x100000'
2192 WARNINGS_AS_ERRORS='-Werror'
2193 MOZ_DEBUG_FLAGS="-g -fno-inline"
2194 MOZ_OPTIMIZE_FLAGS="-O2"
2195 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2196 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2197 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2198 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2199 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2200 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2201 LDFLAGS="$LDFLAGS -Zhigh-mem"
2202 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2203 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2206 # GCC for OS/2 currently predefines these, but we don't want them
2207 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2208 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2210 AC_CACHE_CHECK(for __declspec(dllexport),
2212 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2214 ac_os2_declspec="yes",
2215 ac_os2_declspec="no")])
2216 if test "$ac_os2_declspec" = "yes"; then
2218 MOZ_OS2_USE_DECLSPEC='1'
2221 # Visual Age C++ build
2222 elif test "$VACPP" = "yes"; then
2223 MOZ_BUILD_ROOT=`pwd -D`
2226 AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
2235 CFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9"
2236 CXXFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9 /Gx+"
2237 MOZ_DEBUG_FLAGS="/Ti+"
2238 WARNINGS_AS_ERRORS='-WX'
2239 MOZ_OPTIMIZE_FLAGS="/O+ /Gl+ /G5 /qarch=pentium"
2241 MOZ_DEBUG_LDFLAGS="/DE"
2242 MOZ_OPTIMIZE_LDFLAGS="/OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
2245 IMPLIB='implib /NOL /NOI'
2246 FILTER='cppfilt -q -B -P'
2247 AC_DEFINE(NO_ANSI_KEYWORDS)
2250 AC_DEFINE(XP_OS2_VACPP)
2251 AC_DEFINE(TCPV40HDRS)
2252 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2253 AC_DEFINE(STDC_HEADERS)
2254 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2255 MKSHLIB='$(LD) $(DSO_LDOPTS)'
2256 MKCSHLIB='$(LD) $(DSO_LDOPTS)'
2257 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
2258 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcomct.lib'
2259 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2260 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2265 if test "$GNU_CC"; then
2266 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2267 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2270 MOZ_DEBUG_FLAGS='-g'
2271 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2272 CFLAGS="$CFLAGS -ieee"
2273 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2274 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2277 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2278 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2279 MKSHLIB_FORCE_ALL='-all'
2280 MKSHLIB_UNFORCE_ALL='-none'
2281 dnl Might fix the libxpcom.so breakage on this platform as well....
2282 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2283 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2285 if test -z "$GNU_CXX"; then
2288 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2292 DIRENT_INO=d_stat.st_ino
2293 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2294 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2295 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2296 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2297 AC_DEFINE(STDC_HEADERS)
2298 if test "$no_x" = "yes"; then
2299 _PLATFORM_DEFAULT_TOOLKIT='photon'
2300 TK_CFLAGS='-I/usr/nto/include/photon'
2301 TK_LIBS='-lphoton -lphrender'
2306 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2307 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2308 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2309 if test ! "$GNU_CC"; then
2314 dnl the qsort routine under solaris is faulty
2317 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2319 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2320 # libraries one level up (e.g. libnspr4.so)
2321 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2322 if test -z "$GNU_CC"; then
2324 MOZ_FIX_LINK_PATHS='-R $(LIBXUL_DIST)/bin'
2325 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2326 CFLAGS="$CFLAGS -xstrconst -xbuiltin=%all"
2327 CXXFLAGS="$CXXFLAGS -xbuiltin=%all -features=tmplife -norunpath"
2328 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2329 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2330 _SAVE_LDFLAGS=$LDFLAGS
2331 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2332 AC_TRY_LINK([#include <stdio.h>],
2333 [printf("Hello World\n");],
2335 [LDFLAGS=$_SAVE_LDFLAGS])
2337 WARNINGS_AS_ERRORS='-Werror'
2338 MOZ_OPTIMIZE_FLAGS="-xO4"
2339 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2340 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2341 MKSHLIB_FORCE_ALL='-z allextract'
2342 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2343 DSO_LDOPTS='-G -z muldefs'
2349 AS='/usr/ccs/bin/as'
2350 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2352 TARGET_COMPILER_ABI="sunc"
2353 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2354 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2355 AC_MSG_CHECKING([for Forte compiler version >= WS6U2])
2359 [#if (__SUNPRO_CC < 0x530)
2362 _BAD_COMPILER=,_BAD_COMPILER=1)
2363 if test -n "$_BAD_COMPILER"; then
2365 AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .])
2369 AC_MSG_RESULT([$_res])
2372 ASFLAGS="$ASFLAGS -fPIC"
2375 _WARNINGS_CXXFLAGS=''
2376 if test "$OS_RELEASE" = "5.3"; then
2377 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2380 if test "$OS_RELEASE" = "5.5.1"; then
2381 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2386 DSO_LDOPTS='-Bdynamic'
2387 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2388 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2390 AC_DEFINE(SPRINTF_RETURNS_STRING)
2391 case "$(target_os)" in
2393 DLL_SUFFIX='.so.1.0'
2399 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2403 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2408 dnl Only one oddball right now (QNX), but this gives us flexibility
2409 dnl if any other platforms need to override this in the future.
2410 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2412 dnl ========================================================
2413 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2414 dnl by now will not have any way to link most binaries (tests
2415 dnl as well as viewer, apprunner, etc.), because some symbols
2416 dnl will be left out of the "composite" .so's by ld as unneeded.
2417 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2418 dnl they can link in the static libs that provide the missing
2420 dnl ========================================================
2421 NO_LD_ARCHIVE_FLAGS=
2422 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2423 NO_LD_ARCHIVE_FLAGS=1
2427 NO_LD_ARCHIVE_FLAGS=
2430 NO_LD_ARCHIVE_FLAGS=
2433 NO_LD_ARCHIVE_FLAGS=
2435 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2436 if test -z "$GNU_CC"; then
2437 NO_LD_ARCHIVE_FLAGS=
2441 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2444 dnl Indicate that platform requires special thread safe
2445 dnl locking when starting up the OJI JVM
2446 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2447 dnl ========================================================
2450 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2454 dnl ========================================================
2455 dnl = Flags to strip unused symbols from .so components
2456 dnl ========================================================
2459 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2462 if test -z "$GNU_CC"; then
2463 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2465 if test -z "$GCC_USE_GNU_LD"; then
2466 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2468 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2473 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2476 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2478 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2479 if test -n "$GNU_CC"; then
2480 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2485 if test -z "$COMPILE_ENVIRONMENT"; then
2486 SKIP_COMPILER_CHECKS=1
2487 SKIP_LIBRARY_CHECKS=1
2490 if test -z "$SKIP_COMPILER_CHECKS"; then
2491 dnl Checks for typedefs, structures, and compiler characteristics.
2492 dnl ========================================================
2500 AC_STRUCT_ST_BLKSIZE
2501 AC_MSG_CHECKING(for siginfo_t)
2502 AC_CACHE_VAL(ac_cv_siginfo_t,
2503 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2504 #include <signal.h>],
2506 [ac_cv_siginfo_t=true],
2507 [ac_cv_siginfo_t=false])])
2508 if test "$ac_cv_siginfo_t" = true ; then
2509 AC_DEFINE(HAVE_SIGINFO_T)
2515 dnl Visual Age for os/2 also defines size_t and off_t in certain
2516 dnl header files. These defines make Visual Age use the mozilla
2518 if test "$VACPP" = "yes"; then
2523 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2524 dnl ========================================================
2525 AC_MSG_CHECKING(for int16_t)
2526 AC_CACHE_VAL(ac_cv_int16_t,
2527 [AC_TRY_COMPILE([#include <stdio.h>
2528 #include <sys/types.h>],
2530 [ac_cv_int16_t=true],
2531 [ac_cv_int16_t=false])])
2532 if test "$ac_cv_int16_t" = true ; then
2533 AC_DEFINE(HAVE_INT16_T)
2538 AC_MSG_CHECKING(for int32_t)
2539 AC_CACHE_VAL(ac_cv_int32_t,
2540 [AC_TRY_COMPILE([#include <stdio.h>
2541 #include <sys/types.h>],
2543 [ac_cv_int32_t=true],
2544 [ac_cv_int32_t=false])])
2545 if test "$ac_cv_int32_t" = true ; then
2546 AC_DEFINE(HAVE_INT32_T)
2551 AC_MSG_CHECKING(for int64_t)
2552 AC_CACHE_VAL(ac_cv_int64_t,
2553 [AC_TRY_COMPILE([#include <stdio.h>
2554 #include <sys/types.h>],
2556 [ac_cv_int64_t=true],
2557 [ac_cv_int64_t=false])])
2558 if test "$ac_cv_int64_t" = true ; then
2559 AC_DEFINE(HAVE_INT64_T)
2564 AC_MSG_CHECKING(for int64)
2565 AC_CACHE_VAL(ac_cv_int64,
2566 [AC_TRY_COMPILE([#include <stdio.h>
2567 #include <sys/types.h>],
2570 [ac_cv_int64=false])])
2571 if test "$ac_cv_int64" = true ; then
2572 AC_DEFINE(HAVE_INT64)
2577 AC_MSG_CHECKING(for uint)
2578 AC_CACHE_VAL(ac_cv_uint,
2579 [AC_TRY_COMPILE([#include <stdio.h>
2580 #include <sys/types.h>],
2583 [ac_cv_uint=false])])
2584 if test "$ac_cv_uint" = true ; then
2585 AC_DEFINE(HAVE_UINT)
2590 AC_MSG_CHECKING(for uint_t)
2591 AC_CACHE_VAL(ac_cv_uint_t,
2592 [AC_TRY_COMPILE([#include <stdio.h>
2593 #include <sys/types.h>],
2595 [ac_cv_uint_t=true],
2596 [ac_cv_uint_t=false])])
2597 if test "$ac_cv_uint_t" = true ; then
2598 AC_DEFINE(HAVE_UINT_T)
2603 AC_MSG_CHECKING(for uint16_t)
2604 AC_CACHE_VAL(ac_cv_uint16_t,
2605 [AC_TRY_COMPILE([#include <stdio.h>
2606 #include <sys/types.h>],
2607 [uint16_t foo = 0;],
2608 [ac_cv_uint16_t=true],
2609 [ac_cv_uint16_t=false])])
2610 if test "$ac_cv_uint16_t" = true ; then
2611 AC_DEFINE(HAVE_UINT16_T)
2617 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2618 dnl are defined when compiling C++ but not C. Since the result of this
2619 dnl test is used only in C++, do it in C++.
2622 AC_MSG_CHECKING(for uname.domainname)
2623 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2624 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2625 [ struct utsname *res; char *domain;
2626 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2627 [ac_cv_have_uname_domainname_field=true],
2628 [ac_cv_have_uname_domainname_field=false])])
2630 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2631 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2637 AC_MSG_CHECKING(for uname.__domainname)
2638 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2639 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2640 [ struct utsname *res; char *domain;
2641 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2642 [ac_cv_have_uname_us_domainname_field=true],
2643 [ac_cv_have_uname_us_domainname_field=false])])
2645 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2646 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2654 dnl Check for usable wchar_t (2 bytes, unsigned)
2655 dnl (we really don't need the unsignedness check anymore)
2656 dnl ========================================================
2658 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2659 ac_cv_have_usable_wchar_v2,
2660 [AC_TRY_COMPILE([#include <stddef.h>
2661 $configure_static_assert_macros],
2662 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2663 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2664 ac_cv_have_usable_wchar_v2="yes",
2665 ac_cv_have_usable_wchar_v2="no")])
2666 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2667 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2668 HAVE_CPP_2BYTE_WCHAR_T=1
2670 dnl This is really gcc-only
2671 dnl Do this test using CXX only since some versions of gcc
2672 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2673 dnl only have short-wchar support for c++.
2674 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2678 _SAVE_CXXFLAGS=$CXXFLAGS
2679 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2681 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2682 ac_cv_have_usable_wchar_option_v2,
2683 [AC_TRY_COMPILE([#include <stddef.h>
2684 $configure_static_assert_macros],
2685 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2686 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2687 ac_cv_have_usable_wchar_option_v2="yes",
2688 ac_cv_have_usable_wchar_option_v2="no")])
2690 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2691 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2692 HAVE_CPP_2BYTE_WCHAR_T=1
2694 CXXFLAGS=$_SAVE_CXXFLAGS
2699 dnl Check for .hidden assembler directive and visibility attribute.
2700 dnl Borrowed from glibc configure.in
2701 dnl ===============================================================
2702 if test "$GNU_CC"; then
2703 AC_CACHE_CHECK(for visibility(hidden) attribute,
2704 ac_cv_visibility_hidden,
2705 [cat > conftest.c <<EOF
2706 int foo __attribute__ ((visibility ("hidden"))) = 1;
2708 ac_cv_visibility_hidden=no
2709 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2710 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2711 ac_cv_visibility_hidden=yes
2716 if test "$ac_cv_visibility_hidden" = "yes"; then
2717 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2719 AC_CACHE_CHECK(for visibility(default) attribute,
2720 ac_cv_visibility_default,
2721 [cat > conftest.c <<EOF
2722 int foo __attribute__ ((visibility ("default"))) = 1;
2724 ac_cv_visibility_default=no
2725 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2726 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2727 ac_cv_visibility_default=yes
2732 if test "$ac_cv_visibility_default" = "yes"; then
2733 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2735 AC_CACHE_CHECK(for visibility pragma support,
2736 ac_cv_visibility_pragma,
2737 [cat > conftest.c <<EOF
2738 #pragma GCC visibility push(hidden)
2740 #pragma GCC visibility push(default)
2741 int foo_default = 1;
2743 ac_cv_visibility_pragma=no
2744 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2745 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2746 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2747 ac_cv_visibility_pragma=yes
2753 if test "$ac_cv_visibility_pragma" = "yes"; then
2754 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2755 ac_cv_have_visibility_class_bug,
2756 [cat > conftest.c <<EOF
2757 #pragma GCC visibility push(hidden)
2758 struct __attribute__ ((visibility ("default"))) TestStruct {
2761 __attribute__ ((visibility ("default"))) void TestFunc() {
2765 ac_cv_have_visibility_class_bug=no
2766 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2767 ac_cv_have_visibility_class_bug=yes
2769 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2770 ac_cv_have_visibility_class_bug=yes
2773 rm -rf conftest.{c,S}
2776 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2777 ac_cv_have_visibility_builtin_bug,
2778 [cat > conftest.c <<EOF
2779 #pragma GCC visibility push(hidden)
2780 #pragma GCC visibility push(default)
2782 #pragma GCC visibility pop
2784 __attribute__ ((visibility ("default"))) void Func() {
2786 memset(c, 0, sizeof(c));
2789 ac_cv_have_visibility_builtin_bug=no
2790 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2791 ac_cv_have_visibility_builtin_bug=yes
2793 if test `grep -c "@PLT" conftest.S` = 0; then
2794 ac_cv_visibility_builtin_bug=yes
2797 rm -f conftest.{c,S}
2799 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2800 "$ac_cv_have_visibility_class_bug" = "no"; then
2801 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2802 WRAP_SYSTEM_INCLUDES=1
2804 VISIBILITY_FLAGS='-fvisibility=hidden'
2805 fi # have visibility pragma bug
2806 fi # have visibility pragma
2807 fi # have visibility(default) attribute
2808 fi # have visibility(hidden) attribute
2811 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2812 AC_SUBST(VISIBILITY_FLAGS)
2814 dnl Checks for header files.
2815 dnl ========================================================
2817 case "$target_os" in
2819 # for stuff like -lXshm
2820 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2823 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
2824 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
2825 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
2826 AC_CHECK_HEADERS(malloc.h)
2827 AC_CHECK_HEADERS(X11/XKBlib.h)
2829 dnl These are all the places some variant of statfs can be hiding.
2830 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2832 dnl Try for MMX support
2833 dnl NB - later gcc versions require -mmmx for this header to be successfully
2834 dnl included (or another option which implies it, such as -march=pentium-mmx)
2835 AC_CHECK_HEADERS(mmintrin.h)
2837 dnl Check whether the compiler supports the new-style C++ standard
2838 dnl library headers (i.e. <new>) or needs the old "new.h"
2841 AC_CHECK_HEADER(new, [NEW_H=new])
2842 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2845 AC_ARG_ENABLE(dtrace,
2846 [ --enable-dtrace build with dtrace support if available (default=no)],
2847 [enable_dtrace="yes"],)
2848 if test "x$enable_dtrace" = "xyes"; then
2849 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2850 if test -n "$HAVE_DTRACE"; then
2851 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
2853 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
2856 AC_SUBST(HAVE_DTRACE)
2862 AC_CHECK_HEADERS(sys/cdefs.h)
2866 dnl Checks for libraries.
2867 dnl ========================================================
2872 AC_CHECK_LIB(c_r, gethostbyname_r)
2876 dnl We don't want to link with libdl even if it's present on OS X, since
2877 dnl it's not used and not part of the default installation.
2878 dnl The same goes for BeOS.
2879 dnl We don't want to link against libm or libpthread on Darwin since
2880 dnl they both are just symlinks to libSystem and explicitly linking
2881 dnl against libSystem causes issues when debugging (see bug 299601).
2888 AC_CHECK_LIB(m, atan)
2889 AC_CHECK_LIB(dl, dlopen,
2890 AC_CHECK_HEADER(dlfcn.h,
2892 AC_DEFINE(HAVE_LIBDL)))
2896 _SAVE_CFLAGS="$CFLAGS"
2897 CFLAGS="$CFLAGS -D_GNU_SOURCE"
2898 AC_CHECK_FUNCS(dladdr)
2899 CFLAGS="$_SAVE_CFLAGS"
2901 if test ! "$GNU_CXX"; then
2905 AC_CHECK_LIB(C_r, demangle)
2908 AC_CHECK_LIB(C, demangle)
2912 AC_CHECK_LIB(socket, socket)
2915 XLIBS="$X_EXTRA_LIBS"
2917 dnl ========================================================
2918 dnl Checks for X libraries.
2919 dnl Ordering is important.
2920 dnl Xt is dependent upon SM as of X11R6
2921 dnl ========================================================
2922 if test "$no_x" = "yes"; then
2925 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
2926 XLIBS="-lX11 $XLIBS"
2927 _SAVE_LDFLAGS="$LDFLAGS"
2928 LDFLAGS="$XLDFLAGS $LDFLAGS"
2929 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
2930 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
2931 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
2932 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
2935 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
2936 unset ac_cv_lib_Xt_XtFree
2937 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
2938 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
2939 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
2940 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
2943 # AIX needs the motif library linked before libXt to prevent
2944 # crashes in plugins linked against Motif - Bug #98892
2945 case "${target_os}" in
2947 XT_LIBS="-lXm $XT_LIBS"
2951 dnl ========================================================
2952 dnl = Check for XShm
2953 dnl ========================================================
2954 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
2956 AC_CHECK_HEADER(X11/extensions/XShm.h)
2957 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
2958 test -n "$_HAVE_XSHM_XEXT"; then
2959 AC_DEFINE(HAVE_XSHM)
2962 dnl ========================================================
2964 dnl ========================================================
2965 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
2967 AC_CHECK_HEADER(X11/extensions/XIElib.h)
2969 if test "$MOZ_XIE_LIBS"; then
2970 dnl ====================================================
2971 dnl = If XIE is present and is desired, turn it on
2972 dnl ====================================================
2982 LDFLAGS="$_SAVE_LDFLAGS"
2984 dnl ========================================================
2985 dnl = Check for freetype2 and its functionality
2986 dnl ========================================================
2987 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
2989 if test "$_HAVE_FREETYPE2"; then
2991 _SAVE_CFLAGS="$CFLAGS"
2992 LIBS="$LIBS $FT2_LIBS"
2993 CFLAGS="$CFLAGS $FT2_CFLAGS"
2995 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
2996 ac_cv_member_FT_Bitmap_Size_y_ppem,
2997 [AC_TRY_COMPILE([#include <ft2build.h>
2998 #include FT_FREETYPE_H],
3000 if (sizeof s.y_ppem) return 0;
3002 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3003 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3004 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3005 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3007 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3009 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3010 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3011 [FT_Bitmap_Size structure includes y_ppem field])
3013 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3016 CFLAGS="$_SAVE_CFLAGS"
3026 dnl ========================================================
3027 dnl = pthread support
3028 dnl = Start by checking whether the system support pthreads
3029 dnl ========================================================
3030 case "$target_os" in
3035 MOZ_CHECK_PTHREADS(pthreads,
3036 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3037 MOZ_CHECK_PTHREADS(pthread,
3038 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3039 MOZ_CHECK_PTHREADS(c_r,
3040 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3041 MOZ_CHECK_PTHREADS(c,
3050 dnl ========================================================
3051 dnl Check the command line for --with-pthreads
3052 dnl ========================================================
3053 MOZ_ARG_WITH_BOOL(pthreads,
3054 [ --with-pthreads Force use of system pthread library with NSPR ],
3055 [ if test "$USE_PTHREADS"x = x; then
3056 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3062 dnl ========================================================
3063 dnl Do the platform specific pthread hackery
3064 dnl ========================================================
3065 if test "$USE_PTHREADS"x != x
3068 dnl See if -pthread is supported.
3071 ac_cv_have_dash_pthread=no
3072 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3073 echo 'int main() { return 0; }' | cat > conftest.c
3074 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3075 if test $? -eq 0; then
3076 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3077 ac_cv_have_dash_pthread=yes
3078 case "$target_os" in
3080 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3083 CFLAGS="$CFLAGS -pthread"
3084 CXXFLAGS="$CXXFLAGS -pthread"
3090 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3093 dnl See if -pthreads is supported.
3095 ac_cv_have_dash_pthreads=no
3096 if test "$ac_cv_have_dash_pthread" = "no"; then
3097 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3098 echo 'int main() { return 0; }' | cat > conftest.c
3099 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3100 if test $? -eq 0; then
3101 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3102 ac_cv_have_dash_pthreads=yes
3103 CFLAGS="$CFLAGS -pthreads"
3104 CXXFLAGS="$CXXFLAGS -pthreads"
3108 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3113 AC_DEFINE(_REENTRANT)
3114 AC_DEFINE(_THREAD_SAFE)
3115 dnl -pthread links in -lc_r, so don't specify it explicitly.
3116 if test "$ac_cv_have_dash_pthread" = "yes"; then
3117 _PTHREAD_LDFLAGS="-pthread"
3119 _PTHREAD_LDFLAGS="-lc_r"
3123 *-*-openbsd*|*-*-bsdi*)
3124 AC_DEFINE(_REENTRANT)
3125 AC_DEFINE(_THREAD_SAFE)
3126 dnl -pthread links in -lc_r, so don't specify it explicitly.
3127 if test "$ac_cv_have_dash_pthread" = "yes"; then
3128 _PTHREAD_LDFLAGS="-pthread"
3133 AC_DEFINE(_REENTRANT)
3137 AC_DEFINE(_REENTRANT)
3141 AC_DEFINE(_REENTRANT)
3145 AC_DEFINE(_REENTRANT)
3149 AC_DEFINE(_REENTRANT)
3153 AC_DEFINE(_REENTRANT)
3154 if test ! "$GNU_CC"; then
3155 CFLAGS="$CFLAGS -mt"
3156 CXXFLAGS="$CXXFLAGS -mt"
3160 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3163 dnl ========================================================
3164 dnl See if mmap sees writes
3165 dnl For cross compiling, just define it as no, which is a safe default
3166 dnl ========================================================
3167 AC_MSG_CHECKING(whether mmap() sees write()s)
3173 #include <sys/mman.h>
3174 #include <sys/types.h>
3175 #include <sys/stat.h>
3178 char fname[] = "conftest.file";
3179 char zbuff[1024]; /* Fractional page is probably worst case */
3186 fd = open(fname, O_RDWR | O_CREAT, 0660);
3189 write(fd, zbuff, sizeof(zbuff));
3190 lseek(fd, 0, SEEK_SET);
3191 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3192 if(map==(char*)-1) return 2;
3193 for(i=0; fname[i]; i++) {
3194 int rc = write(fd, &fname[i], 1);
3195 if(map[i]!=fname[i]) return 4;
3202 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3204 AC_MSG_RESULT("$result")
3206 if test "$result" = "no"; then
3207 AC_DEFINE(MMAP_MISSES_WRITES)
3211 dnl Checks for library functions.
3212 dnl ========================================================
3213 AC_PROG_GCC_TRADITIONAL
3215 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64)
3216 AC_CHECK_FUNCS(flockfile getpagesize)
3218 dnl localtime_r and strtok_r are only present on MacOS version 10.2 and higher
3219 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100200"; then
3220 AC_CHECK_FUNCS(localtime_r strtok_r)
3223 dnl check for wcrtomb/mbrtowc
3224 dnl =======================================================================
3225 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3228 AC_CACHE_CHECK(for wcrtomb,
3230 [AC_TRY_LINK([#include <wchar.h>],
3231 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3232 ac_cv_have_wcrtomb="yes",
3233 ac_cv_have_wcrtomb="no")])
3234 if test "$ac_cv_have_wcrtomb" = "yes"; then
3235 AC_DEFINE(HAVE_WCRTOMB)
3237 AC_CACHE_CHECK(for mbrtowc,
3239 [AC_TRY_LINK([#include <wchar.h>],
3240 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3241 ac_cv_have_mbrtowc="yes",
3242 ac_cv_have_mbrtowc="no")])
3243 if test "$ac_cv_have_mbrtowc" = "yes"; then
3244 AC_DEFINE(HAVE_MBRTOWC)
3251 ac_cv_func_res_ninit,
3254 #define _BSD_SOURCE 1
3258 [int foo = res_ninit(&_res);],
3259 [ac_cv_func_res_ninit=yes],
3260 [ac_cv_func_res_ninit=no])
3263 if test "$ac_cv_func_res_ninit" = "yes"; then
3264 AC_DEFINE(HAVE_RES_NINIT)
3265 dnl must add the link line we do something as foolish as this... dougt
3267 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3268 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3273 [for gnu_get_libc_version()],
3274 ac_cv_func_gnu_get_libc_version,
3276 #ifdef HAVE_GNU_LIBC_VERSION_H
3277 #include <gnu/libc-version.h>
3280 [const char *glibc_version = gnu_get_libc_version();],
3281 [ac_cv_func_gnu_get_libc_version=yes],
3282 [ac_cv_func_gnu_get_libc_version=no]
3286 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3287 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3291 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3295 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3296 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3297 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3299 LIBS="$LIBS $_ICONV_LIBS"
3308 iconv_t h = iconv_open("", "");
3309 iconv(h, NULL, NULL, NULL, NULL);
3312 [ac_cv_func_iconv=yes],
3313 [ac_cv_func_iconv=no]
3316 if test "$ac_cv_func_iconv" = "yes"; then
3317 AC_DEFINE(HAVE_ICONV)
3318 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3319 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3320 LIBICONV="$_ICONV_LIBS"
3322 [for iconv() with const input],
3323 ac_cv_func_const_iconv,
3329 const char *input = "testing";
3330 iconv_t h = iconv_open("", "");
3331 iconv(h, &input, NULL, NULL, NULL);
3334 [ac_cv_func_const_iconv=yes],
3335 [ac_cv_func_const_iconv=no]
3338 if test "$ac_cv_func_const_iconv" = "yes"; then
3339 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3351 dnl **********************
3352 dnl *** va_copy checks ***
3353 dnl **********************
3354 dnl we currently check for all three va_copy possibilities, so we get
3355 dnl all results in config.log for bug reports.
3356 AC_MSG_CHECKING(for an implementation of va_copy())
3357 AC_CACHE_VAL(ac_cv_va_copy,[
3360 void f (int i, ...) {
3361 va_list args1, args2;
3362 va_start (args1, i);
3363 va_copy (args2, args1);
3364 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3366 va_end (args1); va_end (args2);
3368 int main() { f (0, 42); return 0; }],
3374 AC_MSG_RESULT($ac_cv_va_copy)
3375 AC_MSG_CHECKING(for an implementation of __va_copy())
3376 AC_CACHE_VAL(ac_cv___va_copy,[
3379 void f (int i, ...) {
3380 va_list args1, args2;
3381 va_start (args1, i);
3382 __va_copy (args2, args1);
3383 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3385 va_end (args1); va_end (args2);
3387 int main() { f (0, 42); return 0; }],
3388 ac_cv___va_copy=yes,
3393 AC_MSG_RESULT($ac_cv___va_copy)
3394 AC_MSG_CHECKING(whether va_lists can be copied by value)
3395 AC_CACHE_VAL(ac_cv_va_val_copy,[
3398 void f (int i, ...) {
3399 va_list args1, args2;
3400 va_start (args1, i);
3402 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3404 va_end (args1); va_end (args2);
3406 int main() { f (0, 42); return 0; }],
3407 ac_cv_va_val_copy=yes,
3408 ac_cv_va_val_copy=no,
3409 ac_cv_va_val_copy=yes
3412 if test "x$ac_cv_va_copy" = "xyes"; then
3413 AC_DEFINE(VA_COPY, va_copy)
3414 AC_DEFINE(HAVE_VA_COPY)
3415 elif test "x$ac_cv___va_copy" = "xyes"; then
3416 AC_DEFINE(VA_COPY, __va_copy)
3417 AC_DEFINE(HAVE_VA_COPY)
3420 if test "x$ac_cv_va_val_copy" = "xno"; then
3421 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3423 AC_MSG_RESULT($ac_cv_va_val_copy)
3425 dnl Check for dll-challenged libc's.
3426 dnl This check is apparently only needed for Linux.
3429 dnl ===================================================================
3432 rm -rf conftest* _conftest
3434 cat >> conftest.C <<\EOF
3439 void __dump_link_map(void) {
3440 struct link_map *map = _dl_loaded;
3441 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3444 dlopen("./conftest1.so",RTLD_LAZY);
3445 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3446 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3447 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3451 /* _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).*/
3452 int main() { printf("./conftest1.so\n"); }
3456 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3458 cat >> conftest1.C <<\EOF
3460 void foo(void) {printf("foo in dll called\n");}
3462 ${CXX-g++} -fPIC -c -g conftest1.C
3463 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3464 ${CXX-g++} -g conftest.C -o conftest -ldl
3465 cp -f conftest1.so conftest _conftest
3467 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3470 echo "*** Your libc has a bug that can result in loading the same dynamic"
3471 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3472 echo "*** or later. However, if you choose not to upgrade, the only effect"
3473 echo "*** will be excessive memory usage at runtime."
3477 rm -rf conftest* _conftest
3478 dnl ===================================================================
3482 dnl ===================================================================
3483 dnl ========================================================
3484 dnl By default, turn rtti and exceptions off on g++/egcs
3485 dnl ========================================================
3486 if test "$GNU_CXX"; then
3488 AC_MSG_CHECKING(for C++ exceptions flag)
3490 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3491 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3492 [echo "int main() { return 0; }" | cat > conftest.C
3494 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3496 if egrep "warning.*renamed" conftest.out >/dev/null; then
3497 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3499 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3504 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3505 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3506 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3509 dnl ========================================================
3510 dnl Put your C++ language/feature checks below
3511 dnl ========================================================
3515 if test "$GNU_CC"; then
3516 AC_CACHE_CHECK(for gcc 3.0 ABI,
3517 ac_cv_gcc_three_abi,
3520 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3526 ac_cv_gcc_three_abi="yes",
3527 ac_cv_gcc_three_abi="no")])
3528 if test "$ac_cv_gcc_three_abi" = "yes"; then
3529 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3532 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3535 AC_SUBST(HAVE_GCC3_ABI)
3538 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3540 [AC_TRY_COMPILE(class X {
3541 public: explicit X(int i) : i_(i) {}
3545 ac_cv_cpp_explicit=yes,
3546 ac_cv_cpp_explicit=no)])
3547 if test "$ac_cv_cpp_explicit" = yes ; then
3548 AC_DEFINE(HAVE_CPP_EXPLICIT)
3551 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3553 [AC_TRY_COMPILE(class param {
3555 typedef unsigned long num_type;
3558 template <class T> class tplt {
3560 typedef typename T::num_type t_num_type;
3561 t_num_type foo(typename T::num_type num) {
3567 ac_cv_cpp_typename=yes,
3568 ac_cv_cpp_typename=no)])
3569 if test "$ac_cv_cpp_typename" = yes ; then
3570 AC_DEFINE(HAVE_CPP_TYPENAME)
3573 dnl Check for support of modern template specialization syntax
3574 dnl Test code and requirement from scc@netscape.com.
3575 dnl Autoconf cut-and-paste job by waterson@netscape.com
3576 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3577 ac_cv_cpp_modern_specialize_template_syntax,
3578 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3580 template <> struct X<Y> { double a; };,
3583 ac_cv_cpp_modern_specialize_template_syntax=yes,
3584 ac_cv_cpp_modern_specialize_template_syntax=no)])
3585 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3586 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3590 dnl Some compilers support only full specialization, and some don't.
3591 AC_CACHE_CHECK(whether partial template specialization works,
3592 ac_cv_cpp_partial_specialization,
3593 [AC_TRY_COMPILE(template <class T> class Foo {};
3594 template <class T> class Foo<T*> {};,
3596 ac_cv_cpp_partial_specialization=yes,
3597 ac_cv_cpp_partial_specialization=no)])
3598 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3599 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3602 dnl Some compilers have limited support for operators with templates;
3603 dnl specifically, it is necessary to define derived operators when a base
3604 dnl class's operator declaration should suffice.
3605 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3606 ac_cv_need_derived_template_operators,
3607 [AC_TRY_COMPILE([template <class T> class Base { };
3609 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3610 template <class T> class Derived : public Base<T> { };],
3611 [Derived<char> a, b;
3612 Base<char> c = a + b;
3614 ac_cv_need_derived_template_operators=no,
3615 ac_cv_need_derived_template_operators=yes)])
3616 if test "$ac_cv_need_derived_template_operators" = yes ; then
3617 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3621 dnl Some compilers have trouble detecting that a template class
3622 dnl that derives from another template is actually an instance
3623 dnl of the base class. This test checks for that.
3624 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3625 ac_cv_need_cpp_template_cast_to_base,
3626 [AC_TRY_COMPILE([template <class T> class Base { };
3627 template <class T> class Derived : public Base<T> { };
3628 template <class T> int foo(const Base<T>&) { return 0; }],
3629 [Derived<char> bar; return foo(bar);],
3630 ac_cv_need_cpp_template_cast_to_base=no,
3631 ac_cv_need_cpp_template_cast_to_base=yes)])
3632 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3633 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3636 dnl Some compilers have trouble resolving the ambiguity between two
3637 dnl functions whose arguments differ only by cv-qualifications.
3638 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3639 ac_cv_can_resolve_const_ambiguity,
3641 template <class T> class ptrClass {
3645 template <class T> T* a(ptrClass<T> *arg) {
3650 const T* a(const ptrClass<T> *arg) {
3656 ac_cv_can_resolve_const_ambiguity=yes,
3657 ac_cv_can_resolve_const_ambiguity=no)])
3658 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3659 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3663 dnl We don't do exceptions on unix. The only reason this used to be here
3664 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3665 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3666 dnl So im commenting this out until someone writes some artificial
3667 dnl intelligence to detect not only if the compiler has exceptions, but if
3668 dnl they are enabled as well.
3670 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3671 dnl ac_cv_cpp_exceptions,
3672 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3673 dnl static void F() { throw X(); },
3674 dnl try { F(); } catch(X & e) { },
3675 dnl ac_cv_cpp_exceptions=yes,
3676 dnl ac_cv_cpp_exceptions=no)])
3677 dnl if test $ac_cv_cpp_exceptions = yes ; then
3678 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3681 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3682 dnl supports it well enough to allow us to use it to change access, but not
3683 dnl to resolve ambiguity. The next two tests determine how well the |using|
3684 dnl keyword is supported.
3686 dnl Check to see if we can change access with |using|. Test both a
3687 dnl legal and an illegal example.
3688 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3689 ac_cv_cpp_access_changing_using2,
3691 class A { protected: int foo() { return 0; } };
3692 class B : public A { public: using A::foo; };,
3693 B b; return b.foo();,
3695 class A { public: int foo() { return 1; } };
3696 class B : public A { private: using A::foo; };,
3697 B b; return b.foo();,
3698 ac_cv_cpp_access_changing_using2=no,
3699 ac_cv_cpp_access_changing_using2=yes)],
3700 ac_cv_cpp_access_changing_using2=no)])
3701 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3702 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3705 dnl Check to see if we can resolve ambiguity with |using|.
3706 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3707 ac_cv_cpp_ambiguity_resolving_using,
3708 [AC_TRY_COMPILE(class X {
3709 public: int go(const X&) {return 3;}
3710 int jo(const X&) {return 3;}
3712 class Y : public X {
3713 public: int go(int) {return 2;}
3714 int jo(int) {return 2;}
3716 private: using X::go;
3719 ac_cv_cpp_ambiguity_resolving_using=yes,
3720 ac_cv_cpp_ambiguity_resolving_using=no)])
3721 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3722 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3725 dnl Check to see if the |std| namespace is supported. If so, we'll want
3726 dnl to qualify any standard library calls with "std::" to ensure that
3727 dnl those functions can be resolved.
3728 AC_CACHE_CHECK(for \"std::\" namespace,
3729 ac_cv_cpp_namespace_std,
3730 [AC_TRY_COMPILE([#include <algorithm>],
3731 [return std::min(0, 1);],
3732 ac_cv_cpp_namespace_std=yes,
3733 ac_cv_cpp_namespace_std=no)])
3734 if test "$ac_cv_cpp_namespace_std" = yes ; then
3735 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3738 dnl Older compilers are overly ambitious with respect to using the standard
3739 dnl template library's |operator!=()| when |operator==()| is defined. In
3740 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3741 dnl ambiguity at compile-time. This test checks for that case.
3742 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3743 ac_cv_cpp_unambiguous_std_notequal,
3744 [AC_TRY_COMPILE([#include <algorithm>
3746 int operator==(const T1&, const T1&) { return 0; }
3747 int operator!=(const T1&, const T1&) { return 0; }],
3748 [T1 a,b; return a != b;],
3749 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3750 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3751 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3752 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
3756 AC_CACHE_CHECK(for C++ reinterpret_cast,
3757 ac_cv_cpp_reinterpret_cast,
3758 [AC_TRY_COMPILE(struct X { int i; };
3759 struct Y { int i; };,
3760 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
3761 ac_cv_cpp_reinterpret_cast=yes,
3762 ac_cv_cpp_reinterpret_cast=no)])
3763 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
3764 AC_DEFINE(HAVE_CPP_NEW_CASTS)
3767 dnl See if a dynamic_cast to void* gives the most derived object.
3768 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3769 ac_cv_cpp_dynamic_cast_void_ptr,
3770 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3771 class Y { int j; public: virtual ~Y() { } };
3772 class Z : public X, public Y { int k; };
3778 return !((((void*)&mdo != (void*)subx) &&
3779 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3780 (((void*)&mdo != (void*)suby) &&
3781 ((void*)&mdo == dynamic_cast<void*>(suby))));
3783 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3784 ac_cv_cpp_dynamic_cast_void_ptr=no,
3785 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3786 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3787 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3791 dnl note that this one is reversed - if the test fails, then
3792 dnl we require implementations of unused virtual methods. Which
3793 dnl really blows because it means we'll have useless vtable
3795 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3796 ac_cv_cpp_unused_required,
3797 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3799 ac_cv_cpp_unused_required=no,
3800 ac_cv_cpp_unused_required=yes)])
3801 if test "$ac_cv_cpp_unused_required" = yes ; then
3802 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3806 dnl Some compilers have trouble comparing a constant reference to a templatized
3807 dnl class to zero, and require an explicit operator==() to be defined that takes
3808 dnl an int. This test separates the strong from the weak.
3810 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3811 ac_cv_trouble_comparing_to_zero,
3812 [AC_TRY_COMPILE([#include <algorithm>
3813 template <class T> class Foo {};
3815 template <class T> int operator==(const T2*, const T&) { return 0; }
3816 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3817 [Foo<int> f; return (0 != f);],
3818 ac_cv_trouble_comparing_to_zero=no,
3819 ac_cv_trouble_comparing_to_zero=yes)])
3820 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3821 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3826 dnl End of C++ language/feature checks
3829 dnl ========================================================
3830 dnl = Internationalization checks
3831 dnl ========================================================
3833 dnl Internationalization and Locale support is different
3834 dnl on various UNIX platforms. Checks for specific i18n
3835 dnl features go here.
3837 dnl check for LC_MESSAGES
3838 AC_CACHE_CHECK(for LC_MESSAGES,
3839 ac_cv_i18n_lc_messages,
3840 [AC_TRY_COMPILE([#include <locale.h>],
3841 [int category = LC_MESSAGES;],
3842 ac_cv_i18n_lc_messages=yes,
3843 ac_cv_i18n_lc_messages=no)])
3844 if test "$ac_cv_i18n_lc_messages" = yes; then
3845 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3848 fi # SKIP_COMPILER_CHECKS
3851 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3852 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3855 dnl Mozilla specific options
3856 dnl ========================================================
3857 dnl The macros used for command line options
3858 dnl are defined in build/autoconf/altoptions.m4.
3861 dnl ========================================================
3863 dnl = Check for external package dependencies
3865 dnl ========================================================
3866 MOZ_ARG_HEADER(External Packages)
3870 MOZ_ARG_WITH_STRING(libxul-sdk,
3871 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
3872 LIBXUL_SDK_DIR=$withval)
3874 if test "$LIBXUL_SDK_DIR" = "yes"; then
3875 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
3876 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
3877 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
3879 if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
3880 AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
3885 AC_SUBST(LIBXUL_SDK)
3887 dnl ========================================================
3888 dnl = If NSPR was not detected in the system,
3889 dnl = use the one in the source tree (mozilla/nsprpub)
3890 dnl ========================================================
3891 MOZ_ARG_WITH_BOOL(system-nspr,
3892 [ --with-system-nspr Use system installed NSPR],
3893 _USE_SYSTEM_NSPR=1 )
3895 if test -n "$_USE_SYSTEM_NSPR"; then
3896 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
3899 if test -n "$MOZ_NATIVE_NSPR"; then
3900 _SAVE_CFLAGS=$CFLAGS
3901 CFLAGS="$CFLAGS $NSPR_CFLAGS"
3902 AC_TRY_COMPILE([#include "prlog.h"],
3903 [#ifndef PR_STATIC_ASSERT
3904 #error PR_STATIC_ASSERT not defined
3906 [MOZ_NATIVE_NSPR=1],
3907 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
3908 CFLAGS=$_SAVE_CFLAGS
3910 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --includedir=$(LIBXUL_DIST)/include/nspr --cflags`'
3911 # explicitly set libs for Visual Age C++ for OS/2
3912 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
3913 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '$_PTHREAD_LDFLAGS''
3914 elif test "$OS_ARCH" = "WINCE"; then
3915 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3916 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3917 elif test "$OS_ARCH" = "WINNT"; then
3918 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3919 if test -n "$GNU_CC"; then
3920 NSPR_LIBS="-L\$(LIBXUL_DIST)/lib -lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION"
3922 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3925 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --libdir=$(LIBXUL_DIST)/lib --libs`'
3929 dnl ========================================================
3930 dnl = If NSS was not detected in the system,
3931 dnl = use the one in the source tree (mozilla/security/nss)
3932 dnl ========================================================
3934 MOZ_ARG_WITH_BOOL(system-nss,
3935 [ --with-system-nss Use system installed NSS],
3938 if test -n "$_USE_SYSTEM_NSS"; then
3939 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
3942 if test -n "$MOZ_NATIVE_NSS"; then
3943 NSS_LIBS="$NSS_LIBS -lcrmf"
3945 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
3947 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3948 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)smime'$NSS_VERSION'$(DLL_SUFFIX) \\\
3949 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)ssl'$NSS_VERSION'$(DLL_SUFFIX) \\\
3950 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)nss'$NSS_VERSION'$(DLL_SUFFIX) \\\
3951 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)nssutil'$NSS_VERSION'$(DLL_SUFFIX) \\\
3952 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)softokn'$NSS_VERSION'$(DLL_SUFFIX)'
3954 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
3956 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3957 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)smime'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3958 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)ssl'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3959 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nss'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3960 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nssutil'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3961 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)softokn'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX)'
3963 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
3967 if test -z "$SKIP_LIBRARY_CHECKS"; then
3968 dnl system JPEG support
3969 dnl ========================================================
3970 MOZ_ARG_WITH_STRING(system-jpeg,
3971 [ --with-system-jpeg[=PFX]
3972 Use system libjpeg [installed at prefix PFX]],
3975 _SAVE_CFLAGS=$CFLAGS
3976 _SAVE_LDFLAGS=$LDFLAGS
3978 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
3979 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
3980 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
3982 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
3985 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
3988 if test "$SYSTEM_JPEG" = 1; then
3989 LIBS="$JPEG_LIBS $LIBS"
3990 AC_TRY_COMPILE([ #include <stdio.h>
3991 #include <sys/types.h>
3992 #include <jpeglib.h> ],
3993 [ #if JPEG_LIB_VERSION < $MOZJPEG
3994 #error "Insufficient JPEG library version ($MOZJPEG required)."
3997 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
3999 CFLAGS=$_SAVE_CFLAGS
4000 LDFLAGS=$_SAVE_LDFLAGS
4003 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4004 JPEG_CFLAGS="-I${JPEG_DIR}/include"
4005 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4008 dnl system ZLIB support
4009 dnl ========================================================
4010 MOZ_ARG_WITH_STRING(system-zlib,
4011 [ --with-system-zlib[=PFX]
4012 Use system libz [installed at prefix PFX]],
4015 _SAVE_CFLAGS=$CFLAGS
4016 _SAVE_LDFLAGS=$LDFLAGS
4018 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4019 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4020 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4022 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4025 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4026 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4028 if test "$SYSTEM_ZLIB" = 1; then
4029 LIBS="$ZLIB_LIBS $LIBS"
4030 AC_TRY_COMPILE([ #include <stdio.h>
4032 #include <zlib.h> ],
4033 [ #if ZLIB_VERNUM < $MOZZLIB
4034 #error "Insufficient zlib version ($MOZZLIB required)."
4037 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4039 CFLAGS=$_SAVE_CFLAGS
4040 LDFLAGS=$_SAVE_LDFLAGS
4043 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4044 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4045 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4048 dnl system PNG Support
4049 dnl ========================================================
4050 MOZ_ARG_WITH_STRING(system-png,
4051 [ --with-system-png[=PFX]
4052 Use system libpng [installed at prefix PFX]],
4055 _SAVE_CFLAGS=$CFLAGS
4056 _SAVE_LDFLAGS=$LDFLAGS
4058 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4059 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4060 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4061 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4062 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4064 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4067 _SAVE_PNG_LIBS=$PNG_LIBS
4068 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4069 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4071 AC_CHECK_LIB(png, png_get_acTL, ,
4072 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4075 if test "$SYSTEM_PNG" = 1; then
4076 LIBS="$PNG_LIBS $LIBS"
4077 AC_TRY_COMPILE([ #include <stdio.h>
4078 #include <sys/types.h>
4080 [ #if PNG_LIBPNG_VER < $MOZPNG
4081 #error "Insufficient libpng version ($MOZPNG required)."
4083 #ifndef PNG_UINT_31_MAX
4084 #error "Insufficient libpng version."
4087 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4089 CFLAGS=$_SAVE_CFLAGS
4090 LDFLAGS=$_SAVE_LDFLAGS
4093 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4094 PNG_CFLAGS="-I${PNG_DIR}/include"
4095 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4098 fi # SKIP_LIBRARY_CHECKS
4100 dnl system HunSpell Support
4101 dnl ========================================================
4102 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4103 [ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4106 if test -n "$SYSTEM_HUNSPELL"; then
4107 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4110 AC_SUBST(SYSTEM_HUNSPELL)
4112 dnl check whether to enable glitz
4113 dnl ========================================================
4114 MOZ_ARG_ENABLE_BOOL(glitz,
4115 [ --enable-glitz Enable Glitz for use with Cairo],
4118 if test "$MOZ_ENABLE_GLITZ"; then
4119 AC_DEFINE(MOZ_ENABLE_GLITZ)
4122 dnl ========================================================
4123 dnl Java SDK support
4124 dnl ========================================================
4126 MOZ_ARG_WITH_STRING(java-include-path,
4127 [ --with-java-include-path=dir Location of Java SDK headers],
4128 JAVA_INCLUDE_PATH=$withval)
4131 MOZ_ARG_WITH_STRING(java-bin-path,
4132 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4133 JAVA_BIN_PATH=$withval)
4135 dnl ========================================================
4139 dnl ========================================================
4141 MOZ_ARG_HEADER(Application)
4145 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4146 MOZ_BRANDING_DIRECTORY=
4148 MOZ_DBGRINFO_MODULES=
4150 MOZ_EXTENSIONS_ALL=" wallet xml-rpc venkman inspector irc typeaheadfind gnomevfs sroaming datetime finger cview layout-debug tasks sql xforms schema-validation reporter"
4152 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4153 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4166 MOZ_AUTH_EXTENSION=1
4167 MOZ_NO_ACTIVEX_SUPPORT=1
4168 MOZ_NO_INSPECTOR_APIS=
4169 MOZ_NO_XPCOM_OBSOLETE=
4174 MOZ_PLAINTEXT_EDITOR_ONLY=
4176 MOZ_PREF_EXTENSIONS=1
4177 MOZ_PROFILELOCKING=1
4178 MOZ_PROFILESHARING=1
4180 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4182 MOZ_PYTHON_DEBUG_SUFFIX=
4183 MOZ_PYTHON_DLL_SUFFIX=
4184 MOZ_PYTHON_INCLUDES=
4188 MOZ_PYTHON_VER_DOTTED=
4193 MOZ_STATIC_MAIL_BUILD=
4198 MOZ_UNIVERSALCHARDET=1
4200 MOZ_USE_NATIVE_UCONV=
4205 MOZ_XPFE_COMPONENTS=1
4207 MOZ_XSLT_STANDALONE=
4215 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4216 NECKO_SMALL_BUFFERS=
4219 XPC_IDISPATCH_SUPPORT=
4222 case "$target_os" in
4231 case "$target_os" in
4232 msvc*|mks*|cygwin*|mingw*)
4233 if test -z "$GNU_CC"; then
4234 XPC_IDISPATCH_SUPPORT=1
4235 MOZ_NO_ACTIVEX_SUPPORT=
4236 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4241 MOZ_ARG_ENABLE_STRING(application,
4242 [ --enable-application=APP
4252 content/xslt (Standalone Transformiix XSLT)
4253 netwerk (Standalone Necko)
4254 tools/update-packaging (AUS-related packaging tools)
4255 standalone (use this for standalone
4256 xpcom/xpconnect or to manually drive a build)],
4257 [ MOZ_BUILD_APP=$enableval ] )
4259 if test "$MOZ_BUILD_APP" = "macbrowser"; then
4260 AC_MSG_WARN([--enable-application=macbrowser is deprecated. Use --enable-application=camino.])
4261 MOZ_BUILD_APP=camino
4264 case "$MOZ_BUILD_APP" in
4266 MOZ_EMBEDDING_PROFILE=basic
4270 MOZ_EMBEDDING_PROFILE=default
4274 MOZ_ARG_WITH_STRING(embedding-profile,
4275 [ --with-embedding-profile=default|basic|minimal
4276 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4277 [ MOZ_EMBEDDING_PROFILE=$withval ])
4279 case "$MOZ_EMBEDDING_PROFILE" in
4281 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4282 MOZ_EMBEDDING_LEVEL_BASIC=1
4283 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4284 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4285 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4286 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4290 MOZ_EMBEDDING_LEVEL_DEFAULT=
4291 MOZ_EMBEDDING_LEVEL_BASIC=1
4292 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4293 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4294 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4296 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4299 MOZ_ENABLE_POSTSCRIPT=
4300 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4301 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4302 MOZ_IMG_ENCODERS_DEFAULT=
4310 MOZ_NO_ACTIVEX_SUPPORT=1
4311 MOZ_NO_INSPECTOR_APIS=1
4312 MOZ_NO_XPCOM_OBSOLETE=1
4315 MOZ_PLAINTEXT_EDITOR_ONLY=1
4317 MOZ_PREF_EXTENSIONS=
4322 MOZ_UNIVERSALCHARDET=
4324 MOZ_USE_NATIVE_UCONV=
4326 MOZ_XPFE_COMPONENTS=
4331 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4332 NECKO_SMALL_BUFFERS=1
4333 NS_DISABLE_LOGGING=1
4339 MOZ_EMBEDDING_LEVEL_DEFAULT=
4340 MOZ_EMBEDDING_LEVEL_BASIC=
4341 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4342 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4344 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4347 MOZ_ENABLE_POSTSCRIPT=
4348 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4349 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4350 MOZ_IMG_ENCODERS_DEFAULT=
4358 MOZ_NO_ACTIVEX_SUPPORT=1
4359 MOZ_NO_INSPECTOR_APIS=1
4360 MOZ_NO_XPCOM_OBSOLETE=1
4363 MOZ_PLAINTEXT_EDITOR_ONLY=1
4365 MOZ_PREF_EXTENSIONS=
4372 MOZ_UNIVERSALCHARDET=
4374 MOZ_USE_NATIVE_UCONV=1
4376 MOZ_XPFE_COMPONENTS=
4383 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4384 NECKO_SMALL_BUFFERS=1
4385 NS_DISABLE_LOGGING=1
4391 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4395 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4396 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4397 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4399 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4400 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4401 XULRUNNER_STUB_NAME=$withval)
4403 if test -z "$XULRUNNER_STUB_NAME"; then
4404 case "$target_os" in
4406 XULRUNNER_STUB_NAME=xulrunner
4409 XULRUNNER_STUB_NAME=xulrunner-stub
4412 AC_SUBST(XULRUNNER_STUB_NAME)
4414 if test -z "$MOZ_BUILD_APP"; then
4415 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4417 # We have a valid application only if it has a build.mk file in its top
4419 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4420 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4424 # Allow the application to influence configure with a confvars.sh script.
4426 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4427 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4428 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4429 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4434 # Now is a good time to test for logic errors, define mismatches, etc.
4435 case "$MOZ_BUILD_APP" in
4437 if test "$LIBXUL_SDK"; then
4438 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4442 # Fix this case for folks who forget. Warn them.
4443 if test -n "$LIBXUL_SDK" -a -z "$MOZ_XUL_APP"; then
4444 AC_MSG_WARN([Setting MOZ_XUL_APP since LIBXUL_SDK was set. Add to confvars.sh!])
4450 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4451 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4453 case "$MOZ_BUILD_APP" in
4455 AC_DEFINE(MOZ_SUITE)
4459 AC_DEFINE(MOZ_PHOENIX)
4467 AC_DEFINE(MOZ_THUNDERBIRD)
4471 AC_DEFINE(MOZ_STANDALONE_COMPOSER)
4475 AC_DEFINE(MOZ_SUNBIRD)
4479 AC_DEFINE(MOZ_XULRUNNER)
4483 AC_DEFINE(MOZ_MACBROWSER)
4491 MOZ_APP_NAME=mozilla
4492 MOZ_APP_DISPLAYNAME=Mozilla
4493 MOZ_APP_VERSION=$MOZILLA_VERSION
4498 AC_SUBST(MOZ_BUILD_APP)
4499 AC_SUBST(MOZ_XUL_APP)
4501 AC_SUBST(MOZ_PHOENIX)
4502 AC_SUBST(MOZ_THUNDERBIRD)
4503 AC_SUBST(MOZ_STANDALONE_COMPOSER)
4504 AC_SUBST(MOZ_SUNBIRD)
4505 AC_SUBST(MOZ_XULRUNNER)
4507 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4509 if test "$MOZ_XUL_APP"; then
4511 AC_DEFINE(MOZ_XUL_APP)
4514 dnl ========================================================
4516 dnl = Toolkit Options
4518 dnl ========================================================
4519 MOZ_ARG_HEADER(Toolkit Options)
4521 dnl ========================================================
4522 dnl = Select the default toolkit
4523 dnl ========================================================
4524 MOZ_ARG_ENABLE_STRING(default-toolkit,
4525 [ --enable-default-toolkit=TK
4526 Select default toolkit
4527 Platform specific defaults:
4529 Mac OS X - cairo-cocoa
4530 Neutrino/QNX - photon
4532 Win32 - cairo-windows
4535 [ _DEFAULT_TOOLKIT=$enableval ],
4536 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4538 if test "$_DEFAULT_TOOLKIT" = "photon" \
4539 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4540 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4541 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4542 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4543 -o "$_DEFAULT_TOOLKIT" = "cairo-mac" \
4544 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4546 dnl nglayout only supports building with one toolkit,
4547 dnl so ignore everything after the first comma (",").
4548 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4550 if test "$no_x" != "yes"; then
4551 AC_MSG_ERROR([Toolkit must be cairo-gtk2.])
4553 AC_MSG_ERROR([Toolkit must be $_PLATFORM_DEFAULT_TOOLKIT (if supported).])
4557 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4559 dnl ========================================================
4560 dnl = Enable the toolkit as needed =
4561 dnl ========================================================
4563 case "$MOZ_WIDGET_TOOLKIT" in
4566 AC_DEFINE(MOZ_WIDGET_PHOTON)
4570 MOZ_WIDGET_TOOLKIT=windows
4571 MOZ_GFX_TOOLKIT=cairo
4575 MOZ_WIDGET_TOOLKIT=gtk2
4576 MOZ_GFX_TOOLKIT=cairo
4578 MOZ_ENABLE_XREMOTE=1
4579 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4580 TK_LIBS='$(MOZ_GTK2_LIBS)'
4581 AC_DEFINE(MOZ_WIDGET_GTK2)
4584 MOZ_WIDGET_TOOLKIT=beos
4585 MOZ_GFX_TOOLKIT=cairo
4586 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4587 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4591 MOZ_WIDGET_TOOLKIT=os2
4592 MOZ_GFX_TOOLKIT=cairo
4593 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4594 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4597 cairo-mac|cairo-cocoa)
4598 if test "$MOZ_WIDGET_TOOLKIT" = "cairo-cocoa"; then
4599 MOZ_WIDGET_TOOLKIT=cocoa
4600 AC_DEFINE(MOZ_WIDGET_COCOA)
4603 MOZ_WIDGET_TOOLKIT=mac
4605 MOZ_GFX_TOOLKIT=cairo
4606 MOZ_USER_DIR="Mozilla"
4607 AC_DEFINE(XP_MACOSX)
4608 AC_DEFINE(TARGET_CARBON)
4609 AC_DEFINE(TARGET_API_MAC_CARBON)
4610 TK_LIBS='-framework Carbon'
4611 TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
4612 CFLAGS="$CFLAGS $TK_CFLAGS"
4613 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4617 if test "$MOZ_ENABLE_XREMOTE"; then
4618 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4621 if test "$COMPILE_ENVIRONMENT"; then
4622 if test "$MOZ_ENABLE_GTK2"
4624 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 gdk-x11-2.0 glib-2.0 gobject-2.0)
4626 fi # COMPILE_ENVIRONMENT
4628 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4630 dnl ========================================================
4631 dnl = startup-notification support module
4632 dnl ========================================================
4634 if test "$MOZ_ENABLE_GTK2"
4636 MOZ_ENABLE_STARTUP_NOTIFICATION=
4638 MOZ_ARG_ENABLE_BOOL(startup-notification,
4639 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4640 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4641 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4642 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4644 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4645 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4646 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4647 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4649 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4651 MOZ_ENABLE_STARTUP_NOTIFICATION=
4655 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4656 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4659 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4661 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4662 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4663 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4665 AC_SUBST(GTK_CONFIG)
4669 AC_SUBST(MOZ_ENABLE_GTK2)
4670 AC_SUBST(MOZ_ENABLE_PHOTON)
4671 AC_SUBST(MOZ_ENABLE_COCOA)
4672 AC_SUBST(MOZ_ENABLE_GLITZ)
4673 AC_SUBST(MOZ_ENABLE_XREMOTE)
4674 AC_SUBST(MOZ_GTK2_CFLAGS)
4675 AC_SUBST(MOZ_GTK2_LIBS)
4679 if test "$MOZ_ENABLE_GTK2"
4686 dnl ========================================================
4688 dnl = Components & Features
4690 dnl ========================================================
4691 MOZ_ARG_HEADER(Components and Features)
4693 dnl ========================================================
4695 dnl ========================================================
4696 MOZ_ARG_ENABLE_STRING(ui-locale,
4697 [ --enable-ui-locale=ab-CD
4698 Select the user interface locale (default: en-US)],
4699 MOZ_UI_LOCALE=$enableval )
4700 AC_SUBST(MOZ_UI_LOCALE)
4702 dnl =========================================================
4703 dnl = Calendar client
4704 dnl =========================================================
4705 MOZ_ARG_ENABLE_BOOL(calendar,,
4709 if test "$MOZ_OLD_CALENDAR"; then
4710 AC_MSG_WARN([Building with the calendar extension is no longer supported.])
4711 if test "$MOZ_THUNDERBIRD"; then
4712 AC_MSG_WARN([Since you're trying to build mail, you could try adding])
4713 AC_MSG_WARN(['--enable-extensions=default,lightning' to your mozconfig])
4714 AC_MSG_WARN([and building WITH A FRESH TREE.])
4716 AC_MSG_WARN([For more information, please visit:])
4717 AC_MSG_ERROR([http://www.mozilla.org/projects/calendar/])
4720 AC_SUBST(MOZ_CALENDAR)
4722 dnl =========================================================
4724 dnl =========================================================
4725 MOZ_ARG_DISABLE_BOOL(mailnews,
4726 [ --disable-mailnews Disable building of mail & news components],
4729 AC_SUBST(MOZ_MAIL_NEWS)
4731 dnl =========================================================
4733 dnl =========================================================
4734 MOZ_ARG_DISABLE_BOOL(ldap,
4735 [ --disable-ldap Disable LDAP support],
4739 dnl ========================================================
4740 dnl = Trademarked Branding
4741 dnl ========================================================
4742 MOZ_ARG_ENABLE_BOOL(official-branding,
4743 [ --enable-official-branding Enable Official mozilla.org Branding
4744 Do not distribute builds with
4745 --enable-official-branding unless you have
4746 permission to use trademarks per
4747 http://www.mozilla.org/foundation/trademarks/ .],
4748 [case "$MOZ_BUILD_APP" in
4750 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
4751 MOZ_APP_DISPLAYNAME=Firefox
4755 MOZ_BRANDING_DIRECTORY=other-licenses/branding/sunbird
4756 MOZ_APP_DISPLAYNAME=Sunbird
4760 MOZ_BRANDING_DIRECTORY=other-licenses/branding/thunderbird
4764 AC_MSG_ERROR([Official branding is only available for Firefox Sunbird and Thunderbird.])
4768 MOZ_ARG_WITH_STRING(branding,
4769 [ --with-branding=dir Use branding from the specified directory.],
4770 MOZ_BRANDING_DIRECTORY=$withval)
4772 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4773 if test -z "$REAL_BRANDING_DIRECTORY"; then
4774 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4777 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4778 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
4781 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4783 dnl ========================================================
4784 dnl = Distribution ID
4785 dnl ========================================================
4786 MOZ_ARG_WITH_STRING(distribution-id,
4787 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
4788 [ val=`echo $withval`
4789 MOZ_DISTRIBUTION_ID="$val"])
4791 if test -z "$MOZ_DISTRIBUTION_ID"; then
4792 MOZ_DISTRIBUTION_ID="org.mozilla"
4795 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4796 AC_SUBST(MOZ_DISTRIBUTION_ID)
4798 dnl ========================================================
4800 dnl ========================================================
4801 if test "$MOZ_ENABLE_GTK2"
4803 PKG_CHECK_MODULES(MOZ_XFT, xft)
4804 AC_SUBST(MOZ_XFT_CFLAGS)
4805 AC_SUBST(MOZ_XFT_LIBS)
4807 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
4808 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangocairo >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
4809 AC_SUBST(MOZ_PANGO_CFLAGS)
4810 AC_SUBST(MOZ_PANGO_LIBS)
4813 dnl ========================================================
4814 dnl = PostScript print module
4815 dnl ========================================================
4816 MOZ_ARG_DISABLE_BOOL(postscript,
4817 [ --disable-postscript Disable PostScript printing support ],
4818 MOZ_ENABLE_POSTSCRIPT=,
4819 MOZ_ENABLE_POSTSCRIPT=1 )
4821 dnl ========================================================
4822 dnl = GnomeVFS support module
4823 dnl ========================================================
4827 dnl build the gnomevfs extension by default only when the
4828 dnl GTK2 toolkit is in use.
4829 if test "$MOZ_ENABLE_GTK2"
4831 MOZ_ENABLE_GNOMEVFS=1
4833 MOZ_ENABLE_LIBGNOME=1
4836 MOZ_ARG_DISABLE_BOOL(gnomevfs,
4837 [ --disable-gnomevfs Disable GnomeVFS support ],
4838 MOZ_ENABLE_GNOMEVFS=,
4839 MOZ_ENABLE_GNOMEVFS=force)
4841 if test "$MOZ_ENABLE_GNOMEVFS"
4843 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4844 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4845 MOZ_ENABLE_GNOMEVFS=1
4847 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
4849 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
4851 MOZ_ENABLE_GNOMEVFS=
4855 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
4856 AC_SUBST(MOZ_GNOMEVFS_LIBS)
4858 if test "$MOZ_ENABLE_GCONF"
4860 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
4861 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
4868 AC_SUBST(MOZ_GCONF_CFLAGS)
4869 AC_SUBST(MOZ_GCONF_LIBS)
4871 if test "$MOZ_ENABLE_LIBGNOME"
4873 PKG_CHECK_MODULES(MOZ_LIBGNOME, libgnome-2.0 >= $LIBGNOME_VERSION,[
4874 MOZ_LIBGNOME_LIBS=`echo $MOZ_LIBGNOME_LIBS | sed 's/-llinc\>//'`
4875 MOZ_ENABLE_LIBGNOME=1
4877 MOZ_ENABLE_LIBGNOME=
4881 AC_SUBST(MOZ_LIBGNOME_CFLAGS)
4882 AC_SUBST(MOZ_LIBGNOME_LIBS)
4884 # The GNOME component is built if gtk2, gconf, gnome-vfs, and libgnome
4885 # are all available.
4887 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
4888 "$MOZ_ENABLE_GNOMEVFS" -a "$MOZ_ENABLE_LIBGNOME"; then
4889 MOZ_ENABLE_GNOME_COMPONENT=1
4891 MOZ_ENABLE_GNOME_COMPONENT=
4894 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
4897 dnl ========================================================
4898 dnl = libgnomeui support module
4899 dnl ========================================================
4901 if test "$MOZ_ENABLE_GTK2"
4903 MOZ_ENABLE_GNOMEUI=1
4905 MOZ_ARG_DISABLE_BOOL(gnomeui,
4906 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
4907 MOZ_ENABLE_GNOMEUI=,
4908 MOZ_ENABLE_GNOMEUI=force)
4910 if test "$MOZ_ENABLE_GNOMEUI"
4912 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
4914 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
4915 MOZ_ENABLE_GNOMEUI=1
4917 if test "$MOZ_ENABLE_GNOMEUI" = "force"
4919 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
4925 if test "$MOZ_ENABLE_GNOMEUI"; then
4926 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
4929 AC_SUBST(MOZ_ENABLE_GNOMEUI)
4930 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
4931 AC_SUBST(MOZ_GNOMEUI_LIBS)
4933 dnl ========================================================
4935 dnl ========================================================
4937 if test "$MOZ_ENABLE_GTK2"
4941 MOZ_ARG_DISABLE_BOOL(dbus,
4942 [ --disable-dbus Disable dbus support ],
4946 if test "$MOZ_ENABLE_DBUS"
4948 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
4949 AC_DEFINE(MOZ_ENABLE_DBUS)
4952 AC_SUBST(MOZ_ENABLE_DBUS)
4953 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
4954 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
4956 dnl ========================================================
4957 dnl = Build Personal Security Manager
4958 dnl ========================================================
4959 MOZ_ARG_DISABLE_BOOL(crypto,
4960 [ --disable-crypto Disable crypto support (Personal Security Manager)],
4964 dnl ========================================================
4965 dnl = JS Debugger XPCOM component (js/jsd)
4966 dnl ========================================================
4967 MOZ_ARG_DISABLE_BOOL(jsd,
4968 [ --disable-jsd Disable JavaScript debug library],
4973 dnl ========================================================
4974 dnl = Disable plugin support
4975 dnl ========================================================
4976 MOZ_ARG_DISABLE_BOOL(plugins,
4977 [ --disable-plugins Disable plugins support],
4981 dnl ========================================================
4982 dnl = Open JVM Interface (OJI) support
4983 dnl ========================================================
4984 MOZ_ARG_DISABLE_BOOL(oji,
4985 [ --disable-oji Disable Open JVM Integration support],
4988 if test -n "$MOZ_OJI"; then
4992 dnl bi-directional support always on
4996 dnl ========================================================
4997 dnl complex text support off by default
4998 dnl ========================================================
4999 MOZ_ARG_ENABLE_BOOL(ctl,
5000 [ --enable-ctl Enable Thai Complex Script support],
5004 dnl ========================================================
5005 dnl view source support on by default
5006 dnl ========================================================
5007 MOZ_ARG_DISABLE_BOOL(view-source,
5008 [ --disable-view-source Disable view source support],
5011 if test "$MOZ_VIEW_SOURCE"; then
5012 AC_DEFINE(MOZ_VIEW_SOURCE)
5016 dnl ========================================================
5017 dnl accessibility support on by default on all platforms
5019 dnl ========================================================
5020 MOZ_ARG_DISABLE_BOOL(accessibility,
5021 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5024 if test "$ACCESSIBILITY"; then
5025 AC_DEFINE(ACCESSIBILITY)
5028 dnl ========================================================
5029 dnl xpfe/components on by default
5030 dnl ========================================================
5031 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5032 [ --disable-xpfe-components
5033 Disable xpfe components],
5034 MOZ_XPFE_COMPONENTS=,
5035 MOZ_XPFE_COMPONENTS=1 )
5037 dnl ========================================================
5038 dnl xpinstall support on by default
5039 dnl ========================================================
5040 MOZ_ARG_DISABLE_BOOL(xpinstall,
5041 [ --disable-xpinstall Disable xpinstall support],
5044 if test "$MOZ_XPINSTALL"; then
5045 AC_DEFINE(MOZ_XPINSTALL)
5048 dnl ========================================================
5049 dnl xpcom js loader support on by default
5050 dnl ========================================================
5051 MOZ_ARG_DISABLE_BOOL(jsloader,
5052 [ --disable-jsloader Disable xpcom js loader support],
5055 if test "$MOZ_JSLOADER"; then
5056 AC_DEFINE(MOZ_JSLOADER)
5059 dnl ========================================================
5060 dnl Disable printing
5061 dnl ========================================================
5062 MOZ_ARG_DISABLE_BOOL(printing,
5063 [ --disable-printing Disable printing support],
5067 if test "$NS_PRINTING"; then
5068 AC_DEFINE(NS_PRINTING)
5069 AC_DEFINE(NS_PRINT_PREVIEW)
5072 dnl ========================================================
5073 dnl use native unicode converters
5074 dnl ========================================================
5075 MOZ_ARG_ENABLE_BOOL(native-uconv,
5076 [ --enable-native-uconv Enable iconv support],
5077 MOZ_USE_NATIVE_UCONV=1,
5078 MOZ_USE_NATIVE_UCONV= )
5079 if test "$MOZ_USE_NATIVE_UCONV"; then
5080 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5082 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5083 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5087 dnl ========================================================
5088 dnl Libeditor can be build as plaintext-only,
5089 dnl or as a full html and text editing component.
5090 dnl We build both by default.
5091 dnl ========================================================
5092 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5093 [ --enable-plaintext-editor-only
5094 Allow only plaintext editing],
5095 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5096 MOZ_PLAINTEXT_EDITOR_ONLY= )
5097 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5098 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5100 dnl ========================================================
5101 dnl Composer is on by default.
5102 dnl ========================================================
5103 MOZ_ARG_DISABLE_BOOL(composer,
5104 [ --disable-composer Disable building of Composer],
5107 AC_SUBST(MOZ_COMPOSER)
5110 dnl ========================================================
5111 dnl = Drop XPCOM Obsolete library
5112 dnl ========================================================
5113 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5114 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5115 MOZ_NO_XPCOM_OBSOLETE=1,
5116 MOZ_NO_XPCOM_OBSOLETE=)
5118 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5119 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5122 dnl ========================================================
5123 dnl = Disable Fast Load
5124 dnl ========================================================
5125 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5126 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5130 AC_SUBST(MOZ_NO_FAST_LOAD)
5132 if test -n "$MOZ_NO_FAST_LOAD"; then
5133 AC_DEFINE(MOZ_NO_FAST_LOAD)
5136 dnl ========================================================
5137 dnl Permissions System
5138 dnl ========================================================
5139 MOZ_ARG_DISABLE_BOOL(permissions,
5140 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5145 dnl ========================================================
5147 dnl ========================================================
5148 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5149 [ --disable-negotiateauth Disable GSS-API negotiation ],
5150 MOZ_AUTH_EXTENSION=,
5151 MOZ_AUTH_EXTENSION=1 )
5153 dnl ========================================================
5155 dnl ========================================================
5156 MOZ_ARG_DISABLE_BOOL(xtf,
5157 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5160 if test "$MOZ_XTF"; then
5164 dnl ========================================================
5166 dnl ========================================================
5167 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5168 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5169 MOZ_NO_INSPECTOR_APIS=1,
5170 MOZ_NO_INSPECTOR_APIS= )
5172 dnl ========================================================
5174 dnl ========================================================
5175 MOZ_ARG_DISABLE_BOOL(xmlextras,
5176 [ --disable-xmlextras Disable XMLExtras such as XPointer support ],
5180 dnl ========================================================
5182 dnl ========================================================
5183 MOZ_ARG_ENABLE_BOOL(webservices,
5184 [ --enable-webservices Enable Webservices/SOAP support ],
5188 dnl ========================================================
5189 dnl Pref extensions (autoconfig and system-pref)
5190 dnl ========================================================
5191 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5192 [ --disable-pref-extensions
5193 Disable pref extensions such as autoconfig and
5195 MOZ_PREF_EXTENSIONS=,
5196 MOZ_PREF_EXTENSIONS=1 )
5198 dnl ========================================================
5199 dnl = Universalchardet
5200 dnl ========================================================
5201 MOZ_ARG_DISABLE_BOOL(universalchardet,
5202 [ --disable-universalchardet
5203 Disable universal encoding detection],
5204 MOZ_UNIVERSALCHARDET=,
5205 MOZ_UNIVERSALCHARDET=1 )
5207 dnl ========================================================
5209 dnl ========================================================
5210 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5211 [ --enable-javaxpcom
5212 Enable Java-XPCOM bridge],
5216 if test -n "${MOZ_JAVAXPCOM}"; then
5219 if test -n "$JAVA_HOME"; then
5220 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5224 if test -n "$JAVA_HOME"; then
5225 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5230 if test -n "${JAVA_INCLUDE_PATH}"; then
5231 dnl Make sure jni.h exists in the given include path.
5232 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5233 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5236 case "$target_os" in
5238 dnl Default to java system location
5239 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5243 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5246 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5247 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.])
5251 if test -n "${JAVA_BIN_PATH}"; then
5252 dnl Look for javac and jar in the specified path.
5253 JAVA_PATH="$JAVA_BIN_PATH"
5255 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5256 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5259 AC_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5260 AC_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5261 AC_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5262 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5263 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.])
5267 dnl ========================================================
5268 dnl = Breakpad crash reporting (on by default on supported platforms)
5269 dnl ========================================================
5271 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5272 || test "$OS_ARCH" = "Darwin" \
5273 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86") \
5274 && test -z "$HAVE_64BIT_OS"; then
5278 MOZ_ARG_DISABLE_BOOL(crashreporter,
5279 [ --disable-crashreporter Disable breakpad crash reporting],
5281 MOZ_CRASHREPORTER=1)
5283 if test -n "$MOZ_CRASHREPORTER"; then
5284 AC_DEFINE(MOZ_CRASHREPORTER)
5286 if test "$OS_ARCH" = "Linux" && \
5287 test -z "$SKIP_LIBRARY_CHECKS"; then
5288 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5289 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5290 AC_SUBST(MOZ_GTHREAD_LIBS)
5292 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.])])
5296 dnl ========================================================
5297 dnl = Build mochitest JS/DOM tests (on by default)
5298 dnl ========================================================
5299 MOZ_ARG_DISABLE_BOOL(mochitest,
5300 [ --disable-mochitest Disable mochitest harness],
5304 dnl ========================================================
5305 dnl = Enable compilation of specific extension modules
5306 dnl ========================================================
5308 MOZ_ARG_ENABLE_STRING(extensions,
5309 [ --enable-extensions Enable extensions],
5310 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5311 if test "$option" = "yes" || test "$option" = "all"; then
5312 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_ALL"
5313 elif test "$option" = "no" || test "$option" = "none"; then
5315 elif test "$option" = "default"; then
5316 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5317 elif test `echo "$option" | grep -c \^-` != 0; then
5318 option=`echo $option | sed 's/^-//'`
5319 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5321 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5324 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5326 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5327 # Suppress warning on non-X11 platforms
5328 if test -n "$MOZ_X11"; then
5329 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5331 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5334 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5335 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5336 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5339 dnl This might be temporary: build tridentprofile only on Windows
5340 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5341 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5342 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5345 dnl cookie must be built before tridentprofile. put it at list's end.
5346 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5347 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5348 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5351 dnl xforms requires xtf and schema-validation
5352 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5353 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5354 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5356 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5357 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5358 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5361 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5362 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5363 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5366 if test `echo "$MOZ_EXTENSIONS" | grep -c xmlextras` -ne 0; then
5367 AC_MSG_WARN([xmlextras is no longer an extension, use --disable-xmlextras to disable.])
5368 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xmlextras||g'`
5371 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5372 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5373 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5376 if test `echo "$MOZ_EXTENSIONS" | grep -c webservices` -ne 0; then
5377 AC_MSG_WARN([webservices is no longer an extension, use --disable-webservices to disable.])
5378 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|webservices||g'`
5381 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5382 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5383 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5386 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5387 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5388 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5391 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5392 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5393 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5396 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5397 AC_MSG_WARN([spellcheck is no longer an extension.])
5398 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5401 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5402 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5403 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5407 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5409 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5410 dnl when trying to build a non-existent extension.
5411 for extension in $MOZ_EXTENSIONS; do
5412 if test ! -d "${srcdir}/extensions/${extension}"; then
5413 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5418 dnl ========================================================
5420 dnl ========================================================
5421 case "$MOZ_WIDGET_TOOLKIT" in
5422 beos|windows|os2|mac|cocoa)
5425 if test -z "$MOZ_ENABLE_GTK2"; then
5426 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5431 MOZ_ARG_ENABLE_STRING(image-decoders,
5432 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5433 Enable specific image decoders],
5434 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5435 if test "$option" = "yes" || test "$option" = "all"; then
5436 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5437 elif test "$option" = "no" || test "$option" = "none"; then
5439 elif test "$option" = "default"; then
5440 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5441 elif test `echo "$option" | grep -c \^-` != 0; then
5442 option=`echo $option | sed 's/^-//'`
5443 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5445 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5448 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5450 dnl Dupes are removed in the encoder section because it will also add decoders
5452 dnl ========================================================
5454 dnl ========================================================
5455 MOZ_ARG_ENABLE_STRING(image-encoders,
5456 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5457 Enable specific image encoders],
5458 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5459 if test "$option" = "yes" || test "$option" = "all"; then
5460 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5461 elif test "$option" = "no" || test "$option" = "none"; then
5464 elif test "$option" = "default"; then
5465 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5466 elif test `echo "$option" | grep -c \^-` != 0; then
5467 option=`echo $option | sed 's/^-//'`
5468 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5470 addencoder="$option"
5472 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5474 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5477 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5478 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5480 dnl ========================================================
5481 dnl experimental ldap features
5482 dnl ========================================================
5483 MOZ_ARG_ENABLE_BOOL(ldap-experimental,
5484 [ --enable-ldap-experimental
5485 Enable LDAP experimental features],
5486 MOZ_LDAP_XPCOM_EXPERIMENTAL=1,
5487 MOZ_LDAP_XPCOM_EXPERIMENTAL=)
5489 dnl ========================================================
5490 dnl MathML on by default
5491 dnl ========================================================
5492 MOZ_ARG_DISABLE_BOOL(mathml,
5493 [ --disable-mathml Disable MathML support],
5496 if test "$MOZ_MATHML"; then
5497 AC_DEFINE(MOZ_MATHML)
5500 dnl ========================================================
5502 dnl ========================================================
5503 MOZ_ARG_DISABLE_BOOL(canvas,
5504 [ --disable-canvas Disable html:canvas feature],
5506 MOZ_ENABLE_CANVAS=1 )
5507 if test -n "$MOZ_ENABLE_CANVAS"; then
5508 AC_DEFINE(MOZ_ENABLE_CANVAS)
5510 AC_SUBST(MOZ_ENABLE_CANVAS)
5512 dnl ========================================================
5514 dnl ========================================================
5515 MOZ_ARG_DISABLE_BOOL(svg,
5516 [ --disable-svg Disable SVG support],
5519 if test -n "$MOZ_SVG"; then
5523 MOZ_SVG_FOREIGNOBJECT=1
5524 dnl ========================================================
5525 dnl SVG <foreignObject>
5526 dnl ========================================================
5527 MOZ_ARG_DISABLE_BOOL(svg-foreignobject,
5528 [ --disable-svg-foreignobject
5529 Disable SVG <foreignObject> support],
5530 MOZ_SVG_FOREIGNOBJECT=,
5531 MOZ_SVG_FOREIGNOBJECT=1 )
5532 if test "$MOZ_SVG_FOREIGNOBJECT"; then
5533 if test "$MOZ_SVG"; then
5534 AC_DEFINE(MOZ_SVG_FOREIGNOBJECT)
5536 MOZ_SVG_FOREIGNOBEJCT=
5540 dnl ========================================================
5542 dnl ========================================================
5543 case "$target_os" in
5544 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5549 MOZ_ARG_DISABLE_BOOL(installer,
5550 [ --disable-installer Disable building of installer],
5553 if test -n "$MOZ_INSTALLER" -a -n "$MOZ_XUL_APP" -a "$OS_ARCH" = "WINNT"; then
5554 # Disable installer for Windows builds that use the new toolkit if NSIS
5555 # isn't in the path.
5556 AC_PATH_PROGS(MAKENSIS, makensis)
5557 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5558 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5560 # The Windows build for NSIS requires the iconv command line utility to
5561 # convert the charset of the locale files.
5562 AC_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5563 if test -z "$HOST_ICONV"; then
5564 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5568 # Automatically disable installer if xpinstall isn't built
5569 if test -z "$MOZ_XPINSTALL"; then
5572 AC_SUBST(MOZ_INSTALLER)
5574 AC_MSG_CHECKING([for tar archiver])
5575 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
5576 if test -z "$TAR"; then
5577 AC_MSG_ERROR([no tar archiver found in \$PATH])
5579 AC_MSG_RESULT([$TAR])
5582 dnl ========================================================
5584 dnl ========================================================
5586 MOZ_ARG_DISABLE_BOOL(updater,
5587 [ --disable-updater Disable building of updater],
5590 # The Windows build requires the iconv command line utility
5591 # in order to build the updater.
5592 case "$target_os" in
5593 msvc*|mks*|cygwin*|mingw*|wince*)
5594 if test -n "$MOZ_UPDATER"; then
5595 AC_MSG_CHECKING([for iconv])
5596 AC_CHECK_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5597 if test -z "$HOST_ICONV"; then
5598 AC_MSG_ERROR([iconv not found in \$PATH])
5603 AC_SUBST(MOZ_UPDATER)
5605 # app update channel is 'default' when not supplied.
5606 MOZ_ARG_ENABLE_STRING([update-channel],
5607 [ --enable-update-channel=CHANNEL
5608 Select application update channel (default=default)],
5609 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
5611 if test -z "$MOZ_UPDATE_CHANNEL"; then
5612 MOZ_UPDATE_CHANNEL=default
5614 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5616 # tools/update-packaging is not checked out by default.
5617 MOZ_ARG_ENABLE_BOOL(update-packaging,
5618 [ --enable-update-packaging
5619 Enable tools/update-packaging],
5620 MOZ_UPDATE_PACKAGING=1,
5621 MOZ_UPDATE_PACKAGING= )
5622 AC_SUBST(MOZ_UPDATE_PACKAGING)
5624 dnl ========================================================
5626 dnl ========================================================
5628 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
5629 [ --disable-xpconnect-idispatch
5630 Disable building of xpconnect support for IDispatch
5632 XPC_IDISPATCH_SUPPORT=,
5633 XPC_IDISPATCH_SUPPORT=1)
5634 AC_SUBST(XPC_IDISPATCH_SUPPORT)
5636 MOZ_ARG_DISABLE_BOOL(activex,
5637 [ --disable-activex Disable building of ActiveX control (win32 only)],
5638 MOZ_NO_ACTIVEX_SUPPORT=1,
5639 MOZ_NO_ACTIVEX_SUPPORT= )
5640 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
5642 MOZ_ARG_DISABLE_BOOL(activex-scripting,
5643 [ --disable-activex-scripting
5644 Disable building of ActiveX scripting support (win32)],
5645 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
5646 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
5647 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
5649 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
5651 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
5654 dnl ========================================================
5656 dnl ========================================================
5657 MOZ_ARG_ENABLE_BOOL(leaky,
5658 [ --enable-leaky Build leaky memory tool],
5663 dnl ========================================================
5665 dnl ========================================================
5666 MOZ_ARG_ENABLE_BOOL(xpctools,
5667 [ --enable-xpctools Build JS profiling tool],
5672 dnl ========================================================
5673 dnl build the tests by default
5674 dnl ========================================================
5675 MOZ_ARG_DISABLE_BOOL(tests,
5676 [ --disable-tests Do not build test libraries & programs],
5680 dnl ========================================================
5682 dnl = Module specific options
5684 dnl ========================================================
5685 MOZ_ARG_HEADER(Individual module options)
5687 dnl ========================================================
5688 dnl = Enable Lea malloc in xpcom. OFF by default.
5689 dnl ========================================================
5690 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
5691 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
5694 if test -n "$XPCOM_USE_LEA"; then
5695 AC_DEFINE(XPCOM_USE_LEA)
5698 dnl ========================================================
5699 dnl = Enable places (new history/bookmarks)
5700 dnl ========================================================
5701 MOZ_ARG_ENABLE_BOOL(places,
5702 [ --enable-places Enable 'places' bookmark/history implementation],
5705 if test -n "$MOZ_PLACES"; then
5706 AC_DEFINE(MOZ_PLACES)
5707 if test -z "$MOZ_MAIL_NEWS"; then
5712 if test "$MOZ_BUILD_APP" = "browser"; then
5713 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
5717 dnl ========================================================
5718 dnl = Disable feed handling components
5719 dnl ========================================================
5720 MOZ_ARG_DISABLE_BOOL(feeds,
5721 [ --disable-feeds Disable feed handling and processing components],
5724 if test -n "$MOZ_FEEDS"; then
5725 AC_DEFINE(MOZ_FEEDS)
5727 if test "$MOZ_BUILD_APP" = "browser"; then
5728 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
5732 dnl ========================================================
5733 dnl = Enable mozStorage
5734 dnl ========================================================
5735 dnl Implicitly enabled by default if building calendar or places
5736 MOZ_ARG_ENABLE_BOOL(storage,
5737 [ --enable-storage Enable mozStorage module and related components],
5740 if test -n "$MOZ_STORAGE"; then
5741 AC_DEFINE(MOZ_STORAGE)
5744 dnl ========================================================
5745 dnl Check for sqlite
5746 dnl ========================================================
5749 MOZ_ARG_ENABLE_BOOL(system-sqlite,
5750 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
5751 MOZ_NATIVE_SQLITE=1,
5752 MOZ_NATIVE_SQLITE= )
5754 if test -z "$MOZ_NATIVE_SQLITE"
5757 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
5759 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
5762 AC_SUBST(MOZ_NATIVE_SQLITE)
5764 dnl ========================================================
5765 dnl = Enable safe browsing (anti-phishing)
5766 dnl ========================================================
5767 MOZ_ARG_ENABLE_BOOL(safe-browsing,
5768 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
5769 MOZ_SAFE_BROWSING=1,
5770 MOZ_SAFE_BROWSING= )
5771 if test -n "$MOZ_SAFE_BROWSING"; then
5772 AC_DEFINE(MOZ_SAFE_BROWSING)
5774 AC_SUBST(MOZ_SAFE_BROWSING)
5776 dnl ========================================================
5777 dnl = Enable url-classifier
5778 dnl ========================================================
5779 dnl Implicitly enabled by default if building with safe-browsing
5780 if test -n "$MOZ_SAFE_BROWSING"; then
5781 MOZ_URL_CLASSIFIER=1
5783 MOZ_ARG_ENABLE_BOOL(url-classifier,
5784 [ --enable-url-classifier Enable url classifier module],
5785 MOZ_URL_CLASSIFIER=1,
5786 MOZ_URL_CLASSIFIER= )
5787 if test -n "$MOZ_URL_CLASSIFIER"; then
5788 AC_DEFINE(MOZ_URL_CLASSIFIER)
5790 AC_SUBST(MOZ_URL_CLASSIFIER)
5792 dnl ========================================================
5793 dnl = Disable zipwriter
5794 dnl ========================================================
5795 MOZ_ARG_DISABLE_BOOL(zipwriter,
5796 [ --disable-zipwriter Disable zipwriter component],
5799 AC_SUBST(MOZ_ZIPWRITER)
5801 dnl ========================================================
5802 dnl = Enable Ultrasparc specific optimizations for JS
5803 dnl ========================================================
5804 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
5805 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
5806 JS_ULTRASPARC_OPTS=1,
5807 JS_ULTRASPARC_OPTS= )
5809 dnl only enable option for ultrasparcs
5810 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
5811 "$OS_TEST" != "sun4u"; then
5814 AC_SUBST(JS_ULTRASPARC_OPTS)
5816 dnl ========================================================
5818 dnl = Feature options that require extra sources to be pulled
5820 dnl ========================================================
5821 dnl MOZ_ARG_HEADER(Features that require extra sources)
5823 dnl ========================================================
5825 dnl = Debugging Options
5827 dnl ========================================================
5828 MOZ_ARG_HEADER(Debugging and Optimizations)
5830 dnl ========================================================
5831 dnl = Disable building with debug info.
5832 dnl = Debugging is OFF by default
5833 dnl ========================================================
5834 if test -z "$MOZ_DEBUG_FLAGS"
5838 if test "$GNU_CC"; then
5839 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
5840 case "$GCC_VERSION" in
5845 MOZ_DEBUG_FLAGS="-g"
5849 MOZ_DEBUG_FLAGS="-g"
5853 MOZ_DEBUG_FLAGS="-g"
5858 MOZ_ARG_ENABLE_STRING(debug,
5859 [ --enable-debug[=DBG] Enable building with developer debug info
5860 (Using compiler flags DBG)],
5861 [ if test "$enableval" != "no"; then
5863 if test -n "$enableval" && test "$enableval" != "yes"; then
5864 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
5871 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
5872 case "${target_os}" in
5874 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
5876 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5877 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
5880 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
5883 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
5885 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
5887 if test -n "$MOZ_DEBUG"; then
5888 AC_MSG_CHECKING([for valid debug flags])
5889 _SAVE_CFLAGS=$CFLAGS
5890 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
5891 AC_TRY_COMPILE([#include <stdio.h>],
5892 [printf("Hello World\n");],
5895 AC_MSG_RESULT([$_results])
5896 if test "$_results" = "no"; then
5897 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
5899 CFLAGS=$_SAVE_CFLAGS
5902 dnl ========================================================
5903 dnl = Enable code optimization. ON by default.
5904 dnl ========================================================
5905 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
5906 MOZ_OPTIMIZE_FLAGS="-O"
5909 MOZ_ARG_ENABLE_STRING(optimize,
5910 [ --disable-optimize Disable compiler optimization
5911 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
5912 [ if test "$enableval" != "no"; then
5914 if test -n "$enableval" && test "$enableval" != "yes"; then
5915 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
5920 fi ], MOZ_OPTIMIZE=1)
5922 if test "$COMPILE_ENVIRONMENT"; then
5923 if test -n "$MOZ_OPTIMIZE"; then
5924 AC_MSG_CHECKING([for valid optimization flags])
5925 _SAVE_CFLAGS=$CFLAGS
5926 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
5927 AC_TRY_COMPILE([#include <stdio.h>],
5928 [printf("Hello World\n");],
5931 AC_MSG_RESULT([$_results])
5932 if test "$_results" = "no"; then
5933 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
5935 CFLAGS=$_SAVE_CFLAGS
5937 fi # COMPILE_ENVIRONMENT
5939 AC_SUBST(MOZ_OPTIMIZE)
5940 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
5941 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
5943 dnl ========================================================
5944 dnl = Enable/disable debug for specific modules only
5945 dnl = module names beginning with ^ will be disabled
5946 dnl ========================================================
5947 MOZ_ARG_ENABLE_STRING(debug-modules,
5948 [ --enable-debug-modules Enable/disable debug info for specific modules],
5949 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
5951 dnl ========================================================
5952 dnl = Enable/disable generation of debugger info for specific modules only
5953 dnl = the special module name ALL_MODULES can be used to denote all modules
5954 dnl = module names beginning with ^ will be disabled
5955 dnl ========================================================
5956 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
5957 [ --enable-debugger-info-modules
5958 Enable/disable debugger info for specific modules],
5959 [ for i in `echo $enableval | sed 's/,/ /g'`; do
5960 dnl note that the list of module names is reversed as it is copied
5961 dnl this is important, as it will allow config.mk to interpret stuff like
5962 dnl "^ALL_MODULES xpcom" properly
5963 if test "$i" = "no"; then
5966 if test "$i" = "yes"; then
5969 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
5972 dnl ========================================================
5973 dnl Enable garbage collector
5974 dnl ========================================================
5975 MOZ_ARG_ENABLE_BOOL(boehm,
5976 [ --enable-boehm Enable the Boehm Garbage Collector],
5979 if test -n "$GC_LEAK_DETECTOR"; then
5980 AC_DEFINE(GC_LEAK_DETECTOR)
5983 dnl ========================================================
5984 dnl Disable runtime logging checks
5985 dnl ========================================================
5986 MOZ_ARG_DISABLE_BOOL(logging,
5987 [ --disable-logging Disable logging facilities],
5988 NS_DISABLE_LOGGING=1,
5989 NS_DISABLE_LOGGING= )
5990 if test "$NS_DISABLE_LOGGING"; then
5991 AC_DEFINE(NS_DISABLE_LOGGING)
5993 AC_DEFINE(MOZ_LOGGING)
5996 dnl ========================================================
5997 dnl = dnl This will enable logging of addref, release, ctor, dtor.
5998 dnl ========================================================
5999 _ENABLE_LOGREFCNT=42
6000 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6001 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6002 _ENABLE_LOGREFCNT=1,
6003 _ENABLE_LOGREFCNT= )
6004 if test "$_ENABLE_LOGREFCNT" = "1"; then
6005 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6006 elif test -z "$_ENABLE_LOGREFCNT"; then
6007 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6010 dnl ========================================================
6011 dnl = Enable trace malloc
6012 dnl ========================================================
6013 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6014 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6015 [ --enable-trace-malloc Enable malloc tracing],
6018 if test "$NS_TRACE_MALLOC"; then
6019 # Please, Mr. Linker Man, don't take away our symbol names
6020 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6022 AC_DEFINE(NS_TRACE_MALLOC)
6024 AC_SUBST(NS_TRACE_MALLOC)
6026 dnl ========================================================
6027 dnl = Enable jemalloc
6028 dnl ========================================================
6029 MOZ_ARG_ENABLE_BOOL(jemalloc,
6030 [ --enable-jemalloc Replace memory allocator with jemalloc],
6034 if test "$NS_TRACE_MALLOC"; then
6038 if test "$MOZ_MEMORY"; then
6040 dnl Don't try to run compiler tests on Windows
6041 if test "$OS_ARCH" = "WINNT"; then
6042 if test -z "$HAVE_64BIT_OS"; then
6043 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6045 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6048 AC_CHECK_SIZEOF([int *], [4])
6049 case "${ac_cv_sizeof_int_p}" in
6051 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6054 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6057 AC_MSG_ERROR([Unexpected pointer size])
6062 AC_DEFINE(MOZ_MEMORY)
6063 if test "x$MOZ_DEBUG" = "x1"; then
6064 AC_DEFINE(MOZ_MEMORY_DEBUG)
6066 dnl The generic feature tests that determine how to compute ncpus are long and
6067 dnl complicated. Therefore, simply define special cpp variables for the
6068 dnl platforms we have special knowledge of.
6069 case "${target_os}" in
6071 AC_DEFINE(MOZ_MEMORY_DARWIN)
6074 AC_DEFINE(MOZ_MEMORY_BSD)
6077 AC_DEFINE(MOZ_MEMORY_LINUX)
6080 AC_DEFINE(MOZ_MEMORY_BSD)
6083 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6085 msvc*|mks*|cygwin*|mingw*)
6086 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6087 dnl XXX: should test for vc8sp1 here, otherwise patching the crt src
6088 dnl will fail miserably
6089 if test "$_CC_SUITE" -lt "8"; then
6090 AC_MSG_ERROR([Building jemalloc requires Visual C++ 2005 or better])
6092 if test -z "$WIN32_CRT_SRC_DIR" -a -z "$WIN32_CUSTOM_CRT_DIR"; then
6093 if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6094 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.])
6096 WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6099 if test -z "$WIN32_CRT_SRC_DIR"; then
6101 WIN32_CUSTOM_CRT_DIR=`cd "$WIN32_CUSTOM_CRT_DIR" && pwd`
6102 _WIN_UNIX_CRT_PATH="$WIN32_CUSTOM_CRT_DIR"
6104 # CRT source directory
6105 WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd`
6106 _CRT_BASE_DIR=`basename "$WIN32_CRT_SRC_DIR"`
6107 _WIN_UNIX_CRT_PATH="$_objdir/memory/jemalloc/$_CRT_BASE_DIR/build/intel"
6109 dnl need win32 paths in LIB, hence this python abuse. extra brackets
6111 _WIN_CRT_PATH=[`$PYTHON -c 'import sys, os.path; print os.path.normpath(sys.argv[1])' "$_WIN_UNIX_CRT_PATH"`]
6112 MOZ_LIB="$_WIN_CRT_PATH;$LIB"
6113 dnl Needs to be in PATH too, since our tools will wind up linked against it.
6114 dnl This needs to be unix style.
6115 MOZ_PATH="$PATH:$_WIN_UNIX_CRT_PATH"
6116 dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6117 AC_DEFINE(_STATIC_CPPLIB)
6118 dnl Don't generate a manifest, since we're linking to a custom CRT.
6119 LDFLAGS="$LDFLAGS -MANIFEST:NO"
6120 dnl Also pass this to NSPR/NSS
6121 DLLFLAGS="$DLLFLAGS -MANIFEST:NO"
6125 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6129 AC_SUBST(MOZ_MEMORY)
6130 AC_SUBST(WIN32_CRT_SRC_DIR)
6131 AC_SUBST(WIN32_CUSTOM_CRT_DIR)
6134 dnl Need to set this for make because NSS doesn't have configure
6137 dnl ========================================================
6138 dnl = Use malloc wrapper lib
6139 dnl ========================================================
6140 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6141 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6145 if test -n "$_WRAP_MALLOC"; then
6146 if test "$GNU_CC"; then
6147 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"
6148 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6152 dnl ========================================================
6153 dnl = Location of malloc wrapper lib
6154 dnl ========================================================
6155 MOZ_ARG_WITH_STRING(wrap-malloc,
6156 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6157 WRAP_MALLOC_LIB=$withval)
6159 dnl ========================================================
6160 dnl = Use Electric Fence
6161 dnl ========================================================
6162 MOZ_ARG_ENABLE_BOOL(efence,
6163 [ --enable-efence Link with Electric Fence],
6166 if test -n "$_ENABLE_EFENCE"; then
6167 AC_CHECK_LIB(efence,malloc)
6170 dnl ========================================================
6172 dnl ========================================================
6173 MOZ_ARG_ENABLE_BOOL(jprof,
6174 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6177 if test -n "$MOZ_JPROF"; then
6178 AC_DEFINE(MOZ_JPROF)
6181 dnl ========================================================
6183 dnl ========================================================
6184 MOZ_ARG_ENABLE_BOOL(shark,
6185 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6188 if test -n "$MOZ_SHARK"; then
6189 AC_DEFINE(MOZ_SHARK)
6192 dnl ========================================================
6193 dnl = Enable stripping of libs & executables
6194 dnl ========================================================
6195 MOZ_ARG_ENABLE_BOOL(strip,
6196 [ --enable-strip Enable stripping of libs & executables ],
6200 dnl ========================================================
6201 dnl = Enable stripping of libs & executables when packaging
6202 dnl ========================================================
6203 MOZ_ARG_ENABLE_BOOL(install-strip,
6204 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6208 dnl ========================================================
6209 dnl = --enable-elf-dynstr-gc
6210 dnl ========================================================
6211 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6212 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6213 USE_ELF_DYNSTR_GC=1,
6214 USE_ELF_DYNSTR_GC= )
6216 dnl ========================================================
6217 dnl = --enable-old-abi-compat-wrappers
6218 dnl ========================================================
6219 dnl on x86 linux, the current builds of some popular plugins (notably
6220 dnl flashplayer and real) expect a few builtin symbols from libgcc
6221 dnl which were available in some older versions of gcc. However,
6222 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6223 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6224 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6225 dnl to true on x86 linux, and false everywhere else.
6228 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6229 [ --enable-old-abi-compat-wrappers
6230 Support old GCC ABI symbols to ease the pain
6231 of the linux compiler change],
6232 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6233 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6234 if test "$COMPILE_ENVIRONMENT"; then
6235 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6238 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6240 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6242 fi # COMPILE_ENVIRONMENT
6244 dnl ========================================================
6245 dnl = --enable-prebinding
6246 dnl ========================================================
6247 MOZ_ARG_ENABLE_BOOL(prebinding,
6248 [ --enable-prebinding Enable prebinding (Mac OS X only)],
6252 dnl ========================================================
6254 dnl = Profiling and Instrumenting
6256 dnl ========================================================
6257 MOZ_ARG_HEADER(Profiling and Instrumenting)
6259 dnl ========================================================
6260 dnl = Enable timeline service, which provides lightweight
6261 dnl = instrumentation of mozilla for performance measurement.
6262 dnl = Timeline is off by default.
6263 dnl ========================================================
6264 MOZ_ARG_ENABLE_BOOL(timeline,
6265 [ --enable-timeline Enable timeline services ],
6268 if test -n "$MOZ_TIMELINE"; then
6269 AC_DEFINE(MOZ_TIMELINE)
6272 dnl ========================================================
6273 dnl Turn on reflow counting
6274 dnl ========================================================
6275 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6276 [ --enable-reflow-perf Enable reflow performance tracing],
6279 if test -n "$MOZ_REFLOW_PREF"; then
6280 AC_DEFINE(MOZ_REFLOW_PREF)
6282 AC_SUBST(MOZ_REFLOW_PERF)
6284 dnl ========================================================
6285 dnl Enable performance metrics.
6286 dnl ========================================================
6287 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6288 [ --enable-perf-metrics Enable performance metrics],
6291 if test -n "$MOZ_PERF_METRICS"; then
6292 AC_DEFINE(MOZ_PERF_METRICS)
6295 dnl ========================================================
6296 dnl Enable code size metrics.
6297 dnl ========================================================
6298 MOZ_ARG_ENABLE_BOOL(codesighs,
6299 [ --enable-codesighs Enable code size analysis tools],
6300 _ENABLE_CODESIGHS=1,
6301 _ENABLE_CODESIGHS= )
6302 if test -n "$_ENABLE_CODESIGHS"; then
6303 if test -d $srcdir/tools/codesighs; then
6306 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6310 dnl ========================================================
6311 dnl = Add support for Eazel profiler
6312 dnl ========================================================
6313 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6314 [ --enable-eazel-profiler-support
6315 Enable Corel/Eazel profiler support],
6316 ENABLE_EAZEL_PROFILER=1,
6317 ENABLE_EAZEL_PROFILER= )
6318 if test -n "$ENABLE_EAZEL_PROFILER"; then
6319 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6321 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6322 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6323 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6326 MOZ_ARG_ENABLE_STRING(profile-modules,
6327 [ --enable-profile-modules
6328 Enable/disable profiling for specific modules],
6329 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6331 MOZ_ARG_ENABLE_BOOL(insure,
6332 [ --enable-insure Enable insure++ instrumentation (linux only)],
6335 if test -n "$_ENABLE_INSURE"; then
6339 MOZ_INSURE_EXCLUDE_DIRS="config"
6342 MOZ_ARG_WITH_STRING(insure-dirs,
6343 [ --with-insure-dirs=DIRS
6344 Dirs to instrument with insure ],
6345 MOZ_INSURE_DIRS=$withval )
6347 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6348 [ --with-insure-exclude-dirs=DIRS
6349 Dirs to not instrument with insure ],
6350 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6352 dnl ========================================================
6353 dnl = Support for Quantify (Windows)
6354 dnl ========================================================
6355 MOZ_ARG_ENABLE_BOOL(quantify,
6356 [ --enable-quantify Enable Quantify support (Windows only) ],
6360 dnl ========================================================
6361 dnl = Support for demangling undefined symbols
6362 dnl ========================================================
6363 if test -z "$SKIP_LIBRARY_CHECKS"; then
6366 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6370 # Demangle only for debug or trace-malloc builds
6371 MOZ_DEMANGLE_SYMBOLS=
6372 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6373 MOZ_DEMANGLE_SYMBOLS=1
6374 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6376 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6378 dnl ========================================================
6379 dnl = Support for gcc stack unwinding (from gcc 3.3)
6380 dnl ========================================================
6381 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6382 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6385 dnl ========================================================
6389 dnl ========================================================
6390 MOZ_ARG_HEADER(Misc. Options)
6392 dnl ========================================================
6393 dnl update xterm title
6394 dnl ========================================================
6395 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6396 [ --enable-xterm-updates Update XTERM titles with current command.],
6400 dnl =========================================================
6402 dnl =========================================================
6403 MOZ_ARG_ENABLE_STRING([chrome-format],
6404 [ --enable-chrome-format=jar|flat|both|symlink
6405 Select FORMAT of chrome files (default=jar)],
6406 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6408 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6409 MOZ_CHROME_FILE_FORMAT=jar
6412 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6413 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6414 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6415 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6416 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6419 dnl ========================================================
6420 dnl = Define default location for MOZILLA_FIVE_HOME
6421 dnl ========================================================
6422 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6423 [ --with-default-mozilla-five-home
6424 Set the default value for MOZILLA_FIVE_HOME],
6425 [ val=`echo $withval`
6426 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
6428 dnl ========================================================
6429 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
6430 dnl ========================================================
6431 MOZ_ARG_WITH_STRING(user-appdir,
6432 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
6433 [ val=`echo $withval`
6434 if echo "$val" | grep "\/" >/dev/null; then
6435 AC_MSG_ERROR("Homedir must be single relative path.")
6440 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
6442 dnl ========================================================
6443 dnl = Doxygen configuration
6444 dnl ========================================================
6445 dnl Use commas to specify multiple dirs to this arg
6446 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
6447 MOZ_ARG_WITH_STRING(doc-input-dirs,
6448 [ --with-doc-input-dirs=DIRS
6449 Header/idl dirs to create docs from],
6450 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6451 AC_SUBST(MOZ_DOC_INPUT_DIRS)
6453 dnl Use commas to specify multiple dirs to this arg
6454 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
6455 MOZ_ARG_WITH_STRING(doc-include-dirs,
6456 [ --with-doc-include-dirs=DIRS
6457 Include dirs to preprocess doc headers],
6458 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6459 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
6461 MOZ_DOC_OUTPUT_DIR='./dist/docs'
6462 MOZ_ARG_WITH_STRING(doc-output-dir,
6463 [ --with-doc-output-dir=DIR
6464 Dir to generate docs into],
6465 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
6466 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
6468 if test -z "$SKIP_COMPILER_CHECKS"; then
6469 dnl ========================================================
6471 dnl = Compiler Options
6473 dnl ========================================================
6474 MOZ_ARG_HEADER(Compiler Options)
6476 dnl ========================================================
6477 dnl Check for gcc -pipe support
6478 dnl ========================================================
6479 AC_MSG_CHECKING([for gcc -pipe support])
6480 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
6481 echo '#include <stdio.h>' > dummy-hello.c
6482 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
6483 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
6484 cat dummy-hello.s | ${AS_BIN} -o dummy-hello.S - 2>&5
6485 if test $? = 0; then
6490 if test "$_res_as_stdin" = "yes"; then
6491 _SAVE_CFLAGS=$CFLAGS
6492 CFLAGS="$CFLAGS -pipe"
6493 AC_TRY_COMPILE( [ #include <stdio.h> ],
6494 [printf("Hello World\n");],
6495 [_res_gcc_pipe="yes"],
6496 [_res_gcc_pipe="no"] )
6497 CFLAGS=$_SAVE_CFLAGS
6499 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
6501 CFLAGS="$CFLAGS -pipe"
6502 CXXFLAGS="$CXXFLAGS -pipe"
6506 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
6507 AC_MSG_RESULT([$_res])
6512 dnl pass -Wno-long-long to the compiler
6513 MOZ_ARG_ENABLE_BOOL(long-long-warning,
6514 [ --enable-long-long-warning
6515 Warn about use of non-ANSI long long type],
6516 _IGNORE_LONG_LONG_WARNINGS=,
6517 _IGNORE_LONG_LONG_WARNINGS=1)
6519 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
6520 _SAVE_CFLAGS="$CFLAGS"
6521 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
6522 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
6523 AC_TRY_COMPILE([], [return(0);],
6524 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6525 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6526 result="yes" ], result="no")
6527 AC_MSG_RESULT([$result])
6528 CFLAGS="$_SAVE_CFLAGS"
6531 dnl ========================================================
6532 dnl Profile guided optimization
6533 dnl ========================================================
6534 dnl Test for profiling options
6535 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
6536 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
6538 _SAVE_CFLAGS="$CFLAGS"
6539 CFLAGS="$CFLAGS -fprofile-generate"
6541 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
6542 AC_TRY_COMPILE([], [return 0;],
6543 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
6544 result="yes" ], result="no")
6545 AC_MSG_RESULT([$result])
6547 if test $result = "yes"; then
6548 PROFILE_GEN_LDFLAGS="-fprofile-generate"
6549 PROFILE_USE_CFLAGS="-fprofile-use"
6550 PROFILE_USE_LDFLAGS="-fprofile-use"
6552 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
6553 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
6554 AC_TRY_COMPILE([], [return 0;],
6555 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
6556 result="yes" ], result="no")
6557 AC_MSG_RESULT([$result])
6558 if test $result = "yes"; then
6559 PROFILE_USE_CFLAGS="-fbranch-probabilities"
6561 # don't really care, this is an old GCC
6562 PROFILE_GEN_LDFLAGS=
6563 PROFILE_USE_LDFLAGS=
6566 CFLAGS="$_SAVE_CFLAGS"
6568 AC_SUBST(PROFILE_GEN_CFLAGS)
6569 AC_SUBST(PROFILE_GEN_LDFLAGS)
6570 AC_SUBST(PROFILE_USE_CFLAGS)
6571 AC_SUBST(PROFILE_USE_LDFLAGS)
6575 dnl ========================================================
6576 dnl Test for -pedantic bustage
6577 dnl ========================================================
6578 MOZ_ARG_DISABLE_BOOL(pedantic,
6579 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
6581 if test "$_PEDANTIC"; then
6582 _SAVE_CXXFLAGS=$CXXFLAGS
6583 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6584 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
6585 AC_TRY_COMPILE([$configure_static_assert_macros],
6586 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
6587 result="no", result="yes" )
6588 AC_MSG_RESULT([$result])
6589 CXXFLAGS="$_SAVE_CXXFLAGS"
6593 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
6594 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6597 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
6602 dnl ========================================================
6603 dnl Test for correct temporary object destruction order
6604 dnl ========================================================
6605 dnl We want to make sure the compiler follows the C++ spec here as
6606 dnl xpcom and the string classes depend on it (bug 235381).
6607 AC_MSG_CHECKING([for correct temporary object destruction order])
6608 AC_TRY_RUN([ class A {
6609 public: A(int& x) : mValue(x) {}
6611 operator char**() { return 0; }
6612 private: int& mValue;
6614 void func(char **arg) {}
6625 result="yes", result="no", result="maybe")
6626 AC_MSG_RESULT([$result])
6628 if test "$result" = "no"; then
6629 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
6632 dnl ========================================================
6633 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
6634 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
6635 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
6636 dnl ========================================================
6637 _SAVE_CXXFLAGS=$CXXFLAGS
6638 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
6639 AC_CACHE_CHECK(for correct overload resolution with const and templates,
6640 ac_nscap_nonconst_opeq_bug,
6649 template <class T, class U>
6650 int operator==(const Pointer<T>& rhs, U* lhs)
6652 return rhs.myPtr == lhs;
6655 template <class T, class U>
6656 int operator==(const Pointer<T>& rhs, const U* lhs)
6658 return rhs.myPtr == lhs;
6666 ac_nscap_nonconst_opeq_bug="no",
6667 ac_nscap_nonconst_opeq_bug="yes")])
6668 CXXFLAGS="$_SAVE_CXXFLAGS"
6670 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
6671 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
6673 fi # SKIP_COMPILER_CHECKS
6675 dnl ========================================================
6677 dnl Should be smarter and check that the compiler does indeed have rtti
6678 dnl ========================================================
6679 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
6680 [ --enable-cpp-rtti Enable C++ RTTI ],
6681 [ _MOZ_USE_RTTI=1 ],
6684 if test "$_MOZ_USE_RTTI"; then
6685 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
6687 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
6690 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
6692 dnl ========================================================
6693 dnl C++ exceptions (g++/egcs only - for now)
6694 dnl Should be smarter and check that the compiler does indeed have exceptions
6695 dnl ========================================================
6696 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
6697 [ --enable-cpp-exceptions Enable C++ exceptions ],
6698 [ _MOZ_CPP_EXCEPTIONS=1 ],
6699 [ _MOZ_CPP_EXCEPTIONS= ])
6701 if test "$_MOZ_CPP_EXCEPTIONS"; then
6702 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
6704 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
6707 # Irix & OSF native compilers do not like exception declarations
6708 # when exceptions are disabled
6709 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
6710 AC_DEFINE(CPP_THROW_NEW, [])
6712 AC_DEFINE(CPP_THROW_NEW, [throw()])
6716 dnl ========================================================
6718 dnl = Build depencency options
6720 dnl ========================================================
6721 MOZ_ARG_HEADER(Build dependencies)
6723 dnl ========================================================
6724 dnl = Do not auto generate dependency info
6725 dnl ========================================================
6727 MOZ_ARG_DISABLE_BOOL(auto-deps,
6728 [ --disable-auto-deps Do not automatically generate dependency info],
6732 if test -n "$MOZ_AUTO_DEPS"; then
6733 dnl ========================================================
6734 dnl = Use mkdepend instead of $CC -MD for dependency generation
6735 dnl ========================================================
6737 MOZ_ARG_DISABLE_BOOL(md,
6738 [ --disable-md Do not use compiler-based dependencies ],
6741 [dnl Default is to turn on -MD if using GNU-compatible compilers
6742 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
6745 dnl Default is to use -xM if using Sun Studio on Solaris
6746 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6749 if test "$_cpp_md_flag"; then
6751 if test "$OS_ARCH" = "OpenVMS"; then
6752 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(*F).pp))'
6754 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(*F).pp)'
6756 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
6757 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6762 _USE_CPP_INCLUDE_FLAG=
6763 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6764 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6768 AC_SUBST(MOZ_AUTO_DEPS)
6769 AC_SUBST(COMPILER_DEPEND)
6773 dnl ========================================================
6775 dnl = Static Build Options
6777 dnl ========================================================
6778 MOZ_ARG_HEADER(Static build options)
6780 MOZ_ARG_ENABLE_BOOL(static,
6781 [ --enable-static Enable building of internal static libs],
6782 BUILD_STATIC_LIBS=1,
6785 dnl Disable libxul in debug builds, but not for xulrunner.
6786 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
6790 MOZ_ARG_ENABLE_BOOL(libxul,
6791 [ --enable-libxul Enable building of libxul],
6792 MOZ_ENABLE_LIBXUL=1,
6795 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
6796 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
6799 if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
6800 AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
6803 if test -n "$MOZ_ENABLE_LIBXUL"; then
6804 XPCOM_LIBS="$LIBXUL_LIBS"
6805 AC_DEFINE(MOZ_ENABLE_LIBXUL)
6807 if test -n "$BUILD_STATIC_LIBS"; then
6808 AC_DEFINE(MOZ_STATIC_BUILD)
6810 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
6813 dnl ========================================================
6814 dnl = Force JS to be a static lib
6815 dnl ========================================================
6816 MOZ_ARG_ENABLE_BOOL(js-static-build,
6817 [ --enable-js-static-build Force js to be a static lib],
6821 AC_SUBST(JS_STATIC_BUILD)
6823 if test -n "$JS_STATIC_BUILD"; then
6824 AC_DEFINE(EXPORT_JS_API)
6826 if test -z "$BUILD_STATIC_LIBS"; then
6827 AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static])
6832 dnl Disable static mail in debug builds, but not with libxul sdk.
6833 if test -n "$MOZ_DEBUG" -a -z "$LIBXUL_SDK"; then
6834 MOZ_STATIC_MAIL_BUILD=
6836 MOZ_ARG_ENABLE_BOOL(static-mail,
6837 [ --enable-static-mail Enable static mail build support],
6838 MOZ_STATIC_MAIL_BUILD=1,
6839 MOZ_STATIC_MAIL_BUILD= )
6841 if test "$MOZ_STATIC_MAIL_BUILD"; then
6842 AC_DEFINE(MOZ_STATIC_MAIL_BUILD)
6845 AC_SUBST(MOZ_STATIC_MAIL_BUILD)
6847 dnl ========================================================
6849 dnl = Standalone module options
6851 dnl ========================================================
6852 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
6854 dnl Check for GLib and libIDL.
6855 dnl ========================================================
6856 case "$target_os" in
6857 msvc*|mks*|cygwin*|mingw*|wince*)
6858 SKIP_IDL_CHECK="yes"
6865 if test -z "$COMPILE_ENVIRONMENT"; then
6866 SKIP_IDL_CHECK="yes"
6869 dnl = Allow users to disable libIDL checking for standalone modules
6870 MOZ_ARG_WITHOUT_BOOL(libIDL,
6871 [ --without-libIDL Skip check for libIDL (standalone modules only)],
6872 SKIP_IDL_CHECK="yes")
6874 if test "$SKIP_IDL_CHECK" = "no"
6877 if test "$MACOS_SDK_DIR"; then
6878 dnl xpidl, and therefore libIDL, is only needed on the build host.
6879 dnl Don't build it against the SDK, as that causes problems.
6880 _MACSAVE_CFLAGS="$CFLAGS"
6881 _MACSAVE_LIBS="$LIBS"
6882 _MACSAVE_LDFLAGS="$LDFLAGS"
6883 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
6885 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"`
6886 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
6887 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
6892 if test "$MOZ_ENABLE_GTK2"; then
6893 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
6895 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
6896 dnl to either libIDL1 or libIDL2.
6897 if test -z "$_LIBIDL_FOUND"; then
6898 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
6899 if test -z "$_LIBIDL_FOUND"; then
6900 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
6904 dnl If we don't have a libIDL config program & not cross-compiling,
6905 dnl look for orbit-config instead.
6907 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
6908 AC_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
6909 if test -n "$ORBIT_CONFIG"; then
6910 AC_MSG_CHECKING([for ORBit libIDL usability])
6911 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
6912 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
6913 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
6914 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
6915 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
6916 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
6918 _SAVE_CFLAGS="$CFLAGS"
6920 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
6921 LIBS="$LIBIDL_LIBS $LIBS"
6924 #include <libIDL/IDL.h>
6927 s=strdup(IDL_get_libver_string());
6940 AC_MSG_RESULT($result)
6941 CFLAGS="$_SAVE_CFLAGS"
6945 if test -z "$_LIBIDL_FOUND"; then
6946 AC_MSG_ERROR([libIDL not found.
6947 libIDL $LIBIDL_VERSION or higher is required.])
6949 if test "$MACOS_SDK_DIR"; then
6950 CFLAGS="$_MACSAVE_CFLAGS"
6951 LIBS="$_MACSAVE_LIBS"
6952 LDFLAGS="$_MACSAVE_LDFLAGS"
6953 if test -n "$_MACSAVE_NEXT_ROOT" ; then
6954 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
6959 if test -n "$CROSS_COMPILE"; then
6960 if test -z "$HOST_LIBIDL_CONFIG"; then
6961 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
6963 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
6964 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
6965 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
6967 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
6968 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
6972 if test -z "$SKIP_PATH_CHECKS"; then
6973 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
6974 if test "$MOZ_ENABLE_GTK2"; then
6975 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
6977 AM_PATH_GLIB(${GLIB_VERSION})
6982 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
6983 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
6986 AC_SUBST(LIBIDL_CFLAGS)
6987 AC_SUBST(LIBIDL_LIBS)
6988 AC_SUBST(STATIC_LIBIDL)
6989 AC_SUBST(GLIB_CFLAGS)
6991 AC_SUBST(GLIB_GMODULE_LIBS)
6992 AC_SUBST(HOST_LIBIDL_CONFIG)
6993 AC_SUBST(HOST_LIBIDL_CFLAGS)
6994 AC_SUBST(HOST_LIBIDL_LIBS)
6996 dnl ========================================================
6997 dnl Check for libart
6998 dnl ========================================================
6999 if test "$MOZ_SVG_RENDERER_LIBART"; then
7000 if test ! -f $topsrcdir/other-licenses/libart_lgpl/Makefile.in; then
7001 AC_MSG_ERROR([You must check out the mozilla version of libart. Use
7002 mk_add_options MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl])
7005 dnl libart's configure hasn't been run yet, but we know what the
7006 dnl answer should be anyway
7007 MOZ_LIBART_CFLAGS='-I${DIST}/include/libart_lgpl'
7008 case "$target_os" in
7009 msvc*|mks*|cygwin*|mingw*|wince*)
7010 MOZ_LIBART_LIBS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)moz_art_lgpl.$(IMPORT_LIB_SUFFIX)'
7013 MOZ_LIBART_LIBS='-lmoz_art -lm'
7016 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lroot -lbe'
7019 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lm'
7025 AC_SUBST(MOZ_LIBART_CFLAGS)
7026 AC_SUBST(MOZ_LIBART_LIBS)
7028 dnl ========================================================
7030 dnl ========================================================
7031 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7034 MOZ_ARG_ENABLE_BOOL(system-cairo,
7035 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7039 # Check for headers defining standard int types.
7040 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7042 if test "$MOZ_TREE_CAIRO"; then
7043 AC_DEFINE(MOZ_TREE_CAIRO)
7045 # For now we assume that we will have a uint64_t available through
7046 # one of the above headers or mozstdint.h.
7047 AC_DEFINE(HAVE_UINT64_T)
7049 # Define macros for cairo-features.h
7050 if test "$MOZ_X11"; then
7051 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7052 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7053 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7054 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7055 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7056 MOZ_ENABLE_CAIRO_FT=1
7057 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7059 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7060 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7061 ATSUI_FONT_FEATURE="#define CAIRO_HAS_ATSUI_FONT 1"
7063 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7064 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7065 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7066 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7068 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7069 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7070 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7071 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7072 MOZ_ENABLE_CAIRO_FT=1
7073 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7074 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7076 if test "$MOZ_ENABLE_GLITZ"; then
7077 GLITZ_SURFACE_FEATURE="#define CAIRO_HAS_GLITZ_SURFACE 1"
7079 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7080 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7081 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7082 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7083 MOZ_ENABLE_CAIRO_FT=1
7085 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7086 AC_SUBST(CAIRO_FT_CFLAGS)
7088 if test "$MOZ_DEBUG"; then
7089 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7091 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7094 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7096 AC_SUBST(PS_SURFACE_FEATURE)
7097 AC_SUBST(PDF_SURFACE_FEATURE)
7098 AC_SUBST(SVG_SURFACE_FEATURE)
7099 AC_SUBST(XLIB_SURFACE_FEATURE)
7100 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7101 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7102 AC_SUBST(NQUARTZ_SURFACE_FEATURE)
7103 AC_SUBST(XCB_SURFACE_FEATURE)
7104 AC_SUBST(WIN32_SURFACE_FEATURE)
7105 AC_SUBST(OS2_SURFACE_FEATURE)
7106 AC_SUBST(BEOS_SURFACE_FEATURE)
7107 AC_SUBST(GLITZ_SURFACE_FEATURE)
7108 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7109 AC_SUBST(FT_FONT_FEATURE)
7110 AC_SUBST(WIN32_FONT_FEATURE)
7111 AC_SUBST(ATSUI_FONT_FEATURE)
7112 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7114 if test "$_WIN32_MSVC"; then
7115 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7116 if test "$MOZ_ENABLE_GLITZ"; then
7117 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'$(DEPTH)/gfx/cairo/glitz/src/mozglitz.lib $(DEPTH)/gfx/cairo/glitz/src/wgl/mozglitzwgl.lib'
7120 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"
7122 if test "$MOZ_X11"; then
7123 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7126 if test "$MOZ_ENABLE_GLITZ"; then
7127 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src -lmozglitz'
7128 if test "$MOZ_X11"; then
7129 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/glx -lmozglitzglx -lGL'
7131 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7132 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/wgl -lmozglitzwgl'
7137 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7138 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7139 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7140 if test "$MOZ_X11"; then
7141 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7142 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7143 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7147 AC_SUBST(MOZ_TREE_CAIRO)
7148 AC_SUBST(MOZ_CAIRO_CFLAGS)
7149 AC_SUBST(MOZ_CAIRO_LIBS)
7151 dnl ========================================================
7153 dnl ========================================================
7156 MOZ_ARG_ENABLE_BOOL(system-lcms,
7157 [ --enable-system-lcms Use system lcms (located with pkgconfig)],
7161 if test -z "$MOZ_NATIVE_LCMS"
7164 if test "$_WIN32_MSVC"; then
7165 if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
7166 LCMS_CFLAGS=-DLCMS_DLL
7168 LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
7170 LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
7173 PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_VERSION)
7176 AC_SUBST(MOZ_NATIVE_LCMS)
7177 AC_SUBST(LCMS_CFLAGS)
7180 dnl ========================================================
7182 dnl ========================================================
7183 MOZ_ARG_DISABLE_BOOL(xul,
7184 [ --disable-xul Disable XUL],
7186 if test "$MOZ_XUL"; then
7189 dnl remove extensions that require XUL
7190 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7195 dnl ========================================================
7196 dnl Two ways to enable Python support:
7197 dnl --enable-extensions=python # select all available.
7198 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7200 dnl --enable-extensions=python/xpcom,... # select individual ones
7202 dnl If either is used, we locate the Python to use.
7203 dnl ========================================================
7205 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7206 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7207 dnl Allow PYTHON to point to the Python interpreter to use
7208 dnl (note that it must be the python executable - which we
7209 dnl run to locate the relevant paths etc)
7210 dnl If not set, we use whatever Python we can find.
7212 dnl Ask Python what its version number is
7214 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7215 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7217 dnl Ask for the Python "prefix" (ie, home/source dir)
7218 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7219 dnl Setup the include and library directories.
7220 if test "$OS_ARCH" = "WINNT"; then
7221 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7222 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7223 dnl Binary trees have "include" for .h, and "libs" for .lib
7224 dnl We add 'em both - along with quotes, to handle spaces.
7225 MOZ_PYTHON_DLL_SUFFIX=.pyd
7226 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7227 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7229 dnl Non-Windows include and libs
7230 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7231 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7232 dnl Check for dynamic Python lib
7233 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7234 dnl - core, xpcom loader, pydom etc) all need to share Python.
7235 dnl - Python 2.3's std --enable-shared configure option will
7236 dnl create a libpython2.3.so.1.0. We should first try this
7237 dnl dotted versioned .so file because this is the one that
7238 dnl the PyXPCOM build mechanics tries to link to.
7239 dnl XXX Should find a better way than hardcoding "1.0".
7240 dnl - Python developement tree dir layouts are NOT allowed here
7241 dnl because the PyXPCOM build just dies on it later anyway.
7242 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7243 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7244 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7245 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7246 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7247 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7248 dnl Don't Python development tree directory layout.
7249 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7250 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.])
7251 elif test "$OS_ARCH" = "Darwin"; then
7252 dnl We do Darwin last, so if a custom non-framework build of
7253 dnl python is used on OSX, then it will be picked up first by
7254 dnl the logic above.
7255 MOZ_PYTHON_LIBS="-framework Python"
7257 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7259 if test "$OS_ARCH" = "Linux"; then
7260 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7263 dnl Handle "_d" on Windows
7264 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7265 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7267 MOZ_PYTHON_DEBUG_SUFFIX=
7269 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7272 dnl If the user asks for the 'python' extension, then we add
7273 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7274 dnl Note the careful regex - it must match 'python' followed by anything
7275 dnl other than a '/', including the end-of-string.
7276 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7277 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7278 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7281 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7282 dnl command-line, but not yet
7283 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7284 AC_SUBST(MOZ_PYTHON)
7285 AC_SUBST(MOZ_PYTHON_PREFIX)
7286 AC_SUBST(MOZ_PYTHON_INCLUDES)
7287 AC_SUBST(MOZ_PYTHON_LIBS)
7288 AC_SUBST(MOZ_PYTHON_VER)
7289 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7290 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7291 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7293 dnl ========================================================
7294 dnl disable profile sharing
7295 dnl ========================================================
7296 MOZ_ARG_DISABLE_BOOL(profilesharing,
7297 [ --disable-profilesharing Disable profile sharing],
7298 MOZ_PROFILESHARING=,
7299 MOZ_PROFILESHARING=1 )
7300 if test "$MOZ_PROFILESHARING"; then
7302 AC_DEFINE(MOZ_PROFILESHARING)
7305 dnl ========================================================
7307 dnl ========================================================
7308 MOZ_ARG_ENABLE_BOOL(ipcd,
7309 [ --enable-ipcd Enable IPC daemon],
7313 dnl ========================================================
7314 dnl disable profile locking
7315 dnl do no use this in applications that can have more than
7316 dnl one process accessing the profile directory.
7317 dnl ========================================================
7318 MOZ_ARG_DISABLE_BOOL(profilelocking,
7319 [ --disable-profilelocking Disable profile locking],
7320 MOZ_PROFILELOCKING=,
7321 MOZ_PROFILELOCKING=1 )
7322 if test "$MOZ_PROFILELOCKING"; then
7323 AC_DEFINE(MOZ_PROFILELOCKING)
7326 dnl ========================================================
7327 dnl disable rdf services
7328 dnl ========================================================
7329 MOZ_ARG_DISABLE_BOOL(rdf,
7330 [ --disable-rdf Disable RDF],
7332 if test "$MOZ_RDF"; then
7338 dnl ========================================================
7339 dnl necko configuration options
7340 dnl ========================================================
7343 dnl option to disable various necko protocols
7345 MOZ_ARG_ENABLE_STRING(necko-protocols,
7346 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7347 Enable/disable specific protocol handlers],
7348 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7349 if test "$option" = "yes" || test "$option" = "all"; then
7350 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7351 elif test "$option" = "no" || test "$option" = "none"; then
7353 elif test "$option" = "default"; then
7354 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7355 elif test `echo "$option" | grep -c \^-` != 0; then
7356 option=`echo $option | sed 's/^-//'`
7357 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7359 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7362 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7364 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7365 AC_SUBST(NECKO_PROTOCOLS)
7366 for p in $NECKO_PROTOCOLS; do
7367 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7371 dnl option to disable necko's disk cache
7373 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7374 [ --disable-necko-disk-cache
7375 Disable necko disk cache],
7378 AC_SUBST(NECKO_DISK_CACHE)
7379 if test "$NECKO_DISK_CACHE"; then
7380 AC_DEFINE(NECKO_DISK_CACHE)
7384 dnl option to minimize size of necko's i/o buffers
7386 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7387 [ --enable-necko-small-buffers
7388 Minimize size of necko's i/o buffers],
7389 NECKO_SMALL_BUFFERS=1,
7390 NECKO_SMALL_BUFFERS=)
7391 AC_SUBST(NECKO_SMALL_BUFFERS)
7392 if test "$NECKO_SMALL_BUFFERS"; then
7393 AC_DEFINE(NECKO_SMALL_BUFFERS)
7397 dnl option to disable cookies
7399 MOZ_ARG_DISABLE_BOOL(cookies,
7400 [ --disable-cookies Disable cookie support],
7403 AC_SUBST(NECKO_COOKIES)
7404 if test "$NECKO_COOKIES"; then
7405 AC_DEFINE(NECKO_COOKIES)
7408 dnl NECKO_ configuration options are not global
7409 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7411 dnl ========================================================
7412 dnl string api compatibility
7413 dnl ========================================================
7414 MOZ_ARG_DISABLE_BOOL(v1-string-abi,
7415 [ --disable-v1-string-abi Disable binary compatibility layer for strings],
7417 MOZ_V1_STRING_ABI=1)
7418 AC_SUBST(MOZ_V1_STRING_ABI)
7419 if test "$MOZ_V1_STRING_ABI"; then
7420 AC_DEFINE(MOZ_V1_STRING_ABI)
7423 dnl Only build Mork if it's required
7425 if test "$MOZ_MORK"; then
7429 dnl Build the lightweight Mork reader if required
7430 AC_SUBST(MOZ_MORKREADER)
7431 if test "$MOZ_MORKREADER"; then
7432 AC_DEFINE(MOZ_MORKREADER)
7435 dnl ========================================================
7436 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7437 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7440 if test "$MOZ_LDAP_XPCOM"; then
7441 LDAP_CFLAGS='-I${DIST}/public/ldap'
7442 if test "$OS_ARCH" = "WINNT"; then
7443 if test -n "$GNU_CC"; then
7444 LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
7446 LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)nsldap32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldappr32v60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)nsldif32v60.${IMPORT_LIB_SUFFIX}'
7448 elif test "$OS_ARCH" = "OS2"; then
7449 LDAP_LIBS='$(DIST)/lib/$(LIB_PREFIX)ldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)prldap60.${IMPORT_LIB_SUFFIX} $(DIST)/lib/$(LIB_PREFIX)ldif60.${IMPORT_LIB_SUFFIX}'
7451 LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
7455 if test "$COMPILE_ENVIRONMENT"; then
7456 if test "$SUNCTL"; then
7457 dnl older versions of glib do not seem to have gmodule which ctl needs
7458 _SAVE_CFLAGS=$CFLAGS
7459 CFLAGS="$CFLAGS $GLIB_CFLAGS"
7462 AC_TRY_COMPILE([#include <gmodule.h>],
7463 [ int x = 1; x++; ],,
7464 [AC_MSG_ERROR([Cannot build ctl without gmodule support in glib.])])
7466 CFLAGS=$_SAVE_CFLAGS
7469 fi # COMPILE_ENVIRONMENT
7471 dnl ========================================================
7473 dnl = Maintainer debug option (no --enable equivalent)
7475 dnl ========================================================
7480 AC_SUBST(AR_EXTRACT)
7484 AC_SUBST(AS_DASH_C_FLAG)
7489 AC_SUBST(USE_SHORT_LIBNAME)
7493 AC_SUBST(NS_USE_NATIVE)
7494 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7495 AC_SUBST(MOZ_GFX_TOOLKIT)
7496 AC_SUBST(MOZ_UPDATE_XTERM)
7498 AC_SUBST(MOZ_AUTH_EXTENSION)
7499 AC_SUBST(MOZ_MATHML)
7500 AC_SUBST(MOZ_PERMISSIONS)
7502 AC_SUBST(MOZ_XMLEXTRAS)
7503 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7504 AC_SUBST(MOZ_WEBSERVICES)
7505 AC_SUBST(MOZ_PREF_EXTENSIONS)
7507 AC_SUBST(MOZ_SVG_FOREIGNOBJECT)
7508 AC_SUBST(MOZ_XSLT_STANDALONE)
7509 AC_SUBST(MOZ_JS_LIBS)
7512 AC_SUBST(MOZ_DEBUG_MODULES)
7513 AC_SUBST(MOZ_PROFILE_MODULES)
7514 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7515 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7516 AC_SUBST(MOZ_DEBUG_FLAGS)
7517 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7518 AC_SUBST(WARNINGS_AS_ERRORS)
7519 AC_SUBST(MOZ_DBGRINFO_MODULES)
7520 AC_SUBST(MOZ_EXTENSIONS)
7521 AC_SUBST(MOZ_IMG_DECODERS)
7522 AC_SUBST(MOZ_IMG_ENCODERS)
7523 AC_SUBST(MOZ_JSDEBUGGER)
7525 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7526 AC_SUBST(MOZ_PLUGINS)
7527 AC_SUBST(ENABLE_EAZEL_PROFILER)
7528 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7529 AC_SUBST(EAZEL_PROFILER_LIBS)
7530 AC_SUBST(MOZ_PERF_METRICS)
7531 AC_SUBST(GC_LEAK_DETECTOR)
7532 AC_SUBST(MOZ_LOG_REFCNT)
7536 AC_SUBST(MOZ_XPCTOOLS)
7537 AC_SUBST(MOZ_JSLOADER)
7538 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7539 AC_SUBST(MOZ_INSURE)
7540 AC_SUBST(MOZ_INSURE_DIRS)
7541 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7542 AC_SUBST(MOZ_QUANTIFY)
7543 AC_SUBST(MOZ_INSURIFYING)
7544 AC_SUBST(MOZ_LDAP_XPCOM)
7545 AC_SUBST(MOZ_LDAP_XPCOM_EXPERIMENTAL)
7546 AC_SUBST(LDAP_CFLAGS)
7549 AC_SUBST(MOZ_PLACES)
7550 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7551 AC_SUBST(MOZ_STORAGE)
7553 AC_SUBST(NS_PRINTING)
7555 AC_SUBST(MOZ_JAVAXPCOM)
7556 AC_SUBST(JAVA_INCLUDE_PATH)
7561 AC_SUBST(MOZ_PROFILESHARING)
7562 AC_SUBST(MOZ_PROFILELOCKING)
7567 AC_SUBST(MOZ_XIE_LIBS)
7568 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
7570 AC_SUBST(XPCOM_USE_LEA)
7571 AC_SUBST(BUILD_STATIC_LIBS)
7572 AC_SUBST(MOZ_ENABLE_LIBXUL)
7573 AC_SUBST(ENABLE_TESTS)
7576 AC_SUBST(MOZ_UNIVERSALCHARDET)
7577 AC_SUBST(ACCESSIBILITY)
7578 AC_SUBST(MOZ_XPINSTALL)
7579 AC_SUBST(MOZ_VIEW_SOURCE)
7580 AC_SUBST(MOZ_SPELLCHECK)
7581 AC_SUBST(MOZ_XPFE_COMPONENTS)
7582 AC_SUBST(MOZ_USER_DIR)
7583 AC_SUBST(MOZ_CRASHREPORTER)
7584 AC_SUBST(MOZ_MOCHITEST)
7586 AC_SUBST(ENABLE_STRIP)
7587 AC_SUBST(PKG_SKIP_STRIP)
7588 AC_SUBST(USE_ELF_DYNSTR_GC)
7589 AC_SUBST(USE_PREBINDING)
7590 AC_SUBST(INCREMENTAL_LINKER)
7591 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
7592 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
7593 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
7595 AC_SUBST(MOZ_FIX_LINK_PATHS)
7596 AC_SUBST(XPCOM_LIBS)
7597 AC_SUBST(XPCOM_FROZEN_LDOPTS)
7598 AC_SUBST(XPCOM_GLUE_LDOPTS)
7599 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
7601 AC_SUBST(USE_DEPENDENT_LIBS)
7603 AC_SUBST(MOZ_BUILD_ROOT)
7604 AC_SUBST(MOZ_OS2_TOOLS)
7605 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
7607 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
7608 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
7609 AC_SUBST(MOZ_TIMELINE)
7611 AC_SUBST(TARGET_DEVICE)
7613 AC_SUBST(MOZ_APP_NAME)
7614 AC_SUBST(MOZ_APP_DISPLAYNAME)
7615 AC_SUBST(MOZ_APP_VERSION)
7616 AC_SUBST(FIREFOX_VERSION)
7617 AC_SUBST(THUNDERBIRD_VERSION)
7618 AC_SUBST(SUNBIRD_VERSION)
7619 AC_SUBST(SEAMONKEY_VERSION)
7621 AC_SUBST(MOZ_PKG_SPECIAL)
7623 AC_SUBST(MOZILLA_OFFICIAL)
7624 AC_SUBST(BUILD_OFFICIAL)
7625 AC_SUBST(MOZ_MILESTONE_RELEASE)
7628 AC_SUBST(MOZ_PROFILE)
7629 AC_SUBST(MOZ_DEBUG_SYMBOLS)
7630 AC_SUBST(MOZ_MAPINFO)
7631 AC_SUBST(MOZ_BROWSE_INFO)
7632 AC_SUBST(MOZ_TOOLS_DIR)
7633 AC_SUBST(CYGWIN_WRAPPER)
7635 AC_SUBST(WIN32_REDIST_DIR)
7638 dnl Echo the CFLAGS to remove extra whitespace.
7645 $_MOZ_EXCEPTIONS_FLAGS \
7646 $_WARNINGS_CXXFLAGS \
7649 COMPILE_CFLAGS=`echo \
7654 COMPILE_CXXFLAGS=`echo \
7655 $_DEFINES_CXXFLAGS \
7659 AC_SUBST(SYSTEM_MAKEDEPEND)
7660 AC_SUBST(SYSTEM_JPEG)
7661 AC_SUBST(SYSTEM_PNG)
7662 AC_SUBST(SYSTEM_ZLIB)
7664 AC_SUBST(JPEG_CFLAGS)
7666 AC_SUBST(ZLIB_CFLAGS)
7668 AC_SUBST(PNG_CFLAGS)
7671 AC_SUBST(MOZ_JPEG_CFLAGS)
7672 AC_SUBST(MOZ_JPEG_LIBS)
7673 AC_SUBST(MOZ_ZLIB_CFLAGS)
7674 AC_SUBST(MOZ_ZLIB_LIBS)
7675 AC_SUBST(MOZ_PNG_CFLAGS)
7676 AC_SUBST(MOZ_PNG_LIBS)
7678 AC_SUBST(NSPR_CFLAGS)
7680 AC_SUBST(MOZ_NATIVE_NSPR)
7682 AC_SUBST(NSS_CFLAGS)
7684 AC_SUBST(NSS_DEP_LIBS)
7685 AC_SUBST(MOZ_NATIVE_NSS)
7690 AC_SUBST(COMPILE_CFLAGS)
7691 AC_SUBST(COMPILE_CXXFLAGS)
7694 AC_SUBST(CROSS_COMPILE)
7698 AC_SUBST(HOST_CFLAGS)
7699 AC_SUBST(HOST_CXXFLAGS)
7700 AC_SUBST(HOST_OPTIMIZE_FLAGS)
7702 AC_SUBST(HOST_AR_FLAGS)
7704 AC_SUBST(HOST_RANLIB)
7705 AC_SUBST(HOST_NSPR_MDCPUCFG)
7706 AC_SUBST(HOST_BIN_SUFFIX)
7707 AC_SUBST(HOST_OS_ARCH)
7709 AC_SUBST(TARGET_CPU)
7710 AC_SUBST(TARGET_VENDOR)
7712 AC_SUBST(TARGET_NSPR_MDCPUCFG)
7713 AC_SUBST(TARGET_MD_ARCH)
7714 AC_SUBST(TARGET_XPCOM_ABI)
7717 AC_SUBST(OS_RELEASE)
7720 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
7721 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
7723 AC_SUBST(WRAP_MALLOC_CFLAGS)
7724 AC_SUBST(WRAP_MALLOC_LIB)
7727 AC_SUBST(MKSHLIB_FORCE_ALL)
7728 AC_SUBST(MKSHLIB_UNFORCE_ALL)
7729 AC_SUBST(DSO_CFLAGS)
7730 AC_SUBST(DSO_PIC_CFLAGS)
7731 AC_SUBST(DSO_LDOPTS)
7732 AC_SUBST(LIB_PREFIX)
7733 AC_SUBST(DLL_PREFIX)
7734 AC_SUBST(DLL_SUFFIX)
7735 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
7736 AC_SUBST(LIB_SUFFIX)
7737 AC_SUBST(OBJ_SUFFIX)
7738 AC_SUBST(BIN_SUFFIX)
7739 AC_SUBST(ASM_SUFFIX)
7740 AC_SUBST(IMPORT_LIB_SUFFIX)
7742 AC_SUBST(CC_VERSION)
7743 AC_SUBST(CXX_VERSION)
7744 AC_SUBST(MSMANIFEST_TOOL)
7746 if test "$USING_HCC"; then
7747 CC='${topsrcdir}/build/hcc'
7749 CXX='${topsrcdir}/build/hcpp'
7750 CXX="$CXX '$_OLDCXX'"
7755 dnl Check for missing components
7756 if test "$COMPILE_ENVIRONMENT"; then
7757 if test "$MOZ_X11"; then
7758 dnl ====================================================
7759 dnl = Check if X headers exist
7760 dnl ====================================================
7761 _SAVE_CFLAGS=$CFLAGS
7762 CFLAGS="$CFLAGS $XCFLAGS"
7765 #include <X11/Xlib.h>
7766 #include <X11/Intrinsic.h>
7770 if ((dpy = XOpenDisplay(NULL)) == NULL) {
7771 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
7775 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
7776 CFLAGS="$_SAVE_CFLAGS"
7778 if test ! -z "$MISSING_X"; then
7779 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
7783 fi # COMPILE_ENVIRONMENT
7785 dnl Set various defines and substitutions
7786 dnl ========================================================
7788 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
7789 LIBS='so32dll.lib tcp32dll.lib'
7790 elif test "$OS_ARCH" = "BeOS"; then
7793 elif test "$OS_ARCH" = "Darwin"; then
7795 AC_DEFINE(UNIX_ASYNC_DNS)
7797 elif test "$OS_ARCH" = "OpenVMS"; then
7799 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
7801 AC_DEFINE(UNIX_ASYNC_DNS)
7804 AC_SUBST(MOZ_MOVEMAIL)
7806 AC_DEFINE(JS_THREADSAFE)
7808 if test "$MOZ_DEBUG"; then
7809 AC_DEFINE(MOZ_REFLOW_PERF)
7810 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
7813 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
7814 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
7815 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
7816 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
7817 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
7818 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
7819 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
7820 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
7821 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
7824 # Used for LD_LIBRARY_PATH of run_viewer target
7826 for lib_arg in $NSPR_LIBS $TK_LIBS; do
7828 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
7834 dnl ========================================================
7835 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
7836 dnl ========================================================
7839 WIN_TOP_SRC=`cd $srcdir; pwd -W`
7842 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
7843 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
7844 CC="\$(CYGWIN_WRAPPER) $CC"
7845 CXX="\$(CYGWIN_WRAPPER) $CXX"
7846 CPP="\$(CYGWIN_WRAPPER) $CPP"
7847 LD="\$(CYGWIN_WRAPPER) $LD"
7848 AS="\$(CYGWIN_WRAPPER) $AS"
7849 RC="\$(CYGWIN_WRAPPER) $RC"
7850 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
7851 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
7852 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
7856 AC_SUBST(CYGDRIVE_MOUNT)
7857 AC_SUBST(WIN_TOP_SRC)
7859 AC_SUBST(MOZILLA_VERSION)
7861 . ${srcdir}/config/chrome-versions.sh
7862 AC_DEFINE_UNQUOTED(MOZILLA_LOCALE_VERSION,"$MOZILLA_LOCALE_VERSION")
7863 AC_DEFINE_UNQUOTED(MOZILLA_REGION_VERSION,"$MOZILLA_REGION_VERSION")
7864 AC_DEFINE_UNQUOTED(MOZILLA_SKIN_VERSION,"$MOZILLA_SKIN_VERSION")
7866 AC_SUBST(ac_configure_args)
7868 dnl Spit out some output
7869 dnl ========================================================
7871 dnl The following defines are used by xpcom
7872 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
7874 HAVE_CPP_2BYTE_WCHAR_T
7875 HAVE_CPP_ACCESS_CHANGING_USING
7876 HAVE_CPP_AMBIGUITY_RESOLVING_USING
7878 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
7880 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
7881 HAVE_CPP_NAMESPACE_STD
7883 HAVE_CPP_PARTIAL_SPECIALIZATION
7884 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
7886 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
7888 NEED_CPP_UNUSED_IMPLEMENTATIONS
7892 HAVE_ICONV_WITH_CONST_INPUT
7901 netwerk/necko-config.h
7902 xpcom/xpcom-config.h
7903 xpcom/xpcom-private.h
7906 # Save the defines header file before autoconf removes it.
7907 # (Do not add AC_DEFINE calls after this line.)
7908 _CONFIG_TMP=confdefs-tmp.h
7909 _CONFIG_DEFS_H=mozilla-config.h
7911 cat > $_CONFIG_TMP <<\EOF
7912 /* List of defines generated by configure. Included with preprocessor flag,
7913 * -include, to avoid long list of -D defines on the compile command-line.
7917 #ifndef _MOZILLA_CONFIG_H_
7918 #define _MOZILLA_CONFIG_H_
7921 _EGREP_PATTERN='^#define ('
7922 if test -n "$_NON_GLOBAL_ACDEFINES"; then
7923 for f in $_NON_GLOBAL_ACDEFINES; do
7924 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
7927 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
7929 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
7931 cat >> $_CONFIG_TMP <<\EOF
7933 #endif /* _MOZILLA_CONFIG_H_ */
7937 # Only write mozilla-config.h when something changes (or it doesn't exist)
7938 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
7941 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
7942 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
7944 echo ==== $_CONFIG_DEFS_H =================================
7948 dnl Probably shouldn't call this manually but we always want the output of DEFS
7949 rm -f confdefs.h.save
7950 mv confdefs.h confdefs.h.save
7951 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
7952 AC_OUTPUT_MAKE_DEFS()
7954 AC_SUBST(MOZ_DEFINES)
7956 mv confdefs.h.save confdefs.h
7958 dnl Load the list of Makefiles to generate.
7959 dnl To add new Makefiles, edit allmakefiles.sh.
7960 dnl allmakefiles.sh sets the variable, MAKEFILES.
7961 . ${srcdir}/allmakefiles.sh
7963 dnl Run a perl script to quickly create the makefiles.
7964 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
7965 dnl for the files it cannot handle correctly. This way, config.status
7966 dnl will handle these files.
7967 dnl If it fails, nothing is set and config.status will run as usual.
7969 dnl This does not change the $MAKEFILES variable.
7971 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
7973 if test -z "${AS_PERL}"; then
7974 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
7976 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
7981 echo $MAKEFILES > unallmakefiles
7983 AC_OUTPUT($MAKEFILES)
7985 dnl ========================================================
7986 dnl = Setup a nice relatively clean build environment for
7987 dnl = sub-configures.
7988 dnl ========================================================
7991 CFLAGS="$_SUBDIR_CFLAGS"
7992 CPPFLAGS="$_SUBDIR_CPPFLAGS"
7993 CXXFLAGS="$_SUBDIR_CXXFLAGS"
7994 LDFLAGS="$_SUBDIR_LDFLAGS"
7995 HOST_CC="$_SUBDIR_HOST_CC"
7996 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
7997 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8003 if test "$COMPILE_ENVIRONMENT"; then
8004 if test -z "$MOZ_NATIVE_NSPR" || test "$MOZ_LDAP_XPCOM"; then
8005 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8006 if test -z "$MOZ_DEBUG"; then
8007 ac_configure_args="$ac_configure_args --disable-debug"
8009 if test "$MOZ_OPTIMIZE" = "1"; then
8010 ac_configure_args="$ac_configure_args --enable-optimize"
8012 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8013 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8015 if test -n "$HAVE_64BIT_OS"; then
8016 ac_configure_args="$ac_configure_args --enable-64bit"
8018 AC_OUTPUT_SUBDIRS(nsprpub)
8019 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8022 if test -z "$MOZ_NATIVE_NSPR"; then
8023 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8024 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8025 if test ! "$VACPP" && test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8026 _libs=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --libdir=$\(LIBXUL_DIST\)/lib --libs`
8027 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $_libs'" config/autoconf.mk
8029 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE" ; then
8030 _cflags=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --includedir=$\(LIBXUL_DIST\)/include/nspr --cflags`
8031 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $_cflags'" config/autoconf.mk
8033 rm -f config/autoconf.mk.bak
8036 # if we're building the LDAP XPCOM component, we need to build
8039 if test "$MOZ_LDAP_XPCOM"; then
8041 # these subdirs may not yet have been created in the build tree.
8042 # don't use the "-p" switch to mkdir, since not all platforms have it
8044 if test ! -d "directory"; then
8047 if test ! -d "directory/c-sdk"; then
8048 mkdir "directory/c-sdk"
8050 if test ! -d "directory/c-sdk/ldap"; then
8051 mkdir "directory/c-sdk/ldap"
8054 ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
8055 if test -z "$MOZ_DEBUG"; then
8056 ac_configure_args="$ac_configure_args --disable-debug"
8058 if test "$MOZ_OPTIMIZE" = "1"; then
8059 ac_configure_args="$ac_configure_args --enable-optimize"
8061 if test -n "$HAVE_64BIT_OS"; then
8062 ac_configure_args="$ac_configure_args --enable-64bit"
8064 AC_OUTPUT_SUBDIRS(directory/c-sdk)
8065 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8067 fi # COMPILE_ENVIRONMENT