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 ========================================================
65 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
66 AC_CONFIG_HEADER(js-config.h)
68 TARGET_CPU="${target_cpu}"
69 TARGET_VENDOR="${target_vendor}"
70 TARGET_OS="${target_os}"
72 dnl ========================================================
74 dnl = Don't change the following two lines. Doing so breaks:
76 dnl = CFLAGS="-foo" ./configure
78 dnl ========================================================
80 CPPFLAGS="${CPPFLAGS=}"
81 CXXFLAGS="${CXXFLAGS=}"
83 HOST_CFLAGS="${HOST_CFLAGS=}"
84 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
85 HOST_LDFLAGS="${HOST_LDFLAGS=}"
87 dnl ========================================================
88 dnl = Preserve certain environment flags passed to configure
89 dnl = We want sub projects to receive the same flags
90 dnl = untainted by this configure script
91 dnl ========================================================
94 _SUBDIR_CFLAGS="$CFLAGS"
95 _SUBDIR_CPPFLAGS="$CPPFLAGS"
96 _SUBDIR_CXXFLAGS="$CXXFLAGS"
97 _SUBDIR_LDFLAGS="$LDFLAGS"
98 _SUBDIR_HOST_CC="$HOST_CC"
99 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
100 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
101 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
102 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
104 dnl Set the version number of the libs included with mozilla
105 dnl ========================================================
108 dnl Set the minimum version of toolkit libs used by mozilla
109 dnl ========================================================
111 WINDRES_VERSION=2.14.90
116 dnl Set various checks
117 dnl ========================================================
121 dnl Initialize the Pthread test variables early so they can be
122 dnl overridden by each platform.
123 dnl ========================================================
127 dnl Do not allow a separate objdir build if a srcdir build exists.
128 dnl ==============================================================
129 _topsrcdir=`cd \`dirname $0\`; pwd`
132 if test "$_topsrcdir" != "$_objdir"
134 # Check for a couple representative files in the source tree
136 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
137 if test -f $file; then
138 _conflict_files="$_conflict_files $file"
141 if test "$_conflict_files"; then
143 echo "* Your source tree contains these files:"
144 for file in $_conflict_files; do
148 * This indicates that you previously built in the source tree.
149 * A source tree build can confuse the separate objdir build.
151 * To clean up the source tree:
162 dnl Choose where to put the 'dist' directory.
163 dnl ==============================================================
165 MOZ_ARG_WITH_STRING(dist-dir,
166 [ --with-dist-dir=DIR Use DIR as 'dist' staging area. DIR may be
167 relative to the top of SpiderMonkey build tree,
173 dnl Default to MSVC for win32 and gcc-4.2 for darwin
174 dnl ==============================================================
175 if test -z "$CROSS_COMPILE"; then
177 *-cygwin*|*-mingw*|*-msvc*|*-mks*)
178 if test -z "$CC"; then CC=cl; fi
179 if test -z "$CXX"; then CXX=cl; fi
180 if test -z "$CPP"; then CPP="cl -E -nologo"; fi
181 if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
182 if test -z "$LD"; then LD=link; fi
183 if test -z "$AS"; then
184 case "${target_cpu}" in
193 if test -z "$MIDL"; then MIDL=midl; fi
196 if test -z "$CC"; then CC=gcc-4.2; fi
197 if test -z "$CXX"; then CXX=g++-4.2; fi
202 COMPILE_ENVIRONMENT=1
203 MOZ_ARG_ENABLE_BOOL(compile-environment,
204 [ --disable-compile-environment
205 Disable compiler/library checks.],
206 COMPILE_ENVIRONMENT=1,
207 COMPILE_ENVIRONMENT= )
209 dnl ========================================================
210 dnl Checks for compilers.
211 dnl ========================================================
213 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
216 if test "$COMPILE_ENVIRONMENT"; then
218 if test "$target" != "$host"; then
219 echo "cross compiling from $host to $target"
222 _SAVE_CFLAGS="$CFLAGS"
223 _SAVE_LDFLAGS="$LDFLAGS"
225 AC_MSG_CHECKING([for host c compiler])
226 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
227 if test -z "$HOST_CC"; then
228 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
230 AC_MSG_RESULT([$HOST_CC])
231 AC_MSG_CHECKING([for host c++ compiler])
232 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
233 if test -z "$HOST_CXX"; then
234 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
236 AC_MSG_RESULT([$HOST_CXX])
238 if test -z "$HOST_CFLAGS"; then
239 HOST_CFLAGS="$CFLAGS"
241 if test -z "$HOST_CXXFLAGS"; then
242 HOST_CXXFLAGS="$CXXFLAGS"
244 if test -z "$HOST_LDFLAGS"; then
245 HOST_LDFLAGS="$LDFLAGS"
247 if test -z "$HOST_AR_FLAGS"; then
248 HOST_AR_FLAGS="$AR_FLAGS"
250 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
251 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
253 CFLAGS="$HOST_CFLAGS"
254 LDFLAGS="$HOST_LDFLAGS"
256 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
257 AC_TRY_COMPILE([], [return(0);],
258 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
259 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
262 CFLAGS="$HOST_CXXFLAGS"
264 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
265 AC_TRY_COMPILE([], [return(0);],
266 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
267 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
271 LDFLAGS=$_SAVE_LDFLAGS
273 case "$build:$target" in
274 powerpc-apple-darwin8*:i?86-apple-darwin*)
275 dnl The Darwin cross compiler doesn't necessarily point itself at a
276 dnl root that has libraries for the proper architecture, it defaults
277 dnl to the system root. The libraries in the system root on current
278 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
279 dnl checks will fail. Fake a working SDK in that case.
281 _SAVE_CXXFLAGS=$CXXLAGS
282 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
283 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
289 AC_ARG_WITH(symbian-sdk,
290 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
291 The path to the Symbian SDK],
292 SYMBIAN_SDK_DIR=$withval)
294 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
295 CFLAGS="-MD -nostdinc"
296 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
301 CC=arm-none-symbianelf-gcc.exe
302 CXX=arm-none-symbianelf-g++.exe
303 LD=arm-none-symbianelf-ld.exe
304 AR=arm-none-symbianelf-ar.exe
305 CPP=arm-none-symbianelf-cpp.exe
306 CFLAGS="$CFLAGS -c -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -msoft-float"
307 CXXFLAGS="$CFLAGS -Wno-ctor-dtor-privacy"
308 GCCE_INCLUDE="-include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
309 CFLAGS="$CFLAGS ${GCCE_INCLUDE} -x c"
310 CXXFLAGS="$CXXFLAGS ${GCCE_INCLUDE} -x c++"
311 CPPFLAGS="$CPPFLAGS ${SYMBIAN_SYS_INCLUDE}"
314 dnl TODO: add emulator build code
321 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
324 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
328 case "$build:$target" in
329 powerpc-apple-darwin8*:i?86-apple-darwin*)
330 dnl Revert the changes made above. From this point on, the target
331 dnl compiler will never be used without applying the SDK to CFLAGS
332 dnl (see --with-macos-sdk below).
334 CXXFLAGS=$_SAVE_CXXFLAGS
338 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
339 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
340 MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
341 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
342 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
343 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
344 AC_DEFINE(CROSS_COMPILE)
346 dnl If we cross compile for ppc on Mac OS X x86, cross_compiling will
347 dnl have erroneously been set to "no", because the x86 build host is
348 dnl able to run ppc code in a translated environment, making a cross
349 dnl compiler appear native. So we override that here.
355 MOZ_PATH_PROGS(AS, $AS as, $CC)
356 AC_CHECK_PROGS(AR, ar, :)
357 AC_CHECK_PROGS(LD, ld, :)
358 AC_CHECK_PROGS(STRIP, strip, :)
359 AC_CHECK_PROGS(WINDRES, windres, :)
360 if test -z "$HOST_CC"; then
363 if test -z "$HOST_CFLAGS"; then
364 HOST_CFLAGS="$CFLAGS"
366 if test -z "$HOST_CXX"; then
369 if test -z "$HOST_CXXFLAGS"; then
370 HOST_CXXFLAGS="$CXXFLAGS"
372 if test -z "$HOST_LDFLAGS"; then
373 HOST_LDFLAGS="$LDFLAGS"
375 if test -z "$HOST_RANLIB"; then
376 HOST_RANLIB="$RANLIB"
378 if test -z "$HOST_AR"; then
381 if test -z "$HOST_AR_FLAGS"; then
382 HOST_AR_FLAGS="$AR_FLAGS"
392 if test "$GCC" = "yes"; then
394 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
396 if test "$GXX" = "yes"; then
398 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
400 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
403 if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
406 if test "$GNU_CC"; then
407 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
414 if test "$GCC" = yes; then
415 if test "`$CC -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
420 if test "$GXX" = yes; then
421 if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
426 dnl Special win32 checks
427 dnl ========================================================
433 if test -n "$GNU_CC"; then
442 *-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince|*-winmo)
443 if test "$GCC" != "yes"; then
444 # Check to see if we are really running in a msvc environemnt
447 # Make sure compilers are valid
448 CFLAGS="$CFLAGS -TC -nologo"
449 CXXFLAGS="$CXXFLAGS -TP -nologo"
452 AC_TRY_COMPILE([#include <stdio.h>],
453 [ printf("Hello World\n"); ],,
454 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
457 AC_TRY_COMPILE([#include <new.h>],
458 [ unsigned *test = new unsigned(42); ],,
459 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
463 _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
466 # Determine compiler version
467 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
468 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
469 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
470 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
471 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
472 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
474 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
475 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
477 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
478 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
480 if test "$_CC_MAJOR_VERSION" = "13"; then
482 elif test "$_CC_MAJOR_VERSION" = "14"; then
484 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
485 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
486 dnl so be very specific here!
487 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
488 if test $_CC_RELEASE -gt 50727; then
490 elif test $_CC_BUILD -ge 762; then
493 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
494 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
495 elif test "$_CC_MAJOR_VERSION" = "15"; then
497 CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
498 LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
500 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
501 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
502 elif test "$_CC_MAJOR_VERSION" = "16"; 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.])
550 unset _MSVC_VER_FILTER
553 # Check w32api version
554 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
555 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
556 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
557 AC_TRY_COMPILE([#include <w32api.h>],
558 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
559 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
560 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
561 #error "test failed."
563 , [ res=yes ], [ res=no ])
564 AC_MSG_RESULT([$res])
565 if test "$res" != "yes"; then
566 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
568 # Check windres version
569 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
570 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
571 AC_MSG_RESULT([$_WINDRES_VERSION])
572 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
573 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
574 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
575 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
576 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
577 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
578 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
579 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
580 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
581 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
582 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
583 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
585 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
589 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
590 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
591 # Require OS features provided by IE 5.0
592 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
596 dnl Test breaks icc on OS/2 && MSVC
597 if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
599 if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
603 CC="${srcdir}/build/hcc '$CC'"
604 CXX="${srcdir}/build/hcpp '$CXX'"
611 if test -n "$_WIN32_MSVC"; then
613 SKIP_COMPILER_CHECKS=1
614 SKIP_LIBRARY_CHECKS=1
616 # Since we're skipping compiler and library checks, hard-code
619 # Common to all MSVC environments:
620 # Windows lacks <stdint.h>, but has __int8, and so on.
621 AC_DEFINE(JS_HAVE___INTN)
625 AC_DEFINE(HAVE_SYSTEMTIMETOFILETIME)
626 AC_DEFINE(JS_CRTDEFS_H_HAS_INTPTR_T)
629 AC_DEFINE(HAVE_SYSTEMTIMETOFILETIME)
630 AC_DEFINE(HAVE_GETSYSTEMTIMEASFILETIME)
631 # Windows <stddef.h> defines intptr_t and uintptr_t.
632 # VS2005: http://msdn.microsoft.com/en-us/library/323b6b3k(VS.80).aspx
633 # VS2008: http://msdn.microsoft.com/en-us/library/323b6b3k.aspx
634 AC_DEFINE(JS_STDDEF_H_HAS_INTPTR_T)
639 fi # COMPILE_ENVIRONMENT
641 if test "$cross_compiling" = "yes"; then
656 dnl ========================================================
657 dnl Checks for programs.
658 dnl ========================================================
661 MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
662 if test -z "$PERL" || test "$PERL" = ":"; then
663 AC_MSG_ERROR([perl not found in \$PATH])
666 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
667 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
668 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
670 AC_MSG_RESULT([$_perl_version])
672 if test "$_perl_res" != 0; then
673 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
677 AC_MSG_CHECKING([for full perl installation])
678 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
680 if test "$_perl_res" != 0; then
682 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
687 MOZ_PATH_PROGS(PYTHON, $PYTHON python)
688 if test -z "$PYTHON"; then
689 AC_MSG_ERROR([python was not found in \$PATH])
692 if test -z "$COMPILE_ENVIRONMENT"; then
693 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
695 AC_SUBST(NSINSTALL_BIN)
697 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
698 MOZ_PATH_PROG(WHOAMI, whoami, :)
699 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
700 MOZ_PATH_PROG(UNZIP, unzip, :)
701 MOZ_PATH_PROGS(ZIP, zip)
702 if test -z "$ZIP" || test "$ZIP" = ":"; then
703 AC_MSG_ERROR([zip not found in \$PATH])
705 MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
706 MOZ_PATH_PROG(XARGS, xargs)
707 if test -z "$XARGS" || test "$XARGS" = ":"; then
708 AC_MSG_ERROR([xargs not found in \$PATH .])
711 if test "$COMPILE_ENVIRONMENT"; then
713 dnl ========================================================
714 dnl = Mac OS X toolchain support
715 dnl ========================================================
719 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
720 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
721 dnl the environment and includedir purposes (when using an SDK, below),
722 dnl but remember the full version number for the libdir (SDK).
724 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
725 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
727 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
728 dnl Bug 280479, but this keeps popping up in bug 292530 too because
729 dnl 4.0.0/4061 is the default compiler in Tiger.
731 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
733 if test "$GCC_BUILD" = "4061" ; then
734 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
735 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
736 from building Mozilla. Upgrade to Xcode 2.1 or later.])
740 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
741 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
742 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
743 MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
748 XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
750 if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
756 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
757 dnl it has moved into /usr/bin.
758 MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
762 AC_SUBST(GCC_VERSION)
763 AC_SUBST(XCODEBUILD_VERSION)
764 AC_SUBST(HAS_XCODE_2_1)
766 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
767 dnl that a universal binary is being produced.
768 AC_SUBST(UNIVERSAL_BINARY)
770 dnl ========================================================
771 dnl Check for MacOS deployment target version
772 dnl ========================================================
774 MOZ_ARG_ENABLE_STRING(macos-target,
775 [ --enable-macos-target=VER (default=10.4)
776 Set the minimum MacOS version needed at runtime],
777 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
781 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
782 dnl Use the specified value
783 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
784 AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
785 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
786 dnl No value specified on the command line or in the environment,
787 dnl use the lesser of the application's minimum or the architecture's
789 export MACOSX_DEPLOYMENT_TARGET=10.4
794 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
796 dnl ========================================================
797 dnl = Mac OS X SDK support
798 dnl ========================================================
801 MOZ_ARG_WITH_STRING(macos-sdk,
802 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
803 MACOS_SDK_DIR=$withval)
805 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
806 dnl NEXT_ROOT will be set and exported only if it's needed.
807 AC_SUBST(MACOS_SDK_DIR)
810 if test "$MACOS_SDK_DIR"; then
811 dnl Sync this section with the ones in NSPR and NSS.
812 dnl Changes to the cross environment here need to be accounted for in
813 dnl the libIDL checks (below) and xpidl build.
815 if test ! -d "$MACOS_SDK_DIR"; then
816 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
817 specify a valid SDK. SDKs are installed when the optional cross-development
818 tools are selected during the Xcode/Developer Tools installation.])
821 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
822 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
823 AC_MSG_ERROR([You need to upgrade the compiler version to 4.x])
825 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
826 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
828 dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
829 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
830 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
832 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
833 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
834 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
835 dnl be ignored and cause warnings when -syslibroot is specified.
836 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
837 dnl the -isysroot it receives, so this is only needed with 4.0.0.
838 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
843 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
845 AC_TRY_COMPILE([#include <new>
846 int main() { return 0; }],
850 AC_MSG_RESULT($result)
852 if test "$result" = "no" ; then
853 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
857 fi # COMPILE_ENVIRONMENT
859 if test -z "$MAKE"; then
861 cygwin*|mingw*|mks*|msvc*)
862 MOZ_PATH_PROGS(MAKE, $MAKE make gmake, :)
865 MOZ_PATH_PROGS(MAKE, $MAKE gmake make, :)
870 if test "$COMPILE_ENVIRONMENT"; then
876 fi # COMPILE_ENVIRONMENT
878 dnl ========================================================
879 dnl set the defaults first
880 dnl ========================================================
898 MOZ_USER_DIR=".mozilla"
900 MOZ_JS_LIBS='-L$(libdir) -lmozjs'
901 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib'
903 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
907 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
909 MOZ_ENABLE_POSTSCRIPT=1
911 if test -n "$CROSS_COMPILE"; then
912 OS_TARGET="${target_os}"
913 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
915 case "${target_os}" in
916 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
917 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
918 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
919 mingw*) OS_ARCH=WINNT ;;
920 wince*) OS_ARCH=WINCE ;;
921 winmo*) OS_ARCH=WINCE ;;
922 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
926 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
927 OS_RELEASE=`uname -r`
930 # Before this used `uname -m` when not cross compiling
931 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
932 OS_TEST="${target_cpu}"
936 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
938 #######################################################################
939 # Master "Core Components" macros for getting the OS target #
940 #######################################################################
943 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
948 # Define and override various archtecture-specific variables, including
957 case "$HOST_OS_ARCH" in
958 cygwin*|mingw*|mks*|msvc*)
968 if test -z "$GNU_CC"; then
969 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
974 if test -z "$GNU_CXX"; then
975 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
979 AC_SUBST(SOLARIS_SUNPRO_CC)
980 AC_SUBST(SOLARIS_SUNPRO_CXX)
992 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
995 HOST_OS_ARCH=UNIXWARE
1007 HOST_OS_ARCH=OpenVMS
1017 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1021 HOST_OS_ARCH=UNIXWARE
1031 # If uname -s returns "Windows_NT", we assume that we are using
1032 # the uname.exe in MKS toolkit.
1034 # The -r option of MKS uname only returns the major version number.
1035 # So we need to use its -v option to get the minor version number.
1036 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1040 OS_MINOR_RELEASE=`uname -v`
1041 if test "$OS_MINOR_RELEASE" = "00"; then
1044 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1046 CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1048 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1049 # the uname.exe in the Cygwin tools.
1050 # Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1051 # If uname -s returns "CYGWIN32/NT", we assume that we are using
1052 # the uname.exe in the GNU-Win32 tools.
1053 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1054 # the uname.exe in the MSYS tools.
1056 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1061 OS_RELEASE=`uname -v`.`uname -r`
1062 OS_TEST=${target_cpu}
1074 if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1078 OS_RELEASE=`uname -v`
1102 OS_RELEASE=`uname -v`
1108 OS_RELEASE=`uname -v`
1111 if test "$OS_TARGET" != "NTO"; then
1113 OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1122 SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1128 OS_RELEASE=`uname -v`
1133 if test "$WINCE_WINDOWS_MOBILE"; then
1140 case "${target_cpu}" in
1151 if test -z "$CROSS_COMPILE" ; then
1159 if test "$OS_ARCH" = "NCR"; then
1161 OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1165 # Only set CPU_ARCH if we recognize the value of OS_TEST
1172 powerpc* | ppc | rs6000)
1176 Alpha | alpha | ALPHA)
1193 if test "$OS_ARCH" = "WINCE"; then
1199 if test -z "$OS_TARGET"; then
1202 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1204 dnl ========================================================
1205 dnl GNU specific defaults
1206 dnl ========================================================
1207 if test "$GNU_CC"; then
1208 # FIXME: Let us build with strict aliasing. bug 414641.
1209 CFLAGS="$CFLAGS -fno-strict-aliasing"
1210 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1211 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1212 DSO_LDOPTS='-shared'
1213 if test "$GCC_USE_GNU_LD"; then
1214 # Don't allow undefined symbols in libraries
1215 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1217 WARNINGS_AS_ERRORS='-Werror'
1219 DSO_PIC_CFLAGS='-fPIC'
1220 ASFLAGS="$ASFLAGS -fPIC"
1221 _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1222 _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1223 _MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1224 _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1226 # Turn on GNU specific features
1227 # -Wall - turn on all warnings
1228 # -pedantic - make compiler warn about non-ANSI stuff, and
1229 # be a little bit stricter
1230 # Warnings slamm took out for now (these were giving more noise than help):
1231 # -Wbad-function-cast - warns when casting a function to a new return type
1232 # -Wshadow - removed because it generates more noise than help --pete
1233 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1234 if test -z "$INTEL_CC"; then
1235 # Don't use -Wcast-align with ICC
1237 # And don't use it on hppa, ia64, sparc, since it's noisy there
1238 hppa | ia64 | sparc)
1241 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1246 dnl Turn pedantic on but disable the warnings for long long
1249 if test -z "$INTEL_CC"; then
1250 _IGNORE_LONG_LONG_WARNINGS=1
1251 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1253 _IGNORE_LONG_LONG_WARNINGS=
1257 _DEFINES_CFLAGS='-include $(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT'
1258 _USE_CPP_INCLUDE_FLAG=1
1259 elif test "$SOLARIS_SUNPRO_CC"; then
1260 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1261 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1263 DSO_LDOPTS='-shared'
1264 if test "$GNU_LD"; then
1265 # Don't allow undefined symbols in libraries
1266 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1270 if test "$CPU_ARCH" = "sparc"; then
1271 # for Sun Studio on Solaris/SPARC
1272 DSO_PIC_CFLAGS='-xcode=pic32'
1274 DSO_PIC_CFLAGS='-KPIC'
1276 _DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
1278 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1279 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1281 DSO_LDOPTS='-shared'
1282 if test "$GNU_LD"; then
1283 # Don't allow undefined symbols in libraries
1284 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1288 DSO_PIC_CFLAGS='-KPIC'
1289 _DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
1292 if test "$GNU_CXX"; then
1293 # FIXME: Let us build with strict aliasing. bug 414641.
1294 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1295 # Turn on GNU specific features
1296 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1297 if test -z "$INTEL_CC"; then
1298 # Don't use -Wcast-align with ICC
1300 # And don't use it on hppa, ia64, sparc, since it's noisy there
1301 hppa | ia64 | sparc)
1304 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1309 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/js-confdefs.h'
1310 _USE_CPP_INCLUDE_FLAG=1
1312 AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1313 ac_has_wno_invalid_offsetof,
1317 _SAVE_CXXFLAGS="$CXXFLAGS"
1318 CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1321 ac_has_wno_invalid_offsetof="yes",
1322 ac_has_wno_invalid_offsetof="no")
1323 CXXFLAGS="$_SAVE_CXXFLAGS"
1326 if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1327 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1330 AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
1331 ac_has_wno_variadic_macros,
1335 _SAVE_CXXFLAGS="$CXXFLAGS"
1336 CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
1339 ac_has_wno_variadic_macros="yes",
1340 ac_has_wno_variadic_macros="no")
1341 CXXFLAGS="$_SAVE_CXXFLAGS"
1344 if test "$ac_has_wno_variadic_macros" = "yes"; then
1345 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
1348 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_JS_CONFDEFS_H_ $(ACDEFINES)'
1351 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1352 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1353 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1354 dnl normal behavior.
1355 dnl ========================================================
1357 MKSHLIB_UNFORCE_ALL=
1359 if test "$COMPILE_ENVIRONMENT"; then
1360 if test "$GNU_CC"; then
1361 AC_MSG_CHECKING(whether ld has archive extraction flags)
1362 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1363 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1364 ac_cv_mkshlib_force_and_unforce="no"
1365 exec 3<&0 <<LOOP_INPUT
1366 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1367 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1368 force="-Wl,-all"; unforce="-Wl,-none"
1375 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1378 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1380 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1384 eval $ac_cv_mkshlib_force_and_unforce
1385 MKSHLIB_FORCE_ALL=$force
1386 MKSHLIB_UNFORCE_ALL=$unforce
1389 fi # COMPILE_ENVIRONMENT
1391 dnl =================================================================
1392 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1393 dnl which is bad when cross compiling.
1394 dnl =================================================================
1395 if test "$COMPILE_ENVIRONMENT"; then
1396 configure_static_assert_macros='
1397 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1398 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1399 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1402 dnl test that the macros actually work:
1403 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1404 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1407 ac_cv_static_assertion_macros_work="yes"
1408 AC_TRY_COMPILE([$configure_static_assert_macros],
1409 [CONFIGURE_STATIC_ASSERT(1)],
1411 ac_cv_static_assertion_macros_work="no")
1412 AC_TRY_COMPILE([$configure_static_assert_macros],
1413 [CONFIGURE_STATIC_ASSERT(0)],
1414 ac_cv_static_assertion_macros_work="no",
1417 AC_TRY_COMPILE([$configure_static_assert_macros],
1418 [CONFIGURE_STATIC_ASSERT(1)],
1420 ac_cv_static_assertion_macros_work="no")
1421 AC_TRY_COMPILE([$configure_static_assert_macros],
1422 [CONFIGURE_STATIC_ASSERT(0)],
1423 ac_cv_static_assertion_macros_work="no",
1427 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1428 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1429 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1431 fi # COMPILE_ENVIRONMENT
1433 dnl ========================================================
1434 dnl Checking for 64-bit OS
1435 dnl ========================================================
1436 if test "$COMPILE_ENVIRONMENT"; then
1439 AC_MSG_CHECKING(for 64-bit OS)
1440 AC_TRY_COMPILE([$configure_static_assert_macros],
1441 [CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
1442 result="yes", result="no")
1443 AC_MSG_RESULT("$result")
1444 if test "$result" = "yes"; then
1445 AC_DEFINE(HAVE_64BIT_OS)
1448 AC_SUBST(HAVE_64BIT_OS)
1450 fi # COMPILE_ENVIRONMENT
1452 dnl ========================================================
1453 dnl Enable high-memory support on OS/2 by default.
1454 dnl ========================================================
1455 MOZ_OS2_HIGH_MEMORY=1
1456 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1457 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1458 MOZ_OS2_HIGH_MEMORY=,
1459 MOZ_OS2_HIGH_MEMORY=1 )
1460 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1462 dnl ========================================================
1463 dnl System overrides of the defaults for host
1464 dnl ========================================================
1467 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1468 HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1469 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1472 *cygwin*|*mingw*|*mks*|*msvc*|*wince|*winmo)
1473 if test -n "$_WIN32_MSVC"; then
1475 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1476 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1477 HOST_RANLIB='echo ranlib'
1479 HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1481 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1482 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1483 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1484 HOST_BIN_SUFFIX=.exe
1487 dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1490 CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1491 if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1493 CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1495 if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1497 PERL="${CYGWIN_WRAPPER} $PERL"
1500 if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1501 PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1508 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1509 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1510 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1511 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1512 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
1515 *-linux*|*-kfreebsd*-gnu)
1516 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1517 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1518 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1522 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1523 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1524 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1525 HOST_BIN_SUFFIX=.exe
1530 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1531 HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1532 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1536 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1537 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1541 dnl ========================================================
1542 dnl System overrides of the defaults for target
1543 dnl ========================================================
1548 if test ! "$GNU_CC"; then
1549 if test ! "$HAVE_64BIT_OS"; then
1550 # Compiling with Visual Age C++ object model compat is the
1551 # default. To compile with object model ibm, add
1552 # AIX_OBJMODEL=ibm to .mozconfig.
1553 if test "$AIX_OBJMODEL" = "ibm"; then
1554 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1561 AC_SUBST(AIX_OBJMODEL)
1562 DSO_LDOPTS='-qmkshrobj=1'
1563 DSO_CFLAGS='-qflag=w:w'
1565 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1566 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1568 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1569 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1570 if test "$COMPILE_ENVIRONMENT"; then
1573 AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
1575 [#if (__IBMCPP__ < 600)
1576 #error "Bad compiler"
1578 _BAD_COMPILER=,_BAD_COMPILER=1)
1579 if test -n "$_BAD_COMPILER"; then
1581 AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
1583 AC_MSG_RESULT([yes])
1586 TARGET_COMPILER_ABI="ibmc"
1587 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1588 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1591 case "${target_os}" in
1596 if test "$COMPILE_ENVIRONMENT"; then
1597 AC_CHECK_HEADERS(sys/inttypes.h)
1599 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1604 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1605 _PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1606 DSO_LDOPTS='-nostart'
1607 TK_LIBS='-lbe -lroot'
1609 if test "$COMPILE_ENVIRONMENT"; then
1610 AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1611 AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1613 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1614 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1617 MOZ_USER_DIR="Mozilla"
1621 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1623 _IGNORE_LONG_LONG_WARNINGS=
1631 _WARNINGS_CFLAGS="-Wall"
1632 _WARNINGS_CXXFLAGS="-Wall"
1633 # The test above doesn't work properly, at least on 3.1.
1634 MKSHLIB_FORCE_ALL=''
1635 MKSHLIB_UNFORCE_ALL=''
1641 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1642 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1643 MOZ_OPTIMIZE_FLAGS="-O3"
1645 CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1646 CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1649 STRIP="$STRIP -x -S"
1650 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1651 MOZ_ENABLE_POSTSCRIPT=
1652 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1653 LDFLAGS="$LDFLAGS -framework Cocoa"
1654 # The ExceptionHandling framework is needed for Objective-C exception
1655 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1657 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1658 # set MACOSX to generate lib/mac/MoreFiles/Makefile
1661 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1662 dnl ===================================================================
1663 if test "x$enable_dtrace" = "xyes"; then
1664 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1666 dnl check for the presence of the -dead_strip linker flag
1667 AC_MSG_CHECKING([for -dead_strip option to ld])
1668 _SAVE_LDFLAGS=$LDFLAGS
1669 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1670 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1671 if test -n "$_HAVE_DEAD_STRIP" ; then
1672 AC_MSG_RESULT([yes])
1673 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1678 LDFLAGS=$_SAVE_LDFLAGS
1683 if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1684 DLL_SUFFIX=".so.1.0"
1685 DSO_LDOPTS="-shared"
1687 if test ! "$GNU_CC"; then
1688 DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1690 # Can't have force w/o an unforce.
1691 # # Hack for FreeBSD 2.2
1692 # if test -z "$MKSHLIB_FORCE_ALL"; then
1693 # MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1694 # MKSHLIB_UNFORCE_ALL=''
1700 if test ! "$GNU_CC"; then
1701 DSO_LDOPTS='-b -Wl,+s'
1704 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1705 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1706 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1708 DSO_LDOPTS='-b -E +s'
1709 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1710 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1712 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1713 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1718 DSO_LDOPTS='-elf -shared'
1720 if test "$GNU_CC"; then
1721 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1722 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1723 MKSHLIB_FORCE_ALL='-Wl,-all'
1724 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1725 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1727 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1728 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1729 MKSHLIB_FORCE_ALL='-all'
1730 MKSHLIB_UNFORCE_ALL='-none'
1736 dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1737 dnl compile and link using -n32
1739 TARGET_COMPILER_ABI=n32
1740 DSO_LDOPTS='-elf -shared'
1741 MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1742 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1743 _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1744 _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1745 if test "$GNU_CC"; then
1746 MKSHLIB_FORCE_ALL='-Wl,-all'
1747 MKSHLIB_UNFORCE_ALL='-Wl,-none'
1748 _WARNINGS_CFLAGS="-Wall"
1749 _WARNINGS_CXXFLAGS="-Wall"
1750 CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1752 MKSHLIB_FORCE_ALL='-all'
1753 MKSHLIB_UNFORCE_ALL='-none'
1759 CFLAGS="$CFLAGS -woff 3262 -G 4"
1760 CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1761 if test -n "$USE_N32"; then
1762 ASFLAGS="$ASFLAGS -n32"
1763 CFLAGS="$CFLAGS -n32"
1764 CXXFLAGS="$CXXFLAGS -n32"
1765 LDFLAGS="$LDFLAGS -n32"
1767 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1768 AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1771 if test -z "$GNU_CXX"; then
1777 # Note: both GNU_CXX and INTEL_CXX are set when using Intel's C compiler.
1778 if test "$INTEL_CXX"; then
1779 # -Os has been broken on Intel's C/C++ compilers for quite a
1780 # while; Intel recommends against using it.
1781 MOZ_OPTIMIZE_FLAGS="-O2"
1782 MOZ_DEBUG_FLAGS="-g -fno-inline"
1783 elif test "$GNU_CXX"; then
1784 GCC_VERSION=`$CXX -v 2>&1 | awk '/^gcc version/ { print $3 }'`
1785 case $GCC_VERSION in
1787 # -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
1788 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
1790 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
1791 MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1792 # and that combo is not yet good at
1793 # debugging inlined functions (even
1794 # when using DWARF2 as the debugging
1798 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1800 case "${target_cpu}" in
1802 CFLAGS="$CFLAGS -mieee"
1803 CXXFLAGS="$CXXFLAGS -mieee"
1806 MOZ_DEBUG_FLAGS="-g" # We want inlining
1812 TARGET_COMPILER_ABI=msvc
1813 MOZ_TOOLS_DIR=`echo $MOZ_TOOLS`
1815 AR_EXTRACT="$AR -extract"
1817 AR_FLAGS='-OUT:"$@"'
1824 if test -z "$RC"; then
1827 # certain versions of cygwin's makedepend barf on the
1828 # #include <string> vs -I./dist/include/string issue so don't use it
1834 HOST_AR='lib -OUT:$@'
1835 HOST_RANLIB='echo ranlib'
1836 HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
1839 WARNINGS_AS_ERRORS='-WX'
1840 MOZ_OPTIMIZE_FLAGS='-O1'
1841 AR_FLAGS='-NOLOGO -OUT:"$@"'
1843 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
1844 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
1847 DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
1848 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1850 IMPORT_LIB_SUFFIX=lib
1852 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
1855 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1856 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
1858 MKSHLIB_UNFORCE_ALL=
1859 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1860 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
1861 MOZ_DEBUG_FLAGS='-Zi'
1862 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1864 MOZ_JS_LIBS='$(libdir)/mozjs.lib'
1866 RANLIB='echo not_ranlib'
1867 STRIP='echo not_strip'
1868 TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
1871 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1875 AC_DEFINE(HAVE_SNPRINTF)
1880 AC_DEFINE(HW_THREADS)
1881 AC_DEFINE(STDC_HEADERS)
1882 AC_DEFINE(NEW_H, <new>)
1883 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1885 TARGET_MD_ARCH=win32
1886 _PLATFORM_DEFAULT_TOOLKIT='windows'
1888 MOZ_ENABLE_POSTSCRIPT=
1889 MOZ_USER_DIR="Mozilla"
1891 dnl Default to Windows Mobile components enabled
1892 WINCE_WINDOWS_MOBILE=1
1894 MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
1895 [ --disable-windows-mobile-components
1896 Disable Windows Mobile specific components from CE build],
1897 WINCE_WINDOWS_MOBILE=,
1898 WINCE_WINDOWS_MOBILE=1)
1900 if test "$WINCE_WINDOWS_MOBILE"; then
1901 AC_DEFINE(WINCE_WINDOWS_MOBILE)
1910 AC_DEFINE(__SYMBIAN32__)
1913 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
1914 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
1915 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1916 AC_DEFINE(HAVE_SOCKLEN_T)
1929 TARGET_NSPR_MDCPUCFG='\"md/_symbian.cfg\"'
1930 RANLIB='echo no ranlib '
1933 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1938 # certain versions of cygwin's makedepend barf on the
1939 # #include <string> vs -I./dist/include/string issue so don't use it
1941 if test -n "$GNU_CC"; then
1942 CC="$CC -mno-cygwin"
1943 CXX="$CXX -mno-cygwin"
1944 CPP="$CPP -mno-cygwin"
1945 CFLAGS="$CFLAGS -mms-bitfields"
1946 CXXFLAGS="$CXXFLAGS -mms-bitfields"
1947 DSO_LDOPTS='-shared'
1948 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1949 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1951 # Use temp file for windres (bug 213281)
1952 RCFLAGS='-O coff --use-temp-file'
1953 # mingw doesn't require kernel32, user32, and advapi32 explicitly
1954 LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
1955 MOZ_JS_LIBS='-L$(libdir) -lmozjs'
1957 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
1958 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
1960 IMPORT_LIB_SUFFIX=dll.a
1962 TARGET_COMPILER_ABI=msvc
1966 AR='lib -NOLOGO -OUT:"$@"'
1968 RANLIB='echo not_ranlib'
1969 STRIP='echo not_strip'
1974 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1979 IMPORT_LIB_SUFFIX=lib
1980 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
1981 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
1983 MKSHLIB_UNFORCE_ALL=
1984 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
1985 _USE_CPP_INCLUDE_FLAG=1
1986 _DEFINES_CFLAGS='-FI $(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT'
1987 _DEFINES_CXXFLAGS='-FI $(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT'
1988 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
1989 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
1990 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
1991 MOZ_DEBUG_FLAGS='-Zi'
1992 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1993 WARNINGS_AS_ERRORS='-WX'
1994 MOZ_OPTIMIZE_FLAGS='-O1'
1995 MOZ_JS_LIBS='$(libdir)/mozjs.lib'
1997 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
1998 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
1999 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2000 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2001 if test $_MSC_VER -ge 1400; then
2002 LDFLAGS="$LDFLAGS -NXCOMPAT"
2003 dnl For profile-guided optimization
2004 PROFILE_GEN_CFLAGS="-GL"
2005 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2006 dnl XXX: PGO builds can fail with warnings treated as errors,
2007 dnl specifically "no profile data available" appears to be
2008 dnl treated as an error sometimes. This might be a consequence
2009 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2010 dnl with the linker doing most of the work in the whole-program
2011 dnl optimization/PGO case. I think it's probably a compiler bug,
2012 dnl but we work around it here.
2013 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2014 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2015 dnl Probably also a compiler bug, but what can you do?
2016 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2017 if test -n "$_USE_DYNAMICBASE"; then
2018 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2022 AC_DEFINE(HAVE_SNPRINTF)
2027 AC_DEFINE(HW_THREADS)
2028 AC_DEFINE(STDC_HEADERS)
2029 AC_DEFINE(NEW_H, <new>)
2030 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2031 TARGET_MD_ARCH=win32
2032 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2034 MOZ_ENABLE_POSTSCRIPT=
2035 MOZ_USER_DIR="Mozilla"
2037 dnl Hardcode to win95 for now - cls
2038 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2040 dnl set NO_X11 defines here as the general check is skipped on win32
2044 dnl MinGW/MSYS doesn't provide or need cygpath
2049 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2051 *-cygwin*|*-msvc*|*-mks*)
2052 CYGPATH_W="cygpath -a -w"
2053 CYGPATH_S="sed -e s|\\\\|/|g"
2054 MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2058 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
2060 if test -z "$MOZ_TOOLS"; then
2061 AC_MSG_ERROR([MOZ_TOOLS is not set])
2064 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd`
2065 if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2066 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2068 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_DIR/bin:"` = 0; then
2069 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2071 MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2078 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])
2082 AC_CHECK_HEADERS(oleacc.idl)
2086 AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2093 if test "$HAVE_64BIT_OS"; then
2094 AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
2097 if test $_MSC_VER -ge 1400; then
2098 LDFLAGS="$LDFLAGS -SAFESEH"
2100 AC_CHECK_HEADERS(mmintrin.h)
2113 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2117 if test "$HAVE_64BIT_OS"; then
2124 CFLAGS="$CFLAGS -Dunix"
2125 CXXFLAGS="$CXXFLAGS -Dunix"
2126 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2128 DSO_PIC_CFLAGS='-fPIC -DPIC'
2129 DSO_LDOPTS='-shared'
2130 BIN_FLAGS='-Wl,--export-dynamic'
2132 DSO_PIC_CFLAGS='-fPIC -DPIC'
2133 DLL_SUFFIX=".so.1.0"
2134 DSO_LDOPTS='-shared'
2136 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2137 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2138 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2139 if test "$LIBRUNPATH"; then
2140 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2142 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2143 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2148 AC_DEFINE(_QNX_SOURCE)
2151 WARNINGS_AS_ERRORS=''
2152 MOZ_OPTIMIZE_FLAGS="-O"
2153 MOZ_DEBUG_FLAGS="-gstabs"
2156 LIBS="$LIBS -lsocket -lstdc++"
2157 _DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2158 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/js-confdefs.h -D_POSIX_C_SOURCE=199506'
2159 if test "$with_x" != "yes"
2161 _PLATFORM_DEFAULT_TOOLKIT="photon"
2162 TK_CFLAGS='-I/usr/include/photon'
2165 case "${target_cpu}" in
2167 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2173 DLL_SUFFIX=".so.1.0"
2175 DSO_PIC_CFLAGS='-fPIC'
2176 DSO_LDOPTS='-shared -fPIC'
2177 if test "$LIBRUNPATH"; then
2178 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2183 AC_DEFINE(NO_PW_GECOS)
2184 AC_DEFINE(NO_UDSOCK)
2185 AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2187 MKSHLIB_FORCE_ALL='-all'
2188 MKSHLIB_UNFORCE_ALL='-none'
2190 AS_DASH_C_FLAG='-Wc/names=as_is'
2192 DSO_LDOPTS='-shared -auto_symvec'
2194 MOZ_DEBUG_LDFLAGS='-g'
2196 CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2197 CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2202 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2203 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2206 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2207 AC_DEFINE(TCPV40HDRS)
2213 IMPORT_LIB_SUFFIX=lib
2217 CFLAGS="$CFLAGS -Zomf"
2218 CXXFLAGS="$CXXFLAGS -Zomf"
2220 BIN_FLAGS='-Zlinker /ST:0x100000'
2224 WARNINGS_AS_ERRORS='-Werror'
2225 MOZ_DEBUG_FLAGS="-g -fno-inline"
2226 MOZ_OPTIMIZE_FLAGS="-O2"
2227 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2228 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2229 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2231 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2232 MOZ_ENABLE_POSTSCRIPT=
2235 MOZ_USER_DIR="Mozilla"
2237 if test "$MOZTOOLS"; then
2238 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2240 AC_MSG_ERROR([MOZTOOLS is not set])
2242 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2243 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2244 LDFLAGS="$LDFLAGS -Zhigh-mem"
2245 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2246 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2249 # GCC for OS/2 currently predefines these, but we don't want them
2250 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2251 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2253 AC_CACHE_CHECK(for __declspec(dllexport),
2255 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2257 ac_os2_declspec="yes",
2258 ac_os2_declspec="no")])
2259 if test "$ac_os2_declspec" = "yes"; then
2261 MOZ_OS2_USE_DECLSPEC='1'
2266 if test "$GNU_CC"; then
2267 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2268 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2271 MOZ_DEBUG_FLAGS='-g'
2272 ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2273 CFLAGS="$CFLAGS -ieee"
2274 CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2275 DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2278 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2279 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2280 MKSHLIB_FORCE_ALL='-all'
2281 MKSHLIB_UNFORCE_ALL='-none'
2282 dnl Might fix the libxpcom.so breakage on this platform as well....
2283 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2284 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2286 if test -z "$GNU_CXX"; then
2289 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2293 DIRENT_INO=d_stat.st_ino
2294 dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2295 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2296 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2297 dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2298 AC_DEFINE(STDC_HEADERS)
2299 if test "$no_x" = "yes"; then
2300 _PLATFORM_DEFAULT_TOOLKIT='photon'
2301 TK_CFLAGS='-I/usr/nto/include/photon'
2302 TK_LIBS='-lphoton -lphrender'
2307 AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2308 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2309 CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2310 if test ! "$GNU_CC"; then
2317 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2318 if test -z "$CROSS_COMPILE" && pkginfo -q SUNWpr && pkginfo -q SUNWprd; then
2319 NO_NSPR_CONFIG_SYSTEM_LDFLAGS="-L/usr/lib/mps -R/usr/lib/mps -lnspr4"
2320 NO_NSPR_CONFIG_SYSTEM_CFLAGS="-I/usr/include/mps"
2321 NO_NSPR_CONFIG_SYSTEM_VERSION=["`pkgparam SUNWpr SUNW_PRODVERS | sed -e 's/^[1-9][0-9]*\.[0-9][0-9]*$/&.0/'`"]
2324 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2325 # libraries one level up (e.g. libnspr4.so)
2326 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2327 if test "$SOLARIS_SUNPRO_CC"; then
2328 LIBS="-lCrun -lCstd $LIBS"
2331 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2332 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2333 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2334 LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2335 if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2336 _SAVE_LDFLAGS=$LDFLAGS
2337 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2338 AC_TRY_LINK([#include <stdio.h>],
2339 [printf("Hello World\n");],
2341 [LDFLAGS=$_SAVE_LDFLAGS])
2343 WARNINGS_AS_ERRORS='-Werror'
2344 MOZ_OPTIMIZE_FLAGS="-xO4"
2345 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2346 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2347 MKSHLIB_FORCE_ALL='-z allextract'
2348 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2349 DSO_LDOPTS='-G -z muldefs'
2355 AS='/usr/ccs/bin/as'
2356 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2358 TARGET_COMPILER_ABI="sunc"
2359 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2360 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2361 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2365 [#if (__SUNPRO_CC < 0x590)
2368 _BAD_COMPILER=,_BAD_COMPILER=1)
2369 if test -n "$_BAD_COMPILER"; then
2371 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2375 AC_MSG_RESULT([$_res])
2378 ASFLAGS="$ASFLAGS -fPIC"
2381 _WARNINGS_CXXFLAGS=''
2382 if test "$OS_RELEASE" = "5.3"; then
2383 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2386 if test "$OS_RELEASE" = "5.5.1"; then
2387 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2392 DSO_LDOPTS='-Bdynamic'
2393 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2394 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2396 AC_DEFINE(SPRINTF_RETURNS_STRING)
2397 case "$(target_os)" in
2399 DLL_SUFFIX='.so.1.0'
2405 NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2409 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2414 dnl Only one oddball right now (QNX), but this gives us flexibility
2415 dnl if any other platforms need to override this in the future.
2416 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2418 dnl ========================================================
2419 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2420 dnl by now will not have any way to link most binaries (tests
2421 dnl as well as viewer, apprunner, etc.), because some symbols
2422 dnl will be left out of the "composite" .so's by ld as unneeded.
2423 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2424 dnl they can link in the static libs that provide the missing
2426 dnl ========================================================
2427 NO_LD_ARCHIVE_FLAGS=
2428 if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2429 NO_LD_ARCHIVE_FLAGS=1
2433 NO_LD_ARCHIVE_FLAGS=
2436 NO_LD_ARCHIVE_FLAGS=
2439 NO_LD_ARCHIVE_FLAGS=
2441 *-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince|*-winmo)
2442 if test -z "$GNU_CC"; then
2443 NO_LD_ARCHIVE_FLAGS=
2447 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2450 dnl Indicate that platform requires special thread safe
2451 dnl locking when starting up the OJI JVM
2452 dnl (see mozilla/modules/oji/src/nsJVMManager.cpp)
2453 dnl ========================================================
2456 AC_DEFINE(MOZ_OJI_REQUIRE_THREAD_SAFE_ON_STARTUP)
2460 dnl ========================================================
2461 dnl = Flags to strip unused symbols from .so components
2462 dnl ========================================================
2464 *-linux*|*-kfreebsd*-gnu)
2465 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2468 if test -z "$GNU_CC"; then
2469 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2471 if test -z "$GCC_USE_GNU_LD"; then
2472 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2474 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2479 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2482 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2484 *-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince|*-winmo)
2485 if test -n "$GNU_CC"; then
2486 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2491 if test -z "$COMPILE_ENVIRONMENT"; then
2492 SKIP_COMPILER_CHECKS=1
2493 SKIP_LIBRARY_CHECKS=1
2496 dnl Configure JIT support
2517 MOZ_ARG_DISABLE_BOOL(tracejit,
2518 [ --disable-tracejit Disable tracing JIT support],
2521 if test "$ENABLE_TRACEJIT"; then
2523 AC_DEFINE(FEATURE_NANOJIT)
2524 AC_DEFINE(JS_TRACER)
2528 AC_DEFINE(AVMPLUS_IA32)
2531 AC_DEFINE(AVMPLUS_AMD64)
2532 AC_DEFINE(AVMPLUS_64BIT)
2535 AC_DEFINE(AVMPLUS_ARM)
2538 AC_DEFINE(AVMPLUS_SPARC)
2542 case "$target_os" in
2544 AC_DEFINE(AVMPLUS_UNIX)
2545 AC_DEFINE(AVMPLUS_LINUX)
2548 AC_DEFINE(AVMPLUS_UNIX)
2551 AC_DEFINE(AVMPLUS_UNIX)
2554 AC_DEFINE(AVMPLUS_UNIX)
2556 *cygwin*|*mingw*|*mks*|*msvc*|*wince|*winmo)
2557 AC_DEFINE(AVMPLUS_WIN32)
2560 AC_DEFINE(AVMPLUS_OS2)
2563 AC_MSG_ERROR([Unrecognized nanojit platform. Use --disable-tracejit to build without tracing JIT support.])
2566 fi # ENABLE_TRACEJIT
2568 AC_SUBST(ENABLE_TRACEJIT)
2569 AC_SUBST(NANOJIT_ARCH)
2571 if test -z "$SKIP_COMPILER_CHECKS"; then
2572 dnl Checks for typedefs, structures, and compiler characteristics.
2573 dnl ========================================================
2581 AC_STRUCT_ST_BLKSIZE
2582 AC_MSG_CHECKING(for siginfo_t)
2583 AC_CACHE_VAL(ac_cv_siginfo_t,
2584 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2585 #include <signal.h>],
2587 [ac_cv_siginfo_t=true],
2588 [ac_cv_siginfo_t=false])])
2589 if test "$ac_cv_siginfo_t" = true ; then
2590 AC_DEFINE(HAVE_SIGINFO_T)
2596 dnl Find exact-width integer types, or figure them out
2598 dnl ========================================================
2599 dnl Once this is working, we can delete the code for int16_t,
2602 AC_CHECK_HEADER(stdint.h)
2603 if test "$ac_cv_header_stdint_h" = yes; then
2604 AC_DEFINE(JS_HAVE_STDINT_H)
2606 dnl We'll figure them out for ourselves. List more likely types
2607 dnl earlier. If we ever really encounter a size for which none of
2608 dnl the listed types are appropriate, we'll get a configure-time
2609 dnl error; just add the right answer.
2610 MOZ_N_BYTE_TYPE(JS_INT8_TYPE, 1, [char])
2611 MOZ_N_BYTE_TYPE(JS_INT16_TYPE, 2, [short int long])
2612 MOZ_N_BYTE_TYPE(JS_INT32_TYPE, 4, [int long 'long long' short])
2613 MOZ_N_BYTE_TYPE(JS_INT64_TYPE, 8, [int long 'long long'])
2614 MOZ_N_BYTE_TYPE(JS_INTPTR_TYPE, sizeof (void *),
2615 [int long 'long long' short])
2618 MOZ_SIZE_OF_TYPE(JS_BYTES_PER_WORD, void*, 4 8)
2619 if test "$moz_cv_size_of_JS_BYTES_PER_WORD" -eq "4"; then
2620 AC_DEFINE(JS_BITS_PER_WORD_LOG2, 5)
2621 elif test "$moz_cv_size_of_JS_BYTES_PER_WORD" -eq "8"; then
2622 AC_DEFINE(JS_BITS_PER_WORD_LOG2, 6)
2624 AC_MSG_ERROR([Unexpected JS_BYTES_PER_WORD])
2627 MOZ_ALIGN_OF_TYPE(JS_ALIGN_OF_POINTER, void*, 2 4 8 16)
2628 MOZ_SIZE_OF_TYPE(JS_BYTES_PER_DOUBLE, double, 6 8 10 12 14)
2630 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2631 dnl ========================================================
2632 AC_MSG_CHECKING(for int16_t)
2633 AC_CACHE_VAL(ac_cv_int16_t,
2634 [AC_TRY_COMPILE([#include <stdio.h>
2635 #include <sys/types.h>],
2637 [ac_cv_int16_t=true],
2638 [ac_cv_int16_t=false])])
2639 if test "$ac_cv_int16_t" = true ; then
2640 AC_DEFINE(HAVE_INT16_T)
2645 AC_MSG_CHECKING(for int32_t)
2646 AC_CACHE_VAL(ac_cv_int32_t,
2647 [AC_TRY_COMPILE([#include <stdio.h>
2648 #include <sys/types.h>],
2650 [ac_cv_int32_t=true],
2651 [ac_cv_int32_t=false])])
2652 if test "$ac_cv_int32_t" = true ; then
2653 AC_DEFINE(HAVE_INT32_T)
2658 AC_MSG_CHECKING(for int64_t)
2659 AC_CACHE_VAL(ac_cv_int64_t,
2660 [AC_TRY_COMPILE([#include <stdio.h>
2661 #include <sys/types.h>],
2663 [ac_cv_int64_t=true],
2664 [ac_cv_int64_t=false])])
2665 if test "$ac_cv_int64_t" = true ; then
2666 AC_DEFINE(HAVE_INT64_T)
2671 AC_MSG_CHECKING(for int64)
2672 AC_CACHE_VAL(ac_cv_int64,
2673 [AC_TRY_COMPILE([#include <stdio.h>
2674 #include <sys/types.h>],
2677 [ac_cv_int64=false])])
2678 if test "$ac_cv_int64" = true ; then
2679 AC_DEFINE(HAVE_INT64)
2684 AC_MSG_CHECKING(for uint)
2685 AC_CACHE_VAL(ac_cv_uint,
2686 [AC_TRY_COMPILE([#include <stdio.h>
2687 #include <sys/types.h>],
2690 [ac_cv_uint=false])])
2691 if test "$ac_cv_uint" = true ; then
2692 AC_DEFINE(HAVE_UINT)
2697 AC_MSG_CHECKING(for uint_t)
2698 AC_CACHE_VAL(ac_cv_uint_t,
2699 [AC_TRY_COMPILE([#include <stdio.h>
2700 #include <sys/types.h>],
2702 [ac_cv_uint_t=true],
2703 [ac_cv_uint_t=false])])
2704 if test "$ac_cv_uint_t" = true ; then
2705 AC_DEFINE(HAVE_UINT_T)
2710 AC_MSG_CHECKING(for uint16_t)
2711 AC_CACHE_VAL(ac_cv_uint16_t,
2712 [AC_TRY_COMPILE([#include <stdio.h>
2713 #include <sys/types.h>],
2714 [uint16_t foo = 0;],
2715 [ac_cv_uint16_t=true],
2716 [ac_cv_uint16_t=false])])
2717 if test "$ac_cv_uint16_t" = true ; then
2718 AC_DEFINE(HAVE_UINT16_T)
2724 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2725 dnl are defined when compiling C++ but not C. Since the result of this
2726 dnl test is used only in C++, do it in C++.
2729 AC_MSG_CHECKING(for uname.domainname)
2730 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2731 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2732 [ struct utsname *res; char *domain;
2733 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2734 [ac_cv_have_uname_domainname_field=true],
2735 [ac_cv_have_uname_domainname_field=false])])
2737 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2738 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2744 AC_MSG_CHECKING(for uname.__domainname)
2745 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2746 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2747 [ struct utsname *res; char *domain;
2748 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2749 [ac_cv_have_uname_us_domainname_field=true],
2750 [ac_cv_have_uname_us_domainname_field=false])])
2752 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2753 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2761 dnl Check for .hidden assembler directive and visibility attribute.
2762 dnl Borrowed from glibc configure.in
2763 dnl ===============================================================
2764 if test "$GNU_CC"; then
2765 AC_CACHE_CHECK(for visibility(hidden) attribute,
2766 ac_cv_visibility_hidden,
2767 [cat > conftest.c <<EOF
2768 int foo __attribute__ ((visibility ("hidden"))) = 1;
2770 ac_cv_visibility_hidden=no
2771 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2772 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2773 ac_cv_visibility_hidden=yes
2778 if test "$ac_cv_visibility_hidden" = "yes"; then
2779 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2781 AC_CACHE_CHECK(for visibility(default) attribute,
2782 ac_cv_visibility_default,
2783 [cat > conftest.c <<EOF
2784 int foo __attribute__ ((visibility ("default"))) = 1;
2786 ac_cv_visibility_default=no
2787 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2788 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2789 ac_cv_visibility_default=yes
2794 if test "$ac_cv_visibility_default" = "yes"; then
2795 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2797 AC_CACHE_CHECK(for visibility pragma support,
2798 ac_cv_visibility_pragma,
2799 [cat > conftest.c <<EOF
2800 #pragma GCC visibility push(hidden)
2802 #pragma GCC visibility push(default)
2803 int foo_default = 1;
2805 ac_cv_visibility_pragma=no
2806 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2807 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2808 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2809 ac_cv_visibility_pragma=yes
2815 if test "$ac_cv_visibility_pragma" = "yes"; then
2816 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2817 ac_cv_have_visibility_class_bug,
2818 [cat > conftest.c <<EOF
2819 #pragma GCC visibility push(hidden)
2820 struct __attribute__ ((visibility ("default"))) TestStruct {
2823 __attribute__ ((visibility ("default"))) void TestFunc() {
2827 ac_cv_have_visibility_class_bug=no
2828 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2829 ac_cv_have_visibility_class_bug=yes
2831 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2832 ac_cv_have_visibility_class_bug=yes
2835 rm -rf conftest.{c,S}
2838 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2839 ac_cv_have_visibility_builtin_bug,
2840 [cat > conftest.c <<EOF
2841 #pragma GCC visibility push(hidden)
2842 #pragma GCC visibility push(default)
2844 #pragma GCC visibility pop
2846 __attribute__ ((visibility ("default"))) void Func() {
2848 memset(c, 0, sizeof(c));
2851 ac_cv_have_visibility_builtin_bug=no
2852 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2853 ac_cv_have_visibility_builtin_bug=yes
2855 if test `grep -c "@PLT" conftest.S` = 0; then
2856 ac_cv_visibility_builtin_bug=yes
2859 rm -f conftest.{c,S}
2861 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2862 "$ac_cv_have_visibility_class_bug" = "no"; then
2863 VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h'
2864 WRAP_SYSTEM_INCLUDES=1
2866 VISIBILITY_FLAGS='-fvisibility=hidden'
2867 fi # have visibility pragma bug
2868 fi # have visibility pragma
2869 fi # have visibility(default) attribute
2870 fi # have visibility(hidden) attribute
2873 # visibility hidden flag for Sun Studio on Solaris
2874 if test "$SOLARIS_SUNPRO_CC"; then
2875 VISIBILITY_FLAGS='-xldscope=hidden'
2876 fi # Sun Studio on Solaris
2878 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2879 AC_SUBST(VISIBILITY_FLAGS)
2881 dnl Checks for header files.
2882 dnl ========================================================
2884 case "$target_os" in
2886 # for stuff like -lXshm
2887 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2890 AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
2891 AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
2892 AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
2893 AC_CHECK_HEADERS(malloc.h)
2894 AC_CHECK_HEADERS(X11/XKBlib.h)
2896 dnl These are all the places some variant of statfs can be hiding.
2897 AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2899 dnl Try for MMX support
2900 dnl NB - later gcc versions require -mmmx for this header to be successfully
2901 dnl included (or another option which implies it, such as -march=pentium-mmx)
2902 AC_CHECK_HEADERS(mmintrin.h)
2904 dnl Check whether the compiler supports the new-style C++ standard
2905 dnl library headers (i.e. <new>) or needs the old "new.h"
2908 AC_CHECK_HEADER(new, [NEW_H=new])
2909 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2912 AC_ARG_ENABLE(dtrace,
2913 [ --enable-dtrace build with dtrace support if available (default=no)],
2914 [enable_dtrace="yes"],)
2915 if test "x$enable_dtrace" = "xyes"; then
2916 AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2917 if test -n "$HAVE_DTRACE"; then
2918 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
2920 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
2923 AC_SUBST(HAVE_DTRACE)
2929 AC_CHECK_HEADERS(sys/cdefs.h)
2933 dnl Checks for libraries.
2934 dnl ========================================================
2939 AC_CHECK_LIB(c_r, gethostbyname_r)
2943 dnl We don't want to link with libdl even if it's present on OS X, since
2944 dnl it's not used and not part of the default installation.
2945 dnl The same goes for BeOS. OS/2 has dlfcn in libc.
2946 dnl We don't want to link against libm or libpthread on Darwin since
2947 dnl they both are just symlinks to libSystem and explicitly linking
2948 dnl against libSystem causes issues when debugging (see bug 299601).
2957 AC_CHECK_LIB(m, atan)
2958 AC_CHECK_LIB(dl, dlopen,
2959 AC_CHECK_HEADER(dlfcn.h,
2961 AC_DEFINE(HAVE_LIBDL)))
2965 _SAVE_CFLAGS="$CFLAGS"
2966 CFLAGS="$CFLAGS -D_GNU_SOURCE"
2967 AC_CHECK_FUNCS(dladdr)
2968 CFLAGS="$_SAVE_CFLAGS"
2970 if test ! "$GNU_CXX"; then
2974 AC_CHECK_LIB(C_r, demangle)
2977 AC_CHECK_LIB(C, demangle)
2982 dnl OS/2 has socket in libc.
2987 AC_CHECK_LIB(socket, socket)
2990 dnl ========================================================
2991 dnl = pthread support
2992 dnl = Start by checking whether the system support pthreads
2993 dnl ========================================================
2994 case "$target_os" in
2999 MOZ_CHECK_PTHREADS(pthreads,
3000 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3001 MOZ_CHECK_PTHREADS(pthread,
3002 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3003 MOZ_CHECK_PTHREADS(c_r,
3004 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3005 MOZ_CHECK_PTHREADS(c,
3014 dnl ========================================================
3015 dnl Check the command line for --with-pthreads
3016 dnl ========================================================
3017 MOZ_ARG_WITH_BOOL(pthreads,
3018 [ --with-pthreads Force use of system pthread library with NSPR ],
3019 [ if test "$USE_PTHREADS"x = x; then
3020 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3026 dnl ========================================================
3027 dnl Do the platform specific pthread hackery
3028 dnl ========================================================
3029 if test "$USE_PTHREADS"x != x
3032 dnl See if -pthread is supported.
3035 ac_cv_have_dash_pthread=no
3036 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3037 echo 'int main() { return 0; }' | cat > conftest.c
3038 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3039 if test $? -eq 0; then
3040 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3041 ac_cv_have_dash_pthread=yes
3042 case "$target_os" in
3044 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3047 CFLAGS="$CFLAGS -pthread"
3048 CXXFLAGS="$CXXFLAGS -pthread"
3054 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3057 dnl See if -pthreads is supported.
3059 ac_cv_have_dash_pthreads=no
3060 if test "$ac_cv_have_dash_pthread" = "no"; then
3061 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3062 echo 'int main() { return 0; }' | cat > conftest.c
3063 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3064 if test $? -eq 0; then
3065 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3066 ac_cv_have_dash_pthreads=yes
3067 CFLAGS="$CFLAGS -pthreads"
3068 CXXFLAGS="$CXXFLAGS -pthreads"
3072 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3077 AC_DEFINE(_REENTRANT)
3078 AC_DEFINE(_THREAD_SAFE)
3079 dnl -pthread links in -lc_r, so don't specify it explicitly.
3080 if test "$ac_cv_have_dash_pthread" = "yes"; then
3081 _PTHREAD_LDFLAGS="-pthread"
3083 _PTHREAD_LDFLAGS="-lc_r"
3087 *-*-openbsd*|*-*-bsdi*)
3088 AC_DEFINE(_REENTRANT)
3089 AC_DEFINE(_THREAD_SAFE)
3090 dnl -pthread links in -lc_r, so don't specify it explicitly.
3091 if test "$ac_cv_have_dash_pthread" = "yes"; then
3092 _PTHREAD_LDFLAGS="-pthread"
3096 *-*-linux*|*-*-kfreebsd*-gnu)
3097 AC_DEFINE(_REENTRANT)
3101 AC_DEFINE(_REENTRANT)
3105 AC_DEFINE(_REENTRANT)
3109 AC_DEFINE(_REENTRANT)
3113 AC_DEFINE(_REENTRANT)
3117 AC_DEFINE(_REENTRANT)
3118 if test "$SOLARIS_SUNPRO_CC"; then
3119 CFLAGS="$CFLAGS -mt"
3120 CXXFLAGS="$CXXFLAGS -mt"
3124 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3127 dnl ========================================================
3128 dnl See if mmap sees writes
3129 dnl For cross compiling, just define it as no, which is a safe default
3130 dnl ========================================================
3131 AC_MSG_CHECKING(whether mmap() sees write()s)
3137 #include <sys/mman.h>
3138 #include <sys/types.h>
3139 #include <sys/stat.h>
3142 char fname[] = "conftest.file";
3143 char zbuff[1024]; /* Fractional page is probably worst case */
3150 fd = open(fname, O_RDWR | O_CREAT, 0660);
3153 write(fd, zbuff, sizeof(zbuff));
3154 lseek(fd, 0, SEEK_SET);
3155 map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3156 if(map==(char*)-1) return 2;
3157 for(i=0; fname[i]; i++) {
3158 int rc = write(fd, &fname[i], 1);
3159 if(map[i]!=fname[i]) return 4;
3166 AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3168 AC_MSG_RESULT("$result")
3170 if test "$result" = "no"; then
3171 AC_DEFINE(MMAP_MISSES_WRITES)
3175 dnl Checks for library functions.
3176 dnl ========================================================
3177 AC_PROG_GCC_TRADITIONAL
3180 AC_CHECK_FUNCS([fchmod flockfile getc_unlocked _getc_nolock getpagesize \
3181 lchown localtime_r lstat64 memmove random rint sbrk snprintf \
3182 stat64 statvfs statvfs64 strerror strtok_r truncate64])
3184 dnl Windows functions, for mingw.
3185 AC_TRY_LINK([#include <windows.h>],
3186 [SYSTEMTIME st;FILETIME ft;SystemTimeToFileTime(&st,&ft);],
3187 ac_cv_have_systemtimetofiletime="yes",
3188 ac_cv_have_systemtimetofiletime="no")
3189 if test "$ac_cv_have_systemtimetofiletime" = "yes"; then
3190 AC_DEFINE(HAVE_SYSTEMTIMETOFILETIME)
3192 AC_TRY_LINK([#include <windows.h>],
3193 [FILETIME ft;GetSystemTimeAsFileTime(&ft);],
3194 ac_cv_have_getsystemtimeasfiletime="yes",
3195 ac_cv_have_getsystemtimeasfiletime="no")
3196 if test "$ac_cv_have_getsystemtimeasfiletime" = "yes"; then
3197 AC_DEFINE(HAVE_GETSYSTEMTIMEASFILETIME)
3200 dnl check for wcrtomb/mbrtowc
3201 dnl =======================================================================
3202 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3205 AC_CACHE_CHECK(for wcrtomb,
3207 [AC_TRY_LINK([#include <wchar.h>],
3208 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3209 ac_cv_have_wcrtomb="yes",
3210 ac_cv_have_wcrtomb="no")])
3211 if test "$ac_cv_have_wcrtomb" = "yes"; then
3212 AC_DEFINE(HAVE_WCRTOMB)
3214 AC_CACHE_CHECK(for mbrtowc,
3216 [AC_TRY_LINK([#include <wchar.h>],
3217 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3218 ac_cv_have_mbrtowc="yes",
3219 ac_cv_have_mbrtowc="no")])
3220 if test "$ac_cv_have_mbrtowc" = "yes"; then
3221 AC_DEFINE(HAVE_MBRTOWC)
3228 ac_cv_func_res_ninit,
3231 #define _BSD_SOURCE 1
3235 [int foo = res_ninit(&_res);],
3236 [ac_cv_func_res_ninit=yes],
3237 [ac_cv_func_res_ninit=no])
3240 if test "$ac_cv_func_res_ninit" = "yes"; then
3241 AC_DEFINE(HAVE_RES_NINIT)
3242 dnl must add the link line we do something as foolish as this... dougt
3244 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3245 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3250 [for gnu_get_libc_version()],
3251 ac_cv_func_gnu_get_libc_version,
3253 #ifdef HAVE_GNU_LIBC_VERSION_H
3254 #include <gnu/libc-version.h>
3257 [const char *glibc_version = gnu_get_libc_version();],
3258 [ac_cv_func_gnu_get_libc_version=yes],
3259 [ac_cv_func_gnu_get_libc_version=no]
3263 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3264 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3268 os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|winmo*|beos*)
3272 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3273 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3274 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3276 LIBS="$LIBS $_ICONV_LIBS"
3285 iconv_t h = iconv_open("", "");
3286 iconv(h, NULL, NULL, NULL, NULL);
3289 [ac_cv_func_iconv=yes],
3290 [ac_cv_func_iconv=no]
3293 if test "$ac_cv_func_iconv" = "yes"; then
3294 AC_DEFINE(HAVE_ICONV)
3295 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3296 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3297 LIBICONV="$_ICONV_LIBS"
3299 [for iconv() with const input],
3300 ac_cv_func_const_iconv,
3306 const char *input = "testing";
3307 iconv_t h = iconv_open("", "");
3308 iconv(h, &input, NULL, NULL, NULL);
3311 [ac_cv_func_const_iconv=yes],
3312 [ac_cv_func_const_iconv=no]
3315 if test "$ac_cv_func_const_iconv" = "yes"; then
3316 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3326 dnl **********************
3327 dnl *** va_copy checks ***
3328 dnl **********************
3329 dnl we currently check for all three va_copy possibilities, so we get
3330 dnl all results in config.log for bug reports.
3331 AC_MSG_CHECKING(for an implementation of va_copy())
3332 AC_CACHE_VAL(ac_cv_va_copy,[
3335 void f (int i, ...) {
3336 va_list args1, args2;
3337 va_start (args1, i);
3338 va_copy (args2, args1);
3339 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3341 va_end (args1); va_end (args2);
3343 int main() { f (0, 42); return 0; }],
3349 AC_MSG_RESULT($ac_cv_va_copy)
3350 AC_MSG_CHECKING(for an implementation of __va_copy())
3351 AC_CACHE_VAL(ac_cv___va_copy,[
3354 void f (int i, ...) {
3355 va_list args1, args2;
3356 va_start (args1, i);
3357 __va_copy (args2, args1);
3358 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3360 va_end (args1); va_end (args2);
3362 int main() { f (0, 42); return 0; }],
3363 ac_cv___va_copy=yes,
3368 AC_MSG_RESULT($ac_cv___va_copy)
3369 AC_MSG_CHECKING(whether va_lists can be copied by value)
3370 AC_CACHE_VAL(ac_cv_va_val_copy,[
3373 void f (int i, ...) {
3374 va_list args1, args2;
3375 va_start (args1, i);
3377 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3379 va_end (args1); va_end (args2);
3381 int main() { f (0, 42); return 0; }],
3382 ac_cv_va_val_copy=yes,
3383 ac_cv_va_val_copy=no,
3384 ac_cv_va_val_copy=yes
3387 if test "x$ac_cv_va_copy" = "xyes"; then
3388 AC_DEFINE(VA_COPY, va_copy)
3389 AC_DEFINE(HAVE_VA_COPY)
3390 elif test "x$ac_cv___va_copy" = "xyes"; then
3391 AC_DEFINE(VA_COPY, __va_copy)
3392 AC_DEFINE(HAVE_VA_COPY)
3395 if test "x$ac_cv_va_val_copy" = "xno"; then
3396 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3398 AC_MSG_RESULT($ac_cv_va_val_copy)
3400 dnl Check for dll-challenged libc's.
3401 dnl This check is apparently only needed for Linux.
3404 dnl ===================================================================
3407 rm -rf conftest* _conftest
3409 cat >> conftest.C <<\EOF
3414 void __dump_link_map(void) {
3415 struct link_map *map = _dl_loaded;
3416 while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3419 dlopen("./conftest1.so",RTLD_LAZY);
3420 dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3421 dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3422 dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3426 /* _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).*/
3427 int main() { printf("./conftest1.so\n"); }
3431 $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3433 cat >> conftest1.C <<\EOF
3435 void foo(void) {printf("foo in dll called\n");}
3437 ${CXX-g++} -fPIC -c -g conftest1.C
3438 ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3439 ${CXX-g++} -g conftest.C -o conftest -ldl
3440 cp -f conftest1.so conftest _conftest
3442 if test `./conftest | grep conftest1.so | wc -l` -gt 1
3445 echo "*** Your libc has a bug that can result in loading the same dynamic"
3446 echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3447 echo "*** or later. However, if you choose not to upgrade, the only effect"
3448 echo "*** will be excessive memory usage at runtime."
3452 rm -rf conftest* _conftest
3453 dnl ===================================================================
3457 dnl ===================================================================
3458 dnl ========================================================
3459 dnl By default, turn rtti and exceptions off on g++/egcs
3460 dnl ========================================================
3461 if test "$GNU_CXX"; then
3463 AC_MSG_CHECKING(for C++ exceptions flag)
3465 dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3466 AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3467 [echo "int main() { return 0; }" | cat > conftest.C
3469 ${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3471 if egrep "warning.*renamed" conftest.out >/dev/null; then
3472 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3474 ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3479 AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3480 _MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3481 _MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3484 dnl ========================================================
3485 dnl Put your C++ language/feature checks below
3486 dnl ========================================================
3490 if test "$GNU_CC"; then
3491 AC_CACHE_CHECK(for gcc 3.0 ABI,
3492 ac_cv_gcc_three_abi,
3495 #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3501 ac_cv_gcc_three_abi="yes",
3502 ac_cv_gcc_three_abi="no")])
3503 if test "$ac_cv_gcc_three_abi" = "yes"; then
3504 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3507 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3510 AC_SUBST(HAVE_GCC3_ABI)
3513 AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3515 [AC_TRY_COMPILE(class X {
3516 public: explicit X(int i) : i_(i) {}
3520 ac_cv_cpp_explicit=yes,
3521 ac_cv_cpp_explicit=no)])
3522 if test "$ac_cv_cpp_explicit" = yes ; then
3523 AC_DEFINE(HAVE_CPP_EXPLICIT)
3526 AC_CACHE_CHECK(for C++ \"typename\" keyword,
3528 [AC_TRY_COMPILE(class param {
3530 typedef unsigned long num_type;
3533 template <class T> class tplt {
3535 typedef typename T::num_type t_num_type;
3536 t_num_type foo(typename T::num_type num) {
3542 ac_cv_cpp_typename=yes,
3543 ac_cv_cpp_typename=no)])
3544 if test "$ac_cv_cpp_typename" = yes ; then
3545 AC_DEFINE(HAVE_CPP_TYPENAME)
3548 dnl Check for support of modern template specialization syntax
3549 dnl Test code and requirement from scc@netscape.com.
3550 dnl Autoconf cut-and-paste job by waterson@netscape.com
3551 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3552 ac_cv_cpp_modern_specialize_template_syntax,
3553 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3555 template <> struct X<Y> { double a; };,
3558 ac_cv_cpp_modern_specialize_template_syntax=yes,
3559 ac_cv_cpp_modern_specialize_template_syntax=no)])
3560 if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3561 AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3565 dnl Some compilers support only full specialization, and some don't.
3566 AC_CACHE_CHECK(whether partial template specialization works,
3567 ac_cv_cpp_partial_specialization,
3568 [AC_TRY_COMPILE(template <class T> class Foo {};
3569 template <class T> class Foo<T*> {};,
3571 ac_cv_cpp_partial_specialization=yes,
3572 ac_cv_cpp_partial_specialization=no)])
3573 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3574 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3577 dnl Some compilers have limited support for operators with templates;
3578 dnl specifically, it is necessary to define derived operators when a base
3579 dnl class's operator declaration should suffice.
3580 AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3581 ac_cv_need_derived_template_operators,
3582 [AC_TRY_COMPILE([template <class T> class Base { };
3584 Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3585 template <class T> class Derived : public Base<T> { };],
3586 [Derived<char> a, b;
3587 Base<char> c = a + b;
3589 ac_cv_need_derived_template_operators=no,
3590 ac_cv_need_derived_template_operators=yes)])
3591 if test "$ac_cv_need_derived_template_operators" = yes ; then
3592 AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3596 dnl Some compilers have trouble detecting that a template class
3597 dnl that derives from another template is actually an instance
3598 dnl of the base class. This test checks for that.
3599 AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3600 ac_cv_need_cpp_template_cast_to_base,
3601 [AC_TRY_COMPILE([template <class T> class Base { };
3602 template <class T> class Derived : public Base<T> { };
3603 template <class T> int foo(const Base<T>&) { return 0; }],
3604 [Derived<char> bar; return foo(bar);],
3605 ac_cv_need_cpp_template_cast_to_base=no,
3606 ac_cv_need_cpp_template_cast_to_base=yes)])
3607 if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3608 AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3611 dnl Some compilers have trouble resolving the ambiguity between two
3612 dnl functions whose arguments differ only by cv-qualifications.
3613 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3614 ac_cv_can_resolve_const_ambiguity,
3616 template <class T> class ptrClass {
3620 template <class T> T* a(ptrClass<T> *arg) {
3625 const T* a(const ptrClass<T> *arg) {
3631 ac_cv_can_resolve_const_ambiguity=yes,
3632 ac_cv_can_resolve_const_ambiguity=no)])
3633 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3634 AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3638 dnl We don't do exceptions on unix. The only reason this used to be here
3639 dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3640 dnl exceptions. But, we turn exceptions off by default and this test breaks.
3641 dnl So im commenting this out until someone writes some artificial
3642 dnl intelligence to detect not only if the compiler has exceptions, but if
3643 dnl they are enabled as well.
3645 dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3646 dnl ac_cv_cpp_exceptions,
3647 dnl [AC_TRY_COMPILE(class X { public: X() {} };
3648 dnl static void F() { throw X(); },
3649 dnl try { F(); } catch(X & e) { },
3650 dnl ac_cv_cpp_exceptions=yes,
3651 dnl ac_cv_cpp_exceptions=no)])
3652 dnl if test $ac_cv_cpp_exceptions = yes ; then
3653 dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3656 dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3657 dnl supports it well enough to allow us to use it to change access, but not
3658 dnl to resolve ambiguity. The next two tests determine how well the |using|
3659 dnl keyword is supported.
3661 dnl Check to see if we can change access with |using|. Test both a
3662 dnl legal and an illegal example.
3663 AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3664 ac_cv_cpp_access_changing_using2,
3666 class A { protected: int foo() { return 0; } };
3667 class B : public A { public: using A::foo; };,
3668 B b; return b.foo();,
3670 class A { public: int foo() { return 1; } };
3671 class B : public A { private: using A::foo; };,
3672 B b; return b.foo();,
3673 ac_cv_cpp_access_changing_using2=no,
3674 ac_cv_cpp_access_changing_using2=yes)],
3675 ac_cv_cpp_access_changing_using2=no)])
3676 if test "$ac_cv_cpp_access_changing_using2" = yes ; then
3677 AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
3680 dnl Check to see if we can resolve ambiguity with |using|.
3681 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3682 ac_cv_cpp_ambiguity_resolving_using,
3683 [AC_TRY_COMPILE(class X {
3684 public: int go(const X&) {return 3;}
3685 int jo(const X&) {return 3;}
3687 class Y : public X {
3688 public: int go(int) {return 2;}
3689 int jo(int) {return 2;}
3691 private: using X::go;
3694 ac_cv_cpp_ambiguity_resolving_using=yes,
3695 ac_cv_cpp_ambiguity_resolving_using=no)])
3696 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3697 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3700 dnl Check to see if the |std| namespace is supported. If so, we'll want
3701 dnl to qualify any standard library calls with "std::" to ensure that
3702 dnl those functions can be resolved.
3703 AC_CACHE_CHECK(for \"std::\" namespace,
3704 ac_cv_cpp_namespace_std,
3705 [AC_TRY_COMPILE([#include <algorithm>],
3706 [return std::min(0, 1);],
3707 ac_cv_cpp_namespace_std=yes,
3708 ac_cv_cpp_namespace_std=no)])
3709 if test "$ac_cv_cpp_namespace_std" = yes ; then
3710 AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
3713 dnl Older compilers are overly ambitious with respect to using the standard
3714 dnl template library's |operator!=()| when |operator==()| is defined. In
3715 dnl which case, defining |operator!=()| in addition to |operator==()| causes
3716 dnl ambiguity at compile-time. This test checks for that case.
3717 AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
3718 ac_cv_cpp_unambiguous_std_notequal,
3719 [AC_TRY_COMPILE([#include <algorithm>
3721 int operator==(const T1&, const T1&) { return 0; }
3722 int operator!=(const T1&, const T1&) { return 0; }],
3723 [T1 a,b; return a != b;],
3724 ac_cv_cpp_unambiguous_std_notequal=unambiguous,
3725 ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
3726 if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
3727 AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
3731 AC_CACHE_CHECK(for C++ reinterpret_cast,
3732 ac_cv_cpp_reinterpret_cast,
3733 [AC_TRY_COMPILE(struct X { int i; };
3734 struct Y { int i; };,
3735 X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
3736 ac_cv_cpp_reinterpret_cast=yes,
3737 ac_cv_cpp_reinterpret_cast=no)])
3738 if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
3739 AC_DEFINE(HAVE_CPP_NEW_CASTS)
3742 dnl See if a dynamic_cast to void* gives the most derived object.
3743 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3744 ac_cv_cpp_dynamic_cast_void_ptr,
3745 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3746 class Y { int j; public: virtual ~Y() { } };
3747 class Z : public X, public Y { int k; };
3753 return !((((void*)&mdo != (void*)subx) &&
3754 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3755 (((void*)&mdo != (void*)suby) &&
3756 ((void*)&mdo == dynamic_cast<void*>(suby))));
3758 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3759 ac_cv_cpp_dynamic_cast_void_ptr=no,
3760 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3761 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3762 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3766 dnl note that this one is reversed - if the test fails, then
3767 dnl we require implementations of unused virtual methods. Which
3768 dnl really blows because it means we'll have useless vtable
3770 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3771 ac_cv_cpp_unused_required,
3772 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3774 ac_cv_cpp_unused_required=no,
3775 ac_cv_cpp_unused_required=yes)])
3776 if test "$ac_cv_cpp_unused_required" = yes ; then
3777 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3781 dnl Some compilers have trouble comparing a constant reference to a templatized
3782 dnl class to zero, and require an explicit operator==() to be defined that takes
3783 dnl an int. This test separates the strong from the weak.
3785 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3786 ac_cv_trouble_comparing_to_zero,
3787 [AC_TRY_COMPILE([#include <algorithm>
3788 template <class T> class Foo {};
3790 template <class T> int operator==(const T2*, const T&) { return 0; }
3791 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3792 [Foo<int> f; return (0 != f);],
3793 ac_cv_trouble_comparing_to_zero=no,
3794 ac_cv_trouble_comparing_to_zero=yes)])
3795 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3796 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3801 dnl End of C++ language/feature checks
3804 dnl ========================================================
3805 dnl = Internationalization checks
3806 dnl ========================================================
3808 dnl Internationalization and Locale support is different
3809 dnl on various UNIX platforms. Checks for specific i18n
3810 dnl features go here.
3812 dnl check for LC_MESSAGES
3813 AC_CACHE_CHECK(for LC_MESSAGES,
3814 ac_cv_i18n_lc_messages,
3815 [AC_TRY_COMPILE([#include <locale.h>],
3816 [int category = LC_MESSAGES;],
3817 ac_cv_i18n_lc_messages=yes,
3818 ac_cv_i18n_lc_messages=no)])
3819 if test "$ac_cv_i18n_lc_messages" = yes; then
3820 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3823 fi # SKIP_COMPILER_CHECKS
3826 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3827 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3830 dnl Mozilla specific options
3831 dnl ========================================================
3832 dnl The macros used for command line options
3833 dnl are defined in build/autoconf/altoptions.m4.
3836 dnl ========================================================
3838 dnl = Check for external package dependencies
3840 dnl ========================================================
3841 MOZ_ARG_HEADER(External Packages)
3843 dnl ========================================================
3844 dnl = Find the right NSPR to use.
3845 dnl ========================================================
3846 MOZ_ARG_WITH_BOOL(system-nspr,
3847 [ --with-system-nspr Use an NSPR that is already built and installed.
3848 Use the 'nspr-config' script in the current path,
3849 or look for the script in the directories given with
3850 --with-nspr-exec-prefix or --with-nspr-prefix.
3851 (Those flags are only checked if you specify
3852 --with-system-nspr.)],
3853 _USE_SYSTEM_NSPR=1 )
3855 MOZ_ARG_WITH_STRING(nspr-cflags,
3856 [ --with-nspr-cflags=FLAGS Pass FLAGS to CC when building code that uses NSPR.
3857 Use this when there's no accurate nspr-config
3858 script available. This is the case when building
3859 SpiderMonkey as part of the Mozilla tree: the
3860 top-level configure script computes NSPR flags
3861 that accomodate the quirks of that environment.],
3862 NSPR_CFLAGS=$withval)
3863 MOZ_ARG_WITH_STRING(nspr-libs,
3864 [ --with-nspr-libs=LIBS Pass LIBS to LD when linking code that uses NSPR.
3865 See --with-nspr-cflags for more details.],
3867 AC_SUBST(NSPR_CFLAGS)
3870 dnl Pass either --with-system-nspr or (--with-nspr-cflags and
3871 dnl --with-nspr-libs), but not both.
3872 if test "$_USE_SYSTEM_NSPR" && (test "$NSPR_CFLAGS" || test "$NSPR_LIBS"); then
3873 AC_MSG_ERROR([--with-system-nspr and --with-nspr-libs/cflags are mutually exclusive.
3874 See 'configure --help'.])
3877 if test -n "$_USE_SYSTEM_NSPR"; then
3879 AM_PATH_NSPR(4.7.0, [MOZ_NATIVE_NSPR=1])
3880 if test -z "$MOZ_NATIVE_NSPR"; then
3881 AC_MSG_ERROR([--with-system-nspr given, but configure could not find a suitable NSPR.
3882 Pass --with-nspr-exec-prefix, --with-nspr-prefix, or --with-nspr-cflags/libs.
3883 See 'configure --help'.])
3887 if test -n "$MOZ_NATIVE_NSPR"; then
3888 _SAVE_CFLAGS=$CFLAGS
3889 CFLAGS="$CFLAGS $NSPR_CFLAGS"
3890 AC_TRY_COMPILE([#include "prlog.h"],
3891 [#ifndef PR_STATIC_ASSERT
3892 #error PR_STATIC_ASSERT not defined
3894 [MOZ_NATIVE_NSPR=1],
3895 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
3896 CFLAGS=$_SAVE_CFLAGS
3899 dnl ========================================================
3900 dnl Use ARM userspace kernel helpers; tell NSPR to enable
3901 dnl their usage and use them in spidermonkey.
3902 dnl ========================================================
3903 MOZ_ARG_WITH_BOOL(arm-kuser,
3904 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
3907 if test -n "$USE_ARM_KUSER"; then
3908 AC_DEFINE(USE_ARM_KUSER)
3911 dnl ========================================================
3915 dnl ========================================================
3917 MOZ_ARG_HEADER(Application)
3921 MOZ_DBGRINFO_MODULES=
3923 dnl ========================================================
3925 dnl = Components & Features
3927 dnl ========================================================
3928 MOZ_ARG_HEADER(Components and Features)
3930 dnl ========================================================
3932 dnl ========================================================
3933 MOZ_ARG_ENABLE_STRING(ui-locale,
3934 [ --enable-ui-locale=ab-CD
3935 Select the user interface locale (default: en-US)],
3936 MOZ_UI_LOCALE=$enableval )
3937 AC_SUBST(MOZ_UI_LOCALE)
3939 dnl ========================================================
3940 dnl build the tests by default
3941 dnl ========================================================
3942 MOZ_ARG_DISABLE_BOOL(tests,
3943 [ --disable-tests Do not build test libraries & programs],
3947 dnl ========================================================
3949 dnl = Module specific options
3951 dnl ========================================================
3952 MOZ_ARG_HEADER(Individual module options)
3954 dnl ========================================================
3956 dnl = Debugging Options
3958 dnl ========================================================
3959 MOZ_ARG_HEADER(Debugging and Optimizations)
3961 dnl ========================================================
3962 dnl = Disable building with debug info.
3963 dnl = Debugging is OFF by default
3964 dnl ========================================================
3965 if test -z "$MOZ_DEBUG_FLAGS"
3969 if test "$GNU_CC"; then
3970 GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
3971 case "$GCC_VERSION" in
3976 MOZ_DEBUG_FLAGS="-g"
3980 MOZ_DEBUG_FLAGS="-g"
3984 MOZ_DEBUG_FLAGS="-g"
3989 MOZ_ARG_ENABLE_STRING(debug,
3990 [ --enable-debug[=DBG] Enable building with developer debug info
3991 (Using compiler flags DBG)],
3992 [ if test "$enableval" != "no"; then
3994 if test -n "$enableval" && test "$enableval" != "yes"; then
3995 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
4002 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
4003 case "${target_os}" in
4005 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
4007 msvc*|mks*|cygwin*|mingw*|os2*|wince*|winmo*)
4008 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
4011 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
4014 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
4016 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
4018 if test -n "$MOZ_DEBUG"; then
4019 AC_MSG_CHECKING([for valid debug flags])
4020 _SAVE_CFLAGS=$CFLAGS
4021 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
4022 AC_TRY_COMPILE([#include <stdio.h>],
4023 [printf("Hello World\n");],
4026 AC_MSG_RESULT([$_results])
4027 if test "$_results" = "no"; then
4028 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
4030 CFLAGS=$_SAVE_CFLAGS
4033 dnl ========================================================
4034 dnl = Enable code optimization. ON by default.
4035 dnl ========================================================
4036 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
4037 MOZ_OPTIMIZE_FLAGS="-O"
4040 MOZ_ARG_ENABLE_STRING(optimize,
4041 [ --disable-optimize Disable compiler optimization
4042 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
4043 [ if test "$enableval" != "no"; then
4045 if test -n "$enableval" && test "$enableval" != "yes"; then
4046 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
4051 fi ], MOZ_OPTIMIZE=1)
4053 if test "$COMPILE_ENVIRONMENT"; then
4054 if test -n "$MOZ_OPTIMIZE"; then
4055 AC_MSG_CHECKING([for valid optimization flags])
4056 _SAVE_CFLAGS=$CFLAGS
4057 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
4058 AC_TRY_COMPILE([#include <stdio.h>],
4059 [printf("Hello World\n");],
4062 AC_MSG_RESULT([$_results])
4063 if test "$_results" = "no"; then
4064 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
4066 CFLAGS=$_SAVE_CFLAGS
4068 fi # COMPILE_ENVIRONMENT
4070 AC_SUBST(MOZ_OPTIMIZE)
4071 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
4072 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
4073 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
4075 dnl ========================================================
4076 dnl = Enable/disable debug for specific modules only
4077 dnl = module names beginning with ^ will be disabled
4078 dnl ========================================================
4079 MOZ_ARG_ENABLE_STRING(debug-modules,
4080 [ --enable-debug-modules Enable/disable debug info for specific modules],
4081 [ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
4083 dnl ========================================================
4084 dnl = Enable/disable generation of debugger info for specific modules only
4085 dnl = the special module name ALL_MODULES can be used to denote all modules
4086 dnl = module names beginning with ^ will be disabled
4087 dnl ========================================================
4088 MOZ_ARG_ENABLE_STRING(debugger-info-modules,
4089 [ --enable-debugger-info-modules
4090 Enable/disable debugger info for specific modules],
4091 [ for i in `echo $enableval | sed 's/,/ /g'`; do
4092 dnl note that the list of module names is reversed as it is copied
4093 dnl this is important, as it will allow config.mk to interpret stuff like
4094 dnl "^ALL_MODULES xpcom" properly
4095 if test "$i" = "no"; then
4098 if test "$i" = "yes"; then
4101 MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
4104 dnl ========================================================
4105 dnl Enable Narcissus
4106 dnl ========================================================
4107 MOZ_ARG_ENABLE_BOOL(narcissus,
4108 [ --enable-narcissus Build with Narcissus code enabled],
4111 if test -n "$NARCISSUS"; then
4112 AC_DEFINE(NARCISSUS)
4115 dnl ========================================================
4116 dnl = Enable trace malloc
4117 dnl ========================================================
4118 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
4119 MOZ_ARG_ENABLE_BOOL(trace-malloc,
4120 [ --enable-trace-malloc Enable malloc tracing],
4123 if test "$NS_TRACE_MALLOC"; then
4124 # Please, Mr. Linker Man, don't take away our symbol names
4125 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
4126 AC_DEFINE(NS_TRACE_MALLOC)
4128 AC_SUBST(NS_TRACE_MALLOC)
4130 dnl ========================================================
4131 dnl = Enable jemalloc
4132 dnl ========================================================
4133 MOZ_ARG_ENABLE_BOOL(jemalloc,
4134 [ --enable-jemalloc Replace memory allocator with jemalloc],
4138 if test "$NS_TRACE_MALLOC"; then
4142 if test "$MOZ_MEMORY"; then
4144 dnl Don't try to run compiler tests on Windows
4145 if test "$OS_ARCH" = "WINNT"; then
4146 if test -z "$HAVE_64BIT_OS"; then
4147 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
4149 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
4152 AC_CHECK_SIZEOF([int *], [4])
4153 case "${ac_cv_sizeof_int_p}" in
4155 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
4158 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
4161 AC_MSG_ERROR([Unexpected pointer size])
4166 AC_DEFINE(MOZ_MEMORY)
4167 if test "x$MOZ_DEBUG" = "x1"; then
4168 AC_DEFINE(MOZ_MEMORY_DEBUG)
4170 dnl The generic feature tests that determine how to compute ncpus are long and
4171 dnl complicated. Therefore, simply define special cpp variables for the
4172 dnl platforms we have special knowledge of.
4173 case "${target_os}" in
4175 AC_DEFINE(MOZ_MEMORY_DARWIN)
4178 AC_DEFINE(MOZ_MEMORY_BSD)
4181 AC_DEFINE(MOZ_MEMORY_LINUX)
4184 AC_DEFINE(MOZ_MEMORY_BSD)
4187 AC_DEFINE(MOZ_MEMORY_SOLARIS)
4189 msvc*|mks*|cygwin*|mingw*)
4190 AC_DEFINE(MOZ_MEMORY_WINDOWS)
4191 # the interesting bits will get passed down in MOZ_MEMORY_LDFLAGS
4194 AC_DEFINE(MOZ_MEMORY_WINCE)
4195 AC_DEFINE(MOZ_MEMORY_WINDOWS)
4198 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
4202 AC_SUBST(MOZ_MEMORY)
4203 AC_SUBST(MOZ_MEMORY_LDFLAGS)
4205 dnl ========================================================
4206 dnl = Use malloc wrapper lib
4207 dnl ========================================================
4208 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
4209 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
4213 if test -n "$_WRAP_MALLOC"; then
4214 if test "$GNU_CC"; then
4215 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"
4216 MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
4220 dnl ========================================================
4221 dnl = Location of malloc wrapper lib
4222 dnl ========================================================
4223 MOZ_ARG_WITH_STRING(wrap-malloc,
4224 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
4225 WRAP_MALLOC_LIB=$withval)
4227 dnl ========================================================
4229 dnl ========================================================
4230 MOZ_ARG_ENABLE_BOOL(tracevis,
4231 [ --enable-tracevis Enable TraceVis tracing tool (default=no)],
4234 if test -n "$MOZ_TRACEVIS"; then
4235 AC_DEFINE(MOZ_TRACEVIS)
4236 if test -z "$ENABLE_TRACEJIT"; then
4237 AC_MSG_ERROR([--enable-tracevis is incompatible with --disable-tracejit])
4242 dnl ========================================================
4244 dnl ========================================================
4245 MOZ_ARG_ENABLE_BOOL(valgrind,
4246 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
4249 if test -n "$MOZ_VALGRIND"; then
4250 AC_CHECK_HEADER([valgrind/valgrind.h], [],
4252 [--enable-valgrind specified but Valgrind is not installed]))
4253 AC_DEFINE(MOZ_VALGRIND)
4256 dnl ========================================================
4258 dnl ========================================================
4259 MOZ_ARG_ENABLE_BOOL(jprof,
4260 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
4263 if test -n "$MOZ_JPROF"; then
4264 AC_DEFINE(MOZ_JPROF)
4267 dnl ========================================================
4269 dnl ========================================================
4270 MOZ_ARG_ENABLE_BOOL(shark,
4271 [ --enable-shark Enable shark remote profiling (needs CHUD framework)],
4274 if test -n "$MOZ_SHARK"; then
4275 AC_DEFINE(MOZ_SHARK)
4278 dnl ========================================================
4280 dnl ========================================================
4281 MOZ_ARG_ENABLE_BOOL(callgrind,
4282 [ --enable-callgrind Enable callgrind profiling],
4285 if test -n "$MOZ_CALLGRIND"; then
4286 AC_DEFINE(MOZ_CALLGRIND)
4289 dnl ========================================================
4291 dnl ========================================================
4292 MOZ_ARG_ENABLE_BOOL(vtune,
4293 [ --enable-vtune Enable vtune profiling],
4296 if test -n "$MOZ_VTUNE"; then
4297 AC_DEFINE(MOZ_VTUNE)
4300 dnl ========================================================
4302 dnl ========================================================
4303 MOZ_ARG_ENABLE_BOOL(gczeal,
4304 [ --enable-gczeal Enable zealous GCing],
4307 if test -n "$JS_GC_ZEAL"; then
4308 AC_DEFINE(JS_GC_ZEAL)
4311 dnl ========================================================
4312 dnl = Enable static checking using gcc-dehydra
4313 dnl ========================================================
4315 MOZ_ARG_WITH_STRING(static-checking,
4316 [ --with-static-checking=path/to/gcc_dehydra.so
4317 Enable static checking of code using GCC-dehydra],
4318 DEHYDRA_PATH=$withval,
4321 if test -n "$DEHYDRA_PATH"; then
4322 if test ! -f "$DEHYDRA_PATH"; then
4323 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
4325 AC_DEFINE(NS_STATIC_CHECKING)
4327 AC_SUBST(DEHYDRA_PATH)
4329 dnl ========================================================
4330 dnl = Enable stripping of libs & executables
4331 dnl ========================================================
4332 MOZ_ARG_ENABLE_BOOL(strip,
4333 [ --enable-strip Enable stripping of libs & executables ],
4337 dnl ========================================================
4338 dnl = Enable stripping of libs & executables when packaging
4339 dnl ========================================================
4340 MOZ_ARG_ENABLE_BOOL(install-strip,
4341 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
4345 dnl ========================================================
4347 dnl = Profiling and Instrumenting
4349 dnl ========================================================
4350 MOZ_ARG_HEADER(Profiling and Instrumenting)
4352 dnl ========================================================
4353 dnl = Enable timeline service, which provides lightweight
4354 dnl = instrumentation of mozilla for performance measurement.
4355 dnl = Timeline is off by default.
4356 dnl ========================================================
4357 MOZ_ARG_ENABLE_BOOL(timeline,
4358 [ --enable-timeline Enable timeline services ],
4361 if test -n "$MOZ_TIMELINE"; then
4362 AC_DEFINE(MOZ_TIMELINE)
4365 MOZ_ARG_ENABLE_BOOL(insure,
4366 [ --enable-insure Enable insure++ instrumentation (linux only)],
4369 if test -n "$_ENABLE_INSURE"; then
4373 MOZ_INSURE_EXCLUDE_DIRS="config"
4376 MOZ_ARG_WITH_STRING(insure-dirs,
4377 [ --with-insure-dirs=DIRS
4378 Dirs to instrument with insure ],
4379 MOZ_INSURE_DIRS=$withval )
4381 MOZ_ARG_WITH_STRING(insure-exclude-dirs,
4382 [ --with-insure-exclude-dirs=DIRS
4383 Dirs to not instrument with insure ],
4384 MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
4386 dnl ========================================================
4387 dnl = Support for Quantify (Windows)
4388 dnl ========================================================
4389 MOZ_ARG_ENABLE_BOOL(quantify,
4390 [ --enable-quantify Enable Quantify support (Windows only) ],
4394 dnl ========================================================
4395 dnl = Support for demangling undefined symbols
4396 dnl ========================================================
4397 if test -z "$SKIP_LIBRARY_CHECKS"; then
4400 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
4404 # Demangle only for debug or trace-malloc builds
4405 MOZ_DEMANGLE_SYMBOLS=
4406 if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
4407 MOZ_DEMANGLE_SYMBOLS=1
4408 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
4410 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
4412 dnl ========================================================
4413 dnl = Support for gcc stack unwinding (from gcc 3.3)
4414 dnl ========================================================
4415 if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
4416 AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
4419 dnl ========================================================
4423 dnl ========================================================
4424 MOZ_ARG_HEADER(Misc. Options)
4426 dnl ========================================================
4427 dnl update xterm title
4428 dnl ========================================================
4429 MOZ_ARG_ENABLE_BOOL(xterm-updates,
4430 [ --enable-xterm-updates Update XTERM titles with current command.],
4434 if test -z "$SKIP_COMPILER_CHECKS"; then
4435 dnl ========================================================
4437 dnl = Compiler Options
4439 dnl ========================================================
4440 MOZ_ARG_HEADER(Compiler Options)
4442 dnl ========================================================
4443 dnl Check for gcc -pipe support
4444 dnl ========================================================
4445 AC_MSG_CHECKING([for gcc -pipe support])
4446 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
4447 echo '#include <stdio.h>' > dummy-hello.c
4448 echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
4449 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
4450 cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
4451 if test $? = 0; then
4456 if test "$_res_as_stdin" = "yes"; then
4457 _SAVE_CFLAGS=$CFLAGS
4458 CFLAGS="$CFLAGS -pipe"
4459 AC_TRY_COMPILE( [ #include <stdio.h> ],
4460 [printf("Hello World\n");],
4461 [_res_gcc_pipe="yes"],
4462 [_res_gcc_pipe="no"] )
4463 CFLAGS=$_SAVE_CFLAGS
4465 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
4467 CFLAGS="$CFLAGS -pipe"
4468 CXXFLAGS="$CXXFLAGS -pipe"
4472 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
4473 AC_MSG_RESULT([$_res])
4478 dnl pass -Wno-long-long to the compiler
4479 MOZ_ARG_ENABLE_BOOL(long-long-warning,
4480 [ --enable-long-long-warning
4481 Warn about use of non-ANSI long long type],
4482 _IGNORE_LONG_LONG_WARNINGS=,
4483 _IGNORE_LONG_LONG_WARNINGS=1)
4485 if test "$_IGNORE_LONG_LONG_WARNINGS"; then
4486 _SAVE_CFLAGS="$CFLAGS"
4487 CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
4488 AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
4489 AC_TRY_COMPILE([], [return(0);],
4490 [ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
4491 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
4492 result="yes" ], result="no")
4493 AC_MSG_RESULT([$result])
4494 CFLAGS="$_SAVE_CFLAGS"
4497 dnl ========================================================
4498 dnl Profile guided optimization
4499 dnl ========================================================
4500 dnl Test for profiling options
4501 dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
4502 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
4504 dnl Provide a switch to disable PGO even when called via profiledbuild.
4505 MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
4506 [ --disable-profile-guided-optimization
4507 Don't build with PGO even if called via make profiledbuild],
4508 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
4509 MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
4511 AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
4513 _SAVE_CFLAGS="$CFLAGS"
4514 CFLAGS="$CFLAGS -fprofile-generate"
4516 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
4517 AC_TRY_COMPILE([], [return 0;],
4518 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
4519 result="yes" ], result="no")
4520 AC_MSG_RESULT([$result])
4522 if test $result = "yes"; then
4523 PROFILE_GEN_LDFLAGS="-fprofile-generate"
4524 PROFILE_USE_CFLAGS="-fprofile-use"
4525 PROFILE_USE_LDFLAGS="-fprofile-use"
4527 CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
4528 AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
4529 AC_TRY_COMPILE([], [return 0;],
4530 [ PROFILE_GEN_CFLAGS="-fprofile-arcs"
4531 result="yes" ], result="no")
4532 AC_MSG_RESULT([$result])
4533 if test $result = "yes"; then
4534 PROFILE_USE_CFLAGS="-fbranch-probabilities"
4536 # don't really care, this is an old GCC
4537 PROFILE_GEN_LDFLAGS=
4538 PROFILE_USE_LDFLAGS=
4541 CFLAGS="$_SAVE_CFLAGS"
4543 if test -n "$INTEL_CC"; then
4544 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
4545 PROFILE_GEN_LDFLAGS=
4546 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
4547 PROFILE_USE_LDFLAGS=
4550 dnl Sun Studio on Solaris
4551 if test "$SOLARIS_SUNPRO_CC"; then
4552 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
4553 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
4554 if test "$CPU_ARCH" != "sparc"; then
4555 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
4556 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
4558 PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
4559 PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
4563 AC_SUBST(PROFILE_GEN_CFLAGS)
4564 AC_SUBST(PROFILE_GEN_LDFLAGS)
4565 AC_SUBST(PROFILE_USE_CFLAGS)
4566 AC_SUBST(PROFILE_USE_LDFLAGS)
4570 dnl ========================================================
4571 dnl Test for -pedantic bustage
4572 dnl ========================================================
4573 MOZ_ARG_DISABLE_BOOL(pedantic,
4574 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
4576 if test "$_PEDANTIC"; then
4577 _SAVE_CXXFLAGS=$CXXFLAGS
4578 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
4579 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
4580 AC_TRY_COMPILE([$configure_static_assert_macros],
4581 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
4582 result="no", result="yes" )
4583 AC_MSG_RESULT([$result])
4584 CXXFLAGS="$_SAVE_CXXFLAGS"
4588 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
4589 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
4592 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
4597 dnl ========================================================
4598 dnl Test for correct temporary object destruction order
4599 dnl ========================================================
4600 dnl We want to make sure the compiler follows the C++ spec here as
4601 dnl xpcom and the string classes depend on it (bug 235381).
4602 AC_MSG_CHECKING([for correct temporary object destruction order])
4603 AC_TRY_RUN([ class A {
4604 public: A(int& x) : mValue(x) {}
4606 operator char**() { return 0; }
4607 private: int& mValue;
4609 void func(char **arg) {}
4620 result="yes", result="no", result="maybe")
4621 AC_MSG_RESULT([$result])
4623 if test "$result" = "no"; then
4624 AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
4627 dnl ========================================================
4628 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
4629 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
4630 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
4631 dnl ========================================================
4632 _SAVE_CXXFLAGS=$CXXFLAGS
4633 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
4634 AC_CACHE_CHECK(for correct overload resolution with const and templates,
4635 ac_nscap_nonconst_opeq_bug,
4644 template <class T, class U>
4645 int operator==(const Pointer<T>& rhs, U* lhs)
4647 return rhs.myPtr == lhs;
4650 template <class T, class U>
4651 int operator==(const Pointer<T>& rhs, const U* lhs)
4653 return rhs.myPtr == lhs;
4661 ac_nscap_nonconst_opeq_bug="no",
4662 ac_nscap_nonconst_opeq_bug="yes")])
4663 CXXFLAGS="$_SAVE_CXXFLAGS"
4665 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
4666 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
4669 dnl ========================================================
4670 dnl Check for tm_zone, tm_gmtoff in struct tm
4671 dnl ========================================================
4672 AC_CACHE_CHECK(for tm_zone tm_gmtoff in struct tm,
4673 ac_cv_struct_tm_zone_tm_gmtoff,
4674 [AC_TRY_COMPILE([#include <time.h>],
4675 [struct tm tm; tm.tm_zone = 0; tm.tm_gmtoff = 1;],
4676 [ac_cv_struct_tm_zone_tm_gmtoff="yes"],
4677 [ac_cv_struct_tm_zone_tm_gmtoff="no"])])
4678 if test "$ac_cv_struct_tm_zone_tm_gmtoff" = "yes" ; then
4679 AC_DEFINE(HAVE_TM_ZONE_TM_GMTOFF)
4682 fi # SKIP_COMPILER_CHECKS
4684 dnl ========================================================
4686 dnl Should be smarter and check that the compiler does indeed have rtti
4687 dnl ========================================================
4688 MOZ_ARG_ENABLE_BOOL(cpp-rtti,
4689 [ --enable-cpp-rtti Enable C++ RTTI ],
4690 [ _MOZ_USE_RTTI=1 ],
4693 if test "$_MOZ_USE_RTTI"; then
4694 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
4696 _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
4699 AC_SUBST(_MOZ_RTTI_FLAGS_ON)
4701 dnl ========================================================
4702 dnl C++ exceptions (g++/egcs only - for now)
4703 dnl Should be smarter and check that the compiler does indeed have exceptions
4704 dnl ========================================================
4705 MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
4706 [ --enable-cpp-exceptions Enable C++ exceptions ],
4707 [ _MOZ_CPP_EXCEPTIONS=1 ],
4708 [ _MOZ_CPP_EXCEPTIONS= ])
4710 if test "$_MOZ_CPP_EXCEPTIONS"; then
4711 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
4713 _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
4716 AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
4718 # Irix & OSF native compilers do not like exception declarations
4719 # when exceptions are disabled
4720 if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
4721 AC_DEFINE(CPP_THROW_NEW, [])
4723 AC_DEFINE(CPP_THROW_NEW, [throw()])
4727 dnl ========================================================
4729 dnl = Build depencency options
4731 dnl ========================================================
4732 MOZ_ARG_HEADER(Build dependencies)
4734 dnl ========================================================
4735 dnl = Do not auto generate dependency info
4736 dnl ========================================================
4738 MOZ_ARG_DISABLE_BOOL(auto-deps,
4739 [ --disable-auto-deps Do not automatically generate dependency info],
4743 if test -n "$MOZ_AUTO_DEPS"; then
4744 dnl ========================================================
4745 dnl = Use mkdepend instead of $CC -MD for dependency generation
4746 dnl ========================================================
4748 MOZ_ARG_DISABLE_BOOL(md,
4749 [ --disable-md Do not use compiler-based dependencies ],
4752 [dnl Default is to turn on -MD if using GNU-compatible compilers
4753 if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
4756 dnl Default is to use -xM if using Sun Studio on Solaris
4757 if test "$SOLARIS_SUNPRO_CC"; then
4760 if test "$_cpp_md_flag"; then
4762 if test "$OS_ARCH" = "OpenVMS"; then
4763 _DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
4765 _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
4767 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
4768 if test "$SOLARIS_SUNPRO_CC"; then
4773 dnl Don't override this for MSVC
4774 if test -z "$_WIN32_MSVC"; then
4775 _USE_CPP_INCLUDE_FLAG=
4776 _DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
4777 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
4782 AC_SUBST(MOZ_AUTO_DEPS)
4783 AC_SUBST(COMPILER_DEPEND)
4787 dnl ========================================================
4789 dnl = Static Build Options
4791 dnl ========================================================
4792 MOZ_ARG_HEADER(Static build options)
4794 MOZ_ARG_ENABLE_BOOL(static,
4795 [ --enable-static Enable building of internal static libs],
4796 BUILD_STATIC_LIBS=1,
4799 dnl ========================================================
4800 dnl = Link js shell to system readline
4801 dnl ========================================================
4802 MOZ_ARG_ENABLE_BOOL(readline,
4803 [ --enable-readline Link js shell to system readline library],
4812 *-wince*|*-winmo*|*-mingw*|*-cygwin*|*-msvc*|*-mks*)
4823 if test -z "$SKIP_LIBRARY_CHECKS" -a -z "$NO_EDITLINE"; then
4824 if test -n "$JS_WANT_READLINE"; then
4825 AC_CHECK_LIB(readline, readline,
4826 EDITLINE_LIBS="-lreadline",
4827 AC_MSG_ERROR([No system readline library found.]))
4829 dnl By default, we use editline
4830 JS_NATIVE_EDITLINE=1
4831 EDITLINE_LIBS='$(DEPTH)/editline/$(LIB_PREFIX)editline.$(LIB_SUFFIX)'
4834 dnl Either way, we want to build with line editing support.
4837 AC_SUBST(JS_NATIVE_EDITLINE)
4838 AC_SUBST(JS_DISABLE_SHELL)
4839 AC_SUBST(EDITLINE_LIBS)
4841 dnl ========================================================
4843 dnl = Standalone module options
4845 dnl ========================================================
4846 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
4848 dnl ========================================================
4849 if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
4850 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
4853 MOZ_ARG_WITH_STRING(sync-build-files,
4854 [ --with-sync-build-files=DIR
4855 Check that files in 'config' and 'build' match
4856 their originals in 'DIR/config' and 'DIR/build'.
4857 This helps keep the SpiderMonkey build machinery
4858 in sync with Mozilla's, on which it is based.],
4859 [MOZ_SYNC_BUILD_FILES=$withval ] )
4860 AC_SUBST(MOZ_SYNC_BUILD_FILES)
4862 dnl ========================================================
4864 dnl = Maintainer debug option (no --enable equivalent)
4866 dnl ========================================================
4871 AC_SUBST(AR_EXTRACT)
4875 AC_SUBST(AS_DASH_C_FLAG)
4883 AC_SUBST(NS_USE_NATIVE)
4884 AC_SUBST(MOZ_JS_LIBS)
4887 AC_SUBST(MOZ_DEBUG_MODULES)
4888 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
4889 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
4890 AC_SUBST(MOZ_DEBUG_FLAGS)
4891 AC_SUBST(MOZ_DEBUG_LDFLAGS)
4892 AC_SUBST(WARNINGS_AS_ERRORS)
4893 AC_SUBST(MOZ_DBGRINFO_MODULES)
4897 AC_SUBST(MOZ_CALLGRIND)
4899 AC_SUBST(MOZ_XPCTOOLS)
4900 AC_SUBST(MOZ_JSLOADER)
4901 AC_SUBST(MOZ_INSURE)
4902 AC_SUBST(MOZ_INSURE_DIRS)
4903 AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
4904 AC_SUBST(MOZ_QUANTIFY)
4905 AC_SUBST(MOZ_INSURIFYING)
4908 AC_SUBST(BUILD_STATIC_LIBS)
4909 AC_SUBST(ENABLE_TESTS)
4911 AC_SUBST(ENABLE_STRIP)
4912 AC_SUBST(PKG_SKIP_STRIP)
4913 AC_SUBST(INCREMENTAL_LINKER)
4914 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
4915 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
4917 AC_SUBST(MOZ_FIX_LINK_PATHS)
4919 AC_SUBST(USE_DEPENDENT_LIBS)
4921 AC_SUBST(MOZ_BUILD_ROOT)
4922 AC_SUBST(MOZ_OS2_TOOLS)
4923 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
4925 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
4926 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
4927 AC_SUBST(MOZ_TIMELINE)
4929 AC_SUBST(WINCE_WINDOWS_MOBILE)
4931 AC_SUBST(MOZ_APP_NAME)
4932 AC_SUBST(MOZ_APP_DISPLAYNAME)
4933 AC_SUBST(MOZ_APP_VERSION)
4935 AC_SUBST(MOZ_PKG_SPECIAL)
4937 AC_SUBST(MOZILLA_OFFICIAL)
4940 AC_SUBST(MOZ_DEBUG_SYMBOLS)
4941 AC_SUBST(MOZ_MAPINFO)
4942 AC_SUBST(MOZ_BROWSE_INFO)
4943 AC_SUBST(MOZ_TOOLS_DIR)
4944 AC_SUBST(CYGWIN_WRAPPER)
4946 AC_SUBST(WIN32_REDIST_DIR)
4949 dnl Echo the CFLAGS to remove extra whitespace.
4956 $_MOZ_EXCEPTIONS_FLAGS \
4957 $_WARNINGS_CXXFLAGS \
4960 COMPILE_CFLAGS=`echo \
4965 COMPILE_CXXFLAGS=`echo \
4966 $_DEFINES_CXXFLAGS \
4970 AC_SUBST(SYSTEM_MAKEDEPEND)
4972 AC_SUBST(NSPR_CFLAGS)
4974 AC_SUBST(MOZ_NATIVE_NSPR)
4979 AC_SUBST(COMPILE_CFLAGS)
4980 AC_SUBST(COMPILE_CXXFLAGS)
4983 AC_SUBST(CROSS_COMPILE)
4987 AC_SUBST(HOST_CFLAGS)
4988 AC_SUBST(HOST_CXXFLAGS)
4989 AC_SUBST(HOST_OPTIMIZE_FLAGS)
4991 AC_SUBST(HOST_AR_FLAGS)
4993 AC_SUBST(HOST_RANLIB)
4994 AC_SUBST(HOST_NSPR_MDCPUCFG)
4995 AC_SUBST(HOST_BIN_SUFFIX)
4996 AC_SUBST(HOST_OS_ARCH)
4998 AC_SUBST(TARGET_CPU)
4999 AC_SUBST(TARGET_VENDOR)
5001 AC_SUBST(TARGET_NSPR_MDCPUCFG)
5002 AC_SUBST(TARGET_MD_ARCH)
5003 AC_SUBST(TARGET_XPCOM_ABI)
5006 AC_SUBST(OS_RELEASE)
5009 AC_SUBST(WRAP_MALLOC_CFLAGS)
5010 AC_SUBST(WRAP_MALLOC_LIB)
5013 AC_SUBST(MKSHLIB_FORCE_ALL)
5014 AC_SUBST(MKSHLIB_UNFORCE_ALL)
5015 AC_SUBST(DSO_CFLAGS)
5016 AC_SUBST(DSO_PIC_CFLAGS)
5017 AC_SUBST(DSO_LDOPTS)
5018 AC_SUBST(LIB_PREFIX)
5019 AC_SUBST(DLL_PREFIX)
5020 AC_SUBST(DLL_SUFFIX)
5021 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
5022 AC_SUBST(LIB_SUFFIX)
5023 AC_SUBST(OBJ_SUFFIX)
5024 AC_SUBST(BIN_SUFFIX)
5025 AC_SUBST(ASM_SUFFIX)
5026 AC_SUBST(IMPORT_LIB_SUFFIX)
5028 AC_SUBST(CC_VERSION)
5029 AC_SUBST(CXX_VERSION)
5030 AC_SUBST(MSMANIFEST_TOOL)
5032 if test "$USING_HCC"; then
5033 CC='${topsrcdir}/build/hcc'
5035 CXX='${topsrcdir}/build/hcpp'
5036 CXX="$CXX '$_OLDCXX'"
5041 dnl Check for missing components
5042 if test "$COMPILE_ENVIRONMENT"; then
5043 if test "$MOZ_X11"; then
5044 dnl ====================================================
5045 dnl = Check if X headers exist
5046 dnl ====================================================
5047 _SAVE_CFLAGS=$CFLAGS
5048 CFLAGS="$CFLAGS $XCFLAGS"
5052 #include <X11/Xlib.h>
5053 #include <X11/Intrinsic.h>
5057 if ((dpy = XOpenDisplay(NULL)) == NULL) {
5058 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
5062 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
5063 CFLAGS="$_SAVE_CFLAGS"
5065 if test ! -z "$MISSING_X"; then
5066 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
5070 fi # COMPILE_ENVIRONMENT
5072 dnl Set various defines and substitutions
5073 dnl ========================================================
5075 if test "$OS_ARCH" = "BeOS"; then
5078 elif test "$OS_ARCH" = "Darwin"; then
5080 AC_DEFINE(UNIX_ASYNC_DNS)
5082 elif test "$OS_ARCH" = "OpenVMS"; then
5084 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
5086 AC_DEFINE(UNIX_ASYNC_DNS)
5089 AC_SUBST(MOZ_MOVEMAIL)
5091 AC_ARG_ENABLE(threadsafe,
5092 [ --enable-threadsafe Enable support for multiple threads.],
5093 [AC_DEFINE(JS_THREADSAFE)],)
5095 if test "$MOZ_DEBUG"; then
5096 AC_DEFINE(MOZ_REFLOW_PERF)
5097 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
5100 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
5101 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
5102 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
5103 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
5104 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
5105 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
5106 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
5107 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
5108 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
5111 dnl ========================================================
5112 dnl JavaScript shell
5113 dnl ========================================================
5115 AC_HAVE_FUNCS(setlocale)
5117 dnl ========================================================
5118 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
5119 dnl ========================================================
5122 WIN_TOP_SRC=`cd $srcdir; pwd -W`
5125 HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
5126 HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
5127 CC="\$(CYGWIN_WRAPPER) $CC"
5128 CXX="\$(CYGWIN_WRAPPER) $CXX"
5129 CPP="\$(CYGWIN_WRAPPER) $CPP"
5130 LD="\$(CYGWIN_WRAPPER) $LD"
5131 AS="\$(CYGWIN_WRAPPER) $AS"
5132 RC="\$(CYGWIN_WRAPPER) $RC"
5133 CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
5134 WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
5138 AC_SUBST(CYGDRIVE_MOUNT)
5139 AC_SUBST(WIN_TOP_SRC)
5141 AC_SUBST(MOZILLA_VERSION)
5143 AC_SUBST(ac_configure_args)
5145 dnl Spit out some output
5146 dnl ========================================================
5148 # Save the defines header file before autoconf removes it.
5149 # (Do not add AC_DEFINE calls after this line.)
5150 _CONFIG_TMP=confdefs-tmp.h
5151 _CONFIG_DEFS_H=js-confdefs.h
5153 cat > $_CONFIG_TMP <<\EOF
5154 /* List of defines generated by configure. Included with preprocessor flag,
5155 * -include, to avoid long list of -D defines on the compile command-line.
5159 #ifndef _JS_CONFDEFS_H_
5160 #define _JS_CONFDEFS_H_
5163 _EGREP_PATTERN='^#define ('
5164 if test -n "$_NON_GLOBAL_ACDEFINES"; then
5165 for f in $_NON_GLOBAL_ACDEFINES; do
5166 _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
5169 _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
5171 sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
5173 cat >> $_CONFIG_TMP <<\EOF
5175 #endif /* _JS_CONFDEFS_H_ */
5179 # Only write js-confdefs.h when something changes (or it doesn't exist)
5180 if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
5183 AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
5184 mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
5186 echo ==== $_CONFIG_DEFS_H =================================
5190 dnl Probably shouldn't call this manually but we always want the output of DEFS
5191 rm -f confdefs.h.save
5192 mv confdefs.h confdefs.h.save
5193 egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
5194 AC_OUTPUT_MAKE_DEFS()
5196 AC_SUBST(MOZ_DEFINES)
5198 mv confdefs.h.save confdefs.h
5204 jsapi-tests/Makefile
5208 config/mkdepend/Makefile
5211 if test -n "$JS_NATIVE_EDITLINE"; then
5212 MAKEFILES="$MAKEFILES
5218 dnl Run a perl script to quickly create the makefiles.
5219 dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
5220 dnl for the files it cannot handle correctly. This way, config.status
5221 dnl will handle these files.
5222 dnl If it fails, nothing is set and config.status will run as usual.
5224 dnl This does not change the $MAKEFILES variable.
5226 dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
5228 if test -z "${AS_PERL}"; then
5229 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
5231 echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
5236 echo $MAKEFILES > unallmakefiles
5238 mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
5240 AC_OUTPUT($MAKEFILES)
5242 dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
5243 if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
5244 echo "config/autoconf.mk is unchanged"
5245 mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
5247 rm -f config/autoconf.mk.orig 2> /dev/null
5250 # Produce the js-config script at configure time; see the comments for
5251 # 'js-config' in Makefile.in.
5252 AC_MSG_RESULT(invoking make to create js-config script)