~ubuntu-branches/ubuntu/trusty/enigmail/trusty-security

« back to all changes in this revision

Viewing changes to configure.in~

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2011-08-12 12:25:06 UTC
  • mfrom: (0.12.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110812122506-zko6c7zfexvyg71q
Tags: 2:1.2.1-0ubuntu1
* New upstream release
* Drop fix_install_rdf_xml_errors.diff - fixed upstream
* Refresh port_to_latest_thunderbird.diff
* Add a proper get-orig-source target which pulls the build system from
  lp:~mozillateam/mozilla-build-system/beta, now that we don't have the old
  build-system.tar.gz from xulrunner

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2
 
dnl vi: set tabstop=4 shiftwidth=4 expandtab syntax=m4:
3
 
dnl ***** BEGIN LICENSE BLOCK *****
4
 
dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
 
dnl
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/
10
 
dnl
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
14
 
dnl License.
15
 
dnl
16
 
dnl The Original Code is this file as it was released upon August 6, 1998.
17
 
dnl
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.
22
 
dnl
23
 
dnl Contributor(s):
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
30
 
dnl   Insure support.
31
 
dnl   Henry Sobotka <sobotka@axess.com>
32
 
dnl   OS/2 support
33
 
dnl   Dan Mosedale <dmose@mozilla.org>
34
 
dnl   LDAP support
35
 
dnl   Seth Spitzer <sspitzer@netscape.com>
36
 
dnl   xpctools support
37
 
dnl   Benjamin Smedberg <benjamin@smedbergs.us>
38
 
dnl   Howard Chu <hyc@symas.com>
39
 
dnl   MSYS support
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>
45
 
dnl   Windows x64 support
46
 
dnl   Makoto Kato <m_kato@ga2.so-net.ne.jp>
47
 
dnl
48
 
dnl Alternatively, the contents of this file may be used under the terms of
49
 
dnl either the GNU General Public License Version 2 or later (the "GPL"), or
50
 
dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
51
 
dnl in which case the provisions of the GPL or the LGPL are applicable instead
52
 
dnl of those above. If you wish to allow use of your version of this file only
53
 
dnl under the terms of either the GPL or the LGPL, and not to allow others to
54
 
dnl use your version of this file under the terms of the MPL, indicate your
55
 
dnl decision by deleting the provisions above and replace them with the notice
56
 
dnl and other provisions required by the GPL or the LGPL. If you do not delete
57
 
dnl the provisions above, a recipient may use your version of this file under
58
 
dnl the terms of any one of the MPL, the GPL or the LGPL.
59
 
dnl
60
 
dnl ***** END LICENSE BLOCK *****
61
 
 
62
 
dnl Process this file with autoconf to produce a configure script.
63
 
dnl ========================================================
64
 
 
65
 
AC_PREREQ(2.13)
66
 
AC_INIT(config/config.mk)
67
 
AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
68
 
AC_CANONICAL_SYSTEM
69
 
TARGET_CPU="${target_cpu}"
70
 
TARGET_VENDOR="${target_vendor}"
71
 
TARGET_OS="${target_os}"
72
 
 
73
 
MOZ_DEB_TIMESTAMP=`date +"%a, %d  %b %Y %T %z"   2>&1` 
74
 
AC_SUBST(MOZ_DEB_TIMESTAMP)
75
 
 
76
 
dnl ========================================================
77
 
dnl =
78
 
dnl = Don't change the following two lines.  Doing so breaks:
79
 
dnl =
80
 
dnl = CFLAGS="-foo" ./configure
81
 
dnl =
82
 
dnl ========================================================
83
 
CFLAGS="${CFLAGS=}"
84
 
CPPFLAGS="${CPPFLAGS=}"
85
 
CXXFLAGS="${CXXFLAGS=}"
86
 
LDFLAGS="${LDFLAGS=}"
87
 
HOST_CFLAGS="${HOST_CFLAGS=}"
88
 
HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
89
 
HOST_LDFLAGS="${HOST_LDFLAGS=}"
90
 
 
91
 
dnl ========================================================
92
 
dnl = Preserve certain environment flags passed to configure
93
 
dnl = We want sub projects to receive the same flags
94
 
dnl = untainted by this configure script
95
 
dnl ========================================================
96
 
_SUBDIR_CC="$CC"
97
 
_SUBDIR_CXX="$CXX"
98
 
_SUBDIR_CFLAGS="$CFLAGS"
99
 
_SUBDIR_CPPFLAGS="$CPPFLAGS"
100
 
_SUBDIR_CXXFLAGS="$CXXFLAGS"
101
 
_SUBDIR_LDFLAGS="$LDFLAGS"
102
 
_SUBDIR_HOST_CC="$HOST_CC"
103
 
_SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
104
 
_SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
105
 
_SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
106
 
_SUBDIR_CONFIG_ARGS="$ac_configure_args"
107
 
 
108
 
dnl Set the version number of the libs included with mozilla
109
 
dnl ========================================================
110
 
MOZJPEG=62
111
 
MOZPNG=10401
112
 
MOZZLIB=0x1230
113
 
NSPR_VERSION=4
114
 
NSS_VERSION=3
115
 
 
116
 
dnl Set the minimum version of toolkit libs used by mozilla
117
 
dnl ========================================================
118
 
GLIB_VERSION=1.2.0
119
 
LIBIDL_VERSION=0.6.3
120
 
PERL_VERSION=5.006
121
 
PYTHON_VERSION=2.5
122
 
CAIRO_VERSION=1.10
123
 
PANGO_VERSION=1.14.0
124
 
GTK2_VERSION=2.10.0
125
 
WINDRES_VERSION=2.14.90
126
 
W32API_VERSION=3.8
127
 
GNOMEVFS_VERSION=2.0
128
 
GNOMEUI_VERSION=2.2.0
129
 
GCONF_VERSION=1.2.1
130
 
GIO_VERSION=2.0
131
 
STARTUP_NOTIFICATION_VERSION=0.8
132
 
DBUS_VERSION=0.60
133
 
SQLITE_VERSION=3.7.5
134
 
LIBNOTIFY_VERSION=0.4
135
 
 
136
 
MSMANIFEST_TOOL=
137
 
 
138
 
dnl Set various checks
139
 
dnl ========================================================
140
 
MISSING_X=
141
 
AC_PROG_AWK
142
 
 
143
 
dnl Initialize the Pthread test variables early so they can be
144
 
dnl  overridden by each platform.
145
 
dnl ========================================================
146
 
USE_PTHREADS=
147
 
_PTHREAD_LDFLAGS=""
148
 
 
149
 
dnl Do not allow a separate objdir build if a srcdir build exists.
150
 
dnl ==============================================================
151
 
_topsrcdir=`cd \`dirname $0\`; pwd`
152
 
_objdir=`pwd`
153
 
 
154
 
if test "$_topsrcdir" != "$_objdir"
155
 
then
156
 
  # Check for a couple representative files in the source tree
157
 
  _conflict_files=
158
 
  for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
159
 
    if test -f $file; then
160
 
      _conflict_files="$_conflict_files $file"
161
 
    fi
162
 
  done
163
 
  if test "$_conflict_files"; then
164
 
    echo "***"
165
 
    echo "*   Your source tree contains these files:"
166
 
    for file in $_conflict_files; do
167
 
      echo "*         $file"
168
 
    done
169
 
    cat 1>&2 <<-EOF
170
 
        *   This indicates that you previously built in the source tree.
171
 
        *   A source tree build can confuse the separate objdir build.
172
 
        *
173
 
        *   To clean up the source tree:
174
 
        *     1. cd $_topsrcdir
175
 
        *     2. gmake distclean
176
 
        ***
177
 
        EOF
178
 
    exit 1
179
 
    break
180
 
  fi
181
 
fi
182
 
MOZ_BUILD_ROOT=`pwd`
183
 
 
184
 
dnl Default to MSVC for win32 and gcc-4.2 for darwin
185
 
dnl ==============================================================
186
 
if test -z "$CROSS_COMPILE"; then
187
 
case "$target" in
188
 
*-mingw*)
189
 
    if test -z "$CC"; then CC=cl; fi
190
 
    if test -z "$CXX"; then CXX=cl; fi
191
 
    if test -z "$CPP"; then CPP="cl -E -nologo"; fi
192
 
    if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
193
 
    if test -z "$LD"; then LD=link; fi
194
 
    if test -z "$AS"; then
195
 
        case "${target_cpu}" in
196
 
        i*86)
197
 
            AS=ml;
198
 
            ;;
199
 
        x86_64)
200
 
            AS=ml64;
201
 
            ;;
202
 
        esac
203
 
    fi
204
 
    if test -z "$MIDL"; then MIDL=midl; fi
205
 
    ;;
206
 
*-darwin*)
207
 
    if test -z "$CC"; then CC=gcc-4.2; fi
208
 
    if test -z "$CXX"; then CXX=g++-4.2; fi
209
 
    ;;
210
 
esac
211
 
fi
212
 
 
213
 
COMPILE_ENVIRONMENT=1
214
 
MOZ_ARG_DISABLE_BOOL(compile-environment,
215
 
[  --disable-compile-environment
216
 
                          Disable compiler/library checks.],
217
 
    COMPILE_ENVIRONMENT= )
218
 
AC_SUBST(COMPILE_ENVIRONMENT)
219
 
 
220
 
MOZ_ARG_WITH_STRING(l10n-base,
221
 
[  --with-l10n-base=DIR    path to l10n repositories],
222
 
    L10NBASEDIR=$withval)
223
 
if test ! -z "$L10NBASEDIR"; then
224
 
    if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
225
 
        AC_MSG_ERROR([--with-l10n-base must specify a path])
226
 
    elif test -d "$L10NBASEDIR"; then
227
 
        L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
228
 
    else
229
 
        AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
230
 
    fi
231
 
fi
232
 
AC_SUBST(L10NBASEDIR)
233
 
 
234
 
dnl Check for Perl first -- needed for win32 SDK checks
235
 
MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
236
 
if test -z "$PERL" -o "$PERL" = ":"; then
237
 
    AC_MSG_ERROR([perl not found in \$PATH])
238
 
fi
239
 
 
240
 
dnl ========================================================
241
 
dnl = Android uses a very custom (hacky) toolchain; we need to do this
242
 
dnl = here, so that the compiler checks can succeed
243
 
dnl ========================================================
244
 
 
245
 
MOZ_ARG_WITH_STRING(android-ndk,
246
 
[  --with-android-ndk=DIR
247
 
                          location where the Android NDK can be found],
248
 
    android_ndk=$withval)
249
 
 
250
 
MOZ_ARG_WITH_STRING(android-toolchain,
251
 
[  --with-android-toolchain=DIR
252
 
                          location of the android toolchain, default NDK/build/prebuilt/HOST/arm-eabi-4.4.0],
253
 
    android_toolchain=$withval)
254
 
 
255
 
 
256
 
MOZ_ARG_WITH_STRING(android-version,
257
 
[  --with-android-version=VER
258
 
                          android platform version, default 5],
259
 
    android_version=$withval,
260
 
    android_version=5)
261
 
 
262
 
MOZ_ARG_WITH_STRING(android-sdk,
263
 
[  --with-android-sdk=DIR
264
 
                          location where the Android SDK can be found (base directory, e.g. .../android/platforms/android-6)],
265
 
    android_sdk=$withval)
266
 
 
267
 
if test "$target" = "arm-android-eabi" ; then
268
 
    if test -z "$android_ndk" ; then
269
 
        AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
270
 
    fi
271
 
 
272
 
    if test -z "$android_sdk" ; then
273
 
        AC_MSG_ERROR([You must specify --with-android-sdk=/path/to/sdk when targeting Android.])
274
 
    fi
275
 
 
276
 
    android_platform_tools="$android_sdk"/../../platform-tools
277
 
    if test ! -d "$android_platform_tools" ; then
278
 
        android_platform_tools="$android_sdk"/tools # SDK Tools < r8
279
 
    fi
280
 
 
281
 
    if test -z "$android_toolchain" ; then
282
 
        android_toolchain="$android_ndk"/build/prebuilt/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/arm-eabi-4.4.0
283
 
    fi
284
 
 
285
 
    if test -z "$android_platform" ; then
286
 
       android_platform="$android_ndk"/build/platforms/android-"$android_version"/arch-"$target_cpu"
287
 
    fi
288
 
 
289
 
    dnl set up compilers
290
 
    AS="$android_toolchain"/bin/arm-eabi-as
291
 
    CC="$android_toolchain"/bin/arm-eabi-gcc
292
 
    CXX="$android_toolchain"/bin/arm-eabi-g++
293
 
    CPP="$android_toolchain"/bin/arm-eabi-cpp
294
 
    LD="$android_toolchain"/bin/arm-eabi-ld
295
 
    AR="$android_toolchain"/bin/arm-eabi-ar
296
 
    RANLIB="$android_toolchain"/bin/arm-eabi-ranlib
297
 
    STRIP="$android_toolchain"/bin/arm-eabi-strip
298
 
 
299
 
    CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
300
 
    CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
301
 
    CXXFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CXXFLAGS"
302
 
 
303
 
    dnl Add -llog by default, since we use it all over the place.
304
 
    dnl Add --allow-shlib-undefined, because libGLESv2 links to an
305
 
    dnl undefined symbol (present on the hardware, just not in the
306
 
    dnl NDK.)
307
 
    LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"
308
 
 
309
 
    dnl prevent cross compile section from using these flags as host flags
310
 
    if test -z "$HOST_CPPFLAGS" ; then
311
 
        HOST_CPPFLAGS=" "
312
 
    fi
313
 
    if test -z "$HOST_CFLAGS" ; then
314
 
        HOST_CFLAGS=" "
315
 
    fi
316
 
    if test -z "$HOST_CXXFLAGS" ; then
317
 
        HOST_CXXFLAGS=" "
318
 
    fi
319
 
    if test -z "$HOST_LDFLAGS" ; then
320
 
        HOST_LDFLAGS=" "
321
 
    fi
322
 
 
323
 
    ANDROID_NDK="${android_ndk}"
324
 
    ANDROID_TOOLCHAIN="{android_toolchain}"
325
 
    ANDROID_PLATFORM="{android_platform}"
326
 
    ANDROID_SDK="${android_sdk}"
327
 
    ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
328
 
    ANDROID_VERSION="${android_version}"
329
 
    if test -z "$ANDROID_PACKAGE_NAME" ; then
330
 
        ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)'
331
 
    fi
332
 
 
333
 
    AC_DEFINE(ANDROID)
334
 
    AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version)
335
 
    AC_SUBST(ANDROID_VERSION)
336
 
    CROSS_COMPILE=1
337
 
    MOZ_CHROME_FILE_FORMAT=omni
338
 
    ZLIB_DIR=yes
339
 
fi
340
 
 
341
 
AC_SUBST(ANDROID_NDK)
342
 
AC_SUBST(ANDROID_TOOLCHAIN)
343
 
AC_SUBST(ANDROID_PLATFORM)
344
 
AC_SUBST(ANDROID_SDK)
345
 
AC_SUBST(ANDROID_PLATFORM_TOOLS)
346
 
AC_SUBST(ANDROID_PACKAGE_NAME)
347
 
 
348
 
dnl ========================================================
349
 
dnl Checks for compilers.
350
 
dnl ========================================================
351
 
dnl Set CROSS_COMPILE in the environment when running configure
352
 
dnl to use the cross-compile setup for now
353
 
dnl ========================================================
354
 
 
355
 
dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
356
 
AR_FLAGS='cr $@'
357
 
 
358
 
if test "$COMPILE_ENVIRONMENT"; then
359
 
 
360
 
dnl Do some special WinCE toolchain stuff
361
 
case "$target" in
362
 
*wince|*winmo)
363
 
 
364
 
    MOZ_ARG_WITH_STRING(wince-sdk,
365
 
    [  --with-wince-sdk=WINCE_SDK_DIR
366
 
                          The path to the Windows CE SDK],
367
 
    WINCE_SDK_DIR=$withval)
368
 
 
369
 
    MOZ_ARG_WITH_STRING(ogles-sdk,
370
 
    [  --with-ogles-sdk=OGLES_SDK_DIR
371
 
                          The path to the OGLES SDK],
372
 
    OGLES_SDK_DIR=$withval)
373
 
 
374
 
    AC_DEFINE(WINCE)
375
 
    
376
 
    export WINCE=1
377
 
 
378
 
    echo -----------------------------------------------------------------------------
379
 
    echo Building Windows CE Shunt Library and Tool Chain
380
 
    echo Using SDK in:
381
 
    echo $WINCE_SDK_DIR
382
 
 
383
 
    ac_exeext=.exe
384
 
 
385
 
    _pwd=`pwd -W`
386
 
    _topsrcdirwin=`cd \`dirname $0\`; pwd -W`
387
 
    make OGLES_SDK_DIR="$OGLES_SDK_DIR" WINCE_SDK_DIR="$WINCE_SDK_DIR" \
388
 
    TOPSRCDIR="$_topsrcdirwin" OBJDIR="$_pwd" target="$target" \
389
 
    -C $srcdir/build/wince/tools
390
 
 
391
 
    CC="$_pwd/dist/sdk/bin/$target-gcc.exe"
392
 
    CXX="$_pwd/dist/sdk/bin/$target-gcc.exe"
393
 
    CPP="$_pwd/dist/sdk/bin/$target-gcc.exe -E -nologo"
394
 
    CXXCPP="$_pwd/dist/sdk/bin/$target-gcc.exe -TP -E -nologo"
395
 
    LD="$_pwd/dist/sdk/bin/$target-link.exe"
396
 
    AR="$_pwd/dist/sdk/bin/$target-lib.exe"
397
 
    AS="$_pwd/dist/sdk/bin/$target-as.exe"
398
 
    RC="$_pwd/dist/sdk/bin/$target-res.exe"
399
 
 
400
 
 
401
 
    echo -----------------------------------------------------------------------------
402
 
 
403
 
    ;;
404
 
esac
405
 
 
406
 
if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then
407
 
    echo "cross compiling from $host to $target"
408
 
    cross_compiling=yes
409
 
 
410
 
    _SAVE_CC="$CC"
411
 
    _SAVE_CFLAGS="$CFLAGS"
412
 
    _SAVE_LDFLAGS="$LDFLAGS"
413
 
 
414
 
    AC_MSG_CHECKING([for host c compiler])
415
 
    AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
416
 
    if test -z "$HOST_CC"; then
417
 
        AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
418
 
    fi
419
 
    AC_MSG_RESULT([$HOST_CC])
420
 
    AC_MSG_CHECKING([for host c++ compiler])
421
 
    AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
422
 
    if test -z "$HOST_CXX"; then
423
 
        AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
424
 
    fi
425
 
    AC_MSG_RESULT([$HOST_CXX])
426
 
 
427
 
    if test -z "$HOST_CFLAGS"; then
428
 
        HOST_CFLAGS="$CFLAGS"
429
 
    fi
430
 
    if test -z "$HOST_CXXFLAGS"; then
431
 
        HOST_CXXFLAGS="$CXXFLAGS"
432
 
    fi
433
 
    if test -z "$HOST_LDFLAGS"; then
434
 
        HOST_LDFLAGS="$LDFLAGS"
435
 
    fi
436
 
    if test -z "$HOST_AR_FLAGS"; then
437
 
        HOST_AR_FLAGS="$AR_FLAGS"
438
 
    fi
439
 
    AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
440
 
    AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
441
 
    CC="$HOST_CC"
442
 
    CFLAGS="$HOST_CFLAGS"
443
 
    LDFLAGS="$HOST_LDFLAGS"
444
 
 
445
 
    AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
446
 
    AC_TRY_COMPILE([], [return(0);], 
447
 
        [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
448
 
        AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
449
 
 
450
 
    CC="$HOST_CXX"
451
 
    CFLAGS="$HOST_CXXFLAGS"
452
 
 
453
 
    AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
454
 
    AC_TRY_COMPILE([], [return(0);], 
455
 
        [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
456
 
        AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
457
 
    
458
 
    CC=$_SAVE_CC
459
 
    CFLAGS=$_SAVE_CFLAGS
460
 
    LDFLAGS=$_SAVE_LDFLAGS
461
 
 
462
 
    case "$build:$target" in
463
 
      powerpc-apple-darwin8*:i?86-apple-darwin*)
464
 
        dnl The Darwin cross compiler doesn't necessarily point itself at a
465
 
        dnl root that has libraries for the proper architecture, it defaults
466
 
        dnl to the system root.  The libraries in the system root on current
467
 
        dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
468
 
        dnl checks will fail.  Fake a working SDK in that case.
469
 
        _SAVE_CFLAGS=$CFLAGS
470
 
        _SAVE_CXXFLAGS=$CXXLAGS
471
 
        CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk $CFLAGS"
472
 
        CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk $CXXFLAGS"
473
 
        ;;
474
 
    esac
475
 
 
476
 
    AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
477
 
    unset ac_cv_prog_CC
478
 
    AC_PROG_CC
479
 
    AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
480
 
    unset ac_cv_prog_CXX
481
 
    AC_PROG_CXX
482
 
 
483
 
    case "$build:$target" in
484
 
      powerpc-apple-darwin8*:i?86-apple-darwin*)
485
 
        dnl Revert the changes made above.  From this point on, the target
486
 
        dnl compiler will never be used without applying the SDK to CFLAGS
487
 
        dnl (see --with-macos-sdk below).
488
 
        CFLAGS=$_SAVE_CFLAGS
489
 
        CXXFLAGS=$_SAVE_CXXFLAGS
490
 
        ;;
491
 
    esac
492
 
 
493
 
    AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
494
 
    AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
495
 
    MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
496
 
    AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
497
 
    AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
498
 
    AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
499
 
    AC_DEFINE(CROSS_COMPILE)
500
 
else
501
 
    AC_PROG_CC
502
 
    AC_PROG_CXX
503
 
    AC_PROG_RANLIB
504
 
    MOZ_PATH_PROGS(AS, $AS as, $CC)
505
 
    AC_CHECK_PROGS(AR, ar, :)
506
 
    AC_CHECK_PROGS(LD, ld, :)
507
 
    AC_CHECK_PROGS(STRIP, strip, :)
508
 
    AC_CHECK_PROGS(WINDRES, windres, :)
509
 
    if test -z "$HOST_CC"; then
510
 
        HOST_CC='$(CC)'
511
 
    fi
512
 
    if test -z "$HOST_CFLAGS"; then
513
 
        HOST_CFLAGS='$(CFLAGS)'
514
 
    fi
515
 
    if test -z "$HOST_CXX"; then
516
 
        HOST_CXX='$(CXX)'
517
 
    fi
518
 
    if test -z "$HOST_CXXFLAGS"; then
519
 
        HOST_CXXFLAGS='$(CXXFLAGS)'
520
 
    fi
521
 
    if test -z "$HOST_LDFLAGS"; then
522
 
        HOST_LDFLAGS='$(LDFLAGS)'
523
 
    fi
524
 
    if test -z "$HOST_RANLIB"; then
525
 
        HOST_RANLIB='$(RANLIB)'
526
 
    fi
527
 
    if test -z "$HOST_AR"; then
528
 
        HOST_AR='$(AR)'
529
 
    fi
530
 
    if test -z "$HOST_AR_FLAGS"; then
531
 
        HOST_AR_FLAGS='$(AR_FLAGS)'
532
 
    fi
533
 
fi
534
 
 
535
 
GNU_AS=
536
 
GNU_LD=
537
 
GNU_CC=
538
 
GNU_CXX=
539
 
CC_VERSION='N/A'
540
 
CXX_VERSION='N/A'
541
 
if test "$GCC" = "yes"; then
542
 
    GNU_CC=1
543
 
    CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
544
 
fi
545
 
if test "$GXX" = "yes"; then
546
 
    GNU_CXX=1
547
 
    CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
548
 
fi
549
 
if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
550
 
    GNU_AS=1
551
 
fi
552
 
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
553
 
    GNU_LD=1
554
 
fi
555
 
if test "$GNU_CC"; then
556
 
    if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
557
 
        GCC_USE_GNU_LD=1
558
 
    fi
559
 
fi
560
 
 
561
 
INTEL_CC=
562
 
INTEL_CXX=
563
 
if test "$GCC" = yes; then
564
 
   if test "`$CC -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
565
 
     INTEL_CC=1
566
 
   fi
567
 
fi
568
 
 
569
 
if test "$GXX" = yes; then
570
 
   if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
571
 
     INTEL_CXX=1
572
 
   fi
573
 
fi
574
 
 
575
 
dnl Special win32 checks
576
 
dnl ========================================================
577
 
case "$target" in
578
 
*-wince|*-winmo)
579
 
    WINVER=500
580
 
    WINSDK_TARGETVER=502
581
 
    ;;
582
 
*)
583
 
    WINVER=502
584
 
    dnl Target the Windows 7 SDK by default
585
 
    WINSDK_TARGETVER=601
586
 
    ;;
587
 
esac
588
 
 
589
 
MOZ_ARG_WITH_STRING(windows-version,
590
 
[  --with-windows-version=WINSDK_TARGETVER
591
 
                          Highest Windows version to target using this SDK
592
 
                              502: Windows Server 2003
593
 
                              600: Windows Vista
594
 
                              601: Windows 7],
595
 
  WINSDK_TARGETVER=$withval)
596
 
 
597
 
case "$WINSDK_TARGETVER" in
598
 
502|600|601)
599
 
    MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
600
 
    ;;
601
 
 
602
 
*)
603
 
    AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
604
 
    ;;
605
 
 
606
 
esac
607
 
 
608
 
if test -n "$COMPILE_ENVIRONMENT"; then
609
 
if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
610
 
    # We can't build parental controls either
611
 
    MOZ_DISABLE_PARENTAL_CONTROLS=1
612
 
fi
613
 
fi
614
 
 
615
 
case "$target" in
616
 
*-mingw*|*-wince|*-winmo)
617
 
    if test "$GCC" != "yes"; then
618
 
        # Check to see if we are really running in a msvc environemnt
619
 
        _WIN32_MSVC=1
620
 
        AC_CHECK_PROGS(MIDL, midl)
621
 
 
622
 
        # Make sure compilers are valid
623
 
        CFLAGS="$CFLAGS -TC -nologo"
624
 
        CXXFLAGS="$CXXFLAGS -TP -nologo"
625
 
        AC_LANG_SAVE
626
 
        AC_LANG_C
627
 
        AC_TRY_COMPILE([#include <stdio.h>],
628
 
            [ printf("Hello World\n"); ],,
629
 
            AC_MSG_ERROR([\$(CC) test failed.  You must have MS VC++ in your path to build.]) )
630
 
 
631
 
        AC_LANG_CPLUSPLUS
632
 
        AC_TRY_COMPILE([#include <new.h>],
633
 
            [ unsigned *test = new unsigned(42); ],,
634
 
            AC_MSG_ERROR([\$(CXX) test failed.  You must have MS VC++ in your path to build.]) )
635
 
        AC_LANG_RESTORE
636
 
        
637
 
        changequote(,)
638
 
        _MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
639
 
        changequote([,])
640
 
        
641
 
        # Determine compiler version
642
 
        CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
643
 
        _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
644
 
        _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
645
 
        _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
646
 
        _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
647
 
        _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
648
 
 
649
 
        CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
650
 
        _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
651
 
 
652
 
        if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
653
 
            AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
654
 
        fi
655
 
 
656
 
        if test "$_CC_MAJOR_VERSION" = "14"; then
657
 
            dnl Require VC8SP1 or newer.
658
 
            dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762.
659
 
            if test "$_CC_RELEASE" -lt 50727 -o \
660
 
                    \( "$_CC_RELEASE" -eq 50727 -a "$_CC_BUILD" -lt 762 \); then
661
 
              AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. You probably need to install Service Pack 1 of Visual Studio 2005. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
662
 
            fi
663
 
 
664
 
            _CC_SUITE=8
665
 
            CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
666
 
            AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
667
 
            AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
668
 
        elif test "$_CC_MAJOR_VERSION" = "15"; then
669
 
            _CC_SUITE=9
670
 
            CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
671
 
            AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
672
 
            AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
673
 
        elif test "$_CC_MAJOR_VERSION" = "16"; then
674
 
            _CC_SUITE=10
675
 
            CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
676
 
            AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
677
 
            AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
678
 
        else
679
 
            AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
680
 
        fi
681
 
 
682
 
        _MOZ_RTTI_FLAGS_ON='-GR'
683
 
        _MOZ_RTTI_FLAGS_OFF='-GR-'
684
 
        _MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
685
 
        _MOZ_EXCEPTIONS_FLAGS_OFF=''
686
 
        AC_DEFINE(HAVE_SEH_EXCEPTIONS)
687
 
 
688
 
        if test -n "$WIN32_REDIST_DIR"; then
689
 
            WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
690
 
        fi
691
 
 
692
 
        dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
693
 
        dnl not something else like "magnetic tape manipulation utility".
694
 
        MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
695
 
        if test -z "$MSMT_TOOL"; then
696
 
          AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
697
 
        fi
698
 
 
699
 
        changequote(,)
700
 
        _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
701
 
        changequote([,])
702
 
        MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
703
 
        if test -z "$MSMANIFEST_TOOL_VERSION"; then
704
 
          AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
705
 
        fi
706
 
 
707
 
        MSMANIFEST_TOOL=1
708
 
        unset MSMT_TOOL
709
 
 
710
 
        # Check linker version
711
 
        _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
712
 
        _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
713
 
        if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
714
 
            AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION,  does not match the compiler suite version, $_CC_SUITE.])
715
 
        fi
716
 
 
717
 
        INCREMENTAL_LINKER=1
718
 
 
719
 
        # Check midl version
720
 
        _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
721
 
        _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
722
 
        _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
723
 
        _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
724
 
        # Add flags if necessary
725
 
        AC_MSG_CHECKING([for midl flags])
726
 
        case "$target" in
727
 
        i*86-*)
728
 
            if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
729
 
                # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
730
 
                # MIDL version 7.00.0500 or later has no problem.
731
 
                MIDL_FLAGS="${MIDL_FLAGS} -env win32"
732
 
                AC_MSG_RESULT([need -env win32])
733
 
            else
734
 
                AC_MSG_RESULT([none needed])
735
 
            fi
736
 
            ;;
737
 
        x86_64-*)
738
 
            MIDL_FLAGS="${MIDL_FLAGS} -env x64"
739
 
            ;;
740
 
        *)
741
 
            AC_MSG_RESULT([none needed])
742
 
            ;;
743
 
        esac
744
 
 
745
 
        # Identify which version of the SDK we're building with
746
 
        # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
747
 
        # from there
748
 
        MOZ_CHECK_HEADERS([winsdkver.h])
749
 
        if test "$ac_cv_header_winsdkver_h" = "yes"; then
750
 
            # Get the highest _WIN32_WINNT and NTDDI versions supported
751
 
            # Take the higher of the two
752
 
            # This is done because the Windows 7 beta SDK reports its
753
 
            # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
754
 
            AC_CACHE_CHECK(for highest Windows version supported by this SDK,
755
 
                           ac_cv_winsdk_maxver,
756
 
                           [cat > conftest.h <<EOF
757
 
#include <winsdkver.h>
758
 
#include <sdkddkver.h>
759
 
 
760
 
#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
761
 
#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
762
 
#else
763
 
#define WINSDK_MAXVER NTDDI_MAXVER
764
 
#endif
765
 
 
766
 
WINSDK_MAXVER
767
 
EOF
768
 
                            ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
769
 
                            rm -f conftest.h
770
 
                           ])
771
 
            MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
772
 
        else
773
 
            # The Vista SDK is the only one to have sdkddkver.h but not
774
 
            # WinSDKVer.h
775
 
            MOZ_CHECK_HEADERS([sdkddkver.h])
776
 
            if test "$ac_cv_header_sdkddkver_h" = "yes"; then
777
 
                MOZ_WINSDK_MAXVER=0x06000000
778
 
            else
779
 
                # Assume the Server 2003 Platform SDK
780
 
                MOZ_WINSDK_MAXVER=0x05020000
781
 
            fi
782
 
        fi
783
 
 
784
 
        unset _MSVC_VER_FILTER
785
 
 
786
 
        AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw,
787
 
            [
788
 
                AC_LANG_SAVE
789
 
                AC_LANG_CPLUSPLUS
790
 
                _SAVE_CXXFLAGS="$CXXFLAGS"
791
 
                CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
792
 
                AC_TRY_COMPILE([#include <exception>],
793
 
                            [std::_Throw(std::exception()); return 0;],
794
 
                            ac_cv_have_std__Throw="yes",
795
 
                            ac_cv_have_std__Throw="no")
796
 
                CXXFLAGS="$_SAVE_CXXFLAGS"
797
 
                AC_LANG_RESTORE
798
 
            ])
799
 
 
800
 
        if test "$ac_cv_have_std__Throw" = "yes"; then
801
 
            AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug,
802
 
                           ac_cv_have_dllimport_exception_bug,
803
 
                [
804
 
                    AC_LANG_SAVE
805
 
                    AC_LANG_CPLUSPLUS
806
 
                    _SAVE_CXXFLAGS="$CXXFLAGS"
807
 
                    CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
808
 
                    AC_TRY_LINK([#include <vector>],
809
 
                                [std::vector<int> v; return v.at(1);],
810
 
                                ac_cv_have_dllimport_exception_bug="no",
811
 
                                ac_cv_have_dllimport_exception_bug="yes")
812
 
                    CXXFLAGS="$_SAVE_CXXFLAGS"
813
 
                    AC_LANG_RESTORE
814
 
                ])
815
 
            if test "$ac_cv_have_dllimport_exception_bug" = "no"; then
816
 
                WRAP_STL_INCLUDES=1
817
 
                MOZ_MSVC_STL_WRAP__Throw=1
818
 
                AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw)
819
 
            fi
820
 
        else
821
 
            AC_CACHE_CHECK(for overridable _RAISE,
822
 
                           ac_cv_have__RAISE,
823
 
                [
824
 
                    AC_LANG_SAVE
825
 
                    AC_LANG_CPLUSPLUS
826
 
                    _SAVE_CXXFLAGS="$CXXFLAGS"
827
 
                    CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
828
 
                    AC_TRY_COMPILE([#include <xstddef>
829
 
                                    #undef _RAISE
830
 
                                    #define _RAISE(x) externallyDefinedFunction((x).what())
831
 
                                    #include <vector>
832
 
                                   ],
833
 
                                   [std::vector<int> v; return v.at(1);],
834
 
                                   ac_cv_have__RAISE="no",
835
 
                                   ac_cv_have__RAISE="yes")
836
 
                    CXXFLAGS="$_SAVE_CXXFLAGS"
837
 
                    AC_LANG_RESTORE
838
 
                ])
839
 
            if test "$ac_cv_have__RAISE" = "yes"; then
840
 
                WRAP_STL_INCLUDES=1
841
 
                MOZ_MSVC_STL_WRAP__RAISE=1
842
 
                AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE)
843
 
            else
844
 
                AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK.  Please file a bug describing this error and your build configuration.])
845
 
            fi
846
 
        fi
847
 
 
848
 
        if test "$WRAP_STL_INCLUDES" = "1"; then
849
 
            STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers'
850
 
        fi
851
 
    else
852
 
        # Check w32api version
853
 
        _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
854
 
        _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
855
 
        AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
856
 
        AC_TRY_COMPILE([#include <w32api.h>],
857
 
            #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
858
 
                (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
859
 
                 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
860
 
                #error "test failed."
861
 
            #endif
862
 
            , [ res=yes ], [ res=no ])
863
 
        AC_MSG_RESULT([$res])
864
 
        if test "$res" != "yes"; then
865
 
            AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
866
 
        fi
867
 
        # Check windres version
868
 
        AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
869
 
        _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
870
 
        AC_MSG_RESULT([$_WINDRES_VERSION])
871
 
        _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
872
 
        _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
873
 
        _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
874
 
        WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
875
 
        WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
876
 
        WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
877
 
        if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
878
 
                "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
879
 
                "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
880
 
                "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
881
 
                "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
882
 
                "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
883
 
        then
884
 
            AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
885
 
        fi
886
 
 
887
 
        # Server 2003 is the highest version supported
888
 
        MOZ_WINSDK_MAXVER=0x05020000
889
 
    fi # !GNU_CC
890
 
 
891
 
    AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
892
 
    AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
893
 
    # Require OS features provided by IE 5.0
894
 
    AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
895
 
 
896
 
    # If the maximum version supported by this SDK is lower than the target
897
 
    # version, error out
898
 
    AC_MSG_CHECKING([for Windows SDK being recent enough])
899
 
    if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
900
 
        AC_MSG_RESULT("yes")
901
 
    else
902
 
        AC_MSG_RESULT("no")
903
 
        AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. Alternatively, try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
904
 
    fi
905
 
 
906
 
    AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
907
 
    # Definitions matching sdkddkver.h
908
 
    AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
909
 
    AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
910
 
    AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
911
 
    ;;
912
 
esac
913
 
 
914
 
dnl Test breaks icc on OS/2 && MSVC
915
 
if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
916
 
    AC_PROG_CC_C_O
917
 
    if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
918
 
        USING_HCC=1
919
 
        _OLDCC=$CC
920
 
        _OLDCXX=$CXX
921
 
        CC="${srcdir}/build/hcc '$CC'"
922
 
        CXX="${srcdir}/build/hcpp '$CXX'"
923
 
    fi
924
 
fi
925
 
 
926
 
AC_PROG_CPP
927
 
AC_PROG_CXXCPP
928
 
 
929
 
if test -n "$_WIN32_MSVC"; then
930
 
    SKIP_PATH_CHECKS=1
931
 
    SKIP_COMPILER_CHECKS=1
932
 
    SKIP_LIBRARY_CHECKS=1
933
 
 
934
 
    # Since we're skipping compiler and library checks, hard-code
935
 
    # some facts here.
936
 
    case "$target" in
937
 
    *-wince|*-winmo)
938
 
        ;;
939
 
    *)
940
 
        AC_DEFINE(HAVE_IO_H)
941
 
        AC_DEFINE(HAVE_SETBUF)
942
 
        AC_DEFINE(HAVE_ISATTY)
943
 
        ;;
944
 
    esac
945
 
fi
946
 
 
947
 
fi # COMPILE_ENVIRONMENT
948
 
 
949
 
AC_SUBST(MIDL_FLAGS)
950
 
AC_SUBST(_MSC_VER)
951
 
 
952
 
AC_SUBST(GNU_AS)
953
 
AC_SUBST(GNU_LD)
954
 
AC_SUBST(GNU_CC)
955
 
AC_SUBST(GNU_CXX)
956
 
AC_SUBST(INTEL_CC)
957
 
AC_SUBST(INTEL_CXX)
958
 
 
959
 
AC_SUBST(STL_FLAGS)
960
 
AC_SUBST(WRAP_STL_INCLUDES)
961
 
AC_SUBST(MOZ_MSVC_STL_WRAP__Throw)
962
 
AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE)
963
 
 
964
 
dnl ========================================================
965
 
dnl Checks for programs.
966
 
dnl ========================================================
967
 
AC_PROG_INSTALL
968
 
AC_PROG_LN_S
969
 
 
970
 
if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
971
 
AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
972
 
_perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
973
 
_perl_res=$?
974
 
AC_MSG_RESULT([$_perl_version])
975
 
 
976
 
if test "$_perl_res" != 0; then
977
 
    AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
978
 
fi
979
 
fi
980
 
 
981
 
AC_MSG_CHECKING([for full perl installation])
982
 
_perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
983
 
_perl_res=$?
984
 
if test "$_perl_res" != 0; then
985
 
    AC_MSG_RESULT([no])
986
 
    AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}.  A full perl installation is required.])
987
 
else
988
 
    AC_MSG_RESULT([yes])    
989
 
fi
990
 
 
991
 
MOZ_PATH_PROGS(PYTHON, $PYTHON python2.7 python2.6 python2.5 python)
992
 
if test -z "$PYTHON"; then
993
 
    AC_MSG_ERROR([python was not found in \$PATH])
994
 
fi
995
 
 
996
 
if test -z "$COMPILE_ENVIRONMENT"; then
997
 
    NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
998
 
fi
999
 
AC_SUBST(NSINSTALL_BIN)
1000
 
 
1001
 
MOZ_PATH_PROG(DOXYGEN, doxygen, :)
1002
 
MOZ_PATH_PROG(AUTOCONF, autoconf, :)
1003
 
MOZ_PATH_PROG(UNZIP, unzip, :)
1004
 
MOZ_PATH_PROGS(ZIP, zip)
1005
 
if test -z "$ZIP" -o "$ZIP" = ":"; then
1006
 
    AC_MSG_ERROR([zip not found in \$PATH])
1007
 
fi
1008
 
MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
1009
 
MOZ_PATH_PROG(XARGS, xargs)
1010
 
if test -z "$XARGS" -o "$XARGS" = ":"; then
1011
 
    AC_MSG_ERROR([xargs not found in \$PATH .])
1012
 
fi
1013
 
 
1014
 
MOZ_PATH_PROG(RPMBUILD, rpmbuild, :)
1015
 
AC_SUBST(RPMBUILD)
1016
 
 
1017
 
if test "$COMPILE_ENVIRONMENT"; then
1018
 
 
1019
 
dnl ========================================================
1020
 
dnl = Mac OS X toolchain support
1021
 
dnl ========================================================
1022
 
 
1023
 
case "$target_os" in
1024
 
darwin*)
1025
 
    dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
1026
 
    dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
1027
 
    dnl the environment and includedir purposes (when using an SDK, below),
1028
 
    dnl but remember the full version number for the libdir (SDK).
1029
 
    changequote(,)
1030
 
    GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1031
 
    GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1032
 
    changequote([,])
1033
 
    if test "$GCC_VERSION_FULL" = "4.0.0" ; then
1034
 
        dnl Bug 280479, but this keeps popping up in bug 292530 too because
1035
 
        dnl 4.0.0/4061 is the default compiler in Tiger.
1036
 
        changequote(,)
1037
 
        GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
1038
 
        changequote([,])
1039
 
        if test "$GCC_BUILD" = "4061" ; then
1040
 
            AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
1041
 
This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
1042
 
from building Mozilla. Upgrade to Xcode 2.1 or later.])
1043
 
        fi
1044
 
    fi
1045
 
 
1046
 
    dnl xcodebuild needs GCC_VERSION defined in the environment, since it
1047
 
    dnl doesn't respect the CC/CXX setting.  With GCC_VERSION set, it will use
1048
 
    dnl /usr/bin/g(cc|++)-$GCC_VERSION.
1049
 
    MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
1050
 
 
1051
 
    case "$PBBUILD" in
1052
 
      *xcodebuild*)
1053
 
        changequote(,)
1054
 
        XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
1055
 
        changequote([,])
1056
 
        if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
1057
 
          HAS_XCODE_2_1=1;
1058
 
        fi
1059
 
      ;;
1060
 
    esac
1061
 
 
1062
 
    dnl sdp was formerly in /Developer/Tools.  As of Mac OS X 10.4 (Darwin 8),
1063
 
    dnl it has moved into /usr/bin.
1064
 
    MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
1065
 
    ;;
1066
 
esac
1067
 
 
1068
 
AC_SUBST(GCC_VERSION)
1069
 
AC_SUBST(XCODEBUILD_VERSION)
1070
 
AC_SUBST(HAS_XCODE_2_1)
1071
 
 
1072
 
dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
1073
 
dnl that a universal binary is being produced.
1074
 
AC_SUBST(UNIVERSAL_BINARY)
1075
 
 
1076
 
dnl ========================================================
1077
 
dnl Check for MacOS deployment target version
1078
 
dnl ========================================================
1079
 
 
1080
 
MOZ_ARG_ENABLE_STRING(macos-target,
1081
 
                      [  --enable-macos-target=VER (default=10.5)
1082
 
                          Set the minimum MacOS version needed at runtime],
1083
 
                      [_MACOSX_DEPLOYMENT_TARGET=$enableval])
1084
 
 
1085
 
case "$target" in
1086
 
*-darwin*)
1087
 
    if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1088
 
        dnl Use the specified value
1089
 
        export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1090
 
        AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
1091
 
    else
1092
 
        dnl No value specified on the command line or in the environment,
1093
 
        dnl use architecture minimum.
1094
 
        case "${target_cpu}" in
1095
 
          ppc*)
1096
 
            export MACOSX_DEPLOYMENT_TARGET=10.5
1097
 
            ;;
1098
 
          i*86)
1099
 
            export MACOSX_DEPLOYMENT_TARGET=10.5
1100
 
            ;;
1101
 
          x86_64)
1102
 
            export MACOSX_DEPLOYMENT_TARGET=10.6
1103
 
            ;;
1104
 
        esac
1105
 
    fi
1106
 
    ;;
1107
 
esac
1108
 
 
1109
 
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
1110
 
 
1111
 
dnl ========================================================
1112
 
dnl = Mac OS X SDK support
1113
 
dnl ========================================================
1114
 
MACOS_SDK_DIR=
1115
 
NEXT_ROOT=
1116
 
MOZ_ARG_WITH_STRING(macos-sdk,
1117
 
[  --with-macos-sdk=dir    Location of platform SDK to use (Mac OS X only)],
1118
 
    MACOS_SDK_DIR=$withval)
1119
 
 
1120
 
dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
1121
 
dnl NEXT_ROOT will be set and exported only if it's needed.
1122
 
AC_SUBST(MACOS_SDK_DIR)
1123
 
AC_SUBST(NEXT_ROOT)
1124
 
 
1125
 
if test "$MACOS_SDK_DIR"; then
1126
 
  dnl Sync this section with the ones in NSPR and NSS.
1127
 
  dnl Changes to the cross environment here need to be accounted for in
1128
 
  dnl the libIDL checks (below) and xpidl build.
1129
 
 
1130
 
  if test ! -d "$MACOS_SDK_DIR"; then
1131
 
    AC_MSG_ERROR([SDK not found.  When using --with-macos-sdk, you must
1132
 
specify a valid SDK.  SDKs are installed when the optional cross-development
1133
 
tools are selected during the Xcode/Developer Tools installation.])
1134
 
  fi
1135
 
 
1136
 
  GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1137
 
  if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1138
 
    AC_MSG_ERROR([You need to upgrade the compiler version to 4.x])
1139
 
  else
1140
 
    CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1141
 
    CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
1142
 
 
1143
 
    dnl CPP/CXXCPP needs to be set for MOZ_CHECK_HEADER.
1144
 
    CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1145
 
    CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
1146
 
 
1147
 
    if test "$GCC_VERSION_FULL" = "4.0.0" ; then
1148
 
      dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
1149
 
      dnl that supports -syslibroot.  Don't set NEXT_ROOT because it will
1150
 
      dnl be ignored and cause warnings when -syslibroot is specified.
1151
 
      dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
1152
 
      dnl the -isysroot it receives, so this is only needed with 4.0.0.
1153
 
      LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1154
 
    fi
1155
 
  fi
1156
 
 
1157
 
  AC_LANG_SAVE
1158
 
  AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
1159
 
  AC_LANG_CPLUSPLUS
1160
 
  AC_TRY_COMPILE([#include <new>],[],
1161
 
   result=yes,
1162
 
   result=no)
1163
 
  AC_LANG_RESTORE
1164
 
  AC_MSG_RESULT($result)
1165
 
 
1166
 
  if test "$result" = "no" ; then
1167
 
    AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
1168
 
  fi
1169
 
fi
1170
 
 
1171
 
fi # COMPILE_ENVIRONMENT
1172
 
 
1173
 
dnl clang prior to 2.9 (including Xcode 4) does not support all the
1174
 
dnl constructs required by the libtheora inline asm. This is used to
1175
 
dnl detect and disable it
1176
 
AC_LANG_SAVE
1177
 
AC_LANG_C
1178
 
AC_TRY_COMPILE([
1179
 
#if defined(__clang__)
1180
 
# if __clang_major__<2 || (__clang_major__==2 && __clang_minor__<9)
1181
 
#  error "clang older than 2.9 detected"
1182
 
# endif
1183
 
#endif
1184
 
               ],
1185
 
               [],
1186
 
               result="yes",
1187
 
               result="no")
1188
 
if test "$result" = "no"; then
1189
 
    AC_DEFINE(HAVE_OLD_CLANG)
1190
 
    HAVE_OLD_CLANG=1
1191
 
fi
1192
 
AC_LANG_RESTORE
1193
 
AC_SUBST(HAVE_OLD_CLANG)
1194
 
 
1195
 
if test -n "$MAKE"; then
1196
 
  if test `echo $MAKE | grep -c make.py` != 1; then
1197
 
     NOT_PYMAKE=$MAKE
1198
 
  fi
1199
 
fi
1200
 
 
1201
 
case "$host_os" in
1202
 
mingw*)
1203
 
    MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
1204
 
    ;;
1205
 
*)
1206
 
    MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
1207
 
    ;;
1208
 
esac
1209
 
if test "$GMAKE" = ":"; then
1210
 
   AC_MSG_ERROR([GNU make not found])
1211
 
fi
1212
 
AC_SUBST(GMAKE)
1213
 
 
1214
 
if test "$COMPILE_ENVIRONMENT"; then
1215
 
 
1216
 
AC_PATH_XTRA
1217
 
 
1218
 
XCFLAGS="$X_CFLAGS"
1219
 
 
1220
 
fi # COMPILE_ENVIRONMENT
1221
 
 
1222
 
dnl ========================================================
1223
 
dnl set the defaults first
1224
 
dnl ========================================================
1225
 
AS_BIN=$AS
1226
 
AR_LIST='$(AR) t'
1227
 
AR_EXTRACT='$(AR) x'
1228
 
AR_DELETE='$(AR) d'
1229
 
AS='$(CC)'
1230
 
AS_DASH_C_FLAG='-c'
1231
 
DLL_PREFIX=lib
1232
 
LIB_PREFIX=lib
1233
 
DLL_SUFFIX=.so
1234
 
OBJ_SUFFIX=o
1235
 
LIB_SUFFIX=a
1236
 
ASM_SUFFIX=s
1237
 
IMPORT_LIB_SUFFIX=
1238
 
TARGET_MD_ARCH=unix
1239
 
DIRENT_INO=d_ino
1240
 
WIN_TOP_SRC=
1241
 
MOZ_USER_DIR=".mozilla"
1242
 
 
1243
 
MOZ_JPEG_CFLAGS=
1244
 
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
1245
 
MOZ_ZLIB_CFLAGS=
1246
 
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
1247
 
MOZ_BZ2_CFLAGS=
1248
 
MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1249
 
MOZ_PNG_CFLAGS=
1250
 
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
1251
 
 
1252
 
MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
1253
 
MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
1254
 
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core -lmozalloc'
1255
 
MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1256
 
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom -lmozalloc'
1257
 
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1258
 
XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1259
 
XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1260
 
 
1261
 
MOZ_FS_LAYOUT=unix
1262
 
 
1263
 
MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1264
 
 
1265
 
USE_DEPENDENT_LIBS=1
1266
 
 
1267
 
_PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1268
 
 
1269
 
if test -n "$CROSS_COMPILE"; then
1270
 
    OS_TARGET="${target_os}"
1271
 
    OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1272
 
    OS_RELEASE=
1273
 
    case "${target_os}" in
1274
 
        linux*)       OS_ARCH=Linux OS_TARGET=Linux ;;
1275
 
        kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1276
 
        gnu*)         OS_ARCH=GNU ;;
1277
 
        solaris*)     OS_ARCH=SunOS OS_RELEASE=5 ;;
1278
 
        mingw*)       OS_ARCH=WINNT ;;
1279
 
        wince*)       OS_ARCH=WINCE ;;
1280
 
        winmo*)       OS_ARCH=WINCE ;;
1281
 
        darwin*)      OS_ARCH=Darwin OS_TARGET=Darwin ;;
1282
 
    esac
1283
 
    case "${target}" in
1284
 
        arm-android-eabi) OS_ARCH=Linux OS_TARGET=Android ;;
1285
 
    esac
1286
 
else
1287
 
    OS_TARGET=`uname -s`
1288
 
    OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1289
 
    OS_RELEASE=`uname -r`
1290
 
fi
1291
 
 
1292
 
# Before this used `uname -m` when not cross compiling
1293
 
# but that breaks when you have a 64 bit kernel with a 32 bit userland.
1294
 
OS_TEST="${target_cpu}"
1295
 
 
1296
 
_COMPILER_PREFIX=
1297
 
 
1298
 
HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1299
 
 
1300
 
#######################################################################
1301
 
# Master "Core Components" macros for getting the OS target           #
1302
 
#######################################################################
1303
 
 
1304
 
#
1305
 
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1306
 
# cross-compilation.
1307
 
#
1308
 
 
1309
 
#
1310
 
# Define and override various archtecture-specific variables, including
1311
 
# HOST_OS_ARCH
1312
 
# OS_ARCH
1313
 
# OS_TEST
1314
 
# OS_TARGET
1315
 
# OS_RELEASE
1316
 
# OS_MINOR_RELEASE
1317
 
#
1318
 
 
1319
 
case "$HOST_OS_ARCH" in
1320
 
mingw*)
1321
 
    HOST_OS_ARCH=WINNT
1322
 
    ;;
1323
 
darwin*)
1324
 
    HOST_OS_ARCH=Darwin
1325
 
    ;;
1326
 
linux*)
1327
 
    HOST_OS_ARCH=Linux
1328
 
    ;;
1329
 
solaris*)
1330
 
    HOST_OS_ARCH=SunOS
1331
 
    SOLARIS_SUNPRO_CC=
1332
 
    SOLARIS_SUNPRO_CXX=
1333
 
    if test -z "$GNU_CC"; then
1334
 
        if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1335
 
            SOLARIS_SUNPRO_CC=1
1336
 
       fi
1337
 
    fi
1338
 
 
1339
 
    if test -z "$GNU_CXX"; then
1340
 
       if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1341
 
           SOLARIS_SUNPRO_CXX=1
1342
 
       fi
1343
 
    fi
1344
 
    AC_SUBST(SOLARIS_SUNPRO_CC)
1345
 
    AC_SUBST(SOLARIS_SUNPRO_CXX)
1346
 
    ;;
1347
 
BSD_386)
1348
 
    HOST_OS_ARCH=BSD
1349
 
    ;;
1350
 
dgux)
1351
 
    HOST_OS_ARCH=DGUX
1352
 
    ;;
1353
 
IRIX64)
1354
 
    HOST_OS_ARCH=IRIX
1355
 
    ;;
1356
 
UNIX_SV)
1357
 
    if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1358
 
        HOST_OS_ARCH=NCR
1359
 
    else
1360
 
        HOST_OS_ARCH=UNIXWARE
1361
 
    fi
1362
 
    ;;
1363
 
ncr)
1364
 
    HOST_OS_ARCH=NCR
1365
 
    ;;
1366
 
UNIX_SYSTEM_V)
1367
 
    HOST_OS_ARCH=NEC
1368
 
    ;;
1369
 
OSF1)
1370
 
    ;;
1371
 
OS_2)
1372
 
    HOST_OS_ARCH=OS2
1373
 
    ;;
1374
 
QNX)
1375
 
    ;;
1376
 
SCO_SV)
1377
 
    HOST_OS_ARCH=SCOOS
1378
 
    ;;
1379
 
SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1380
 
    HOST_OS_ARCH=SINIX
1381
 
    ;;
1382
 
UnixWare)
1383
 
    HOST_OS_ARCH=UNIXWARE
1384
 
    ;;
1385
 
esac
1386
 
 
1387
 
case "$OS_ARCH" in
1388
 
WINNT)
1389
 
    if test -z "$CROSS_COMPILE" ; then
1390
 
        OS_TEST=`uname -p`
1391
 
    fi
1392
 
    ;;
1393
 
Windows_NT)
1394
 
#
1395
 
# If uname -s returns "Windows_NT", we assume that we are using
1396
 
# the uname.exe in MKS toolkit.
1397
 
#
1398
 
# The -r option of MKS uname only returns the major version number.
1399
 
# So we need to use its -v option to get the minor version number.
1400
 
# Moreover, it doesn't have the -p option, so we need to use uname -m.
1401
 
#
1402
 
    OS_ARCH=WINNT
1403
 
    OS_TARGET=WINNT
1404
 
    OS_MINOR_RELEASE=`uname -v`
1405
 
    if test "$OS_MINOR_RELEASE" = "00"; then
1406
 
        OS_MINOR_RELEASE=0
1407
 
    fi
1408
 
    OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1409
 
    ;;
1410
 
MINGW*_NT*)
1411
 
#
1412
 
# If uname -s returns MINGW32_NT-5.1, we assume that we are using
1413
 
# the uname.exe in the MSYS tools.
1414
 
#
1415
 
    OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1416
 
    OS_ARCH=WINNT
1417
 
    OS_TARGET=WINNT
1418
 
    ;;
1419
 
AIX)
1420
 
    OS_RELEASE=`uname -v`.`uname -r`
1421
 
    OS_TEST=${target_cpu}
1422
 
    ;;
1423
 
BSD_386)
1424
 
    OS_ARCH=BSD
1425
 
    ;;
1426
 
dgux)
1427
 
    OS_ARCH=DGUX
1428
 
    ;;
1429
 
IRIX64)
1430
 
    OS_ARCH=IRIX
1431
 
    ;;
1432
 
UNIX_SV)
1433
 
    if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1434
 
        OS_ARCH=NCR
1435
 
    else
1436
 
        OS_ARCH=UNIXWARE
1437
 
        OS_RELEASE=`uname -v`
1438
 
    fi
1439
 
    ;;
1440
 
ncr)
1441
 
    OS_ARCH=NCR
1442
 
    ;;
1443
 
UNIX_SYSTEM_V)
1444
 
    OS_ARCH=NEC
1445
 
    ;;
1446
 
OSF1)
1447
 
    case `uname -v` in
1448
 
    148)
1449
 
        OS_RELEASE=V3.2C
1450
 
        ;;
1451
 
    564)
1452
 
        OS_RELEASE=V4.0B
1453
 
        ;;
1454
 
    878)
1455
 
        OS_RELEASE=V4.0D
1456
 
        ;;
1457
 
    esac
1458
 
    ;;
1459
 
OS_2)
1460
 
    OS_ARCH=OS2
1461
 
    OS_TARGET=OS2
1462
 
    OS_RELEASE=`uname -v`
1463
 
    ;;
1464
 
QNX)
1465
 
    if test "$OS_TARGET" != "NTO"; then
1466
 
        changequote(,)
1467
 
        OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1468
 
        changequote([,])
1469
 
    fi
1470
 
    OS_TEST=x86
1471
 
    ;;
1472
 
SCO_SV)
1473
 
    OS_ARCH=SCOOS
1474
 
    OS_RELEASE=5.0
1475
 
    ;;
1476
 
SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1477
 
    OS_ARCH=SINIX
1478
 
    OS_TEST=`uname -p`
1479
 
    ;;
1480
 
UnixWare)
1481
 
    OS_ARCH=UNIXWARE
1482
 
    OS_RELEASE=`uname -v`
1483
 
    ;;
1484
 
WINCE)
1485
 
    OS_ARCH=WINCE
1486
 
    case "${target_os}" in
1487
 
    *winmo)
1488
 
        OS_TARGET=WINMO
1489
 
        WINCE_WINDOWS_MOBILE=1
1490
 
        AC_DEFINE(WINCE_WINDOWS_MOBILE)
1491
 
        ;;
1492
 
    *)
1493
 
        OS_TARGET=WINCE
1494
 
        ;;
1495
 
    esac
1496
 
    ;;
1497
 
Darwin)
1498
 
    case "${target_cpu}" in
1499
 
    powerpc*)
1500
 
        OS_TEST=ppc
1501
 
        ;;
1502
 
    i*86*)
1503
 
        OS_TEST=i386 
1504
 
        ;;
1505
 
    x86_64)
1506
 
        OS_TEST=x86_64
1507
 
        ;;
1508
 
    *)
1509
 
        if test -z "$CROSS_COMPILE" ; then
1510
 
            OS_TEST=`uname -p`
1511
 
        fi
1512
 
        ;;
1513
 
    esac
1514
 
    ;;
1515
 
esac
1516
 
 
1517
 
if test "$OS_ARCH" = "NCR"; then
1518
 
    changequote(,)
1519
 
    OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1520
 
    changequote([,])
1521
 
fi
1522
 
 
1523
 
# Only set CPU_ARCH if we recognize the value of OS_TEST
1524
 
 
1525
 
case "$OS_TEST" in
1526
 
*86 | i86pc)
1527
 
    CPU_ARCH=x86
1528
 
    ;;
1529
 
 
1530
 
powerpc64 | ppc64)
1531
 
    CPU_ARCH=ppc64
1532
 
    ;;
1533
 
 
1534
 
powerpc | ppc | rs6000)
1535
 
    CPU_ARCH=ppc
1536
 
    ;;
1537
 
 
1538
 
Alpha | alpha | ALPHA)
1539
 
    CPU_ARCH=Alpha
1540
 
    ;;
1541
 
 
1542
 
s390)
1543
 
    CPU_ARCH=s390
1544
 
    ;;
1545
 
 
1546
 
s390x)
1547
 
    CPU_ARCH=s390x
1548
 
    ;;
1549
 
 
1550
 
hppa* | parisc)
1551
 
    CPU_ARCH=hppa
1552
 
    ;;
1553
 
 
1554
 
sun4u | sparc*)
1555
 
    CPU_ARCH=sparc
1556
 
    ;;
1557
 
 
1558
 
x86_64 | ia64)
1559
 
    CPU_ARCH="$OS_TEST"
1560
 
    ;;
1561
 
 
1562
 
arm*)
1563
 
    CPU_ARCH=arm
1564
 
    ;;
1565
 
 
1566
 
mips|mipsel)
1567
 
    CPU_ARCH="mips"
1568
 
    ;;
1569
 
esac
1570
 
 
1571
 
if test -z "$OS_TARGET"; then
1572
 
    OS_TARGET=$OS_ARCH
1573
 
fi
1574
 
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1575
 
 
1576
 
dnl Set INTEL_ARCHITECTURE if we're compiling for x86-32 or x86-64.
1577
 
dnl ===============================================================
1578
 
INTEL_ARCHITECTURE=
1579
 
case "$OS_TEST" in
1580
 
    x86_64|i?86)
1581
 
      INTEL_ARCHITECTURE=1
1582
 
esac
1583
 
 
1584
 
dnl ========================================================
1585
 
dnl GNU specific defaults
1586
 
dnl ========================================================
1587
 
if test "$GNU_CC"; then
1588
 
    # FIXME: Let us build with strict aliasing. bug 414641.
1589
 
    CFLAGS="$CFLAGS -fno-strict-aliasing"
1590
 
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1591
 
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1592
 
    DSO_LDOPTS='-shared'
1593
 
    if test "$GCC_USE_GNU_LD"; then
1594
 
        # Don't allow undefined symbols in libraries
1595
 
        DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1596
 
    fi
1597
 
    WARNINGS_AS_ERRORS='-Werror'
1598
 
    DSO_CFLAGS=''
1599
 
    DSO_PIC_CFLAGS='-fPIC'
1600
 
    ASFLAGS="$ASFLAGS -fPIC"
1601
 
    _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1602
 
    _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1603
 
    _MOZ_EXCEPTIONS_FLAGS_ON='-fexceptions'
1604
 
    _MOZ_EXCEPTIONS_FLAGS_OFF='-fno-exceptions'
1605
 
 
1606
 
    # Turn on GNU specific features
1607
 
    # -Wall - turn on all warnings
1608
 
    # -pedantic - make compiler warn about non-ANSI stuff, and
1609
 
    #             be a little bit stricter
1610
 
    # Warnings slamm took out for now (these were giving more noise than help):
1611
 
    # -Wbad-function-cast - warns when casting a function to a new return type
1612
 
    # -Wshadow - removed because it generates more noise than help --pete
1613
 
    _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1614
 
    if test -z "$INTEL_CC"; then
1615
 
       # Don't use -Wcast-align with ICC
1616
 
       case "$CPU_ARCH" in
1617
 
           # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1618
 
           hppa | ia64 | sparc | arm)
1619
 
           ;;
1620
 
           *)
1621
 
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1622
 
           ;;
1623
 
       esac
1624
 
    fi
1625
 
 
1626
 
    dnl Turn pedantic on but disable the warnings for long long
1627
 
    _PEDANTIC=1
1628
 
 
1629
 
    if test -z "$INTEL_CC"; then
1630
 
      _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1631
 
    fi
1632
 
 
1633
 
    _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1634
 
    _USE_CPP_INCLUDE_FLAG=1
1635
 
elif test "$SOLARIS_SUNPRO_CC"; then
1636
 
    DSO_CFLAGS=''
1637
 
    if test "$CPU_ARCH" = "sparc"; then
1638
 
        # for Sun Studio on Solaris/SPARC
1639
 
        DSO_PIC_CFLAGS='-xcode=pic32'
1640
 
    else
1641
 
        DSO_PIC_CFLAGS='-KPIC'
1642
 
    fi
1643
 
    _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1644
 
else
1645
 
    MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1646
 
    MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1647
 
 
1648
 
    DSO_LDOPTS='-shared'
1649
 
    if test "$GNU_LD"; then
1650
 
        # Don't allow undefined symbols in libraries
1651
 
        DSO_LDOPTS="$DSO_LDOPTS -z defs"
1652
 
    fi
1653
 
 
1654
 
    DSO_CFLAGS=''
1655
 
    DSO_PIC_CFLAGS='-KPIC'
1656
 
    _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1657
 
fi
1658
 
 
1659
 
if test "$GNU_CXX"; then
1660
 
    # FIXME: Let us build with strict aliasing. bug 414641.
1661
 
    CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1662
 
    # Turn on GNU specific features
1663
 
    _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1664
 
    if test -z "$INTEL_CC"; then
1665
 
       # Don't use -Wcast-align with ICC
1666
 
       case "$CPU_ARCH" in
1667
 
           # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1668
 
           hppa | ia64 | sparc | arm)
1669
 
           ;;
1670
 
           *)
1671
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1672
 
           ;;
1673
 
       esac
1674
 
    fi
1675
 
 
1676
 
    _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1677
 
    _USE_CPP_INCLUDE_FLAG=1
1678
 
 
1679
 
    AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1680
 
                   ac_has_wno_invalid_offsetof,
1681
 
        [
1682
 
            AC_LANG_SAVE
1683
 
            AC_LANG_CPLUSPLUS
1684
 
            _SAVE_CXXFLAGS="$CXXFLAGS"
1685
 
            CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1686
 
            AC_TRY_COMPILE([],
1687
 
                           [return(0);],
1688
 
                           ac_has_wno_invalid_offsetof="yes",
1689
 
                           ac_has_wno_invalid_offsetof="no")
1690
 
            CXXFLAGS="$_SAVE_CXXFLAGS"
1691
 
            AC_LANG_RESTORE
1692
 
        ])
1693
 
    if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1694
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1695
 
    fi
1696
 
 
1697
 
    AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
1698
 
                   ac_has_wno_variadic_macros,
1699
 
        [
1700
 
            AC_LANG_SAVE
1701
 
            AC_LANG_CPLUSPLUS
1702
 
            _SAVE_CXXFLAGS="$CXXFLAGS"
1703
 
            CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
1704
 
            AC_TRY_COMPILE([],
1705
 
                           [return(0);],
1706
 
                           ac_has_wno_variadic_macros="yes",
1707
 
                           ac_has_wno_variadic_macros="no")
1708
 
            CXXFLAGS="$_SAVE_CXXFLAGS"
1709
 
            AC_LANG_RESTORE
1710
 
        ])
1711
 
    if test "$ac_has_wno_variadic_macros" = "yes"; then
1712
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
1713
 
    fi
1714
 
 
1715
 
    AC_CACHE_CHECK(whether the compiler supports -Werror=return-type,
1716
 
                   ac_has_werror_return_type,
1717
 
        [
1718
 
            AC_LANG_SAVE
1719
 
            AC_LANG_CPLUSPLUS
1720
 
            _SAVE_CXXFLAGS="$CXXFLAGS"
1721
 
            CXXFLAGS="$CXXFLAGS -Werror=return-type"
1722
 
            AC_TRY_COMPILE([],
1723
 
                           [return(0);],
1724
 
                           ac_has_werror_return_type="yes",
1725
 
                           ac_has_werror_return_type="no")
1726
 
            CXXFLAGS="$_SAVE_CXXFLAGS"
1727
 
            AC_LANG_RESTORE
1728
 
        ])
1729
 
    if test "$ac_has_werror_return_type" = "yes"; then
1730
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type"
1731
 
    fi
1732
 
 
1733
 
else
1734
 
    _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1735
 
fi
1736
 
 
1737
 
dnl gcc can come with its own linker so it is better to use the pass-thru calls
1738
 
dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1739
 
dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1740
 
dnl normal behavior.
1741
 
dnl ========================================================
1742
 
MKSHLIB_FORCE_ALL=
1743
 
MKSHLIB_UNFORCE_ALL=
1744
 
 
1745
 
if test "$COMPILE_ENVIRONMENT"; then
1746
 
if test "$GNU_CC"; then
1747
 
  AC_MSG_CHECKING(whether ld has archive extraction flags)
1748
 
  AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1749
 
   [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1750
 
    ac_cv_mkshlib_force_and_unforce="no"
1751
 
    exec 3<&0 <<LOOP_INPUT
1752
 
        force="-Wl,--whole-archive";   unforce="-Wl,--no-whole-archive"
1753
 
        force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1754
 
        force="-Wl,-all";              unforce="-Wl,-none"
1755
 
LOOP_INPUT
1756
 
    while read line
1757
 
    do
1758
 
      eval $line
1759
 
      LDFLAGS=$force
1760
 
      LIBS=$unforce
1761
 
      AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1762
 
    done
1763
 
    exec 0<&3 3<&-
1764
 
    LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1765
 
   ])
1766
 
  if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1767
 
    AC_MSG_RESULT(no)
1768
 
  else
1769
 
    AC_MSG_RESULT(yes)
1770
 
    eval $ac_cv_mkshlib_force_and_unforce
1771
 
    MKSHLIB_FORCE_ALL=$force
1772
 
    MKSHLIB_UNFORCE_ALL=$unforce
1773
 
  fi
1774
 
fi # GNU_CC
1775
 
fi # COMPILE_ENVIRONMENT
1776
 
 
1777
 
dnl =================================================================
1778
 
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1779
 
dnl which is bad when cross compiling.
1780
 
dnl =================================================================
1781
 
if test "$COMPILE_ENVIRONMENT"; then
1782
 
configure_static_assert_macros='
1783
 
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1784
 
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1785
 
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1786
 
'
1787
 
 
1788
 
dnl test that the macros actually work:
1789
 
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1790
 
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1791
 
 [AC_LANG_SAVE
1792
 
  AC_LANG_C
1793
 
  ac_cv_static_assertion_macros_work="yes"
1794
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1795
 
                 [CONFIGURE_STATIC_ASSERT(1)],
1796
 
                 ,
1797
 
                 ac_cv_static_assertion_macros_work="no")
1798
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1799
 
                 [CONFIGURE_STATIC_ASSERT(0)],
1800
 
                 ac_cv_static_assertion_macros_work="no",
1801
 
                 )
1802
 
  AC_LANG_CPLUSPLUS
1803
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1804
 
                 [CONFIGURE_STATIC_ASSERT(1)],
1805
 
                 ,
1806
 
                 ac_cv_static_assertion_macros_work="no")
1807
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1808
 
                 [CONFIGURE_STATIC_ASSERT(0)],
1809
 
                 ac_cv_static_assertion_macros_work="no",
1810
 
                 )
1811
 
  AC_LANG_RESTORE
1812
 
 ])
1813
 
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1814
 
if test "$ac_cv_static_assertion_macros_work" = "no"; then
1815
 
    AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1816
 
fi
1817
 
fi # COMPILE_ENVIRONMENT
1818
 
 
1819
 
dnl ========================================================
1820
 
dnl Checking for 64-bit OS
1821
 
dnl ========================================================
1822
 
if test "$COMPILE_ENVIRONMENT"; then
1823
 
AC_LANG_SAVE
1824
 
AC_LANG_C
1825
 
AC_MSG_CHECKING(for 64-bit OS)
1826
 
AC_TRY_COMPILE([$configure_static_assert_macros],
1827
 
               [CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
1828
 
               result="yes", result="no")
1829
 
AC_MSG_RESULT("$result")
1830
 
if test "$result" = "yes"; then
1831
 
    AC_DEFINE(HAVE_64BIT_OS)
1832
 
    HAVE_64BIT_OS=1
1833
 
fi
1834
 
AC_SUBST(HAVE_64BIT_OS)
1835
 
AC_LANG_RESTORE
1836
 
fi # COMPILE_ENVIRONMENT
1837
 
 
1838
 
dnl ========================================================
1839
 
dnl Enable high-memory support on OS/2 by default.
1840
 
dnl ========================================================
1841
 
MOZ_OS2_HIGH_MEMORY=1
1842
 
MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1843
 
[  --disable-os2-high-mem  Disable high-memory support on OS/2],
1844
 
    MOZ_OS2_HIGH_MEMORY=,
1845
 
    MOZ_OS2_HIGH_MEMORY=1 )
1846
 
AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1847
 
 
1848
 
dnl ========================================================
1849
 
dnl = Use profiling compile flags
1850
 
dnl ========================================================
1851
 
MOZ_ARG_ENABLE_BOOL(profiling,
1852
 
[  --enable-profiling      Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
1853
 
    MOZ_PROFILING=1,
1854
 
    MOZ_PROFILING= )
1855
 
 
1856
 
dnl ========================================================
1857
 
dnl = Use Valgrind
1858
 
dnl ========================================================
1859
 
MOZ_ARG_ENABLE_BOOL(valgrind,
1860
 
[  --enable-valgrind       Enable Valgrind integration hooks (default=no)],
1861
 
    MOZ_VALGRIND=1,
1862
 
    MOZ_VALGRIND= )
1863
 
if test -n "$MOZ_VALGRIND"; then
1864
 
    MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
1865
 
        AC_MSG_ERROR(
1866
 
            [--enable-valgrind specified but Valgrind is not installed]))
1867
 
    AC_DEFINE(MOZ_VALGRIND)
1868
 
fi
1869
 
 
1870
 
dnl ========================================================
1871
 
dnl jprof
1872
 
dnl ========================================================
1873
 
MOZ_ARG_ENABLE_BOOL(jprof,
1874
 
[  --enable-jprof          Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.],
1875
 
    MOZ_JPROF=1,
1876
 
    MOZ_JPROF= )
1877
 
if test -n "$MOZ_JPROF"; then
1878
 
    MOZ_PROFILING=1
1879
 
    AC_DEFINE(MOZ_JPROF)
1880
 
fi
1881
 
 
1882
 
dnl ========================================================
1883
 
dnl shark
1884
 
dnl ========================================================
1885
 
MOZ_ARG_ENABLE_BOOL(shark,
1886
 
[  --enable-shark          Enable shark remote profiling. Implies --enable-profiling.],
1887
 
    MOZ_SHARK=1,
1888
 
    MOZ_SHARK= )
1889
 
if test -n "$MOZ_SHARK"; then
1890
 
    MOZ_PROFILING=1
1891
 
    AC_DEFINE(MOZ_SHARK)
1892
 
fi
1893
 
 
1894
 
dnl ========================================================
1895
 
dnl callgrind
1896
 
dnl ========================================================
1897
 
MOZ_ARG_ENABLE_BOOL(callgrind,
1898
 
[  --enable-callgrind      Enable callgrind profiling],
1899
 
    MOZ_CALLGRIND=1,
1900
 
    MOZ_CALLGRIND= )
1901
 
if test -n "$MOZ_CALLGRIND"; then
1902
 
    AC_DEFINE(MOZ_CALLGRIND)
1903
 
fi
1904
 
 
1905
 
dnl ========================================================
1906
 
dnl vtune
1907
 
dnl ========================================================
1908
 
MOZ_ARG_ENABLE_BOOL(vtune,
1909
 
[  --enable-vtune          Enable vtune profiling. Implies --enable-profiling.],
1910
 
    MOZ_VTUNE=1,
1911
 
    MOZ_VTUNE= )
1912
 
if test -n "$MOZ_VTUNE"; then
1913
 
    MOZ_PROFILING=1
1914
 
    AC_DEFINE(MOZ_VTUNE)
1915
 
fi
1916
 
 
1917
 
dnl ========================================================
1918
 
dnl Profiling
1919
 
dnl ========================================================
1920
 
if test -n "$MOZ_PROFILING"; then
1921
 
    AC_DEFINE(MOZ_PROFILING)
1922
 
fi
1923
 
 
1924
 
dnl ========================================================
1925
 
dnl System overrides of the defaults for host
1926
 
dnl ========================================================
1927
 
case "$host" in
1928
 
*mingw*|*wince|*winmo)
1929
 
    if test -n "$_WIN32_MSVC"; then
1930
 
        HOST_AR=lib
1931
 
        HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1932
 
        HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1933
 
        HOST_RANLIB='echo ranlib'
1934
 
    else
1935
 
        HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1936
 
    fi
1937
 
    HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
1938
 
    HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1939
 
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1940
 
    HOST_BIN_SUFFIX=.exe
1941
 
    case "$host" in
1942
 
    *mingw*)
1943
 
        PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper"
1944
 
        ;;
1945
 
    esac
1946
 
 
1947
 
    case "${host_cpu}" in
1948
 
    x86_64)
1949
 
        HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
1950
 
        ;;
1951
 
    esac
1952
 
    ;;
1953
 
 
1954
 
*-darwin*)
1955
 
    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1956
 
    HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1957
 
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1958
 
    ;;
1959
 
 
1960
 
*-linux*|*-kfreebsd*-gnu|*-gnu*)
1961
 
    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1962
 
    HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1963
 
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1964
 
    ;;
1965
 
 
1966
 
*os2*)
1967
 
    HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1968
 
    HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1969
 
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1970
 
    HOST_BIN_SUFFIX=.exe
1971
 
    MOZ_FIX_LINK_PATHS=
1972
 
    ;;
1973
 
 
1974
 
*-osf*)
1975
 
    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1976
 
    HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1977
 
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1978
 
    ;;
1979
 
 
1980
 
*)
1981
 
    HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1982
 
    HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1983
 
    ;;
1984
 
esac
1985
 
 
1986
 
dnl We require version 2.5 or newer of Python to build.
1987
 
AC_MSG_CHECKING([for Python version >= $PYTHON_VERSION but not 3.x])
1988
 
changequote(,)
1989
 
$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1] or sys.version[:2] != '2.')" $PYTHON_VERSION
1990
 
_python_res=$?
1991
 
changequote([,])
1992
 
if test "$_python_res" != 0; then
1993
 
    AC_MSG_ERROR([Python $PYTHON_VERSION or higher (but not Python 3.x) is required.])
1994
 
fi
1995
 
AC_MSG_RESULT([yes])
1996
 
 
1997
 
dnl Get mozilla version from central milestone file
1998
 
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1999
 
 
2000
 
dnl Get version of various core apps from the version files.
2001
 
FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
2002
 
 
2003
 
if test -z "$FIREFOX_VERSION"; then
2004
 
    AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
2005
 
fi
2006
 
 
2007
 
AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
2008
 
AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
2009
 
 
2010
 
MOZ_DOING_LTO(lto_is_enabled)
2011
 
 
2012
 
dnl ========================================================
2013
 
dnl System overrides of the defaults for target
2014
 
dnl ========================================================
2015
 
 
2016
 
case "$target" in
2017
 
*-aix*)
2018
 
    AC_DEFINE(AIX)
2019
 
    if test ! "$GNU_CC"; then
2020
 
        if test ! "$HAVE_64BIT_OS"; then
2021
 
            # Compiling with Visual Age C++ object model compat is the
2022
 
            # default. To compile with object model ibm, add 
2023
 
            # AIX_OBJMODEL=ibm to .mozconfig.
2024
 
            if test "$AIX_OBJMODEL" = "ibm"; then
2025
 
                CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
2026
 
            else
2027
 
                AIX_OBJMODEL=compat
2028
 
            fi
2029
 
        else
2030
 
            AIX_OBJMODEL=compat
2031
 
        fi
2032
 
        AC_SUBST(AIX_OBJMODEL)
2033
 
        DSO_LDOPTS='-qmkshrobj=1'
2034
 
        DSO_CFLAGS='-qflag=w:w'
2035
 
        DSO_PIC_CFLAGS=
2036
 
        LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
2037
 
        MOZ_FIX_LINK_PATHS=
2038
 
        MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2039
 
        MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2040
 
        if test "$COMPILE_ENVIRONMENT"; then
2041
 
            AC_LANG_SAVE
2042
 
            AC_LANG_CPLUSPLUS
2043
 
            AC_MSG_CHECKING([for IBM XLC/C++ compiler version >= 9.0.0.7])
2044
 
            AC_TRY_COMPILE([],
2045
 
                [#if (__IBMCPP__ < 900)
2046
 
                 #error "Bad compiler"
2047
 
                 #endif],
2048
 
                _BAD_COMPILER=,_BAD_COMPILER=1)
2049
 
            if test -n "$_BAD_COMPILER"; then
2050
 
                AC_MSG_RESULT([no])    
2051
 
                AC_MSG_ERROR([IBM XLC/C++ 9.0.0.7 or higher is required to build.])
2052
 
            else
2053
 
                AC_MSG_RESULT([yes])    
2054
 
            fi
2055
 
            AC_LANG_RESTORE
2056
 
            TARGET_COMPILER_ABI="ibmc"
2057
 
            CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
2058
 
            CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
2059
 
        fi
2060
 
    fi
2061
 
    case "${target_os}" in
2062
 
    aix4.1*)
2063
 
        DLL_SUFFIX='_shr.a'
2064
 
        ;;
2065
 
    esac
2066
 
    if test "$COMPILE_ENVIRONMENT"; then
2067
 
        MOZ_CHECK_HEADERS(sys/inttypes.h)
2068
 
    fi
2069
 
    AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2070
 
    ;;
2071
 
 
2072
 
*-bsdi*)
2073
 
    dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
2074
 
    _PEDANTIC=
2075
 
    case $OS_RELEASE in
2076
 
        4.*|5.*)
2077
 
            STRIP="$STRIP -d"
2078
 
            ;;
2079
 
        *)
2080
 
            DSO_CFLAGS=''
2081
 
            DSO_LDOPTS='-r'
2082
 
            _WARNINGS_CFLAGS="-Wall"
2083
 
            _WARNINGS_CXXFLAGS="-Wall"
2084
 
            # The test above doesn't work properly, at least on 3.1.
2085
 
            MKSHLIB_FORCE_ALL=''
2086
 
            MKSHLIB_UNFORCE_ALL=''
2087
 
        ;;
2088
 
    esac
2089
 
    ;;
2090
 
 
2091
 
*-darwin*) 
2092
 
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2093
 
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2094
 
    # If we're building with --enable-profiling, we need a frame pointer.
2095
 
    if test -z "$MOZ_PROFILING"; then
2096
 
        MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
2097
 
    else
2098
 
        MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
2099
 
    fi
2100
 
    _PEDANTIC=
2101
 
    CFLAGS="$CFLAGS -fpascal-strings -fno-common"
2102
 
    CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
2103
 
    DLL_SUFFIX=".dylib"
2104
 
    DSO_LDOPTS=''
2105
 
    STRIP="$STRIP -x -S"
2106
 
    _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
2107
 
    TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
2108
 
    # The ExceptionHandling framework is needed for Objective-C exception
2109
 
    # logging code in nsObjCExceptions.h. Currently we only use that in debug
2110
 
    # builds.
2111
 
    MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
2112
 
 
2113
 
    if test "x$lto_is_enabled" = "xyes"; then
2114
 
        echo "Skipping -dead_strip because lto is enabled."
2115
 
    dnl DTrace and -dead_strip don't interact well. See bug 403132.
2116
 
    dnl ===================================================================
2117
 
    elif test "x$enable_dtrace" = "xyes"; then
2118
 
        echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
2119
 
    else
2120
 
        dnl check for the presence of the -dead_strip linker flag
2121
 
        AC_MSG_CHECKING([for -dead_strip option to ld])
2122
 
        _SAVE_LDFLAGS=$LDFLAGS
2123
 
        LDFLAGS="$LDFLAGS -Wl,-dead_strip"
2124
 
        AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
2125
 
        if test -n "$_HAVE_DEAD_STRIP" ; then
2126
 
            AC_MSG_RESULT([yes])
2127
 
            MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
2128
 
        else
2129
 
            AC_MSG_RESULT([no])
2130
 
        fi
2131
 
        
2132
 
        LDFLAGS=$_SAVE_LDFLAGS
2133
 
    fi
2134
 
    MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
2135
 
    ;;
2136
 
 
2137
 
*-freebsd*)
2138
 
    if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
2139
 
        DLL_SUFFIX=".so.1.0"
2140
 
        DSO_LDOPTS="-shared"
2141
 
    fi
2142
 
    if test ! "$GNU_CC"; then
2143
 
        DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
2144
 
    fi
2145
 
    ;; 
2146
 
 
2147
 
ia64*-hpux*)
2148
 
    DLL_SUFFIX=".so"
2149
 
    if test ! "$GNU_CC"; then
2150
 
       DSO_LDOPTS='-b'
2151
 
       DSO_CFLAGS=""
2152
 
       DSO_PIC_CFLAGS=
2153
 
       MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
2154
 
       MKCSHLIB='$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
2155
 
       CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2156
 
    else
2157
 
       DSO_LDOPTS='-b -E'
2158
 
       MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2159
 
       MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2160
 
    fi
2161
 
    MOZ_FIX_LINK_PATHS=
2162
 
    SYSTEM_MAKEDEPEND=
2163
 
    AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2164
 
    AC_DEFINE(_LARGEFILE64_SOURCE)
2165
 
    ;;
2166
 
 
2167
 
*-hpux*)
2168
 
    DLL_SUFFIX=".sl"
2169
 
    if test ! "$GNU_CC"; then
2170
 
        DSO_LDOPTS='-b -Wl,+s'
2171
 
        DSO_CFLAGS=""
2172
 
        DSO_PIC_CFLAGS="+Z"
2173
 
        MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
2174
 
        MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
2175
 
        CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2176
 
    else
2177
 
        DSO_LDOPTS='-b -E +s'
2178
 
        MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2179
 
        MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2180
 
    fi
2181
 
    MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
2182
 
    AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2183
 
    ;;
2184
 
 
2185
 
*-irix5*)
2186
 
    AC_DEFINE(IRIX)
2187
 
    DSO_LDOPTS='-elf -shared'
2188
 
 
2189
 
    if test "$GNU_CC"; then
2190
 
       MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2191
 
       MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2192
 
       MKSHLIB_FORCE_ALL='-Wl,-all'
2193
 
       MKSHLIB_UNFORCE_ALL='-Wl,-none'
2194
 
       CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
2195
 
    else
2196
 
       MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2197
 
       MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2198
 
       MKSHLIB_FORCE_ALL='-all'
2199
 
       MKSHLIB_UNFORCE_ALL='-none'
2200
 
    fi
2201
 
    ;;
2202
 
 
2203
 
*-irix6*)
2204
 
    AC_DEFINE(IRIX)
2205
 
    dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must* 
2206
 
    dnl compile and link using -n32
2207
 
    USE_N32=1
2208
 
    TARGET_COMPILER_ABI=n32
2209
 
    DSO_LDOPTS='-elf -shared'
2210
 
    MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2211
 
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2212
 
    _MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
2213
 
    _MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
2214
 
    if test "$GNU_CC"; then
2215
 
       MKSHLIB_FORCE_ALL='-Wl,-all'
2216
 
       MKSHLIB_UNFORCE_ALL='-Wl,-none'
2217
 
       _WARNINGS_CFLAGS="-Wall"
2218
 
       _WARNINGS_CXXFLAGS="-Wall"
2219
 
       CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
2220
 
    else
2221
 
       MKSHLIB_FORCE_ALL='-all'
2222
 
       MKSHLIB_UNFORCE_ALL='-none'
2223
 
           AR_LIST="$AR t"
2224
 
           AR_EXTRACT="$AR x"
2225
 
           AR_DELETE="$AR d"
2226
 
           AR='$(CXX) -ar'
2227
 
           AR_FLAGS='-o $@'
2228
 
       CFLAGS="$CFLAGS -woff 3262 -G 4"
2229
 
       CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
2230
 
       if test -n "$USE_N32"; then
2231
 
           ASFLAGS="$ASFLAGS -n32"
2232
 
           CFLAGS="$CFLAGS -n32"
2233
 
           CXXFLAGS="$CXXFLAGS -n32"
2234
 
           LDFLAGS="$LDFLAGS -n32"
2235
 
       fi
2236
 
       AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2237
 
       AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
2238
 
       MOZ_FIX_LINK_PATHS=
2239
 
    fi
2240
 
    if test -z "$GNU_CXX"; then
2241
 
      MIPSPRO_CXX=1
2242
 
    fi
2243
 
    ;;
2244
 
 
2245
 
*-*linux*)
2246
 
    # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
2247
 
    # Similarly for GNU_CXX and INTEL_CXX.
2248
 
    if test "$INTEL_CC" -o "$INTEL_CXX"; then
2249
 
        # -Os has been broken on Intel's C/C++ compilers for quite a
2250
 
        # while; Intel recommends against using it.
2251
 
        MOZ_OPTIMIZE_FLAGS="-O2"
2252
 
        MOZ_DEBUG_FLAGS="-g"
2253
 
    elif test "$GNU_CC" -o "$GNU_CXX"; then
2254
 
        GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2255
 
        case $GCC_VERSION in
2256
 
        4.1.*|4.2.*|4.5.*)
2257
 
            # -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results.
2258
 
            MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
2259
 
        esac
2260
 
        # If we're building with --enable-profiling, we need a frame pointer.
2261
 
        if test -z "$MOZ_PROFILING"; then
2262
 
            MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
2263
 
        else
2264
 
            MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-omit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
2265
 
        fi
2266
 
        MOZ_DEBUG_FLAGS="-g"
2267
 
    fi
2268
 
 
2269
 
    TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2270
 
 
2271
 
    MOZ_MEMORY=1
2272
 
 
2273
 
    case "${target_cpu}" in
2274
 
    alpha*)
2275
 
        CFLAGS="$CFLAGS -mieee"
2276
 
        CXXFLAGS="$CXXFLAGS -mieee"
2277
 
    ;;
2278
 
    i*86)
2279
 
        USE_ELF_DYNSTR_GC=1
2280
 
    ;;
2281
 
    mips*)
2282
 
        MOZ_DEBUG_FLAGS="-g" # We want inlining
2283
 
    ;;
2284
 
    esac
2285
 
    ;;
2286
 
 
2287
 
*-wince*|*-winmo*)
2288
 
    TARGET_COMPILER_ABI=msvc
2289
 
    _PLATFORM_DEFAULT_TOOLKIT=cairo-windows
2290
 
    MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2291
 
    MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2292
 
    AR_LIST="$AR -list"
2293
 
    AR_EXTRACT=
2294
 
    AR_DELETE="$AR d"
2295
 
    AR_FLAGS='-OUT:"$@"'
2296
 
    MOZ_MEMORY=1
2297
 
    NSS_DISABLE_DBM=1
2298
 
    MOZ_OGG=
2299
 
    ac_configure_args="$ac_configure_args --enable-win32-target=WINCE"
2300
 
 
2301
 
    if test "$AS_BIN"; then
2302
 
        AS="$AS_BIN"
2303
 
    fi
2304
 
    DSO_CFLAGS=
2305
 
    DSO_PIC_CFLAGS=
2306
 
    DLL_SUFFIX=.dll
2307
 
    BIN_SUFFIX='.exe'
2308
 
    if test -z "$RC"; then 
2309
 
        RC=rc.exe  
2310
 
    fi
2311
 
    # certain versions of cygwin's makedepend barf on the 
2312
 
    # #include <string> vs -I./dist/include/string issue so don't use it
2313
 
    SYSTEM_MAKEDEPEND=
2314
 
 
2315
 
    HOST_CC=cl
2316
 
    HOST_CXX=cl
2317
 
    HOST_LD=link
2318
 
    HOST_AR='lib'
2319
 
    HOST_AR_FLAGS='-OUT:$@'
2320
 
    HOST_RANLIB='echo ranlib'
2321
 
    HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
2322
 
        
2323
 
        
2324
 
    WARNINGS_AS_ERRORS='-WX'
2325
 
    MOZ_OPTIMIZE_FLAGS='-Ox'
2326
 
    AR_FLAGS='-NOLOGO -OUT:"$@"'
2327
 
    ASM_SUFFIX=asm
2328
 
    CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2329
 
    CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2330
 
    DLL_PREFIX=
2331
 
    DOXYGEN=:
2332
 
    DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
2333
 
    DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2334
 
    GARBAGE=
2335
 
    IMPORT_LIB_SUFFIX=lib
2336
 
    dnl Need to force-link against mozalloc because it's used in the shunt
2337
 
    LIBS="$LIBS \$(LIBXUL_DIST)/lib/mozalloc.lib"
2338
 
    LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2339
 
    LIB_PREFIX=
2340
 
    LIB_SUFFIX=lib 
2341
 
    MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2342
 
    MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2343
 
    MKSHLIB_FORCE_ALL=
2344
 
    MKSHLIB_UNFORCE_ALL=
2345
 
    MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2346
 
    MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2347
 
    MOZ_DEBUG_FLAGS='-Zi'
2348
 
    MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2349
 
    MOZ_FIX_LINK_PATHS=
2350
 
    OBJ_SUFFIX=obj
2351
 
    RANLIB='echo not_ranlib'
2352
 
    STRIP='echo not_strip'
2353
 
    TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
2354
 
    UNZIP=unzip
2355
 
    XARGS=xargs
2356
 
    XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2357
 
    ZIP=zip
2358
 
    MOZ_TREE_FREETYPE=1
2359
 
 
2360
 
    AC_DEFINE(HAVE_SNPRINTF)
2361
 
    AC_DEFINE(_WINDOWS)
2362
 
    AC_DEFINE(WIN32)
2363
 
    AC_DEFINE(XP_WIN)
2364
 
    AC_DEFINE(XP_WIN32)
2365
 
    AC_DEFINE(HW_THREADS)
2366
 
    AC_DEFINE(STDC_HEADERS)
2367
 
    AC_DEFINE(NEW_H, <new>)
2368
 
    AC_DEFINE(WIN32_LEAN_AND_MEAN)
2369
 
    AC_DEFINE(HAVE_LOCALTIME_R)
2370
 
 
2371
 
    TARGET_MD_ARCH=win32
2372
 
    _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2373
 
    BIN_SUFFIX='.exe'
2374
 
    MOZ_USER_DIR="Mozilla"
2375
 
 
2376
 
    MOZ_GFX_OPTIMIZE_MOBILE=1
2377
 
 
2378
 
    # Sanity check for WINCE_WINDOWS_MOBILE
2379
 
    # XXX disabled until we can fix the mobile tinderbox
2380
 
    ##if test "$WINCE_WINDOWS_MOBILE"; then
2381
 
    ##   MOZ_CHECK_HEADER(tpcshell.h, [],
2382
 
    ##        AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
2383
 
    ##fi
2384
 
;;
2385
 
 
2386
 
*-mingw*)
2387
 
    DSO_CFLAGS=
2388
 
    DSO_PIC_CFLAGS=
2389
 
    DLL_SUFFIX=.dll
2390
 
    RC=rc.exe
2391
 
    # certain versions of cygwin's makedepend barf on the 
2392
 
    # #include <string> vs -I./dist/include/string issue so don't use it
2393
 
    SYSTEM_MAKEDEPEND=
2394
 
    if test -n "$GNU_CC"; then
2395
 
        CC="$CC -mno-cygwin"
2396
 
        CXX="$CXX -mno-cygwin"
2397
 
        CPP="$CPP -mno-cygwin"
2398
 
        CFLAGS="$CFLAGS -mms-bitfields"
2399
 
        CXXFLAGS="$CXXFLAGS -mms-bitfields"
2400
 
        DSO_LDOPTS='-shared'
2401
 
        MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2402
 
        MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2403
 
        RC='$(WINDRES)'
2404
 
        # Use temp file for windres (bug 213281)
2405
 
        RCFLAGS='-O coff --use-temp-file'
2406
 
        # mingw doesn't require kernel32, user32, and advapi32 explicitly
2407
 
        LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32"
2408
 
        MOZ_FIX_LINK_PATHS=
2409
 
        DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc'
2410
 
        XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
2411
 
        DLL_PREFIX=
2412
 
        IMPORT_LIB_SUFFIX=dll.a
2413
 
        GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2414
 
    else
2415
 
        TARGET_COMPILER_ABI=msvc
2416
 
        HOST_CC='$(CC)'
2417
 
        HOST_CXX='$(CXX)'
2418
 
        HOST_LD='$(LD)'
2419
 
        if test "$AS_BIN"; then
2420
 
            AS="$(basename "$AS_BIN")"
2421
 
        fi
2422
 
        AR='lib'
2423
 
        AR_FLAGS='-NOLOGO -OUT:"$@"'
2424
 
        AR_EXTRACT=
2425
 
        RANLIB='echo not_ranlib'
2426
 
        STRIP='echo not_strip'
2427
 
        PKG_SKIP_STRIP=1
2428
 
        XARGS=xargs
2429
 
        ZIP=zip
2430
 
        UNZIP=unzip
2431
 
        DOXYGEN=:
2432
 
        GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2433
 
        ASM_SUFFIX=asm
2434
 
        OBJ_SUFFIX=obj
2435
 
        LIB_SUFFIX=lib
2436
 
        DLL_PREFIX=
2437
 
        LIB_PREFIX=
2438
 
        IMPORT_LIB_SUFFIX=lib
2439
 
        MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2440
 
        MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2441
 
        MKSHLIB_FORCE_ALL=
2442
 
        MKSHLIB_UNFORCE_ALL=
2443
 
        DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2444
 
        _USE_CPP_INCLUDE_FLAG=1
2445
 
        _DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2446
 
        _DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2447
 
        CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2448
 
        CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2449
 
        CXXFLAGS="$CXXFLAGS -wd4800" # disable warning "forcing value to bool"
2450
 
        LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2451
 
        MOZ_DEBUG_FLAGS='-Zi'
2452
 
        MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2453
 
        WARNINGS_AS_ERRORS='-WX'
2454
 
        # If we're building with --enable-profiling, we need -Oy-, which forces a frame pointer.
2455
 
        if test -z "$MOZ_PROFILING"; then
2456
 
            MOZ_OPTIMIZE_FLAGS='-O1'
2457
 
        else
2458
 
            MOZ_OPTIMIZE_FLAGS='-O1 -Oy-'
2459
 
        fi
2460
 
        MOZ_FIX_LINK_PATHS=
2461
 
        DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2462
 
        XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2463
 
        LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2464
 
        MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2465
 
        if test $_MSC_VER -ge 1400; then
2466
 
            LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
2467
 
            dnl For profile-guided optimization
2468
 
            PROFILE_GEN_CFLAGS="-GL"
2469
 
            PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2470
 
            dnl XXX: PGO builds can fail with warnings treated as errors,
2471
 
            dnl specifically "no profile data available" appears to be
2472
 
            dnl treated as an error sometimes. This might be a consequence
2473
 
            dnl of using WARNINGS_AS_ERRORS in some modules, combined
2474
 
            dnl with the linker doing most of the work in the whole-program
2475
 
            dnl optimization/PGO case. I think it's probably a compiler bug,
2476
 
            dnl but we work around it here.
2477
 
            PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2478
 
            dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2479
 
            dnl Probably also a compiler bug, but what can you do?
2480
 
            PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2481
 
            LDFLAGS="$LDFLAGS -DYNAMICBASE"
2482
 
        fi
2483
 
    fi
2484
 
    MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg32$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2485
 
    MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2486
 
    AC_DEFINE(HAVE_SNPRINTF)
2487
 
    AC_DEFINE(_WINDOWS)
2488
 
    AC_DEFINE(WIN32)
2489
 
    AC_DEFINE(XP_WIN)
2490
 
    AC_DEFINE(XP_WIN32)
2491
 
    AC_DEFINE(HW_THREADS)
2492
 
    AC_DEFINE(STDC_HEADERS)
2493
 
    AC_DEFINE(NEW_H, <new>)
2494
 
    AC_DEFINE(WIN32_LEAN_AND_MEAN)
2495
 
    TARGET_MD_ARCH=win32
2496
 
    _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2497
 
    BIN_SUFFIX='.exe'
2498
 
    MOZ_USER_DIR="Mozilla"
2499
 
 
2500
 
    dnl Hardcode to win95 for now - cls
2501
 
    TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2502
 
 
2503
 
    dnl set NO_X11 defines here as the general check is skipped on win32
2504
 
    no_x=yes
2505
 
    AC_DEFINE(NO_X11)
2506
 
 
2507
 
    case "$host" in
2508
 
    *-mingw*)
2509
 
        MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2510
 
        ;;
2511
 
    esac
2512
 
 
2513
 
    case "$host" in
2514
 
    *-mingw*)
2515
 
        if test -z "$MOZ_TOOLS"; then
2516
 
            AC_MSG_ERROR([MOZ_TOOLS is not set])
2517
 
        fi
2518
 
        MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2519
 
        if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then
2520
 
            AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2521
 
        fi
2522
 
        MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2523
 
        if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2524
 
            AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2525
 
        fi
2526
 
        ;;
2527
 
    esac 
2528
 
 
2529
 
    case "$host_os" in
2530
 
    cygwin*|msvc*|mks*)
2531
 
        AC_MSG_ERROR([Using a Cygwin build environment is unsupported. Configure cannot check for presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
2532
 
        ;;
2533
 
    *)
2534
 
        AC_CHECK_HEADERS(oleacc.idl)
2535
 
        AC_LANG_SAVE
2536
 
        AC_LANG_CPLUSPLUS
2537
 
        MOZ_CHECK_HEADERS(atlbase.h)
2538
 
        AC_LANG_RESTORE
2539
 
        ;;
2540
 
    esac
2541
 
 
2542
 
    case "$target" in
2543
 
    i*86-*)
2544
 
        if test "$HAVE_64BIT_OS"; then
2545
 
            AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
2546
 
        fi
2547
 
 
2548
 
        if test $_MSC_VER -ge 1400; then
2549
 
            LDFLAGS="$LDFLAGS -SAFESEH"
2550
 
        fi
2551
 
 
2552
 
        if test -n "$GNU_CC"; then
2553
 
            CFLAGS="$CFLAGS -mstackrealign"
2554
 
            CXXFLAGS="$CXXFLAGS -mstackrealign"
2555
 
        fi
2556
 
 
2557
 
        MOZ_CHECK_HEADERS(mmintrin.h)
2558
 
        AC_DEFINE(_X86_)
2559
 
        ;;
2560
 
    x86_64-*)
2561
 
        AC_DEFINE(_AMD64_)
2562
 
        ;;
2563
 
    *)
2564
 
        AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2565
 
        ;;
2566
 
    esac
2567
 
 
2568
 
    if test "$HAVE_64BIT_OS"; then
2569
 
        AC_DEFINE(_WIN64)
2570
 
    fi
2571
 
    ;;
2572
 
 
2573
 
*-netbsd*)
2574
 
    DSO_CFLAGS=''
2575
 
    CFLAGS="$CFLAGS -Dunix"
2576
 
    CXXFLAGS="$CXXFLAGS -Dunix"
2577
 
    if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2578
 
        DLL_SUFFIX=".so"
2579
 
        DSO_PIC_CFLAGS='-fPIC -DPIC'
2580
 
        DSO_LDOPTS='-shared'
2581
 
        BIN_FLAGS='-Wl,--export-dynamic'
2582
 
    else
2583
 
        DSO_PIC_CFLAGS='-fPIC -DPIC'
2584
 
        DLL_SUFFIX=".so.1.0"
2585
 
        DSO_LDOPTS='-shared'
2586
 
    fi
2587
 
    # This will fail on a.out systems prior to 1.5.1_ALPHA.
2588
 
    MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2589
 
    MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2590
 
    if test "$LIBRUNPATH"; then
2591
 
        DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2592
 
    fi
2593
 
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2594
 
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2595
 
    ;;
2596
 
 
2597
 
*-nto*) 
2598
 
        AC_DEFINE(NTO)  
2599
 
        AC_DEFINE(_QNX_SOURCE)
2600
 
        AC_DEFINE(_i386)
2601
 
        OS_TARGET=NTO
2602
 
        WARNINGS_AS_ERRORS=''
2603
 
        MOZ_OPTIMIZE_FLAGS="-O"
2604
 
        MOZ_DEBUG_FLAGS="-gstabs"
2605
 
        USE_PTHREADS=1
2606
 
        _PEDANTIC=
2607
 
        LIBS="$LIBS -lsocket -lstdc++"
2608
 
        _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2609
 
        _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2610
 
        if test "$with_x" != "yes"
2611
 
        then
2612
 
                _PLATFORM_DEFAULT_TOOLKIT="photon"
2613
 
            TK_CFLAGS='-I/usr/include/photon'
2614
 
                TK_LIBS='-lph'
2615
 
        fi
2616
 
        case "${target_cpu}" in
2617
 
        ppc*)
2618
 
        AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)        
2619
 
        ;;
2620
 
        esac
2621
 
        case "${host_cpu}" in
2622
 
        i*86)
2623
 
        USE_ELF_DYNSTR_GC=1
2624
 
        ;;
2625
 
        esac
2626
 
        ;;
2627
 
 
2628
 
*-openbsd*)
2629
 
    DLL_SUFFIX=".so.1.0"
2630
 
    DSO_CFLAGS=''
2631
 
    DSO_PIC_CFLAGS='-fPIC'
2632
 
    DSO_LDOPTS='-shared -fPIC'
2633
 
    if test "$LIBRUNPATH"; then
2634
 
        DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2635
 
    fi
2636
 
    ;;
2637
 
 
2638
 
*-os2*)
2639
 
    MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2640
 
    MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2641
 
    AC_DEFINE(OS2)
2642
 
    AC_DEFINE(XP_OS2)
2643
 
    AC_DEFINE(OS2EMX_PLAIN_CHAR)
2644
 
    AC_DEFINE(TCPV40HDRS)
2645
 
    DLL_PREFIX=
2646
 
    LIB_PREFIX=
2647
 
    LIB_SUFFIX=lib
2648
 
    BIN_SUFFIX=".exe"
2649
 
    DLL_SUFFIX=".dll"
2650
 
    IMPORT_LIB_SUFFIX=lib
2651
 
    DSO_PIC_CFLAGS=
2652
 
    AR=emxomfar
2653
 
    AR_FLAGS='r $@'
2654
 
    CFLAGS="$CFLAGS -Zomf"
2655
 
    CXXFLAGS="$CXXFLAGS -Zomf"
2656
 
    DSO_LDOPTS='-Zdll'
2657
 
    BIN_FLAGS='-Zlinker /ST:0x100000'
2658
 
    IMPLIB='emximp -o'
2659
 
    FILTER='true'
2660
 
    LDFLAGS='-Zmap'
2661
 
    WARNINGS_AS_ERRORS='-Werror'
2662
 
    MOZ_DEBUG_FLAGS="-g -fno-inline"
2663
 
    MOZ_OPTIMIZE_FLAGS="-O2"
2664
 
    MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2665
 
    DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2666
 
    LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2667
 
    TARGET_MD_ARCH=os2
2668
 
    _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2669
 
    RC=rc.exe
2670
 
    RCFLAGS='-n'
2671
 
    MOZ_USER_DIR="Mozilla"
2672
 
    ZIP="$ZIP -X"
2673
 
 
2674
 
    if test "$MOZTOOLS"; then
2675
 
        MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2676
 
    else
2677
 
        AC_MSG_ERROR([MOZTOOLS is not set])
2678
 
    fi
2679
 
    if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2680
 
        DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2681
 
        LDFLAGS="$LDFLAGS -Zhigh-mem"
2682
 
        MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2683
 
        AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2684
 
    fi
2685
 
 
2686
 
    # GCC for OS/2 currently predefines these, but we don't want them
2687
 
    _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2688
 
    _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2689
 
 
2690
 
    AC_CACHE_CHECK(for __declspec(dllexport),
2691
 
        ac_os2_declspec,
2692
 
        [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2693
 
                        [return 0;],
2694
 
                        ac_os2_declspec="yes",
2695
 
                        ac_os2_declspec="no")])
2696
 
    if test "$ac_os2_declspec" != "yes"; then
2697
 
        AC_MSG_ERROR([Compiler does not support __declspec(dllexport), install GCC-4.3.2 or newer])
2698
 
    fi
2699
 
    ;;
2700
 
 
2701
 
alpha*-*-osf*)
2702
 
    if test "$GNU_CC"; then
2703
 
      MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2704
 
      MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2705
 
 
2706
 
    else
2707
 
        MOZ_DEBUG_FLAGS='-g'
2708
 
        ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2709
 
        CFLAGS="$CFLAGS -ieee"
2710
 
        CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee  -ptr $(DIST)/cxx_repository'
2711
 
        DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2712
 
        DSO_CFLAGS=
2713
 
        DSO_PIC_CFLAGS=
2714
 
        MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2715
 
        MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2716
 
        MKSHLIB_FORCE_ALL='-all'
2717
 
        MKSHLIB_UNFORCE_ALL='-none'
2718
 
        dnl Might fix the libxpcom.so breakage on this platform as well....
2719
 
        AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2720
 
        AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2721
 
    fi
2722
 
    if test -z "$GNU_CXX"; then
2723
 
      COMPAQ_CXX=1
2724
 
    fi
2725
 
    AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2726
 
    ;;
2727
 
 
2728
 
*-qnx*) 
2729
 
    DIRENT_INO=d_stat.st_ino
2730
 
    dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2731
 
    AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2732
 
    AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2733
 
    dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2734
 
    AC_DEFINE(STDC_HEADERS)
2735
 
    if test "$no_x" = "yes"; then
2736
 
            _PLATFORM_DEFAULT_TOOLKIT='photon'
2737
 
            TK_CFLAGS='-I/usr/nto/include/photon'
2738
 
            TK_LIBS='-lphoton -lphrender'
2739
 
    fi
2740
 
    ;;
2741
 
 
2742
 
*-sco*) 
2743
 
    AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2744
 
    AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2745
 
    CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2746
 
    if test ! "$GNU_CC"; then
2747
 
       DSO_LDOPTS='-G'
2748
 
    fi
2749
 
    ;;
2750
 
 
2751
 
*-solaris*) 
2752
 
    AC_DEFINE(SOLARIS)
2753
 
    TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2754
 
    SYSTEM_MAKEDEPEND=
2755
 
    MOZ_FIX_LINK_PATHS=
2756
 
    # $ORIGIN/.. is for shared libraries under components/ to locate shared
2757
 
    # libraries one level up (e.g. libnspr4.so)
2758
 
    if test "$SOLARIS_SUNPRO_CC"; then
2759
 
       LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs"
2760
 
       LIBS="-lCrun -lCstd -lc $LIBS"
2761
 
       NS_USE_NATIVE=1
2762
 
       AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2763
 
       CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
2764
 
       CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
2765
 
       _MOZ_EXCEPTIONS_FLAGS_ON='-features=except'
2766
 
       _MOZ_EXCEPTIONS_FLAGS_OFF='-features=no%except'
2767
 
       LDFLAGS="-xildoff $LDFLAGS"
2768
 
       if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
2769
 
           _SAVE_LDFLAGS=$LDFLAGS
2770
 
           LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS" 
2771
 
           AC_TRY_LINK([#include <stdio.h>],
2772
 
                       [printf("Hello World\n");],
2773
 
                       ,
2774
 
                       [LDFLAGS=$_SAVE_LDFLAGS])
2775
 
       fi
2776
 
       MOZ_OPTIMIZE_FLAGS="-xO4"
2777
 
       MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2778
 
       MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2779
 
       MKSHLIB_FORCE_ALL='-z allextract'
2780
 
       MKSHLIB_UNFORCE_ALL='-z defaultextract'
2781
 
       DSO_LDOPTS='-G'
2782
 
       AR_LIST="$AR t"
2783
 
       AR_EXTRACT="$AR x"
2784
 
       AR_DELETE="$AR d"
2785
 
       AR='$(CXX) -xar'
2786
 
       AR_FLAGS='-o $@'
2787
 
       AS='/usr/ccs/bin/as'
2788
 
       ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2789
 
       AS_DASH_C_FLAG=''
2790
 
       TARGET_COMPILER_ABI="sunc"
2791
 
       CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2792
 
       CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2793
 
       AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2794
 
       AC_LANG_SAVE
2795
 
       AC_LANG_CPLUSPLUS
2796
 
       AC_TRY_COMPILE([],
2797
 
           [#if (__SUNPRO_CC < 0x590)
2798
 
           #error "Denied"
2799
 
           #endif],
2800
 
           _BAD_COMPILER=,_BAD_COMPILER=1)
2801
 
       if test -n "$_BAD_COMPILER"; then
2802
 
           _res="no"
2803
 
           AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2804
 
       else
2805
 
           _res="yes"
2806
 
       fi
2807
 
       AC_TRY_COMPILE([],
2808
 
           [#if (__SUNPRO_CC >= 0x5100)
2809
 
           #error "Sun C++ 5.10 or above"
2810
 
           #endif],
2811
 
           _ABOVE_SS12U1=,_ABOVE_SS12U1=1)
2812
 
       if test "$_ABOVE_SS12U1"; then
2813
 
           # disable xannotate
2814
 
           CXXFLAGS="$CXXFLAGS -xannotate=no"
2815
 
       fi
2816
 
       AC_MSG_RESULT([$_res])
2817
 
       AC_LANG_RESTORE
2818
 
    else
2819
 
       LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs"
2820
 
       LIBS="-lc $LIBS"
2821
 
       MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract'
2822
 
       MKSHLIB_UNFORCE_ALL='-Wl,-z -Wl,defaultextract'
2823
 
       ASFLAGS="$ASFLAGS -fPIC"
2824
 
       DSO_LDOPTS='-shared'
2825
 
       WARNINGS_AS_ERRORS='-Werror'
2826
 
       _WARNINGS_CFLAGS=''
2827
 
       _WARNINGS_CXXFLAGS=''
2828
 
       if test "$OS_RELEASE" = "5.3"; then
2829
 
           AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2830
 
       fi
2831
 
    fi
2832
 
    if test "$OS_RELEASE" = "5.5.1"; then
2833
 
        AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2834
 
    fi
2835
 
    ;;
2836
 
 
2837
 
*-sunos*) 
2838
 
    DSO_LDOPTS='-Bdynamic'
2839
 
    MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2840
 
    MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2841
 
    AC_DEFINE(SUNOS4)
2842
 
    AC_DEFINE(SPRINTF_RETURNS_STRING)
2843
 
    case "$(target_os)" in
2844
 
    sunos4.1*)
2845
 
        DLL_SUFFIX='.so.1.0'
2846
 
        ;;
2847
 
    esac
2848
 
    ;;
2849
 
 
2850
 
*-sysv4.2uw7*) 
2851
 
        NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2852
 
    ;;
2853
 
 
2854
 
*-os2*)
2855
 
    HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2856
 
    ;;
2857
 
 
2858
 
*-android*)
2859
 
    AC_DEFINE(NO_PW_GECOS)
2860
 
    no_x=yes
2861
 
    _PLATFORM_DEFAULT_TOOLKIT=cairo-android
2862
 
    TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2863
 
 
2864
 
    MOZ_GFX_OPTIMIZE_MOBILE=1
2865
 
    # If we're building with --enable-profiling, we need a frame pointer.
2866
 
    if test -z "$MOZ_PROFILING"; then
2867
 
        MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer"
2868
 
    else
2869
 
        MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fno-omit-frame-pointer"
2870
 
    fi
2871
 
    # The Maemo builders don't know about this flag
2872
 
    MOZ_ARM_VFP_FLAGS="-mfpu=vfp"
2873
 
    ;;
2874
 
 
2875
 
esac
2876
 
 
2877
 
dnl Only one oddball right now (QNX), but this gives us flexibility
2878
 
dnl if any other platforms need to override this in the future.
2879
 
AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2880
 
 
2881
 
dnl ========================================================
2882
 
dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2883
 
dnl by now will not have any way to link most binaries (tests
2884
 
dnl as well as viewer, apprunner, etc.), because some symbols
2885
 
dnl will be left out of the "composite" .so's by ld as unneeded.
2886
 
dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2887
 
dnl they can link in the static libs that provide the missing
2888
 
dnl symbols.
2889
 
dnl ========================================================
2890
 
NO_LD_ARCHIVE_FLAGS=
2891
 
if test -z "$MKSHLIB_FORCE_ALL" -o -z "$MKSHLIB_UNFORCE_ALL"; then
2892
 
    NO_LD_ARCHIVE_FLAGS=1
2893
 
fi
2894
 
case "$target" in
2895
 
*-os2*)
2896
 
    NO_LD_ARCHIVE_FLAGS=
2897
 
    ;;
2898
 
*-aix4.3*|*-aix5*)
2899
 
    NO_LD_ARCHIVE_FLAGS=
2900
 
    ;;
2901
 
*-mingw*|*-wince|*-winmo)
2902
 
    if test -z "$GNU_CC"; then
2903
 
        NO_LD_ARCHIVE_FLAGS=
2904
 
    fi
2905
 
    ;;
2906
 
esac
2907
 
AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2908
 
 
2909
 
dnl ========================================================
2910
 
dnl = Flags to strip unused symbols from .so components and
2911
 
dnl = to export jemalloc symbols when linking a program
2912
 
dnl ========================================================
2913
 
case "$target" in
2914
 
    *-linux*|*-kfreebsd*-gnu|*-gnu*)
2915
 
        MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2916
 
        MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS='-rdynamic -Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/jemalloc-standalone-linkage-version-script'
2917
 
        ;;
2918
 
    *-solaris*)
2919
 
        if test -z "$GNU_CC"; then
2920
 
         MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2921
 
        else
2922
 
         if test -z "$GCC_USE_GNU_LD"; then
2923
 
          MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2924
 
         else
2925
 
          MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2926
 
         fi
2927
 
        fi
2928
 
        ;;
2929
 
    *-nto*) 
2930
 
        MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2931
 
        ;;
2932
 
    *-darwin*)
2933
 
        MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2934
 
        ;;
2935
 
    *-mingw*|*-wince|*-winmo)
2936
 
        if test -n "$GNU_CC"; then
2937
 
           MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2938
 
        fi
2939
 
        ;;
2940
 
esac
2941
 
 
2942
 
if test -z "$COMPILE_ENVIRONMENT"; then
2943
 
    SKIP_COMPILER_CHECKS=1
2944
 
    SKIP_LIBRARY_CHECKS=1
2945
 
fi
2946
 
 
2947
 
if test -z "$SKIP_COMPILER_CHECKS"; then
2948
 
dnl Checks for typedefs, structures, and compiler characteristics.
2949
 
dnl ========================================================
2950
 
AC_HEADER_STDC
2951
 
AC_C_CONST
2952
 
AC_TYPE_MODE_T
2953
 
AC_TYPE_OFF_T
2954
 
AC_TYPE_PID_T
2955
 
AC_TYPE_SIZE_T
2956
 
AC_LANG_CPLUSPLUS
2957
 
AC_MSG_CHECKING(for __stdcall)
2958
 
AC_CACHE_VAL(ac_cv___stdcall,
2959
 
 [AC_TRY_COMPILE([template <typename Method> struct foo;
2960
 
                  template <> struct foo<void (*)()> {};
2961
 
                  template <> struct foo<void (__stdcall*)()> {};],
2962
 
                 [],
2963
 
                 [ac_cv___stdcall=true],
2964
 
                 [ac_cv___stdcall=false])])
2965
 
if test "$ac_cv___stdcall" = true ; then
2966
 
  AC_DEFINE(HAVE_STDCALL)
2967
 
  AC_MSG_RESULT(yes)
2968
 
else
2969
 
  AC_MSG_RESULT(no)
2970
 
fi
2971
 
AC_LANG_C
2972
 
AC_MSG_CHECKING(for ssize_t)
2973
 
AC_CACHE_VAL(ac_cv_type_ssize_t,
2974
 
 [AC_TRY_COMPILE([#include <stdio.h>
2975
 
                  #include <sys/types.h>],
2976
 
                 [ssize_t foo = 0;],
2977
 
                 [ac_cv_type_ssize_t=true],
2978
 
                 [ac_cv_type_ssize_t=false])])
2979
 
if test "$ac_cv_type_ssize_t" = true ; then
2980
 
  AC_DEFINE(HAVE_SSIZE_T)
2981
 
  AC_MSG_RESULT(yes)
2982
 
else
2983
 
  AC_MSG_RESULT(no)
2984
 
fi
2985
 
AC_STRUCT_ST_BLKSIZE
2986
 
AC_MSG_CHECKING(for siginfo_t)
2987
 
AC_CACHE_VAL(ac_cv_siginfo_t,
2988
 
 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2989
 
                  #include <signal.h>],
2990
 
                 [siginfo_t* info;],
2991
 
                 [ac_cv_siginfo_t=true],
2992
 
                 [ac_cv_siginfo_t=false])])
2993
 
if test "$ac_cv_siginfo_t" = true ; then
2994
 
  AC_DEFINE(HAVE_SIGINFO_T)
2995
 
  AC_MSG_RESULT(yes)
2996
 
else
2997
 
  AC_MSG_RESULT(no)
2998
 
fi
2999
 
 
3000
 
dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
3001
 
dnl ========================================================
3002
 
AC_MSG_CHECKING(for int16_t)
3003
 
AC_CACHE_VAL(ac_cv_int16_t,
3004
 
 [AC_TRY_COMPILE([#include <stdio.h>
3005
 
                  #include <sys/types.h>],
3006
 
                 [int16_t foo = 0;],
3007
 
                 [ac_cv_int16_t=true],
3008
 
                 [ac_cv_int16_t=false])])
3009
 
if test "$ac_cv_int16_t" = true ; then
3010
 
  AC_DEFINE(HAVE_INT16_T)
3011
 
  AC_MSG_RESULT(yes)
3012
 
else
3013
 
  AC_MSG_RESULT(no)
3014
 
fi
3015
 
AC_MSG_CHECKING(for int32_t)
3016
 
AC_CACHE_VAL(ac_cv_int32_t,
3017
 
 [AC_TRY_COMPILE([#include <stdio.h>
3018
 
                  #include <sys/types.h>],
3019
 
                 [int32_t foo = 0;],
3020
 
                 [ac_cv_int32_t=true],
3021
 
                 [ac_cv_int32_t=false])])
3022
 
if test "$ac_cv_int32_t" = true ; then
3023
 
  AC_DEFINE(HAVE_INT32_T)
3024
 
  AC_MSG_RESULT(yes)
3025
 
else
3026
 
  AC_MSG_RESULT(no)
3027
 
fi
3028
 
AC_MSG_CHECKING(for int64_t)
3029
 
AC_CACHE_VAL(ac_cv_int64_t,
3030
 
 [AC_TRY_COMPILE([#include <stdio.h>
3031
 
                  #include <sys/types.h>],
3032
 
                 [int64_t foo = 0;],
3033
 
                 [ac_cv_int64_t=true],
3034
 
                 [ac_cv_int64_t=false])])
3035
 
if test "$ac_cv_int64_t" = true ; then
3036
 
  AC_DEFINE(HAVE_INT64_T)
3037
 
  AC_MSG_RESULT(yes)
3038
 
else
3039
 
  AC_MSG_RESULT(no)
3040
 
fi
3041
 
AC_MSG_CHECKING(for int64)
3042
 
AC_CACHE_VAL(ac_cv_int64,
3043
 
 [AC_TRY_COMPILE([#include <stdio.h>
3044
 
                  #include <sys/types.h>],
3045
 
                 [int64 foo = 0;],
3046
 
                 [ac_cv_int64=true],
3047
 
                 [ac_cv_int64=false])])
3048
 
if test "$ac_cv_int64" = true ; then
3049
 
  AC_DEFINE(HAVE_INT64)
3050
 
  AC_MSG_RESULT(yes)
3051
 
else
3052
 
  AC_MSG_RESULT(no)
3053
 
fi
3054
 
AC_MSG_CHECKING(for uint)
3055
 
AC_CACHE_VAL(ac_cv_uint,
3056
 
 [AC_TRY_COMPILE([#include <stdio.h>
3057
 
                  #include <sys/types.h>],
3058
 
                 [uint foo = 0;],
3059
 
                 [ac_cv_uint=true],
3060
 
                 [ac_cv_uint=false])])
3061
 
if test "$ac_cv_uint" = true ; then
3062
 
  AC_DEFINE(HAVE_UINT)
3063
 
  AC_MSG_RESULT(yes)
3064
 
else
3065
 
  AC_MSG_RESULT(no)
3066
 
fi
3067
 
AC_MSG_CHECKING(for uint_t)
3068
 
AC_CACHE_VAL(ac_cv_uint_t,
3069
 
 [AC_TRY_COMPILE([#include <stdio.h>
3070
 
                  #include <sys/types.h>],
3071
 
                 [uint_t foo = 0;],
3072
 
                 [ac_cv_uint_t=true],
3073
 
                 [ac_cv_uint_t=false])])
3074
 
if test "$ac_cv_uint_t" = true ; then
3075
 
  AC_DEFINE(HAVE_UINT_T)
3076
 
  AC_MSG_RESULT(yes)
3077
 
else
3078
 
  AC_MSG_RESULT(no)
3079
 
fi
3080
 
AC_MSG_CHECKING(for uint16_t)
3081
 
AC_CACHE_VAL(ac_cv_uint16_t,
3082
 
 [AC_TRY_COMPILE([#include <stdio.h>
3083
 
                  #include <sys/types.h>],
3084
 
                 [uint16_t foo = 0;],
3085
 
                 [ac_cv_uint16_t=true],
3086
 
                 [ac_cv_uint16_t=false])])
3087
 
if test "$ac_cv_uint16_t" = true ; then
3088
 
  AC_DEFINE(HAVE_UINT16_T)
3089
 
  AC_MSG_RESULT(yes)
3090
 
else
3091
 
  AC_MSG_RESULT(no)
3092
 
fi
3093
 
 
3094
 
dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
3095
 
dnl are defined when compiling C++ but not C.  Since the result of this
3096
 
dnl test is used only in C++, do it in C++.
3097
 
AC_LANG_CPLUSPLUS
3098
 
 
3099
 
AC_MSG_CHECKING(for uname.domainname)
3100
 
AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
3101
 
    [AC_TRY_COMPILE([#include <sys/utsname.h>],
3102
 
        [ struct utsname *res; char *domain; 
3103
 
            (void)uname(res);  if (res != 0) { domain = res->domainname; } ],
3104
 
        [ac_cv_have_uname_domainname_field=true],
3105
 
        [ac_cv_have_uname_domainname_field=false])])
3106
 
 
3107
 
if test "$ac_cv_have_uname_domainname_field" = "true"; then
3108
 
    AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
3109
 
    AC_MSG_RESULT(yes)
3110
 
else
3111
 
    AC_MSG_RESULT(no)
3112
 
fi
3113
 
 
3114
 
AC_MSG_CHECKING(for uname.__domainname)
3115
 
AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
3116
 
    [AC_TRY_COMPILE([#include <sys/utsname.h>],
3117
 
        [ struct utsname *res; char *domain; 
3118
 
            (void)uname(res);  if (res != 0) { domain = res->__domainname; } ],
3119
 
        [ac_cv_have_uname_us_domainname_field=true],
3120
 
        [ac_cv_have_uname_us_domainname_field=false])])
3121
 
 
3122
 
if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
3123
 
    AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
3124
 
    AC_MSG_RESULT(yes)
3125
 
else
3126
 
    AC_MSG_RESULT(no)
3127
 
fi
3128
 
 
3129
 
AC_LANG_CPLUSPLUS
3130
 
 
3131
 
dnl Check for usable char16_t (2 bytes, unsigned)
3132
 
dnl (we might not need the unsignedness check anymore)
3133
 
AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
3134
 
    ac_cv_have_usable_char16_t,
3135
 
    [AC_TRY_COMPILE([$configure_static_assert_macros],
3136
 
                    [CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
3137
 
                     CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
3138
 
                     CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
3139
 
                     CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
3140
 
                     CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
3141
 
                    ac_cv_have_usable_char16_t="yes",
3142
 
                    ac_cv_have_usable_char16_t="no")])
3143
 
if test "$ac_cv_have_usable_char16_t" = "yes"; then
3144
 
    AC_DEFINE(HAVE_CPP_CHAR16_T)
3145
 
    HAVE_CPP_CHAR16_T=1
3146
 
fi
3147
 
 
3148
 
dnl Check for usable wchar_t (2 bytes, unsigned)
3149
 
dnl (we really don't need the unsignedness check anymore)
3150
 
dnl ========================================================
3151
 
 
3152
 
AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
3153
 
    ac_cv_have_usable_wchar_v2,
3154
 
    [AC_TRY_COMPILE([#include <stddef.h>
3155
 
                     $configure_static_assert_macros],
3156
 
                    [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
3157
 
                     CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
3158
 
                    ac_cv_have_usable_wchar_v2="yes",
3159
 
                    ac_cv_have_usable_wchar_v2="no")])
3160
 
if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
3161
 
    AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
3162
 
    HAVE_CPP_2BYTE_WCHAR_T=1
3163
 
elif test "$ac_cv_have_usable_char16_t" != "yes"; then
3164
 
dnl This is really gcc-only
3165
 
dnl Do this test using CXX only since some versions of gcc
3166
 
dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
3167
 
dnl only have short-wchar support for c++.
3168
 
dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
3169
 
 
3170
 
    _SAVE_CXXFLAGS=$CXXFLAGS
3171
 
    CXXFLAGS="$CXXFLAGS -fshort-wchar"
3172
 
 
3173
 
    AC_CACHE_CHECK(for compiler -fshort-wchar option, 
3174
 
        ac_cv_have_usable_wchar_option_v2,
3175
 
        [AC_TRY_LINK([#include <stddef.h>
3176
 
                      $configure_static_assert_macros],
3177
 
                     [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
3178
 
                      CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
3179
 
                     ac_cv_have_usable_wchar_option_v2="yes",
3180
 
                     ac_cv_have_usable_wchar_option_v2="no")])
3181
 
 
3182
 
    if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
3183
 
        AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
3184
 
        HAVE_CPP_2BYTE_WCHAR_T=1
3185
 
        if test "$OS_TARGET" = Android; then
3186
 
            WCHAR_CFLAGS="-fshort-wchar -Wl,--no-wchar-size-warning"
3187
 
            CXXFLAGS="$CXXFLAGS -Wl,--no-wchar-size-warning"
3188
 
            CFLAGS="$CFLAGS -Wl,--no-wchar-size-warning"
3189
 
            DSO_LDOPTS="$DSO_LDOPTS -Wl,--no-wchar-size-warning"
3190
 
        else
3191
 
            WCHAR_CFLAGS="-fshort-wchar"
3192
 
        fi
3193
 
    else    
3194
 
        CXXFLAGS=$_SAVE_CXXFLAGS
3195
 
    fi
3196
 
fi
3197
 
 
3198
 
AC_LANG_C
3199
 
 
3200
 
dnl Check for .hidden assembler directive and visibility attribute.
3201
 
dnl Borrowed from glibc configure.in
3202
 
dnl ===============================================================
3203
 
if test "$GNU_CC"; then
3204
 
  AC_CACHE_CHECK(for visibility(hidden) attribute,
3205
 
                 ac_cv_visibility_hidden,
3206
 
                 [cat > conftest.c <<EOF
3207
 
                  int foo __attribute__ ((visibility ("hidden"))) = 1;
3208
 
EOF
3209
 
                  ac_cv_visibility_hidden=no
3210
 
                  if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3211
 
                    if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
3212
 
                      ac_cv_visibility_hidden=yes
3213
 
                    fi
3214
 
                  fi
3215
 
                  rm -f conftest.[cs]
3216
 
                 ])
3217
 
  if test "$ac_cv_visibility_hidden" = "yes"; then
3218
 
    AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
3219
 
 
3220
 
    AC_CACHE_CHECK(for visibility(default) attribute,
3221
 
                   ac_cv_visibility_default,
3222
 
                   [cat > conftest.c <<EOF
3223
 
                    int foo __attribute__ ((visibility ("default"))) = 1;
3224
 
EOF
3225
 
                    ac_cv_visibility_default=no
3226
 
                    if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3227
 
                      if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
3228
 
                        ac_cv_visibility_default=yes
3229
 
                      fi
3230
 
                    fi
3231
 
                    rm -f conftest.[cs]
3232
 
                   ])
3233
 
    if test "$ac_cv_visibility_default" = "yes"; then
3234
 
      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
3235
 
 
3236
 
      AC_CACHE_CHECK(for visibility pragma support,
3237
 
                     ac_cv_visibility_pragma,
3238
 
                     [cat > conftest.c <<EOF
3239
 
#pragma GCC visibility push(hidden)
3240
 
                      int foo_hidden = 1;
3241
 
#pragma GCC visibility push(default)
3242
 
                      int foo_default = 1;
3243
 
EOF
3244
 
                      ac_cv_visibility_pragma=no
3245
 
                      if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3246
 
                        if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
3247
 
                          if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
3248
 
                            ac_cv_visibility_pragma=yes
3249
 
                          fi
3250
 
                        fi
3251
 
                      fi
3252
 
                      rm -f conftest.[cs]
3253
 
                    ])
3254
 
      if test "$ac_cv_visibility_pragma" = "yes"; then
3255
 
        AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
3256
 
                       ac_cv_have_visibility_class_bug,
3257
 
                       [cat > conftest.c <<EOF
3258
 
#pragma GCC visibility push(hidden)
3259
 
struct __attribute__ ((visibility ("default"))) TestStruct {
3260
 
  static void Init();
3261
 
};
3262
 
__attribute__ ((visibility ("default"))) void TestFunc() {
3263
 
  TestStruct::Init();
3264
 
}
3265
 
EOF
3266
 
                       ac_cv_have_visibility_class_bug=no
3267
 
                       if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3268
 
                         ac_cv_have_visibility_class_bug=yes
3269
 
                       else
3270
 
                         if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
3271
 
                           ac_cv_have_visibility_class_bug=yes
3272
 
                         fi
3273
 
                       fi
3274
 
                       rm -rf conftest.{c,S}
3275
 
                       ])
3276
 
 
3277
 
        AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
3278
 
                       ac_cv_have_visibility_builtin_bug,
3279
 
                       [cat > conftest.c <<EOF
3280
 
#pragma GCC visibility push(hidden)
3281
 
#pragma GCC visibility push(default)
3282
 
#include <string.h>
3283
 
#pragma GCC visibility pop
3284
 
 
3285
 
__attribute__ ((visibility ("default"))) void Func() {
3286
 
  char c[[100]];
3287
 
  memset(c, 0, sizeof(c));
3288
 
}
3289
 
EOF
3290
 
                       ac_cv_have_visibility_builtin_bug=no
3291
 
                       if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3292
 
                         ac_cv_have_visibility_builtin_bug=yes
3293
 
                       else
3294
 
                         if test `grep -c "@PLT" conftest.S` = 0; then
3295
 
                           ac_cv_visibility_builtin_bug=yes
3296
 
                         fi
3297
 
                       fi
3298
 
                       rm -f conftest.{c,S}
3299
 
                       ])
3300
 
        if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
3301
 
                "$ac_cv_have_visibility_class_bug" = "no"; then
3302
 
          VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
3303
 
          WRAP_SYSTEM_INCLUDES=1
3304
 
          STL_FLAGS='-I$(DIST)/stl_wrappers'
3305
 
          WRAP_STL_INCLUDES=1
3306
 
        else
3307
 
          VISIBILITY_FLAGS='-fvisibility=hidden'
3308
 
        fi # have visibility pragma bug
3309
 
      fi   # have visibility pragma
3310
 
    fi     # have visibility(default) attribute
3311
 
  fi       # have visibility(hidden) attribute
3312
 
fi         # GNU_CC
3313
 
 
3314
 
# visibility hidden flag for Sun Studio on Solaris
3315
 
if test "$SOLARIS_SUNPRO_CC"; then
3316
 
VISIBILITY_FLAGS='-xldscope=hidden'
3317
 
fi         # Sun Studio on Solaris
3318
 
 
3319
 
AC_SUBST(WRAP_SYSTEM_INCLUDES)
3320
 
AC_SUBST(VISIBILITY_FLAGS)
3321
 
 
3322
 
dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
3323
 
dnl ========================================================
3324
 
if test "$GNU_CC"; then
3325
 
  CFLAGS_save="${CFLAGS}"
3326
 
  CFLAGS="${CFLAGS} -Werror"
3327
 
  AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute,
3328
 
                 ac_cv_force_align_arg_pointer,
3329
 
                 [AC_TRY_COMPILE([__attribute__ ((__force_align_arg_pointer__)) void test() {}],
3330
 
                                 [],
3331
 
                                 ac_cv_force_align_arg_pointer="yes",
3332
 
                                 ac_cv_force_align_arg_pointer="no")])
3333
 
  CFLAGS="${CFLAGS_save}"
3334
 
  if test "$ac_cv_force_align_arg_pointer" = "yes"; then
3335
 
    HAVE_GCC_ALIGN_ARG_POINTER=1
3336
 
  else
3337
 
    HAVE_GCC_ALIGN_ARG_POINTER=
3338
 
  fi
3339
 
fi
3340
 
AC_SUBST(HAVE_GCC_ALIGN_ARG_POINTER)
3341
 
 
3342
 
dnl Checks for header files.
3343
 
dnl ========================================================
3344
 
AC_HEADER_DIRENT
3345
 
case "$target_os" in
3346
 
freebsd*)
3347
 
# for stuff like -lXshm
3348
 
    CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3349
 
    ;;
3350
 
esac
3351
 
MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3352
 
MOZ_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3353
 
MOZ_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3354
 
MOZ_CHECK_HEADERS(malloc.h)
3355
 
MOZ_CHECK_HEADERS(X11/XKBlib.h)
3356
 
MOZ_CHECK_HEADERS(io.h)
3357
 
 
3358
 
dnl These are all the places some variant of statfs can be hiding.
3359
 
MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3360
 
 
3361
 
dnl Quota support
3362
 
MOZ_CHECK_HEADERS(sys/quota.h)
3363
 
MOZ_CHECK_HEADERS(linux/quota.h)
3364
 
 
3365
 
dnl Try for MMX support
3366
 
dnl NB - later gcc versions require -mmmx for this header to be successfully
3367
 
dnl included (or another option which implies it, such as -march=pentium-mmx)
3368
 
MOZ_CHECK_HEADERS(mmintrin.h)
3369
 
 
3370
 
dnl Check whether the compiler supports the new-style C++ standard
3371
 
dnl library headers (i.e. <new>) or needs the old "new.h"
3372
 
AC_LANG_CPLUSPLUS
3373
 
NEW_H=new.h
3374
 
MOZ_CHECK_HEADER(new, [NEW_H=new])
3375
 
AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
3376
 
AC_LANG_C
3377
 
 
3378
 
AC_ARG_ENABLE(dtrace,
3379
 
              [  --enable-dtrace         build with dtrace support if available (default=no)],
3380
 
              [enable_dtrace="yes"],)
3381
 
if test "x$enable_dtrace" = "xyes"; then
3382
 
  MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
3383
 
  if test -n "$HAVE_DTRACE"; then
3384
 
      AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3385
 
  else
3386
 
      AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3387
 
  fi
3388
 
fi
3389
 
AC_SUBST(HAVE_DTRACE)
3390
 
 
3391
 
case $target in
3392
 
*-aix4.3*|*-aix5*)
3393
 
        ;;
3394
 
*)
3395
 
        MOZ_CHECK_HEADERS(sys/cdefs.h)
3396
 
        ;;
3397
 
esac
3398
 
 
3399
 
dnl Checks for libraries.
3400
 
dnl ========================================================
3401
 
case $target in
3402
 
*-hpux11.*)
3403
 
        ;;
3404
 
*)
3405
 
        AC_CHECK_LIB(c_r, gethostbyname_r)
3406
 
        ;;
3407
 
esac
3408
 
 
3409
 
dnl We don't want to link with libdl even if it's present on OS X, since
3410
 
dnl it's not used and not part of the default installation. OS/2 has dlfcn
3411
 
dnl in libc.
3412
 
dnl We don't want to link against libm or libpthread on Darwin since
3413
 
dnl they both are just symlinks to libSystem and explicitly linking
3414
 
dnl against libSystem causes issues when debugging (see bug 299601).
3415
 
case $target in
3416
 
*-darwin*)
3417
 
    ;;
3418
 
*-os2*)
3419
 
    ;;
3420
 
*)
3421
 
    AC_SEARCH_LIBS(dlopen, dl, 
3422
 
        MOZ_CHECK_HEADER(dlfcn.h, 
3423
 
        AC_DEFINE(HAVE_DLOPEN)))
3424
 
    ;;
3425
 
esac
3426
 
 
3427
 
_SAVE_CFLAGS="$CFLAGS"
3428
 
CFLAGS="$CFLAGS -D_GNU_SOURCE"
3429
 
AC_CHECK_FUNCS(dladdr)
3430
 
CFLAGS="$_SAVE_CFLAGS"
3431
 
 
3432
 
if test ! "$GNU_CXX"; then
3433
 
 
3434
 
    case $target in
3435
 
    *-aix*)
3436
 
        AC_CHECK_LIB(C_r, demangle)
3437
 
        ;;
3438
 
     *)
3439
 
        AC_CHECK_LIB(C, demangle)
3440
 
        ;;
3441
 
     esac
3442
 
fi
3443
 
 
3444
 
dnl OS/2 has socket in libc.
3445
 
case $target in
3446
 
*-os2*)
3447
 
    ;;
3448
 
*)
3449
 
    AC_CHECK_LIB(socket, socket)
3450
 
esac
3451
 
 
3452
 
dnl ========================================================
3453
 
dnl Check whether we can compile code for Core Text
3454
 
dnl (available on Mac OS X 10.5 or later)
3455
 
dnl ========================================================
3456
 
case "$target" in
3457
 
*-darwin*)
3458
 
  AC_MSG_CHECKING([for Core Text])
3459
 
  AC_TRY_COMPILE([#include <ApplicationServices/ApplicationServices.h>],
3460
 
                 [CTLineRef lineRef;],
3461
 
                  ac_cv_have_core_text="yes",
3462
 
                  ac_cv_have_core_text="no")
3463
 
  AC_MSG_RESULT([$ac_cv_have_core_text])
3464
 
 
3465
 
  if test "$ac_cv_have_core_text" = "no"; then
3466
 
    AC_MSG_ERROR([Core Text is required (available on Mac OS X 10.5 or later).])
3467
 
  fi
3468
 
  ;;
3469
 
esac
3470
 
 
3471
 
XLDFLAGS="$X_LIBS"
3472
 
XLIBS="$X_EXTRA_LIBS"
3473
 
 
3474
 
dnl ========================================================
3475
 
dnl Checks for X libraries.
3476
 
dnl Ordering is important.
3477
 
dnl Xt is dependent upon SM as of X11R6
3478
 
dnl ========================================================
3479
 
if test "$no_x" = "yes"; then
3480
 
    AC_DEFINE(NO_X11)
3481
 
else
3482
 
    AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3483
 
        XLIBS="-lX11 $XLIBS"
3484
 
        _SAVE_LDFLAGS="$LDFLAGS"
3485
 
        LDFLAGS="$XLDFLAGS $LDFLAGS"
3486
 
        AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3487
 
                [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3488
 
        AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3489
 
                [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3490
 
     
3491
 
        AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3492
 
        unset ac_cv_lib_Xt_XtFree
3493
 
            AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3494
 
            AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS) 
3495
 
        AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3496
 
                    [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3497
 
        ])
3498
 
 
3499
 
    # AIX needs the motif library linked before libXt to prevent
3500
 
    # crashes in plugins linked against Motif - Bug #98892
3501
 
    case "${target_os}" in
3502
 
    aix*)
3503
 
        XT_LIBS="-lXm $XT_LIBS"
3504
 
        ;;
3505
 
    esac
3506
 
 
3507
 
    dnl ========================================================
3508
 
    dnl = Check for XShm
3509
 
    dnl ========================================================
3510
 
    AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3511
 
        $XLIBS $XEXT_LIBS)
3512
 
    MOZ_CHECK_HEADER(X11/extensions/XShm.h)
3513
 
    if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3514
 
        test -n "$_HAVE_XSHM_XEXT"; then
3515
 
        AC_DEFINE(HAVE_XSHM)
3516
 
    fi
3517
 
 
3518
 
    dnl ========================================================
3519
 
    dnl = Check for Xss
3520
 
    dnl ========================================================
3521
 
    MOZ_CHECK_HEADER(X11/extensions/scrnsaver.h,
3522
 
        AC_CHECK_LIB(Xss, XScreenSaverQueryInfo,
3523
 
            [XSS_LIBS="-lXss $XEXT_LIBS $XLIBS"
3524
 
             AC_DEFINE(HAVE_LIBXSS)],, $XEXT_LIBS $XLIBS))
3525
 
 
3526
 
    dnl ========================================================
3527
 
    dnl = Check for XIE
3528
 
    dnl ========================================================
3529
 
    AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3530
 
        $XLIBS $XEXT_LIBS)
3531
 
    MOZ_CHECK_HEADER(X11/extensions/XIElib.h)
3532
 
 
3533
 
    if test "$MOZ_XIE_LIBS"; then
3534
 
        dnl ====================================================
3535
 
        dnl = If XIE is present and is desired, turn it on
3536
 
        dnl ====================================================
3537
 
        case $target in
3538
 
            *-hpux*)
3539
 
                ;;
3540
 
            *)
3541
 
                HAVE_XIE=1
3542
 
                ;;
3543
 
        esac
3544
 
    fi
3545
 
 
3546
 
        LDFLAGS="$_SAVE_LDFLAGS"
3547
 
 
3548
 
    dnl ========================================================
3549
 
    dnl = Check for freetype2 and its functionality
3550
 
    dnl ========================================================
3551
 
    AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3552
 
 
3553
 
    if test "$_HAVE_FREETYPE2"; then
3554
 
        _SAVE_LIBS="$LIBS"
3555
 
        _SAVE_CFLAGS="$CFLAGS"
3556
 
        LIBS="$LIBS $FT2_LIBS"
3557
 
        CFLAGS="$CFLAGS $FT2_CFLAGS"
3558
 
 
3559
 
        AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3560
 
            ac_cv_member_FT_Bitmap_Size_y_ppem,
3561
 
            [AC_TRY_COMPILE([#include <ft2build.h>
3562
 
                             #include FT_FREETYPE_H],
3563
 
                            [FT_Bitmap_Size s;
3564
 
                             if (sizeof s.y_ppem) return 0;
3565
 
                             return 1],
3566
 
                            ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3567
 
                            ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3568
 
        if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3569
 
            HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3570
 
        else
3571
 
            HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3572
 
        fi
3573
 
        AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3574
 
                           $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3575
 
                           [FT_Bitmap_Size structure includes y_ppem field])
3576
 
 
3577
 
        AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3578
 
 
3579
 
        LIBS="$_SAVE_LIBS"
3580
 
        CFLAGS="$_SAVE_CFLAGS"
3581
 
    fi
3582
 
 
3583
 
fi # $no_x
3584
 
 
3585
 
AC_SUBST(XCFLAGS)
3586
 
AC_SUBST(XLDFLAGS)
3587
 
AC_SUBST(XLIBS)
3588
 
AC_SUBST(XEXT_LIBS)
3589
 
AC_SUBST(XT_LIBS)
3590
 
AC_SUBST(XSS_LIBS)
3591
 
 
3592
 
AC_MSG_CHECKING(for ARM SIMD support in compiler)
3593
 
# We try to link so that this also fails when
3594
 
# building with LTO.
3595
 
AC_TRY_LINK([],
3596
 
               [asm("uqadd8 r1, r1, r2");],
3597
 
               result="yes", result="no")
3598
 
AC_MSG_RESULT("$result")
3599
 
if test "$result" = "yes"; then
3600
 
    AC_DEFINE(HAVE_ARM_SIMD)
3601
 
    HAVE_ARM_SIMD=1
3602
 
fi
3603
 
AC_SUBST(HAVE_ARM_SIMD)
3604
 
 
3605
 
AC_MSG_CHECKING(for ARM NEON support in compiler)
3606
 
_SAVE_CFLAGS="$CFLAGS"
3607
 
if test "$GNU_CC"; then
3608
 
  # gcc needs -mfpu=neon to recognize NEON instructions
3609
 
  CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
3610
 
fi
3611
 
# We try to link so that this also fails when
3612
 
# building with LTO.
3613
 
AC_TRY_LINK([],
3614
 
               [asm("vadd.i8 d0, d0, d0");],
3615
 
               result="yes", result="no")
3616
 
AC_MSG_RESULT("$result")
3617
 
if test "$result" = "yes"; then
3618
 
    AC_DEFINE(HAVE_ARM_NEON)
3619
 
    HAVE_ARM_NEON=1
3620
 
fi
3621
 
CFLAGS="$_SAVE_CFLAGS"
3622
 
AC_SUBST(HAVE_ARM_NEON)
3623
 
 
3624
 
dnl ========================================================
3625
 
dnl = pthread support
3626
 
dnl = Start by checking whether the system support pthreads
3627
 
dnl ========================================================
3628
 
case "$target_os" in
3629
 
darwin*)
3630
 
    USE_PTHREADS=1
3631
 
    ;;
3632
 
*)
3633
 
    MOZ_CHECK_PTHREADS(pthreads,
3634
 
        USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3635
 
        MOZ_CHECK_PTHREADS(pthread,
3636
 
            USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3637
 
            MOZ_CHECK_PTHREADS(c_r,
3638
 
                USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3639
 
                MOZ_CHECK_PTHREADS(c,
3640
 
                    USE_PTHREADS=1
3641
 
                )
3642
 
            )
3643
 
        )
3644
 
    )
3645
 
    ;;
3646
 
esac
3647
 
 
3648
 
dnl ========================================================
3649
 
dnl Check the command line for --with-pthreads 
3650
 
dnl ========================================================
3651
 
MOZ_ARG_WITH_BOOL(pthreads,
3652
 
[  --with-pthreads         Force use of system pthread library with NSPR ],
3653
 
[ if test "$USE_PTHREADS"x = x; then
3654
 
    AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3655
 
fi],
3656
 
    USE_PTHREADS=
3657
 
    _PTHREAD_LDFLAGS=
3658
 
)
3659
 
 
3660
 
dnl ========================================================
3661
 
dnl Do the platform specific pthread hackery
3662
 
dnl ========================================================
3663
 
if test "$USE_PTHREADS"x != x
3664
 
then
3665
 
        dnl
3666
 
        dnl See if -pthread is supported.
3667
 
        dnl
3668
 
        rm -f conftest*
3669
 
        ac_cv_have_dash_pthread=no
3670
 
        AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3671
 
        echo 'int main() { return 0; }' | cat > conftest.c
3672
 
        ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3673
 
        if test $? -eq 0; then
3674
 
                if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3675
 
                        ac_cv_have_dash_pthread=yes
3676
 
                case "$target_os" in
3677
 
                freebsd*)
3678
 
# Freebsd doesn't use -pthread for compiles, it uses them for linking
3679
 
                ;;
3680
 
                *)
3681
 
                            CFLAGS="$CFLAGS -pthread"
3682
 
                            CXXFLAGS="$CXXFLAGS -pthread"
3683
 
                ;;
3684
 
                esac
3685
 
                fi
3686
 
        fi
3687
 
        rm -f conftest*
3688
 
    AC_MSG_RESULT($ac_cv_have_dash_pthread)
3689
 
 
3690
 
        dnl
3691
 
        dnl See if -pthreads is supported.
3692
 
        dnl
3693
 
    ac_cv_have_dash_pthreads=no
3694
 
    if test "$ac_cv_have_dash_pthread" = "no"; then
3695
 
            AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3696
 
        echo 'int main() { return 0; }' | cat > conftest.c
3697
 
            ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3698
 
        if test $? -eq 0; then
3699
 
                if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3700
 
                            ac_cv_have_dash_pthreads=yes
3701
 
                            CFLAGS="$CFLAGS -pthreads"
3702
 
                            CXXFLAGS="$CXXFLAGS -pthreads"
3703
 
                    fi
3704
 
            fi
3705
 
            rm -f conftest*
3706
 
        AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3707
 
    fi
3708
 
 
3709
 
        case "$target" in
3710
 
            *-*-freebsd*)
3711
 
                        AC_DEFINE(_REENTRANT)
3712
 
                        AC_DEFINE(_THREAD_SAFE)
3713
 
                        dnl -pthread links in -lc_r, so don't specify it explicitly.
3714
 
                        if test "$ac_cv_have_dash_pthread" = "yes"; then
3715
 
                                _PTHREAD_LDFLAGS="-pthread"
3716
 
                        else
3717
 
                                _PTHREAD_LDFLAGS="-lc_r"
3718
 
                        fi
3719
 
                        ;;
3720
 
 
3721
 
            *-*-openbsd*|*-*-bsdi*)
3722
 
                        AC_DEFINE(_REENTRANT)
3723
 
                        AC_DEFINE(_THREAD_SAFE)
3724
 
                        dnl -pthread links in -lc_r, so don't specify it explicitly.
3725
 
                        if test "$ac_cv_have_dash_pthread" = "yes"; then
3726
 
                _PTHREAD_LDFLAGS="-pthread"
3727
 
                        fi
3728
 
                        ;;
3729
 
 
3730
 
            *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
3731
 
                        AC_DEFINE(_REENTRANT) 
3732
 
                        ;;
3733
 
 
3734
 
            *-*-nto*) 
3735
 
                        AC_DEFINE(_REENTRANT) 
3736
 
                        ;;
3737
 
 
3738
 
            *-aix4.3*|*-aix5*)
3739
 
                        AC_DEFINE(_REENTRANT) 
3740
 
                        ;;
3741
 
 
3742
 
            *-hpux11.*)
3743
 
                        AC_DEFINE(_REENTRANT) 
3744
 
                        ;;
3745
 
 
3746
 
            alpha*-*-osf*)
3747
 
                        AC_DEFINE(_REENTRANT)
3748
 
                        ;;
3749
 
 
3750
 
            *-*-solaris*) 
3751
 
                        AC_DEFINE(_REENTRANT)
3752
 
                        if test "$SOLARIS_SUNPRO_CC"; then
3753
 
                                CFLAGS="$CFLAGS -mt" 
3754
 
                                CXXFLAGS="$CXXFLAGS -mt" 
3755
 
                        fi
3756
 
                        ;;
3757
 
        esac
3758
 
    LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3759
 
fi
3760
 
 
3761
 
dnl ========================================================
3762
 
dnl See if mmap sees writes
3763
 
dnl For cross compiling, just define it as no, which is a safe default
3764
 
dnl ========================================================
3765
 
AC_MSG_CHECKING(whether mmap() sees write()s)
3766
 
 
3767
 
changequote(,)
3768
 
mmap_test_prog='
3769
 
    #include <stdlib.h>
3770
 
    #include <unistd.h>
3771
 
    #include <sys/mman.h>
3772
 
    #include <sys/types.h>
3773
 
    #include <sys/stat.h>
3774
 
    #include <fcntl.h>
3775
 
 
3776
 
    char fname[] = "conftest.file";
3777
 
    char zbuff[1024]; /* Fractional page is probably worst case */
3778
 
 
3779
 
    int main() {
3780
 
        char *map;
3781
 
        int fd;
3782
 
        int i;
3783
 
        unlink(fname);
3784
 
        fd = open(fname, O_RDWR | O_CREAT, 0660);
3785
 
        if(fd<0) return 1;
3786
 
        unlink(fname);
3787
 
        write(fd, zbuff, sizeof(zbuff));
3788
 
        lseek(fd, 0, SEEK_SET);
3789
 
        map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3790
 
        if(map==(char*)-1) return 2;
3791
 
        for(i=0; fname[i]; i++) {
3792
 
            int rc = write(fd, &fname[i], 1);
3793
 
            if(map[i]!=fname[i]) return 4;
3794
 
        }
3795
 
        return 0;
3796
 
    }
3797
 
'
3798
 
changequote([,])
3799
 
 
3800
 
AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3801
 
 
3802
 
AC_MSG_RESULT("$result")
3803
 
 
3804
 
if test "$result" = "no"; then
3805
 
    AC_DEFINE(MMAP_MISSES_WRITES)
3806
 
fi
3807
 
 
3808
 
 
3809
 
dnl Checks for library functions.
3810
 
dnl ========================================================
3811
 
AC_PROG_GCC_TRADITIONAL
3812
 
AC_FUNC_MEMCMP
3813
 
AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3814
 
AC_CHECK_FUNCS(flockfile getpagesize)
3815
 
AC_CHECK_FUNCS(localtime_r strtok_r)
3816
 
 
3817
 
dnl check for clock_gettime(), the CLOCK_MONOTONIC clock, and -lrt
3818
 
_SAVE_LDFLAGS=$LDFLAGS
3819
 
LDFLAGS="$LDFLAGS -lrt"
3820
 
AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC) and -lrt,
3821
 
               ac_cv_have_clock_monotonic,
3822
 
               [AC_TRY_LINK([#include <time.h>],
3823
 
                            [ struct timespec ts;
3824
 
                              clock_gettime(CLOCK_MONOTONIC, &ts); ],
3825
 
                            ac_cv_have_clock_monotonic=yes,
3826
 
                            ac_cv_have_clock_monotonic=no)])
3827
 
LDFLAGS=$_SAVE_LDFLAGS
3828
 
if test "$ac_cv_have_clock_monotonic" = "yes"; then
3829
 
    HAVE_CLOCK_MONOTONIC=1
3830
 
    REALTIME_LIBS=-lrt
3831
 
    AC_DEFINE(HAVE_CLOCK_MONOTONIC)
3832
 
    AC_SUBST(HAVE_CLOCK_MONOTONIC)
3833
 
    AC_SUBST(REALTIME_LIBS)
3834
 
fi
3835
 
 
3836
 
dnl check for wcrtomb/mbrtowc
3837
 
dnl =======================================================================
3838
 
if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3839
 
AC_LANG_SAVE
3840
 
AC_LANG_CPLUSPLUS
3841
 
AC_CACHE_CHECK(for wcrtomb,
3842
 
    ac_cv_have_wcrtomb,
3843
 
    [AC_TRY_LINK([#include <wchar.h>],
3844
 
                 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3845
 
                 ac_cv_have_wcrtomb="yes",
3846
 
                 ac_cv_have_wcrtomb="no")])
3847
 
if test "$ac_cv_have_wcrtomb" = "yes"; then
3848
 
    AC_DEFINE(HAVE_WCRTOMB)
3849
 
fi
3850
 
AC_CACHE_CHECK(for mbrtowc,
3851
 
    ac_cv_have_mbrtowc,
3852
 
    [AC_TRY_LINK([#include <wchar.h>],
3853
 
                 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3854
 
                 ac_cv_have_mbrtowc="yes",
3855
 
                 ac_cv_have_mbrtowc="no")])
3856
 
if test "$ac_cv_have_mbrtowc" = "yes"; then
3857
 
    AC_DEFINE(HAVE_MBRTOWC)
3858
 
fi
3859
 
AC_LANG_RESTORE
3860
 
fi
3861
 
 
3862
 
AC_CACHE_CHECK(
3863
 
    [for res_ninit()],
3864
 
    ac_cv_func_res_ninit,
3865
 
    [AC_TRY_LINK([
3866
 
        #ifdef linux
3867
 
        #define _BSD_SOURCE 1
3868
 
        #endif
3869
 
        #include <resolv.h>
3870
 
        ],
3871
 
        [int foo = res_ninit(&_res);],
3872
 
        [ac_cv_func_res_ninit=yes],
3873
 
        [ac_cv_func_res_ninit=no])
3874
 
    ])
3875
 
 
3876
 
if test "$ac_cv_func_res_ninit" = "yes"; then
3877
 
    AC_DEFINE(HAVE_RES_NINIT)
3878
 
dnl must add the link line we do something as foolish as this... dougt
3879
 
dnl else
3880
 
dnl    AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3881
 
dnl        AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3882
 
fi
3883
 
 
3884
 
AC_LANG_CPLUSPLUS
3885
 
AC_CACHE_CHECK(
3886
 
    [for gnu_get_libc_version()],
3887
 
    ac_cv_func_gnu_get_libc_version,
3888
 
    [AC_TRY_LINK([
3889
 
        #ifdef HAVE_GNU_LIBC_VERSION_H
3890
 
        #include <gnu/libc-version.h>
3891
 
        #endif
3892
 
        ],
3893
 
        [const char *glibc_version = gnu_get_libc_version();],
3894
 
        [ac_cv_func_gnu_get_libc_version=yes],
3895
 
        [ac_cv_func_gnu_get_libc_version=no] 
3896
 
        )]
3897
 
    )
3898
 
 
3899
 
if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3900
 
    AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3901
 
fi
3902
 
 
3903
 
case $target_os in
3904
 
    darwin*|mingw*|os2*|wince*|winmo*)
3905
 
        ;;
3906
 
    *)
3907
 
    
3908
 
AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3909
 
    AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3910
 
        AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3911
 
_SAVE_LIBS=$LIBS
3912
 
LIBS="$LIBS $_ICONV_LIBS"
3913
 
AC_CACHE_CHECK(
3914
 
    [for iconv()],
3915
 
    ac_cv_func_iconv,
3916
 
    [AC_TRY_LINK([
3917
 
        #include <stdlib.h>
3918
 
        #include <iconv.h>
3919
 
        ],
3920
 
        [
3921
 
            iconv_t h = iconv_open("", "");
3922
 
            iconv(h, NULL, NULL, NULL, NULL);
3923
 
            iconv_close(h);
3924
 
        ],
3925
 
        [ac_cv_func_iconv=yes],
3926
 
        [ac_cv_func_iconv=no] 
3927
 
        )]
3928
 
    )
3929
 
if test "$ac_cv_func_iconv" = "yes"; then
3930
 
    AC_DEFINE(HAVE_ICONV)
3931
 
    DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3932
 
    LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3933
 
    LIBICONV="$_ICONV_LIBS"
3934
 
    AC_CACHE_CHECK(
3935
 
        [for iconv() with const input],
3936
 
        ac_cv_func_const_iconv,
3937
 
        [AC_TRY_COMPILE([
3938
 
            #include <stdlib.h>
3939
 
            #include <iconv.h>
3940
 
            ],
3941
 
            [
3942
 
                const char *input = "testing";
3943
 
                iconv_t h = iconv_open("", "");
3944
 
                iconv(h, &input, NULL, NULL, NULL);
3945
 
                iconv_close(h);
3946
 
            ],
3947
 
            [ac_cv_func_const_iconv=yes],
3948
 
            [ac_cv_func_const_iconv=no] 
3949
 
            )]
3950
 
        )
3951
 
    if test "$ac_cv_func_const_iconv" = "yes"; then
3952
 
        AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3953
 
    fi
3954
 
fi
3955
 
LIBS=$_SAVE_LIBS
3956
 
 
3957
 
    ;;
3958
 
esac
3959
 
 
3960
 
AM_LANGINFO_CODESET
3961
 
 
3962
 
AC_LANG_C
3963
 
 
3964
 
dnl **********************
3965
 
dnl *** va_copy checks ***
3966
 
dnl **********************
3967
 
dnl we currently check for all three va_copy possibilities, so we get
3968
 
dnl all results in config.log for bug reports.
3969
 
AC_MSG_CHECKING(for an implementation of va_copy())
3970
 
AC_CACHE_VAL(ac_cv_va_copy,[
3971
 
    AC_TRY_RUN([
3972
 
        #include <stdarg.h>
3973
 
        void f (int i, ...) {
3974
 
            va_list args1, args2;
3975
 
            va_start (args1, i);
3976
 
            va_copy (args2, args1);
3977
 
            if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3978
 
                exit (1);
3979
 
            va_end (args1); va_end (args2);
3980
 
        }
3981
 
        int main() { f (0, 42); return 0; }],
3982
 
        ac_cv_va_copy=yes,
3983
 
        ac_cv_va_copy=no,
3984
 
        ac_cv_va_copy=no
3985
 
    )
3986
 
])
3987
 
AC_MSG_RESULT($ac_cv_va_copy)
3988
 
AC_MSG_CHECKING(for an implementation of __va_copy())
3989
 
AC_CACHE_VAL(ac_cv___va_copy,[
3990
 
    AC_TRY_RUN([
3991
 
        #include <stdarg.h>
3992
 
        void f (int i, ...) {
3993
 
            va_list args1, args2;
3994
 
            va_start (args1, i);
3995
 
            __va_copy (args2, args1);
3996
 
            if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3997
 
                exit (1);
3998
 
            va_end (args1); va_end (args2);
3999
 
        }
4000
 
        int main() { f (0, 42); return 0; }],
4001
 
        ac_cv___va_copy=yes,
4002
 
        ac_cv___va_copy=no,
4003
 
        ac_cv___va_copy=no
4004
 
    )
4005
 
])
4006
 
AC_MSG_RESULT($ac_cv___va_copy)
4007
 
AC_MSG_CHECKING(whether va_lists can be copied by value)
4008
 
AC_CACHE_VAL(ac_cv_va_val_copy,[
4009
 
    AC_TRY_RUN([
4010
 
        #include <stdarg.h>
4011
 
        void f (int i, ...) {
4012
 
            va_list args1, args2;
4013
 
            va_start (args1, i);
4014
 
            args2 = args1;
4015
 
            if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
4016
 
                exit (1);
4017
 
            va_end (args1); va_end (args2);
4018
 
        }
4019
 
        int main() { f (0, 42); return 0; }],
4020
 
        ac_cv_va_val_copy=yes,
4021
 
        ac_cv_va_val_copy=no,
4022
 
        ac_cv_va_val_copy=yes
4023
 
    )
4024
 
])
4025
 
if test "x$ac_cv_va_copy" = "xyes"; then
4026
 
    AC_DEFINE(VA_COPY, va_copy)
4027
 
    AC_DEFINE(HAVE_VA_COPY)
4028
 
elif test "x$ac_cv___va_copy" = "xyes"; then
4029
 
    AC_DEFINE(VA_COPY, __va_copy)
4030
 
    AC_DEFINE(HAVE_VA_COPY)
4031
 
fi
4032
 
 
4033
 
if test "x$ac_cv_va_val_copy" = "xno"; then
4034
 
   AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
4035
 
fi
4036
 
AC_MSG_RESULT($ac_cv_va_val_copy)
4037
 
 
4038
 
dnl Check for dll-challenged libc's.
4039
 
dnl This check is apparently only needed for Linux.
4040
 
case "$target" in
4041
 
        *-linux*)
4042
 
            dnl ===================================================================
4043
 
            _curdir=`pwd`
4044
 
            export _curdir
4045
 
            rm -rf conftest* _conftest
4046
 
            mkdir _conftest
4047
 
            cat >> conftest.C <<\EOF
4048
 
#include <stdio.h>
4049
 
#include <link.h>
4050
 
#include <dlfcn.h>
4051
 
#ifdef _dl_loaded
4052
 
void __dump_link_map(void) {
4053
 
  struct link_map *map = _dl_loaded;
4054
 
  while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
4055
 
}
4056
 
int main() {
4057
 
  dlopen("./conftest1.so",RTLD_LAZY);
4058
 
  dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
4059
 
  dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
4060
 
  dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
4061
 
  __dump_link_map();
4062
 
}
4063
 
#else
4064
 
/* _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).*/
4065
 
int main() { printf("./conftest1.so\n"); }
4066
 
#endif
4067
 
EOF
4068
 
 
4069
 
            $PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
4070
 
 
4071
 
            cat >> conftest1.C <<\EOF
4072
 
#include <stdio.h>
4073
 
void foo(void) {printf("foo in dll called\n");}
4074
 
EOF
4075
 
            ${CXX-g++} -fPIC -c -g conftest1.C
4076
 
            ${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
4077
 
            ${CXX-g++} -g conftest.C -o conftest -ldl
4078
 
            cp -f conftest1.so conftest _conftest
4079
 
            cd _conftest
4080
 
            if test `./conftest | grep conftest1.so | wc -l` -gt 1
4081
 
            then
4082
 
                echo
4083
 
                echo "*** Your libc has a bug that can result in loading the same dynamic"
4084
 
                echo "*** library multiple times.  This bug is known to be fixed in glibc-2.0.7-32"
4085
 
                echo "*** or later.  However, if you choose not to upgrade, the only effect"
4086
 
                echo "*** will be excessive memory usage at runtime."
4087
 
                echo
4088
 
            fi
4089
 
            cd ${_curdir}
4090
 
            rm -rf conftest* _conftest
4091
 
            dnl ===================================================================
4092
 
            ;;
4093
 
esac
4094
 
 
4095
 
dnl ===================================================================
4096
 
dnl ========================================================
4097
 
dnl Put your C++ language/feature checks below
4098
 
dnl ========================================================
4099
 
AC_LANG_CPLUSPLUS
4100
 
 
4101
 
ARM_ABI_PREFIX=
4102
 
HAVE_GCC3_ABI=
4103
 
if test "$GNU_CC"; then
4104
 
  if test "$CPU_ARCH" = "arm" ; then
4105
 
    AC_CACHE_CHECK(for ARM EABI,
4106
 
        ac_cv_gcc_arm_eabi,
4107
 
        [AC_TRY_COMPILE([],
4108
 
                        [
4109
 
#if defined(__ARM_EABI__)
4110
 
  return 0;
4111
 
#else
4112
 
#error Not ARM EABI.
4113
 
#endif
4114
 
                        ],
4115
 
                        ac_cv_gcc_arm_eabi="yes",
4116
 
                        ac_cv_gcc_arm_eabi="no")])
4117
 
    if test "$ac_cv_gcc_arm_eabi" = "yes"; then
4118
 
        HAVE_ARM_EABI=1
4119
 
        ARM_ABI_PREFIX=eabi-
4120
 
    else
4121
 
        ARM_ABI_PREFIX=oabi-
4122
 
    fi
4123
 
  fi
4124
 
 
4125
 
  AC_CACHE_CHECK(for gcc 3.0 ABI,
4126
 
      ac_cv_gcc_three_abi,
4127
 
      [AC_TRY_COMPILE([],
4128
 
                      [
4129
 
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
4130
 
  return 0;
4131
 
#else
4132
 
#error Not gcc3.
4133
 
#endif
4134
 
                      ],
4135
 
                      ac_cv_gcc_three_abi="yes",
4136
 
                      ac_cv_gcc_three_abi="no")])
4137
 
  if test "$ac_cv_gcc_three_abi" = "yes"; then
4138
 
      TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
4139
 
      HAVE_GCC3_ABI=1
4140
 
  else
4141
 
      TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc2}"
4142
 
  fi
4143
 
fi
4144
 
AC_SUBST(HAVE_GCC3_ABI)
4145
 
 
4146
 
 
4147
 
AC_CACHE_CHECK(for C++ \"explicit\" keyword,
4148
 
               ac_cv_cpp_explicit,
4149
 
               [AC_TRY_COMPILE(class X {
4150
 
                               public: explicit X(int i) : i_(i) {}
4151
 
                               private: int i_;
4152
 
                               };,
4153
 
                               X x(3);,
4154
 
                               ac_cv_cpp_explicit=yes,
4155
 
                               ac_cv_cpp_explicit=no)])
4156
 
if test "$ac_cv_cpp_explicit" = yes ; then
4157
 
   AC_DEFINE(HAVE_CPP_EXPLICIT)
4158
 
fi
4159
 
 
4160
 
AC_CACHE_CHECK(for C++ \"typename\" keyword,
4161
 
               ac_cv_cpp_typename,
4162
 
               [AC_TRY_COMPILE(class param {
4163
 
                               public:
4164
 
                                   typedef unsigned long num_type;
4165
 
                               };
4166
 
 
4167
 
                               template <class T> class tplt {
4168
 
                               public:
4169
 
                                   typedef typename T::num_type t_num_type;
4170
 
                                   t_num_type foo(typename T::num_type num) {
4171
 
                                       return num;
4172
 
                                   }
4173
 
                               };,
4174
 
                               tplt<param> A;
4175
 
                               A.foo(0);,
4176
 
                               ac_cv_cpp_typename=yes,
4177
 
                               ac_cv_cpp_typename=no)])
4178
 
if test "$ac_cv_cpp_typename" = yes ; then
4179
 
   AC_DEFINE(HAVE_CPP_TYPENAME)
4180
 
fi
4181
 
 
4182
 
dnl Check for support of modern template specialization syntax
4183
 
dnl Test code and requirement from scc@netscape.com.
4184
 
dnl Autoconf cut-and-paste job by waterson@netscape.com
4185
 
AC_CACHE_CHECK(for modern C++ template specialization syntax support,
4186
 
               ac_cv_cpp_modern_specialize_template_syntax,
4187
 
               [AC_TRY_COMPILE(template <class T> struct X { int a; };
4188
 
                               class Y {};
4189
 
                               template <> struct X<Y> { double a; };,
4190
 
                               X<int> int_x;
4191
 
                               X<Y> y_x;,
4192
 
                               ac_cv_cpp_modern_specialize_template_syntax=yes,
4193
 
                               ac_cv_cpp_modern_specialize_template_syntax=no)])
4194
 
if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
4195
 
  AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
4196
 
fi
4197
 
 
4198
 
 
4199
 
dnl Some compilers support only full specialization, and some don't.
4200
 
AC_CACHE_CHECK(whether partial template specialization works,
4201
 
               ac_cv_cpp_partial_specialization,
4202
 
               [AC_TRY_COMPILE(template <class T> class Foo {};
4203
 
                               template <class T> class Foo<T*> {};,
4204
 
                               return 0;,
4205
 
                               ac_cv_cpp_partial_specialization=yes,
4206
 
                               ac_cv_cpp_partial_specialization=no)])
4207
 
if test "$ac_cv_cpp_partial_specialization" = yes ; then
4208
 
  AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
4209
 
fi
4210
 
 
4211
 
dnl Some compilers have limited support for operators with templates;
4212
 
dnl specifically, it is necessary to define derived operators when a base
4213
 
dnl class's operator declaration should suffice.
4214
 
AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
4215
 
               ac_cv_need_derived_template_operators,
4216
 
               [AC_TRY_COMPILE([template <class T> class Base { };
4217
 
                                template <class T>
4218
 
                                Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
4219
 
                                template <class T> class Derived : public Base<T> { };],
4220
 
                               [Derived<char> a, b;
4221
 
                                Base<char> c = a + b;
4222
 
                                return 0;],
4223
 
                               ac_cv_need_derived_template_operators=no,
4224
 
                               ac_cv_need_derived_template_operators=yes)])
4225
 
if test "$ac_cv_need_derived_template_operators" = yes ; then
4226
 
  AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
4227
 
fi
4228
 
 
4229
 
 
4230
 
dnl Some compilers have trouble detecting that a template class
4231
 
dnl that derives from another template is actually an instance
4232
 
dnl of the base class. This test checks for that.
4233
 
AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
4234
 
               ac_cv_need_cpp_template_cast_to_base,
4235
 
               [AC_TRY_COMPILE([template <class T> class Base { };
4236
 
                                template <class T> class Derived : public Base<T> { };
4237
 
                                template <class T> int foo(const Base<T>&) { return 0; }],
4238
 
                               [Derived<char> bar; return foo(bar);],
4239
 
                               ac_cv_need_cpp_template_cast_to_base=no,
4240
 
                               ac_cv_need_cpp_template_cast_to_base=yes)])
4241
 
if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
4242
 
  AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
4243
 
fi
4244
 
 
4245
 
dnl Some compilers have trouble resolving the ambiguity between two
4246
 
dnl functions whose arguments differ only by cv-qualifications.
4247
 
AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
4248
 
               ac_cv_can_resolve_const_ambiguity,
4249
 
               [AC_TRY_COMPILE([
4250
 
                                template <class T> class ptrClass {
4251
 
                                  public: T* ptr;
4252
 
                                };
4253
 
 
4254
 
                                template <class T> T* a(ptrClass<T> *arg) {
4255
 
                                  return arg->ptr;
4256
 
                                }
4257
 
 
4258
 
                                template <class T>
4259
 
                                const T* a(const ptrClass<T> *arg) {
4260
 
                                  return arg->ptr;
4261
 
                                }
4262
 
                               ],
4263
 
                               [ ptrClass<int> i;
4264
 
                                 a(&i); ],
4265
 
                               ac_cv_can_resolve_const_ambiguity=yes,
4266
 
                               ac_cv_can_resolve_const_ambiguity=no)])
4267
 
if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
4268
 
  AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
4269
 
fi
4270
 
 
4271
 
dnl
4272
 
dnl We don't do exceptions on unix.  The only reason this used to be here
4273
 
dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses 
4274
 
dnl exceptions.  But, we turn exceptions off by default and this test breaks.
4275
 
dnl So im commenting this out until someone writes some artificial 
4276
 
dnl intelligence to detect not only if the compiler has exceptions, but if 
4277
 
dnl they are enabled as well.
4278
 
dnl 
4279
 
dnl AC_CACHE_CHECK(for C++ \"exceptions\",
4280
 
dnl                ac_cv_cpp_exceptions,
4281
 
dnl                [AC_TRY_COMPILE(class X { public: X() {} };
4282
 
dnl                                static void F() { throw X(); },
4283
 
dnl                                try { F(); } catch(X & e) { },
4284
 
dnl                                ac_cv_cpp_exceptions=yes,
4285
 
dnl                                ac_cv_cpp_exceptions=no)])
4286
 
dnl if test $ac_cv_cpp_exceptions = yes ; then
4287
 
dnl    AC_DEFINE(HAVE_CPP_EXCEPTIONS)
4288
 
dnl fi
4289
 
 
4290
 
dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
4291
 
dnl supports it well enough to allow us to use it to change access, but not
4292
 
dnl to resolve ambiguity. The next two tests determine how well the |using|
4293
 
dnl keyword is supported.
4294
 
dnl
4295
 
dnl Check to see if we can change access with |using|.  Test both a
4296
 
dnl legal and an illegal example.
4297
 
AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
4298
 
               ac_cv_cpp_access_changing_using2,
4299
 
               [AC_TRY_COMPILE(
4300
 
                   class A { protected: int foo() { return 0; } };
4301
 
                   class B : public A { public: using A::foo; };,
4302
 
                   B b; return b.foo();,
4303
 
                   [AC_TRY_COMPILE(
4304
 
                       class A { public: int foo() { return 1; } };
4305
 
                       class B : public A { private: using A::foo; };,
4306
 
                       B b; return b.foo();,
4307
 
                       ac_cv_cpp_access_changing_using2=no,
4308
 
                       ac_cv_cpp_access_changing_using2=yes)],
4309
 
                   ac_cv_cpp_access_changing_using2=no)])
4310
 
if test "$ac_cv_cpp_access_changing_using2" = yes ; then
4311
 
   AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
4312
 
fi
4313
 
 
4314
 
dnl Check to see if we can resolve ambiguity with |using|.
4315
 
AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
4316
 
               ac_cv_cpp_ambiguity_resolving_using,
4317
 
               [AC_TRY_COMPILE(class X { 
4318
 
                                 public: int go(const X&) {return 3;}
4319
 
                                         int jo(const X&) {return 3;}
4320
 
                               };
4321
 
                               class Y : public X {
4322
 
                                 public:  int go(int) {return 2;}
4323
 
                                          int jo(int) {return 2;}
4324
 
                                          using X::jo;
4325
 
                                 private: using X::go;
4326
 
                               };,
4327
 
                               X x; Y y; y.jo(x);,
4328
 
                               ac_cv_cpp_ambiguity_resolving_using=yes,
4329
 
                               ac_cv_cpp_ambiguity_resolving_using=no)])
4330
 
if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
4331
 
   AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
4332
 
fi
4333
 
 
4334
 
dnl Check to see if the |std| namespace is supported. If so, we'll want
4335
 
dnl to qualify any standard library calls with "std::" to ensure that
4336
 
dnl those functions can be resolved.
4337
 
AC_CACHE_CHECK(for \"std::\" namespace,
4338
 
               ac_cv_cpp_namespace_std,
4339
 
               [AC_TRY_COMPILE([#include <algorithm>],
4340
 
                               [return std::min(0, 1);],
4341
 
                               ac_cv_cpp_namespace_std=yes,
4342
 
                               ac_cv_cpp_namespace_std=no)])
4343
 
if test "$ac_cv_cpp_namespace_std" = yes ; then
4344
 
   AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
4345
 
fi
4346
 
 
4347
 
dnl Older compilers are overly ambitious with respect to using the standard
4348
 
dnl template library's |operator!=()| when |operator==()| is defined. In
4349
 
dnl which case, defining |operator!=()| in addition to |operator==()| causes
4350
 
dnl ambiguity at compile-time. This test checks for that case.
4351
 
AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
4352
 
               ac_cv_cpp_unambiguous_std_notequal,
4353
 
               [AC_TRY_COMPILE([#include <algorithm>
4354
 
                                struct T1 {};
4355
 
                                int operator==(const T1&, const T1&) { return 0; }
4356
 
                                int operator!=(const T1&, const T1&) { return 0; }],
4357
 
                               [T1 a,b; return a != b;],
4358
 
                               ac_cv_cpp_unambiguous_std_notequal=unambiguous,
4359
 
                               ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
4360
 
if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
4361
 
  AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
4362
 
fi
4363
 
 
4364
 
 
4365
 
AC_CACHE_CHECK(for C++ reinterpret_cast,
4366
 
               ac_cv_cpp_reinterpret_cast,
4367
 
               [AC_TRY_COMPILE(struct X { int i; };
4368
 
                               struct Y { int i; };,
4369
 
                               X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
4370
 
                               ac_cv_cpp_reinterpret_cast=yes,
4371
 
                               ac_cv_cpp_reinterpret_cast=no)])
4372
 
if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
4373
 
   AC_DEFINE(HAVE_CPP_NEW_CASTS)
4374
 
fi
4375
 
 
4376
 
dnl See if a dynamic_cast to void* gives the most derived object.
4377
 
AC_CACHE_CHECK(for C++ dynamic_cast to void*,
4378
 
               ac_cv_cpp_dynamic_cast_void_ptr,
4379
 
               [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
4380
 
                            class Y { int j; public: virtual ~Y() { } };
4381
 
                            class Z : public X, public Y { int k; };
4382
 
 
4383
 
                            int main() {
4384
 
                                 Z mdo;
4385
 
                                 X *subx = (X*)&mdo;
4386
 
                                 Y *suby = (Y*)&mdo;
4387
 
                                 return !((((void*)&mdo != (void*)subx) &&
4388
 
                                           ((void*)&mdo == dynamic_cast<void*>(subx))) ||
4389
 
                                          (((void*)&mdo != (void*)suby) &&
4390
 
                                           ((void*)&mdo == dynamic_cast<void*>(suby))));
4391
 
                            }],
4392
 
                           ac_cv_cpp_dynamic_cast_void_ptr=yes,
4393
 
                           ac_cv_cpp_dynamic_cast_void_ptr=no,
4394
 
                           ac_cv_cpp_dynamic_cast_void_ptr=no)])
4395
 
if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
4396
 
   AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
4397
 
fi
4398
 
 
4399
 
 
4400
 
dnl note that this one is reversed - if the test fails, then
4401
 
dnl we require implementations of unused virtual methods. Which
4402
 
dnl really blows because it means we'll have useless vtable
4403
 
dnl bloat.
4404
 
AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
4405
 
               ac_cv_cpp_unused_required,
4406
 
               [AC_TRY_LINK(class X {private: virtual void never_called();};,
4407
 
                               X x;,
4408
 
                               ac_cv_cpp_unused_required=no,
4409
 
                               ac_cv_cpp_unused_required=yes)])
4410
 
if test "$ac_cv_cpp_unused_required" = yes ; then
4411
 
   AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
4412
 
fi
4413
 
 
4414
 
 
4415
 
dnl Some compilers have trouble comparing a constant reference to a templatized
4416
 
dnl class to zero, and require an explicit operator==() to be defined that takes
4417
 
dnl an int. This test separates the strong from the weak.
4418
 
 
4419
 
AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
4420
 
               ac_cv_trouble_comparing_to_zero,
4421
 
               [AC_TRY_COMPILE([#include <algorithm>
4422
 
                                template <class T> class Foo {};
4423
 
                                class T2;
4424
 
                                template <class T> int operator==(const T2*, const T&) { return 0; }
4425
 
                                template <class T> int operator!=(const T2*, const T&) { return 0; }],
4426
 
                               [Foo<int> f; return (0 != f);],
4427
 
                               ac_cv_trouble_comparing_to_zero=no,
4428
 
                               ac_cv_trouble_comparing_to_zero=yes)])
4429
 
if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
4430
 
  AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
4431
 
fi
4432
 
 
4433
 
# try harder, when checking for __thread support, see bug 521750 comment #33 and below
4434
 
_SAVE_LDFLAGS=$LDFLAGS
4435
 
LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS"
4436
 
AC_CACHE_CHECK(for __thread keyword for TLS variables,
4437
 
               ac_cv_thread_keyword,
4438
 
               [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
4439
 
                            [return tlsIsMainThread;],
4440
 
                            ac_cv_thread_keyword=yes,
4441
 
                            ac_cv_thread_keyword=no)])
4442
 
LDFLAGS=$_SAVE_LDFLAGS
4443
 
if test "$ac_cv_thread_keyword" = yes; then
4444
 
  # mips builds fail with TLS variables because of a binutils bug.
4445
 
  # See bug 528687
4446
 
  case "${target}" in
4447
 
    mips*-*)
4448
 
      :
4449
 
      ;;
4450
 
    *-android*)
4451
 
      :
4452
 
      ;;
4453
 
    *)
4454
 
      AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
4455
 
      ;;
4456
 
  esac
4457
 
fi
4458
 
 
4459
 
dnl Check for the existence of various allocation headers/functions
4460
 
 
4461
 
MALLOC_H=
4462
 
MOZ_CHECK_HEADER(malloc.h,        [MALLOC_H=malloc.h])
4463
 
if test "$MALLOC_H" = ""; then
4464
 
  MOZ_CHECK_HEADER(malloc/malloc.h, [MALLOC_H=malloc/malloc.h])
4465
 
  if test "$MALLOC_H" = ""; then
4466
 
    MOZ_CHECK_HEADER(sys/malloc.h,    [MALLOC_H=sys/malloc.h])
4467
 
  fi
4468
 
fi
4469
 
if test "$MALLOC_H" != ""; then
4470
 
   AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
4471
 
fi
4472
 
 
4473
 
MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc"
4474
 
AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)
4475
 
 
4476
 
dnl See if compiler supports some gcc-style attributes
4477
 
 
4478
 
AC_CACHE_CHECK(for __attribute__((always_inline)),
4479
 
               ac_cv_attribute_always_inline,
4480
 
               [AC_TRY_COMPILE([],
4481
 
                               [inline void f(void) __attribute__((always_inline));],
4482
 
                               ac_cv_attribute_always_inline=yes,
4483
 
                               ac_cv_attribute_always_inline=no)])
4484
 
 
4485
 
AC_CACHE_CHECK(for __attribute__((malloc)),
4486
 
               ac_cv_attribute_malloc,
4487
 
               [AC_TRY_COMPILE([],
4488
 
                               [void* f(int) __attribute__((malloc));],
4489
 
                               ac_cv_attribute_malloc=yes,
4490
 
                               ac_cv_attribute_malloc=no)])
4491
 
 
4492
 
AC_CACHE_CHECK(for __attribute__((warn_unused_result)),
4493
 
               ac_cv_attribute_warn_unused,
4494
 
               [AC_TRY_COMPILE([],
4495
 
                               [int f(void) __attribute__((warn_unused_result));],
4496
 
                               ac_cv_attribute_warn_unused=yes,
4497
 
                               ac_cv_attribute_warn_unused=no)])
4498
 
 
4499
 
AC_CACHE_CHECK(for __attribute__((noreturn)),
4500
 
               ac_cv_attribute_noreturn,
4501
 
               [AC_TRY_COMPILE([],
4502
 
                               [void f(void) __attribute__((noreturn));],
4503
 
                               ac_cv_attribute_noreturn=yes,
4504
 
                               ac_cv_attribute_noreturn=no)])
4505
 
 
4506
 
dnl End of C++ language/feature checks
4507
 
AC_LANG_C
4508
 
 
4509
 
dnl ========================================================
4510
 
dnl =  Internationalization checks
4511
 
dnl ========================================================
4512
 
dnl
4513
 
dnl Internationalization and Locale support is different
4514
 
dnl on various UNIX platforms.  Checks for specific i18n
4515
 
dnl features go here.
4516
 
 
4517
 
dnl check for LC_MESSAGES
4518
 
AC_CACHE_CHECK(for LC_MESSAGES,
4519
 
                ac_cv_i18n_lc_messages,
4520
 
                [AC_TRY_COMPILE([#include <locale.h>],
4521
 
                                [int category = LC_MESSAGES;],
4522
 
                                ac_cv_i18n_lc_messages=yes,
4523
 
                                ac_cv_i18n_lc_messages=no)])
4524
 
if test "$ac_cv_i18n_lc_messages" = yes; then
4525
 
   AC_DEFINE(HAVE_I18N_LC_MESSAGES)
4526
 
fi
4527
 
 
4528
 
AC_HAVE_FUNCS(localeconv)
4529
 
 
4530
 
fi # SKIP_COMPILER_CHECKS
4531
 
 
4532
 
TARGET_XPCOM_ABI=
4533
 
if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
4534
 
    TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4535
 
fi
4536
 
 
4537
 
dnl Mozilla specific options
4538
 
dnl ========================================================
4539
 
dnl The macros used for command line options
4540
 
dnl are defined in build/autoconf/altoptions.m4.
4541
 
 
4542
 
dnl If the compiler supports these attributes, define them as
4543
 
dnl convenience macros.
4544
 
if test "$ac_cv_attribute_always_inline" = yes ; then
4545
 
  AC_DEFINE(NS_ALWAYS_INLINE, [__attribute__((always_inline))])
4546
 
else
4547
 
  AC_DEFINE(NS_ALWAYS_INLINE,)
4548
 
fi
4549
 
 
4550
 
if test "$ac_cv_attribute_malloc" = yes ; then
4551
 
  AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))])
4552
 
else
4553
 
  AC_DEFINE(NS_ATTR_MALLOC,)
4554
 
fi
4555
 
 
4556
 
if test "$ac_cv_attribute_warn_unused" = yes ; then
4557
 
  AC_DEFINE(NS_WARN_UNUSED_RESULT, [__attribute__((warn_unused_result))])
4558
 
else
4559
 
  AC_DEFINE(NS_WARN_UNUSED_RESULT,)
4560
 
fi
4561
 
 
4562
 
if test "$ac_cv_attribute_noreturn" = yes ; then
4563
 
  AC_DEFINE(NS_NORETURN, [__attribute__((noreturn))])
4564
 
else
4565
 
  AC_DEFINE(NS_NORETURN,)
4566
 
fi
4567
 
 
4568
 
dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
4569
 
dnl features that Windows actually does support.
4570
 
 
4571
 
if test -n "$SKIP_COMPILER_CHECKS"; then
4572
 
   dnl Windows has malloc.h
4573
 
   AC_DEFINE(MALLOC_H, [<malloc.h>])
4574
 
   AC_DEFINE(HAVE_FORCEINLINE)
4575
 
   AC_DEFINE(HAVE_LOCALECONV)
4576
 
fi # SKIP_COMPILER_CHECKS
4577
 
 
4578
 
dnl ========================================================
4579
 
dnl =
4580
 
dnl = Check for external package dependencies
4581
 
dnl =
4582
 
dnl ========================================================
4583
 
MOZ_ARG_HEADER(External Packages)
4584
 
 
4585
 
MOZ_ENABLE_LIBXUL=1
4586
 
 
4587
 
MOZ_ARG_WITH_STRING(libxul-sdk,
4588
 
[  --with-libxul-sdk=PFX   Use the libXUL SDK at <PFX>],
4589
 
  LIBXUL_SDK_DIR=$withval)
4590
 
 
4591
 
if test "$LIBXUL_SDK_DIR" = "yes"; then
4592
 
    AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4593
 
elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4594
 
    LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4595
 
 
4596
 
    if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
4597
 
        AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
4598
 
    fi
4599
 
 
4600
 
    MOZ_ENABLE_LIBXUL=1
4601
 
fi
4602
 
AC_SUBST(LIBXUL_SDK)
4603
 
 
4604
 
if test -n "$LIBXUL_SDK"; then
4605
 
    LIBXUL_DIST="$LIBXUL_SDK"
4606
 
else
4607
 
    LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4608
 
fi
4609
 
AC_SUBST(LIBXUL_DIST)
4610
 
 
4611
 
SYSTEM_LIBXUL=
4612
 
 
4613
 
MOZ_ARG_WITH_BOOL(system-libxul,
4614
 
[  --with-system-libxul    Use system installed libxul SDK],
4615
 
    SYSTEM_LIBXUL=1)
4616
 
 
4617
 
if test -n "$SYSTEM_LIBXUL" -a -z "$MOZ_ENABLE_LIBXUL"; then
4618
 
    AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4619
 
fi
4620
 
 
4621
 
dnl ========================================================
4622
 
dnl = If NSPR was not detected in the system, 
4623
 
dnl = use the one in the source tree (mozilla/nsprpub)
4624
 
dnl ========================================================
4625
 
MOZ_ARG_WITH_BOOL(system-nspr,
4626
 
[  --with-system-nspr      Use system installed NSPR],
4627
 
    _USE_SYSTEM_NSPR=1 )
4628
 
 
4629
 
if test -n "$_USE_SYSTEM_NSPR"; then
4630
 
    AM_PATH_NSPR(4.8.7, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
4631
 
fi
4632
 
 
4633
 
if test -n "$MOZ_NATIVE_NSPR"; then
4634
 
    _SAVE_CFLAGS=$CFLAGS
4635
 
    CFLAGS="$CFLAGS $NSPR_CFLAGS"
4636
 
    AC_TRY_COMPILE([#include "prtypes.h"],
4637
 
                [#ifndef PR_STATIC_ASSERT
4638
 
                 #error PR_STATIC_ASSERT not defined or requires including prlog.h
4639
 
                 #endif],
4640
 
                [MOZ_NATIVE_NSPR=1],
4641
 
                AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it]))
4642
 
    CFLAGS=$_SAVE_CFLAGS
4643
 
else
4644
 
    if test "$OS_ARCH" = "WINCE"; then
4645
 
        NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4646
 
        NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4647
 
    elif test "$OS_ARCH" = "WINNT"; then
4648
 
        NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4649
 
        if test -n "$GNU_CC"; then
4650
 
            NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4651
 
        else
4652
 
            NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4653
 
        fi
4654
 
    else
4655
 
        NSPR_CFLAGS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4656
 
        NSPR_LIBS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4657
 
    fi
4658
 
fi
4659
 
 
4660
 
dnl system libevent Support
4661
 
dnl ========================================================
4662
 
MOZ_ARG_WITH_STRING(system-libevent,
4663
 
[  --with-system-libevent=[PFX]
4664
 
                          Use system libevent [installed at prefix PFX]],
4665
 
    LIBEVENT_DIR=$withval)
4666
 
 
4667
 
_SAVE_CFLAGS=$CFLAGS
4668
 
_SAVE_LDFLAGS=$LDFLAGS
4669
 
_SAVE_LIBS=$LIBS
4670
 
if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
4671
 
    MOZ_NATIVE_LIBEVENT=
4672
 
else
4673
 
    if test "${LIBEVENT_DIR}" = "yes"; then
4674
 
        LIBEVENT_DIR=/usr
4675
 
    fi
4676
 
    CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
4677
 
    LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
4678
 
    MOZ_CHECK_HEADER(event.h,
4679
 
        [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
4680
 
             AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
4681
 
         fi],
4682
 
        AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
4683
 
    AC_CHECK_LIB(event, event_init,
4684
 
                 [MOZ_NATIVE_LIBEVENT=1
4685
 
                  MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
4686
 
                  MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
4687
 
                 [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=])
4688
 
fi
4689
 
CFLAGS=$_SAVE_CFLAGS
4690
 
LDFLAGS=$_SAVE_LDFLAGS
4691
 
LIBS=$_SAVE_LIBS
4692
 
 
4693
 
AC_SUBST(MOZ_NATIVE_LIBEVENT)
4694
 
AC_SUBST(MOZ_LIBEVENT_INCLUDES)
4695
 
AC_SUBST(MOZ_LIBEVENT_LIBS)
4696
 
 
4697
 
dnl ========================================================
4698
 
dnl = If NSS was not detected in the system, 
4699
 
dnl = use the one in the source tree (mozilla/security/nss)
4700
 
dnl ========================================================
4701
 
 
4702
 
MOZ_ARG_WITH_BOOL(system-nss,
4703
 
[  --with-system-nss       Use system installed NSS],
4704
 
    _USE_SYSTEM_NSS=1 )
4705
 
 
4706
 
if test -n "$_USE_SYSTEM_NSS"; then
4707
 
    AM_PATH_NSS(3.12.9, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
4708
 
fi
4709
 
 
4710
 
if test -n "$MOZ_NATIVE_NSS"; then
4711
 
   NSS_LIBS="$NSS_LIBS -lcrmf"
4712
 
else
4713
 
   NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4714
 
   NSS_DEP_LIBS="\
4715
 
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4716
 
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4717
 
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4718
 
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4719
 
        \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX)"
4720
 
 
4721
 
   if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4722
 
       NSS_LIBS="\
4723
 
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4724
 
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \
4725
 
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \
4726
 
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \
4727
 
        \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)"
4728
 
   else
4729
 
       NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
4730
 
   fi
4731
 
fi
4732
 
 
4733
 
dnl ======================
4734
 
dnl Detect yasm
4735
 
dnl ======================
4736
 
 
4737
 
AC_MSG_CHECKING([for YASM assembler])
4738
 
AC_CHECK_PROGS(YASM, yasm, "")
4739
 
 
4740
 
if test -n "$YASM"; then
4741
 
  dnl Pull out yasm's version string
4742
 
  changequote(,)
4743
 
  _YASM_VER_FILTER='s|.* \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*|\1|p'
4744
 
  changequote([,])
4745
 
 
4746
 
  YASM_VERSION=`yasm --version | sed -ne "$_YASM_VER_FILTER"`
4747
 
  _YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'`
4748
 
  _YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'`
4749
 
  _YASM_RELEASE=`      echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'`
4750
 
  _YASM_BUILD=`        echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
4751
 
fi
4752
 
 
4753
 
if test -z "$SKIP_LIBRARY_CHECKS"; then
4754
 
dnl system JPEG support
4755
 
dnl ========================================================
4756
 
MOZ_ARG_WITH_STRING(system-jpeg,
4757
 
[  --with-system-jpeg[=PFX]
4758
 
                          Use system libjpeg [installed at prefix PFX]],
4759
 
    JPEG_DIR=$withval)
4760
 
 
4761
 
_SAVE_CFLAGS=$CFLAGS
4762
 
_SAVE_LDFLAGS=$LDFLAGS
4763
 
_SAVE_LIBS=$LIBS
4764
 
if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4765
 
    CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4766
 
    LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4767
 
fi
4768
 
if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4769
 
    SYSTEM_JPEG=
4770
 
else
4771
 
    AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4772
 
fi
4773
 
 
4774
 
if test "$SYSTEM_JPEG" = 1; then
4775
 
    LIBS="$JPEG_LIBS $LIBS"
4776
 
    AC_TRY_COMPILE([ #include <stdio.h>
4777
 
                     #include <sys/types.h>
4778
 
                     #include <jpeglib.h> ],
4779
 
                   [ #if JPEG_LIB_VERSION < $MOZJPEG
4780
 
                     #error "Insufficient JPEG library version ($MOZJPEG required)."
4781
 
                     #endif ],
4782
 
                   SYSTEM_JPEG=1,
4783
 
                   [SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=]) 
4784
 
fi 
4785
 
CFLAGS=$_SAVE_CFLAGS
4786
 
LDFLAGS=$_SAVE_LDFLAGS
4787
 
LIBS=$_SAVE_LIBS
4788
 
 
4789
 
if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4790
 
    JPEG_CFLAGS="-I${JPEG_DIR}/include"
4791
 
    JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4792
 
fi
4793
 
 
4794
 
dnl system ZLIB support
4795
 
dnl ========================================================
4796
 
MOZ_ARG_WITH_STRING(system-zlib,
4797
 
[  --with-system-zlib[=PFX]
4798
 
                          Use system libz [installed at prefix PFX]],
4799
 
    ZLIB_DIR=$withval)
4800
 
 
4801
 
_SAVE_CFLAGS=$CFLAGS
4802
 
_SAVE_LDFLAGS=$LDFLAGS
4803
 
_SAVE_LIBS=$LIBS
4804
 
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4805
 
    CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4806
 
    LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4807
 
fi
4808
 
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4809
 
    SYSTEM_ZLIB=
4810
 
else
4811
 
    AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"], 
4812
 
        [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4813
 
fi
4814
 
if test "$SYSTEM_ZLIB" = 1; then
4815
 
    LIBS="$ZLIB_LIBS $LIBS"
4816
 
    AC_TRY_COMPILE([ #include <stdio.h>
4817
 
                     #include <string.h>
4818
 
                     #include <zlib.h> ],
4819
 
                   [ #if ZLIB_VERNUM < $MOZZLIB 
4820
 
                     #error "Insufficient zlib version ($MOZZLIB required)."
4821
 
                     #endif ],
4822
 
                   SYSTEM_ZLIB=1,
4823
 
                   [SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=]) 
4824
 
fi
4825
 
CFLAGS=$_SAVE_CFLAGS
4826
 
LDFLAGS=$_SAVE_LDFLAGS
4827
 
LIBS=$_SAVE_LIBS
4828
 
 
4829
 
if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4830
 
    ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4831
 
    ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4832
 
fi
4833
 
 
4834
 
dnl system BZIP2 Support
4835
 
dnl ========================================================
4836
 
MOZ_ARG_WITH_STRING(system-bz2,
4837
 
[  --with-system-bz2[=PFX]
4838
 
                          Use system libbz2 [installed at prefix PFX]],
4839
 
    BZ2_DIR=$withval)
4840
 
 
4841
 
_SAVE_CFLAGS=$CFLAGS
4842
 
_SAVE_LDFLAGS=$LDFLAGS
4843
 
_SAVE_LIBS=$LIBS
4844
 
if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4845
 
    CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4846
 
    LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4847
 
fi
4848
 
if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4849
 
    SYSTEM_BZ2=
4850
 
else
4851
 
    AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4852
 
        [SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=])
4853
 
fi
4854
 
CFLAGS=$_SAVE_CFLAGS
4855
 
LDFLAGS=$_SAVE_LDFLAGS
4856
 
LIBS=$_SAVE_LIBS
4857
 
 
4858
 
if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4859
 
    BZ2_CFLAGS="-I${BZ2_DIR}/include"
4860
 
    BZ2_LIBS="-L${BZ2_DIR}/lib ${BZ2_LIBS}"
4861
 
fi
4862
 
 
4863
 
dnl system PNG Support
4864
 
dnl ========================================================
4865
 
MOZ_ARG_WITH_STRING(system-png, 
4866
 
[  --with-system-png[=PFX]
4867
 
                          Use system libpng [installed at prefix PFX]],
4868
 
    PNG_DIR=$withval)
4869
 
 
4870
 
_SAVE_CFLAGS=$CFLAGS
4871
 
_SAVE_LDFLAGS=$LDFLAGS
4872
 
_SAVE_LIBS=$LIBS
4873
 
CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4874
 
LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4875
 
if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4876
 
    CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4877
 
    LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4878
 
fi
4879
 
if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4880
 
    SYSTEM_PNG=
4881
 
else
4882
 
    _SAVE_PNG_LIBS=$PNG_LIBS
4883
 
    AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4884
 
                 AC_MSG_ERROR([--with-system-png requested but no working libpng found]), 
4885
 
                 $PNG_LIBS)
4886
 
    AC_CHECK_LIB(png, png_get_acTL, ,
4887
 
                 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4888
 
                 $_SAVE_PNG_LIBS)
4889
 
fi
4890
 
if test "$SYSTEM_PNG" = 1; then
4891
 
    LIBS="$PNG_LIBS $LIBS"
4892
 
    AC_TRY_COMPILE([ #include <stdio.h>
4893
 
                     #include <sys/types.h>
4894
 
                     #include <png.h> ],
4895
 
                   [ #if PNG_LIBPNG_VER < $MOZPNG
4896
 
                     #error "Insufficient libpng version ($MOZPNG required)."
4897
 
                     #endif
4898
 
                     #ifndef PNG_UINT_31_MAX
4899
 
                     #error "Insufficient libpng version."
4900
 
                     #endif ],
4901
 
                   SYSTEM_PNG=1,
4902
 
                   AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4903
 
fi
4904
 
CFLAGS=$_SAVE_CFLAGS
4905
 
LDFLAGS=$_SAVE_LDFLAGS
4906
 
LIBS=$_SAVE_LIBS
4907
 
 
4908
 
if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4909
 
    PNG_CFLAGS="-I${PNG_DIR}/include"
4910
 
    PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4911
 
fi
4912
 
 
4913
 
fi # SKIP_LIBRARY_CHECKS
4914
 
 
4915
 
dnl system HunSpell Support
4916
 
dnl ========================================================
4917
 
MOZ_ARG_ENABLE_BOOL(system-hunspell,
4918
 
[  --enable-system-hunspell
4919
 
                          Use system hunspell (located with pkgconfig)],
4920
 
    SYSTEM_HUNSPELL=1 )
4921
 
 
4922
 
if test -n "$SYSTEM_HUNSPELL"; then
4923
 
    PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4924
 
fi
4925
 
 
4926
 
AC_SUBST(SYSTEM_HUNSPELL)
4927
 
 
4928
 
dnl ========================================================
4929
 
dnl Java SDK support
4930
 
dnl ========================================================
4931
 
 
4932
 
JAVA_BIN_PATH=
4933
 
MOZ_ARG_WITH_STRING(java-bin-path,
4934
 
[  --with-java-bin-path=dir
4935
 
                          Location of Java binaries (java, javac, jar)],
4936
 
    JAVA_BIN_PATH=$withval)
4937
 
 
4938
 
dnl ========================================================
4939
 
dnl =
4940
 
dnl = Application
4941
 
dnl =
4942
 
dnl ========================================================
4943
 
 
4944
 
MOZ_ARG_HEADER(Application)
4945
 
 
4946
 
BUILD_STATIC_LIBS=
4947
 
ENABLE_TESTS=1
4948
 
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4949
 
MOZ_BRANDING_DIRECTORY=
4950
 
MOZ_OFFICIAL_BRANDING=
4951
 
MOZ_FEEDS=1
4952
 
MOZ_INSTALLER=1
4953
 
MOZ_JSDEBUGGER=1
4954
 
MOZ_MATHML=1
4955
 
MOZ_CSS_ANIMATIONS=1
4956
 
MOZ_MORK=
4957
 
MOZ_MORKREADER=1
4958
 
MOZ_AUTH_EXTENSION=1
4959
 
MOZ_NO_ACTIVEX_SUPPORT=1
4960
 
MOZ_NO_FAST_LOAD=
4961
 
MOZ_OGG=1
4962
 
MOZ_RAW=
4963
 
MOZ_SYDNEYAUDIO=
4964
 
MOZ_VORBIS=
4965
 
MOZ_TREMOR=
4966
 
MOZ_WAVE=1
4967
 
MOZ_MEDIA=
4968
 
MOZ_WEBM=1
4969
 
VPX_AS=
4970
 
VPX_ASFLAGS=
4971
 
VPX_AS_DASH_C_FLAG=
4972
 
VPX_AS_CONVERSION=
4973
 
VPX_ASM_SUFFIX=
4974
 
VPX_X86_ASM=
4975
 
VPX_ARM_ASM=
4976
 
MOZ_LIBJPEG_TURBO=1
4977
 
LIBJPEG_TURBO_AS=
4978
 
LIBJPEG_TURBO_ASFLAGS=
4979
 
LIBJPEG_TURBO_X86_ASM=
4980
 
LIBJPEG_TURBO_X64_ASM=
4981
 
MOZ_PANGO=1
4982
 
MOZ_PERMISSIONS=1
4983
 
MOZ_PLACES=1
4984
 
MOZ_PREF_EXTENSIONS=1
4985
 
MOZ_PROFILELOCKING=1
4986
 
MOZ_PSM=1
4987
 
MOZ_RDF=1
4988
 
MOZ_REFLOW_PERF=
4989
 
MOZ_SAFE_BROWSING=
4990
 
MOZ_FASTSTART=
4991
 
MOZ_HELP_VIEWER=
4992
 
MOZ_SPELLCHECK=1
4993
 
MOZ_SPLASHSCREEN=
4994
 
MOZ_STORAGE=1
4995
 
MOZ_SVG=1
4996
 
MOZ_THUMB2=
4997
 
MOZ_TIMELINE=
4998
 
MOZ_TOOLKIT_SEARCH=1
4999
 
MOZ_UI_LOCALE=en-US
5000
 
MOZ_UNIVERSALCHARDET=1
5001
 
MOZ_URL_CLASSIFIER=
5002
 
MOZ_XSLT_STANDALONE=
5003
 
MOZ_XTF=1
5004
 
MOZ_XUL=1
5005
 
MOZ_ZIPWRITER=1
5006
 
NS_PRINTING=1
5007
 
MOZ_PDF_PRINTING=
5008
 
MOZ_DISABLE_DOMCRYPTO=
5009
 
NSS_DISABLE_DBM=
5010
 
NECKO_WIFI=1
5011
 
NECKO_COOKIES=1
5012
 
NECKO_DISK_CACHE=1
5013
 
NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource wyciwyg"
5014
 
USE_ARM_KUSER=
5015
 
BUILD_CTYPES=1
5016
 
XPC_IDISPATCH_SUPPORT=
5017
 
 
5018
 
 
5019
 
case "${target}" in
5020
 
*android*|*darwin*|*wince*|*winmo*)
5021
 
    ACCESSIBILITY=
5022
 
    ;;
5023
 
*)
5024
 
    ACCESSIBILITY=1
5025
 
    ;;
5026
 
esac
5027
 
 
5028
 
case "$target_os" in
5029
 
    mingw*)
5030
 
        NS_ENABLE_TSF=1
5031
 
        if test -z "$GNU_CC"; then 
5032
 
            if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
5033
 
                NS_ENABLE_TSF=
5034
 
            fi
5035
 
        fi
5036
 
        if test -n "$NS_ENABLE_TSF"; then
5037
 
            AC_DEFINE(NS_ENABLE_TSF)
5038
 
        fi
5039
 
        ;;
5040
 
esac
5041
 
 
5042
 
case "${target}" in
5043
 
    arm-android-eabi)
5044
 
        NSS_DISABLE_DBM=1
5045
 
        USE_ARM_KUSER=1
5046
 
        MOZ_INSTALLER=
5047
 
        NECKO_WIFI=
5048
 
        MOZ_THUMB2=1
5049
 
        MOZ_THEME_FASTSTRIPE=1
5050
 
        MOZ_TREE_FREETYPE=1
5051
 
        MOZ_MEMORY=1
5052
 
        ;;
5053
 
esac
5054
 
 
5055
 
MOZ_ARG_ENABLE_STRING(application,
5056
 
[  --enable-application=APP
5057
 
                          Options include:
5058
 
                            browser (Firefox)
5059
 
                            xulrunner
5060
 
                            content/xslt (Standalone Transformiix XSLT)
5061
 
                            netwerk (Standalone Necko)
5062
 
                            tools/update-packaging (AUS-related packaging tools)
5063
 
                            standalone (use this for standalone
5064
 
                              xpcom/xpconnect or to manually drive a build)],
5065
 
[ MOZ_BUILD_APP=$enableval ] )
5066
 
 
5067
 
MOZ_ARG_WITH_STRING(xulrunner-stub-name,
5068
 
[  --with-xulrunner-stub-name=appname   Create the xulrunner stub with the given name],
5069
 
  XULRUNNER_STUB_NAME=$withval)
5070
 
 
5071
 
if test -z "$XULRUNNER_STUB_NAME"; then
5072
 
  case "$target_os" in
5073
 
  darwin*)
5074
 
    XULRUNNER_STUB_NAME=xulrunner
5075
 
    ;;
5076
 
  *)
5077
 
    XULRUNNER_STUB_NAME=xulrunner-stub
5078
 
  esac
5079
 
fi
5080
 
AC_SUBST(XULRUNNER_STUB_NAME)
5081
 
 
5082
 
AC_MSG_CHECKING([for application to build])
5083
 
if test -z "$MOZ_BUILD_APP"; then
5084
 
  AC_MSG_RESULT([browser])
5085
 
  MOZ_BUILD_APP=browser
5086
 
else
5087
 
  # We have a valid application only if it has a build.mk file in its top
5088
 
  # directory.
5089
 
  if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
5090
 
    AC_MSG_RESULT([none])
5091
 
    AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
5092
 
  else
5093
 
    AC_MSG_RESULT([$MOZ_BUILD_APP])
5094
 
  fi
5095
 
fi
5096
 
 
5097
 
# Allow the application to influence configure with a confvars.sh script.
5098
 
 
5099
 
AC_MSG_CHECKING([if app-specific confvars.sh exists])
5100
 
if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
5101
 
  AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
5102
 
  . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
5103
 
else
5104
 
  AC_MSG_RESULT([no])
5105
 
fi
5106
 
 
5107
 
# Now is a good time to test for logic errors, define mismatches, etc.
5108
 
case "$MOZ_BUILD_APP" in
5109
 
xulrunner)
5110
 
  if test "$LIBXUL_SDK"; then
5111
 
    AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
5112
 
  fi
5113
 
  ;;
5114
 
esac
5115
 
 
5116
 
# Special cases where we need to AC_DEFINE something. Also a holdover for apps
5117
 
# that haven't made a confvars.sh yet. Don't add new stuff here, use
5118
 
# MOZ_BUILD_APP.
5119
 
case "$MOZ_BUILD_APP" in
5120
 
browser)
5121
 
  AC_DEFINE(MOZ_PHOENIX)
5122
 
  ;;
5123
 
 
5124
 
xulrunner)
5125
 
  AC_DEFINE(MOZ_XULRUNNER)
5126
 
  ;;
5127
 
 
5128
 
content/xslt)
5129
 
  AC_DEFINE(TX_EXE)
5130
 
  ;;
5131
 
 
5132
 
standalone) 
5133
 
  MOZ_APP_NAME=mozilla
5134
 
  MOZ_APP_DISPLAYNAME=Mozilla
5135
 
  MOZ_APP_VERSION=$MOZILLA_VERSION
5136
 
  ;;
5137
 
 
5138
 
esac
5139
 
 
5140
 
AC_SUBST(MOZ_BUILD_APP)
5141
 
AC_SUBST(MOZ_PHOENIX)
5142
 
AC_SUBST(MOZ_XULRUNNER)
5143
 
 
5144
 
AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
5145
 
 
5146
 
dnl ========================================================
5147
 
dnl = 
5148
 
dnl = Toolkit Options
5149
 
dnl = 
5150
 
dnl ========================================================
5151
 
MOZ_ARG_HEADER(Toolkit Options)
5152
 
 
5153
 
    dnl ========================================================
5154
 
    dnl = Select the default toolkit
5155
 
    dnl ========================================================
5156
 
        MOZ_ARG_ENABLE_STRING(default-toolkit,
5157
 
        [  --enable-default-toolkit=TK
5158
 
                          Select default toolkit
5159
 
                          Platform specific defaults:
5160
 
                            Mac OS X - cairo-cocoa
5161
 
                            Neutrino/QNX - photon
5162
 
                            OS/2 - cairo-os2
5163
 
                            Win32/WinCE - cairo-windows
5164
 
                            Gtk2 with DirectFB - cairo-gtk2-dfb
5165
 
                            * - cairo-gtk2
5166
 
                            * - cairo-qt],
5167
 
    [ _DEFAULT_TOOLKIT=$enableval ],
5168
 
    [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
5169
 
 
5170
 
    if test "$_DEFAULT_TOOLKIT" = "photon" \
5171
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
5172
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
5173
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
5174
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
5175
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
5176
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
5177
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
5178
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-android"
5179
 
    then
5180
 
        dnl nglayout only supports building with one toolkit,
5181
 
        dnl so ignore everything after the first comma (",").
5182
 
        MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
5183
 
    else
5184
 
        AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
5185
 
    fi
5186
 
 
5187
 
dnl ========================================================
5188
 
dnl = Enable the toolkit as needed                         =
5189
 
dnl ========================================================
5190
 
 
5191
 
case "$MOZ_WIDGET_TOOLKIT" in
5192
 
photon)
5193
 
        MOZ_ENABLE_PHOTON=1
5194
 
        AC_DEFINE(MOZ_WIDGET_PHOTON)
5195
 
    ;;
5196
 
 
5197
 
cairo-windows)
5198
 
    MOZ_WIDGET_TOOLKIT=windows
5199
 
    MOZ_WEBGL=1
5200
 
    case "${target}" in
5201
 
    *-wince*)
5202
 
        NS_PRINTING=
5203
 
        ;;
5204
 
    esac
5205
 
    MOZ_PDF_PRINTING=1
5206
 
    ;;
5207
 
 
5208
 
cairo-gtk2|cairo-gtk2-x11)
5209
 
    MOZ_WIDGET_TOOLKIT=gtk2
5210
 
    MOZ_ENABLE_GTK2=1
5211
 
    MOZ_ENABLE_XREMOTE=1
5212
 
    MOZ_WEBGL=1
5213
 
    MOZ_WEBGL_GLX=1
5214
 
 
5215
 
    AC_DEFINE(MOZ_X11)
5216
 
    MOZ_X11=1
5217
 
    USE_FC_FREETYPE=1
5218
 
 
5219
 
    TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
5220
 
    TK_LIBS='$(MOZ_GTK2_LIBS)'
5221
 
    AC_DEFINE(MOZ_WIDGET_GTK2)
5222
 
    MOZ_PDF_PRINTING=1
5223
 
    ;;
5224
 
 
5225
 
cairo-gtk2-dfb)
5226
 
    MOZ_WIDGET_TOOLKIT=gtk2
5227
 
    MOZ_ENABLE_GTK2=1
5228
 
    MOZ_WEBGL=
5229
 
 
5230
 
    AC_DEFINE(MOZ_DFB)
5231
 
    MOZ_DFB=1
5232
 
 
5233
 
    TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
5234
 
    TK_LIBS='$(MOZ_GTK2_LIBS)'
5235
 
    AC_DEFINE(MOZ_WIDGET_GTK2)
5236
 
    if test "$no_x" != "yes"; then
5237
 
        AC_MSG_WARN([Disabling X when DirectFB is specified.])
5238
 
        no_x=yes
5239
 
    fi
5240
 
    MOZ_PDF_PRINTING=1
5241
 
    ;;
5242
 
 
5243
 
cairo-qt)
5244
 
    MOZ_WIDGET_TOOLKIT=qt
5245
 
    MOZ_ENABLE_QT=1
5246
 
    MOZ_ENABLE_XREMOTE=1
5247
 
    MOZ_WEBGL=1
5248
 
    MOZ_WEBGL_GLX=1
5249
 
    USE_ELF_DYNSTR_GC=
5250
 
 
5251
 
    AC_DEFINE(MOZ_X11)
5252
 
    MOZ_X11=1
5253
 
    USE_FC_FREETYPE=1
5254
 
 
5255
 
    TK_CFLAGS='$(MOZ_QT_CFLAGS)'
5256
 
    TK_LIBS='$(MOZ_QT_LIBS)'
5257
 
    AC_DEFINE(MOZ_WIDGET_QT)
5258
 
    MOZ_PDF_PRINTING=1
5259
 
    ;;
5260
 
 
5261
 
cairo-os2)
5262
 
    MOZ_WIDGET_TOOLKIT=os2
5263
 
    USE_FC_FREETYPE=1
5264
 
    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
5265
 
    TK_LIBS='$(MOZ_CAIRO_LIBS)'
5266
 
    MOZ_PDF_PRINTING=1
5267
 
    ;;
5268
 
 
5269
 
cairo-cocoa)
5270
 
    MOZ_WIDGET_TOOLKIT=cocoa
5271
 
    AC_DEFINE(MOZ_WIDGET_COCOA)
5272
 
    MOZ_USER_DIR="Mozilla"
5273
 
    AC_DEFINE(XP_MACOSX)
5274
 
    TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
5275
 
    TK_CFLAGS="-DNO_X11"
5276
 
    LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
5277
 
    CFLAGS="$CFLAGS $TK_CFLAGS"
5278
 
    CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
5279
 
    LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
5280
 
    MOZ_FS_LAYOUT=bundle
5281
 
    MOZ_WEBGL=1
5282
 
    ;;
5283
 
 
5284
 
cairo-android)
5285
 
    AC_DEFINE(MOZ_WIDGET_ANDROID)
5286
 
    MOZ_WIDGET_TOOLKIT=android
5287
 
    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
5288
 
    TK_LIBS='$(MOZ_CAIRO_LIBS)'
5289
 
    MOZ_WEBGL=1
5290
 
    MOZ_PDF_PRINTING=1
5291
 
    ;;
5292
 
 
5293
 
esac
5294
 
 
5295
 
AC_SUBST(MOZ_PDF_PRINTING)
5296
 
if test "$MOZ_PDF_PRINTING"; then
5297
 
   PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
5298
 
   AC_DEFINE(MOZ_PDF_PRINTING)
5299
 
fi
5300
 
 
5301
 
if test "$MOZ_ENABLE_XREMOTE"; then
5302
 
    AC_DEFINE(MOZ_ENABLE_XREMOTE)
5303
 
fi
5304
 
 
5305
 
if test "$COMPILE_ENVIRONMENT"; then
5306
 
  if test "$MOZ_ENABLE_GTK2"; then
5307
 
    if test "$MOZ_X11"; then
5308
 
      GDK_PACKAGES=gdk-x11-2.0
5309
 
    elif test "$MOZ_DFB"; then
5310
 
      PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
5311
 
      GDK_PACKAGES=directfb
5312
 
    fi
5313
 
 
5314
 
    PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
5315
 
  fi
5316
 
 
5317
 
fi # COMPILE_ENVIRONMENT
5318
 
 
5319
 
AC_SUBST(MOZ_FS_LAYOUT)
5320
 
 
5321
 
dnl ========================================================
5322
 
dnl Use ARM userspace kernel helpers; tell NSPR to enable
5323
 
dnl their usage and use them in spidermonkey.
5324
 
dnl ========================================================
5325
 
MOZ_ARG_WITH_BOOL(arm-kuser,
5326
 
[  --with-arm-kuser         Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
5327
 
    USE_ARM_KUSER=1,)
5328
 
if test -n "$USE_ARM_KUSER"; then
5329
 
   AC_DEFINE(USE_ARM_KUSER)
5330
 
fi
5331
 
 
5332
 
dnl ========================================================
5333
 
dnl = startup-notification support module
5334
 
dnl ========================================================
5335
 
 
5336
 
if test "$MOZ_ENABLE_GTK2"
5337
 
then
5338
 
    MOZ_ENABLE_STARTUP_NOTIFICATION=
5339
 
 
5340
 
    MOZ_ARG_ENABLE_BOOL(startup-notification,
5341
 
    [  --enable-startup-notification
5342
 
                          Enable startup-notification support (default: disabled) ],
5343
 
        MOZ_ENABLE_STARTUP_NOTIFICATION=force,
5344
 
        MOZ_ENABLE_STARTUP_NOTIFICATION=)
5345
 
    if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
5346
 
    then
5347
 
        PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
5348
 
                          libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
5349
 
        [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
5350
 
            if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
5351
 
            then
5352
 
                AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
5353
 
            fi
5354
 
            MOZ_ENABLE_STARTUP_NOTIFICATION=
5355
 
        ])
5356
 
    fi
5357
 
 
5358
 
    if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
5359
 
        AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
5360
 
    fi
5361
 
 
5362
 
    TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
5363
 
fi
5364
 
AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
5365
 
AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
5366
 
AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
5367
 
 
5368
 
dnl ========================================================
5369
 
dnl = QT support
5370
 
dnl ========================================================
5371
 
if test "$MOZ_ENABLE_QT"
5372
 
then
5373
 
    MOZ_ARG_WITH_STRING(qtdir,
5374
 
    [  --with-qtdir=\$dir       Specify Qt directory ],
5375
 
    [ QTDIR=$withval])
5376
 
 
5377
 
    if test -z "$QTDIR"; then
5378
 
        PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL)
5379
 
        AC_CHECK_PROGS(HOST_MOC, $MOC moc, "")
5380
 
    else
5381
 
        MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtDBus -lQtXml -lQtOpenGL"
5382
 
 
5383
 
        MOZ_QT_CFLAGS="-DQT_SHARED"
5384
 
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
5385
 
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
5386
 
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
5387
 
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
5388
 
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
5389
 
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDBus"
5390
 
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
5391
 
        HOST_MOC="$QTDIR/bin/moc"
5392
 
    fi
5393
 
    if test -z "$HOST_MOC"; then
5394
 
        AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
5395
 
incorrect])
5396
 
    fi
5397
 
    MOC=$HOST_MOC
5398
 
 
5399
 
    MOZ_ENABLE_QTNETWORK=
5400
 
    PKG_CHECK_MODULES(_QTNETWORK, QtNetwork >= 4.7,
5401
 
                      MOZ_ENABLE_QTNETWORK=1,
5402
 
                      MOZ_ENABLE_QTNETWORK=)
5403
 
 
5404
 
    if test "$MOZ_ENABLE_QTNETWORK"; then
5405
 
      MOZ_ENABLE_QTNETWORK=1
5406
 
      AC_DEFINE(MOZ_ENABLE_QTNETWORK)
5407
 
    fi
5408
 
 
5409
 
    MOZ_ENABLE_QTMOBILITY=
5410
 
    PKG_CHECK_MODULES(_QTMOBILITY, QtSensors,
5411
 
                      MOZ_ENABLE_QTMOBILITY=1,
5412
 
                      MOZ_ENABLE_QTMOBILITY=)
5413
 
    if test "$MOZ_ENABLE_QTMOBILITY"; then
5414
 
       MOZ_ENABLE_QTMOBILITY=1
5415
 
       MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
5416
 
       MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
5417
 
    else
5418
 
       AC_CHECK_LIB(QtSensors, main, [
5419
 
          MOZ_ENABLE_QTMOBILITY=1
5420
 
          MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtMobility"
5421
 
          MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtSensors"
5422
 
          MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors"
5423
 
       ])
5424
 
    fi
5425
 
    if test "$MOZ_ENABLE_QTMOBILITY"; then
5426
 
       AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
5427
 
    fi
5428
 
fi
5429
 
 
5430
 
AC_SUBST(GTK_CONFIG)
5431
 
AC_SUBST(TK_CFLAGS)
5432
 
AC_SUBST(TK_LIBS)
5433
 
 
5434
 
AC_SUBST(MOZ_ENABLE_GTK2)
5435
 
AC_SUBST(MOZ_ENABLE_PHOTON)
5436
 
AC_SUBST(MOZ_ENABLE_QT)
5437
 
AC_SUBST(MOZ_ENABLE_QTNETWORK)
5438
 
AC_SUBST(MOZ_ENABLE_QTMOBILITY)
5439
 
AC_SUBST(MOZ_ENABLE_XREMOTE)
5440
 
AC_SUBST(MOZ_GTK2_CFLAGS)
5441
 
AC_SUBST(MOZ_GTK2_LIBS)
5442
 
AC_SUBST(MOZ_QT_CFLAGS)
5443
 
AC_SUBST(MOZ_QT_LIBS)
5444
 
 
5445
 
AC_SUBST(MOC)
5446
 
 
5447
 
AC_SUBST(MOZ_DFB)
5448
 
AC_SUBST(MOZ_X11)
5449
 
 
5450
 
dnl ========================================================
5451
 
dnl =
5452
 
dnl = Components & Features
5453
 
dnl = 
5454
 
dnl ========================================================
5455
 
MOZ_ARG_HEADER(Components and Features)
5456
 
 
5457
 
dnl ========================================================
5458
 
dnl = Localization
5459
 
dnl ========================================================
5460
 
MOZ_ARG_ENABLE_STRING(ui-locale,
5461
 
[  --enable-ui-locale=ab-CD
5462
 
                          Select the user interface locale (default: en-US)],
5463
 
    MOZ_UI_LOCALE=$enableval )
5464
 
AC_SUBST(MOZ_UI_LOCALE)
5465
 
 
5466
 
dnl ========================================================
5467
 
dnl = Trademarked Branding 
5468
 
dnl ========================================================
5469
 
MOZ_ARG_ENABLE_BOOL(official-branding,
5470
 
[  --enable-official-branding
5471
 
                          Enable Official mozilla.org Branding
5472
 
                          Do not distribute builds with
5473
 
                          --enable-official-branding unless you have
5474
 
                          permission to use trademarks per
5475
 
                          http://www.mozilla.org/foundation/trademarks/ .],
5476
 
[
5477
 
  if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
5478
 
    AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
5479
 
  else
5480
 
    MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
5481
 
    MOZ_OFFICIAL_BRANDING=1
5482
 
  fi
5483
 
], MOZ_OFFICIAL_BRANDING=)
5484
 
 
5485
 
AC_SUBST(MOZ_OFFICIAL_BRANDING)
5486
 
if test -n "$MOZ_OFFICIAL_BRANDING"; then
5487
 
  AC_DEFINE(MOZ_OFFICIAL_BRANDING)
5488
 
fi
5489
 
 
5490
 
MOZ_ARG_WITH_STRING(branding,
5491
 
[  --with-branding=dir     Use branding from the specified directory.],
5492
 
    MOZ_BRANDING_DIRECTORY=$withval)
5493
 
 
5494
 
REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
5495
 
if test -z "$REAL_BRANDING_DIRECTORY"; then
5496
 
  REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5497
 
fi
5498
 
 
5499
 
if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
5500
 
  . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
5501
 
fi
5502
 
 
5503
 
AC_SUBST(MOZ_BRANDING_DIRECTORY)
5504
 
 
5505
 
dnl ========================================================
5506
 
dnl = Distribution ID
5507
 
dnl ========================================================
5508
 
MOZ_ARG_WITH_STRING(distribution-id,
5509
 
[  --with-distribution-id=ID
5510
 
                          Set distribution-specific id (default=org.mozilla)],
5511
 
[ val=`echo $withval`
5512
 
    MOZ_DISTRIBUTION_ID="$val"])
5513
 
 
5514
 
if test -z "$MOZ_DISTRIBUTION_ID"; then
5515
 
   MOZ_DISTRIBUTION_ID="org.mozilla"
5516
 
fi
5517
 
 
5518
 
AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
5519
 
AC_SUBST(MOZ_DISTRIBUTION_ID)
5520
 
 
5521
 
 
5522
 
dnl ========================================================
5523
 
dnl complex text support off by default
5524
 
dnl ========================================================
5525
 
MOZ_ARG_DISABLE_BOOL(pango,
5526
 
[  --disable-pango         Disable usage of Pango ],
5527
 
    MOZ_PANGO=,
5528
 
    MOZ_PANGO=1)
5529
 
 
5530
 
dnl ========================================================
5531
 
dnl = Pango
5532
 
dnl ========================================================
5533
 
if test "$MOZ_ENABLE_GTK2"
5534
 
then
5535
 
    AC_SUBST(MOZ_PANGO)
5536
 
 
5537
 
    PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5538
 
 
5539
 
    PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
5540
 
    AC_SUBST(MOZ_PANGO_CFLAGS)
5541
 
    AC_SUBST(MOZ_PANGO_LIBS)
5542
 
    if test "$MOZ_PANGO"
5543
 
    then
5544
 
        AC_DEFINE(MOZ_PANGO)
5545
 
    else
5546
 
        PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5547
 
        AC_SUBST(FT2_CFLAGS)
5548
 
        AC_SUBST(FT2_LIBS)
5549
 
    fi
5550
 
fi
5551
 
 
5552
 
if test "$MOZ_ENABLE_QT"
5553
 
then
5554
 
    if test "$MOZ_PANGO"
5555
 
    then
5556
 
        PKG_CHECK_MODULES(MOZ_PANGO, [pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION],
5557
 
        [
5558
 
            AC_SUBST(MOZ_PANGO_CFLAGS)
5559
 
            AC_SUBST(MOZ_PANGO_LIBS)
5560
 
            AC_DEFINE(MOZ_PANGO)
5561
 
        ],
5562
 
        [
5563
 
            echo "Pango library not found, will use FT2 font engine"
5564
 
            MOZ_PANGO=
5565
 
        ])
5566
 
    fi
5567
 
    AC_SUBST(MOZ_PANGO)
5568
 
fi
5569
 
 
5570
 
dnl ========================================================
5571
 
dnl = GnomeVFS, GIO and GConf support module
5572
 
dnl ========================================================
5573
 
 
5574
 
if test "$MOZ_X11"
5575
 
then
5576
 
    dnl build the gnomevfs extension by default only when the
5577
 
    dnl GTK2 toolkit is in use.
5578
 
    if test "$MOZ_ENABLE_GTK2"
5579
 
    then
5580
 
        MOZ_ENABLE_GNOMEVFS=1
5581
 
        MOZ_ENABLE_GCONF=1
5582
 
    fi
5583
 
 
5584
 
    dnl ========================================================
5585
 
    dnl = GnomeVFS support module
5586
 
    dnl ========================================================
5587
 
    MOZ_ARG_DISABLE_BOOL(gnomevfs,
5588
 
    [  --disable-gnomevfs      Disable GnomeVFS support ],
5589
 
        MOZ_ENABLE_GNOMEVFS=,
5590
 
        MOZ_ENABLE_GNOMEVFS=force)
5591
 
 
5592
 
    if test "$MOZ_ENABLE_GNOMEVFS"
5593
 
    then
5594
 
        PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5595
 
            MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5596
 
            MOZ_ENABLE_GNOMEVFS=1
5597
 
            AC_DEFINE(MOZ_ENABLE_GNOMEVFS)
5598
 
        ],[
5599
 
            if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5600
 
            then
5601
 
                AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5602
 
            fi
5603
 
            MOZ_ENABLE_GNOMEVFS=
5604
 
        ])
5605
 
    else
5606
 
        if test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5607
 
            PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5608
 
              MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5609
 
            ])
5610
 
        fi
5611
 
    fi
5612
 
 
5613
 
    AC_SUBST(MOZ_ENABLE_GNOMEVFS)
5614
 
    AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5615
 
    AC_SUBST(MOZ_GNOMEVFS_LIBS)
5616
 
 
5617
 
    dnl ========================================================
5618
 
    dnl = GIO support module
5619
 
    dnl ========================================================
5620
 
    MOZ_ARG_ENABLE_BOOL(gio,
5621
 
    [  --enable-gio            Enable GIO support (default: disabled)],
5622
 
        MOZ_ENABLE_GIO=force,
5623
 
        MOZ_ENABLE_GIO=)
5624
 
 
5625
 
    if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
5626
 
    then
5627
 
        PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
5628
 
            MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
5629
 
            MOZ_ENABLE_GIO=1
5630
 
            AC_DEFINE(MOZ_ENABLE_GIO)
5631
 
        ],[
5632
 
            if test "$MOZ_ENABLE_GIO" = "force"
5633
 
            then
5634
 
                AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
5635
 
            fi
5636
 
            MOZ_ENABLE_GIO=
5637
 
        ])
5638
 
    fi
5639
 
 
5640
 
    AC_SUBST(MOZ_ENABLE_GIO)
5641
 
    AC_SUBST(MOZ_GIO_CFLAGS)
5642
 
    AC_SUBST(MOZ_GIO_LIBS)
5643
 
   
5644
 
    dnl ========================================================
5645
 
    dnl = GConf support module
5646
 
    dnl ========================================================
5647
 
    MOZ_ARG_DISABLE_BOOL(gconf,
5648
 
    [  --disable-gconf      Disable Gconf support ],
5649
 
        MOZ_ENABLE_GCONF=,
5650
 
        MOZ_ENABLE_GCONF=force)
5651
 
 
5652
 
    if test "$MOZ_ENABLE_GCONF"
5653
 
    then
5654
 
        PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
5655
 
            MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5656
 
            MOZ_ENABLE_GCONF=1
5657
 
        ],[
5658
 
            if test "$MOZ_ENABLE_GCONF" = "force"
5659
 
            then
5660
 
                AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
5661
 
            fi
5662
 
            MOZ_ENABLE_GCONF=
5663
 
        ])
5664
 
    fi
5665
 
 
5666
 
    if test "$MOZ_ENABLE_GCONF"; then
5667
 
        AC_DEFINE(MOZ_ENABLE_GCONF)
5668
 
    fi
5669
 
 
5670
 
    AC_SUBST(MOZ_ENABLE_GCONF)
5671
 
    AC_SUBST(MOZ_GCONF_CFLAGS)
5672
 
    AC_SUBST(MOZ_GCONF_LIBS)
5673
 
fi
5674
 
 
5675
 
dnl ========================================================
5676
 
dnl = libproxy support
5677
 
dnl ========================================================
5678
 
 
5679
 
if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
5680
 
then
5681
 
    MOZ_ENABLE_LIBPROXY=
5682
 
 
5683
 
    MOZ_ARG_ENABLE_BOOL(libproxy,
5684
 
    [  --enable-libproxy         Enable libproxy support ],
5685
 
    MOZ_ENABLE_LIBPROXY=1,
5686
 
    MOZ_ENABLE_LIBPROXY=)
5687
 
 
5688
 
    if test "$MOZ_ENABLE_LIBPROXY"
5689
 
    then
5690
 
        PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
5691
 
        AC_DEFINE(MOZ_ENABLE_LIBPROXY)
5692
 
    fi
5693
 
fi
5694
 
AC_SUBST(MOZ_ENABLE_LIBPROXY)
5695
 
AC_SUBST(MOZ_LIBPROXY_CFLAGS)
5696
 
AC_SUBST(MOZ_LIBPROXY_LIBS)
5697
 
 
5698
 
dnl ========================================================
5699
 
dnl = libnotify support
5700
 
dnl ========================================================
5701
 
 
5702
 
if test "$MOZ_ENABLE_GTK2"
5703
 
then
5704
 
    MOZ_ENABLE_LIBNOTIFY=1
5705
 
 
5706
 
    MOZ_ARG_DISABLE_BOOL(libnotify,
5707
 
    [  --disable-libnotify     Disable libnotify support ],
5708
 
    MOZ_ENABLE_LIBNOTIFY=,
5709
 
    MOZ_ENABLE_LIBNOTIFY=1)
5710
 
 
5711
 
    if test "$MOZ_ENABLE_LIBNOTIFY"
5712
 
    then
5713
 
        AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5714
 
    fi
5715
 
fi
5716
 
 
5717
 
if test -z "$SKIP_LIBRARY_CHECKS"
5718
 
then
5719
 
    if test "$MOZ_ENABLE_GTK2"
5720
 
    then
5721
 
        if test "$MOZ_ENABLE_LIBNOTIFY"
5722
 
        then
5723
 
            PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5724
 
        fi
5725
 
    fi
5726
 
fi
5727
 
AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5728
 
AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5729
 
AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5730
 
 
5731
 
dnl ========================================================
5732
 
dnl = GNOME component (mozgnome)
5733
 
dnl ========================================================
5734
 
 
5735
 
# The GNOME component is built if one of 
5736
 
# gnome-vfs, gio, gconf or libnotify is available.
5737
 
if test "$MOZ_ENABLE_GCONF" -o \
5738
 
   "$MOZ_ENABLE_GNOMEVFS" -o \
5739
 
   "$MOZ_ENABLE_GIO" -o \
5740
 
   "$MOZ_ENABLE_LIBNOTIFY"; then
5741
 
    MOZ_ENABLE_GNOME_COMPONENT=1
5742
 
else
5743
 
    MOZ_ENABLE_GNOME_COMPONENT=
5744
 
fi
5745
 
AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5746
 
 
5747
 
dnl ========================================================
5748
 
dnl = libgnomeui support module
5749
 
dnl ========================================================
5750
 
 
5751
 
if test "$MOZ_ENABLE_GTK2"
5752
 
then
5753
 
    MOZ_ENABLE_GNOMEUI=1
5754
 
 
5755
 
    MOZ_ARG_DISABLE_BOOL(gnomeui,
5756
 
    [  --disable-gnomeui       Disable libgnomeui support (default: auto, optional at runtime) ],
5757
 
        MOZ_ENABLE_GNOMEUI=,
5758
 
        MOZ_ENABLE_GNOMEUI=force)
5759
 
 
5760
 
    if test "$MOZ_ENABLE_GNOMEUI"
5761
 
    then
5762
 
        PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5763
 
        [
5764
 
            MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5765
 
            MOZ_ENABLE_GNOMEUI=1
5766
 
        ],[
5767
 
            if test "$MOZ_ENABLE_GNOMEUI" = "force"
5768
 
            then
5769
 
                AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5770
 
            fi
5771
 
            MOZ_ENABLE_GNOMEUI=
5772
 
        ])
5773
 
    fi
5774
 
 
5775
 
    if test "$MOZ_ENABLE_GNOMEUI"; then
5776
 
        AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5777
 
    fi
5778
 
fi
5779
 
 
5780
 
AC_SUBST(MOZ_ENABLE_GNOMEUI)
5781
 
AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5782
 
AC_SUBST(MOZ_GNOMEUI_LIBS)
5783
 
 
5784
 
dnl ========================================================
5785
 
dnl = dbus support
5786
 
dnl ========================================================
5787
 
 
5788
 
if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
5789
 
then
5790
 
    MOZ_ENABLE_DBUS=1
5791
 
 
5792
 
    MOZ_ARG_DISABLE_BOOL(dbus,
5793
 
    [  --disable-dbus          Disable dbus support ],
5794
 
        MOZ_ENABLE_DBUS=,
5795
 
        MOZ_ENABLE_DBUS=1)
5796
 
 
5797
 
    if test "$MOZ_ENABLE_DBUS"
5798
 
    then
5799
 
        PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
5800
 
        PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5801
 
        AC_DEFINE(MOZ_ENABLE_DBUS)
5802
 
    fi
5803
 
fi
5804
 
AC_SUBST(MOZ_ENABLE_DBUS)
5805
 
AC_SUBST(MOZ_DBUS_CFLAGS)
5806
 
AC_SUBST(MOZ_DBUS_LIBS)
5807
 
AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5808
 
AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5809
 
 
5810
 
dnl ========================================================
5811
 
dnl = Build Personal Security Manager
5812
 
dnl ========================================================
5813
 
MOZ_ARG_DISABLE_BOOL(crypto,
5814
 
[  --disable-crypto        Disable crypto support (Personal Security Manager)],
5815
 
    MOZ_PSM=,
5816
 
    MOZ_PSM=1 )
5817
 
 
5818
 
dnl ========================================================
5819
 
dnl = JS Debugger XPCOM component (js/jsd)
5820
 
dnl ========================================================
5821
 
MOZ_ARG_DISABLE_BOOL(jsd,
5822
 
[  --disable-jsd           Disable JavaScript debug library],
5823
 
    MOZ_JSDEBUGGER=,
5824
 
    MOZ_JSDEBUGGER=1)
5825
 
 
5826
 
 
5827
 
dnl ========================================================
5828
 
dnl = Enable IPDL's "expensive" unit tests
5829
 
dnl ========================================================
5830
 
MOZ_IPDL_TESTS=
5831
 
 
5832
 
MOZ_ARG_ENABLE_BOOL(ipdl-tests,
5833
 
[  --enable-ipdl-tests     Enable expensive IPDL tests],
5834
 
    MOZ_IPDL_TESTS=1,
5835
 
    MOZ_IPDL_TESTS=)
5836
 
 
5837
 
if test -n "$MOZ_IPDL_TESTS"; then
5838
 
    AC_DEFINE(MOZ_IPDL_TESTS)
5839
 
fi
5840
 
 
5841
 
AC_SUBST(MOZ_IPDL_TESTS)
5842
 
 
5843
 
dnl ========================================================
5844
 
dnl = Disable building dbm
5845
 
dnl ========================================================
5846
 
MOZ_ARG_DISABLE_BOOL(dbm,
5847
 
[  --disable-dbm           Disable building dbm],
5848
 
    NSS_DISABLE_DBM=1,
5849
 
    NSS_DISABLE_DBM=)
5850
 
 
5851
 
dnl bi-directional support always on
5852
 
IBMBIDI=1
5853
 
AC_DEFINE(IBMBIDI)
5854
 
 
5855
 
dnl ========================================================
5856
 
dnl accessibility support on by default on all platforms 
5857
 
dnl except OS X.
5858
 
dnl ========================================================
5859
 
MOZ_ARG_DISABLE_BOOL(accessibility,
5860
 
[  --disable-accessibility Disable accessibility support (off by default on OS X)],
5861
 
    ACCESSIBILITY=,
5862
 
    ACCESSIBILITY=1 )
5863
 
if test "$ACCESSIBILITY"; then
5864
 
    AC_DEFINE(ACCESSIBILITY)
5865
 
fi
5866
 
 
5867
 
if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5868
 
case "$target" in
5869
 
*-mingw*)
5870
 
    if test "$ac_cv_header_atlbase_h" = "no"; then
5871
 
        AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
5872
 
    fi
5873
 
    if test "$ac_cv_header_oleacc_idl" = "no"; then
5874
 
        AC_MSG_ERROR([System header oleacc.idl is not available. See http://developer.mozilla.org/en/docs/oleacc.idl for details on fixing this problem.])
5875
 
    fi
5876
 
    ;;
5877
 
esac
5878
 
fi
5879
 
 
5880
 
dnl ========================================================
5881
 
dnl Disable printing
5882
 
dnl ========================================================
5883
 
MOZ_ARG_DISABLE_BOOL(printing,
5884
 
[  --disable-printing      Disable printing support],
5885
 
    NS_PRINTING=,
5886
 
    NS_PRINTING=1)
5887
 
 
5888
 
if test "$NS_PRINTING"; then
5889
 
    AC_DEFINE(NS_PRINTING)
5890
 
    AC_DEFINE(NS_PRINT_PREVIEW)
5891
 
fi
5892
 
 
5893
 
dnl ========================================================
5894
 
dnl = Disable Fast Load
5895
 
dnl ========================================================
5896
 
MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5897
 
[  --disable-xpcom-fastload
5898
 
                          Disable XPCOM fastload support],
5899
 
    MOZ_NO_FAST_LOAD=1,
5900
 
    MOZ_NO_FAST_LOAD=)
5901
 
 
5902
 
AC_SUBST(MOZ_NO_FAST_LOAD)
5903
 
 
5904
 
if test -n "$MOZ_NO_FAST_LOAD"; then
5905
 
    AC_DEFINE(MOZ_NO_FAST_LOAD)
5906
 
fi
5907
 
 
5908
 
dnl ========================================================
5909
 
dnl = Enable Raw Codecs
5910
 
dnl ========================================================
5911
 
MOZ_ARG_ENABLE_BOOL(raw,
5912
 
[  --enable-raw           Enable support for RAW media],
5913
 
    MOZ_RAW=1,
5914
 
    MOZ_RAW=)
5915
 
 
5916
 
if test -n "$MOZ_RAW"; then
5917
 
    AC_DEFINE(MOZ_RAW)
5918
 
    MOZ_MEDIA=1
5919
 
fi
5920
 
 
5921
 
AC_SUBST(MOZ_RAW)
5922
 
 
5923
 
dnl ========================================================
5924
 
dnl = Disable Ogg Codecs
5925
 
dnl ========================================================
5926
 
MOZ_ARG_DISABLE_BOOL(ogg,
5927
 
[  --disable-ogg           Disable support for OGG media (Theora video and Vorbis audio)],
5928
 
    MOZ_OGG=,
5929
 
    MOZ_OGG=1)
5930
 
 
5931
 
if test -n "$MOZ_OGG"; then
5932
 
    AC_DEFINE(MOZ_OGG)
5933
 
    MOZ_SYDNEYAUDIO=1
5934
 
    MOZ_MEDIA=1
5935
 
    case "$target_cpu" in
5936
 
    arm*)
5937
 
        MOZ_TREMOR=1
5938
 
    ;;
5939
 
    *)
5940
 
        MOZ_VORBIS=1
5941
 
    ;;
5942
 
    esac
5943
 
 
5944
 
    dnl Checks for __attribute__(aligned()) directive
5945
 
    AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5946
 
        [ac_cv_c_attribute_aligned],
5947
 
        [ac_cv_c_attribute_aligned=0
5948
 
         CFLAGS_save="${CFLAGS}"
5949
 
         CFLAGS="${CFLAGS} -Werror"
5950
 
         for ac_cv_c_attr_align_try in 64 32 16 8; do
5951
 
           echo "trying $ac_cv_c_attr_align_try"
5952
 
           AC_TRY_COMPILE([],
5953
 
                          [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5954
 
                          [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5955
 
           if test "$ac_cv_c_attribute_aligned" != 0; then
5956
 
             break;
5957
 
           fi
5958
 
         done
5959
 
           CFLAGS="${CFLAGS_save}"])
5960
 
    if test "${ac_cv_c_attribute_aligned}" != "0"; then
5961
 
      AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5962
 
                         [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5963
 
    fi
5964
 
fi
5965
 
 
5966
 
dnl ========================================================
5967
 
dnl = Disable VP8 decoder support
5968
 
dnl ========================================================
5969
 
MOZ_ARG_DISABLE_BOOL(webm,
5970
 
[  --disable-webm          Disable support for WebM media (VP8 video and Vorbis audio)],
5971
 
    MOZ_WEBM=,
5972
 
    MOZ_WEBM=1)
5973
 
 
5974
 
dnl system libvpx Support
5975
 
dnl ========================================================
5976
 
MOZ_ARG_WITH_STRING(system-libvpx,
5977
 
[  --with-system-libvpx=[PFX]
5978
 
                          Use system libvpx [installed at prefix PFX]],
5979
 
    LIBVPX_DIR=$withval)
5980
 
 
5981
 
MOZ_NATIVE_LIBVPX=
5982
 
MOZ_LIBVPX_INCLUDES=
5983
 
MOZ_LIBVPX_LIBS=
5984
 
 
5985
 
if test -n "$MOZ_WEBM"; then
5986
 
    AC_DEFINE(MOZ_WEBM)
5987
 
 
5988
 
    if test -n "$LIBVPX_DIR" -a "$LIBVPX_DIR" != no; then
5989
 
        _SAVE_CFLAGS=$CFLAGS
5990
 
        _SAVE_LDFLAGS=$LDFLAGS
5991
 
        _SAVE_LIBS=$LIBS
5992
 
        if test "${LIBVPX_DIR}" = "yes"; then
5993
 
            LIBVPX_DIR=/usr
5994
 
        fi
5995
 
        CFLAGS="-I${LIBVPX_DIR}/include $CFLAGS"
5996
 
        LDFLAGS="-L${LIBVPX_DIR}/lib $LDFLAGS"
5997
 
        MOZ_CHECK_HEADER(vpx/vpx_decoder.h,
5998
 
            [if test ! -f "${LIBVPX_DIR}/include/vpx/vpx_decoder.h"; then
5999
 
             AC_MSG_ERROR([vpx/vpx_decoder.h found, but is not in ${LIBVPX_DIR}/include])
6000
 
            fi],
6001
 
            AC_MSG_ERROR([--with-system-libvpx requested but vpx/vpx_decoder.h not found]))
6002
 
        AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver,
6003
 
                     [MOZ_NATIVE_LIBVPX=1
6004
 
                      MOZ_LIBVPX_INCLUDES="-I${LIBVPX_DIR}/include"
6005
 
                      MOZ_LIBVPX_LIBS="-L${LIBVPX_DIR}/lib -lvpx"],
6006
 
                     ([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found]))
6007
 
        CFLAGS=$_SAVE_CFLAGS
6008
 
        LDFLAGS=$_SAVE_LDFLAGS
6009
 
        LIBS=$_SAVE_LIBS
6010
 
    fi
6011
 
fi
6012
 
 
6013
 
AC_SUBST(MOZ_NATIVE_LIBVPX)
6014
 
AC_SUBST(MOZ_LIBVPX_INCLUDES)
6015
 
AC_SUBST(MOZ_LIBVPX_LIBS)
6016
 
 
6017
 
if test -n "$MOZ_WEBM" -a -z "$MOZ_NATIVE_LIBVPX"; then
6018
 
    MOZ_SYDNEYAUDIO=1
6019
 
    MOZ_MEDIA=1
6020
 
    case "$target_cpu" in
6021
 
    arm*)
6022
 
        MOZ_TREMOR=1
6023
 
    ;;
6024
 
    *)
6025
 
        MOZ_VORBIS=1
6026
 
    ;;
6027
 
    esac
6028
 
 
6029
 
 
6030
 
    dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
6031
 
    dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
6032
 
    dnl We currently require gcc on all arm platforms.
6033
 
    VPX_AS=$YASM
6034
 
    VPX_ASM_SUFFIX=asm
6035
 
 
6036
 
    dnl See if we have assembly on this platform.  
6037
 
    case "$OS_ARCH:$CPU_ARCH" in
6038
 
    Linux:x86)
6039
 
      VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
6040
 
      VPX_X86_ASM=1
6041
 
    ;;
6042
 
    Linux:x86_64)
6043
 
      VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
6044
 
      VPX_X86_ASM=1
6045
 
    ;;
6046
 
    SunOS:x86)
6047
 
      VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
6048
 
      VPX_X86_ASM=1
6049
 
    ;;
6050
 
    SunOS:x86_64)
6051
 
      VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
6052
 
      VPX_X86_ASM=1
6053
 
    ;;
6054
 
    Darwin:x86)
6055
 
      VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
6056
 
      VPX_X86_ASM=1
6057
 
    ;;
6058
 
    Darwin:x86_64)
6059
 
      VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC"
6060
 
      VPX_X86_ASM=1
6061
 
    ;;
6062
 
    WINNT:x86_64)
6063
 
      if test -z "$GNU_CC"; then
6064
 
        VPX_ASFLAGS="-f x64 -rnasm -pnasm"
6065
 
        VPX_X86_ASM=1
6066
 
      fi
6067
 
    ;;
6068
 
    WINNT:x86)
6069
 
      if test -z "$GNU_CC"; then
6070
 
        dnl Check for yasm 1.1 or greater.
6071
 
        if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
6072
 
          AC_MSG_ERROR([yasm 1.1 or greater is required to build libvpx on Win32, but it appears not to be installed.  Install it (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
6073
 
        elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
6074
 
          AC_MSG_ERROR([yasm 1.1 or greater is required to build libvpx on Win32, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.  Upgrade to the newest version (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
6075
 
        else
6076
 
          VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC"
6077
 
          VPX_X86_ASM=1
6078
 
        fi
6079
 
      fi
6080
 
    ;;
6081
 
    *:arm*)
6082
 
      if test -n "$GNU_AS" ; then
6083
 
        VPX_AS=$AS
6084
 
        dnl These flags are a lie; they're just used to enable the requisite
6085
 
        dnl opcodes; actual arch detection is done at runtime.
6086
 
        VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
6087
 
        VPX_DASH_C_FLAG="-c"
6088
 
        VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
6089
 
        VPX_ASM_SUFFIX="$ASM_SUFFIX"
6090
 
        VPX_ARM_ASM=1
6091
 
      fi
6092
 
    esac
6093
 
 
6094
 
    if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
6095
 
      AC_MSG_ERROR([yasm is a required build tool for this architecture when webm is enabled. You may either install yasm or --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
6096
 
    fi
6097
 
 
6098
 
    if test -n "$VPX_X86_ASM"; then
6099
 
      AC_DEFINE(VPX_X86_ASM)
6100
 
    elif test -n "$VPX_ARM_ASM"; then
6101
 
      AC_DEFINE(VPX_ARM_ASM)
6102
 
    else
6103
 
      AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
6104
 
    fi
6105
 
fi
6106
 
 
6107
 
dnl ========================================================
6108
 
dnl = Disable Wave decoder support
6109
 
dnl ========================================================
6110
 
MOZ_ARG_DISABLE_BOOL(wave,
6111
 
[  --disable-wave          Disable Wave decoder support],
6112
 
    MOZ_WAVE=,
6113
 
    MOZ_WAVE=1)
6114
 
 
6115
 
if test -n "$MOZ_WAVE"; then
6116
 
    AC_DEFINE(MOZ_WAVE)
6117
 
    MOZ_SYDNEYAUDIO=1
6118
 
    MOZ_MEDIA=1
6119
 
fi
6120
 
 
6121
 
dnl ========================================================
6122
 
dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
6123
 
dnl ========================================================
6124
 
 
6125
 
if test -n "$MOZ_SYDNEYAUDIO"; then
6126
 
    AC_DEFINE(MOZ_SYDNEYAUDIO)
6127
 
fi
6128
 
 
6129
 
if test -n "$MOZ_MEDIA"; then
6130
 
    AC_DEFINE(MOZ_MEDIA)
6131
 
fi
6132
 
 
6133
 
if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
6134
 
    AC_MSG_ERROR([MOZ_VORBIS and MOZ_TREMOR are mutually exclusive!  The build system should not allow them both to be set, but they are.  Please file a bug at https://bugzilla.mozilla.org/])
6135
 
fi
6136
 
 
6137
 
if test -n "$MOZ_VORBIS"; then
6138
 
    AC_DEFINE(MOZ_VORBIS)
6139
 
fi
6140
 
 
6141
 
if test -n "$MOZ_TREMOR"; then
6142
 
    AC_DEFINE(MOZ_TREMOR)
6143
 
fi
6144
 
 
6145
 
dnl ========================================================
6146
 
dnl = Check alsa availability on Linux if using sydneyaudio
6147
 
dnl ========================================================
6148
 
 
6149
 
dnl If using sydneyaudio with Linux, ensure that the alsa library is available
6150
 
if test -n "$MOZ_SYDNEYAUDIO"; then
6151
 
   case "$target_os" in
6152
 
linux*)
6153
 
      PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
6154
 
         [echo "$MOZ_ALSA_PKG_ERRORS"
6155
 
          AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux.  Disable with --disable-ogg --disable-wave --disable-webm.  (On Ubuntu, you might try installing the package libasound2-dev.)])])
6156
 
      ;;
6157
 
   esac
6158
 
fi
6159
 
 
6160
 
dnl ========================================================
6161
 
dnl Splashscreen
6162
 
dnl ========================================================
6163
 
AC_ARG_ENABLE(splashscreen,
6164
 
              [  --enable-splashscreen   display splashscreen while loading (default=no)],
6165
 
              [enable_splash="yes"],[enable_splash=""])
6166
 
if test "x$enable_splash" = "xyes"; then
6167
 
  MOZ_SPLASHSCREEN=1
6168
 
  AC_DEFINE(MOZ_SPLASHSCREEN)
6169
 
fi
6170
 
AC_SUBST(MOZ_SPLASHSCREEN)
6171
 
 
6172
 
dnl ========================================================
6173
 
dnl Permissions System
6174
 
dnl ========================================================
6175
 
MOZ_ARG_DISABLE_BOOL(permissions,
6176
 
[  --disable-permissions   Disable permissions (popup and cookie blocking)],
6177
 
    MOZ_PERMISSIONS=,
6178
 
    MOZ_PERMISSIONS=1
6179
 
)
6180
 
 
6181
 
dnl ========================================================
6182
 
dnl NegotiateAuth
6183
 
dnl ========================================================
6184
 
MOZ_ARG_DISABLE_BOOL(negotiateauth,
6185
 
[  --disable-negotiateauth Disable GSS-API negotiation ],
6186
 
    MOZ_AUTH_EXTENSION=,
6187
 
    MOZ_AUTH_EXTENSION=1 )
6188
 
 
6189
 
dnl ========================================================
6190
 
dnl XTF
6191
 
dnl ========================================================
6192
 
MOZ_ARG_DISABLE_BOOL(xtf,
6193
 
[  --disable-xtf           Disable XTF (pluggable xml tags) support],
6194
 
    MOZ_XTF=,
6195
 
    MOZ_XTF=1 )
6196
 
if test "$MOZ_XTF"; then
6197
 
  AC_DEFINE(MOZ_XTF)
6198
 
fi
6199
 
 
6200
 
dnl ========================================================
6201
 
dnl Pref extensions (autoconfig and system-pref)
6202
 
dnl ========================================================
6203
 
MOZ_ARG_DISABLE_BOOL(pref-extensions,
6204
 
[  --disable-pref-extensions
6205
 
                          Disable pref extensions such as autoconfig and
6206
 
                          system-pref],
6207
 
  MOZ_PREF_EXTENSIONS=,
6208
 
  MOZ_PREF_EXTENSIONS=1 )
6209
 
 
6210
 
dnl ========================================================
6211
 
dnl = Universalchardet
6212
 
dnl ========================================================
6213
 
MOZ_ARG_DISABLE_BOOL(universalchardet,
6214
 
[  --disable-universalchardet
6215
 
                          Disable universal encoding detection],
6216
 
  MOZ_UNIVERSALCHARDET=,
6217
 
  MOZ_UNIVERSALCHARDET=1 )
6218
 
 
6219
 
if test -n "${JAVA_BIN_PATH}"; then
6220
 
  dnl Look for javac and jar in the specified path.
6221
 
  JAVA_PATH="$JAVA_BIN_PATH"
6222
 
else
6223
 
  dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
6224
 
  JAVA_PATH="$JAVA_HOME/bin:$PATH"
6225
 
fi
6226
 
 
6227
 
MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
6228
 
MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
6229
 
MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
6230
 
 
6231
 
if test -n "${JAVA_BIN_PATH}" -o "$OS_TARGET" = Android; then
6232
 
  if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAR" -o "$JAR" = ":"; then
6233
 
    AC_MSG_ERROR([The programs java, javac and jar were not found.  Set \$JAVA_HOME to your java sdk directory or use --with-java-bin-path={java-bin-dir}])
6234
 
  fi
6235
 
fi
6236
 
 
6237
 
dnl ========================================================
6238
 
dnl = ANGLE OpenGL->D3D translator for WebGL
6239
 
dnl = * only applies to win32
6240
 
dnl = * enabled by default (shipping build); requires explicit --disable to disable
6241
 
dnl ========================================================
6242
 
MOZ_ANGLE=
6243
 
MOZ_DIRECTX_SDK_PATH=
6244
 
MOZ_DIRECTX_SDK_CPU_SUFFIX=
6245
 
MOZ_D3DX9_VERSION=
6246
 
MOZ_D3DX9_CAB=
6247
 
MOZ_D3DCOMPILER_CAB=
6248
 
MOZ_D3DX9_DLL=
6249
 
MOZ_D3DCOMPILER_DLL=
6250
 
case "$target_os" in
6251
 
*mingw*)
6252
 
    MOZ_ANGLE=1
6253
 
    ;;
6254
 
esac
6255
 
 
6256
 
# The DirectX SDK libraries are split into x86 and x64 sub-directories
6257
 
case "${target_cpu}" in
6258
 
i*86)
6259
 
  MOZ_DIRECTX_SDK_CPU_SUFFIX=x86
6260
 
  ;;
6261
 
x86_64)
6262
 
  MOZ_DIRECTX_SDK_CPU_SUFFIX=x64
6263
 
  # currently we disable ANGLE in 64bit builds
6264
 
  MOZ_ANGLE=
6265
 
  ;;
6266
 
esac
6267
 
 
6268
 
if test -n "$MOZ_ANGLE"; then
6269
 
MOZ_ARG_DISABLE_BOOL(angle,
6270
 
[  --disable-angle     Disable building of ANGLE for WebGL->D3D translation],
6271
 
    MOZ_ANGLE=,
6272
 
    MOZ_ANGLE=1)
6273
 
 
6274
 
if test -n "$MOZ_ANGLE"; then
6275
 
  if test -z "$_WIN32_MSVC"; then
6276
 
    AC_MSG_ERROR([Building ANGLE requires MSVC.  To build without ANGLE, reconfigure with --disable-angle.])
6277
 
  fi
6278
 
 
6279
 
  # Get the SDK path from the registry.
6280
 
  MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
6281
 
  MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's,  *, ,g' | cut -d' ' -f4-`
6282
 
 
6283
 
  MOZ_ANGLE=
6284
 
 
6285
 
  if test -n "$MOZ_DIRECTX_SDK_PATH" ; then
6286
 
    if test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h && test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
6287
 
      AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH])
6288
 
      MOZ_ANGLE=1
6289
 
    fi
6290
 
  fi
6291
 
 
6292
 
  if test -z "$MOZ_ANGLE" ; then
6293
 
    AC_MSG_WARN([Couldn't find the DirectX SDK, needed for ANGLE. Please install it (February 2010 or newer). To explicitly build without ANGLE, reconfigure with --disable-angle.])
6294
 
    AC_MSG_WARN([This will become an error in the future.])
6295
 
  fi
6296
 
 
6297
 
  if test -n "$MOZ_ANGLE" ; then
6298
 
    # Get the SDK numeric version (e.g. 42 or 43) by looking at the dependencies of d3dx9.lib
6299
 
    MOZ_D3DX9_VERSION=`dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[[0-9]][[0-9]]\.dll | head -n1 | sed 's/.*\([[0-9]][[0-9]]\).*/\\1/g'`
6300
 
 
6301
 
    if test -z "$MOZ_D3DX9_VERSION" ; then
6302
 
      MOZ_ANGLE=
6303
 
      AC_MSG_WARN([Couldn't determine the D3DX9 version! Disabling ANGLE.])
6304
 
      AC_MSG_WARN([This will become an error in the future.])
6305
 
    fi
6306
 
 
6307
 
    if test -n "$MOZ_ANGLE" ; then
6308
 
      MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
6309
 
      MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
6310
 
 
6311
 
      MOZ_D3DX9_DLL=d3dx9_$MOZ_D3DX9_VERSION.dll
6312
 
      MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll
6313
 
    fi
6314
 
  fi
6315
 
fi
6316
 
fi
6317
 
 
6318
 
dnl ========================================================
6319
 
dnl = Breakpad crash reporting (on by default on supported platforms)
6320
 
dnl ========================================================
6321
 
 
6322
 
case $target in
6323
 
i?86-*-mingw*|x86_64-*-mingw*)
6324
 
  MOZ_CRASHREPORTER=1
6325
 
  ;;
6326
 
i?86-apple-darwin*|powerpc-apple-darwin*|x86_64-apple-darwin*)
6327
 
  MOZ_CRASHREPORTER=1
6328
 
  ;;
6329
 
i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
6330
 
  if test "$MOZ_ENABLE_GTK2"; then
6331
 
    MOZ_CRASHREPORTER=1
6332
 
  fi
6333
 
  ;;
6334
 
arm-android-eabi)
6335
 
  MOZ_CRASHREPORTER=1
6336
 
  ;;
6337
 
*solaris*)
6338
 
  MOZ_CRASHREPORTER=1
6339
 
  ;;
6340
 
esac
6341
 
 
6342
 
MOZ_ARG_DISABLE_BOOL(crashreporter,
6343
 
[  --disable-crashreporter Disable breakpad crash reporting],
6344
 
    MOZ_CRASHREPORTER=,
6345
 
    MOZ_CRASHREPORTER=1)
6346
 
 
6347
 
if test -n "$MOZ_CRASHREPORTER"; then
6348
 
   AC_DEFINE(MOZ_CRASHREPORTER)
6349
 
 
6350
 
  if (test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS") && \
6351
 
    test -z "$SKIP_LIBRARY_CHECKS"; then
6352
 
    PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
6353
 
    AC_SUBST(MOZ_GTHREAD_CFLAGS)
6354
 
    AC_SUBST(MOZ_GTHREAD_LIBS)
6355
 
 
6356
 
    MOZ_CHECK_HEADERS([curl/curl.h], [], [AC_MSG_ERROR([Couldn't find curl/curl.h which is required for the crash reporter.  Use --disable-crashreporter to disable the crash reporter.])])
6357
 
  fi
6358
 
fi
6359
 
 
6360
 
MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
6361
 
[  --with-crashreporter-enable-percent=NN
6362
 
                          Enable sending crash reports by default on NN% of users. (default=100)],
6363
 
[ val=`echo $withval | sed 's/[^0-9]//g'`
6364
 
    MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
6365
 
 
6366
 
if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
6367
 
   MOZ_CRASHREPORTER_ENABLE_PERCENT=100
6368
 
fi
6369
 
AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
6370
 
 
6371
 
dnl ========================================================
6372
 
dnl = libjpeg-turbo configuration
6373
 
dnl ========================================================
6374
 
 
6375
 
MOZ_ARG_DISABLE_BOOL(libjpeg_turbo,
6376
 
[ --disable-libjpeg-turbo  Disable optimized jpeg decoding routines],
6377
 
    MOZ_LIBJPEG_TURBO=,
6378
 
    MOZ_LIBJPEG_TURBO=1)
6379
 
 
6380
 
dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
6381
 
dnl files.
6382
 
 
6383
 
if test -n "$MOZ_LIBJPEG_TURBO"; then
6384
 
 
6385
 
  dnl Do we support libjpeg-turbo on this platform?
6386
 
  case "$OS_ARCH:$OS_TEST" in
6387
 
  Linux:x86|Linux:i?86)
6388
 
    LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
6389
 
    LIBJPEG_TURBO_X86_ASM=1
6390
 
  ;;
6391
 
  Linux:x86_64)
6392
 
    LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
6393
 
    LIBJPEG_TURBO_X64_ASM=1
6394
 
  ;;
6395
 
  SunOS:i?86)
6396
 
    LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
6397
 
    LIBJPEG_TURBO_X86_ASM=1
6398
 
  ;;
6399
 
  SunOS:x86_64)
6400
 
    LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
6401
 
    LIBJPEG_TURBO_X64_ASM=1
6402
 
  ;;
6403
 
  Darwin:i?86)
6404
 
    LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
6405
 
    LIBJPEG_TURBO_X86_ASM=1
6406
 
  ;;
6407
 
  Darwin:x86_64)
6408
 
    LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
6409
 
    LIBJPEG_TURBO_X64_ASM=1
6410
 
  ;;
6411
 
  WINNT:x86|WINNT:i?86)
6412
 
    LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
6413
 
    LIBJPEG_TURBO_X86_ASM=1
6414
 
  ;;
6415
 
  WINNT:x86_64)
6416
 
    LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
6417
 
    LIBJPEG_TURBO_X64_ASM=1
6418
 
  ;;
6419
 
  esac
6420
 
 
6421
 
fi
6422
 
 
6423
 
dnl If we're on a system which supports libjpeg-turbo's asm routines and
6424
 
dnl --disable-libjpeg-turbo wasn't passed, check for yasm, and error out if it
6425
 
dnl doesn't exist or we have too old of a version.
6426
 
if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
6427
 
    AC_MSG_CHECKING([for YASM assembler])
6428
 
    AC_CHECK_PROGS(LIBJPEG_TURBO_AS, yasm, "")
6429
 
 
6430
 
    if test -z "$LIBJPEG_TURBO_AS" ; then
6431
 
        AC_MSG_ERROR([yasm is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you do not appear to have yasm installed.  Either install it or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder.  See https://developer.mozilla.org/en/YASM for more details.])
6432
 
    fi
6433
 
 
6434
 
    dnl Check that we have the right yasm version.  We require 1.0.1 or newer
6435
 
    dnl on Linux and 1.1 or newer everywhere else.
6436
 
    if test "$OS_ARCH" = "Linux" ; then
6437
 
        if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -eq "0" -a "$_YASM_RELEASE" -lt "1" \) ; then
6438
 
            AC_MSG_ERROR([yasm 1.0.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.$_YASM_MINOR_VERSION.  Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder.  See https://developer.mozilla.org/en/YASM for more details.])
6439
 
        fi
6440
 
    else
6441
 
        if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
6442
 
            AC_MSG_ERROR([yasm 1.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.  Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder.  See https://developer.mozilla.org/en/YASM for more details.])
6443
 
        fi
6444
 
    fi
6445
 
fi
6446
 
 
6447
 
if test -n "$LIBJPEG_TURBO_X86_ASM"; then
6448
 
    AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
6449
 
elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
6450
 
    AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
6451
 
elif test -n "$MOZ_LIBJPEG_TURBO"; then
6452
 
    dnl Warn if we're not building the optimized routines, even though the user
6453
 
    dnl didn't specify --disable-libjpeg-turbo.
6454
 
    AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo.  Using unoptimized C routines.])
6455
 
fi
6456
 
 
6457
 
dnl ========================================================
6458
 
dnl = Enable compilation of specific extension modules
6459
 
dnl ========================================================
6460
 
 
6461
 
MOZ_ARG_ENABLE_STRING(extensions,
6462
 
[  --enable-extensions     Enable extensions],
6463
 
[ for option in `echo $enableval | sed 's/,/ /g'`; do
6464
 
    if test "$option" = "yes" -o "$option" = "all"; then
6465
 
        AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
6466
 
    elif test "$option" = "no" -o "$option" = "none"; then
6467
 
        MOZ_EXTENSIONS=""
6468
 
    elif test "$option" = "default"; then
6469
 
        MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
6470
 
    elif test `echo "$option" | grep -c \^-` != 0; then
6471
 
        option=`echo $option | sed 's/^-//'`
6472
 
        MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
6473
 
    else
6474
 
        MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
6475
 
    fi
6476
 
done],
6477
 
    MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
6478
 
 
6479
 
if test -z "$MOZ_ENABLE_GNOMEVFS" -a -z "$MOZ_GNOMEVFS_LIBS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
6480
 
    # Suppress warning on non-X11 platforms
6481
 
    if test -n "$MOZ_X11"; then
6482
 
        AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
6483
 
    fi
6484
 
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
6485
 
fi
6486
 
 
6487
 
dnl Do not build gnomevfs with libxul based apps
6488
 
if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
6489
 
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
6490
 
fi
6491
 
 
6492
 
if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
6493
 
    # Suppress warning on non-X11 platforms
6494
 
    if test -n "$MOZ_X11"; then
6495
 
        AC_MSG_WARN([Cannot build gio without required libraries. Removing gio from MOZ_EXTENSIONS.])
6496
 
    fi
6497
 
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
6498
 
fi
6499
 
 
6500
 
dnl Do not build gio with libxul based apps
6501
 
if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
6502
 
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
6503
 
fi
6504
 
 
6505
 
if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
6506
 
    AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
6507
 
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
6508
 
fi
6509
 
 
6510
 
dnl xforms requires xtf
6511
 
if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
6512
 
    AC_MSG_WARN([Cannot build XForms without XTF support.  Removing XForms from MOZ_EXTENSIONS.])
6513
 
    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
6514
 
fi
6515
 
 
6516
 
dnl Remove dupes
6517
 
MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
6518
 
 
6519
 
dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
6520
 
dnl when trying to build a nonexistent extension.
6521
 
for extension in $MOZ_EXTENSIONS; do
6522
 
    if test ! -d "${srcdir}/extensions/${extension}"; then
6523
 
        AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
6524
 
    fi
6525
 
done
6526
 
 
6527
 
dnl ========================================================
6528
 
dnl MathML on by default
6529
 
dnl ========================================================
6530
 
MOZ_ARG_DISABLE_BOOL(mathml,
6531
 
[  --disable-mathml        Disable MathML support],
6532
 
    MOZ_MATHML=,
6533
 
    MOZ_MATHML=1 )
6534
 
if test "$MOZ_MATHML"; then
6535
 
  AC_DEFINE(MOZ_MATHML)
6536
 
fi
6537
 
 
6538
 
AC_DEFINE(MOZ_CSS_ANIMATIONS)
6539
 
 
6540
 
dnl ========================================================
6541
 
dnl Keeping AC_DEFINE(MOZ_SVG) for the moment in case of something needs it.
6542
 
dnl ========================================================
6543
 
AC_DEFINE(MOZ_SVG)
6544
 
 
6545
 
dnl ========================================================
6546
 
dnl SMIL
6547
 
dnl ========================================================
6548
 
MOZ_SMIL=1
6549
 
MOZ_ARG_DISABLE_BOOL(smil,
6550
 
[  --disable-smil          Disable SMIL animation support],
6551
 
    MOZ_SMIL=,
6552
 
    MOZ_SMIL=1 )
6553
 
if test -n "$MOZ_SMIL"; then
6554
 
  AC_DEFINE(MOZ_SMIL)
6555
 
fi
6556
 
 
6557
 
dnl ========================================================
6558
 
dnl Build Freetype in the tree
6559
 
dnl ========================================================
6560
 
MOZ_ARG_ENABLE_BOOL(tree-freetype,
6561
 
[  --enable-tree-freetype  Enable Tree FreeType],
6562
 
    MOZ_TREE_FREETYPE=1,
6563
 
    MOZ_TREE_FREETYPE= )
6564
 
if test -n "$MOZ_TREE_FREETYPE"; then
6565
 
   if test -n "$_WIN32_MSVC"; then
6566
 
      AC_ERROR("building with in-tree freetype is not supported on MSVC")
6567
 
   fi
6568
 
   AC_DEFINE(MOZ_TREE_FREETYPE)
6569
 
   AC_SUBST(MOZ_TREE_FREETYPE)
6570
 
   MOZ_ENABLE_CAIRO_FT=1       
6571
 
   FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6572
 
   FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6573
 
   CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6574
 
   FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6575
 
   CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6576
 
   AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
6577
 
   AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
6578
 
   AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
6579
 
   AC_SUBST(CAIRO_FT_CFLAGS)
6580
 
fi
6581
 
 
6582
 
dnl ========================================================
6583
 
dnl Installer
6584
 
dnl ========================================================
6585
 
case "$target_os" in
6586
 
    aix*|solaris*|linux*|mingw*|os2*|wince*|winmo*)
6587
 
        MOZ_INSTALLER=1
6588
 
        ;;
6589
 
esac
6590
 
 
6591
 
MOZ_ARG_DISABLE_BOOL(installer,
6592
 
[  --disable-installer     Disable building of installer],
6593
 
    MOZ_INSTALLER=,
6594
 
    MOZ_INSTALLER=1)
6595
 
if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
6596
 
    # Disable installer for Windows builds that use the new toolkit if the
6597
 
    # required major version and minimum minor version of Unicode NSIS isn't in
6598
 
    # the path.
6599
 
    REQ_NSIS_MAJOR_VER=2
6600
 
    MIN_NSIS_MINOR_VER=33
6601
 
    MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-2.46 makensisu makensis)
6602
 
    if test -z "$MAKENSISU" -o "$MAKENSISU" = ":"; then
6603
 
        AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path. To build without the installer reconfigure using --disable-installer.])
6604
 
    fi
6605
 
    changequote(,)
6606
 
    MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'`
6607
 
    changequote([,])
6608
 
    if test ! "$MAKENSISU_VER" = ""; then
6609
 
        MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'`
6610
 
        MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'`
6611
 
    fi
6612
 
    AC_MSG_CHECKING([for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER])
6613
 
    if test "$MAKENSISU_VER" = "" ||
6614
 
       test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \
6615
 
            ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then
6616
 
        AC_MSG_RESULT([no])
6617
 
        AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path. To build without the installer reconfigure using --disable-installer.])
6618
 
    fi
6619
 
    AC_MSG_RESULT([yes])
6620
 
fi
6621
 
 
6622
 
AC_SUBST(MOZ_INSTALLER)
6623
 
 
6624
 
AC_MSG_CHECKING([for tar archiver])
6625
 
AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6626
 
if test -z "$TAR"; then
6627
 
    AC_MSG_ERROR([no tar archiver found in \$PATH])
6628
 
fi
6629
 
AC_MSG_RESULT([$TAR])
6630
 
AC_SUBST(TAR)
6631
 
 
6632
 
AC_MSG_CHECKING([for wget])
6633
 
AC_CHECK_PROGS(WGET, wget, "")
6634
 
AC_MSG_RESULT([$WGET])
6635
 
AC_SUBST(WGET)
6636
 
 
6637
 
dnl ========================================================
6638
 
dnl Updater
6639
 
dnl ========================================================
6640
 
 
6641
 
MOZ_ARG_DISABLE_BOOL(updater,
6642
 
[  --disable-updater       Disable building of updater],
6643
 
    MOZ_UPDATER=,
6644
 
    MOZ_UPDATER=1 )
6645
 
 
6646
 
if test -n "$MOZ_UPDATER"; then
6647
 
    AC_DEFINE(MOZ_UPDATER)
6648
 
fi
6649
 
 
6650
 
# app update channel is 'default' when not supplied.
6651
 
MOZ_ARG_ENABLE_STRING([update-channel],
6652
 
[  --enable-update-channel=CHANNEL
6653
 
                          Select application update channel (default=default)],
6654
 
    MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6655
 
 
6656
 
if test -z "$MOZ_UPDATE_CHANNEL"; then
6657
 
    MOZ_UPDATE_CHANNEL=default
6658
 
fi
6659
 
AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6660
 
AC_SUBST(MOZ_UPDATE_CHANNEL)
6661
 
 
6662
 
# tools/update-packaging is not checked out by default.
6663
 
MOZ_ARG_ENABLE_BOOL(update-packaging,
6664
 
[  --enable-update-packaging
6665
 
                          Enable tools/update-packaging],
6666
 
    MOZ_UPDATE_PACKAGING=1,
6667
 
    MOZ_UPDATE_PACKAGING= )
6668
 
AC_SUBST(MOZ_UPDATE_PACKAGING)
6669
 
 
6670
 
dnl ========================================================
6671
 
dnl ActiveX
6672
 
dnl ========================================================
6673
 
 
6674
 
MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
6675
 
[  --disable-xpconnect-idispatch
6676
 
                          Disable building of xpconnect support for IDispatch
6677
 
                          (win32 only)],
6678
 
    XPC_IDISPATCH_SUPPORT=,
6679
 
    XPC_IDISPATCH_SUPPORT=1)
6680
 
AC_SUBST(XPC_IDISPATCH_SUPPORT)
6681
 
 
6682
 
MOZ_ARG_DISABLE_BOOL(activex,
6683
 
[  --disable-activex       Disable building of ActiveX control (win32 only)],
6684
 
    MOZ_NO_ACTIVEX_SUPPORT=1,
6685
 
    MOZ_NO_ACTIVEX_SUPPORT= )
6686
 
AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
6687
 
 
6688
 
MOZ_ARG_ENABLE_BOOL(activex-scripting,
6689
 
[  --enable-activex-scripting
6690
 
                          Enable building of ActiveX scripting support (win32)],
6691
 
    MOZ_ACTIVEX_SCRIPTING_SUPPORT=1,
6692
 
    MOZ_ACTIVEX_SCRIPTING_SUPPORT=)
6693
 
AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
6694
 
 
6695
 
if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
6696
 
then
6697
 
    AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
6698
 
fi
6699
 
 
6700
 
if test "$COMPILE_ENVIRONMENT" = "1"; then
6701
 
if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
6702
 
case "$target" in
6703
 
*-mingw*)
6704
 
    if test "$ac_cv_header_atlbase_h" = "no"; then
6705
 
        AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
6706
 
    fi
6707
 
    ;;
6708
 
esac
6709
 
fi
6710
 
fi
6711
 
 
6712
 
dnl ========================================================
6713
 
dnl leaky
6714
 
dnl ========================================================
6715
 
MOZ_ARG_ENABLE_BOOL(leaky,
6716
 
[  --enable-leaky          Build leaky memory tool],
6717
 
    MOZ_LEAKY=1,
6718
 
    MOZ_LEAKY=)
6719
 
 
6720
 
 
6721
 
dnl ========================================================
6722
 
dnl build the tests by default
6723
 
dnl ========================================================
6724
 
MOZ_ARG_DISABLE_BOOL(tests,
6725
 
[  --disable-tests         Do not build test libraries & programs],
6726
 
    ENABLE_TESTS=,
6727
 
    ENABLE_TESTS=1 )
6728
 
 
6729
 
dnl ========================================================
6730
 
dnl parental controls (for Windows Vista)
6731
 
dnl ========================================================
6732
 
MOZ_ARG_DISABLE_BOOL(parental-controls,
6733
 
[  --disable-parental-controls
6734
 
                          Do not build parental controls],
6735
 
   MOZ_DISABLE_PARENTAL_CONTROLS=1,
6736
 
   MOZ_DISABLE_PARENTAL_CONTROLS=)
6737
 
if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6738
 
    AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6739
 
fi
6740
 
 
6741
 
AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6742
 
 
6743
 
dnl ========================================================
6744
 
dnl = Disable DOMCrypto
6745
 
dnl ========================================================
6746
 
if test -n "$MOZ_DISABLE_DOMCRYPTO"; then
6747
 
    AC_DEFINE(MOZ_DISABLE_DOMCRYPTO)
6748
 
fi
6749
 
 
6750
 
dnl ========================================================
6751
 
dnl =
6752
 
dnl = Module specific options
6753
 
dnl =
6754
 
dnl ========================================================
6755
 
MOZ_ARG_HEADER(Individual module options)
6756
 
 
6757
 
dnl ========================================================
6758
 
dnl = Disable feed handling components
6759
 
dnl ========================================================
6760
 
MOZ_ARG_DISABLE_BOOL(feeds,
6761
 
[  --disable-feeds         Disable feed handling and processing components],
6762
 
    MOZ_FEEDS=,
6763
 
    MOZ_FEEDS=1 )
6764
 
if test -n "$MOZ_FEEDS"; then
6765
 
    AC_DEFINE(MOZ_FEEDS)
6766
 
else
6767
 
    if test "$MOZ_BUILD_APP" = "browser"; then
6768
 
        AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6769
 
    fi
6770
 
fi
6771
 
 
6772
 
dnl ========================================================
6773
 
dnl = Enable mozStorage
6774
 
dnl ========================================================
6775
 
dnl Implicitly enabled by default if building calendar or places
6776
 
MOZ_ARG_ENABLE_BOOL(storage,
6777
 
[  --enable-storage        Enable mozStorage module and related components],
6778
 
    MOZ_STORAGE=1,
6779
 
    MOZ_STORAGE= )
6780
 
if test -n "$MOZ_STORAGE"; then
6781
 
    AC_DEFINE(MOZ_STORAGE)
6782
 
fi
6783
 
 
6784
 
dnl ========================================================
6785
 
dnl Check for sqlite
6786
 
dnl ========================================================
6787
 
 
6788
 
MOZ_NATIVE_SQLITE=
6789
 
MOZ_ARG_ENABLE_BOOL(system-sqlite,
6790
 
[  --enable-system-sqlite  Use system sqlite (located with pkgconfig)],
6791
 
MOZ_NATIVE_SQLITE=1,
6792
 
MOZ_NATIVE_SQLITE= )
6793
 
 
6794
 
if test -z "$MOZ_NATIVE_SQLITE"
6795
 
then
6796
 
    SQLITE_CFLAGS=
6797
 
    SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
6798
 
else
6799
 
    dnl ============================
6800
 
    dnl === SQLite Version check ===
6801
 
    dnl ============================
6802
 
    dnl Check to see if the system SQLite package is new enough.
6803
 
    PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6804
 
 
6805
 
    dnl ==================================
6806
 
    dnl === SQLITE_SECURE_DELETE check ===
6807
 
    dnl ==================================
6808
 
    dnl Check to see if the system SQLite package is compiled with
6809
 
    dnl SQLITE_SECURE_DELETE enabled.
6810
 
    AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
6811
 
    _SAVE_CFLAGS="$CFLAGS"
6812
 
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6813
 
    _SAVE_LIBS="$LIBS"
6814
 
    LIBS="$LIBS $SQLITE_LIBS"
6815
 
    AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
6816
 
        AC_TRY_RUN([
6817
 
            #include "sqlite3.h"
6818
 
 
6819
 
            int main(int argc, char **argv){
6820
 
              return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
6821
 
            }],
6822
 
            ac_cv_sqlite_secure_delete=yes,
6823
 
            ac_cv_sqlite_secure_delete=no,
6824
 
            ac_cv_sqlite_secure_delete=no
6825
 
        )
6826
 
    ])
6827
 
    AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
6828
 
    CFLAGS="$_SAVE_CFLAGS"
6829
 
    LIBS="$_SAVE_LIBS"
6830
 
    if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
6831
 
        AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
6832
 
    fi
6833
 
 
6834
 
    dnl ===============================
6835
 
    dnl === SQLITE_THREADSAFE check ===
6836
 
    dnl ===============================
6837
 
    dnl Check to see if the system SQLite package is compiled with
6838
 
    dnl SQLITE_THREADSAFE enabled.
6839
 
    AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
6840
 
    _SAVE_CFLAGS="$CFLAGS"
6841
 
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6842
 
    _SAVE_LIBS="$LIBS"
6843
 
    LIBS="$LIBS $SQLITE_LIBS"
6844
 
    AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
6845
 
        AC_TRY_RUN([
6846
 
            #include "sqlite3.h"
6847
 
 
6848
 
            int main(int argc, char **argv){
6849
 
              return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
6850
 
            }],
6851
 
            ac_cv_sqlite_threadsafe=yes,
6852
 
            ac_cv_sqlite_threadsafe=no,
6853
 
            ac_cv_sqlite_threadsafe=no
6854
 
        )
6855
 
    ])
6856
 
    AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
6857
 
    CFLAGS="$_SAVE_CFLAGS"
6858
 
    LIBS="$_SAVE_LIBS"
6859
 
    if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
6860
 
        AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
6861
 
    fi
6862
 
 
6863
 
    dnl ================================
6864
 
    dnl === SQLITE_ENABLE_FTS3 check ===
6865
 
    dnl ================================
6866
 
    dnl check to see if the system SQLite package is compiled with
6867
 
    dnl SQLITE_ENABLE_FTS3 enabled.
6868
 
    AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
6869
 
    _SAVE_CFLAGS="$CFLAGS"
6870
 
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6871
 
    _SAVE_LIBS="$LIBS"
6872
 
    LIBS="$LIBS $SQLITE_LIBS"
6873
 
    AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
6874
 
        AC_TRY_RUN([
6875
 
            #include "sqlite3.h"
6876
 
 
6877
 
            int main(int argc, char **argv){
6878
 
              return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
6879
 
            }],
6880
 
            ac_cv_sqlite_enable_fts3=yes,
6881
 
            ac_cv_sqlite_enable_fts3=no,
6882
 
            ac_cv_sqlite_enable_fts3=no
6883
 
        )
6884
 
    ])
6885
 
    AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
6886
 
    CFLAGS="$_SAVE_CFLAGS"
6887
 
    LIBS="$_SAVE_LIBS"
6888
 
    if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
6889
 
        AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
6890
 
    fi
6891
 
 
6892
 
    dnl =========================================
6893
 
    dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
6894
 
    dnl =========================================
6895
 
    dnl check to see if the system SQLite package is compiled with
6896
 
    dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
6897
 
    AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
6898
 
    _SAVE_CFLAGS="$CFLAGS"
6899
 
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6900
 
    _SAVE_LIBS="$LIBS"
6901
 
    LIBS="$LIBS $SQLITE_LIBS"
6902
 
    AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
6903
 
        AC_TRY_RUN([
6904
 
            #include "sqlite3.h"
6905
 
 
6906
 
            int main(int argc, char **argv){
6907
 
              return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
6908
 
            }],
6909
 
            ac_cv_sqlite_enable_unlock_notify=yes,
6910
 
            ac_cv_sqlite_enable_unlock_notify=no,
6911
 
            ac_cv_sqlite_enable_unlock_notify=no
6912
 
        )
6913
 
    ])
6914
 
    AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
6915
 
    CFLAGS="$_SAVE_CFLAGS"
6916
 
    LIBS="$_SAVE_LIBS"
6917
 
    if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
6918
 
        AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
6919
 
    fi
6920
 
fi
6921
 
 
6922
 
if test -n "$MOZ_NATIVE_SQLITE"; then
6923
 
    AC_DEFINE(MOZ_NATIVE_SQLITE)
6924
 
fi
6925
 
AC_SUBST(MOZ_NATIVE_SQLITE)
6926
 
 
6927
 
dnl ========================================================
6928
 
dnl = Enable help viewer (off by default)
6929
 
dnl ========================================================
6930
 
if test -n "$MOZ_HELP_VIEWER"; then
6931
 
     dnl Do this if defined in confvars.sh
6932
 
     AC_DEFINE(MOZ_HELP_VIEWER)
6933
 
fi
6934
 
 
6935
 
dnl ========================================================
6936
 
dnl = Enable safe browsing (anti-phishing)
6937
 
dnl ========================================================
6938
 
MOZ_ARG_ENABLE_BOOL(safe-browsing,
6939
 
[  --enable-safe-browsing  Enable safe browsing (anti-phishing) implementation],
6940
 
    MOZ_SAFE_BROWSING=1,
6941
 
    MOZ_SAFE_BROWSING= )
6942
 
if test -n "$MOZ_SAFE_BROWSING"; then
6943
 
    AC_DEFINE(MOZ_SAFE_BROWSING)
6944
 
fi
6945
 
AC_SUBST(MOZ_SAFE_BROWSING)
6946
 
 
6947
 
dnl ========================================================
6948
 
dnl = Enable faststart component
6949
 
dnl ========================================================
6950
 
MOZ_ARG_ENABLE_BOOL(faststart,
6951
 
[  --enable-faststart      Enable the faststart component],
6952
 
    MOZ_FASTSTART=1,
6953
 
    MOZ_FASTSTART= )
6954
 
if test -n "$MOZ_FASTSTART"; then
6955
 
    AC_DEFINE(MOZ_FASTSTART)
6956
 
fi
6957
 
AC_SUBST(MOZ_FASTSTART)
6958
 
 
6959
 
dnl ========================================================
6960
 
dnl = Enable url-classifier
6961
 
dnl ========================================================
6962
 
dnl Implicitly enabled by default if building with safe-browsing
6963
 
if test -n "$MOZ_SAFE_BROWSING"; then
6964
 
    MOZ_URL_CLASSIFIER=1
6965
 
fi
6966
 
MOZ_ARG_ENABLE_BOOL(url-classifier,
6967
 
[  --enable-url-classifier Enable url classifier module],
6968
 
    MOZ_URL_CLASSIFIER=1,
6969
 
    MOZ_URL_CLASSIFIER= )
6970
 
if test -n "$MOZ_URL_CLASSIFIER"; then
6971
 
    AC_DEFINE(MOZ_URL_CLASSIFIER)
6972
 
fi
6973
 
AC_SUBST(MOZ_URL_CLASSIFIER)
6974
 
 
6975
 
dnl ========================================================
6976
 
dnl = Disable zipwriter
6977
 
dnl ========================================================
6978
 
MOZ_ARG_DISABLE_BOOL(zipwriter,
6979
 
[  --disable-zipwriter     Disable zipwriter component],
6980
 
    MOZ_ZIPWRITER=,
6981
 
    MOZ_ZIPWRITER=1 )
6982
 
AC_SUBST(MOZ_ZIPWRITER)
6983
 
 
6984
 
dnl ========================================================
6985
 
dnl = libconic
6986
 
dnl ========================================================
6987
 
dnl superseded by QtNetwork starting from 4.7
6988
 
MOZ_ENABLE_LIBCONIC=1
6989
 
 
6990
 
if test -n "$MOZ_ENABLE_QT"; then
6991
 
  if test "$MOZ_ENABLE_QTNETWORK"; then
6992
 
    MOZ_ENABLE_LIBCONIC=
6993
 
  fi
6994
 
fi
6995
 
 
6996
 
MOZ_ARG_DISABLE_BOOL(libconic,
6997
 
[  --disable-libconic      Disable libconic],
6998
 
    MOZ_ENABLE_LIBCONIC=,
6999
 
    MOZ_ENABLE_LIBCONIC=1 )
7000
 
 
7001
 
if test -n "$MOZ_ENABLE_LIBCONIC"; then
7002
 
    PKG_CHECK_MODULES(LIBCONIC, conic,
7003
 
                      MOZ_ENABLE_LIBCONIC=1,
7004
 
                      MOZ_ENABLE_LIBCONIC=)
7005
 
fi
7006
 
if test "$MOZ_ENABLE_LIBCONIC"; then
7007
 
    AC_DEFINE(MOZ_ENABLE_LIBCONIC)
7008
 
fi
7009
 
 
7010
 
AC_SUBST(MOZ_ENABLE_LIBCONIC)
7011
 
AC_SUBST(LIBCONIC_CFLAGS)
7012
 
AC_SUBST(LIBCONIC_LIBS)
7013
 
 
7014
 
dnl ========================================================
7015
 
dnl = Maemo checks
7016
 
dnl ========================================================
7017
 
 
7018
 
MAEMO_SDK_TARGET_VER=-1
7019
 
 
7020
 
MOZ_ARG_WITH_STRING(maemo-version,
7021
 
[  --with-maemo-version=MAEMO_SDK_TARGET_VER
7022
 
                          Maemo SDK Version],
7023
 
  MAEMO_SDK_TARGET_VER=$withval)
7024
 
 
7025
 
case "$MAEMO_SDK_TARGET_VER" in
7026
 
5)
7027
 
    MOZ_PLATFORM_MAEMO=5
7028
 
    ;;
7029
 
 
7030
 
6)
7031
 
    MOZ_PLATFORM_MAEMO=6
7032
 
    ;;
7033
 
 
7034
 
-1)
7035
 
    dnl We aren't compiling for Maemo, move on.
7036
 
    ;;
7037
 
*)
7038
 
    AC_MSG_ERROR([Unknown Maemo Version.  Try setting --with-maemo-version to 5 or 6.])
7039
 
    ;;
7040
 
esac
7041
 
 
7042
 
if test $MOZ_PLATFORM_MAEMO; then
7043
 
   AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
7044
 
 
7045
 
   if test -z "$MOZ_ENABLE_DBUS"; then
7046
 
       AC_MSG_ERROR([DBus is required when building for Maemo])
7047
 
   fi
7048
 
 
7049
 
   MOZ_GFX_OPTIMIZE_MOBILE=1
7050
 
   MOZ_WEBGL_GLX=
7051
 
   MOZ_MAEMO_LIBLOCATION=
7052
 
 
7053
 
   if test $MOZ_PLATFORM_MAEMO = 5; then
7054
 
      dnl if we have Xcomposite we should also have Xdamage and Xfixes
7055
 
      MOZ_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
7056
 
          [AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
7057
 
      AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
7058
 
                   [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
7059
 
 
7060
 
      AC_SUBST(XCOMPOSITE_LIBS)
7061
 
 
7062
 
      PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
7063
 
      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
7064
 
      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
7065
 
      if test -z "$_LIB_FOUND"; then
7066
 
         AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
7067
 
      fi
7068
 
 
7069
 
 
7070
 
      PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
7071
 
      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
7072
 
      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
7073
 
      if test -z "$_LIB_FOUND"; then
7074
 
         AC_MSG_ERROR([LibOSSO is required when building for Maemo])
7075
 
      fi
7076
 
 
7077
 
      PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
7078
 
      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
7079
 
      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
7080
 
      if test -z "$_LIB_FOUND"; then
7081
 
         AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
7082
 
      fi
7083
 
 
7084
 
   fi
7085
 
   if test $MOZ_PLATFORM_MAEMO = 6; then
7086
 
      dnl ========================================================
7087
 
      dnl = Enable meego libcontentaction
7088
 
      dnl ========================================================
7089
 
      MOZ_ARG_ENABLE_BOOL(meegocontentaction,
7090
 
      [  --enable-meegocontentaction           Enable meegocontentaction support],
7091
 
         MOZ_MEEGOCONTENTACTION=1,
7092
 
         MOZ_MEEGOCONTENTACTION=)
7093
 
 
7094
 
      if test -n "$MOZ_MEEGOCONTENTACTION"; then
7095
 
 
7096
 
         PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
7097
 
         if test "$_LIB_FOUND"; then
7098
 
            MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
7099
 
            MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
7100
 
            MOZ_ENABLE_CONTENTACTION=1
7101
 
            AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
7102
 
            AC_SUBST(MOZ_ENABLE_CONTENTACTION)
7103
 
         fi
7104
 
      fi
7105
 
 
7106
 
      MOZ_THUMB2=1
7107
 
   fi
7108
 
 
7109
 
   PKG_CHECK_MODULES(LIBLOCATION,liblocation, _LIB_FOUND=1, _LIB_FOUND=)
7110
 
   MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBLOCATION_LIBS"
7111
 
   MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBLOCATION_CFLAGS"
7112
 
   if test "$_LIB_FOUND"; then
7113
 
      MOZ_MAEMO_LIBLOCATION=1
7114
 
      AC_DEFINE(MOZ_MAEMO_LIBLOCATION)
7115
 
   else
7116
 
      AC_MSG_WARN([Cannot liblocation-dev. Disabling Maemo geolocation.])
7117
 
   fi
7118
 
   AC_SUBST(MOZ_MAEMO_LIBLOCATION)
7119
 
 
7120
 
   PKG_CHECK_MODULES(LIBMEEGOTOUCHSHARE, ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri, _LIB_FOUND=1, _LIB_FOUND=)
7121
 
   MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBMEEGOTOUCHSHARE_LIBS"
7122
 
   MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBMEEGOTOUCHSHARE_CFLAGS"
7123
 
   if test "$_LIB_FOUND"; then
7124
 
      MOZ_ENABLE_MEEGOTOUCHSHARE=1
7125
 
      AC_DEFINE(MOZ_ENABLE_MEEGOTOUCHSHARE)
7126
 
   else
7127
 
      AC_MSG_WARN([Cannot find maemo-meegotouch-interfaces-dev or libmdatauri-dev. Disabling meegotouch share ui.])
7128
 
   fi
7129
 
   AC_SUBST(MOZ_ENABLE_MEEGOTOUCHSHARE)
7130
 
 
7131
 
   AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
7132
 
   AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
7133
 
fi
7134
 
 
7135
 
dnl Setup default CPU arch for arm target
7136
 
case "$target_cpu" in
7137
 
  arm*)
7138
 
    MOZ_ARM_ARCH=armv7
7139
 
  ;;
7140
 
esac
7141
 
dnl ========================================================
7142
 
dnl = Enable building the Thumb2 instruction set
7143
 
dnl ========================================================
7144
 
MOZ_ARG_ENABLE_BOOL(thumb2,
7145
 
 [  --enable-thumb2         Enable Thumb2 instruction set (implies ARMv7)],
7146
 
    MOZ_THUMB2=1,
7147
 
    MOZ_THUMB2=)
7148
 
if test -n "$MOZ_THUMB2"; then
7149
 
  MOZ_ARM_ARCH=armv7
7150
 
fi
7151
 
 
7152
 
dnl ========================================================
7153
 
dnl = Enable building for ARM specific CPU features
7154
 
dnl ========================================================
7155
 
MOZ_ARG_WITH_STRING(cpu-arch,
7156
 
[  --with-cpu-arch=arch      Use specific arm architecture CPU features, default armv7],
7157
 
    MOZ_ARM_ARCH=$withval)
7158
 
 
7159
 
if test -n "$MOZ_THUMB2"; then
7160
 
  case "$target_cpu" in
7161
 
    arm*)
7162
 
      if test "$MOZ_ARM_ARCH" != "armv7"; then
7163
 
        AC_MSG_ERROR([--enable-thumb2 is not compatible with cpu-arch=$MOZ_ARM_ARCH])
7164
 
      fi
7165
 
      if test "$GNU_CC"; then
7166
 
        AC_DEFINE(MOZ_THUMB2)
7167
 
        AC_DEFINE(MOZ_ARM_ARCH)
7168
 
        CFLAGS="$CFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7169
 
        CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7170
 
        ASFLAGS="$ASFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7171
 
      else
7172
 
        AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
7173
 
      fi
7174
 
    ;;
7175
 
    *)
7176
 
      AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures])
7177
 
    ;;
7178
 
  esac
7179
 
elif test "$MOZ_ARM_ARCH" = "armv7"; then
7180
 
  case "$target_cpu" in
7181
 
    arm*)
7182
 
      if test "$GNU_CC"; then
7183
 
        AC_DEFINE(MOZ_ARM_ARCH)
7184
 
        CFLAGS="$CFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7185
 
        CXXFLAGS="$CXXFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7186
 
        ASFLAGS="$ASFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7187
 
      else
7188
 
        AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-GNU toolchains])
7189
 
      fi
7190
 
    ;;
7191
 
    *)
7192
 
      AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-ARM CPU architectures])
7193
 
    ;;
7194
 
  esac
7195
 
else
7196
 
  case "$target_cpu" in
7197
 
    arm*)
7198
 
      if test "$GNU_CC"; then
7199
 
        CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -msoft-float"
7200
 
        CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -msoft-float"
7201
 
        ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork -msoft-float"
7202
 
      fi
7203
 
      ;;
7204
 
  esac
7205
 
fi
7206
 
 
7207
 
AC_SUBST(MOZ_THUMB2)
7208
 
AC_SUBST(MOZ_ARM_ARCH)
7209
 
 
7210
 
dnl ========================================================
7211
 
dnl = faststripe theme
7212
 
dnl ========================================================
7213
 
MOZ_ARG_ENABLE_BOOL(faststripe,
7214
 
[  --enable-faststripe     Use faststripe theme],
7215
 
    MOZ_THEME_FASTSTRIPE=1,
7216
 
    MOZ_THEME_FASTSTRIPE= )
7217
 
AC_SUBST(MOZ_THEME_FASTSTRIPE)
7218
 
 
7219
 
dnl ========================================================
7220
 
dnl =
7221
 
dnl = Feature options that require extra sources to be pulled
7222
 
dnl =
7223
 
dnl ========================================================
7224
 
dnl MOZ_ARG_HEADER(Features that require extra sources)
7225
 
 
7226
 
dnl ========================================================
7227
 
dnl =
7228
 
dnl = Debugging Options
7229
 
dnl = 
7230
 
dnl ========================================================
7231
 
MOZ_ARG_HEADER(Debugging and Optimizations)
7232
 
 
7233
 
dnl ========================================================
7234
 
dnl = Disable building with debug info.
7235
 
dnl = Debugging is OFF by default
7236
 
dnl ========================================================
7237
 
if test -z "$MOZ_DEBUG_FLAGS"; then
7238
 
  MOZ_DEBUG_FLAGS="-g"
7239
 
fi
7240
 
 
7241
 
MOZ_ARG_ENABLE_STRING(debug,
7242
 
[  --enable-debug[=DBG]    Enable building with developer debug info
7243
 
                           (using compiler flags DBG)],
7244
 
[ if test "$enableval" != "no"; then
7245
 
    MOZ_DEBUG=1
7246
 
    if test -n "$enableval" -a "$enableval" != "yes"; then
7247
 
        MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
7248
 
        _MOZ_DEBUG_FLAGS_SET=1
7249
 
    fi
7250
 
  else
7251
 
    MOZ_DEBUG=
7252
 
  fi ],
7253
 
  MOZ_DEBUG=)
7254
 
 
7255
 
MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
7256
 
MOZ_ARG_WITH_STRING(debug-label,
7257
 
[  --with-debug-label=LABELS
7258
 
                          Define DEBUG_<value> for each comma-separated
7259
 
                          value given.],
7260
 
[ for option in `echo $withval | sed 's/,/ /g'`; do
7261
 
    MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
7262
 
done])
7263
 
 
7264
 
MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
7265
 
 
7266
 
if test -n "$MOZ_DEBUG"; then
7267
 
    AC_MSG_CHECKING([for valid debug flags])
7268
 
    _SAVE_CFLAGS=$CFLAGS
7269
 
    CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
7270
 
    AC_TRY_COMPILE([#include <stdio.h>], 
7271
 
        [printf("Hello World\n");],
7272
 
        _results=yes,
7273
 
        _results=no)
7274
 
    AC_MSG_RESULT([$_results])
7275
 
    if test "$_results" = "no"; then
7276
 
        AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
7277
 
    fi
7278
 
    CFLAGS=$_SAVE_CFLAGS
7279
 
fi
7280
 
 
7281
 
dnl ========================================================
7282
 
dnl enable mobile optimizations
7283
 
dnl ========================================================
7284
 
MOZ_ARG_ENABLE_BOOL(mobile-optimize,
7285
 
[  --enable-mobile-optimize
7286
 
                          Enable mobile optimizations],
7287
 
    MOZ_GFX_OPTIMIZE_MOBILE=1)
7288
 
 
7289
 
AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
7290
 
 
7291
 
if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
7292
 
    AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
7293
 
fi
7294
 
 
7295
 
dnl ========================================================
7296
 
dnl = Enable code optimization. ON by default.
7297
 
dnl ========================================================
7298
 
if test -z "$MOZ_OPTIMIZE_FLAGS"; then
7299
 
        MOZ_OPTIMIZE_FLAGS="-O"
7300
 
fi
7301
 
 
7302
 
MOZ_ARG_ENABLE_STRING(optimize,
7303
 
[  --disable-optimize      Disable compiler optimization
7304
 
  --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
7305
 
[ if test "$enableval" != "no"; then
7306
 
    MOZ_OPTIMIZE=1
7307
 
    if test -n "$enableval" -a "$enableval" != "yes"; then
7308
 
        MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
7309
 
        MOZ_OPTIMIZE=2
7310
 
    fi
7311
 
else
7312
 
    MOZ_OPTIMIZE=
7313
 
fi ], MOZ_OPTIMIZE=1)
7314
 
 
7315
 
if test "$COMPILE_ENVIRONMENT"; then
7316
 
if test -n "$MOZ_OPTIMIZE"; then
7317
 
    AC_MSG_CHECKING([for valid optimization flags])
7318
 
    _SAVE_CFLAGS=$CFLAGS
7319
 
    CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
7320
 
    AC_TRY_COMPILE([#include <stdio.h>], 
7321
 
        [printf("Hello World\n");],
7322
 
        _results=yes,
7323
 
        _results=no)
7324
 
    AC_MSG_RESULT([$_results])
7325
 
    if test "$_results" = "no"; then
7326
 
        AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
7327
 
    fi
7328
 
    CFLAGS=$_SAVE_CFLAGS
7329
 
fi
7330
 
fi # COMPILE_ENVIRONMENT
7331
 
 
7332
 
AC_SUBST(MOZ_OPTIMIZE)
7333
 
AC_SUBST(MOZ_OPTIMIZE_FLAGS)
7334
 
AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
7335
 
AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
7336
 
 
7337
 
dnl ========================================================
7338
 
dnl = Enable generation of debug symbols
7339
 
dnl ========================================================
7340
 
MOZ_ARG_ENABLE_STRING(debug-symbols,
7341
 
[  --enable-debug-symbols[=DBG]
7342
 
                          Enable debugging symbols (using compiler flags DBG)],
7343
 
[ if test "$enableval" != "no"; then
7344
 
      MOZ_DEBUG_SYMBOLS=1
7345
 
      if test -n "$enableval" -a "$enableval" != "yes"; then
7346
 
          if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
7347
 
              MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
7348
 
          else
7349
 
              AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
7350
 
          fi
7351
 
      fi
7352
 
  else
7353
 
      MOZ_DEBUG_SYMBOLS=
7354
 
  fi ],
7355
 
  MOZ_DEBUG_SYMBOLS=1)
7356
 
 
7357
 
if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
7358
 
    AC_DEFINE(MOZ_DEBUG_SYMBOLS)
7359
 
    export MOZ_DEBUG_SYMBOLS
7360
 
fi
7361
 
 
7362
 
dnl ========================================================
7363
 
dnl = Disable any treating of compile warnings as errors
7364
 
dnl ========================================================
7365
 
MOZ_ARG_DISABLE_BOOL(warnings-as-errors,
7366
 
[  --disable-warnings-as-errors
7367
 
                          Disable treating of warnings as errors],
7368
 
    MOZ_DISABLE_WARNINGS_AS_ERRORS=1,
7369
 
    MOZ_DISABLE_WARNINGS_AS_ERRORS= )
7370
 
if test "$MOZ_DISABLE_WARNINGS_AS_ERRORS"; then
7371
 
   WARNINGS_AS_ERRORS=''
7372
 
fi
7373
 
 
7374
 
dnl ========================================================
7375
 
dnl = Disable runtime logging checks
7376
 
dnl ========================================================
7377
 
MOZ_ARG_DISABLE_BOOL(logging,
7378
 
[  --disable-logging       Disable logging facilities],
7379
 
    NS_DISABLE_LOGGING=1,
7380
 
    NS_DISABLE_LOGGING= )
7381
 
if test "$NS_DISABLE_LOGGING"; then
7382
 
    AC_DEFINE(NS_DISABLE_LOGGING)
7383
 
else
7384
 
    AC_DEFINE(MOZ_LOGGING)
7385
 
fi
7386
 
 
7387
 
dnl ========================================================
7388
 
dnl = This will enable logging of addref, release, ctor, dtor.
7389
 
dnl ========================================================
7390
 
_ENABLE_LOGREFCNT=42
7391
 
MOZ_ARG_ENABLE_BOOL(logrefcnt,
7392
 
[  --enable-logrefcnt      Enable logging of refcounts (default=debug) ],
7393
 
    _ENABLE_LOGREFCNT=1,
7394
 
    _ENABLE_LOGREFCNT= )
7395
 
if test "$_ENABLE_LOGREFCNT" = "1"; then
7396
 
    AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
7397
 
elif test -z "$_ENABLE_LOGREFCNT"; then
7398
 
    AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
7399
 
fi
7400
 
 
7401
 
dnl ========================================================
7402
 
dnl = Enable trace malloc
7403
 
dnl ========================================================
7404
 
NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
7405
 
MOZ_ARG_ENABLE_BOOL(trace-malloc,
7406
 
[  --enable-trace-malloc   Enable malloc tracing],
7407
 
    NS_TRACE_MALLOC=1,
7408
 
    NS_TRACE_MALLOC= )
7409
 
if test "$NS_TRACE_MALLOC"; then
7410
 
  # Please, Mr. Linker Man, don't take away our symbol names
7411
 
  MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7412
 
  USE_ELF_DYNSTR_GC=
7413
 
  AC_DEFINE(NS_TRACE_MALLOC)
7414
 
fi
7415
 
AC_SUBST(NS_TRACE_MALLOC)
7416
 
 
7417
 
dnl ========================================================
7418
 
dnl = Enable jemalloc
7419
 
dnl ========================================================
7420
 
MOZ_ARG_ENABLE_BOOL(jemalloc,
7421
 
[  --enable-jemalloc       Replace memory allocator with jemalloc],
7422
 
    MOZ_MEMORY=1,
7423
 
    MOZ_MEMORY=)
7424
 
 
7425
 
if test "$NS_TRACE_MALLOC"; then
7426
 
    MOZ_MEMORY=
7427
 
fi
7428
 
 
7429
 
if test "$MOZ_MEMORY"; then
7430
 
 
7431
 
  dnl Don't try to run compiler tests on Windows  
7432
 
  if test "$OS_ARCH" = "WINNT"; then
7433
 
    if test -z "$HAVE_64BIT_OS"; then
7434
 
      AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
7435
 
    else
7436
 
      AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
7437
 
    fi
7438
 
  else
7439
 
    AC_CHECK_SIZEOF([int *], [4])
7440
 
    case "${ac_cv_sizeof_int_p}" in
7441
 
    4)
7442
 
      AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
7443
 
      ;;
7444
 
    8)
7445
 
      AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
7446
 
      ;;
7447
 
    *)
7448
 
      AC_MSG_ERROR([Unexpected pointer size])
7449
 
      ;;
7450
 
    esac
7451
 
  fi
7452
 
 
7453
 
  AC_DEFINE(MOZ_MEMORY)
7454
 
  if test "x$MOZ_DEBUG" = "x1"; then
7455
 
    AC_DEFINE(MOZ_MEMORY_DEBUG)
7456
 
  fi
7457
 
  dnl The generic feature tests that determine how to compute ncpus are long and
7458
 
  dnl complicated.  Therefore, simply define special cpp variables for the
7459
 
  dnl platforms we have special knowledge of.
7460
 
  case "${target}" in
7461
 
  *-darwin*)
7462
 
    AC_DEFINE(MOZ_MEMORY_DARWIN)
7463
 
    ;;
7464
 
  *-*freebsd*)
7465
 
    AC_DEFINE(MOZ_MEMORY_BSD)
7466
 
    ;;
7467
 
  *-*linux*)
7468
 
    AC_DEFINE(MOZ_MEMORY_LINUX)
7469
 
    ;;
7470
 
  *-netbsd*)
7471
 
    AC_DEFINE(MOZ_MEMORY_BSD)
7472
 
    ;;
7473
 
  *-solaris*)
7474
 
    AC_DEFINE(MOZ_MEMORY_SOLARIS)
7475
 
    ;;
7476
 
  *-mingw*)
7477
 
    AC_DEFINE(MOZ_MEMORY_WINDOWS)
7478
 
    dnl This is sort of awful. Will revisit if we add support for more versions
7479
 
    if test "$CC_VERSION" != "14.00.50727.762" -a "$CC_VERSION" != "15.00.30729.01"; then
7480
 
        AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 or 2008 SP1 currently.])
7481
 
    fi
7482
 
    if test -z "$WIN32_CRT_SRC_DIR"; then
7483
 
      if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
7484
 
        AC_MSG_ERROR([When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you).])
7485
 
      else
7486
 
        WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
7487
 
      fi
7488
 
    fi
7489
 
    dnl cpu check
7490
 
    case "${target_cpu}" in
7491
 
    i*86)
7492
 
      MOZ_CRT_CPU_ARCH=intel
7493
 
      ;;
7494
 
    x86_64)
7495
 
      MOZ_CRT_CPU_ARCH=amd64
7496
 
      ;;
7497
 
    *)
7498
 
      AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
7499
 
      ;;
7500
 
    esac
7501
 
 
7502
 
    AC_SUBST(MOZ_CRT_CPU_ARCH)
7503
 
 
7504
 
    if test ! -d "$WIN32_CRT_SRC_DIR"; then
7505
 
      AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
7506
 
    fi
7507
 
    WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
7508
 
    _objdir_win=`pwd -W`
7509
 
    WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
7510
 
    MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
7511
 
    dnl Also pass this to NSPR/NSS
7512
 
    DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
7513
 
    export DLLFLAGS
7514
 
    ;;
7515
 
  *-*wince)
7516
 
    AC_DEFINE(MOZ_MEMORY_WINCE)
7517
 
    AC_DEFINE(MOZ_MEMORY_WINDOWS)
7518
 
    if test -z "$WINCE_WINDOWS_MOBILE"; then
7519
 
      AC_DEFINE(MOZ_MEMORY_WINCE6)
7520
 
    fi
7521
 
    ;;
7522
 
  *-*winmo)
7523
 
    AC_DEFINE(MOZ_MEMORY_WINCE)
7524
 
    AC_DEFINE(MOZ_MEMORY_WINDOWS)
7525
 
    ;;
7526
 
  *-android*)
7527
 
    AC_DEFINE(MOZ_MEMORY_LINUX)
7528
 
    AC_DEFINE(MOZ_MEMORY_ANDROID)
7529
 
    _WRAP_MALLOC=1
7530
 
    export WRAP_MALLOC_LIB="-L$_objdir/dist/lib -lmozalloc -lmozutils"
7531
 
    WRAP_MALLOC_CFLAGS="-Wl,--wrap=dlopen -Wl,--wrap=dlclose -Wl,--wrap=dlerror -Wl,--wrap=dlsym -Wl,--wrap=dladdr"
7532
 
    ;;
7533
 
  *)
7534
 
    AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
7535
 
    ;;
7536
 
  esac
7537
 
 
7538
 
  if test "$OS_ARCH" != "Darwin"; then
7539
 
    dnl NB: this must be kept in sync with jemalloc.h
7540
 
    AC_DEFINE(HAVE_JEMALLOC_VALLOC)
7541
 
    AC_DEFINE(HAVE_JEMALLOC_POSIX_MEMALIGN)
7542
 
    AC_DEFINE(HAVE_JEMALLOC_MEMALIGN)
7543
 
  fi
7544
 
fi
7545
 
AC_SUBST(MOZ_MEMORY)
7546
 
AC_SUBST(MOZ_MEMORY_LDFLAGS)
7547
 
AC_SUBST(WIN32_CRT_SRC_DIR)
7548
 
dnl Need to set this for make because NSS doesn't have configure
7549
 
AC_SUBST(DLLFLAGS)
7550
 
 
7551
 
dnl ========================================================
7552
 
dnl = Use malloc wrapper lib
7553
 
dnl ========================================================
7554
 
MOZ_ARG_ENABLE_BOOL(wrap-malloc,
7555
 
[  --enable-wrap-malloc    Wrap malloc calls (gnu linker only)],
7556
 
    _WRAP_MALLOC=1,
7557
 
    _WRAP_MALLOC= )
7558
 
 
7559
 
if test -n "$_WRAP_MALLOC"; then
7560
 
    if test "$GNU_CC"; then
7561
 
    WRAP_MALLOC_CFLAGS="${LDFLAGS} ${WRAP_MALLOC_CFLAGS} -Wl,--wrap -Wl,malloc -Wl,--wrap -Wl,calloc -Wl,--wrap -Wl,valloc -Wl,--wrap -Wl,free -Wl,--wrap -Wl,realloc -Wl,--wrap -Wl,memalign -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 -Wl,--wrap -Wl,strdup -Wl,--wrap -Wl,strndup -Wl,--wrap -Wl,posix_memalign"
7562
 
    MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) $(WRAP_MALLOC_LIB) -o $@'
7563
 
    MKCSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) $(WRAP_MALLOC_LIB) -o $@'
7564
 
    fi
7565
 
fi
7566
 
 
7567
 
dnl ========================================================
7568
 
dnl = Location of malloc wrapper lib
7569
 
dnl ========================================================
7570
 
MOZ_ARG_WITH_STRING(wrap-malloc,
7571
 
[  --with-wrap-malloc=DIR  Location of malloc wrapper library],
7572
 
    WRAP_MALLOC_LIB=$withval)
7573
 
 
7574
 
dnl ========================================================
7575
 
dnl = Use JS Call tracing
7576
 
dnl ========================================================
7577
 
MOZ_ARG_ENABLE_BOOL(trace-jscalls,
7578
 
[  --enable-trace-jscalls  Enable JS call enter/exit callback (default=no)],
7579
 
    MOZ_TRACE_JSCALLS=1,
7580
 
    MOZ_TRACE_JSCALLS= )
7581
 
if test -n "$MOZ_TRACE_JSCALLS"; then
7582
 
    AC_DEFINE(MOZ_TRACE_JSCALLS)
7583
 
fi
7584
 
 
7585
 
dnl ========================================================
7586
 
dnl = Use TraceVis
7587
 
dnl ========================================================
7588
 
MOZ_ARG_ENABLE_BOOL(tracevis,
7589
 
[  --enable-tracevis       Enable TraceVis tracing tool (default=no)],
7590
 
    MOZ_TRACEVIS=1,
7591
 
    MOZ_TRACEVIS= )
7592
 
if test -n "$MOZ_TRACEVIS"; then
7593
 
    AC_DEFINE(MOZ_TRACEVIS)
7594
 
fi
7595
 
 
7596
 
dnl ========================================================
7597
 
dnl = Use GCTimer
7598
 
dnl ========================================================
7599
 
MOZ_ARG_ENABLE_BOOL(gctimer,
7600
 
[  --enable-gctimer        Enable GC timer (default=no)],
7601
 
    MOZ_GCTIMER=1,
7602
 
    MOZ_GCTIMER= )
7603
 
if test -n "$MOZ_GCTIMER"; then
7604
 
    AC_DEFINE(MOZ_GCTIMER)
7605
 
fi
7606
 
 
7607
 
dnl ========================================================
7608
 
dnl Zealous JavaScript GC
7609
 
dnl ========================================================
7610
 
MOZ_ARG_ENABLE_BOOL(gczeal,
7611
 
[  --enable-gczeal         Enable zealous JavaScript GCing],
7612
 
    JS_GC_ZEAL=1,
7613
 
    JS_GC_ZEAL= )
7614
 
if test -n "$JS_GC_ZEAL"; then
7615
 
    AC_DEFINE(JS_GC_ZEAL)
7616
 
fi
7617
 
 
7618
 
dnl ======================================================
7619
 
dnl = Enable compiling with ccache
7620
 
dnl ======================================================
7621
 
MOZ_ARG_WITH_STRING(ccache,
7622
 
[  --with-ccache[=path/to/ccache]
7623
 
                          Enable compiling with ccache],
7624
 
    CCACHE=$withval, CCACHE="no")
7625
 
 
7626
 
if test "$CCACHE" != "no"; then
7627
 
    if test -z "$CCACHE" -o "$CCACHE" = "yes"; then
7628
 
        CCACHE=
7629
 
    else
7630
 
        if test ! -e "$CCACHE"; then
7631
 
            AC_MSG_ERROR([$CCACHE not found])
7632
 
        fi
7633
 
    fi
7634
 
    MOZ_PATH_PROGS(CCACHE, $CCACHE ccache)
7635
 
    if test -z "$CCACHE" -o "$CCACHE" = ":"; then
7636
 
        AC_MSG_ERROR([ccache not found])
7637
 
    elif test -x "$CCACHE"; then
7638
 
        CC="$CCACHE $CC"
7639
 
        CXX="$CCACHE $CXX"
7640
 
    else
7641
 
        AC_MSG_ERROR([$CCACHE is not executable])
7642
 
    fi
7643
 
fi
7644
 
 
7645
 
dnl ========================================================
7646
 
dnl = Enable static checking using gcc-dehydra
7647
 
dnl ========================================================
7648
 
 
7649
 
MOZ_ARG_WITH_STRING(static-checking,
7650
 
[  --with-static-checking=path/to/gcc_dehydra.so
7651
 
                          Enable static checking of code using GCC-dehydra],
7652
 
    DEHYDRA_PATH=$withval,
7653
 
    DEHYDRA_PATH= )
7654
 
 
7655
 
if test -n "$DEHYDRA_PATH"; then
7656
 
    if test ! -f "$DEHYDRA_PATH"; then
7657
 
        AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
7658
 
    fi
7659
 
    AC_DEFINE(NS_STATIC_CHECKING)
7660
 
fi
7661
 
AC_SUBST(DEHYDRA_PATH)
7662
 
 
7663
 
dnl ========================================================
7664
 
dnl = Enable stripping of libs & executables
7665
 
dnl ========================================================
7666
 
MOZ_ARG_ENABLE_BOOL(strip,
7667
 
[  --enable-strip          Enable stripping of libs & executables ],
7668
 
    ENABLE_STRIP=1,
7669
 
    ENABLE_STRIP= )
7670
 
 
7671
 
dnl ========================================================
7672
 
dnl = Enable stripping of libs & executables when packaging
7673
 
dnl ========================================================
7674
 
MOZ_ARG_ENABLE_BOOL(install-strip,
7675
 
[  --enable-install-strip  Enable stripping of libs & executables when packaging ],
7676
 
    PKG_SKIP_STRIP= ,
7677
 
    PKG_SKIP_STRIP=1)
7678
 
 
7679
 
dnl ========================================================
7680
 
dnl = --enable-elf-dynstr-gc
7681
 
dnl ========================================================
7682
 
MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
7683
 
[  --enable-elf-dynstr-gc  Enable elf dynstr garbage collector (opt builds only)],
7684
 
    USE_ELF_DYNSTR_GC=1,
7685
 
    USE_ELF_DYNSTR_GC= )
7686
 
 
7687
 
dnl ========================================================
7688
 
dnl = --disable-elf-hack
7689
 
dnl ========================================================
7690
 
 
7691
 
USE_ELF_HACK=1
7692
 
MOZ_ARG_DISABLE_BOOL(elf-hack,
7693
 
[  --disable-elf-hack      Disable elf hacks],
7694
 
    USE_ELF_HACK=,
7695
 
    USE_ELF_HACK=1)
7696
 
 
7697
 
# Only enable elfhack where supported
7698
 
if test "$USE_ELF_HACK" = 1; then
7699
 
    case "${HOST_OS_ARCH},${OS_ARCH}" in
7700
 
    Linux,Linux)
7701
 
        case "${CPU_ARCH}" in
7702
 
        arm | x86 | x86_64)
7703
 
            USE_ELF_HACK=1
7704
 
            ;;
7705
 
        *)
7706
 
            USE_ELF_HACK=
7707
 
            ;;
7708
 
        esac
7709
 
        ;;
7710
 
    *)
7711
 
        USE_ELF_HACK=
7712
 
        ;;
7713
 
    esac
7714
 
fi
7715
 
 
7716
 
dnl ========================================================
7717
 
dnl = 
7718
 
dnl = Profiling and Instrumenting
7719
 
dnl = 
7720
 
dnl ========================================================
7721
 
MOZ_ARG_HEADER(Profiling and Instrumenting)
7722
 
 
7723
 
dnl ========================================================
7724
 
dnl = Enable timeline service, which provides lightweight
7725
 
dnl = instrumentation of mozilla for performance measurement.
7726
 
dnl = Timeline is off by default.
7727
 
dnl ========================================================
7728
 
MOZ_ARG_ENABLE_BOOL(timeline,
7729
 
[  --enable-timeline       Enable timeline services ],
7730
 
    MOZ_TIMELINE=1,
7731
 
    MOZ_TIMELINE= )
7732
 
if test -n "$MOZ_TIMELINE"; then
7733
 
    AC_DEFINE(MOZ_TIMELINE)
7734
 
fi
7735
 
 
7736
 
dnl ========================================================
7737
 
dnl = Enable NS_FUNCTION_TIMER, which provides Function 
7738
 
dnl = timing for identifying code bottlenecks 
7739
 
dnl = NS_FUNCTION_TIMER is off by default.
7740
 
dnl ========================================================
7741
 
MOZ_ARG_ENABLE_BOOL(functiontimer,
7742
 
[  --enable-functiontimer  Enable NS_FUNCTION_TIMER ],
7743
 
    NS_FUNCTION_TIMER=1,
7744
 
    NS_FUNCTION_TIMER= )
7745
 
if test -n "$NS_FUNCTION_TIMER"; then
7746
 
    AC_DEFINE(NS_FUNCTION_TIMER)
7747
 
fi
7748
 
 
7749
 
dnl ========================================================
7750
 
dnl Turn on reflow counting
7751
 
dnl ========================================================
7752
 
MOZ_ARG_ENABLE_BOOL(reflow-perf,
7753
 
[  --enable-reflow-perf    Enable reflow performance tracing],
7754
 
    MOZ_REFLOW_PERF=1,
7755
 
    MOZ_REFLOW_PERF= )
7756
 
if test -n "$MOZ_REFLOW_PERF"; then
7757
 
    AC_DEFINE(MOZ_REFLOW_PERF)
7758
 
fi
7759
 
 
7760
 
dnl ========================================================
7761
 
dnl Enable code size metrics.
7762
 
dnl ========================================================
7763
 
MOZ_ARG_ENABLE_BOOL(codesighs,
7764
 
[  --enable-codesighs      Enable code size analysis tools],
7765
 
    _ENABLE_CODESIGHS=1,
7766
 
    _ENABLE_CODESIGHS= )
7767
 
if test -n "$_ENABLE_CODESIGHS"; then
7768
 
    if test -d $srcdir/tools/codesighs; then 
7769
 
        MOZ_MAPINFO=1
7770
 
    else
7771
 
        AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
7772
 
    fi
7773
 
fi
7774
 
 
7775
 
dnl ========================================================
7776
 
dnl = Support for Quantify (Windows)
7777
 
dnl ========================================================
7778
 
MOZ_ARG_ENABLE_BOOL(quantify,
7779
 
[  --enable-quantify       Enable Quantify support (Windows only) ],
7780
 
    MOZ_QUANTIFY=1,
7781
 
    MOZ_QUANTIFY= )
7782
 
 
7783
 
dnl ========================================================
7784
 
dnl = Support for demangling undefined symbols
7785
 
dnl ========================================================
7786
 
if test -z "$SKIP_LIBRARY_CHECKS"; then
7787
 
    AC_LANG_SAVE
7788
 
    AC_LANG_CPLUSPLUS
7789
 
    AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
7790
 
    AC_LANG_RESTORE
7791
 
fi
7792
 
 
7793
 
# Demangle only for debug or trace-malloc builds
7794
 
MOZ_DEMANGLE_SYMBOLS=
7795
 
if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
7796
 
    MOZ_DEMANGLE_SYMBOLS=1
7797
 
    AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
7798
 
fi
7799
 
AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
7800
 
 
7801
 
dnl ========================================================
7802
 
dnl = Support for gcc stack unwinding (from gcc 3.3)
7803
 
dnl ========================================================
7804
 
if test "$HAVE_GCC3_ABI" -a -z "$SKIP_LIBRARY_CHECKS"; then
7805
 
    MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
7806
 
fi
7807
 
 
7808
 
dnl ========================================================
7809
 
dnl =
7810
 
dnl = Misc. Options
7811
 
dnl = 
7812
 
dnl ========================================================
7813
 
MOZ_ARG_HEADER(Misc. Options)
7814
 
 
7815
 
dnl ========================================================
7816
 
dnl update xterm title
7817
 
dnl ========================================================
7818
 
MOZ_ARG_ENABLE_BOOL(xterm-updates,
7819
 
[  --enable-xterm-updates  Update XTERM titles with current command.],
7820
 
    MOZ_UPDATE_XTERM=1,
7821
 
    MOZ_UPDATE_XTERM= )
7822
 
 
7823
 
dnl =========================================================
7824
 
dnl = Chrome format
7825
 
dnl =========================================================
7826
 
MOZ_ARG_ENABLE_STRING([chrome-format],
7827
 
[  --enable-chrome-format=jar|flat|both|symlink|omni
7828
 
                          Select FORMAT of chrome files (default=jar)],
7829
 
    MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7830
 
 
7831
 
if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7832
 
    MOZ_CHROME_FILE_FORMAT=jar
7833
 
fi
7834
 
 
7835
 
if test "$MOZ_CHROME_FILE_FORMAT" != "jar" && 
7836
 
    test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7837
 
    test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7838
 
    test "$MOZ_CHROME_FILE_FORMAT" != "both" &&
7839
 
    test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then
7840
 
    AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, symlink, or omni])
7841
 
fi
7842
 
 
7843
 
dnl =========================================================
7844
 
dnl Omnijar packaging (bug 552121)
7845
 
dnl =========================================================
7846
 
dnl Omnijar packaging is compatible with flat packaging.
7847
 
dnl In unpackaged builds, omnijar looks for files as if
7848
 
dnl things were flat packaged. After packaging, all files
7849
 
dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
7850
 
dnl is set to flat since putting files into jars is only
7851
 
dnl done during packaging with omnijar.
7852
 
if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
7853
 
    MOZ_OMNIJAR=1
7854
 
    AC_DEFINE(MOZ_OMNIJAR)
7855
 
    MOZ_CHROME_FILE_FORMAT=flat
7856
 
elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
7857
 
    AC_DEFINE(MOZ_CHROME_FILE_FORMAT_JAR)
7858
 
fi
7859
 
 
7860
 
AC_SUBST(MOZ_OMNIJAR)
7861
 
 
7862
 
dnl ========================================================
7863
 
dnl = Define default location for MOZILLA_FIVE_HOME
7864
 
dnl ========================================================
7865
 
MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7866
 
[  --with-default-mozilla-five-home
7867
 
                          Set the default value for MOZILLA_FIVE_HOME],
7868
 
[ val=`echo $withval`
7869
 
  AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7870
 
 
7871
 
dnl ========================================================
7872
 
dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7873
 
dnl ========================================================
7874
 
MOZ_ARG_WITH_STRING(user-appdir,
7875
 
[  --with-user-appdir=DIR  Set user-specific appdir (default=.mozilla)],
7876
 
[ val=`echo $withval`
7877
 
if echo "$val" | grep "\/" >/dev/null; then
7878
 
    AC_MSG_ERROR("Homedir must be single relative path.")
7879
 
else 
7880
 
    MOZ_USER_DIR="$val"
7881
 
fi])
7882
 
 
7883
 
AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7884
 
 
7885
 
dnl ========================================================
7886
 
dnl = Doxygen configuration
7887
 
dnl ========================================================
7888
 
dnl Use commas to specify multiple dirs to this arg
7889
 
MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7890
 
MOZ_ARG_WITH_STRING(doc-input-dirs,
7891
 
[  --with-doc-input-dirs=DIRS
7892
 
                          Header/idl dirs to create docs from],
7893
 
[ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7894
 
AC_SUBST(MOZ_DOC_INPUT_DIRS)
7895
 
 
7896
 
dnl Use commas to specify multiple dirs to this arg
7897
 
MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7898
 
MOZ_ARG_WITH_STRING(doc-include-dirs,
7899
 
[  --with-doc-include-dirs=DIRS  
7900
 
                          Include dirs to preprocess doc headers],
7901
 
[ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7902
 
AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7903
 
 
7904
 
MOZ_DOC_OUTPUT_DIR='./dist/docs'
7905
 
MOZ_ARG_WITH_STRING(doc-output-dir,
7906
 
[  --with-doc-output-dir=DIR
7907
 
                          Dir to generate docs into],
7908
 
[ MOZ_DOC_OUTPUT_DIR=$withval ] )
7909
 
AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7910
 
 
7911
 
if test -z "$SKIP_COMPILER_CHECKS"; then
7912
 
dnl ========================================================
7913
 
dnl =
7914
 
dnl = Compiler Options
7915
 
dnl = 
7916
 
dnl ========================================================
7917
 
MOZ_ARG_HEADER(Compiler Options)
7918
 
 
7919
 
dnl ========================================================
7920
 
dnl Check for gcc -pipe support
7921
 
dnl ========================================================
7922
 
AC_MSG_CHECKING([for gcc -pipe support])
7923
 
if test -n "$GNU_CC" -a -n "$GNU_CXX" -a -n "$GNU_AS"; then
7924
 
    echo '#include <stdio.h>' > dummy-hello.c
7925
 
    echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7926
 
    ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7927
 
    cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
7928
 
    if test $? = 0; then
7929
 
        _res_as_stdin="yes"
7930
 
    else
7931
 
        _res_as_stdin="no"
7932
 
    fi
7933
 
    if test "$_res_as_stdin" = "yes"; then
7934
 
        _SAVE_CFLAGS=$CFLAGS
7935
 
        CFLAGS="$CFLAGS -pipe"
7936
 
        AC_TRY_COMPILE( [ #include <stdio.h> ],
7937
 
            [printf("Hello World\n");],
7938
 
            [_res_gcc_pipe="yes"],
7939
 
            [_res_gcc_pipe="no"] )
7940
 
        CFLAGS=$_SAVE_CFLAGS
7941
 
    fi
7942
 
    if test "$_res_as_stdin" = "yes" -a "$_res_gcc_pipe" = "yes"; then
7943
 
        _res="yes";
7944
 
        CFLAGS="$CFLAGS -pipe"
7945
 
        CXXFLAGS="$CXXFLAGS -pipe"
7946
 
    else
7947
 
        _res="no"
7948
 
    fi
7949
 
    rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7950
 
    AC_MSG_RESULT([$_res])
7951
 
else
7952
 
    AC_MSG_RESULT([no])
7953
 
fi
7954
 
 
7955
 
dnl ========================================================
7956
 
dnl Profile guided optimization
7957
 
dnl ========================================================
7958
 
dnl Test for profiling options
7959
 
dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7960
 
 
7961
 
dnl Provide a switch to disable PGO even when called via profiledbuild.
7962
 
MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
7963
 
[  --disable-profile-guided-optimization
7964
 
                          Don't build with PGO even if called via make profiledbuild],
7965
 
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
7966
 
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
7967
 
 
7968
 
AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
7969
 
 
7970
 
_SAVE_CFLAGS="$CFLAGS"
7971
 
CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
7972
 
 
7973
 
AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7974
 
AC_TRY_COMPILE([], [return 0;],
7975
 
               [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7976
 
                 result="yes" ], result="no")
7977
 
AC_MSG_RESULT([$result])
7978
 
 
7979
 
if test $result = "yes"; then
7980
 
  PROFILE_GEN_LDFLAGS="-fprofile-generate"
7981
 
  PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch -freorder-blocks-and-partition"
7982
 
  PROFILE_USE_LDFLAGS="-fprofile-use"
7983
 
fi
7984
 
 
7985
 
CFLAGS="$_SAVE_CFLAGS"
7986
 
 
7987
 
if test -n "$INTEL_CC"; then
7988
 
  PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7989
 
  PROFILE_GEN_LDFLAGS=
7990
 
  PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7991
 
  PROFILE_USE_LDFLAGS=
7992
 
fi
7993
 
 
7994
 
dnl Sun Studio on Solaris
7995
 
if test "$SOLARIS_SUNPRO_CC"; then
7996
 
  PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7997
 
  PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7998
 
  PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7999
 
  PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
8000
 
fi
8001
 
 
8002
 
AC_SUBST(PROFILE_GEN_CFLAGS)
8003
 
AC_SUBST(PROFILE_GEN_LDFLAGS)
8004
 
AC_SUBST(PROFILE_USE_CFLAGS)
8005
 
AC_SUBST(PROFILE_USE_LDFLAGS)
8006
 
 
8007
 
AC_LANG_CPLUSPLUS
8008
 
 
8009
 
dnl ========================================================
8010
 
dnl Test for -pedantic bustage
8011
 
dnl ========================================================
8012
 
MOZ_ARG_DISABLE_BOOL(pedantic,
8013
 
[  --disable-pedantic      Issue all warnings demanded by strict ANSI C ],
8014
 
_PEDANTIC= )
8015
 
if test "$_PEDANTIC"; then
8016
 
    _SAVE_CXXFLAGS=$CXXFLAGS
8017
 
    CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
8018
 
    AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
8019
 
    AC_TRY_COMPILE([$configure_static_assert_macros],
8020
 
                   [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
8021
 
                   result="no", result="yes" )
8022
 
    AC_MSG_RESULT([$result])
8023
 
    CXXFLAGS="$_SAVE_CXXFLAGS"
8024
 
 
8025
 
    case "$result" in
8026
 
    no)
8027
 
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
8028
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
8029
 
        ;;
8030
 
    yes)
8031
 
        AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic.  Reconfigure using --disable-pedantic. ])
8032
 
        ;;
8033
 
    esac
8034
 
fi
8035
 
 
8036
 
dnl ========================================================
8037
 
dnl Test for correct temporary object destruction order
8038
 
dnl ========================================================
8039
 
dnl We want to make sure the compiler follows the C++ spec here as 
8040
 
dnl xpcom and the string classes depend on it (bug 235381).
8041
 
AC_MSG_CHECKING([for correct temporary object destruction order])
8042
 
AC_TRY_RUN([ class A {
8043
 
             public:  A(int& x) : mValue(x) {}
8044
 
                      ~A() { mValue--; }
8045
 
                      operator char**() { return 0; }
8046
 
             private:  int& mValue;
8047
 
             };
8048
 
             void func(char **arg) {}
8049
 
             int m=2;
8050
 
             void test() {
8051
 
                  func(A(m));
8052
 
                  if (m==1) m = 0;
8053
 
             }
8054
 
             int main() {
8055
 
                 test();
8056
 
                 return(m);
8057
 
             }
8058
 
             ],
8059
 
     result="yes", result="no", result="maybe")
8060
 
AC_MSG_RESULT([$result])
8061
 
 
8062
 
if test "$result" = "no"; then
8063
 
    AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
8064
 
fi
8065
 
 
8066
 
dnl ========================================================
8067
 
dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
8068
 
dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
8069
 
dnl raw pointers in nsCOMPtr.h.  (VC++ has the same bug.)
8070
 
dnl ========================================================
8071
 
_SAVE_CXXFLAGS=$CXXFLAGS
8072
 
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
8073
 
AC_CACHE_CHECK(for correct overload resolution with const and templates,
8074
 
    ac_nscap_nonconst_opeq_bug,
8075
 
    [AC_TRY_COMPILE([
8076
 
                      template <class T>
8077
 
                      class Pointer
8078
 
                        {
8079
 
                        public:
8080
 
                          T* myPtr;
8081
 
                        };
8082
 
                      
8083
 
                      template <class T, class U>
8084
 
                      int operator==(const Pointer<T>& rhs, U* lhs)
8085
 
                        {
8086
 
                          return rhs.myPtr == lhs;
8087
 
                        }
8088
 
                      
8089
 
                      template <class T, class U>
8090
 
                      int operator==(const Pointer<T>& rhs, const U* lhs)
8091
 
                        {
8092
 
                          return rhs.myPtr == lhs;
8093
 
                        }
8094
 
                    ],
8095
 
                    [
8096
 
                      Pointer<int> foo;
8097
 
                      const int* bar;
8098
 
                      return foo == bar;
8099
 
                    ],
8100
 
                    ac_nscap_nonconst_opeq_bug="no",
8101
 
                    ac_nscap_nonconst_opeq_bug="yes")])
8102
 
CXXFLAGS="$_SAVE_CXXFLAGS"
8103
 
 
8104
 
if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
8105
 
    AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
8106
 
fi
8107
 
fi # SKIP_COMPILER_CHECKS
8108
 
 
8109
 
dnl ========================================================
8110
 
dnl C++ rtti
8111
 
dnl Should be smarter and check that the compiler does indeed have rtti
8112
 
dnl ========================================================
8113
 
 
8114
 
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
8115
 
[  --enable-cpp-rtti       Enable C++ RTTI ],
8116
 
[ _MOZ_USE_RTTI=1 ],
8117
 
[ _MOZ_USE_RTTI= ])
8118
 
 
8119
 
if test "$_MOZ_USE_RTTI"; then
8120
 
   _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
8121
 
else
8122
 
   _MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
8123
 
fi
8124
 
 
8125
 
AC_SUBST(_MOZ_RTTI_FLAGS_ON)
8126
 
 
8127
 
dnl ========================================================
8128
 
dnl C++ exceptions (g++/VC/irix6/Sun only - for now)
8129
 
dnl Should be smarter and check that the compiler does indeed have exceptions
8130
 
dnl ========================================================
8131
 
MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
8132
 
[  --enable-cpp-exceptions Enable C++ exceptions ],
8133
 
[ _MOZ_CPP_EXCEPTIONS=1 ],
8134
 
[ _MOZ_CPP_EXCEPTIONS= ])
8135
 
 
8136
 
if test "$_MOZ_CPP_EXCEPTIONS"; then
8137
 
    _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
8138
 
    AC_DEFINE(MOZ_CPP_EXCEPTIONS)
8139
 
else
8140
 
    _MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
8141
 
fi
8142
 
 
8143
 
AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
8144
 
 
8145
 
# Irix & OSF native compilers do not like exception declarations 
8146
 
# when exceptions are disabled
8147
 
if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
8148
 
    AC_DEFINE(CPP_THROW_NEW, [])
8149
 
else
8150
 
    AC_DEFINE(CPP_THROW_NEW, [throw()])
8151
 
fi
8152
 
AC_LANG_C
8153
 
 
8154
 
dnl ========================================================
8155
 
dnl =
8156
 
dnl = Check what kind of list files are supported by the
8157
 
dnl = linker
8158
 
dnl =
8159
 
dnl ========================================================
8160
 
 
8161
 
AC_CACHE_CHECK(what kind of list files are supported by the linker,
8162
 
    EXPAND_LIBS_LIST_STYLE,
8163
 
    [echo "int main() {return 0;}" > conftest.${ac_ext}
8164
 
     if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&2) && test -s conftest.${OBJ_SUFFIX}; then
8165
 
         echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
8166
 
         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
8167
 
             EXPAND_LIBS_LIST_STYLE=linkerscript
8168
 
         else
8169
 
             echo "conftest.${OBJ_SUFFIX}" > conftest.list
8170
 
             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
8171
 
                 EXPAND_LIBS_LIST_STYLE=list
8172
 
             else
8173
 
                 EXPAND_LIBS_LIST_STYLE=none
8174
 
             fi
8175
 
         fi
8176
 
     else
8177
 
         dnl We really don't expect to get here, but just in case
8178
 
         AC_ERROR([couldn't compile a simple C file])
8179
 
     fi
8180
 
     rm -rf conftest*])
8181
 
 
8182
 
LIBS_DESC_SUFFIX=desc
8183
 
AC_SUBST(LIBS_DESC_SUFFIX)
8184
 
AC_SUBST(EXPAND_LIBS_LIST_STYLE)
8185
 
 
8186
 
dnl ========================================================
8187
 
dnl =
8188
 
dnl = Build depencency options
8189
 
dnl =
8190
 
dnl ========================================================
8191
 
MOZ_ARG_HEADER(Build dependencies)
8192
 
 
8193
 
dnl ========================================================
8194
 
dnl = Do not auto generate dependency info
8195
 
dnl ========================================================
8196
 
MOZ_AUTO_DEPS=1
8197
 
MOZ_ARG_DISABLE_BOOL(auto-deps,
8198
 
[  --disable-auto-deps     Do not automatically generate dependency info],
8199
 
    MOZ_AUTO_DEPS=,
8200
 
    MOZ_AUTO_DEPS=1)
8201
 
 
8202
 
if test -n "$MOZ_AUTO_DEPS"; then
8203
 
dnl ========================================================
8204
 
dnl = Use mkdepend instead of $CC -MD for dependency generation
8205
 
dnl ========================================================
8206
 
_cpp_md_flag=
8207
 
MOZ_ARG_DISABLE_BOOL(md,
8208
 
[  --disable-md            Do not use compiler-based dependencies ],
8209
 
  [_cpp_md_flag=],
8210
 
  [_cpp_md_flag=1],
8211
 
  [dnl Default is to turn on -MD if using GNU-compatible compilers
8212
 
   if test "$GNU_CC" -a "$GNU_CXX"; then
8213
 
     _cpp_md_flag=1
8214
 
   fi
8215
 
  dnl Default is to use -xM if using Sun Studio on Solaris
8216
 
   if test "$SOLARIS_SUNPRO_CC"; then
8217
 
     _cpp_md_flag=1
8218
 
   fi])
8219
 
if test "$_cpp_md_flag"; then
8220
 
  COMPILER_DEPEND=1
8221
 
  _DEPEND_CFLAGS='$(filter-out %/.pp,-MD -MF $(MDDEPDIR)/$(basename $(@F)).pp)'
8222
 
  dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
8223
 
  if test "$SOLARIS_SUNPRO_CC"; then
8224
 
    _DEPEND_CFLAGS=
8225
 
  fi
8226
 
else
8227
 
  COMPILER_DEPEND=
8228
 
  dnl Don't override this for MSVC
8229
 
  if test -z "$_WIN32_MSVC"; then
8230
 
    _USE_CPP_INCLUDE_FLAG=
8231
 
    _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
8232
 
    _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
8233
 
  else
8234
 
    echo '#include <stdio.h>' > dummy-hello.c
8235
 
    changequote(,)
8236
 
    CL_INCLUDES_PREFIX=`"${CC}" -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
8237
 
    changequote([,])
8238
 
    if test -z "$CL_INCLUDES_PREFIX"; then
8239
 
        AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
8240
 
    fi
8241
 
    AC_SUBST(CL_INCLUDES_PREFIX)
8242
 
    rm -f dummy-hello.c
8243
 
    _topsrcdirwin=`cd \`dirname $0\`; pwd -W`
8244
 
    dnl cl.py provides dependency generation for MSVC
8245
 
    CC_WRAPPER="$PYTHON -O $_topsrcdirwin/build/cl.py"
8246
 
    CXX_WRAPPER="$PYTHON -O $_topsrcdirwin/build/cl.py"
8247
 
    COMPILER_DEPEND=1
8248
 
  fi
8249
 
fi
8250
 
fi # MOZ_AUTO_DEPS
8251
 
MDDEPDIR='.deps'
8252
 
AC_SUBST(MOZ_AUTO_DEPS)
8253
 
AC_SUBST(COMPILER_DEPEND)
8254
 
AC_SUBST(MDDEPDIR)
8255
 
AC_SUBST(CC_WRAPPER)
8256
 
AC_SUBST(CXX_WRAPPER)
8257
 
 
8258
 
 
8259
 
dnl ========================================================
8260
 
dnl =
8261
 
dnl = Static Build Options
8262
 
dnl =
8263
 
dnl ========================================================
8264
 
MOZ_ARG_HEADER(Static build options)
8265
 
 
8266
 
MOZ_ARG_ENABLE_BOOL(static,
8267
 
[  --enable-static         Enable building internal static libs],
8268
 
    BUILD_STATIC_LIBS=1,
8269
 
    BUILD_STATIC_LIBS=)
8270
 
 
8271
 
MOZ_ENABLE_LIBXUL=1
8272
 
 
8273
 
MOZ_ARG_DISABLE_BOOL(libxul,
8274
 
[  --disable-libxul        Disable building libxul (not supported)],
8275
 
    MOZ_ENABLE_LIBXUL=,
8276
 
    MOZ_ENABLE_LIBXUL=1)
8277
 
 
8278
 
if test -z "$MOZ_ENABLE_LIBXUL"; then
8279
 
  AC_MSG_ERROR([--disable-libxul is no longer supported.])
8280
 
fi
8281
 
 
8282
 
# split JS out by default to avoid VS2005 PGO crash (bug 591836).
8283
 
if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
8284
 
  ENABLE_SHARED_JS=1
8285
 
fi
8286
 
 
8287
 
MOZ_ARG_ENABLE_BOOL(shared-js,
8288
 
[  --enable-shared-js
8289
 
                          Create a shared JavaScript library.],
8290
 
    ENABLE_SHARED_JS=1,
8291
 
    ENABLE_SHARED_JS=)
8292
 
 
8293
 
if test -n "$ENABLE_SHARED_JS"; then
8294
 
  JS_SHARED_LIBRARY=1
8295
 
  MOZ_JS_LIBS=$MOZ_JS_SHARED_LIBS
8296
 
else
8297
 
  MOZ_JS_LIBS=$MOZ_JS_STATIC_LIBS
8298
 
  AC_DEFINE(MOZ_STATIC_JS)
8299
 
fi
8300
 
AC_SUBST(JS_SHARED_LIBRARY)
8301
 
 
8302
 
if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
8303
 
  AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME.])
8304
 
fi
8305
 
 
8306
 
if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
8307
 
  AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
8308
 
fi
8309
 
 
8310
 
AC_SUBST(LIBXUL_LIBS)
8311
 
XPCOM_LIBS="$LIBXUL_LIBS"
8312
 
AC_DEFINE(MOZ_ENABLE_LIBXUL)
8313
 
 
8314
 
dnl ========================================================
8315
 
dnl =
8316
 
dnl = Standalone module options
8317
 
dnl = 
8318
 
dnl ========================================================
8319
 
MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
8320
 
 
8321
 
dnl Check for GLib and libIDL.
8322
 
dnl ========================================================
8323
 
SKIP_IDL_CHECK="no"
8324
 
 
8325
 
if test -z "$COMPILE_ENVIRONMENT"; then
8326
 
    SKIP_IDL_CHECK="yes"
8327
 
fi
8328
 
 
8329
 
dnl = Allow users to disable libIDL checking for standalone modules
8330
 
MOZ_ARG_WITHOUT_BOOL(libIDL,
8331
 
[  --without-libIDL        Skip check for libIDL (standalone modules only)],
8332
 
        SKIP_IDL_CHECK="yes")
8333
 
 
8334
 
if test -z "$CROSS_COMPILE"; then
8335
 
    if test -z "$HOST_LIBIDL_CONFIG"; then
8336
 
        HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
8337
 
    fi
8338
 
    if test -z "$HOST_LIBIDL_PREFIX"; then
8339
 
        HOST_LIBIDL_PREFIX="$LIBIDL_PREFIX"
8340
 
    fi
8341
 
fi
8342
 
 
8343
 
if test "$SKIP_IDL_CHECK" = "no"
8344
 
then
8345
 
    _LIBIDL_FOUND=
8346
 
    case "$host" in
8347
 
    *-mingw*)
8348
 
        if test -n "$GLIB_PREFIX"; then
8349
 
            _GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
8350
 
            if test "$?" = "0"; then
8351
 
                if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
8352
 
                    AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
8353
 
                fi
8354
 
            else
8355
 
                 AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
8356
 
            fi
8357
 
        else
8358
 
            _GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
8359
 
        fi
8360
 
        if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
8361
 
            AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
8362
 
        fi
8363
 
        GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
8364
 
        if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
8365
 
            GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
8366
 
        elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
8367
 
            GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
8368
 
        else
8369
 
            AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
8370
 
        fi
8371
 
 
8372
 
        if test -n "$HOST_LIBIDL_PREFIX"; then
8373
 
            _LIBIDL_PREFIX_DIR=`cd $HOST_LIBIDL_PREFIX && pwd -W`
8374
 
            if test "$?" = "0"; then
8375
 
                if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
8376
 
                    AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
8377
 
                fi
8378
 
            else
8379
 
                AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
8380
 
            fi
8381
 
        else
8382
 
            _LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
8383
 
        fi        
8384
 
        if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
8385
 
            AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
8386
 
        fi
8387
 
        HOST_LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
8388
 
        if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
8389
 
            HOST_LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
8390
 
            STATIC_LIBIDL=1
8391
 
        elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
8392
 
            HOST_LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
8393
 
        else
8394
 
            AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
8395
 
        fi
8396
 
        HOST_LIBIDL_LIBS="${HOST_LIBIDL_LIBS} ${GLIB_LIBS}"
8397
 
        _LIBIDL_FOUND=1
8398
 
        ;;
8399
 
    esac
8400
 
 
8401
 
    if test -z "$_LIBIDL_FOUND"; then
8402
 
        if test "$MACOS_SDK_DIR"; then 
8403
 
            dnl xpidl, and therefore libIDL, is only needed on the build host.
8404
 
            dnl Don't build it against the SDK, as that causes problems.
8405
 
            _MACSAVE_CFLAGS="$CFLAGS"
8406
 
            _MACSAVE_LIBS="$LIBS"
8407
 
            _MACSAVE_LDFLAGS="$LDFLAGS"
8408
 
            _MACSAVE_NEXT_ROOT="$NEXT_ROOT"
8409
 
          changequote(,)
8410
 
          CFLAGS=`echo $CFLAGS|sed -E -e "s%((-I|-isystem )${MACOS_SDK_DIR}/usr/(include|lib/gcc)[^ ]*)|-F${MACOS_SDK_DIR}(/System)?/Library/Frameworks[^ ]*|-nostdinc[^ ]*|-isysroot ${MACOS_SDK_DIR}%%g"`
8411
 
          LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
8412
 
          LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
8413
 
          changequote([,])
8414
 
          unset NEXT_ROOT
8415
 
        fi
8416
 
 
8417
 
        PKG_CHECK_MODULES(HOST_LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
8418
 
    fi
8419
 
 
8420
 
    dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
8421
 
    dnl to either libIDL1 or libIDL2.
8422
 
    if test -z "$_LIBIDL_FOUND"; then
8423
 
        AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
8424
 
        if test -z "$_LIBIDL_FOUND"; then
8425
 
            PKG_CHECK_MODULES(HOST_LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
8426
 
        fi
8427
 
    fi
8428
 
    dnl
8429
 
    dnl If we don't have a libIDL config program & not cross-compiling, 
8430
 
    dnl     look for orbit-config instead.
8431
 
    dnl
8432
 
    if test -z "$_LIBIDL_FOUND" -a -z "$CROSS_COMPILE"; then
8433
 
        MOZ_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
8434
 
        if test -n "$ORBIT_CONFIG"; then
8435
 
            AC_MSG_CHECKING([for ORBit libIDL usability])
8436
 
                _ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
8437
 
            _ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
8438
 
            _ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
8439
 
            _ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
8440
 
            HOST_LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
8441
 
            HOST_LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
8442
 
            HOST_LIBIDL_CONFIG=
8443
 
            _SAVE_CFLAGS="$CFLAGS"
8444
 
            _SAVE_LIBS="$LIBS"
8445
 
            CFLAGS="$HOST_LIBIDL_CFLAGS $CFLAGS"
8446
 
            LIBS="$HOST_LIBIDL_LIBS $LIBS"
8447
 
            AC_TRY_RUN([
8448
 
#include <stdlib.h>
8449
 
#include <libIDL/IDL.h>
8450
 
int main() {
8451
 
  char *s;
8452
 
  s=strdup(IDL_get_libver_string());
8453
 
  if(s==NULL) {
8454
 
    exit(1);
8455
 
  }
8456
 
  exit(0);
8457
 
}
8458
 
            ], [_LIBIDL_FOUND=1
8459
 
                result="yes"],
8460
 
               [HOST_LIBIDL_CFLAGS=
8461
 
                HOST_LIBIDL_LIBS=
8462
 
                result="no"],
8463
 
               [_LIBIDL_FOUND=1
8464
 
                result="maybe"] )
8465
 
            AC_MSG_RESULT($result)
8466
 
            CFLAGS="$_SAVE_CFLAGS"
8467
 
            LIBS="$_SAVE_LIBS"
8468
 
        fi
8469
 
    fi
8470
 
    if test -z "$_LIBIDL_FOUND"; then
8471
 
        AC_MSG_ERROR([libIDL not found.
8472
 
        libIDL $LIBIDL_VERSION or higher is required.])
8473
 
    fi
8474
 
    if test "$MACOS_SDK_DIR"; then
8475
 
      CFLAGS="$_MACSAVE_CFLAGS"
8476
 
      LIBS="$_MACSAVE_LIBS"
8477
 
      LDFLAGS="$_MACSAVE_LDFLAGS"
8478
 
      if test -n "$_MACSAVE_NEXT_ROOT" ; then
8479
 
        export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
8480
 
      fi
8481
 
    fi
8482
 
fi
8483
 
 
8484
 
if test -n "$CROSS_COMPILE"; then
8485
 
    case "$target" in
8486
 
    *-mingw*)
8487
 
        if test -n "$GLIB_PREFIX"; then
8488
 
            GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
8489
 
            if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
8490
 
                GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
8491
 
            elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
8492
 
                GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
8493
 
            else
8494
 
                AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
8495
 
            fi
8496
 
        fi
8497
 
 
8498
 
        if test -n "$LIBIDL_PREFIX"; then
8499
 
            LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
8500
 
            if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
8501
 
                LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
8502
 
                STATIC_LIBIDL=1
8503
 
            elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
8504
 
                LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
8505
 
            else
8506
 
                AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
8507
 
            fi
8508
 
        fi
8509
 
        LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
8510
 
        ;;
8511
 
    *)
8512
 
        if test -n "LIBIDL_CONFIG" -a "LIBIDL_CONFIG" != "no"; then
8513
 
            LIBIDL_CFLAGS=`${LIBIDL_CONFIG} --cflags`
8514
 
            LIBIDL_LIBS=`${LIBIDL_CONFIG} --libs`
8515
 
        fi
8516
 
        ;;
8517
 
    esac
8518
 
else
8519
 
    LIBIDL_CFLAGS="$HOST_LIBIDL_CFLAGS"
8520
 
    LIBIDL_LIBS="$HOST_LIBIDL_LIBS"
8521
 
fi
8522
 
 
8523
 
if test -z "$SKIP_PATH_CHECKS"; then
8524
 
if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
8525
 
    if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then
8526
 
        PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
8527
 
    else
8528
 
        AM_PATH_GLIB(${GLIB_VERSION})
8529
 
    fi
8530
 
fi
8531
 
fi
8532
 
 
8533
 
if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
8534
 
    GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
8535
 
fi
8536
 
 
8537
 
AC_SUBST(LIBIDL_CFLAGS)
8538
 
AC_SUBST(LIBIDL_LIBS)
8539
 
AC_SUBST(STATIC_LIBIDL)
8540
 
AC_SUBST(GLIB_CFLAGS)
8541
 
AC_SUBST(GLIB_LIBS)
8542
 
AC_SUBST(GLIB_GMODULE_LIBS)
8543
 
AC_SUBST(HOST_LIBIDL_CONFIG)
8544
 
AC_SUBST(HOST_LIBIDL_CFLAGS)
8545
 
AC_SUBST(HOST_LIBIDL_LIBS)
8546
 
 
8547
 
dnl ========================================================
8548
 
dnl Check for cairo
8549
 
dnl ========================================================
8550
 
MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
8551
 
 
8552
 
MOZ_TREE_CAIRO=1
8553
 
MOZ_ARG_ENABLE_BOOL(system-cairo,
8554
 
[  --enable-system-cairo   Use system cairo (located with pkgconfig)],
8555
 
MOZ_TREE_CAIRO=,
8556
 
MOZ_TREE_CAIRO=1 )
8557
 
 
8558
 
MOZ_TREE_PIXMAN=1
8559
 
MOZ_ARG_ENABLE_BOOL(system-pixman,
8560
 
[ --enable-system-pixman Use system pixman (located with pkgconfig)],
8561
 
MOZ_TREE_PIXMAN=,
8562
 
MOZ_TREE_PIXMAN=1 )
8563
 
 
8564
 
# Check for headers defining standard int types.
8565
 
MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
8566
 
 
8567
 
if test "$MOZ_TREE_CAIRO"; then
8568
 
    AC_DEFINE(MOZ_TREE_CAIRO)
8569
 
 
8570
 
    # For now we assume that we will have a uint64_t available through
8571
 
    # one of the above headers or mozstdint.h.
8572
 
    AC_DEFINE(HAVE_UINT64_T)
8573
 
 
8574
 
    # Define macros for cairo-features.h
8575
 
    if test "$MOZ_X11"; then
8576
 
        XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
8577
 
        XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
8578
 
        PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
8579
 
        FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
8580
 
        MOZ_ENABLE_CAIRO_FT=1
8581
 
        CAIRO_FT_CFLAGS="$FT2_CFLAGS"
8582
 
    fi
8583
 
    if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
8584
 
        QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
8585
 
    fi
8586
 
    if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
8587
 
        QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
8588
 
        QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
8589
 
        QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
8590
 
    fi
8591
 
    if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
8592
 
        WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
8593
 
        if test -z "$WINCE"; then
8594
 
            WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
8595
 
            if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
8596
 
                WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
8597
 
                WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
8598
 
                MOZ_ENABLE_D2D_SURFACE=1
8599
 
                MOZ_ENABLE_DWRITE_FONT=1
8600
 
            else
8601
 
                WIN32_DWRITE_FONT_FEATURE=
8602
 
                WIN32_D2D_SURFACE_FEATURE=
8603
 
            fi
8604
 
        else
8605
 
            WIN32_FONT_FEATURE=
8606
 
            WIN32_DWRITE_FONT_FEATURE=
8607
 
            WIN32_D2D_SURFACE_FEATURE=
8608
 
        fi
8609
 
 
8610
 
        MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
8611
 
 
8612
 
        dnl D3D10 Layers depend on D2D Surfaces.
8613
 
        if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
8614
 
          MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
8615
 
        fi
8616
 
 
8617
 
    fi
8618
 
    if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
8619
 
        OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
8620
 
        FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
8621
 
        MOZ_ENABLE_CAIRO_FT=1
8622
 
        CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
8623
 
        CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
8624
 
    fi
8625
 
    if test "$USE_FC_FREETYPE"; then
8626
 
        FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
8627
 
    fi
8628
 
    AC_SUBST(MOZ_ENABLE_CAIRO_FT)
8629
 
    AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
8630
 
    AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
8631
 
    AC_SUBST(MOZ_ENABLE_D3D9_LAYER)
8632
 
    AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
8633
 
    AC_SUBST(CAIRO_FT_CFLAGS)
8634
 
    AC_SUBST(HAS_OGLES)
8635
 
 
8636
 
    if test "$MOZ_DEBUG"; then
8637
 
      SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
8638
 
    else
8639
 
      SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
8640
 
    fi
8641
 
 
8642
 
    PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
8643
 
 
8644
 
    AC_SUBST(PS_SURFACE_FEATURE)
8645
 
    AC_SUBST(PDF_SURFACE_FEATURE)
8646
 
    AC_SUBST(SVG_SURFACE_FEATURE)
8647
 
    AC_SUBST(XLIB_SURFACE_FEATURE)
8648
 
    AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
8649
 
    AC_SUBST(QUARTZ_SURFACE_FEATURE)
8650
 
    AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
8651
 
    AC_SUBST(XCB_SURFACE_FEATURE)
8652
 
    AC_SUBST(WIN32_SURFACE_FEATURE)
8653
 
    AC_SUBST(OS2_SURFACE_FEATURE)
8654
 
    AC_SUBST(DIRECTFB_SURFACE_FEATURE)
8655
 
    AC_SUBST(FT_FONT_FEATURE)
8656
 
    AC_SUBST(FC_FONT_FEATURE)
8657
 
    AC_SUBST(WIN32_FONT_FEATURE)
8658
 
    AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
8659
 
    AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
8660
 
    AC_SUBST(QUARTZ_FONT_FEATURE)
8661
 
    AC_SUBST(PNG_FUNCTIONS_FEATURE)
8662
 
    AC_SUBST(QT_SURFACE_FEATURE)
8663
 
 
8664
 
    MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
8665
 
 
8666
 
    if test "$MOZ_TREE_PIXMAN"; then
8667
 
        AC_DEFINE(MOZ_TREE_PIXMAN)
8668
 
        MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS"' $(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
8669
 
    else
8670
 
        PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2)
8671
 
        MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $PIXMAN_CFLAGS"
8672
 
        MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $PIXMAN_LIBS"
8673
 
    fi
8674
 
 
8675
 
    if test "$MOZ_X11"; then
8676
 
        MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
8677
 
    fi
8678
 
 
8679
 
    CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
8680
 
    mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
8681
 
 
8682
 
else
8683
 
   PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig)
8684
 
   MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
8685
 
   MOZ_CAIRO_LIBS=$CAIRO_LIBS
8686
 
   PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION)
8687
 
   if test "$MOZ_X11"; then
8688
 
        PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
8689
 
        MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
8690
 
        MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
8691
 
   fi
8692
 
fi
8693
 
 
8694
 
AC_SUBST(MOZ_TREE_CAIRO)
8695
 
AC_SUBST(MOZ_CAIRO_CFLAGS)
8696
 
AC_SUBST(MOZ_CAIRO_LIBS)
8697
 
AC_SUBST(MOZ_TREE_PIXMAN)
8698
 
 
8699
 
dnl ========================================================
8700
 
dnl Dbus-Menu
8701
 
dnl ========================================================
8702
 
 
8703
 
UNITY_GLOBALMENU=0
8704
 
if test `echo "$MOZ_EXTENSIONS" | grep -c globalmenu` -ne 0; then
8705
 
   PKG_CHECK_MODULES(DBUSMENU, dbusmenu-gtk-0.4 gio-2.0)
8706
 
   UNITY_GLOBALMENU=1
8707
 
   AC_SUBST(DBUSMENU_CFLAGS)
8708
 
   AC_SUBST(DBUSMENU_LIBS)
8709
 
   AC_DEFINE(UNITY_GLOBALMENU)
8710
 
fi
8711
 
AC_SUBST(UNITY_GLOBALMENU)
8712
 
 
8713
 
dnl ========================================================
8714
 
dnl qcms
8715
 
dnl ========================================================
8716
 
 
8717
 
QCMS_LIBS='$(call EXPAND_LIBNAME_PATH,mozqcms,$(DEPTH)/gfx/qcms)'
8718
 
AC_SUBST(QCMS_LIBS)
8719
 
 
8720
 
dnl ========================================================
8721
 
dnl HarfBuzz
8722
 
dnl ========================================================
8723
 
MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
8724
 
AC_SUBST(MOZ_HARFBUZZ_LIBS)
8725
 
 
8726
 
dnl ========================================================
8727
 
dnl OTS
8728
 
dnl ========================================================
8729
 
MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
8730
 
AC_SUBST(MOZ_OTS_LIBS)
8731
 
 
8732
 
dnl ========================================================
8733
 
dnl disable xul
8734
 
dnl ========================================================
8735
 
MOZ_ARG_DISABLE_BOOL(xul,
8736
 
[  --disable-xul           Disable XUL],
8737
 
    MOZ_XUL= )
8738
 
if test "$MOZ_XUL"; then
8739
 
  AC_DEFINE(MOZ_XUL)
8740
 
else
8741
 
  dnl remove extensions that require XUL
8742
 
  MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
8743
 
fi
8744
 
 
8745
 
AC_SUBST(MOZ_XUL)
8746
 
 
8747
 
dnl ========================================================
8748
 
dnl disable profile locking
8749
 
dnl   do no use this in applications that can have more than
8750
 
dnl   one process accessing the profile directory.
8751
 
dnl ========================================================
8752
 
MOZ_ARG_DISABLE_BOOL(profilelocking,
8753
 
[  --disable-profilelocking
8754
 
                          Disable profile locking],
8755
 
    MOZ_PROFILELOCKING=,
8756
 
    MOZ_PROFILELOCKING=1 )
8757
 
if test "$MOZ_PROFILELOCKING"; then
8758
 
  AC_DEFINE(MOZ_PROFILELOCKING)
8759
 
fi
8760
 
 
8761
 
dnl ========================================================
8762
 
dnl disable rdf services
8763
 
dnl ========================================================
8764
 
MOZ_ARG_DISABLE_BOOL(rdf,
8765
 
[  --disable-rdf           Disable RDF],
8766
 
    MOZ_RDF= )
8767
 
if test "$MOZ_RDF"; then
8768
 
  AC_DEFINE(MOZ_RDF)
8769
 
fi
8770
 
 
8771
 
AC_SUBST(MOZ_RDF)
8772
 
 
8773
 
dnl ========================================================
8774
 
dnl necko configuration options
8775
 
dnl ========================================================
8776
 
 
8777
 
dnl
8778
 
dnl option to disable various necko protocols
8779
 
dnl
8780
 
MOZ_ARG_ENABLE_STRING(necko-protocols,
8781
 
[  --enable-necko-protocols[={http,ftp,default,all,none}]
8782
 
                          Enable/disable specific protocol handlers],
8783
 
[ for option in `echo $enableval | sed 's/,/ /g'`; do
8784
 
    if test "$option" = "yes" -o "$option" = "all"; then
8785
 
        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8786
 
    elif test "$option" = "no" -o "$option" = "none"; then
8787
 
        NECKO_PROTOCOLS=""
8788
 
    elif test "$option" = "default"; then
8789
 
        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8790
 
    elif test `echo "$option" | grep -c \^-` != 0; then
8791
 
        option=`echo $option | sed 's/^-//'`
8792
 
        NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
8793
 
    else
8794
 
        NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
8795
 
    fi
8796
 
done],
8797
 
    NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
8798
 
dnl Remove dupes
8799
 
NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
8800
 
AC_SUBST(NECKO_PROTOCOLS)
8801
 
for p in $NECKO_PROTOCOLS; do
8802
 
    AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
8803
 
done
8804
 
 
8805
 
dnl
8806
 
dnl option to disable necko's disk cache
8807
 
dnl
8808
 
MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
8809
 
[  --disable-necko-disk-cache
8810
 
                          Disable necko disk cache],
8811
 
    NECKO_DISK_CACHE=,
8812
 
    NECKO_DISK_CACHE=1)
8813
 
AC_SUBST(NECKO_DISK_CACHE)
8814
 
if test "$NECKO_DISK_CACHE"; then
8815
 
    AC_DEFINE(NECKO_DISK_CACHE)
8816
 
fi
8817
 
 
8818
 
dnl
8819
 
dnl option to disable necko's wifi scanner
8820
 
dnl
8821
 
MOZ_ARG_DISABLE_BOOL(necko-wifi,
8822
 
[  --disable-necko-wifi    Disable necko wifi scanner],
8823
 
    NECKO_WIFI=,
8824
 
    NECKO_WIFI=1)
8825
 
 
8826
 
if test "$OS_ARCH" = "OS2"; then
8827
 
  dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
8828
 
  NECKO_WIFI=
8829
 
fi
8830
 
if test "$NECKO_WIFI" -a \
8831
 
        "$OS_ARCH" != "Linux" -a \
8832
 
        "$OS_ARCH" != "Darwin" -a \
8833
 
        "$OS_ARCH" != "SunOS" -a \
8834
 
        "$OS_ARCH" != "WINNT" -a \
8835
 
        "$OS_ARCH" != "WINCE"; then
8836
 
  AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
8837
 
fi
8838
 
 
8839
 
if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
8840
 
then
8841
 
  MOZ_CHECK_HEADER([iwlib.h])
8842
 
  if test "$ac_cv_header_iwlib_h" != "yes"; then
8843
 
    AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora) or libiw-devel (openSUSE)); use --disable-necko-wifi to disable])
8844
 
  fi
8845
 
fi
8846
 
 
8847
 
if test "$NECKO_WIFI"; then
8848
 
  AC_DEFINE(NECKO_WIFI)
8849
 
fi
8850
 
AC_SUBST(NECKO_WIFI)
8851
 
 
8852
 
dnl
8853
 
dnl option to disable cookies
8854
 
dnl
8855
 
MOZ_ARG_DISABLE_BOOL(cookies,
8856
 
[  --disable-cookies       Disable cookie support],
8857
 
    NECKO_COOKIES=,
8858
 
    NECKO_COOKIES=1)
8859
 
AC_SUBST(NECKO_COOKIES)
8860
 
if test "$NECKO_COOKIES"; then
8861
 
    AC_DEFINE(NECKO_COOKIES)
8862
 
fi
8863
 
 
8864
 
dnl
8865
 
dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
8866
 
dnl
8867
 
MOZ_ARG_DISABLE_BOOL(ctypes,
8868
 
[  --disable-ctypes        Disable js-ctypes],
8869
 
    BUILD_CTYPES=,
8870
 
    BUILD_CTYPES=1)
8871
 
AC_SUBST(BUILD_CTYPES)
8872
 
if test "$BUILD_CTYPES"; then
8873
 
  if test "$OS_ARCH" = "WINCE" -a `echo $OS_TEST | grep -ic arm` = 1; then
8874
 
    # Disable ctypes for arm/wince.
8875
 
    BUILD_CTYPES=
8876
 
  else
8877
 
    AC_DEFINE(BUILD_CTYPES)
8878
 
  fi
8879
 
fi
8880
 
 
8881
 
dnl NECKO_ configuration options are not global
8882
 
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
8883
 
 
8884
 
dnl Only build Mork if it's required
8885
 
AC_SUBST(MOZ_MORK)
8886
 
if test "$MOZ_MORK"; then
8887
 
  AC_DEFINE(MOZ_MORK)
8888
 
fi
8889
 
 
8890
 
dnl Build the lightweight Mork reader if required
8891
 
AC_SUBST(MOZ_MORKREADER)
8892
 
if test "$MOZ_MORKREADER"; then
8893
 
  AC_DEFINE(MOZ_MORKREADER)
8894
 
fi
8895
 
 
8896
 
dnl Build Places if required
8897
 
if test "$MOZ_PLACES"; then
8898
 
  AC_DEFINE(MOZ_PLACES)
8899
 
fi
8900
 
 
8901
 
dnl Build Sync Services if required
8902
 
AC_SUBST(MOZ_SERVICES_SYNC)
8903
 
if test -n "$MOZ_SERVICES_SYNC"; then
8904
 
  AC_DEFINE(MOZ_SERVICES_SYNC)
8905
 
fi
8906
 
 
8907
 
dnl ========================================================
8908
 
if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
8909
 
    MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
8910
 
fi
8911
 
 
8912
 
if test "$MOZ_APP_COMPONENT_INCLUDE"; then
8913
 
  AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE")
8914
 
fi
8915
 
 
8916
 
if test "$MOZ_APP_COMPONENT_MODULES"; then
8917
 
  AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_MODULES, $MOZ_APP_COMPONENT_MODULES)
8918
 
fi
8919
 
 
8920
 
dnl ========================================================
8921
 
dnl =
8922
 
dnl = Maintainer debug option (no --enable equivalent)
8923
 
dnl =
8924
 
dnl ========================================================
8925
 
 
8926
 
AC_SUBST(AR)
8927
 
AC_SUBST(AR_FLAGS)
8928
 
AC_SUBST(AR_LIST)
8929
 
AC_SUBST(AR_EXTRACT)
8930
 
AC_SUBST(AR_DELETE)
8931
 
AC_SUBST(AS)
8932
 
AC_SUBST(ASFLAGS)
8933
 
AC_SUBST(AS_DASH_C_FLAG)
8934
 
AC_SUBST(LD)
8935
 
AC_SUBST(RC)
8936
 
AC_SUBST(RCFLAGS)
8937
 
AC_SUBST(WINDRES)
8938
 
AC_SUBST(IMPLIB)
8939
 
AC_SUBST(FILTER)
8940
 
AC_SUBST(BIN_FLAGS)
8941
 
AC_SUBST(NS_USE_NATIVE)
8942
 
AC_SUBST(MOZ_WIDGET_TOOLKIT)
8943
 
AC_SUBST(MOZ_UPDATE_XTERM)
8944
 
AC_SUBST(MINIMO)
8945
 
AC_SUBST(MOZ_PLATFORM_MAEMO)
8946
 
AC_SUBST(MOZ_AUTH_EXTENSION)
8947
 
AC_SUBST(MOZ_MATHML)
8948
 
AC_SUBST(MOZ_CSS_ANIMATIONS)
8949
 
AC_SUBST(MOZ_PERMISSIONS)
8950
 
AC_SUBST(MOZ_XTF)
8951
 
AC_SUBST(MOZ_PREF_EXTENSIONS)
8952
 
AC_SUBST(MOZ_SVG)
8953
 
AC_SUBST(MOZ_SMIL)
8954
 
AC_SUBST(MOZ_XSLT_STANDALONE)
8955
 
AC_SUBST(MOZ_JS_LIBS)
8956
 
AC_SUBST(MOZ_PSM)
8957
 
AC_SUBST(MOZ_DEBUG)
8958
 
AC_SUBST(MOZ_DEBUG_SYMBOLS)
8959
 
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8960
 
AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8961
 
AC_SUBST(MOZ_DEBUG_FLAGS)
8962
 
AC_SUBST(MOZ_DEBUG_LDFLAGS)
8963
 
AC_SUBST(WARNINGS_AS_ERRORS)
8964
 
AC_SUBST(MOZ_EXTENSIONS)
8965
 
AC_SUBST(MOZ_JSDEBUGGER)
8966
 
AC_SUBST(MOZ_LOG_REFCNT)
8967
 
AC_SUBST(MOZ_LEAKY)
8968
 
AC_SUBST(MOZ_JPROF)
8969
 
AC_SUBST(MOZ_SHARK)
8970
 
AC_SUBST(MOZ_CALLGRIND)
8971
 
AC_SUBST(MOZ_VTUNE)
8972
 
AC_SUBST(MOZ_PROFILING)
8973
 
AC_SUBST(MOZ_QUANTIFY)
8974
 
AC_SUBST(LIBICONV)
8975
 
AC_SUBST(MOZ_PLACES)
8976
 
AC_SUBST(MOZ_STORAGE)
8977
 
AC_SUBST(MOZ_TOOLKIT_SEARCH)
8978
 
AC_SUBST(MOZ_FEEDS)
8979
 
AC_SUBST(NS_PRINTING)
8980
 
AC_SUBST(MOZ_WEBGL)
8981
 
AC_SUBST(MOZ_HELP_VIEWER)
8982
 
 
8983
 
AC_SUBST(JAVA)
8984
 
AC_SUBST(JAVAC)
8985
 
AC_SUBST(JAR)
8986
 
 
8987
 
AC_SUBST(MOZ_PROFILELOCKING)
8988
 
 
8989
 
AC_SUBST(HAVE_XIE)
8990
 
AC_SUBST(MOZ_XIE_LIBS)
8991
 
 
8992
 
AC_SUBST(BUILD_STATIC_LIBS)
8993
 
AC_SUBST(MOZ_ENABLE_LIBXUL)
8994
 
AC_SUBST(ENABLE_TESTS)
8995
 
AC_SUBST(IBMBIDI)
8996
 
AC_SUBST(MOZ_UNIVERSALCHARDET)
8997
 
AC_SUBST(ACCESSIBILITY)
8998
 
AC_SUBST(MOZ_SPELLCHECK)
8999
 
AC_SUBST(MOZ_USER_DIR)
9000
 
AC_SUBST(MOZ_CRASHREPORTER)
9001
 
AC_SUBST(MOZ_UPDATER)
9002
 
AC_SUBST(MOZ_ANGLE)
9003
 
AC_SUBST(MOZ_DIRECTX_SDK_PATH)
9004
 
AC_SUBST(MOZ_DIRECTX_SDK_CPU_SUFFIX)
9005
 
AC_SUBST(MOZ_D3DX9_VERSION)
9006
 
AC_SUBST(MOZ_D3DX9_CAB)
9007
 
AC_SUBST(MOZ_D3DCOMPILER_CAB)
9008
 
AC_SUBST(MOZ_D3DX9_DLL)
9009
 
AC_SUBST(MOZ_D3DCOMPILER_DLL)
9010
 
 
9011
 
AC_SUBST(ENABLE_STRIP)
9012
 
AC_SUBST(PKG_SKIP_STRIP)
9013
 
AC_SUBST(USE_ELF_DYNSTR_GC)
9014
 
AC_SUBST(USE_ELF_HACK)
9015
 
AC_SUBST(INCREMENTAL_LINKER)
9016
 
AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
9017
 
AC_SUBST(MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS)
9018
 
AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
9019
 
 
9020
 
AC_SUBST(MOZ_FIX_LINK_PATHS)
9021
 
AC_SUBST(XPCOM_LIBS)
9022
 
AC_SUBST(XPCOM_FROZEN_LDOPTS)
9023
 
AC_SUBST(XPCOM_GLUE_LDOPTS)
9024
 
AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
9025
 
 
9026
 
AC_SUBST(USE_DEPENDENT_LIBS)
9027
 
 
9028
 
AC_SUBST(MOZ_BUILD_ROOT)
9029
 
AC_SUBST(MOZ_OS2_TOOLS)
9030
 
 
9031
 
AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
9032
 
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
9033
 
AC_SUBST(MOZ_TIMELINE)
9034
 
AC_SUBST(OGLES_SDK_DIR)
9035
 
 
9036
 
AC_SUBST(MOZ_APP_NAME)
9037
 
AC_SUBST(MOZ_APP_DISPLAYNAME)
9038
 
AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
9039
 
AC_SUBST(MOZ_APP_UA_NAME)
9040
 
AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
9041
 
AC_SUBST(MOZ_APP_VERSION)
9042
 
AC_DEFINE_UNQUOTED(MOZ_UA_BUILDID, "$MOZ_UA_BUILDID")
9043
 
AC_SUBST(MOZ_UA_BUILDID)
9044
 
 
9045
 
AC_SUBST(MOZ_PKG_SPECIAL)
9046
 
 
9047
 
AC_SUBST(MOZILLA_OFFICIAL)
9048
 
 
9049
 
dnl win32 options
9050
 
AC_SUBST(MOZ_MAPINFO)
9051
 
AC_SUBST(MOZ_BROWSE_INFO)
9052
 
AC_SUBST(MOZ_TOOLS_DIR)
9053
 
AC_SUBST(WIN32_REDIST_DIR)
9054
 
AC_SUBST(PYTHON)
9055
 
AC_SUBST(MAKENSISU)
9056
 
 
9057
 
AC_SUBST(WINCE)
9058
 
AC_SUBST(WINCE_SDK_DIR)
9059
 
AC_SUBST(WINCE_WINDOWS_MOBILE)
9060
 
 
9061
 
dnl Echo the CFLAGS to remove extra whitespace.
9062
 
CFLAGS=`echo \
9063
 
        $_WARNINGS_CFLAGS \
9064
 
        $CFLAGS`
9065
 
 
9066
 
CXXFLAGS=`echo \
9067
 
        $_MOZ_RTTI_FLAGS \
9068
 
        $_MOZ_EXCEPTIONS_FLAGS \
9069
 
        $_WARNINGS_CXXFLAGS \
9070
 
        $CXXFLAGS`
9071
 
 
9072
 
COMPILE_CFLAGS=`echo \
9073
 
    $_DEFINES_CFLAGS \
9074
 
        $_DEPEND_CFLAGS \
9075
 
    $COMPILE_CFLAGS`
9076
 
 
9077
 
COMPILE_CXXFLAGS=`echo \
9078
 
    $_DEFINES_CXXFLAGS \
9079
 
        $_DEPEND_CFLAGS \
9080
 
    $COMPILE_CXXFLAGS`
9081
 
 
9082
 
AC_SUBST(SYSTEM_MAKEDEPEND)
9083
 
AC_SUBST(SYSTEM_LIBXUL)
9084
 
AC_SUBST(SYSTEM_JPEG)
9085
 
AC_SUBST(SYSTEM_PNG)
9086
 
AC_SUBST(SYSTEM_ZLIB)
9087
 
AC_SUBST(SYSTEM_BZ2)
9088
 
 
9089
 
AC_SUBST(JPEG_CFLAGS)
9090
 
AC_SUBST(JPEG_LIBS)
9091
 
AC_SUBST(ZLIB_CFLAGS)
9092
 
AC_SUBST(ZLIB_LIBS)
9093
 
AC_SUBST(BZ2_CFLAGS)
9094
 
AC_SUBST(BZ2_LIBS)
9095
 
AC_SUBST(PNG_CFLAGS)
9096
 
AC_SUBST(PNG_LIBS)
9097
 
 
9098
 
AC_SUBST(MOZ_JPEG_CFLAGS)
9099
 
AC_SUBST(MOZ_JPEG_LIBS)
9100
 
AC_SUBST(MOZ_ZLIB_CFLAGS)
9101
 
AC_SUBST(MOZ_ZLIB_LIBS)
9102
 
AC_SUBST(MOZ_BZ2_CFLAGS)
9103
 
AC_SUBST(MOZ_BZ2_LIBS)
9104
 
AC_SUBST(MOZ_PNG_CFLAGS)
9105
 
AC_SUBST(MOZ_PNG_LIBS)
9106
 
 
9107
 
AC_SUBST(NSPR_CFLAGS)
9108
 
AC_SUBST(NSPR_LIBS)
9109
 
AC_SUBST(MOZ_NATIVE_NSPR)
9110
 
 
9111
 
AC_SUBST(NSS_CFLAGS)
9112
 
AC_SUBST(NSS_LIBS)
9113
 
AC_SUBST(NSS_DEP_LIBS)
9114
 
AC_SUBST(MOZ_NATIVE_NSS)
9115
 
AC_SUBST(NSS_DISABLE_DBM)
9116
 
 
9117
 
AC_SUBST(CFLAGS)
9118
 
AC_SUBST(CXXFLAGS)
9119
 
AC_SUBST(CPPFLAGS)
9120
 
AC_SUBST(COMPILE_CFLAGS)
9121
 
AC_SUBST(COMPILE_CXXFLAGS)
9122
 
AC_SUBST(LDFLAGS)
9123
 
AC_SUBST(LIBS)
9124
 
AC_SUBST(CROSS_COMPILE)
9125
 
AC_SUBST(WCHAR_CFLAGS)
9126
 
 
9127
 
AC_SUBST(HOST_CC)
9128
 
AC_SUBST(HOST_CXX)
9129
 
AC_SUBST(HOST_CFLAGS)
9130
 
AC_SUBST(HOST_CXXFLAGS)
9131
 
AC_SUBST(HOST_LDFLAGS)
9132
 
AC_SUBST(HOST_OPTIMIZE_FLAGS)
9133
 
AC_SUBST(HOST_AR)
9134
 
AC_SUBST(HOST_AR_FLAGS)
9135
 
AC_SUBST(HOST_LD)
9136
 
AC_SUBST(HOST_RANLIB)
9137
 
AC_SUBST(HOST_NSPR_MDCPUCFG)
9138
 
AC_SUBST(HOST_BIN_SUFFIX)
9139
 
AC_SUBST(HOST_OS_ARCH)
9140
 
 
9141
 
AC_SUBST(TARGET_CPU)
9142
 
AC_SUBST(TARGET_VENDOR)
9143
 
AC_SUBST(TARGET_OS)
9144
 
AC_SUBST(TARGET_NSPR_MDCPUCFG)
9145
 
AC_SUBST(TARGET_MD_ARCH)
9146
 
AC_SUBST(TARGET_XPCOM_ABI)
9147
 
AC_SUBST(OS_TARGET)
9148
 
AC_SUBST(OS_ARCH)
9149
 
AC_SUBST(OS_RELEASE)
9150
 
AC_SUBST(OS_TEST)
9151
 
AC_SUBST(CPU_ARCH)
9152
 
AC_SUBST(INTEL_ARCHITECTURE)
9153
 
 
9154
 
AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
9155
 
AC_SUBST(MOZ_CHROME_FILE_FORMAT)
9156
 
 
9157
 
AC_SUBST(WRAP_MALLOC_CFLAGS)
9158
 
AC_SUBST(WRAP_MALLOC_LIB)
9159
 
AC_SUBST(MKSHLIB)
9160
 
AC_SUBST(MKCSHLIB)
9161
 
AC_SUBST(MKSHLIB_FORCE_ALL)
9162
 
AC_SUBST(MKSHLIB_UNFORCE_ALL)
9163
 
AC_SUBST(DSO_CFLAGS)
9164
 
AC_SUBST(DSO_PIC_CFLAGS)
9165
 
AC_SUBST(DSO_LDOPTS)
9166
 
AC_SUBST(LIB_PREFIX)
9167
 
AC_SUBST(DLL_PREFIX)
9168
 
AC_SUBST(DLL_SUFFIX)
9169
 
AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
9170
 
AC_SUBST(LIB_SUFFIX)
9171
 
AC_SUBST(OBJ_SUFFIX)
9172
 
AC_SUBST(BIN_SUFFIX)
9173
 
AC_SUBST(ASM_SUFFIX)
9174
 
AC_SUBST(IMPORT_LIB_SUFFIX)
9175
 
AC_SUBST(USE_N32)
9176
 
AC_SUBST(CC_VERSION)
9177
 
AC_SUBST(CXX_VERSION)
9178
 
AC_SUBST(MSMANIFEST_TOOL)
9179
 
AC_SUBST(NS_ENABLE_TSF)
9180
 
AC_SUBST(MOZ_NSS_PATCH)
9181
 
AC_SUBST(MOZ_APP_COMPONENT_LIBS)
9182
 
AC_SUBST(MOZ_APP_EXTRA_LIBS)
9183
 
 
9184
 
AC_SUBST(MOZ_MEDIA)
9185
 
AC_SUBST(MOZ_SYDNEYAUDIO)
9186
 
AC_SUBST(MOZ_WAVE)
9187
 
AC_SUBST(MOZ_VORBIS)
9188
 
AC_SUBST(MOZ_TREMOR)
9189
 
AC_SUBST(MOZ_WEBM)
9190
 
AC_SUBST(MOZ_OGG)
9191
 
AC_SUBST(MOZ_ALSA_LIBS)
9192
 
AC_SUBST(VPX_AS)
9193
 
AC_SUBST(VPX_ASFLAGS)
9194
 
AC_SUBST(VPX_DASH_C_FLAG)
9195
 
AC_SUBST(VPX_AS_CONVERSION)
9196
 
AC_SUBST(VPX_ASM_SUFFIX)
9197
 
AC_SUBST(VPX_X86_ASM)
9198
 
AC_SUBST(VPX_ARM_ASM)
9199
 
AC_SUBST(LIBJPEG_TURBO_AS)
9200
 
AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
9201
 
AC_SUBST(LIBJPEG_TURBO_X86_ASM)
9202
 
AC_SUBST(LIBJPEG_TURBO_X64_ASM)
9203
 
 
9204
 
if test "$USING_HCC"; then
9205
 
   CC='${topsrcdir}/build/hcc'
9206
 
   CC="$CC '$_OLDCC'"
9207
 
   CXX='${topsrcdir}/build/hcpp'
9208
 
   CXX="$CXX '$_OLDCXX'"
9209
 
   AC_SUBST(CC)
9210
 
   AC_SUBST(CXX)
9211
 
fi
9212
 
 
9213
 
AC_MSG_CHECKING([for posix_fallocate])       
9214
 
AC_TRY_LINK([#define _XOPEN_SOURCE 600
9215
 
  #include <fcntl.h>],
9216
 
                 [posix_fallocate(0, 0, 0);],
9217
 
                 [ac_cv___posix_fallocate=true],
9218
 
                 [ac_cv___posix_fallocate=false])
9219
 
 
9220
 
if test "$ac_cv___posix_fallocate" = true ; then
9221
 
  AC_DEFINE(HAVE_POSIX_FALLOCATE)
9222
 
  AC_MSG_RESULT(yes)
9223
 
else
9224
 
  AC_MSG_RESULT(no)
9225
 
fi
9226
 
 
9227
 
dnl Check for missing components
9228
 
if test "$COMPILE_ENVIRONMENT"; then
9229
 
if test "$MOZ_X11"; then
9230
 
    dnl ====================================================
9231
 
    dnl = Check if X headers exist
9232
 
    dnl ====================================================
9233
 
    _SAVE_CFLAGS=$CFLAGS
9234
 
    CFLAGS="$CFLAGS $XCFLAGS"
9235
 
    AC_TRY_COMPILE([
9236
 
        #include <stdio.h>
9237
 
        #include <stdlib.h>
9238
 
        #include <X11/Xlib.h>
9239
 
        #include <X11/Intrinsic.h>
9240
 
    ],
9241
 
    [
9242
 
        Display *dpy = 0;
9243
 
        if ((dpy = XOpenDisplay(NULL)) == NULL) {
9244
 
            fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
9245
 
            exit(1);
9246
 
        }
9247
 
    ], [], 
9248
 
    [ AC_MSG_ERROR([Could not compile basic X program.]) ])
9249
 
    CFLAGS="$_SAVE_CFLAGS"
9250
 
 
9251
 
    if test ! -z "$MISSING_X"; then
9252
 
        AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
9253
 
    fi
9254
 
 
9255
 
fi # MOZ_X11
9256
 
 
9257
 
dnl Check for headers, etc. needed by WebGL.
9258
 
if test -n "$MOZ_WEBGL_GLX"; then
9259
 
    MOZ_CHECK_HEADER(GL/glx.h)
9260
 
    if test "$ac_cv_header_GL_glx_h" != "yes"; then
9261
 
        AC_MSG_ERROR([Can't find header GL/glx.h for WebGL (install mesa-common-dev (Ubuntu), mesa-libGL-devel (Fedora), or Mesa-devel (openSUSE))])
9262
 
    fi
9263
 
fi # MOZ_WEBGL_GLX
9264
 
fi # COMPILE_ENVIRONMENT
9265
 
 
9266
 
if test "$USE_FC_FREETYPE"; then
9267
 
    if test "$COMPILE_ENVIRONMENT"; then
9268
 
        _SAVE_CPPFLAGS="$CPPFLAGS"
9269
 
        CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
9270
 
        AC_CHECK_HEADERS(fontconfig/fcfreetype.h, , 
9271
 
            [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)])
9272
 
        CPPFLAGS="$_SAVE_CPPFLAGS"
9273
 
    else
9274
 
        AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
9275
 
    fi
9276
 
fi
9277
 
 
9278
 
dnl Set various defines and substitutions
9279
 
dnl ========================================================
9280
 
 
9281
 
if test "$OS_ARCH" = "Darwin"; then
9282
 
  AC_DEFINE(XP_UNIX)
9283
 
  AC_DEFINE(UNIX_ASYNC_DNS)
9284
 
elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
9285
 
  AC_DEFINE(XP_UNIX)
9286
 
  AC_DEFINE(UNIX_ASYNC_DNS)
9287
 
fi
9288
 
 
9289
 
if test "$MOZ_DEBUG"; then
9290
 
    AC_DEFINE(MOZ_REFLOW_PERF)
9291
 
    AC_DEFINE(MOZ_REFLOW_PERF_DSP)
9292
 
fi
9293
 
 
9294
 
if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
9295
 
    AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
9296
 
    ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
9297
 
    ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
9298
 
    ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
9299
 
    ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
9300
 
    AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
9301
 
    AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
9302
 
    AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
9303
 
fi
9304
 
 
9305
 
case "$host_os" in
9306
 
mingw*)
9307
 
    WIN_TOP_SRC=`cd $srcdir; pwd -W`
9308
 
    ;;
9309
 
esac
9310
 
 
9311
 
AC_SUBST(WIN_TOP_SRC)
9312
 
 
9313
 
AC_SUBST(MOZILLA_VERSION)
9314
 
 
9315
 
AC_SUBST(ac_configure_args)
9316
 
 
9317
 
dnl Spit out some output
9318
 
dnl ========================================================
9319
 
 
9320
 
dnl The following defines are used by xpcom
9321
 
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
9322
 
CPP_THROW_NEW
9323
 
HAVE_CPP_2BYTE_WCHAR_T
9324
 
HAVE_CPP_ACCESS_CHANGING_USING
9325
 
HAVE_CPP_AMBIGUITY_RESOLVING_USING
9326
 
HAVE_CPP_BOOL
9327
 
HAVE_CPP_CHAR16_T
9328
 
HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
9329
 
HAVE_CPP_EXPLICIT
9330
 
HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
9331
 
HAVE_CPP_NAMESPACE_STD
9332
 
HAVE_CPP_NEW_CASTS
9333
 
HAVE_CPP_PARTIAL_SPECIALIZATION
9334
 
HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
9335
 
HAVE_CPP_TYPENAME
9336
 
HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
9337
 
HAVE_STATVFS
9338
 
NEED_CPP_UNUSED_IMPLEMENTATIONS
9339
 
NEW_H
9340
 
HAVE_GETPAGESIZE
9341
 
HAVE_ICONV
9342
 
HAVE_ICONV_WITH_CONST_INPUT
9343
 
HAVE_MBRTOWC
9344
 
HAVE_SYS_MOUNT_H
9345
 
HAVE_SYS_VFS_H
9346
 
HAVE_WCRTOMB
9347
 
"
9348
 
 
9349
 
AC_CONFIG_HEADER(
9350
 
netwerk/necko-config.h
9351
 
xpcom/xpcom-config.h
9352
 
xpcom/xpcom-private.h
9353
 
)
9354
 
 
9355
 
# Save the defines header file before autoconf removes it.
9356
 
# (Do not add AC_DEFINE calls after this line.)
9357
 
  _CONFIG_TMP=confdefs-tmp.h
9358
 
  _CONFIG_DEFS_H=mozilla-config.h
9359
 
 
9360
 
  cat > $_CONFIG_TMP <<\EOF
9361
 
/* List of defines generated by configure. Included with preprocessor flag,
9362
 
 * -include, to avoid long list of -D defines on the compile command-line.
9363
 
 * Do not edit.
9364
 
 */
9365
 
 
9366
 
#ifndef _MOZILLA_CONFIG_H_
9367
 
#define _MOZILLA_CONFIG_H_
9368
 
EOF
9369
 
 
9370
 
_EGREP_PATTERN='^#define ('
9371
 
if test -n "$_NON_GLOBAL_ACDEFINES"; then
9372
 
    for f in $_NON_GLOBAL_ACDEFINES; do
9373
 
        _EGREP_PATTERN="${_EGREP_PATTERN}$f|"
9374
 
    done
9375
 
fi
9376
 
_EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
9377
 
 
9378
 
  sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
9379
 
 
9380
 
  cat >> $_CONFIG_TMP <<\EOF
9381
 
 
9382
 
#endif /* _MOZILLA_CONFIG_H_ */
9383
 
 
9384
 
EOF
9385
 
 
9386
 
  # Only write mozilla-config.h when something changes (or it doesn't exist)
9387
 
  if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
9388
 
    rm $_CONFIG_TMP
9389
 
  else
9390
 
    AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
9391
 
    mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
9392
 
 
9393
 
    echo ==== $_CONFIG_DEFS_H =================================
9394
 
    cat $_CONFIG_DEFS_H
9395
 
  fi
9396
 
 
9397
 
dnl Probably shouldn't call this manually but we always want the output of DEFS
9398
 
rm -f confdefs.h.save
9399
 
mv confdefs.h confdefs.h.save
9400
 
egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
9401
 
AC_OUTPUT_MAKE_DEFS()
9402
 
MOZ_DEFINES=$DEFS
9403
 
AC_SUBST(MOZ_DEFINES)
9404
 
rm -f confdefs.h
9405
 
mv confdefs.h.save confdefs.h
9406
 
 
9407
 
dnl Load the list of Makefiles to generate.
9408
 
dnl   To add new Makefiles, edit allmakefiles.sh.
9409
 
dnl   allmakefiles.sh sets the variable, MAKEFILES.
9410
 
. ${srcdir}/allmakefiles.sh
9411
 
dnl 
9412
 
dnl Run a perl script to quickly create the makefiles.
9413
 
dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
9414
 
dnl   for the files it cannot handle correctly. This way, config.status
9415
 
dnl   will handle these files.
9416
 
dnl If it fails, nothing is set and config.status will run as usual.
9417
 
dnl
9418
 
dnl This does not change the $MAKEFILES variable.
9419
 
dnl
9420
 
echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
9421
 
. ./conftest.sh
9422
 
rm conftest.sh
9423
 
 
9424
 
echo $MAKEFILES > unallmakefiles
9425
 
 
9426
 
mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
9427
 
 
9428
 
AC_OUTPUT($MAKEFILES)
9429
 
 
9430
 
dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
9431
 
if test "$CAIRO_FEATURES_H"; then
9432
 
  if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
9433
 
    echo "$CAIRO_FEATURES_H is unchanged"
9434
 
    mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
9435
 
  else
9436
 
    rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
9437
 
  fi
9438
 
fi
9439
 
 
9440
 
# Run freetype configure script
9441
 
 
9442
 
if test "$MOZ_TREE_FREETYPE"; then
9443
 
   export CFLAGS="$CFLAGS -std=c99"
9444
 
   export CPPFLAGS="$CPPFLAGS"
9445
 
   export CXXFLAGS="$CXXFLAGS"
9446
 
   export LDFLAGS="$LDFLAGS"
9447
 
   export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
9448
 
   ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes"
9449
 
   AC_OUTPUT_SUBDIRS(modules/freetype2)
9450
 
fi
9451
 
 
9452
 
dnl ========================================================
9453
 
dnl = Setup a nice relatively clean build environment for
9454
 
dnl = sub-configures.
9455
 
dnl ========================================================
9456
 
CC="$_SUBDIR_CC" 
9457
 
CXX="$_SUBDIR_CXX" 
9458
 
CFLAGS="$_SUBDIR_CFLAGS" 
9459
 
CPPFLAGS="$_SUBDIR_CPPFLAGS"
9460
 
CXXFLAGS="$_SUBDIR_CXXFLAGS"
9461
 
LDFLAGS="$_SUBDIR_LDFLAGS"
9462
 
HOST_CC="$_SUBDIR_HOST_CC" 
9463
 
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
9464
 
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
9465
 
RC=
9466
 
 
9467
 
unset MAKEFILES
9468
 
unset CONFIG_FILES
9469
 
 
9470
 
# No need to run subconfigures when building with LIBXUL_SDK_DIR
9471
 
if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
9472
 
 
9473
 
if test -n "$MOZ_THUMB2"; then
9474
 
  _SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --enable-thumb2"
9475
 
fi
9476
 
if test -n "$MOZ_ARM_ARCH"; then
9477
 
  _SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --with-cpu-arch=$MOZ_ARM_ARCH"
9478
 
fi
9479
 
if test -n "$_WRAP_MALLOC"; then
9480
 
  _SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --enable-wrap-malloc"
9481
 
fi
9482
 
 
9483
 
if test -z "$MOZ_NATIVE_NSPR"; then
9484
 
    ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
9485
 
    if test -z "$MOZ_DEBUG"; then
9486
 
        ac_configure_args="$ac_configure_args --disable-debug"
9487
 
    fi
9488
 
    if test "$MOZ_OPTIMIZE" = "1"; then
9489
 
        ac_configure_args="$ac_configure_args --enable-optimize"
9490
 
    fi
9491
 
    if test "$OS_ARCH" = "WINNT" -a "$NS_TRACE_MALLOC"; then
9492
 
       ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
9493
 
    fi
9494
 
    if test -n "$HAVE_64BIT_OS"; then
9495
 
        ac_configure_args="$ac_configure_args --enable-64bit"
9496
 
    fi
9497
 
    if test -n "$USE_ARM_KUSER"; then
9498
 
        ac_configure_args="$ac_configure_args --with-arm-kuser"
9499
 
    fi
9500
 
    AC_OUTPUT_SUBDIRS(nsprpub)
9501
 
    ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9502
 
fi
9503
 
 
9504
 
if test -z "$MOZ_NATIVE_NSPR"; then
9505
 
    # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
9506
 
    AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
9507
 
    if test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
9508
 
       NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
9509
 
       $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
9510
 
       NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
9511
 
       $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
9512
 
    fi
9513
 
    rm -f config/autoconf.mk.bak
9514
 
fi
9515
 
 
9516
 
# Run the SpiderMonkey 'configure' script.
9517
 
dist=$MOZ_BUILD_ROOT/dist
9518
 
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9519
 
ac_configure_args="$ac_configure_args --enable-threadsafe"
9520
 
if test "$BUILD_CTYPES"; then
9521
 
    # Build js-ctypes on the platforms we can.
9522
 
    ac_configure_args="$ac_configure_args --enable-ctypes"
9523
 
fi
9524
 
if test -z "$JS_SHARED_LIBRARY" ; then
9525
 
    ac_configure_args="$ac_configure_args --disable-shared-js"
9526
 
fi
9527
 
if test -z "$MOZ_NATIVE_NSPR"; then
9528
 
    ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
9529
 
    ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
9530
 
fi
9531
 
ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
9532
 
ac_configure_args="$ac_configure_args --prefix=$dist"
9533
 
ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
9534
 
if test "$MOZ_MEMORY"; then
9535
 
   ac_configure_args="$ac_configure_args --enable-jemalloc"
9536
 
   if test -n "$MOZ_MEMORY_LDFLAGS"; then
9537
 
     export MOZ_MEMORY_LDFLAGS
9538
 
   fi
9539
 
fi
9540
 
export MOZ_APP_NAME
9541
 
AC_OUTPUT_SUBDIRS(js/src)
9542
 
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9543
 
 
9544
 
fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
9545
 
 
9546
 
dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
9547
 
dnl Needs to be at the end to respect possible changes from NSPR configure
9548
 
if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
9549
 
  echo "config/autoconf.mk is unchanged"
9550
 
  mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
9551
 
else
9552
 
  rm -f config/autoconf.mk.orig 2> /dev/null
9553
 
fi
9554