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 $@'
1596 MOZ_OPTIMIZE_FLAGS="-O2"
1598 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1599 CXXFLAGS="$CXXFLAGS -fpascal-strings -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_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions"
1720 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1721 # and that combo is not yet good at
1722 # debugging inlined functions (even
1723 # when using DWARF2 as the debugging
1726 case "${target_cpu}" in
1728 CFLAGS="$CFLAGS -mieee"
1729 CXXFLAGS="$CXXFLAGS -mieee"
1733 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1736 CFLAGS="$CFLAGS -Wa,-xgot"
1737 CXXFLAGS="$CXXFLAGS -Wa,-xgot"
1744 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1746 AR_EXTRACT="$AR -extract"
1748 AR_FLAGS='-OUT:"$@"'
1755 # certain versions of cygwin's makedepend barf on the
1756 # #include <string> vs -I./dist/include/string issue so don't use it
1762 HOST_AR='lib -OUT:$@'
1763 HOST_RANLIB='echo ranlib'
1765 WARNINGS_AS_ERRORS='-WX'
1766 MOZ_OPTIMIZE_FLAGS='-O1'
1767 AR_FLAGS='-NOLOGO -OUT:"$@"'
1769 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1770 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1773 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
1774 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1776 IMPORT_LIB_SUFFIX=lib
1778 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1781 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1782 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1784 MKSHLIB_UNFORCE_ALL=
1785 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1786 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1787 MOZ_DEBUG_FLAGS='-Zi'
1788 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1790 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1791 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1793 RANLIB='echo not_ranlib'
1794 STRIP='echo not_strip'
1795 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
1798 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1800 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
1801 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
1804 AC_DEFINE(HAVE_SNPRINTF)
1810 AC_DEFINE(HW_THREADS)
1811 AC_DEFINE(STDC_HEADERS)
1812 AC_DEFINE(NEW_H, <new>)
1813 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1815 TARGET_MD_ARCH=win32
1816 _PLATFORM_DEFAULT_TOOLKIT='windows'
1819 MOZ_ENABLE_COREXFONTS=
1820 MOZ_ENABLE_POSTSCRIPT=
1821 MOZ_USER_DIR="Mozilla"
1825 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1830 # certain versions of cygwin's makedepend barf on the
1831 # #include <string> vs -I./dist/include/string issue so don't use it
1833 if test -n "$GNU_CC"; then
1834 CC="$CC -mno-cygwin"
1835 CXX="$CXX -mno-cygwin"
1836 CPP="$CPP -mno-cygwin"
1837 CFLAGS="$CFLAGS -mms-bitfields"
1838 CXXFLAGS="$CXXFLAGS -mms-bitfields"
1839 DSO_LDOPTS='-shared'
1840 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1841 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1843 # Use temp file for windres (bug 213281)
1844 RCFLAGS='-O coff --use-temp-file'
1845 # mingw doesn't require kernel32, user32, and advapi32 explicitly
1846 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
1847 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
1849 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
1850 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
1852 IMPORT_LIB_SUFFIX=dll.a
1854 TARGET_COMPILER_ABI=msvc
1858 AR='lib -NOLOGO -OUT:"$@"'
1860 RANLIB='echo not_ranlib'
1861 STRIP='echo not_strip'
1866 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1871 IMPORT_LIB_SUFFIX=lib
1872 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1873 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1875 MKSHLIB_UNFORCE_ALL=
1876 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
1877 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1878 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1879 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
1880 MOZ_DEBUG_FLAGS='-Zi'
1881 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1882 WARNINGS_AS_ERRORS='-WX'
1883 MOZ_OPTIMIZE_FLAGS='-O1'
1884 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1886 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1887 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1888 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1889 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1890 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1891 if test $_MSC_VER -ge 1400; then
1892 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
1895 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
1896 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
1897 AC_DEFINE(HAVE_SNPRINTF)
1903 AC_DEFINE(HW_THREADS)
1904 AC_DEFINE(STDC_HEADERS)
1905 AC_DEFINE(NEW_H, <new>)
1906 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1907 TARGET_MD_ARCH=win32
1908 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
1911 MOZ_ENABLE_POSTSCRIPT=
1912 MOZ_USER_DIR="Mozilla"
1914 dnl Hardcode to win95 for now - cls
1915 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
1917 dnl set NO_X11 defines here as the general check is skipped on win32
1921 dnl MinGW/MSYS doesn't provide or need cygpath
1926 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
1928 *-cygwin*|*-msvc*|*-mks*)
1929 CYGPATH_W="cygpath -a -w"
1930 CYGPATH_S="sed -e s|\\\\|/|g"
1931 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
1935 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1937 if test -z "$MOZ_TOOLS"; then
1938 AC_MSG_ERROR([MOZ_TOOLS is not set])
1941 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
1942 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
1943 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
1945 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
1946 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
1948 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
1950 if test -n "$GLIB_PREFIX"; then
1951 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
1952 if test "$?" = "0"; then
1953 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
1954 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
1956 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
1958 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
1961 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
1963 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
1964 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
1966 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
1967 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
1968 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
1969 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
1970 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
1972 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
1975 if test -n "$LIBIDL_PREFIX"; then
1976 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
1977 if test "$?" = "0"; then
1978 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
1979 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
1981 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
1983 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
1986 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
1988 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
1989 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
1991 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
1992 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
1993 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
1995 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
1996 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
1998 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2000 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2003 *) # else cross-compiling
2004 if test -n "$GLIB_PREFIX"; then
2005 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2006 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2007 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2008 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2009 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2011 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2014 if test -n "$LIBIDL_PREFIX"; then
2015 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2016 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2017 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2019 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2020 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2022 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2025 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2040 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2047 CFLAGS="$CFLAGS -Dunix"
2048 CXXFLAGS="$CXXFLAGS -Dunix"
2049 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2051 DSO_PIC_CFLAGS='-fPIC -DPIC'
2052 DSO_LDOPTS='-shared'
2053 BIN_FLAGS='-Wl,--export-dynamic'
2055 DSO_PIC_CFLAGS='-fPIC -DPIC'
2056 DLL_SUFFIX=".so.1.0"
2057 DSO_LDOPTS='-shared'
2059 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2060 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2061 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2062 if test "$LIBRUNPATH"; then
2063 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2065 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2066 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2071 AC_DEFINE(_QNX_SOURCE)
2074 WARNINGS_AS_ERRORS=''
2075 MOZ_OPTIMIZE_FLAGS="-O"
2076 MOZ_DEBUG_FLAGS="-gstabs"
2079 LIBS="$LIBS -lsocket -lstdc++"
2080 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2081 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2082 if test "$with_x" != "yes"
2084 _PLATFORM_DEFAULT_TOOLKIT="photon"
2085 TK_CFLAGS='-I/usr/include/photon'
2088 case "${target_cpu}" in
2090 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2093 case "${host_cpu}" in
2101 DLL_SUFFIX=".so.1.0"
2103 DSO_PIC_CFLAGS='-fPIC'
2104 DSO_LDOPTS='-shared -fPIC'
2105 if test "$LIBRUNPATH"; then
2106 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2111 AC_DEFINE(NO_PW_GECOS)
2112 AC_DEFINE(NO_UDSOCK)
2113 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2115 MKSHLIB_FORCE_ALL='-all'
2116 MKSHLIB_UNFORCE_ALL='-none'
2118 AS_DASH_C_FLAG='-Wc/names=as_is'
2120 DSO_LDOPTS='-shared -auto_symvec'
2122 MOZ_DEBUG_LDFLAGS='-g'
2124 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2125 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2130 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2131 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2139 IMPORT_LIB_SUFFIX=lib
2142 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2143 MOZ_ENABLE_POSTSCRIPT=
2146 MOZ_USER_DIR="Mozilla"
2148 if test "$MOZTOOLS"; then
2149 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2151 AC_MSG_ERROR([MOZTOOLS is not set])
2155 if test -n "$GNU_CC"; then
2157 AC_DEFINE(XP_OS2_EMX)
2158 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2159 AC_DEFINE(TCPV40HDRS)
2162 CFLAGS="$CFLAGS -Zomf"
2163 CXXFLAGS="$CXXFLAGS -Zomf"
2165 BIN_FLAGS='-Zlinker /ST:0x100000'
2169 WARNINGS_AS_ERRORS='-Werror'
2170 MOZ_DEBUG_FLAGS="-g -fno-inline"
2171 MOZ_OPTIMIZE_FLAGS="-O2 -s"
2172 MOZ_OPTIMIZE_LDFLAGS="-Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2173 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2174 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2175 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2176 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2177 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2178 LDFLAGS="$LDFLAGS -Zhigh-mem"
2179 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2180 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2183 # GCC for OS/2 currently predefines these, but we don't want them
2184 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2185 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2187 AC_CACHE_CHECK(for __declspec(dllexport),
2189 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2191 ac_os2_declspec="yes",
2192 ac_os2_declspec="no")])
2193 if test "$ac_os2_declspec" = "yes"; then
2195 MOZ_OS2_USE_DECLSPEC='1'
2198 # Visual Age C++ build
2199 elif test "$VACPP" = "yes"; then
2200 MOZ_BUILD_ROOT=`pwd -D`
2203 AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
2212 CFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9"
2213 CXXFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9 /Gx+"
2214 MOZ_DEBUG_FLAGS="/Ti+"
2215 WARNINGS_AS_ERRORS='-WX'
2216 MOZ_OPTIMIZE_FLAGS="/O+ /Gl+ /G5 /qarch=pentium"
2218 MOZ_DEBUG_LDFLAGS="/DE"
2219 MOZ_OPTIMIZE_LDFLAGS="/OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
2222 IMPLIB='implib /NOL /NOI'
2223 FILTER='cppfilt -q -B -P'
2224 AC_DEFINE(NO_ANSI_KEYWORDS)
2227 AC_DEFINE(XP_OS2_VACPP)
2228 AC_DEFINE(TCPV40HDRS)
2229 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2230 AC_DEFINE(STDC_HEADERS)
2231 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2232 MKSHLIB='$(LD) $(DSO_LDOPTS)'
2233 MKCSHLIB='$(LD) $(DSO_LDOPTS)'
2234 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
2235 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcomct.lib'
2236 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2237 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2242 if test "$GNU_CC"; then
2243 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2244 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2247 MOZ_DEBUG_FLAGS='-g'
2248 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2249 CFLAGS="$CFLAGS -ieee"
2250 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2251 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2254 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2255 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2256 MKSHLIB_FORCE_ALL='-all'
2257 MKSHLIB_UNFORCE_ALL='-none'
2258 dnl Might fix the libxpcom.so breakage on this platform as well....
2259 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2260 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2262 if test -z "$GNU_CXX"; then
2265 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2269 DIRENT_INO=d_stat.st_ino
2270 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2271 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2272 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2273 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2274 AC_DEFINE(STDC_HEADERS)
2275 if test "$no_x" = "yes"; then
2276 _PLATFORM_DEFAULT_TOOLKIT='photon'
2277 TK_CFLAGS='-I/usr/nto/include/photon'
2278 TK_LIBS='-lphoton -lphrender'
2283 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2284 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2285 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2286 if test ! "$GNU_CC"; then
2291 dnl the qsort routine under solaris is faulty
2294 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2296 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2297 # libraries one level up (e.g. libnspr4.so)
2298 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2299 if test -z "$GNU_CC"; then
2301 MOZ_FIX_LINK_PATHS='-R $(LIBXUL_DIST)/bin'
2302 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2303 CFLAGS="$CFLAGS -xstrconst -xbuiltin=%all"
2304 CXXFLAGS="$CXXFLAGS -xbuiltin=%all -features=tmplife -norunpath"
2305 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2306 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2307 _SAVE_LDFLAGS=$LDFLAGS
2308 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2309 AC_TRY_LINK([#include <stdio.h>],
2310 [printf("Hello World\n");],
2312 [LDFLAGS=$_SAVE_LDFLAGS])
2314 WARNINGS_AS_ERRORS='-Werror'
2315 MOZ_OPTIMIZE_FLAGS="-xO4"
2316 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2317 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2318 MKSHLIB_FORCE_ALL='-z allextract'
2319 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2320 DSO_LDOPTS='-G -z muldefs'
2326 AS='/usr/ccs/bin/as'
2327 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2329 TARGET_COMPILER_ABI="sunc"
2330 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2331 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2332 AC_MSG_CHECKING([for Forte compiler version >= WS6U2])
2336 [#if (__SUNPRO_CC < 0x530)
2339 _BAD_COMPILER=,_BAD_COMPILER=1)
2340 if test -n "$_BAD_COMPILER"; then
2342 AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .])
2346 AC_MSG_RESULT([$_res])
2349 ASFLAGS="$ASFLAGS -fPIC"
2352 _WARNINGS_CXXFLAGS=''
2353 if test "$OS_RELEASE" = "5.3"; then
2354 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2357 if test "$OS_RELEASE" = "5.5.1"; then
2358 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2363 DSO_LDOPTS='-Bdynamic'
2364 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2365 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2367 AC_DEFINE(SPRINTF_RETURNS_STRING)
2368 case "$(target_os)" in
2370 DLL_SUFFIX='.so.1.0'
2376 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2380 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2385 dnl Only one oddball right now (QNX), but this gives us flexibility
2386 dnl if any other platforms need to override this in the future.
2387 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2389 dnl ========================================================
2390 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2391 dnl by now will not have any way to link most binaries (tests
2392 dnl as well as viewer, apprunner, etc.), because some symbols
2393 dnl will be left out of the "composite" .so's by ld as unneeded.
2394 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2395 dnl they can link in the static libs that provide the missing
2397 dnl ========================================================
2398 NO_LD_ARCHIVE_FLAGS=
2399 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2400 NO_LD_ARCHIVE_FLAGS=1
2404 NO_LD_ARCHIVE_FLAGS=
2407 NO_LD_ARCHIVE_FLAGS=
2410 NO_LD_ARCHIVE_FLAGS=
2412 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2413 if test -z "$GNU_CC"; then
2414 NO_LD_ARCHIVE_FLAGS=
2418 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2421 dnl Indicate that platform requires special thread safe
2422 dnl locking when starting up the OJI JVM
2423 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2424 dnl ========================================================
2427 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2431 dnl ========================================================
2432 dnl = Flags to strip unused symbols from .so components
2433 dnl ========================================================
2436 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2439 if test -z "$GNU_CC"; then
2440 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2442 if test -z "$GCC_USE_GNU_LD"; then
2443 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2445 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2450 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2453 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2455 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2456 if test -n "$GNU_CC"; then
2457 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2462 if test -z "$COMPILE_ENVIRONMENT"; then
2463 SKIP_COMPILER_CHECKS=1
2464 SKIP_LIBRARY_CHECKS=1
2467 if test -z "$SKIP_COMPILER_CHECKS"; then
2468 dnl Checks for typedefs, structures, and compiler characteristics.
2469 dnl ========================================================
2477 AC_STRUCT_ST_BLKSIZE
2478 AC_MSG_CHECKING(for siginfo_t)
2479 AC_CACHE_VAL(ac_cv_siginfo_t,
2480 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2481 #include <signal.h>],
2483 [ac_cv_siginfo_t=true],
2484 [ac_cv_siginfo_t=false])])
2485 if test "$ac_cv_siginfo_t" = true ; then
2486 AC_DEFINE(HAVE_SIGINFO_T)
2492 dnl Visual Age for os/2 also defines size_t and off_t in certain
2493 dnl header files. These defines make Visual Age use the mozilla
2495 if test "$VACPP" = "yes"; then
2500 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2501 dnl ========================================================
2502 AC_MSG_CHECKING(for int16_t)
2503 AC_CACHE_VAL(ac_cv_int16_t,
2504 [AC_TRY_COMPILE([#include <stdio.h>
2505 #include <sys/types.h>],
2507 [ac_cv_int16_t=true],
2508 [ac_cv_int16_t=false])])
2509 if test "$ac_cv_int16_t" = true ; then
2510 AC_DEFINE(HAVE_INT16_T)
2515 AC_MSG_CHECKING(for int32_t)
2516 AC_CACHE_VAL(ac_cv_int32_t,
2517 [AC_TRY_COMPILE([#include <stdio.h>
2518 #include <sys/types.h>],
2520 [ac_cv_int32_t=true],
2521 [ac_cv_int32_t=false])])
2522 if test "$ac_cv_int32_t" = true ; then
2523 AC_DEFINE(HAVE_INT32_T)
2528 AC_MSG_CHECKING(for int64_t)
2529 AC_CACHE_VAL(ac_cv_int64_t,
2530 [AC_TRY_COMPILE([#include <stdio.h>
2531 #include <sys/types.h>],
2533 [ac_cv_int64_t=true],
2534 [ac_cv_int64_t=false])])
2535 if test "$ac_cv_int64_t" = true ; then
2536 AC_DEFINE(HAVE_INT64_T)
2541 AC_MSG_CHECKING(for int64)
2542 AC_CACHE_VAL(ac_cv_int64,
2543 [AC_TRY_COMPILE([#include <stdio.h>
2544 #include <sys/types.h>],
2547 [ac_cv_int64=false])])
2548 if test "$ac_cv_int64" = true ; then
2549 AC_DEFINE(HAVE_INT64)
2554 AC_MSG_CHECKING(for uint)
2555 AC_CACHE_VAL(ac_cv_uint,
2556 [AC_TRY_COMPILE([#include <stdio.h>
2557 #include <sys/types.h>],
2560 [ac_cv_uint=false])])
2561 if test "$ac_cv_uint" = true ; then
2562 AC_DEFINE(HAVE_UINT)
2567 AC_MSG_CHECKING(for uint_t)
2568 AC_CACHE_VAL(ac_cv_uint_t,
2569 [AC_TRY_COMPILE([#include <stdio.h>
2570 #include <sys/types.h>],
2572 [ac_cv_uint_t=true],
2573 [ac_cv_uint_t=false])])
2574 if test "$ac_cv_uint_t" = true ; then
2575 AC_DEFINE(HAVE_UINT_T)
2580 AC_MSG_CHECKING(for uint16_t)
2581 AC_CACHE_VAL(ac_cv_uint16_t,
2582 [AC_TRY_COMPILE([#include <stdio.h>
2583 #include <sys/types.h>],
2584 [uint16_t foo = 0;],
2585 [ac_cv_uint16_t=true],
2586 [ac_cv_uint16_t=false])])
2587 if test "$ac_cv_uint16_t" = true ; then
2588 AC_DEFINE(HAVE_UINT16_T)
2594 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2595 dnl are defined when compiling C++ but not C. Since the result of this
2596 dnl test is used only in C++, do it in C++.
2599 AC_MSG_CHECKING(for uname.domainname)
2600 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2601 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2602 [ struct utsname *res; char *domain;
2603 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2604 [ac_cv_have_uname_domainname_field=true],
2605 [ac_cv_have_uname_domainname_field=false])])
2607 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2608 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2614 AC_MSG_CHECKING(for uname.__domainname)
2615 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2616 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2617 [ struct utsname *res; char *domain;
2618 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2619 [ac_cv_have_uname_us_domainname_field=true],
2620 [ac_cv_have_uname_us_domainname_field=false])])
2622 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2623 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2631 dnl Check for usable wchar_t (2 bytes, unsigned)
2632 dnl (we really don't need the unsignedness check anymore)
2633 dnl ========================================================
2635 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2636 ac_cv_have_usable_wchar_v2,
2637 [AC_TRY_COMPILE([#include <stddef.h>
2638 $configure_static_assert_macros],
2639 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2640 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2641 ac_cv_have_usable_wchar_v2="yes",
2642 ac_cv_have_usable_wchar_v2="no")])
2643 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2644 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2645 HAVE_CPP_2BYTE_WCHAR_T=1
2647 dnl This is really gcc-only
2648 dnl Do this test using CXX only since some versions of gcc
2649 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2650 dnl only have short-wchar support for c++.
2651 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2655 _SAVE_CXXFLAGS=$CXXFLAGS
2656 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2658 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2659 ac_cv_have_usable_wchar_option_v2,
2660 [AC_TRY_COMPILE([#include <stddef.h>
2661 $configure_static_assert_macros],
2662 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2663 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2664 ac_cv_have_usable_wchar_option_v2="yes",
2665 ac_cv_have_usable_wchar_option_v2="no")])
2667 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2668 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2669 HAVE_CPP_2BYTE_WCHAR_T=1
2671 CXXFLAGS=$_SAVE_CXXFLAGS
2676 dnl Check for .hidden assembler directive and visibility attribute.
2677 dnl Borrowed from glibc configure.in
2678 dnl ===============================================================
2679 if test "$GNU_CC"; then
2680 AC_CACHE_CHECK(for visibility(hidden) attribute,
2681 ac_cv_visibility_hidden,
2682 [cat > conftest.c <<EOF
2683 int foo __attribute__ ((visibility ("hidden"))) = 1;
2685 ac_cv_visibility_hidden=no
2686 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2687 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2688 ac_cv_visibility_hidden=yes
2693 if test "$ac_cv_visibility_hidden" = "yes"; then
2694 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2696 AC_CACHE_CHECK(for visibility(default) attribute,
2697 ac_cv_visibility_default,
2698 [cat > conftest.c <<EOF
2699 int foo __attribute__ ((visibility ("default"))) = 1;
2701 ac_cv_visibility_default=no
2702 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2703 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2704 ac_cv_visibility_default=yes
2709 if test "$ac_cv_visibility_default" = "yes"; then
2710 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2712 AC_CACHE_CHECK(for visibility pragma support,
2713 ac_cv_visibility_pragma,
2714 [cat > conftest.c <<EOF
2715 #pragma GCC visibility push(hidden)
2717 #pragma GCC visibility push(default)
2718 int foo_default = 1;
2720 ac_cv_visibility_pragma=no
2721 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2722 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2723 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2724 ac_cv_visibility_pragma=yes
2730 if test "$ac_cv_visibility_pragma" = "yes"; then
2731 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2732 ac_cv_have_visibility_class_bug,
2733 [cat > conftest.c <<EOF
2734 #pragma GCC visibility push(hidden)
2735 struct __attribute__ ((visibility ("default"))) TestStruct {
2738 __attribute__ ((visibility ("default"))) void TestFunc() {
2742 ac_cv_have_visibility_class_bug=no
2743 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2744 ac_cv_have_visibility_class_bug=yes
2746 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2747 ac_cv_have_visibility_class_bug=yes
2750 rm -rf conftest.{c,S}
2753 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2754 ac_cv_have_visibility_builtin_bug,
2755 [cat > conftest.c <<EOF
2756 #pragma GCC visibility push(hidden)
2757 #pragma GCC visibility push(default)
2759 #pragma GCC visibility pop
2761 __attribute__ ((visibility ("default"))) void Func() {
2763 memset(c, 0, sizeof(c));
2766 ac_cv_have_visibility_builtin_bug=no
2767 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2768 ac_cv_have_visibility_builtin_bug=yes
2770 if test `grep -c "@PLT" conftest.S` = 0; then
2771 ac_cv_visibility_builtin_bug=yes
2774 rm -f conftest.{c,S}
2776 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2777 "$ac_cv_have_visibility_class_bug" = "no"; then
2778 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2779 WRAP_SYSTEM_INCLUDES=1
2781 VISIBILITY_FLAGS='-fvisibility=hidden'
2782 fi # have visibility pragma bug
2783 fi # have visibility pragma
2784 fi # have visibility(default) attribute
2785 fi # have visibility(hidden) attribute
2788 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2789 AC_SUBST(VISIBILITY_FLAGS)
2791 dnl Checks for header files.
2792 dnl ========================================================
2794 case "$target_os" in
2796 # for stuff like -lXshm
2797 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2800 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
2801 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
2802 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
2803 AC_CHECK_HEADERS(malloc.h)
2804 AC_CHECK_HEADERS(X11/XKBlib.h)
2806 dnl These are all the places some variant of statfs can be hiding.
2807 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2809 dnl Try for MMX support
2810 dnl NB - later gcc versions require -mmmx for this header to be successfully
2811 dnl included (or another option which implies it, such as -march=pentium-mmx)
2812 AC_CHECK_HEADERS(mmintrin.h)
2814 dnl Check whether the compiler supports the new-style C++ standard
2815 dnl library headers (i.e. <new>) or needs the old "new.h"
2818 AC_CHECK_HEADER(new, [NEW_H=new])
2819 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2822 AC_ARG_ENABLE(dtrace,
2823 build with dtrace support if available (default=no),
2824 [enable_dtrace="yes"],)
2825 if test "x$enable_dtrace" = "xyes"; then
2826 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2827 if test -n "$HAVE_DTRACE"; then
2828 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
2830 AC_MSG_ERROR([dtrace enabled but sys/std.h not found]);
2833 AC_SUBST(HAVE_DTRACE)
2839 AC_CHECK_HEADERS(sys/cdefs.h)
2843 dnl Checks for libraries.
2844 dnl ========================================================
2849 AC_CHECK_LIB(c_r, gethostbyname_r)
2853 dnl We don't want to link with libdl even if it's present on OS X, since
2854 dnl it's not used and not part of the default installation.
2855 dnl The same goes for BeOS.
2856 dnl We don't want to link against libm or libpthread on Darwin since
2857 dnl they both are just symlinks to libSystem and explicitly linking
2858 dnl against libSystem causes issues when debugging (see bug 299601).
2865 AC_CHECK_LIB(m, atan)
2866 AC_CHECK_LIB(dl, dlopen,
2867 AC_CHECK_HEADER(dlfcn.h,
2869 AC_DEFINE(HAVE_LIBDL)))
2873 _SAVE_CFLAGS="$CFLAGS"
2874 CFLAGS="$CFLAGS -D_GNU_SOURCE"
2875 AC_CHECK_FUNCS(dladdr)
2876 CFLAGS="$_SAVE_CFLAGS"
2878 if test ! "$GNU_CXX"; then
2882 AC_CHECK_LIB(C_r, demangle)
2885 AC_CHECK_LIB(C, demangle)
2889 AC_CHECK_LIB(socket, socket)
2892 XLIBS="$X_EXTRA_LIBS"
2894 dnl ========================================================
2895 dnl Checks for X libraries.
2896 dnl Ordering is important.
2897 dnl Xt is dependent upon SM as of X11R6
2898 dnl ========================================================
2899 if test "$no_x" = "yes"; then
2902 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
2903 XLIBS="-lX11 $XLIBS"
2904 _SAVE_LDFLAGS="$LDFLAGS"
2905 LDFLAGS="$XLDFLAGS $LDFLAGS"
2906 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
2907 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
2908 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
2909 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
2912 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
2913 unset ac_cv_lib_Xt_XtFree
2914 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
2915 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
2916 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
2917 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
2920 # AIX needs the motif library linked before libXt to prevent
2921 # crashes in plugins linked against Motif - Bug #98892
2922 case "${target_os}" in
2924 XT_LIBS="-lXm $XT_LIBS"
2928 dnl ========================================================
2929 dnl = Check for XShm
2930 dnl ========================================================
2931 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
2933 AC_CHECK_HEADER(X11/extensions/XShm.h)
2934 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
2935 test -n "$_HAVE_XSHM_XEXT"; then
2936 AC_DEFINE(HAVE_XSHM)
2939 dnl ========================================================
2941 dnl ========================================================
2942 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
2944 AC_CHECK_HEADER(X11/extensions/XIElib.h)
2946 if test "$MOZ_XIE_LIBS"; then
2947 dnl ====================================================
2948 dnl = If XIE is present and is desired, turn it on
2949 dnl ====================================================
2959 LDFLAGS="$_SAVE_LDFLAGS"
2961 dnl ========================================================
2962 dnl = Check for freetype2 and its functionality
2963 dnl ========================================================
2964 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
2966 if test "$_HAVE_FREETYPE2"; then
2968 _SAVE_CFLAGS="$CFLAGS"
2969 LIBS="$LIBS $FT2_LIBS"
2970 CFLAGS="$CFLAGS $FT2_CFLAGS"
2972 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
2973 ac_cv_member_FT_Bitmap_Size_y_ppem,
2974 [AC_TRY_COMPILE([#include <ft2build.h>
2975 #include FT_FREETYPE_H],
2977 if (sizeof s.y_ppem) return 0;
2979 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
2980 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
2981 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
2982 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
2984 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
2986 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
2987 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
2988 [FT_Bitmap_Size structure includes y_ppem field])
2990 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
2993 CFLAGS="$_SAVE_CFLAGS"
3003 dnl ========================================================
3004 dnl = pthread support
3005 dnl = Start by checking whether the system support pthreads
3006 dnl ========================================================
3007 case "$target_os" in
3012 MOZ_CHECK_PTHREADS(pthreads,
3013 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3014 MOZ_CHECK_PTHREADS(pthread,
3015 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3016 MOZ_CHECK_PTHREADS(c_r,
3017 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3018 MOZ_CHECK_PTHREADS(c,
3027 dnl ========================================================
3028 dnl Check the command line for --with-pthreads
3029 dnl ========================================================
3030 MOZ_ARG_WITH_BOOL(pthreads,
3031 [ --with-pthreads Force use of system pthread library with NSPR ],
3032 [ if test "$USE_PTHREADS"x = x; then
3033 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3039 dnl ========================================================
3040 dnl Do the platform specific pthread hackery
3041 dnl ========================================================
3042 if test "$USE_PTHREADS"x != x
3045 dnl See if -pthread is supported.
3048 ac_cv_have_dash_pthread=no
3049 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3050 echo 'int main() { return 0; }' | cat > conftest.c
3051 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3052 if test $? -eq 0; then
3053 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3054 ac_cv_have_dash_pthread=yes
3055 case "$target_os" in
3057 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3060 CFLAGS="$CFLAGS -pthread"
3061 CXXFLAGS="$CXXFLAGS -pthread"
3067 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3070 dnl See if -pthreads is supported.
3072 ac_cv_have_dash_pthreads=no
3073 if test "$ac_cv_have_dash_pthread" = "no"; then
3074 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3075 echo 'int main() { return 0; }' | cat > conftest.c
3076 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3077 if test $? -eq 0; then
3078 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3079 ac_cv_have_dash_pthreads=yes
3080 CFLAGS="$CFLAGS -pthreads"
3081 CXXFLAGS="$CXXFLAGS -pthreads"
3085 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3090 AC_DEFINE(_REENTRANT)
3091 AC_DEFINE(_THREAD_SAFE)
3092 dnl -pthread links in -lc_r, so don't specify it explicitly.
3093 if test "$ac_cv_have_dash_pthread" = "yes"; then
3094 _PTHREAD_LDFLAGS="-pthread"
3096 _PTHREAD_LDFLAGS="-lc_r"
3100 *-*-openbsd*|*-*-bsdi*)
3101 AC_DEFINE(_REENTRANT)
3102 AC_DEFINE(_THREAD_SAFE)
3103 dnl -pthread links in -lc_r, so don't specify it explicitly.
3104 if test "$ac_cv_have_dash_pthread" = "yes"; then
3105 _PTHREAD_LDFLAGS="-pthread"
3110 AC_DEFINE(_REENTRANT)
3114 AC_DEFINE(_REENTRANT)
3118 AC_DEFINE(_REENTRANT)
3122 AC_DEFINE(_REENTRANT)
3126 AC_DEFINE(_REENTRANT)
3130 AC_DEFINE(_REENTRANT)
3131 if test ! "$GNU_CC"; then
3132 CFLAGS="$CFLAGS -mt"
3133 CXXFLAGS="$CXXFLAGS -mt"
3137 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3140 dnl ========================================================
3141 dnl See if mmap sees writes
3142 dnl For cross compiling, just define it as no, which is a safe default
3143 dnl ========================================================
3144 AC_MSG_CHECKING(whether mmap() sees write()s)
3150 #include <sys/mman.h>
3151 #include <sys/types.h>
3152 #include <sys/stat.h>
3155 char fname[] = "conftest.file";
3156 char zbuff[1024]; /* Fractional page is probably worst case */
3163 fd = open(fname, O_RDWR | O_CREAT, 0660);
3166 write(fd, zbuff, sizeof(zbuff));
3167 lseek(fd, 0, SEEK_SET);
3168 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3169 if(map==(char*)-1) return 2;
3170 for(i=0; fname[i]; i++) {
3171 int rc = write(fd, &fname[i], 1);
3172 if(map[i]!=fname[i]) return 4;
3179 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3181 AC_MSG_RESULT("$result")
3183 if test "$result" = "no"; then
3184 AC_DEFINE(MMAP_MISSES_WRITES)
3188 dnl Checks for library functions.
3189 dnl ========================================================
3190 AC_PROG_GCC_TRADITIONAL
3192 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64)
3193 AC_CHECK_FUNCS(flockfile getpagesize)
3195 dnl localtime_r and strtok_r are only present on MacOS version 10.2 and higher
3196 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100200"; then
3197 AC_CHECK_FUNCS(localtime_r strtok_r)
3200 dnl check for wcrtomb/mbrtowc
3201 dnl =======================================================================
3202 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3205 AC_CACHE_CHECK(for wcrtomb,
3207 [AC_TRY_LINK([#include <wchar.h>],
3208 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3209 ac_cv_have_wcrtomb="yes",
3210 ac_cv_have_wcrtomb="no")])
3211 if test "$ac_cv_have_wcrtomb" = "yes"; then
3212 AC_DEFINE(HAVE_WCRTOMB)
3214 AC_CACHE_CHECK(for mbrtowc,
3216 [AC_TRY_LINK([#include <wchar.h>],
3217 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3218 ac_cv_have_mbrtowc="yes",
3219 ac_cv_have_mbrtowc="no")])
3220 if test "$ac_cv_have_mbrtowc" = "yes"; then
3221 AC_DEFINE(HAVE_MBRTOWC)
3228 ac_cv_func_res_ninit,
3231 #define _BSD_SOURCE 1
3235 [int foo = res_ninit(&_res);],
3236 [ac_cv_func_res_ninit=yes],
3237 [ac_cv_func_res_ninit=no])
3240 if test "$ac_cv_func_res_ninit" = "yes"; then
3241 AC_DEFINE(HAVE_RES_NINIT)
3242 dnl must add the link line we do something as foolish as this... dougt
3244 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3245 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3250 [for gnu_get_libc_version()],
3251 ac_cv_func_gnu_get_libc_version,
3253 #ifdef HAVE_GNU_LIBC_VERSION_H
3254 #include <gnu/libc-version.h>
3257 [const char *glibc_version = gnu_get_libc_version();],
3258 [ac_cv_func_gnu_get_libc_version=yes],
3259 [ac_cv_func_gnu_get_libc_version=no]
3263 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3264 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3268 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3272 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3273 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3274 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3276 LIBS="$LIBS $_ICONV_LIBS"
3285 iconv_t h = iconv_open("", "");
3286 iconv(h, NULL, NULL, NULL, NULL);
3289 [ac_cv_func_iconv=yes],
3290 [ac_cv_func_iconv=no]
3293 if test "$ac_cv_func_iconv" = "yes"; then
3294 AC_DEFINE(HAVE_ICONV)
3295 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3296 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3297 LIBICONV="$_ICONV_LIBS"
3299 [for iconv() with const input],
3300 ac_cv_func_const_iconv,
3306 const char *input = "testing";
3307 iconv_t h = iconv_open("", "");
3308 iconv(h, &input, NULL, NULL, NULL);
3311 [ac_cv_func_const_iconv=yes],
3312 [ac_cv_func_const_iconv=no]
3315 if test "$ac_cv_func_const_iconv" = "yes"; then
3316 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3328 dnl **********************
3329 dnl *** va_copy checks ***
3330 dnl **********************
3331 dnl we currently check for all three va_copy possibilities, so we get
3332 dnl all results in config.log for bug reports.
3333 AC_MSG_CHECKING(for an implementation of va_copy())
3334 AC_CACHE_VAL(ac_cv_va_copy,[
3337 void f (int i, ...) {
3338 va_list args1, args2;
3339 va_start (args1, i);
3340 va_copy (args2, args1);
3341 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3343 va_end (args1); va_end (args2);
3345 int main() { f (0, 42); return 0; }],
3351 AC_MSG_RESULT($ac_cv_va_copy)
3352 AC_MSG_CHECKING(for an implementation of __va_copy())
3353 AC_CACHE_VAL(ac_cv___va_copy,[
3356 void f (int i, ...) {
3357 va_list args1, args2;
3358 va_start (args1, i);
3359 __va_copy (args2, args1);
3360 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3362 va_end (args1); va_end (args2);
3364 int main() { f (0, 42); return 0; }],
3365 ac_cv___va_copy=yes,
3370 AC_MSG_RESULT($ac_cv___va_copy)
3371 AC_MSG_CHECKING(whether va_lists can be copied by value)
3372 AC_CACHE_VAL(ac_cv_va_val_copy,[
3375 void f (int i, ...) {
3376 va_list args1, args2;
3377 va_start (args1, i);
3379 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3381 va_end (args1); va_end (args2);
3383 int main() { f (0, 42); return 0; }],
3384 ac_cv_va_val_copy=yes,
3385 ac_cv_va_val_copy=no,
3386 ac_cv_va_val_copy=yes
3389 if test "x$ac_cv_va_copy" = "xyes"; then
3390 AC_DEFINE(VA_COPY, va_copy)
3391 AC_DEFINE(HAVE_VA_COPY)
3392 elif test "x$ac_cv___va_copy" = "xyes"; then
3393 AC_DEFINE(VA_COPY, __va_copy)
3394 AC_DEFINE(HAVE_VA_COPY)
3397 if test "x$ac_cv_va_val_copy" = "xno"; then
3398 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3400 AC_MSG_RESULT($ac_cv_va_val_copy)
3402 dnl Check for dll-challenged libc's.
3403 dnl This check is apparently only needed for Linux.
3406 dnl ===================================================================
3409 rm -rf conftest* _conftest
3411 cat >> conftest.C <<\EOF
3416 void __dump_link_map(void) {
3417 struct link_map *map = _dl_loaded;
3418 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3421 dlopen("./conftest1.so",RTLD_LAZY);
3422 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3423 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3424 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3428 /* _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).*/
3429 int main() { printf("./conftest1.so\n"); }
3433 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3435 cat >> conftest1.C <<\EOF
3437 void foo(void) {printf("foo in dll called\n");}
3439 ${CXX-g++} -fPIC -c -g conftest1.C
3440 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3441 ${CXX-g++} -g conftest.C -o conftest -ldl
3442 cp -f conftest1.so conftest _conftest
3444 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3447 echo "*** Your libc has a bug that can result in loading the same dynamic"
3448 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3449 echo "*** or later. However, if you choose not to upgrade, the only effect"
3450 echo "*** will be excessive memory usage at runtime."
3454 rm -rf conftest* _conftest
3455 dnl ===================================================================
3459 dnl ===================================================================
3460 dnl ========================================================
3461 dnl By default, turn rtti and exceptions off on g++/egcs
3462 dnl ========================================================
3463 if test "$GNU_CXX"; then
3465 AC_MSG_CHECKING(for C++ exceptions flag)
3467 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3468 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3469 [echo "int main() { return 0; }" | cat > conftest.C
3471 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3473 if egrep "warning.*renamed" conftest.out >/dev/null; then
3474 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3476 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3481 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3482 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3483 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3486 dnl ========================================================
3487 dnl Put your C++ language/feature checks below
3488 dnl ========================================================
3492 if test "$GNU_CC"; then
3493 AC_CACHE_CHECK(for gcc 3.0 ABI,
3494 ac_cv_gcc_three_abi,
3497 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3503 ac_cv_gcc_three_abi="yes",
3504 ac_cv_gcc_three_abi="no")])
3505 if test "$ac_cv_gcc_three_abi" = "yes"; then
3506 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3509 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3512 AC_SUBST(HAVE_GCC3_ABI)
3515 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3517 [AC_TRY_COMPILE(class X {
3518 public: explicit X(int i) : i_(i) {}
3522 ac_cv_cpp_explicit=yes,
3523 ac_cv_cpp_explicit=no)])
3524 if test "$ac_cv_cpp_explicit" = yes ; then
3525 AC_DEFINE(HAVE_CPP_EXPLICIT)
3528 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3530 [AC_TRY_COMPILE(class param {
3532 typedef unsigned long num_type;
3535 template <class T> class tplt {
3537 typedef typename T::num_type t_num_type;
3538 t_num_type foo(typename T::num_type num) {
3544 ac_cv_cpp_typename=yes,
3545 ac_cv_cpp_typename=no)])
3546 if test "$ac_cv_cpp_typename" = yes ; then
3547 AC_DEFINE(HAVE_CPP_TYPENAME)
3550 dnl Check for support of modern template specialization syntax
3551 dnl Test code and requirement from scc@netscape.com.
3552 dnl Autoconf cut-and-paste job by waterson@netscape.com
3553 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3554 ac_cv_cpp_modern_specialize_template_syntax,
3555 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3557 template <> struct X<Y> { double a; };,
3560 ac_cv_cpp_modern_specialize_template_syntax=yes,
3561 ac_cv_cpp_modern_specialize_template_syntax=no)])
3562 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3563 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3567 dnl Some compilers support only full specialization, and some don't.
3568 AC_CACHE_CHECK(whether partial template specialization works,
3569 ac_cv_cpp_partial_specialization,
3570 [AC_TRY_COMPILE(template <class T> class Foo {};
3571 template <class T> class Foo<T*> {};,
3573 ac_cv_cpp_partial_specialization=yes,
3574 ac_cv_cpp_partial_specialization=no)])
3575 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3576 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3579 dnl Some compilers have limited support for operators with templates;
3580 dnl specifically, it is necessary to define derived operators when a base
3581 dnl class's operator declaration should suffice.
3582 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3583 ac_cv_need_derived_template_operators,
3584 [AC_TRY_COMPILE([template <class T> class Base { };
3586 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3587 template <class T> class Derived : public Base<T> { };],
3588 [Derived<char> a, b;
3589 Base<char> c = a + b;
3591 ac_cv_need_derived_template_operators=no,
3592 ac_cv_need_derived_template_operators=yes)])
3593 if test "$ac_cv_need_derived_template_operators" = yes ; then
3594 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3598 dnl Some compilers have trouble detecting that a template class
3599 dnl that derives from another template is actually an instance
3600 dnl of the base class. This test checks for that.
3601 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3602 ac_cv_need_cpp_template_cast_to_base,
3603 [AC_TRY_COMPILE([template <class T> class Base { };
3604 template <class T> class Derived : public Base<T> { };
3605 template <class T> int foo(const Base<T>&) { return 0; }],
3606 [Derived<char> bar; return foo(bar);],
3607 ac_cv_need_cpp_template_cast_to_base=no,
3608 ac_cv_need_cpp_template_cast_to_base=yes)])
3609 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3610 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3613 dnl Some compilers have trouble resolving the ambiguity between two
3614 dnl functions whose arguments differ only by cv-qualifications.
3615 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3616 ac_cv_can_resolve_const_ambiguity,
3618 template <class T> class ptrClass {
3622 template <class T> T* a(ptrClass<T> *arg) {
3627 const T* a(const ptrClass<T> *arg) {
3633 ac_cv_can_resolve_const_ambiguity=yes,
3634 ac_cv_can_resolve_const_ambiguity=no)])
3635 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3636 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3640 dnl We don't do exceptions on unix. The only reason this used to be here
3641 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3642 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3643 dnl So im commenting this out until someone writes some artificial
3644 dnl intelligence to detect not only if the compiler has exceptions, but if
3645 dnl they are enabled as well.
3647 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3648 dnl ac_cv_cpp_exceptions,
3649 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3650 dnl static void F() { throw X(); },
3651 dnl try { F(); } catch(X & e) { },
3652 dnl ac_cv_cpp_exceptions=yes,
3653 dnl ac_cv_cpp_exceptions=no)])
3654 dnl if test $ac_cv_cpp_exceptions = yes ; then
3655 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3658 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3659 dnl supports it well enough to allow us to use it to change access, but not
3660 dnl to resolve ambiguity. The next two tests determine how well the |using|
3661 dnl keyword is supported.
3663 dnl Check to see if we can change access with |using|. Test both a
3664 dnl legal and an illegal example.
3665 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3666 ac_cv_cpp_access_changing_using2,
3668 class A { protected: int foo() { return 0; } };
3669 class B : public A { public: using A::foo; };,
3670 B b; return b.foo();,
3672 class A { public: int foo() { return 1; } };
3673 class B : public A { private: using A::foo; };,
3674 B b; return b.foo();,
3675 ac_cv_cpp_access_changing_using2=no,
3676 ac_cv_cpp_access_changing_using2=yes)],
3677 ac_cv_cpp_access_changing_using2=no)])
3678 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3679 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3682 dnl Check to see if we can resolve ambiguity with |using|.
3683 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3684 ac_cv_cpp_ambiguity_resolving_using,
3685 [AC_TRY_COMPILE(class X {
3686 public: int go(const X&) {return 3;}
3687 int jo(const X&) {return 3;}
3689 class Y : public X {
3690 public: int go(int) {return 2;}
3691 int jo(int) {return 2;}
3693 private: using X::go;
3696 ac_cv_cpp_ambiguity_resolving_using=yes,
3697 ac_cv_cpp_ambiguity_resolving_using=no)])
3698 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3699 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3702 dnl Check to see if the |std| namespace is supported. If so, we'll want
3703 dnl to qualify any standard library calls with "std::" to ensure that
3704 dnl those functions can be resolved.
3705 AC_CACHE_CHECK(for \"std::\" namespace,
3706 ac_cv_cpp_namespace_std,
3707 [AC_TRY_COMPILE([#include <algorithm>],
3708 [return std::min(0, 1);],
3709 ac_cv_cpp_namespace_std=yes,
3710 ac_cv_cpp_namespace_std=no)])
3711 if test "$ac_cv_cpp_namespace_std" = yes ; then
3712 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3715 dnl Older compilers are overly ambitious with respect to using the standard
3716 dnl template library's |operator!=()| when |operator==()| is defined. In
3717 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3718 dnl ambiguity at compile-time. This test checks for that case.
3719 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3720 ac_cv_cpp_unambiguous_std_notequal,
3721 [AC_TRY_COMPILE([#include <algorithm>
3723 int operator==(const T1&, const T1&) { return 0; }
3724 int operator!=(const T1&, const T1&) { return 0; }],
3725 [T1 a,b; return a != b;],
3726 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3727 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3728 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3729 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
3733 AC_CACHE_CHECK(for C++ reinterpret_cast,
3734 ac_cv_cpp_reinterpret_cast,
3735 [AC_TRY_COMPILE(struct X { int i; };
3736 struct Y { int i; };,
3737 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
3738 ac_cv_cpp_reinterpret_cast=yes,
3739 ac_cv_cpp_reinterpret_cast=no)])
3740 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
3741 AC_DEFINE(HAVE_CPP_NEW_CASTS)
3744 dnl See if a dynamic_cast to void* gives the most derived object.
3745 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3746 ac_cv_cpp_dynamic_cast_void_ptr,
3747 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3748 class Y { int j; public: virtual ~Y() { } };
3749 class Z : public X, public Y { int k; };
3755 return !((((void*)&mdo != (void*)subx) &&
3756 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3757 (((void*)&mdo != (void*)suby) &&
3758 ((void*)&mdo == dynamic_cast<void*>(suby))));
3760 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3761 ac_cv_cpp_dynamic_cast_void_ptr=no,
3762 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3763 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3764 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3768 dnl note that this one is reversed - if the test fails, then
3769 dnl we require implementations of unused virtual methods. Which
3770 dnl really blows because it means we'll have useless vtable
3772 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3773 ac_cv_cpp_unused_required,
3774 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3776 ac_cv_cpp_unused_required=no,
3777 ac_cv_cpp_unused_required=yes)])
3778 if test "$ac_cv_cpp_unused_required" = yes ; then
3779 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3783 dnl Some compilers have trouble comparing a constant reference to a templatized
3784 dnl class to zero, and require an explicit operator==() to be defined that takes
3785 dnl an int. This test separates the strong from the weak.
3787 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3788 ac_cv_trouble_comparing_to_zero,
3789 [AC_TRY_COMPILE([#include <algorithm>
3790 template <class T> class Foo {};
3792 template <class T> int operator==(const T2*, const T&) { return 0; }
3793 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3794 [Foo<int> f; return (0 != f);],
3795 ac_cv_trouble_comparing_to_zero=no,
3796 ac_cv_trouble_comparing_to_zero=yes)])
3797 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3798 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3803 dnl End of C++ language/feature checks
3806 dnl ========================================================
3807 dnl = Internationalization checks
3808 dnl ========================================================
3810 dnl Internationalization and Locale support is different
3811 dnl on various UNIX platforms. Checks for specific i18n
3812 dnl features go here.
3814 dnl check for LC_MESSAGES
3815 AC_CACHE_CHECK(for LC_MESSAGES,
3816 ac_cv_i18n_lc_messages,
3817 [AC_TRY_COMPILE([#include <locale.h>],
3818 [int category = LC_MESSAGES;],
3819 ac_cv_i18n_lc_messages=yes,
3820 ac_cv_i18n_lc_messages=no)])
3821 if test "$ac_cv_i18n_lc_messages" = yes; then
3822 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3825 fi # SKIP_COMPILER_CHECKS
3828 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3829 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3832 dnl Mozilla specific options
3833 dnl ========================================================
3834 dnl The macros used for command line options
3835 dnl are defined in build/autoconf/altoptions.m4.
3838 dnl ========================================================
3840 dnl = Check for external package dependencies
3842 dnl ========================================================
3843 MOZ_ARG_HEADER(External Packages)
3847 MOZ_ARG_WITH_STRING(libxul-sdk,
3848 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
3849 LIBXUL_SDK_DIR=$withval)
3851 if test "$LIBXUL_SDK_DIR" = "yes"; then
3852 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
3853 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
3854 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
3856 if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
3857 AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
3862 AC_SUBST(LIBXUL_SDK)
3864 dnl ========================================================
3865 dnl = If NSPR was not detected in the system,
3866 dnl = use the one in the source tree (mozilla/nsprpub)
3867 dnl ========================================================
3868 MOZ_ARG_WITH_BOOL(system-nspr,
3869 [ --with-system-nspr Use system installed NSPR],
3870 _USE_SYSTEM_NSPR=1 )
3872 if test -n "$_USE_SYSTEM_NSPR"; then
3873 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
3876 if test -n "$MOZ_NATIVE_NSPR"; then
3877 _SAVE_CFLAGS=$CFLAGS
3878 CFLAGS="$CFLAGS $NSPR_CFLAGS"
3879 AC_TRY_COMPILE([#include "prlog.h"],
3880 [#ifndef PR_STATIC_ASSERT
3881 #error PR_STATIC_ASSERT not defined
3883 [MOZ_NATIVE_NSPR=1],
3884 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
3885 CFLAGS=$_SAVE_CFLAGS
3887 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --includedir=$(LIBXUL_DIST)/include/nspr --cflags`'
3888 # explicitly set libs for Visual Age C++ for OS/2
3889 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
3890 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''
3891 elif test "$OS_ARCH" = "WINCE"; then
3892 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3893 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3894 elif test "$OS_ARCH" = "WINNT"; then
3895 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
3896 if test -n "$GNU_CC"; then
3897 NSPR_LIBS="-L\$(LIBXUL_DIST)/lib -lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION"
3899 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
3902 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --libdir=$(LIBXUL_DIST)/lib --libs`'
3906 dnl ========================================================
3907 dnl = If NSS was not detected in the system,
3908 dnl = use the one in the source tree (mozilla/security/nss)
3909 dnl ========================================================
3911 MOZ_ARG_WITH_BOOL(system-nss,
3912 [ --with-system-nss Use system installed NSS],
3915 if test -n "$_USE_SYSTEM_NSS"; then
3916 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
3919 if test -n "$MOZ_NATIVE_NSS"; then
3920 NSS_LIBS="$NSS_LIBS -lcrmf"
3922 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
3924 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3925 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)smime'$NSS_VERSION'$(DLL_SUFFIX) \\\
3926 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)ssl'$NSS_VERSION'$(DLL_SUFFIX) \\\
3927 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)nss'$NSS_VERSION'$(DLL_SUFFIX) \\\
3928 $(LIBXUL_DIST)/lib/$(DLL_PREFIX)softokn'$NSS_VERSION'$(DLL_SUFFIX)'
3930 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
3932 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) \\\
3933 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)smime'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3934 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)ssl'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3935 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nss'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX) \\\
3936 $(LIBXUL_DIST)/lib/$(LIB_PREFIX)softokn'$NSS_VERSION'.$(IMPORT_LIB_SUFFIX)'
3938 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lsoftokn$NSS_VERSION"
3942 if test -z "$SKIP_LIBRARY_CHECKS"; then
3943 dnl system JPEG support
3944 dnl ========================================================
3945 MOZ_ARG_WITH_STRING(system-jpeg,
3946 [ --with-system-jpeg[=PFX]
3947 Use system libjpeg [installed at prefix PFX]],
3950 _SAVE_CFLAGS=$CFLAGS
3951 _SAVE_LDFLAGS=$LDFLAGS
3953 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
3954 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
3955 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
3957 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
3960 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
3963 if test "$SYSTEM_JPEG" = 1; then
3964 LIBS="$JPEG_LIBS $LIBS"
3965 AC_TRY_COMPILE([ #include <stdio.h>
3966 #include <sys/types.h>
3967 #include <jpeglib.h> ],
3968 [ #if JPEG_LIB_VERSION < $MOZJPEG
3969 #error "Insufficient JPEG library version ($MOZJPEG required)."
3972 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
3974 CFLAGS=$_SAVE_CFLAGS
3975 LDFLAGS=$_SAVE_LDFLAGS
3978 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
3979 JPEG_CFLAGS="-I${JPEG_DIR}/include"
3980 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
3983 dnl system ZLIB support
3984 dnl ========================================================
3985 MOZ_ARG_WITH_STRING(system-zlib,
3986 [ --with-system-zlib[=PFX]
3987 Use system libz [installed at prefix PFX]],
3990 _SAVE_CFLAGS=$CFLAGS
3991 _SAVE_LDFLAGS=$LDFLAGS
3993 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
3994 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
3995 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
3997 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4000 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4001 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4003 if test "$SYSTEM_ZLIB" = 1; then
4004 LIBS="$ZLIB_LIBS $LIBS"
4005 AC_TRY_COMPILE([ #include <stdio.h>
4007 #include <zlib.h> ],
4008 [ #if ZLIB_VERNUM < $MOZZLIB
4009 #error "Insufficient zlib version ($MOZZLIB required)."
4012 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4014 CFLAGS=$_SAVE_CFLAGS
4015 LDFLAGS=$_SAVE_LDFLAGS
4018 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4019 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4020 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4023 dnl system PNG Support
4024 dnl ========================================================
4025 MOZ_ARG_WITH_STRING(system-png,
4026 [ --with-system-png[=PFX]
4027 Use system libpng [installed at prefix PFX]],
4030 _SAVE_CFLAGS=$CFLAGS
4031 _SAVE_LDFLAGS=$LDFLAGS
4033 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4034 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4035 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4036 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4037 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4039 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4042 _SAVE_PNG_LIBS=$PNG_LIBS
4043 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4044 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4046 AC_CHECK_LIB(png, png_get_acTL, ,
4047 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4050 if test "$SYSTEM_PNG" = 1; then
4051 LIBS="$PNG_LIBS $LIBS"
4052 AC_TRY_COMPILE([ #include <stdio.h>
4053 #include <sys/types.h>
4055 [ #if PNG_LIBPNG_VER < $MOZPNG
4056 #error "Insufficient libpng version ($MOZPNG required)."
4058 #ifndef PNG_UINT_31_MAX
4059 #error "Insufficient libpng version."
4062 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4064 CFLAGS=$_SAVE_CFLAGS
4065 LDFLAGS=$_SAVE_LDFLAGS
4068 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4069 PNG_CFLAGS="-I${PNG_DIR}/include"
4070 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4073 fi # SKIP_LIBRARY_CHECKS
4075 dnl check whether to enable glitz
4076 dnl ========================================================
4077 MOZ_ARG_ENABLE_BOOL(glitz,
4078 [ --enable-glitz Enable Glitz for use with Cairo],
4081 if test "$MOZ_ENABLE_GLITZ"; then
4082 AC_DEFINE(MOZ_ENABLE_GLITZ)
4085 dnl ========================================================
4086 dnl Java SDK support
4087 dnl ========================================================
4089 MOZ_ARG_WITH_STRING(java-include-path,
4090 [ --with-java-include-path=dir Location of Java SDK headers],
4091 JAVA_INCLUDE_PATH=$withval)
4094 MOZ_ARG_WITH_STRING(java-bin-path,
4095 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4096 JAVA_BIN_PATH=$withval)
4098 dnl ========================================================
4102 dnl ========================================================
4104 MOZ_ARG_HEADER(Application)
4108 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4109 MOZ_BRANDING_DIRECTORY=
4111 MOZ_DBGRINFO_MODULES=
4113 MOZ_EXTENSIONS_ALL=" wallet xml-rpc venkman inspector irc typeaheadfind gnomevfs sroaming datetime finger cview layout-debug tasks sql xforms schema-validation reporter"
4115 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4116 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4129 MOZ_AUTH_EXTENSION=1
4130 MOZ_NO_ACTIVEX_SUPPORT=1
4131 MOZ_NO_INSPECTOR_APIS=
4132 MOZ_NO_XPCOM_OBSOLETE=
4137 MOZ_PLAINTEXT_EDITOR_ONLY=
4139 MOZ_PREF_EXTENSIONS=1
4140 MOZ_PROFILELOCKING=1
4141 MOZ_PROFILESHARING=1
4143 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4145 MOZ_PYTHON_DEBUG_SUFFIX=
4146 MOZ_PYTHON_DLL_SUFFIX=
4147 MOZ_PYTHON_INCLUDES=
4151 MOZ_PYTHON_VER_DOTTED=
4156 MOZ_STATIC_MAIL_BUILD=
4161 MOZ_UNIVERSALCHARDET=1
4163 MOZ_USE_NATIVE_UCONV=
4168 MOZ_XPFE_COMPONENTS=1
4170 MOZ_XSLT_STANDALONE=
4178 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4179 NECKO_SMALL_BUFFERS=
4182 XPC_IDISPATCH_SUPPORT=
4185 case "$target_os" in
4194 case "$target_os" in
4195 msvc*|mks*|cygwin*|mingw*)
4196 if test -z "$GNU_CC"; then
4197 XPC_IDISPATCH_SUPPORT=1
4198 MOZ_NO_ACTIVEX_SUPPORT=
4199 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4204 MOZ_ARG_ENABLE_STRING(application,
4205 [ --enable-application=APP
4215 content/xslt (Standalone Transformiix XSLT)
4216 netwerk (Standalone Necko)
4217 tools/update-packaging (AUS-related packaging tools)
4218 standalone (use this for standalone
4219 xpcom/xpconnect or to manually drive a build)],
4220 [ MOZ_BUILD_APP=$enableval ] )
4222 if test "$MOZ_BUILD_APP" = "macbrowser"; then
4223 AC_MSG_WARN([--enable-application=macbrowser is deprecated. Use --enable-application=camino.])
4224 MOZ_BUILD_APP=camino
4227 case "$MOZ_BUILD_APP" in
4229 MOZ_EMBEDDING_PROFILE=basic
4233 MOZ_EMBEDDING_PROFILE=default
4237 MOZ_ARG_WITH_STRING(embedding-profile,
4238 [ --with-embedding-profile=default|basic|minimal
4239 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4240 [ MOZ_EMBEDDING_PROFILE=$withval ])
4242 case "$MOZ_EMBEDDING_PROFILE" in
4244 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4245 MOZ_EMBEDDING_LEVEL_BASIC=1
4246 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4247 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4248 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4249 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4253 MOZ_EMBEDDING_LEVEL_DEFAULT=
4254 MOZ_EMBEDDING_LEVEL_BASIC=1
4255 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4256 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4257 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4259 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4262 MOZ_ENABLE_POSTSCRIPT=
4263 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4264 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4265 MOZ_IMG_ENCODERS_DEFAULT=
4273 MOZ_NO_ACTIVEX_SUPPORT=1
4274 MOZ_NO_INSPECTOR_APIS=1
4275 MOZ_NO_XPCOM_OBSOLETE=1
4278 MOZ_PLAINTEXT_EDITOR_ONLY=1
4280 MOZ_PREF_EXTENSIONS=
4285 MOZ_UNIVERSALCHARDET=
4287 MOZ_USE_NATIVE_UCONV=1
4289 MOZ_XPFE_COMPONENTS=
4294 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4295 NECKO_SMALL_BUFFERS=1
4296 NS_DISABLE_LOGGING=1
4302 MOZ_EMBEDDING_LEVEL_DEFAULT=
4303 MOZ_EMBEDDING_LEVEL_BASIC=
4304 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4305 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4307 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4310 MOZ_ENABLE_POSTSCRIPT=
4311 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4312 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4313 MOZ_IMG_ENCODERS_DEFAULT=
4321 MOZ_NO_ACTIVEX_SUPPORT=1
4322 MOZ_NO_INSPECTOR_APIS=1
4323 MOZ_NO_XPCOM_OBSOLETE=1
4326 MOZ_PLAINTEXT_EDITOR_ONLY=1
4328 MOZ_PREF_EXTENSIONS=
4335 MOZ_UNIVERSALCHARDET=
4337 MOZ_USE_NATIVE_UCONV=1
4339 MOZ_XPFE_COMPONENTS=
4346 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4347 NECKO_SMALL_BUFFERS=1
4348 NS_DISABLE_LOGGING=1
4354 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4358 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4359 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4360 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4362 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4363 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4364 XULRUNNER_STUB_NAME=$withval)
4366 if test -z "$XULRUNNER_STUB_NAME"; then
4367 case "$target_os" in
4369 XULRUNNER_STUB_NAME=xulrunner
4372 XULRUNNER_STUB_NAME=xulrunner-stub
4375 AC_SUBST(XULRUNNER_STUB_NAME)
4377 if test -z "$MOZ_BUILD_APP"; then
4378 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4380 # We have a valid application only if it has a build.mk file in its top
4382 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4383 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4387 # Allow the application to influence configure with a confvars.sh script.
4389 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4390 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4391 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4392 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4397 # Now is a good time to test for logic errors, define mismatches, etc.
4398 case "$MOZ_BUILD_APP" in
4400 if test "$LIBXUL_SDK"; then
4401 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4405 # Fix this case for folks who forget. Warn them.
4406 if test -n "$LIBXUL_SDK" -a -z "$MOZ_XUL_APP"; then
4407 AC_MSG_WARN([Setting MOZ_XUL_APP since LIBXUL_SDK was set. Add to confvars.sh!])
4413 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4414 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4416 case "$MOZ_BUILD_APP" in
4418 AC_DEFINE(MOZ_SUITE)
4422 AC_DEFINE(MOZ_PHOENIX)
4430 AC_DEFINE(MOZ_THUNDERBIRD)
4434 AC_DEFINE(MOZ_STANDALONE_COMPOSER)
4438 AC_DEFINE(MOZ_SUNBIRD)
4442 AC_DEFINE(MOZ_XULRUNNER)
4446 AC_DEFINE(MOZ_MACBROWSER)
4454 MOZ_APP_NAME=mozilla
4455 MOZ_APP_DISPLAYNAME=Mozilla
4456 MOZ_APP_VERSION=$MOZILLA_VERSION
4461 AC_SUBST(MOZ_BUILD_APP)
4462 AC_SUBST(MOZ_XUL_APP)
4464 AC_SUBST(MOZ_PHOENIX)
4465 AC_SUBST(MOZ_THUNDERBIRD)
4466 AC_SUBST(MOZ_STANDALONE_COMPOSER)
4467 AC_SUBST(MOZ_SUNBIRD)
4468 AC_SUBST(MOZ_XULRUNNER)
4470 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4472 if test "$MOZ_XUL_APP"; then
4474 AC_DEFINE(MOZ_XUL_APP)
4477 dnl ========================================================
4479 dnl = Toolkit Options
4481 dnl ========================================================
4482 MOZ_ARG_HEADER(Toolkit Options)
4484 dnl ========================================================
4485 dnl = Select the default toolkit
4486 dnl ========================================================
4487 MOZ_ARG_ENABLE_STRING(default-toolkit,
4488 [ --enable-default-toolkit=TK
4489 Select default toolkit
4490 Platform specific defaults:
4492 Mac OS X - cairo-cocoa
4493 Neutrino/QNX - photon
4495 Win32 - cairo-windows
4498 [ _DEFAULT_TOOLKIT=$enableval ],
4499 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4501 if test "$_DEFAULT_TOOLKIT" = "photon" \
4502 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4503 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4504 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4505 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4506 -o "$_DEFAULT_TOOLKIT" = "cairo-mac" \
4507 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4509 dnl nglayout only supports building with one toolkit,
4510 dnl so ignore everything after the first comma (",").
4511 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4513 if test "$no_x" != "yes"; then
4514 AC_MSG_ERROR([Toolkit must be cairo-gtk2.])
4516 AC_MSG_ERROR([Toolkit must be $_PLATFORM_DEFAULT_TOOLKIT (if supported).])
4520 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4522 dnl ========================================================
4523 dnl = Enable the toolkit as needed =
4524 dnl ========================================================
4526 case "$MOZ_WIDGET_TOOLKIT" in
4529 AC_DEFINE(MOZ_WIDGET_PHOTON)
4533 MOZ_WIDGET_TOOLKIT=windows
4534 MOZ_GFX_TOOLKIT=cairo
4535 MOZ_ENABLE_CAIRO_GFX=1
4539 MOZ_WIDGET_TOOLKIT=gtk2
4540 MOZ_GFX_TOOLKIT=cairo
4541 MOZ_ENABLE_CAIRO_GFX=1
4543 MOZ_ENABLE_XREMOTE=1
4544 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4545 TK_LIBS='$(MOZ_GTK2_LIBS)'
4546 AC_DEFINE(MOZ_WIDGET_GTK2)
4549 MOZ_WIDGET_TOOLKIT=beos
4550 MOZ_GFX_TOOLKIT=cairo
4551 MOZ_ENABLE_CAIRO_GFX=1
4552 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4553 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4557 MOZ_WIDGET_TOOLKIT=os2
4558 MOZ_GFX_TOOLKIT=cairo
4559 MOZ_ENABLE_CAIRO_GFX=1
4560 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4561 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4564 cairo-mac|cairo-cocoa)
4565 if test "$MOZ_WIDGET_TOOLKIT" = "cairo-cocoa"; then
4566 MOZ_WIDGET_TOOLKIT=cocoa
4567 AC_DEFINE(MOZ_WIDGET_COCOA)
4570 MOZ_WIDGET_TOOLKIT=mac
4572 MOZ_ENABLE_CAIRO_GFX=1
4573 MOZ_GFX_TOOLKIT=cairo
4574 MOZ_USER_DIR="Mozilla"
4575 AC_DEFINE(XP_MACOSX)
4576 AC_DEFINE(TARGET_CARBON)
4577 AC_DEFINE(TARGET_API_MAC_CARBON)
4578 TK_LIBS='-framework Carbon'
4579 TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
4580 CFLAGS="$CFLAGS $TK_CFLAGS"
4581 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4585 if test "$MOZ_ENABLE_XREMOTE"; then
4586 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4589 if test "$COMPILE_ENVIRONMENT"; then
4590 if test "$MOZ_ENABLE_GTK2"
4592 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gdk-x11-2.0 glib-2.0 gobject-2.0)
4594 fi # COMPILE_ENVIRONMENT
4596 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4598 dnl ========================================================
4599 dnl = startup-notification support module
4600 dnl ========================================================
4602 if test "$MOZ_ENABLE_GTK2"
4604 MOZ_ENABLE_STARTUP_NOTIFICATION=
4606 MOZ_ARG_ENABLE_BOOL(startup-notification,
4607 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4608 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4609 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4610 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4612 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4613 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4614 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4615 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4617 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4619 MOZ_ENABLE_STARTUP_NOTIFICATION=
4623 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4624 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4627 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4629 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4630 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4631 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4633 AC_SUBST(GTK_CONFIG)
4637 AC_SUBST(MOZ_ENABLE_GTK2)
4638 AC_SUBST(MOZ_ENABLE_PHOTON)
4639 AC_SUBST(MOZ_ENABLE_COCOA)
4640 AC_SUBST(MOZ_ENABLE_CAIRO_GFX)
4641 AC_SUBST(MOZ_ENABLE_GLITZ)
4642 AC_SUBST(MOZ_ENABLE_XREMOTE)
4643 AC_SUBST(MOZ_GTK2_CFLAGS)
4644 AC_SUBST(MOZ_GTK2_LIBS)
4648 if test "$MOZ_ENABLE_CAIRO_GFX"
4650 AC_DEFINE(MOZ_THEBES)
4651 AC_DEFINE(MOZ_CAIRO_GFX)
4654 if test "$MOZ_ENABLE_GTK2"
4661 dnl ========================================================
4663 dnl = Components & Features
4665 dnl ========================================================
4666 MOZ_ARG_HEADER(Components and Features)
4668 dnl ========================================================
4670 dnl ========================================================
4671 MOZ_ARG_ENABLE_STRING(ui-locale,
4672 [ --enable-ui-locale=ab-CD
4673 Select the user interface locale (default: en-US)],
4674 MOZ_UI_LOCALE=$enableval )
4675 AC_SUBST(MOZ_UI_LOCALE)
4677 dnl =========================================================
4678 dnl = Calendar client
4679 dnl =========================================================
4680 MOZ_ARG_ENABLE_BOOL(calendar,,
4684 if test "$MOZ_OLD_CALENDAR"; then
4685 AC_MSG_WARN([Building with the calendar extension is no longer supported.])
4686 if test "$MOZ_THUNDERBIRD"; then
4687 AC_MSG_WARN([Since you're trying to build mail, you could try adding])
4688 AC_MSG_WARN(['--enable-extensions=default,lightning' to your mozconfig])
4689 AC_MSG_WARN([and building WITH A FRESH TREE.])
4691 AC_MSG_WARN([For more information, please visit:])
4692 AC_MSG_ERROR([http://www.mozilla.org/projects/calendar/])
4695 AC_SUBST(MOZ_CALENDAR)
4697 dnl =========================================================
4699 dnl =========================================================
4700 MOZ_ARG_DISABLE_BOOL(mailnews,
4701 [ --disable-mailnews Disable building of mail & news components],
4704 AC_SUBST(MOZ_MAIL_NEWS)
4706 dnl ========================================================
4707 dnl static mail build off by default
4708 dnl ========================================================
4709 MOZ_ARG_ENABLE_BOOL(static-mail,
4710 [ --enable-static-mail Enable static mail build support],
4711 MOZ_STATIC_MAIL_BUILD=1,
4712 MOZ_STATIC_MAIL_BUILD= )
4714 if test "$MOZ_STATIC_MAIL_BUILD"; then
4715 AC_DEFINE(MOZ_STATIC_MAIL_BUILD)
4718 AC_SUBST(MOZ_STATIC_MAIL_BUILD)
4720 dnl =========================================================
4722 dnl =========================================================
4723 MOZ_ARG_DISABLE_BOOL(ldap,
4724 [ --disable-ldap Disable LDAP support],
4728 dnl ========================================================
4729 dnl = Trademarked Branding
4730 dnl ========================================================
4731 MOZ_ARG_ENABLE_BOOL(official-branding,
4732 [ --enable-official-branding Enable Official mozilla.org Branding
4733 Do not distribute builds with
4734 --enable-official-branding unless you have
4735 permission to use trademarks per
4736 http://www.mozilla.org/foundation/trademarks/ .],
4737 [case "$MOZ_BUILD_APP" in
4739 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
4740 MOZ_APP_DISPLAYNAME=Firefox
4744 MOZ_BRANDING_DIRECTORY=other-licenses/branding/sunbird
4745 MOZ_APP_DISPLAYNAME=Sunbird
4749 MOZ_BRANDING_DIRECTORY=other-licenses/branding/thunderbird
4753 AC_MSG_ERROR([Official branding is only available for Firefox Sunbird and Thunderbird.])
4757 MOZ_ARG_WITH_STRING(branding,
4758 [ --with-branding=dir Use branding from the specified directory.],
4759 MOZ_BRANDING_DIRECTORY=$withval)
4761 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4762 if test -z "$REAL_BRANDING_DIRECTORY"; then
4763 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4766 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4767 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
4770 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4772 dnl ========================================================
4773 dnl = Distribution ID
4774 dnl ========================================================
4775 MOZ_ARG_WITH_STRING(distribution-id,
4776 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
4777 [ val=`echo $withval`
4778 MOZ_DISTRIBUTION_ID="$val"])
4780 if test -z "$MOZ_DISTRIBUTION_ID"; then
4781 MOZ_DISTRIBUTION_ID="org.mozilla"
4784 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4785 AC_SUBST(MOZ_DISTRIBUTION_ID)
4787 dnl ========================================================
4789 dnl ========================================================
4790 if test "$MOZ_ENABLE_GTK2"; then
4794 MOZ_ARG_DISABLE_BOOL(xft,
4795 [ --disable-xft Disable Xft support ],
4799 if test "$MOZ_ENABLE_XFT" && test -z "$MOZ_ENABLE_GTK2"; then
4800 AC_MSG_ERROR([Cannot enable XFT support for non-GTK2 toolkits.])
4803 if test "$MOZ_ENABLE_XFT"
4805 AC_DEFINE(MOZ_ENABLE_XFT)
4806 PKG_CHECK_MODULES(MOZ_XFT, xft)
4807 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
4810 AC_SUBST(MOZ_ENABLE_XFT)
4811 AC_SUBST(MOZ_XFT_CFLAGS)
4812 AC_SUBST(MOZ_XFT_LIBS)
4814 dnl ========================================================
4815 dnl = pango font rendering
4816 dnl ========================================================
4817 MOZ_ARG_ENABLE_BOOL(pango,
4818 [ --enable-pango Enable Pango font rendering support],
4822 if test "$MOZ_ENABLE_PANGO" && test -z "$MOZ_ENABLE_CAIRO_GFX"
4824 AC_MSG_ERROR([Cairo gfx is required for Pango font rendering])
4827 if test "$MOZ_ENABLE_GTK2" && test "$MOZ_ENABLE_CAIRO_GFX"
4829 # For gtk2, we require --enable-pango; gtk2 already implies --enable-xft
4830 if test -z "$MOZ_ENABLE_PANGO"
4832 AC_MSG_WARN([Pango is required for cairo gfx builds, assuming --enable-pango])
4837 if test "$MOZ_ENABLE_PANGO" && test "$MOZ_ENABLE_CAIRO_GFX"
4839 AC_DEFINE(MOZ_ENABLE_PANGO)
4840 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangocairo >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
4841 AC_SUBST(MOZ_ENABLE_PANGO)
4842 AC_SUBST(MOZ_PANGO_CFLAGS)
4843 AC_SUBST(MOZ_PANGO_LIBS)
4846 dnl ========================================================
4847 dnl = x11 core font support (default and ability to enable depend on toolkit)
4848 dnl ========================================================
4851 MOZ_ENABLE_COREXFONTS=${MOZ_ENABLE_COREXFONTS-1}
4853 MOZ_ENABLE_COREXFONTS=
4855 if test "$MOZ_ENABLE_COREXFONTS"
4857 AC_DEFINE(MOZ_ENABLE_COREXFONTS)
4860 AC_SUBST(MOZ_ENABLE_COREXFONTS)
4862 dnl ========================================================
4863 dnl = PostScript print module
4864 dnl ========================================================
4865 MOZ_ARG_DISABLE_BOOL(postscript,
4866 [ --disable-postscript Disable PostScript printing support ],
4867 MOZ_ENABLE_POSTSCRIPT=,
4868 MOZ_ENABLE_POSTSCRIPT=1 )
4870 dnl ========================================================
4871 dnl = GnomeVFS support module
4872 dnl ========================================================
4876 dnl build the gnomevfs extension by default only when the
4877 dnl GTK2 toolkit is in use.
4878 if test "$MOZ_ENABLE_GTK2"
4880 MOZ_ENABLE_GNOMEVFS=1
4882 MOZ_ENABLE_LIBGNOME=1
4885 MOZ_ARG_DISABLE_BOOL(gnomevfs,
4886 [ --disable-gnomevfs Disable GnomeVFS support ],
4887 MOZ_ENABLE_GNOMEVFS=,
4888 MOZ_ENABLE_GNOMEVFS=force)
4890 if test "$MOZ_ENABLE_GNOMEVFS"
4892 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4893 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4894 MOZ_ENABLE_GNOMEVFS=1
4896 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
4898 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
4900 MOZ_ENABLE_GNOMEVFS=
4904 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
4905 AC_SUBST(MOZ_GNOMEVFS_LIBS)
4907 if test "$MOZ_ENABLE_GCONF"
4909 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
4910 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
4917 AC_SUBST(MOZ_GCONF_CFLAGS)
4918 AC_SUBST(MOZ_GCONF_LIBS)
4920 if test "$MOZ_ENABLE_LIBGNOME"
4922 PKG_CHECK_MODULES(MOZ_LIBGNOME, libgnome-2.0 >= $LIBGNOME_VERSION,[
4923 MOZ_LIBGNOME_LIBS=`echo $MOZ_LIBGNOME_LIBS | sed 's/-llinc\>//'`
4924 MOZ_ENABLE_LIBGNOME=1
4926 MOZ_ENABLE_LIBGNOME=
4930 AC_SUBST(MOZ_LIBGNOME_CFLAGS)
4931 AC_SUBST(MOZ_LIBGNOME_LIBS)
4933 # The GNOME component is built if gtk2, gconf, gnome-vfs, and libgnome
4934 # are all available.
4936 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
4937 "$MOZ_ENABLE_GNOMEVFS" -a "$MOZ_ENABLE_LIBGNOME"; then
4938 MOZ_ENABLE_GNOME_COMPONENT=1
4940 MOZ_ENABLE_GNOME_COMPONENT=
4943 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
4946 dnl ========================================================
4947 dnl = libgnomeui support module
4948 dnl ========================================================
4950 if test "$MOZ_ENABLE_GTK2"
4952 MOZ_ENABLE_GNOMEUI=1
4954 MOZ_ARG_DISABLE_BOOL(gnomeui,
4955 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
4956 MOZ_ENABLE_GNOMEUI=,
4957 MOZ_ENABLE_GNOMEUI=force)
4959 if test "$MOZ_ENABLE_GNOMEUI"
4961 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
4963 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
4964 MOZ_ENABLE_GNOMEUI=1
4966 if test "$MOZ_ENABLE_GNOMEUI" = "force"
4968 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
4974 if test "$MOZ_ENABLE_GNOMEUI"; then
4975 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
4978 AC_SUBST(MOZ_ENABLE_GNOMEUI)
4979 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
4980 AC_SUBST(MOZ_GNOMEUI_LIBS)
4982 dnl ========================================================
4984 dnl ========================================================
4986 if test "$MOZ_ENABLE_GTK2"
4990 MOZ_ARG_DISABLE_BOOL(dbus,
4991 [ --disable-dbus Disable dbus support ],
4995 if test "$MOZ_ENABLE_DBUS"
4997 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
4998 AC_DEFINE(MOZ_ENABLE_DBUS)
5001 AC_SUBST(MOZ_ENABLE_DBUS)
5002 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5003 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5005 dnl ========================================================
5006 dnl = Setting MOZ_EXTRA_X11CONVERTERS turns on additional
5007 dnl = converters in intl/uconv that are used only by X11 gfx
5008 dnl = implementations. By default, it's undefined so that
5009 dnl = those converters are not built on other platforms/toolkits.
5010 dnl = (see bug 180851)
5011 dnl ========================================================
5013 if test "$MOZ_ENABLE_GTK2" \
5014 && test "$MOZ_ENABLE_COREXFONTS"
5016 AC_DEFINE(MOZ_EXTRA_X11CONVERTERS)
5017 MOZ_EXTRA_X11CONVERTERS=1
5019 AC_SUBST(MOZ_EXTRA_X11CONVERTERS)
5021 dnl ========================================================
5022 dnl = Build Personal Security Manager
5023 dnl ========================================================
5024 MOZ_ARG_DISABLE_BOOL(crypto,
5025 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5029 dnl ========================================================
5030 dnl = JS Debugger XPCOM component (js/jsd)
5031 dnl ========================================================
5032 MOZ_ARG_DISABLE_BOOL(jsd,
5033 [ --disable-jsd Disable JavaScript debug library],
5038 dnl ========================================================
5039 dnl = Disable plugin support
5040 dnl ========================================================
5041 MOZ_ARG_DISABLE_BOOL(plugins,
5042 [ --disable-plugins Disable plugins support],
5046 dnl ========================================================
5047 dnl = Open JVM Interface (OJI) support
5048 dnl ========================================================
5049 MOZ_ARG_DISABLE_BOOL(oji,
5050 [ --disable-oji Disable Open JVM Integration support],
5053 if test -n "$MOZ_OJI"; then
5057 dnl bi-directional support always on
5061 dnl ========================================================
5062 dnl complex text support off by default
5063 dnl ========================================================
5064 MOZ_ARG_ENABLE_BOOL(ctl,
5065 [ --enable-ctl Enable Thai Complex Script support],
5069 dnl ========================================================
5070 dnl view source support on by default
5071 dnl ========================================================
5072 MOZ_ARG_DISABLE_BOOL(view-source,
5073 [ --disable-view-source Disable view source support],
5076 if test "$MOZ_VIEW_SOURCE"; then
5077 AC_DEFINE(MOZ_VIEW_SOURCE)
5081 dnl ========================================================
5082 dnl accessibility support on by default on all platforms
5084 dnl ========================================================
5085 MOZ_ARG_DISABLE_BOOL(accessibility,
5086 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5089 if test "$ACCESSIBILITY"; then
5090 AC_DEFINE(ACCESSIBILITY)
5093 dnl ========================================================
5094 dnl xpfe/components on by default
5095 dnl ========================================================
5096 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5097 [ --disable-xpfe-components
5098 Disable xpfe components],
5099 MOZ_XPFE_COMPONENTS=,
5100 MOZ_XPFE_COMPONENTS=1 )
5102 dnl ========================================================
5103 dnl xpinstall support on by default
5104 dnl ========================================================
5105 MOZ_ARG_DISABLE_BOOL(xpinstall,
5106 [ --disable-xpinstall Disable xpinstall support],
5109 if test "$MOZ_XPINSTALL"; then
5110 AC_DEFINE(MOZ_XPINSTALL)
5113 dnl ========================================================
5114 dnl xpcom js loader support on by default
5115 dnl ========================================================
5116 MOZ_ARG_DISABLE_BOOL(jsloader,
5117 [ --disable-jsloader Disable xpcom js loader support],
5120 if test "$MOZ_JSLOADER"; then
5121 AC_DEFINE(MOZ_JSLOADER)
5124 dnl ========================================================
5125 dnl Disable printing
5126 dnl ========================================================
5127 MOZ_ARG_DISABLE_BOOL(printing,
5128 [ --disable-printing Disable printing support],
5132 if test "$NS_PRINTING"; then
5133 AC_DEFINE(NS_PRINTING)
5134 AC_DEFINE(NS_PRINT_PREVIEW)
5137 dnl ========================================================
5138 dnl use native unicode converters
5139 dnl ========================================================
5140 MOZ_ARG_ENABLE_BOOL(native-uconv,
5141 [ --enable-native-uconv Enable iconv support],
5142 MOZ_USE_NATIVE_UCONV=1,
5143 MOZ_USE_NATIVE_UCONV= )
5144 if test "$MOZ_USE_NATIVE_UCONV"; then
5145 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5147 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5148 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5152 dnl ========================================================
5153 dnl Libeditor can be build as plaintext-only,
5154 dnl or as a full html and text editing component.
5155 dnl We build both by default.
5156 dnl ========================================================
5157 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5158 [ --enable-plaintext-editor-only
5159 Allow only plaintext editing],
5160 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5161 MOZ_PLAINTEXT_EDITOR_ONLY= )
5162 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5163 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5165 dnl ========================================================
5166 dnl Composer is on by default.
5167 dnl ========================================================
5168 MOZ_ARG_DISABLE_BOOL(composer,
5169 [ --disable-composer Disable building of Composer],
5172 AC_SUBST(MOZ_COMPOSER)
5175 dnl ========================================================
5176 dnl = Drop XPCOM Obsolete library
5177 dnl ========================================================
5178 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5179 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5180 MOZ_NO_XPCOM_OBSOLETE=1,
5181 MOZ_NO_XPCOM_OBSOLETE=)
5183 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5184 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5187 dnl ========================================================
5188 dnl = Disable Fast Load
5189 dnl ========================================================
5190 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5191 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5195 AC_SUBST(MOZ_NO_FAST_LOAD)
5197 if test -n "$MOZ_NO_FAST_LOAD"; then
5198 AC_DEFINE(MOZ_NO_FAST_LOAD)
5201 dnl ========================================================
5202 dnl Permissions System
5203 dnl ========================================================
5204 MOZ_ARG_DISABLE_BOOL(permissions,
5205 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5210 dnl ========================================================
5212 dnl ========================================================
5213 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5214 [ --disable-negotiateauth Disable GSS-API negotiation ],
5215 MOZ_AUTH_EXTENSION=,
5216 MOZ_AUTH_EXTENSION=1 )
5218 dnl ========================================================
5220 dnl ========================================================
5221 MOZ_ARG_DISABLE_BOOL(xtf,
5222 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5225 if test "$MOZ_XTF"; then
5229 dnl ========================================================
5231 dnl ========================================================
5232 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5233 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5234 MOZ_NO_INSPECTOR_APIS=1,
5235 MOZ_NO_INSPECTOR_APIS= )
5237 dnl ========================================================
5239 dnl ========================================================
5240 MOZ_ARG_DISABLE_BOOL(xmlextras,
5241 [ --disable-xmlextras Disable XMLExtras such as XPointer support ],
5245 dnl ========================================================
5247 dnl ========================================================
5248 MOZ_ARG_ENABLE_BOOL(webservices,
5249 [ --enable-webservices Enable Webservices/SOAP support ],
5253 dnl ========================================================
5254 dnl Pref extensions (autoconfig and system-pref)
5255 dnl ========================================================
5256 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5257 [ --disable-pref-extensions
5258 Disable pref extensions such as autoconfig and
5260 MOZ_PREF_EXTENSIONS=,
5261 MOZ_PREF_EXTENSIONS=1 )
5263 dnl ========================================================
5264 dnl = Universalchardet
5265 dnl ========================================================
5266 MOZ_ARG_DISABLE_BOOL(universalchardet,
5267 [ --disable-universalchardet
5268 Disable universal encoding detection],
5269 MOZ_UNIVERSALCHARDET=,
5270 MOZ_UNIVERSALCHARDET=1 )
5272 dnl ========================================================
5274 dnl ========================================================
5275 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5276 [ --enable-javaxpcom
5277 Enable Java-XPCOM bridge],
5281 if test -n "${MOZ_JAVAXPCOM}"; then
5284 if test -n "$JAVA_HOME"; then
5285 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5289 if test -n "$JAVA_HOME"; then
5290 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5295 if test -n "${JAVA_INCLUDE_PATH}"; then
5296 dnl Make sure jni.h exists in the given include path.
5297 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5298 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5301 case "$target_os" in
5303 dnl Default to java system location
5304 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5308 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5311 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5312 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.])
5316 if test -n "${JAVA_BIN_PATH}"; then
5317 dnl Look for javac and jar in the specified path.
5318 JAVA_PATH="$JAVA_BIN_PATH"
5320 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5321 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5324 AC_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5325 AC_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5326 AC_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5327 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5328 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.])
5332 dnl ========================================================
5333 dnl = Breakpad crash reporting (on by default on supported platforms)
5334 dnl ========================================================
5336 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5337 || test "$OS_ARCH" = "Darwin" \
5338 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86") \
5339 && test -z "$HAVE_64BIT_OS"; then
5343 MOZ_ARG_DISABLE_BOOL(crashreporter,
5344 [ --disable-crashreporter Disable breakpad crash reporting],
5346 MOZ_CRASHREPORTER=1)
5348 if test -n "$MOZ_CRASHREPORTER"; then
5349 AC_DEFINE(MOZ_CRASHREPORTER)
5351 if test "$OS_ARCH" = "Linux" && \
5352 test -z "$SKIP_LIBRARY_CHECKS"; then
5353 _SAVE_LDFLAGS=$LDFLAGS
5354 LDFLAGS="$LDFLAGS -lcurl"
5355 AC_CACHE_CHECK(for libcurl,
5357 [AC_TRY_LINK([#include <curl/curl.h>],
5358 [curl_easy_init();],
5359 ac_cv_have_libcurl="yes",
5360 ac_cv_have_libcurl="no")])
5361 if test "$ac_cv_have_libcurl" = "no"; then
5362 AC_MSG_ERROR([Couldn't find libcurl, which is required for the crash reporter. Use --disable-crashreporter to disable the crash reporter.])
5364 LDFLAGS=$_SAVE_LDFLAGS
5368 dnl ========================================================
5369 dnl = Build mochitest JS/DOM tests (on by default)
5370 dnl ========================================================
5371 MOZ_ARG_DISABLE_BOOL(mochitest,
5372 [ --disable-mochitest Disable mochitest harness],
5376 dnl ========================================================
5377 dnl = Enable compilation of specific extension modules
5378 dnl ========================================================
5380 MOZ_ARG_ENABLE_STRING(extensions,
5381 [ --enable-extensions Enable extensions],
5382 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5383 if test "$option" = "yes" || test "$option" = "all"; then
5384 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_ALL"
5385 elif test "$option" = "no" || test "$option" = "none"; then
5387 elif test "$option" = "default"; then
5388 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5389 elif test `echo "$option" | grep -c \^-` != 0; then
5390 option=`echo $option | sed 's/^-//'`
5391 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5393 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5396 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5398 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5399 # Suppress warning on non-X11 platforms
5400 if test -n "$MOZ_X11"; then
5401 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5403 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5406 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5407 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5408 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5411 dnl This might be temporary: build tridentprofile only on Windows
5412 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5413 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5414 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5417 dnl cookie must be built before tridentprofile. put it at list's end.
5418 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5419 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5420 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5423 dnl schema-validation requires webservices
5424 if test -z "$MOZ_WEBSERVICES" && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -ne 0; then
5425 AC_MSG_WARN([Cannot build schema-validation without webservices. Removing schema-validation from MOZ_EXTENSIONS.])
5426 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|schema-validation||g'`
5429 dnl xforms requires xtf and webservices and schema-validation
5430 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5431 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5432 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5434 if test -z "$MOZ_WEBSERVICES" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5435 AC_MSG_WARN([Cannot build XForms without webservices. Removing XForms from MOZ_EXTENSIONS.])
5436 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5439 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5440 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5441 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5444 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5445 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5446 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5449 if test `echo "$MOZ_EXTENSIONS" | grep -c xmlextras` -ne 0; then
5450 AC_MSG_WARN([xmlextras is no longer an extension, use --disable-xmlextras to disable.])
5451 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xmlextras||g'`
5454 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5455 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5456 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5459 if test `echo "$MOZ_EXTENSIONS" | grep -c webservices` -ne 0; then
5460 AC_MSG_WARN([webservices is no longer an extension, use --disable-webservices to disable.])
5461 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|webservices||g'`
5464 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5465 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5466 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5469 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5470 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5471 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5474 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5475 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5476 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5479 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5480 AC_MSG_WARN([spellcheck is no longer an extension.])
5481 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5484 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5485 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5486 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5490 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5492 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5493 dnl when trying to build a non-existent extension.
5494 for extension in $MOZ_EXTENSIONS; do
5495 if test ! -d "${srcdir}/extensions/${extension}"; then
5496 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5501 dnl ========================================================
5503 dnl ========================================================
5504 case "$MOZ_WIDGET_TOOLKIT" in
5505 beos|windows|os2|mac|cocoa)
5508 if test -z "$MOZ_ENABLE_GTK2"; then
5509 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5514 MOZ_ARG_ENABLE_STRING(image-decoders,
5515 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5516 Enable specific image decoders],
5517 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5518 if test "$option" = "yes" || test "$option" = "all"; then
5519 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5520 elif test "$option" = "no" || test "$option" = "none"; then
5522 elif test "$option" = "default"; then
5523 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5524 elif test `echo "$option" | grep -c \^-` != 0; then
5525 option=`echo $option | sed 's/^-//'`
5526 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5528 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5531 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5533 dnl Dupes are removed in the encoder section because it will also add decoders
5535 dnl ========================================================
5537 dnl ========================================================
5538 MOZ_ARG_ENABLE_STRING(image-encoders,
5539 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5540 Enable specific image encoders],
5541 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5542 if test "$option" = "yes" || test "$option" = "all"; then
5543 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5544 elif test "$option" = "no" || test "$option" = "none"; then
5547 elif test "$option" = "default"; then
5548 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5549 elif test `echo "$option" | grep -c \^-` != 0; then
5550 option=`echo $option | sed 's/^-//'`
5551 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5553 addencoder="$option"
5555 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5557 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5560 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5561 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5563 dnl ========================================================
5564 dnl experimental ldap features
5565 dnl ========================================================
5566 MOZ_ARG_ENABLE_BOOL(ldap-experimental,
5567 [ --enable-ldap-experimental
5568 Enable LDAP experimental features],
5569 MOZ_LDAP_XPCOM_EXPERIMENTAL=1,
5570 MOZ_LDAP_XPCOM_EXPERIMENTAL=)
5572 dnl ========================================================
5573 dnl MathML on by default
5574 dnl ========================================================
5575 MOZ_ARG_DISABLE_BOOL(mathml,
5576 [ --disable-mathml Disable MathML support],
5579 if test "$MOZ_MATHML"; then
5580 AC_DEFINE(MOZ_MATHML)
5583 dnl ========================================================
5585 dnl ========================================================
5586 MOZ_ARG_DISABLE_BOOL(canvas,
5587 [ --disable-canvas Disable html:canvas feature],
5589 MOZ_ENABLE_CANVAS=1 )
5590 if test -n "$MOZ_ENABLE_CANVAS"; then
5591 AC_DEFINE(MOZ_ENABLE_CANVAS)
5593 AC_SUBST(MOZ_ENABLE_CANVAS)
5595 dnl ========================================================
5597 dnl ========================================================
5598 MOZ_ARG_DISABLE_BOOL(svg,
5599 [ --disable-svg Disable SVG support],
5602 if test -n "$MOZ_SVG"; then
5603 if test -z "$MOZ_ENABLE_CAIRO_GFX"; then
5604 AC_MSG_ERROR([SVG requires cairo gfx])
5610 MOZ_SVG_FOREIGNOBJECT=$MOZ_ENABLE_CAIRO_GFX
5611 dnl ========================================================
5612 dnl SVG <foreignObject>
5613 dnl ========================================================
5614 MOZ_ARG_DISABLE_BOOL(svg-foreignobject,
5615 [ --disable-svg-foreignobject
5616 Disable SVG <foreignObject> support],
5617 MOZ_SVG_FOREIGNOBJECT=,
5618 MOZ_SVG_FOREIGNOBJECT=1 )
5619 if test "$MOZ_SVG_FOREIGNOBJECT"; then
5620 if test -z "$MOZ_ENABLE_CAIRO_GFX"; then
5621 AC_MSG_ERROR([<foreignobject> requires cairo gfx])
5623 if test "$MOZ_SVG"; then
5624 AC_DEFINE(MOZ_SVG_FOREIGNOBJECT)
5626 MOZ_SVG_FOREIGNOBEJCT=
5631 dnl ========================================================
5633 dnl ========================================================
5634 case "$target_os" in
5635 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5640 MOZ_ARG_DISABLE_BOOL(installer,
5641 [ --disable-installer Disable building of installer],
5644 if test -n "$MOZ_INSTALLER" -a -n "$MOZ_XUL_APP" -a "$OS_ARCH" = "WINNT"; then
5645 # Disable installer for Windows builds that use the new toolkit if NSIS
5646 # isn't in the path.
5647 AC_PATH_PROGS(MAKENSIS, makensis)
5648 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5649 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5651 # The Windows build for NSIS requires the iconv command line utility to
5652 # convert the charset of the locale files.
5653 AC_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5654 if test -z "$HOST_ICONV"; then
5655 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5659 # Automatically disable installer if xpinstall isn't built
5660 if test -z "$MOZ_XPINSTALL"; then
5663 AC_SUBST(MOZ_INSTALLER)
5665 AC_MSG_CHECKING([for tar archiver])
5666 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
5667 if test -z "$TAR"; then
5668 AC_MSG_ERROR([no tar archiver found in \$PATH])
5670 AC_MSG_RESULT([$TAR])
5673 dnl ========================================================
5675 dnl ========================================================
5677 MOZ_ARG_DISABLE_BOOL(updater,
5678 [ --disable-updater Disable building of updater],
5681 # The Windows build requires the iconv command line utility
5682 # in order to build the updater.
5683 case "$target_os" in
5684 msvc*|mks*|cygwin*|mingw*|wince*)
5685 if test -n "$MOZ_UPDATER"; then
5686 AC_MSG_CHECKING([for iconv])
5687 AC_CHECK_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5688 if test -z "$HOST_ICONV"; then
5689 AC_MSG_ERROR([iconv not found in \$PATH])
5694 AC_SUBST(MOZ_UPDATER)
5696 # app update channel is 'default' when not supplied.
5697 MOZ_ARG_ENABLE_STRING([update-channel],
5698 [ --enable-update-channel=CHANNEL
5699 Select application update channel (default=default)],
5700 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
5702 if test -z "$MOZ_UPDATE_CHANNEL"; then
5703 MOZ_UPDATE_CHANNEL=default
5705 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5707 # tools/update-packaging is not checked out by default.
5708 MOZ_ARG_ENABLE_BOOL(update-packaging,
5709 [ --enable-update-packaging
5710 Enable tools/update-packaging],
5711 MOZ_UPDATE_PACKAGING=1,
5712 MOZ_UPDATE_PACKAGING= )
5713 AC_SUBST(MOZ_UPDATE_PACKAGING)
5715 dnl ========================================================
5717 dnl ========================================================
5719 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
5720 [ --disable-xpconnect-idispatch
5721 Disable building of xpconnect support for IDispatch
5723 XPC_IDISPATCH_SUPPORT=,
5724 XPC_IDISPATCH_SUPPORT=1)
5725 AC_SUBST(XPC_IDISPATCH_SUPPORT)
5727 MOZ_ARG_DISABLE_BOOL(activex,
5728 [ --disable-activex Disable building of ActiveX control (win32 only)],
5729 MOZ_NO_ACTIVEX_SUPPORT=1,
5730 MOZ_NO_ACTIVEX_SUPPORT= )
5731 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
5733 MOZ_ARG_DISABLE_BOOL(activex-scripting,
5734 [ --disable-activex-scripting
5735 Disable building of ActiveX scripting support (win32)],
5736 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
5737 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
5738 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
5740 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
5742 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
5745 dnl ========================================================
5747 dnl ========================================================
5748 MOZ_ARG_ENABLE_BOOL(leaky,
5749 [ --enable-leaky Build leaky memory tool],
5754 dnl ========================================================
5756 dnl ========================================================
5757 MOZ_ARG_ENABLE_BOOL(xpctools,
5758 [ --enable-xpctools Build JS profiling tool],
5763 dnl ========================================================
5764 dnl build the tests by default
5765 dnl ========================================================
5766 MOZ_ARG_DISABLE_BOOL(tests,
5767 [ --disable-tests Do not build test libraries & programs],
5771 dnl ========================================================
5773 dnl = Module specific options
5775 dnl ========================================================
5776 MOZ_ARG_HEADER(Individual module options)
5778 dnl ========================================================
5779 dnl = Enable Lea malloc in xpcom. OFF by default.
5780 dnl ========================================================
5781 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
5782 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
5785 if test -n "$XPCOM_USE_LEA"; then
5786 AC_DEFINE(XPCOM_USE_LEA)
5789 dnl ========================================================
5790 dnl = Enable places (new history/bookmarks)
5791 dnl ========================================================
5792 MOZ_ARG_ENABLE_BOOL(places,
5793 [ --enable-places Enable 'places' bookmark/history implementation],
5796 if test -n "$MOZ_PLACES"; then
5797 AC_DEFINE(MOZ_PLACES)
5798 if test -z "$MOZ_MAIL_NEWS"; then
5803 if test "$MOZ_BUILD_APP" = "browser"; then
5804 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
5808 dnl ========================================================
5809 dnl = Disable feed handling components
5810 dnl ========================================================
5811 MOZ_ARG_DISABLE_BOOL(feeds,
5812 [ --disable-feeds Disable feed handling and processing components],
5815 if test -n "$MOZ_FEEDS"; then
5816 AC_DEFINE(MOZ_FEEDS)
5818 if test "$MOZ_BUILD_APP" = "browser"; then
5819 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
5823 dnl ========================================================
5824 dnl = Enable mozStorage
5825 dnl = XXX need to implement --with-system-sqlite3 (see bug 263381)
5826 dnl ========================================================
5827 dnl Implicitly enabled by default if building calendar or places
5828 MOZ_ARG_ENABLE_BOOL(storage,
5829 [ --enable-storage Enable mozStorage module and related components],
5832 if test -n "$MOZ_STORAGE"; then
5833 AC_DEFINE(MOZ_STORAGE)
5836 dnl ========================================================
5837 dnl = Enable safe browsing (anti-phishing)
5838 dnl ========================================================
5839 MOZ_ARG_ENABLE_BOOL(safe-browsing,
5840 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
5841 MOZ_SAFE_BROWSING=1,
5842 MOZ_SAFE_BROWSING= )
5843 if test -n "$MOZ_SAFE_BROWSING"; then
5844 AC_DEFINE(MOZ_SAFE_BROWSING)
5846 AC_SUBST(MOZ_SAFE_BROWSING)
5848 dnl ========================================================
5849 dnl = Enable url-classifier
5850 dnl ========================================================
5851 dnl Implicitly enabled by default if building with safe-browsing
5852 if test -n "$MOZ_SAFE_BROWSING"; then
5853 MOZ_URL_CLASSIFIER=1
5855 MOZ_ARG_ENABLE_BOOL(url-classifier,
5856 [ --enable-url-classifier Enable url classifier module],
5857 MOZ_URL_CLASSIFIER=1,
5858 MOZ_URL_CLASSIFIER= )
5859 if test -n "$MOZ_URL_CLASSIFIER"; then
5860 AC_DEFINE(MOZ_URL_CLASSIFIER)
5862 AC_SUBST(MOZ_URL_CLASSIFIER)
5864 dnl ========================================================
5865 dnl = Disable zipwriter
5866 dnl ========================================================
5867 MOZ_ARG_DISABLE_BOOL(zipwriter,
5868 [ --disable-zipwriter Disable zipwriter component],
5871 AC_SUBST(MOZ_ZIPWRITER)
5873 dnl ========================================================
5874 dnl = Enable Ultrasparc specific optimizations for JS
5875 dnl ========================================================
5876 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
5877 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
5878 JS_ULTRASPARC_OPTS=1,
5879 JS_ULTRASPARC_OPTS= )
5881 dnl only enable option for ultrasparcs
5882 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
5883 "$OS_TEST" != "sun4u"; then
5886 AC_SUBST(JS_ULTRASPARC_OPTS)
5888 dnl ========================================================
5890 dnl = Feature options that require extra sources to be pulled
5892 dnl ========================================================
5893 dnl MOZ_ARG_HEADER(Features that require extra sources)
5895 dnl ========================================================
5897 dnl = Debugging Options
5899 dnl ========================================================
5900 MOZ_ARG_HEADER(Debugging and Optimizations)
5902 dnl ========================================================
5903 dnl = Disable building with debug info.
5904 dnl = Debugging is OFF by default
5905 dnl ========================================================
5906 if test -z "$MOZ_DEBUG_FLAGS"
5910 if test "$GNU_CC"; then
5911 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
5912 case "$GCC_VERSION" in
5917 MOZ_DEBUG_FLAGS="-g"
5921 MOZ_DEBUG_FLAGS="-g"
5925 MOZ_DEBUG_FLAGS="-g"
5930 MOZ_ARG_ENABLE_STRING(debug,
5931 [ --enable-debug[=DBG] Enable building with developer debug info
5932 (Using compiler flags DBG)],
5933 [ if test "$enableval" != "no"; then
5935 if test -n "$enableval" && test "$enableval" != "yes"; then
5936 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
5943 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
5944 case "${target_os}" in
5946 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
5948 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5949 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
5952 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
5955 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
5957 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
5959 if test -n "$MOZ_DEBUG"; then
5960 AC_MSG_CHECKING([for valid debug flags])
5961 _SAVE_CFLAGS=$CFLAGS
5962 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
5963 AC_TRY_COMPILE([#include <stdio.h>],
5964 [printf("Hello World\n");],
5967 AC_MSG_RESULT([$_results])
5968 if test "$_results" = "no"; then
5969 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
5971 CFLAGS=$_SAVE_CFLAGS
5974 dnl ========================================================
5975 dnl = Enable code optimization. ON by default.
5976 dnl ========================================================
5977 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
5978 MOZ_OPTIMIZE_FLAGS="-O"
5981 MOZ_ARG_ENABLE_STRING(optimize,
5982 [ --disable-optimize Disable compiler optimization
5983 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
5984 [ if test "$enableval" != "no"; then
5986 if test -n "$enableval" && test "$enableval" != "yes"; then
5987 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
5992 fi ], MOZ_OPTIMIZE=1)
5994 if test "$COMPILE_ENVIRONMENT"; then
5995 if test -n "$MOZ_OPTIMIZE"; then
5996 AC_MSG_CHECKING([for valid optimization flags])
5997 _SAVE_CFLAGS=$CFLAGS
5998 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
5999 AC_TRY_COMPILE([#include <stdio.h>],
6000 [printf("Hello World\n");],
6003 AC_MSG_RESULT([$_results])
6004 if test "$_results" = "no"; then
6005 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6007 CFLAGS=$_SAVE_CFLAGS
6009 fi # COMPILE_ENVIRONMENT
6011 AC_SUBST(MOZ_OPTIMIZE)
6012 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6013 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6015 dnl ========================================================
6016 dnl = Enable/disable debug for specific modules only
6017 dnl = module names beginning with ^ will be disabled
6018 dnl ========================================================
6019 MOZ_ARG_ENABLE_STRING(debug-modules,
6020 [ --enable-debug-modules Enable/disable debug info for specific modules],
6021 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6023 dnl ========================================================
6024 dnl = Enable/disable generation of debugger info for specific modules only
6025 dnl = the special module name ALL_MODULES can be used to denote all modules
6026 dnl = module names beginning with ^ will be disabled
6027 dnl ========================================================
6028 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6029 [ --enable-debugger-info-modules
6030 Enable/disable debugger info for specific modules],
6031 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6032 dnl note that the list of module names is reversed as it is copied
6033 dnl this is important, as it will allow config.mk to interpret stuff like
6034 dnl "^ALL_MODULES xpcom" properly
6035 if test "$i" = "no"; then
6038 if test "$i" = "yes"; then
6041 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6044 dnl ========================================================
6045 dnl Enable garbage collector
6046 dnl ========================================================
6047 MOZ_ARG_ENABLE_BOOL(boehm,
6048 [ --enable-boehm Enable the Boehm Garbage Collector],
6051 if test -n "$GC_LEAK_DETECTOR"; then
6052 AC_DEFINE(GC_LEAK_DETECTOR)
6055 dnl ========================================================
6056 dnl Disable runtime logging checks
6057 dnl ========================================================
6058 MOZ_ARG_DISABLE_BOOL(logging,
6059 [ --disable-logging Disable logging facilities],
6060 NS_DISABLE_LOGGING=1,
6061 NS_DISABLE_LOGGING= )
6062 if test "$NS_DISABLE_LOGGING"; then
6063 AC_DEFINE(NS_DISABLE_LOGGING)
6065 AC_DEFINE(MOZ_LOGGING)
6068 dnl ========================================================
6069 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6070 dnl ========================================================
6071 _ENABLE_LOGREFCNT=42
6072 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6073 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6074 _ENABLE_LOGREFCNT=1,
6075 _ENABLE_LOGREFCNT= )
6076 if test "$_ENABLE_LOGREFCNT" = "1"; then
6077 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6078 elif test -z "$_ENABLE_LOGREFCNT"; then
6079 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6082 dnl ========================================================
6083 dnl = Use malloc wrapper lib
6084 dnl ========================================================
6085 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6086 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6090 if test -n "$_WRAP_MALLOC"; then
6091 if test "$GNU_CC"; then
6092 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"
6093 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6097 dnl ========================================================
6098 dnl = Location of malloc wrapper lib
6099 dnl ========================================================
6100 MOZ_ARG_WITH_STRING(wrap-malloc,
6101 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6102 WRAP_MALLOC_LIB=$withval)
6104 dnl ========================================================
6105 dnl = Use Electric Fence
6106 dnl ========================================================
6107 MOZ_ARG_ENABLE_BOOL(efence,
6108 [ --enable-efence Link with Electric Fence],
6111 if test -n "$_ENABLE_EFENCE"; then
6112 AC_CHECK_LIB(efence,malloc)
6115 dnl ========================================================
6117 dnl ========================================================
6118 MOZ_ARG_ENABLE_BOOL(jprof,
6119 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6122 if test -n "$MOZ_JPROF"; then
6123 AC_DEFINE(MOZ_JPROF)
6127 dnl ========================================================
6128 dnl = Enable stripping of libs & executables
6129 dnl ========================================================
6130 MOZ_ARG_ENABLE_BOOL(strip,
6131 [ --enable-strip Enable stripping of libs & executables ],
6135 dnl ========================================================
6136 dnl = Enable stripping of libs & executables when packaging
6137 dnl ========================================================
6138 MOZ_ARG_ENABLE_BOOL(install-strip,
6139 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6143 dnl ========================================================
6144 dnl = --enable-elf-dynstr-gc
6145 dnl ========================================================
6146 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6147 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6148 USE_ELF_DYNSTR_GC=1,
6149 USE_ELF_DYNSTR_GC= )
6151 dnl ========================================================
6152 dnl = --enable-old-abi-compat-wrappers
6153 dnl ========================================================
6154 dnl on x86 linux, the current builds of some popular plugins (notably
6155 dnl flashplayer and real) expect a few builtin symbols from libgcc
6156 dnl which were available in some older versions of gcc. However,
6157 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6158 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6159 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6160 dnl to true on x86 linux, and false everywhere else.
6163 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6164 [ --enable-old-abi-compat-wrappers
6165 Support old GCC ABI symbols to ease the pain
6166 of the linux compiler change],
6167 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6168 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6169 if test "$COMPILE_ENVIRONMENT"; then
6170 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6173 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6175 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6177 fi # COMPILE_ENVIRONMENT
6179 dnl ========================================================
6180 dnl = --enable-prebinding
6181 dnl ========================================================
6182 MOZ_ARG_ENABLE_BOOL(prebinding,
6183 [ --enable-prebinding Enable prebinding (Mac OS X only)],
6187 dnl ========================================================
6189 dnl = Profiling and Instrumenting
6191 dnl ========================================================
6192 MOZ_ARG_HEADER(Profiling and Instrumenting)
6194 dnl ========================================================
6195 dnl = Enable timeline service, which provides lightweight
6196 dnl = instrumentation of mozilla for performance measurement.
6197 dnl = Timeline is off by default.
6198 dnl ========================================================
6199 MOZ_ARG_ENABLE_BOOL(timeline,
6200 [ --enable-timeline Enable timeline services ],
6203 if test -n "$MOZ_TIMELINE"; then
6204 AC_DEFINE(MOZ_TIMELINE)
6207 dnl ========================================================
6208 dnl Turn on reflow counting
6209 dnl ========================================================
6210 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6211 [ --enable-reflow-perf Enable reflow performance tracing],
6214 if test -n "$MOZ_REFLOW_PREF"; then
6215 AC_DEFINE(MOZ_REFLOW_PREF)
6217 AC_SUBST(MOZ_REFLOW_PERF)
6219 dnl ========================================================
6220 dnl Enable performance metrics.
6221 dnl ========================================================
6222 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6223 [ --enable-perf-metrics Enable performance metrics],
6226 if test -n "$MOZ_PERF_METRICS"; then
6227 AC_DEFINE(MOZ_PERF_METRICS)
6230 dnl ========================================================
6231 dnl Enable code size metrics.
6232 dnl ========================================================
6233 MOZ_ARG_ENABLE_BOOL(codesighs,
6234 [ --enable-codesighs Enable code size analysis tools],
6235 _ENABLE_CODESIGHS=1,
6236 _ENABLE_CODESIGHS= )
6237 if test -n "$_ENABLE_CODESIGHS"; then
6238 if test -d $srcdir/tools/codesighs; then
6241 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6245 dnl ========================================================
6246 dnl = Enable trace malloc
6247 dnl ========================================================
6248 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6249 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6250 [ --enable-trace-malloc Enable malloc tracing],
6253 if test "$NS_TRACE_MALLOC"; then
6254 # Please, Mr. Linker Man, don't take away our symbol names
6255 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6257 AC_DEFINE(NS_TRACE_MALLOC)
6259 AC_SUBST(NS_TRACE_MALLOC)
6261 dnl ========================================================
6262 dnl = Add support for Eazel profiler
6263 dnl ========================================================
6264 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6265 [ --enable-eazel-profiler-support
6266 Enable Corel/Eazel profiler support],
6267 ENABLE_EAZEL_PROFILER=1,
6268 ENABLE_EAZEL_PROFILER= )
6269 if test -n "$ENABLE_EAZEL_PROFILER"; then
6270 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6272 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6273 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6274 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6277 MOZ_ARG_ENABLE_STRING(profile-modules,
6278 [ --enable-profile-modules
6279 Enable/disable profiling for specific modules],
6280 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6282 MOZ_ARG_ENABLE_BOOL(insure,
6283 [ --enable-insure Enable insure++ instrumentation (linux only)],
6286 if test -n "$_ENABLE_INSURE"; then
6290 MOZ_INSURE_EXCLUDE_DIRS="config"
6293 MOZ_ARG_WITH_STRING(insure-dirs,
6294 [ --with-insure-dirs=DIRS
6295 Dirs to instrument with insure ],
6296 MOZ_INSURE_DIRS=$withval )
6298 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6299 [ --with-insure-exclude-dirs=DIRS
6300 Dirs to not instrument with insure ],
6301 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6303 dnl ========================================================
6304 dnl = Support for Quantify (Windows)
6305 dnl ========================================================
6306 MOZ_ARG_ENABLE_BOOL(quantify,
6307 [ --enable-quantify Enable Quantify support (Windows only) ],
6311 dnl ========================================================
6312 dnl = Support for demangling undefined symbols
6313 dnl ========================================================
6314 if test -z "$SKIP_LIBRARY_CHECKS"; then
6317 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6321 # Demangle only for debug or trace-malloc builds
6322 MOZ_DEMANGLE_SYMBOLS=
6323 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6324 MOZ_DEMANGLE_SYMBOLS=1
6325 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6327 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6329 dnl ========================================================
6330 dnl = Support for gcc stack unwinding (from gcc 3.3)
6331 dnl ========================================================
6332 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6333 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6336 dnl ========================================================
6340 dnl ========================================================
6341 MOZ_ARG_HEADER(Misc. Options)
6343 dnl ========================================================
6344 dnl update xterm title
6345 dnl ========================================================
6346 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6347 [ --enable-xterm-updates Update XTERM titles with current command.],
6351 dnl =========================================================
6353 dnl =========================================================
6354 MOZ_ARG_ENABLE_STRING([chrome-format],
6355 [ --enable-chrome-format=jar|flat|both|symlink
6356 Select FORMAT of chrome files (default=jar)],
6357 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6359 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6360 MOZ_CHROME_FILE_FORMAT=jar
6363 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6364 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6365 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6366 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6367 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6370 dnl ========================================================
6371 dnl = Define default location for MOZILLA_FIVE_HOME
6372 dnl ========================================================
6373 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6374 [ --with-default-mozilla-five-home
6375 Set the default value for MOZILLA_FIVE_HOME],
6376 [ val=`echo $withval`
6377 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
6379 dnl ========================================================
6380 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
6381 dnl ========================================================
6382 MOZ_ARG_WITH_STRING(user-appdir,
6383 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
6384 [ val=`echo $withval`
6385 if echo "$val" | grep "\/" >/dev/null; then
6386 AC_MSG_ERROR("Homedir must be single relative path.")
6391 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
6393 dnl ========================================================
6394 dnl = Doxygen configuration
6395 dnl ========================================================
6396 dnl Use commas to specify multiple dirs to this arg
6397 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
6398 MOZ_ARG_WITH_STRING(doc-input-dirs,
6399 [ --with-doc-input-dirs=DIRS
6400 Header/idl dirs to create docs from],
6401 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6402 AC_SUBST(MOZ_DOC_INPUT_DIRS)
6404 dnl Use commas to specify multiple dirs to this arg
6405 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
6406 MOZ_ARG_WITH_STRING(doc-include-dirs,
6407 [ --with-doc-include-dirs=DIRS
6408 Include dirs to preprocess doc headers],
6409 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6410 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
6412 MOZ_DOC_OUTPUT_DIR='./dist/docs'
6413 MOZ_ARG_WITH_STRING(doc-output-dir,
6414 [ --with-doc-output-dir=DIR
6415 Dir to generate docs into],
6416 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
6417 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
6419 if test -z "$SKIP_COMPILER_CHECKS"; then
6420 dnl ========================================================
6422 dnl = Compiler Options
6424 dnl ========================================================
6425 MOZ_ARG_HEADER(Compiler Options)
6427 dnl ========================================================
6428 dnl Check for gcc -pipe support
6429 dnl ========================================================
6430 AC_MSG_CHECKING([for gcc -pipe support])
6431 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
6432 echo '#include <stdio.h>' > dummy-hello.c
6433 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
6434 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
6435 cat dummy-hello.s | ${AS_BIN} -o dummy-hello.S - 2>&5
6436 if test $? = 0; then
6441 if test "$_res_as_stdin" = "yes"; then
6442 _SAVE_CFLAGS=$CFLAGS
6443 CFLAGS="$CFLAGS -pipe"
6444 AC_TRY_COMPILE( [ #include <stdio.h> ],
6445 [printf("Hello World\n");],
6446 [_res_gcc_pipe="yes"],
6447 [_res_gcc_pipe="no"] )
6448 CFLAGS=$_SAVE_CFLAGS
6450 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
6452 CFLAGS="$CFLAGS -pipe"
6453 CXXFLAGS="$CXXFLAGS -pipe"
6457 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
6458 AC_MSG_RESULT([$_res])
6463 dnl pass -Wno-long-long to the compiler
6464 MOZ_ARG_ENABLE_BOOL(long-long-warning,
6465 [ --enable-long-long-warning
6466 Warn about use of non-ANSI long long type],
6467 _IGNORE_LONG_LONG_WARNINGS=,
6468 _IGNORE_LONG_LONG_WARNINGS=1)
6470 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
6471 _SAVE_CFLAGS="$CFLAGS"
6472 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
6473 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
6474 AC_TRY_COMPILE([], [return(0);],
6475 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6476 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6477 result="yes" ], result="no")
6478 AC_MSG_RESULT([$result])
6479 CFLAGS="$_SAVE_CFLAGS"
6482 dnl Test for profiling options
6483 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
6484 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
6486 _SAVE_CFLAGS="$CFLAGS"
6487 CFLAGS="$CFLAGS -fprofile-generate"
6489 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
6490 AC_TRY_COMPILE([], [return 0;],
6491 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
6492 result="yes" ], result="no")
6493 AC_MSG_RESULT([$result])
6495 if test $result = "yes"; then
6496 PROFILE_USE_CFLAGS="-fprofile-use"
6498 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
6499 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
6500 AC_TRY_COMPILE([], [return 0;],
6501 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
6502 result="yes" ], result="no")
6503 AC_MSG_RESULT([$result])
6504 if test $result = "yes"; then
6505 PROFILE_USE_CFLAGS="-fbranch-probabilities"
6509 CFLAGS="$_SAVE_CFLAGS"
6511 AC_SUBST(PROFILE_GEN_CFLAGS)
6512 AC_SUBST(PROFILE_USE_CFLAGS)
6516 dnl ========================================================
6517 dnl Test for -pedantic bustage
6518 dnl ========================================================
6519 MOZ_ARG_DISABLE_BOOL(pedantic,
6520 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
6522 if test "$_PEDANTIC"; then
6523 _SAVE_CXXFLAGS=$CXXFLAGS
6524 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6525 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
6526 AC_TRY_COMPILE([$configure_static_assert_macros],
6527 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
6528 result="no", result="yes" )
6529 AC_MSG_RESULT([$result])
6530 CXXFLAGS="$_SAVE_CXXFLAGS"
6534 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
6535 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6538 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
6543 dnl ========================================================
6544 dnl Test for correct temporary object destruction order
6545 dnl ========================================================
6546 dnl We want to make sure the compiler follows the C++ spec here as
6547 dnl xpcom and the string classes depend on it (bug 235381).
6548 AC_MSG_CHECKING([for correct temporary object destruction order])
6549 AC_TRY_RUN([ class A {
6550 public: A(int& x) : mValue(x) {}
6552 operator char**() { return 0; }
6553 private: int& mValue;
6555 void func(char **arg) {}
6566 result="yes", result="no", result="maybe")
6567 AC_MSG_RESULT([$result])
6569 if test "$result" = "no"; then
6570 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
6573 dnl ========================================================
6574 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
6575 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
6576 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
6577 dnl ========================================================
6578 _SAVE_CXXFLAGS=$CXXFLAGS
6579 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
6580 AC_CACHE_CHECK(for correct overload resolution with const and templates,
6581 ac_nscap_nonconst_opeq_bug,
6590 template <class T, class U>
6591 int operator==(const Pointer<T>& rhs, U* lhs)
6593 return rhs.myPtr == lhs;
6596 template <class T, class U>
6597 int operator==(const Pointer<T>& rhs, const U* lhs)
6599 return rhs.myPtr == lhs;
6607 ac_nscap_nonconst_opeq_bug="no",
6608 ac_nscap_nonconst_opeq_bug="yes")])
6609 CXXFLAGS="$_SAVE_CXXFLAGS"
6611 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
6612 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
6614 fi # SKIP_COMPILER_CHECKS
6616 dnl ========================================================
6618 dnl Should be smarter and check that the compiler does indeed have rtti
6619 dnl ========================================================
6620 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
6621 [ --enable-cpp-rtti Enable C++ RTTI ],
6622 [ _MOZ_USE_RTTI=1 ],
6625 if test "$_MOZ_USE_RTTI"; then
6626 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
6628 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
6631 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
6633 dnl ========================================================
6634 dnl C++ exceptions (g++/egcs only - for now)
6635 dnl Should be smarter and check that the compiler does indeed have exceptions
6636 dnl ========================================================
6637 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
6638 [ --enable-cpp-exceptions Enable C++ exceptions ],
6639 [ _MOZ_CPP_EXCEPTIONS=1 ],
6640 [ _MOZ_CPP_EXCEPTIONS= ])
6642 if test "$_MOZ_CPP_EXCEPTIONS"; then
6643 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
6645 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
6648 # Irix & OSF native compilers do not like exception declarations
6649 # when exceptions are disabled
6650 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
6651 AC_DEFINE(CPP_THROW_NEW, [])
6653 AC_DEFINE(CPP_THROW_NEW, [throw()])
6657 dnl ========================================================
6659 dnl = Build depencency options
6661 dnl ========================================================
6662 MOZ_ARG_HEADER(Build dependencies)
6664 dnl ========================================================
6665 dnl = Do not auto generate dependency info
6666 dnl ========================================================
6668 MOZ_ARG_DISABLE_BOOL(auto-deps,
6669 [ --disable-auto-deps Do not automatically generate dependency info],
6673 if test -n "$MOZ_AUTO_DEPS"; then
6674 dnl ========================================================
6675 dnl = Use mkdepend instead of $CC -MD for dependency generation
6676 dnl ========================================================
6678 MOZ_ARG_DISABLE_BOOL(md,
6679 [ --disable-md Do not use compiler-based dependencies ],
6682 [dnl Default is to turn on -MD if using GNU-compatible compilers
6683 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
6686 dnl Default is to use -xM if using Sun Studio on Solaris
6687 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6690 if test "$_cpp_md_flag"; then
6692 if test "$OS_ARCH" = "OpenVMS"; then
6693 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(*F).pp))'
6695 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(*F).pp)'
6697 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
6698 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6703 _USE_CPP_INCLUDE_FLAG=
6704 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6705 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
6709 AC_SUBST(MOZ_AUTO_DEPS)
6710 AC_SUBST(COMPILER_DEPEND)
6714 dnl ========================================================
6716 dnl = Static Build Options
6718 dnl ========================================================
6719 MOZ_ARG_HEADER(Static build options)
6721 MOZ_ARG_ENABLE_BOOL(static,
6722 [ --enable-static Enable building of internal static libs],
6723 BUILD_STATIC_LIBS=1,
6726 dnl Disable libxul in debug builds, but not for xulrunner.
6727 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
6731 MOZ_ARG_ENABLE_BOOL(libxul,
6732 [ --enable-libxul Enable building of libxul],
6733 MOZ_ENABLE_LIBXUL=1,
6736 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
6737 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
6740 if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
6741 AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
6744 if test -n "$MOZ_ENABLE_LIBXUL"; then
6745 XPCOM_LIBS="$LIBXUL_LIBS"
6746 AC_DEFINE(MOZ_ENABLE_LIBXUL)
6748 if test -n "$BUILD_STATIC_LIBS"; then
6749 AC_DEFINE(MOZ_STATIC_BUILD)
6751 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
6754 dnl ========================================================
6755 dnl = Force JS to be a static lib
6756 dnl ========================================================
6757 MOZ_ARG_ENABLE_BOOL(js-static-build,
6758 [ --enable-js-static-build Force js to be a static lib],
6762 AC_SUBST(JS_STATIC_BUILD)
6764 if test -n "$JS_STATIC_BUILD"; then
6765 AC_DEFINE(EXPORT_JS_API)
6767 if test -z "$BUILD_STATIC_LIBS"; then
6768 AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static])
6773 dnl ========================================================
6775 dnl = Standalone module options
6777 dnl ========================================================
6778 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
6780 dnl Check for GLib and libIDL.
6781 dnl ========================================================
6782 case "$target_os" in
6783 msvc*|mks*|cygwin*|mingw*|wince*)
6784 SKIP_IDL_CHECK="yes"
6791 if test -z "$COMPILE_ENVIRONMENT"; then
6792 SKIP_IDL_CHECK="yes"
6795 dnl = Allow users to disable libIDL checking for standalone modules
6796 MOZ_ARG_WITHOUT_BOOL(libIDL,
6797 [ --without-libIDL Skip check for libIDL (standalone modules only)],
6798 SKIP_IDL_CHECK="yes")
6800 if test "$SKIP_IDL_CHECK" = "no"
6803 if test "$MACOS_SDK_DIR"; then
6804 dnl xpidl, and therefore libIDL, is only needed on the build host.
6805 dnl Don't build it against the SDK, as that causes problems.
6806 _MACSAVE_CFLAGS="$CFLAGS"
6807 _MACSAVE_LIBS="$LIBS"
6808 _MACSAVE_LDFLAGS="$LDFLAGS"
6809 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
6811 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"`
6812 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
6813 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
6818 if test "$MOZ_ENABLE_GTK2"; then
6819 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
6821 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
6822 dnl to either libIDL1 or libIDL2.
6823 if test -z "$_LIBIDL_FOUND"; then
6824 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
6825 if test -z "$_LIBIDL_FOUND"; then
6826 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
6830 dnl If we don't have a libIDL config program & not cross-compiling,
6831 dnl look for orbit-config instead.
6833 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
6834 AC_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
6835 if test -n "$ORBIT_CONFIG"; then
6836 AC_MSG_CHECKING([for ORBit libIDL usability])
6837 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
6838 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
6839 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
6840 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
6841 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
6842 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
6844 _SAVE_CFLAGS="$CFLAGS"
6846 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
6847 LIBS="$LIBIDL_LIBS $LIBS"
6850 #include <libIDL/IDL.h>
6853 s=strdup(IDL_get_libver_string());
6866 AC_MSG_RESULT($result)
6867 CFLAGS="$_SAVE_CFLAGS"
6871 if test -z "$_LIBIDL_FOUND"; then
6872 AC_MSG_ERROR([libIDL not found.
6873 libIDL $LIBIDL_VERSION or higher is required.])
6875 if test "$MACOS_SDK_DIR"; then
6876 CFLAGS="$_MACSAVE_CFLAGS"
6877 LIBS="$_MACSAVE_LIBS"
6878 LDFLAGS="$_MACSAVE_LDFLAGS"
6879 if test -n "$_MACSAVE_NEXT_ROOT" ; then
6880 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
6885 if test -n "$CROSS_COMPILE"; then
6886 if test -z "$HOST_LIBIDL_CONFIG"; then
6887 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
6889 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
6890 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
6891 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
6893 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
6894 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
6898 if test -z "$SKIP_PATH_CHECKS"; then
6899 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
6900 if test "$MOZ_ENABLE_GTK2"; then
6901 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
6903 AM_PATH_GLIB(${GLIB_VERSION})
6908 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
6909 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
6912 AC_SUBST(LIBIDL_CFLAGS)
6913 AC_SUBST(LIBIDL_LIBS)
6914 AC_SUBST(STATIC_LIBIDL)
6915 AC_SUBST(GLIB_CFLAGS)
6917 AC_SUBST(GLIB_GMODULE_LIBS)
6918 AC_SUBST(HOST_LIBIDL_CONFIG)
6919 AC_SUBST(HOST_LIBIDL_CFLAGS)
6920 AC_SUBST(HOST_LIBIDL_LIBS)
6922 dnl ========================================================
6923 dnl Check for libart
6924 dnl ========================================================
6925 if test "$MOZ_SVG_RENDERER_LIBART"; then
6926 if test ! -f $topsrcdir/other-licenses/libart_lgpl/Makefile.in; then
6927 AC_MSG_ERROR([You must check out the mozilla version of libart. Use
6928 mk_add_options MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl])
6931 dnl libart's configure hasn't been run yet, but we know what the
6932 dnl answer should be anyway
6933 MOZ_LIBART_CFLAGS='-I${DIST}/include/libart_lgpl'
6934 case "$target_os" in
6935 msvc*|mks*|cygwin*|mingw*|wince*)
6936 MOZ_LIBART_LIBS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)moz_art_lgpl.$(IMPORT_LIB_SUFFIX)'
6939 MOZ_LIBART_LIBS='-lmoz_art -lm'
6942 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lroot -lbe'
6945 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lm'
6951 AC_SUBST(MOZ_LIBART_CFLAGS)
6952 AC_SUBST(MOZ_LIBART_LIBS)
6954 dnl ========================================================
6956 dnl ========================================================
6957 if test "$MOZ_SVG" -o "$MOZ_ENABLE_CANVAS" -o "$MOZ_ENABLE_CAIRO_GFX" ; then
6958 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
6961 MOZ_ARG_ENABLE_BOOL(system-cairo,
6962 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
6966 # Check for headers defining standard int types.
6967 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
6969 if test "$MOZ_TREE_CAIRO"; then
6970 # For now we assume that we will have a uint64_t available through
6971 # one of the above headers or mozstdint.h.
6972 AC_DEFINE(HAVE_UINT64_T)
6974 # Define macros for cairo-features.h
6975 if test "$MOZ_X11"; then
6976 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
6977 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
6978 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
6979 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
6980 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6981 MOZ_ENABLE_CAIRO_FT=1
6982 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
6984 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
6985 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
6986 ATSUI_FONT_FEATURE="#define CAIRO_HAS_ATSUI_FONT 1"
6988 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
6989 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
6990 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
6991 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
6993 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
6994 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
6995 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6996 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
6997 MOZ_ENABLE_CAIRO_FT=1
6998 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
6999 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7001 if test "$MOZ_ENABLE_GLITZ"; then
7002 GLITZ_SURFACE_FEATURE="#define CAIRO_HAS_GLITZ_SURFACE 1"
7004 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7005 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7006 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7007 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7008 MOZ_ENABLE_CAIRO_FT=1
7010 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7011 AC_SUBST(CAIRO_FT_CFLAGS)
7013 if test "$MOZ_DEBUG"; then
7014 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7016 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7019 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7021 AC_SUBST(PS_SURFACE_FEATURE)
7022 AC_SUBST(PDF_SURFACE_FEATURE)
7023 AC_SUBST(SVG_SURFACE_FEATURE)
7024 AC_SUBST(XLIB_SURFACE_FEATURE)
7025 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7026 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7027 AC_SUBST(NQUARTZ_SURFACE_FEATURE)
7028 AC_SUBST(XCB_SURFACE_FEATURE)
7029 AC_SUBST(WIN32_SURFACE_FEATURE)
7030 AC_SUBST(OS2_SURFACE_FEATURE)
7031 AC_SUBST(BEOS_SURFACE_FEATURE)
7032 AC_SUBST(GLITZ_SURFACE_FEATURE)
7033 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7034 AC_SUBST(FT_FONT_FEATURE)
7035 AC_SUBST(WIN32_FONT_FEATURE)
7036 AC_SUBST(ATSUI_FONT_FEATURE)
7037 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7039 if test "$_WIN32_MSVC"; then
7040 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7041 if test "$MOZ_ENABLE_GLITZ"; then
7042 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'$(DEPTH)/gfx/cairo/glitz/src/mozglitz.lib $(DEPTH)/gfx/cairo/glitz/src/wgl/mozglitzwgl.lib'
7045 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"
7047 if test "$MOZ_X11"; then
7048 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7051 if test "$MOZ_ENABLE_GLITZ"; then
7052 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src -lmozglitz'
7053 if test "$MOZ_X11"; then
7054 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/glx -lmozglitzglx -lGL'
7056 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7057 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/wgl -lmozglitzwgl'
7062 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7063 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7064 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7068 AC_SUBST(MOZ_TREE_CAIRO)
7069 AC_SUBST(MOZ_CAIRO_CFLAGS)
7070 AC_SUBST(MOZ_CAIRO_LIBS)
7072 dnl ========================================================
7074 dnl ========================================================
7077 MOZ_ARG_ENABLE_BOOL(system-lcms,
7078 [ --enable-system-lcms Use system lcms (located with pkgconfig)],
7082 if test -z "$MOZ_NATIVE_LCMS"
7085 if test "$_WIN32_MSVC"; then
7086 if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
7087 LCMS_CFLAGS=-DLCMS_DLL
7089 LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
7091 LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
7094 PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_VERSION)
7097 AC_SUBST(MOZ_NATIVE_LCMS)
7098 AC_SUBST(LCMS_CFLAGS)
7101 dnl ========================================================
7103 dnl ========================================================
7104 MOZ_ARG_DISABLE_BOOL(xul,
7105 [ --disable-xul Disable XUL],
7107 if test "$MOZ_XUL"; then
7110 dnl remove extensions that require XUL
7111 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7116 dnl ========================================================
7117 dnl Two ways to enable Python support:
7118 dnl --enable-extensions=python # select all available.
7119 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7121 dnl --enable-extensions=python/xpcom,... # select individual ones
7123 dnl If either is used, we locate the Python to use.
7124 dnl ========================================================
7126 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7127 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7128 dnl Allow PYTHON to point to the Python interpreter to use
7129 dnl (note that it must be the python executable - which we
7130 dnl run to locate the relevant paths etc)
7131 dnl If not set, we use whatever Python we can find.
7133 dnl Ask Python what its version number is
7135 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7136 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7138 dnl Ask for the Python "prefix" (ie, home/source dir)
7139 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7140 dnl Setup the include and library directories.
7141 if test "$OS_ARCH" = "WINNT"; then
7142 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7143 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7144 dnl Binary trees have "include" for .h, and "libs" for .lib
7145 dnl We add 'em both - along with quotes, to handle spaces.
7146 MOZ_PYTHON_DLL_SUFFIX=.pyd
7147 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7148 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7150 dnl Non-Windows include and libs
7151 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7152 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7153 dnl Check for dynamic Python lib
7154 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7155 dnl - core, xpcom loader, pydom etc) all need to share Python.
7156 dnl - Python 2.3's std --enable-shared configure option will
7157 dnl create a libpython2.3.so.1.0. We should first try this
7158 dnl dotted versioned .so file because this is the one that
7159 dnl the PyXPCOM build mechanics tries to link to.
7160 dnl XXX Should find a better way than hardcoding "1.0".
7161 dnl - Python developement tree dir layouts are NOT allowed here
7162 dnl because the PyXPCOM build just dies on it later anyway.
7163 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7164 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7165 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7166 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7167 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7168 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7169 dnl Don't Python development tree directory layout.
7170 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7171 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.])
7172 elif test "$OS_ARCH" = "Darwin"; then
7173 dnl We do Darwin last, so if a custom non-framework build of
7174 dnl python is used on OSX, then it will be picked up first by
7175 dnl the logic above.
7176 MOZ_PYTHON_LIBS="-framework Python"
7178 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7180 if test "$OS_ARCH" = "Linux"; then
7181 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7184 dnl Handle "_d" on Windows
7185 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7186 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7188 MOZ_PYTHON_DEBUG_SUFFIX=
7190 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7193 dnl If the user asks for the 'python' extension, then we add
7194 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7195 dnl Note the careful regex - it must match 'python' followed by anything
7196 dnl other than a '/', including the end-of-string.
7197 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7198 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7199 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7202 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7203 dnl command-line, but not yet
7204 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7205 AC_SUBST(MOZ_PYTHON)
7206 AC_SUBST(MOZ_PYTHON_PREFIX)
7207 AC_SUBST(MOZ_PYTHON_INCLUDES)
7208 AC_SUBST(MOZ_PYTHON_LIBS)
7209 AC_SUBST(MOZ_PYTHON_VER)
7210 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7211 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7212 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7214 dnl ========================================================
7215 dnl disable profile sharing
7216 dnl ========================================================
7217 MOZ_ARG_DISABLE_BOOL(profilesharing,
7218 [ --disable-profilesharing Disable profile sharing],
7219 MOZ_PROFILESHARING=,
7220 MOZ_PROFILESHARING=1 )
7221 if test "$MOZ_PROFILESHARING"; then
7223 AC_DEFINE(MOZ_PROFILESHARING)
7226 dnl ========================================================
7228 dnl ========================================================
7229 MOZ_ARG_ENABLE_BOOL(ipcd,
7230 [ --enable-ipcd Enable IPC daemon],
7234 dnl ========================================================
7235 dnl disable profile locking
7236 dnl do no use this in applications that can have more than
7237 dnl one process accessing the profile directory.
7238 dnl ========================================================
7239 MOZ_ARG_DISABLE_BOOL(profilelocking,
7240 [ --disable-profilelocking Disable profile locking],
7241 MOZ_PROFILELOCKING=,
7242 MOZ_PROFILELOCKING=1 )
7243 if test "$MOZ_PROFILELOCKING"; then
7244 AC_DEFINE(MOZ_PROFILELOCKING)
7247 dnl ========================================================
7248 dnl disable rdf services
7249 dnl ========================================================
7250 MOZ_ARG_DISABLE_BOOL(rdf,
7251 [ --disable-rdf Disable RDF],
7253 if test "$MOZ_RDF"; then
7259 dnl ========================================================
7260 dnl necko configuration options
7261 dnl ========================================================
7264 dnl option to disable various necko protocols
7266 MOZ_ARG_ENABLE_STRING(necko-protocols,
7267 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7268 Enable/disable specific protocol handlers],
7269 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7270 if test "$option" = "yes" || test "$option" = "all"; then
7271 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7272 elif test "$option" = "no" || test "$option" = "none"; then
7274 elif test "$option" = "default"; then
7275 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7276 elif test `echo "$option" | grep -c \^-` != 0; then
7277 option=`echo $option | sed 's/^-//'`
7278 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7280 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7283 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7285 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7286 AC_SUBST(NECKO_PROTOCOLS)
7287 for p in $NECKO_PROTOCOLS; do
7288 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7292 dnl option to disable necko's disk cache
7294 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7295 [ --disable-necko-disk-cache
7296 Disable necko disk cache],
7299 AC_SUBST(NECKO_DISK_CACHE)
7300 if test "$NECKO_DISK_CACHE"; then
7301 AC_DEFINE(NECKO_DISK_CACHE)
7305 dnl option to minimize size of necko's i/o buffers
7307 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7308 [ --enable-necko-small-buffers
7309 Minimize size of necko's i/o buffers],
7310 NECKO_SMALL_BUFFERS=1,
7311 NECKO_SMALL_BUFFERS=)
7312 AC_SUBST(NECKO_SMALL_BUFFERS)
7313 if test "$NECKO_SMALL_BUFFERS"; then
7314 AC_DEFINE(NECKO_SMALL_BUFFERS)
7318 dnl option to disable cookies
7320 MOZ_ARG_DISABLE_BOOL(cookies,
7321 [ --disable-cookies Disable cookie support],
7324 AC_SUBST(NECKO_COOKIES)
7325 if test "$NECKO_COOKIES"; then
7326 AC_DEFINE(NECKO_COOKIES)
7329 dnl NECKO_ configuration options are not global
7330 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7332 dnl ========================================================
7333 dnl string api compatibility
7334 dnl ========================================================
7335 MOZ_ARG_DISABLE_BOOL(v1-string-abi,
7336 [ --disable-v1-string-abi Disable binary compatibility layer for strings],
7338 MOZ_V1_STRING_ABI=1)
7339 AC_SUBST(MOZ_V1_STRING_ABI)
7340 if test "$MOZ_V1_STRING_ABI"; then
7341 AC_DEFINE(MOZ_V1_STRING_ABI)
7344 dnl Only build Mork if it's required
7346 if test "$MOZ_MORK"; then
7350 dnl Build the lightweight Mork reader if required
7351 AC_SUBST(MOZ_MORKREADER)
7352 if test "$MOZ_MORKREADER"; then
7353 AC_DEFINE(MOZ_MORKREADER)
7356 dnl ========================================================
7357 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7358 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7361 if test "$MOZ_LDAP_XPCOM"; then
7362 LDAP_CFLAGS='-I${DIST}/public/ldap'
7363 if test "$OS_ARCH" = "WINNT"; then
7364 if test -n "$GNU_CC"; then
7365 LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
7367 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}'
7369 elif test "$OS_ARCH" = "OS2"; then
7370 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}'
7372 LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
7376 if test "$COMPILE_ENVIRONMENT"; then
7377 if test "$SUNCTL"; then
7378 dnl older versions of glib do not seem to have gmodule which ctl needs
7379 _SAVE_CFLAGS=$CFLAGS
7380 CFLAGS="$CFLAGS $GLIB_CFLAGS"
7383 AC_TRY_COMPILE([#include <gmodule.h>],
7384 [ int x = 1; x++; ],,
7385 [AC_MSG_ERROR([Cannot build ctl without gmodule support in glib.])])
7387 CFLAGS=$_SAVE_CFLAGS
7390 fi # COMPILE_ENVIRONMENT
7392 dnl ========================================================
7394 dnl = Maintainer debug option (no --enable equivalent)
7396 dnl ========================================================
7401 AC_SUBST(AR_EXTRACT)
7405 AC_SUBST(AS_DASH_C_FLAG)
7410 AC_SUBST(USE_SHORT_LIBNAME)
7414 AC_SUBST(NS_USE_NATIVE)
7415 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7416 AC_SUBST(MOZ_GFX_TOOLKIT)
7417 AC_SUBST(MOZ_UPDATE_XTERM)
7419 AC_SUBST(MOZ_AUTH_EXTENSION)
7420 AC_SUBST(MOZ_MATHML)
7421 AC_SUBST(MOZ_PERMISSIONS)
7423 AC_SUBST(MOZ_XMLEXTRAS)
7424 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7425 AC_SUBST(MOZ_WEBSERVICES)
7426 AC_SUBST(MOZ_PREF_EXTENSIONS)
7428 AC_SUBST(MOZ_SVG_FOREIGNOBJECT)
7429 AC_SUBST(MOZ_XSLT_STANDALONE)
7430 AC_SUBST(MOZ_JS_LIBS)
7433 AC_SUBST(MOZ_DEBUG_MODULES)
7434 AC_SUBST(MOZ_PROFILE_MODULES)
7435 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7436 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7437 AC_SUBST(MOZ_DEBUG_FLAGS)
7438 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7439 AC_SUBST(WARNINGS_AS_ERRORS)
7440 AC_SUBST(MOZ_DBGRINFO_MODULES)
7441 AC_SUBST(MOZ_EXTENSIONS)
7442 AC_SUBST(MOZ_IMG_DECODERS)
7443 AC_SUBST(MOZ_IMG_ENCODERS)
7444 AC_SUBST(MOZ_JSDEBUGGER)
7446 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7447 AC_SUBST(MOZ_PLUGINS)
7448 AC_SUBST(ENABLE_EAZEL_PROFILER)
7449 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7450 AC_SUBST(EAZEL_PROFILER_LIBS)
7451 AC_SUBST(MOZ_PERF_METRICS)
7452 AC_SUBST(GC_LEAK_DETECTOR)
7453 AC_SUBST(MOZ_LOG_REFCNT)
7456 AC_SUBST(MOZ_XPCTOOLS)
7457 AC_SUBST(MOZ_JSLOADER)
7458 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7459 AC_SUBST(MOZ_INSURE)
7460 AC_SUBST(MOZ_INSURE_DIRS)
7461 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7462 AC_SUBST(MOZ_QUANTIFY)
7463 AC_SUBST(MOZ_INSURIFYING)
7464 AC_SUBST(MOZ_LDAP_XPCOM)
7465 AC_SUBST(MOZ_LDAP_XPCOM_EXPERIMENTAL)
7466 AC_SUBST(LDAP_CFLAGS)
7469 AC_SUBST(MOZ_PLACES)
7470 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7471 AC_SUBST(MOZ_STORAGE)
7473 AC_SUBST(NS_PRINTING)
7475 AC_SUBST(MOZ_JAVAXPCOM)
7476 AC_SUBST(JAVA_INCLUDE_PATH)
7481 AC_SUBST(MOZ_PROFILESHARING)
7482 AC_SUBST(MOZ_PROFILELOCKING)
7487 AC_SUBST(MOZ_XIE_LIBS)
7488 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
7490 AC_SUBST(XPCOM_USE_LEA)
7491 AC_SUBST(BUILD_STATIC_LIBS)
7492 AC_SUBST(MOZ_ENABLE_LIBXUL)
7493 AC_SUBST(ENABLE_TESTS)
7496 AC_SUBST(MOZ_UNIVERSALCHARDET)
7497 AC_SUBST(ACCESSIBILITY)
7498 AC_SUBST(MOZ_XPINSTALL)
7499 AC_SUBST(MOZ_VIEW_SOURCE)
7500 AC_SUBST(MOZ_SPELLCHECK)
7501 AC_SUBST(MOZ_XPFE_COMPONENTS)
7502 AC_SUBST(MOZ_USER_DIR)
7503 AC_SUBST(MOZ_CRASHREPORTER)
7504 AC_SUBST(MOZ_MOCHITEST)
7506 AC_SUBST(ENABLE_STRIP)
7507 AC_SUBST(PKG_SKIP_STRIP)
7508 AC_SUBST(USE_ELF_DYNSTR_GC)
7509 AC_SUBST(USE_PREBINDING)
7510 AC_SUBST(INCREMENTAL_LINKER)
7511 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
7512 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
7513 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
7515 AC_SUBST(MOZ_FIX_LINK_PATHS)
7516 AC_SUBST(XPCOM_LIBS)
7517 AC_SUBST(XPCOM_FROZEN_LDOPTS)
7518 AC_SUBST(XPCOM_GLUE_LDOPTS)
7519 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
7521 AC_SUBST(USE_DEPENDENT_LIBS)
7523 AC_SUBST(MOZ_BUILD_ROOT)
7524 AC_SUBST(MOZ_OS2_TOOLS)
7525 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
7527 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
7528 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
7529 AC_SUBST(MOZ_TIMELINE)
7531 AC_SUBST(TARGET_DEVICE)
7533 AC_SUBST(MOZ_APP_NAME)
7534 AC_SUBST(MOZ_APP_DISPLAYNAME)
7535 AC_SUBST(MOZ_APP_VERSION)
7536 AC_SUBST(FIREFOX_VERSION)
7537 AC_SUBST(THUNDERBIRD_VERSION)
7538 AC_SUBST(SUNBIRD_VERSION)
7539 AC_SUBST(SEAMONKEY_VERSION)
7541 AC_SUBST(MOZ_PKG_SPECIAL)
7543 AC_SUBST(MOZILLA_OFFICIAL)
7544 AC_SUBST(BUILD_OFFICIAL)
7545 AC_SUBST(MOZ_MILESTONE_RELEASE)
7548 AC_SUBST(MOZ_PROFILE)
7549 AC_SUBST(MOZ_DEBUG_SYMBOLS)
7550 AC_SUBST(MOZ_MAPINFO)
7551 AC_SUBST(MOZ_BROWSE_INFO)
7552 AC_SUBST(MOZ_TOOLS_DIR)
7553 AC_SUBST(CYGWIN_WRAPPER)
7555 AC_SUBST(WIN32_REDIST_DIR)
7558 dnl Echo the CFLAGS to remove extra whitespace.
7565 $_MOZ_EXCEPTIONS_FLAGS \
7566 $_WARNINGS_CXXFLAGS \
7569 COMPILE_CFLAGS=`echo \
7574 COMPILE_CXXFLAGS=`echo \
7575 $_DEFINES_CXXFLAGS \
7579 AC_SUBST(SYSTEM_MAKEDEPEND)
7580 AC_SUBST(SYSTEM_JPEG)
7581 AC_SUBST(SYSTEM_PNG)
7582 AC_SUBST(SYSTEM_ZLIB)
7584 AC_SUBST(JPEG_CFLAGS)
7586 AC_SUBST(ZLIB_CFLAGS)
7588 AC_SUBST(PNG_CFLAGS)
7591 AC_SUBST(MOZ_JPEG_CFLAGS)
7592 AC_SUBST(MOZ_JPEG_LIBS)
7593 AC_SUBST(MOZ_ZLIB_CFLAGS)
7594 AC_SUBST(MOZ_ZLIB_LIBS)
7595 AC_SUBST(MOZ_PNG_CFLAGS)
7596 AC_SUBST(MOZ_PNG_LIBS)
7598 AC_SUBST(NSPR_CFLAGS)
7600 AC_SUBST(MOZ_NATIVE_NSPR)
7602 AC_SUBST(NSS_CFLAGS)
7604 AC_SUBST(NSS_DEP_LIBS)
7605 AC_SUBST(MOZ_NATIVE_NSS)
7610 AC_SUBST(COMPILE_CFLAGS)
7611 AC_SUBST(COMPILE_CXXFLAGS)
7614 AC_SUBST(CROSS_COMPILE)
7618 AC_SUBST(HOST_CFLAGS)
7619 AC_SUBST(HOST_CXXFLAGS)
7620 AC_SUBST(HOST_OPTIMIZE_FLAGS)
7622 AC_SUBST(HOST_AR_FLAGS)
7624 AC_SUBST(HOST_RANLIB)
7625 AC_SUBST(HOST_NSPR_MDCPUCFG)
7626 AC_SUBST(HOST_BIN_SUFFIX)
7627 AC_SUBST(HOST_OS_ARCH)
7629 AC_SUBST(TARGET_CPU)
7630 AC_SUBST(TARGET_VENDOR)
7632 AC_SUBST(TARGET_NSPR_MDCPUCFG)
7633 AC_SUBST(TARGET_MD_ARCH)
7634 AC_SUBST(TARGET_XPCOM_ABI)
7637 AC_SUBST(OS_RELEASE)
7640 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
7641 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
7643 AC_SUBST(WRAP_MALLOC_CFLAGS)
7644 AC_SUBST(WRAP_MALLOC_LIB)
7647 AC_SUBST(MKSHLIB_FORCE_ALL)
7648 AC_SUBST(MKSHLIB_UNFORCE_ALL)
7649 AC_SUBST(DSO_CFLAGS)
7650 AC_SUBST(DSO_PIC_CFLAGS)
7651 AC_SUBST(DSO_LDOPTS)
7652 AC_SUBST(LIB_PREFIX)
7653 AC_SUBST(DLL_PREFIX)
7654 AC_SUBST(DLL_SUFFIX)
7655 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
7656 AC_SUBST(LIB_SUFFIX)
7657 AC_SUBST(OBJ_SUFFIX)
7658 AC_SUBST(BIN_SUFFIX)
7659 AC_SUBST(ASM_SUFFIX)
7660 AC_SUBST(IMPORT_LIB_SUFFIX)
7662 AC_SUBST(CC_VERSION)
7663 AC_SUBST(CXX_VERSION)
7664 AC_SUBST(MSMANIFEST_TOOL)
7666 if test "$USING_HCC"; then
7667 CC='${topsrcdir}/build/hcc'
7669 CXX='${topsrcdir}/build/hcpp'
7670 CXX="$CXX '$_OLDCXX'"
7675 dnl Check for missing components
7676 if test "$COMPILE_ENVIRONMENT"; then
7677 if test "$MOZ_X11"; then
7678 dnl ====================================================
7679 dnl = Check if X headers exist
7680 dnl ====================================================
7681 _SAVE_CFLAGS=$CFLAGS
7682 CFLAGS="$CFLAGS $XCFLAGS"
7685 #include <X11/Xlib.h>
7686 #include <X11/Intrinsic.h>
7690 if ((dpy = XOpenDisplay(NULL)) == NULL) {
7691 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
7695 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
7696 CFLAGS="$_SAVE_CFLAGS"
7698 if test ! -z "$MISSING_X"; then
7699 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
7703 fi # COMPILE_ENVIRONMENT
7705 dnl Set various defines and substitutions
7706 dnl ========================================================
7708 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
7709 LIBS='so32dll.lib tcp32dll.lib'
7710 elif test "$OS_ARCH" = "BeOS"; then
7713 elif test "$OS_ARCH" = "Darwin"; then
7715 AC_DEFINE(UNIX_ASYNC_DNS)
7717 elif test "$OS_ARCH" = "OpenVMS"; then
7719 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
7721 AC_DEFINE(UNIX_ASYNC_DNS)
7724 AC_SUBST(MOZ_MOVEMAIL)
7726 AC_DEFINE(JS_THREADSAFE)
7728 if test "$MOZ_DEBUG"; then
7729 AC_DEFINE(MOZ_REFLOW_PERF)
7730 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
7733 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
7734 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
7735 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
7736 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
7737 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
7738 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
7739 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
7740 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
7741 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
7744 # Used for LD_LIBRARY_PATH of run_viewer target
7746 for lib_arg in $NSPR_LIBS $TK_LIBS; do
7748 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
7754 dnl ========================================================
7755 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
7756 dnl ========================================================
7759 WIN_TOP_SRC=`cd $srcdir; pwd -W`
7762 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
7763 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
7764 CC="\$(CYGWIN_WRAPPER) $CC"
7765 CXX="\$(CYGWIN_WRAPPER) $CXX"
7766 CPP="\$(CYGWIN_WRAPPER) $CPP"
7767 LD="\$(CYGWIN_WRAPPER) $LD"
7768 AS="\$(CYGWIN_WRAPPER) $AS"
7769 RC="\$(CYGWIN_WRAPPER) $RC"
7770 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
7771 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
7772 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
7776 AC_SUBST(CYGDRIVE_MOUNT)
7777 AC_SUBST(WIN_TOP_SRC)
7779 AC_SUBST(MOZILLA_VERSION)
7781 . ${srcdir}/config/chrome-versions.sh
7782 AC_DEFINE_UNQUOTED(MOZILLA_LOCALE_VERSION,"$MOZILLA_LOCALE_VERSION")
7783 AC_DEFINE_UNQUOTED(MOZILLA_REGION_VERSION,"$MOZILLA_REGION_VERSION")
7784 AC_DEFINE_UNQUOTED(MOZILLA_SKIN_VERSION,"$MOZILLA_SKIN_VERSION")
7786 AC_SUBST(ac_configure_args)
7788 dnl Spit out some output
7789 dnl ========================================================
7791 dnl The following defines are used by xpcom
7792 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
7794 HAVE_CPP_2BYTE_WCHAR_T
7795 HAVE_CPP_ACCESS_CHANGING_USING
7796 HAVE_CPP_AMBIGUITY_RESOLVING_USING
7798 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
7800 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
7801 HAVE_CPP_NAMESPACE_STD
7803 HAVE_CPP_PARTIAL_SPECIALIZATION
7804 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
7806 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
7808 NEED_CPP_UNUSED_IMPLEMENTATIONS
7812 HAVE_ICONV_WITH_CONST_INPUT
7822 netwerk/necko-config.h
7823 xpcom/xpcom-config.h
7824 xpcom/xpcom-private.h
7827 # Save the defines header file before autoconf removes it.
7828 # (Do not add AC_DEFINE calls after this line.)
7829 _CONFIG_TMP=confdefs-tmp.h
7830 _CONFIG_DEFS_H=mozilla-config.h
7832 cat > $_CONFIG_TMP <<\EOF
7833 /* List of defines generated by configure. Included with preprocessor flag,
7834 * -include, to avoid long list of -D defines on the compile command-line.
7838 #ifndef _MOZILLA_CONFIG_H_
7839 #define _MOZILLA_CONFIG_H_
7842 _EGREP_PATTERN='^#define ('
7843 if test -n "$_NON_GLOBAL_ACDEFINES"; then
7844 for f in $_NON_GLOBAL_ACDEFINES; do
7845 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
7848 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
7850 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
7852 cat >> $_CONFIG_TMP <<\EOF
7854 #endif /* _MOZILLA_CONFIG_H_ */
7858 # Only write mozilla-config.h when something changes (or it doesn't exist)
7859 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
7862 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
7863 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
7865 echo ==== $_CONFIG_DEFS_H =================================
7869 dnl Probably shouldn't call this manually but we always want the output of DEFS
7870 rm -f confdefs.h.save
7871 mv confdefs.h confdefs.h.save
7872 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
7873 AC_OUTPUT_MAKE_DEFS()
7875 AC_SUBST(MOZ_DEFINES)
7877 mv confdefs.h.save confdefs.h
7879 dnl Load the list of Makefiles to generate.
7880 dnl To add new Makefiles, edit allmakefiles.sh.
7881 dnl allmakefiles.sh sets the variable, MAKEFILES.
7882 . ${srcdir}/allmakefiles.sh
7884 dnl Run a perl script to quickly create the makefiles.
7885 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
7886 dnl for the files it cannot handle correctly. This way, config.status
7887 dnl will handle these files.
7888 dnl If it fails, nothing is set and config.status will run as usual.
7890 dnl This does not change the $MAKEFILES variable.
7892 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
7894 if test -z "${AS_PERL}"; then
7895 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
7897 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
7902 echo $MAKEFILES > unallmakefiles
7904 AC_OUTPUT($MAKEFILES)
7906 dnl ========================================================
7907 dnl = Setup a nice relatively clean build environment for
7908 dnl = sub-configures.
7909 dnl ========================================================
7912 CFLAGS="$_SUBDIR_CFLAGS"
7913 CPPFLAGS="$_SUBDIR_CPPFLAGS"
7914 CXXFLAGS="$_SUBDIR_CXXFLAGS"
7915 LDFLAGS="$_SUBDIR_LDFLAGS"
7916 HOST_CC="$_SUBDIR_HOST_CC"
7917 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
7918 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
7924 if test "$COMPILE_ENVIRONMENT"; then
7925 if test -z "$MOZ_NATIVE_NSPR" || test "$MOZ_LDAP_XPCOM"; then
7926 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
7927 if test -z "$MOZ_DEBUG"; then
7928 ac_configure_args="$ac_configure_args --disable-debug"
7930 if test "$MOZ_OPTIMIZE" = "1"; then
7931 ac_configure_args="$ac_configure_args --enable-optimize"
7933 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
7934 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
7936 if test -n "$HAVE_64BIT_OS"; then
7937 ac_configure_args="$ac_configure_args --enable-64bit"
7939 AC_OUTPUT_SUBDIRS(nsprpub)
7940 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
7943 if test -z "$MOZ_NATIVE_NSPR"; then
7944 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
7945 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
7946 if test ! "$VACPP" && test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
7947 _libs=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --libdir=$\(LIBXUL_DIST\)/lib --libs`
7948 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $_libs'" config/autoconf.mk
7950 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE" ; then
7951 _cflags=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --includedir=$\(LIBXUL_DIST\)/include/nspr --cflags`
7952 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $_cflags'" config/autoconf.mk
7954 rm -f config/autoconf.mk.bak
7957 # if we're building the LDAP XPCOM component, we need to build
7960 if test "$MOZ_LDAP_XPCOM"; then
7962 # these subdirs may not yet have been created in the build tree.
7963 # don't use the "-p" switch to mkdir, since not all platforms have it
7965 if test ! -d "directory"; then
7968 if test ! -d "directory/c-sdk"; then
7969 mkdir "directory/c-sdk"
7971 if test ! -d "directory/c-sdk/ldap"; then
7972 mkdir "directory/c-sdk/ldap"
7975 ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
7976 if test -z "$MOZ_DEBUG"; then
7977 ac_configure_args="$ac_configure_args --disable-debug"
7979 if test "$MOZ_OPTIMIZE" = "1"; then
7980 ac_configure_args="$ac_configure_args --enable-optimize"
7982 if test -n "$HAVE_64BIT_OS"; then
7983 ac_configure_args="$ac_configure_args --enable-64bit"
7985 AC_OUTPUT_SUBDIRS(directory/c-sdk)
7986 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
7988 fi # COMPILE_ENVIRONMENT