1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2 dnl vi: set tabstop=4 shiftwidth=4 expandtab:
3 dnl ***** BEGIN LICENSE BLOCK *****
4 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 dnl The contents of this file are subject to the Mozilla Public License Version
7 dnl 1.1 (the "License"); you may not use this file except in compliance with
8 dnl the License. You may obtain a copy of the License at
9 dnl http://www.mozilla.org/MPL/
11 dnl Software distributed under the License is distributed on an "AS IS" basis,
12 dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 dnl for the specific language governing rights and limitations under the
16 dnl The Original Code is this file as it was released upon August 6, 1998.
18 dnl The Initial Developer of the Original Code is
19 dnl Christopher Seawood.
20 dnl Portions created by the Initial Developer are Copyright (C) 1998-2001
21 dnl the Initial Developer. All Rights Reserved.
24 dnl Jamie Zawinski <jwz@jwz.org>
25 dnl gettimeofday args check
26 dnl Christopher Blizzard <blizzard@appliedtheory.com>
27 dnl gnomefe update & enable-pthreads
28 dnl Ramiro Estrugo <ramiro@netscape.com>
29 dnl X11 makedepend support
31 dnl Henry Sobotka <sobotka@axess.com>
33 dnl Dan Mosedale <dmose@mozilla.org>
35 dnl Seth Spitzer <sspitzer@netscape.com>
37 dnl Benjamin Smedberg <benjamin@smedbergs.us>
38 dnl Howard Chu <hyc@symas.com>
40 dnl Mark Mentovai <mark@moxienet.com>:
41 dnl Mac OS X 10.4 support
42 dnl Giorgio Maone <g.maone@informaction.com>
43 dnl MSVC l10n compatible version check
44 dnl Ben Turner <mozilla@songbirdnest.com>
46 dnl Alternatively, the contents of this file may be used under the terms of
47 dnl either the GNU General Public License Version 2 or later (the "GPL"), or
48 dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
49 dnl in which case the provisions of the GPL or the LGPL are applicable instead
50 dnl of those above. If you wish to allow use of your version of this file only
51 dnl under the terms of either the GPL or the LGPL, and not to allow others to
52 dnl use your version of this file under the terms of the MPL, indicate your
53 dnl decision by deleting the provisions above and replace them with the notice
54 dnl and other provisions required by the GPL or the LGPL. If you do not delete
55 dnl the provisions above, a recipient may use your version of this file under
56 dnl the terms of any one of the MPL, the GPL or the LGPL.
58 dnl ***** END LICENSE BLOCK *****
60 dnl Process this file with autoconf to produce a configure script.
61 dnl ========================================================
64 AC_INIT(config/config.mk)
65 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
67 TARGET_CPU="${target_cpu}"
68 TARGET_VENDOR="${target_vendor}"
69 TARGET_OS="${target_os}"
71 dnl ========================================================
73 dnl = Don't change the following two lines. Doing so breaks:
75 dnl = CFLAGS="-foo" ./configure
77 dnl ========================================================
79 CPPFLAGS="${CPPFLAGS=}"
80 CXXFLAGS="${CXXFLAGS=}"
82 HOST_CFLAGS="${HOST_CFLAGS=}"
83 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
84 HOST_LDFLAGS="${HOST_LDFLAGS=}"
86 dnl ========================================================
87 dnl = Preserve certain environment flags passed to configure
88 dnl = We want sub projects to receive the same flags
89 dnl = untainted by this configure script
90 dnl ========================================================
93 _SUBDIR_CFLAGS="$CFLAGS"
94 _SUBDIR_CPPFLAGS="$CPPFLAGS"
95 _SUBDIR_CXXFLAGS="$CXXFLAGS"
96 _SUBDIR_LDFLAGS="$LDFLAGS"
97 _SUBDIR_HOST_CC="$HOST_CC"
98 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
99 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
100 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
101 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
103 dnl Set the version number of the libs included with mozilla
104 dnl ========================================================
111 dnl Set the minimum version of toolkit libs used by mozilla
112 dnl ========================================================
122 WINDRES_VERSION=2.14.90
125 GNOMEUI_VERSION=2.2.0
128 STARTUP_NOTIFICATION_VERSION=0.8
134 dnl Set various checks
135 dnl ========================================================
139 dnl Initialize the Pthread test variables early so they can be
140 dnl overridden by each platform.
141 dnl ========================================================
145 dnl Do not allow a separate objdir build if a srcdir build exists.
146 dnl ==============================================================
147 _topsrcdir=`cd \`dirname $0\`; pwd`
149 if test "$_topsrcdir" != "$_objdir"
151 # Check for a couple representative files in the source tree
153 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
154 if test -f $file; then
155 _conflict_files="$_conflict_files $file"
158 if test "$_conflict_files"; then
160 echo "* Your source tree contains these files:"
161 for file in $_conflict_files; do
165 * This indicates that you previously built in the source tree.
166 * A source tree build can confuse the separate objdir build.
168 * To clean up the source tree:
179 dnl Default to MSVC for win32
180 dnl ==============================================================
181 if test -z "$CROSS_COMPILE"; then
183 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
185 if test -z "$CC"; then CC=cl; fi
186 if test -z "$CXX"; then CXX=cl; fi
187 if test -z "$CPP"; then CPP=cl; fi
188 if test -z "$LD"; then LD=link; fi
189 if test -z "$AS"; then AS=ml; fi
190 if test -z "$MIDL"; then MIDL=midl; fi
195 COMPILE_ENVIRONMENT=1
196 MOZ_ARG_ENABLE_BOOL(compile-environment,
197 [ --disable-compile-environment
198 Disable compiler/library checks.],
199 COMPILE_ENVIRONMENT=1,
200 COMPILE_ENVIRONMENT= )
202 dnl ========================================================
203 dnl Checks for compilers.
204 dnl ========================================================
205 dnl Set CROSS_COMPILE in the environment when running configure
206 dnl to use the cross-compile setup for now
207 dnl ========================================================
209 if test "$COMPILE_ENVIRONMENT"; then
211 dnl Do some special WinCE toolchain stuff
214 echo -----------------------------------------------------------------------------
215 echo Building Windows CE Shunt Library and Tool Chain
216 echo -----------------------------------------------------------------------------
218 echo -n "#define TOPSRCDIR \"" > $srcdir/build/wince/tools/topsrcdir.h
219 `$srcdir/build/cygwin-wrapper echo -n $_topsrcdir >> $srcdir/build/wince/tools/topsrcdir.h`
220 echo -n \" >> $srcdir/build/wince/tools/topsrcdir.h
222 make -C $srcdir/build/wince/tools
223 echo -----------------------------------------------------------------------------
227 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
228 echo "cross compiling from $host to $target"
232 _SAVE_CFLAGS="$CFLAGS"
233 _SAVE_LDFLAGS="$LDFLAGS"
235 AC_MSG_CHECKING([for host c compiler])
236 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
237 if test -z "$HOST_CC"; then
238 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
240 AC_MSG_RESULT([$HOST_CC])
241 AC_MSG_CHECKING([for host c++ compiler])
242 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
243 if test -z "$HOST_CXX"; then
244 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
246 AC_MSG_RESULT([$HOST_CXX])
248 if test -z "$HOST_CFLAGS"; then
249 HOST_CFLAGS="$CFLAGS"
251 if test -z "$HOST_CXXFLAGS"; then
252 HOST_CXXFLAGS="$CXXFLAGS"
254 if test -z "$HOST_LDFLAGS"; then
255 HOST_LDFLAGS="$LDFLAGS"
257 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
258 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
260 CFLAGS="$HOST_CFLAGS"
261 LDFLAGS="$HOST_LDFLAGS"
263 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
264 AC_TRY_COMPILE([], [return(0);],
265 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
266 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
269 CFLAGS="$HOST_CXXFLAGS"
271 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
272 AC_TRY_COMPILE([], [return(0);],
273 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
274 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
278 LDFLAGS=$_SAVE_LDFLAGS
280 case "$build:$target" in
281 powerpc-apple-darwin8*:i?86-apple-darwin*)
282 dnl The Darwin cross compiler doesn't necessarily point itself at a
283 dnl root that has libraries for the proper architecture, it defaults
284 dnl to the system root. The libraries in the system root on current
285 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
286 dnl checks will fail. Fake a working SDK in that case.
288 _SAVE_CXXFLAGS=$CXXLAGS
289 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
290 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
294 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
297 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
301 case "$build:$target" in
302 powerpc-apple-darwin8*:i?86-apple-darwin*)
303 dnl Revert the changes made above. From this point on, the target
304 dnl compiler will never be used without applying the SDK to CFLAGS
305 dnl (see --with-macos-sdk below).
307 CXXFLAGS=$_SAVE_CXXFLAGS
311 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
312 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
313 AC_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
314 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
315 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
316 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
317 AC_DEFINE(CROSS_COMPILE)
322 AC_PATH_PROGS(AS, $AS as, $CC)
323 AC_CHECK_PROGS(AR, ar, :)
324 AC_CHECK_PROGS(LD, ld, :)
325 AC_CHECK_PROGS(STRIP, strip, :)
326 AC_CHECK_PROGS(WINDRES, windres, :)
327 if test -z "$HOST_CC"; then
330 if test -z "$HOST_CFLAGS"; then
331 HOST_CFLAGS="$CFLAGS"
333 if test -z "$HOST_CXX"; then
336 if test -z "$HOST_CXXFLAGS"; then
337 HOST_CXXFLAGS="$CXXFLAGS"
339 if test -z "$HOST_LDFLAGS"; then
340 HOST_LDFLAGS="$LDFLAGS"
342 if test -z "$HOST_RANLIB"; then
343 HOST_RANLIB="$RANLIB"
345 if test -z "$HOST_AR"; then
356 if test "$GCC" = "yes"; then
358 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
360 if test "$GXX" = "yes"; then
362 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
364 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
367 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
370 if test "$GNU_CC"; then
371 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
376 dnl Special win32 checks
377 dnl ========================================================
383 if test -n "$GNU_CC"; then
391 MOZ_ARG_WITH_STRING(windows-version,
392 [ --with-windows-version=WINVER
393 Minimum Windows version (WINVER) to support
404 AC_MSG_ERROR([Invalid value --with-windows-version, must be 400, 500 or 501]);
410 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
411 if test "$GCC" != "yes"; then
412 # Check to see if we are really running in a msvc environemnt
414 AC_CHECK_PROGS(MIDL, midl)
416 # Make sure compilers are valid
417 CFLAGS="$CFLAGS -TC -nologo"
418 CXXFLAGS="$CXXFLAGS -TP -nologo"
421 AC_TRY_COMPILE([#include <stdio.h>],
422 [ printf("Hello World\n"); ],,
423 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
426 AC_TRY_COMPILE([#include <new.h>],
427 [ unsigned *test = new unsigned(42); ],,
428 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
432 _MSVC_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
435 # Determine compiler version
436 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
437 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
438 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
439 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
441 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
442 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
444 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
445 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
447 if test "$_CC_MAJOR_VERSION" = "12"; then
449 elif test "$_CC_MAJOR_VERSION" = "13"; then
451 elif test "$_CC_MAJOR_VERSION" = "14"; then
453 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
454 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
455 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
456 elif test "$_CC_MAJOR_VERSION" = "15"; then
458 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
459 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
460 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
462 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
465 _MOZ_RTTI_FLAGS_ON='-GR'
466 _MOZ_RTTI_FLAGS_OFF='-GR-'
467 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
468 _MOZ_EXCEPTIONS_FLAGS_OFF=''
470 if test -n "$WIN32_REDIST_DIR"; then
471 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
475 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
476 if test "$_CC_SUITE" -ge "8"; then
478 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
481 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
482 if test -n "$MSMT_TOOL"; then
483 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
484 if test -z "$MSMANIFEST_TOOL_VERSION"; then
485 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
490 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
494 # Check linker version
495 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
496 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
497 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
498 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
503 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
504 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
505 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
506 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
507 # Add flags if necessary
508 AC_MSG_CHECKING([for midl flags])
509 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
510 # Starting with MIDL version 6.0.359, the MIDL compiler
511 # generates /Oicf /robust stubs by default, which is not
512 # compatible with versions of Windows older than Win2k.
513 # This switches us back to the old behaviour. When we drop
514 # support for Windows older than Win2k, we should remove
516 MIDL_FLAGS="${MIDL_FLAGS} -no_robust"
517 AC_MSG_RESULT([need -no_robust])
519 MIDL_FLAGS="${MIDL_FLAGS}"
520 AC_MSG_RESULT([none needed])
523 unset _MSVC_VER_FILTER
526 # Check w32api version
527 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
528 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
529 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
530 AC_TRY_COMPILE([#include <w32api.h>],
531 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
532 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
533 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
534 #error "test failed."
536 , [ res=yes ], [ res=no ])
537 AC_MSG_RESULT([$res])
538 if test "$res" != "yes"; then
539 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
541 # Check windres version
542 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
543 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
544 AC_MSG_RESULT([$_WINDRES_VERSION])
545 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
546 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
547 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
548 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
549 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
550 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
551 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
552 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
553 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
554 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
555 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
556 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
558 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
562 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
563 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
564 # Require OS features provided by IE 5.0
565 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
569 if test -n "$_WIN32_MSVC"; then
571 SKIP_COMPILER_CHECKS=1
572 SKIP_LIBRARY_CHECKS=1
573 AC_CHECK_HEADERS(mmintrin.h)
576 dnl Test breaks icc on OS/2 && MSVC
577 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
579 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
583 CC="${srcdir}/build/hcc '$CC'"
584 CXX="${srcdir}/build/hcpp '$CXX'"
591 fi # COMPILE_ENVIRONMENT
601 dnl ========================================================
602 dnl Checks for programs.
603 dnl ========================================================
606 AC_PATH_PROGS(PERL, $PERL perl5 perl )
607 if test -z "$PERL" || test "$PERL" = ":"; then
608 AC_MSG_ERROR([perl not found in \$PATH])
611 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
612 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
613 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
615 AC_MSG_RESULT([$_perl_version])
617 if test "$_perl_res" != 0; then
618 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
622 AC_MSG_CHECKING([for full perl installation])
623 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
625 if test "$_perl_res" != 0; then
627 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
632 AC_PATH_PROGS(PYTHON, $PYTHON python)
633 if test -z "$PYTHON"; then
634 AC_MSG_ERROR([python was not found in \$PATH])
636 echo PYTHON="$PYTHON"
638 AC_PATH_PROGS(NSINSTALL_BIN, nsinstall )
639 if test -z "$COMPILE_ENVIRONMENT"; then
640 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
641 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
644 AC_SUBST(NSINSTALL_BIN)
646 AC_PATH_PROG(DOXYGEN, doxygen, :)
647 AC_PATH_PROG(WHOAMI, whoami, :)
648 AC_PATH_PROG(AUTOCONF, autoconf, :)
649 AC_PATH_PROG(UNZIP, unzip, :)
650 AC_PATH_PROGS(ZIP, zip)
651 if test -z "$ZIP" || test "$ZIP" = ":"; then
652 AC_MSG_ERROR([zip not found in \$PATH])
654 AC_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
655 AC_PATH_PROG(XARGS, xargs)
656 if test -z "$XARGS" || test "$XARGS" = ":"; then
657 AC_MSG_ERROR([xargs not found in \$PATH .])
660 if test "$COMPILE_ENVIRONMENT"; then
662 dnl ========================================================
663 dnl = Mac OS X toolchain support
664 dnl ========================================================
668 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
669 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
670 dnl the environment and includedir purposes (when using an SDK, below),
671 dnl but remember the full version number for the libdir (SDK).
673 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
674 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
676 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
677 dnl Bug 280479, but this keeps popping up in bug 292530 too because
678 dnl 4.0.0/4061 is the default compiler in Tiger.
680 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
682 if test "$GCC_BUILD" = "4061" ; then
683 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
684 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
685 from building Mozilla. Upgrade to Xcode 2.1 or later.])
689 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
690 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
691 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
692 AC_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
697 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
699 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
705 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
706 dnl it has moved into /usr/bin.
707 AC_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
711 AC_SUBST(GCC_VERSION)
712 AC_SUBST(XCODEBUILD_VERSION)
713 AC_SUBST(HAS_XCODE_2_1)
715 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
716 dnl that a universal binary is being produced.
717 AC_SUBST(UNIVERSAL_BINARY)
719 dnl ========================================================
720 dnl Check for MacOS deployment target version
721 dnl ========================================================
723 MOZ_ARG_ENABLE_STRING(macos-target,
724 [ --enable-macos-target=VER (default=10.4)
725 Set the minimum MacOS version needed at runtime],
726 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
730 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
731 dnl Use the specified value
732 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
733 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
734 dnl No value specified on the command line or in the environment,
735 dnl use the lesser of the application's minimum or the architecture's
737 export MACOSX_DEPLOYMENT_TARGET=10.4
742 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
744 dnl ========================================================
745 dnl = Mac OS X SDK support
746 dnl ========================================================
749 MOZ_ARG_WITH_STRING(macos-sdk,
750 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
751 MACOS_SDK_DIR=$withval)
753 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
754 dnl NEXT_ROOT will be set and exported only if it's needed.
755 AC_SUBST(MACOS_SDK_DIR)
758 if test "$MACOS_SDK_DIR"; then
759 dnl Sync this section with the ones in NSPR and NSS.
760 dnl Changes to the cross environment here need to be accounted for in
761 dnl the libIDL checks (below) and xpidl build.
763 if test ! -d "$MACOS_SDK_DIR"; then
764 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
765 specify a valid SDK. SDKs are installed when the optional cross-development
766 tools are selected during the Xcode/Developer Tools installation.])
769 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
770 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
771 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"
772 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
773 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
775 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"
777 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
778 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
780 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
781 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
782 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
784 dnl ld support for -syslibroot is compiler-agnostic, but only available
785 dnl on Tiger. Although it's possible to switch on the build host's
786 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
787 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
788 dnl set because both the compiler and linker use it.
789 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"
790 export NEXT_ROOT=$MACOS_SDK_DIR
792 if test -n "$CROSS_COMPILE" ; then
793 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
794 dnl the build host. HOST_CXX is presently unused.
795 HOST_CC="NEXT_ROOT= $HOST_CC"
796 HOST_CXX="NEXT_ROOT= $HOST_CXX"
799 dnl gcc >= 4.0 uses different paths than above, but knows how to find
801 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
802 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
804 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
805 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
806 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
808 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
809 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
810 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
811 dnl be ignored and cause warnings when -syslibroot is specified.
812 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
813 dnl the -isysroot it receives, so this is only needed with 4.0.0.
814 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
819 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
821 AC_TRY_COMPILE([#include <new>
822 int main() { return 0; }],
826 AC_MSG_RESULT($result)
828 if test "$result" = "no" ; then
829 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
833 fi # COMPILE_ENVIRONMENT
835 dnl Be sure the make we use is GNU make.
836 dnl on win32, gmake.exe is the generally the wrong version
838 cygwin*|mingw*|mks*|msvc*)
839 AC_PATH_PROGS(MAKE, $MAKE make gmake, :)
842 AC_PATH_PROGS(MAKE, $MAKE gmake make, :)
845 _make_try=`$MAKE --version 2>/dev/null | grep GNU`
846 if test ! "$_make_try"
849 echo "*** $MAKE is not GNU Make. You will not be able to build Mozilla without GNU Make."
853 dnl Now exit if version if < MAKE_VERSION
855 echo 'all: ; @echo $(MAKE_VERSION)' > dummy.mk
856 _make_vers=`$MAKE --no-print-directory -f dummy.mk all 2>/dev/null`
858 _MAKE_MAJOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $1 }'`
859 _MAKE_MINOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $2 }'`
860 MAKE_MAJOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $1 }'`
861 MAKE_MINOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $2 }'`
862 if test "$_MAKE_MAJOR_VERSION" -lt "$MAKE_MAJOR_VERSION" || \
863 test "$_MAKE_MAJOR_VERSION" = "$MAKE_MAJOR_VERSION" -a \
864 "$_MAKE_MINOR_VERSION" -lt "$MAKE_MINOR_VERSION"; then
865 AC_MSG_ERROR([GNU Make $MAKE_VERSION or higher is required to build Mozilla.])
869 if test "$COMPILE_ENVIRONMENT"; then
873 dnl Check in X11 include directory too.
874 if test "$no_x" != "yes"; then
875 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
880 fi # COMPILE_ENVIRONMENT
882 dnl ========================================================
883 dnl set the defaults first
884 dnl ========================================================
903 MOZ_USER_DIR=".mozilla"
905 HOST_AR_FLAGS='$(AR_FLAGS)'
908 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
910 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
912 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
914 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
915 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
916 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin'
917 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
918 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
919 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
920 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
922 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
923 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
927 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
928 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
930 MOZ_ENABLE_POSTSCRIPT=1
932 if test -n "$CROSS_COMPILE"; then
933 OS_TARGET="${target_os}"
934 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
936 case "${target_os}" in
937 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
938 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
939 mingw*) OS_ARCH=WINNT ;;
940 wince*) OS_ARCH=WINCE ;;
941 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
945 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
946 OS_RELEASE=`uname -r`
949 # Before this used `uname -m` when not cross compiling
950 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
951 OS_TEST="${target_cpu}"
955 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
957 #######################################################################
958 # Master "Core Components" macros for getting the OS target #
959 #######################################################################
962 # Note: OS_TARGET should be specified on the command line for gmake.
963 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
964 # The difference between the Win95 target and the WinNT target is that
965 # the WinNT target uses Windows NT specific features not available
966 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
967 # at lesser performance (the Win95 target uses threads; the WinNT target
970 # When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
971 # is built. See: win16_3.11.mk for lots more about the Win16 target.
973 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
978 # The following hack allows one to build on a WIN95 machine (as if
979 # s/he were cross-compiling on a WINNT host for a WIN95 target).
980 # It also accomodates for MKS's uname.exe. If you never intend
981 # to do development on a WIN95 machine, you don't need this hack.
996 CYGWIN_9*|CYGWIN_ME*)
997 OS_ARCH='CYGWIN_NT-4.0'
1003 # Define and override various archtecture-specific variables, including
1012 case "$HOST_OS_ARCH" in
1013 cygwin*|mingw*|mks*|msvc*)
1032 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1035 HOST_OS_ARCH=UNIXWARE
1047 HOST_OS_ARCH=OpenVMS
1057 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1061 HOST_OS_ARCH=UNIXWARE
1071 # If uname -s returns "Windows_NT", we assume that we are using
1072 # the uname.exe in MKS toolkit.
1074 # The -r option of MKS uname only returns the major version number.
1075 # So we need to use its -v option to get the minor version number.
1076 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1080 OS_MINOR_RELEASE=`uname -v`
1081 if test "$OS_MINOR_RELEASE" = "00"; then
1084 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1086 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1088 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1089 # the uname.exe in the Cygwin tools.
1090 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1091 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1092 # the uname.exe in the GNU-Win32 tools.
1093 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1094 # the uname.exe in the MSYS tools.
1096 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1101 OS_RELEASE=`uname -v`.`uname -r`
1114 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1118 OS_RELEASE=`uname -v`
1142 OS_RELEASE=`uname -v`
1148 OS_RELEASE=`uname -v`
1151 if test "$OS_TARGET" != "NTO"; then
1153 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1162 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1168 OS_RELEASE=`uname -v`
1175 case "${target_cpu}" in
1183 if test -z "$CROSS_COMPILE" ; then
1191 if test "$OS_ARCH" = "NCR"; then
1193 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1197 # Only set CPU_ARCH if we recognize the value of OS_TEST
1208 Alpha | alpha | ALPHA)
1216 x86_64 | sparc | ppc | ia64)
1221 if test -z "$OS_TARGET"; then
1224 if test "$OS_TARGET" = "WIN95"; then
1227 if test "$OS_TARGET" = "WIN16"; then
1230 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1232 dnl ========================================================
1233 dnl GNU specific defaults
1234 dnl ========================================================
1235 if test "$GNU_CC"; then
1236 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1237 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1238 DSO_LDOPTS='-shared'
1239 if test "$GCC_USE_GNU_LD"; then
1240 # Don't allow undefined symbols in libraries
1241 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1243 WARNINGS_AS_ERRORS='-Werror'
1245 DSO_PIC_CFLAGS='-fPIC'
1246 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1247 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1248 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1249 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1251 # Turn on GNU specific features
1252 # -Wall - turn on all warnings
1253 # -pedantic - make compiler warn about non-ANSI stuff, and
1254 # be a little bit stricter
1255 # Warnings slamm took out for now (these were giving more noise than help):
1256 # -Wbad-function-cast - warns when casting a function to a new return type
1257 # -Wconversion - complained when char's or short's were used a function args
1258 # -Wshadow - removed because it generates more noise than help --pete
1259 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith -Wcast-align"
1261 dnl Turn pedantic on but disable the warnings for long long
1263 _IGNORE_LONG_LONG_WARNINGS=1
1265 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1266 _USE_CPP_INCLUDE_FLAG=1
1268 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1269 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1271 DSO_LDOPTS='-shared'
1272 if test "$GNU_LD"; then
1273 # Don't allow undefined symbols in libraries
1274 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1278 DSO_PIC_CFLAGS='-KPIC'
1279 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1282 if test "$GNU_CXX"; then
1283 # Turn on GNU specific features
1284 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1286 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1287 _USE_CPP_INCLUDE_FLAG=1
1289 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1292 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1293 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1294 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1295 dnl normal behavior.
1296 dnl ========================================================
1298 MKSHLIB_UNFORCE_ALL=
1300 if test "$COMPILE_ENVIRONMENT"; then
1301 if test "$GNU_CC"; then
1302 AC_MSG_CHECKING(whether ld has archive extraction flags)
1303 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1304 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1305 ac_cv_mkshlib_force_and_unforce="no"
1306 exec 3<&0 <<LOOP_INPUT
1307 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1308 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1309 force="-Wl,-all"; unforce="-Wl,-none"
1316 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1319 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1321 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1325 eval $ac_cv_mkshlib_force_and_unforce
1326 MKSHLIB_FORCE_ALL=$force
1327 MKSHLIB_UNFORCE_ALL=$unforce
1330 fi # COMPILE_ENVIRONMENT
1332 dnl =================================================================
1333 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1334 dnl which is bad when cross compiling.
1335 dnl =================================================================
1336 if test "$COMPILE_ENVIRONMENT"; then
1337 configure_static_assert_macros='
1338 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1339 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1340 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1343 dnl test that the macros actually work:
1344 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1345 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1348 ac_cv_static_assertion_macros_work="yes"
1349 AC_TRY_COMPILE([$configure_static_assert_macros],
1350 [CONFIGURE_STATIC_ASSERT(1)],
1352 ac_cv_static_assertion_macros_work="no")
1353 AC_TRY_COMPILE([$configure_static_assert_macros],
1354 [CONFIGURE_STATIC_ASSERT(0)],
1355 ac_cv_static_assertion_macros_work="no",
1358 AC_TRY_COMPILE([$configure_static_assert_macros],
1359 [CONFIGURE_STATIC_ASSERT(1)],
1361 ac_cv_static_assertion_macros_work="no")
1362 AC_TRY_COMPILE([$configure_static_assert_macros],
1363 [CONFIGURE_STATIC_ASSERT(0)],
1364 ac_cv_static_assertion_macros_work="no",
1368 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1369 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1370 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1373 fi # COMPILE_ENVIRONMENT
1375 dnl ========================================================
1376 dnl Checking for 64-bit OS
1377 dnl ========================================================
1378 if test "$COMPILE_ENVIRONMENT"; then
1381 AC_MSG_CHECKING(for 64-bit OS)
1382 AC_TRY_COMPILE([$configure_static_assert_macros],
1383 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1384 result="yes", result="no")
1385 AC_MSG_RESULT("$result")
1386 if test "$result" = "yes"; then
1387 AC_DEFINE(HAVE_64BIT_OS)
1390 AC_SUBST(HAVE_64BIT_OS)
1392 fi # COMPILE_ENVIRONMENT
1394 dnl ========================================================
1395 dnl Enable high-memory support on OS/2, disabled by default
1396 dnl ========================================================
1397 MOZ_ARG_ENABLE_BOOL(os2-high-mem,
1398 [ --enable-os2-high-mem Enable high-memory support on OS/2],
1399 MOZ_OS2_HIGH_MEMORY=1,
1400 MOZ_OS2_HIGH_MEMORY= )
1401 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1403 dnl ========================================================
1404 dnl System overrides of the defaults for host
1405 dnl ========================================================
1408 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1409 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1410 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1413 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1414 if test -n "$_WIN32_MSVC"; then
1416 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1417 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1418 HOST_RANLIB='echo ranlib'
1420 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1422 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1423 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1424 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1425 HOST_BIN_SUFFIX=.exe
1428 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1431 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1432 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1434 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1436 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1438 PERL="${CYGWIN_WRAPPER} $PERL"
1441 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1442 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1449 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1450 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1451 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1452 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1453 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
1457 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1458 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1459 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1463 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1464 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1465 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1466 HOST_BIN_SUFFIX=.exe
1471 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1472 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1473 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1477 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1478 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1482 dnl Get mozilla version from central milestone file
1483 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1485 dnl Get version of various core apps from the version files.
1486 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1487 THUNDERBIRD_VERSION=`cat $topsrcdir/mail/config/version.txt`
1488 SUNBIRD_VERSION=`cat $topsrcdir/calendar/sunbird/config/version.txt`
1489 SEAMONKEY_VERSION=`cat $topsrcdir/suite/config/version.txt`
1491 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1492 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1494 dnl ========================================================
1495 dnl System overrides of the defaults for target
1496 dnl ========================================================
1501 if test ! "$GNU_CC"; then
1502 if test ! "$HAVE_64BIT_OS"; then
1503 # Compiling with Visual Age C++ object model compat is the
1504 # default. To compile with object model ibm, add
1505 # AIX_OBJMODEL=ibm to .mozconfig.
1506 if test "$AIX_OBJMODEL" = "ibm"; then
1507 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1514 AC_SUBST(AIX_OBJMODEL)
1515 DSO_LDOPTS='-qmkshrobj=1'
1516 DSO_CFLAGS='-qflag=w:w'
1518 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1519 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1521 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1522 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1523 if test "$COMPILE_ENVIRONMENT"; then
1526 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 5.0.2.0])
1528 [#if (__IBMCPP__ < 502)
1529 #error "Bad compiler"
1531 _BAD_COMPILER=,_BAD_COMPILER=1)
1532 if test -n "$_BAD_COMPILER"; then
1534 AC_MSG_ERROR([VisualAge C++ version 5.0.2.0 or higher is required to build.])
1536 AC_MSG_RESULT([yes])
1539 TARGET_COMPILER_ABI="ibmc"
1540 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1541 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1544 case "${target_os}" in
1549 if test "$COMPILE_ENVIRONMENT"; then
1550 AC_CHECK_HEADERS(sys/inttypes.h)
1552 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1557 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1558 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1559 DSO_LDOPTS='-nostart'
1560 TK_LIBS='-lbe -lroot'
1562 if test "$COMPILE_ENVIRONMENT"; then
1563 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1564 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1566 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1567 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1570 MOZ_USER_DIR="Mozilla"
1574 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1576 _IGNORE_LONG_LONG_WARNINGS=
1584 _WARNINGS_CFLAGS="-Wall"
1585 _WARNINGS_CXXFLAGS="-Wall"
1586 # The test above doesn't work properly, at least on 3.1.
1587 MKSHLIB_FORCE_ALL=''
1588 MKSHLIB_UNFORCE_ALL=''
1594 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1595 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1598 CFLAGS="$CFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
1599 CXXFLAGS="$CXXFLAGS -fpascal-strings -no-cpp-precomp -fno-common"
1602 STRIP="$STRIP -x -S"
1603 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1604 MOZ_ENABLE_POSTSCRIPT=
1605 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1606 # set MACOSX to generate lib/mac/MoreFiles/Makefile
1609 dnl check for the presence of the -dead_strip linker flag
1610 AC_MSG_CHECKING([for -dead_strip option to ld])
1611 _SAVE_LDFLAGS=$LDFLAGS
1612 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1613 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1614 if test -n "$_HAVE_DEAD_STRIP" ; then
1615 AC_MSG_RESULT([yes])
1616 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1620 LDFLAGS=$_SAVE_LDFLAGS
1624 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` != "elf"; then
1625 DLL_SUFFIX=".so.1.0"
1626 DSO_LDOPTS="-shared"
1628 if test ! "$GNU_CC"; then
1629 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1631 # Can't have force w/o an unforce.
1632 # # Hack for FreeBSD 2.2
1633 # if test -z "$MKSHLIB_FORCE_ALL"; then
1634 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1635 # MKSHLIB_UNFORCE_ALL=''
1641 if test ! "$GNU_CC"; then
1642 DSO_LDOPTS='-b -Wl,+s'
1645 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1646 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1647 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1649 DSO_LDOPTS='-b -E +s'
1650 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1651 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1653 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1654 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1659 DSO_LDOPTS='-elf -shared'
1661 if test "$GNU_CC"; then
1662 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1663 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1664 MKSHLIB_FORCE_ALL='-Wl,-all'
1665 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1666 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1668 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1669 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1670 MKSHLIB_FORCE_ALL='-all'
1671 MKSHLIB_UNFORCE_ALL='-none'
1677 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1678 dnl compile and link using -n32
1680 TARGET_COMPILER_ABI=n32
1681 DSO_LDOPTS='-elf -shared'
1682 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1683 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1684 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1685 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1686 if test "$GNU_CC"; then
1687 MKSHLIB_FORCE_ALL='-Wl,-all'
1688 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1689 _WARNINGS_CFLAGS="-Wall"
1690 _WARNINGS_CXXFLAGS="-Wall"
1691 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1693 MKSHLIB_FORCE_ALL='-all'
1694 MKSHLIB_UNFORCE_ALL='-none'
1700 CFLAGS="$CFLAGS -woff 3262 -G 4"
1701 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1702 if test -n "$USE_N32"; then
1703 ASFLAGS="$ASFLAGS -n32"
1704 CFLAGS="$CFLAGS -n32"
1705 CXXFLAGS="$CXXFLAGS -n32"
1706 LDFLAGS="$LDFLAGS -n32"
1708 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1709 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1712 if test -z "$GNU_CXX"; then
1718 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1719 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1720 # and that combo is not yet good at
1721 # debugging inlined functions (even
1722 # when using DWARF2 as the debugging
1725 case "${target_cpu}" in
1727 CFLAGS="$CFLAGS -mieee"
1728 CXXFLAGS="$CXXFLAGS -mieee"
1732 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1735 CFLAGS="$CFLAGS -Wa,-xgot"
1736 CXXFLAGS="$CXXFLAGS -Wa,-xgot"
1743 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1745 AR_EXTRACT="$AR -extract"
1747 AR_FLAGS='-OUT:"$@"'
1754 # certain versions of cygwin's makedepend barf on the
1755 # #include <string> vs -I./dist/include/string issue so don't use it
1761 HOST_AR='lib -OUT:$@'
1762 HOST_RANLIB='echo ranlib'
1764 WARNINGS_AS_ERRORS='-WX'
1765 MOZ_OPTIMIZE_FLAGS='-O1'
1766 AR_FLAGS='-NOLOGO -OUT:"$@"'
1768 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1769 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1772 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
1773 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1775 IMPORT_LIB_SUFFIX=lib
1777 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1780 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1781 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1783 MKSHLIB_UNFORCE_ALL=
1784 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1785 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1786 MOZ_DEBUG_FLAGS='-Zi'
1787 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1789 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1790 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1792 RANLIB='echo not_ranlib'
1793 STRIP='echo not_strip'
1794 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
1797 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1799 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
1800 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
1803 AC_DEFINE(HAVE_SNPRINTF)
1809 AC_DEFINE(HW_THREADS)
1810 AC_DEFINE(STDC_HEADERS)
1811 AC_DEFINE(NEW_H, <new>)
1812 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1814 TARGET_MD_ARCH=win32
1815 _PLATFORM_DEFAULT_TOOLKIT='windows'
1818 MOZ_ENABLE_COREXFONTS=
1819 MOZ_ENABLE_POSTSCRIPT=
1820 MOZ_USER_DIR="Mozilla"
1824 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1829 # certain versions of cygwin's makedepend barf on the
1830 # #include <string> vs -I./dist/include/string issue so don't use it
1832 if test -n "$GNU_CC"; then
1833 CC="$CC -mno-cygwin"
1834 CXX="$CXX -mno-cygwin"
1835 CPP="$CPP -mno-cygwin"
1836 CFLAGS="$CFLAGS -mms-bitfields"
1837 CXXFLAGS="$CXXFLAGS -mms-bitfields"
1838 DSO_LDOPTS='-shared'
1839 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1840 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1842 # Use temp file for windres (bug 213281)
1843 RCFLAGS='-O coff --use-temp-file'
1844 # mingw doesn't require kernel32, user32, and advapi32 explicitly
1845 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
1846 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
1848 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
1849 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
1851 IMPORT_LIB_SUFFIX=dll.a
1853 TARGET_COMPILER_ABI=msvc
1857 AR='lib -NOLOGO -OUT:"$@"'
1859 RANLIB='echo not_ranlib'
1860 STRIP='echo not_strip'
1865 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1870 IMPORT_LIB_SUFFIX=lib
1871 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1872 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1874 MKSHLIB_UNFORCE_ALL=
1875 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
1876 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1877 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1878 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
1879 MOZ_DEBUG_FLAGS='-Zi'
1880 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1881 WARNINGS_AS_ERRORS='-WX'
1882 MOZ_OPTIMIZE_FLAGS='-O1'
1883 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1885 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1886 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1887 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1888 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1889 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1890 if test $_MSC_VER -ge 1400; then
1891 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
1894 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
1895 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
1896 AC_DEFINE(HAVE_SNPRINTF)
1902 AC_DEFINE(HW_THREADS)
1903 AC_DEFINE(STDC_HEADERS)
1904 AC_DEFINE(NEW_H, <new>)
1905 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1906 TARGET_MD_ARCH=win32
1907 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
1910 MOZ_ENABLE_POSTSCRIPT=
1911 MOZ_USER_DIR="Mozilla"
1913 dnl Hardcode to win95 for now - cls
1914 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
1916 dnl set NO_X11 defines here as the general check is skipped on win32
1920 dnl MinGW/MSYS doesn't provide or need cygpath
1925 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
1927 *-cygwin*|*-msvc*|*-mks*)
1928 CYGPATH_W="cygpath -a -w"
1929 CYGPATH_S="sed -e s|\\\\|/|g"
1930 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
1934 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1936 if test -z "$MOZ_TOOLS"; then
1937 AC_MSG_ERROR([MOZ_TOOLS is not set])
1940 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
1941 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
1942 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
1944 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
1945 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
1947 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
1949 if test -n "$GLIB_PREFIX"; then
1950 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
1951 if test "$?" = "0"; then
1952 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
1953 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
1955 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
1957 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
1960 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
1962 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
1963 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
1965 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
1966 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
1967 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
1968 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
1969 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
1971 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
1974 if test -n "$LIBIDL_PREFIX"; then
1975 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
1976 if test "$?" = "0"; then
1977 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
1978 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
1980 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
1982 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
1985 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
1987 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
1988 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
1990 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
1991 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
1992 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
1994 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
1995 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
1997 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
1999 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2002 *) # else cross-compiling
2003 if test -n "$GLIB_PREFIX"; then
2004 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2005 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2006 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2007 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2008 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2010 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2013 if test -n "$LIBIDL_PREFIX"; then
2014 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2015 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2016 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2018 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2019 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2021 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2024 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2039 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2046 CFLAGS="$CFLAGS -Dunix"
2047 CXXFLAGS="$CXXFLAGS -Dunix"
2048 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2050 DSO_PIC_CFLAGS='-fPIC -DPIC'
2051 DSO_LDOPTS='-shared'
2052 BIN_FLAGS='-Wl,--export-dynamic'
2054 DSO_PIC_CFLAGS='-fPIC -DPIC'
2055 DLL_SUFFIX=".so.1.0"
2056 DSO_LDOPTS='-shared'
2058 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2059 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2060 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2061 if test "$LIBRUNPATH"; then
2062 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2064 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2065 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2070 AC_DEFINE(_QNX_SOURCE)
2073 WARNINGS_AS_ERRORS=''
2074 MOZ_OPTIMIZE_FLAGS="-O"
2075 MOZ_DEBUG_FLAGS="-gstabs"
2078 LIBS="$LIBS -lsocket -lstdc++"
2079 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2080 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2081 if test "$with_x" != "yes"
2083 _PLATFORM_DEFAULT_TOOLKIT="photon"
2084 TK_CFLAGS='-I/usr/include/photon'
2087 case "${target_cpu}" in
2089 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2092 case "${host_cpu}" in
2100 DLL_SUFFIX=".so.1.0"
2102 DSO_PIC_CFLAGS='-fPIC'
2103 DSO_LDOPTS='-shared -fPIC'
2104 if test "$LIBRUNPATH"; then
2105 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2110 AC_DEFINE(NO_PW_GECOS)
2111 AC_DEFINE(NO_UDSOCK)
2112 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2114 MKSHLIB_FORCE_ALL='-all'
2115 MKSHLIB_UNFORCE_ALL='-none'
2117 AS_DASH_C_FLAG='-Wc/names=as_is'
2119 DSO_LDOPTS='-shared -auto_symvec'
2121 MOZ_DEBUG_LDFLAGS='-g'
2123 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2124 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2129 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2130 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2138 IMPORT_LIB_SUFFIX=lib
2141 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2142 MOZ_ENABLE_POSTSCRIPT=
2145 MOZ_USER_DIR="Mozilla"
2147 if test "$MOZTOOLS"; then
2148 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2150 AC_MSG_ERROR([MOZTOOLS is not set])
2154 if test -n "$GNU_CC"; then
2156 AC_DEFINE(XP_OS2_EMX)
2157 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2158 AC_DEFINE(TCPV40HDRS)
2161 CFLAGS="$CFLAGS -Zomf"
2162 CXXFLAGS="$CXXFLAGS -Zomf"
2164 BIN_FLAGS='-Zlinker /ST:0x100000'
2168 WARNINGS_AS_ERRORS='-Werror'
2169 MOZ_DEBUG_FLAGS="-g -fno-inline"
2170 MOZ_OPTIMIZE_FLAGS="-O2 -s"
2171 MOZ_OPTIMIZE_LDFLAGS="-Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2172 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2173 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2174 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2175 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2176 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2177 LDFLAGS="$LDFLAGS -Zhigh-mem"
2178 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2179 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2182 # GCC for OS/2 currently predefines these, but we don't want them
2183 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2184 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2186 AC_CACHE_CHECK(for __declspec(dllexport),
2188 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2190 ac_os2_declspec="yes",
2191 ac_os2_declspec="no")])
2192 if test "$ac_os2_declspec" = "yes"; then
2194 MOZ_OS2_USE_DECLSPEC='1'
2197 # Visual Age C++ build
2198 elif test "$VACPP" = "yes"; then
2199 MOZ_BUILD_ROOT=`pwd -D`
2202 AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
2211 CFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9"
2212 CXXFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9 /Gx+"
2213 MOZ_DEBUG_FLAGS="/Ti+"
2214 WARNINGS_AS_ERRORS='-WX'
2215 MOZ_OPTIMIZE_FLAGS="/O+ /Gl+ /G5 /qarch=pentium"
2217 MOZ_DEBUG_LDFLAGS="/DE"
2218 MOZ_OPTIMIZE_LDFLAGS="/OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
2221 IMPLIB='implib /NOL /NOI'
2222 FILTER='cppfilt -q -B -P'
2223 AC_DEFINE(NO_ANSI_KEYWORDS)
2226 AC_DEFINE(XP_OS2_VACPP)
2227 AC_DEFINE(TCPV40HDRS)
2228 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2229 AC_DEFINE(STDC_HEADERS)
2230 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2231 MKSHLIB='$(LD) $(DSO_LDOPTS)'
2232 MKCSHLIB='$(LD) $(DSO_LDOPTS)'
2233 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
2234 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcomct.lib'
2235 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2236 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2241 if test "$GNU_CC"; then
2242 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2243 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2246 MOZ_DEBUG_FLAGS='-g'
2247 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2248 CFLAGS="$CFLAGS -ieee"
2249 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2250 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2253 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2254 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2255 MKSHLIB_FORCE_ALL='-all'
2256 MKSHLIB_UNFORCE_ALL='-none'
2257 dnl Might fix the libxpcom.so breakage on this platform as well....
2258 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2259 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2261 if test -z "$GNU_CXX"; then
2264 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2268 DIRENT_INO=d_stat.st_ino
2269 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2270 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2271 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2272 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2273 AC_DEFINE(STDC_HEADERS)
2274 if test "$no_x" = "yes"; then
2275 _PLATFORM_DEFAULT_TOOLKIT='photon'
2276 TK_CFLAGS='-I/usr/nto/include/photon'
2277 TK_LIBS='-lphoton -lphrender'
2282 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2283 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2284 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2285 if test ! "$GNU_CC"; then
2290 dnl the qsort routine under solaris is faulty
2293 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2295 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2296 # libraries one level up (e.g. libnspr4.so)
2297 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2298 if test -z "$GNU_CC"; then
2300 MOZ_FIX_LINK_PATHS='-R $(LIBXUL_DIST)/bin'
2301 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2302 CFLAGS="$CFLAGS -xstrconst -xbuiltin=%all"
2303 CXXFLAGS="$CXXFLAGS -xbuiltin=%all -features=tmplife -norunpath"
2304 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2305 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2306 _SAVE_LDFLAGS=$LDFLAGS
2307 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2308 AC_TRY_LINK([#include <stdio.h>],
2309 [printf("Hello World\n");],
2311 [LDFLAGS=$_SAVE_LDFLAGS])
2313 WARNINGS_AS_ERRORS='-Werror'
2314 MOZ_OPTIMIZE_FLAGS="-xO4"
2315 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2316 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2317 MKSHLIB_FORCE_ALL='-z allextract'
2318 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2319 DSO_LDOPTS='-G -z muldefs'
2325 AS='/usr/ccs/bin/as'
2326 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2328 TARGET_COMPILER_ABI="sunc"
2329 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2330 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2331 AC_MSG_CHECKING([for Forte compiler version >= WS6U2])
2335 [#if (__SUNPRO_CC < 0x530)
2338 _BAD_COMPILER=,_BAD_COMPILER=1)
2339 if test -n "$_BAD_COMPILER"; then
2341 AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .])
2345 AC_MSG_RESULT([$_res])
2348 ASFLAGS="$ASFLAGS -fPIC"
2351 _WARNINGS_CXXFLAGS=''
2352 if test "$OS_RELEASE" = "5.3"; then
2353 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2356 if test "$OS_RELEASE" = "5.5.1"; then
2357 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2362 DSO_LDOPTS='-Bdynamic'
2363 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2364 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2366 AC_DEFINE(SPRINTF_RETURNS_STRING)
2367 case "$(target_os)" in
2369 DLL_SUFFIX='.so.1.0'
2375 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2379 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2384 dnl Only one oddball right now (QNX), but this gives us flexibility
2385 dnl if any other platforms need to override this in the future.
2386 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2388 dnl ========================================================
2389 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2390 dnl by now will not have any way to link most binaries (tests
2391 dnl as well as viewer, apprunner, etc.), because some symbols
2392 dnl will be left out of the "composite" .so's by ld as unneeded.
2393 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2394 dnl they can link in the static libs that provide the missing
2396 dnl ========================================================
2397 NO_LD_ARCHIVE_FLAGS=
2398 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2399 NO_LD_ARCHIVE_FLAGS=1
2403 NO_LD_ARCHIVE_FLAGS=
2406 NO_LD_ARCHIVE_FLAGS=
2409 NO_LD_ARCHIVE_FLAGS=
2411 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2412 if test -z "$GNU_CC"; then
2413 NO_LD_ARCHIVE_FLAGS=
2417 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2420 dnl Indicate that platform requires special thread safe
2421 dnl locking when starting up the OJI JVM
2422 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2423 dnl ========================================================
2426 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2430 dnl ========================================================
2431 dnl = Flags to strip unused symbols from .so components
2432 dnl ========================================================
2435 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2438 if test -z "$GNU_CC"; then
2439 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2441 if test -z "$GCC_USE_GNU_LD"; then
2442 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2444 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2449 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2452 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2454 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2455 if test -n "$GNU_CC"; then
2456 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2461 if test -z "$COMPILE_ENVIRONMENT"; then
2462 SKIP_COMPILER_CHECKS=1
2463 SKIP_LIBRARY_CHECKS=1
2466 if test -z "$SKIP_COMPILER_CHECKS"; then
2467 dnl Checks for typedefs, structures, and compiler characteristics.
2468 dnl ========================================================
2476 AC_STRUCT_ST_BLKSIZE
2477 AC_MSG_CHECKING(for siginfo_t)
2478 AC_CACHE_VAL(ac_cv_siginfo_t,
2479 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2480 #include <signal.h>],
2482 [ac_cv_siginfo_t=true],
2483 [ac_cv_siginfo_t=false])])
2484 if test "$ac_cv_siginfo_t" = true ; then
2485 AC_DEFINE(HAVE_SIGINFO_T)
2491 dnl Visual Age for os/2 also defines size_t and off_t in certain
2492 dnl header files. These defines make Visual Age use the mozilla
2494 if test "$VACPP" = "yes"; then
2499 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2500 dnl ========================================================
2501 AC_MSG_CHECKING(for int16_t)
2502 AC_CACHE_VAL(ac_cv_int16_t,
2503 [AC_TRY_COMPILE([#include <stdio.h>
2504 #include <sys/types.h>],
2506 [ac_cv_int16_t=true],
2507 [ac_cv_int16_t=false])])
2508 if test "$ac_cv_int16_t" = true ; then
2509 AC_DEFINE(HAVE_INT16_T)
2514 AC_MSG_CHECKING(for int32_t)
2515 AC_CACHE_VAL(ac_cv_int32_t,
2516 [AC_TRY_COMPILE([#include <stdio.h>
2517 #include <sys/types.h>],
2519 [ac_cv_int32_t=true],
2520 [ac_cv_int32_t=false])])
2521 if test "$ac_cv_int32_t" = true ; then
2522 AC_DEFINE(HAVE_INT32_T)
2527 AC_MSG_CHECKING(for int64_t)
2528 AC_CACHE_VAL(ac_cv_int64_t,
2529 [AC_TRY_COMPILE([#include <stdio.h>
2530 #include <sys/types.h>],
2532 [ac_cv_int64_t=true],
2533 [ac_cv_int64_t=false])])
2534 if test "$ac_cv_int64_t" = true ; then
2535 AC_DEFINE(HAVE_INT64_T)
2540 AC_MSG_CHECKING(for int64)
2541 AC_CACHE_VAL(ac_cv_int64,
2542 [AC_TRY_COMPILE([#include <stdio.h>
2543 #include <sys/types.h>],
2546 [ac_cv_int64=false])])
2547 if test "$ac_cv_int64" = true ; then
2548 AC_DEFINE(HAVE_INT64)
2553 AC_MSG_CHECKING(for uint)
2554 AC_CACHE_VAL(ac_cv_uint,
2555 [AC_TRY_COMPILE([#include <stdio.h>
2556 #include <sys/types.h>],
2559 [ac_cv_uint=false])])
2560 if test "$ac_cv_uint" = true ; then
2561 AC_DEFINE(HAVE_UINT)
2566 AC_MSG_CHECKING(for uint_t)
2567 AC_CACHE_VAL(ac_cv_uint_t,
2568 [AC_TRY_COMPILE([#include <stdio.h>
2569 #include <sys/types.h>],
2571 [ac_cv_uint_t=true],
2572 [ac_cv_uint_t=false])])
2573 if test "$ac_cv_uint_t" = true ; then
2574 AC_DEFINE(HAVE_UINT_T)
2579 AC_MSG_CHECKING(for uint16_t)
2580 AC_CACHE_VAL(ac_cv_uint16_t,
2581 [AC_TRY_COMPILE([#include <stdio.h>
2582 #include <sys/types.h>],
2583 [uint16_t foo = 0;],
2584 [ac_cv_uint16_t=true],
2585 [ac_cv_uint16_t=false])])
2586 if test "$ac_cv_uint16_t" = true ; then
2587 AC_DEFINE(HAVE_UINT16_T)
2593 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2594 dnl are defined when compiling C++ but not C. Since the result of this
2595 dnl test is used only in C++, do it in C++.
2598 AC_MSG_CHECKING(for uname.domainname)
2599 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2600 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2601 [ struct utsname *res; char *domain;
2602 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2603 [ac_cv_have_uname_domainname_field=true],
2604 [ac_cv_have_uname_domainname_field=false])])
2606 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2607 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2613 AC_MSG_CHECKING(for uname.__domainname)
2614 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2615 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2616 [ struct utsname *res; char *domain;
2617 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2618 [ac_cv_have_uname_us_domainname_field=true],
2619 [ac_cv_have_uname_us_domainname_field=false])])
2621 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2622 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2630 dnl Check for usable wchar_t (2 bytes, unsigned)
2631 dnl (we really don't need the unsignedness check anymore)
2632 dnl ========================================================
2634 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2635 ac_cv_have_usable_wchar_v2,
2636 [AC_TRY_COMPILE([#include <stddef.h>
2637 $configure_static_assert_macros],
2638 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2639 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2640 ac_cv_have_usable_wchar_v2="yes",
2641 ac_cv_have_usable_wchar_v2="no")])
2642 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2643 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2644 HAVE_CPP_2BYTE_WCHAR_T=1
2646 dnl This is really gcc-only
2647 dnl Do this test using CXX only since some versions of gcc
2648 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2649 dnl only have short-wchar support for c++.
2650 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2654 _SAVE_CXXFLAGS=$CXXFLAGS
2655 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2657 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2658 ac_cv_have_usable_wchar_option_v2,
2659 [AC_TRY_COMPILE([#include <stddef.h>
2660 $configure_static_assert_macros],
2661 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2662 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2663 ac_cv_have_usable_wchar_option_v2="yes",
2664 ac_cv_have_usable_wchar_option_v2="no")])
2666 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2667 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2668 HAVE_CPP_2BYTE_WCHAR_T=1
2670 CXXFLAGS=$_SAVE_CXXFLAGS
2675 dnl Check for .hidden assembler directive and visibility attribute.
2676 dnl Borrowed from glibc configure.in
2677 dnl ===============================================================
2678 if test "$GNU_CC"; then
2679 AC_CACHE_CHECK(for visibility(hidden) attribute,
2680 ac_cv_visibility_hidden,
2681 [cat > conftest.c <<EOF
2682 int foo __attribute__ ((visibility ("hidden"))) = 1;
2684 ac_cv_visibility_hidden=no
2685 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2686 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2687 ac_cv_visibility_hidden=yes
2692 if test "$ac_cv_visibility_hidden" = "yes"; then
2693 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2695 AC_CACHE_CHECK(for visibility(default) attribute,
2696 ac_cv_visibility_default,
2697 [cat > conftest.c <<EOF
2698 int foo __attribute__ ((visibility ("default"))) = 1;
2700 ac_cv_visibility_default=no
2701 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2702 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2703 ac_cv_visibility_default=yes
2708 if test "$ac_cv_visibility_default" = "yes"; then
2709 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2711 AC_CACHE_CHECK(for visibility pragma support,
2712 ac_cv_visibility_pragma,
2713 [cat > conftest.c <<EOF
2714 #pragma GCC visibility push(hidden)
2716 #pragma GCC visibility push(default)
2717 int foo_default = 1;
2719 ac_cv_visibility_pragma=no
2720 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2721 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2722 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2723 ac_cv_visibility_pragma=yes
2729 if test "$ac_cv_visibility_pragma" = "yes"; then
2730 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2731 ac_cv_have_visibility_class_bug,
2732 [cat > conftest.c <<EOF
2733 #pragma GCC visibility push(hidden)
2734 struct __attribute__ ((visibility ("default"))) TestStruct {
2737 __attribute__ ((visibility ("default"))) void TestFunc() {
2741 ac_cv_have_visibility_class_bug=no
2742 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2743 ac_cv_have_visibility_class_bug=yes
2745 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2746 ac_cv_have_visibility_class_bug=yes
2749 rm -rf conftest.{c,S}
2752 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2753 ac_cv_have_visibility_builtin_bug,
2754 [cat > conftest.c <<EOF
2755 #pragma GCC visibility push(hidden)
2756 #pragma GCC visibility push(default)
2758 #pragma GCC visibility pop
2760 __attribute__ ((visibility ("default"))) void Func() {
2762 memset(c, 0, sizeof(c));
2765 ac_cv_have_visibility_builtin_bug=no
2766 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2767 ac_cv_have_visibility_builtin_bug=yes
2769 if test `grep -c "@PLT" conftest.S` = 0; then
2770 ac_cv_visibility_builtin_bug=yes
2773 rm -f conftest.{c,S}
2775 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2776 "$ac_cv_have_visibility_class_bug" = "no"; then
2777 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2778 WRAP_SYSTEM_INCLUDES=1
2780 VISIBILITY_FLAGS='-fvisibility=hidden'
2781 fi # have visibility pragma bug
2782 fi # have visibility pragma
2783 fi # have visibility(default) attribute
2784 fi # have visibility(hidden) attribute
2787 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2788 AC_SUBST(VISIBILITY_FLAGS)
2790 dnl Checks for header files.
2791 dnl ========================================================
2793 case "$target_os" in
2795 # for stuff like -lXshm
2796 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2799 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
2800 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
2801 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
2802 AC_CHECK_HEADERS(malloc.h)
2803 AC_CHECK_HEADERS(X11/XKBlib.h)
2805 dnl These are all the places some variant of statfs can be hiding.
2806 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2808 dnl Try for MMX support
2809 dnl NB - later gcc versions require -mmmx for this header to be successfully
2810 dnl included (or another option which implies it, such as -march=pentium-mmx)
2811 AC_CHECK_HEADERS(mmintrin.h)
2813 dnl Check whether the compiler supports the new-style C++ standard
2814 dnl library headers (i.e. <new>) or needs the old "new.h"
2817 AC_CHECK_HEADER(new, [NEW_H=new])
2818 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2821 AC_ARG_ENABLE(dtrace,
2822 build with dtrace support if available (default=no),
2823 [enable_dtrace="yes"],)
2824 if test "x$enable_dtrace" = "xyes"; then
2825 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2826 if test -n "$HAVE_DTRACE"; then
2827 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
2829 AC_MSG_ERROR([dtrace enabled but sys/std.h not found]);
2832 AC_SUBST(HAVE_DTRACE)
2838 AC_CHECK_HEADERS(sys/cdefs.h)
2842 dnl Checks for libraries.
2843 dnl ========================================================
2848 AC_CHECK_LIB(c_r, gethostbyname_r)
2852 dnl We don't want to link with libdl even if it's present on OS X, since
2853 dnl it's not used and not part of the default installation.
2854 dnl The same goes for BeOS.
2855 dnl We don't want to link against libm or libpthread on Darwin since
2856 dnl they both are just symlinks to libSystem and explicitly linking
2857 dnl against libSystem causes issues when debugging (see bug 299601).
2864 AC_CHECK_LIB(m, atan)
2865 AC_CHECK_LIB(dl, dlopen,
2866 AC_CHECK_HEADER(dlfcn.h,
2868 AC_DEFINE(HAVE_LIBDL)))
2872 _SAVE_CFLAGS="$CFLAGS"
2873 CFLAGS="$CFLAGS -D_GNU_SOURCE"
2874 AC_CHECK_FUNCS(dladdr)
2875 CFLAGS="$_SAVE_CFLAGS"
2877 if test ! "$GNU_CXX"; then
2881 AC_CHECK_LIB(C_r, demangle)
2884 AC_CHECK_LIB(C, demangle)
2888 AC_CHECK_LIB(socket, socket)
2891 XLIBS="$X_EXTRA_LIBS"
2893 dnl ========================================================
2894 dnl Checks for X libraries.
2895 dnl Ordering is important.
2896 dnl Xt is dependent upon SM as of X11R6
2897 dnl ========================================================
2898 if test "$no_x" = "yes"; then
2901 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
2902 XLIBS="-lX11 $XLIBS"
2903 _SAVE_LDFLAGS="$LDFLAGS"
2904 LDFLAGS="$XLDFLAGS $LDFLAGS"
2905 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
2906 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
2907 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
2908 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
2911 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
2912 unset ac_cv_lib_Xt_XtFree
2913 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
2914 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
2915 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
2916 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
2919 # AIX needs the motif library linked before libXt to prevent
2920 # crashes in plugins linked against Motif - Bug #98892
2921 case "${target_os}" in
2923 XT_LIBS="-lXm $XT_LIBS"
2927 dnl ========================================================
2928 dnl = Check for XShm
2929 dnl ========================================================
2930 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
2932 AC_CHECK_HEADER(X11/extensions/XShm.h)
2933 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
2934 test -n "$_HAVE_XSHM_XEXT"; then
2935 AC_DEFINE(HAVE_XSHM)
2938 dnl ========================================================
2940 dnl ========================================================
2941 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
2943 AC_CHECK_HEADER(X11/extensions/XIElib.h)
2945 if test "$MOZ_XIE_LIBS"; then
2946 dnl ====================================================
2947 dnl = If XIE is present and is desired, turn it on
2948 dnl ====================================================
2958 LDFLAGS="$_SAVE_LDFLAGS"
2960 dnl ========================================================
2961 dnl = Check for freetype2 and its functionality
2962 dnl ========================================================
2963 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
2965 if test "$_HAVE_FREETYPE2"; then
2967 _SAVE_CFLAGS="$CFLAGS"
2968 LIBS="$LIBS $FT2_LIBS"
2969 CFLAGS="$CFLAGS $FT2_CFLAGS"
2971 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
2972 ac_cv_member_FT_Bitmap_Size_y_ppem,
2973 [AC_TRY_COMPILE([#include <ft2build.h>
2974 #include FT_FREETYPE_H],
2976 if (sizeof s.y_ppem) return 0;
2978 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
2979 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
2980 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
2981 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
2983 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
2985 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
2986 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
2987 [FT_Bitmap_Size structure includes y_ppem field])
2989 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
2992 CFLAGS="$_SAVE_CFLAGS"
3002 dnl ========================================================
3003 dnl = pthread support
3004 dnl = Start by checking whether the system support pthreads
3005 dnl ========================================================
3006 case "$target_os" in
3011 MOZ_CHECK_PTHREADS(pthreads,
3012 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3013 MOZ_CHECK_PTHREADS(pthread,
3014 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3015 MOZ_CHECK_PTHREADS(c_r,
3016 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3017 MOZ_CHECK_PTHREADS(c,
3026 dnl ========================================================
3027 dnl Check the command line for --with-pthreads
3028 dnl ========================================================
3029 MOZ_ARG_WITH_BOOL(pthreads,
3030 [ --with-pthreads Force use of system pthread library with NSPR ],
3031 [ if test "$USE_PTHREADS"x = x; then
3032 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3038 dnl ========================================================
3039 dnl Do the platform specific pthread hackery
3040 dnl ========================================================
3041 if test "$USE_PTHREADS"x != x
3044 dnl See if -pthread is supported.
3047 ac_cv_have_dash_pthread=no
3048 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3049 echo 'int main() { return 0; }' | cat > conftest.c
3050 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3051 if test $? -eq 0; then
3052 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3053 ac_cv_have_dash_pthread=yes
3054 case "$target_os" in
3056 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3059 CFLAGS="$CFLAGS -pthread"
3060 CXXFLAGS="$CXXFLAGS -pthread"
3066 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3069 dnl See if -pthreads is supported.
3071 ac_cv_have_dash_pthreads=no
3072 if test "$ac_cv_have_dash_pthread" = "no"; then
3073 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3074 echo 'int main() { return 0; }' | cat > conftest.c
3075 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3076 if test $? -eq 0; then
3077 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3078 ac_cv_have_dash_pthreads=yes
3079 CFLAGS="$CFLAGS -pthreads"
3080 CXXFLAGS="$CXXFLAGS -pthreads"
3084 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3089 AC_DEFINE(_REENTRANT)
3090 AC_DEFINE(_THREAD_SAFE)
3091 dnl -pthread links in -lc_r, so don't specify it explicitly.
3092 if test "$ac_cv_have_dash_pthread" = "yes"; then
3093 _PTHREAD_LDFLAGS="-pthread"
3095 _PTHREAD_LDFLAGS="-lc_r"
3099 *-*-openbsd*|*-*-bsdi*)
3100 AC_DEFINE(_REENTRANT)
3101 AC_DEFINE(_THREAD_SAFE)
3102 dnl -pthread links in -lc_r, so don't specify it explicitly.
3103 if test "$ac_cv_have_dash_pthread" = "yes"; then
3104 _PTHREAD_LDFLAGS="-pthread"
3109 AC_DEFINE(_REENTRANT)
3113 AC_DEFINE(_REENTRANT)
3117 AC_DEFINE(_REENTRANT)
3121 AC_DEFINE(_REENTRANT)
3125 AC_DEFINE(_REENTRANT)
3129 AC_DEFINE(_REENTRANT)
3130 if test ! "$GNU_CC"; then
3131 CFLAGS="$CFLAGS -mt"
3132 CXXFLAGS="$CXXFLAGS -mt"
3136 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3139 dnl ========================================================
3140 dnl See if mmap sees writes
3141 dnl For cross compiling, just define it as no, which is a safe default
3142 dnl ========================================================
3143 AC_MSG_CHECKING(whether mmap() sees write()s)
3149 #include <sys/mman.h>
3150 #include <sys/types.h>
3151 #include <sys/stat.h>
3154 char fname[] = "conftest.file";
3155 char zbuff[1024]; /* Fractional page is probably worst case */
3162 fd = open(fname, O_RDWR | O_CREAT, 0660);
3165 write(fd, zbuff, sizeof(zbuff));
3166 lseek(fd, 0, SEEK_SET);
3167 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3168 if(map==(char*)-1) return 2;
3169 for(i=0; fname[i]; i++) {
3170 int rc = write(fd, &fname[i], 1);
3171 if(map[i]!=fname[i]) return 4;
3178 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3180 AC_MSG_RESULT("$result")
3182 if test "$result" = "no"; then
3183 AC_DEFINE(MMAP_MISSES_WRITES)
3187 dnl Checks for library functions.
3188 dnl ========================================================
3189 AC_PROG_GCC_TRADITIONAL
3191 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64)
3192 AC_CHECK_FUNCS(flockfile getpagesize)
3194 dnl localtime_r and strtok_r are only present on MacOS version 10.2 and higher
3195 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100200"; then
3196 AC_CHECK_FUNCS(localtime_r strtok_r)
3199 dnl check for wcrtomb/mbrtowc
3200 dnl =======================================================================
3201 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3204 AC_CACHE_CHECK(for wcrtomb,
3206 [AC_TRY_LINK([#include <wchar.h>],
3207 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3208 ac_cv_have_wcrtomb="yes",
3209 ac_cv_have_wcrtomb="no")])
3210 if test "$ac_cv_have_wcrtomb" = "yes"; then
3211 AC_DEFINE(HAVE_WCRTOMB)
3213 AC_CACHE_CHECK(for mbrtowc,
3215 [AC_TRY_LINK([#include <wchar.h>],
3216 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3217 ac_cv_have_mbrtowc="yes",
3218 ac_cv_have_mbrtowc="no")])
3219 if test "$ac_cv_have_mbrtowc" = "yes"; then
3220 AC_DEFINE(HAVE_MBRTOWC)
3227 ac_cv_func_res_ninit,
3230 #define _BSD_SOURCE 1
3234 [int foo = res_ninit(&_res);],
3235 [ac_cv_func_res_ninit=yes],
3236 [ac_cv_func_res_ninit=no])
3239 if test "$ac_cv_func_res_ninit" = "yes"; then
3240 AC_DEFINE(HAVE_RES_NINIT)
3241 dnl must add the link line we do something as foolish as this... dougt
3243 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3244 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3249 [for gnu_get_libc_version()],
3250 ac_cv_func_gnu_get_libc_version,
3252 #ifdef HAVE_GNU_LIBC_VERSION_H
3253 #include <gnu/libc-version.h>
3256 [const char *glibc_version = gnu_get_libc_version();],
3257 [ac_cv_func_gnu_get_libc_version=yes],
3258 [ac_cv_func_gnu_get_libc_version=no]
3262 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3263 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3267 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3271 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3272 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3273 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3275 LIBS="$LIBS $_ICONV_LIBS"
3284 iconv_t h = iconv_open("", "");
3285 iconv(h, NULL, NULL, NULL, NULL);
3288 [ac_cv_func_iconv=yes],
3289 [ac_cv_func_iconv=no]
3292 if test "$ac_cv_func_iconv" = "yes"; then
3293 AC_DEFINE(HAVE_ICONV)
3294 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3295 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3296 LIBICONV="$_ICONV_LIBS"
3298 [for iconv() with const input],
3299 ac_cv_func_const_iconv,
3305 const char *input = "testing";
3306 iconv_t h = iconv_open("", "");
3307 iconv(h, &input, NULL, NULL, NULL);
3310 [ac_cv_func_const_iconv=yes],
3311 [ac_cv_func_const_iconv=no]
3314 if test "$ac_cv_func_const_iconv" = "yes"; then
3315 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3327 dnl **********************
3328 dnl *** va_copy checks ***
3329 dnl **********************
3330 dnl we currently check for all three va_copy possibilities, so we get
3331 dnl all results in config.log for bug reports.
3332 AC_MSG_CHECKING(for an implementation of va_copy())
3333 AC_CACHE_VAL(ac_cv_va_copy,[
3336 void f (int i, ...) {
3337 va_list args1, args2;
3338 va_start (args1, i);
3339 va_copy (args2, args1);
3340 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3342 va_end (args1); va_end (args2);
3344 int main() { f (0, 42); return 0; }],
3350 AC_MSG_RESULT($ac_cv_va_copy)
3351 AC_MSG_CHECKING(for an implementation of __va_copy())
3352 AC_CACHE_VAL(ac_cv___va_copy,[
3355 void f (int i, ...) {
3356 va_list args1, args2;
3357 va_start (args1, i);
3358 __va_copy (args2, args1);
3359 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3361 va_end (args1); va_end (args2);
3363 int main() { f (0, 42); return 0; }],
3364 ac_cv___va_copy=yes,
3369 AC_MSG_RESULT($ac_cv___va_copy)
3370 AC_MSG_CHECKING(whether va_lists can be copied by value)
3371 AC_CACHE_VAL(ac_cv_va_val_copy,[
3374 void f (int i, ...) {
3375 va_list args1, args2;
3376 va_start (args1, i);
3378 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3380 va_end (args1); va_end (args2);
3382 int main() { f (0, 42); return 0; }],
3383 ac_cv_va_val_copy=yes,
3384 ac_cv_va_val_copy=no,
3385 ac_cv_va_val_copy=yes
3388 if test "x$ac_cv_va_copy" = "xyes"; then
3389 AC_DEFINE(VA_COPY, va_copy)
3390 AC_DEFINE(HAVE_VA_COPY)
3391 elif test "x$ac_cv___va_copy" = "xyes"; then
3392 AC_DEFINE(VA_COPY, __va_copy)
3393 AC_DEFINE(HAVE_VA_COPY)
3396 if test "x$ac_cv_va_val_copy" = "xno"; then
3397 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3399 AC_MSG_RESULT($ac_cv_va_val_copy)
3401 dnl Check for dll-challenged libc's.
3402 dnl This check is apparently only needed for Linux.
3405 dnl ===================================================================
3408 rm -rf conftest* _conftest
3410 cat >> conftest.C <<\EOF
3415 void __dump_link_map(void) {
3416 struct link_map *map = _dl_loaded;
3417 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3420 dlopen("./conftest1.so",RTLD_LAZY);
3421 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3422 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3423 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3427 /* _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).*/
3428 int main() { printf("./conftest1.so\n"); }
3432 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3434 cat >> conftest1.C <<\EOF
3436 void foo(void) {printf("foo in dll called\n");}
3438 ${CXX-g++} -fPIC -c -g conftest1.C
3439 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3440 ${CXX-g++} -g conftest.C -o conftest -ldl
3441 cp -f conftest1.so conftest _conftest
3443 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3446 echo "*** Your libc has a bug that can result in loading the same dynamic"
3447 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3448 echo "*** or later. However, if you choose not to upgrade, the only effect"
3449 echo "*** will be excessive memory usage at runtime."
3453 rm -rf conftest* _conftest
3454 dnl ===================================================================
3458 dnl ===================================================================
3459 dnl ========================================================
3460 dnl By default, turn rtti and exceptions off on g++/egcs
3461 dnl ========================================================
3462 if test "$GNU_CXX"; then
3464 AC_MSG_CHECKING(for C++ exceptions flag)
3466 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3467 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3468 [echo "int main() { return 0; }" | cat > conftest.C
3470 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3472 if egrep "warning.*renamed" conftest.out >/dev/null; then
3473 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3475 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3480 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3481 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3482 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3485 dnl ========================================================
3486 dnl Put your C++ language/feature checks below
3487 dnl ========================================================
3491 if test "$GNU_CC"; then
3492 AC_CACHE_CHECK(for gcc 3.0 ABI,
3493 ac_cv_gcc_three_abi,
3496 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3502 ac_cv_gcc_three_abi="yes",
3503 ac_cv_gcc_three_abi="no")])
3504 if test "$ac_cv_gcc_three_abi" = "yes"; then
3505 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3508 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3511 AC_SUBST(HAVE_GCC3_ABI)
3514 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3516 [AC_TRY_COMPILE(class X {
3517 public: explicit X(int i) : i_(i) {}
3521 ac_cv_cpp_explicit=yes,
3522 ac_cv_cpp_explicit=no)])
3523 if test "$ac_cv_cpp_explicit" = yes ; then
3524 AC_DEFINE(HAVE_CPP_EXPLICIT)
3527 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3529 [AC_TRY_COMPILE(class param {
3531 typedef unsigned long num_type;
3534 template <class T> class tplt {
3536 typedef typename T::num_type t_num_type;
3537 t_num_type foo(typename T::num_type num) {
3543 ac_cv_cpp_typename=yes,
3544 ac_cv_cpp_typename=no)])
3545 if test "$ac_cv_cpp_typename" = yes ; then
3546 AC_DEFINE(HAVE_CPP_TYPENAME)
3549 dnl Check for support of modern template specialization syntax
3550 dnl Test code and requirement from scc@netscape.com.
3551 dnl Autoconf cut-and-paste job by waterson@netscape.com
3552 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3553 ac_cv_cpp_modern_specialize_template_syntax,
3554 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3556 template <> struct X<Y> { double a; };,
3559 ac_cv_cpp_modern_specialize_template_syntax=yes,
3560 ac_cv_cpp_modern_specialize_template_syntax=no)])
3561 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3562 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3566 dnl Some compilers support only full specialization, and some don't.
3567 AC_CACHE_CHECK(whether partial template specialization works,
3568 ac_cv_cpp_partial_specialization,
3569 [AC_TRY_COMPILE(template <class T> class Foo {};
3570 template <class T> class Foo<T*> {};,
3572 ac_cv_cpp_partial_specialization=yes,
3573 ac_cv_cpp_partial_specialization=no)])
3574 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3575 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3578 dnl Some compilers have limited support for operators with templates;
3579 dnl specifically, it is necessary to define derived operators when a base
3580 dnl class's operator declaration should suffice.
3581 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3582 ac_cv_need_derived_template_operators,
3583 [AC_TRY_COMPILE([template <class T> class Base { };
3585 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3586 template <class T> class Derived : public Base<T> { };],
3587 [Derived<char> a, b;
3588 Base<char> c = a + b;
3590 ac_cv_need_derived_template_operators=no,
3591 ac_cv_need_derived_template_operators=yes)])
3592 if test "$ac_cv_need_derived_template_operators" = yes ; then
3593 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3597 dnl Some compilers have trouble detecting that a template class
3598 dnl that derives from another template is actually an instance
3599 dnl of the base class. This test checks for that.
3600 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3601 ac_cv_need_cpp_template_cast_to_base,
3602 [AC_TRY_COMPILE([template <class T> class Base { };
3603 template <class T> class Derived : public Base<T> { };
3604 template <class T> int foo(const Base<T>&) { return 0; }],
3605 [Derived<char> bar; return foo(bar);],
3606 ac_cv_need_cpp_template_cast_to_base=no,
3607 ac_cv_need_cpp_template_cast_to_base=yes)])
3608 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3609 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3612 dnl Some compilers have trouble resolving the ambiguity between two
3613 dnl functions whose arguments differ only by cv-qualifications.
3614 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3615 ac_cv_can_resolve_const_ambiguity,
3617 template <class T> class ptrClass {
3621 template <class T> T* a(ptrClass<T> *arg) {
3626 const T* a(const ptrClass<T> *arg) {
3632 ac_cv_can_resolve_const_ambiguity=yes,
3633 ac_cv_can_resolve_const_ambiguity=no)])
3634 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3635 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3639 dnl We don't do exceptions on unix. The only reason this used to be here
3640 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3641 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3642 dnl So im commenting this out until someone writes some artificial
3643 dnl intelligence to detect not only if the compiler has exceptions, but if
3644 dnl they are enabled as well.
3646 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3647 dnl ac_cv_cpp_exceptions,
3648 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3649 dnl static void F() { throw X(); },
3650 dnl try { F(); } catch(X & e) { },
3651 dnl ac_cv_cpp_exceptions=yes,
3652 dnl ac_cv_cpp_exceptions=no)])
3653 dnl if test $ac_cv_cpp_exceptions = yes ; then
3654 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3657 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3658 dnl supports it well enough to allow us to use it to change access, but not
3659 dnl to resolve ambiguity. The next two tests determine how well the |using|
3660 dnl keyword is supported.
3662 dnl Check to see if we can change access with |using|. Test both a
3663 dnl legal and an illegal example.
3664 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3665 ac_cv_cpp_access_changing_using2,
3667 class A { protected: int foo() { return 0; } };
3668 class B : public A { public: using A::foo; };,
3669 B b; return b.foo();,
3671 class A { public: int foo() { return 1; } };
3672 class B : public A { private: using A::foo; };,
3673 B b; return b.foo();,
3674 ac_cv_cpp_access_changing_using2=no,
3675 ac_cv_cpp_access_changing_using2=yes)],
3676 ac_cv_cpp_access_changing_using2=no)])
3677 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3678 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3681 dnl Check to see if we can resolve ambiguity with |using|.
3682 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3683 ac_cv_cpp_ambiguity_resolving_using,
3684 [AC_TRY_COMPILE(class X {
3685 public: int go(const X&) {return 3;}
3686 int jo(const X&) {return 3;}
3688 class Y : public X {
3689 public: int go(int) {return 2;}
3690 int jo(int) {return 2;}
3692 private: using X::go;
3695 ac_cv_cpp_ambiguity_resolving_using=yes,
3696 ac_cv_cpp_ambiguity_resolving_using=no)])
3697 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3698 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3701 dnl Check to see if the |std| namespace is supported. If so, we'll want
3702 dnl to qualify any standard library calls with "std::" to ensure that
3703 dnl those functions can be resolved.
3704 AC_CACHE_CHECK(for \"std::\" namespace,
3705 ac_cv_cpp_namespace_std,
3706 [AC_TRY_COMPILE([#include <algorithm>],
3707 [return std::min(0, 1);],
3708 ac_cv_cpp_namespace_std=yes,
3709 ac_cv_cpp_namespace_std=no)])
3710 if test "$ac_cv_cpp_namespace_std" = yes ; then
3711 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3714 dnl Older compilers are overly ambitious with respect to using the standard
3715 dnl template library's |operator!=()| when |operator==()| is defined. In
3716 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3717 dnl ambiguity at compile-time. This test checks for that case.
3718 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3719 ac_cv_cpp_unambiguous_std_notequal,
3720 [AC_TRY_COMPILE([#include <algorithm>
3722 int operator==(const T1&, const T1&) { return 0; }
3723 int operator!=(const T1&, const T1&) { return 0; }],
3724 [T1 a,b; return a != b;],
3725 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3726 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3727 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3728 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
3732 AC_CACHE_CHECK(for C++ reinterpret_cast,
3733 ac_cv_cpp_reinterpret_cast,
3734 [AC_TRY_COMPILE(struct X { int i; };
3735 struct Y { int i; };,
3736 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
3737 ac_cv_cpp_reinterpret_cast=yes,
3738 ac_cv_cpp_reinterpret_cast=no)])
3739 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
3740 AC_DEFINE(HAVE_CPP_NEW_CASTS)
3743 dnl See if a dynamic_cast to void* gives the most derived object.
3744 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3745 ac_cv_cpp_dynamic_cast_void_ptr,
3746 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3747 class Y { int j; public: virtual ~Y() { } };
3748 class Z : public X, public Y { int k; };
3754 return !((((void*)&mdo != (void*)subx) &&
3755 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3756 (((void*)&mdo != (void*)suby) &&
3757 ((void*)&mdo == dynamic_cast<void*>(suby))));
3759 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3760 ac_cv_cpp_dynamic_cast_void_ptr=no,
3761 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3762 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3763 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3767 dnl note that this one is reversed - if the test fails, then
3768 dnl we require implementations of unused virtual methods. Which
3769 dnl really blows because it means we'll have useless vtable
3771 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3772 ac_cv_cpp_unused_required,
3773 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3775 ac_cv_cpp_unused_required=no,
3776 ac_cv_cpp_unused_required=yes)])
3777 if test "$ac_cv_cpp_unused_required" = yes ; then
3778 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3782 dnl Some compilers have trouble comparing a constant reference to a templatized
3783 dnl class to zero, and require an explicit operator==() to be defined that takes
3784 dnl an int. This test separates the strong from the weak.
3786 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3787 ac_cv_trouble_comparing_to_zero,
3788 [AC_TRY_COMPILE([#include <algorithm>
3789 template <class T> class Foo {};
3791 template <class T> int operator==(const T2*, const T&) { return 0; }
3792 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3793 [Foo<int> f; return (0 != f);],
3794 ac_cv_trouble_comparing_to_zero=no,
3795 ac_cv_trouble_comparing_to_zero=yes)])
3796 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3797 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3802 dnl End of C++ language/feature checks
3805 dnl ========================================================
3806 dnl = Internationalization checks
3807 dnl ========================================================
3809 dnl Internationalization and Locale support is different
3810 dnl on various UNIX platforms. Checks for specific i18n
3811 dnl features go here.
3813 dnl check for LC_MESSAGES
3814 AC_CACHE_CHECK(for LC_MESSAGES,
3815 ac_cv_i18n_lc_messages,
3816 [AC_TRY_COMPILE([#include <locale.h>],
3817 [int category = LC_MESSAGES;],
3818 ac_cv_i18n_lc_messages=yes,
3819 ac_cv_i18n_lc_messages=no)])
3820 if test "$ac_cv_i18n_lc_messages" = yes; then
3821 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3824 fi # SKIP_COMPILER_CHECKS
3827 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3828 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3831 dnl Mozilla specific options
3832 dnl ========================================================
3833 dnl The macros used for command line options
3834 dnl are defined in build/autoconf/altoptions.m4.
3837 dnl ========================================================
3839 dnl = Check for external package dependencies
3841 dnl ========================================================
3842 MOZ_ARG_HEADER(External Packages)
3846 MOZ_ARG_WITH_STRING(libxul-sdk,
3847 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
3848 LIBXUL_SDK_DIR=$withval)
3850 if test "$LIBXUL_SDK_DIR" = "yes"; then
3851 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
3852 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
3853 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
3855 if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
3856 AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
3861 AC_SUBST(LIBXUL_SDK)
3863 dnl ========================================================
3864 dnl = If NSPR was not detected in the system,
3865 dnl = use the one in the source tree (mozilla/nsprpub)
3866 dnl ========================================================
3867 MOZ_ARG_WITH_BOOL(system-nspr,
3868 [ --with-system-nspr Use system installed NSPR],
3869 _USE_SYSTEM_NSPR=1 )
3871 if test -n "$_USE_SYSTEM_NSPR"; then
3872 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
3875 if test -n "$MOZ_NATIVE_NSPR"; then
3876 _SAVE_CFLAGS=$CFLAGS
3877 CFLAGS="$CFLAGS $NSPR_CFLAGS"
3878 AC_TRY_COMPILE([#include "prlog.h"],
3879 [#ifndef PR_STATIC_ASSERT
3880 #error PR_STATIC_ASSERT not defined
3882 [MOZ_NATIVE_NSPR=1],
3883 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
3884 CFLAGS=$_SAVE_CFLAGS
3886 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --includedir=$(LIBXUL_DIST)/include/nspr --cflags`'
3887 # explicitly set libs for Visual Age C++ for OS/2
3888 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
3889 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''
3890 elif test "$OS_ARCH" = "WINCE"; then
3891 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3892 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3893 elif test "$OS_ARCH" = "WINNT"; then
3894 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3895 if test -n "$GNU_CC"; then
3896 NSPR_LIBS="-L\$(LIBXUL_DIST)/lib -lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION"
3898 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3901 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --libdir=$(LIBXUL_DIST)/lib --libs`'
3905 dnl ========================================================
3906 dnl = If NSS was not detected in the system,
3907 dnl = use the one in the source tree (mozilla/security/nss)
3908 dnl ========================================================
3910 MOZ_ARG_WITH_BOOL(system-nss,
3911 [ --with-system-nss Use system installed NSS],
3914 if test -n "$_USE_SYSTEM_NSS"; then
3915 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
3918 if test -n "$MOZ_NATIVE_NSS"; then
3919 NSS_LIBS="$NSS_LIBS -lcrmf"
3921 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
3923 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3924 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)smime'$NSS_VERSION'$(DLL_SUFFIX) \\\
3925 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)ssl'$NSS_VERSION'$(DLL_SUFFIX) \\\
3926 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)nss'$NSS_VERSION'$(DLL_SUFFIX) \\\
3927 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)softokn'$NSS_VERSION'$(DLL_SUFFIX)'
3929 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
3931 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3932 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)smime'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3933 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)ssl'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3934 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nss'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3935 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)softokn'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX)'
3937 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lsoftokn$NSS_VERSION"
3941 if test -z "$SKIP_LIBRARY_CHECKS"; then
3942 dnl system JPEG support
3943 dnl ========================================================
3944 MOZ_ARG_WITH_STRING(system-jpeg,
3945 [ --with-system-jpeg[=PFX]
3946 Use system libjpeg [installed at prefix PFX]],
3949 _SAVE_CFLAGS=$CFLAGS
3950 _SAVE_LDFLAGS=$LDFLAGS
3952 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
3953 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
3954 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
3956 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
3959 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
3962 if test "$SYSTEM_JPEG" = 1; then
3963 LIBS="$JPEG_LIBS $LIBS"
3964 AC_TRY_COMPILE([ #include <stdio.h>
3965 #include <sys/types.h>
3966 #include <jpeglib.h> ],
3967 [ #if JPEG_LIB_VERSION < $MOZJPEG
3968 #error "Insufficient JPEG library version ($MOZJPEG required)."
3971 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
3973 CFLAGS=$_SAVE_CFLAGS
3974 LDFLAGS=$_SAVE_LDFLAGS
3977 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
3978 JPEG_CFLAGS="-I${JPEG_DIR}/include"
3979 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
3982 dnl system ZLIB support
3983 dnl ========================================================
3984 MOZ_ARG_WITH_STRING(system-zlib,
3985 [ --with-system-zlib[=PFX]
3986 Use system libz [installed at prefix PFX]],
3989 _SAVE_CFLAGS=$CFLAGS
3990 _SAVE_LDFLAGS=$LDFLAGS
3992 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
3993 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
3994 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
3996 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
3999 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4000 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4002 if test "$SYSTEM_ZLIB" = 1; then
4003 LIBS="$ZLIB_LIBS $LIBS"
4004 AC_TRY_COMPILE([ #include <stdio.h>
4006 #include <zlib.h> ],
4007 [ #if ZLIB_VERNUM < $MOZZLIB
4008 #error "Insufficient zlib version ($MOZZLIB required)."
4011 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4013 CFLAGS=$_SAVE_CFLAGS
4014 LDFLAGS=$_SAVE_LDFLAGS
4017 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4018 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4019 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4022 dnl system PNG Support
4023 dnl ========================================================
4024 MOZ_ARG_WITH_STRING(system-png,
4025 [ --with-system-png[=PFX]
4026 Use system libpng [installed at prefix PFX]],
4029 _SAVE_CFLAGS=$CFLAGS
4030 _SAVE_LDFLAGS=$LDFLAGS
4032 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4033 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4034 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4035 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4036 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4038 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4041 _SAVE_PNG_LIBS=$PNG_LIBS
4042 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4043 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4045 AC_CHECK_LIB(png, png_get_acTL, ,
4046 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4049 if test "$SYSTEM_PNG" = 1; then
4050 LIBS="$PNG_LIBS $LIBS"
4051 AC_TRY_COMPILE([ #include <stdio.h>
4052 #include <sys/types.h>
4054 [ #if PNG_LIBPNG_VER < $MOZPNG
4055 #error "Insufficient libpng version ($MOZPNG required)."
4057 #ifndef PNG_UINT_31_MAX
4058 #error "Insufficient libpng version."
4061 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4063 CFLAGS=$_SAVE_CFLAGS
4064 LDFLAGS=$_SAVE_LDFLAGS
4067 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4068 PNG_CFLAGS="-I${PNG_DIR}/include"
4069 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4072 fi # SKIP_LIBRARY_CHECKS
4074 dnl check whether to enable glitz
4075 dnl ========================================================
4076 MOZ_ARG_ENABLE_BOOL(glitz,
4077 [ --enable-glitz Enable Glitz for use with Cairo],
4080 if test "$MOZ_ENABLE_GLITZ"; then
4081 AC_DEFINE(MOZ_ENABLE_GLITZ)
4084 dnl ========================================================
4085 dnl Java SDK support
4086 dnl ========================================================
4088 MOZ_ARG_WITH_STRING(java-include-path,
4089 [ --with-java-include-path=dir Location of Java SDK headers],
4090 JAVA_INCLUDE_PATH=$withval)
4093 MOZ_ARG_WITH_STRING(java-bin-path,
4094 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4095 JAVA_BIN_PATH=$withval)
4097 dnl ========================================================
4101 dnl ========================================================
4103 MOZ_ARG_HEADER(Application)
4107 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4108 MOZ_BRANDING_DIRECTORY=
4110 MOZ_DBGRINFO_MODULES=
4112 MOZ_EXTENSIONS_ALL=" wallet xml-rpc venkman inspector irc typeaheadfind gnomevfs sroaming datetime finger cview layout-debug tasks sql xforms schema-validation reporter"
4114 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4115 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4128 MOZ_AUTH_EXTENSION=1
4129 MOZ_NO_ACTIVEX_SUPPORT=1
4130 MOZ_NO_INSPECTOR_APIS=
4131 MOZ_NO_XPCOM_OBSOLETE=
4136 MOZ_PLAINTEXT_EDITOR_ONLY=
4138 MOZ_PREF_EXTENSIONS=1
4139 MOZ_PROFILELOCKING=1
4140 MOZ_PROFILESHARING=1
4142 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4144 MOZ_PYTHON_DEBUG_SUFFIX=
4145 MOZ_PYTHON_DLL_SUFFIX=
4146 MOZ_PYTHON_INCLUDES=
4150 MOZ_PYTHON_VER_DOTTED=
4155 MOZ_STATIC_MAIL_BUILD=
4160 MOZ_UNIVERSALCHARDET=1
4162 MOZ_USE_NATIVE_UCONV=
4167 MOZ_XPFE_COMPONENTS=1
4169 MOZ_XSLT_STANDALONE=
4177 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4178 NECKO_SMALL_BUFFERS=
4181 XPC_IDISPATCH_SUPPORT=
4184 case "$target_os" in
4193 case "$target_os" in
4194 msvc*|mks*|cygwin*|mingw*)
4195 if test -z "$GNU_CC"; then
4196 XPC_IDISPATCH_SUPPORT=1
4197 MOZ_NO_ACTIVEX_SUPPORT=
4198 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4203 MOZ_ARG_ENABLE_STRING(application,
4204 [ --enable-application=APP
4214 content/xslt (Standalone Transformiix XSLT)
4215 netwerk (Standalone Necko)
4216 tools/update-packaging (AUS-related packaging tools)
4217 standalone (use this for standalone
4218 xpcom/xpconnect or to manually drive a build)],
4219 [ MOZ_BUILD_APP=$enableval ] )
4221 if test "$MOZ_BUILD_APP" = "macbrowser"; then
4222 AC_MSG_WARN([--enable-application=macbrowser is deprecated. Use --enable-application=camino.])
4223 MOZ_BUILD_APP=camino
4226 case "$MOZ_BUILD_APP" in
4228 MOZ_EMBEDDING_PROFILE=basic
4232 MOZ_EMBEDDING_PROFILE=default
4236 MOZ_ARG_WITH_STRING(embedding-profile,
4237 [ --with-embedding-profile=default|basic|minimal
4238 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4239 [ MOZ_EMBEDDING_PROFILE=$withval ])
4241 case "$MOZ_EMBEDDING_PROFILE" in
4243 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4244 MOZ_EMBEDDING_LEVEL_BASIC=1
4245 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4246 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4247 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4248 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4252 MOZ_EMBEDDING_LEVEL_DEFAULT=
4253 MOZ_EMBEDDING_LEVEL_BASIC=1
4254 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4255 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4256 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4258 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4261 MOZ_ENABLE_POSTSCRIPT=
4262 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4263 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4264 MOZ_IMG_ENCODERS_DEFAULT=
4272 MOZ_NO_ACTIVEX_SUPPORT=1
4273 MOZ_NO_INSPECTOR_APIS=1
4274 MOZ_NO_XPCOM_OBSOLETE=1
4277 MOZ_PLAINTEXT_EDITOR_ONLY=1
4279 MOZ_PREF_EXTENSIONS=
4284 MOZ_UNIVERSALCHARDET=
4286 MOZ_USE_NATIVE_UCONV=1
4288 MOZ_XPFE_COMPONENTS=
4293 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4294 NECKO_SMALL_BUFFERS=1
4295 NS_DISABLE_LOGGING=1
4301 MOZ_EMBEDDING_LEVEL_DEFAULT=
4302 MOZ_EMBEDDING_LEVEL_BASIC=
4303 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4304 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4306 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4309 MOZ_ENABLE_POSTSCRIPT=
4310 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4311 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4312 MOZ_IMG_ENCODERS_DEFAULT=
4320 MOZ_NO_ACTIVEX_SUPPORT=1
4321 MOZ_NO_INSPECTOR_APIS=1
4322 MOZ_NO_XPCOM_OBSOLETE=1
4325 MOZ_PLAINTEXT_EDITOR_ONLY=1
4327 MOZ_PREF_EXTENSIONS=
4334 MOZ_UNIVERSALCHARDET=
4336 MOZ_USE_NATIVE_UCONV=1
4338 MOZ_XPFE_COMPONENTS=
4345 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4346 NECKO_SMALL_BUFFERS=1
4347 NS_DISABLE_LOGGING=1
4353 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4357 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4358 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4359 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4361 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4362 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4363 XULRUNNER_STUB_NAME=$withval)
4365 if test -z "$XULRUNNER_STUB_NAME"; then
4366 case "$target_os" in
4368 XULRUNNER_STUB_NAME=xulrunner
4371 XULRUNNER_STUB_NAME=xulrunner-stub
4374 AC_SUBST(XULRUNNER_STUB_NAME)
4376 if test -z "$MOZ_BUILD_APP"; then
4377 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4379 # We have a valid application only if it has a build.mk file in its top
4381 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4382 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4386 # Allow the application to influence configure with a confvars.sh script.
4388 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4389 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4390 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4391 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4396 # Now is a good time to test for logic errors, define mismatches, etc.
4397 case "$MOZ_BUILD_APP" in
4399 if test "$LIBXUL_SDK"; then
4400 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4404 # Fix this case for folks who forget. Warn them.
4405 if test -n "$LIBXUL_SDK" -a -z "$MOZ_XUL_APP"; then
4406 AC_MSG_WARN([Setting MOZ_XUL_APP since LIBXUL_SDK was set. Add to confvars.sh!])
4412 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4413 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4415 case "$MOZ_BUILD_APP" in
4417 AC_DEFINE(MOZ_SUITE)
4421 AC_DEFINE(MOZ_PHOENIX)
4429 AC_DEFINE(MOZ_THUNDERBIRD)
4433 AC_DEFINE(MOZ_STANDALONE_COMPOSER)
4437 AC_DEFINE(MOZ_SUNBIRD)
4441 AC_DEFINE(MOZ_XULRUNNER)
4445 AC_DEFINE(MOZ_MACBROWSER)
4453 MOZ_APP_NAME=mozilla
4454 MOZ_APP_DISPLAYNAME=Mozilla
4455 MOZ_APP_VERSION=$MOZILLA_VERSION
4460 AC_SUBST(MOZ_BUILD_APP)
4461 AC_SUBST(MOZ_XUL_APP)
4463 AC_SUBST(MOZ_PHOENIX)
4464 AC_SUBST(MOZ_THUNDERBIRD)
4465 AC_SUBST(MOZ_STANDALONE_COMPOSER)
4466 AC_SUBST(MOZ_SUNBIRD)
4467 AC_SUBST(MOZ_XULRUNNER)
4469 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4471 if test "$MOZ_XUL_APP"; then
4473 AC_DEFINE(MOZ_XUL_APP)
4476 dnl ========================================================
4478 dnl = Toolkit Options
4480 dnl ========================================================
4481 MOZ_ARG_HEADER(Toolkit Options)
4483 dnl ========================================================
4484 dnl = Select the default toolkit
4485 dnl ========================================================
4486 MOZ_ARG_ENABLE_STRING(default-toolkit,
4487 [ --enable-default-toolkit=TK
4488 Select default toolkit
4489 Platform specific defaults:
4491 Mac OS X - cairo-cocoa
4492 Neutrino/QNX - photon
4494 Win32 - cairo-windows
4497 [ _DEFAULT_TOOLKIT=$enableval ],
4498 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4500 if test "$_DEFAULT_TOOLKIT" = "photon" \
4501 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4502 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4503 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4504 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4505 -o "$_DEFAULT_TOOLKIT" = "cairo-mac" \
4506 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4508 dnl nglayout only supports building with one toolkit,
4509 dnl so ignore everything after the first comma (",").
4510 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4512 if test "$no_x" != "yes"; then
4513 AC_MSG_ERROR([Toolkit must be cairo-gtk2.])
4515 AC_MSG_ERROR([Toolkit must be $_PLATFORM_DEFAULT_TOOLKIT (if supported).])
4519 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4521 dnl ========================================================
4522 dnl = Enable the toolkit as needed =
4523 dnl ========================================================
4525 case "$MOZ_WIDGET_TOOLKIT" in
4528 AC_DEFINE(MOZ_WIDGET_PHOTON)
4532 MOZ_WIDGET_TOOLKIT=windows
4533 MOZ_GFX_TOOLKIT=cairo
4534 MOZ_ENABLE_CAIRO_GFX=1
4538 MOZ_WIDGET_TOOLKIT=gtk2
4539 MOZ_GFX_TOOLKIT=cairo
4540 MOZ_ENABLE_CAIRO_GFX=1
4542 MOZ_ENABLE_XREMOTE=1
4543 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4544 TK_LIBS='$(MOZ_GTK2_LIBS)'
4545 AC_DEFINE(MOZ_WIDGET_GTK2)
4548 MOZ_WIDGET_TOOLKIT=beos
4549 MOZ_GFX_TOOLKIT=cairo
4550 MOZ_ENABLE_CAIRO_GFX=1
4551 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4552 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4556 MOZ_WIDGET_TOOLKIT=os2
4557 MOZ_GFX_TOOLKIT=cairo
4558 MOZ_ENABLE_CAIRO_GFX=1
4559 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4560 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4563 cairo-mac|cairo-cocoa)
4564 if test "$MOZ_WIDGET_TOOLKIT" = "cairo-cocoa"; then
4565 MOZ_WIDGET_TOOLKIT=cocoa
4566 AC_DEFINE(MOZ_WIDGET_COCOA)
4569 MOZ_WIDGET_TOOLKIT=mac
4571 MOZ_ENABLE_CAIRO_GFX=1
4572 MOZ_GFX_TOOLKIT=cairo
4573 MOZ_USER_DIR="Mozilla"
4574 AC_DEFINE(XP_MACOSX)
4575 AC_DEFINE(TARGET_CARBON)
4576 AC_DEFINE(TARGET_API_MAC_CARBON)
4577 TK_LIBS='-framework Carbon'
4578 TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
4579 CFLAGS="$CFLAGS $TK_CFLAGS"
4580 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4584 if test "$MOZ_ENABLE_XREMOTE"; then
4585 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4588 if test "$COMPILE_ENVIRONMENT"; then
4589 if test "$MOZ_ENABLE_GTK2"
4591 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gdk-x11-2.0 glib-2.0 gobject-2.0)
4593 fi # COMPILE_ENVIRONMENT
4595 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4597 dnl ========================================================
4598 dnl = startup-notification support module
4599 dnl ========================================================
4601 if test "$MOZ_ENABLE_GTK2"
4603 MOZ_ENABLE_STARTUP_NOTIFICATION=
4605 MOZ_ARG_ENABLE_BOOL(startup-notification,
4606 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4607 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4608 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4609 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4611 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4612 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4613 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4614 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4616 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4618 MOZ_ENABLE_STARTUP_NOTIFICATION=
4622 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4623 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4626 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4628 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4629 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4630 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4632 AC_SUBST(GTK_CONFIG)
4636 AC_SUBST(MOZ_ENABLE_GTK2)
4637 AC_SUBST(MOZ_ENABLE_PHOTON)
4638 AC_SUBST(MOZ_ENABLE_COCOA)
4639 AC_SUBST(MOZ_ENABLE_CAIRO_GFX)
4640 AC_SUBST(MOZ_ENABLE_GLITZ)
4641 AC_SUBST(MOZ_ENABLE_XREMOTE)
4642 AC_SUBST(MOZ_GTK2_CFLAGS)
4643 AC_SUBST(MOZ_GTK2_LIBS)
4647 if test "$MOZ_ENABLE_CAIRO_GFX"
4649 AC_DEFINE(MOZ_THEBES)
4650 AC_DEFINE(MOZ_CAIRO_GFX)
4653 if test "$MOZ_ENABLE_GTK2"
4660 dnl ========================================================
4662 dnl = Components & Features
4664 dnl ========================================================
4665 MOZ_ARG_HEADER(Components and Features)
4667 dnl ========================================================
4669 dnl ========================================================
4670 MOZ_ARG_ENABLE_STRING(ui-locale,
4671 [ --enable-ui-locale=ab-CD
4672 Select the user interface locale (default: en-US)],
4673 MOZ_UI_LOCALE=$enableval )
4674 AC_SUBST(MOZ_UI_LOCALE)
4676 dnl =========================================================
4677 dnl = Calendar client
4678 dnl =========================================================
4679 MOZ_ARG_ENABLE_BOOL(calendar,,
4683 if test "$MOZ_OLD_CALENDAR"; then
4684 AC_MSG_WARN([Building with the calendar extension is no longer supported.])
4685 if test "$MOZ_THUNDERBIRD"; then
4686 AC_MSG_WARN([Since you're trying to build mail, you could try adding])
4687 AC_MSG_WARN(['--enable-extensions=default,lightning' to your mozconfig])
4688 AC_MSG_WARN([and building WITH A FRESH TREE.])
4690 AC_MSG_WARN([For more information, please visit:])
4691 AC_MSG_ERROR([http://www.mozilla.org/projects/calendar/])
4694 AC_SUBST(MOZ_CALENDAR)
4696 dnl =========================================================
4698 dnl =========================================================
4699 MOZ_ARG_DISABLE_BOOL(mailnews,
4700 [ --disable-mailnews Disable building of mail & news components],
4703 AC_SUBST(MOZ_MAIL_NEWS)
4705 dnl ========================================================
4706 dnl static mail build off by default
4707 dnl ========================================================
4708 MOZ_ARG_ENABLE_BOOL(static-mail,
4709 [ --enable-static-mail Enable static mail build support],
4710 MOZ_STATIC_MAIL_BUILD=1,
4711 MOZ_STATIC_MAIL_BUILD= )
4713 if test "$MOZ_STATIC_MAIL_BUILD"; then
4714 AC_DEFINE(MOZ_STATIC_MAIL_BUILD)
4717 AC_SUBST(MOZ_STATIC_MAIL_BUILD)
4719 dnl =========================================================
4721 dnl =========================================================
4722 MOZ_ARG_DISABLE_BOOL(ldap,
4723 [ --disable-ldap Disable LDAP support],
4727 dnl ========================================================
4728 dnl = Trademarked Branding
4729 dnl ========================================================
4730 MOZ_ARG_ENABLE_BOOL(official-branding,
4731 [ --enable-official-branding Enable Official mozilla.org Branding
4732 Do not distribute builds with
4733 --enable-official-branding unless you have
4734 permission to use trademarks per
4735 http://www.mozilla.org/foundation/trademarks/ .],
4736 [case "$MOZ_BUILD_APP" in
4738 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
4739 MOZ_APP_DISPLAYNAME=Firefox
4743 MOZ_BRANDING_DIRECTORY=other-licenses/branding/sunbird
4744 MOZ_APP_DISPLAYNAME=Sunbird
4748 MOZ_BRANDING_DIRECTORY=other-licenses/branding/thunderbird
4752 AC_MSG_ERROR([Official branding is only available for Firefox Sunbird and Thunderbird.])
4756 MOZ_ARG_WITH_STRING(branding,
4757 [ --with-branding=dir Use branding from the specified directory.],
4758 MOZ_BRANDING_DIRECTORY=$withval)
4760 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4761 if test -z "$REAL_BRANDING_DIRECTORY"; then
4762 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4765 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4766 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
4769 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4771 dnl ========================================================
4772 dnl = Distribution ID
4773 dnl ========================================================
4774 MOZ_ARG_WITH_STRING(distribution-id,
4775 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
4776 [ val=`echo $withval`
4777 MOZ_DISTRIBUTION_ID="$val"])
4779 if test -z "$MOZ_DISTRIBUTION_ID"; then
4780 MOZ_DISTRIBUTION_ID="org.mozilla"
4783 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4784 AC_SUBST(MOZ_DISTRIBUTION_ID)
4786 dnl ========================================================
4788 dnl ========================================================
4789 if test "$MOZ_ENABLE_GTK2"; then
4793 MOZ_ARG_DISABLE_BOOL(xft,
4794 [ --disable-xft Disable Xft support ],
4798 if test "$MOZ_ENABLE_XFT" && test -z "$MOZ_ENABLE_GTK2"; then
4799 AC_MSG_ERROR([Cannot enable XFT support for non-GTK2 toolkits.])
4802 if test "$MOZ_ENABLE_XFT"
4804 AC_DEFINE(MOZ_ENABLE_XFT)
4805 PKG_CHECK_MODULES(MOZ_XFT, xft)
4806 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
4809 AC_SUBST(MOZ_ENABLE_XFT)
4810 AC_SUBST(MOZ_XFT_CFLAGS)
4811 AC_SUBST(MOZ_XFT_LIBS)
4813 dnl ========================================================
4814 dnl = pango font rendering
4815 dnl ========================================================
4816 MOZ_ARG_ENABLE_BOOL(pango,
4817 [ --enable-pango Enable Pango font rendering support],
4821 if test "$MOZ_ENABLE_PANGO" && test -z "$MOZ_ENABLE_CAIRO_GFX"
4823 AC_MSG_ERROR([Cairo gfx is required for Pango font rendering])
4826 if test "$MOZ_ENABLE_GTK2" && test "$MOZ_ENABLE_CAIRO_GFX"
4828 # For gtk2, we require --enable-pango; gtk2 already implies --enable-xft
4829 if test -z "$MOZ_ENABLE_PANGO"
4831 AC_MSG_WARN([Pango is required for cairo gfx builds, assuming --enable-pango])
4836 if test "$MOZ_ENABLE_PANGO" && test "$MOZ_ENABLE_CAIRO_GFX"
4838 AC_DEFINE(MOZ_ENABLE_PANGO)
4839 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangocairo >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
4840 AC_SUBST(MOZ_ENABLE_PANGO)
4841 AC_SUBST(MOZ_PANGO_CFLAGS)
4842 AC_SUBST(MOZ_PANGO_LIBS)
4845 dnl ========================================================
4846 dnl = x11 core font support (default and ability to enable depend on toolkit)
4847 dnl ========================================================
4850 MOZ_ENABLE_COREXFONTS=${MOZ_ENABLE_COREXFONTS-1}
4852 MOZ_ENABLE_COREXFONTS=
4854 if test "$MOZ_ENABLE_COREXFONTS"
4856 AC_DEFINE(MOZ_ENABLE_COREXFONTS)
4859 AC_SUBST(MOZ_ENABLE_COREXFONTS)
4861 dnl ========================================================
4862 dnl = PostScript print module
4863 dnl ========================================================
4864 MOZ_ARG_DISABLE_BOOL(postscript,
4865 [ --disable-postscript Disable PostScript printing support ],
4866 MOZ_ENABLE_POSTSCRIPT=,
4867 MOZ_ENABLE_POSTSCRIPT=1 )
4869 dnl ========================================================
4870 dnl = GnomeVFS support module
4871 dnl ========================================================
4875 dnl build the gnomevfs extension by default only when the
4876 dnl GTK2 toolkit is in use.
4877 if test "$MOZ_ENABLE_GTK2"
4879 MOZ_ENABLE_GNOMEVFS=1
4881 MOZ_ENABLE_LIBGNOME=1
4884 MOZ_ARG_DISABLE_BOOL(gnomevfs,
4885 [ --disable-gnomevfs Disable GnomeVFS support ],
4886 MOZ_ENABLE_GNOMEVFS=,
4887 MOZ_ENABLE_GNOMEVFS=force)
4889 if test "$MOZ_ENABLE_GNOMEVFS"
4891 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4892 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4893 MOZ_ENABLE_GNOMEVFS=1
4895 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
4897 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
4899 MOZ_ENABLE_GNOMEVFS=
4903 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
4904 AC_SUBST(MOZ_GNOMEVFS_LIBS)
4906 if test "$MOZ_ENABLE_GCONF"
4908 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
4909 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
4916 AC_SUBST(MOZ_GCONF_CFLAGS)
4917 AC_SUBST(MOZ_GCONF_LIBS)
4919 if test "$MOZ_ENABLE_LIBGNOME"
4921 PKG_CHECK_MODULES(MOZ_LIBGNOME, libgnome-2.0 >= $LIBGNOME_VERSION,[
4922 MOZ_LIBGNOME_LIBS=`echo $MOZ_LIBGNOME_LIBS | sed 's/-llinc\>//'`
4923 MOZ_ENABLE_LIBGNOME=1
4925 MOZ_ENABLE_LIBGNOME=
4929 AC_SUBST(MOZ_LIBGNOME_CFLAGS)
4930 AC_SUBST(MOZ_LIBGNOME_LIBS)
4932 # The GNOME component is built if gtk2, gconf, gnome-vfs, and libgnome
4933 # are all available.
4935 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
4936 "$MOZ_ENABLE_GNOMEVFS" -a "$MOZ_ENABLE_LIBGNOME"; then
4937 MOZ_ENABLE_GNOME_COMPONENT=1
4939 MOZ_ENABLE_GNOME_COMPONENT=
4942 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
4945 dnl ========================================================
4946 dnl = libgnomeui support module
4947 dnl ========================================================
4949 if test "$MOZ_ENABLE_GTK2"
4951 MOZ_ENABLE_GNOMEUI=1
4953 MOZ_ARG_DISABLE_BOOL(gnomeui,
4954 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
4955 MOZ_ENABLE_GNOMEUI=,
4956 MOZ_ENABLE_GNOMEUI=force)
4958 if test "$MOZ_ENABLE_GNOMEUI"
4960 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
4962 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
4963 MOZ_ENABLE_GNOMEUI=1
4965 if test "$MOZ_ENABLE_GNOMEUI" = "force"
4967 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
4973 if test "$MOZ_ENABLE_GNOMEUI"; then
4974 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
4977 AC_SUBST(MOZ_ENABLE_GNOMEUI)
4978 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
4979 AC_SUBST(MOZ_GNOMEUI_LIBS)
4981 dnl ========================================================
4983 dnl ========================================================
4985 if test "$MOZ_ENABLE_GTK2"
4989 MOZ_ARG_DISABLE_BOOL(dbus,
4990 [ --disable-dbus Disable dbus support ],
4994 if test "$MOZ_ENABLE_DBUS"
4996 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
4997 AC_DEFINE(MOZ_ENABLE_DBUS)
5000 AC_SUBST(MOZ_ENABLE_DBUS)
5001 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5002 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5004 dnl ========================================================
5005 dnl = Setting MOZ_EXTRA_X11CONVERTERS turns on additional
5006 dnl = converters in intl/uconv that are used only by X11 gfx
5007 dnl = implementations. By default, it's undefined so that
5008 dnl = those converters are not built on other platforms/toolkits.
5009 dnl = (see bug 180851)
5010 dnl ========================================================
5012 if test "$MOZ_ENABLE_GTK2" \
5013 && test "$MOZ_ENABLE_COREXFONTS"
5015 AC_DEFINE(MOZ_EXTRA_X11CONVERTERS)
5016 MOZ_EXTRA_X11CONVERTERS=1
5018 AC_SUBST(MOZ_EXTRA_X11CONVERTERS)
5020 dnl ========================================================
5021 dnl = Build Personal Security Manager
5022 dnl ========================================================
5023 MOZ_ARG_DISABLE_BOOL(crypto,
5024 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5028 dnl ========================================================
5029 dnl = JS Debugger XPCOM component (js/jsd)
5030 dnl ========================================================
5031 MOZ_ARG_DISABLE_BOOL(jsd,
5032 [ --disable-jsd Disable JavaScript debug library],
5037 dnl ========================================================
5038 dnl = Disable plugin support
5039 dnl ========================================================
5040 MOZ_ARG_DISABLE_BOOL(plugins,
5041 [ --disable-plugins Disable plugins support],
5045 dnl ========================================================
5046 dnl = Open JVM Interface (OJI) support
5047 dnl ========================================================
5048 MOZ_ARG_DISABLE_BOOL(oji,
5049 [ --disable-oji Disable Open JVM Integration support],
5052 if test -n "$MOZ_OJI"; then
5056 dnl bi-directional support always on
5060 dnl ========================================================
5061 dnl complex text support off by default
5062 dnl ========================================================
5063 MOZ_ARG_ENABLE_BOOL(ctl,
5064 [ --enable-ctl Enable Thai Complex Script support],
5068 dnl ========================================================
5069 dnl view source support on by default
5070 dnl ========================================================
5071 MOZ_ARG_DISABLE_BOOL(view-source,
5072 [ --disable-view-source Disable view source support],
5075 if test "$MOZ_VIEW_SOURCE"; then
5076 AC_DEFINE(MOZ_VIEW_SOURCE)
5080 dnl ========================================================
5081 dnl accessibility support on by default on all platforms
5083 dnl ========================================================
5084 MOZ_ARG_DISABLE_BOOL(accessibility,
5085 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5088 if test "$ACCESSIBILITY"; then
5089 AC_DEFINE(ACCESSIBILITY)
5092 dnl ========================================================
5093 dnl xpfe/components on by default
5094 dnl ========================================================
5095 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5096 [ --disable-xpfe-components
5097 Disable xpfe components],
5098 MOZ_XPFE_COMPONENTS=,
5099 MOZ_XPFE_COMPONENTS=1 )
5101 dnl ========================================================
5102 dnl xpinstall support on by default
5103 dnl ========================================================
5104 MOZ_ARG_DISABLE_BOOL(xpinstall,
5105 [ --disable-xpinstall Disable xpinstall support],
5108 if test "$MOZ_XPINSTALL"; then
5109 AC_DEFINE(MOZ_XPINSTALL)
5112 dnl ========================================================
5113 dnl xpcom js loader support on by default
5114 dnl ========================================================
5115 MOZ_ARG_DISABLE_BOOL(jsloader,
5116 [ --disable-jsloader Disable xpcom js loader support],
5119 if test "$MOZ_JSLOADER"; then
5120 AC_DEFINE(MOZ_JSLOADER)
5123 dnl ========================================================
5124 dnl Disable printing
5125 dnl ========================================================
5126 MOZ_ARG_DISABLE_BOOL(printing,
5127 [ --disable-printing Disable printing support],
5131 if test "$NS_PRINTING"; then
5132 AC_DEFINE(NS_PRINTING)
5133 AC_DEFINE(NS_PRINT_PREVIEW)
5136 dnl ========================================================
5137 dnl use native unicode converters
5138 dnl ========================================================
5139 MOZ_ARG_ENABLE_BOOL(native-uconv,
5140 [ --enable-native-uconv Enable iconv support],
5141 MOZ_USE_NATIVE_UCONV=1,
5142 MOZ_USE_NATIVE_UCONV= )
5143 if test "$MOZ_USE_NATIVE_UCONV"; then
5144 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5146 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5147 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5151 dnl ========================================================
5152 dnl Libeditor can be build as plaintext-only,
5153 dnl or as a full html and text editing component.
5154 dnl We build both by default.
5155 dnl ========================================================
5156 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5157 [ --enable-plaintext-editor-only
5158 Allow only plaintext editing],
5159 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5160 MOZ_PLAINTEXT_EDITOR_ONLY= )
5161 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5162 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5164 dnl ========================================================
5165 dnl Composer is on by default.
5166 dnl ========================================================
5167 MOZ_ARG_DISABLE_BOOL(composer,
5168 [ --disable-composer Disable building of Composer],
5171 AC_SUBST(MOZ_COMPOSER)
5174 dnl ========================================================
5175 dnl = Drop XPCOM Obsolete library
5176 dnl ========================================================
5177 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5178 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5179 MOZ_NO_XPCOM_OBSOLETE=1,
5180 MOZ_NO_XPCOM_OBSOLETE=)
5182 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5183 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5186 dnl ========================================================
5187 dnl = Disable Fast Load
5188 dnl ========================================================
5189 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5190 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5194 AC_SUBST(MOZ_NO_FAST_LOAD)
5196 if test -n "$MOZ_NO_FAST_LOAD"; then
5197 AC_DEFINE(MOZ_NO_FAST_LOAD)
5200 dnl ========================================================
5201 dnl Permissions System
5202 dnl ========================================================
5203 MOZ_ARG_DISABLE_BOOL(permissions,
5204 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5209 dnl ========================================================
5211 dnl ========================================================
5212 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5213 [ --disable-negotiateauth Disable GSS-API negotiation ],
5214 MOZ_AUTH_EXTENSION=,
5215 MOZ_AUTH_EXTENSION=1 )
5217 dnl ========================================================
5219 dnl ========================================================
5220 MOZ_ARG_DISABLE_BOOL(xtf,
5221 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5224 if test "$MOZ_XTF"; then
5228 dnl ========================================================
5230 dnl ========================================================
5231 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5232 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5233 MOZ_NO_INSPECTOR_APIS=1,
5234 MOZ_NO_INSPECTOR_APIS= )
5236 dnl ========================================================
5238 dnl ========================================================
5239 MOZ_ARG_DISABLE_BOOL(xmlextras,
5240 [ --disable-xmlextras Disable XMLExtras such as XPointer support ],
5244 dnl ========================================================
5246 dnl ========================================================
5247 MOZ_ARG_ENABLE_BOOL(webservices,
5248 [ --enable-webservices Enable Webservices/SOAP support ],
5252 dnl ========================================================
5253 dnl Pref extensions (autoconfig and system-pref)
5254 dnl ========================================================
5255 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5256 [ --disable-pref-extensions
5257 Disable pref extensions such as autoconfig and
5259 MOZ_PREF_EXTENSIONS=,
5260 MOZ_PREF_EXTENSIONS=1 )
5262 dnl ========================================================
5263 dnl = Universalchardet
5264 dnl ========================================================
5265 MOZ_ARG_DISABLE_BOOL(universalchardet,
5266 [ --disable-universalchardet
5267 Disable universal encoding detection],
5268 MOZ_UNIVERSALCHARDET=,
5269 MOZ_UNIVERSALCHARDET=1 )
5271 dnl ========================================================
5273 dnl ========================================================
5274 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5275 [ --enable-javaxpcom
5276 Enable Java-XPCOM bridge],
5280 if test -n "${MOZ_JAVAXPCOM}"; then
5283 if test -n "$JAVA_HOME"; then
5284 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5288 if test -n "$JAVA_HOME"; then
5289 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5294 if test -n "${JAVA_INCLUDE_PATH}"; then
5295 dnl Make sure jni.h exists in the given include path.
5296 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5297 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5300 case "$target_os" in
5302 dnl Default to java system location
5303 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5307 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5310 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5311 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.])
5315 if test -n "${JAVA_BIN_PATH}"; then
5316 dnl Look for javac and jar in the specified path.
5317 JAVA_PATH="$JAVA_BIN_PATH"
5319 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5320 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5323 AC_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5324 AC_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5325 AC_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5326 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5327 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.])
5331 dnl ========================================================
5332 dnl = Breakpad crash reporting (on by default on supported platforms)
5333 dnl ========================================================
5335 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5336 || test "$OS_ARCH" = "Darwin" \
5337 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86") \
5338 && test -z "$HAVE_64BIT_OS"; then
5342 MOZ_ARG_DISABLE_BOOL(crashreporter,
5343 [ --disable-crashreporter Disable breakpad crash reporting],
5345 MOZ_CRASHREPORTER=1)
5347 if test -n "$MOZ_CRASHREPORTER"; then
5348 AC_DEFINE(MOZ_CRASHREPORTER)
5350 if test "$OS_ARCH" = "Linux" && \
5351 test -z "$SKIP_LIBRARY_CHECKS"; then
5352 _SAVE_LDFLAGS=$LDFLAGS
5353 LDFLAGS="$LDFLAGS -lcurl"
5354 AC_CACHE_CHECK(for libcurl,
5356 [AC_TRY_LINK([#include <curl/curl.h>],
5357 [curl_easy_init();],
5358 ac_cv_have_libcurl="yes",
5359 ac_cv_have_libcurl="no")])
5360 if test "$ac_cv_have_libcurl" = "no"; then
5361 AC_MSG_ERROR([Couldn't find libcurl, which is required for the crash reporter. Use --disable-crashreporter to disable the crash reporter.])
5363 LDFLAGS=$_SAVE_LDFLAGS
5367 dnl ========================================================
5368 dnl = Build mochitest JS/DOM tests (on by default)
5369 dnl ========================================================
5370 MOZ_ARG_DISABLE_BOOL(mochitest,
5371 [ --disable-mochitest Disable mochitest harness],
5375 dnl ========================================================
5376 dnl = Enable compilation of specific extension modules
5377 dnl ========================================================
5379 MOZ_ARG_ENABLE_STRING(extensions,
5380 [ --enable-extensions Enable extensions],
5381 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5382 if test "$option" = "yes" || test "$option" = "all"; then
5383 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_ALL"
5384 elif test "$option" = "no" || test "$option" = "none"; then
5386 elif test "$option" = "default"; then
5387 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5388 elif test `echo "$option" | grep -c \^-` != 0; then
5389 option=`echo $option | sed 's/^-//'`
5390 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5392 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5395 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5397 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5398 # Suppress warning on non-X11 platforms
5399 if test -n "$MOZ_X11"; then
5400 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5402 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5405 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5406 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5407 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5410 dnl This might be temporary: build tridentprofile only on Windows
5411 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5412 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5413 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5416 dnl cookie must be built before tridentprofile. put it at list's end.
5417 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5418 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5419 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5422 dnl schema-validation requires webservices
5423 if test -z "$MOZ_WEBSERVICES" && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -ne 0; then
5424 AC_MSG_WARN([Cannot build schema-validation without webservices. Removing schema-validation from MOZ_EXTENSIONS.])
5425 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|schema-validation||g'`
5428 dnl xforms requires xtf and webservices and schema-validation
5429 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5430 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5431 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5433 if test -z "$MOZ_WEBSERVICES" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5434 AC_MSG_WARN([Cannot build XForms without webservices. Removing XForms from MOZ_EXTENSIONS.])
5435 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5438 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5439 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5440 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5443 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5444 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5445 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5448 if test `echo "$MOZ_EXTENSIONS" | grep -c xmlextras` -ne 0; then
5449 AC_MSG_WARN([xmlextras is no longer an extension, use --disable-xmlextras to disable.])
5450 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xmlextras||g'`
5453 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5454 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5455 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5458 if test `echo "$MOZ_EXTENSIONS" | grep -c webservices` -ne 0; then
5459 AC_MSG_WARN([webservices is no longer an extension, use --disable-webservices to disable.])
5460 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|webservices||g'`
5463 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5464 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5465 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5468 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5469 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5470 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5473 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5474 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5475 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5478 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5479 AC_MSG_WARN([spellcheck is no longer an extension.])
5480 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5483 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5484 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5485 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5489 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5491 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5492 dnl when trying to build a non-existent extension.
5493 for extension in $MOZ_EXTENSIONS; do
5494 if test ! -d "${srcdir}/extensions/${extension}"; then
5495 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5500 dnl ========================================================
5502 dnl ========================================================
5503 case "$MOZ_WIDGET_TOOLKIT" in
5504 beos|windows|os2|mac|cocoa)
5507 if test -z "$MOZ_ENABLE_GTK2"; then
5508 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5513 MOZ_ARG_ENABLE_STRING(image-decoders,
5514 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5515 Enable specific image decoders],
5516 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5517 if test "$option" = "yes" || test "$option" = "all"; then
5518 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5519 elif test "$option" = "no" || test "$option" = "none"; then
5521 elif test "$option" = "default"; then
5522 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5523 elif test `echo "$option" | grep -c \^-` != 0; then
5524 option=`echo $option | sed 's/^-//'`
5525 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5527 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5530 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5532 dnl Dupes are removed in the encoder section because it will also add decoders
5534 dnl ========================================================
5536 dnl ========================================================
5537 MOZ_ARG_ENABLE_STRING(image-encoders,
5538 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5539 Enable specific image encoders],
5540 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5541 if test "$option" = "yes" || test "$option" = "all"; then
5542 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5543 elif test "$option" = "no" || test "$option" = "none"; then
5546 elif test "$option" = "default"; then
5547 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5548 elif test `echo "$option" | grep -c \^-` != 0; then
5549 option=`echo $option | sed 's/^-//'`
5550 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5552 addencoder="$option"
5554 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5556 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5559 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5560 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5562 dnl ========================================================
5563 dnl experimental ldap features
5564 dnl ========================================================
5565 MOZ_ARG_ENABLE_BOOL(ldap-experimental,
5566 [ --enable-ldap-experimental
5567 Enable LDAP experimental features],
5568 MOZ_LDAP_XPCOM_EXPERIMENTAL=1,
5569 MOZ_LDAP_XPCOM_EXPERIMENTAL=)
5571 dnl ========================================================
5572 dnl MathML on by default
5573 dnl ========================================================
5574 MOZ_ARG_DISABLE_BOOL(mathml,
5575 [ --disable-mathml Disable MathML support],
5578 if test "$MOZ_MATHML"; then
5579 AC_DEFINE(MOZ_MATHML)
5582 dnl ========================================================
5584 dnl ========================================================
5585 MOZ_ARG_DISABLE_BOOL(canvas,
5586 [ --disable-canvas Disable html:canvas feature],
5588 MOZ_ENABLE_CANVAS=1 )
5589 if test -n "$MOZ_ENABLE_CANVAS"; then
5590 AC_DEFINE(MOZ_ENABLE_CANVAS)
5592 AC_SUBST(MOZ_ENABLE_CANVAS)
5594 dnl ========================================================
5596 dnl ========================================================
5597 MOZ_ARG_DISABLE_BOOL(svg,
5598 [ --disable-svg Disable SVG support],
5601 if test -n "$MOZ_SVG"; then
5602 if test -z "$MOZ_ENABLE_CAIRO_GFX"; then
5603 AC_MSG_ERROR([SVG requires cairo gfx])
5609 MOZ_SVG_FOREIGNOBJECT=$MOZ_ENABLE_CAIRO_GFX
5610 dnl ========================================================
5611 dnl SVG <foreignObject>
5612 dnl ========================================================
5613 MOZ_ARG_DISABLE_BOOL(svg-foreignobject,
5614 [ --disable-svg-foreignobject
5615 Disable SVG <foreignObject> support],
5616 MOZ_SVG_FOREIGNOBJECT=,
5617 MOZ_SVG_FOREIGNOBJECT=1 )
5618 if test "$MOZ_SVG_FOREIGNOBJECT"; then
5619 if test -z "$MOZ_ENABLE_CAIRO_GFX"; then
5620 AC_MSG_ERROR([<foreignobject> requires cairo gfx])
5622 if test "$MOZ_SVG"; then
5623 AC_DEFINE(MOZ_SVG_FOREIGNOBJECT)
5625 MOZ_SVG_FOREIGNOBEJCT=
5630 dnl ========================================================
5632 dnl ========================================================
5633 case "$target_os" in
5634 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5639 MOZ_ARG_DISABLE_BOOL(installer,
5640 [ --disable-installer Disable building of installer],
5643 if test -n "$MOZ_INSTALLER" -a -n "$MOZ_XUL_APP" -a "$OS_ARCH" = "WINNT"; then
5644 # Disable installer for Windows builds that use the new toolkit if NSIS
5645 # isn't in the path.
5646 AC_PATH_PROGS(MAKENSIS, makensis)
5647 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5648 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5650 # The Windows build for NSIS requires the iconv command line utility to
5651 # convert the charset of the locale files.
5652 AC_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5653 if test -z "$HOST_ICONV"; then
5654 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5658 # Automatically disable installer if xpinstall isn't built
5659 if test -z "$MOZ_XPINSTALL"; then
5662 AC_SUBST(MOZ_INSTALLER)
5664 AC_MSG_CHECKING([for tar archiver])
5665 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
5666 if test -z "$TAR"; then
5667 AC_MSG_ERROR([no tar archiver found in \$PATH])
5669 AC_MSG_RESULT([$TAR])
5672 dnl ========================================================
5674 dnl ========================================================
5676 MOZ_ARG_DISABLE_BOOL(updater,
5677 [ --disable-updater Disable building of updater],
5680 # The Windows build requires the iconv command line utility
5681 # in order to build the updater.
5682 case "$target_os" in
5683 msvc*|mks*|cygwin*|mingw*|wince*)
5684 if test -n "$MOZ_UPDATER"; then
5685 AC_MSG_CHECKING([for iconv])
5686 AC_CHECK_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5687 if test -z "$HOST_ICONV"; then
5688 AC_MSG_ERROR([iconv not found in \$PATH])
5693 AC_SUBST(MOZ_UPDATER)
5695 # app update channel is 'default' when not supplied.
5696 MOZ_ARG_ENABLE_STRING([update-channel],
5697 [ --enable-update-channel=CHANNEL
5698 Select application update channel (default=default)],
5699 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
5701 if test -z "$MOZ_UPDATE_CHANNEL"; then
5702 MOZ_UPDATE_CHANNEL=default
5704 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5706 # tools/update-packaging is not checked out by default.
5707 MOZ_ARG_ENABLE_BOOL(update-packaging,
5708 [ --enable-update-packaging
5709 Enable tools/update-packaging],
5710 MOZ_UPDATE_PACKAGING=1,
5711 MOZ_UPDATE_PACKAGING= )
5712 AC_SUBST(MOZ_UPDATE_PACKAGING)
5714 dnl ========================================================
5716 dnl ========================================================
5718 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
5719 [ --disable-xpconnect-idispatch
5720 Disable building of xpconnect support for IDispatch
5722 XPC_IDISPATCH_SUPPORT=,
5723 XPC_IDISPATCH_SUPPORT=1)
5724 AC_SUBST(XPC_IDISPATCH_SUPPORT)
5726 MOZ_ARG_DISABLE_BOOL(activex,
5727 [ --disable-activex Disable building of ActiveX control (win32 only)],
5728 MOZ_NO_ACTIVEX_SUPPORT=1,
5729 MOZ_NO_ACTIVEX_SUPPORT= )
5730 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
5732 MOZ_ARG_DISABLE_BOOL(activex-scripting,
5733 [ --disable-activex-scripting
5734 Disable building of ActiveX scripting support (win32)],
5735 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
5736 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
5737 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
5739 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
5741 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
5744 dnl ========================================================
5746 dnl ========================================================
5747 MOZ_ARG_ENABLE_BOOL(leaky,
5748 [ --enable-leaky Build leaky memory tool],
5753 dnl ========================================================
5755 dnl ========================================================
5756 MOZ_ARG_ENABLE_BOOL(xpctools,
5757 [ --enable-xpctools Build JS profiling tool],
5762 dnl ========================================================
5763 dnl build the tests by default
5764 dnl ========================================================
5765 MOZ_ARG_DISABLE_BOOL(tests,
5766 [ --disable-tests Do not build test libraries & programs],
5770 dnl ========================================================
5772 dnl = Module specific options
5774 dnl ========================================================
5775 MOZ_ARG_HEADER(Individual module options)
5777 dnl ========================================================
5778 dnl = Enable Lea malloc in xpcom. OFF by default.
5779 dnl ========================================================
5780 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
5781 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
5784 if test -n "$XPCOM_USE_LEA"; then
5785 AC_DEFINE(XPCOM_USE_LEA)
5788 dnl ========================================================
5789 dnl = Enable places (new history/bookmarks)
5790 dnl ========================================================
5791 MOZ_ARG_ENABLE_BOOL(places,
5792 [ --enable-places Enable 'places' bookmark/history implementation],
5795 if test -n "$MOZ_PLACES"; then
5796 AC_DEFINE(MOZ_PLACES)
5797 if test -z "$MOZ_MAIL_NEWS"; then
5802 if test "$MOZ_BUILD_APP" = "browser"; then
5803 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
5807 dnl ========================================================
5808 dnl = Disable feed handling components
5809 dnl ========================================================
5810 MOZ_ARG_DISABLE_BOOL(feeds,
5811 [ --disable-feeds Disable feed handling and processing components],
5814 if test -n "$MOZ_FEEDS"; then
5815 AC_DEFINE(MOZ_FEEDS)
5817 if test "$MOZ_BUILD_APP" = "browser"; then
5818 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
5822 dnl ========================================================
5823 dnl = Enable mozStorage
5824 dnl = XXX need to implement --with-system-sqlite3 (see bug 263381)
5825 dnl ========================================================
5826 dnl Implicitly enabled by default if building calendar or places
5827 MOZ_ARG_ENABLE_BOOL(storage,
5828 [ --enable-storage Enable mozStorage module and related components],
5831 if test -n "$MOZ_STORAGE"; then
5832 AC_DEFINE(MOZ_STORAGE)
5835 dnl ========================================================
5836 dnl = Enable safe browsing (anti-phishing)
5837 dnl ========================================================
5838 MOZ_ARG_ENABLE_BOOL(safe-browsing,
5839 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
5840 MOZ_SAFE_BROWSING=1,
5841 MOZ_SAFE_BROWSING= )
5842 if test -n "$MOZ_SAFE_BROWSING"; then
5843 AC_DEFINE(MOZ_SAFE_BROWSING)
5845 AC_SUBST(MOZ_SAFE_BROWSING)
5847 dnl ========================================================
5848 dnl = Enable url-classifier
5849 dnl ========================================================
5850 dnl Implicitly enabled by default if building with safe-browsing
5851 if test -n "$MOZ_SAFE_BROWSING"; then
5852 MOZ_URL_CLASSIFIER=1
5854 MOZ_ARG_ENABLE_BOOL(url-classifier,
5855 [ --enable-url-classifier Enable url classifier module],
5856 MOZ_URL_CLASSIFIER=1,
5857 MOZ_URL_CLASSIFIER= )
5858 if test -n "$MOZ_URL_CLASSIFIER"; then
5859 AC_DEFINE(MOZ_URL_CLASSIFIER)
5861 AC_SUBST(MOZ_URL_CLASSIFIER)
5863 dnl ========================================================
5864 dnl = Disable zipwriter
5865 dnl ========================================================
5866 MOZ_ARG_DISABLE_BOOL(zipwriter,
5867 [ --disable-zipwriter Disable zipwriter component],
5870 AC_SUBST(MOZ_ZIPWRITER)
5872 dnl ========================================================
5873 dnl = Enable Ultrasparc specific optimizations for JS
5874 dnl ========================================================
5875 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
5876 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
5877 JS_ULTRASPARC_OPTS=1,
5878 JS_ULTRASPARC_OPTS= )
5880 dnl only enable option for ultrasparcs
5881 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
5882 "$OS_TEST" != "sun4u"; then
5885 AC_SUBST(JS_ULTRASPARC_OPTS)
5887 dnl ========================================================
5889 dnl = Feature options that require extra sources to be pulled
5891 dnl ========================================================
5892 dnl MOZ_ARG_HEADER(Features that require extra sources)
5894 dnl ========================================================
5896 dnl = Debugging Options
5898 dnl ========================================================
5899 MOZ_ARG_HEADER(Debugging and Optimizations)
5901 dnl ========================================================
5902 dnl = Disable building with debug info.
5903 dnl = Debugging is OFF by default
5904 dnl ========================================================
5905 if test -z "$MOZ_DEBUG_FLAGS"
5909 if test "$GNU_CC"; then
5910 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
5911 case "$GCC_VERSION" in
5916 MOZ_DEBUG_FLAGS="-g"
5920 MOZ_DEBUG_FLAGS="-g"
5924 MOZ_DEBUG_FLAGS="-g"
5929 MOZ_ARG_ENABLE_STRING(debug,
5930 [ --enable-debug[=DBG] Enable building with developer debug info
5931 (Using compiler flags DBG)],
5932 [ if test "$enableval" != "no"; then
5934 if test -n "$enableval" && test "$enableval" != "yes"; then
5935 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
5942 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
5943 case "${target_os}" in
5945 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
5947 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5948 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
5951 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
5954 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
5956 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
5958 if test -n "$MOZ_DEBUG"; then
5959 AC_MSG_CHECKING([for valid debug flags])
5960 _SAVE_CFLAGS=$CFLAGS
5961 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
5962 AC_TRY_COMPILE([#include <stdio.h>],
5963 [printf("Hello World\n");],
5966 AC_MSG_RESULT([$_results])
5967 if test "$_results" = "no"; then
5968 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
5970 CFLAGS=$_SAVE_CFLAGS
5973 dnl ========================================================
5974 dnl = Enable code optimization. ON by default.
5975 dnl ========================================================
5976 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
5977 MOZ_OPTIMIZE_FLAGS="-O"
5980 MOZ_ARG_ENABLE_STRING(optimize,
5981 [ --disable-optimize Disable compiler optimization
5982 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
5983 [ if test "$enableval" != "no"; then
5985 if test -n "$enableval" && test "$enableval" != "yes"; then
5986 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
5991 fi ], MOZ_OPTIMIZE=1)
5993 if test "$COMPILE_ENVIRONMENT"; then
5994 if test -n "$MOZ_OPTIMIZE"; then
5995 AC_MSG_CHECKING([for valid optimization flags])
5996 _SAVE_CFLAGS=$CFLAGS
5997 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
5998 AC_TRY_COMPILE([#include <stdio.h>],
5999 [printf("Hello World\n");],
6002 AC_MSG_RESULT([$_results])
6003 if test "$_results" = "no"; then
6004 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6006 CFLAGS=$_SAVE_CFLAGS
6008 fi # COMPILE_ENVIRONMENT
6010 AC_SUBST(MOZ_OPTIMIZE)
6011 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6012 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6014 dnl ========================================================
6015 dnl = Enable/disable debug for specific modules only
6016 dnl = module names beginning with ^ will be disabled
6017 dnl ========================================================
6018 MOZ_ARG_ENABLE_STRING(debug-modules,
6019 [ --enable-debug-modules Enable/disable debug info for specific modules],
6020 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6022 dnl ========================================================
6023 dnl = Enable/disable generation of debugger info for specific modules only
6024 dnl = the special module name ALL_MODULES can be used to denote all modules
6025 dnl = module names beginning with ^ will be disabled
6026 dnl ========================================================
6027 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6028 [ --enable-debugger-info-modules
6029 Enable/disable debugger info for specific modules],
6030 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6031 dnl note that the list of module names is reversed as it is copied
6032 dnl this is important, as it will allow config.mk to interpret stuff like
6033 dnl "^ALL_MODULES xpcom" properly
6034 if test "$i" = "no"; then
6037 if test "$i" = "yes"; then
6040 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6043 dnl ========================================================
6044 dnl Enable garbage collector
6045 dnl ========================================================
6046 MOZ_ARG_ENABLE_BOOL(boehm,
6047 [ --enable-boehm Enable the Boehm Garbage Collector],
6050 if test -n "$GC_LEAK_DETECTOR"; then
6051 AC_DEFINE(GC_LEAK_DETECTOR)
6054 dnl ========================================================
6055 dnl Disable runtime logging checks
6056 dnl ========================================================
6057 MOZ_ARG_DISABLE_BOOL(logging,
6058 [ --disable-logging Disable logging facilities],
6059 NS_DISABLE_LOGGING=1,
6060 NS_DISABLE_LOGGING= )
6061 if test "$NS_DISABLE_LOGGING"; then
6062 AC_DEFINE(NS_DISABLE_LOGGING)
6064 AC_DEFINE(MOZ_LOGGING)
6067 dnl ========================================================
6068 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6069 dnl ========================================================
6070 _ENABLE_LOGREFCNT=42
6071 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6072 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6073 _ENABLE_LOGREFCNT=1,
6074 _ENABLE_LOGREFCNT= )
6075 if test "$_ENABLE_LOGREFCNT" = "1"; then
6076 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6077 elif test -z "$_ENABLE_LOGREFCNT"; then
6078 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6081 dnl ========================================================
6082 dnl = Use malloc wrapper lib
6083 dnl ========================================================
6084 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6085 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6089 if test -n "$_WRAP_MALLOC"; then
6090 if test "$GNU_CC"; then
6091 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"
6092 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6096 dnl ========================================================
6097 dnl = Location of malloc wrapper lib
6098 dnl ========================================================
6099 MOZ_ARG_WITH_STRING(wrap-malloc,
6100 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6101 WRAP_MALLOC_LIB=$withval)
6103 dnl ========================================================
6104 dnl = Use Electric Fence
6105 dnl ========================================================
6106 MOZ_ARG_ENABLE_BOOL(efence,
6107 [ --enable-efence Link with Electric Fence],
6110 if test -n "$_ENABLE_EFENCE"; then
6111 AC_CHECK_LIB(efence,malloc)
6114 dnl ========================================================
6116 dnl ========================================================
6117 MOZ_ARG_ENABLE_BOOL(jprof,
6118 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6121 if test -n "$MOZ_JPROF"; then
6122 AC_DEFINE(MOZ_JPROF)
6126 dnl ========================================================
6127 dnl = Enable stripping of libs & executables
6128 dnl ========================================================
6129 MOZ_ARG_ENABLE_BOOL(strip,
6130 [ --enable-strip Enable stripping of libs & executables ],
6134 dnl ========================================================
6135 dnl = Enable stripping of libs & executables when packaging
6136 dnl ========================================================
6137 MOZ_ARG_ENABLE_BOOL(install-strip,
6138 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6142 dnl ========================================================
6143 dnl = --enable-elf-dynstr-gc
6144 dnl ========================================================
6145 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6146 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6147 USE_ELF_DYNSTR_GC=1,
6148 USE_ELF_DYNSTR_GC= )
6150 dnl ========================================================
6151 dnl = --enable-old-abi-compat-wrappers
6152 dnl ========================================================
6153 dnl on x86 linux, the current builds of some popular plugins (notably
6154 dnl flashplayer and real) expect a few builtin symbols from libgcc
6155 dnl which were available in some older versions of gcc. However,
6156 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6157 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6158 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6159 dnl to true on x86 linux, and false everywhere else.
6162 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6163 [ --enable-old-abi-compat-wrappers
6164 Support old GCC ABI symbols to ease the pain
6165 of the linux compiler change],
6166 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6167 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6168 if test "$COMPILE_ENVIRONMENT"; then
6169 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6172 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6174 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6176 fi # COMPILE_ENVIRONMENT
6178 dnl ========================================================
6179 dnl = --enable-prebinding
6180 dnl ========================================================
6181 MOZ_ARG_ENABLE_BOOL(prebinding,
6182 [ --enable-prebinding Enable prebinding (Mac OS X only)],
6186 dnl ========================================================
6188 dnl = Profiling and Instrumenting
6190 dnl ========================================================
6191 MOZ_ARG_HEADER(Profiling and Instrumenting)
6193 dnl ========================================================
6194 dnl = Enable timeline service, which provides lightweight
6195 dnl = instrumentation of mozilla for performance measurement.
6196 dnl = Timeline is off by default.
6197 dnl ========================================================
6198 MOZ_ARG_ENABLE_BOOL(timeline,
6199 [ --enable-timeline Enable timeline services ],
6202 if test -n "$MOZ_TIMELINE"; then
6203 AC_DEFINE(MOZ_TIMELINE)
6206 dnl ========================================================
6207 dnl Turn on reflow counting
6208 dnl ========================================================
6209 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6210 [ --enable-reflow-perf Enable reflow performance tracing],
6213 if test -n "$MOZ_REFLOW_PREF"; then
6214 AC_DEFINE(MOZ_REFLOW_PREF)
6216 AC_SUBST(MOZ_REFLOW_PERF)
6218 dnl ========================================================
6219 dnl Enable performance metrics.
6220 dnl ========================================================
6221 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6222 [ --enable-perf-metrics Enable performance metrics],
6225 if test -n "$MOZ_PERF_METRICS"; then
6226 AC_DEFINE(MOZ_PERF_METRICS)
6229 dnl ========================================================
6230 dnl Enable code size metrics.
6231 dnl ========================================================
6232 MOZ_ARG_ENABLE_BOOL(codesighs,
6233 [ --enable-codesighs Enable code size analysis tools],
6234 _ENABLE_CODESIGHS=1,
6235 _ENABLE_CODESIGHS= )
6236 if test -n "$_ENABLE_CODESIGHS"; then
6237 if test -d $srcdir/tools/codesighs; then
6240 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6244 dnl ========================================================
6245 dnl = Enable trace malloc
6246 dnl ========================================================
6247 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6248 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6249 [ --enable-trace-malloc Enable malloc tracing],
6252 if test "$NS_TRACE_MALLOC"; then
6253 # Please, Mr. Linker Man, don't take away our symbol names
6254 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6256 AC_DEFINE(NS_TRACE_MALLOC)
6258 AC_SUBST(NS_TRACE_MALLOC)
6260 dnl ========================================================
6261 dnl = Add support for Eazel profiler
6262 dnl ========================================================
6263 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6264 [ --enable-eazel-profiler-support
6265 Enable Corel/Eazel profiler support],
6266 ENABLE_EAZEL_PROFILER=1,
6267 ENABLE_EAZEL_PROFILER= )
6268 if test -n "$ENABLE_EAZEL_PROFILER"; then
6269 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6271 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6272 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6273 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6276 MOZ_ARG_ENABLE_STRING(profile-modules,
6277 [ --enable-profile-modules
6278 Enable/disable profiling for specific modules],
6279 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6281 MOZ_ARG_ENABLE_BOOL(insure,
6282 [ --enable-insure Enable insure++ instrumentation (linux only)],
6285 if test -n "$_ENABLE_INSURE"; then
6289 MOZ_INSURE_EXCLUDE_DIRS="config"
6292 MOZ_ARG_WITH_STRING(insure-dirs,
6293 [ --with-insure-dirs=DIRS
6294 Dirs to instrument with insure ],
6295 MOZ_INSURE_DIRS=$withval )
6297 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6298 [ --with-insure-exclude-dirs=DIRS
6299 Dirs to not instrument with insure ],
6300 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6302 dnl ========================================================
6303 dnl = Support for Quantify (Windows)
6304 dnl ========================================================
6305 MOZ_ARG_ENABLE_BOOL(quantify,
6306 [ --enable-quantify Enable Quantify support (Windows only) ],
6310 dnl ========================================================
6311 dnl = Support for demangling undefined symbols
6312 dnl ========================================================
6313 if test -z "$SKIP_LIBRARY_CHECKS"; then
6316 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6320 # Demangle only for debug or trace-malloc builds
6321 MOZ_DEMANGLE_SYMBOLS=
6322 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6323 MOZ_DEMANGLE_SYMBOLS=1
6324 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6326 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6328 dnl ========================================================
6329 dnl = Support for gcc stack unwinding (from gcc 3.3)
6330 dnl ========================================================
6331 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6332 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6335 dnl ========================================================
6339 dnl ========================================================
6340 MOZ_ARG_HEADER(Misc. Options)
6342 dnl ========================================================
6343 dnl update xterm title
6344 dnl ========================================================
6345 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6346 [ --enable-xterm-updates Update XTERM titles with current command.],
6350 dnl =========================================================
6352 dnl =========================================================
6353 MOZ_ARG_ENABLE_STRING([chrome-format],
6354 [ --enable-chrome-format=jar|flat|both|symlink
6355 Select FORMAT of chrome files (default=jar)],
6356 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6358 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6359 MOZ_CHROME_FILE_FORMAT=jar
6362 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6363 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6364 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6365 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6366 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6369 dnl ========================================================
6370 dnl = Define default location for MOZILLA_FIVE_HOME
6371 dnl ========================================================
6372 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6373 [ --with-default-mozilla-five-home
6374 Set the default value for MOZILLA_FIVE_HOME],
6375 [ val=`echo $withval`
6376 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
6378 dnl ========================================================
6379 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
6380 dnl ========================================================
6381 MOZ_ARG_WITH_STRING(user-appdir,
6382 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
6383 [ val=`echo $withval`
6384 if echo "$val" | grep "\/" >/dev/null; then
6385 AC_MSG_ERROR("Homedir must be single relative path.")
6390 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
6392 dnl ========================================================
6393 dnl = Doxygen configuration
6394 dnl ========================================================
6395 dnl Use commas to specify multiple dirs to this arg
6396 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
6397 MOZ_ARG_WITH_STRING(doc-input-dirs,
6398 [ --with-doc-input-dirs=DIRS
6399 Header/idl dirs to create docs from],
6400 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6401 AC_SUBST(MOZ_DOC_INPUT_DIRS)
6403 dnl Use commas to specify multiple dirs to this arg
6404 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
6405 MOZ_ARG_WITH_STRING(doc-include-dirs,
6406 [ --with-doc-include-dirs=DIRS
6407 Include dirs to preprocess doc headers],
6408 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6409 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
6411 MOZ_DOC_OUTPUT_DIR='./dist/docs'
6412 MOZ_ARG_WITH_STRING(doc-output-dir,
6413 [ --with-doc-output-dir=DIR
6414 Dir to generate docs into],
6415 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
6416 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
6418 if test -z "$SKIP_COMPILER_CHECKS"; then
6419 dnl ========================================================
6421 dnl = Compiler Options
6423 dnl ========================================================
6424 MOZ_ARG_HEADER(Compiler Options)
6426 dnl ========================================================
6427 dnl Check for gcc -pipe support
6428 dnl ========================================================
6429 AC_MSG_CHECKING([for gcc -pipe support])
6430 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
6431 echo '#include <stdio.h>' > dummy-hello.c
6432 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
6433 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
6434 cat dummy-hello.s | ${AS_BIN} -o dummy-hello.S - 2>&5
6435 if test $? = 0; then
6440 if test "$_res_as_stdin" = "yes"; then
6441 _SAVE_CFLAGS=$CFLAGS
6442 CFLAGS="$CFLAGS -pipe"
6443 AC_TRY_COMPILE( [ #include <stdio.h> ],
6444 [printf("Hello World\n");],
6445 [_res_gcc_pipe="yes"],
6446 [_res_gcc_pipe="no"] )
6447 CFLAGS=$_SAVE_CFLAGS
6449 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
6451 CFLAGS="$CFLAGS -pipe"
6452 CXXFLAGS="$CXXFLAGS -pipe"
6456 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
6457 AC_MSG_RESULT([$_res])
6462 dnl pass -Wno-long-long to the compiler
6463 MOZ_ARG_ENABLE_BOOL(long-long-warning,
6464 [ --enable-long-long-warning
6465 Warn about use of non-ANSI long long type],
6466 _IGNORE_LONG_LONG_WARNINGS=,
6467 _IGNORE_LONG_LONG_WARNINGS=1)
6469 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
6470 _SAVE_CFLAGS="$CFLAGS"
6471 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
6472 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
6473 AC_TRY_COMPILE([], [return(0);],
6474 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6475 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6476 result="yes" ], result="no")
6477 AC_MSG_RESULT([$result])
6478 CFLAGS="$_SAVE_CFLAGS"
6481 dnl Test for profiling options
6482 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
6483 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
6485 _SAVE_CFLAGS="$CFLAGS"
6486 CFLAGS="$CFLAGS -fprofile-generate"
6488 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
6489 AC_TRY_COMPILE([], [return 0;],
6490 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
6491 result="yes" ], result="no")
6492 AC_MSG_RESULT([$result])
6494 if test $result = "yes"; then
6495 PROFILE_USE_CFLAGS="-fprofile-use"
6497 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
6498 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
6499 AC_TRY_COMPILE([], [return 0;],
6500 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
6501 result="yes" ], result="no")
6502 AC_MSG_RESULT([$result])
6503 if test $result = "yes"; then
6504 PROFILE_USE_CFLAGS="-fbranch-probabilities"
6508 CFLAGS="$_SAVE_CFLAGS"
6510 AC_SUBST(PROFILE_GEN_CFLAGS)
6511 AC_SUBST(PROFILE_USE_CFLAGS)
6515 dnl ========================================================
6516 dnl Test for -pedantic bustage
6517 dnl ========================================================
6518 MOZ_ARG_DISABLE_BOOL(pedantic,
6519 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
6521 if test "$_PEDANTIC"; then
6522 _SAVE_CXXFLAGS=$CXXFLAGS
6523 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6524 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
6525 AC_TRY_COMPILE([$configure_static_assert_macros],
6526 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
6527 result="no", result="yes" )
6528 AC_MSG_RESULT([$result])
6529 CXXFLAGS="$_SAVE_CXXFLAGS"
6533 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
6534 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6537 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
6542 dnl ========================================================
6543 dnl Test for correct temporary object destruction order
6544 dnl ========================================================
6545 dnl We want to make sure the compiler follows the C++ spec here as
6546 dnl xpcom and the string classes depend on it (bug 235381).
6547 AC_MSG_CHECKING([for correct temporary object destruction order])
6548 AC_TRY_RUN([ class A {
6549 public: A(int& x) : mValue(x) {}
6551 operator char**() { return 0; }
6552 private: int& mValue;
6554 void func(char **arg) {}
6565 result="yes", result="no", result="maybe")
6566 AC_MSG_RESULT([$result])
6568 if test "$result" = "no"; then
6569 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
6572 dnl ========================================================
6573 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
6574 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
6575 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
6576 dnl ========================================================
6577 _SAVE_CXXFLAGS=$CXXFLAGS
6578 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
6579 AC_CACHE_CHECK(for correct overload resolution with const and templates,
6580 ac_nscap_nonconst_opeq_bug,
6589 template <class T, class U>
6590 int operator==(const Pointer<T>& rhs, U* lhs)
6592 return rhs.myPtr == lhs;
6595 template <class T, class U>
6596 int operator==(const Pointer<T>& rhs, const U* lhs)
6598 return rhs.myPtr == lhs;
6606 ac_nscap_nonconst_opeq_bug="no",
6607 ac_nscap_nonconst_opeq_bug="yes")])
6608 CXXFLAGS="$_SAVE_CXXFLAGS"
6610 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
6611 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
6613 fi # SKIP_COMPILER_CHECKS
6615 dnl ========================================================
6617 dnl Should be smarter and check that the compiler does indeed have rtti
6618 dnl ========================================================
6619 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
6620 [ --enable-cpp-rtti Enable C++ RTTI ],
6621 [ _MOZ_USE_RTTI=1 ],
6624 if test "$_MOZ_USE_RTTI"; then
6625 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
6627 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
6630 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
6632 dnl ========================================================
6633 dnl C++ exceptions (g++/egcs only - for now)
6634 dnl Should be smarter and check that the compiler does indeed have exceptions
6635 dnl ========================================================
6636 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
6637 [ --enable-cpp-exceptions Enable C++ exceptions ],
6638 [ _MOZ_CPP_EXCEPTIONS=1 ],
6639 [ _MOZ_CPP_EXCEPTIONS= ])
6641 if test "$_MOZ_CPP_EXCEPTIONS"; then
6642 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
6644 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
6647 # Irix & OSF native compilers do not like exception declarations
6648 # when exceptions are disabled
6649 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
6650 AC_DEFINE(CPP_THROW_NEW, [])
6652 AC_DEFINE(CPP_THROW_NEW, [throw()])
6656 dnl ========================================================
6658 dnl = Build depencency options
6660 dnl ========================================================
6661 MOZ_ARG_HEADER(Build dependencies)
6663 dnl ========================================================
6664 dnl = Do not auto generate dependency info
6665 dnl ========================================================
6667 MOZ_ARG_DISABLE_BOOL(auto-deps,
6668 [ --disable-auto-deps Do not automatically generate dependency info],
6672 if test -n "$MOZ_AUTO_DEPS"; then
6673 dnl ========================================================
6674 dnl = Use mkdepend instead of $CC -MD for dependency generation
6675 dnl ========================================================
6677 MOZ_ARG_DISABLE_BOOL(md,
6678 [ --disable-md Do not use compiler-based dependencies ],
6681 [dnl Default is to turn on -MD if using GNU-compatible compilers
6682 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
6685 dnl Default is to use -xM if using Sun Studio on Solaris
6686 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6689 if test "$_cpp_md_flag"; then
6691 if test "$OS_ARCH" = "OpenVMS"; then
6692 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(*F).pp))'
6694 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(*F).pp)'
6696 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
6697 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6702 _USE_CPP_INCLUDE_FLAG=
6703 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6704 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6708 AC_SUBST(MOZ_AUTO_DEPS)
6709 AC_SUBST(COMPILER_DEPEND)
6713 dnl ========================================================
6715 dnl = Static Build Options
6717 dnl ========================================================
6718 MOZ_ARG_HEADER(Static build options)
6720 MOZ_ARG_ENABLE_BOOL(static,
6721 [ --enable-static Enable building of internal static libs],
6722 BUILD_STATIC_LIBS=1,
6725 dnl Disable libxul in debug builds, but not for xulrunner.
6726 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
6730 MOZ_ARG_ENABLE_BOOL(libxul,
6731 [ --enable-libxul Enable building of libxul],
6732 MOZ_ENABLE_LIBXUL=1,
6735 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
6736 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
6739 if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
6740 AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
6743 if test -n "$MOZ_ENABLE_LIBXUL"; then
6744 XPCOM_LIBS="$LIBXUL_LIBS"
6745 AC_DEFINE(MOZ_ENABLE_LIBXUL)
6747 if test -n "$BUILD_STATIC_LIBS"; then
6748 AC_DEFINE(MOZ_STATIC_BUILD)
6750 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
6753 dnl ========================================================
6754 dnl = Force JS to be a static lib
6755 dnl ========================================================
6756 MOZ_ARG_ENABLE_BOOL(js-static-build,
6757 [ --enable-js-static-build Force js to be a static lib],
6761 AC_SUBST(JS_STATIC_BUILD)
6763 if test -n "$JS_STATIC_BUILD"; then
6764 AC_DEFINE(EXPORT_JS_API)
6766 if test -z "$BUILD_STATIC_LIBS"; then
6767 AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static])
6772 dnl ========================================================
6774 dnl = Standalone module options
6776 dnl ========================================================
6777 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
6779 dnl Check for GLib and libIDL.
6780 dnl ========================================================
6781 case "$target_os" in
6782 msvc*|mks*|cygwin*|mingw*|wince*)
6783 SKIP_IDL_CHECK="yes"
6790 if test -z "$COMPILE_ENVIRONMENT"; then
6791 SKIP_IDL_CHECK="yes"
6794 dnl = Allow users to disable libIDL checking for standalone modules
6795 MOZ_ARG_WITHOUT_BOOL(libIDL,
6796 [ --without-libIDL Skip check for libIDL (standalone modules only)],
6797 SKIP_IDL_CHECK="yes")
6799 if test "$SKIP_IDL_CHECK" = "no"
6802 if test "$MACOS_SDK_DIR"; then
6803 dnl xpidl, and therefore libIDL, is only needed on the build host.
6804 dnl Don't build it against the SDK, as that causes problems.
6805 _MACSAVE_CFLAGS="$CFLAGS"
6806 _MACSAVE_LIBS="$LIBS"
6807 _MACSAVE_LDFLAGS="$LDFLAGS"
6808 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
6810 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"`
6811 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
6812 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
6817 if test "$MOZ_ENABLE_GTK2"; then
6818 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
6820 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
6821 dnl to either libIDL1 or libIDL2.
6822 if test -z "$_LIBIDL_FOUND"; then
6823 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
6824 if test -z "$_LIBIDL_FOUND"; then
6825 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
6829 dnl If we don't have a libIDL config program & not cross-compiling,
6830 dnl look for orbit-config instead.
6832 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
6833 AC_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
6834 if test -n "$ORBIT_CONFIG"; then
6835 AC_MSG_CHECKING([for ORBit libIDL usability])
6836 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
6837 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
6838 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
6839 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
6840 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
6841 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
6843 _SAVE_CFLAGS="$CFLAGS"
6845 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
6846 LIBS="$LIBIDL_LIBS $LIBS"
6849 #include <libIDL/IDL.h>
6852 s=strdup(IDL_get_libver_string());
6865 AC_MSG_RESULT($result)
6866 CFLAGS="$_SAVE_CFLAGS"
6870 if test -z "$_LIBIDL_FOUND"; then
6871 AC_MSG_ERROR([libIDL not found.
6872 libIDL $LIBIDL_VERSION or higher is required.])
6874 if test "$MACOS_SDK_DIR"; then
6875 CFLAGS="$_MACSAVE_CFLAGS"
6876 LIBS="$_MACSAVE_LIBS"
6877 LDFLAGS="$_MACSAVE_LDFLAGS"
6878 if test -n "$_MACSAVE_NEXT_ROOT" ; then
6879 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
6884 if test -n "$CROSS_COMPILE"; then
6885 if test -z "$HOST_LIBIDL_CONFIG"; then
6886 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
6888 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
6889 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
6890 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
6892 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
6893 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
6897 if test -z "$SKIP_PATH_CHECKS"; then
6898 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
6899 if test "$MOZ_ENABLE_GTK2"; then
6900 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
6902 AM_PATH_GLIB(${GLIB_VERSION})
6907 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
6908 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
6911 AC_SUBST(LIBIDL_CFLAGS)
6912 AC_SUBST(LIBIDL_LIBS)
6913 AC_SUBST(STATIC_LIBIDL)
6914 AC_SUBST(GLIB_CFLAGS)
6916 AC_SUBST(GLIB_GMODULE_LIBS)
6917 AC_SUBST(HOST_LIBIDL_CONFIG)
6918 AC_SUBST(HOST_LIBIDL_CFLAGS)
6919 AC_SUBST(HOST_LIBIDL_LIBS)
6921 dnl ========================================================
6922 dnl Check for libart
6923 dnl ========================================================
6924 if test "$MOZ_SVG_RENDERER_LIBART"; then
6925 if test ! -f $topsrcdir/other-licenses/libart_lgpl/Makefile.in; then
6926 AC_MSG_ERROR([You must check out the mozilla version of libart. Use
6927 mk_add_options MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl])
6930 dnl libart's configure hasn't been run yet, but we know what the
6931 dnl answer should be anyway
6932 MOZ_LIBART_CFLAGS='-I${DIST}/include/libart_lgpl'
6933 case "$target_os" in
6934 msvc*|mks*|cygwin*|mingw*|wince*)
6935 MOZ_LIBART_LIBS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)moz_art_lgpl.$(IMPORT_LIB_SUFFIX)'
6938 MOZ_LIBART_LIBS='-lmoz_art -lm'
6941 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lroot -lbe'
6944 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lm'
6950 AC_SUBST(MOZ_LIBART_CFLAGS)
6951 AC_SUBST(MOZ_LIBART_LIBS)
6953 dnl ========================================================
6955 dnl ========================================================
6956 if test "$MOZ_SVG" -o "$MOZ_ENABLE_CANVAS" -o "$MOZ_ENABLE_CAIRO_GFX" ; then
6957 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
6960 MOZ_ARG_ENABLE_BOOL(system-cairo,
6961 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
6965 # Check for headers defining standard int types.
6966 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
6968 if test "$MOZ_TREE_CAIRO"; then
6969 # For now we assume that we will have a uint64_t available through
6970 # one of the above headers or mozstdint.h.
6971 AC_DEFINE(HAVE_UINT64_T)
6973 # Define macros for cairo-features.h
6974 if test "$MOZ_X11"; then
6975 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
6976 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
6977 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
6978 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
6979 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6980 MOZ_ENABLE_CAIRO_FT=1
6981 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
6983 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
6984 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
6985 ATSUI_FONT_FEATURE="#define CAIRO_HAS_ATSUI_FONT 1"
6987 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
6988 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
6989 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
6990 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
6992 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
6993 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
6994 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6995 MOZ_ENABLE_CAIRO_FT=1
6996 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
6997 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
6999 if test "$MOZ_ENABLE_GLITZ"; then
7000 GLITZ_SURFACE_FEATURE="#define CAIRO_HAS_GLITZ_SURFACE 1"
7002 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7003 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7004 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7005 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7006 MOZ_ENABLE_CAIRO_FT=1
7008 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7009 AC_SUBST(CAIRO_FT_CFLAGS)
7011 if test "$MOZ_DEBUG"; then
7012 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7014 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7017 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7019 AC_SUBST(PS_SURFACE_FEATURE)
7020 AC_SUBST(PDF_SURFACE_FEATURE)
7021 AC_SUBST(SVG_SURFACE_FEATURE)
7022 AC_SUBST(XLIB_SURFACE_FEATURE)
7023 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7024 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7025 AC_SUBST(NQUARTZ_SURFACE_FEATURE)
7026 AC_SUBST(XCB_SURFACE_FEATURE)
7027 AC_SUBST(WIN32_SURFACE_FEATURE)
7028 AC_SUBST(OS2_SURFACE_FEATURE)
7029 AC_SUBST(BEOS_SURFACE_FEATURE)
7030 AC_SUBST(GLITZ_SURFACE_FEATURE)
7031 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7032 AC_SUBST(FT_FONT_FEATURE)
7033 AC_SUBST(WIN32_FONT_FEATURE)
7034 AC_SUBST(ATSUI_FONT_FEATURE)
7035 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7037 if test "$_WIN32_MSVC"; then
7038 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7039 if test "$MOZ_ENABLE_GLITZ"; then
7040 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'$(DEPTH)/gfx/cairo/glitz/src/mozglitz.lib $(DEPTH)/gfx/cairo/glitz/src/wgl/mozglitzwgl.lib'
7043 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/$(LIB_PREFIX)mozcairo.$(LIB_SUFFIX) $(DEPTH)/gfx/cairo/libpixman/src/$(LIB_PREFIX)mozlibpixman.$(LIB_SUFFIX)'" $CAIRO_FT_LIBS"
7045 if test "$MOZ_X11"; then
7046 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7049 if test "$MOZ_ENABLE_GLITZ"; then
7050 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src -lmozglitz'
7051 if test "$MOZ_X11"; then
7052 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/glx -lmozglitzglx -lGL'
7054 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7055 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/wgl -lmozglitzwgl'
7060 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7061 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7062 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7066 AC_SUBST(MOZ_TREE_CAIRO)
7067 AC_SUBST(MOZ_CAIRO_CFLAGS)
7068 AC_SUBST(MOZ_CAIRO_LIBS)
7070 dnl ========================================================
7072 dnl ========================================================
7075 MOZ_ARG_ENABLE_BOOL(system-lcms,
7076 [ --enable-system-lcms Use system lcms (located with pkgconfig)],
7080 if test -z "$MOZ_NATIVE_LCMS"
7083 if test "$_WIN32_MSVC"; then
7084 if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
7085 LCMS_CFLAGS=-DLCMS_DLL
7087 LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
7089 LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
7092 PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_VERSION)
7095 AC_SUBST(MOZ_NATIVE_LCMS)
7096 AC_SUBST(LCMS_CFLAGS)
7099 dnl ========================================================
7101 dnl ========================================================
7102 MOZ_ARG_DISABLE_BOOL(xul,
7103 [ --disable-xul Disable XUL],
7105 if test "$MOZ_XUL"; then
7108 dnl remove extensions that require XUL
7109 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7114 dnl ========================================================
7115 dnl Two ways to enable Python support:
7116 dnl --enable-extensions=python # select all available.
7117 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7119 dnl --enable-extensions=python/xpcom,... # select individual ones
7121 dnl If either is used, we locate the Python to use.
7122 dnl ========================================================
7124 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7125 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7126 dnl Allow PYTHON to point to the Python interpreter to use
7127 dnl (note that it must be the python executable - which we
7128 dnl run to locate the relevant paths etc)
7129 dnl If not set, we use whatever Python we can find.
7131 dnl Ask Python what its version number is
7133 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7134 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7136 dnl Ask for the Python "prefix" (ie, home/source dir)
7137 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7138 dnl Setup the include and library directories.
7139 if test "$OS_ARCH" = "WINNT"; then
7140 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7141 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7142 dnl Binary trees have "include" for .h, and "libs" for .lib
7143 dnl We add 'em both - along with quotes, to handle spaces.
7144 MOZ_PYTHON_DLL_SUFFIX=.pyd
7145 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7146 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7148 dnl Non-Windows include and libs
7149 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7150 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7151 dnl Check for dynamic Python lib
7152 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7153 dnl - core, xpcom loader, pydom etc) all need to share Python.
7154 dnl - Python 2.3's std --enable-shared configure option will
7155 dnl create a libpython2.3.so.1.0. We should first try this
7156 dnl dotted versioned .so file because this is the one that
7157 dnl the PyXPCOM build mechanics tries to link to.
7158 dnl XXX Should find a better way than hardcoding "1.0".
7159 dnl - Python developement tree dir layouts are NOT allowed here
7160 dnl because the PyXPCOM build just dies on it later anyway.
7161 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7162 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7163 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7164 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7165 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7166 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7167 dnl Don't Python development tree directory layout.
7168 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7169 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.])
7170 elif test "$OS_ARCH" = "Darwin"; then
7171 dnl We do Darwin last, so if a custom non-framework build of
7172 dnl python is used on OSX, then it will be picked up first by
7173 dnl the logic above.
7174 MOZ_PYTHON_LIBS="-framework Python"
7176 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7178 if test "$OS_ARCH" = "Linux"; then
7179 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7182 dnl Handle "_d" on Windows
7183 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7184 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7186 MOZ_PYTHON_DEBUG_SUFFIX=
7188 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7191 dnl If the user asks for the 'python' extension, then we add
7192 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7193 dnl Note the careful regex - it must match 'python' followed by anything
7194 dnl other than a '/', including the end-of-string.
7195 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7196 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7197 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7200 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7201 dnl command-line, but not yet
7202 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7203 AC_SUBST(MOZ_PYTHON)
7204 AC_SUBST(MOZ_PYTHON_PREFIX)
7205 AC_SUBST(MOZ_PYTHON_INCLUDES)
7206 AC_SUBST(MOZ_PYTHON_LIBS)
7207 AC_SUBST(MOZ_PYTHON_VER)
7208 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7209 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7210 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7212 dnl ========================================================
7213 dnl disable profile sharing
7214 dnl ========================================================
7215 MOZ_ARG_DISABLE_BOOL(profilesharing,
7216 [ --disable-profilesharing Disable profile sharing],
7217 MOZ_PROFILESHARING=,
7218 MOZ_PROFILESHARING=1 )
7219 if test "$MOZ_PROFILESHARING"; then
7221 AC_DEFINE(MOZ_PROFILESHARING)
7224 dnl ========================================================
7226 dnl ========================================================
7227 MOZ_ARG_ENABLE_BOOL(ipcd,
7228 [ --enable-ipcd Enable IPC daemon],
7232 dnl ========================================================
7233 dnl disable profile locking
7234 dnl do no use this in applications that can have more than
7235 dnl one process accessing the profile directory.
7236 dnl ========================================================
7237 MOZ_ARG_DISABLE_BOOL(profilelocking,
7238 [ --disable-profilelocking Disable profile locking],
7239 MOZ_PROFILELOCKING=,
7240 MOZ_PROFILELOCKING=1 )
7241 if test "$MOZ_PROFILELOCKING"; then
7242 AC_DEFINE(MOZ_PROFILELOCKING)
7245 dnl ========================================================
7246 dnl disable rdf services
7247 dnl ========================================================
7248 MOZ_ARG_DISABLE_BOOL(rdf,
7249 [ --disable-rdf Disable RDF],
7251 if test "$MOZ_RDF"; then
7257 dnl ========================================================
7258 dnl necko configuration options
7259 dnl ========================================================
7262 dnl option to disable various necko protocols
7264 MOZ_ARG_ENABLE_STRING(necko-protocols,
7265 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7266 Enable/disable specific protocol handlers],
7267 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7268 if test "$option" = "yes" || test "$option" = "all"; then
7269 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7270 elif test "$option" = "no" || test "$option" = "none"; then
7272 elif test "$option" = "default"; then
7273 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7274 elif test `echo "$option" | grep -c \^-` != 0; then
7275 option=`echo $option | sed 's/^-//'`
7276 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7278 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7281 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7283 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7284 AC_SUBST(NECKO_PROTOCOLS)
7285 for p in $NECKO_PROTOCOLS; do
7286 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7290 dnl option to disable necko's disk cache
7292 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7293 [ --disable-necko-disk-cache
7294 Disable necko disk cache],
7297 AC_SUBST(NECKO_DISK_CACHE)
7298 if test "$NECKO_DISK_CACHE"; then
7299 AC_DEFINE(NECKO_DISK_CACHE)
7303 dnl option to minimize size of necko's i/o buffers
7305 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7306 [ --enable-necko-small-buffers
7307 Minimize size of necko's i/o buffers],
7308 NECKO_SMALL_BUFFERS=1,
7309 NECKO_SMALL_BUFFERS=)
7310 AC_SUBST(NECKO_SMALL_BUFFERS)
7311 if test "$NECKO_SMALL_BUFFERS"; then
7312 AC_DEFINE(NECKO_SMALL_BUFFERS)
7316 dnl option to disable cookies
7318 MOZ_ARG_DISABLE_BOOL(cookies,
7319 [ --disable-cookies Disable cookie support],
7322 AC_SUBST(NECKO_COOKIES)
7323 if test "$NECKO_COOKIES"; then
7324 AC_DEFINE(NECKO_COOKIES)
7327 dnl NECKO_ configuration options are not global
7328 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7330 dnl ========================================================
7331 dnl string api compatibility
7332 dnl ========================================================
7333 MOZ_ARG_DISABLE_BOOL(v1-string-abi,
7334 [ --disable-v1-string-abi Disable binary compatibility layer for strings],
7336 MOZ_V1_STRING_ABI=1)
7337 AC_SUBST(MOZ_V1_STRING_ABI)
7338 if test "$MOZ_V1_STRING_ABI"; then
7339 AC_DEFINE(MOZ_V1_STRING_ABI)
7342 dnl Only build Mork if it's required
7344 if test "$MOZ_MORK"; then
7348 dnl Build the lightweight Mork reader if required
7349 AC_SUBST(MOZ_MORKREADER)
7350 if test "$MOZ_MORKREADER"; then
7351 AC_DEFINE(MOZ_MORKREADER)
7354 dnl ========================================================
7355 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7356 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7359 if test "$MOZ_LDAP_XPCOM"; then
7360 LDAP_CFLAGS='-I${DIST}/public/ldap'
7361 if test "$OS_ARCH" = "WINNT"; then
7362 if test -n "$GNU_CC"; then
7363 LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
7365 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}'
7367 elif test "$OS_ARCH" = "OS2"; then
7368 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}'
7370 LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
7374 if test "$COMPILE_ENVIRONMENT"; then
7375 if test "$SUNCTL"; then
7376 dnl older versions of glib do not seem to have gmodule which ctl needs
7377 _SAVE_CFLAGS=$CFLAGS
7378 CFLAGS="$CFLAGS $GLIB_CFLAGS"
7381 AC_TRY_COMPILE([#include <gmodule.h>],
7382 [ int x = 1; x++; ],,
7383 [AC_MSG_ERROR([Cannot build ctl without gmodule support in glib.])])
7385 CFLAGS=$_SAVE_CFLAGS
7388 fi # COMPILE_ENVIRONMENT
7390 dnl ========================================================
7392 dnl = Maintainer debug option (no --enable equivalent)
7394 dnl ========================================================
7399 AC_SUBST(AR_EXTRACT)
7403 AC_SUBST(AS_DASH_C_FLAG)
7408 AC_SUBST(USE_SHORT_LIBNAME)
7412 AC_SUBST(NS_USE_NATIVE)
7413 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7414 AC_SUBST(MOZ_GFX_TOOLKIT)
7415 AC_SUBST(MOZ_UPDATE_XTERM)
7417 AC_SUBST(MOZ_AUTH_EXTENSION)
7418 AC_SUBST(MOZ_MATHML)
7419 AC_SUBST(MOZ_PERMISSIONS)
7421 AC_SUBST(MOZ_XMLEXTRAS)
7422 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7423 AC_SUBST(MOZ_WEBSERVICES)
7424 AC_SUBST(MOZ_PREF_EXTENSIONS)
7426 AC_SUBST(MOZ_SVG_FOREIGNOBJECT)
7427 AC_SUBST(MOZ_XSLT_STANDALONE)
7428 AC_SUBST(MOZ_JS_LIBS)
7431 AC_SUBST(MOZ_DEBUG_MODULES)
7432 AC_SUBST(MOZ_PROFILE_MODULES)
7433 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7434 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7435 AC_SUBST(MOZ_DEBUG_FLAGS)
7436 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7437 AC_SUBST(WARNINGS_AS_ERRORS)
7438 AC_SUBST(MOZ_DBGRINFO_MODULES)
7439 AC_SUBST(MOZ_EXTENSIONS)
7440 AC_SUBST(MOZ_IMG_DECODERS)
7441 AC_SUBST(MOZ_IMG_ENCODERS)
7442 AC_SUBST(MOZ_JSDEBUGGER)
7444 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7445 AC_SUBST(MOZ_PLUGINS)
7446 AC_SUBST(ENABLE_EAZEL_PROFILER)
7447 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7448 AC_SUBST(EAZEL_PROFILER_LIBS)
7449 AC_SUBST(MOZ_PERF_METRICS)
7450 AC_SUBST(GC_LEAK_DETECTOR)
7451 AC_SUBST(MOZ_LOG_REFCNT)
7454 AC_SUBST(MOZ_XPCTOOLS)
7455 AC_SUBST(MOZ_JSLOADER)
7456 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7457 AC_SUBST(MOZ_INSURE)
7458 AC_SUBST(MOZ_INSURE_DIRS)
7459 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7460 AC_SUBST(MOZ_QUANTIFY)
7461 AC_SUBST(MOZ_INSURIFYING)
7462 AC_SUBST(MOZ_LDAP_XPCOM)
7463 AC_SUBST(MOZ_LDAP_XPCOM_EXPERIMENTAL)
7464 AC_SUBST(LDAP_CFLAGS)
7467 AC_SUBST(MOZ_PLACES)
7468 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7469 AC_SUBST(MOZ_STORAGE)
7471 AC_SUBST(NS_PRINTING)
7473 AC_SUBST(MOZ_JAVAXPCOM)
7474 AC_SUBST(JAVA_INCLUDE_PATH)
7479 AC_SUBST(MOZ_PROFILESHARING)
7480 AC_SUBST(MOZ_PROFILELOCKING)
7485 AC_SUBST(MOZ_XIE_LIBS)
7486 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
7488 AC_SUBST(XPCOM_USE_LEA)
7489 AC_SUBST(BUILD_STATIC_LIBS)
7490 AC_SUBST(MOZ_ENABLE_LIBXUL)
7491 AC_SUBST(ENABLE_TESTS)
7494 AC_SUBST(MOZ_UNIVERSALCHARDET)
7495 AC_SUBST(ACCESSIBILITY)
7496 AC_SUBST(MOZ_XPINSTALL)
7497 AC_SUBST(MOZ_VIEW_SOURCE)
7498 AC_SUBST(MOZ_SPELLCHECK)
7499 AC_SUBST(MOZ_XPFE_COMPONENTS)
7500 AC_SUBST(MOZ_USER_DIR)
7501 AC_SUBST(MOZ_CRASHREPORTER)
7502 AC_SUBST(MOZ_MOCHITEST)
7504 AC_SUBST(ENABLE_STRIP)
7505 AC_SUBST(PKG_SKIP_STRIP)
7506 AC_SUBST(USE_ELF_DYNSTR_GC)
7507 AC_SUBST(USE_PREBINDING)
7508 AC_SUBST(INCREMENTAL_LINKER)
7509 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
7510 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
7511 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
7513 AC_SUBST(MOZ_FIX_LINK_PATHS)
7514 AC_SUBST(XPCOM_LIBS)
7515 AC_SUBST(XPCOM_FROZEN_LDOPTS)
7516 AC_SUBST(XPCOM_GLUE_LDOPTS)
7517 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
7519 AC_SUBST(USE_DEPENDENT_LIBS)
7521 AC_SUBST(MOZ_BUILD_ROOT)
7522 AC_SUBST(MOZ_OS2_TOOLS)
7523 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
7525 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
7526 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
7527 AC_SUBST(MOZ_TIMELINE)
7529 AC_SUBST(TARGET_DEVICE)
7531 AC_SUBST(MOZ_APP_NAME)
7532 AC_SUBST(MOZ_APP_DISPLAYNAME)
7533 AC_SUBST(MOZ_APP_VERSION)
7534 AC_SUBST(FIREFOX_VERSION)
7535 AC_SUBST(THUNDERBIRD_VERSION)
7536 AC_SUBST(SUNBIRD_VERSION)
7537 AC_SUBST(SEAMONKEY_VERSION)
7539 AC_SUBST(MOZ_PKG_SPECIAL)
7541 AC_SUBST(MOZILLA_OFFICIAL)
7542 AC_SUBST(BUILD_OFFICIAL)
7543 AC_SUBST(MOZ_MILESTONE_RELEASE)
7546 AC_SUBST(MOZ_PROFILE)
7547 AC_SUBST(MOZ_DEBUG_SYMBOLS)
7548 AC_SUBST(MOZ_MAPINFO)
7549 AC_SUBST(MOZ_BROWSE_INFO)
7550 AC_SUBST(MOZ_TOOLS_DIR)
7551 AC_SUBST(CYGWIN_WRAPPER)
7553 AC_SUBST(WIN32_REDIST_DIR)
7556 dnl Echo the CFLAGS to remove extra whitespace.
7563 $_MOZ_EXCEPTIONS_FLAGS \
7564 $_WARNINGS_CXXFLAGS \
7567 COMPILE_CFLAGS=`echo \
7572 COMPILE_CXXFLAGS=`echo \
7573 $_DEFINES_CXXFLAGS \
7577 AC_SUBST(SYSTEM_MAKEDEPEND)
7578 AC_SUBST(SYSTEM_JPEG)
7579 AC_SUBST(SYSTEM_PNG)
7580 AC_SUBST(SYSTEM_ZLIB)
7582 AC_SUBST(JPEG_CFLAGS)
7584 AC_SUBST(ZLIB_CFLAGS)
7586 AC_SUBST(PNG_CFLAGS)
7589 AC_SUBST(MOZ_JPEG_CFLAGS)
7590 AC_SUBST(MOZ_JPEG_LIBS)
7591 AC_SUBST(MOZ_ZLIB_CFLAGS)
7592 AC_SUBST(MOZ_ZLIB_LIBS)
7593 AC_SUBST(MOZ_PNG_CFLAGS)
7594 AC_SUBST(MOZ_PNG_LIBS)
7596 AC_SUBST(NSPR_CFLAGS)
7598 AC_SUBST(MOZ_NATIVE_NSPR)
7600 AC_SUBST(NSS_CFLAGS)
7602 AC_SUBST(NSS_DEP_LIBS)
7603 AC_SUBST(MOZ_NATIVE_NSS)
7608 AC_SUBST(COMPILE_CFLAGS)
7609 AC_SUBST(COMPILE_CXXFLAGS)
7612 AC_SUBST(CROSS_COMPILE)
7616 AC_SUBST(HOST_CFLAGS)
7617 AC_SUBST(HOST_CXXFLAGS)
7618 AC_SUBST(HOST_OPTIMIZE_FLAGS)
7620 AC_SUBST(HOST_AR_FLAGS)
7622 AC_SUBST(HOST_RANLIB)
7623 AC_SUBST(HOST_NSPR_MDCPUCFG)
7624 AC_SUBST(HOST_BIN_SUFFIX)
7625 AC_SUBST(HOST_OS_ARCH)
7627 AC_SUBST(TARGET_CPU)
7628 AC_SUBST(TARGET_VENDOR)
7630 AC_SUBST(TARGET_NSPR_MDCPUCFG)
7631 AC_SUBST(TARGET_MD_ARCH)
7632 AC_SUBST(TARGET_XPCOM_ABI)
7635 AC_SUBST(OS_RELEASE)
7638 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
7639 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
7641 AC_SUBST(WRAP_MALLOC_CFLAGS)
7642 AC_SUBST(WRAP_MALLOC_LIB)
7645 AC_SUBST(MKSHLIB_FORCE_ALL)
7646 AC_SUBST(MKSHLIB_UNFORCE_ALL)
7647 AC_SUBST(DSO_CFLAGS)
7648 AC_SUBST(DSO_PIC_CFLAGS)
7649 AC_SUBST(DSO_LDOPTS)
7650 AC_SUBST(LIB_PREFIX)
7651 AC_SUBST(DLL_PREFIX)
7652 AC_SUBST(DLL_SUFFIX)
7653 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
7654 AC_SUBST(LIB_SUFFIX)
7655 AC_SUBST(OBJ_SUFFIX)
7656 AC_SUBST(BIN_SUFFIX)
7657 AC_SUBST(ASM_SUFFIX)
7658 AC_SUBST(IMPORT_LIB_SUFFIX)
7660 AC_SUBST(CC_VERSION)
7661 AC_SUBST(CXX_VERSION)
7662 AC_SUBST(MSMANIFEST_TOOL)
7664 if test "$USING_HCC"; then
7665 CC='${topsrcdir}/build/hcc'
7667 CXX='${topsrcdir}/build/hcpp'
7668 CXX="$CXX '$_OLDCXX'"
7673 dnl Check for missing components
7674 if test "$COMPILE_ENVIRONMENT"; then
7675 if test "$MOZ_X11"; then
7676 dnl ====================================================
7677 dnl = Check if X headers exist
7678 dnl ====================================================
7679 _SAVE_CFLAGS=$CFLAGS
7680 CFLAGS="$CFLAGS $XCFLAGS"
7683 #include <X11/Xlib.h>
7684 #include <X11/Intrinsic.h>
7688 if ((dpy = XOpenDisplay(NULL)) == NULL) {
7689 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
7693 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
7694 CFLAGS="$_SAVE_CFLAGS"
7696 if test ! -z "$MISSING_X"; then
7697 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
7701 fi # COMPILE_ENVIRONMENT
7703 dnl Set various defines and substitutions
7704 dnl ========================================================
7706 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
7707 LIBS='so32dll.lib tcp32dll.lib'
7708 elif test "$OS_ARCH" = "BeOS"; then
7711 elif test "$OS_ARCH" = "Darwin"; then
7713 AC_DEFINE(UNIX_ASYNC_DNS)
7715 elif test "$OS_ARCH" = "OpenVMS"; then
7717 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
7719 AC_DEFINE(UNIX_ASYNC_DNS)
7722 AC_SUBST(MOZ_MOVEMAIL)
7724 AC_DEFINE(JS_THREADSAFE)
7726 if test "$MOZ_DEBUG"; then
7727 AC_DEFINE(MOZ_REFLOW_PERF)
7728 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
7731 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
7732 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
7733 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
7734 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
7735 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
7736 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
7737 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
7738 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
7739 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
7742 # Used for LD_LIBRARY_PATH of run_viewer target
7744 for lib_arg in $NSPR_LIBS $TK_LIBS; do
7746 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
7752 dnl ========================================================
7753 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
7754 dnl ========================================================
7757 WIN_TOP_SRC=`cd $srcdir; pwd -W`
7760 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
7761 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
7762 CC="\$(CYGWIN_WRAPPER) $CC"
7763 CXX="\$(CYGWIN_WRAPPER) $CXX"
7764 CPP="\$(CYGWIN_WRAPPER) $CPP"
7765 LD="\$(CYGWIN_WRAPPER) $LD"
7766 AS="\$(CYGWIN_WRAPPER) $AS"
7767 RC="\$(CYGWIN_WRAPPER) $RC"
7768 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
7769 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
7770 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
7774 AC_SUBST(CYGDRIVE_MOUNT)
7775 AC_SUBST(WIN_TOP_SRC)
7777 AC_SUBST(MOZILLA_VERSION)
7779 . ${srcdir}/config/chrome-versions.sh
7780 AC_DEFINE_UNQUOTED(MOZILLA_LOCALE_VERSION,"$MOZILLA_LOCALE_VERSION")
7781 AC_DEFINE_UNQUOTED(MOZILLA_REGION_VERSION,"$MOZILLA_REGION_VERSION")
7782 AC_DEFINE_UNQUOTED(MOZILLA_SKIN_VERSION,"$MOZILLA_SKIN_VERSION")
7784 AC_SUBST(ac_configure_args)
7786 dnl Spit out some output
7787 dnl ========================================================
7789 dnl The following defines are used by xpcom
7790 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
7792 HAVE_CPP_2BYTE_WCHAR_T
7793 HAVE_CPP_ACCESS_CHANGING_USING
7794 HAVE_CPP_AMBIGUITY_RESOLVING_USING
7796 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
7798 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
7799 HAVE_CPP_NAMESPACE_STD
7801 HAVE_CPP_PARTIAL_SPECIALIZATION
7802 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
7804 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
7806 NEED_CPP_UNUSED_IMPLEMENTATIONS
7810 HAVE_ICONV_WITH_CONST_INPUT
7820 netwerk/necko-config.h
7821 xpcom/xpcom-config.h
7822 xpcom/xpcom-private.h
7825 # Save the defines header file before autoconf removes it.
7826 # (Do not add AC_DEFINE calls after this line.)
7827 _CONFIG_TMP=confdefs-tmp.h
7828 _CONFIG_DEFS_H=mozilla-config.h
7830 cat > $_CONFIG_TMP <<\EOF
7831 /* List of defines generated by configure. Included with preprocessor flag,
7832 * -include, to avoid long list of -D defines on the compile command-line.
7836 #ifndef _MOZILLA_CONFIG_H_
7837 #define _MOZILLA_CONFIG_H_
7840 _EGREP_PATTERN='^#define ('
7841 if test -n "$_NON_GLOBAL_ACDEFINES"; then
7842 for f in $_NON_GLOBAL_ACDEFINES; do
7843 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
7846 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
7848 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
7850 cat >> $_CONFIG_TMP <<\EOF
7852 #endif /* _MOZILLA_CONFIG_H_ */
7856 # Only write mozilla-config.h when something changes (or it doesn't exist)
7857 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
7860 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
7861 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
7863 echo ==== $_CONFIG_DEFS_H =================================
7867 dnl Probably shouldn't call this manually but we always want the output of DEFS
7868 rm -f confdefs.h.save
7869 mv confdefs.h confdefs.h.save
7870 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
7871 AC_OUTPUT_MAKE_DEFS()
7873 AC_SUBST(MOZ_DEFINES)
7875 mv confdefs.h.save confdefs.h
7877 dnl Load the list of Makefiles to generate.
7878 dnl To add new Makefiles, edit allmakefiles.sh.
7879 dnl allmakefiles.sh sets the variable, MAKEFILES.
7880 . ${srcdir}/allmakefiles.sh
7882 dnl Run a perl script to quickly create the makefiles.
7883 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
7884 dnl for the files it cannot handle correctly. This way, config.status
7885 dnl will handle these files.
7886 dnl If it fails, nothing is set and config.status will run as usual.
7888 dnl This does not change the $MAKEFILES variable.
7890 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
7892 if test -z "${AS_PERL}"; then
7893 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
7895 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
7900 echo $MAKEFILES > unallmakefiles
7902 AC_OUTPUT($MAKEFILES)
7904 dnl ========================================================
7905 dnl = Setup a nice relatively clean build environment for
7906 dnl = sub-configures.
7907 dnl ========================================================
7910 CFLAGS="$_SUBDIR_CFLAGS"
7911 CPPFLAGS="$_SUBDIR_CPPFLAGS"
7912 CXXFLAGS="$_SUBDIR_CXXFLAGS"
7913 LDFLAGS="$_SUBDIR_LDFLAGS"
7914 HOST_CC="$_SUBDIR_HOST_CC"
7915 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
7916 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
7922 if test "$COMPILE_ENVIRONMENT"; then
7923 if test -z "$MOZ_NATIVE_NSPR" || test "$MOZ_LDAP_XPCOM"; then
7924 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
7925 if test -z "$MOZ_DEBUG"; then
7926 ac_configure_args="$ac_configure_args --disable-debug"
7928 if test "$MOZ_OPTIMIZE" = "1"; then
7929 ac_configure_args="$ac_configure_args --enable-optimize"
7931 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
7932 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
7934 if test -n "$HAVE_64BIT_OS"; then
7935 ac_configure_args="$ac_configure_args --enable-64bit"
7937 AC_OUTPUT_SUBDIRS(nsprpub)
7938 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
7941 if test -z "$MOZ_NATIVE_NSPR"; then
7942 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
7943 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
7944 if test ! "$VACPP" && test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
7945 _libs=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --libdir=$\(LIBXUL_DIST\)/lib --libs`
7946 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $_libs'" config/autoconf.mk
7948 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE" ; then
7949 _cflags=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --includedir=$\(LIBXUL_DIST\)/include/nspr --cflags`
7950 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $_cflags'" config/autoconf.mk
7952 rm -f config/autoconf.mk.bak
7955 # if we're building the LDAP XPCOM component, we need to build
7958 if test "$MOZ_LDAP_XPCOM"; then
7960 # these subdirs may not yet have been created in the build tree.
7961 # don't use the "-p" switch to mkdir, since not all platforms have it
7963 if test ! -d "directory"; then
7966 if test ! -d "directory/c-sdk"; then
7967 mkdir "directory/c-sdk"
7969 if test ! -d "directory/c-sdk/ldap"; then
7970 mkdir "directory/c-sdk/ldap"
7973 ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
7974 if test -z "$MOZ_DEBUG"; then
7975 ac_configure_args="$ac_configure_args --disable-debug"
7977 if test "$MOZ_OPTIMIZE" = "1"; then
7978 ac_configure_args="$ac_configure_args --enable-optimize"
7980 if test -n "$HAVE_64BIT_OS"; then
7981 ac_configure_args="$ac_configure_args --enable-64bit"
7983 AC_OUTPUT_SUBDIRS(directory/c-sdk)
7984 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
7986 fi # COMPILE_ENVIRONMENT