1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2 dnl vi: set tabstop=4 shiftwidth=4 expandtab:
3 dnl ***** BEGIN LICENSE BLOCK *****
4 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 dnl The contents of this file are subject to the Mozilla Public License Version
7 dnl 1.1 (the "License"); you may not use this file except in compliance with
8 dnl the License. You may obtain a copy of the License at
9 dnl http://www.mozilla.org/MPL/
11 dnl Software distributed under the License is distributed on an "AS IS" basis,
12 dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 dnl for the specific language governing rights and limitations under the
16 dnl The Original Code is this file as it was released upon August 6, 1998.
18 dnl The Initial Developer of the Original Code is
19 dnl Christopher Seawood.
20 dnl Portions created by the Initial Developer are Copyright (C) 1998-2001
21 dnl the Initial Developer. All Rights Reserved.
24 dnl Jamie Zawinski <jwz@jwz.org>
25 dnl gettimeofday args check
26 dnl Christopher Blizzard <blizzard@appliedtheory.com>
27 dnl gnomefe update & enable-pthreads
28 dnl Ramiro Estrugo <ramiro@netscape.com>
29 dnl X11 makedepend support
31 dnl Henry Sobotka <sobotka@axess.com>
33 dnl Dan Mosedale <dmose@mozilla.org>
35 dnl Seth Spitzer <sspitzer@netscape.com>
37 dnl Benjamin Smedberg <benjamin@smedbergs.us>
38 dnl Howard Chu <hyc@symas.com>
40 dnl Mark Mentovai <mark@moxienet.com>:
41 dnl Mac OS X 10.4 support
42 dnl Giorgio Maone <g.maone@informaction.com>
43 dnl MSVC l10n compatible version check
44 dnl Ben Turner <mozilla@songbirdnest.com>
46 dnl Alternatively, the contents of this file may be used under the terms of
47 dnl either the GNU General Public License Version 2 or later (the "GPL"), or
48 dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
49 dnl in which case the provisions of the GPL or the LGPL are applicable instead
50 dnl of those above. If you wish to allow use of your version of this file only
51 dnl under the terms of either the GPL or the LGPL, and not to allow others to
52 dnl use your version of this file under the terms of the MPL, indicate your
53 dnl decision by deleting the provisions above and replace them with the notice
54 dnl and other provisions required by the GPL or the LGPL. If you do not delete
55 dnl the provisions above, a recipient may use your version of this file under
56 dnl the terms of any one of the MPL, the GPL or the LGPL.
58 dnl ***** END LICENSE BLOCK *****
60 dnl Process this file with autoconf to produce a configure script.
61 dnl ========================================================
64 AC_INIT(config/config.mk)
65 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
67 TARGET_CPU="${target_cpu}"
68 TARGET_VENDOR="${target_vendor}"
69 TARGET_OS="${target_os}"
72 MOZ_DEB_TIMESTAMP=`date +"%a, %d %b %Y %T %z" 2>&1`
73 AC_SUBST(MOZ_DEB_TIMESTAMP)
76 dnl ========================================================
78 dnl = Don't change the following two lines. Doing so breaks:
80 dnl = CFLAGS="-foo" ./configure
82 dnl ========================================================
84 CPPFLAGS="${CPPFLAGS=}"
85 CXXFLAGS="${CXXFLAGS=}"
87 HOST_CFLAGS="${HOST_CFLAGS=}"
88 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
89 HOST_LDFLAGS="${HOST_LDFLAGS=}"
91 dnl ========================================================
92 dnl = Preserve certain environment flags passed to configure
93 dnl = We want sub projects to receive the same flags
94 dnl = untainted by this configure script
95 dnl ========================================================
98 _SUBDIR_CFLAGS="$CFLAGS"
99 _SUBDIR_CPPFLAGS="$CPPFLAGS"
100 _SUBDIR_CXXFLAGS="$CXXFLAGS"
101 _SUBDIR_LDFLAGS="$LDFLAGS"
102 _SUBDIR_HOST_CC="$HOST_CC"
103 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
104 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
105 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
106 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
108 dnl Set the version number of the libs included with mozilla
109 dnl ========================================================
116 dnl Set the minimum version of toolkit libs used by mozilla
117 dnl ========================================================
127 WINDRES_VERSION=2.14.90
130 GNOMEUI_VERSION=2.2.0
133 STARTUP_NOTIFICATION_VERSION=0.8
140 dnl Set various checks
141 dnl ========================================================
145 dnl Initialize the Pthread test variables early so they can be
146 dnl overridden by each platform.
147 dnl ========================================================
151 dnl Do not allow a separate objdir build if a srcdir build exists.
152 dnl ==============================================================
153 _topsrcdir=`cd \`dirname $0\`; pwd`
156 if test "$_topsrcdir" != "$_objdir"
158 # Check for a couple representative files in the source tree
160 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
161 if test -f $file; then
162 _conflict_files="$_conflict_files $file"
165 if test "$_conflict_files"; then
167 echo "* Your source tree contains these files:"
168 for file in $_conflict_files; do
172 * This indicates that you previously built in the source tree.
173 * A source tree build can confuse the separate objdir build.
175 * To clean up the source tree:
186 dnl Default to MSVC for win32
187 dnl ==============================================================
188 if test -z "$CROSS_COMPILE"; then
190 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
192 if test -z "$CC"; then CC=cl; fi
193 if test -z "$CXX"; then CXX=cl; fi
194 if test -z "$CPP"; then CPP="cl -E -nologo"; fi
195 if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
196 if test -z "$LD"; then LD=link; fi
197 if test -z "$AS"; then AS=ml; fi
198 if test -z "$MIDL"; then MIDL=midl; fi
203 COMPILE_ENVIRONMENT=1
204 MOZ_ARG_ENABLE_BOOL(compile-environment,
205 [ --disable-compile-environment
206 Disable compiler/library checks.],
207 COMPILE_ENVIRONMENT=1,
208 COMPILE_ENVIRONMENT= )
210 MOZ_ARG_WITH_STRING(l10n-base,
211 [ --with-l10nbase=DIR path to l10n repositories],
212 L10NBASEDIR=$withval)
213 if test ! -z "$L10NBASEDIR"; then
214 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
215 AC_MSG_ERROR([--with-l10n-base must specify a path])
216 elif test -d "$L10NBASEDIR"; then
217 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
219 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
222 AC_SUBST(L10NBASEDIR)
224 dnl ========================================================
225 dnl Checks for compilers.
226 dnl ========================================================
227 dnl Set CROSS_COMPILE in the environment when running configure
228 dnl to use the cross-compile setup for now
229 dnl ========================================================
231 if test "$COMPILE_ENVIRONMENT"; then
233 dnl Do some special WinCE toolchain stuff
236 echo -----------------------------------------------------------------------------
237 echo Building Windows CE Shunt Library and Tool Chain
238 echo -----------------------------------------------------------------------------
242 echo -n "#define TOPSRCDIR \"" > $srcdir/build/wince/tools/topsrcdir.h
243 echo `cd "$_topsrcdir" && pwd -W | tr '\n' '\"'` >> $srcdir/build/wince/tools/topsrcdir.h
244 make -C $srcdir/build/wince/tools
245 echo -----------------------------------------------------------------------------
249 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
250 echo "cross compiling from $host to $target"
254 _SAVE_CFLAGS="$CFLAGS"
255 _SAVE_LDFLAGS="$LDFLAGS"
257 AC_MSG_CHECKING([for host c compiler])
258 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
259 if test -z "$HOST_CC"; then
260 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
262 AC_MSG_RESULT([$HOST_CC])
263 AC_MSG_CHECKING([for host c++ compiler])
264 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
265 if test -z "$HOST_CXX"; then
266 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
268 AC_MSG_RESULT([$HOST_CXX])
270 if test -z "$HOST_CFLAGS"; then
271 HOST_CFLAGS="$CFLAGS"
273 if test -z "$HOST_CXXFLAGS"; then
274 HOST_CXXFLAGS="$CXXFLAGS"
276 if test -z "$HOST_LDFLAGS"; then
277 HOST_LDFLAGS="$LDFLAGS"
279 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
280 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
282 CFLAGS="$HOST_CFLAGS"
283 LDFLAGS="$HOST_LDFLAGS"
285 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
286 AC_TRY_COMPILE([], [return(0);],
287 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
288 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
291 CFLAGS="$HOST_CXXFLAGS"
293 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
294 AC_TRY_COMPILE([], [return(0);],
295 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
296 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
300 LDFLAGS=$_SAVE_LDFLAGS
302 case "$build:$target" in
303 powerpc-apple-darwin8*:i?86-apple-darwin*)
304 dnl The Darwin cross compiler doesn't necessarily point itself at a
305 dnl root that has libraries for the proper architecture, it defaults
306 dnl to the system root. The libraries in the system root on current
307 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
308 dnl checks will fail. Fake a working SDK in that case.
310 _SAVE_CXXFLAGS=$CXXLAGS
311 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
312 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
316 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
319 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
323 case "$build:$target" in
324 powerpc-apple-darwin8*:i?86-apple-darwin*)
325 dnl Revert the changes made above. From this point on, the target
326 dnl compiler will never be used without applying the SDK to CFLAGS
327 dnl (see --with-macos-sdk below).
329 CXXFLAGS=$_SAVE_CXXFLAGS
333 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
334 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
335 AC_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
336 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
337 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
338 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
339 AC_DEFINE(CROSS_COMPILE)
344 AC_PATH_PROGS(AS, $AS as, $CC)
345 AC_CHECK_PROGS(AR, ar, :)
346 AC_CHECK_PROGS(LD, ld, :)
347 AC_CHECK_PROGS(STRIP, strip, :)
348 AC_CHECK_PROGS(WINDRES, windres, :)
349 if test -z "$HOST_CC"; then
352 if test -z "$HOST_CFLAGS"; then
353 HOST_CFLAGS="$CFLAGS"
355 if test -z "$HOST_CXX"; then
358 if test -z "$HOST_CXXFLAGS"; then
359 HOST_CXXFLAGS="$CXXFLAGS"
361 if test -z "$HOST_LDFLAGS"; then
362 HOST_LDFLAGS="$LDFLAGS"
364 if test -z "$HOST_RANLIB"; then
365 HOST_RANLIB="$RANLIB"
367 if test -z "$HOST_AR"; then
378 if test "$GCC" = "yes"; then
380 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
382 if test "$GXX" = "yes"; then
384 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
386 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
389 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
392 if test "$GNU_CC"; then
393 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
400 if test "$GCC" = yes; then
401 if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
406 if test "$GXX" = yes; then
407 if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
412 dnl Special win32 checks
413 dnl ========================================================
419 if test -n "$GNU_CC"; then
427 MOZ_ARG_WITH_STRING(windows-version,
428 [ --with-windows-version=WINVER
429 Minimum Windows version (WINVER) to support
440 AC_MSG_ERROR([Invalid value --with-windows-version, must be 400, 500 or 501]);
446 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
447 if test "$GCC" != "yes"; then
448 # Check to see if we are really running in a msvc environemnt
450 AC_CHECK_PROGS(MIDL, midl)
452 # Make sure compilers are valid
453 CFLAGS="$CFLAGS -TC -nologo"
454 CXXFLAGS="$CXXFLAGS -TP -nologo"
457 AC_TRY_COMPILE([#include <stdio.h>],
458 [ printf("Hello World\n"); ],,
459 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
462 AC_TRY_COMPILE([#include <new.h>],
463 [ unsigned *test = new unsigned(42); ],,
464 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
468 _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
471 # Determine compiler version
472 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
473 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
474 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
475 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
476 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
477 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
479 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
480 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
482 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
483 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
485 if test "$_CC_MAJOR_VERSION" = "12"; then
487 elif test "$_CC_MAJOR_VERSION" = "13"; then
489 elif test "$_CC_MAJOR_VERSION" = "14"; then
491 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
492 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
493 dnl so be very specific here!
494 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
495 if test $_CC_RELEASE -gt 50727; then
497 elif test $_CC_BUILD -ge 762; then
500 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
501 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
502 elif test "$_CC_MAJOR_VERSION" = "15"; then
504 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
505 LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
507 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
508 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
510 AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
513 _MOZ_RTTI_FLAGS_ON='-GR'
514 _MOZ_RTTI_FLAGS_OFF='-GR-'
515 _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
516 _MOZ_EXCEPTIONS_FLAGS_OFF=''
518 if test -n "$WIN32_REDIST_DIR"; then
519 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
523 # ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
524 if test "$_CC_SUITE" -ge "8"; then
526 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
529 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
530 if test -n "$MSMT_TOOL"; then
531 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
532 if test -z "$MSMANIFEST_TOOL_VERSION"; then
533 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
538 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
542 # Check linker version
543 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
544 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
545 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
546 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
551 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
552 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
553 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
554 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
555 # Add flags if necessary
556 AC_MSG_CHECKING([for midl flags])
557 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
558 # Starting with MIDL version 6.0.359, the MIDL compiler
559 # generates /Oicf /robust stubs by default, which is not
560 # compatible with versions of Windows older than Win2k.
561 # This switches us back to the old behaviour. When we drop
562 # support for Windows older than Win2k, we should remove
564 MIDL_FLAGS="${MIDL_FLAGS} -no_robust"
565 AC_MSG_RESULT([need -no_robust])
567 MIDL_FLAGS="${MIDL_FLAGS}"
568 AC_MSG_RESULT([none needed])
571 unset _MSVC_VER_FILTER
574 # Check w32api version
575 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
576 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
577 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
578 AC_TRY_COMPILE([#include <w32api.h>],
579 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
580 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
581 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
582 #error "test failed."
584 , [ res=yes ], [ res=no ])
585 AC_MSG_RESULT([$res])
586 if test "$res" != "yes"; then
587 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
589 # Check windres version
590 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
591 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
592 AC_MSG_RESULT([$_WINDRES_VERSION])
593 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
594 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
595 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
596 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
597 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
598 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
599 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
600 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
601 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
602 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
603 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
604 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
606 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
610 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
611 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
612 # Require OS features provided by IE 5.0
613 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
617 dnl Test breaks icc on OS/2 && MSVC
618 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
620 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
624 CC="${srcdir}/build/hcc '$CC'"
625 CXX="${srcdir}/build/hcpp '$CXX'"
632 if test -n "$_WIN32_MSVC"; then
634 SKIP_COMPILER_CHECKS=1
635 SKIP_LIBRARY_CHECKS=1
638 fi # COMPILE_ENVIRONMENT
650 dnl ========================================================
651 dnl Checks for programs.
652 dnl ========================================================
655 AC_PATH_PROGS(PERL, $PERL perl5 perl )
656 if test -z "$PERL" || test "$PERL" = ":"; then
657 AC_MSG_ERROR([perl not found in \$PATH])
660 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
661 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
662 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
664 AC_MSG_RESULT([$_perl_version])
666 if test "$_perl_res" != 0; then
667 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
671 AC_MSG_CHECKING([for full perl installation])
672 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
674 if test "$_perl_res" != 0; then
676 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
681 AC_PATH_PROGS(PYTHON, $PYTHON python)
682 if test -z "$PYTHON"; then
683 AC_MSG_ERROR([python was not found in \$PATH])
685 echo PYTHON="$PYTHON"
687 AC_PATH_PROGS(NSINSTALL_BIN, nsinstall )
688 if test -z "$COMPILE_ENVIRONMENT"; then
689 if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
690 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
693 AC_SUBST(NSINSTALL_BIN)
695 AC_PATH_PROG(DOXYGEN, doxygen, :)
696 AC_PATH_PROG(WHOAMI, whoami, :)
697 AC_PATH_PROG(AUTOCONF, autoconf, :)
698 AC_PATH_PROG(UNZIP, unzip, :)
699 AC_PATH_PROGS(ZIP, zip)
700 if test -z "$ZIP" || test "$ZIP" = ":"; then
701 AC_MSG_ERROR([zip not found in \$PATH])
703 AC_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
704 AC_PATH_PROG(XARGS, xargs)
705 if test -z "$XARGS" || test "$XARGS" = ":"; then
706 AC_MSG_ERROR([xargs not found in \$PATH .])
709 if test "$COMPILE_ENVIRONMENT"; then
711 dnl ========================================================
712 dnl = Mac OS X toolchain support
713 dnl ========================================================
717 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
718 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
719 dnl the environment and includedir purposes (when using an SDK, below),
720 dnl but remember the full version number for the libdir (SDK).
722 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
723 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
725 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
726 dnl Bug 280479, but this keeps popping up in bug 292530 too because
727 dnl 4.0.0/4061 is the default compiler in Tiger.
729 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
731 if test "$GCC_BUILD" = "4061" ; then
732 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
733 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
734 from building Mozilla. Upgrade to Xcode 2.1 or later.])
738 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
739 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
740 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
741 AC_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
746 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
748 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
754 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
755 dnl it has moved into /usr/bin.
756 AC_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
760 AC_SUBST(GCC_VERSION)
761 AC_SUBST(XCODEBUILD_VERSION)
762 AC_SUBST(HAS_XCODE_2_1)
764 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
765 dnl that a universal binary is being produced.
766 AC_SUBST(UNIVERSAL_BINARY)
768 dnl ========================================================
769 dnl Check for MacOS deployment target version
770 dnl ========================================================
772 MOZ_ARG_ENABLE_STRING(macos-target,
773 [ --enable-macos-target=VER (default=10.4)
774 Set the minimum MacOS version needed at runtime],
775 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
779 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
780 dnl Use the specified value
781 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
782 AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
783 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
784 dnl No value specified on the command line or in the environment,
785 dnl use the lesser of the application's minimum or the architecture's
787 export MACOSX_DEPLOYMENT_TARGET=10.4
792 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
794 dnl ========================================================
795 dnl = Mac OS X SDK support
796 dnl ========================================================
799 MOZ_ARG_WITH_STRING(macos-sdk,
800 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
801 MACOS_SDK_DIR=$withval)
803 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
804 dnl NEXT_ROOT will be set and exported only if it's needed.
805 AC_SUBST(MACOS_SDK_DIR)
808 if test "$MACOS_SDK_DIR"; then
809 dnl Sync this section with the ones in NSPR and NSS.
810 dnl Changes to the cross environment here need to be accounted for in
811 dnl the libIDL checks (below) and xpidl build.
813 if test ! -d "$MACOS_SDK_DIR"; then
814 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
815 specify a valid SDK. SDKs are installed when the optional cross-development
816 tools are selected during the Xcode/Developer Tools installation.])
819 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
820 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
821 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"
822 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
823 SDK_C_INCLUDE="$SDK_C_INCLUDE -F${MACOS_SDK_DIR}/Library/Frameworks"
825 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"
827 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
828 CXXFLAGS="$CXXFLAGS -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
830 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
831 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
832 CXXCPP="$CXXCPP -nostdinc -nostdinc++ ${SDK_CXX_INCLUDE} ${SDK_C_INCLUDE}"
834 dnl ld support for -syslibroot is compiler-agnostic, but only available
835 dnl on Tiger. Although it's possible to switch on the build host's
836 dnl OS release to use ld -syslibroot when available, ld -syslibroot will
837 dnl cause warnings as long as NEXT_ROOT is set. NEXT_ROOT should be
838 dnl set because both the compiler and linker use it.
839 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"
840 export NEXT_ROOT=$MACOS_SDK_DIR
842 if test -n "$CROSS_COMPILE" ; then
843 dnl NEXT_ROOT will be in the environment, but it shouldn't be set for
844 dnl the build host. HOST_CXX is presently unused.
845 HOST_CC="NEXT_ROOT= $HOST_CC"
846 HOST_CXX="NEXT_ROOT= $HOST_CXX"
849 dnl gcc >= 4.0 uses different paths than above, but knows how to find
851 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
852 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
854 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
855 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
856 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
858 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
859 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
860 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
861 dnl be ignored and cause warnings when -syslibroot is specified.
862 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
863 dnl the -isysroot it receives, so this is only needed with 4.0.0.
864 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
869 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
871 AC_TRY_COMPILE([#include <new>
872 int main() { return 0; }],
876 AC_MSG_RESULT($result)
878 if test "$result" = "no" ; then
879 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
883 fi # COMPILE_ENVIRONMENT
885 dnl Be sure the make we use is GNU make.
886 dnl on win32, gmake.exe is the generally the wrong version
888 cygwin*|mingw*|mks*|msvc*)
889 AC_PATH_PROGS(MAKE, $MAKE make gmake, :)
892 AC_PATH_PROGS(MAKE, $MAKE gmake make, :)
895 _make_try=`$MAKE --version 2>/dev/null | grep GNU`
896 if test ! "$_make_try"
899 echo "*** $MAKE is not GNU Make. You will not be able to build Mozilla without GNU Make."
903 dnl Now exit if version if < MAKE_VERSION
905 echo 'all: ; @echo $(MAKE_VERSION)' > dummy.mk
906 _make_vers=`$MAKE --no-print-directory -f dummy.mk all 2>/dev/null`
908 _MAKE_MAJOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $1 }'`
909 _MAKE_MINOR_VERSION=`echo $_make_vers | $AWK -F\. '{ print $2 }'`
910 MAKE_MAJOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $1 }'`
911 MAKE_MINOR_VERSION=`echo $MAKE_VERSION | $AWK -F\. '{ print $2 }'`
912 if test "$_MAKE_MAJOR_VERSION" -lt "$MAKE_MAJOR_VERSION" || \
913 test "$_MAKE_MAJOR_VERSION" = "$MAKE_MAJOR_VERSION" -a \
914 "$_MAKE_MINOR_VERSION" -lt "$MAKE_MINOR_VERSION"; then
915 AC_MSG_ERROR([GNU Make $MAKE_VERSION or higher is required to build Mozilla.])
919 if test "$COMPILE_ENVIRONMENT"; then
923 dnl Check in X11 include directory too.
924 if test "$no_x" != "yes"; then
925 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
930 fi # COMPILE_ENVIRONMENT
932 dnl ========================================================
933 dnl set the defaults first
934 dnl ========================================================
953 MOZ_USER_DIR=".mozilla"
955 HOST_AR_FLAGS='$(AR_FLAGS)'
958 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
960 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
962 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
964 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
966 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
967 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
968 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib'
969 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
970 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
971 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
972 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
974 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
975 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
979 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
980 MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
982 MOZ_ENABLE_POSTSCRIPT=1
984 if test -n "$CROSS_COMPILE"; then
985 OS_TARGET="${target_os}"
986 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
988 case "${target_os}" in
989 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
990 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
991 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
992 mingw*) OS_ARCH=WINNT ;;
993 wince*) OS_ARCH=WINCE ;;
994 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
998 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
999 OS_RELEASE=`uname -r`
1002 # Before this used `uname -m` when not cross compiling
1003 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1004 OS_TEST="${target_cpu}"
1008 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1010 #######################################################################
1011 # Master "Core Components" macros for getting the OS target #
1012 #######################################################################
1015 # Note: OS_TARGET should be specified on the command line for gmake.
1016 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
1017 # The difference between the Win95 target and the WinNT target is that
1018 # the WinNT target uses Windows NT specific features not available
1019 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
1020 # at lesser performance (the Win95 target uses threads; the WinNT target
1023 # When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
1024 # is built. See: win16_3.11.mk for lots more about the Win16 target.
1026 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1027 # cross-compilation.
1031 # The following hack allows one to build on a WIN95 machine (as if
1032 # s/he were cross-compiling on a WINNT host for a WIN95 target).
1033 # It also accomodates for MKS's uname.exe. If you never intend
1034 # to do development on a WIN95 machine, you don't need this hack.
1049 CYGWIN_9*|CYGWIN_ME*)
1050 OS_ARCH='CYGWIN_NT-4.0'
1056 # Define and override various archtecture-specific variables, including
1065 case "$HOST_OS_ARCH" in
1066 cygwin*|mingw*|mks*|msvc*)
1085 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1088 HOST_OS_ARCH=UNIXWARE
1100 HOST_OS_ARCH=OpenVMS
1110 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1114 HOST_OS_ARCH=UNIXWARE
1124 # If uname -s returns "Windows_NT", we assume that we are using
1125 # the uname.exe in MKS toolkit.
1127 # The -r option of MKS uname only returns the major version number.
1128 # So we need to use its -v option to get the minor version number.
1129 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1133 OS_MINOR_RELEASE=`uname -v`
1134 if test "$OS_MINOR_RELEASE" = "00"; then
1137 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1139 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1141 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1142 # the uname.exe in the Cygwin tools.
1143 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1144 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1145 # the uname.exe in the GNU-Win32 tools.
1146 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1147 # the uname.exe in the MSYS tools.
1149 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1154 OS_RELEASE=`uname -v`.`uname -r`
1167 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1171 OS_RELEASE=`uname -v`
1195 OS_RELEASE=`uname -v`
1201 OS_RELEASE=`uname -v`
1204 if test "$OS_TARGET" != "NTO"; then
1206 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1215 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1221 OS_RELEASE=`uname -v`
1228 case "${target_cpu}" in
1236 if test -z "$CROSS_COMPILE" ; then
1244 if test "$OS_ARCH" = "NCR"; then
1246 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1250 # Only set CPU_ARCH if we recognize the value of OS_TEST
1261 Alpha | alpha | ALPHA)
1278 if test -z "$OS_TARGET"; then
1281 if test "$OS_TARGET" = "WIN95"; then
1284 if test "$OS_TARGET" = "WIN16"; then
1287 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1289 dnl ========================================================
1290 dnl GNU specific defaults
1291 dnl ========================================================
1292 if test "$GNU_CC"; then
1293 # FIXME: Let us build with strict aliasing. bug 414641.
1294 CFLAGS="$CFLAGS -fno-strict-aliasing"
1295 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1296 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1297 DSO_LDOPTS='-shared'
1298 if test "$GCC_USE_GNU_LD"; then
1299 # Don't allow undefined symbols in libraries
1300 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1302 WARNINGS_AS_ERRORS='-Werror'
1304 DSO_PIC_CFLAGS='-fPIC'
1305 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1306 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1307 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1308 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1310 # Turn on GNU specific features
1311 # -Wall - turn on all warnings
1312 # -pedantic - make compiler warn about non-ANSI stuff, and
1313 # be a little bit stricter
1314 # Warnings slamm took out for now (these were giving more noise than help):
1315 # -Wbad-function-cast - warns when casting a function to a new return type
1316 # -Wconversion - complained when char's or short's were used a function args
1317 # -Wshadow - removed because it generates more noise than help --pete
1318 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1319 if test -z "$INTEL_CC"; then
1320 # Don't use -Wcast-align with ICC
1322 # And don't use it on hppa, ia64, sparc, since it's noisy there
1323 hppa | ia64 | sparc)
1326 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1331 dnl Turn pedantic on but disable the warnings for long long
1334 if test -z "$INTEL_CC"; then
1335 _IGNORE_LONG_LONG_WARNINGS=1
1336 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1338 _IGNORE_LONG_LONG_WARNINGS=
1342 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1343 _USE_CPP_INCLUDE_FLAG=1
1345 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1346 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1348 DSO_LDOPTS='-shared'
1349 if test "$GNU_LD"; then
1350 # Don't allow undefined symbols in libraries
1351 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1355 DSO_PIC_CFLAGS='-KPIC'
1356 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1359 if test "$GNU_CXX"; then
1360 # FIXME: Let us build with strict aliasing. bug 414641.
1361 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1362 # Turn on GNU specific features
1363 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1364 if test -z "$INTEL_CC"; then
1365 # Don't use -Wcast-align with ICC
1367 # And don't use it on hppa, ia64, sparc, since it's noisy there
1368 hppa | ia64 | sparc)
1371 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1376 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1377 _USE_CPP_INCLUDE_FLAG=1
1379 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1382 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1383 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1384 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1385 dnl normal behavior.
1386 dnl ========================================================
1388 MKSHLIB_UNFORCE_ALL=
1390 if test "$COMPILE_ENVIRONMENT"; then
1391 if test "$GNU_CC"; then
1392 AC_MSG_CHECKING(whether ld has archive extraction flags)
1393 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1394 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1395 ac_cv_mkshlib_force_and_unforce="no"
1396 exec 3<&0 <<LOOP_INPUT
1397 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1398 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1399 force="-Wl,-all"; unforce="-Wl,-none"
1406 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1409 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1411 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1415 eval $ac_cv_mkshlib_force_and_unforce
1416 MKSHLIB_FORCE_ALL=$force
1417 MKSHLIB_UNFORCE_ALL=$unforce
1420 fi # COMPILE_ENVIRONMENT
1422 dnl =================================================================
1423 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1424 dnl which is bad when cross compiling.
1425 dnl =================================================================
1426 if test "$COMPILE_ENVIRONMENT"; then
1427 configure_static_assert_macros='
1428 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1429 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1430 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1433 dnl test that the macros actually work:
1434 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1435 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1438 ac_cv_static_assertion_macros_work="yes"
1439 AC_TRY_COMPILE([$configure_static_assert_macros],
1440 [CONFIGURE_STATIC_ASSERT(1)],
1442 ac_cv_static_assertion_macros_work="no")
1443 AC_TRY_COMPILE([$configure_static_assert_macros],
1444 [CONFIGURE_STATIC_ASSERT(0)],
1445 ac_cv_static_assertion_macros_work="no",
1448 AC_TRY_COMPILE([$configure_static_assert_macros],
1449 [CONFIGURE_STATIC_ASSERT(1)],
1451 ac_cv_static_assertion_macros_work="no")
1452 AC_TRY_COMPILE([$configure_static_assert_macros],
1453 [CONFIGURE_STATIC_ASSERT(0)],
1454 ac_cv_static_assertion_macros_work="no",
1458 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1459 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1460 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1463 fi # COMPILE_ENVIRONMENT
1465 dnl ========================================================
1466 dnl Checking for 64-bit OS
1467 dnl ========================================================
1468 if test "$COMPILE_ENVIRONMENT"; then
1471 AC_MSG_CHECKING(for 64-bit OS)
1472 AC_TRY_COMPILE([$configure_static_assert_macros],
1473 [CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1474 result="yes", result="no")
1475 AC_MSG_RESULT("$result")
1476 if test "$result" = "yes"; then
1477 AC_DEFINE(HAVE_64BIT_OS)
1480 AC_SUBST(HAVE_64BIT_OS)
1482 fi # COMPILE_ENVIRONMENT
1484 dnl ========================================================
1485 dnl Enable high-memory support on OS/2 by default.
1486 dnl ========================================================
1487 MOZ_OS2_HIGH_MEMORY=1
1488 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1489 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1490 MOZ_OS2_HIGH_MEMORY=,
1491 MOZ_OS2_HIGH_MEMORY=1 )
1492 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1494 dnl ========================================================
1495 dnl System overrides of the defaults for host
1496 dnl ========================================================
1499 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1500 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1501 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1504 *cygwin*|*mingw*|*mks*|*msvc*|*wince)
1505 if test -n "$_WIN32_MSVC"; then
1507 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1508 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1509 HOST_RANLIB='echo ranlib'
1511 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1513 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1514 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1515 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1516 HOST_BIN_SUFFIX=.exe
1519 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1522 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1523 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1525 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1527 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1529 PERL="${CYGWIN_WRAPPER} $PERL"
1532 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1533 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1540 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1541 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1542 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1543 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1544 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
1547 *-linux*|*-kfreebsd*-gnu)
1548 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1549 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1550 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1554 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1555 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1556 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1557 HOST_BIN_SUFFIX=.exe
1562 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1563 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1564 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1568 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1569 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1573 dnl Get mozilla version from central milestone file
1574 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1576 dnl Get version of various core apps from the version files.
1577 FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1578 THUNDERBIRD_VERSION=`cat $topsrcdir/mail/config/version.txt`
1579 SUNBIRD_VERSION=`cat $topsrcdir/calendar/sunbird/config/version.txt`
1580 SEAMONKEY_VERSION=`cat $topsrcdir/suite/config/version.txt`
1582 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1583 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1585 dnl ========================================================
1586 dnl System overrides of the defaults for target
1587 dnl ========================================================
1592 if test ! "$GNU_CC"; then
1593 if test ! "$HAVE_64BIT_OS"; then
1594 # Compiling with Visual Age C++ object model compat is the
1595 # default. To compile with object model ibm, add
1596 # AIX_OBJMODEL=ibm to .mozconfig.
1597 if test "$AIX_OBJMODEL" = "ibm"; then
1598 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1605 AC_SUBST(AIX_OBJMODEL)
1606 DSO_LDOPTS='-qmkshrobj=1'
1607 DSO_CFLAGS='-qflag=w:w'
1609 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1610 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1612 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1613 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1614 if test "$COMPILE_ENVIRONMENT"; then
1617 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 5.0.2.0])
1619 [#if (__IBMCPP__ < 502)
1620 #error "Bad compiler"
1622 _BAD_COMPILER=,_BAD_COMPILER=1)
1623 if test -n "$_BAD_COMPILER"; then
1625 AC_MSG_ERROR([VisualAge C++ version 5.0.2.0 or higher is required to build.])
1627 AC_MSG_RESULT([yes])
1630 TARGET_COMPILER_ABI="ibmc"
1631 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1632 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1635 case "${target_os}" in
1640 if test "$COMPILE_ENVIRONMENT"; then
1641 AC_CHECK_HEADERS(sys/inttypes.h)
1643 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1648 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1649 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1650 DSO_LDOPTS='-nostart'
1651 TK_LIBS='-lbe -lroot'
1653 if test "$COMPILE_ENVIRONMENT"; then
1654 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1655 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1657 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1658 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1661 MOZ_USER_DIR="Mozilla"
1665 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1667 _IGNORE_LONG_LONG_WARNINGS=
1675 _WARNINGS_CFLAGS="-Wall"
1676 _WARNINGS_CXXFLAGS="-Wall"
1677 # The test above doesn't work properly, at least on 3.1.
1678 MKSHLIB_FORCE_ALL=''
1679 MKSHLIB_UNFORCE_ALL=''
1685 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1686 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1687 MOZ_OPTIMIZE_FLAGS="-O2"
1689 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1690 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1693 STRIP="$STRIP -x -S"
1694 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1695 MOZ_ENABLE_POSTSCRIPT=
1696 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1697 LDFLAGS="$LDFLAGS -framework Cocoa"
1698 # The ExceptionHandling framework is needed for Objective-C exception
1699 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1701 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1702 # set MACOSX to generate lib/mac/MoreFiles/Makefile
1705 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1706 dnl ===================================================================
1707 if test "x$enable_dtrace" = "xyes"; then
1708 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1710 dnl check for the presence of the -dead_strip linker flag
1711 AC_MSG_CHECKING([for -dead_strip option to ld])
1712 _SAVE_LDFLAGS=$LDFLAGS
1713 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1714 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1715 if test -n "$_HAVE_DEAD_STRIP" ; then
1716 AC_MSG_RESULT([yes])
1717 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1722 LDFLAGS=$_SAVE_LDFLAGS
1727 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1728 DLL_SUFFIX=".so.1.0"
1729 DSO_LDOPTS="-shared"
1731 if test ! "$GNU_CC"; then
1732 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1734 # Can't have force w/o an unforce.
1735 # # Hack for FreeBSD 2.2
1736 # if test -z "$MKSHLIB_FORCE_ALL"; then
1737 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1738 # MKSHLIB_UNFORCE_ALL=''
1744 if test ! "$GNU_CC"; then
1745 DSO_LDOPTS='-b -Wl,+s'
1748 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1749 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1750 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1752 DSO_LDOPTS='-b -E +s'
1753 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1754 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1756 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1757 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1762 DSO_LDOPTS='-elf -shared'
1764 if test "$GNU_CC"; then
1765 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1766 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1767 MKSHLIB_FORCE_ALL='-Wl,-all'
1768 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1769 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1771 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1772 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1773 MKSHLIB_FORCE_ALL='-all'
1774 MKSHLIB_UNFORCE_ALL='-none'
1780 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1781 dnl compile and link using -n32
1783 TARGET_COMPILER_ABI=n32
1784 DSO_LDOPTS='-elf -shared'
1785 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1786 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1787 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1788 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1789 if test "$GNU_CC"; then
1790 MKSHLIB_FORCE_ALL='-Wl,-all'
1791 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1792 _WARNINGS_CFLAGS="-Wall"
1793 _WARNINGS_CXXFLAGS="-Wall"
1794 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1796 MKSHLIB_FORCE_ALL='-all'
1797 MKSHLIB_UNFORCE_ALL='-none'
1803 CFLAGS="$CFLAGS -woff 3262 -G 4"
1804 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1805 if test -n "$USE_N32"; then
1806 ASFLAGS="$ASFLAGS -n32"
1807 CFLAGS="$CFLAGS -n32"
1808 CXXFLAGS="$CXXFLAGS -n32"
1809 LDFLAGS="$LDFLAGS -n32"
1811 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1812 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1815 if test -z "$GNU_CXX"; then
1821 if test "$GNU_CC"; then
1822 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
1823 case $GCC_VERSION in
1825 # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
1826 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
1830 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1831 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
1832 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1833 # and that combo is not yet good at
1834 # debugging inlined functions (even
1835 # when using DWARF2 as the debugging
1840 case "${target_cpu}" in
1842 CFLAGS="$CFLAGS -mieee"
1843 CXXFLAGS="$CXXFLAGS -mieee"
1847 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1850 CFLAGS="$CFLAGS -Wa,-xgot"
1851 CXXFLAGS="$CXXFLAGS -Wa,-xgot"
1858 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1860 AR_EXTRACT="$AR -extract"
1862 AR_FLAGS='-OUT:"$@"'
1869 # certain versions of cygwin's makedepend barf on the
1870 # #include <string> vs -I./dist/include/string issue so don't use it
1876 HOST_AR='lib -OUT:$@'
1877 HOST_RANLIB='echo ranlib'
1878 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
1881 WARNINGS_AS_ERRORS='-WX'
1882 MOZ_OPTIMIZE_FLAGS='-O1'
1883 AR_FLAGS='-NOLOGO -OUT:"$@"'
1885 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1886 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1889 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
1890 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1892 IMPORT_LIB_SUFFIX=lib
1894 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1897 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1898 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1900 MKSHLIB_UNFORCE_ALL=
1901 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1902 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1903 MOZ_DEBUG_FLAGS='-Zi'
1904 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1906 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
1907 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
1909 RANLIB='echo not_ranlib'
1910 STRIP='echo not_strip'
1911 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
1914 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1916 LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
1917 LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
1920 AC_DEFINE(HAVE_SNPRINTF)
1926 AC_DEFINE(HW_THREADS)
1927 AC_DEFINE(STDC_HEADERS)
1928 AC_DEFINE(NEW_H, <new>)
1929 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1931 TARGET_MD_ARCH=win32
1932 _PLATFORM_DEFAULT_TOOLKIT='windows'
1935 MOZ_ENABLE_POSTSCRIPT=
1936 MOZ_USER_DIR="Mozilla"
1940 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1945 # certain versions of cygwin's makedepend barf on the
1946 # #include <string> vs -I./dist/include/string issue so don't use it
1948 if test -n "$GNU_CC"; then
1949 CC="$CC -mno-cygwin"
1950 CXX="$CXX -mno-cygwin"
1951 CPP="$CPP -mno-cygwin"
1952 CFLAGS="$CFLAGS -mms-bitfields"
1953 CXXFLAGS="$CXXFLAGS -mms-bitfields"
1954 DSO_LDOPTS='-shared'
1955 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1956 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1958 # Use temp file for windres (bug 213281)
1959 RCFLAGS='-O coff --use-temp-file'
1960 # mingw doesn't require kernel32, user32, and advapi32 explicitly
1961 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
1962 MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
1964 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
1965 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
1967 IMPORT_LIB_SUFFIX=dll.a
1969 TARGET_COMPILER_ABI=msvc
1973 AR='lib -NOLOGO -OUT:"$@"'
1975 RANLIB='echo not_ranlib'
1976 STRIP='echo not_strip'
1981 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1986 IMPORT_LIB_SUFFIX=lib
1987 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1988 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(PDBFILE) $(DSO_LDOPTS)'
1990 MKSHLIB_UNFORCE_ALL=
1991 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
1992 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1993 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(PDBFILE)"
1994 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
1995 MOZ_DEBUG_FLAGS='-Zi'
1996 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1997 WARNINGS_AS_ERRORS='-WX'
1998 MOZ_OPTIMIZE_FLAGS='-O1'
1999 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2001 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2002 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2003 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2004 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2005 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2006 if test $_MSC_VER -ge 1400; then
2007 LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
2008 dnl For profile-guided optimization
2009 PROFILE_GEN_CFLAGS="-GL"
2010 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2011 dnl XXX: PGO builds can fail with warnings treated as errors,
2012 dnl specifically "no profile data available" appears to be
2013 dnl treated as an error sometimes. This might be a consequence
2014 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2015 dnl with the linker doing most of the work in the whole-program
2016 dnl optimization/PGO case. I think it's probably a compiler bug,
2017 dnl but we work around it here.
2018 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2019 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2020 dnl Probably also a compiler bug, but what can you do?
2021 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2022 if test -n "$_USE_DYNAMICBASE"; then
2023 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2027 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2028 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2029 AC_DEFINE(HAVE_SNPRINTF)
2035 AC_DEFINE(HW_THREADS)
2036 AC_DEFINE(STDC_HEADERS)
2037 AC_DEFINE(NEW_H, <new>)
2038 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2039 TARGET_MD_ARCH=win32
2040 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2043 MOZ_ENABLE_POSTSCRIPT=
2044 MOZ_USER_DIR="Mozilla"
2046 dnl Hardcode to win95 for now - cls
2047 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2049 dnl set NO_X11 defines here as the general check is skipped on win32
2053 dnl MinGW/MSYS doesn't provide or need cygpath
2058 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2060 *-cygwin*|*-msvc*|*-mks*)
2061 CYGPATH_W="cygpath -a -w"
2062 CYGPATH_S="sed -e s|\\\\|/|g"
2063 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2067 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2069 if test -z "$MOZ_TOOLS"; then
2070 AC_MSG_ERROR([MOZ_TOOLS is not set])
2073 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
2074 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2075 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2077 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
2078 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2080 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2082 if test -n "$GLIB_PREFIX"; then
2083 _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd`
2084 if test "$?" = "0"; then
2085 if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
2086 AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
2088 _GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
2090 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
2093 _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
2095 if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
2096 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
2098 GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
2099 if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
2100 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
2101 elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
2102 GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
2104 AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
2107 if test -n "$LIBIDL_PREFIX"; then
2108 _LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd`
2109 if test "$?" = "0"; then
2110 if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2111 AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2113 _LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2115 AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2118 _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2120 if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2121 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2123 LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2124 if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2125 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2127 elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2128 LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2130 AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2132 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2135 *) # else cross-compiling
2136 if test -n "$GLIB_PREFIX"; then
2137 GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2138 if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2139 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2140 elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2141 GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2143 AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2146 if test -n "$LIBIDL_PREFIX"; then
2147 LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2148 if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2149 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2151 elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2152 LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2154 AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2157 LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2164 AC_MSG_WARN([Using a cygwin build environment is unsupported. Configure cannot check for the presence of necessary headers. Please upgrade to MozillaBuild; see http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites])
2168 AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
2172 AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2188 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2195 CFLAGS="$CFLAGS -Dunix"
2196 CXXFLAGS="$CXXFLAGS -Dunix"
2197 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2199 DSO_PIC_CFLAGS='-fPIC -DPIC'
2200 DSO_LDOPTS='-shared'
2201 BIN_FLAGS='-Wl,--export-dynamic'
2203 DSO_PIC_CFLAGS='-fPIC -DPIC'
2204 DLL_SUFFIX=".so.1.0"
2205 DSO_LDOPTS='-shared'
2207 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2208 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2209 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2210 if test "$LIBRUNPATH"; then
2211 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2213 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2214 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2219 AC_DEFINE(_QNX_SOURCE)
2222 WARNINGS_AS_ERRORS=''
2223 MOZ_OPTIMIZE_FLAGS="-O"
2224 MOZ_DEBUG_FLAGS="-gstabs"
2227 LIBS="$LIBS -lsocket -lstdc++"
2228 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2229 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2230 if test "$with_x" != "yes"
2232 _PLATFORM_DEFAULT_TOOLKIT="photon"
2233 TK_CFLAGS='-I/usr/include/photon'
2236 case "${target_cpu}" in
2238 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2241 case "${host_cpu}" in
2249 DLL_SUFFIX=".so.1.0"
2251 DSO_PIC_CFLAGS='-fPIC'
2252 DSO_LDOPTS='-shared -fPIC'
2253 if test "$LIBRUNPATH"; then
2254 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2259 AC_DEFINE(NO_PW_GECOS)
2260 AC_DEFINE(NO_UDSOCK)
2261 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2263 MKSHLIB_FORCE_ALL='-all'
2264 MKSHLIB_UNFORCE_ALL='-none'
2266 AS_DASH_C_FLAG='-Wc/names=as_is'
2268 DSO_LDOPTS='-shared -auto_symvec'
2270 MOZ_DEBUG_LDFLAGS='-g'
2272 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2273 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2278 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2279 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2287 IMPORT_LIB_SUFFIX=lib
2290 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2291 MOZ_ENABLE_POSTSCRIPT=
2294 MOZ_USER_DIR="Mozilla"
2296 if test "$MOZTOOLS"; then
2297 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2299 AC_MSG_ERROR([MOZTOOLS is not set])
2303 if test -n "$GNU_CC"; then
2305 AC_DEFINE(XP_OS2_EMX)
2306 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2307 AC_DEFINE(TCPV40HDRS)
2310 CFLAGS="$CFLAGS -Zomf"
2311 CXXFLAGS="$CXXFLAGS -Zomf"
2313 BIN_FLAGS='-Zlinker /ST:0x100000'
2317 WARNINGS_AS_ERRORS='-Werror'
2318 MOZ_DEBUG_FLAGS="-g -fno-inline"
2319 MOZ_OPTIMIZE_FLAGS="-O2"
2320 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2321 MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2322 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2323 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2324 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2325 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2326 LDFLAGS="$LDFLAGS -Zhigh-mem"
2327 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2328 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2331 # GCC for OS/2 currently predefines these, but we don't want them
2332 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2333 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2335 AC_CACHE_CHECK(for __declspec(dllexport),
2337 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2339 ac_os2_declspec="yes",
2340 ac_os2_declspec="no")])
2341 if test "$ac_os2_declspec" = "yes"; then
2343 MOZ_OS2_USE_DECLSPEC='1'
2346 # Visual Age C++ build
2347 elif test "$VACPP" = "yes"; then
2348 MOZ_BUILD_ROOT=`pwd -D`
2351 AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
2360 CFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9"
2361 CXXFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9 /Gx+"
2362 MOZ_DEBUG_FLAGS="/Ti+"
2363 WARNINGS_AS_ERRORS='-WX'
2364 MOZ_OPTIMIZE_FLAGS="/O+ /Gl+ /G5 /qarch=pentium"
2366 MOZ_DEBUG_LDFLAGS="/DE"
2367 MOZ_OPTIMIZE_LDFLAGS="/OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
2370 IMPLIB='implib /NOL /NOI'
2371 FILTER='cppfilt -q -B -P'
2372 AC_DEFINE(NO_ANSI_KEYWORDS)
2375 AC_DEFINE(XP_OS2_VACPP)
2376 AC_DEFINE(TCPV40HDRS)
2377 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2378 AC_DEFINE(STDC_HEADERS)
2379 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2380 MKSHLIB='$(LD) $(DSO_LDOPTS)'
2381 MKCSHLIB='$(LD) $(DSO_LDOPTS)'
2382 MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
2383 MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcomct.lib'
2384 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2385 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2390 if test "$GNU_CC"; then
2391 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2392 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2395 MOZ_DEBUG_FLAGS='-g'
2396 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2397 CFLAGS="$CFLAGS -ieee"
2398 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2399 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2402 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2403 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2404 MKSHLIB_FORCE_ALL='-all'
2405 MKSHLIB_UNFORCE_ALL='-none'
2406 dnl Might fix the libxpcom.so breakage on this platform as well....
2407 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2408 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2410 if test -z "$GNU_CXX"; then
2413 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2417 DIRENT_INO=d_stat.st_ino
2418 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2419 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2420 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2421 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2422 AC_DEFINE(STDC_HEADERS)
2423 if test "$no_x" = "yes"; then
2424 _PLATFORM_DEFAULT_TOOLKIT='photon'
2425 TK_CFLAGS='-I/usr/nto/include/photon'
2426 TK_LIBS='-lphoton -lphrender'
2431 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2432 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2433 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2434 if test ! "$GNU_CC"; then
2439 dnl the qsort routine under solaris is faulty
2442 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2444 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2445 # libraries one level up (e.g. libnspr4.so)
2446 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2448 if test -z "$GNU_CC"; then
2450 MOZ_FIX_LINK_PATHS='-R $(LIBXUL_DIST)/bin'
2451 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2453 if test "$CPU_ARCH" != "sparc"; then
2454 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2455 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2457 # Do not use -xbuiltin on SPARC to get around a bug of compiler
2458 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%none"
2459 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%none -features=tmplife -norunpath"
2462 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2463 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2464 _SAVE_LDFLAGS=$LDFLAGS
2465 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2466 AC_TRY_LINK([#include <stdio.h>],
2467 [printf("Hello World\n");],
2469 [LDFLAGS=$_SAVE_LDFLAGS])
2471 WARNINGS_AS_ERRORS='-Werror'
2472 MOZ_OPTIMIZE_FLAGS="-xO4"
2473 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2474 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2475 MKSHLIB_FORCE_ALL='-z allextract'
2476 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2477 DSO_LDOPTS='-G -z muldefs'
2483 AS='/usr/ccs/bin/as'
2484 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2486 TARGET_COMPILER_ABI="sunc"
2487 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2488 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2489 AC_MSG_CHECKING([for Forte compiler version >= WS6U2])
2493 [#if (__SUNPRO_CC < 0x530)
2496 _BAD_COMPILER=,_BAD_COMPILER=1)
2497 if test -n "$_BAD_COMPILER"; then
2499 AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .])
2503 AC_MSG_RESULT([$_res])
2506 ASFLAGS="$ASFLAGS -fPIC"
2509 _WARNINGS_CXXFLAGS=''
2510 if test "$OS_RELEASE" = "5.3"; then
2511 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2514 if test "$OS_RELEASE" = "5.5.1"; then
2515 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2520 DSO_LDOPTS='-Bdynamic'
2521 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2522 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2524 AC_DEFINE(SPRINTF_RETURNS_STRING)
2525 case "$(target_os)" in
2527 DLL_SUFFIX='.so.1.0'
2533 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2537 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2542 dnl Only one oddball right now (QNX), but this gives us flexibility
2543 dnl if any other platforms need to override this in the future.
2544 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2546 dnl ========================================================
2547 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2548 dnl by now will not have any way to link most binaries (tests
2549 dnl as well as viewer, apprunner, etc.), because some symbols
2550 dnl will be left out of the "composite" .so's by ld as unneeded.
2551 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2552 dnl they can link in the static libs that provide the missing
2554 dnl ========================================================
2555 NO_LD_ARCHIVE_FLAGS=
2556 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2557 NO_LD_ARCHIVE_FLAGS=1
2561 NO_LD_ARCHIVE_FLAGS=
2564 NO_LD_ARCHIVE_FLAGS=
2567 NO_LD_ARCHIVE_FLAGS=
2569 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2570 if test -z "$GNU_CC"; then
2571 NO_LD_ARCHIVE_FLAGS=
2575 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2578 dnl Indicate that platform requires special thread safe
2579 dnl locking when starting up the OJI JVM
2580 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2581 dnl ========================================================
2584 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2588 dnl ========================================================
2589 dnl = Flags to strip unused symbols from .so components
2590 dnl ========================================================
2592 *-linux*|*-kfreebsd*-gnu)
2593 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2596 if test -z "$GNU_CC"; then
2597 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2599 if test -z "$GCC_USE_GNU_LD"; then
2600 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2602 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2607 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2610 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2612 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2613 if test -n "$GNU_CC"; then
2614 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2619 if test -z "$COMPILE_ENVIRONMENT"; then
2620 SKIP_COMPILER_CHECKS=1
2621 SKIP_LIBRARY_CHECKS=1
2624 if test -z "$SKIP_COMPILER_CHECKS"; then
2625 dnl Checks for typedefs, structures, and compiler characteristics.
2626 dnl ========================================================
2634 AC_STRUCT_ST_BLKSIZE
2635 AC_MSG_CHECKING(for siginfo_t)
2636 AC_CACHE_VAL(ac_cv_siginfo_t,
2637 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2638 #include <signal.h>],
2640 [ac_cv_siginfo_t=true],
2641 [ac_cv_siginfo_t=false])])
2642 if test "$ac_cv_siginfo_t" = true ; then
2643 AC_DEFINE(HAVE_SIGINFO_T)
2649 dnl Visual Age for os/2 also defines size_t and off_t in certain
2650 dnl header files. These defines make Visual Age use the mozilla
2652 if test "$VACPP" = "yes"; then
2657 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2658 dnl ========================================================
2659 AC_MSG_CHECKING(for int16_t)
2660 AC_CACHE_VAL(ac_cv_int16_t,
2661 [AC_TRY_COMPILE([#include <stdio.h>
2662 #include <sys/types.h>],
2664 [ac_cv_int16_t=true],
2665 [ac_cv_int16_t=false])])
2666 if test "$ac_cv_int16_t" = true ; then
2667 AC_DEFINE(HAVE_INT16_T)
2672 AC_MSG_CHECKING(for int32_t)
2673 AC_CACHE_VAL(ac_cv_int32_t,
2674 [AC_TRY_COMPILE([#include <stdio.h>
2675 #include <sys/types.h>],
2677 [ac_cv_int32_t=true],
2678 [ac_cv_int32_t=false])])
2679 if test "$ac_cv_int32_t" = true ; then
2680 AC_DEFINE(HAVE_INT32_T)
2685 AC_MSG_CHECKING(for int64_t)
2686 AC_CACHE_VAL(ac_cv_int64_t,
2687 [AC_TRY_COMPILE([#include <stdio.h>
2688 #include <sys/types.h>],
2690 [ac_cv_int64_t=true],
2691 [ac_cv_int64_t=false])])
2692 if test "$ac_cv_int64_t" = true ; then
2693 AC_DEFINE(HAVE_INT64_T)
2698 AC_MSG_CHECKING(for int64)
2699 AC_CACHE_VAL(ac_cv_int64,
2700 [AC_TRY_COMPILE([#include <stdio.h>
2701 #include <sys/types.h>],
2704 [ac_cv_int64=false])])
2705 if test "$ac_cv_int64" = true ; then
2706 AC_DEFINE(HAVE_INT64)
2711 AC_MSG_CHECKING(for uint)
2712 AC_CACHE_VAL(ac_cv_uint,
2713 [AC_TRY_COMPILE([#include <stdio.h>
2714 #include <sys/types.h>],
2717 [ac_cv_uint=false])])
2718 if test "$ac_cv_uint" = true ; then
2719 AC_DEFINE(HAVE_UINT)
2724 AC_MSG_CHECKING(for uint_t)
2725 AC_CACHE_VAL(ac_cv_uint_t,
2726 [AC_TRY_COMPILE([#include <stdio.h>
2727 #include <sys/types.h>],
2729 [ac_cv_uint_t=true],
2730 [ac_cv_uint_t=false])])
2731 if test "$ac_cv_uint_t" = true ; then
2732 AC_DEFINE(HAVE_UINT_T)
2737 AC_MSG_CHECKING(for uint16_t)
2738 AC_CACHE_VAL(ac_cv_uint16_t,
2739 [AC_TRY_COMPILE([#include <stdio.h>
2740 #include <sys/types.h>],
2741 [uint16_t foo = 0;],
2742 [ac_cv_uint16_t=true],
2743 [ac_cv_uint16_t=false])])
2744 if test "$ac_cv_uint16_t" = true ; then
2745 AC_DEFINE(HAVE_UINT16_T)
2751 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2752 dnl are defined when compiling C++ but not C. Since the result of this
2753 dnl test is used only in C++, do it in C++.
2756 AC_MSG_CHECKING(for uname.domainname)
2757 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2758 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2759 [ struct utsname *res; char *domain;
2760 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2761 [ac_cv_have_uname_domainname_field=true],
2762 [ac_cv_have_uname_domainname_field=false])])
2764 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2765 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2771 AC_MSG_CHECKING(for uname.__domainname)
2772 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2773 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2774 [ struct utsname *res; char *domain;
2775 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2776 [ac_cv_have_uname_us_domainname_field=true],
2777 [ac_cv_have_uname_us_domainname_field=false])])
2779 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2780 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2788 dnl Check for usable wchar_t (2 bytes, unsigned)
2789 dnl (we really don't need the unsignedness check anymore)
2790 dnl ========================================================
2792 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2793 ac_cv_have_usable_wchar_v2,
2794 [AC_TRY_COMPILE([#include <stddef.h>
2795 $configure_static_assert_macros],
2796 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2797 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2798 ac_cv_have_usable_wchar_v2="yes",
2799 ac_cv_have_usable_wchar_v2="no")])
2800 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2801 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2802 HAVE_CPP_2BYTE_WCHAR_T=1
2804 dnl This is really gcc-only
2805 dnl Do this test using CXX only since some versions of gcc
2806 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2807 dnl only have short-wchar support for c++.
2808 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2812 _SAVE_CXXFLAGS=$CXXFLAGS
2813 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2815 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2816 ac_cv_have_usable_wchar_option_v2,
2817 [AC_TRY_LINK([#include <stddef.h>
2818 $configure_static_assert_macros],
2819 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2820 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2821 ac_cv_have_usable_wchar_option_v2="yes",
2822 ac_cv_have_usable_wchar_option_v2="no")])
2824 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2825 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2826 HAVE_CPP_2BYTE_WCHAR_T=1
2828 CXXFLAGS=$_SAVE_CXXFLAGS
2833 dnl Check for .hidden assembler directive and visibility attribute.
2834 dnl Borrowed from glibc configure.in
2835 dnl ===============================================================
2836 if test "$GNU_CC"; then
2837 AC_CACHE_CHECK(for visibility(hidden) attribute,
2838 ac_cv_visibility_hidden,
2839 [cat > conftest.c <<EOF
2840 int foo __attribute__ ((visibility ("hidden"))) = 1;
2842 ac_cv_visibility_hidden=no
2843 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2844 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2845 ac_cv_visibility_hidden=yes
2850 if test "$ac_cv_visibility_hidden" = "yes"; then
2851 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2853 AC_CACHE_CHECK(for visibility(default) attribute,
2854 ac_cv_visibility_default,
2855 [cat > conftest.c <<EOF
2856 int foo __attribute__ ((visibility ("default"))) = 1;
2858 ac_cv_visibility_default=no
2859 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2860 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2861 ac_cv_visibility_default=yes
2866 if test "$ac_cv_visibility_default" = "yes"; then
2867 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2869 AC_CACHE_CHECK(for visibility pragma support,
2870 ac_cv_visibility_pragma,
2871 [cat > conftest.c <<EOF
2872 #pragma GCC visibility push(hidden)
2874 #pragma GCC visibility push(default)
2875 int foo_default = 1;
2877 ac_cv_visibility_pragma=no
2878 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2879 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2880 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2881 ac_cv_visibility_pragma=yes
2887 if test "$ac_cv_visibility_pragma" = "yes"; then
2888 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2889 ac_cv_have_visibility_class_bug,
2890 [cat > conftest.c <<EOF
2891 #pragma GCC visibility push(hidden)
2892 struct __attribute__ ((visibility ("default"))) TestStruct {
2895 __attribute__ ((visibility ("default"))) void TestFunc() {
2899 ac_cv_have_visibility_class_bug=no
2900 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2901 ac_cv_have_visibility_class_bug=yes
2903 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2904 ac_cv_have_visibility_class_bug=yes
2907 rm -rf conftest.{c,S}
2910 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2911 ac_cv_have_visibility_builtin_bug,
2912 [cat > conftest.c <<EOF
2913 #pragma GCC visibility push(hidden)
2914 #pragma GCC visibility push(default)
2916 #pragma GCC visibility pop
2918 __attribute__ ((visibility ("default"))) void Func() {
2920 memset(c, 0, sizeof(c));
2923 ac_cv_have_visibility_builtin_bug=no
2924 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2925 ac_cv_have_visibility_builtin_bug=yes
2927 if test `grep -c "@PLT" conftest.S` = 0; then
2928 ac_cv_visibility_builtin_bug=yes
2931 rm -f conftest.{c,S}
2933 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2934 "$ac_cv_have_visibility_class_bug" = "no"; then
2935 VISIBILITY_FLAGS='-I$(DIST)/include/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2936 WRAP_SYSTEM_INCLUDES=1
2938 VISIBILITY_FLAGS='-fvisibility=hidden'
2939 fi # have visibility pragma bug
2940 fi # have visibility pragma
2941 fi # have visibility(default) attribute
2942 fi # have visibility(hidden) attribute
2945 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2946 AC_SUBST(VISIBILITY_FLAGS)
2948 dnl Checks for header files.
2949 dnl ========================================================
2951 case "$target_os" in
2953 # for stuff like -lXshm
2954 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2957 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
2958 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
2959 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
2960 AC_CHECK_HEADERS(malloc.h)
2961 AC_CHECK_HEADERS(X11/XKBlib.h)
2963 dnl These are all the places some variant of statfs can be hiding.
2964 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2966 dnl Try for MMX support
2967 dnl NB - later gcc versions require -mmmx for this header to be successfully
2968 dnl included (or another option which implies it, such as -march=pentium-mmx)
2969 AC_CHECK_HEADERS(mmintrin.h)
2971 dnl Check whether the compiler supports the new-style C++ standard
2972 dnl library headers (i.e. <new>) or needs the old "new.h"
2975 AC_CHECK_HEADER(new, [NEW_H=new])
2976 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2979 AC_ARG_ENABLE(dtrace,
2980 [ --enable-dtrace build with dtrace support if available (default=no)],
2981 [enable_dtrace="yes"],)
2982 if test "x$enable_dtrace" = "xyes"; then
2983 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2984 if test -n "$HAVE_DTRACE"; then
2985 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
2987 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
2990 AC_SUBST(HAVE_DTRACE)
2996 AC_CHECK_HEADERS(sys/cdefs.h)
3000 dnl Checks for libraries.
3001 dnl ========================================================
3006 AC_CHECK_LIB(c_r, gethostbyname_r)
3010 dnl We don't want to link with libdl even if it's present on OS X, since
3011 dnl it's not used and not part of the default installation.
3012 dnl The same goes for BeOS.
3013 dnl We don't want to link against libm or libpthread on Darwin since
3014 dnl they both are just symlinks to libSystem and explicitly linking
3015 dnl against libSystem causes issues when debugging (see bug 299601).
3022 AC_CHECK_LIB(m, atan)
3023 AC_CHECK_LIB(dl, dlopen,
3024 AC_CHECK_HEADER(dlfcn.h,
3026 AC_DEFINE(HAVE_LIBDL)))
3030 _SAVE_CFLAGS="$CFLAGS"
3031 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3032 AC_CHECK_FUNCS(dladdr)
3033 CFLAGS="$_SAVE_CFLAGS"
3035 if test ! "$GNU_CXX"; then
3039 AC_CHECK_LIB(C_r, demangle)
3042 AC_CHECK_LIB(C, demangle)
3046 AC_CHECK_LIB(socket, socket)
3049 XLIBS="$X_EXTRA_LIBS"
3051 dnl ========================================================
3052 dnl Checks for X libraries.
3053 dnl Ordering is important.
3054 dnl Xt is dependent upon SM as of X11R6
3055 dnl ========================================================
3056 if test "$no_x" = "yes"; then
3059 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3060 XLIBS="-lX11 $XLIBS"
3061 _SAVE_LDFLAGS="$LDFLAGS"
3062 LDFLAGS="$XLDFLAGS $LDFLAGS"
3063 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3064 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3065 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3066 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3069 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3070 unset ac_cv_lib_Xt_XtFree
3071 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3072 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3073 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3074 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3077 # AIX needs the motif library linked before libXt to prevent
3078 # crashes in plugins linked against Motif - Bug #98892
3079 case "${target_os}" in
3081 XT_LIBS="-lXm $XT_LIBS"
3085 dnl ========================================================
3086 dnl = Check for XShm
3087 dnl ========================================================
3088 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3090 AC_CHECK_HEADER(X11/extensions/XShm.h)
3091 if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3092 test -n "$_HAVE_XSHM_XEXT"; then
3093 AC_DEFINE(HAVE_XSHM)
3096 dnl ========================================================
3098 dnl ========================================================
3099 AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3101 AC_CHECK_HEADER(X11/extensions/XIElib.h)
3103 if test "$MOZ_XIE_LIBS"; then
3104 dnl ====================================================
3105 dnl = If XIE is present and is desired, turn it on
3106 dnl ====================================================
3116 LDFLAGS="$_SAVE_LDFLAGS"
3118 dnl ========================================================
3119 dnl = Check for freetype2 and its functionality
3120 dnl ========================================================
3121 AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3123 if test "$_HAVE_FREETYPE2"; then
3125 _SAVE_CFLAGS="$CFLAGS"
3126 LIBS="$LIBS $FT2_LIBS"
3127 CFLAGS="$CFLAGS $FT2_CFLAGS"
3129 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3130 ac_cv_member_FT_Bitmap_Size_y_ppem,
3131 [AC_TRY_COMPILE([#include <ft2build.h>
3132 #include FT_FREETYPE_H],
3134 if (sizeof s.y_ppem) return 0;
3136 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3137 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3138 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3139 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3141 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3143 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3144 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3145 [FT_Bitmap_Size structure includes y_ppem field])
3147 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3150 CFLAGS="$_SAVE_CFLAGS"
3160 dnl ========================================================
3161 dnl = pthread support
3162 dnl = Start by checking whether the system support pthreads
3163 dnl ========================================================
3164 case "$target_os" in
3169 MOZ_CHECK_PTHREADS(pthreads,
3170 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3171 MOZ_CHECK_PTHREADS(pthread,
3172 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3173 MOZ_CHECK_PTHREADS(c_r,
3174 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3175 MOZ_CHECK_PTHREADS(c,
3184 dnl ========================================================
3185 dnl Check the command line for --with-pthreads
3186 dnl ========================================================
3187 MOZ_ARG_WITH_BOOL(pthreads,
3188 [ --with-pthreads Force use of system pthread library with NSPR ],
3189 [ if test "$USE_PTHREADS"x = x; then
3190 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3196 dnl ========================================================
3197 dnl Do the platform specific pthread hackery
3198 dnl ========================================================
3199 if test "$USE_PTHREADS"x != x
3202 dnl See if -pthread is supported.
3205 ac_cv_have_dash_pthread=no
3206 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3207 echo 'int main() { return 0; }' | cat > conftest.c
3208 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3209 if test $? -eq 0; then
3210 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3211 ac_cv_have_dash_pthread=yes
3212 case "$target_os" in
3214 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3217 CFLAGS="$CFLAGS -pthread"
3218 CXXFLAGS="$CXXFLAGS -pthread"
3224 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3227 dnl See if -pthreads is supported.
3229 ac_cv_have_dash_pthreads=no
3230 if test "$ac_cv_have_dash_pthread" = "no"; then
3231 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3232 echo 'int main() { return 0; }' | cat > conftest.c
3233 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3234 if test $? -eq 0; then
3235 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3236 ac_cv_have_dash_pthreads=yes
3237 CFLAGS="$CFLAGS -pthreads"
3238 CXXFLAGS="$CXXFLAGS -pthreads"
3242 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3247 AC_DEFINE(_REENTRANT)
3248 AC_DEFINE(_THREAD_SAFE)
3249 dnl -pthread links in -lc_r, so don't specify it explicitly.
3250 if test "$ac_cv_have_dash_pthread" = "yes"; then
3251 _PTHREAD_LDFLAGS="-pthread"
3253 _PTHREAD_LDFLAGS="-lc_r"
3257 *-*-openbsd*|*-*-bsdi*)
3258 AC_DEFINE(_REENTRANT)
3259 AC_DEFINE(_THREAD_SAFE)
3260 dnl -pthread links in -lc_r, so don't specify it explicitly.
3261 if test "$ac_cv_have_dash_pthread" = "yes"; then
3262 _PTHREAD_LDFLAGS="-pthread"
3266 *-*-linux*|*-*-kfreebsd*-gnu)
3267 AC_DEFINE(_REENTRANT)
3271 AC_DEFINE(_REENTRANT)
3275 AC_DEFINE(_REENTRANT)
3279 AC_DEFINE(_REENTRANT)
3283 AC_DEFINE(_REENTRANT)
3287 AC_DEFINE(_REENTRANT)
3288 if test ! "$GNU_CC"; then
3289 CFLAGS="$CFLAGS -mt"
3290 CXXFLAGS="$CXXFLAGS -mt"
3294 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3297 dnl ========================================================
3298 dnl See if mmap sees writes
3299 dnl For cross compiling, just define it as no, which is a safe default
3300 dnl ========================================================
3301 AC_MSG_CHECKING(whether mmap() sees write()s)
3307 #include <sys/mman.h>
3308 #include <sys/types.h>
3309 #include <sys/stat.h>
3312 char fname[] = "conftest.file";
3313 char zbuff[1024]; /* Fractional page is probably worst case */
3320 fd = open(fname, O_RDWR | O_CREAT, 0660);
3323 write(fd, zbuff, sizeof(zbuff));
3324 lseek(fd, 0, SEEK_SET);
3325 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3326 if(map==(char*)-1) return 2;
3327 for(i=0; fname[i]; i++) {
3328 int rc = write(fd, &fname[i], 1);
3329 if(map[i]!=fname[i]) return 4;
3336 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3338 AC_MSG_RESULT("$result")
3340 if test "$result" = "no"; then
3341 AC_DEFINE(MMAP_MISSES_WRITES)
3345 dnl Checks for library functions.
3346 dnl ========================================================
3347 AC_PROG_GCC_TRADITIONAL
3349 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64)
3350 AC_CHECK_FUNCS(flockfile getpagesize)
3352 dnl localtime_r and strtok_r are only present on MacOS version 10.2 and higher
3353 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100200"; then
3354 AC_CHECK_FUNCS(localtime_r strtok_r)
3357 dnl check for wcrtomb/mbrtowc
3358 dnl =======================================================================
3359 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3362 AC_CACHE_CHECK(for wcrtomb,
3364 [AC_TRY_LINK([#include <wchar.h>],
3365 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3366 ac_cv_have_wcrtomb="yes",
3367 ac_cv_have_wcrtomb="no")])
3368 if test "$ac_cv_have_wcrtomb" = "yes"; then
3369 AC_DEFINE(HAVE_WCRTOMB)
3371 AC_CACHE_CHECK(for mbrtowc,
3373 [AC_TRY_LINK([#include <wchar.h>],
3374 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3375 ac_cv_have_mbrtowc="yes",
3376 ac_cv_have_mbrtowc="no")])
3377 if test "$ac_cv_have_mbrtowc" = "yes"; then
3378 AC_DEFINE(HAVE_MBRTOWC)
3385 ac_cv_func_res_ninit,
3388 #define _BSD_SOURCE 1
3392 [int foo = res_ninit(&_res);],
3393 [ac_cv_func_res_ninit=yes],
3394 [ac_cv_func_res_ninit=no])
3397 if test "$ac_cv_func_res_ninit" = "yes"; then
3398 AC_DEFINE(HAVE_RES_NINIT)
3399 dnl must add the link line we do something as foolish as this... dougt
3401 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3402 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3407 [for gnu_get_libc_version()],
3408 ac_cv_func_gnu_get_libc_version,
3410 #ifdef HAVE_GNU_LIBC_VERSION_H
3411 #include <gnu/libc-version.h>
3414 [const char *glibc_version = gnu_get_libc_version();],
3415 [ac_cv_func_gnu_get_libc_version=yes],
3416 [ac_cv_func_gnu_get_libc_version=no]
3420 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3421 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3425 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3429 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3430 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3431 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3433 LIBS="$LIBS $_ICONV_LIBS"
3442 iconv_t h = iconv_open("", "");
3443 iconv(h, NULL, NULL, NULL, NULL);
3446 [ac_cv_func_iconv=yes],
3447 [ac_cv_func_iconv=no]
3450 if test "$ac_cv_func_iconv" = "yes"; then
3451 AC_DEFINE(HAVE_ICONV)
3452 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3453 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3454 LIBICONV="$_ICONV_LIBS"
3456 [for iconv() with const input],
3457 ac_cv_func_const_iconv,
3463 const char *input = "testing";
3464 iconv_t h = iconv_open("", "");
3465 iconv(h, &input, NULL, NULL, NULL);
3468 [ac_cv_func_const_iconv=yes],
3469 [ac_cv_func_const_iconv=no]
3472 if test "$ac_cv_func_const_iconv" = "yes"; then
3473 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3485 dnl **********************
3486 dnl *** va_copy checks ***
3487 dnl **********************
3488 dnl we currently check for all three va_copy possibilities, so we get
3489 dnl all results in config.log for bug reports.
3490 AC_MSG_CHECKING(for an implementation of va_copy())
3491 AC_CACHE_VAL(ac_cv_va_copy,[
3494 void f (int i, ...) {
3495 va_list args1, args2;
3496 va_start (args1, i);
3497 va_copy (args2, args1);
3498 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3500 va_end (args1); va_end (args2);
3502 int main() { f (0, 42); return 0; }],
3508 AC_MSG_RESULT($ac_cv_va_copy)
3509 AC_MSG_CHECKING(for an implementation of __va_copy())
3510 AC_CACHE_VAL(ac_cv___va_copy,[
3513 void f (int i, ...) {
3514 va_list args1, args2;
3515 va_start (args1, i);
3516 __va_copy (args2, args1);
3517 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3519 va_end (args1); va_end (args2);
3521 int main() { f (0, 42); return 0; }],
3522 ac_cv___va_copy=yes,
3527 AC_MSG_RESULT($ac_cv___va_copy)
3528 AC_MSG_CHECKING(whether va_lists can be copied by value)
3529 AC_CACHE_VAL(ac_cv_va_val_copy,[
3532 void f (int i, ...) {
3533 va_list args1, args2;
3534 va_start (args1, i);
3536 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3538 va_end (args1); va_end (args2);
3540 int main() { f (0, 42); return 0; }],
3541 ac_cv_va_val_copy=yes,
3542 ac_cv_va_val_copy=no,
3543 ac_cv_va_val_copy=yes
3546 if test "x$ac_cv_va_copy" = "xyes"; then
3547 AC_DEFINE(VA_COPY, va_copy)
3548 AC_DEFINE(HAVE_VA_COPY)
3549 elif test "x$ac_cv___va_copy" = "xyes"; then
3550 AC_DEFINE(VA_COPY, __va_copy)
3551 AC_DEFINE(HAVE_VA_COPY)
3554 if test "x$ac_cv_va_val_copy" = "xno"; then
3555 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3557 AC_MSG_RESULT($ac_cv_va_val_copy)
3559 dnl Check for dll-challenged libc's.
3560 dnl This check is apparently only needed for Linux.
3563 dnl ===================================================================
3566 rm -rf conftest* _conftest
3568 cat >> conftest.C <<\EOF
3573 void __dump_link_map(void) {
3574 struct link_map *map = _dl_loaded;
3575 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3578 dlopen("./conftest1.so",RTLD_LAZY);
3579 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3580 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3581 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3585 /* _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).*/
3586 int main() { printf("./conftest1.so\n"); }
3590 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3592 cat >> conftest1.C <<\EOF
3594 void foo(void) {printf("foo in dll called\n");}
3596 ${CXX-g++} -fPIC -c -g conftest1.C
3597 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3598 ${CXX-g++} -g conftest.C -o conftest -ldl
3599 cp -f conftest1.so conftest _conftest
3601 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3604 echo "*** Your libc has a bug that can result in loading the same dynamic"
3605 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3606 echo "*** or later. However, if you choose not to upgrade, the only effect"
3607 echo "*** will be excessive memory usage at runtime."
3611 rm -rf conftest* _conftest
3612 dnl ===================================================================
3616 dnl ===================================================================
3617 dnl ========================================================
3618 dnl By default, turn rtti and exceptions off on g++/egcs
3619 dnl ========================================================
3620 if test "$GNU_CXX"; then
3622 AC_MSG_CHECKING(for C++ exceptions flag)
3624 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3625 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3626 [echo "int main() { return 0; }" | cat > conftest.C
3628 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3630 if egrep "warning.*renamed" conftest.out >/dev/null; then
3631 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3633 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3638 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3639 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3640 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3643 dnl ========================================================
3644 dnl Put your C++ language/feature checks below
3645 dnl ========================================================
3649 if test "$GNU_CC"; then
3650 AC_CACHE_CHECK(for gcc 3.0 ABI,
3651 ac_cv_gcc_three_abi,
3654 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3660 ac_cv_gcc_three_abi="yes",
3661 ac_cv_gcc_three_abi="no")])
3662 if test "$ac_cv_gcc_three_abi" = "yes"; then
3663 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3666 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3669 AC_SUBST(HAVE_GCC3_ABI)
3672 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3674 [AC_TRY_COMPILE(class X {
3675 public: explicit X(int i) : i_(i) {}
3679 ac_cv_cpp_explicit=yes,
3680 ac_cv_cpp_explicit=no)])
3681 if test "$ac_cv_cpp_explicit" = yes ; then
3682 AC_DEFINE(HAVE_CPP_EXPLICIT)
3685 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3687 [AC_TRY_COMPILE(class param {
3689 typedef unsigned long num_type;
3692 template <class T> class tplt {
3694 typedef typename T::num_type t_num_type;
3695 t_num_type foo(typename T::num_type num) {
3701 ac_cv_cpp_typename=yes,
3702 ac_cv_cpp_typename=no)])
3703 if test "$ac_cv_cpp_typename" = yes ; then
3704 AC_DEFINE(HAVE_CPP_TYPENAME)
3707 dnl Check for support of modern template specialization syntax
3708 dnl Test code and requirement from scc@netscape.com.
3709 dnl Autoconf cut-and-paste job by waterson@netscape.com
3710 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3711 ac_cv_cpp_modern_specialize_template_syntax,
3712 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3714 template <> struct X<Y> { double a; };,
3717 ac_cv_cpp_modern_specialize_template_syntax=yes,
3718 ac_cv_cpp_modern_specialize_template_syntax=no)])
3719 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3720 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3724 dnl Some compilers support only full specialization, and some don't.
3725 AC_CACHE_CHECK(whether partial template specialization works,
3726 ac_cv_cpp_partial_specialization,
3727 [AC_TRY_COMPILE(template <class T> class Foo {};
3728 template <class T> class Foo<T*> {};,
3730 ac_cv_cpp_partial_specialization=yes,
3731 ac_cv_cpp_partial_specialization=no)])
3732 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3733 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3736 dnl Some compilers have limited support for operators with templates;
3737 dnl specifically, it is necessary to define derived operators when a base
3738 dnl class's operator declaration should suffice.
3739 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3740 ac_cv_need_derived_template_operators,
3741 [AC_TRY_COMPILE([template <class T> class Base { };
3743 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3744 template <class T> class Derived : public Base<T> { };],
3745 [Derived<char> a, b;
3746 Base<char> c = a + b;
3748 ac_cv_need_derived_template_operators=no,
3749 ac_cv_need_derived_template_operators=yes)])
3750 if test "$ac_cv_need_derived_template_operators" = yes ; then
3751 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3755 dnl Some compilers have trouble detecting that a template class
3756 dnl that derives from another template is actually an instance
3757 dnl of the base class. This test checks for that.
3758 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3759 ac_cv_need_cpp_template_cast_to_base,
3760 [AC_TRY_COMPILE([template <class T> class Base { };
3761 template <class T> class Derived : public Base<T> { };
3762 template <class T> int foo(const Base<T>&) { return 0; }],
3763 [Derived<char> bar; return foo(bar);],
3764 ac_cv_need_cpp_template_cast_to_base=no,
3765 ac_cv_need_cpp_template_cast_to_base=yes)])
3766 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3767 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3770 dnl Some compilers have trouble resolving the ambiguity between two
3771 dnl functions whose arguments differ only by cv-qualifications.
3772 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3773 ac_cv_can_resolve_const_ambiguity,
3775 template <class T> class ptrClass {
3779 template <class T> T* a(ptrClass<T> *arg) {
3784 const T* a(const ptrClass<T> *arg) {
3790 ac_cv_can_resolve_const_ambiguity=yes,
3791 ac_cv_can_resolve_const_ambiguity=no)])
3792 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3793 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3797 dnl We don't do exceptions on unix. The only reason this used to be here
3798 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3799 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3800 dnl So im commenting this out until someone writes some artificial
3801 dnl intelligence to detect not only if the compiler has exceptions, but if
3802 dnl they are enabled as well.
3804 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3805 dnl ac_cv_cpp_exceptions,
3806 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3807 dnl static void F() { throw X(); },
3808 dnl try { F(); } catch(X & e) { },
3809 dnl ac_cv_cpp_exceptions=yes,
3810 dnl ac_cv_cpp_exceptions=no)])
3811 dnl if test $ac_cv_cpp_exceptions = yes ; then
3812 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3815 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3816 dnl supports it well enough to allow us to use it to change access, but not
3817 dnl to resolve ambiguity. The next two tests determine how well the |using|
3818 dnl keyword is supported.
3820 dnl Check to see if we can change access with |using|. Test both a
3821 dnl legal and an illegal example.
3822 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3823 ac_cv_cpp_access_changing_using2,
3825 class A { protected: int foo() { return 0; } };
3826 class B : public A { public: using A::foo; };,
3827 B b; return b.foo();,
3829 class A { public: int foo() { return 1; } };
3830 class B : public A { private: using A::foo; };,
3831 B b; return b.foo();,
3832 ac_cv_cpp_access_changing_using2=no,
3833 ac_cv_cpp_access_changing_using2=yes)],
3834 ac_cv_cpp_access_changing_using2=no)])
3835 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3836 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3839 dnl Check to see if we can resolve ambiguity with |using|.
3840 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3841 ac_cv_cpp_ambiguity_resolving_using,
3842 [AC_TRY_COMPILE(class X {
3843 public: int go(const X&) {return 3;}
3844 int jo(const X&) {return 3;}
3846 class Y : public X {
3847 public: int go(int) {return 2;}
3848 int jo(int) {return 2;}
3850 private: using X::go;
3853 ac_cv_cpp_ambiguity_resolving_using=yes,
3854 ac_cv_cpp_ambiguity_resolving_using=no)])
3855 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3856 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3859 dnl Check to see if the |std| namespace is supported. If so, we'll want
3860 dnl to qualify any standard library calls with "std::" to ensure that
3861 dnl those functions can be resolved.
3862 AC_CACHE_CHECK(for \"std::\" namespace,
3863 ac_cv_cpp_namespace_std,
3864 [AC_TRY_COMPILE([#include <algorithm>],
3865 [return std::min(0, 1);],
3866 ac_cv_cpp_namespace_std=yes,
3867 ac_cv_cpp_namespace_std=no)])
3868 if test "$ac_cv_cpp_namespace_std" = yes ; then
3869 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3872 dnl Older compilers are overly ambitious with respect to using the standard
3873 dnl template library's |operator!=()| when |operator==()| is defined. In
3874 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3875 dnl ambiguity at compile-time. This test checks for that case.
3876 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3877 ac_cv_cpp_unambiguous_std_notequal,
3878 [AC_TRY_COMPILE([#include <algorithm>
3880 int operator==(const T1&, const T1&) { return 0; }
3881 int operator!=(const T1&, const T1&) { return 0; }],
3882 [T1 a,b; return a != b;],
3883 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3884 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3885 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3886 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
3890 AC_CACHE_CHECK(for C++ reinterpret_cast,
3891 ac_cv_cpp_reinterpret_cast,
3892 [AC_TRY_COMPILE(struct X { int i; };
3893 struct Y { int i; };,
3894 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
3895 ac_cv_cpp_reinterpret_cast=yes,
3896 ac_cv_cpp_reinterpret_cast=no)])
3897 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
3898 AC_DEFINE(HAVE_CPP_NEW_CASTS)
3901 dnl See if a dynamic_cast to void* gives the most derived object.
3902 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3903 ac_cv_cpp_dynamic_cast_void_ptr,
3904 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3905 class Y { int j; public: virtual ~Y() { } };
3906 class Z : public X, public Y { int k; };
3912 return !((((void*)&mdo != (void*)subx) &&
3913 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3914 (((void*)&mdo != (void*)suby) &&
3915 ((void*)&mdo == dynamic_cast<void*>(suby))));
3917 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3918 ac_cv_cpp_dynamic_cast_void_ptr=no,
3919 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3920 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3921 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3925 dnl note that this one is reversed - if the test fails, then
3926 dnl we require implementations of unused virtual methods. Which
3927 dnl really blows because it means we'll have useless vtable
3929 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3930 ac_cv_cpp_unused_required,
3931 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3933 ac_cv_cpp_unused_required=no,
3934 ac_cv_cpp_unused_required=yes)])
3935 if test "$ac_cv_cpp_unused_required" = yes ; then
3936 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3940 dnl Some compilers have trouble comparing a constant reference to a templatized
3941 dnl class to zero, and require an explicit operator==() to be defined that takes
3942 dnl an int. This test separates the strong from the weak.
3944 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3945 ac_cv_trouble_comparing_to_zero,
3946 [AC_TRY_COMPILE([#include <algorithm>
3947 template <class T> class Foo {};
3949 template <class T> int operator==(const T2*, const T&) { return 0; }
3950 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3951 [Foo<int> f; return (0 != f);],
3952 ac_cv_trouble_comparing_to_zero=no,
3953 ac_cv_trouble_comparing_to_zero=yes)])
3954 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3955 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3960 dnl End of C++ language/feature checks
3963 dnl ========================================================
3964 dnl = Internationalization checks
3965 dnl ========================================================
3967 dnl Internationalization and Locale support is different
3968 dnl on various UNIX platforms. Checks for specific i18n
3969 dnl features go here.
3971 dnl check for LC_MESSAGES
3972 AC_CACHE_CHECK(for LC_MESSAGES,
3973 ac_cv_i18n_lc_messages,
3974 [AC_TRY_COMPILE([#include <locale.h>],
3975 [int category = LC_MESSAGES;],
3976 ac_cv_i18n_lc_messages=yes,
3977 ac_cv_i18n_lc_messages=no)])
3978 if test "$ac_cv_i18n_lc_messages" = yes; then
3979 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3982 fi # SKIP_COMPILER_CHECKS
3985 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3986 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3989 dnl Mozilla specific options
3990 dnl ========================================================
3991 dnl The macros used for command line options
3992 dnl are defined in build/autoconf/altoptions.m4.
3995 dnl ========================================================
3997 dnl = Check for external package dependencies
3999 dnl ========================================================
4000 MOZ_ARG_HEADER(External Packages)
4004 MOZ_ARG_WITH_STRING(libxul-sdk,
4005 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4006 LIBXUL_SDK_DIR=$withval)
4008 if test "$LIBXUL_SDK_DIR" = "yes"; then
4009 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4010 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4011 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4013 if test ! -f "$LIBXUL_SDK/sdk/include/xpcom-config.h"; then
4014 AC_MSG_ERROR([$LIBXUL_SDK/sdk/include/xpcom-config.h doesn't exist])
4019 AC_SUBST(LIBXUL_SDK)
4021 dnl ========================================================
4022 dnl = If NSPR was not detected in the system,
4023 dnl = use the one in the source tree (mozilla/nsprpub)
4024 dnl ========================================================
4025 MOZ_ARG_WITH_BOOL(system-nspr,
4026 [ --with-system-nspr Use system installed NSPR],
4027 _USE_SYSTEM_NSPR=1 )
4029 if test -n "$_USE_SYSTEM_NSPR"; then
4030 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
4033 if test -n "$MOZ_NATIVE_NSPR"; then
4034 _SAVE_CFLAGS=$CFLAGS
4035 CFLAGS="$CFLAGS $NSPR_CFLAGS"
4036 AC_TRY_COMPILE([#include "prlog.h"],
4037 [#ifndef PR_STATIC_ASSERT
4038 #error PR_STATIC_ASSERT not defined
4040 [MOZ_NATIVE_NSPR=1],
4041 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
4042 CFLAGS=$_SAVE_CFLAGS
4044 NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --includedir=$(LIBXUL_DIST)/include/nspr --cflags`'
4045 # explicitly set libs for Visual Age C++ for OS/2
4046 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
4047 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''
4048 elif test "$OS_ARCH" = "WINCE"; then
4049 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
4050 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
4051 elif test "$OS_ARCH" = "WINNT"; then
4052 NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
4053 if test -n "$GNU_CC"; then
4054 NSPR_LIBS="-L\$(LIBXUL_DIST)/lib -lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION"
4056 NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
4059 NSPR_LIBS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --libdir=$(LIBXUL_DIST)/lib --libs`'
4063 dnl ========================================================
4064 dnl = If NSS was not detected in the system,
4065 dnl = use the one in the source tree (mozilla/security/nss)
4066 dnl ========================================================
4068 MOZ_ARG_WITH_BOOL(system-nss,
4069 [ --with-system-nss Use system installed NSS],
4072 if test -n "$_USE_SYSTEM_NSS"; then
4073 AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
4076 if test -n "$MOZ_NATIVE_NSS"; then
4077 NSS_LIBS="$NSS_LIBS -lcrmf"
4079 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4081 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4082 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4083 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4084 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4085 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX) \
4086 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)softokn$NSS_VERSION\$(DLL_SUFFIX)"
4088 if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4090 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4091 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4092 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4093 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4094 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4095 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)softokn$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
4097 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION -lsoftokn$NSS_VERSION"
4101 if test -z "$SKIP_LIBRARY_CHECKS"; then
4102 dnl system JPEG support
4103 dnl ========================================================
4104 MOZ_ARG_WITH_STRING(system-jpeg,
4105 [ --with-system-jpeg[=PFX]
4106 Use system libjpeg [installed at prefix PFX]],
4109 _SAVE_CFLAGS=$CFLAGS
4110 _SAVE_LDFLAGS=$LDFLAGS
4112 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4113 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4114 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4116 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4119 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4122 if test "$SYSTEM_JPEG" = 1; then
4123 LIBS="$JPEG_LIBS $LIBS"
4124 AC_TRY_COMPILE([ #include <stdio.h>
4125 #include <sys/types.h>
4126 #include <jpeglib.h> ],
4127 [ #if JPEG_LIB_VERSION < $MOZJPEG
4128 #error "Insufficient JPEG library version ($MOZJPEG required)."
4131 [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4133 CFLAGS=$_SAVE_CFLAGS
4134 LDFLAGS=$_SAVE_LDFLAGS
4137 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4138 JPEG_CFLAGS="-I${JPEG_DIR}/include"
4139 JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4142 dnl system ZLIB support
4143 dnl ========================================================
4144 MOZ_ARG_WITH_STRING(system-zlib,
4145 [ --with-system-zlib[=PFX]
4146 Use system libz [installed at prefix PFX]],
4149 _SAVE_CFLAGS=$CFLAGS
4150 _SAVE_LDFLAGS=$LDFLAGS
4152 if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4153 CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4154 LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4156 if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4159 AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4160 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4162 if test "$SYSTEM_ZLIB" = 1; then
4163 LIBS="$ZLIB_LIBS $LIBS"
4164 AC_TRY_COMPILE([ #include <stdio.h>
4166 #include <zlib.h> ],
4167 [ #if ZLIB_VERNUM < $MOZZLIB
4168 #error "Insufficient zlib version ($MOZZLIB required)."
4171 [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4173 CFLAGS=$_SAVE_CFLAGS
4174 LDFLAGS=$_SAVE_LDFLAGS
4177 if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4178 ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4179 ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4182 dnl system BZIP2 Support
4183 dnl ========================================================
4184 MOZ_ARG_WITH_STRING(system-bz2,
4185 [ --with-system-bz2[=PFX]
4186 Use system libbz2 [installed at prefix PFX]],
4189 _SAVE_CFLAGS=$CFLAGS
4190 _SAVE_LDFLAGS=$LDFLAGS
4192 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4193 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4194 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4196 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4199 AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4200 [SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
4202 CFLAGS=$_SAVE_CFLAGS
4203 LDFLAGS=$_SAVE_LDFLAGS
4206 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4207 BZ2_CFLAGS="-I${BZ2_DIR}/include"
4208 BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4211 dnl system PNG Support
4212 dnl ========================================================
4213 MOZ_ARG_WITH_STRING(system-png,
4214 [ --with-system-png[=PFX]
4215 Use system libpng [installed at prefix PFX]],
4218 _SAVE_CFLAGS=$CFLAGS
4219 _SAVE_LDFLAGS=$LDFLAGS
4221 CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4222 LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4223 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4224 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4225 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4227 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4230 _SAVE_PNG_LIBS=$PNG_LIBS
4231 AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4232 AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4234 AC_CHECK_LIB(png, png_get_acTL, ,
4235 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4238 if test "$SYSTEM_PNG" = 1; then
4239 LIBS="$PNG_LIBS $LIBS"
4240 AC_TRY_COMPILE([ #include <stdio.h>
4241 #include <sys/types.h>
4243 [ #if PNG_LIBPNG_VER < $MOZPNG
4244 #error "Insufficient libpng version ($MOZPNG required)."
4246 #ifndef PNG_UINT_31_MAX
4247 #error "Insufficient libpng version."
4250 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4252 CFLAGS=$_SAVE_CFLAGS
4253 LDFLAGS=$_SAVE_LDFLAGS
4256 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4257 PNG_CFLAGS="-I${PNG_DIR}/include"
4258 PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4261 fi # SKIP_LIBRARY_CHECKS
4263 dnl system HunSpell Support
4264 dnl ========================================================
4265 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4266 [ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4269 if test -n "$SYSTEM_HUNSPELL"; then
4270 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4273 AC_SUBST(SYSTEM_HUNSPELL)
4275 dnl check whether to enable glitz
4276 dnl ========================================================
4277 MOZ_ARG_ENABLE_BOOL(glitz,
4278 [ --enable-glitz Enable Glitz for use with Cairo],
4281 if test "$MOZ_ENABLE_GLITZ"; then
4282 AC_DEFINE(MOZ_ENABLE_GLITZ)
4285 dnl ========================================================
4286 dnl Java SDK support
4287 dnl ========================================================
4289 MOZ_ARG_WITH_STRING(java-include-path,
4290 [ --with-java-include-path=dir Location of Java SDK headers],
4291 JAVA_INCLUDE_PATH=$withval)
4294 MOZ_ARG_WITH_STRING(java-bin-path,
4295 [ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4296 JAVA_BIN_PATH=$withval)
4298 dnl ========================================================
4299 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4300 dnl their usage and use them in spidermonkey.
4301 dnl ========================================================
4302 MOZ_ARG_WITH_BOOL(arm-kuser,
4303 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4306 if test -n "$USE_ARM_KUSER"; then
4307 AC_DEFINE(USE_ARM_KUSER)
4310 dnl ========================================================
4314 dnl ========================================================
4316 MOZ_ARG_HEADER(Application)
4320 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4321 MOZ_BRANDING_DIRECTORY=
4323 MOZ_DBGRINFO_MODULES=
4325 MOZ_EXTENSIONS_ALL=" wallet p3p venkman inspector irc typeaheadfind gnomevfs sroaming datetime finger cview layout-debug tasks sql xforms schema-validation reporter"
4327 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp xbm icon"
4328 MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4341 MOZ_AUTH_EXTENSION=1
4342 MOZ_NO_ACTIVEX_SUPPORT=1
4343 MOZ_NO_INSPECTOR_APIS=
4344 MOZ_NO_XPCOM_OBSOLETE=
4351 MOZ_PLAINTEXT_EDITOR_ONLY=
4353 MOZ_PREF_EXTENSIONS=1
4354 MOZ_PROFILELOCKING=1
4355 MOZ_PROFILESHARING=1
4357 MOZ_PYTHON_EXTENSIONS="xpcom dom"
4359 MOZ_PYTHON_DEBUG_SUFFIX=
4360 MOZ_PYTHON_DLL_SUFFIX=
4361 MOZ_PYTHON_INCLUDES=
4365 MOZ_PYTHON_VER_DOTTED=
4371 MOZ_STATIC_MAIL_BUILD=
4376 MOZ_UNIVERSALCHARDET=1
4378 MOZ_USE_NATIVE_UCONV=
4381 MOZ_XPFE_COMPONENTS=1
4383 MOZ_XSLT_STANDALONE=
4391 NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4392 NECKO_SMALL_BUFFERS=
4394 XPC_IDISPATCH_SUPPORT=
4397 case "$target_os" in
4406 case "$target_os" in
4407 msvc*|mks*|cygwin*|mingw*)
4408 if test -z "$GNU_CC"; then
4409 XPC_IDISPATCH_SUPPORT=1
4410 MOZ_NO_ACTIVEX_SUPPORT=
4411 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
4416 MOZ_ARG_ENABLE_STRING(application,
4417 [ --enable-application=APP
4426 content/xslt (Standalone Transformiix XSLT)
4427 netwerk (Standalone Necko)
4428 tools/update-packaging (AUS-related packaging tools)
4429 standalone (use this for standalone
4430 xpcom/xpconnect or to manually drive a build)],
4431 [ MOZ_BUILD_APP=$enableval ] )
4433 if test "$MOZ_BUILD_APP" = "macbrowser"; then
4434 AC_MSG_WARN([--enable-application=macbrowser is deprecated. Use --enable-application=camino.])
4435 MOZ_BUILD_APP=camino
4438 MOZ_EMBEDDING_PROFILE=default
4439 MOZ_ARG_WITH_STRING(embedding-profile,
4440 [ --with-embedding-profile=default|basic|minimal
4441 see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4442 [ MOZ_EMBEDDING_PROFILE=$withval ])
4444 case "$MOZ_EMBEDDING_PROFILE" in
4446 MOZ_EMBEDDING_LEVEL_DEFAULT=1
4447 MOZ_EMBEDDING_LEVEL_BASIC=1
4448 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4449 AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4450 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4451 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4455 MOZ_EMBEDDING_LEVEL_DEFAULT=
4456 MOZ_EMBEDDING_LEVEL_BASIC=1
4457 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4458 AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4459 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4461 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4464 MOZ_ENABLE_POSTSCRIPT=
4465 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4466 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4467 MOZ_IMG_ENCODERS_DEFAULT=
4475 MOZ_NO_ACTIVEX_SUPPORT=1
4476 MOZ_NO_INSPECTOR_APIS=1
4477 MOZ_NO_XPCOM_OBSOLETE=1
4480 MOZ_PLAINTEXT_EDITOR_ONLY=1
4482 MOZ_PREF_EXTENSIONS=
4487 MOZ_UNIVERSALCHARDET=
4489 MOZ_USE_NATIVE_UCONV=
4491 MOZ_XPFE_COMPONENTS=
4496 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4497 NECKO_SMALL_BUFFERS=1
4498 NS_DISABLE_LOGGING=1
4504 MOZ_EMBEDDING_LEVEL_DEFAULT=
4505 MOZ_EMBEDDING_LEVEL_BASIC=
4506 MOZ_EMBEDDING_LEVEL_MINIMAL=1
4507 AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4509 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4512 MOZ_ENABLE_POSTSCRIPT=
4513 MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4514 MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4515 MOZ_IMG_ENCODERS_DEFAULT=
4523 MOZ_NO_ACTIVEX_SUPPORT=1
4524 MOZ_NO_INSPECTOR_APIS=1
4525 MOZ_NO_XPCOM_OBSOLETE=1
4528 MOZ_PLAINTEXT_EDITOR_ONLY=1
4530 MOZ_PREF_EXTENSIONS=
4537 MOZ_UNIVERSALCHARDET=
4539 MOZ_USE_NATIVE_UCONV=1
4541 MOZ_XPFE_COMPONENTS=
4548 NECKO_PROTOCOLS_DEFAULT="about data http file res"
4549 NECKO_SMALL_BUFFERS=1
4550 NS_DISABLE_LOGGING=1
4556 AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4560 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4561 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4562 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4564 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4565 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4566 XULRUNNER_STUB_NAME=$withval)
4568 if test -z "$XULRUNNER_STUB_NAME"; then
4569 case "$target_os" in
4571 XULRUNNER_STUB_NAME=xulrunner
4574 XULRUNNER_STUB_NAME=xulrunner-stub
4577 AC_SUBST(XULRUNNER_STUB_NAME)
4579 if test -z "$MOZ_BUILD_APP"; then
4580 AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4582 # We have a valid application only if it has a build.mk file in its top
4584 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4585 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4589 # Allow the application to influence configure with a confvars.sh script.
4591 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4592 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4593 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4594 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4599 # Now is a good time to test for logic errors, define mismatches, etc.
4600 case "$MOZ_BUILD_APP" in
4602 if test "$LIBXUL_SDK"; then
4603 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4607 # Fix this case for folks who forget. Warn them.
4608 if test -n "$LIBXUL_SDK" -a -z "$MOZ_XUL_APP"; then
4609 AC_MSG_WARN([Setting MOZ_XUL_APP since LIBXUL_SDK was set. Add to confvars.sh!])
4615 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4616 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4618 case "$MOZ_BUILD_APP" in
4620 AC_DEFINE(MOZ_SUITE)
4624 AC_DEFINE(MOZ_PHOENIX)
4628 AC_DEFINE(MOZ_THUNDERBIRD)
4632 AC_DEFINE(MOZ_STANDALONE_COMPOSER)
4636 AC_DEFINE(MOZ_SUNBIRD)
4640 AC_DEFINE(MOZ_XULRUNNER)
4644 AC_DEFINE(MOZ_MACBROWSER)
4652 MOZ_APP_NAME=mozilla
4653 MOZ_APP_DISPLAYNAME=Mozilla
4654 MOZ_APP_VERSION=$MOZILLA_VERSION
4659 AC_SUBST(MOZ_BUILD_APP)
4660 AC_SUBST(MOZ_XUL_APP)
4662 AC_SUBST(MOZ_PHOENIX)
4663 AC_SUBST(MOZ_THUNDERBIRD)
4664 AC_SUBST(MOZ_STANDALONE_COMPOSER)
4665 AC_SUBST(MOZ_SUNBIRD)
4666 AC_SUBST(MOZ_XULRUNNER)
4668 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4670 if test "$MOZ_XUL_APP"; then
4672 AC_DEFINE(MOZ_XUL_APP)
4675 dnl ========================================================
4677 dnl = Toolkit Options
4679 dnl ========================================================
4680 MOZ_ARG_HEADER(Toolkit Options)
4682 dnl ========================================================
4683 dnl = Select the default toolkit
4684 dnl ========================================================
4685 MOZ_ARG_ENABLE_STRING(default-toolkit,
4686 [ --enable-default-toolkit=TK
4687 Select default toolkit
4688 Platform specific defaults:
4690 Mac OS X - cairo-cocoa
4691 Neutrino/QNX - photon
4693 Win32 - cairo-windows
4695 Gtk2 with DirectFB - cairo-gtk2-dfb
4697 [ _DEFAULT_TOOLKIT=$enableval ],
4698 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4700 if test "$_DEFAULT_TOOLKIT" = "photon" \
4701 -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4702 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4703 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
4704 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4705 -o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4706 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4707 -o "$_DEFAULT_TOOLKIT" = "cairo-mac" \
4708 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4710 dnl nglayout only supports building with one toolkit,
4711 dnl so ignore everything after the first comma (",").
4712 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4714 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4717 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4719 dnl ========================================================
4720 dnl = Enable the toolkit as needed =
4721 dnl ========================================================
4723 case "$MOZ_WIDGET_TOOLKIT" in
4726 AC_DEFINE(MOZ_WIDGET_PHOTON)
4730 MOZ_WIDGET_TOOLKIT=windows
4731 MOZ_GFX_TOOLKIT=cairo
4734 cairo-gtk2|cairo-gtk2-x11)
4735 MOZ_WIDGET_TOOLKIT=gtk2
4736 MOZ_GFX_TOOLKIT=cairo
4738 MOZ_ENABLE_XREMOTE=1
4743 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4744 TK_LIBS='$(MOZ_GTK2_LIBS)'
4745 AC_DEFINE(MOZ_WIDGET_GTK2)
4749 MOZ_WIDGET_TOOLKIT=gtk2
4750 MOZ_GFX_TOOLKIT=cairo
4756 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4757 TK_LIBS='$(MOZ_GTK2_LIBS)'
4758 AC_DEFINE(MOZ_WIDGET_GTK2)
4759 if test "$no_x" != "yes"; then
4760 AC_MSG_WARN([Disabling X when DirectFB is specified.])
4766 MOZ_WIDGET_TOOLKIT=beos
4767 MOZ_GFX_TOOLKIT=cairo
4768 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4769 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4773 MOZ_WIDGET_TOOLKIT=os2
4774 MOZ_GFX_TOOLKIT=cairo
4775 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4776 TK_LIBS='$(MOZ_CAIRO_LIBS)'
4779 cairo-mac|cairo-cocoa)
4780 if test "$MOZ_WIDGET_TOOLKIT" = "cairo-cocoa"; then
4781 MOZ_WIDGET_TOOLKIT=cocoa
4782 AC_DEFINE(MOZ_WIDGET_COCOA)
4785 MOZ_WIDGET_TOOLKIT=mac
4787 MOZ_GFX_TOOLKIT=cairo
4788 MOZ_USER_DIR="Mozilla"
4789 AC_DEFINE(XP_MACOSX)
4790 AC_DEFINE(TARGET_CARBON)
4791 AC_DEFINE(TARGET_API_MAC_CARBON)
4792 TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit'
4793 TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
4794 CFLAGS="$CFLAGS $TK_CFLAGS"
4795 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4799 if test "$MOZ_ENABLE_XREMOTE"; then
4800 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4803 if test "$COMPILE_ENVIRONMENT"; then
4804 if test "$MOZ_ENABLE_GTK2"; then
4805 if test "$MOZ_X11"; then
4806 GDK_PACKAGES=gdk-x11-2.0
4807 elif test "$MOZ_DFB"; then
4808 PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
4809 GDK_PACKAGES=directfb
4812 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4815 fi # COMPILE_ENVIRONMENT
4817 AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4819 dnl ========================================================
4820 dnl = startup-notification support module
4821 dnl ========================================================
4823 if test "$MOZ_ENABLE_GTK2"
4825 MOZ_ENABLE_STARTUP_NOTIFICATION=
4827 MOZ_ARG_ENABLE_BOOL(startup-notification,
4828 [ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4829 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4830 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4831 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4833 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4834 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4835 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4836 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4838 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4840 MOZ_ENABLE_STARTUP_NOTIFICATION=
4844 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4845 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4848 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4850 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4851 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4852 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4854 AC_SUBST(GTK_CONFIG)
4858 AC_SUBST(MOZ_ENABLE_GTK2)
4859 AC_SUBST(MOZ_ENABLE_PHOTON)
4860 AC_SUBST(MOZ_ENABLE_COCOA)
4861 AC_SUBST(MOZ_ENABLE_GLITZ)
4862 AC_SUBST(MOZ_ENABLE_XREMOTE)
4863 AC_SUBST(MOZ_GTK2_CFLAGS)
4864 AC_SUBST(MOZ_GTK2_LIBS)
4871 dnl ========================================================
4873 dnl = Components & Features
4875 dnl ========================================================
4876 MOZ_ARG_HEADER(Components and Features)
4878 dnl ========================================================
4880 dnl ========================================================
4881 MOZ_ARG_ENABLE_STRING(ui-locale,
4882 [ --enable-ui-locale=ab-CD
4883 Select the user interface locale (default: en-US)],
4884 MOZ_UI_LOCALE=$enableval )
4885 AC_SUBST(MOZ_UI_LOCALE)
4887 dnl =========================================================
4888 dnl = Calendar client
4889 dnl =========================================================
4890 MOZ_ARG_ENABLE_BOOL(calendar,,
4894 if test "$MOZ_OLD_CALENDAR"; then
4895 AC_MSG_WARN([Building with the calendar extension is no longer supported.])
4896 if test "$MOZ_THUNDERBIRD"; then
4897 AC_MSG_WARN([Since you're trying to build mail, you could try adding])
4898 AC_MSG_WARN(['--enable-extensions=default,lightning' to your mozconfig])
4899 AC_MSG_WARN([and building WITH A FRESH TREE.])
4901 AC_MSG_WARN([For more information, please visit:])
4902 AC_MSG_ERROR([http://www.mozilla.org/projects/calendar/])
4905 AC_SUBST(MOZ_CALENDAR)
4907 dnl =========================================================
4909 dnl =========================================================
4910 MOZ_ARG_DISABLE_BOOL(mailnews,
4911 [ --disable-mailnews Disable building of mail & news components],
4914 AC_SUBST(MOZ_MAIL_NEWS)
4916 dnl =========================================================
4918 dnl =========================================================
4919 MOZ_ARG_DISABLE_BOOL(ldap,
4920 [ --disable-ldap Disable LDAP support],
4924 dnl ========================================================
4925 dnl = Trademarked Branding
4926 dnl ========================================================
4927 MOZ_ARG_ENABLE_BOOL(official-branding,
4928 [ --enable-official-branding Enable Official mozilla.org Branding
4929 Do not distribute builds with
4930 --enable-official-branding unless you have
4931 permission to use trademarks per
4932 http://www.mozilla.org/foundation/trademarks/ .],
4933 [case "$MOZ_BUILD_APP" in
4935 MOZ_BRANDING_DIRECTORY=other-licenses/branding/firefox
4936 MOZ_APP_DISPLAYNAME=Firefox
4940 MOZ_BRANDING_DIRECTORY=other-licenses/branding/sunbird
4941 MOZ_APP_DISPLAYNAME=Sunbird
4945 MOZ_BRANDING_DIRECTORY=other-licenses/branding/thunderbird
4949 AC_MSG_ERROR([Official branding is only available for Firefox Sunbird and Thunderbird.])
4953 MOZ_ARG_WITH_STRING(branding,
4954 [ --with-branding=dir Use branding from the specified directory.],
4955 MOZ_BRANDING_DIRECTORY=$withval)
4957 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4958 if test -z "$REAL_BRANDING_DIRECTORY"; then
4959 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4962 if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4963 . "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
4966 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4968 dnl ========================================================
4969 dnl = Distribution ID
4970 dnl ========================================================
4971 MOZ_ARG_WITH_STRING(distribution-id,
4972 [ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
4973 [ val=`echo $withval`
4974 MOZ_DISTRIBUTION_ID="$val"])
4976 if test -z "$MOZ_DISTRIBUTION_ID"; then
4977 MOZ_DISTRIBUTION_ID="org.mozilla"
4980 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4981 AC_SUBST(MOZ_DISTRIBUTION_ID)
4984 dnl ========================================================
4985 dnl complex text support off by default
4986 dnl ========================================================
4988 MOZ_ARG_DISABLE_BOOL(pango,
4989 [ --disable-pango Disable usage of Pango ],
4994 dnl ========================================================
4996 dnl ========================================================
4997 if test "$MOZ_ENABLE_GTK2"
4999 if test "$MOZ_X11"; then
5000 PKG_CHECK_MODULES(MOZ_XFT, xft)
5001 AC_SUBST(MOZ_XFT_CFLAGS)
5002 AC_SUBST(MOZ_XFT_LIBS)
5007 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5009 if test "$MOZ_PANGO"
5011 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangocairo >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5012 AC_SUBST(MOZ_PANGO_CFLAGS)
5013 AC_SUBST(MOZ_PANGO_LIBS)
5014 AC_DEFINE(MOZ_PANGO)
5016 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5017 AC_SUBST(MOZ_PANGO_CFLAGS)
5018 AC_SUBST(MOZ_PANGO_LIBS)
5020 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5021 AC_SUBST(FT2_CFLAGS)
5026 dnl ========================================================
5027 dnl = PostScript print module
5028 dnl ========================================================
5029 MOZ_ARG_DISABLE_BOOL(postscript,
5030 [ --disable-postscript Disable PostScript printing support ],
5031 MOZ_ENABLE_POSTSCRIPT=,
5032 MOZ_ENABLE_POSTSCRIPT=1 )
5034 dnl ========================================================
5035 dnl = GnomeVFS support module
5036 dnl ========================================================
5040 dnl build the gnomevfs extension by default only when the
5041 dnl GTK2 toolkit is in use.
5042 if test "$MOZ_ENABLE_GTK2"
5044 MOZ_ENABLE_GNOMEVFS=1
5046 MOZ_ENABLE_LIBGNOME=1
5049 MOZ_ARG_DISABLE_BOOL(gnomevfs,
5050 [ --disable-gnomevfs Disable GnomeVFS support ],
5051 MOZ_ENABLE_GNOMEVFS=,
5052 MOZ_ENABLE_GNOMEVFS=force)
5054 if test "$MOZ_ENABLE_GNOMEVFS"
5056 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5057 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5058 MOZ_ENABLE_GNOMEVFS=1
5060 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5062 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5064 MOZ_ENABLE_GNOMEVFS=
5068 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5069 AC_SUBST(MOZ_GNOMEVFS_LIBS)
5071 if test "$MOZ_ENABLE_GCONF"
5073 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
5074 MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5081 if test "$MOZ_ENABLE_GCONF"; then
5082 AC_DEFINE(MOZ_ENABLE_GCONF)
5085 AC_SUBST(MOZ_ENABLE_GCONF)
5086 AC_SUBST(MOZ_GCONF_CFLAGS)
5087 AC_SUBST(MOZ_GCONF_LIBS)
5089 if test "$MOZ_ENABLE_LIBGNOME"
5091 PKG_CHECK_MODULES(MOZ_LIBGNOME, libgnome-2.0 >= $LIBGNOME_VERSION,[
5092 MOZ_LIBGNOME_LIBS=`echo $MOZ_LIBGNOME_LIBS | sed 's/-llinc\>//'`
5093 MOZ_ENABLE_LIBGNOME=1
5095 MOZ_ENABLE_LIBGNOME=
5099 AC_SUBST(MOZ_LIBGNOME_CFLAGS)
5100 AC_SUBST(MOZ_LIBGNOME_LIBS)
5102 # The GNOME component is built if gtk2, gconf, gnome-vfs, and libgnome
5103 # are all available.
5105 if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
5106 "$MOZ_ENABLE_GNOMEVFS" -a "$MOZ_ENABLE_LIBGNOME"; then
5107 MOZ_ENABLE_GNOME_COMPONENT=1
5109 MOZ_ENABLE_GNOME_COMPONENT=
5112 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5115 dnl ========================================================
5116 dnl = libgnomeui support module
5117 dnl ========================================================
5119 if test "$MOZ_ENABLE_GTK2"
5121 MOZ_ENABLE_GNOMEUI=1
5123 MOZ_ARG_DISABLE_BOOL(gnomeui,
5124 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5125 MOZ_ENABLE_GNOMEUI=,
5126 MOZ_ENABLE_GNOMEUI=force)
5128 if test "$MOZ_ENABLE_GNOMEUI"
5130 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5132 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5133 MOZ_ENABLE_GNOMEUI=1
5135 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5137 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5143 if test "$MOZ_ENABLE_GNOMEUI"; then
5144 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5147 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5148 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5149 AC_SUBST(MOZ_GNOMEUI_LIBS)
5151 dnl ========================================================
5153 dnl ========================================================
5155 if test "$MOZ_ENABLE_GTK2"
5159 MOZ_ARG_DISABLE_BOOL(dbus,
5160 [ --disable-dbus Disable dbus support ],
5164 if test "$MOZ_ENABLE_DBUS"
5166 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5167 AC_DEFINE(MOZ_ENABLE_DBUS)
5170 AC_SUBST(MOZ_ENABLE_DBUS)
5171 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5172 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5174 dnl ========================================================
5175 dnl = Build Personal Security Manager
5176 dnl ========================================================
5177 MOZ_ARG_DISABLE_BOOL(crypto,
5178 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5182 dnl ========================================================
5183 dnl = JS Debugger XPCOM component (js/jsd)
5184 dnl ========================================================
5185 MOZ_ARG_DISABLE_BOOL(jsd,
5186 [ --disable-jsd Disable JavaScript debug library],
5191 dnl ========================================================
5192 dnl = Disable plugin support
5193 dnl ========================================================
5194 MOZ_ARG_DISABLE_BOOL(plugins,
5195 [ --disable-plugins Disable plugins support],
5199 dnl ========================================================
5200 dnl = Open JVM Interface (OJI) support
5201 dnl ========================================================
5202 MOZ_ARG_DISABLE_BOOL(oji,
5203 [ --disable-oji Disable Open JVM Integration support],
5206 if test -n "$MOZ_OJI"; then
5210 dnl bi-directional support always on
5214 dnl ========================================================
5215 dnl view source support on by default
5216 dnl ========================================================
5217 MOZ_ARG_DISABLE_BOOL(view-source,
5218 [ --disable-view-source Disable view source support],
5221 if test "$MOZ_VIEW_SOURCE"; then
5222 AC_DEFINE(MOZ_VIEW_SOURCE)
5226 dnl ========================================================
5227 dnl accessibility support on by default on all platforms
5229 dnl ========================================================
5230 MOZ_ARG_DISABLE_BOOL(accessibility,
5231 [ --disable-accessibility Disable accessibility support (off by default on OS X)],
5234 if test "$ACCESSIBILITY"; then
5235 AC_DEFINE(ACCESSIBILITY)
5238 if test -n "$ACCESSIBILITY"; then
5240 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5241 if test "$ac_cv_header_atlbase_h" = "no"; then
5242 AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
5244 if test "$ac_cv_header_oleacc_idl" = "no"; then
5245 AC_MSG_ERROR([System header oleacc.idl is not available. See http://developer.mozilla.org/en/docs/oleacc.idl for details on fixing this problem.])
5251 dnl ========================================================
5252 dnl xpfe/components on by default
5253 dnl ========================================================
5254 MOZ_ARG_DISABLE_BOOL(xpfe-components,
5255 [ --disable-xpfe-components
5256 Disable xpfe components],
5257 MOZ_XPFE_COMPONENTS=,
5258 MOZ_XPFE_COMPONENTS=1 )
5260 dnl ========================================================
5261 dnl xpinstall support on by default
5262 dnl ========================================================
5263 MOZ_ARG_DISABLE_BOOL(xpinstall,
5264 [ --disable-xpinstall Disable xpinstall support],
5267 if test "$MOZ_XPINSTALL"; then
5268 AC_DEFINE(MOZ_XPINSTALL)
5271 dnl ========================================================
5272 dnl xpcom js loader support on by default
5273 dnl ========================================================
5274 MOZ_ARG_DISABLE_BOOL(jsloader,
5275 [ --disable-jsloader Disable xpcom js loader support],
5278 if test "$MOZ_JSLOADER"; then
5279 AC_DEFINE(MOZ_JSLOADER)
5282 dnl ========================================================
5283 dnl Disable printing
5284 dnl ========================================================
5285 MOZ_ARG_DISABLE_BOOL(printing,
5286 [ --disable-printing Disable printing support],
5290 if test "$NS_PRINTING"; then
5291 AC_DEFINE(NS_PRINTING)
5292 AC_DEFINE(NS_PRINT_PREVIEW)
5295 dnl ========================================================
5296 dnl use native unicode converters
5297 dnl ========================================================
5298 MOZ_ARG_ENABLE_BOOL(native-uconv,
5299 [ --enable-native-uconv Enable iconv support],
5300 MOZ_USE_NATIVE_UCONV=1,
5301 MOZ_USE_NATIVE_UCONV= )
5302 if test "$MOZ_USE_NATIVE_UCONV"; then
5303 AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5305 if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5306 AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5310 dnl ========================================================
5311 dnl Libeditor can be build as plaintext-only,
5312 dnl or as a full html and text editing component.
5313 dnl We build both by default.
5314 dnl ========================================================
5315 MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5316 [ --enable-plaintext-editor-only
5317 Allow only plaintext editing],
5318 MOZ_PLAINTEXT_EDITOR_ONLY=1,
5319 MOZ_PLAINTEXT_EDITOR_ONLY= )
5320 dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5321 AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5323 dnl ========================================================
5324 dnl Composer is on by default.
5325 dnl ========================================================
5326 MOZ_ARG_DISABLE_BOOL(composer,
5327 [ --disable-composer Disable building of Composer],
5330 AC_SUBST(MOZ_COMPOSER)
5333 dnl ========================================================
5334 dnl = Drop XPCOM Obsolete library
5335 dnl ========================================================
5336 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5337 [ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5338 MOZ_NO_XPCOM_OBSOLETE=1,
5339 MOZ_NO_XPCOM_OBSOLETE=)
5341 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5342 AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5345 dnl ========================================================
5346 dnl = Disable Fast Load
5347 dnl ========================================================
5348 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5349 [ --disable-xpcom-fastload Disable XPCOM fastload support],
5353 AC_SUBST(MOZ_NO_FAST_LOAD)
5355 if test -n "$MOZ_NO_FAST_LOAD"; then
5356 AC_DEFINE(MOZ_NO_FAST_LOAD)
5359 dnl ========================================================
5360 dnl = Enable Ogg Codecs
5361 dnl ========================================================
5362 MOZ_ARG_DISABLE_BOOL(ogg,
5363 [ --disable-ogg Disable Ogg Codec support],
5369 if test -n "$MOZ_OGG"; then
5376 if test -n "$MOZ_MEDIA"; then
5377 AC_DEFINE(MOZ_MEDIA)
5380 dnl If using Ogg with Linux, ensure that the alsa library is available
5381 if test -n "$MOZ_OGG"; then
5382 case "$target_os" in
5384 AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
5389 dnl ========================================================
5390 dnl Permissions System
5391 dnl ========================================================
5392 MOZ_ARG_DISABLE_BOOL(permissions,
5393 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5398 dnl ========================================================
5400 dnl ========================================================
5401 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5402 [ --disable-negotiateauth Disable GSS-API negotiation ],
5403 MOZ_AUTH_EXTENSION=,
5404 MOZ_AUTH_EXTENSION=1 )
5406 dnl ========================================================
5408 dnl ========================================================
5409 MOZ_ARG_DISABLE_BOOL(xtf,
5410 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5413 if test "$MOZ_XTF"; then
5417 dnl ========================================================
5419 dnl ========================================================
5420 MOZ_ARG_DISABLE_BOOL(inspector-apis,
5421 [ --disable-inspector-apis Disable the DOM inspection APIs ],
5422 MOZ_NO_INSPECTOR_APIS=1,
5423 MOZ_NO_INSPECTOR_APIS= )
5425 dnl ========================================================
5426 dnl Pref extensions (autoconfig and system-pref)
5427 dnl ========================================================
5428 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5429 [ --disable-pref-extensions
5430 Disable pref extensions such as autoconfig and
5432 MOZ_PREF_EXTENSIONS=,
5433 MOZ_PREF_EXTENSIONS=1 )
5435 dnl ========================================================
5436 dnl = Universalchardet
5437 dnl ========================================================
5438 MOZ_ARG_DISABLE_BOOL(universalchardet,
5439 [ --disable-universalchardet
5440 Disable universal encoding detection],
5441 MOZ_UNIVERSALCHARDET=,
5442 MOZ_UNIVERSALCHARDET=1 )
5444 dnl ========================================================
5446 dnl ========================================================
5447 MOZ_ARG_ENABLE_BOOL(javaxpcom,
5448 [ --enable-javaxpcom
5449 Enable Java-XPCOM bridge],
5453 if test -n "${MOZ_JAVAXPCOM}"; then
5456 if test -n "$JAVA_HOME"; then
5457 JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5461 if test -n "$JAVA_HOME"; then
5462 JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5467 if test -n "${JAVA_INCLUDE_PATH}"; then
5468 dnl Make sure jni.h exists in the given include path.
5469 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5470 AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5473 case "$target_os" in
5475 dnl Default to java system location
5476 JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5480 JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5483 if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5484 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.])
5488 if test -n "${JAVA_BIN_PATH}"; then
5489 dnl Look for javac and jar in the specified path.
5490 JAVA_PATH="$JAVA_BIN_PATH"
5492 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5493 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5496 AC_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5497 AC_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5498 AC_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5499 if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5500 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.])
5504 dnl ========================================================
5505 dnl = Breakpad crash reporting (on by default on supported platforms)
5506 dnl ========================================================
5508 if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5509 || test "$OS_ARCH" = "Darwin" \
5510 || test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
5511 || test "$OS_ARCH" = "SunOS") \
5512 && test -z "$HAVE_64BIT_OS"; then
5516 MOZ_ARG_DISABLE_BOOL(crashreporter,
5517 [ --disable-crashreporter Disable breakpad crash reporting],
5519 MOZ_CRASHREPORTER=1)
5521 if test -n "$MOZ_CRASHREPORTER"; then
5522 AC_DEFINE(MOZ_CRASHREPORTER)
5524 if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
5525 test -z "$SKIP_LIBRARY_CHECKS"; then
5526 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5527 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5528 AC_SUBST(MOZ_GTHREAD_LIBS)
5530 AC_CHECK_HEADERS([curl/curl.h], [], [AC_MSG_ERROR([Couldn't find curl/curl.h which is required for the crash reporter. Use --disable-crashreporter to disable the crash reporter.])])
5534 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5535 [ --with-crashreporter-enable-percent=NN Enable sending crash reports by default on NN% of users. (default=100)],
5536 [ val=`echo $withval | sed 's/[^0-9]//g'`
5537 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5539 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5540 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5542 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5545 dnl ========================================================
5546 dnl = Build mochitest JS/DOM tests (on by default)
5547 dnl ========================================================
5548 MOZ_ARG_DISABLE_BOOL(mochitest,
5549 [ --disable-mochitest Disable mochitest harness],
5553 dnl ========================================================
5554 dnl = Enable compilation of specific extension modules
5555 dnl ========================================================
5557 MOZ_ARG_ENABLE_STRING(extensions,
5558 [ --enable-extensions Enable extensions],
5559 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5560 if test "$option" = "yes" || test "$option" = "all"; then
5561 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_ALL"
5562 elif test "$option" = "no" || test "$option" = "none"; then
5564 elif test "$option" = "default"; then
5565 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5566 elif test `echo "$option" | grep -c \^-` != 0; then
5567 option=`echo $option | sed 's/^-//'`
5568 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5570 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5573 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5575 if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5576 # Suppress warning on non-X11 platforms
5577 if test -n "$MOZ_X11"; then
5578 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5580 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5583 if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5584 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5585 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5588 dnl This might be temporary: build tridentprofile only on Windows
5589 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5590 AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5591 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5594 dnl cookie must be built before tridentprofile. put it at list's end.
5595 if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5596 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5597 MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5600 dnl xforms requires xtf and schema-validation
5601 if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5602 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5603 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5605 if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5606 AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5607 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5610 if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5611 AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5612 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5615 if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5616 AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5617 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5620 if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5621 AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5622 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5625 if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5626 AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5627 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5630 if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5631 AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5632 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5635 if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5636 AC_MSG_WARN([spellcheck is no longer an extension.])
5637 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5640 if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5641 AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5642 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5646 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5648 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5649 dnl when trying to build a non-existent extension.
5650 for extension in $MOZ_EXTENSIONS; do
5651 if test ! -d "${srcdir}/extensions/${extension}"; then
5652 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5657 dnl ========================================================
5659 dnl ========================================================
5660 case "$MOZ_WIDGET_TOOLKIT" in
5661 beos|windows|os2|mac|cocoa)
5664 if test -z "$MOZ_ENABLE_GTK2"; then
5665 MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5670 MOZ_ARG_ENABLE_STRING(image-decoders,
5671 [ --enable-image-decoders[={mod1,mod2,default,all,none}]
5672 Enable specific image decoders],
5673 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5674 if test "$option" = "yes" || test "$option" = "all"; then
5675 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5676 elif test "$option" = "no" || test "$option" = "none"; then
5678 elif test "$option" = "default"; then
5679 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5680 elif test `echo "$option" | grep -c \^-` != 0; then
5681 option=`echo $option | sed 's/^-//'`
5682 MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5684 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5687 MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5689 dnl Dupes are removed in the encoder section because it will also add decoders
5691 dnl ========================================================
5693 dnl ========================================================
5694 MOZ_ARG_ENABLE_STRING(image-encoders,
5695 [ --enable-image-encoders[={mod1,mod2,default,all,none}]
5696 Enable specific image encoders],
5697 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5698 if test "$option" = "yes" || test "$option" = "all"; then
5699 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5700 elif test "$option" = "no" || test "$option" = "none"; then
5703 elif test "$option" = "default"; then
5704 addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5705 elif test `echo "$option" | grep -c \^-` != 0; then
5706 option=`echo $option | sed 's/^-//'`
5707 addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5709 addencoder="$option"
5711 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5713 MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5716 MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5717 MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5719 dnl ========================================================
5720 dnl experimental ldap features
5721 dnl ========================================================
5722 MOZ_ARG_ENABLE_BOOL(ldap-experimental,
5723 [ --enable-ldap-experimental
5724 Enable LDAP experimental features],
5725 MOZ_LDAP_XPCOM_EXPERIMENTAL=1,
5726 MOZ_LDAP_XPCOM_EXPERIMENTAL=)
5728 dnl ========================================================
5729 dnl MathML on by default
5730 dnl ========================================================
5731 MOZ_ARG_DISABLE_BOOL(mathml,
5732 [ --disable-mathml Disable MathML support],
5735 if test "$MOZ_MATHML"; then
5736 AC_DEFINE(MOZ_MATHML)
5739 dnl ========================================================
5741 dnl ========================================================
5742 MOZ_ARG_DISABLE_BOOL(canvas,
5743 [ --disable-canvas Disable html:canvas feature],
5745 MOZ_ENABLE_CANVAS=1 )
5746 if test -n "$MOZ_ENABLE_CANVAS"; then
5747 AC_DEFINE(MOZ_ENABLE_CANVAS)
5749 AC_SUBST(MOZ_ENABLE_CANVAS)
5751 dnl ========================================================
5753 dnl ========================================================
5754 MOZ_ARG_DISABLE_BOOL(svg,
5755 [ --disable-svg Disable SVG support],
5758 if test -n "$MOZ_SVG"; then
5762 MOZ_SVG_FOREIGNOBJECT=1
5763 dnl ========================================================
5764 dnl SVG <foreignObject>
5765 dnl ========================================================
5766 MOZ_ARG_DISABLE_BOOL(svg-foreignobject,
5767 [ --disable-svg-foreignobject
5768 Disable SVG <foreignObject> support],
5769 MOZ_SVG_FOREIGNOBJECT=,
5770 MOZ_SVG_FOREIGNOBJECT=1 )
5771 if test "$MOZ_SVG_FOREIGNOBJECT"; then
5772 if test "$MOZ_SVG"; then
5773 AC_DEFINE(MOZ_SVG_FOREIGNOBJECT)
5775 MOZ_SVG_FOREIGNOBEJCT=
5779 dnl ========================================================
5781 dnl ========================================================
5782 case "$target_os" in
5783 aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
5788 MOZ_ARG_DISABLE_BOOL(installer,
5789 [ --disable-installer Disable building of installer],
5792 if test -n "$MOZ_INSTALLER" -a -n "$MOZ_XUL_APP" -a "$OS_ARCH" = "WINNT"; then
5793 # Disable installer for Windows builds that use the new toolkit if NSIS
5794 # isn't in the path.
5795 AC_PATH_PROGS(MAKENSIS, makensis)
5796 if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
5797 AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
5799 # The Windows build for NSIS requires the iconv command line utility to
5800 # convert the charset of the locale files.
5801 AC_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5802 if test -z "$HOST_ICONV"; then
5803 AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
5807 # Automatically disable installer if xpinstall isn't built
5808 if test -z "$MOZ_XPINSTALL"; then
5811 AC_SUBST(MOZ_INSTALLER)
5813 AC_MSG_CHECKING([for tar archiver])
5814 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
5815 if test -z "$TAR"; then
5816 AC_MSG_ERROR([no tar archiver found in \$PATH])
5818 AC_MSG_RESULT([$TAR])
5821 dnl ========================================================
5823 dnl ========================================================
5825 MOZ_ARG_DISABLE_BOOL(updater,
5826 [ --disable-updater Disable building of updater],
5829 # The Windows build requires the iconv command line utility
5830 # in order to build the updater.
5831 case "$target_os" in
5832 msvc*|mks*|cygwin*|mingw*|wince*)
5833 if test -n "$MOZ_UPDATER"; then
5834 AC_MSG_CHECKING([for iconv])
5835 AC_CHECK_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
5836 if test -z "$HOST_ICONV"; then
5837 AC_MSG_ERROR([iconv not found in \$PATH])
5842 AC_SUBST(MOZ_UPDATER)
5844 # app update channel is 'default' when not supplied.
5845 MOZ_ARG_ENABLE_STRING([update-channel],
5846 [ --enable-update-channel=CHANNEL
5847 Select application update channel (default=default)],
5848 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
5850 if test -z "$MOZ_UPDATE_CHANNEL"; then
5851 MOZ_UPDATE_CHANNEL=default
5853 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5855 # tools/update-packaging is not checked out by default.
5856 MOZ_ARG_ENABLE_BOOL(update-packaging,
5857 [ --enable-update-packaging
5858 Enable tools/update-packaging],
5859 MOZ_UPDATE_PACKAGING=1,
5860 MOZ_UPDATE_PACKAGING= )
5861 AC_SUBST(MOZ_UPDATE_PACKAGING)
5863 dnl ========================================================
5865 dnl ========================================================
5867 MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
5868 [ --disable-xpconnect-idispatch
5869 Disable building of xpconnect support for IDispatch
5871 XPC_IDISPATCH_SUPPORT=,
5872 XPC_IDISPATCH_SUPPORT=1)
5873 AC_SUBST(XPC_IDISPATCH_SUPPORT)
5875 MOZ_ARG_DISABLE_BOOL(activex,
5876 [ --disable-activex Disable building of ActiveX control (win32 only)],
5877 MOZ_NO_ACTIVEX_SUPPORT=1,
5878 MOZ_NO_ACTIVEX_SUPPORT= )
5879 AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
5881 MOZ_ARG_DISABLE_BOOL(activex-scripting,
5882 [ --disable-activex-scripting
5883 Disable building of ActiveX scripting support (win32)],
5884 MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
5885 MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
5886 AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
5888 if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
5890 AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
5893 if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
5895 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5896 if test "$ac_cv_header_atlbase_h" = "no"; then
5897 AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
5903 dnl ========================================================
5905 dnl ========================================================
5906 MOZ_ARG_ENABLE_BOOL(leaky,
5907 [ --enable-leaky Build leaky memory tool],
5912 dnl ========================================================
5914 dnl ========================================================
5915 MOZ_ARG_ENABLE_BOOL(xpctools,
5916 [ --enable-xpctools Build JS profiling tool],
5921 dnl ========================================================
5922 dnl build the tests by default
5923 dnl ========================================================
5924 MOZ_ARG_DISABLE_BOOL(tests,
5925 [ --disable-tests Do not build test libraries & programs],
5929 dnl ========================================================
5930 dnl parental controls (for Windows Vista)
5931 dnl ========================================================
5932 MOZ_ARG_DISABLE_BOOL(parental-controls,
5933 [ --disable-parental-controls
5934 Do not build parental controls],
5935 MOZ_DISABLE_PARENTAL_CONTROLS=1,
5936 MOZ_DISABLE_PARENTAL_CONTROLS=)
5937 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
5938 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
5941 dnl ========================================================
5942 dnl Vista SDK specific api
5943 dnl ========================================================
5944 MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
5945 [ --disable-vista-sdk-requirements
5946 Do not build Vista SDK specific code],
5947 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
5948 MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
5949 if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
5950 AC_MSG_WARN([Resulting builds will not be compatible with Windows Vista. (bug 428970)])
5951 AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
5952 if test -z "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
5953 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
5955 MOZ_DISABLE_PARENTAL_CONTROLS=1
5958 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
5959 if test "$ac_cv_header_wpcapi_h" = "no"; then
5960 AC_MSG_ERROR([System header wpcapi.h is not available. See updated http://developer.mozilla.org/en/docs/wpcapi.h for details on fixing this problem.])
5965 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
5966 AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
5968 dnl ========================================================
5970 dnl = Module specific options
5972 dnl ========================================================
5973 MOZ_ARG_HEADER(Individual module options)
5975 dnl ========================================================
5976 dnl = Enable Lea malloc in xpcom. OFF by default.
5977 dnl ========================================================
5978 MOZ_ARG_ENABLE_BOOL(xpcom-lea,
5979 [ --enable-xpcom-lea Use Lea malloc in xpcom ],
5982 if test -n "$XPCOM_USE_LEA"; then
5983 AC_DEFINE(XPCOM_USE_LEA)
5986 dnl ========================================================
5987 dnl = Enable places (new history/bookmarks)
5988 dnl ========================================================
5989 MOZ_ARG_ENABLE_BOOL(places,
5990 [ --enable-places Enable 'places' bookmark/history implementation],
5993 if test -n "$MOZ_PLACES"; then
5994 AC_DEFINE(MOZ_PLACES)
5995 if test -z "$MOZ_MAIL_NEWS"; then
6000 if test "$MOZ_BUILD_APP" = "browser"; then
6001 AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
6005 dnl ========================================================
6006 dnl = Disable feed handling components
6007 dnl ========================================================
6008 MOZ_ARG_DISABLE_BOOL(feeds,
6009 [ --disable-feeds Disable feed handling and processing components],
6012 if test -n "$MOZ_FEEDS"; then
6013 AC_DEFINE(MOZ_FEEDS)
6015 if test "$MOZ_BUILD_APP" = "browser"; then
6016 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6020 dnl ========================================================
6021 dnl = Enable mozStorage
6022 dnl ========================================================
6023 dnl Implicitly enabled by default if building calendar or places
6024 MOZ_ARG_ENABLE_BOOL(storage,
6025 [ --enable-storage Enable mozStorage module and related components],
6028 if test -n "$MOZ_STORAGE"; then
6029 AC_DEFINE(MOZ_STORAGE)
6032 dnl ========================================================
6033 dnl Check for sqlite
6034 dnl ========================================================
6037 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6038 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6039 MOZ_NATIVE_SQLITE=1,
6040 MOZ_NATIVE_SQLITE= )
6042 if test -z "$MOZ_NATIVE_SQLITE"
6045 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
6047 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6050 AC_SUBST(MOZ_NATIVE_SQLITE)
6052 dnl ========================================================
6053 dnl = Enable help viewer (off by default)
6054 dnl ========================================================
6055 MOZ_ARG_ENABLE_BOOL(help-viewer,
6056 [ --enable-help-viewer Enable help viewer],
6059 if test -n "$MOZ_HELP_VIEWER"; then
6060 AC_DEFINE(MOZ_HELP_VIEWER)
6062 AC_SUBST(MOZ_HELP_VIEWER)
6063 if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
6064 AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
6067 dnl ========================================================
6068 dnl = Enable safe browsing (anti-phishing)
6069 dnl ========================================================
6070 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6071 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6072 MOZ_SAFE_BROWSING=1,
6073 MOZ_SAFE_BROWSING= )
6074 if test -n "$MOZ_SAFE_BROWSING"; then
6075 AC_DEFINE(MOZ_SAFE_BROWSING)
6077 AC_SUBST(MOZ_SAFE_BROWSING)
6079 dnl ========================================================
6080 dnl = Enable url-classifier
6081 dnl ========================================================
6082 dnl Implicitly enabled by default if building with safe-browsing
6083 if test -n "$MOZ_SAFE_BROWSING"; then
6084 MOZ_URL_CLASSIFIER=1
6086 MOZ_ARG_ENABLE_BOOL(url-classifier,
6087 [ --enable-url-classifier Enable url classifier module],
6088 MOZ_URL_CLASSIFIER=1,
6089 MOZ_URL_CLASSIFIER= )
6090 if test -n "$MOZ_URL_CLASSIFIER"; then
6091 AC_DEFINE(MOZ_URL_CLASSIFIER)
6093 AC_SUBST(MOZ_URL_CLASSIFIER)
6095 dnl ========================================================
6096 dnl = Disable zipwriter
6097 dnl ========================================================
6098 MOZ_ARG_DISABLE_BOOL(zipwriter,
6099 [ --disable-zipwriter Disable zipwriter component],
6102 AC_SUBST(MOZ_ZIPWRITER)
6104 dnl ========================================================
6105 dnl = Enable Ultrasparc specific optimizations for JS
6106 dnl ========================================================
6107 MOZ_ARG_ENABLE_BOOL(js-ultrasparc,
6108 [ --enable-js-ultrasparc Use UltraSPARC optimizations in JS],
6109 JS_ULTRASPARC_OPTS=1,
6110 JS_ULTRASPARC_OPTS= )
6112 dnl only enable option for ultrasparcs
6113 if test `echo "$target_os" | grep -c \^solaris 2>/dev/null` = 0 -o \
6114 "$OS_TEST" != "sun4u"; then
6117 AC_SUBST(JS_ULTRASPARC_OPTS)
6119 dnl ========================================================
6120 dnl = Hildon and OSSO checks
6121 dnl ========================================================
6122 PKG_CHECK_MODULES(LIBHILONMIME,libhildonmime,
6125 if test $NS_HILDON; then
6126 AC_DEFINE(NS_HILDON)
6129 PKG_CHECK_MODULES(LIBOSSO,libosso,
6133 if test $NS_OSSO; then
6134 if test -z "$MOZ_ENABLE_DBUS"; then
6135 AC_MSG_ERROR([DBus is required when building for OSSO])
6140 dnl ========================================================
6142 dnl = Feature options that require extra sources to be pulled
6144 dnl ========================================================
6145 dnl MOZ_ARG_HEADER(Features that require extra sources)
6147 dnl ========================================================
6149 dnl = Debugging Options
6151 dnl ========================================================
6152 MOZ_ARG_HEADER(Debugging and Optimizations)
6154 dnl ========================================================
6155 dnl = Disable building with debug info.
6156 dnl = Debugging is OFF by default
6157 dnl ========================================================
6158 if test -z "$MOZ_DEBUG_FLAGS"
6162 if test "$GNU_CC"; then
6163 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
6164 case "$GCC_VERSION" in
6169 MOZ_DEBUG_FLAGS="-g"
6173 MOZ_DEBUG_FLAGS="-g"
6177 MOZ_DEBUG_FLAGS="-g"
6182 MOZ_ARG_ENABLE_STRING(debug,
6183 [ --enable-debug[=DBG] Enable building with developer debug info
6184 (Using compiler flags DBG)],
6185 [ if test "$enableval" != "no"; then
6187 if test -n "$enableval" && test "$enableval" != "yes"; then
6188 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6195 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
6196 case "${target_os}" in
6198 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
6200 msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6201 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
6204 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
6207 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
6209 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6211 if test -n "$MOZ_DEBUG"; then
6212 AC_MSG_CHECKING([for valid debug flags])
6213 _SAVE_CFLAGS=$CFLAGS
6214 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6215 AC_TRY_COMPILE([#include <stdio.h>],
6216 [printf("Hello World\n");],
6219 AC_MSG_RESULT([$_results])
6220 if test "$_results" = "no"; then
6221 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6223 CFLAGS=$_SAVE_CFLAGS
6226 dnl ========================================================
6227 dnl = Enable code optimization. ON by default.
6228 dnl ========================================================
6229 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6230 MOZ_OPTIMIZE_FLAGS="-O"
6233 MOZ_ARG_ENABLE_STRING(optimize,
6234 [ --disable-optimize Disable compiler optimization
6235 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6236 [ if test "$enableval" != "no"; then
6238 if test -n "$enableval" && test "$enableval" != "yes"; then
6239 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6244 fi ], MOZ_OPTIMIZE=1)
6246 if test "$COMPILE_ENVIRONMENT"; then
6247 if test -n "$MOZ_OPTIMIZE"; then
6248 AC_MSG_CHECKING([for valid optimization flags])
6249 _SAVE_CFLAGS=$CFLAGS
6250 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6251 AC_TRY_COMPILE([#include <stdio.h>],
6252 [printf("Hello World\n");],
6255 AC_MSG_RESULT([$_results])
6256 if test "$_results" = "no"; then
6257 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6259 CFLAGS=$_SAVE_CFLAGS
6261 fi # COMPILE_ENVIRONMENT
6263 AC_SUBST(MOZ_OPTIMIZE)
6264 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6265 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6266 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6268 dnl ========================================================
6269 dnl = Enable/disable debug for specific modules only
6270 dnl = module names beginning with ^ will be disabled
6271 dnl ========================================================
6272 MOZ_ARG_ENABLE_STRING(debug-modules,
6273 [ --enable-debug-modules Enable/disable debug info for specific modules],
6274 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6276 dnl ========================================================
6277 dnl = Enable/disable generation of debugger info for specific modules only
6278 dnl = the special module name ALL_MODULES can be used to denote all modules
6279 dnl = module names beginning with ^ will be disabled
6280 dnl ========================================================
6281 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6282 [ --enable-debugger-info-modules
6283 Enable/disable debugger info for specific modules],
6284 [ for i in `echo $enableval | sed 's/,/ /g'`; do
6285 dnl note that the list of module names is reversed as it is copied
6286 dnl this is important, as it will allow config.mk to interpret stuff like
6287 dnl "^ALL_MODULES xpcom" properly
6288 if test "$i" = "no"; then
6291 if test "$i" = "yes"; then
6294 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6297 dnl ========================================================
6298 dnl Enable garbage collector
6299 dnl ========================================================
6300 MOZ_ARG_ENABLE_BOOL(boehm,
6301 [ --enable-boehm Enable the Boehm Garbage Collector],
6304 if test -n "$GC_LEAK_DETECTOR"; then
6305 AC_DEFINE(GC_LEAK_DETECTOR)
6308 dnl ========================================================
6309 dnl Disable runtime logging checks
6310 dnl ========================================================
6311 MOZ_ARG_DISABLE_BOOL(logging,
6312 [ --disable-logging Disable logging facilities],
6313 NS_DISABLE_LOGGING=1,
6314 NS_DISABLE_LOGGING= )
6315 if test "$NS_DISABLE_LOGGING"; then
6316 AC_DEFINE(NS_DISABLE_LOGGING)
6318 AC_DEFINE(MOZ_LOGGING)
6321 dnl ========================================================
6322 dnl = dnl This will enable logging of addref, release, ctor, dtor.
6323 dnl ========================================================
6324 _ENABLE_LOGREFCNT=42
6325 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6326 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6327 _ENABLE_LOGREFCNT=1,
6328 _ENABLE_LOGREFCNT= )
6329 if test "$_ENABLE_LOGREFCNT" = "1"; then
6330 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6331 elif test -z "$_ENABLE_LOGREFCNT"; then
6332 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6335 dnl ========================================================
6336 dnl = Enable trace malloc
6337 dnl ========================================================
6338 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6339 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6340 [ --enable-trace-malloc Enable malloc tracing],
6343 if test "$NS_TRACE_MALLOC"; then
6344 # Please, Mr. Linker Man, don't take away our symbol names
6345 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6347 AC_DEFINE(NS_TRACE_MALLOC)
6349 AC_SUBST(NS_TRACE_MALLOC)
6351 dnl ========================================================
6352 dnl = Enable jemalloc
6353 dnl ========================================================
6354 MOZ_ARG_ENABLE_BOOL(jemalloc,
6355 [ --enable-jemalloc Replace memory allocator with jemalloc],
6359 if test "$NS_TRACE_MALLOC"; then
6363 if test "$MOZ_MEMORY"; then
6365 dnl Don't try to run compiler tests on Windows
6366 if test "$OS_ARCH" = "WINNT"; then
6367 if test -z "$HAVE_64BIT_OS"; then
6368 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6370 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6373 AC_CHECK_SIZEOF([int *], [4])
6374 case "${ac_cv_sizeof_int_p}" in
6376 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6379 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6382 AC_MSG_ERROR([Unexpected pointer size])
6387 AC_DEFINE(MOZ_MEMORY)
6388 if test "x$MOZ_DEBUG" = "x1"; then
6389 AC_DEFINE(MOZ_MEMORY_DEBUG)
6391 dnl The generic feature tests that determine how to compute ncpus are long and
6392 dnl complicated. Therefore, simply define special cpp variables for the
6393 dnl platforms we have special knowledge of.
6394 case "${target_os}" in
6396 AC_DEFINE(MOZ_MEMORY_DARWIN)
6399 AC_DEFINE(MOZ_MEMORY_BSD)
6402 AC_DEFINE(MOZ_MEMORY_LINUX)
6405 AC_DEFINE(MOZ_MEMORY_BSD)
6408 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6410 msvc*|mks*|cygwin*|mingw*)
6411 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6412 dnl XXX: should test for vc8sp1 here, otherwise patching the crt src
6413 dnl will fail miserably
6414 if test "$_CC_SUITE" -lt "8"; then
6415 AC_MSG_ERROR([Building jemalloc requires Visual C++ 2005 or better])
6417 if test -z "$WIN32_CRT_SRC_DIR" -a -z "$WIN32_CUSTOM_CRT_DIR"; then
6418 if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6419 AC_MSG_ERROR([When building jemalloc, either set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src), or set WIN32_CUSTOM_CRT_DIR to the path to a folder containing a pre-built CRT DLL.])
6421 WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6424 if test -z "$WIN32_CRT_SRC_DIR"; then
6426 WIN32_CUSTOM_CRT_DIR=`cd "$WIN32_CUSTOM_CRT_DIR" && pwd`
6427 _WIN_UNIX_CRT_PATH="$WIN32_CUSTOM_CRT_DIR"
6429 # CRT source directory
6430 WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd`
6431 _CRT_BASE_DIR=`basename "$WIN32_CRT_SRC_DIR"`
6432 _WIN_UNIX_CRT_PATH="$_objdir/memory/jemalloc/$_CRT_BASE_DIR/build/intel"
6434 dnl need win32 paths in LIB, hence this python abuse. extra brackets
6436 _WIN_CRT_PATH=[`$PYTHON -c 'import sys, os.path; print os.path.normpath(sys.argv[1])' "$_WIN_UNIX_CRT_PATH"`]
6437 MOZ_LIB="$_WIN_CRT_PATH;$LIB"
6438 dnl Needs to be in PATH too, since our tools will wind up linked against it.
6439 dnl This needs to be unix style.
6440 MOZ_PATH="$PATH:$_WIN_UNIX_CRT_PATH"
6441 dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6442 AC_DEFINE(_STATIC_CPPLIB)
6443 dnl Don't generate a manifest, since we're linking to a custom CRT.
6444 LDFLAGS="$LDFLAGS -MANIFEST:NO"
6445 dnl Also pass this to NSPR/NSS
6446 DLLFLAGS="$DLLFLAGS -MANIFEST:NO"
6450 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6454 AC_ARG_WITH([valgrind],
6455 [ --with-valgrind Enable valgrind integration hooks],
6456 [enable_valgrind="yes"], [enable_valgrind="no"])
6457 AC_CHECK_HEADER([valgrind/valgrind.h], [], [enable_valgrind="no"])
6458 if test "x$enable_valgrind" = "xyes" ; then
6459 AC_DEFINE(MOZ_VALGRIND)
6462 AC_SUBST(MOZ_MEMORY)
6463 AC_SUBST(WIN32_CRT_SRC_DIR)
6464 AC_SUBST(WIN32_CUSTOM_CRT_DIR)
6467 dnl Need to set this for make because NSS doesn't have configure
6470 dnl ========================================================
6471 dnl = Use malloc wrapper lib
6472 dnl ========================================================
6473 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6474 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6478 if test -n "$_WRAP_MALLOC"; then
6479 if test "$GNU_CC"; then
6480 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"
6481 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6485 dnl ========================================================
6486 dnl = Location of malloc wrapper lib
6487 dnl ========================================================
6488 MOZ_ARG_WITH_STRING(wrap-malloc,
6489 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
6490 WRAP_MALLOC_LIB=$withval)
6492 dnl ========================================================
6493 dnl = Use Electric Fence
6494 dnl ========================================================
6495 MOZ_ARG_ENABLE_BOOL(efence,
6496 [ --enable-efence Link with Electric Fence],
6499 if test -n "$_ENABLE_EFENCE"; then
6500 AC_CHECK_LIB(efence,malloc)
6503 dnl ========================================================
6505 dnl ========================================================
6506 MOZ_ARG_ENABLE_BOOL(jprof,
6507 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6510 if test -n "$MOZ_JPROF"; then
6511 AC_DEFINE(MOZ_JPROF)
6514 dnl ========================================================
6516 dnl ========================================================
6517 MOZ_ARG_ENABLE_BOOL(shark,
6518 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6521 if test -n "$MOZ_SHARK"; then
6522 AC_DEFINE(MOZ_SHARK)
6525 dnl ========================================================
6527 dnl ========================================================
6528 MOZ_ARG_ENABLE_BOOL(callgrind,
6529 [ --enable-callgrind Enable callgrind profiling],
6532 if test -n "$MOZ_CALLGRIND"; then
6533 AC_DEFINE(MOZ_CALLGRIND)
6536 dnl ========================================================
6538 dnl ========================================================
6539 MOZ_ARG_ENABLE_BOOL(vtune,
6540 [ --enable-vtune Enable vtune profiling],
6543 if test -n "$MOZ_VTUNE"; then
6544 AC_DEFINE(MOZ_VTUNE)
6547 dnl ========================================================
6548 dnl = Enable static checking using gcc-dehydra
6549 dnl ========================================================
6551 MOZ_ARG_WITH_STRING(static-checking,
6552 [ --with-static-checking=path/to/gcc_dehydra.so
6553 Enable static checking of code using GCC-dehydra],
6554 DEHYDRA_PATH=$withval,
6557 if test -n "$DEHYDRA_PATH"; then
6558 if ! test -f "$DEHYDRA_PATH"; then
6559 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
6561 AC_DEFINE(NS_STATIC_CHECKING)
6563 AC_SUBST(DEHYDRA_PATH)
6565 dnl ========================================================
6566 dnl = Enable stripping of libs & executables
6567 dnl ========================================================
6568 MOZ_ARG_ENABLE_BOOL(strip,
6569 [ --enable-strip Enable stripping of libs & executables ],
6573 dnl ========================================================
6574 dnl = Enable stripping of libs & executables when packaging
6575 dnl ========================================================
6576 MOZ_ARG_ENABLE_BOOL(install-strip,
6577 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
6581 dnl ========================================================
6582 dnl = --enable-elf-dynstr-gc
6583 dnl ========================================================
6584 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6585 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6586 USE_ELF_DYNSTR_GC=1,
6587 USE_ELF_DYNSTR_GC= )
6589 dnl ========================================================
6590 dnl = --enable-old-abi-compat-wrappers
6591 dnl ========================================================
6592 dnl on x86 linux, the current builds of some popular plugins (notably
6593 dnl flashplayer and real) expect a few builtin symbols from libgcc
6594 dnl which were available in some older versions of gcc. However,
6595 dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6596 dnl we want those plugin to work with a gcc-3.1 built binary, we need
6597 dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6598 dnl to true on x86 linux, and false everywhere else.
6601 MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6602 [ --enable-old-abi-compat-wrappers
6603 Support old GCC ABI symbols to ease the pain
6604 of the linux compiler change],
6605 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6606 MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6607 if test "$COMPILE_ENVIRONMENT"; then
6608 if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6611 AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6613 AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6615 fi # COMPILE_ENVIRONMENT
6617 dnl ========================================================
6618 dnl = --enable-prebinding
6619 dnl ========================================================
6620 MOZ_ARG_ENABLE_BOOL(prebinding,
6621 [ --enable-prebinding Enable prebinding (Mac OS X only)],
6625 dnl ========================================================
6627 dnl = Profiling and Instrumenting
6629 dnl ========================================================
6630 MOZ_ARG_HEADER(Profiling and Instrumenting)
6632 dnl ========================================================
6633 dnl = Enable timeline service, which provides lightweight
6634 dnl = instrumentation of mozilla for performance measurement.
6635 dnl = Timeline is off by default.
6636 dnl ========================================================
6637 MOZ_ARG_ENABLE_BOOL(timeline,
6638 [ --enable-timeline Enable timeline services ],
6641 if test -n "$MOZ_TIMELINE"; then
6642 AC_DEFINE(MOZ_TIMELINE)
6645 dnl ========================================================
6646 dnl Turn on reflow counting
6647 dnl ========================================================
6648 MOZ_ARG_ENABLE_BOOL(reflow-perf,
6649 [ --enable-reflow-perf Enable reflow performance tracing],
6652 if test -n "$MOZ_REFLOW_PREF"; then
6653 AC_DEFINE(MOZ_REFLOW_PREF)
6655 AC_SUBST(MOZ_REFLOW_PERF)
6657 dnl ========================================================
6658 dnl Enable performance metrics.
6659 dnl ========================================================
6660 MOZ_ARG_ENABLE_BOOL(perf-metrics,
6661 [ --enable-perf-metrics Enable performance metrics],
6664 if test -n "$MOZ_PERF_METRICS"; then
6665 AC_DEFINE(MOZ_PERF_METRICS)
6668 dnl ========================================================
6669 dnl Enable code size metrics.
6670 dnl ========================================================
6671 MOZ_ARG_ENABLE_BOOL(codesighs,
6672 [ --enable-codesighs Enable code size analysis tools],
6673 _ENABLE_CODESIGHS=1,
6674 _ENABLE_CODESIGHS= )
6675 if test -n "$_ENABLE_CODESIGHS"; then
6676 if test -d $srcdir/tools/codesighs; then
6679 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6683 dnl ========================================================
6684 dnl = Add support for Eazel profiler
6685 dnl ========================================================
6686 MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6687 [ --enable-eazel-profiler-support
6688 Enable Corel/Eazel profiler support],
6689 ENABLE_EAZEL_PROFILER=1,
6690 ENABLE_EAZEL_PROFILER= )
6691 if test -n "$ENABLE_EAZEL_PROFILER"; then
6692 AC_DEFINE(ENABLE_EAZEL_PROFILER)
6694 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6695 EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6696 EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6699 MOZ_ARG_ENABLE_STRING(profile-modules,
6700 [ --enable-profile-modules
6701 Enable/disable profiling for specific modules],
6702 [ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6704 MOZ_ARG_ENABLE_BOOL(insure,
6705 [ --enable-insure Enable insure++ instrumentation (linux only)],
6708 if test -n "$_ENABLE_INSURE"; then
6712 MOZ_INSURE_EXCLUDE_DIRS="config"
6715 MOZ_ARG_WITH_STRING(insure-dirs,
6716 [ --with-insure-dirs=DIRS
6717 Dirs to instrument with insure ],
6718 MOZ_INSURE_DIRS=$withval )
6720 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
6721 [ --with-insure-exclude-dirs=DIRS
6722 Dirs to not instrument with insure ],
6723 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
6725 dnl ========================================================
6726 dnl = Support for Quantify (Windows)
6727 dnl ========================================================
6728 MOZ_ARG_ENABLE_BOOL(quantify,
6729 [ --enable-quantify Enable Quantify support (Windows only) ],
6733 dnl ========================================================
6734 dnl = Support for demangling undefined symbols
6735 dnl ========================================================
6736 if test -z "$SKIP_LIBRARY_CHECKS"; then
6739 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
6743 # Demangle only for debug or trace-malloc builds
6744 MOZ_DEMANGLE_SYMBOLS=
6745 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
6746 MOZ_DEMANGLE_SYMBOLS=1
6747 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
6749 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
6751 dnl ========================================================
6752 dnl = Support for gcc stack unwinding (from gcc 3.3)
6753 dnl ========================================================
6754 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
6755 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
6758 dnl ========================================================
6762 dnl ========================================================
6763 MOZ_ARG_HEADER(Misc. Options)
6765 dnl ========================================================
6766 dnl update xterm title
6767 dnl ========================================================
6768 MOZ_ARG_ENABLE_BOOL(xterm-updates,
6769 [ --enable-xterm-updates Update XTERM titles with current command.],
6773 dnl =========================================================
6775 dnl =========================================================
6776 MOZ_ARG_ENABLE_STRING([chrome-format],
6777 [ --enable-chrome-format=jar|flat|both|symlink
6778 Select FORMAT of chrome files (default=jar)],
6779 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
6781 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
6782 MOZ_CHROME_FILE_FORMAT=jar
6785 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
6786 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
6787 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
6788 test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
6789 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
6792 dnl ========================================================
6793 dnl = Define default location for MOZILLA_FIVE_HOME
6794 dnl ========================================================
6795 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
6796 [ --with-default-mozilla-five-home
6797 Set the default value for MOZILLA_FIVE_HOME],
6798 [ val=`echo $withval`
6799 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
6801 dnl ========================================================
6802 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
6803 dnl ========================================================
6804 MOZ_ARG_WITH_STRING(user-appdir,
6805 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
6806 [ val=`echo $withval`
6807 if echo "$val" | grep "\/" >/dev/null; then
6808 AC_MSG_ERROR("Homedir must be single relative path.")
6813 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
6815 dnl ========================================================
6816 dnl = Doxygen configuration
6817 dnl ========================================================
6818 dnl Use commas to specify multiple dirs to this arg
6819 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
6820 MOZ_ARG_WITH_STRING(doc-input-dirs,
6821 [ --with-doc-input-dirs=DIRS
6822 Header/idl dirs to create docs from],
6823 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6824 AC_SUBST(MOZ_DOC_INPUT_DIRS)
6826 dnl Use commas to specify multiple dirs to this arg
6827 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
6828 MOZ_ARG_WITH_STRING(doc-include-dirs,
6829 [ --with-doc-include-dirs=DIRS
6830 Include dirs to preprocess doc headers],
6831 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
6832 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
6834 MOZ_DOC_OUTPUT_DIR='./dist/docs'
6835 MOZ_ARG_WITH_STRING(doc-output-dir,
6836 [ --with-doc-output-dir=DIR
6837 Dir to generate docs into],
6838 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
6839 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
6841 if test -z "$SKIP_COMPILER_CHECKS"; then
6842 dnl ========================================================
6844 dnl = Compiler Options
6846 dnl ========================================================
6847 MOZ_ARG_HEADER(Compiler Options)
6849 dnl ========================================================
6850 dnl Check for gcc -pipe support
6851 dnl ========================================================
6852 AC_MSG_CHECKING([for gcc -pipe support])
6853 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
6854 echo '#include <stdio.h>' > dummy-hello.c
6855 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
6856 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
6857 cat dummy-hello.s | ${AS_BIN} -o dummy-hello.S - 2>&5
6858 if test $? = 0; then
6863 if test "$_res_as_stdin" = "yes"; then
6864 _SAVE_CFLAGS=$CFLAGS
6865 CFLAGS="$CFLAGS -pipe"
6866 AC_TRY_COMPILE( [ #include <stdio.h> ],
6867 [printf("Hello World\n");],
6868 [_res_gcc_pipe="yes"],
6869 [_res_gcc_pipe="no"] )
6870 CFLAGS=$_SAVE_CFLAGS
6872 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
6874 CFLAGS="$CFLAGS -pipe"
6875 CXXFLAGS="$CXXFLAGS -pipe"
6879 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
6880 AC_MSG_RESULT([$_res])
6885 dnl pass -Wno-long-long to the compiler
6886 MOZ_ARG_ENABLE_BOOL(long-long-warning,
6887 [ --enable-long-long-warning
6888 Warn about use of non-ANSI long long type],
6889 _IGNORE_LONG_LONG_WARNINGS=,
6890 _IGNORE_LONG_LONG_WARNINGS=1)
6892 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
6893 _SAVE_CFLAGS="$CFLAGS"
6894 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
6895 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
6896 AC_TRY_COMPILE([], [return(0);],
6897 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6898 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
6899 result="yes" ], result="no")
6900 AC_MSG_RESULT([$result])
6901 CFLAGS="$_SAVE_CFLAGS"
6904 dnl ========================================================
6905 dnl Profile guided optimization
6906 dnl ========================================================
6907 dnl Test for profiling options
6908 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
6909 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
6911 dnl Provide a switch to disable PGO even when called via profiledbuild.
6912 MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
6913 [ --disable-profile-guided-optimization
6914 Don't build with PGO even if called via make profiledbuild],
6915 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
6916 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
6918 AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
6920 _SAVE_CFLAGS="$CFLAGS"
6921 CFLAGS="$CFLAGS -fprofile-generate"
6923 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
6924 AC_TRY_COMPILE([], [return 0;],
6925 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
6926 result="yes" ], result="no")
6927 AC_MSG_RESULT([$result])
6929 if test $result = "yes"; then
6930 PROFILE_GEN_LDFLAGS="-fprofile-generate"
6931 PROFILE_USE_CFLAGS="-fprofile-use"
6932 PROFILE_USE_LDFLAGS="-fprofile-use"
6934 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
6935 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
6936 AC_TRY_COMPILE([], [return 0;],
6937 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
6938 result="yes" ], result="no")
6939 AC_MSG_RESULT([$result])
6940 if test $result = "yes"; then
6941 PROFILE_USE_CFLAGS="-fbranch-probabilities"
6943 # don't really care, this is an old GCC
6944 PROFILE_GEN_LDFLAGS=
6945 PROFILE_USE_LDFLAGS=
6948 CFLAGS="$_SAVE_CFLAGS"
6950 if test -n "$INTEL_CC"; then
6951 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
6952 PROFILE_GEN_LDFLAGS=
6953 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
6954 PROFILE_USE_LDFLAGS=
6957 dnl Sun Studio on Solaris
6958 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
6959 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
6960 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
6961 if test "$CPU_ARCH" != "sparc"; then
6962 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
6963 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
6965 PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
6966 PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
6970 AC_SUBST(PROFILE_GEN_CFLAGS)
6971 AC_SUBST(PROFILE_GEN_LDFLAGS)
6972 AC_SUBST(PROFILE_USE_CFLAGS)
6973 AC_SUBST(PROFILE_USE_LDFLAGS)
6977 dnl ========================================================
6978 dnl Test for -pedantic bustage
6979 dnl ========================================================
6980 MOZ_ARG_DISABLE_BOOL(pedantic,
6981 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
6983 if test "$_PEDANTIC"; then
6984 _SAVE_CXXFLAGS=$CXXFLAGS
6985 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6986 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
6987 AC_TRY_COMPILE([$configure_static_assert_macros],
6988 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
6989 result="no", result="yes" )
6990 AC_MSG_RESULT([$result])
6991 CXXFLAGS="$_SAVE_CXXFLAGS"
6995 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
6996 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
6999 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7004 dnl ========================================================
7005 dnl Test for correct temporary object destruction order
7006 dnl ========================================================
7007 dnl We want to make sure the compiler follows the C++ spec here as
7008 dnl xpcom and the string classes depend on it (bug 235381).
7009 AC_MSG_CHECKING([for correct temporary object destruction order])
7010 AC_TRY_RUN([ class A {
7011 public: A(int& x) : mValue(x) {}
7013 operator char**() { return 0; }
7014 private: int& mValue;
7016 void func(char **arg) {}
7027 result="yes", result="no", result="maybe")
7028 AC_MSG_RESULT([$result])
7030 if test "$result" = "no"; then
7031 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
7034 dnl ========================================================
7035 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7036 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7037 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7038 dnl ========================================================
7039 _SAVE_CXXFLAGS=$CXXFLAGS
7040 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7041 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7042 ac_nscap_nonconst_opeq_bug,
7051 template <class T, class U>
7052 int operator==(const Pointer<T>& rhs, U* lhs)
7054 return rhs.myPtr == lhs;
7057 template <class T, class U>
7058 int operator==(const Pointer<T>& rhs, const U* lhs)
7060 return rhs.myPtr == lhs;
7068 ac_nscap_nonconst_opeq_bug="no",
7069 ac_nscap_nonconst_opeq_bug="yes")])
7070 CXXFLAGS="$_SAVE_CXXFLAGS"
7072 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7073 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7075 fi # SKIP_COMPILER_CHECKS
7077 dnl ========================================================
7079 dnl Should be smarter and check that the compiler does indeed have rtti
7080 dnl ========================================================
7081 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
7082 [ --enable-cpp-rtti Enable C++ RTTI ],
7083 [ _MOZ_USE_RTTI=1 ],
7086 if test "$_MOZ_USE_RTTI"; then
7087 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
7089 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
7092 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
7094 dnl ========================================================
7095 dnl C++ exceptions (g++/egcs only - for now)
7096 dnl Should be smarter and check that the compiler does indeed have exceptions
7097 dnl ========================================================
7098 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
7099 [ --enable-cpp-exceptions Enable C++ exceptions ],
7100 [ _MOZ_CPP_EXCEPTIONS=1 ],
7101 [ _MOZ_CPP_EXCEPTIONS= ])
7103 if test "$_MOZ_CPP_EXCEPTIONS"; then
7104 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
7106 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
7109 # Irix & OSF native compilers do not like exception declarations
7110 # when exceptions are disabled
7111 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
7112 AC_DEFINE(CPP_THROW_NEW, [])
7114 AC_DEFINE(CPP_THROW_NEW, [throw()])
7118 dnl ========================================================
7120 dnl = Build depencency options
7122 dnl ========================================================
7123 MOZ_ARG_HEADER(Build dependencies)
7125 dnl ========================================================
7126 dnl = Do not auto generate dependency info
7127 dnl ========================================================
7129 MOZ_ARG_DISABLE_BOOL(auto-deps,
7130 [ --disable-auto-deps Do not automatically generate dependency info],
7134 if test -n "$MOZ_AUTO_DEPS"; then
7135 dnl ========================================================
7136 dnl = Use mkdepend instead of $CC -MD for dependency generation
7137 dnl ========================================================
7139 MOZ_ARG_DISABLE_BOOL(md,
7140 [ --disable-md Do not use compiler-based dependencies ],
7143 [dnl Default is to turn on -MD if using GNU-compatible compilers
7144 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
7147 dnl Default is to use -xM if using Sun Studio on Solaris
7148 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
7151 if test "$_cpp_md_flag"; then
7153 if test "$OS_ARCH" = "OpenVMS"; then
7154 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(*F).pp))'
7156 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(*F).pp)'
7158 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7159 if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then
7164 _USE_CPP_INCLUDE_FLAG=
7165 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7166 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7170 AC_SUBST(MOZ_AUTO_DEPS)
7171 AC_SUBST(COMPILER_DEPEND)
7175 dnl ========================================================
7177 dnl = Static Build Options
7179 dnl ========================================================
7180 MOZ_ARG_HEADER(Static build options)
7182 MOZ_ARG_ENABLE_BOOL(static,
7183 [ --enable-static Enable building of internal static libs],
7184 BUILD_STATIC_LIBS=1,
7187 dnl Disable libxul in debug builds, but not for xulrunner.
7188 if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
7192 MOZ_ARG_ENABLE_BOOL(libxul,
7193 [ --enable-libxul Enable building of libxul],
7194 MOZ_ENABLE_LIBXUL=1,
7197 if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
7198 AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
7201 if test -n "$MOZ_ENABLE_LIBXUL" -a -z "$MOZ_XUL_APP"; then
7202 AC_MSG_ERROR([--enable-libxul is only compatible with toolkit XUL applications.])
7205 if test -n "$MOZ_ENABLE_LIBXUL"; then
7206 XPCOM_LIBS="$LIBXUL_LIBS"
7207 AC_DEFINE(MOZ_ENABLE_LIBXUL)
7209 if test -n "$BUILD_STATIC_LIBS"; then
7210 AC_DEFINE(MOZ_STATIC_BUILD)
7212 XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
7215 dnl ========================================================
7216 dnl = Force JS to be a static lib
7217 dnl ========================================================
7218 MOZ_ARG_ENABLE_BOOL(js-static-build,
7219 [ --enable-js-static-build Force js to be a static lib],
7223 AC_SUBST(JS_STATIC_BUILD)
7225 if test -n "$JS_STATIC_BUILD"; then
7226 AC_DEFINE(EXPORT_JS_API)
7228 if test -z "$BUILD_STATIC_LIBS"; then
7229 AC_MSG_ERROR([--enable-js-static-build is only compatible with --enable-static])
7234 dnl Disable static mail in debug builds, but not with libxul sdk.
7235 if test -n "$MOZ_DEBUG" -a -z "$LIBXUL_SDK"; then
7236 MOZ_STATIC_MAIL_BUILD=
7238 MOZ_ARG_ENABLE_BOOL(static-mail,
7239 [ --enable-static-mail Enable static mail build support],
7240 MOZ_STATIC_MAIL_BUILD=1,
7241 MOZ_STATIC_MAIL_BUILD= )
7243 if test "$MOZ_STATIC_MAIL_BUILD"; then
7244 AC_DEFINE(MOZ_STATIC_MAIL_BUILD)
7247 AC_SUBST(MOZ_STATIC_MAIL_BUILD)
7249 dnl ========================================================
7251 dnl = Standalone module options
7253 dnl ========================================================
7254 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7256 dnl Check for GLib and libIDL.
7257 dnl ========================================================
7258 case "$target_os" in
7259 msvc*|mks*|cygwin*|mingw*|wince*)
7260 SKIP_IDL_CHECK="yes"
7267 if test -z "$COMPILE_ENVIRONMENT"; then
7268 SKIP_IDL_CHECK="yes"
7271 dnl = Allow users to disable libIDL checking for standalone modules
7272 MOZ_ARG_WITHOUT_BOOL(libIDL,
7273 [ --without-libIDL Skip check for libIDL (standalone modules only)],
7274 SKIP_IDL_CHECK="yes")
7276 if test "$SKIP_IDL_CHECK" = "no"
7279 if test "$MACOS_SDK_DIR"; then
7280 dnl xpidl, and therefore libIDL, is only needed on the build host.
7281 dnl Don't build it against the SDK, as that causes problems.
7282 _MACSAVE_CFLAGS="$CFLAGS"
7283 _MACSAVE_LIBS="$LIBS"
7284 _MACSAVE_LDFLAGS="$LDFLAGS"
7285 _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
7287 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"`
7288 LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
7289 LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
7294 if test "$MOZ_ENABLE_GTK2"; then
7295 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
7297 dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
7298 dnl to either libIDL1 or libIDL2.
7299 if test -z "$_LIBIDL_FOUND"; then
7300 AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
7301 if test -z "$_LIBIDL_FOUND"; then
7302 PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
7306 dnl If we don't have a libIDL config program & not cross-compiling,
7307 dnl look for orbit-config instead.
7309 if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
7310 AC_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
7311 if test -n "$ORBIT_CONFIG"; then
7312 AC_MSG_CHECKING([for ORBit libIDL usability])
7313 _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
7314 _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
7315 _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
7316 _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
7317 LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
7318 LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
7320 _SAVE_CFLAGS="$CFLAGS"
7322 CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
7323 LIBS="$LIBIDL_LIBS $LIBS"
7326 #include <libIDL/IDL.h>
7329 s=strdup(IDL_get_libver_string());
7342 AC_MSG_RESULT($result)
7343 CFLAGS="$_SAVE_CFLAGS"
7347 if test -z "$_LIBIDL_FOUND"; then
7348 AC_MSG_ERROR([libIDL not found.
7349 libIDL $LIBIDL_VERSION or higher is required.])
7351 if test "$MACOS_SDK_DIR"; then
7352 CFLAGS="$_MACSAVE_CFLAGS"
7353 LIBS="$_MACSAVE_LIBS"
7354 LDFLAGS="$_MACSAVE_LDFLAGS"
7355 if test -n "$_MACSAVE_NEXT_ROOT" ; then
7356 export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
7361 if test -n "$CROSS_COMPILE"; then
7362 if test -z "$HOST_LIBIDL_CONFIG"; then
7363 HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
7365 if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
7366 HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
7367 HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
7369 HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
7370 HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
7374 if test -z "$SKIP_PATH_CHECKS"; then
7375 if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
7376 if test "$MOZ_ENABLE_GTK2"; then
7377 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7379 AM_PATH_GLIB(${GLIB_VERSION})
7384 if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
7385 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7388 AC_SUBST(LIBIDL_CFLAGS)
7389 AC_SUBST(LIBIDL_LIBS)
7390 AC_SUBST(STATIC_LIBIDL)
7391 AC_SUBST(GLIB_CFLAGS)
7393 AC_SUBST(GLIB_GMODULE_LIBS)
7394 AC_SUBST(HOST_LIBIDL_CONFIG)
7395 AC_SUBST(HOST_LIBIDL_CFLAGS)
7396 AC_SUBST(HOST_LIBIDL_LIBS)
7398 dnl ========================================================
7399 dnl Check for libart
7400 dnl ========================================================
7401 if test "$MOZ_SVG_RENDERER_LIBART"; then
7402 if test ! -f $topsrcdir/other-licenses/libart_lgpl/Makefile.in; then
7403 AC_MSG_ERROR([You must check out the mozilla version of libart. Use
7404 mk_add_options MOZ_CO_MODULE=mozilla/other-licenses/libart_lgpl])
7407 dnl libart's configure hasn't been run yet, but we know what the
7408 dnl answer should be anyway
7409 MOZ_LIBART_CFLAGS='-I${DIST}/include/libart_lgpl'
7410 case "$target_os" in
7411 msvc*|mks*|cygwin*|mingw*|wince*)
7412 MOZ_LIBART_LIBS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)moz_art_lgpl.$(IMPORT_LIB_SUFFIX)'
7415 MOZ_LIBART_LIBS='-lmoz_art -lm'
7418 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lroot -lbe'
7421 MOZ_LIBART_LIBS='-lmoz_art_lgpl -lm'
7427 AC_SUBST(MOZ_LIBART_CFLAGS)
7428 AC_SUBST(MOZ_LIBART_LIBS)
7430 dnl ========================================================
7432 dnl ========================================================
7433 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7436 MOZ_ARG_ENABLE_BOOL(system-cairo,
7437 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7441 # Check for headers defining standard int types.
7442 AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7444 if test "$MOZ_TREE_CAIRO"; then
7445 AC_DEFINE(MOZ_TREE_CAIRO)
7447 # For now we assume that we will have a uint64_t available through
7448 # one of the above headers or mozstdint.h.
7449 AC_DEFINE(HAVE_UINT64_T)
7451 # Define macros for cairo-features.h
7452 if test "$MOZ_X11"; then
7453 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7454 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7455 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7456 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7457 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7458 MOZ_ENABLE_CAIRO_FT=1
7459 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7461 if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7462 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7463 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7464 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7466 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7467 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7468 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7469 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7471 if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7472 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7473 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7474 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7475 MOZ_ENABLE_CAIRO_FT=1
7476 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7477 CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7479 if test "$MOZ_ENABLE_GLITZ"; then
7480 GLITZ_SURFACE_FEATURE="#define CAIRO_HAS_GLITZ_SURFACE 1"
7482 if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7483 PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7484 BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7485 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7486 MOZ_ENABLE_CAIRO_FT=1
7488 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7489 AC_SUBST(CAIRO_FT_CFLAGS)
7491 if test "$MOZ_DEBUG"; then
7492 SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7494 SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7497 PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7499 AC_SUBST(PS_SURFACE_FEATURE)
7500 AC_SUBST(PDF_SURFACE_FEATURE)
7501 AC_SUBST(SVG_SURFACE_FEATURE)
7502 AC_SUBST(XLIB_SURFACE_FEATURE)
7503 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7504 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7505 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7506 AC_SUBST(XCB_SURFACE_FEATURE)
7507 AC_SUBST(WIN32_SURFACE_FEATURE)
7508 AC_SUBST(OS2_SURFACE_FEATURE)
7509 AC_SUBST(BEOS_SURFACE_FEATURE)
7510 AC_SUBST(GLITZ_SURFACE_FEATURE)
7511 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7512 AC_SUBST(FT_FONT_FEATURE)
7513 AC_SUBST(WIN32_FONT_FEATURE)
7514 AC_SUBST(QUARTZ_FONT_FEATURE)
7515 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7517 if test "$_WIN32_MSVC"; then
7518 MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7519 if test "$MOZ_ENABLE_GLITZ"; then
7520 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'$(DEPTH)/gfx/cairo/glitz/src/mozglitz.lib $(DEPTH)/gfx/cairo/glitz/src/wgl/mozglitzwgl.lib'
7523 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"
7525 if test "$MOZ_X11"; then
7526 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7529 if test "$MOZ_ENABLE_GLITZ"; then
7530 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src -lmozglitz'
7531 if test "$MOZ_X11"; then
7532 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/glx -lmozglitzglx -lGL'
7534 if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7535 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS "'-L$(DEPTH)/gfx/cairo/glitz/src/wgl -lmozglitzwgl'
7540 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7541 mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
7544 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7545 MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7546 MOZ_CAIRO_LIBS=$CAIRO_LIBS
7547 if test "$MOZ_X11"; then
7548 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7549 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7550 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7554 AC_SUBST(MOZ_TREE_CAIRO)
7555 AC_SUBST(MOZ_CAIRO_CFLAGS)
7556 AC_SUBST(MOZ_CAIRO_LIBS)
7558 dnl ========================================================
7560 dnl ========================================================
7563 MOZ_ARG_ENABLE_BOOL(system-lcms,
7564 [ --enable-system-lcms Use system lcms (located with pkgconfig)],
7568 if test -z "$MOZ_NATIVE_LCMS"
7571 if test "$_WIN32_MSVC"; then
7572 if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
7573 LCMS_CFLAGS=-DLCMS_DLL
7575 LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
7577 LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
7580 PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_VERSION)
7583 AC_SUBST(MOZ_NATIVE_LCMS)
7584 AC_SUBST(LCMS_CFLAGS)
7587 dnl ========================================================
7589 dnl ========================================================
7590 MOZ_ARG_DISABLE_BOOL(xul,
7591 [ --disable-xul Disable XUL],
7593 if test "$MOZ_XUL"; then
7596 dnl remove extensions that require XUL
7597 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7602 dnl ========================================================
7603 dnl Two ways to enable Python support:
7604 dnl --enable-extensions=python # select all available.
7605 dnl (MOZ_PYTHON_EXTENSIONS contains the list of extensions)
7607 dnl --enable-extensions=python/xpcom,... # select individual ones
7609 dnl If either is used, we locate the Python to use.
7610 dnl ========================================================
7612 dnl If 'python' appears anywhere in the extensions list, go lookin'...
7613 if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then
7614 dnl Allow PYTHON to point to the Python interpreter to use
7615 dnl (note that it must be the python executable - which we
7616 dnl run to locate the relevant paths etc)
7617 dnl If not set, we use whatever Python we can find.
7619 dnl Ask Python what its version number is
7621 MOZ_PYTHON_VER=`$PYTHON -c "import sys;print '%d%d' % sys.version_info[0:2]"`
7622 MOZ_PYTHON_VER_DOTTED=`$PYTHON -c "import sys;print '%d.%d' % sys.version_info[0:2]"`
7624 dnl Ask for the Python "prefix" (ie, home/source dir)
7625 MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
7626 dnl Setup the include and library directories.
7627 if test "$OS_ARCH" = "WINNT"; then
7628 MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S`
7629 dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib
7630 dnl Binary trees have "include" for .h, and "libs" for .lib
7631 dnl We add 'em both - along with quotes, to handle spaces.
7632 MOZ_PYTHON_DLL_SUFFIX=.pyd
7633 MOZ_PYTHON_INCLUDES="\"-I$MOZ_PYTHON_PREFIX/include\" \"-I$MOZ_PYTHON_PREFIX/PC\""
7634 MOZ_PYTHON_LIBS="\"/libpath:$MOZ_PYTHON_PREFIX/PCBuild\" \"/libpath:$MOZ_PYTHON_PREFIX/libs\""
7636 dnl Non-Windows include and libs
7637 MOZ_PYTHON_DLL_SUFFIX=$DLL_SUFFIX
7638 MOZ_PYTHON_INCLUDES="-I$MOZ_PYTHON_PREFIX/include/python$MOZ_PYTHON_VER_DOTTED"
7639 dnl Check for dynamic Python lib
7640 dnl - A static Python is no good - multiple dynamic libraries (xpcom
7641 dnl - core, xpcom loader, pydom etc) all need to share Python.
7642 dnl - Python 2.3's std --enable-shared configure option will
7643 dnl create a libpython2.3.so.1.0. We should first try this
7644 dnl dotted versioned .so file because this is the one that
7645 dnl the PyXPCOM build mechanics tries to link to.
7646 dnl XXX Should find a better way than hardcoding "1.0".
7647 dnl - Python developement tree dir layouts are NOT allowed here
7648 dnl because the PyXPCOM build just dies on it later anyway.
7649 dnl - Fixes to the above by Python/*nix knowledgable people welcome!
7650 if test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7651 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7652 elif test -f "$MOZ_PYTHON_PREFIX/lib64/libpython$MOZ_PYTHON_VER_DOTTED.so.1.0"; then
7653 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib64 -lpython$MOZ_PYTHON_VER_DOTTED"
7654 elif test -f "$MOZ_PYTHON_PREFIX/lib/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7655 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX/lib -lpython$MOZ_PYTHON_VER_DOTTED"
7656 elif test -f "$MOZ_PYTHON_PREFIX/libpython$MOZ_PYTHON_VER_DOTTED.so"; then
7657 dnl Don't Python development tree directory layout.
7658 MOZ_PYTHON_LIBS="-L$MOZ_PYTHON_PREFIX -lpython$MOZ_PYTHON_VER_DOTTED"
7659 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.])
7660 elif test "$OS_ARCH" = "Darwin"; then
7661 dnl We do Darwin last, so if a custom non-framework build of
7662 dnl python is used on OSX, then it will be picked up first by
7663 dnl the logic above.
7664 MOZ_PYTHON_LIBS="-framework Python"
7666 AC_MSG_ERROR([Could not find build shared libraries for Python at $MOZ_PYTHON_PREFIX. This is required for PyXPCOM.])
7668 if test "$OS_ARCH" = "Linux"; then
7669 MOZ_PYTHON_LIBS="$MOZ_PYTHON_LIBS -lutil"
7672 dnl Handle "_d" on Windows
7673 if test "$OS_ARCH" = "WINNT" && test -n "$MOZ_DEBUG"; then
7674 MOZ_PYTHON_DEBUG_SUFFIX="_d"
7676 MOZ_PYTHON_DEBUG_SUFFIX=
7678 AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX)
7681 dnl If the user asks for the 'python' extension, then we add
7682 dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/'
7683 dnl Note the careful regex - it must match 'python' followed by anything
7684 dnl other than a '/', including the end-of-string.
7685 if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then
7686 for pyext in $MOZ_PYTHON_EXTENSIONS; do
7687 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext`
7690 dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the
7691 dnl command-line, but not yet
7692 AC_SUBST(MOZ_PYTHON_EXTENSIONS)
7693 AC_SUBST(MOZ_PYTHON)
7694 AC_SUBST(MOZ_PYTHON_PREFIX)
7695 AC_SUBST(MOZ_PYTHON_INCLUDES)
7696 AC_SUBST(MOZ_PYTHON_LIBS)
7697 AC_SUBST(MOZ_PYTHON_VER)
7698 AC_SUBST(MOZ_PYTHON_VER_DOTTED)
7699 AC_SUBST(MOZ_PYTHON_DEBUG_SUFFIX)
7700 AC_SUBST(MOZ_PYTHON_DLL_SUFFIX)
7702 dnl ========================================================
7703 dnl disable profile sharing
7704 dnl ========================================================
7705 MOZ_ARG_DISABLE_BOOL(profilesharing,
7706 [ --disable-profilesharing Disable profile sharing],
7707 MOZ_PROFILESHARING=,
7708 MOZ_PROFILESHARING=1 )
7709 if test "$MOZ_PROFILESHARING"; then
7711 AC_DEFINE(MOZ_PROFILESHARING)
7714 dnl ========================================================
7716 dnl ========================================================
7717 MOZ_ARG_ENABLE_BOOL(ipcd,
7718 [ --enable-ipcd Enable IPC daemon],
7722 dnl ========================================================
7723 dnl disable profile locking
7724 dnl do no use this in applications that can have more than
7725 dnl one process accessing the profile directory.
7726 dnl ========================================================
7727 MOZ_ARG_DISABLE_BOOL(profilelocking,
7728 [ --disable-profilelocking Disable profile locking],
7729 MOZ_PROFILELOCKING=,
7730 MOZ_PROFILELOCKING=1 )
7731 if test "$MOZ_PROFILELOCKING"; then
7732 AC_DEFINE(MOZ_PROFILELOCKING)
7735 dnl ========================================================
7736 dnl disable rdf services
7737 dnl ========================================================
7738 MOZ_ARG_DISABLE_BOOL(rdf,
7739 [ --disable-rdf Disable RDF],
7741 if test "$MOZ_RDF"; then
7747 dnl ========================================================
7748 dnl necko configuration options
7749 dnl ========================================================
7752 dnl option to disable various necko protocols
7754 MOZ_ARG_ENABLE_STRING(necko-protocols,
7755 [ --enable-necko-protocols[={http,ftp,default,all,none}]
7756 Enable/disable specific protocol handlers],
7757 [ for option in `echo $enableval | sed 's/,/ /g'`; do
7758 if test "$option" = "yes" || test "$option" = "all"; then
7759 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7760 elif test "$option" = "no" || test "$option" = "none"; then
7762 elif test "$option" = "default"; then
7763 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7764 elif test `echo "$option" | grep -c \^-` != 0; then
7765 option=`echo $option | sed 's/^-//'`
7766 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7768 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7771 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7773 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7774 AC_SUBST(NECKO_PROTOCOLS)
7775 for p in $NECKO_PROTOCOLS; do
7776 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7780 dnl option to disable necko's disk cache
7782 MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7783 [ --disable-necko-disk-cache
7784 Disable necko disk cache],
7787 AC_SUBST(NECKO_DISK_CACHE)
7788 if test "$NECKO_DISK_CACHE"; then
7789 AC_DEFINE(NECKO_DISK_CACHE)
7793 dnl option to minimize size of necko's i/o buffers
7795 MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7796 [ --enable-necko-small-buffers
7797 Minimize size of necko's i/o buffers],
7798 NECKO_SMALL_BUFFERS=1,
7799 NECKO_SMALL_BUFFERS=)
7800 AC_SUBST(NECKO_SMALL_BUFFERS)
7801 if test "$NECKO_SMALL_BUFFERS"; then
7802 AC_DEFINE(NECKO_SMALL_BUFFERS)
7806 dnl option to disable cookies
7808 MOZ_ARG_DISABLE_BOOL(cookies,
7809 [ --disable-cookies Disable cookie support],
7812 AC_SUBST(NECKO_COOKIES)
7813 if test "$NECKO_COOKIES"; then
7814 AC_DEFINE(NECKO_COOKIES)
7817 dnl NECKO_ configuration options are not global
7818 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7820 dnl ========================================================
7821 dnl string api compatibility
7822 dnl ========================================================
7823 MOZ_ARG_DISABLE_BOOL(v1-string-abi,
7824 [ --disable-v1-string-abi Disable binary compatibility layer for strings],
7826 MOZ_V1_STRING_ABI=1)
7827 AC_SUBST(MOZ_V1_STRING_ABI)
7828 if test "$MOZ_V1_STRING_ABI"; then
7829 AC_DEFINE(MOZ_V1_STRING_ABI)
7832 dnl Only build Mork if it's required
7834 if test "$MOZ_MORK"; then
7838 dnl Build the lightweight Mork reader if required
7839 AC_SUBST(MOZ_MORKREADER)
7840 if test "$MOZ_MORKREADER"; then
7841 AC_DEFINE(MOZ_MORKREADER)
7844 dnl ========================================================
7845 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7846 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7849 if test "$MOZ_LDAP_XPCOM"; then
7850 LDAP_CFLAGS='-I${DIST}/public/ldap'
7851 if test "$OS_ARCH" = "WINNT"; then
7852 if test -n "$GNU_CC"; then
7853 LDAP_LIBS='-L$(DIST)/lib -lnsldap32v60 -lnsldappr32v60 -lnsldif32v60'
7855 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}'
7857 elif test "$OS_ARCH" = "OS2"; then
7858 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}'
7860 LDAP_LIBS='-L${DIST}/bin -L${DIST}/lib -lldap60 -lprldap60 -lldif60'
7864 dnl ========================================================
7866 dnl = Maintainer debug option (no --enable equivalent)
7868 dnl ========================================================
7873 AC_SUBST(AR_EXTRACT)
7877 AC_SUBST(AS_DASH_C_FLAG)
7882 AC_SUBST(USE_SHORT_LIBNAME)
7886 AC_SUBST(NS_USE_NATIVE)
7887 AC_SUBST(MOZ_WIDGET_TOOLKIT)
7888 AC_SUBST(MOZ_GFX_TOOLKIT)
7889 AC_SUBST(MOZ_UPDATE_XTERM)
7893 AC_SUBST(MOZ_AUTH_EXTENSION)
7894 AC_SUBST(MOZ_MATHML)
7895 AC_SUBST(MOZ_PERMISSIONS)
7897 AC_SUBST(MOZ_NO_INSPECTOR_APIS)
7898 AC_SUBST(MOZ_PREF_EXTENSIONS)
7900 AC_SUBST(MOZ_SVG_FOREIGNOBJECT)
7901 AC_SUBST(MOZ_XSLT_STANDALONE)
7902 AC_SUBST(MOZ_JS_LIBS)
7905 AC_SUBST(MOZ_DEBUG_MODULES)
7906 AC_SUBST(MOZ_PROFILE_MODULES)
7907 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
7908 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
7909 AC_SUBST(MOZ_DEBUG_FLAGS)
7910 AC_SUBST(MOZ_DEBUG_LDFLAGS)
7911 AC_SUBST(WARNINGS_AS_ERRORS)
7912 AC_SUBST(MOZ_DBGRINFO_MODULES)
7913 AC_SUBST(MOZ_EXTENSIONS)
7914 AC_SUBST(MOZ_IMG_DECODERS)
7915 AC_SUBST(MOZ_IMG_ENCODERS)
7916 AC_SUBST(MOZ_JSDEBUGGER)
7918 AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
7919 AC_SUBST(MOZ_PLUGINS)
7920 AC_SUBST(ENABLE_EAZEL_PROFILER)
7921 AC_SUBST(EAZEL_PROFILER_CFLAGS)
7922 AC_SUBST(EAZEL_PROFILER_LIBS)
7923 AC_SUBST(MOZ_PERF_METRICS)
7924 AC_SUBST(GC_LEAK_DETECTOR)
7925 AC_SUBST(MOZ_LOG_REFCNT)
7929 AC_SUBST(MOZ_CALLGRIND)
7931 AC_SUBST(MOZ_XPCTOOLS)
7932 AC_SUBST(MOZ_JSLOADER)
7933 AC_SUBST(MOZ_USE_NATIVE_UCONV)
7934 AC_SUBST(MOZ_INSURE)
7935 AC_SUBST(MOZ_INSURE_DIRS)
7936 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
7937 AC_SUBST(MOZ_QUANTIFY)
7938 AC_SUBST(MOZ_INSURIFYING)
7939 AC_SUBST(MOZ_LDAP_XPCOM)
7940 AC_SUBST(MOZ_LDAP_XPCOM_EXPERIMENTAL)
7941 AC_SUBST(LDAP_CFLAGS)
7944 AC_SUBST(MOZ_PLACES)
7945 AC_SUBST(MOZ_PLACES_BOOKMARKS)
7946 AC_SUBST(MOZ_STORAGE)
7948 AC_SUBST(NS_PRINTING)
7950 AC_SUBST(MOZ_JAVAXPCOM)
7951 AC_SUBST(JAVA_INCLUDE_PATH)
7956 AC_SUBST(MOZ_PROFILESHARING)
7957 AC_SUBST(MOZ_PROFILELOCKING)
7962 AC_SUBST(MOZ_XIE_LIBS)
7963 AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
7965 AC_SUBST(XPCOM_USE_LEA)
7966 AC_SUBST(BUILD_STATIC_LIBS)
7967 AC_SUBST(MOZ_ENABLE_LIBXUL)
7968 AC_SUBST(ENABLE_TESTS)
7970 AC_SUBST(MOZ_UNIVERSALCHARDET)
7971 AC_SUBST(ACCESSIBILITY)
7972 AC_SUBST(MOZ_XPINSTALL)
7973 AC_SUBST(MOZ_VIEW_SOURCE)
7974 AC_SUBST(MOZ_SPELLCHECK)
7975 AC_SUBST(MOZ_XPFE_COMPONENTS)
7976 AC_SUBST(MOZ_USER_DIR)
7977 AC_SUBST(MOZ_CRASHREPORTER)
7978 AC_SUBST(MOZ_MOCHITEST)
7980 AC_SUBST(ENABLE_STRIP)
7981 AC_SUBST(PKG_SKIP_STRIP)
7982 AC_SUBST(USE_ELF_DYNSTR_GC)
7983 AC_SUBST(USE_PREBINDING)
7984 AC_SUBST(INCREMENTAL_LINKER)
7985 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
7986 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
7987 AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
7989 AC_SUBST(MOZ_FIX_LINK_PATHS)
7990 AC_SUBST(XPCOM_LIBS)
7991 AC_SUBST(XPCOM_FROZEN_LDOPTS)
7992 AC_SUBST(XPCOM_GLUE_LDOPTS)
7993 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
7995 AC_SUBST(USE_DEPENDENT_LIBS)
7997 AC_SUBST(MOZ_BUILD_ROOT)
7998 AC_SUBST(MOZ_OS2_TOOLS)
7999 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
8001 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8002 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8003 AC_SUBST(MOZ_TIMELINE)
8005 AC_SUBST(TARGET_DEVICE)
8007 AC_SUBST(MOZ_APP_NAME)
8008 AC_SUBST(MOZ_APP_DISPLAYNAME)
8009 AC_SUBST(MOZ_APP_VERSION)
8010 AC_SUBST(FIREFOX_VERSION)
8011 AC_SUBST(THUNDERBIRD_VERSION)
8012 AC_SUBST(SUNBIRD_VERSION)
8013 AC_SUBST(SEAMONKEY_VERSION)
8015 AC_SUBST(MOZ_PKG_SPECIAL)
8017 AC_SUBST(MOZILLA_OFFICIAL)
8018 AC_SUBST(BUILD_OFFICIAL)
8019 AC_SUBST(MOZ_MILESTONE_RELEASE)
8022 AC_SUBST(MOZ_PROFILE)
8023 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8024 AC_SUBST(MOZ_MAPINFO)
8025 AC_SUBST(MOZ_BROWSE_INFO)
8026 AC_SUBST(MOZ_TOOLS_DIR)
8027 AC_SUBST(CYGWIN_WRAPPER)
8029 AC_SUBST(WIN32_REDIST_DIR)
8032 dnl Echo the CFLAGS to remove extra whitespace.
8039 $_MOZ_EXCEPTIONS_FLAGS \
8040 $_WARNINGS_CXXFLAGS \
8043 COMPILE_CFLAGS=`echo \
8048 COMPILE_CXXFLAGS=`echo \
8049 $_DEFINES_CXXFLAGS \
8053 AC_SUBST(SYSTEM_MAKEDEPEND)
8054 AC_SUBST(SYSTEM_JPEG)
8055 AC_SUBST(SYSTEM_PNG)
8056 AC_SUBST(SYSTEM_ZLIB)
8057 AC_SUBST(SYSTEM_BZ2)
8059 AC_SUBST(JPEG_CFLAGS)
8061 AC_SUBST(ZLIB_CFLAGS)
8063 AC_SUBST(BZ2_CFLAGS)
8065 AC_SUBST(PNG_CFLAGS)
8068 AC_SUBST(MOZ_JPEG_CFLAGS)
8069 AC_SUBST(MOZ_JPEG_LIBS)
8070 AC_SUBST(MOZ_ZLIB_CFLAGS)
8071 AC_SUBST(MOZ_ZLIB_LIBS)
8072 AC_SUBST(MOZ_BZ2_CFLAGS)
8073 AC_SUBST(MOZ_BZ2_LIBS)
8074 AC_SUBST(MOZ_PNG_CFLAGS)
8075 AC_SUBST(MOZ_PNG_LIBS)
8077 AC_SUBST(NSPR_CFLAGS)
8079 AC_SUBST(MOZ_NATIVE_NSPR)
8081 AC_SUBST(NSS_CFLAGS)
8083 AC_SUBST(NSS_DEP_LIBS)
8084 AC_SUBST(MOZ_NATIVE_NSS)
8089 AC_SUBST(COMPILE_CFLAGS)
8090 AC_SUBST(COMPILE_CXXFLAGS)
8093 AC_SUBST(CROSS_COMPILE)
8097 AC_SUBST(HOST_CFLAGS)
8098 AC_SUBST(HOST_CXXFLAGS)
8099 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8101 AC_SUBST(HOST_AR_FLAGS)
8103 AC_SUBST(HOST_RANLIB)
8104 AC_SUBST(HOST_NSPR_MDCPUCFG)
8105 AC_SUBST(HOST_BIN_SUFFIX)
8106 AC_SUBST(HOST_OS_ARCH)
8108 AC_SUBST(TARGET_CPU)
8109 AC_SUBST(TARGET_VENDOR)
8111 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8112 AC_SUBST(TARGET_MD_ARCH)
8113 AC_SUBST(TARGET_XPCOM_ABI)
8116 AC_SUBST(OS_RELEASE)
8119 AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
8120 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8122 AC_SUBST(WRAP_MALLOC_CFLAGS)
8123 AC_SUBST(WRAP_MALLOC_LIB)
8126 AC_SUBST(MKSHLIB_FORCE_ALL)
8127 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8128 AC_SUBST(DSO_CFLAGS)
8129 AC_SUBST(DSO_PIC_CFLAGS)
8130 AC_SUBST(DSO_LDOPTS)
8131 AC_SUBST(LIB_PREFIX)
8132 AC_SUBST(DLL_PREFIX)
8133 AC_SUBST(DLL_SUFFIX)
8134 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8135 AC_SUBST(LIB_SUFFIX)
8136 AC_SUBST(OBJ_SUFFIX)
8137 AC_SUBST(BIN_SUFFIX)
8138 AC_SUBST(ASM_SUFFIX)
8139 AC_SUBST(IMPORT_LIB_SUFFIX)
8141 AC_SUBST(CC_VERSION)
8142 AC_SUBST(CXX_VERSION)
8143 AC_SUBST(MSMANIFEST_TOOL)
8145 if test "$USING_HCC"; then
8146 CC='${topsrcdir}/build/hcc'
8148 CXX='${topsrcdir}/build/hcpp'
8149 CXX="$CXX '$_OLDCXX'"
8154 dnl Check for missing components
8155 if test "$COMPILE_ENVIRONMENT"; then
8156 if test "$MOZ_X11"; then
8157 dnl ====================================================
8158 dnl = Check if X headers exist
8159 dnl ====================================================
8160 _SAVE_CFLAGS=$CFLAGS
8161 CFLAGS="$CFLAGS $XCFLAGS"
8165 #include <X11/Xlib.h>
8166 #include <X11/Intrinsic.h>
8170 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8171 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8175 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8176 CFLAGS="$_SAVE_CFLAGS"
8178 if test ! -z "$MISSING_X"; then
8179 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8183 fi # COMPILE_ENVIRONMENT
8185 dnl Set various defines and substitutions
8186 dnl ========================================================
8188 if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
8189 LIBS='so32dll.lib tcp32dll.lib'
8190 elif test "$OS_ARCH" = "BeOS"; then
8193 elif test "$OS_ARCH" = "Darwin"; then
8195 AC_DEFINE(UNIX_ASYNC_DNS)
8197 elif test "$OS_ARCH" = "OpenVMS"; then
8199 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
8201 AC_DEFINE(UNIX_ASYNC_DNS)
8204 AC_SUBST(MOZ_MOVEMAIL)
8206 AC_DEFINE(JS_THREADSAFE)
8208 if test "$MOZ_DEBUG"; then
8209 AC_DEFINE(MOZ_REFLOW_PERF)
8210 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8213 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8214 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8215 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8216 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8217 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8218 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8219 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8220 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8221 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8224 # Used for LD_LIBRARY_PATH of run_viewer target
8226 for lib_arg in $NSPR_LIBS $TK_LIBS; do
8228 -L* ) LIBS_PATH="${LIBS_PATH:+$LIBS_PATH:}"`expr $lib_arg : "-L\(.*\)"` ;;
8234 dnl ========================================================
8235 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
8236 dnl ========================================================
8239 WIN_TOP_SRC=`cd $srcdir; pwd -W`
8242 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
8243 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
8244 CC="\$(CYGWIN_WRAPPER) $CC"
8245 CXX="\$(CYGWIN_WRAPPER) $CXX"
8246 CPP="\$(CYGWIN_WRAPPER) $CPP"
8247 LD="\$(CYGWIN_WRAPPER) $LD"
8248 AS="\$(CYGWIN_WRAPPER) $AS"
8249 RC="\$(CYGWIN_WRAPPER) $RC"
8250 MIDL="\$(CYGWIN_WRAPPER) $MIDL"
8251 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
8252 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
8256 AC_SUBST(CYGDRIVE_MOUNT)
8257 AC_SUBST(WIN_TOP_SRC)
8259 AC_SUBST(MOZILLA_VERSION)
8261 . ${srcdir}/config/chrome-versions.sh
8262 AC_DEFINE_UNQUOTED(MOZILLA_LOCALE_VERSION,"$MOZILLA_LOCALE_VERSION")
8263 AC_DEFINE_UNQUOTED(MOZILLA_REGION_VERSION,"$MOZILLA_REGION_VERSION")
8264 AC_DEFINE_UNQUOTED(MOZILLA_SKIN_VERSION,"$MOZILLA_SKIN_VERSION")
8266 AC_SUBST(ac_configure_args)
8268 dnl Spit out some output
8269 dnl ========================================================
8271 dnl The following defines are used by xpcom
8272 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8274 HAVE_CPP_2BYTE_WCHAR_T
8275 HAVE_CPP_ACCESS_CHANGING_USING
8276 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8278 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8280 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8281 HAVE_CPP_NAMESPACE_STD
8283 HAVE_CPP_PARTIAL_SPECIALIZATION
8284 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8286 HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
8288 NEED_CPP_UNUSED_IMPLEMENTATIONS
8292 HAVE_ICONV_WITH_CONST_INPUT
8301 netwerk/necko-config.h
8302 xpcom/xpcom-config.h
8303 xpcom/xpcom-private.h
8306 # Save the defines header file before autoconf removes it.
8307 # (Do not add AC_DEFINE calls after this line.)
8308 _CONFIG_TMP=confdefs-tmp.h
8309 _CONFIG_DEFS_H=mozilla-config.h
8311 cat > $_CONFIG_TMP <<\EOF
8312 /* List of defines generated by configure. Included with preprocessor flag,
8313 * -include, to avoid long list of -D defines on the compile command-line.
8317 #ifndef _MOZILLA_CONFIG_H_
8318 #define _MOZILLA_CONFIG_H_
8321 _EGREP_PATTERN='^#define ('
8322 if test -n "$_NON_GLOBAL_ACDEFINES"; then
8323 for f in $_NON_GLOBAL_ACDEFINES; do
8324 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
8327 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
8329 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
8331 cat >> $_CONFIG_TMP <<\EOF
8333 #endif /* _MOZILLA_CONFIG_H_ */
8337 # Only write mozilla-config.h when something changes (or it doesn't exist)
8338 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
8341 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
8342 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
8344 echo ==== $_CONFIG_DEFS_H =================================
8348 dnl Probably shouldn't call this manually but we always want the output of DEFS
8349 rm -f confdefs.h.save
8350 mv confdefs.h confdefs.h.save
8351 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
8352 AC_OUTPUT_MAKE_DEFS()
8354 AC_SUBST(MOZ_DEFINES)
8356 mv confdefs.h.save confdefs.h
8358 dnl Load the list of Makefiles to generate.
8359 dnl To add new Makefiles, edit allmakefiles.sh.
8360 dnl allmakefiles.sh sets the variable, MAKEFILES.
8361 . ${srcdir}/allmakefiles.sh
8363 dnl Run a perl script to quickly create the makefiles.
8364 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
8365 dnl for the files it cannot handle correctly. This way, config.status
8366 dnl will handle these files.
8367 dnl If it fails, nothing is set and config.status will run as usual.
8369 dnl This does not change the $MAKEFILES variable.
8371 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
8373 if test -z "${AS_PERL}"; then
8374 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
8376 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
8381 echo $MAKEFILES > unallmakefiles
8383 AC_OUTPUT($MAKEFILES)
8385 dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
8386 if test "$CAIRO_FEATURES_H"; then
8387 if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
8388 mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
8390 rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
8394 dnl ========================================================
8395 dnl = Setup a nice relatively clean build environment for
8396 dnl = sub-configures.
8397 dnl ========================================================
8400 CFLAGS="$_SUBDIR_CFLAGS"
8401 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8402 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8403 LDFLAGS="$_SUBDIR_LDFLAGS"
8404 HOST_CC="$_SUBDIR_HOST_CC"
8405 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8406 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8412 if test "$COMPILE_ENVIRONMENT"; then
8413 if test -z "$MOZ_NATIVE_NSPR" || test "$MOZ_LDAP_XPCOM"; then
8414 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8415 if test -z "$MOZ_DEBUG"; then
8416 ac_configure_args="$ac_configure_args --disable-debug"
8418 if test "$MOZ_OPTIMIZE" = "1"; then
8419 ac_configure_args="$ac_configure_args --enable-optimize"
8421 if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8422 ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8424 if test -n "$HAVE_64BIT_OS"; then
8425 ac_configure_args="$ac_configure_args --enable-64bit"
8427 if test -n "$USE_ARM_KUSER"; then
8428 ac_configure_args="$ac_configure_args --with-arm-kuser"
8430 AC_OUTPUT_SUBDIRS(nsprpub)
8431 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8434 if test -z "$MOZ_NATIVE_NSPR"; then
8435 # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8436 AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8437 if test ! "$VACPP" && test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8438 _libs=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --libdir=$\(LIBXUL_DIST\)/lib --libs`
8439 $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $_libs'" config/autoconf.mk
8441 if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE" ; then
8442 _cflags=`./nsprpub/config/nspr-config --prefix=$\(LIBXUL_DIST\) --exec-prefix=$\(DIST\) --includedir=$\(LIBXUL_DIST\)/include/nspr --cflags`
8443 $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $_cflags'" config/autoconf.mk
8445 rm -f config/autoconf.mk.bak
8448 # if we're building the LDAP XPCOM component, we need to build
8451 if test "$MOZ_LDAP_XPCOM"; then
8453 # these subdirs may not yet have been created in the build tree.
8454 # don't use the "-p" switch to mkdir, since not all platforms have it
8456 if test ! -d "directory"; then
8459 if test ! -d "directory/c-sdk"; then
8460 mkdir "directory/c-sdk"
8462 if test ! -d "directory/c-sdk/ldap"; then
8463 mkdir "directory/c-sdk/ldap"
8466 ac_configure_args="$_SUBDIR_CONFIG_ARGS --prefix=$MOZ_BUILD_ROOT/dist --with-dist-prefix=$MOZ_BUILD_ROOT/dist --without-nss --with-mozilla"
8467 if test -z "$MOZ_DEBUG"; then
8468 ac_configure_args="$ac_configure_args --disable-debug"
8470 if test "$MOZ_OPTIMIZE" = "1"; then
8471 ac_configure_args="$ac_configure_args --enable-optimize"
8473 if test -n "$HAVE_64BIT_OS"; then
8474 ac_configure_args="$ac_configure_args --enable-64bit"
8476 AC_OUTPUT_SUBDIRS(directory/c-sdk)
8477 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8479 fi # COMPILE_ENVIRONMENT