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 ========================================================
121 WINDRES_VERSION=2.14.90
124 GNOMEUI_VERSION=2.2.0
127 STARTUP_NOTIFICATION_VERSION=0.8
133 dnl Set various checks
134 dnl ========================================================
138 dnl Initialize the Pthread test variables early so they can be
139 dnl overridden by each platform.
140 dnl ========================================================
144 dnl Do not allow a separate objdir build if a srcdir build exists.
145 dnl ==============================================================
146 _topsrcdir=`cd \`dirname $0\`; pwd`
148 if test "$_topsrcdir" != "$_objdir"
150 # Check for a couple representative files in the source tree
152 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
153 if test -f $file; then
154 _conflict_files="$_conflict_files $file"
157 if test "$_conflict_files"; then
159 echo "* Your source tree contains these files:"
160 for file in $_conflict_files; do
164 * This indicates that you previously built in the source tree.
165 * A source tree build can confuse the separate objdir build.
167 * To clean up the source tree:
178 dnl Default to MSVC for win32
179 dnl ==============================================================
180 if test -z "$CROSS_COMPILE"; then
182 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
184 if test -z "$CC"; then CC=cl; fi
185 if test -z "$CXX"; then CXX=cl; fi
186 if test -z "$CPP"; then CPP=cl; fi
187 if test -z "$LD"; then LD=link; fi
188 if test -z "$AS"; then AS=ml; fi
189 if test -z "$MIDL"; then MIDL=midl; fi
194 COMPILE_ENVIRONMENT=1
195 MOZ_ARG_ENABLE_BOOL(compile-environment,
196 [ --disable-compile-environment
197 Disable compiler/library checks.],
198 COMPILE_ENVIRONMENT=1,
199 COMPILE_ENVIRONMENT= )
201 dnl ========================================================
202 dnl Checks for compilers.
203 dnl ========================================================
204 dnl Set CROSS_COMPILE in the environment when running configure
205 dnl to use the cross-compile setup for now
206 dnl ========================================================
208 if test "$COMPILE_ENVIRONMENT"; then
210 dnl Do some special WinCE toolchain stuff
213 echo -----------------------------------------------------------------------------
214 echo Building Windows CE Shunt Library and Tool Chain
215 echo -----------------------------------------------------------------------------
217 echo -n "#define TOPSRCDIR \"" > $srcdir/build/wince/tools/topsrcdir.h
218 `$srcdir/build/cygwin-wrapper echo -n $_topsrcdir >> $srcdir/build/wince/tools/topsrcdir.h`
219 echo -n \" >> $srcdir/build/wince/tools/topsrcdir.h
221 make -C $srcdir/build/wince/tools
222 echo -----------------------------------------------------------------------------
226 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
227 echo "cross compiling from $host to $target"
231 _SAVE_CFLAGS="$CFLAGS"
232 _SAVE_LDFLAGS="$LDFLAGS"
234 AC_MSG_CHECKING([for host c compiler])
235 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
236 if test -z "$HOST_CC"; then
237 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
239 AC_MSG_RESULT([$HOST_CC])
240 AC_MSG_CHECKING([for host c++ compiler])
241 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
242 if test -z "$HOST_CXX"; then
243 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
245 AC_MSG_RESULT([$HOST_CXX])
247 if test -z "$HOST_CFLAGS"; then
248 HOST_CFLAGS="$CFLAGS"
250 if test -z "$HOST_CXXFLAGS"; then
251 HOST_CXXFLAGS="$CXXFLAGS"
253 if test -z "$HOST_LDFLAGS"; then
254 HOST_LDFLAGS="$LDFLAGS"
256 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
257 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
259 CFLAGS="$HOST_CFLAGS"
260 LDFLAGS="$HOST_LDFLAGS"
262 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
263 AC_TRY_COMPILE([], [return(0);],
264 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
265 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
268 CFLAGS="$HOST_CXXFLAGS"
270 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
271 AC_TRY_COMPILE([], [return(0);],
272 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
273 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
277 LDFLAGS=$_SAVE_LDFLAGS
279 case "$build:$target" in
280 powerpc-apple-darwin8*:i?86-apple-darwin*)
281 dnl The Darwin cross compiler doesn't necessarily point itself at a
282 dnl root that has libraries for the proper architecture, it defaults
283 dnl to the system root. The libraries in the system root on current
284 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
285 dnl checks will fail. Fake a working SDK in that case.
287 _SAVE_CXXFLAGS=$CXXLAGS
288 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
289 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
293 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
296 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
300 case "$build:$target" in
301 powerpc-apple-darwin8*:i?86-apple-darwin*)
302 dnl Revert the changes made above. From this point on, the target
303 dnl compiler will never be used without applying the SDK to CFLAGS
304 dnl (see --with-macos-sdk below).
306 CXXFLAGS=$_SAVE_CXXFLAGS
310 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
311 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
312 AC_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
313 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
314 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
315 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
316 AC_DEFINE(CROSS_COMPILE)
321 AC_PATH_PROGS(AS, $AS as, $CC)
322 AC_CHECK_PROGS(AR, ar, :)
323 AC_CHECK_PROGS(LD, ld, :)
324 AC_CHECK_PROGS(STRIP, strip, :)
325 AC_CHECK_PROGS(WINDRES, windres, :)
326 if test -z "$HOST_CC"; then
329 if test -z "$HOST_CFLAGS"; then
330 HOST_CFLAGS="$CFLAGS"
332 if test -z "$HOST_CXX"; then
335 if test -z "$HOST_CXXFLAGS"; then
336 HOST_CXXFLAGS="$CXXFLAGS"
338 if test -z "$HOST_LDFLAGS"; then
339 HOST_LDFLAGS="$LDFLAGS"
341 if test -z "$HOST_RANLIB"; then
342 HOST_RANLIB="$RANLIB"
344 if test -z "$HOST_AR"; then
355 if test "$GCC" = "yes"; then
357 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
359 if test "$GXX" = "yes"; then
361 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
363 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
366 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
369 if test "$GNU_CC"; then
370 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
375 dnl Special win32 checks
376 dnl ========================================================
382 if test -n "$GNU_CC"; then
390 MOZ_ARG_WITH_STRING(windows-version,
391 [ --with-windows-version=WINVER
392 Minimum Windows version (WINVER) to support
403 AC_MSG_ERROR([Invalid value --with-windows-version, must be 400, 500 or 501]);
409 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
410 if test "$GCC" != "yes"; then
411 # Check to see if we are really running in a msvc environemnt
413 AC_CHECK_PROGS(MIDL, midl)
415 # Make sure compilers are valid
416 CFLAGS="$CFLAGS -TC -nologo"
417 CXXFLAGS="$CXXFLAGS -TP -nologo"
420 AC_TRY_COMPILE([#include <stdio.h>],
421 [ printf("Hello World\n"); ],,
422 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
425 AC_TRY_COMPILE([#include <new.h>],
426 [ unsigned *test = new unsigned(42); ],,
427 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
431 _MSVC_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
434 # Determine compiler version
435 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
436 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
437 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
438 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
440 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
441 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
443 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
444 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
446 if test "$_CC_MAJOR_VERSION" = "12"; then
448 elif test "$_CC_MAJOR_VERSION" = "13"; then
450 elif test "$_CC_MAJOR_VERSION" = "14"; then
452 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
453 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
454 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
455 elif test "$_CC_MAJOR_VERSION" = "15"; then
457 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
458 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
459 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
461 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
464 _MOZ_RTTI_FLAGS_ON='-GR'
465 _MOZ_RTTI_FLAGS_OFF='-GR-'
466 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
467 _MOZ_EXCEPTIONS_FLAGS_OFF=''
469 if test -n "$WIN32_REDIST_DIR"; then
470 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
474 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
475 if test "$_CC_SUITE" -ge "8"; then
477 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
480 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
481 if test -n "$MSMT_TOOL"; then
482 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
483 if test -z "$MSMANIFEST_TOOL_VERSION"; then
484 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
489 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
493 # Check linker version
494 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
495 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
496 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
497 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
502 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
503 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
504 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
505 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
506 # Add flags if necessary
507 AC_MSG_CHECKING([for midl flags])
508 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
509 # Starting with MIDL version 6.0.359, the MIDL compiler
510 # generates /Oicf /robust stubs by default, which is not
511 # compatible with versions of Windows older than Win2k.
512 # This switches us back to the old behaviour. When we drop
513 # support for Windows older than Win2k, we should remove
515 MIDL_FLAGS="${MIDL_FLAGS} -no_robust"
516 AC_MSG_RESULT([need -no_robust])
518 MIDL_FLAGS="${MIDL_FLAGS}"
519 AC_MSG_RESULT([none needed])
522 unset _MSVC_VER_FILTER
525 # Check w32api version
526 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
527 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
528 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
529 AC_TRY_COMPILE([#include <w32api.h>],
530 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
531 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
532 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
533 #error "test failed."
535 , [ res=yes ], [ res=no ])
536 AC_MSG_RESULT([$res])
537 if test "$res" != "yes"; then
538 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
540 # Check windres version
541 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
542 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
543 AC_MSG_RESULT([$_WINDRES_VERSION])
544 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
545 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
546 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
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 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
551 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
552 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
553 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
554 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
555 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
557 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
561 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
562 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
563 # Require OS features provided by IE 5.0
564 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
568 if test -n "$_WIN32_MSVC"; then
570 SKIP_COMPILER_CHECKS=1
571 SKIP_LIBRARY_CHECKS=1
572 AC_CHECK_HEADERS(mmintrin.h)
575 dnl Test breaks icc on OS/2 && MSVC
576 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
578 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
582 CC="${srcdir}/build/hcc '$CC'"
583 CXX="${srcdir}/build/hcpp '$CXX'"
590 fi # COMPILE_ENVIRONMENT
600 dnl ========================================================
601 dnl Checks for programs.
602 dnl ========================================================
605 AC_PATH_PROGS(PERL, $PERL perl5 perl )
606 if test -z "$PERL" || test "$PERL" = ":"; then
607 AC_MSG_ERROR([perl not found in \$PATH])
610 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
611 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
612 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
614 AC_MSG_RESULT([$_perl_version])
616 if test "$_perl_res" != 0; then
617 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
621 AC_MSG_CHECKING([for full perl installation])
622 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
624 if test "$_perl_res" != 0; then
626 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
631 AC_PATH_PROGS(PYTHON, $PYTHON python)
632 if test -z "$PYTHON"; then
633 AC_MSG_ERROR([python was not found in \$PATH])
635 echo PYTHON="$PYTHON"
637 AC_PATH_PROGS(NSINSTALL_BIN, nsinstall )
638 if test -z "$COMPILE_ENVIRONMENT"; then
639 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
640 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
643 AC_SUBST(NSINSTALL_BIN)
645 AC_PATH_PROG(DOXYGEN, doxygen, :)
646 AC_PATH_PROG(WHOAMI, whoami, :)
647 AC_PATH_PROG(AUTOCONF, autoconf, :)
648 AC_PATH_PROG(UNZIP, unzip, :)
649 AC_PATH_PROGS(ZIP, zip)
650 if test -z "$ZIP" || test "$ZIP" = ":"; then
651 AC_MSG_ERROR([zip not found in \$PATH])
653 AC_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
654 AC_PATH_PROG(XARGS, xargs)
655 if test -z "$XARGS" || test "$XARGS" = ":"; then
656 AC_MSG_ERROR([xargs not found in \$PATH .])
659 if test "$COMPILE_ENVIRONMENT"; then
661 dnl ========================================================
662 dnl = Mac OS X toolchain support
663 dnl ========================================================
667 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
668 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
669 dnl the environment and includedir purposes (when using an SDK, below),
670 dnl but remember the full version number for the libdir (SDK).
672 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
673 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
675 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
676 dnl Bug 280479, but this keeps popping up in bug 292530 too because
677 dnl 4.0.0/4061 is the default compiler in Tiger.
679 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
681 if test "$GCC_BUILD" = "4061" ; then
682 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
683 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
684 from building Mozilla. Upgrade to Xcode 2.1 or later.])
688 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
689 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
690 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
691 AC_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
696 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
698 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
704 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
705 dnl it has moved into /usr/bin.
706 AC_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
710 AC_SUBST(GCC_VERSION)
711 AC_SUBST(XCODEBUILD_VERSION)
712 AC_SUBST(HAS_XCODE_2_1)
714 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
715 dnl that a universal binary is being produced.
716 AC_SUBST(UNIVERSAL_BINARY)
718 dnl ========================================================
719 dnl = Mac OS X SDK support
720 dnl ========================================================
723 MOZ_ARG_WITH_STRING(macos-sdk,
724 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
725 MACOS_SDK_DIR=$withval)
727 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
728 dnl NEXT_ROOT will be set and exported only if it's needed.
729 AC_SUBST(MACOS_SDK_DIR)
732 if test "$MACOS_SDK_DIR"; then
733 dnl Sync this section with the ones in NSPR and NSS.
734 dnl Changes to the cross environment here need to be accounted for in
735 dnl the libIDL checks (below) and xpidl build.
737 if test ! -d "$MACOS_SDK_DIR"; then
738 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
739 specify a valid SDK. SDKs are installed when the optional cross-development
740 tools are selected during the Xcode/Developer Tools installation.])
743 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
744 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
745 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"
746 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
747 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
749 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"
751 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
752 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
754 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
755 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
756 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
758 dnl ld support for -syslibroot is compiler-agnostic, but only available
759 dnl on Tiger. Although it's possible to switch on the build host's
760 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
761 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
762 dnl set because both the compiler and linker use it.
763 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"
764 export NEXT_ROOT=$MACOS_SDK_DIR
766 if test -n "$CROSS_COMPILE" ; then
767 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
768 dnl the build host. HOST_CXX is presently unused.
769 HOST_CC="NEXT_ROOT= $HOST_CC"
770 HOST_CXX="NEXT_ROOT= $HOST_CXX"
773 dnl gcc >= 4.0 uses different paths than above, but knows how to find
775 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
776 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
778 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
779 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
780 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
782 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
783 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
784 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
785 dnl be ignored and cause warnings when -syslibroot is specified.
786 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
787 dnl the -isysroot it receives, so this is only needed with 4.0.0.
788 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
793 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
795 AC_TRY_COMPILE([#include <new>
796 int main() { return 0; }],
800 AC_MSG_RESULT($result)
802 if test "$result" = "no" ; then
803 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
807 fi # COMPILE_ENVIRONMENT
809 dnl Be sure the make we use is GNU make.
810 dnl on win32, gmake.exe is the generally the wrong version
812 cygwin*|mingw*|mks*|msvc*)
813 AC_PATH_PROGS(MAKE, $MAKE make gmake, :)
816 AC_PATH_PROGS(MAKE, $MAKE gmake make, :)
819 _make_try=`$MAKE --version 2>/dev/null | grep GNU`
820 if test ! "$_make_try"
823 echo "*** $MAKE is not GNU Make. You will not be able to build Mozilla without GNU Make."
827 dnl Now exit if version if < MAKE_VERSION
829 echo 'all: ; @echo $(MAKE_VERSION)' > dummy.mk
830 _make_vers=`$MAKE --no-print-directory -f dummy.mk all 2>/dev/null`
832 _MAKE_MAJOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $1 }'`
833 _MAKE_MINOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $2 }'`
834 MAKE_MAJOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $1 }'`
835 MAKE_MINOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $2 }'`
836 if test "$_MAKE_MAJOR_VERSION" -lt "$MAKE_MAJOR_VERSION" || \
837 test "$_MAKE_MAJOR_VERSION" = "$MAKE_MAJOR_VERSION" -a \
838 "$_MAKE_MINOR_VERSION" -lt "$MAKE_MINOR_VERSION"; then
839 AC_MSG_ERROR([GNU Make $MAKE_VERSION or higher is required to build Mozilla.])
843 if test "$COMPILE_ENVIRONMENT"; then
847 dnl Check in X11 include directory too.
848 if test "$no_x" != "yes"; then
849 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
854 fi # COMPILE_ENVIRONMENT
856 dnl ========================================================
857 dnl set the defaults first
858 dnl ========================================================
877 MOZ_USER_DIR=".mozilla"
879 HOST_AR_FLAGS='$(AR_FLAGS)'
882 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
884 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
886 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
888 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
889 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
890 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
891 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin $(MOZ_FIX_LINK_PATHS) -lxpcom'
892 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
893 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
894 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
896 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
897 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
901 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
902 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
904 MOZ_ENABLE_POSTSCRIPT=1
906 if test -n "$CROSS_COMPILE"; then
907 OS_TARGET="${target_os}"
908 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
910 case "${target_os}" in
911 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
912 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
913 mingw*) OS_ARCH=WINNT ;;
914 wince*) OS_ARCH=WINCE ;;
915 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
919 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
920 OS_RELEASE=`uname -r`
923 # Before this used `uname -m` when not cross compiling
924 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
925 OS_TEST="${target_cpu}"
929 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
931 #######################################################################
932 # Master "Core Components" macros for getting the OS target #
933 #######################################################################
936 # Note: OS_TARGET should be specified on the command line for gmake.
937 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
938 # The difference between the Win95 target and the WinNT target is that
939 # the WinNT target uses Windows NT specific features not available
940 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
941 # at lesser performance (the Win95 target uses threads; the WinNT target
944 # When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
945 # is built. See: win16_3.11.mk for lots more about the Win16 target.
947 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
952 # The following hack allows one to build on a WIN95 machine (as if
953 # s/he were cross-compiling on a WINNT host for a WIN95 target).
954 # It also accomodates for MKS's uname.exe. If you never intend
955 # to do development on a WIN95 machine, you don't need this hack.
970 CYGWIN_9*|CYGWIN_ME*)
971 OS_ARCH='CYGWIN_NT-4.0'
977 # Define and override various archtecture-specific variables, including
986 case "$HOST_OS_ARCH" in
987 cygwin*|mingw*|mks*|msvc*)
1006 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1009 HOST_OS_ARCH=UNIXWARE
1021 HOST_OS_ARCH=OpenVMS
1031 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1035 HOST_OS_ARCH=UNIXWARE
1045 # If uname -s returns "Windows_NT", we assume that we are using
1046 # the uname.exe in MKS toolkit.
1048 # The -r option of MKS uname only returns the major version number.
1049 # So we need to use its -v option to get the minor version number.
1050 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1054 OS_MINOR_RELEASE=`uname -v`
1055 if test "$OS_MINOR_RELEASE" = "00"; then
1058 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1060 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1062 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1063 # the uname.exe in the Cygwin tools.
1064 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1065 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1066 # the uname.exe in the GNU-Win32 tools.
1067 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1068 # the uname.exe in the MSYS tools.
1070 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1075 OS_RELEASE=`uname -v`.`uname -r`
1088 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1092 OS_RELEASE=`uname -v`
1116 OS_RELEASE=`uname -v`
1122 OS_RELEASE=`uname -v`
1125 if test "$OS_TARGET" != "NTO"; then
1127 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1136 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1142 OS_RELEASE=`uname -v`
1149 case "${target_cpu}" in
1157 if test -z "$CROSS_COMPILE" ; then
1165 if test "$OS_ARCH" = "NCR"; then
1167 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1171 # Only set CPU_ARCH if we recognize the value of OS_TEST
1182 Alpha | alpha | ALPHA)
1190 x86_64 | sparc | ppc | ia64)
1195 if test -z "$OS_TARGET"; then
1198 if test "$OS_TARGET" = "WIN95"; then
1201 if test "$OS_TARGET" = "WIN16"; then
1204 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1206 dnl ========================================================
1207 dnl GNU specific defaults
1208 dnl ========================================================
1209 if test "$GNU_CC"; then
1210 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1211 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1212 DSO_LDOPTS='-shared'
1213 if test "$GCC_USE_GNU_LD"; then
1214 # Don't allow undefined symbols in libraries
1215 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1218 DSO_PIC_CFLAGS='-fPIC'
1219 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1220 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1221 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1222 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1224 # Turn on GNU specific features
1225 # -Wall - turn on all warnings
1226 # -pedantic - make compiler warn about non-ANSI stuff, and
1227 # be a little bit stricter
1228 # Warnings slamm took out for now (these were giving more noise than help):
1229 # -Wbad-function-cast - warns when casting a function to a new return type
1230 # -Wconversion - complained when char's or short's were used a function args
1231 # -Wshadow - removed because it generates more noise than help --pete
1232 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith -Wcast-align"
1234 dnl Turn pedantic on but disable the warnings for long long
1236 _IGNORE_LONG_LONG_WARNINGS=1
1238 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1239 _USE_CPP_INCLUDE_FLAG=1
1241 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1242 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1244 DSO_LDOPTS='-shared'
1245 if test "$GNU_LD"; then
1246 # Don't allow undefined symbols in libraries
1247 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1251 DSO_PIC_CFLAGS='-KPIC'
1252 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1255 if test "$GNU_CXX"; then
1256 # Turn on GNU specific features
1257 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1259 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1260 _USE_CPP_INCLUDE_FLAG=1
1262 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1265 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1266 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1267 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1268 dnl normal behavior.
1269 dnl ========================================================
1271 MKSHLIB_UNFORCE_ALL=
1273 if test "$COMPILE_ENVIRONMENT"; then
1274 if test "$GNU_CC"; then
1275 AC_MSG_CHECKING(whether ld has archive extraction flags)
1276 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1277 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1278 ac_cv_mkshlib_force_and_unforce="no"
1279 exec 3<&0 <<LOOP_INPUT
1280 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1281 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1282 force="-Wl,-all"; unforce="-Wl,-none"
1289 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1292 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1294 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1298 eval $ac_cv_mkshlib_force_and_unforce
1299 MKSHLIB_FORCE_ALL=$force
1300 MKSHLIB_UNFORCE_ALL=$unforce
1303 fi # COMPILE_ENVIRONMENT
1305 dnl =================================================================
1306 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1307 dnl which is bad when cross compiling.
1308 dnl =================================================================
1309 if test "$COMPILE_ENVIRONMENT"; then
1310 configure_static_assert_macros='
1311 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1312 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1313 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1316 dnl test that the macros actually work:
1317 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1318 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1321 ac_cv_static_assertion_macros_work="yes"
1322 AC_TRY_COMPILE([$configure_static_assert_macros],
1323 [CONFIGURE_STATIC_ASSERT(1)],
1325 ac_cv_static_assertion_macros_work="no")
1326 AC_TRY_COMPILE([$configure_static_assert_macros],
1327 [CONFIGURE_STATIC_ASSERT(0)],
1328 ac_cv_static_assertion_macros_work="no",
1331 AC_TRY_COMPILE([$configure_static_assert_macros],
1332 [CONFIGURE_STATIC_ASSERT(1)],
1334 ac_cv_static_assertion_macros_work="no")
1335 AC_TRY_COMPILE([$configure_static_assert_macros],
1336 [CONFIGURE_STATIC_ASSERT(0)],
1337 ac_cv_static_assertion_macros_work="no",
1341 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1342 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1343 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1346 fi # COMPILE_ENVIRONMENT
1348 dnl ========================================================
1349 dnl Checking for 64-bit OS
1350 dnl ========================================================
1351 if test "$COMPILE_ENVIRONMENT"; then
1354 AC_MSG_CHECKING(for 64-bit OS)
1355 AC_TRY_COMPILE([$configure_static_assert_macros],
1356 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1357 result="yes", result="no")
1358 AC_MSG_RESULT("$result")
1359 if test "$result" = "yes"; then
1360 AC_DEFINE(HAVE_64BIT_OS)
1363 AC_SUBST(HAVE_64BIT_OS)
1365 fi # COMPILE_ENVIRONMENT
1367 dnl ========================================================
1368 dnl Enable high-memory support on OS/2, disabled by default
1369 dnl ========================================================
1370 MOZ_ARG_ENABLE_BOOL(os2-high-mem,
1371 [ --enable-os2-high-mem Enable high-memory support on OS/2],
1372 MOZ_OS2_HIGH_MEMORY=1,
1373 MOZ_OS2_HIGH_MEMORY= )
1374 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1376 dnl ========================================================
1377 dnl System overrides of the defaults for host
1378 dnl ========================================================
1381 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1382 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1383 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1386 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1387 if test -n "$_WIN32_MSVC"; then
1389 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1390 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1391 HOST_RANLIB='echo ranlib'
1393 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1395 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1396 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1397 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1398 HOST_BIN_SUFFIX=.exe
1401 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1404 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1405 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1407 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1409 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1411 PERL="${CYGWIN_WRAPPER} $PERL"
1414 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1415 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1422 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1423 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1424 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1425 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1426 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
1430 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1431 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1432 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1436 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1437 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1438 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1439 HOST_BIN_SUFFIX=.exe
1444 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1445 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1446 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1450 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1451 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1455 dnl Get mozilla version from central milestone file
1456 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1458 dnl Get version of various core apps from the version files.
1459 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1460 THUNDERBIRD_VERSION=`cat $topsrcdir/mail/config/version.txt`
1461 SUNBIRD_VERSION=`cat $topsrcdir/calendar/sunbird/config/version.txt`
1462 SEAMONKEY_VERSION=`cat $topsrcdir/suite/config/version.txt`
1464 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1465 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1467 dnl ========================================================
1468 dnl System overrides of the defaults for target
1469 dnl ========================================================
1474 if test ! "$GNU_CC"; then
1475 if test ! "$HAVE_64BIT_OS"; then
1476 # Compiling with Visual Age C++ object model compat is the
1477 # default. To compile with object model ibm, add
1478 # AIX_OBJMODEL=ibm to .mozconfig.
1479 if test "$AIX_OBJMODEL" = "ibm"; then
1480 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1487 AC_SUBST(AIX_OBJMODEL)
1488 DSO_LDOPTS='-qmkshrobj=1'
1489 DSO_CFLAGS='-qflag=w:w'
1491 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1492 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1494 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1495 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1496 if test "$COMPILE_ENVIRONMENT"; then
1499 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 5.0.2.0])
1501 [#if (__IBMCPP__ < 502)
1502 #error "Bad compiler"
1504 _BAD_COMPILER=,_BAD_COMPILER=1)
1505 if test -n "$_BAD_COMPILER"; then
1507 AC_MSG_ERROR([VisualAge C++ version 5.0.2.0 or higher is required to build.])
1509 AC_MSG_RESULT([yes])
1512 TARGET_COMPILER_ABI="ibmc"
1513 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1514 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1517 case "${target_os}" in
1522 if test "$COMPILE_ENVIRONMENT"; then
1523 AC_CHECK_HEADERS(sys/inttypes.h)
1525 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1530 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1531 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1532 DSO_LDOPTS='-nostart'
1533 TK_LIBS='-lbe -lroot'
1535 if test "$COMPILE_ENVIRONMENT"; then
1536 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1537 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1539 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1540 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1543 MOZ_USER_DIR="Mozilla"
1547 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1549 _IGNORE_LONG_LONG_WARNINGS=
1557 _WARNINGS_CFLAGS="-Wall"
1558 _WARNINGS_CXXFLAGS="-Wall"
1559 # The test above doesn't work properly, at least on 3.1.
1560 MKSHLIB_FORCE_ALL=''
1561 MKSHLIB_UNFORCE_ALL=''
1567 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1568 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1571 CFLAGS="$CFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
1572 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
1575 STRIP="$STRIP -x -S"
1576 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1577 MOZ_ENABLE_POSTSCRIPT=
1578 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1579 # set MACOSX to generate lib/mac/MoreFiles/Makefile
1582 dnl check for the presence of the -dead_strip linker flag
1583 AC_MSG_CHECKING([for -dead_strip option to ld])
1584 _SAVE_LDFLAGS=$LDFLAGS
1585 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1586 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1587 if test -n "$_HAVE_DEAD_STRIP" ; then
1588 AC_MSG_RESULT([yes])
1589 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1593 LDFLAGS=$_SAVE_LDFLAGS
1597 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
1598 DLL_SUFFIX=".so.1.0"
1599 DSO_LDOPTS="-shared"
1601 if test ! "$GNU_CC"; then
1602 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1604 # Can't have force w/o an unforce.
1605 # # Hack for FreeBSD 2.2
1606 # if test -z "$MKSHLIB_FORCE_ALL"; then
1607 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1608 # MKSHLIB_UNFORCE_ALL=''
1614 if test ! "$GNU_CC"; then
1615 DSO_LDOPTS='-b -Wl,+s'
1618 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1619 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1620 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1622 DSO_LDOPTS='-b -E +s'
1623 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1624 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1626 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1627 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1632 DSO_LDOPTS='-elf -shared'
1634 if test "$GNU_CC"; then
1635 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1636 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1637 MKSHLIB_FORCE_ALL='-Wl,-all'
1638 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1639 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1641 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1642 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1643 MKSHLIB_FORCE_ALL='-all'
1644 MKSHLIB_UNFORCE_ALL='-none'
1650 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1651 dnl compile and link using -n32
1653 TARGET_COMPILER_ABI=n32
1654 DSO_LDOPTS='-elf -shared'
1655 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1656 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1657 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1658 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1659 if test "$GNU_CC"; then
1660 MKSHLIB_FORCE_ALL='-Wl,-all'
1661 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1662 _WARNINGS_CFLAGS="-Wall"
1663 _WARNINGS_CXXFLAGS="-Wall"
1664 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1666 MKSHLIB_FORCE_ALL='-all'
1667 MKSHLIB_UNFORCE_ALL='-none'
1673 CFLAGS="$CFLAGS -woff 3262 -G 4"
1674 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1675 if test -n "$USE_N32"; then
1676 ASFLAGS="$ASFLAGS -n32"
1677 CFLAGS="$CFLAGS -n32"
1678 CXXFLAGS="$CXXFLAGS -n32"
1679 LDFLAGS="$LDFLAGS -n32"
1681 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1682 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1685 if test -z "$GNU_CXX"; then
1691 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1692 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1693 # and that combo is not yet good at
1694 # debugging inlined functions (even
1695 # when using DWARF2 as the debugging
1698 case "${target_cpu}" in
1700 CFLAGS="$CFLAGS -mieee"
1701 CXXFLAGS="$CXXFLAGS -mieee"
1705 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1708 CFLAGS="$CFLAGS -Wa,-xgot"
1709 CXXFLAGS="$CXXFLAGS -Wa,-xgot"
1716 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1718 AR_EXTRACT="$AR -extract"
1720 AR_FLAGS='-OUT:"$@"'
1727 # certain versions of cygwin's makedepend barf on the
1728 # #include <string> vs -I./dist/include/string issue so don't use it
1734 HOST_AR='lib -OUT:$@'
1735 HOST_RANLIB='echo ranlib'
1737 MOZ_OPTIMIZE_FLAGS='-O1'
1738 AR_FLAGS='-NOLOGO -OUT:"$@"'
1740 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1741 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1744 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
1745 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1747 IMPORT_LIB_SUFFIX=lib
1749 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1752 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1753 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1755 MKSHLIB_UNFORCE_ALL=
1756 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1757 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1758 MOZ_DEBUG_FLAGS='-Zi'
1759 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1761 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1762 MOZ_OPTIMIZE_FLAGS='-O1'
1763 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1765 RANLIB='echo not_ranlib'
1766 STRIP='echo not_strip'
1767 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
1770 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1772 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
1773 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
1776 AC_DEFINE(HAVE_SNPRINTF)
1782 AC_DEFINE(HW_THREADS)
1783 AC_DEFINE(STDC_HEADERS)
1784 AC_DEFINE(NEW_H, <new>)
1785 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1787 TARGET_MD_ARCH=win32
1788 _PLATFORM_DEFAULT_TOOLKIT='windows'
1791 MOZ_ENABLE_COREXFONTS=
1792 MOZ_ENABLE_POSTSCRIPT=
1793 MOZ_USER_DIR="Mozilla"
1797 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1802 # certain versions of cygwin's makedepend barf on the
1803 # #include <string> vs -I./dist/include/string issue so don't use it
1805 if test -n "$GNU_CC"; then
1806 CC="$CC -mno-cygwin"
1807 CXX="$CXX -mno-cygwin"
1808 CPP="$CPP -mno-cygwin"
1809 CFLAGS="$CFLAGS -mms-bitfields"
1810 CXXFLAGS="$CXXFLAGS -mms-bitfields"
1811 DSO_LDOPTS='-shared'
1812 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1813 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1815 # Use temp file for windres (bug 213281)
1816 RCFLAGS='-O coff --use-temp-file'
1817 # mingw doesn't require kernel32, user32, and advapi32 explicitly
1818 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
1819 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
1821 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
1822 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
1824 IMPORT_LIB_SUFFIX=dll.a
1826 TARGET_COMPILER_ABI=msvc
1830 AR='lib -NOLOGO -OUT:"$@"'
1832 RANLIB='echo not_ranlib'
1833 STRIP='echo not_strip'
1838 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1843 IMPORT_LIB_SUFFIX=lib
1844 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1845 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1847 MKSHLIB_UNFORCE_ALL=
1848 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
1849 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1850 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1851 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
1852 MOZ_DEBUG_FLAGS='-Zi'
1853 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1854 MOZ_OPTIMIZE_FLAGS='-O1'
1855 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1857 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1858 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1859 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1860 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1861 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1862 if test $_MSC_VER -ge 1400; then
1863 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
1866 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
1867 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
1868 AC_DEFINE(HAVE_SNPRINTF)
1874 AC_DEFINE(HW_THREADS)
1875 AC_DEFINE(STDC_HEADERS)
1876 AC_DEFINE(NEW_H, <new>)
1877 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1878 TARGET_MD_ARCH=win32
1879 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
1882 MOZ_ENABLE_POSTSCRIPT=
1883 MOZ_USER_DIR="Mozilla"
1885 dnl Hardcode to win95 for now - cls
1886 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
1888 dnl set NO_X11 defines here as the general check is skipped on win32
1892 dnl MinGW/MSYS doesn't provide or need cygpath
1897 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
1899 *-cygwin*|*-msvc*|*-mks*)
1900 CYGPATH_W="cygpath -a -w"
1901 CYGPATH_S="sed -e s|\\\\|/|g"
1902 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
1906 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1908 if test -z "$MOZ_TOOLS"; then
1909 AC_MSG_ERROR([MOZ_TOOLS is not set])
1912 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
1913 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
1914 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
1916 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
1917 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
1919 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
1921 if test -n "$GLIB_PREFIX"; then
1922 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
1923 if test "$?" = "0"; then
1924 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
1925 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
1927 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
1929 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
1932 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
1934 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
1935 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
1937 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
1938 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
1939 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
1940 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
1941 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
1943 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
1946 if test -n "$LIBIDL_PREFIX"; then
1947 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
1948 if test "$?" = "0"; then
1949 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
1950 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
1952 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
1954 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
1957 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
1959 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
1960 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
1962 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
1963 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
1964 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
1966 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
1967 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
1969 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
1971 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
1974 *) # else cross-compiling
1975 if test -n "$GLIB_PREFIX"; then
1976 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
1977 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
1978 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
1979 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
1980 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
1982 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
1985 if test -n "$LIBIDL_PREFIX"; then
1986 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
1987 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
1988 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
1990 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
1991 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
1993 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
1996 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2011 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2018 CFLAGS="$CFLAGS -Dunix"
2019 CXXFLAGS="$CXXFLAGS -Dunix"
2020 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2022 DSO_PIC_CFLAGS='-fPIC -DPIC'
2023 DSO_LDOPTS='-shared'
2024 BIN_FLAGS='-Wl,--export-dynamic'
2026 DSO_PIC_CFLAGS='-fPIC -DPIC'
2027 DLL_SUFFIX=".so.1.0"
2028 DSO_LDOPTS='-shared'
2030 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2031 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2032 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2033 if test "$LIBRUNPATH"; then
2034 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2036 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2037 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2042 AC_DEFINE(_QNX_SOURCE)
2045 MOZ_OPTIMIZE_FLAGS="-O"
2046 MOZ_DEBUG_FLAGS="-gstabs"
2049 LIBS="$LIBS -lsocket -lstdc++"
2050 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2051 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2052 if test "$with_x" != "yes"
2054 _PLATFORM_DEFAULT_TOOLKIT="photon"
2055 TK_CFLAGS='-I/usr/include/photon'
2058 case "${target_cpu}" in
2060 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2063 case "${host_cpu}" in
2071 DLL_SUFFIX=".so.1.0"
2073 DSO_PIC_CFLAGS='-fPIC'
2074 DSO_LDOPTS='-shared -fPIC'
2075 if test "$LIBRUNPATH"; then
2076 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2081 AC_DEFINE(NO_PW_GECOS)
2082 AC_DEFINE(NO_UDSOCK)
2083 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2085 MKSHLIB_FORCE_ALL='-all'
2086 MKSHLIB_UNFORCE_ALL='-none'
2088 AS_DASH_C_FLAG='-Wc/names=as_is'
2090 DSO_LDOPTS='-shared -auto_symvec'
2092 MOZ_DEBUG_LDFLAGS='-g'
2094 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2095 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2100 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2101 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2109 IMPORT_LIB_SUFFIX=lib
2112 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2113 MOZ_ENABLE_POSTSCRIPT=
2116 MOZ_USER_DIR="Mozilla"
2118 if test "$MOZTOOLS"; then
2119 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2121 AC_MSG_ERROR([MOZTOOLS is not set])
2125 if test -n "$GNU_CC"; then
2127 AC_DEFINE(XP_OS2_EMX)
2128 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2129 AC_DEFINE(TCPV40HDRS)
2132 CFLAGS="$CFLAGS -Zomf"
2133 CXXFLAGS="$CXXFLAGS -Zomf"
2135 BIN_FLAGS='-Zlinker /ST:0x100000'
2139 MOZ_DEBUG_FLAGS="-g -fno-inline"
2140 MOZ_OPTIMIZE_FLAGS="-O2 -s"
2141 MOZ_OPTIMIZE_LDFLAGS="-Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2142 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2143 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2144 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2145 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2146 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2147 LDFLAGS="$LDFLAGS -Zhigh-mem"
2148 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2149 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2152 # GCC for OS/2 currently predefines these, but we don't want them
2153 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2154 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2156 AC_CACHE_CHECK(for __declspec(dllexport),
2158 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2160 ac_os2_declspec="yes",
2161 ac_os2_declspec="no")])
2162 if test "$ac_os2_declspec" = "yes"; then
2164 MOZ_OS2_USE_DECLSPEC='1'
2167 # Visual Age C++ build
2168 elif test "$VACPP" = "yes"; then
2169 MOZ_BUILD_ROOT=`pwd -D`
2172 AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
2181 CFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9"
2182 CXXFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9 /Gx+"
2183 MOZ_DEBUG_FLAGS="/Ti+"
2184 MOZ_OPTIMIZE_FLAGS="/O+ /Gl+ /G5 /qarch=pentium"
2186 MOZ_DEBUG_LDFLAGS="/DE"
2187 MOZ_OPTIMIZE_LDFLAGS="/OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
2190 IMPLIB='implib /NOL /NOI'
2191 FILTER='cppfilt -q -B -P'
2192 AC_DEFINE(NO_ANSI_KEYWORDS)
2195 AC_DEFINE(XP_OS2_VACPP)
2196 AC_DEFINE(TCPV40HDRS)
2197 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2198 AC_DEFINE(STDC_HEADERS)
2199 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2200 MKSHLIB='$(LD) $(DSO_LDOPTS)'
2201 MKCSHLIB='$(LD) $(DSO_LDOPTS)'
2202 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
2203 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcomct.lib'
2204 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2205 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2210 if test "$GNU_CC"; then
2211 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2212 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2215 MOZ_DEBUG_FLAGS='-g'
2216 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2217 CFLAGS="$CFLAGS -ieee"
2218 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2219 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2222 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2223 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2224 MKSHLIB_FORCE_ALL='-all'
2225 MKSHLIB_UNFORCE_ALL='-none'
2226 dnl Might fix the libxpcom.so breakage on this platform as well....
2227 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2228 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2230 if test -z "$GNU_CXX"; then
2233 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2237 DIRENT_INO=d_stat.st_ino
2238 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2239 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2240 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2241 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2242 AC_DEFINE(STDC_HEADERS)
2243 if test "$no_x" = "yes"; then
2244 _PLATFORM_DEFAULT_TOOLKIT='photon'
2245 TK_CFLAGS='-I/usr/nto/include/photon'
2246 TK_LIBS='-lphoton -lphrender'
2251 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2252 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2253 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2254 if test ! "$GNU_CC"; then
2259 dnl the qsort routine under solaris is faulty
2262 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2264 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2265 # libraries one level up (e.g. libnspr4.so)
2266 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2267 if test -z "$GNU_CC"; then
2269 MOZ_FIX_LINK_PATHS='-R $(LIBXUL_DIST)/bin'
2270 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2271 CFLAGS="$CFLAGS -xstrconst -xbuiltin=%all"
2272 CXXFLAGS="$CXXFLAGS -xbuiltin=%all -features=tmplife -norunpath"
2273 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2274 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2275 _SAVE_LDFLAGS=$LDFLAGS
2276 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2277 AC_TRY_LINK([#include <stdio.h>],
2278 [printf("Hello World\n");],
2280 [LDFLAGS=$_SAVE_LDFLAGS])
2282 MOZ_OPTIMIZE_FLAGS="-xO4"
2283 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2284 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2285 MKSHLIB_FORCE_ALL='-z allextract'
2286 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2287 DSO_LDOPTS='-G -z muldefs'
2293 AS='/usr/ccs/bin/as'
2294 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2296 TARGET_COMPILER_ABI="sunc"
2297 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2298 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2299 AC_MSG_CHECKING([for Forte compiler version >= WS6U2])
2303 [#if (__SUNPRO_CC < 0x530)
2306 _BAD_COMPILER=,_BAD_COMPILER=1)
2307 if test -n "$_BAD_COMPILER"; then
2309 AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .])
2313 AC_MSG_RESULT([$_res])
2316 ASFLAGS="$ASFLAGS -fPIC"
2319 _WARNINGS_CXXFLAGS=''
2320 if test "$OS_RELEASE" = "5.3"; then
2321 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2324 if test "$OS_RELEASE" = "5.5.1"; then
2325 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2330 DSO_LDOPTS='-Bdynamic'
2331 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2332 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2334 AC_DEFINE(SPRINTF_RETURNS_STRING)
2335 case "$(target_os)" in
2337 DLL_SUFFIX='.so.1.0'
2343 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2347 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2352 dnl Only one oddball right now (QNX), but this gives us flexibility
2353 dnl if any other platforms need to override this in the future.
2354 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2356 dnl ========================================================
2357 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2358 dnl by now will not have any way to link most binaries (tests
2359 dnl as well as viewer, apprunner, etc.), because some symbols
2360 dnl will be left out of the "composite" .so's by ld as unneeded.
2361 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2362 dnl they can link in the static libs that provide the missing
2364 dnl ========================================================
2365 NO_LD_ARCHIVE_FLAGS=
2366 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2367 NO_LD_ARCHIVE_FLAGS=1
2371 NO_LD_ARCHIVE_FLAGS=
2374 NO_LD_ARCHIVE_FLAGS=
2377 NO_LD_ARCHIVE_FLAGS=
2379 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2380 if test -z "$GNU_CC"; then
2381 NO_LD_ARCHIVE_FLAGS=
2385 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2388 dnl Indicate that platform requires special thread safe
2389 dnl locking when starting up the OJI JVM
2390 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2391 dnl ========================================================
2394 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2398 dnl ========================================================
2399 dnl = Flags to strip unused symbols from .so components
2400 dnl ========================================================
2403 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2406 if test -z "$GNU_CC"; then
2407 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2409 if test -z "$GCC_USE_GNU_LD"; then
2410 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2412 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2417 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2420 AC_MSG_CHECKING(for -exported_symbols_list option to ld)
2421 AC_CACHE_VAL(ac_cv_exported_symbols_list,
2423 if $LD -exported_symbols_list 2>&1 | grep "argument missing" >/dev/null; then
2424 ac_cv_exported_symbols_list=true
2426 ac_cv_exported_symbols_list=false
2429 if test "$ac_cv_exported_symbols_list" = true; then
2430 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2436 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2437 if test -n "$GNU_CC"; then
2438 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2443 if test -z "$COMPILE_ENVIRONMENT"; then
2444 SKIP_COMPILER_CHECKS=1
2445 SKIP_LIBRARY_CHECKS=1
2448 if test -z "$SKIP_COMPILER_CHECKS"; then
2449 dnl Checks for typedefs, structures, and compiler characteristics.
2450 dnl ========================================================
2458 AC_STRUCT_ST_BLKSIZE
2459 AC_MSG_CHECKING(for siginfo_t)
2460 AC_CACHE_VAL(ac_cv_siginfo_t,
2461 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2462 #include <signal.h>],
2464 [ac_cv_siginfo_t=true],
2465 [ac_cv_siginfo_t=false])])
2466 if test "$ac_cv_siginfo_t" = true ; then
2467 AC_DEFINE(HAVE_SIGINFO_T)
2473 dnl Visual Age for os/2 also defines size_t and off_t in certain
2474 dnl header files. These defines make Visual Age use the mozilla
2476 if test "$VACPP" = "yes"; then
2481 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2482 dnl ========================================================
2483 AC_MSG_CHECKING(for int16_t)
2484 AC_CACHE_VAL(ac_cv_int16_t,
2485 [AC_TRY_COMPILE([#include <stdio.h>
2486 #include <sys/types.h>],
2488 [ac_cv_int16_t=true],
2489 [ac_cv_int16_t=false])])
2490 if test "$ac_cv_int16_t" = true ; then
2491 AC_DEFINE(HAVE_INT16_T)
2496 AC_MSG_CHECKING(for int32_t)
2497 AC_CACHE_VAL(ac_cv_int32_t,
2498 [AC_TRY_COMPILE([#include <stdio.h>
2499 #include <sys/types.h>],
2501 [ac_cv_int32_t=true],
2502 [ac_cv_int32_t=false])])
2503 if test "$ac_cv_int32_t" = true ; then
2504 AC_DEFINE(HAVE_INT32_T)
2509 AC_MSG_CHECKING(for int64_t)
2510 AC_CACHE_VAL(ac_cv_int64_t,
2511 [AC_TRY_COMPILE([#include <stdio.h>
2512 #include <sys/types.h>],
2514 [ac_cv_int64_t=true],
2515 [ac_cv_int64_t=false])])
2516 if test "$ac_cv_int64_t" = true ; then
2517 AC_DEFINE(HAVE_INT64_T)
2522 AC_MSG_CHECKING(for int64)
2523 AC_CACHE_VAL(ac_cv_int64,
2524 [AC_TRY_COMPILE([#include <stdio.h>
2525 #include <sys/types.h>],
2528 [ac_cv_int64=false])])
2529 if test "$ac_cv_int64" = true ; then
2530 AC_DEFINE(HAVE_INT64)
2535 AC_MSG_CHECKING(for uint)
2536 AC_CACHE_VAL(ac_cv_uint,
2537 [AC_TRY_COMPILE([#include <stdio.h>
2538 #include <sys/types.h>],
2541 [ac_cv_uint=false])])
2542 if test "$ac_cv_uint" = true ; then
2543 AC_DEFINE(HAVE_UINT)
2548 AC_MSG_CHECKING(for uint_t)
2549 AC_CACHE_VAL(ac_cv_uint_t,
2550 [AC_TRY_COMPILE([#include <stdio.h>
2551 #include <sys/types.h>],
2553 [ac_cv_uint_t=true],
2554 [ac_cv_uint_t=false])])
2555 if test "$ac_cv_uint_t" = true ; then
2556 AC_DEFINE(HAVE_UINT_T)
2561 AC_MSG_CHECKING(for uint16_t)
2562 AC_CACHE_VAL(ac_cv_uint16_t,
2563 [AC_TRY_COMPILE([#include <stdio.h>
2564 #include <sys/types.h>],
2565 [uint16_t foo = 0;],
2566 [ac_cv_uint16_t=true],
2567 [ac_cv_uint16_t=false])])
2568 if test "$ac_cv_uint16_t" = true ; then
2569 AC_DEFINE(HAVE_UINT16_T)
2575 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2576 dnl are defined when compiling C++ but not C. Since the result of this
2577 dnl test is used only in C++, do it in C++.
2580 AC_MSG_CHECKING(for uname.domainname)
2581 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2582 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2583 [ struct utsname *res; char *domain;
2584 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2585 [ac_cv_have_uname_domainname_field=true],
2586 [ac_cv_have_uname_domainname_field=false])])
2588 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2589 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2595 AC_MSG_CHECKING(for uname.__domainname)
2596 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2597 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2598 [ struct utsname *res; char *domain;
2599 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2600 [ac_cv_have_uname_us_domainname_field=true],
2601 [ac_cv_have_uname_us_domainname_field=false])])
2603 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2604 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2612 dnl Check for usable wchar_t (2 bytes, unsigned)
2613 dnl (we really don't need the unsignedness check anymore)
2614 dnl ========================================================
2616 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2617 ac_cv_have_usable_wchar_v2,
2618 [AC_TRY_COMPILE([#include <stddef.h>
2619 $configure_static_assert_macros],
2620 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2621 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2622 ac_cv_have_usable_wchar_v2="yes",
2623 ac_cv_have_usable_wchar_v2="no")])
2624 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2625 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2626 HAVE_CPP_2BYTE_WCHAR_T=1
2628 dnl This is really gcc-only
2629 dnl Do this test using CXX only since some versions of gcc
2630 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2631 dnl only have short-wchar support for c++.
2632 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2636 _SAVE_CXXFLAGS=$CXXFLAGS
2637 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2639 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2640 ac_cv_have_usable_wchar_option_v2,
2641 [AC_TRY_COMPILE([#include <stddef.h>
2642 $configure_static_assert_macros],
2643 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2644 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2645 ac_cv_have_usable_wchar_option_v2="yes",
2646 ac_cv_have_usable_wchar_option_v2="no")])
2648 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2649 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2650 HAVE_CPP_2BYTE_WCHAR_T=1
2652 CXXFLAGS=$_SAVE_CXXFLAGS
2657 dnl Check for .hidden assembler directive and visibility attribute.
2658 dnl Borrowed from glibc configure.in
2659 dnl ===============================================================
2660 if test "$GNU_CC"; then
2661 AC_CACHE_CHECK(for visibility(hidden) attribute,
2662 ac_cv_visibility_hidden,
2663 [cat > conftest.c <<EOF
2664 int foo __attribute__ ((visibility ("hidden"))) = 1;
2666 ac_cv_visibility_hidden=no
2667 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2668 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2669 ac_cv_visibility_hidden=yes
2674 if test "$ac_cv_visibility_hidden" = "yes"; then
2675 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2677 AC_CACHE_CHECK(for visibility(default) attribute,
2678 ac_cv_visibility_default,
2679 [cat > conftest.c <<EOF
2680 int foo __attribute__ ((visibility ("default"))) = 1;
2682 ac_cv_visibility_default=no
2683 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2684 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2685 ac_cv_visibility_default=yes
2690 if test "$ac_cv_visibility_default" = "yes"; then
2691 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2693 AC_CACHE_CHECK(for visibility pragma support,
2694 ac_cv_visibility_pragma,
2695 [cat > conftest.c <<EOF
2696 #pragma GCC visibility push(hidden)
2698 #pragma GCC visibility push(default)
2699 int foo_default = 1;
2701 ac_cv_visibility_pragma=no
2702 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2703 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2704 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2705 ac_cv_visibility_pragma=yes
2711 if test "$ac_cv_visibility_pragma" = "yes"; then
2712 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2713 ac_cv_have_visibility_class_bug,
2714 [cat > conftest.c <<EOF
2715 #pragma GCC visibility push(hidden)
2716 struct __attribute__ ((visibility ("default"))) TestStruct {
2719 __attribute__ ((visibility ("default"))) void TestFunc() {
2723 ac_cv_have_visibility_class_bug=no
2724 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2725 ac_cv_have_visibility_class_bug=yes
2727 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2728 ac_cv_have_visibility_class_bug=yes
2731 rm -rf conftest.{c,S}
2734 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2735 ac_cv_have_visibility_builtin_bug,
2736 [cat > conftest.c <<EOF
2737 #pragma GCC visibility push(hidden)
2738 #pragma GCC visibility push(default)
2740 #pragma GCC visibility pop
2742 __attribute__ ((visibility ("default"))) void Func() {
2744 memset(c, 0, sizeof(c));
2747 ac_cv_have_visibility_builtin_bug=no
2748 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2749 ac_cv_have_visibility_builtin_bug=yes
2751 if test `grep -c "@PLT" conftest.S` = 0; then
2752 ac_cv_visibility_builtin_bug=yes
2755 rm -f conftest.{c,S}
2757 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2758 "$ac_cv_have_visibility_class_bug" = "no"; then
2759 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2760 WRAP_SYSTEM_INCLUDES=1
2762 VISIBILITY_FLAGS='-fvisibility=hidden'
2763 fi # have visibility pragma bug
2764 fi # have visibility pragma
2765 fi # have visibility(default) attribute
2766 fi # have visibility(hidden) attribute
2769 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2770 AC_SUBST(VISIBILITY_FLAGS)
2772 dnl Checks for header files.
2773 dnl ========================================================
2775 case "$target_os" in
2777 # for stuff like -lXshm
2778 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2781 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
2782 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
2783 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
2784 AC_CHECK_HEADERS(malloc.h)
2785 AC_CHECK_HEADERS(X11/XKBlib.h)
2787 dnl These are all the places some variant of statfs can be hiding.
2788 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2790 dnl Try for MMX support
2791 dnl NB - later gcc versions require -mmmx for this header to be successfully
2792 dnl included (or another option which implies it, such as -march=pentium-mmx)
2793 AC_CHECK_HEADERS(mmintrin.h)
2795 dnl Check whether the compiler supports the new-style C++ standard
2796 dnl library headers (i.e. <new>) or needs the old "new.h"
2799 AC_CHECK_HEADER(new, [NEW_H=new])
2800 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2807 AC_CHECK_HEADERS(sys/cdefs.h)
2811 dnl Checks for libraries.
2812 dnl ========================================================
2817 AC_CHECK_LIB(c_r, gethostbyname_r)
2821 dnl We don't want to link with libdl even if it's present on OS X, since
2822 dnl it's not used and not part of the default installation.
2823 dnl The same goes for BeOS.
2824 dnl We don't want to link against libm or libpthread on Darwin since
2825 dnl they both are just symlinks to libSystem and explicitly linking
2826 dnl against libSystem causes issues when debugging (see bug 299601).
2833 AC_CHECK_LIB(m, atan)
2834 AC_CHECK_LIB(dl, dlopen,
2835 AC_CHECK_HEADER(dlfcn.h,
2837 AC_DEFINE(HAVE_LIBDL)))
2840 if test ! "$GNU_CXX"; then
2844 AC_CHECK_LIB(C_r, demangle)
2847 AC_CHECK_LIB(C, demangle)
2851 AC_CHECK_LIB(socket, socket)
2854 XLIBS="$X_EXTRA_LIBS"
2856 dnl ========================================================
2857 dnl Checks for X libraries.
2858 dnl Ordering is important.
2859 dnl Xt is dependent upon SM as of X11R6
2860 dnl ========================================================
2861 if test "$no_x" = "yes"; then
2864 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
2865 XLIBS="-lX11 $XLIBS"
2866 _SAVE_LDFLAGS="$LDFLAGS"
2867 LDFLAGS="$XLDFLAGS $LDFLAGS"
2868 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
2869 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
2870 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
2871 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
2874 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
2875 unset ac_cv_lib_Xt_XtFree
2876 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
2877 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
2878 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
2879 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
2882 # AIX needs the motif library linked before libXt to prevent
2883 # crashes in plugins linked against Motif - Bug #98892
2884 case "${target_os}" in
2886 XT_LIBS="-lXm $XT_LIBS"
2890 dnl ========================================================
2891 dnl = Check for XShm
2892 dnl ========================================================
2893 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
2895 AC_CHECK_HEADER(X11/extensions/XShm.h)
2896 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
2897 test -n "$_HAVE_XSHM_XEXT"; then
2898 AC_DEFINE(HAVE_XSHM)
2901 dnl ========================================================
2903 dnl ========================================================
2904 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
2906 AC_CHECK_HEADER(X11/extensions/XIElib.h)
2908 if test "$MOZ_XIE_LIBS"; then
2909 dnl ====================================================
2910 dnl = If XIE is present and is desired, turn it on
2911 dnl ====================================================
2921 LDFLAGS="$_SAVE_LDFLAGS"
2923 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
2932 dnl ========================================================
2933 dnl = pthread support
2934 dnl = Start by checking whether the system support pthreads
2935 dnl ========================================================
2936 case "$target_os" in
2941 MOZ_CHECK_PTHREADS(pthreads,
2942 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2943 MOZ_CHECK_PTHREADS(pthread,
2944 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2945 MOZ_CHECK_PTHREADS(c_r,
2946 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2947 MOZ_CHECK_PTHREADS(c,
2956 dnl ========================================================
2957 dnl Check the command line for --with-pthreads
2958 dnl ========================================================
2959 MOZ_ARG_WITH_BOOL(pthreads,
2960 [ --with-pthreads Force use of system pthread library with NSPR ],
2961 [ if test "$USE_PTHREADS"x = x; then
2962 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2968 dnl ========================================================
2969 dnl Do the platform specific pthread hackery
2970 dnl ========================================================
2971 if test "$USE_PTHREADS"x != x
2974 dnl See if -pthread is supported.
2977 ac_cv_have_dash_pthread=no
2978 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2979 echo 'int main() { return 0; }' | cat > conftest.c
2980 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2981 if test $? -eq 0; then
2982 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2983 ac_cv_have_dash_pthread=yes
2984 case "$target_os" in
2986 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2989 CFLAGS="$CFLAGS -pthread"
2990 CXXFLAGS="$CXXFLAGS -pthread"
2996 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2999 dnl See if -pthreads is supported.
3001 ac_cv_have_dash_pthreads=no
3002 if test "$ac_cv_have_dash_pthread" = "no"; then
3003 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3004 echo 'int main() { return 0; }' | cat > conftest.c
3005 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3006 if test $? -eq 0; then
3007 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3008 ac_cv_have_dash_pthreads=yes
3009 CFLAGS="$CFLAGS -pthreads"
3010 CXXFLAGS="$CXXFLAGS -pthreads"
3014 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3019 AC_DEFINE(_REENTRANT)
3020 AC_DEFINE(_THREAD_SAFE)
3021 dnl -pthread links in -lc_r, so don't specify it explicitly.
3022 if test "$ac_cv_have_dash_pthread" = "yes"; then
3023 _PTHREAD_LDFLAGS="-pthread"
3025 _PTHREAD_LDFLAGS="-lc_r"
3029 *-*-openbsd*|*-*-bsdi*)
3030 AC_DEFINE(_REENTRANT)
3031 AC_DEFINE(_THREAD_SAFE)
3032 dnl -pthread links in -lc_r, so don't specify it explicitly.
3033 if test "$ac_cv_have_dash_pthread" = "yes"; then
3034 _PTHREAD_LDFLAGS="-pthread"
3039 AC_DEFINE(_REENTRANT)
3043 AC_DEFINE(_REENTRANT)
3047 AC_DEFINE(_REENTRANT)
3051 AC_DEFINE(_REENTRANT)
3055 AC_DEFINE(_REENTRANT)
3059 AC_DEFINE(_REENTRANT)
3060 if test ! "$GNU_CC"; then
3061 CFLAGS="$CFLAGS -mt"
3062 CXXFLAGS="$CXXFLAGS -mt"
3066 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3069 dnl ========================================================
3070 dnl Check for MacOS deployment target version
3071 dnl ========================================================
3073 MOZ_ARG_ENABLE_STRING(macos-target,
3074 [ --enable-macos-target=VER (default=10.4)
3075 Set the minimum MacOS version needed at runtime],
3076 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
3080 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
3081 dnl Use the specified value
3082 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
3083 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
3084 dnl No value specified on the command line or in the environment,
3085 dnl use the lesser of the application's minimum or the architecture's
3087 export MACOSX_DEPLOYMENT_TARGET=10.4
3092 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3094 dnl ========================================================
3095 dnl See if mmap sees writes
3096 dnl For cross compiling, just define it as no, which is a safe default
3097 dnl ========================================================
3098 AC_MSG_CHECKING(whether mmap() sees write()s)
3104 #include <sys/mman.h>
3105 #include <sys/types.h>
3106 #include <sys/stat.h>
3109 char fname[] = "conftest.file";
3110 char zbuff[1024]; /* Fractional page is probably worst case */
3117 fd = open(fname, O_RDWR | O_CREAT, 0660);
3120 write(fd, zbuff, sizeof(zbuff));
3121 lseek(fd, 0, SEEK_SET);
3122 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3123 if(map==(char*)-1) return 2;
3124 for(i=0; fname[i]; i++) {
3125 int rc = write(fd, &fname[i], 1);
3126 if(map[i]!=fname[i]) return 4;
3133 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3135 AC_MSG_RESULT("$result")
3137 if test "$result" = "no"; then
3138 AC_DEFINE(MMAP_MISSES_WRITES)
3142 dnl Checks for library functions.
3143 dnl ========================================================
3144 AC_PROG_GCC_TRADITIONAL
3146 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64)
3147 AC_CHECK_FUNCS(flockfile getpagesize)
3149 dnl localtime_r and strtok_r are only present on MacOS version 10.2 and higher
3150 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100200"; then
3151 AC_CHECK_FUNCS(localtime_r strtok_r)
3154 dnl check for wcrtomb/mbrtowc
3155 dnl =======================================================================
3156 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3159 AC_CACHE_CHECK(for wcrtomb,
3161 [AC_TRY_LINK([#include <wchar.h>],
3162 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3163 ac_cv_have_wcrtomb="yes",
3164 ac_cv_have_wcrtomb="no")])
3165 if test "$ac_cv_have_wcrtomb" = "yes"; then
3166 AC_DEFINE(HAVE_WCRTOMB)
3168 AC_CACHE_CHECK(for mbrtowc,
3170 [AC_TRY_LINK([#include <wchar.h>],
3171 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3172 ac_cv_have_mbrtowc="yes",
3173 ac_cv_have_mbrtowc="no")])
3174 if test "$ac_cv_have_mbrtowc" = "yes"; then
3175 AC_DEFINE(HAVE_MBRTOWC)
3182 ac_cv_func_res_ninit,
3185 #define _BSD_SOURCE 1
3189 [int foo = res_ninit(&_res);],
3190 [ac_cv_func_res_ninit=yes],
3191 [ac_cv_func_res_ninit=no])
3194 if test "$ac_cv_func_res_ninit" = "yes"; then
3195 AC_DEFINE(HAVE_RES_NINIT)
3196 dnl must add the link line we do something as foolish as this... dougt
3198 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3199 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3204 [for gnu_get_libc_version()],
3205 ac_cv_func_gnu_get_libc_version,
3207 #ifdef HAVE_GNU_LIBC_VERSION_H
3208 #include <gnu/libc-version.h>
3211 [const char *glibc_version = gnu_get_libc_version();],
3212 [ac_cv_func_gnu_get_libc_version=yes],
3213 [ac_cv_func_gnu_get_libc_version=no]
3217 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3218 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3222 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3226 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3227 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3228 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3230 LIBS="$LIBS $_ICONV_LIBS"
3239 iconv_t h = iconv_open("", "");
3240 iconv(h, NULL, NULL, NULL, NULL);
3243 [ac_cv_func_iconv=yes],
3244 [ac_cv_func_iconv=no]
3247 if test "$ac_cv_func_iconv" = "yes"; then
3248 AC_DEFINE(HAVE_ICONV)
3249 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3250 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3251 LIBICONV="$_ICONV_LIBS"
3253 [for iconv() with const input],
3254 ac_cv_func_const_iconv,
3260 const char *input = "testing";
3261 iconv_t h = iconv_open("", "");
3262 iconv(h, &input, NULL, NULL, NULL);
3265 [ac_cv_func_const_iconv=yes],
3266 [ac_cv_func_const_iconv=no]
3269 if test "$ac_cv_func_const_iconv" = "yes"; then
3270 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3282 dnl **********************
3283 dnl *** va_copy checks ***
3284 dnl **********************
3285 dnl we currently check for all three va_copy possibilities, so we get
3286 dnl all results in config.log for bug reports.
3287 AC_MSG_CHECKING(for an implementation of va_copy())
3288 AC_CACHE_VAL(ac_cv_va_copy,[
3291 void f (int i, ...) {
3292 va_list args1, args2;
3293 va_start (args1, i);
3294 va_copy (args2, args1);
3295 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3297 va_end (args1); va_end (args2);
3299 int main() { f (0, 42); return 0; }],
3305 AC_MSG_RESULT($ac_cv_va_copy)
3306 AC_MSG_CHECKING(for an implementation of __va_copy())
3307 AC_CACHE_VAL(ac_cv___va_copy,[
3310 void f (int i, ...) {
3311 va_list args1, args2;
3312 va_start (args1, i);
3313 __va_copy (args2, args1);
3314 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3316 va_end (args1); va_end (args2);
3318 int main() { f (0, 42); return 0; }],
3319 ac_cv___va_copy=yes,
3324 AC_MSG_RESULT($ac_cv___va_copy)
3325 AC_MSG_CHECKING(whether va_lists can be copied by value)
3326 AC_CACHE_VAL(ac_cv_va_val_copy,[
3329 void f (int i, ...) {
3330 va_list args1, args2;
3331 va_start (args1, i);
3333 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3335 va_end (args1); va_end (args2);
3337 int main() { f (0, 42); return 0; }],
3338 ac_cv_va_val_copy=yes,
3339 ac_cv_va_val_copy=no,
3340 ac_cv_va_val_copy=yes
3343 if test "x$ac_cv_va_copy" = "xyes"; then
3344 AC_DEFINE(VA_COPY, va_copy)
3345 AC_DEFINE(HAVE_VA_COPY)
3346 elif test "x$ac_cv___va_copy" = "xyes"; then
3347 AC_DEFINE(VA_COPY, __va_copy)
3348 AC_DEFINE(HAVE_VA_COPY)
3351 if test "x$ac_cv_va_val_copy" = "xno"; then
3352 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3354 AC_MSG_RESULT($ac_cv_va_val_copy)
3356 dnl Check for dll-challenged libc's.
3357 dnl This check is apparently only needed for Linux.
3360 dnl ===================================================================
3363 rm -rf conftest* _conftest
3365 cat >> conftest.C <<\EOF
3370 void __dump_link_map(void) {
3371 struct link_map *map = _dl_loaded;
3372 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3375 dlopen("./conftest1.so",RTLD_LAZY);
3376 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3377 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3378 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3382 /* _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).*/
3383 int main() { printf("./conftest1.so\n"); }
3387 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3389 cat >> conftest1.C <<\EOF
3391 void foo(void) {printf("foo in dll called\n");}
3393 ${CXX-g++} -fPIC -c -g conftest1.C
3394 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3395 ${CXX-g++} -g conftest.C -o conftest -ldl
3396 cp -f conftest1.so conftest _conftest
3398 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3401 echo "*** Your libc has a bug that can result in loading the same dynamic"
3402 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3403 echo "*** or later. However, if you choose not to upgrade, the only effect"
3404 echo "*** will be excessive memory usage at runtime."
3408 rm -rf conftest* _conftest
3409 dnl ===================================================================
3413 dnl ===================================================================
3414 dnl ========================================================
3415 dnl By default, turn rtti and exceptions off on g++/egcs
3416 dnl ========================================================
3417 if test "$GNU_CXX"; then
3419 AC_MSG_CHECKING(for C++ exceptions flag)
3421 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3422 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3423 [echo "int main() { return 0; }" | cat > conftest.C
3425 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3427 if egrep "warning.*renamed" conftest.out >/dev/null; then
3428 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3430 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3435 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3436 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3437 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3440 dnl ========================================================
3441 dnl Put your C++ language/feature checks below
3442 dnl ========================================================
3446 if test "$GNU_CC"; then
3447 AC_CACHE_CHECK(for gcc 3.0 ABI,
3448 ac_cv_gcc_three_abi,
3451 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3457 ac_cv_gcc_three_abi="yes",
3458 ac_cv_gcc_three_abi="no")])
3459 if test "$ac_cv_gcc_three_abi" = "yes"; then
3460 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3463 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3466 AC_SUBST(HAVE_GCC3_ABI)
3469 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3471 [AC_TRY_COMPILE(class X {
3472 public: explicit X(int i) : i_(i) {}
3476 ac_cv_cpp_explicit=yes,
3477 ac_cv_cpp_explicit=no)])
3478 if test "$ac_cv_cpp_explicit" = yes ; then
3479 AC_DEFINE(HAVE_CPP_EXPLICIT)
3482 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3484 [AC_TRY_COMPILE(class param {
3486 typedef unsigned long num_type;
3489 template <class T> class tplt {
3491 typedef typename T::num_type t_num_type;
3492 t_num_type foo(typename T::num_type num) {
3498 ac_cv_cpp_typename=yes,
3499 ac_cv_cpp_typename=no)])
3500 if test "$ac_cv_cpp_typename" = yes ; then
3501 AC_DEFINE(HAVE_CPP_TYPENAME)
3504 dnl Check for support of modern template specialization syntax
3505 dnl Test code and requirement from scc@netscape.com.
3506 dnl Autoconf cut-and-paste job by waterson@netscape.com
3507 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3508 ac_cv_cpp_modern_specialize_template_syntax,
3509 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3511 template <> struct X<Y> { double a; };,
3514 ac_cv_cpp_modern_specialize_template_syntax=yes,
3515 ac_cv_cpp_modern_specialize_template_syntax=no)])
3516 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3517 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3521 dnl Some compilers support only full specialization, and some don't.
3522 AC_CACHE_CHECK(whether partial template specialization works,
3523 ac_cv_cpp_partial_specialization,
3524 [AC_TRY_COMPILE(template <class T> class Foo {};
3525 template <class T> class Foo<T*> {};,
3527 ac_cv_cpp_partial_specialization=yes,
3528 ac_cv_cpp_partial_specialization=no)])
3529 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3530 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3533 dnl Some compilers have limited support for operators with templates;
3534 dnl specifically, it is necessary to define derived operators when a base
3535 dnl class's operator declaration should suffice.
3536 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3537 ac_cv_need_derived_template_operators,
3538 [AC_TRY_COMPILE([template <class T> class Base { };
3540 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3541 template <class T> class Derived : public Base<T> { };],
3542 [Derived<char> a, b;
3543 Base<char> c = a + b;
3545 ac_cv_need_derived_template_operators=no,
3546 ac_cv_need_derived_template_operators=yes)])
3547 if test "$ac_cv_need_derived_template_operators" = yes ; then
3548 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3552 dnl Some compilers have trouble detecting that a template class
3553 dnl that derives from another template is actually an instance
3554 dnl of the base class. This test checks for that.
3555 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3556 ac_cv_need_cpp_template_cast_to_base,
3557 [AC_TRY_COMPILE([template <class T> class Base { };
3558 template <class T> class Derived : public Base<T> { };
3559 template <class T> int foo(const Base<T>&) { return 0; }],
3560 [Derived<char> bar; return foo(bar);],
3561 ac_cv_need_cpp_template_cast_to_base=no,
3562 ac_cv_need_cpp_template_cast_to_base=yes)])
3563 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3564 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3567 dnl Some compilers have trouble resolving the ambiguity between two
3568 dnl functions whose arguments differ only by cv-qualifications.
3569 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3570 ac_cv_can_resolve_const_ambiguity,
3572 template <class T> class ptrClass {
3576 template <class T> T* a(ptrClass<T> *arg) {
3581 const T* a(const ptrClass<T> *arg) {
3587 ac_cv_can_resolve_const_ambiguity=yes,
3588 ac_cv_can_resolve_const_ambiguity=no)])
3589 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3590 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3594 dnl We don't do exceptions on unix. The only reason this used to be here
3595 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3596 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3597 dnl So im commenting this out until someone writes some artificial
3598 dnl intelligence to detect not only if the compiler has exceptions, but if
3599 dnl they are enabled as well.
3601 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3602 dnl ac_cv_cpp_exceptions,
3603 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3604 dnl static void F() { throw X(); },
3605 dnl try { F(); } catch(X & e) { },
3606 dnl ac_cv_cpp_exceptions=yes,
3607 dnl ac_cv_cpp_exceptions=no)])
3608 dnl if test $ac_cv_cpp_exceptions = yes ; then
3609 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3612 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3613 dnl supports it well enough to allow us to use it to change access, but not
3614 dnl to resolve ambiguity. The next two tests determine how well the |using|
3615 dnl keyword is supported.
3617 dnl Check to see if we can change access with |using|. Test both a
3618 dnl legal and an illegal example.
3619 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3620 ac_cv_cpp_access_changing_using2,
3622 class A { protected: int foo() { return 0; } };
3623 class B : public A { public: using A::foo; };,
3624 B b; return b.foo();,
3626 class A { public: int foo() { return 1; } };
3627 class B : public A { private: using A::foo; };,
3628 B b; return b.foo();,
3629 ac_cv_cpp_access_changing_using2=no,
3630 ac_cv_cpp_access_changing_using2=yes)],
3631 ac_cv_cpp_access_changing_using2=no)])
3632 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3633 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3636 dnl Check to see if we can resolve ambiguity with |using|.
3637 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3638 ac_cv_cpp_ambiguity_resolving_using,
3639 [AC_TRY_COMPILE(class X {
3640 public: int go(const X&) {return 3;}
3641 int jo(const X&) {return 3;}
3643 class Y : public X {
3644 public: int go(int) {return 2;}
3645 int jo(int) {return 2;}
3647 private: using X::go;
3650 ac_cv_cpp_ambiguity_resolving_using=yes,
3651 ac_cv_cpp_ambiguity_resolving_using=no)])
3652 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3653 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3656 dnl Check to see if the |std| namespace is supported. If so, we'll want
3657 dnl to qualify any standard library calls with "std::" to ensure that
3658 dnl those functions can be resolved.
3659 AC_CACHE_CHECK(for \"std::\" namespace,
3660 ac_cv_cpp_namespace_std,
3661 [AC_TRY_COMPILE([#include <algorithm>],
3662 [return std::min(0, 1);],
3663 ac_cv_cpp_namespace_std=yes,
3664 ac_cv_cpp_namespace_std=no)])
3665 if test "$ac_cv_cpp_namespace_std" = yes ; then
3666 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3669 dnl Older compilers are overly ambitious with respect to using the standard
3670 dnl template library's |operator!=()| when |operator==()| is defined. In
3671 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3672 dnl ambiguity at compile-time. This test checks for that case.
3673 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3674 ac_cv_cpp_unambiguous_std_notequal,
3675 [AC_TRY_COMPILE([#include <algorithm>
3677 int operator==(const T1&, const T1&) { return 0; }
3678 int operator!=(const T1&, const T1&) { return 0; }],
3679 [T1 a,b; return a != b;],
3680 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3681 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3682 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3683 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
3687 AC_CACHE_CHECK(for C++ reinterpret_cast,
3688 ac_cv_cpp_reinterpret_cast,
3689 [AC_TRY_COMPILE(struct X { int i; };
3690 struct Y { int i; };,
3691 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
3692 ac_cv_cpp_reinterpret_cast=yes,
3693 ac_cv_cpp_reinterpret_cast=no)])
3694 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
3695 AC_DEFINE(HAVE_CPP_NEW_CASTS)
3698 dnl See if a dynamic_cast to void* gives the most derived object.
3699 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3700 ac_cv_cpp_dynamic_cast_void_ptr,
3701 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3702 class Y { int j; public: virtual ~Y() { } };
3703 class Z : public X, public Y { int k; };
3709 return !((((void*)&mdo != (void*)subx) &&
3710 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3711 (((void*)&mdo != (void*)suby) &&
3712 ((void*)&mdo == dynamic_cast<void*>(suby))));
3714 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3715 ac_cv_cpp_dynamic_cast_void_ptr=no,
3716 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3717 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3718 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3722 dnl note that this one is reversed - if the test fails, then
3723 dnl we require implementations of unused virtual methods. Which
3724 dnl really blows because it means we'll have useless vtable
3726 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3727 ac_cv_cpp_unused_required,
3728 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3730 ac_cv_cpp_unused_required=no,
3731 ac_cv_cpp_unused_required=yes)])
3732 if test "$ac_cv_cpp_unused_required" = yes ; then
3733 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3737 dnl Some compilers have trouble comparing a constant reference to a templatized
3738 dnl class to zero, and require an explicit operator==() to be defined that takes
3739 dnl an int. This test separates the strong from the weak.
3741 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3742 ac_cv_trouble_comparing_to_zero,
3743 [AC_TRY_COMPILE([#include <algorithm>
3744 template <class T> class Foo {};
3746 template <class T> int operator==(const T2*, const T&) { return 0; }
3747 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3748 [Foo<int> f; return (0 != f);],
3749 ac_cv_trouble_comparing_to_zero=no,
3750 ac_cv_trouble_comparing_to_zero=yes)])
3751 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3752 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3757 dnl End of C++ language/feature checks
3760 dnl ========================================================
3761 dnl = Internationalization checks
3762 dnl ========================================================
3764 dnl Internationalization and Locale support is different
3765 dnl on various UNIX platforms. Checks for specific i18n
3766 dnl features go here.
3768 dnl check for LC_MESSAGES
3769 AC_CACHE_CHECK(for LC_MESSAGES,
3770 ac_cv_i18n_lc_messages,
3771 [AC_TRY_COMPILE([#include <locale.h>],
3772 [int category = LC_MESSAGES;],
3773 ac_cv_i18n_lc_messages=yes,
3774 ac_cv_i18n_lc_messages=no)])
3775 if test "$ac_cv_i18n_lc_messages" = yes; then
3776 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3779 fi # SKIP_COMPILER_CHECKS
3782 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3783 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3786 dnl Mozilla specific options
3787 dnl ========================================================
3788 dnl The macros used for command line options
3789 dnl are defined in build/autoconf/altoptions.m4.
3792 dnl ========================================================
3794 dnl = Check for external package dependencies
3796 dnl ========================================================
3797 MOZ_ARG_HEADER(External Packages)
3801 MOZ_ARG_WITH_STRING(libxul-sdk,
3802 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
3803 LIBXUL_SDK_DIR=$withval)
3805 if test "$LIBXUL_SDK_DIR" = "yes"; then
3806 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
3807 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
3808 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
3810 if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
3811 AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
3816 AC_SUBST(LIBXUL_SDK)
3818 dnl ========================================================
3819 dnl = If NSPR was not detected in the system,
3820 dnl = use the one in the source tree (mozilla/nsprpub)
3821 dnl ========================================================
3822 MOZ_ARG_WITH_BOOL(system-nspr,
3823 [ --with-system-nspr Use system installed NSPR],
3824 _USE_SYSTEM_NSPR=1 )
3826 if test -n "$_USE_SYSTEM_NSPR"; then
3827 AM_PATH_NSPR(4.0.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
3830 if test -n "$MOZ_NATIVE_NSPR"; then
3831 _SAVE_CFLAGS=$CFLAGS
3832 CFLAGS="$CFLAGS $NSPR_CFLAGS"
3833 AC_TRY_COMPILE([#include "prlog.h"],
3834 [#ifndef PR_STATIC_ASSERT
3835 #error PR_STATIC_ASSERT not defined
3837 [MOZ_NATIVE_NSPR=1],
3838 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
3839 CFLAGS=$_SAVE_CFLAGS
3841 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --includedir=$(LIBXUL_DIST)/include/nspr --cflags`'
3842 # explicitly set libs for Visual Age C++ for OS/2
3843 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
3844 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''
3845 elif test "$OS_ARCH" = "WINCE"; then
3846 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3847 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3848 elif test "$OS_ARCH" = "WINNT"; then
3849 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3850 if test -n "$GNU_CC"; then
3851 NSPR_LIBS="-L\$(LIBXUL_DIST)/lib -lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION"
3853 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3856 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --libdir=$(LIBXUL_DIST)/lib --libs`'
3860 dnl ========================================================
3861 dnl = If NSS was not detected in the system,
3862 dnl = use the one in the source tree (mozilla/security/nss)
3863 dnl ========================================================
3865 MOZ_ARG_WITH_BOOL(system-nss,
3866 [ --with-system-nss Use system installed NSS],
3869 if test -n "$_USE_SYSTEM_NSS"; then
3870 AM_PATH_NSS(3.0.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
3873 if test -n "$MOZ_NATIVE_NSS"; then
3874 NSS_LIBS="$NSS_LIBS -lcrmf"
3876 NSS_CFLAGS='-I$(LIBXUL_DIST)/public/nss'
3878 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3879 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)smime'$NSS_VERSION'$(DLL_SUFFIX) \\\
3880 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)ssl'$NSS_VERSION'$(DLL_SUFFIX) \\\
3881 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)nss'$NSS_VERSION'$(DLL_SUFFIX) \\\
3882 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)softokn'$NSS_VERSION'$(DLL_SUFFIX)'
3884 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
3886 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3887 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)smime'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3888 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)ssl'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3889 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nss'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3890 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)softokn'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX)'
3892 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lsoftokn$NSS_VERSION"
3896 if test -z "$SKIP_LIBRARY_CHECKS"; then
3897 dnl system JPEG support
3898 dnl ========================================================
3899 MOZ_ARG_WITH_STRING(system-jpeg,
3900 [ --with-system-jpeg[=PFX]
3901 Use system libjpeg [installed at prefix PFX]],
3904 _SAVE_CFLAGS=$CFLAGS
3905 _SAVE_LDFLAGS=$LDFLAGS
3907 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
3908 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
3909 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
3911 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
3914 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
3917 if test "$SYSTEM_JPEG" = 1; then
3918 LIBS="$JPEG_LIBS $LIBS"
3919 AC_TRY_COMPILE([ #include <stdio.h>
3920 #include <sys/types.h>
3921 #include <jpeglib.h> ],
3922 [ #if JPEG_LIB_VERSION < $MOZJPEG
3923 #error "Insufficient JPEG library version ($MOZJPEG required)."
3926 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
3928 CFLAGS=$_SAVE_CFLAGS
3929 LDFLAGS=$_SAVE_LDFLAGS
3932 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
3933 JPEG_CFLAGS="-I${JPEG_DIR}/include"
3934 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
3937 dnl system ZLIB support
3938 dnl ========================================================
3939 MOZ_ARG_WITH_STRING(system-zlib,
3940 [ --with-system-zlib[=PFX]
3941 Use system libz [installed at prefix PFX]],
3944 _SAVE_CFLAGS=$CFLAGS
3945 _SAVE_LDFLAGS=$LDFLAGS
3947 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
3948 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
3949 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
3951 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
3954 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
3955 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
3957 if test "$SYSTEM_ZLIB" = 1; then
3958 LIBS="$ZLIB_LIBS $LIBS"
3959 AC_TRY_COMPILE([ #include <stdio.h>
3961 #include <zlib.h> ],
3962 [ #if ZLIB_VERNUM < $MOZZLIB
3963 #error "Insufficient zlib version ($MOZZLIB required)."
3966 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
3968 CFLAGS=$_SAVE_CFLAGS
3969 LDFLAGS=$_SAVE_LDFLAGS
3972 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
3973 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
3974 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
3977 dnl system PNG Support
3978 dnl ========================================================
3979 MOZ_ARG_WITH_STRING(system-png,
3980 [ --with-system-png[=PFX]
3981 Use system libpng [installed at prefix PFX]],
3984 _SAVE_CFLAGS=$CFLAGS
3985 _SAVE_LDFLAGS=$LDFLAGS
3987 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
3988 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
3989 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
3990 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
3991 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
3993 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
3996 _SAVE_PNG_LIBS=$PNG_LIBS
3997 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
3998 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4000 AC_CHECK_LIB(png, png_get_acTL, ,
4001 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4004 if test "$SYSTEM_PNG" = 1; then
4005 LIBS="$PNG_LIBS $LIBS"
4006 AC_TRY_COMPILE([ #include <stdio.h>
4007 #include <sys/types.h>
4009 [ #if PNG_LIBPNG_VER < $MOZPNG
4010 #error "Insufficient libpng version ($MOZPNG required)."
4012 #ifndef PNG_UINT_31_MAX
4013 #error "Insufficient libpng version."
4016 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4018 CFLAGS=$_SAVE_CFLAGS
4019 LDFLAGS=$_SAVE_LDFLAGS
4022 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4023 PNG_CFLAGS="-I${PNG_DIR}/include"
4024 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4027 fi # SKIP_LIBRARY_CHECKS
4029 dnl check whether to enable glitz
4030 dnl ========================================================
4031 MOZ_ARG_ENABLE_BOOL(glitz,
4032 [ --enable-glitz Enable Glitz for use with Cairo],
4035 if test "$MOZ_ENABLE_GLITZ"; then
4036 AC_DEFINE(MOZ_ENABLE_GLITZ)
4039 dnl ========================================================
4040 dnl Java SDK support
4041 dnl ========================================================
4043 MOZ_ARG_WITH_STRING(java-include-path,
4044 [ --with-java-include-path=dir Location of Java SDK headers],
4045 JAVA_INCLUDE_PATH=$withval)
4048 MOZ_ARG_WITH_STRING(java-bin-path,
4049 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4050 JAVA_BIN_PATH=$withval)
4052 dnl ========================================================
4056 dnl ========================================================
4058 MOZ_ARG_HEADER(Application)
4062 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4063 MOZ_BRANDING_DIRECTORY=
4065 MOZ_DBGRINFO_MODULES=
4067 MOZ_EXTENSIONS_ALL=" wallet xml-rpc help venkman inspector irc typeaheadfind gnomevfs sroaming datetime finger cview layout-debug tasks sql xforms schema-validation reporter"
4069 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4070 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4083 MOZ_AUTH_EXTENSION=1
4084 MOZ_NO_ACTIVEX_SUPPORT=1
4085 MOZ_NO_INSPECTOR_APIS=
4086 MOZ_NO_XPCOM_OBSOLETE=
4091 MOZ_PLAINTEXT_EDITOR_ONLY=
4093 MOZ_PREF_EXTENSIONS=1
4094 MOZ_PROFILELOCKING=1
4095 MOZ_PROFILESHARING=1
4097 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4099 MOZ_PYTHON_DEBUG_SUFFIX=
4100 MOZ_PYTHON_DLL_SUFFIX=
4101 MOZ_PYTHON_INCLUDES=
4105 MOZ_PYTHON_VER_DOTTED=
4111 MOZ_STATIC_MAIL_BUILD=
4116 MOZ_UNIVERSALCHARDET=1
4118 MOZ_USE_NATIVE_UCONV=
4123 MOZ_XPFE_COMPONENTS=1
4125 MOZ_XSLT_STANDALONE=
4132 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4133 NECKO_SMALL_BUFFERS=
4136 XPC_IDISPATCH_SUPPORT=
4139 case "$target_os" in
4148 case "$target_os" in
4149 msvc*|mks*|cygwin*|mingw*)
4150 if test -z "$GNU_CC"; then
4151 XPC_IDISPATCH_SUPPORT=1
4152 MOZ_NO_ACTIVEX_SUPPORT=
4153 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4158 MOZ_ARG_ENABLE_STRING(application,
4159 [ --enable-application=APP
4169 content/xslt (Standalone Transformiix XSLT)
4170 netwerk (Standalone Necko)
4171 tools/update-packaging (AUS-related packaging tools)
4172 standalone (use this for standalone
4173 xpcom/xpconnect or to manually drive a build)],
4174 [ MOZ_BUILD_APP=$enableval ] )
4176 if test "$MOZ_BUILD_APP" = "macbrowser"; then
4177 AC_MSG_WARN([--enable-application=macbrowser is deprecated. Use --enable-application=camino.])
4178 MOZ_BUILD_APP=camino
4181 case "$MOZ_BUILD_APP" in
4183 MOZ_EMBEDDING_PROFILE=basic
4187 MOZ_EMBEDDING_PROFILE=default
4191 MOZ_ARG_WITH_STRING(embedding-profile,
4192 [ --with-embedding-profile=default|basic|minimal
4193 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4194 [ MOZ_EMBEDDING_PROFILE=$withval ])
4196 case "$MOZ_EMBEDDING_PROFILE" in
4198 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4199 MOZ_EMBEDDING_LEVEL_BASIC=1
4200 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4201 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4202 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4203 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4207 MOZ_EMBEDDING_LEVEL_DEFAULT=
4208 MOZ_EMBEDDING_LEVEL_BASIC=1
4209 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4210 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4211 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4213 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4216 MOZ_ENABLE_POSTSCRIPT=
4217 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4218 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4219 MOZ_IMG_ENCODERS_DEFAULT=
4227 MOZ_NO_ACTIVEX_SUPPORT=1
4228 MOZ_NO_INSPECTOR_APIS=1
4229 MOZ_NO_XPCOM_OBSOLETE=1
4232 MOZ_PLAINTEXT_EDITOR_ONLY=1
4234 MOZ_PREF_EXTENSIONS=
4237 MOZ_SINGLE_PROFILE=1
4240 MOZ_UNIVERSALCHARDET=
4242 MOZ_USE_NATIVE_UCONV=1
4244 MOZ_XPFE_COMPONENTS=
4248 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4249 NECKO_SMALL_BUFFERS=1
4250 NS_DISABLE_LOGGING=1
4256 MOZ_EMBEDDING_LEVEL_DEFAULT=
4257 MOZ_EMBEDDING_LEVEL_BASIC=
4258 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4259 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4261 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4264 MOZ_ENABLE_POSTSCRIPT=
4265 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4266 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4267 MOZ_IMG_ENCODERS_DEFAULT=
4275 MOZ_NO_ACTIVEX_SUPPORT=1
4276 MOZ_NO_INSPECTOR_APIS=1
4277 MOZ_NO_XPCOM_OBSOLETE=1
4280 MOZ_PLAINTEXT_EDITOR_ONLY=1
4282 MOZ_PREF_EXTENSIONS=
4285 MOZ_SINGLE_PROFILE=1
4289 MOZ_UNIVERSALCHARDET=
4291 MOZ_USE_NATIVE_UCONV=1
4293 MOZ_XPFE_COMPONENTS=
4299 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4300 NECKO_SMALL_BUFFERS=1
4301 NS_DISABLE_LOGGING=1
4307 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4311 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4312 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4313 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4315 if test -z "$MOZ_BUILD_APP"; then
4316 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4318 # We have a valid application only if it has a build.mk file in its top
4320 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4321 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4325 # Allow the application to influence configure with a confvars.sh script.
4327 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4328 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4329 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4330 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4335 # Now is a good time to test for logic errors, define mismatches, etc.
4336 case "$MOZ_BUILD_APP" in
4338 if test "$LIBXUL_SDK"; then
4339 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4343 # Fix this case for folks who forget. Warn them.
4344 if test -n "$LIBXUL_SDK" -a -z "$MOZ_XUL_APP"; then
4345 AC_MSG_WARN([Setting MOZ_XUL_APP since LIBXUL_SDK was set. Add to confvars.sh!])
4351 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4352 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4354 case "$MOZ_BUILD_APP" in
4356 AC_DEFINE(MOZ_SUITE)
4360 AC_DEFINE(MOZ_PHOENIX)
4368 AC_DEFINE(MOZ_THUNDERBIRD)
4372 AC_DEFINE(MOZ_STANDALONE_COMPOSER)
4376 AC_DEFINE(MOZ_SUNBIRD)
4380 AC_DEFINE(MOZ_XULRUNNER)
4384 AC_DEFINE(MOZ_MACBROWSER)
4392 MOZ_APP_NAME=mozilla
4393 MOZ_APP_DISPLAYNAME=Mozilla
4394 MOZ_APP_VERSION=$MOZILLA_VERSION
4399 AC_SUBST(MOZ_BUILD_APP)
4400 AC_SUBST(MOZ_XUL_APP)
4402 AC_SUBST(MOZ_PHOENIX)
4403 AC_SUBST(MOZ_THUNDERBIRD)
4404 AC_SUBST(MOZ_STANDALONE_COMPOSER)
4405 AC_SUBST(MOZ_SUNBIRD)
4406 AC_SUBST(MOZ_XULRUNNER)
4408 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4410 if test "$MOZ_XUL_APP"; then
4411 MOZ_SINGLE_PROFILE=1
4413 AC_DEFINE(MOZ_XUL_APP)
4416 dnl ========================================================
4418 dnl = Toolkit Options
4420 dnl ========================================================
4421 MOZ_ARG_HEADER(Toolkit Options)
4423 dnl ========================================================
4424 dnl = Select the default toolkit
4425 dnl ========================================================
4426 MOZ_ARG_ENABLE_STRING(default-toolkit,
4427 [ --enable-default-toolkit=TK
4428 Select default toolkit
4429 Platform specific defaults:
4431 Mac OS X - cairo-cocoa
4432 Neutrino/QNX - photon
4434 Win32 - cairo-windows
4437 [ _DEFAULT_TOOLKIT=$enableval ],
4438 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4440 if test "$_DEFAULT_TOOLKIT" = "photon" \
4441 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4442 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4443 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4444 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4445 -o "$_DEFAULT_TOOLKIT" = "cairo-mac" \
4446 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4448 dnl nglayout only supports building with one toolkit,
4449 dnl so ignore everything after the first comma (",").
4450 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4452 if test "$no_x" != "yes"; then
4453 AC_MSG_ERROR([Toolkit must be cairo-gtk2.])
4455 AC_MSG_ERROR([Toolkit must be $_PLATFORM_DEFAULT_TOOLKIT (if supported).])
4459 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4461 dnl ========================================================
4462 dnl = Enable the toolkit as needed =
4463 dnl ========================================================
4465 case "$MOZ_WIDGET_TOOLKIT" in
4468 AC_DEFINE(MOZ_WIDGET_PHOTON)
4472 MOZ_WIDGET_TOOLKIT=windows
4473 MOZ_GFX_TOOLKIT=cairo
4474 MOZ_ENABLE_CAIRO_GFX=1
4478 MOZ_WIDGET_TOOLKIT=gtk2
4479 MOZ_GFX_TOOLKIT=cairo
4480 MOZ_ENABLE_CAIRO_GFX=1
4482 MOZ_ENABLE_XREMOTE=1
4483 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4484 TK_LIBS='$(MOZ_GTK2_LIBS)'
4485 AC_DEFINE(MOZ_WIDGET_GTK2)
4488 MOZ_WIDGET_TOOLKIT=beos
4489 MOZ_GFX_TOOLKIT=cairo
4490 MOZ_ENABLE_CAIRO_GFX=1
4491 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4492 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4496 MOZ_WIDGET_TOOLKIT=os2
4497 MOZ_GFX_TOOLKIT=cairo
4498 MOZ_ENABLE_CAIRO_GFX=1
4499 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4500 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4503 cairo-mac|cairo-cocoa)
4504 if test "$MOZ_WIDGET_TOOLKIT" = "cairo-cocoa"; then
4505 MOZ_WIDGET_TOOLKIT=cocoa
4506 AC_DEFINE(MOZ_WIDGET_COCOA)
4509 MOZ_WIDGET_TOOLKIT=mac
4511 MOZ_ENABLE_CAIRO_GFX=1
4512 MOZ_GFX_TOOLKIT=cairo
4513 MOZ_USER_DIR="Mozilla"
4514 AC_DEFINE(XP_MACOSX)
4515 AC_DEFINE(TARGET_CARBON)
4516 AC_DEFINE(TARGET_API_MAC_CARBON)
4517 TK_LIBS='-framework Carbon'
4518 TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
4519 CFLAGS="$CFLAGS $TK_CFLAGS"
4520 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4524 if test "$MOZ_ENABLE_XREMOTE"; then
4525 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4528 if test "$COMPILE_ENVIRONMENT"; then
4529 if test "$MOZ_ENABLE_GTK2"
4531 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= 1.3.7 gdk-x11-2.0 glib-2.0 gobject-2.0)
4533 fi # COMPILE_ENVIRONMENT
4535 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4537 dnl ========================================================
4538 dnl = startup-notification support module
4539 dnl ========================================================
4541 if test "$MOZ_ENABLE_GTK2"
4543 MOZ_ENABLE_STARTUP_NOTIFICATION=
4545 MOZ_ARG_ENABLE_BOOL(startup-notification,
4546 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4547 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4548 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4549 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4551 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4552 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4553 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4554 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4556 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4558 MOZ_ENABLE_STARTUP_NOTIFICATION=
4562 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4563 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4566 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4568 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4569 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4570 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4572 AC_SUBST(GTK_CONFIG)
4576 AC_SUBST(MOZ_ENABLE_GTK2)
4577 AC_SUBST(MOZ_ENABLE_PHOTON)
4578 AC_SUBST(MOZ_ENABLE_COCOA)
4579 AC_SUBST(MOZ_ENABLE_CAIRO_GFX)
4580 AC_SUBST(MOZ_ENABLE_GLITZ)
4581 AC_SUBST(MOZ_ENABLE_XREMOTE)
4582 AC_SUBST(MOZ_GTK2_CFLAGS)
4583 AC_SUBST(MOZ_GTK2_LIBS)
4587 if test "$MOZ_ENABLE_CAIRO_GFX"
4589 AC_DEFINE(MOZ_THEBES)
4590 AC_DEFINE(MOZ_CAIRO_GFX)
4593 if test "$MOZ_ENABLE_GTK2"
4600 dnl ========================================================
4602 dnl = Components & Features
4604 dnl ========================================================
4605 MOZ_ARG_HEADER(Components and Features)
4607 dnl ========================================================
4609 dnl ========================================================
4610 MOZ_ARG_ENABLE_STRING(ui-locale,
4611 [ --enable-ui-locale=ab-CD
4612 Select the user interface locale (default: en-US)],
4613 MOZ_UI_LOCALE=$enableval )
4614 AC_SUBST(MOZ_UI_LOCALE)
4616 dnl =========================================================
4617 dnl = Calendar client
4618 dnl =========================================================
4619 MOZ_ARG_ENABLE_BOOL(calendar,,
4623 if test "$MOZ_OLD_CALENDAR"; then
4624 AC_MSG_WARN([Building with the calendar extension is no longer supported.])
4625 if test "$MOZ_THUNDERBIRD"; then
4626 AC_MSG_WARN([Since you're trying to build mail, you could try adding])
4627 AC_MSG_WARN(['--enable-extensions=default,lightning' to your mozconfig])
4628 AC_MSG_WARN([and building WITH A FRESH TREE.])
4630 AC_MSG_WARN([For more information, please visit:])
4631 AC_MSG_ERROR([http://www.mozilla.org/projects/calendar/])
4634 AC_SUBST(MOZ_CALENDAR)
4636 dnl =========================================================
4638 dnl =========================================================
4639 MOZ_ARG_DISABLE_BOOL(mailnews,
4640 [ --disable-mailnews Disable building of mail & news components],
4643 AC_SUBST(MOZ_MAIL_NEWS)
4645 dnl ========================================================
4646 dnl static mail build off by default
4647 dnl ========================================================
4648 MOZ_ARG_ENABLE_BOOL(static-mail,
4649 [ --enable-static-mail Enable static mail build support],
4650 MOZ_STATIC_MAIL_BUILD=1,
4651 MOZ_STATIC_MAIL_BUILD= )
4653 if test "$MOZ_STATIC_MAIL_BUILD"; then
4654 AC_DEFINE(MOZ_STATIC_MAIL_BUILD)
4657 AC_SUBST(MOZ_STATIC_MAIL_BUILD)
4659 dnl =========================================================
4661 dnl =========================================================
4662 MOZ_ARG_DISABLE_BOOL(ldap,
4663 [ --disable-ldap Disable LDAP support],
4667 dnl ========================================================
4668 dnl = Trademarked Branding
4669 dnl ========================================================
4670 MOZ_ARG_ENABLE_BOOL(official-branding,
4671 [ --enable-official-branding Enable Official mozilla.org Branding
4672 Do not distribute builds with
4673 --enable-official-branding unless you have
4674 permission to use trademarks per
4675 http://www.mozilla.org/foundation/trademarks/ .],
4676 [case "$MOZ_BUILD_APP" in
4678 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
4679 MOZ_APP_DISPLAYNAME=Firefox
4683 MOZ_BRANDING_DIRECTORY=other-licenses/branding/sunbird
4684 MOZ_APP_DISPLAYNAME=Sunbird
4688 MOZ_BRANDING_DIRECTORY=other-licenses/branding/thunderbird
4692 AC_MSG_ERROR([Official branding is only available for Firefox Sunbird and Thunderbird.])
4696 MOZ_ARG_WITH_STRING(branding,
4697 [ --with-branding=dir Use branding from the specified directory.],
4698 MOZ_BRANDING_DIRECTORY=$withval)
4700 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4701 if test -z "$REAL_BRANDING_DIRECTORY"; then
4702 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4705 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4706 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
4709 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4711 dnl ========================================================
4712 dnl = Distribution ID
4713 dnl ========================================================
4714 MOZ_ARG_WITH_STRING(distribution-id,
4715 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
4716 [ val=`echo $withval`
4717 MOZ_DISTRIBUTION_ID="$val"])
4719 if test -z "$MOZ_DISTRIBUTION_ID"; then
4720 MOZ_DISTRIBUTION_ID="org.mozilla"
4723 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4724 AC_SUBST(MOZ_DISTRIBUTION_ID)
4726 dnl ========================================================
4728 dnl = Enable freetype by default if building against X11
4729 dnl = and freetype is available
4730 dnl ========================================================
4731 MOZ_ARG_DISABLE_BOOL(freetype2,
4732 [ --disable-freetype2 Disable FreeType2 support ],
4733 MOZ_ENABLE_FREETYPE2=,
4734 MOZ_ENABLE_FREETYPE2=1)
4736 if test "$MOZ_ENABLE_FREETYPE2" && test -z "$MOZ_X11" -o -z "$_HAVE_FREETYPE2"; then
4737 AC_MSG_ERROR([Cannot enable FreeType2 support for non-X11 toolkits or if FreeType2 is not detected.])
4740 if test "$MOZ_ENABLE_FREETYPE2"; then
4741 AC_DEFINE(MOZ_ENABLE_FREETYPE2)
4742 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES MOZ_ENABLE_FREETYPE2"
4744 AC_SUBST(MOZ_ENABLE_FREETYPE2)
4746 dnl ========================================================
4748 dnl ========================================================
4749 if test "$MOZ_ENABLE_GTK2"; then
4753 MOZ_ARG_DISABLE_BOOL(xft,
4754 [ --disable-xft Disable Xft support ],
4758 if test "$MOZ_ENABLE_XFT" && test -z "$MOZ_ENABLE_GTK2"; then
4759 AC_MSG_ERROR([Cannot enable XFT support for non-GTK2 toolkits.])
4762 if test "$MOZ_ENABLE_XFT" && test "$MOZ_ENABLE_FREETYPE2"; then
4763 AC_MSG_ERROR([Cannot enable XFT and FREETYPE2 at the same time.])
4766 if test "$MOZ_ENABLE_XFT"
4768 AC_DEFINE(MOZ_ENABLE_XFT)
4769 PKG_CHECK_MODULES(MOZ_XFT, xft)
4770 PKG_CHECK_MODULES(_PANGOCHK, pango >= 1.1.0)
4773 AC_SUBST(MOZ_ENABLE_XFT)
4774 AC_SUBST(MOZ_XFT_CFLAGS)
4775 AC_SUBST(MOZ_XFT_LIBS)
4777 dnl ========================================================
4778 dnl = pango font rendering
4779 dnl ========================================================
4780 MOZ_ARG_ENABLE_BOOL(pango,
4781 [ --enable-pango Enable Pango font rendering support],
4785 if test "$MOZ_ENABLE_PANGO" && test -z "$MOZ_ENABLE_CAIRO_GFX"
4787 AC_DEFINE(MOZ_ENABLE_PANGO)
4788 PKG_CHECK_MODULES(MOZ_PANGO, pangoxft >= 1.6.0)
4790 AC_SUBST(MOZ_ENABLE_PANGO)
4791 AC_SUBST(MOZ_PANGO_CFLAGS)
4792 AC_SUBST(MOZ_PANGO_LIBS)
4795 if test "$MOZ_ENABLE_GTK2" && test "$MOZ_ENABLE_CAIRO_GFX"
4797 # For gtk2, we require --enable-pango; gtk2 already implies --enable-xft
4798 if test -z "$MOZ_ENABLE_PANGO"
4800 AC_MSG_WARN([Pango is required for cairo gfx builds, assuming --enable-pango])
4805 if test "$MOZ_ENABLE_PANGO" && test "$MOZ_ENABLE_CAIRO_GFX"
4807 AC_DEFINE(MOZ_ENABLE_PANGO)
4808 dnl PKG_CHECK_MODULES(MOZ_PANGO, pango >= 1.10.0 pangocairo >= 1.10.0)
4809 if test "$MOZ_X11"; then
4810 PKG_CHECK_MODULES(MOZ_PANGO, pango >= 1.6.0 pangoft2 >= 1.6.0 pangoxft >= 1.6.0)
4812 PKG_CHECK_MODULES(MOZ_PANGO, pango >= 1.6.0 pangoft2 >= 1.6.0)
4815 AC_SUBST(MOZ_ENABLE_PANGO)
4816 AC_SUBST(MOZ_PANGO_CFLAGS)
4817 AC_SUBST(MOZ_PANGO_LIBS)
4820 dnl ========================================================
4821 dnl = x11 core font support (default and ability to enable depend on toolkit)
4822 dnl ========================================================
4825 MOZ_ENABLE_COREXFONTS=${MOZ_ENABLE_COREXFONTS-1}
4827 MOZ_ENABLE_COREXFONTS=
4829 if test "$MOZ_ENABLE_COREXFONTS"
4831 AC_DEFINE(MOZ_ENABLE_COREXFONTS)
4834 AC_SUBST(MOZ_ENABLE_COREXFONTS)
4836 dnl ========================================================
4837 dnl = PostScript print module
4838 dnl ========================================================
4839 MOZ_ARG_DISABLE_BOOL(postscript,
4840 [ --disable-postscript Disable PostScript printing support ],
4841 MOZ_ENABLE_POSTSCRIPT=,
4842 MOZ_ENABLE_POSTSCRIPT=1 )
4844 dnl ========================================================
4845 dnl = GnomeVFS support module
4846 dnl ========================================================
4850 dnl build the gnomevfs extension by default only when the
4851 dnl GTK2 toolkit is in use.
4852 if test "$MOZ_ENABLE_GTK2"
4854 MOZ_ENABLE_GNOMEVFS=1
4856 MOZ_ENABLE_LIBGNOME=1
4859 MOZ_ARG_DISABLE_BOOL(gnomevfs,
4860 [ --disable-gnomevfs Disable GnomeVFS support ],
4861 MOZ_ENABLE_GNOMEVFS=,
4862 MOZ_ENABLE_GNOMEVFS=force)
4864 if test "$MOZ_ENABLE_GNOMEVFS"
4866 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4867 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4868 MOZ_ENABLE_GNOMEVFS=1
4870 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
4872 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
4874 MOZ_ENABLE_GNOMEVFS=
4878 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
4879 AC_SUBST(MOZ_GNOMEVFS_LIBS)
4881 if test "$MOZ_ENABLE_GCONF"
4883 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
4884 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
4891 AC_SUBST(MOZ_GCONF_CFLAGS)
4892 AC_SUBST(MOZ_GCONF_LIBS)
4894 if test "$MOZ_ENABLE_LIBGNOME"
4896 PKG_CHECK_MODULES(MOZ_LIBGNOME, libgnome-2.0 >= $LIBGNOME_VERSION,[
4897 MOZ_LIBGNOME_LIBS=`echo $MOZ_LIBGNOME_LIBS | sed 's/-llinc\>//'`
4898 MOZ_ENABLE_LIBGNOME=1
4900 MOZ_ENABLE_LIBGNOME=
4904 AC_SUBST(MOZ_LIBGNOME_CFLAGS)
4905 AC_SUBST(MOZ_LIBGNOME_LIBS)
4907 # The GNOME component is built if gtk2, gconf, gnome-vfs, and libgnome
4908 # are all available.
4910 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
4911 "$MOZ_ENABLE_GNOMEVFS" -a "$MOZ_ENABLE_LIBGNOME"; then
4912 MOZ_ENABLE_GNOME_COMPONENT=1
4914 MOZ_ENABLE_GNOME_COMPONENT=
4917 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
4920 dnl ========================================================
4921 dnl = libgnomeui support module
4922 dnl ========================================================
4924 if test "$MOZ_ENABLE_GTK2"
4926 MOZ_ENABLE_GNOMEUI=1
4928 MOZ_ARG_DISABLE_BOOL(gnomeui,
4929 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
4930 MOZ_ENABLE_GNOMEUI=,
4931 MOZ_ENABLE_GNOMEUI=force)
4933 if test "$MOZ_ENABLE_GNOMEUI"
4935 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
4937 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
4938 MOZ_ENABLE_GNOMEUI=1
4940 if test "$MOZ_ENABLE_GNOMEUI" = "force"
4942 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
4948 if test "$MOZ_ENABLE_GNOMEUI"; then
4949 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
4952 AC_SUBST(MOZ_ENABLE_GNOMEUI)
4953 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
4954 AC_SUBST(MOZ_GNOMEUI_LIBS)
4956 dnl ========================================================
4958 dnl ========================================================
4960 if test "$MOZ_ENABLE_GTK2"
4962 MOZ_ARG_ENABLE_BOOL(dbus,
4963 [ --enable-dbus Enable dbus support (default: disabled) ],
4964 MOZ_ENABLE_DBUS=force,
4967 if test "$MOZ_ENABLE_DBUS"
4969 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION,
4973 if test "$MOZ_ENABLE_DBUS" = "force"
4975 AC_MSG_ERROR([* * * Could not find dbus-glib-1 >= $DBUS_VERSION])
4981 if test "$MOZ_ENABLE_DBUS"; then
4982 AC_DEFINE(MOZ_ENABLE_DBUS)
4985 AC_SUBST(MOZ_ENABLE_DBUS)
4986 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
4987 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
4989 dnl ========================================================
4990 dnl = Setting MOZ_EXTRA_X11CONVERTERS turns on additional
4991 dnl = converters in intl/uconv that are used only by X11 gfx
4992 dnl = implementations. By default, it's undefined so that
4993 dnl = those converters are not built on other platforms/toolkits.
4994 dnl = (see bug 180851)
4995 dnl ========================================================
4997 if test "$MOZ_ENABLE_GTK2" \
4998 && test "$MOZ_ENABLE_COREXFONTS"
5000 AC_DEFINE(MOZ_EXTRA_X11CONVERTERS)
5001 MOZ_EXTRA_X11CONVERTERS=1
5003 AC_SUBST(MOZ_EXTRA_X11CONVERTERS)
5005 dnl ========================================================
5006 dnl = Build Personal Security Manager
5007 dnl ========================================================
5008 MOZ_ARG_DISABLE_BOOL(crypto,
5009 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5013 dnl ========================================================
5014 dnl = JS Debugger XPCOM component (js/jsd)
5015 dnl ========================================================
5016 MOZ_ARG_DISABLE_BOOL(jsd,
5017 [ --disable-jsd Disable JavaScript debug library],
5022 dnl ========================================================
5023 dnl = Disable plugin support
5024 dnl ========================================================
5025 MOZ_ARG_DISABLE_BOOL(plugins,
5026 [ --disable-plugins Disable plugins support],
5030 dnl ========================================================
5031 dnl = Open JVM Interface (OJI) support
5032 dnl ========================================================
5033 MOZ_ARG_DISABLE_BOOL(oji,
5034 [ --disable-oji Disable Open JVM Integration support],
5037 if test -n "$MOZ_OJI"; then
5041 dnl bi-directional support always on
5045 dnl ========================================================
5046 dnl complex text support off by default
5047 dnl ========================================================
5048 MOZ_ARG_ENABLE_BOOL(ctl,
5049 [ --enable-ctl Enable Thai Complex Script support],
5053 dnl ========================================================
5054 dnl view source support on by default
5055 dnl ========================================================
5056 MOZ_ARG_DISABLE_BOOL(view-source,
5057 [ --disable-view-source Disable view source support],
5060 if test "$MOZ_VIEW_SOURCE"; then
5061 AC_DEFINE(MOZ_VIEW_SOURCE)
5065 dnl ========================================================
5066 dnl accessibility support on by default on all platforms
5068 dnl ========================================================
5069 MOZ_ARG_DISABLE_BOOL(accessibility,
5070 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5073 if test "$ACCESSIBILITY"; then
5074 AC_DEFINE(ACCESSIBILITY)
5077 dnl ========================================================
5078 dnl xpfe/components on by default
5079 dnl ========================================================
5080 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5081 [ --disable-xpfe-components
5082 Disable xpfe components],
5083 MOZ_XPFE_COMPONENTS=,
5084 MOZ_XPFE_COMPONENTS=1 )
5086 dnl ========================================================
5087 dnl xpinstall support on by default
5088 dnl ========================================================
5089 MOZ_ARG_DISABLE_BOOL(xpinstall,
5090 [ --disable-xpinstall Disable xpinstall support],
5093 if test "$MOZ_XPINSTALL"; then
5094 AC_DEFINE(MOZ_XPINSTALL)
5097 dnl ========================================================
5098 dnl Single profile support off by default
5099 dnl ========================================================
5100 MOZ_ARG_ENABLE_BOOL(single-profile,
5101 [ --enable-single-profile Enable single profile support ],
5102 MOZ_SINGLE_PROFILE=1,
5103 MOZ_SINGLE_PROFILE= )
5105 dnl ========================================================
5106 dnl xpcom js loader support on by default
5107 dnl ========================================================
5108 MOZ_ARG_DISABLE_BOOL(jsloader,
5109 [ --disable-jsloader Disable xpcom js loader support],
5112 if test "$MOZ_JSLOADER"; then
5113 AC_DEFINE(MOZ_JSLOADER)
5116 dnl ========================================================
5117 dnl Disable printing
5118 dnl ========================================================
5119 MOZ_ARG_DISABLE_BOOL(printing,
5120 [ --disable-printing Disable printing support],
5124 if test "$NS_PRINTING"; then
5125 AC_DEFINE(NS_PRINTING)
5126 AC_DEFINE(NS_PRINT_PREVIEW)
5129 dnl ========================================================
5130 dnl use native unicode converters
5131 dnl ========================================================
5132 MOZ_ARG_ENABLE_BOOL(native-uconv,
5133 [ --enable-native-uconv Enable iconv support],
5134 MOZ_USE_NATIVE_UCONV=1,
5135 MOZ_USE_NATIVE_UCONV= )
5136 if test "$MOZ_USE_NATIVE_UCONV"; then
5137 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5139 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5140 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5144 dnl ========================================================
5145 dnl Libeditor can be build as plaintext-only,
5146 dnl or as a full html and text editing component.
5147 dnl We build both by default.
5148 dnl ========================================================
5149 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5150 [ --enable-plaintext-editor-only
5151 Allow only plaintext editing],
5152 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5153 MOZ_PLAINTEXT_EDITOR_ONLY= )
5154 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5155 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5157 dnl ========================================================
5158 dnl Composer is on by default.
5159 dnl ========================================================
5160 MOZ_ARG_DISABLE_BOOL(composer,
5161 [ --disable-composer Disable building of Composer],
5164 AC_SUBST(MOZ_COMPOSER)
5167 dnl ========================================================
5168 dnl = Drop XPCOM Obsolete library
5169 dnl ========================================================
5170 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5171 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5172 MOZ_NO_XPCOM_OBSOLETE=1,
5173 MOZ_NO_XPCOM_OBSOLETE=)
5175 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5176 if test -z "$MOZ_SINGLE_PROFILE"; then
5177 AC_MSG_ERROR([Building without xpcom-obsolete isn't support when building full profile support.])
5179 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5182 dnl ========================================================
5183 dnl = Disable Fast Load
5184 dnl ========================================================
5185 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5186 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5190 AC_SUBST(MOZ_NO_FAST_LOAD)
5192 if test -n "$MOZ_NO_FAST_LOAD"; then
5193 AC_DEFINE(MOZ_NO_FAST_LOAD)
5196 dnl ========================================================
5197 dnl Permissions System
5198 dnl ========================================================
5199 MOZ_ARG_DISABLE_BOOL(permissions,
5200 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5205 dnl ========================================================
5207 dnl ========================================================
5208 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5209 [ --disable-negotiateauth Disable GSS-API negotiation ],
5210 MOZ_AUTH_EXTENSION=,
5211 MOZ_AUTH_EXTENSION=1 )
5213 dnl ========================================================
5215 dnl ========================================================
5216 MOZ_ARG_DISABLE_BOOL(xtf,
5217 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5220 if test "$MOZ_XTF"; then
5224 dnl ========================================================
5226 dnl ========================================================
5227 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5228 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5229 MOZ_NO_INSPECTOR_APIS=1,
5230 MOZ_NO_INSPECTOR_APIS= )
5232 dnl ========================================================
5234 dnl ========================================================
5235 MOZ_ARG_DISABLE_BOOL(xmlextras,
5236 [ --disable-xmlextras Disable XMLExtras such as XPointer support ],
5240 dnl ========================================================
5242 dnl ========================================================
5243 MOZ_ARG_ENABLE_BOOL(webservices,
5244 [ --enable-webservices Enable Webservices/SOAP support ],
5248 dnl ========================================================
5249 dnl Pref extensions (autoconfig and system-pref)
5250 dnl ========================================================
5251 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5252 [ --disable-pref-extensions
5253 Disable pref extensions such as autoconfig and
5255 MOZ_PREF_EXTENSIONS=,
5256 MOZ_PREF_EXTENSIONS=1 )
5258 dnl ========================================================
5259 dnl = Universalchardet
5260 dnl ========================================================
5261 MOZ_ARG_DISABLE_BOOL(universalchardet,
5262 [ --disable-universalchardet
5263 Disable universal encoding detection],
5264 MOZ_UNIVERSALCHARDET=,
5265 MOZ_UNIVERSALCHARDET=1 )
5267 dnl ========================================================
5269 dnl ========================================================
5270 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5271 [ --enable-javaxpcom
5272 Enable Java-XPCOM bridge],
5276 if test -n "${MOZ_JAVAXPCOM}"; then
5279 if test -n "$JAVA_HOME"; then
5280 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5284 if test -n "$JAVA_HOME"; then
5285 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5290 if test -n "${JAVA_INCLUDE_PATH}"; then
5291 dnl Make sure jni.h exists in the given include path.
5292 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5293 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5296 case "$target_os" in
5298 dnl Default to java system location
5299 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5303 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5306 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5307 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.])
5311 if test -n "${JAVA_BIN_PATH}"; then
5312 dnl Look for javac and jar in the specified path.
5313 JAVA_PATH="$JAVA_BIN_PATH"
5315 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5316 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5319 AC_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5320 AC_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5321 AC_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5322 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5323 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.])
5327 dnl ========================================================
5328 dnl = Airbag crash reporting (on by default on supported platforms)
5329 dnl ========================================================
5331 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5332 || test "$OS_ARCH" = "Darwin" \
5333 || test "$OS_ARCH" = "Linux") \
5334 && test -z "$HAVE_64BIT_OS"; then
5338 MOZ_ARG_DISABLE_BOOL(airbag,
5339 [ --disable-airbag Disable airbag crash reporting],
5343 if test -n "$MOZ_AIRBAG"; then
5344 AC_DEFINE(MOZ_AIRBAG)
5346 if test "$OS_ARCH" = "Linux" && \
5347 test -z "$SKIP_LIBRARY_CHECKS"; then
5348 _SAVE_LDFLAGS=$LDFLAGS
5349 LDFLAGS="$LDFLAGS -lcurl"
5350 AC_CACHE_CHECK(for libcurl,
5352 [AC_TRY_LINK([#include <curl/curl.h>],
5353 [curl_easy_init();],
5354 ac_cv_have_libcurl="yes",
5355 ac_cv_have_libcurl="no")])
5356 if test "$ac_cv_have_libcurl" = "no"; then
5357 AC_MSG_ERROR([Couldn't find libcurl, which is required for the crash reporter. Use --disable-airbag to disable the crash reporter.])
5359 LDFLAGS=$_SAVE_LDFLAGS
5363 dnl ========================================================
5364 dnl = Build mochitest JS/DOM tests (on by default)
5365 dnl ========================================================
5366 MOZ_ARG_DISABLE_BOOL(mochitest,
5367 [ --disable-mochitest Disable mochitest harness],
5371 dnl ========================================================
5372 dnl = Enable compilation of specific extension modules
5373 dnl ========================================================
5375 MOZ_ARG_ENABLE_STRING(extensions,
5376 [ --enable-extensions Enable extensions],
5377 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5378 if test "$option" = "yes" || test "$option" = "all"; then
5379 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_ALL"
5380 elif test "$option" = "no" || test "$option" = "none"; then
5382 elif test "$option" = "default"; then
5383 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5384 elif test `echo "$option" | grep -c \^-` != 0; then
5385 option=`echo $option | sed 's/^-//'`
5386 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5388 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5391 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5393 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5394 # Suppress warning on non-X11 platforms
5395 if test -n "$MOZ_X11"; then
5396 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5398 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5401 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5402 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5403 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5406 if test "$MOZ_XUL_APP" && test `echo "$MOZ_EXTENSIONS" | grep -c help` -ne 0; then
5407 AC_MSG_WARN([Cannot build old help extension with MOZ_XUL_APP set. Removing help from MOZ_EXTENSIONS.])
5408 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|help||'`
5411 dnl This might be temporary: build tridentprofile only on Windows
5412 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5413 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5414 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5417 dnl cookie must be built before tridentprofile. put it at list's end.
5418 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5419 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5420 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5423 dnl schema-validation requires webservices
5424 if test -z "$MOZ_WEBSERVICES" && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -ne 0; then
5425 AC_MSG_WARN([Cannot build schema-validation without webservices. Removing schema-validation from MOZ_EXTENSIONS.])
5426 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|schema-validation||g'`
5429 dnl xforms requires xtf and webservices and schema-validation
5430 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5431 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5432 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5434 if test -z "$MOZ_WEBSERVICES" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5435 AC_MSG_WARN([Cannot build XForms without webservices. Removing XForms from MOZ_EXTENSIONS.])
5436 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5439 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5440 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5441 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5444 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5445 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5446 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5449 if test `echo "$MOZ_EXTENSIONS" | grep -c xmlextras` -ne 0; then
5450 AC_MSG_WARN([xmlextras is no longer an extension, use --disable-xmlextras to disable.])
5451 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xmlextras||g'`
5454 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5455 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5456 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5459 if test `echo "$MOZ_EXTENSIONS" | grep -c webservices` -ne 0; then
5460 AC_MSG_WARN([webservices is no longer an extension, use --disable-webservices to disable.])
5461 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|webservices||g'`
5464 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5465 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5466 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5469 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5470 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5471 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5474 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5475 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5476 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5479 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5480 AC_MSG_WARN([spellcheck is no longer an extension.])
5481 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5484 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5485 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5486 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5490 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5492 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5493 dnl when trying to build a non-existent extension.
5494 for extension in $MOZ_EXTENSIONS; do
5495 if test ! -d "${srcdir}/extensions/${extension}"; then
5496 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5501 dnl ========================================================
5503 dnl ========================================================
5504 case "$MOZ_WIDGET_TOOLKIT" in
5505 beos|windows|os2|mac|cocoa)
5508 if test -z "$MOZ_ENABLE_GNOMEUI"; then
5509 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5514 MOZ_ARG_ENABLE_STRING(image-decoders,
5515 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5516 Enable specific image decoders],
5517 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5518 if test "$option" = "yes" || test "$option" = "all"; then
5519 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5520 elif test "$option" = "no" || test "$option" = "none"; then
5522 elif test "$option" = "default"; then
5523 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5524 elif test `echo "$option" | grep -c \^-` != 0; then
5525 option=`echo $option | sed 's/^-//'`
5526 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5528 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5531 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5533 if test `echo "$MOZ_IMG_DECODERS" | grep -c png` -ne 0; then
5534 MOZ_PNG_CFLAGS="$MOZ_PNG_CFLAGS -DMOZ_PNG_READ"
5535 AC_MSG_CHECKING([if pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
5536 AC_TRY_COMPILE([#define MOZ_PNG_READ 1
5537 #include "$_topsrcdir/modules/libimg/png/pnggccrd.c"],,
5540 AC_MSG_RESULT([$_results])
5541 if test "$_results" = "no"; then
5542 MOZ_PNG_CFLAGS="$MOZ_PNG_CFLAGS -DPNG_NO_MMX_CODE"
5546 dnl Dupes are removed in the encoder section because it will also add decoders
5548 dnl ========================================================
5550 dnl ========================================================
5551 MOZ_ARG_ENABLE_STRING(image-encoders,
5552 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5553 Enable specific image encoders],
5554 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5555 if test "$option" = "yes" || test "$option" = "all"; then
5556 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5557 elif test "$option" = "no" || test "$option" = "none"; then
5560 elif test "$option" = "default"; then
5561 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5562 elif test `echo "$option" | grep -c \^-` != 0; then
5563 option=`echo $option | sed 's/^-//'`
5564 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5566 addencoder="$option"
5568 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5570 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5572 if test `echo "$MOZ_IMG_ENCODERS" | grep -c png` -ne 0; then
5573 MOZ_PNG_CFLAGS="$MOZ_PNG_CFLAGS -DMOZ_PNG_WRITE"
5577 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5578 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5580 dnl ========================================================
5581 dnl experimental ldap features
5582 dnl ========================================================
5583 MOZ_ARG_ENABLE_BOOL(ldap-experimental,
5584 [ --enable-ldap-experimental
5585 Enable LDAP experimental features],
5586 MOZ_LDAP_XPCOM_EXPERIMENTAL=1,
5587 MOZ_LDAP_XPCOM_EXPERIMENTAL=)
5589 dnl ========================================================
5590 dnl MathML on by default
5591 dnl ========================================================
5592 MOZ_ARG_DISABLE_BOOL(mathml,
5593 [ --disable-mathml Disable MathML support],
5596 if test "$MOZ_MATHML"; then
5597 AC_DEFINE(MOZ_MATHML)
5600 dnl ========================================================
5602 dnl ========================================================
5603 MOZ_ARG_DISABLE_BOOL(canvas,
5604 [ --disable-canvas Disable html:canvas feature],
5606 MOZ_ENABLE_CANVAS=1 )
5607 if test -n "$MOZ_ENABLE_CANVAS"; then
5608 AC_DEFINE(MOZ_ENABLE_CANVAS)
5610 AC_SUBST(MOZ_ENABLE_CANVAS)
5612 dnl ========================================================
5614 dnl ========================================================
5615 MOZ_ARG_DISABLE_BOOL(svg,
5616 [ --disable-svg Disable SVG support],
5619 if test -n "$MOZ_SVG"; then
5620 if test -z "$MOZ_ENABLE_CAIRO_GFX"; then
5621 AC_MSG_ERROR([SVG requires cairo gfx])
5627 MOZ_SVG_FOREIGNOBJECT=$MOZ_ENABLE_CAIRO_GFX
5628 dnl ========================================================
5629 dnl SVG <foreignObject>
5630 dnl ========================================================
5631 MOZ_ARG_DISABLE_BOOL(svg-foreignobject,
5632 [ --disable-svg-foreignobject
5633 Disable SVG <foreignObject> support],
5634 MOZ_SVG_FOREIGNOBJECT=,
5635 MOZ_SVG_FOREIGNOBJECT=1 )
5636 if test "$MOZ_SVG_FOREIGNOBJECT"; then
5637 if test -z "$MOZ_ENABLE_CAIRO_GFX"; then
5638 AC_MSG_ERROR([<foreignobject> requires cairo gfx])
5640 if test "$MOZ_SVG"; then
5641 AC_DEFINE(MOZ_SVG_FOREIGNOBJECT)
5643 MOZ_SVG_FOREIGNOBEJCT=
5648 dnl ========================================================
5650 dnl ========================================================
5651 case "$target_os" in
5652 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5657 MOZ_ARG_DISABLE_BOOL(installer,
5658 [ --disable-installer Disable building of installer],
5661 if test -n "$MOZ_INSTALLER" -a -n "$MOZ_XUL_APP" -a "$OS_ARCH" = "WINNT"; then
5662 # Disable installer for Windows builds that use the new toolkit if NSIS
5663 # isn't in the path.
5664 AC_PATH_PROGS(MAKENSIS, makensis)
5665 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5666 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5668 # The Windows build for NSIS requires the iconv command line utility to
5669 # convert the charset of the locale files.
5670 AC_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5671 if test -z "$HOST_ICONV"; then
5672 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5676 # Automatically disable installer if xpinstall isn't built
5677 if test -z "$MOZ_XPINSTALL"; then
5680 AC_SUBST(MOZ_INSTALLER)
5682 AC_MSG_CHECKING([for tar archiver])
5683 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
5684 if test -z "$TAR"; then
5685 AC_MSG_ERROR([no tar archiver found in \$PATH])
5687 AC_MSG_RESULT([$TAR])
5690 dnl ========================================================
5692 dnl ========================================================
5694 MOZ_ARG_DISABLE_BOOL(updater,
5695 [ --disable-updater Disable building of updater],
5698 # The Windows build requires the iconv command line utility
5699 # in order to build the updater.
5700 case "$target_os" in
5701 msvc*|mks*|cygwin*|mingw*|wince*)
5702 if test -n "$MOZ_UPDATER"; then
5703 AC_MSG_CHECKING([for iconv])
5704 AC_CHECK_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5705 if test -z "$HOST_ICONV"; then
5706 AC_MSG_ERROR([iconv not found in \$PATH])
5711 AC_SUBST(MOZ_UPDATER)
5713 # app update channel is 'default' when not supplied.
5714 MOZ_ARG_ENABLE_STRING([update-channel],
5715 [ --enable-update-channel=CHANNEL
5716 Select application update channel (default=default)],
5717 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
5719 if test -z "$MOZ_UPDATE_CHANNEL"; then
5720 MOZ_UPDATE_CHANNEL=default
5722 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5724 # tools/update-packaging is not checked out by default.
5725 MOZ_ARG_ENABLE_BOOL(update-packaging,
5726 [ --enable-update-packaging
5727 Enable tools/update-packaging],
5728 MOZ_UPDATE_PACKAGING=1,
5729 MOZ_UPDATE_PACKAGING= )
5730 AC_SUBST(MOZ_UPDATE_PACKAGING)
5732 dnl ========================================================
5734 dnl ========================================================
5736 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
5737 [ --disable-xpconnect-idispatch
5738 Disable building of xpconnect support for IDispatch
5740 XPC_IDISPATCH_SUPPORT=,
5741 XPC_IDISPATCH_SUPPORT=1)
5742 AC_SUBST(XPC_IDISPATCH_SUPPORT)
5744 MOZ_ARG_DISABLE_BOOL(activex,
5745 [ --disable-activex Disable building of ActiveX control (win32 only)],
5746 MOZ_NO_ACTIVEX_SUPPORT=1,
5747 MOZ_NO_ACTIVEX_SUPPORT= )
5748 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
5750 MOZ_ARG_DISABLE_BOOL(activex-scripting,
5751 [ --disable-activex-scripting
5752 Disable building of ActiveX scripting support (win32)],
5753 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
5754 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
5755 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
5757 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
5759 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
5762 dnl ========================================================
5764 dnl ========================================================
5765 MOZ_ARG_ENABLE_BOOL(leaky,
5766 [ --enable-leaky Build leaky memory tool],
5771 dnl ========================================================
5773 dnl ========================================================
5774 MOZ_ARG_ENABLE_BOOL(xpctools,
5775 [ --enable-xpctools Build JS profiling tool],
5780 dnl ========================================================
5781 dnl build the tests by default
5782 dnl ========================================================
5783 MOZ_ARG_DISABLE_BOOL(tests,
5784 [ --disable-tests Do not build test libraries & programs],
5788 dnl ========================================================
5790 dnl = Module specific options
5792 dnl ========================================================
5793 MOZ_ARG_HEADER(Individual module options)
5795 dnl ========================================================
5796 dnl = Enable Lea malloc in xpcom. OFF by default.
5797 dnl ========================================================
5798 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
5799 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
5802 if test -n "$XPCOM_USE_LEA"; then
5803 AC_DEFINE(XPCOM_USE_LEA)
5806 dnl ========================================================
5807 dnl = Enable places (new history/bookmarks)
5808 dnl ========================================================
5809 MOZ_ARG_ENABLE_BOOL(places,
5810 [ --enable-places Enable 'places' bookmark/history implementation],
5813 if test -n "$MOZ_PLACES"; then
5814 AC_DEFINE(MOZ_PLACES)
5818 if test "$MOZ_BUILD_APP" = "browser"; then
5819 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
5823 dnl ========================================================
5824 dnl = Disable feed handling components
5825 dnl ========================================================
5826 MOZ_ARG_DISABLE_BOOL(feeds,
5827 [ --disable-feeds Disable feed handling and processing components],
5830 if test -n "$MOZ_FEEDS"; then
5831 AC_DEFINE(MOZ_FEEDS)
5833 if test "$MOZ_BUILD_APP" = "browser"; then
5834 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
5838 dnl ========================================================
5839 dnl = Enable mozStorage
5840 dnl = XXX need to implement --with-system-sqlite3 (see bug 263381)
5841 dnl ========================================================
5842 dnl Implicitly enabled by default if building calendar or places
5843 MOZ_ARG_ENABLE_BOOL(storage,
5844 [ --enable-storage Enable mozStorage module and related components],
5847 if test -n "$MOZ_STORAGE"; then
5848 AC_DEFINE(MOZ_STORAGE)
5851 dnl ========================================================
5852 dnl = Enable safe browsing (anti-phishing)
5853 dnl ========================================================
5854 MOZ_ARG_ENABLE_BOOL(safe-browsing,
5855 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
5856 MOZ_SAFE_BROWSING=1,
5857 MOZ_SAFE_BROWSING= )
5858 if test -n "$MOZ_SAFE_BROWSING"; then
5859 AC_DEFINE(MOZ_SAFE_BROWSING)
5861 AC_SUBST(MOZ_SAFE_BROWSING)
5863 dnl ========================================================
5864 dnl = Enable url-classifier
5865 dnl ========================================================
5866 dnl Implicitly enabled by default if building with safe-browsing
5867 if test -n "$MOZ_SAFE_BROWSING"; then
5868 MOZ_URL_CLASSIFIER=1
5870 MOZ_ARG_ENABLE_BOOL(url-classifier,
5871 [ --enable-url-classifier Enable url classifier module],
5872 MOZ_URL_CLASSIFIER=1,
5873 MOZ_URL_CLASSIFIER= )
5874 if test -n "$MOZ_URL_CLASSIFIER"; then
5875 AC_DEFINE(MOZ_URL_CLASSIFIER)
5877 AC_SUBST(MOZ_URL_CLASSIFIER)
5879 dnl ========================================================
5880 dnl = Enable Ultrasparc specific optimizations for JS
5881 dnl ========================================================
5882 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
5883 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
5884 JS_ULTRASPARC_OPTS=1,
5885 JS_ULTRASPARC_OPTS= )
5887 dnl only enable option for ultrasparcs
5888 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
5889 "$OS_TEST" != "sun4u"; then
5892 AC_SUBST(JS_ULTRASPARC_OPTS)
5894 dnl ========================================================
5896 dnl = Feature options that require extra sources to be pulled
5898 dnl ========================================================
5899 dnl MOZ_ARG_HEADER(Features that require extra sources)
5901 dnl ========================================================
5903 dnl = Debugging Options
5905 dnl ========================================================
5906 MOZ_ARG_HEADER(Debugging and Optimizations)
5908 dnl ========================================================
5909 dnl = Disable building with debug info.
5910 dnl = Debugging is OFF by default
5911 dnl ========================================================
5912 if test -z "$MOZ_DEBUG_FLAGS"
5916 if test "$GNU_CC"; then
5917 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
5918 case "$GCC_VERSION" in
5923 MOZ_DEBUG_FLAGS="-g"
5927 MOZ_DEBUG_FLAGS="-g"
5931 MOZ_DEBUG_FLAGS="-g"
5936 MOZ_ARG_ENABLE_STRING(debug,
5937 [ --enable-debug[=DBG] Enable building with developer debug info
5938 (Using compiler flags DBG)],
5939 [ if test "$enableval" != "no"; then
5941 if test -n "$enableval" && test "$enableval" != "yes"; then
5942 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
5949 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
5950 case "${target_os}" in
5952 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
5954 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5955 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
5958 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
5961 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
5963 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
5965 if test -n "$MOZ_DEBUG"; then
5966 AC_MSG_CHECKING([for valid debug flags])
5967 _SAVE_CFLAGS=$CFLAGS
5968 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
5969 AC_TRY_COMPILE([#include <stdio.h>],
5970 [printf("Hello World\n");],
5973 AC_MSG_RESULT([$_results])
5974 if test "$_results" = "no"; then
5975 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
5977 CFLAGS=$_SAVE_CFLAGS
5980 dnl ========================================================
5981 dnl = Enable code optimization. ON by default.
5982 dnl ========================================================
5983 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
5984 MOZ_OPTIMIZE_FLAGS="-O"
5987 MOZ_ARG_ENABLE_STRING(optimize,
5988 [ --disable-optimize Disable compiler optimization
5989 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
5990 [ if test "$enableval" != "no"; then
5992 if test -n "$enableval" && test "$enableval" != "yes"; then
5993 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
5998 fi ], MOZ_OPTIMIZE=1)
6000 if test "$COMPILE_ENVIRONMENT"; then
6001 if test -n "$MOZ_OPTIMIZE"; then
6002 AC_MSG_CHECKING([for valid optimization flags])
6003 _SAVE_CFLAGS=$CFLAGS
6004 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6005 AC_TRY_COMPILE([#include <stdio.h>],
6006 [printf("Hello World\n");],
6009 AC_MSG_RESULT([$_results])
6010 if test "$_results" = "no"; then
6011 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6013 CFLAGS=$_SAVE_CFLAGS
6015 fi # COMPILE_ENVIRONMENT
6017 AC_SUBST(MOZ_OPTIMIZE)
6018 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6019 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6021 dnl ========================================================
6022 dnl = Enable/disable debug for specific modules only
6023 dnl = module names beginning with ^ will be disabled
6024 dnl ========================================================
6025 MOZ_ARG_ENABLE_STRING(debug-modules,
6026 [ --enable-debug-modules Enable/disable debug info for specific modules],
6027 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6029 dnl ========================================================
6030 dnl = Enable/disable generation of debugger info for specific modules only
6031 dnl = the special module name ALL_MODULES can be used to denote all modules
6032 dnl = module names beginning with ^ will be disabled
6033 dnl ========================================================
6034 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6035 [ --enable-debugger-info-modules
6036 Enable/disable debugger info for specific modules],
6037 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6038 dnl note that the list of module names is reversed as it is copied
6039 dnl this is important, as it will allow config.mk to interpret stuff like
6040 dnl "^ALL_MODULES xpcom" properly
6041 if test "$i" = "no"; then
6044 if test "$i" = "yes"; then
6047 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6050 dnl ========================================================
6051 dnl Enable garbage collector
6052 dnl ========================================================
6053 MOZ_ARG_ENABLE_BOOL(boehm,
6054 [ --enable-boehm Enable the Boehm Garbage Collector],
6057 if test -n "$GC_LEAK_DETECTOR"; then
6058 AC_DEFINE(GC_LEAK_DETECTOR)
6061 dnl ========================================================
6062 dnl Disable runtime logging checks
6063 dnl ========================================================
6064 MOZ_ARG_DISABLE_BOOL(logging,
6065 [ --disable-logging Disable logging facilities],
6066 NS_DISABLE_LOGGING=1,
6067 NS_DISABLE_LOGGING= )
6068 if test "$NS_DISABLE_LOGGING"; then
6069 AC_DEFINE(NS_DISABLE_LOGGING)
6071 AC_DEFINE(MOZ_LOGGING)
6074 dnl ========================================================
6075 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6076 dnl ========================================================
6077 _ENABLE_LOGREFCNT=42
6078 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6079 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6080 _ENABLE_LOGREFCNT=1,
6081 _ENABLE_LOGREFCNT= )
6082 if test "$_ENABLE_LOGREFCNT" = "1"; then
6083 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6084 elif test -z "$_ENABLE_LOGREFCNT"; then
6085 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6088 dnl ========================================================
6089 dnl = Use malloc wrapper lib
6090 dnl ========================================================
6091 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6092 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6096 if test -n "$_WRAP_MALLOC"; then
6097 if test "$GNU_CC"; then
6098 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"
6099 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6103 dnl ========================================================
6104 dnl = Location of malloc wrapper lib
6105 dnl ========================================================
6106 MOZ_ARG_WITH_STRING(wrap-malloc,
6107 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6108 WRAP_MALLOC_LIB=$withval)
6110 dnl ========================================================
6111 dnl = Use Electric Fence
6112 dnl ========================================================
6113 MOZ_ARG_ENABLE_BOOL(efence,
6114 [ --enable-efence Link with Electric Fence],
6117 if test -n "$_ENABLE_EFENCE"; then
6118 AC_CHECK_LIB(efence,malloc)
6121 dnl ========================================================
6123 dnl ========================================================
6124 MOZ_ARG_ENABLE_BOOL(jprof,
6125 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6128 if test -n "$MOZ_JPROF"; then
6129 AC_DEFINE(MOZ_JPROF)
6133 dnl ========================================================
6134 dnl = Enable stripping of libs & executables
6135 dnl ========================================================
6136 MOZ_ARG_ENABLE_BOOL(strip,
6137 [ --enable-strip Enable stripping of libs & executables ],
6141 dnl ========================================================
6142 dnl = --enable-elf-dynstr-gc
6143 dnl ========================================================
6144 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6145 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6146 USE_ELF_DYNSTR_GC=1,
6147 USE_ELF_DYNSTR_GC= )
6149 dnl ========================================================
6150 dnl = --enable-old-abi-compat-wrappers
6151 dnl ========================================================
6152 dnl on x86 linux, the current builds of some popular plugins (notably
6153 dnl flashplayer and real) expect a few builtin symbols from libgcc
6154 dnl which were available in some older versions of gcc. However,
6155 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6156 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6157 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6158 dnl to true on x86 linux, and false everywhere else.
6161 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6162 [ --enable-old-abi-compat-wrappers
6163 Support old GCC ABI symbols to ease the pain
6164 of the linux compiler change],
6165 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6166 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6167 if test "$COMPILE_ENVIRONMENT"; then
6168 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6171 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6173 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6175 fi # COMPILE_ENVIRONMENT
6177 dnl ========================================================
6178 dnl = --enable-prebinding
6179 dnl ========================================================
6180 MOZ_ARG_ENABLE_BOOL(prebinding,
6181 [ --enable-prebinding Enable prebinding (Mac OS X only)],
6185 dnl ========================================================
6187 dnl = Profiling and Instrumenting
6189 dnl ========================================================
6190 MOZ_ARG_HEADER(Profiling and Instrumenting)
6192 dnl ========================================================
6193 dnl = Enable timeline service, which provides lightweight
6194 dnl = instrumentation of mozilla for performance measurement.
6195 dnl = Timeline is off by default.
6196 dnl ========================================================
6197 MOZ_ARG_ENABLE_BOOL(timeline,
6198 [ --enable-timeline Enable timeline services ],
6201 if test -n "$MOZ_TIMELINE"; then
6202 AC_DEFINE(MOZ_TIMELINE)
6205 dnl ========================================================
6206 dnl Turn on reflow counting
6207 dnl ========================================================
6208 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6209 [ --enable-reflow-perf Enable reflow performance tracing],
6212 if test -n "$MOZ_REFLOW_PREF"; then
6213 AC_DEFINE(MOZ_REFLOW_PREF)
6215 AC_SUBST(MOZ_REFLOW_PERF)
6217 dnl ========================================================
6218 dnl Enable performance metrics.
6219 dnl ========================================================
6220 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6221 [ --enable-perf-metrics Enable performance metrics],
6224 if test -n "$MOZ_PERF_METRICS"; then
6225 AC_DEFINE(MOZ_PERF_METRICS)
6228 dnl ========================================================
6229 dnl Enable code size metrics.
6230 dnl ========================================================
6231 MOZ_ARG_ENABLE_BOOL(codesighs,
6232 [ --enable-codesighs Enable code size analysis tools],
6233 _ENABLE_CODESIGHS=1,
6234 _ENABLE_CODESIGHS= )
6235 if test -n "$_ENABLE_CODESIGHS"; then
6236 if test -d $srcdir/tools/codesighs; then
6239 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6243 dnl ========================================================
6244 dnl = Enable trace malloc
6245 dnl ========================================================
6246 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6247 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6248 [ --enable-trace-malloc Enable malloc tracing],
6251 if test "$NS_TRACE_MALLOC"; then
6252 # Please, Mr. Linker Man, don't take away our symbol names
6253 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6255 AC_DEFINE(NS_TRACE_MALLOC)
6257 AC_SUBST(NS_TRACE_MALLOC)
6259 dnl ========================================================
6260 dnl = Add support for Eazel profiler
6261 dnl ========================================================
6262 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6263 [ --enable-eazel-profiler-support
6264 Enable Corel/Eazel profiler support],
6265 ENABLE_EAZEL_PROFILER=1,
6266 ENABLE_EAZEL_PROFILER= )
6267 if test -n "$ENABLE_EAZEL_PROFILER"; then
6268 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6270 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6271 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6272 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6275 MOZ_ARG_ENABLE_STRING(profile-modules,
6276 [ --enable-profile-modules
6277 Enable/disable profiling for specific modules],
6278 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6280 MOZ_ARG_ENABLE_BOOL(insure,
6281 [ --enable-insure Enable insure++ instrumentation (linux only)],
6284 if test -n "$_ENABLE_INSURE"; then
6288 MOZ_INSURE_EXCLUDE_DIRS="config"
6291 MOZ_ARG_WITH_STRING(insure-dirs,
6292 [ --with-insure-dirs=DIRS
6293 Dirs to instrument with insure ],
6294 MOZ_INSURE_DIRS=$withval )
6296 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6297 [ --with-insure-exclude-dirs=DIRS
6298 Dirs to not instrument with insure ],
6299 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6301 dnl ========================================================
6302 dnl = Support for Quantify (Windows)
6303 dnl ========================================================
6304 MOZ_ARG_ENABLE_BOOL(quantify,
6305 [ --enable-quantify Enable Quantify support (Windows only) ],
6309 dnl ========================================================
6310 dnl = Support for demangling undefined symbols
6311 dnl ========================================================
6312 if test -z "$SKIP_LIBRARY_CHECKS"; then
6315 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6319 # Demangle only for debug or trace-malloc builds
6320 MOZ_DEMANGLE_SYMBOLS=
6321 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6322 MOZ_DEMANGLE_SYMBOLS=1
6323 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6325 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6328 dnl ========================================================
6332 dnl ========================================================
6333 MOZ_ARG_HEADER(Misc. Options)
6335 dnl ========================================================
6336 dnl update xterm title
6337 dnl ========================================================
6338 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6339 [ --enable-xterm-updates Update XTERM titles with current command.],
6343 dnl =========================================================
6345 dnl =========================================================
6346 MOZ_ARG_ENABLE_STRING([chrome-format],
6347 [ --enable-chrome-format=jar|flat|both|symlink
6348 Select FORMAT of chrome files (default=jar)],
6349 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6351 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6352 MOZ_CHROME_FILE_FORMAT=jar
6355 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6356 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6357 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6358 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6359 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6362 dnl ========================================================
6363 dnl = Define default location for MOZILLA_FIVE_HOME
6364 dnl ========================================================
6365 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6366 [ --with-default-mozilla-five-home
6367 Set the default value for MOZILLA_FIVE_HOME],
6368 [ val=`echo $withval`
6369 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
6371 dnl ========================================================
6372 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
6373 dnl ========================================================
6374 MOZ_ARG_WITH_STRING(user-appdir,
6375 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
6376 [ val=`echo $withval`
6377 if echo "$val" | grep "\/" >/dev/null; then
6378 AC_MSG_ERROR("Homedir must be single relative path.")
6383 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
6385 dnl ========================================================
6386 dnl = Doxygen configuration
6387 dnl ========================================================
6388 dnl Use commas to specify multiple dirs to this arg
6389 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
6390 MOZ_ARG_WITH_STRING(doc-input-dirs,
6391 [ --with-doc-input-dirs=DIRS
6392 Header/idl dirs to create docs from],
6393 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6394 AC_SUBST(MOZ_DOC_INPUT_DIRS)
6396 dnl Use commas to specify multiple dirs to this arg
6397 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
6398 MOZ_ARG_WITH_STRING(doc-include-dirs,
6399 [ --with-doc-include-dirs=DIRS
6400 Include dirs to preprocess doc headers],
6401 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6402 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
6404 MOZ_DOC_OUTPUT_DIR='./dist/docs'
6405 MOZ_ARG_WITH_STRING(doc-output-dir,
6406 [ --with-doc-output-dir=DIR
6407 Dir to generate docs into],
6408 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
6409 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
6411 if test -z "$SKIP_COMPILER_CHECKS"; then
6412 dnl ========================================================
6414 dnl = Compiler Options
6416 dnl ========================================================
6417 MOZ_ARG_HEADER(Compiler Options)
6419 dnl ========================================================
6420 dnl Check for gcc -pipe support
6421 dnl ========================================================
6422 AC_MSG_CHECKING([for gcc -pipe support])
6423 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
6424 echo '#include <stdio.h>' > dummy-hello.c
6425 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
6426 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
6427 cat dummy-hello.s | ${AS_BIN} -o dummy-hello.S - 2>&5
6428 if test $? = 0; then
6433 if test "$_res_as_stdin" = "yes"; then
6434 _SAVE_CFLAGS=$CFLAGS
6435 CFLAGS="$CFLAGS -pipe"
6436 AC_TRY_COMPILE( [ #include <stdio.h> ],
6437 [printf("Hello World\n");],
6438 [_res_gcc_pipe="yes"],
6439 [_res_gcc_pipe="no"] )
6440 CFLAGS=$_SAVE_CFLAGS
6442 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
6444 CFLAGS="$CFLAGS -pipe"
6445 CXXFLAGS="$CXXFLAGS -pipe"
6449 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
6450 AC_MSG_RESULT([$_res])
6455 dnl pass -Wno-long-long to the compiler
6456 MOZ_ARG_ENABLE_BOOL(long-long-warning,
6457 [ --enable-long-long-warning
6458 Warn about use of non-ANSI long long type],
6459 _IGNORE_LONG_LONG_WARNINGS=,
6460 _IGNORE_LONG_LONG_WARNINGS=1)
6462 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
6463 _SAVE_CFLAGS="$CFLAGS"
6464 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
6465 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
6466 AC_TRY_COMPILE([], [return(0);],
6467 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6468 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6469 result="yes" ], result="no")
6470 AC_MSG_RESULT([$result])
6471 CFLAGS="$_SAVE_CFLAGS"
6474 dnl Test for profiling options
6475 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
6476 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
6478 _SAVE_CFLAGS="$CFLAGS"
6479 CFLAGS="$CFLAGS -fprofile-generate"
6481 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
6482 AC_TRY_COMPILE([], [return 0;],
6483 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
6484 result="yes" ], result="no")
6485 AC_MSG_RESULT([$result])
6487 if test $result = "yes"; then
6488 PROFILE_USE_CFLAGS="-fprofile-use"
6490 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
6491 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
6492 AC_TRY_COMPILE([], [return 0;],
6493 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
6494 result="yes" ], result="no")
6495 AC_MSG_RESULT([$result])
6496 if test $result = "yes"; then
6497 PROFILE_USE_CFLAGS="-fbranch-probabilities"
6501 CFLAGS="$_SAVE_CFLAGS"
6503 AC_SUBST(PROFILE_GEN_CFLAGS)
6504 AC_SUBST(PROFILE_USE_CFLAGS)
6508 dnl ========================================================
6509 dnl Test for -pedantic bustage
6510 dnl ========================================================
6511 MOZ_ARG_DISABLE_BOOL(pedantic,
6512 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
6514 if test "$_PEDANTIC"; then
6515 _SAVE_CXXFLAGS=$CXXFLAGS
6516 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6517 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
6518 AC_TRY_COMPILE([$configure_static_assert_macros],
6519 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
6520 result="no", result="yes" )
6521 AC_MSG_RESULT([$result])
6522 CXXFLAGS="$_SAVE_CXXFLAGS"
6526 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
6527 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6530 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
6535 dnl ========================================================
6536 dnl Test for correct temporary object destruction order
6537 dnl ========================================================
6538 dnl We want to make sure the compiler follows the C++ spec here as
6539 dnl xpcom and the string classes depend on it (bug 235381).
6540 AC_MSG_CHECKING([for correct temporary object destruction order])
6541 AC_TRY_RUN([ class A {
6542 public: A(int& x) : mValue(x) {}
6544 operator char**() { return 0; }
6545 private: int& mValue;
6547 void func(char **arg) {}
6558 result="yes", result="no", result="maybe")
6559 AC_MSG_RESULT([$result])
6561 if test "$result" = "no"; then
6562 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
6565 dnl ========================================================
6566 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
6567 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
6568 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
6569 dnl ========================================================
6570 _SAVE_CXXFLAGS=$CXXFLAGS
6571 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
6572 AC_CACHE_CHECK(for correct overload resolution with const and templates,
6573 ac_nscap_nonconst_opeq_bug,
6582 template <class T, class U>
6583 int operator==(const Pointer<T>& rhs, U* lhs)
6585 return rhs.myPtr == lhs;
6588 template <class T, class U>
6589 int operator==(const Pointer<T>& rhs, const U* lhs)
6591 return rhs.myPtr == lhs;
6599 ac_nscap_nonconst_opeq_bug="no",
6600 ac_nscap_nonconst_opeq_bug="yes")])
6601 CXXFLAGS="$_SAVE_CXXFLAGS"
6603 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
6604 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
6606 fi # SKIP_COMPILER_CHECKS
6608 dnl ========================================================
6610 dnl Should be smarter and check that the compiler does indeed have rtti
6611 dnl ========================================================
6612 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
6613 [ --enable-cpp-rtti Enable C++ RTTI ],
6614 [ _MOZ_USE_RTTI=1 ],
6617 if test "$_MOZ_USE_RTTI"; then
6618 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
6620 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
6623 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
6625 dnl ========================================================
6626 dnl C++ exceptions (g++/egcs only - for now)
6627 dnl Should be smarter and check that the compiler does indeed have exceptions
6628 dnl ========================================================
6629 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
6630 [ --enable-cpp-exceptions Enable C++ exceptions ],
6631 [ _MOZ_CPP_EXCEPTIONS=1 ],
6632 [ _MOZ_CPP_EXCEPTIONS= ])
6634 if test "$_MOZ_CPP_EXCEPTIONS"; then
6635 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
6637 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
6640 # Irix & OSF native compilers do not like exception declarations
6641 # when exceptions are disabled
6642 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
6643 AC_DEFINE(CPP_THROW_NEW, [])
6645 AC_DEFINE(CPP_THROW_NEW, [throw()])
6649 dnl ========================================================
6651 dnl = Build depencency options
6653 dnl ========================================================
6654 MOZ_ARG_HEADER(Build dependencies)
6656 dnl ========================================================
6657 dnl = Do not auto generate dependency info
6658 dnl ========================================================
6660 MOZ_ARG_DISABLE_BOOL(auto-deps,
6661 [ --disable-auto-deps Do not automatically generate dependency info],
6665 if test -n "$MOZ_AUTO_DEPS"; then
6666 dnl ========================================================
6667 dnl = Use mkdepend instead of $CC -MD for dependency generation
6668 dnl ========================================================
6670 MOZ_ARG_DISABLE_BOOL(md,
6671 [ --disable-md Do not use compiler-based dependencies ],
6674 [dnl Default is to turn on -MD if using GNU-compatible compilers
6675 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
6678 if test "$_cpp_md_flag"; then
6680 if test "$OS_ARCH" = "OpenVMS"; then
6681 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(*F).pp))'
6683 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(*F).pp)'
6687 _USE_CPP_INCLUDE_FLAG=
6688 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6689 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6693 AC_SUBST(MOZ_AUTO_DEPS)
6694 AC_SUBST(COMPILER_DEPEND)
6698 dnl ========================================================
6700 dnl = Static Build Options
6702 dnl ========================================================
6703 MOZ_ARG_HEADER(Static build options)
6705 MOZ_ARG_ENABLE_BOOL(static,
6706 [ --enable-static Enable building of internal static libs],
6707 BUILD_STATIC_LIBS=1,
6710 dnl Disable libxul in debug builds.
6711 if test -n "$MOZ_DEBUG"; then
6715 MOZ_ARG_ENABLE_BOOL(libxul,
6716 [ --enable-libxul Enable building of libxul],
6717 MOZ_ENABLE_LIBXUL=1,
6720 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
6721 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
6724 if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
6725 AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
6728 if test -n "$MOZ_ENABLE_LIBXUL"; then
6729 XPCOM_LIBS="$LIBXUL_LIBS"
6730 AC_DEFINE(MOZ_ENABLE_LIBXUL)
6732 if test -n "$BUILD_STATIC_LIBS"; then
6733 AC_DEFINE(MOZ_STATIC_BUILD)
6735 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
6738 dnl ========================================================
6739 dnl = Force JS to be a static lib
6740 dnl ========================================================
6741 MOZ_ARG_ENABLE_BOOL(js-static-build,
6742 [ --enable-js-static-build Force js to be a static lib],
6746 AC_SUBST(JS_STATIC_BUILD)
6748 if test -n "$JS_STATIC_BUILD"; then
6749 AC_DEFINE(EXPORT_JS_API)
6751 if test -z "$BUILD_STATIC_LIBS"; then
6752 AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static])
6757 dnl ========================================================
6759 dnl = Standalone module options
6761 dnl ========================================================
6762 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
6764 dnl Check for GLib and libIDL.
6765 dnl ========================================================
6766 case "$target_os" in
6767 msvc*|mks*|cygwin*|mingw*|wince*)
6768 SKIP_IDL_CHECK="yes"
6775 if test -z "$COMPILE_ENVIRONMENT"; then
6776 SKIP_IDL_CHECK="yes"
6779 dnl = Allow users to disable libIDL checking for standalone modules
6780 MOZ_ARG_WITHOUT_BOOL(libIDL,
6781 [ --without-libIDL Skip check for libIDL (standalone modules only)],
6782 SKIP_IDL_CHECK="yes")
6784 if test "$SKIP_IDL_CHECK" = "no"
6787 if test "$MACOS_SDK_DIR"; then
6788 dnl xpidl, and therefore libIDL, is only needed on the build host.
6789 dnl Don't build it against the SDK, as that causes problems.
6790 _MACSAVE_CFLAGS="$CFLAGS"
6791 _MACSAVE_LIBS="$LIBS"
6792 _MACSAVE_LDFLAGS="$LDFLAGS"
6793 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
6795 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"`
6796 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
6797 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
6802 if test "$MOZ_ENABLE_GTK2"; then
6803 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
6805 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
6806 dnl to either libIDL1 or libIDL2.
6807 if test -z "$_LIBIDL_FOUND"; then
6808 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
6809 if test -z "$_LIBIDL_FOUND"; then
6810 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
6814 dnl If we don't have a libIDL config program & not cross-compiling,
6815 dnl look for orbit-config instead.
6817 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
6818 AC_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
6819 if test -n "$ORBIT_CONFIG"; then
6820 AC_MSG_CHECKING([for ORBit libIDL usability])
6821 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
6822 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
6823 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
6824 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
6825 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
6826 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
6828 _SAVE_CFLAGS="$CFLAGS"
6830 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
6831 LIBS="$LIBIDL_LIBS $LIBS"
6834 #include <libIDL/IDL.h>
6837 s=strdup(IDL_get_libver_string());
6850 AC_MSG_RESULT($result)
6851 CFLAGS="$_SAVE_CFLAGS"
6855 if test -z "$_LIBIDL_FOUND"; then
6856 AC_MSG_ERROR([libIDL not found.
6857 libIDL $LIBIDL_VERSION or higher is required.])
6859 if test "$MACOS_SDK_DIR"; then
6860 CFLAGS="$_MACSAVE_CFLAGS"
6861 LIBS="$_MACSAVE_LIBS"
6862 LDFLAGS="$_MACSAVE_LDFLAGS"
6863 if test -n "$_MACSAVE_NEXT_ROOT" ; then
6864 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
6869 if test -n "$CROSS_COMPILE"; then
6870 if test -z "$HOST_LIBIDL_CONFIG"; then
6871 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
6873 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
6874 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
6875 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
6877 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
6878 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
6882 if test -z "$SKIP_PATH_CHECKS"; then
6883 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
6884 if test "$MOZ_ENABLE_GTK2"; then
6885 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
6887 AM_PATH_GLIB(${GLIB_VERSION})
6892 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
6893 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
6896 AC_SUBST(LIBIDL_CFLAGS)
6897 AC_SUBST(LIBIDL_LIBS)
6898 AC_SUBST(STATIC_LIBIDL)
6899 AC_SUBST(GLIB_CFLAGS)
6901 AC_SUBST(GLIB_GMODULE_LIBS)
6902 AC_SUBST(HOST_LIBIDL_CONFIG)
6903 AC_SUBST(HOST_LIBIDL_CFLAGS)
6904 AC_SUBST(HOST_LIBIDL_LIBS)
6906 dnl ========================================================
6907 dnl Check for libart
6908 dnl ========================================================
6909 if test "$MOZ_SVG_RENDERER_LIBART"; then
6910 if test ! -f $topsrcdir/other-licenses/libart_lgpl/Makefile.in; then
6911 AC_MSG_ERROR([You must check out the mozilla version of libart. Use
6912 mk_add_options MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl])
6915 dnl libart's configure hasn't been run yet, but we know what the
6916 dnl answer should be anyway
6917 MOZ_LIBART_CFLAGS='-I${DIST}/include/libart_lgpl'
6918 case "$target_os" in
6919 msvc*|mks*|cygwin*|mingw*|wince*)
6920 MOZ_LIBART_LIBS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)moz_art_lgpl.$(IMPORT_LIB_SUFFIX)'
6923 MOZ_LIBART_LIBS='-lmoz_art -lm'
6926 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lroot -lbe'
6929 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lm'
6935 AC_SUBST(MOZ_LIBART_CFLAGS)
6936 AC_SUBST(MOZ_LIBART_LIBS)
6938 dnl ========================================================
6940 dnl ========================================================
6941 if test "$MOZ_SVG" -o "$MOZ_ENABLE_CANVAS" -o "$MOZ_ENABLE_CAIRO_GFX" ; then
6942 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
6945 MOZ_ARG_ENABLE_BOOL(system-cairo,
6946 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
6950 if test "$MOZ_TREE_CAIRO"; then
6951 # Check for headers defining standard int types.
6952 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
6954 # For now we assume that we will have a uint64_t available through
6955 # one of the above headers or mozstdint.h.
6956 AC_DEFINE(HAVE_UINT64_T)
6958 # Define macros for cairo-features.h
6959 if test "$MOZ_X11"; then
6960 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
6961 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
6962 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
6963 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6964 MOZ_ENABLE_CAIRO_FT=1
6965 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
6967 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
6968 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
6969 ATSUI_FONT_FEATURE="#define CAIRO_HAS_ATSUI_FONT 1"
6971 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
6972 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
6973 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
6974 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
6976 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
6977 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
6978 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6979 MOZ_ENABLE_CAIRO_FT=1
6980 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
6981 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
6983 if test "$MOZ_ENABLE_GLITZ"; then
6984 GLITZ_SURFACE_FEATURE="#define CAIRO_HAS_GLITZ_SURFACE 1"
6986 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
6987 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
6988 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
6989 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6990 MOZ_ENABLE_CAIRO_FT=1
6992 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
6993 AC_SUBST(CAIRO_FT_CFLAGS)
6995 if test "$MOZ_DEBUG"; then
6996 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
6998 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7001 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7003 AC_SUBST(PS_SURFACE_FEATURE)
7004 AC_SUBST(PDF_SURFACE_FEATURE)
7005 AC_SUBST(SVG_SURFACE_FEATURE)
7006 AC_SUBST(XLIB_SURFACE_FEATURE)
7007 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7008 AC_SUBST(NQUARTZ_SURFACE_FEATURE)
7009 AC_SUBST(XCB_SURFACE_FEATURE)
7010 AC_SUBST(WIN32_SURFACE_FEATURE)
7011 AC_SUBST(OS2_SURFACE_FEATURE)
7012 AC_SUBST(BEOS_SURFACE_FEATURE)
7013 AC_SUBST(GLITZ_SURFACE_FEATURE)
7014 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7015 AC_SUBST(FT_FONT_FEATURE)
7016 AC_SUBST(WIN32_FONT_FEATURE)
7017 AC_SUBST(ATSUI_FONT_FEATURE)
7018 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7020 if test "$_WIN32_MSVC"; then
7021 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7022 if test "$MOZ_ENABLE_GLITZ"; then
7023 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'$(DEPTH)/gfx/cairo/glitz/src/mozglitz.lib $(DEPTH)/gfx/cairo/glitz/src/wgl/mozglitzwgl.lib'
7026 MOZ_CAIRO_LIBS='-L$(DEPTH)/gfx/cairo/cairo/src -lmozcairo -L$(DEPTH)/gfx/cairo/libpixman/src -lmozlibpixman'" $CAIRO_FT_LIBS"
7028 if test "$MOZ_X11"; then
7029 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7032 if test "$MOZ_ENABLE_GLITZ"; then
7033 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src -lmozglitz'
7034 if test "$MOZ_X11"; then
7035 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/glx -lmozglitzglx -lGL'
7037 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7038 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/wgl -lmozglitzwgl'
7043 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7044 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7045 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7049 AC_SUBST(MOZ_TREE_CAIRO)
7050 AC_SUBST(MOZ_CAIRO_CFLAGS)
7051 AC_SUBST(MOZ_CAIRO_LIBS)
7053 dnl ========================================================
7055 dnl ========================================================
7058 MOZ_ARG_ENABLE_BOOL(system-lcms,
7059 [ --enable-system-lcms Use system lcms (located with pkgconfig)],
7063 if test -z "$MOZ_NATIVE_LCMS"
7066 if test "$OS_ARCH" = "WINNT"; then
7067 if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
7068 LCMS_CFLAGS=-DLCMS_DLL
7070 LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
7072 LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
7075 PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_VERSION)
7078 AC_SUBST(MOZ_NATIVE_LCMS)
7079 AC_SUBST(LCMS_CFLAGS)
7082 dnl ========================================================
7084 dnl ========================================================
7085 MOZ_ARG_DISABLE_BOOL(xul,
7086 [ --disable-xul Disable XUL],
7088 if test "$MOZ_XUL"; then
7091 dnl remove extensions that require XUL
7092 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7097 dnl ========================================================
7098 dnl Two ways to enable Python support:
7099 dnl --enable-extensions=python # select all available.
7100 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7102 dnl --enable-extensions=python/xpcom,... # select individual ones
7104 dnl If either is used, we locate the Python to use.
7105 dnl ========================================================
7107 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7108 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7109 dnl Allow PYTHON to point to the Python interpreter to use
7110 dnl (note that it must be the python executable - which we
7111 dnl run to locate the relevant paths etc)
7112 dnl If not set, we use whatever Python we can find.
7114 dnl Ask Python what its version number is
7116 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7117 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7119 dnl Ask for the Python "prefix" (ie, home/source dir)
7120 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7121 dnl Setup the include and library directories.
7122 if test "$OS_ARCH" = "WINNT"; then
7123 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7124 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7125 dnl Binary trees have "include" for .h, and "libs" for .lib
7126 dnl We add 'em both - along with quotes, to handle spaces.
7127 MOZ_PYTHON_DLL_SUFFIX=.pyd
7128 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7129 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7131 dnl Non-Windows include and libs
7132 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7133 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7134 dnl Check for dynamic Python lib
7135 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7136 dnl - core, xpcom loader, pydom etc) all need to share Python.
7137 dnl - Python 2.3's std --enable-shared configure option will
7138 dnl create a libpython2.3.so.1.0. We should first try this
7139 dnl dotted versioned .so file because this is the one that
7140 dnl the PyXPCOM build mechanics tries to link to.
7141 dnl XXX Should find a better way than hardcoding "1.0".
7142 dnl - Python developement tree dir layouts are NOT allowed here
7143 dnl because the PyXPCOM build just dies on it later anyway.
7144 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7145 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7146 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7147 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7148 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7149 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7150 dnl Don't Python development tree directory layout.
7151 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7152 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.])
7153 elif test "$OS_ARCH" = "Darwin"; then
7154 dnl We do Darwin last, so if a custom non-framework build of
7155 dnl python is used on OSX, then it will be picked up first by
7156 dnl the logic above.
7157 MOZ_PYTHON_LIBS="-framework Python"
7159 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7161 if test "$OS_ARCH" = "Linux"; then
7162 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7165 dnl Handle "_d" on Windows
7166 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7167 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7169 MOZ_PYTHON_DEBUG_SUFFIX=
7171 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7174 dnl If the user asks for the 'python' extension, then we add
7175 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7176 dnl Note the careful regex - it must match 'python' followed by anything
7177 dnl other than a '/', including the end-of-string.
7178 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7179 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7180 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7183 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7184 dnl command-line, but not yet
7185 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7186 AC_SUBST(MOZ_PYTHON)
7187 AC_SUBST(MOZ_PYTHON_PREFIX)
7188 AC_SUBST(MOZ_PYTHON_INCLUDES)
7189 AC_SUBST(MOZ_PYTHON_LIBS)
7190 AC_SUBST(MOZ_PYTHON_VER)
7191 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7192 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7193 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7195 dnl ========================================================
7196 dnl disable profile sharing
7197 dnl ========================================================
7198 MOZ_ARG_DISABLE_BOOL(profilesharing,
7199 [ --disable-profilesharing Disable profile sharing],
7200 MOZ_PROFILESHARING=,
7201 MOZ_PROFILESHARING=1 )
7202 if test "$MOZ_PROFILESHARING"; then
7204 AC_DEFINE(MOZ_PROFILESHARING)
7207 dnl ========================================================
7209 dnl ========================================================
7210 MOZ_ARG_ENABLE_BOOL(ipcd,
7211 [ --enable-ipcd Enable IPC daemon],
7215 dnl ========================================================
7216 dnl disable profile locking
7217 dnl do no use this in applications that can have more than
7218 dnl one process accessing the profile directory.
7219 dnl ========================================================
7220 MOZ_ARG_DISABLE_BOOL(profilelocking,
7221 [ --disable-profilelocking Disable profile locking],
7222 MOZ_PROFILELOCKING=,
7223 MOZ_PROFILELOCKING=1 )
7224 if test "$MOZ_PROFILELOCKING"; then
7225 AC_DEFINE(MOZ_PROFILELOCKING)
7228 dnl ========================================================
7229 dnl disable rdf services
7230 dnl ========================================================
7231 MOZ_ARG_DISABLE_BOOL(rdf,
7232 [ --disable-rdf Disable RDF],
7234 if test "$MOZ_RDF"; then
7240 dnl ========================================================
7241 dnl necko configuration options
7242 dnl ========================================================
7245 dnl option to disable various necko protocols
7247 MOZ_ARG_ENABLE_STRING(necko-protocols,
7248 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7249 Enable/disable specific protocol handlers],
7250 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7251 if test "$option" = "yes" || test "$option" = "all"; then
7252 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7253 elif test "$option" = "no" || test "$option" = "none"; then
7255 elif test "$option" = "default"; then
7256 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7257 elif test `echo "$option" | grep -c \^-` != 0; then
7258 option=`echo $option | sed 's/^-//'`
7259 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7261 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7264 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7266 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7267 AC_SUBST(NECKO_PROTOCOLS)
7268 for p in $NECKO_PROTOCOLS; do
7269 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7273 dnl option to disable necko's disk cache
7275 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7276 [ --disable-necko-disk-cache
7277 Disable necko disk cache],
7280 AC_SUBST(NECKO_DISK_CACHE)
7281 if test "$NECKO_DISK_CACHE"; then
7282 AC_DEFINE(NECKO_DISK_CACHE)
7286 dnl option to minimize size of necko's i/o buffers
7288 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7289 [ --enable-necko-small-buffers
7290 Minimize size of necko's i/o buffers],
7291 NECKO_SMALL_BUFFERS=1,
7292 NECKO_SMALL_BUFFERS=)
7293 AC_SUBST(NECKO_SMALL_BUFFERS)
7294 if test "$NECKO_SMALL_BUFFERS"; then
7295 AC_DEFINE(NECKO_SMALL_BUFFERS)
7299 dnl option to disable cookies
7301 MOZ_ARG_DISABLE_BOOL(cookies,
7302 [ --disable-cookies Disable cookie support],
7305 AC_SUBST(NECKO_COOKIES)
7306 if test "$NECKO_COOKIES"; then
7307 AC_DEFINE(NECKO_COOKIES)
7310 dnl NECKO_ configuration options are not global
7311 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7313 dnl ========================================================
7314 dnl string api compatibility
7315 dnl ========================================================
7316 MOZ_ARG_DISABLE_BOOL(v1-string-abi,
7317 [ --disable-v1-string-abi Disable binary compatibility layer for strings],
7319 MOZ_V1_STRING_ABI=1)
7320 AC_SUBST(MOZ_V1_STRING_ABI)
7321 if test "$MOZ_V1_STRING_ABI"; then
7322 AC_DEFINE(MOZ_V1_STRING_ABI)
7325 dnl Only build Mork if it's required
7327 if test "$MOZ_MORK"; then
7331 dnl Build the lightweight Mork reader if required
7332 AC_SUBST(MOZ_MORKREADER)
7333 if test "$MOZ_MORKREADER"; then
7334 AC_DEFINE(MOZ_MORKREADER)
7337 dnl ========================================================
7338 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7339 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7342 if test "$MOZ_LDAP_XPCOM"; then
7343 LDAP_CFLAGS='-I${DIST}/public/ldap'
7344 if test "$OS_ARCH" = "WINNT"; then
7345 if test -n "$GNU_CC"; then
7346 LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
7348 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}'
7350 elif test "$OS_ARCH" = "OS2"; then
7351 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}'
7353 LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
7357 if test "$COMPILE_ENVIRONMENT"; then
7358 if test "$SUNCTL"; then
7359 dnl older versions of glib do not seem to have gmodule which ctl needs
7360 _SAVE_CFLAGS=$CFLAGS
7361 CFLAGS="$CFLAGS $GLIB_CFLAGS"
7364 AC_TRY_COMPILE([#include <gmodule.h>],
7365 [ int x = 1; x++; ],,
7366 [AC_MSG_ERROR([Cannot build ctl without gmodule support in glib.])])
7368 CFLAGS=$_SAVE_CFLAGS
7371 fi # COMPILE_ENVIRONMENT
7373 dnl ========================================================
7375 dnl = Maintainer debug option (no --enable equivalent)
7377 dnl ========================================================
7382 AC_SUBST(AR_EXTRACT)
7386 AC_SUBST(AS_DASH_C_FLAG)
7391 AC_SUBST(USE_SHORT_LIBNAME)
7395 AC_SUBST(NS_USE_NATIVE)
7396 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7397 AC_SUBST(MOZ_GFX_TOOLKIT)
7398 AC_SUBST(MOZ_UPDATE_XTERM)
7400 AC_SUBST(MOZ_AUTH_EXTENSION)
7401 AC_SUBST(MOZ_MATHML)
7402 AC_SUBST(MOZ_PERMISSIONS)
7404 AC_SUBST(MOZ_XMLEXTRAS)
7405 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7406 AC_SUBST(MOZ_WEBSERVICES)
7407 AC_SUBST(MOZ_PREF_EXTENSIONS)
7409 AC_SUBST(MOZ_SVG_FOREIGNOBJECT)
7410 AC_SUBST(MOZ_XSLT_STANDALONE)
7411 AC_SUBST(MOZ_JS_LIBS)
7414 AC_SUBST(MOZ_DEBUG_MODULES)
7415 AC_SUBST(MOZ_PROFILE_MODULES)
7416 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7417 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7418 AC_SUBST(MOZ_DEBUG_FLAGS)
7419 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7420 AC_SUBST(MOZ_DBGRINFO_MODULES)
7421 AC_SUBST(MOZ_EXTENSIONS)
7422 AC_SUBST(MOZ_IMG_DECODERS)
7423 AC_SUBST(MOZ_IMG_ENCODERS)
7424 AC_SUBST(MOZ_JSDEBUGGER)
7426 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7427 AC_SUBST(MOZ_PLUGINS)
7428 AC_SUBST(ENABLE_EAZEL_PROFILER)
7429 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7430 AC_SUBST(EAZEL_PROFILER_LIBS)
7431 AC_SUBST(MOZ_PERF_METRICS)
7432 AC_SUBST(GC_LEAK_DETECTOR)
7433 AC_SUBST(MOZ_LOG_REFCNT)
7436 AC_SUBST(MOZ_XPCTOOLS)
7437 AC_SUBST(MOZ_JSLOADER)
7438 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7439 AC_SUBST(MOZ_INSURE)
7440 AC_SUBST(MOZ_INSURE_DIRS)
7441 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7442 AC_SUBST(MOZ_QUANTIFY)
7443 AC_SUBST(MOZ_INSURIFYING)
7444 AC_SUBST(MOZ_LDAP_XPCOM)
7445 AC_SUBST(MOZ_LDAP_XPCOM_EXPERIMENTAL)
7446 AC_SUBST(LDAP_CFLAGS)
7449 AC_SUBST(MOZ_PLACES)
7450 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7451 AC_SUBST(MOZ_STORAGE)
7453 AC_SUBST(NS_PRINTING)
7455 AC_SUBST(MOZ_JAVAXPCOM)
7456 AC_SUBST(JAVA_INCLUDE_PATH)
7461 AC_SUBST(MOZ_PROFILESHARING)
7462 AC_SUBST(MOZ_PROFILELOCKING)
7467 AC_SUBST(MOZ_XIE_LIBS)
7468 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
7470 AC_SUBST(XPCOM_USE_LEA)
7471 AC_SUBST(BUILD_STATIC_LIBS)
7472 AC_SUBST(MOZ_ENABLE_LIBXUL)
7473 AC_SUBST(ENABLE_TESTS)
7476 AC_SUBST(MOZ_UNIVERSALCHARDET)
7477 AC_SUBST(ACCESSIBILITY)
7478 AC_SUBST(MOZ_XPINSTALL)
7479 AC_SUBST(MOZ_VIEW_SOURCE)
7480 AC_SUBST(MOZ_SINGLE_PROFILE)
7481 AC_SUBST(MOZ_SPELLCHECK)
7482 AC_SUBST(MOZ_XPFE_COMPONENTS)
7483 AC_SUBST(MOZ_USER_DIR)
7484 AC_SUBST(MOZ_AIRBAG)
7485 AC_SUBST(MOZ_MOCHITEST)
7487 AC_SUBST(ENABLE_STRIP)
7488 AC_SUBST(USE_ELF_DYNSTR_GC)
7489 AC_SUBST(USE_PREBINDING)
7490 AC_SUBST(INCREMENTAL_LINKER)
7491 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
7492 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
7493 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
7495 AC_SUBST(MOZ_FIX_LINK_PATHS)
7496 AC_SUBST(XPCOM_LIBS)
7497 AC_SUBST(XPCOM_FROZEN_LDOPTS)
7498 AC_SUBST(XPCOM_GLUE_LDOPTS)
7499 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
7501 AC_SUBST(USE_DEPENDENT_LIBS)
7503 AC_SUBST(MOZ_BUILD_ROOT)
7504 AC_SUBST(MOZ_OS2_TOOLS)
7505 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
7507 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
7508 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
7509 AC_SUBST(MOZ_TIMELINE)
7511 AC_SUBST(TARGET_DEVICE)
7513 AC_SUBST(MOZ_APP_NAME)
7514 AC_SUBST(MOZ_APP_DISPLAYNAME)
7515 AC_SUBST(MOZ_APP_VERSION)
7516 AC_SUBST(FIREFOX_VERSION)
7517 AC_SUBST(THUNDERBIRD_VERSION)
7518 AC_SUBST(SUNBIRD_VERSION)
7519 AC_SUBST(SEAMONKEY_VERSION)
7521 AC_SUBST(MOZ_PKG_SPECIAL)
7523 AC_SUBST(MOZILLA_OFFICIAL)
7524 AC_SUBST(BUILD_OFFICIAL)
7525 AC_SUBST(MOZ_MILESTONE_RELEASE)
7528 AC_SUBST(MOZ_PROFILE)
7529 AC_SUBST(MOZ_DEBUG_SYMBOLS)
7530 AC_SUBST(MOZ_MAPINFO)
7531 AC_SUBST(MOZ_BROWSE_INFO)
7532 AC_SUBST(MOZ_TOOLS_DIR)
7533 AC_SUBST(CYGWIN_WRAPPER)
7535 AC_SUBST(WIN32_REDIST_DIR)
7538 dnl Echo the CFLAGS to remove extra whitespace.
7545 $_MOZ_EXCEPTIONS_FLAGS \
7546 $_WARNINGS_CXXFLAGS \
7549 COMPILE_CFLAGS=`echo \
7554 COMPILE_CXXFLAGS=`echo \
7555 $_DEFINES_CXXFLAGS \
7559 AC_SUBST(SYSTEM_MAKEDEPEND)
7560 AC_SUBST(SYSTEM_JPEG)
7561 AC_SUBST(SYSTEM_PNG)
7562 AC_SUBST(SYSTEM_ZLIB)
7564 AC_SUBST(JPEG_CFLAGS)
7566 AC_SUBST(ZLIB_CFLAGS)
7568 AC_SUBST(PNG_CFLAGS)
7571 AC_SUBST(MOZ_JPEG_CFLAGS)
7572 AC_SUBST(MOZ_JPEG_LIBS)
7573 AC_SUBST(MOZ_ZLIB_CFLAGS)
7574 AC_SUBST(MOZ_ZLIB_LIBS)
7575 AC_SUBST(MOZ_PNG_CFLAGS)
7576 AC_SUBST(MOZ_PNG_LIBS)
7578 AC_SUBST(NSPR_CFLAGS)
7580 AC_SUBST(MOZ_NATIVE_NSPR)
7582 AC_SUBST(NSS_CFLAGS)
7584 AC_SUBST(NSS_DEP_LIBS)
7585 AC_SUBST(MOZ_NATIVE_NSS)
7590 AC_SUBST(COMPILE_CFLAGS)
7591 AC_SUBST(COMPILE_CXXFLAGS)
7594 AC_SUBST(CROSS_COMPILE)
7598 AC_SUBST(HOST_CFLAGS)
7599 AC_SUBST(HOST_CXXFLAGS)
7600 AC_SUBST(HOST_OPTIMIZE_FLAGS)
7602 AC_SUBST(HOST_AR_FLAGS)
7604 AC_SUBST(HOST_RANLIB)
7605 AC_SUBST(HOST_NSPR_MDCPUCFG)
7606 AC_SUBST(HOST_BIN_SUFFIX)
7607 AC_SUBST(HOST_OS_ARCH)
7609 AC_SUBST(TARGET_CPU)
7610 AC_SUBST(TARGET_VENDOR)
7612 AC_SUBST(TARGET_NSPR_MDCPUCFG)
7613 AC_SUBST(TARGET_MD_ARCH)
7614 AC_SUBST(TARGET_XPCOM_ABI)
7617 AC_SUBST(OS_RELEASE)
7620 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
7621 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
7623 AC_SUBST(WRAP_MALLOC_CFLAGS)
7624 AC_SUBST(WRAP_MALLOC_LIB)
7627 AC_SUBST(MKSHLIB_FORCE_ALL)
7628 AC_SUBST(MKSHLIB_UNFORCE_ALL)
7629 AC_SUBST(DSO_CFLAGS)
7630 AC_SUBST(DSO_PIC_CFLAGS)
7631 AC_SUBST(DSO_LDOPTS)
7632 AC_SUBST(LIB_PREFIX)
7633 AC_SUBST(DLL_PREFIX)
7634 AC_SUBST(DLL_SUFFIX)
7635 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
7636 AC_SUBST(LIB_SUFFIX)
7637 AC_SUBST(OBJ_SUFFIX)
7638 AC_SUBST(BIN_SUFFIX)
7639 AC_SUBST(ASM_SUFFIX)
7640 AC_SUBST(IMPORT_LIB_SUFFIX)
7642 AC_SUBST(CC_VERSION)
7643 AC_SUBST(CXX_VERSION)
7644 AC_SUBST(MSMANIFEST_TOOL)
7646 if test "$USING_HCC"; then
7647 CC='${topsrcdir}/build/hcc'
7649 CXX='${topsrcdir}/build/hcpp'
7650 CXX="$CXX '$_OLDCXX'"
7655 dnl Check for missing components
7656 if test "$COMPILE_ENVIRONMENT"; then
7657 if test "$MOZ_X11"; then
7658 dnl ====================================================
7659 dnl = Check if X headers exist
7660 dnl ====================================================
7661 _SAVE_CFLAGS=$CFLAGS
7662 CFLAGS="$CFLAGS $XCFLAGS"
7665 #include <X11/Xlib.h>
7666 #include <X11/Intrinsic.h>
7670 if ((dpy = XOpenDisplay(NULL)) == NULL) {
7671 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
7675 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
7676 CFLAGS="$_SAVE_CFLAGS"
7678 if test ! -z "$MISSING_X"; then
7679 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
7683 fi # COMPILE_ENVIRONMENT
7685 dnl Set various defines and substitutions
7686 dnl ========================================================
7688 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
7689 LIBS='so32dll.lib tcp32dll.lib'
7690 elif test "$OS_ARCH" = "BeOS"; then
7693 elif test "$OS_ARCH" = "Darwin"; then
7695 AC_DEFINE(UNIX_ASYNC_DNS)
7696 elif test "$OS_ARCH" = "OpenVMS"; then
7698 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
7700 AC_DEFINE(UNIX_ASYNC_DNS)
7703 AC_SUBST(MOZ_MOVEMAIL)
7705 AC_DEFINE(JS_THREADSAFE)
7707 if test "$MOZ_DEBUG"; then
7708 AC_DEFINE(MOZ_REFLOW_PERF)
7709 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
7712 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
7713 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
7714 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
7715 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
7716 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
7717 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
7718 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
7719 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
7720 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
7723 # Used for LD_LIBRARY_PATH of run_viewer target
7725 for lib_arg in $NSPR_LIBS $TK_LIBS; do
7727 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
7733 dnl ========================================================
7734 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
7735 dnl ========================================================
7738 WIN_TOP_SRC=`cd $srcdir; pwd -W`
7741 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
7742 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
7743 CC="\$(CYGWIN_WRAPPER) $CC"
7744 CXX="\$(CYGWIN_WRAPPER) $CXX"
7745 CPP="\$(CYGWIN_WRAPPER) $CPP"
7746 LD="\$(CYGWIN_WRAPPER) $LD"
7747 AS="\$(CYGWIN_WRAPPER) $AS"
7748 RC="\$(CYGWIN_WRAPPER) $RC"
7749 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
7750 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
7751 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
7755 AC_SUBST(CYGDRIVE_MOUNT)
7756 AC_SUBST(WIN_TOP_SRC)
7758 AC_SUBST(MOZILLA_VERSION)
7760 . ${srcdir}/config/chrome-versions.sh
7761 AC_DEFINE_UNQUOTED(MOZILLA_LOCALE_VERSION,"$MOZILLA_LOCALE_VERSION")
7762 AC_DEFINE_UNQUOTED(MOZILLA_REGION_VERSION,"$MOZILLA_REGION_VERSION")
7763 AC_DEFINE_UNQUOTED(MOZILLA_SKIN_VERSION,"$MOZILLA_SKIN_VERSION")
7765 AC_SUBST(ac_configure_args)
7767 dnl Spit out some output
7768 dnl ========================================================
7770 dnl The following defines are used by xpcom
7771 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
7773 HAVE_CPP_2BYTE_WCHAR_T
7774 HAVE_CPP_ACCESS_CHANGING_USING
7775 HAVE_CPP_AMBIGUITY_RESOLVING_USING
7777 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
7779 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
7780 HAVE_CPP_NAMESPACE_STD
7782 HAVE_CPP_PARTIAL_SPECIALIZATION
7783 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
7785 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
7787 NEED_CPP_UNUSED_IMPLEMENTATIONS
7791 HAVE_ICONV_WITH_CONST_INPUT
7801 netwerk/necko-config.h
7802 xpcom/xpcom-config.h
7803 xpcom/xpcom-private.h
7806 # Save the defines header file before autoconf removes it.
7807 # (Do not add AC_DEFINE calls after this line.)
7808 _CONFIG_TMP=confdefs-tmp.h
7809 _CONFIG_DEFS_H=mozilla-config.h
7811 cat > $_CONFIG_TMP <<\EOF
7812 /* List of defines generated by configure. Included with preprocessor flag,
7813 * -include, to avoid long list of -D defines on the compile command-line.
7817 #ifndef _MOZILLA_CONFIG_H_
7818 #define _MOZILLA_CONFIG_H_
7821 _EGREP_PATTERN='^#define ('
7822 if test -n "$_NON_GLOBAL_ACDEFINES"; then
7823 for f in $_NON_GLOBAL_ACDEFINES; do
7824 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
7827 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
7829 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
7831 cat >> $_CONFIG_TMP <<\EOF
7833 #endif /* _MOZILLA_CONFIG_H_ */
7837 # Only write mozilla-config.h when something changes (or it doesn't exist)
7838 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
7841 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
7842 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
7844 echo ==== $_CONFIG_DEFS_H =================================
7848 dnl Probably shouldn't call this manually but we always want the output of DEFS
7849 rm -f confdefs.h.save
7850 mv confdefs.h confdefs.h.save
7851 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
7852 AC_OUTPUT_MAKE_DEFS()
7854 AC_SUBST(MOZ_DEFINES)
7856 mv confdefs.h.save confdefs.h
7858 dnl Load the list of Makefiles to generate.
7859 dnl To add new Makefiles, edit allmakefiles.sh.
7860 dnl allmakefiles.sh sets the variable, MAKEFILES.
7861 . ${srcdir}/allmakefiles.sh
7863 dnl Run a perl script to quickly create the makefiles.
7864 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
7865 dnl for the files it cannot handle correctly. This way, config.status
7866 dnl will handle these files.
7867 dnl If it fails, nothing is set and config.status will run as usual.
7869 dnl This does not change the $MAKEFILES variable.
7871 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
7873 if test -z "${AS_PERL}"; then
7874 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
7876 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
7881 echo $MAKEFILES > unallmakefiles
7883 AC_OUTPUT($MAKEFILES)
7885 dnl ========================================================
7886 dnl = Setup a nice relatively clean build environment for
7887 dnl = sub-configures.
7888 dnl ========================================================
7891 CFLAGS="$_SUBDIR_CFLAGS"
7892 CPPFLAGS="$_SUBDIR_CPPFLAGS"
7893 CXXFLAGS="$_SUBDIR_CXXFLAGS"
7894 LDFLAGS="$_SUBDIR_LDFLAGS"
7895 HOST_CC="$_SUBDIR_HOST_CC"
7896 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
7897 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
7903 if test "$COMPILE_ENVIRONMENT"; then
7904 if test -z "$MOZ_NATIVE_NSPR" || test "$MOZ_LDAP_XPCOM"; then
7905 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
7906 if test -z "$MOZ_DEBUG"; then
7907 ac_configure_args="$ac_configure_args --disable-debug"
7909 if test "$MOZ_OPTIMIZE" = "1"; then
7910 ac_configure_args="$ac_configure_args --enable-optimize"
7912 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
7913 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
7915 if test -n "$HAVE_64BIT_OS"; then
7916 ac_configure_args="$ac_configure_args --enable-64bit"
7918 AC_OUTPUT_SUBDIRS(nsprpub)
7919 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
7922 if test -z "$MOZ_NATIVE_NSPR"; then
7923 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
7924 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
7925 if test ! "$VACPP" && test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
7926 _libs=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --libdir=$\(LIBXUL_DIST\)/lib --libs`
7927 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $_libs'" config/autoconf.mk
7929 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE" ; then
7930 _cflags=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --includedir=$\(LIBXUL_DIST\)/include/nspr --cflags`
7931 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $_cflags'" config/autoconf.mk
7933 rm -f config/autoconf.mk.bak
7936 # if we're building the LDAP XPCOM component, we need to build
7939 if test "$MOZ_LDAP_XPCOM"; then
7941 # these subdirs may not yet have been created in the build tree.
7942 # don't use the "-p" switch to mkdir, since not all platforms have it
7944 if test ! -d "directory"; then
7947 if test ! -d "directory/c-sdk"; then
7948 mkdir "directory/c-sdk"
7950 if test ! -d "directory/c-sdk/ldap"; then
7951 mkdir "directory/c-sdk/ldap"
7954 ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
7955 if test -z "$MOZ_DEBUG"; then
7956 ac_configure_args="$ac_configure_args --disable-debug"
7958 if test "$MOZ_OPTIMIZE" = "1"; then
7959 ac_configure_args="$ac_configure_args --enable-optimize"
7961 if test -n "$HAVE_64BIT_OS"; then
7962 ac_configure_args="$ac_configure_args --enable-64bit"
7964 AC_OUTPUT_SUBDIRS(directory/c-sdk)
7965 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
7967 fi # COMPILE_ENVIRONMENT