~ubuntu-branches/ubuntu/precise/lightning-extension/precise

« back to all changes in this revision

Viewing changes to mozilla/configure.in

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-02-07 12:00:41 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20120207120041-qo3fapzsweii9cra
Tags: 1.3~b1+build1-0ubuntu1
* New upstream release from the beta channel (CALENDAR_1_3b1_BUILD1)
* Drop 02_fix_system_libxul_build.patch - this is fixed upstream
* Add mozilla/mfbt to tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
fi
181
181
MOZ_BUILD_ROOT=`pwd`
182
182
 
183
 
dnl Default to MSVC for win32 and gcc-4.2 for darwin
 
183
dnl Default to MSVC for win32 and gcc for darwin
184
184
dnl ==============================================================
185
185
if test -z "$CROSS_COMPILE"; then
186
186
case "$target" in
203
203
    if test -z "$MIDL"; then MIDL=midl; fi
204
204
    ;;
205
205
*-darwin*)
206
 
    if test -z "$CC"; then CC=gcc-4.2; fi
207
 
    if test -z "$CXX"; then CXX=g++-4.2; fi
 
206
    # we prefer gcc-4.2 over gcc on older darwin, so
 
207
    # use that specific version if it's available.
 
208
    MOZ_PATH_PROGS(CC, $CC gcc-4.2 gcc)
 
209
    MOZ_PATH_PROGS(CXX, $CXX g++-4.2 g++)
208
210
    ;;
209
211
esac
210
212
fi
289
291
    ;;
290
292
esac
291
293
 
 
294
MOZ_ARG_WITH_STRING(gonk,
 
295
[  --with-gonk=DIR
 
296
               location of gonk dir],
 
297
    gonkdir=$withval)
 
298
 
 
299
if test -n "$gonkdir" ; then
 
300
    kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
 
301
    gonk_toolchain="$gonkdir"/prebuilt/$kernel_name-x86/toolchain/arm-eabi-4.4.3
 
302
 
 
303
    dnl set up compilers
 
304
    AS="$gonk_toolchain"/bin/"$android_tool_prefix"-as
 
305
    CC="$gonk_toolchain"/bin/"$android_tool_prefix"-gcc
 
306
    CXX="$gonk_toolchain"/bin/"$android_tool_prefix"-g++
 
307
    CPP="$gonk_toolchain"/bin/"$android_tool_prefix"-cpp
 
308
    LD="$gonk_toolchain"/bin/"$android_tool_prefix"-ld
 
309
    AR="$gonk_toolchain"/bin/"$android_tool_prefix"-ar
 
310
    RANLIB="$gonk_toolchain"/bin/"$android_tool_prefix"-ranlib
 
311
    STRIP="$gonk_toolchain"/bin/"$android_tool_prefix"-strip
 
312
 
 
313
    STLPORT_CPPFLAGS="-I$gonkdir/ndk/sources/cxx-stl/stlport/stlport/"
 
314
    STLPORT_LIBS="-lstlport"
 
315
 
 
316
    CPPFLAGS="-DANDROID -I$gonkdir/bionic/libc/include/ -I$gonkdir/bionic/libc/kernel/common -I$gonkdir/bionic/libc/arch-arm/include -I$gonkdir/bionic/libc/kernel/arch-arm -I$gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/system/core/include -I$gonkdir/bionic -I$gonkdir/frameworks/base/include $STLPORT_CPPFLAGS $CPPFLAGS"
 
317
    CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
 
318
    CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS"
 
319
    LIBS="$LIBS $STLPORT_LIBS"
 
320
 
 
321
    dnl Add -llog by default, since we use it all over the place.
 
322
    LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"
 
323
 
 
324
    dnl prevent cross compile section from using these flags as host flags
 
325
    if test -z "$HOST_CPPFLAGS" ; then
 
326
        HOST_CPPFLAGS=" "
 
327
    fi
 
328
    if test -z "$HOST_CFLAGS" ; then
 
329
        HOST_CFLAGS=" "
 
330
    fi
 
331
    if test -z "$HOST_CXXFLAGS" ; then
 
332
        HOST_CXXFLAGS=" "
 
333
    fi
 
334
    if test -z "$HOST_LDFLAGS" ; then
 
335
        HOST_LDFLAGS=" "
 
336
    fi
 
337
 
 
338
    AC_DEFINE(ANDROID)
 
339
    CROSS_COMPILE=1
 
340
    MOZ_CHROME_FILE_FORMAT=omni
 
341
    ZLIB_DIR=yes
 
342
    direct_nspr_config=1
 
343
else
292
344
case "$target" in
293
345
*-android*|*-linuxandroid*)
294
346
    if test -z "$android_ndk" ; then
419
471
    ;;
420
472
esac
421
473
 
 
474
fi
 
475
 
422
476
AC_SUBST(ANDROID_NDK)
423
477
AC_SUBST(ANDROID_TOOLCHAIN)
424
478
AC_SUBST(ANDROID_PLATFORM)
1325
1379
# but that breaks when you have a 64 bit kernel with a 32 bit userland.
1326
1380
OS_TEST="${target_cpu}"
1327
1381
 
1328
 
_COMPILER_PREFIX=
1329
 
 
1330
1382
HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1331
1383
 
1332
1384
#######################################################################
1708
1760
AC_SUBST(HAVE_ARM_SIMD)
1709
1761
AC_SUBST(HAVE_ARM_NEON)
1710
1762
 
 
1763
dnl =================================================================
 
1764
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
 
1765
dnl which is bad when cross compiling.
 
1766
dnl =================================================================
 
1767
if test "$COMPILE_ENVIRONMENT"; then
 
1768
configure_static_assert_macros='
 
1769
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
 
1770
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
 
1771
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
 
1772
'
 
1773
 
 
1774
dnl test that the macros actually work:
 
1775
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
 
1776
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
 
1777
 [AC_LANG_SAVE
 
1778
  AC_LANG_C
 
1779
  ac_cv_static_assertion_macros_work="yes"
 
1780
  AC_TRY_COMPILE([$configure_static_assert_macros],
 
1781
                 [CONFIGURE_STATIC_ASSERT(1)],
 
1782
                 ,
 
1783
                 ac_cv_static_assertion_macros_work="no")
 
1784
  AC_TRY_COMPILE([$configure_static_assert_macros],
 
1785
                 [CONFIGURE_STATIC_ASSERT(0)],
 
1786
                 ac_cv_static_assertion_macros_work="no",
 
1787
                 )
 
1788
  AC_LANG_CPLUSPLUS
 
1789
  AC_TRY_COMPILE([$configure_static_assert_macros],
 
1790
                 [CONFIGURE_STATIC_ASSERT(1)],
 
1791
                 ,
 
1792
                 ac_cv_static_assertion_macros_work="no")
 
1793
  AC_TRY_COMPILE([$configure_static_assert_macros],
 
1794
                 [CONFIGURE_STATIC_ASSERT(0)],
 
1795
                 ac_cv_static_assertion_macros_work="no",
 
1796
                 )
 
1797
  AC_LANG_RESTORE
 
1798
 ])
 
1799
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
 
1800
if test "$ac_cv_static_assertion_macros_work" = "no"; then
 
1801
    AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
 
1802
fi
 
1803
fi # COMPILE_ENVIRONMENT
 
1804
 
1711
1805
dnl ========================================================
1712
1806
dnl Android libstdc++, placed here so it can use MOZ_ARCH
1713
1807
dnl computed above.
1767
1861
    DSO_CFLAGS=''
1768
1862
    DSO_PIC_CFLAGS='-fPIC'
1769
1863
    ASFLAGS="$ASFLAGS -fPIC"
1770
 
    _MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1771
 
    _MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
 
1864
    _MOZ_RTTI_FLAGS_ON=-frtti
 
1865
    _MOZ_RTTI_FLAGS_OFF=-fno-rtti
1772
1866
 
1773
1867
    # Turn on GNU specific features
1774
1868
    # -Wall - turn on all warnings
1844
1938
    _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1845
1939
    _USE_CPP_INCLUDE_FLAG=1
1846
1940
 
 
1941
    # Recent clang and gcc support C++11 deleted functions without warnings if
 
1942
    # compiling with -std=c++0x or -std=gnu++0x (or c++11 or gnu++11 in very new
 
1943
    # versions).  We can't use -std=c++0x yet, so gcc's support must remain
 
1944
    # unused.  But clang's warning can be disabled, so when compiling with clang
 
1945
    # we use it to opt out of the warning, enabling (macro-encapsulated) use of
 
1946
    # deleted function syntax.
 
1947
    if test "$CLANG_CXX"; then
 
1948
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions"
 
1949
    fi
 
1950
 
 
1951
    AC_CACHE_CHECK(whether the compiler supports -Wno-extended-offsetof,
 
1952
                   ac_has_wno_extended_offsetof,
 
1953
        [
 
1954
            AC_LANG_SAVE
 
1955
            AC_LANG_CPLUSPLUS
 
1956
            _SAVE_CXXFLAGS="$CXXFLAGS"
 
1957
            CXXFLAGS="$CXXFLAGS -Wno-extended-offsetof"
 
1958
            AC_TRY_COMPILE([$configure_static_assert_macros
 
1959
                            #ifndef __has_warning
 
1960
                            #define __has_warning(x) 0
 
1961
                            #endif],
 
1962
                           [CONFIGURE_STATIC_ASSERT(__has_warning("-Wextended-offsetof"))],
 
1963
                           ac_has_wno_extended_offsetof="yes",
 
1964
                           ac_has_wno_extended_offsetof="no")
 
1965
            CXXFLAGS="$_SAVE_CXXFLAGS"
 
1966
            AC_LANG_RESTORE
 
1967
        ])
 
1968
    if test "$ac_has_wno_extended_offsetof" = "yes"; then
 
1969
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-extended-offsetof"
 
1970
    fi
 
1971
 
1847
1972
    AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1848
1973
                   ac_has_wno_invalid_offsetof,
1849
1974
        [
1850
1975
            AC_LANG_SAVE
1851
1976
            AC_LANG_CPLUSPLUS
1852
1977
            _SAVE_CXXFLAGS="$CXXFLAGS"
1853
 
            CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
 
1978
            CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof"
1854
1979
            AC_TRY_COMPILE([],
1855
1980
                           [return(0);],
1856
1981
                           ac_has_wno_invalid_offsetof="yes",
1859
1984
            AC_LANG_RESTORE
1860
1985
        ])
1861
1986
    if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1862
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
 
1987
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof"
1863
1988
    fi
1864
1989
 
1865
1990
    AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
1868
1993
            AC_LANG_SAVE
1869
1994
            AC_LANG_CPLUSPLUS
1870
1995
            _SAVE_CXXFLAGS="$CXXFLAGS"
1871
 
            CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
 
1996
            CXXFLAGS="$CXXFLAGS -Wno-variadic-macros"
1872
1997
            AC_TRY_COMPILE([],
1873
1998
                           [return(0);],
1874
1999
                           ac_has_wno_variadic_macros="yes",
1877
2002
            AC_LANG_RESTORE
1878
2003
        ])
1879
2004
    if test "$ac_has_wno_variadic_macros" = "yes"; then
1880
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
 
2005
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros"
1881
2006
    fi
1882
2007
 
1883
2008
    AC_CACHE_CHECK(whether the compiler supports -Werror=return-type,
1942
2067
fi # GNU_CC
1943
2068
fi # COMPILE_ENVIRONMENT
1944
2069
 
1945
 
dnl =================================================================
1946
 
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1947
 
dnl which is bad when cross compiling.
1948
 
dnl =================================================================
1949
 
if test "$COMPILE_ENVIRONMENT"; then
1950
 
configure_static_assert_macros='
1951
 
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1952
 
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1953
 
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1954
 
'
1955
 
 
1956
 
dnl test that the macros actually work:
1957
 
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1958
 
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1959
 
 [AC_LANG_SAVE
1960
 
  AC_LANG_C
1961
 
  ac_cv_static_assertion_macros_work="yes"
1962
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1963
 
                 [CONFIGURE_STATIC_ASSERT(1)],
1964
 
                 ,
1965
 
                 ac_cv_static_assertion_macros_work="no")
1966
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1967
 
                 [CONFIGURE_STATIC_ASSERT(0)],
1968
 
                 ac_cv_static_assertion_macros_work="no",
1969
 
                 )
1970
 
  AC_LANG_CPLUSPLUS
1971
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1972
 
                 [CONFIGURE_STATIC_ASSERT(1)],
1973
 
                 ,
1974
 
                 ac_cv_static_assertion_macros_work="no")
1975
 
  AC_TRY_COMPILE([$configure_static_assert_macros],
1976
 
                 [CONFIGURE_STATIC_ASSERT(0)],
1977
 
                 ac_cv_static_assertion_macros_work="no",
1978
 
                 )
1979
 
  AC_LANG_RESTORE
1980
 
 ])
1981
 
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1982
 
if test "$ac_cv_static_assertion_macros_work" = "no"; then
1983
 
    AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1984
 
fi
1985
 
fi # COMPILE_ENVIRONMENT
1986
 
 
1987
2070
dnl ========================================================
1988
2071
dnl Checking for 64-bit OS
1989
2072
dnl ========================================================
2033
2116
        AC_MSG_ERROR(
2034
2117
            [--enable-valgrind specified but Valgrind is not installed]))
2035
2118
    AC_DEFINE(MOZ_VALGRIND)
2036
 
    MOZ_VALGRIND=1
2037
2119
fi
2038
2120
AC_SUBST(MOZ_VALGRIND)
2039
2121
 
2040
2122
dnl ========================================================
 
2123
dnl = Use DMD
 
2124
dnl ========================================================
 
2125
MOZ_ARG_ENABLE_BOOL(dmd,
 
2126
[  --enable-dmd            Enable DMD; also disables jemalloc (default=no)],
 
2127
    MOZ_DMD=1,
 
2128
    MOZ_DMD= )
 
2129
if test -n "$MOZ_DMD"; then
 
2130
    MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
 
2131
        AC_MSG_ERROR(
 
2132
            [--enable-dmd specified but Valgrind is not installed]))
 
2133
    AC_DEFINE(MOZ_DMD)
 
2134
fi
 
2135
AC_SUBST(MOZ_DMD)
 
2136
 
 
2137
dnl ========================================================
2041
2138
dnl jprof
2042
2139
dnl ========================================================
2043
2140
MOZ_ARG_ENABLE_BOOL(jprof,
2170
2267
fi
2171
2268
AC_MSG_RESULT([yes])
2172
2269
 
 
2270
dnl Check for using a custom <stdint.h> implementation
 
2271
dnl ========================================================
 
2272
AC_MSG_CHECKING(for custom <stdint.h> implementation)
 
2273
if test "$MOZ_CUSTOM_STDINT_H"; then
 
2274
  AC_DEFINE_UNQUOTED(MOZ_CUSTOM_STDINT_H, "$MOZ_CUSTOM_STDINT_H")
 
2275
  AC_SUBST(MOZ_CUSTOM_STDINT_H)
 
2276
  AC_MSG_RESULT(using $MOZ_CUSTOM_STDINT_H)
 
2277
else
 
2278
  AC_MSG_RESULT(none specified)
 
2279
fi
 
2280
 
2173
2281
dnl Get mozilla version from central milestone file
2174
2282
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
2175
2283
 
2379
2487
*-android*|*-linuxandroid*)
2380
2488
    AC_DEFINE(NO_PW_GECOS)
2381
2489
    no_x=yes
2382
 
    _PLATFORM_DEFAULT_TOOLKIT=cairo-android
 
2490
    if test -n "$gonkdir"; then
 
2491
        _PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
 
2492
    else
 
2493
        _PLATFORM_DEFAULT_TOOLKIT=cairo-android
 
2494
        MOZ_LINKER=1
 
2495
    fi
2383
2496
    TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2384
2497
 
2385
2498
    MOZ_GFX_OPTIMIZE_MOBILE=1
2586
2699
        fi
2587
2700
 
2588
2701
        if test -n "$GNU_CC"; then
2589
 
            CFLAGS="$CFLAGS -mstackrealign"
2590
 
            CXXFLAGS="$CXXFLAGS -mstackrealign"
 
2702
            CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
 
2703
            CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
2591
2704
        else
2592
2705
            AC_DEFINE(HAVE_STDCALL)
2593
2706
        fi
2813
2926
 
2814
2927
esac
2815
2928
 
 
2929
AC_SUBST(MOZ_LINKER)
 
2930
 
2816
2931
dnl Only one oddball right now (QNX), but this gives us flexibility
2817
2932
dnl if any other platforms need to override this in the future.
2818
2933
AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2932
3047
  AC_MSG_RESULT(no)
2933
3048
fi
2934
3049
 
2935
 
dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
 
3050
dnl Check for int64, uint, and uint_t.
2936
3051
dnl ========================================================
2937
 
AC_MSG_CHECKING(for int16_t)
2938
 
AC_CACHE_VAL(ac_cv_int16_t,
2939
 
 [AC_TRY_COMPILE([#include <stdio.h>
2940
 
                  #include <sys/types.h>],
2941
 
                 [int16_t foo = 0;],
2942
 
                 [ac_cv_int16_t=true],
2943
 
                 [ac_cv_int16_t=false])])
2944
 
if test "$ac_cv_int16_t" = true ; then
2945
 
  AC_DEFINE(HAVE_INT16_T)
2946
 
  AC_MSG_RESULT(yes)
2947
 
else
2948
 
  AC_MSG_RESULT(no)
2949
 
fi
2950
 
AC_MSG_CHECKING(for int32_t)
2951
 
AC_CACHE_VAL(ac_cv_int32_t,
2952
 
 [AC_TRY_COMPILE([#include <stdio.h>
2953
 
                  #include <sys/types.h>],
2954
 
                 [int32_t foo = 0;],
2955
 
                 [ac_cv_int32_t=true],
2956
 
                 [ac_cv_int32_t=false])])
2957
 
if test "$ac_cv_int32_t" = true ; then
2958
 
  AC_DEFINE(HAVE_INT32_T)
2959
 
  AC_MSG_RESULT(yes)
2960
 
else
2961
 
  AC_MSG_RESULT(no)
2962
 
fi
2963
 
AC_MSG_CHECKING(for int64_t)
2964
 
AC_CACHE_VAL(ac_cv_int64_t,
2965
 
 [AC_TRY_COMPILE([#include <stdio.h>
2966
 
                  #include <sys/types.h>],
2967
 
                 [int64_t foo = 0;],
2968
 
                 [ac_cv_int64_t=true],
2969
 
                 [ac_cv_int64_t=false])])
2970
 
if test "$ac_cv_int64_t" = true ; then
2971
 
  AC_DEFINE(HAVE_INT64_T)
2972
 
  AC_MSG_RESULT(yes)
2973
 
else
2974
 
  AC_MSG_RESULT(no)
2975
 
fi
2976
3052
AC_MSG_CHECKING(for int64)
2977
3053
AC_CACHE_VAL(ac_cv_int64,
2978
3054
 [AC_TRY_COMPILE([#include <stdio.h>
3012
3088
else
3013
3089
  AC_MSG_RESULT(no)
3014
3090
fi
3015
 
AC_MSG_CHECKING(for uint16_t)
3016
 
AC_CACHE_VAL(ac_cv_uint16_t,
3017
 
 [AC_TRY_COMPILE([#include <stdio.h>
3018
 
                  #include <sys/types.h>],
3019
 
                 [uint16_t foo = 0;],
3020
 
                 [ac_cv_uint16_t=true],
3021
 
                 [ac_cv_uint16_t=false])])
3022
 
if test "$ac_cv_uint16_t" = true ; then
3023
 
  AC_DEFINE(HAVE_UINT16_T)
3024
 
  AC_MSG_RESULT(yes)
3025
 
else
3026
 
  AC_MSG_RESULT(no)
3027
 
fi
3028
3091
 
3029
3092
dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
3030
3093
dnl are defined when compiling C++ but not C.  Since the result of this
3324
3387
    CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3325
3388
    ;;
3326
3389
esac
3327
 
MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3328
 
MOZ_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3329
 
MOZ_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3330
 
MOZ_CHECK_HEADERS(malloc.h)
3331
 
MOZ_CHECK_HEADERS(X11/XKBlib.h)
3332
 
MOZ_CHECK_HEADERS(io.h)
 
3390
MOZ_CHECK_COMMON_HEADERS
3333
3391
 
3334
3392
dnl These are all the places some variant of statfs can be hiding.
3335
3393
MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3924
3982
                               X<Y> y_x;,
3925
3983
                               ac_cv_cpp_modern_specialize_template_syntax=yes,
3926
3984
                               ac_cv_cpp_modern_specialize_template_syntax=no)])
3927
 
if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3928
 
  AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
 
3985
if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
 
3986
  AC_MSG_ERROR([The C++ compiler does not support template specialization])
3929
3987
fi
3930
3988
 
3931
 
 
3932
3989
dnl Some compilers support only full specialization, and some don't.
3933
3990
AC_CACHE_CHECK(whether partial template specialization works,
3934
3991
               ac_cv_cpp_partial_specialization,
4031
4088
                            ac_cv_thread_keyword=yes,
4032
4089
                            ac_cv_thread_keyword=no)])
4033
4090
LDFLAGS=$_SAVE_LDFLAGS
4034
 
if test "$ac_cv_thread_keyword" = yes; then
 
4091
# The custom dynamic linker doesn't support TLS variables
 
4092
if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
4035
4093
  # mips builds fail with TLS variables because of a binutils bug.
4036
4094
  # See bug 528687
4037
4095
  case "${target}" in
4087
4145
                               ac_cv_attribute_warn_unused=yes,
4088
4146
                               ac_cv_attribute_warn_unused=no)])
4089
4147
 
4090
 
AC_CACHE_CHECK(for __attribute__((noreturn)),
4091
 
               ac_cv_attribute_noreturn,
4092
 
               [AC_TRY_COMPILE([void f(void) __attribute__((noreturn));],
4093
 
                               [],
4094
 
                               ac_cv_attribute_noreturn=yes,
4095
 
                               ac_cv_attribute_noreturn=no)])
4096
 
 
4097
4148
dnl End of C++ language/feature checks
4098
4149
AC_LANG_C
4099
4150
 
4149
4200
  AC_DEFINE(NS_WARN_UNUSED_RESULT,)
4150
4201
fi
4151
4202
 
4152
 
if test "$ac_cv_attribute_noreturn" = yes ; then
4153
 
  AC_DEFINE(NS_NORETURN, [__attribute__((noreturn))])
4154
 
else
4155
 
  AC_DEFINE(NS_NORETURN,)
4156
 
fi
4157
 
 
4158
4203
dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
4159
4204
dnl features that Windows actually does support.
4160
4205
 
4210
4255
    _USE_SYSTEM_NSPR=1 )
4211
4256
 
4212
4257
if test -n "$_USE_SYSTEM_NSPR"; then
4213
 
    AM_PATH_NSPR(4.8.8, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
 
4258
    AM_PATH_NSPR(4.9.0, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
4214
4259
fi
4215
4260
 
4216
4261
if test -n "$MOZ_NATIVE_NSPR"; then
4218
4263
    CFLAGS="$CFLAGS $NSPR_CFLAGS"
4219
4264
    AC_TRY_COMPILE([#include "prtypes.h"],
4220
4265
                [#ifndef PR_STATIC_ASSERT
4221
 
                 #error PR_STATIC_ASSERT not defined or requires including prlog.h
 
4266
                 #error PR_STATIC_ASSERT not defined or requires including prtypes.h
4222
4267
                 #endif],
4223
4268
                [MOZ_NATIVE_NSPR=1],
4224
4269
                AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it]))
 
4270
    AC_TRY_COMPILE([#include "prtypes.h"],
 
4271
                [#ifndef PR_UINT64
 
4272
                 #error PR_UINT64 not defined or requires including prtypes.h
 
4273
                 #endif],
 
4274
                [MOZ_NATIVE_NSPR=1],
 
4275
                AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
4225
4276
    CFLAGS=$_SAVE_CFLAGS
4226
4277
else
4227
4278
    if test "$OS_ARCH" = "WINNT"; then
4284
4335
    _USE_SYSTEM_NSS=1 )
4285
4336
 
4286
4337
if test -n "$_USE_SYSTEM_NSS"; then
4287
 
    AM_PATH_NSS(3.13.1, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
 
4338
    AM_PATH_NSS(3.13.2, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
4288
4339
fi
4289
4340
 
4290
4341
if test -n "$MOZ_NATIVE_NSS"; then
4411
4462
    ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4412
4463
fi
4413
4464
 
 
4465
if test "$MOZ_LINKER" = 1 -a "$SYSTEM_ZLIB" != 1; then
 
4466
    AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib])
 
4467
fi
 
4468
 
4414
4469
dnl system BZIP2 Support
4415
4470
dnl ========================================================
4416
4471
MOZ_ARG_WITH_STRING(system-bz2,
4580
4635
MOZ_SAFE_BROWSING=
4581
4636
MOZ_HELP_VIEWER=
4582
4637
MOZ_SPELLCHECK=1
 
4638
MOZ_JAVA_COMPOSITOR=
4583
4639
MOZ_SVG_DLISTS=
4584
4640
MOZ_TOOLKIT_SEARCH=1
4585
4641
MOZ_UI_LOCALE=en-US
4598
4654
USE_ARM_KUSER=
4599
4655
BUILD_CTYPES=1
4600
4656
MOZ_USE_NATIVE_POPUP_WINDOWS=
4601
 
 
 
4657
MOZ_ANDROID_HISTORY=
 
4658
MOZ_GRAPHITE=1
4602
4659
 
4603
4660
case "${target}" in
4604
 
*android*|*darwin*)
 
4661
*darwin*)
4605
4662
    ACCESSIBILITY=
4606
4663
    ;;
4607
4664
*)
4667
4724
  AC_MSG_RESULT([browser])
4668
4725
  MOZ_BUILD_APP=browser
4669
4726
else
 
4727
  # default mobile to be mobile/xul
 
4728
  if test "$MOZ_BUILD_APP" = "mobile" ; then
 
4729
    MOZ_BUILD_APP=mobile/xul
 
4730
  fi
4670
4731
  # We have a valid application only if it has a build.mk file in its top
4671
4732
  # directory.
4672
4733
  if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4765
4826
        -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4766
4827
        -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
4767
4828
        -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
4768
 
        -o "$_DEFAULT_TOOLKIT" = "cairo-android"
 
4829
        -o "$_DEFAULT_TOOLKIT" = "cairo-android" \
 
4830
        -o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
4769
4831
    then
4770
4832
        dnl nglayout only supports building with one toolkit,
4771
4833
        dnl so ignore everything after the first comma (",").
4880
4942
 
4881
4943
cairo-android)
4882
4944
    AC_DEFINE(MOZ_WIDGET_ANDROID)
 
4945
    AC_DEFINE(MOZ_TOUCH)
4883
4946
    MOZ_WIDGET_TOOLKIT=android
4884
4947
    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4885
4948
    TK_LIBS='$(MOZ_CAIRO_LIBS)'
4886
4949
    MOZ_WEBGL=1
4887
4950
    MOZ_PDF_PRINTING=1
4888
4951
    MOZ_INSTRUMENT_EVENT_LOOP=1
 
4952
    if test "$MOZ_BUILD_APP" = "mobile/xul"; then
 
4953
        MOZ_OLD_LINKER=1
 
4954
    fi
 
4955
    MOZ_TOUCH=1
 
4956
    ;;
 
4957
 
 
4958
cairo-gonk)
 
4959
    AC_DEFINE(MOZ_WIDGET_GONK)
 
4960
    MOZ_WIDGET_TOOLKIT=gonk
 
4961
    TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
 
4962
    TK_LIBS='$(MOZ_CAIRO_LIBS)'
 
4963
    MOZ_WEBGL=1
 
4964
    MOZ_PDF_PRINTING=1
 
4965
    MOZ_B2G_RIL=1
4889
4966
    ;;
4890
4967
 
4891
4968
esac
4892
4969
 
 
4970
AC_SUBST(MOZ_OLD_LINKER)
4893
4971
AC_SUBST(MOZ_PDF_PRINTING)
4894
4972
if test "$MOZ_PDF_PRINTING"; then
4895
4973
   PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
5425
5503
AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5426
5504
 
5427
5505
dnl ========================================================
 
5506
dnl = Enable Android History instead of Places
 
5507
dnl ========================================================
 
5508
if test -n "$MOZ_ANDROID_HISTORY"; then
 
5509
     dnl Do this if defined in confvars.sh
 
5510
     AC_DEFINE(MOZ_ANDROID_HISTORY)
 
5511
fi
 
5512
 
 
5513
 
 
5514
dnl ========================================================
5428
5515
dnl = Build Personal Security Manager
5429
5516
dnl ========================================================
5430
5517
MOZ_ARG_DISABLE_BOOL(crypto,
5636
5723
                [return 0;],
5637
5724
                [AC_MSG_RESULT([yes])
5638
5725
                 MOZ_NATIVE_LIBVPX=1
 
5726
                 AC_DEFINE(MOZ_NATIVE_LIBVPX)
5639
5727
                 MOZ_LIBVPX_INCLUDES="-I${LIBVPX_DIR}/include"
5640
5728
                 MOZ_LIBVPX_LIBS="-L${LIBVPX_DIR}/lib -lvpx"],
5641
5729
                [AC_MSG_RESULT([no])
5835
5923
fi
5836
5924
 
5837
5925
dnl ========================================================
5838
 
dnl Pref extensions (autoconfig and system-pref)
 
5926
dnl Pref extensions (autoconfig)
5839
5927
dnl ========================================================
5840
5928
MOZ_ARG_DISABLE_BOOL(pref-extensions,
5841
5929
[  --disable-pref-extensions
5842
 
                          Disable pref extensions such as autoconfig and
5843
 
                          system-pref],
 
5930
                          Disable pref extensions such as autoconfig],
5844
5931
  MOZ_PREF_EXTENSIONS=,
5845
5932
  MOZ_PREF_EXTENSIONS=1 )
5846
5933
 
7022
7109
fi
7023
7110
 
7024
7111
dnl ========================================================
 
7112
dnl moz_dump_painting
 
7113
dnl ========================================================
 
7114
MOZ_ARG_ENABLE_BOOL(dump-painting,
 
7115
[  --enable-dump-painting          Enable paint debugging.],
 
7116
    MOZ_DUMP_PAINTING=1,
 
7117
    MOZ_DUMP_PAINTING= )
 
7118
if test -n "$MOZ_DUMP_PAINTING"; then
 
7119
    AC_DEFINE(MOZ_DUMP_PAINTING)
 
7120
    AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
 
7121
fi
 
7122
if test -n "$MOZ_DEBUG"; then
 
7123
    AC_DEFINE(MOZ_DUMP_PAINTING)
 
7124
fi
 
7125
 
 
7126
dnl ========================================================
7025
7127
dnl = Enable trace malloc
7026
7128
dnl ========================================================
7027
7129
NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
7028
7130
MOZ_ARG_ENABLE_BOOL(trace-malloc,
7029
 
[  --enable-trace-malloc   Enable malloc tracing],
 
7131
[  --enable-trace-malloc   Enable malloc tracing; also disables jemalloc],
7030
7132
    NS_TRACE_MALLOC=1,
7031
7133
    NS_TRACE_MALLOC= )
7032
7134
if test "$NS_TRACE_MALLOC"; then
7048
7150
if test "$NS_TRACE_MALLOC"; then
7049
7151
    MOZ_MEMORY=
7050
7152
fi
 
7153
if test "$MOZ_DMD"; then
 
7154
    MOZ_MEMORY=
 
7155
fi
7051
7156
 
7052
7157
if test "${OS_TARGET}" = "Android"; then
7053
 
  dnl On Android, we use WRAP_LDFLAGS to link everything to mozutils
 
7158
  dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue
7054
7159
  :
7055
7160
elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
7056
 
  dnl On Windows, OSX and OS2, we want to link all our binaries against mozutils
7057
 
  MOZ_UTILS_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozutils,$(LIBXUL_DIST)/lib)'
 
7161
  dnl On Windows, OSX and OS2, we want to link all our binaries against mozglue
 
7162
  MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
7058
7163
else
7059
 
  dnl On other Unix systems, we only want to link executables against mozutils
7060
 
  MOZ_UTILS_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozutils,$(LIBXUL_DIST)/lib) $(MKSHLIB_UNFORCE_ALL)'
 
7164
  dnl On other Unix systems, we only want to link executables against mozglue
 
7165
  MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib) $(MKSHLIB_UNFORCE_ALL)'
7061
7166
  if test -n "$GNU_CC"; then
7062
 
    dnl And we need mozutils symbols to be exported.
7063
 
    MOZ_UTILS_PROGRAM_LDFLAGS="$MOZ_UTILS_PROGRAM_LDFLAGS -rdynamic"
 
7167
    dnl And we need mozglue symbols to be exported.
 
7168
    MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
 
7169
  fi
 
7170
  if test "$MOZ_LINKER" = 1; then
 
7171
    MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $ZLIB_LIBS"
7064
7172
  fi
7065
7173
fi
7066
7174
 
7113
7221
    AC_DEFINE(MOZ_MEMORY_LINUX)
7114
7222
    AC_DEFINE(MOZ_MEMORY_ANDROID)
7115
7223
    _WRAP_MALLOC=1
7116
 
    MOZ_UTILS_LDFLAGS=
 
7224
    MOZ_GLUE_LDFLAGS=
7117
7225
    ;;
7118
7226
  *-*linux*)
7119
7227
    AC_DEFINE(MOZ_MEMORY_LINUX)
7135
7243
    WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
7136
7244
    lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
7137
7245
    if grep -q '__imp__\{0,1\}free' crtdll.obj; then
7138
 
      MOZ_UTILS_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
 
7246
      MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
7139
7247
      dnl Also pass this to NSPR/NSS
7140
 
      DLLFLAGS="$DLLFLAGS $MOZ_UTILS_LDFLAGS"
 
7248
      DLLFLAGS="$DLLFLAGS $MOZ_GLUE_LDFLAGS"
7141
7249
    else
7142
 
      DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozutils"
 
7250
      DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue"
7143
7251
    fi
7144
7252
    rm crtdll.obj
7145
7253
 
7158
7266
  AC_DEFINE(HAVE_JEMALLOC_MEMALIGN)
7159
7267
fi # MOZ_MEMORY
7160
7268
AC_SUBST(MOZ_MEMORY)
7161
 
AC_SUBST(MOZ_UTILS_LDFLAGS)
7162
 
AC_SUBST(MOZ_UTILS_PROGRAM_LDFLAGS)
 
7269
AC_SUBST(MOZ_GLUE_LDFLAGS)
 
7270
AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS)
7163
7271
AC_SUBST(WIN32_CRT_LIBS)
7164
7272
dnl Need to set this for make because NSS doesn't have configure
7165
7273
AC_SUBST(DLLFLAGS)
7167
7275
dnl We need to wrap dlopen and related functions on Android because we use
7168
7276
dnl our own linker.
7169
7277
if test "$OS_TARGET" = Android; then
7170
 
    WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozutils"
7171
 
    WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
 
7278
    WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue"
 
7279
    if test "$MOZ_WIDGET_TOOLKIT" = android; then
 
7280
        if test -n "$MOZ_OLD_LINKER"; then
 
7281
            WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
 
7282
        fi
 
7283
        WRAP_LDFLAGS="${WRAP_LDFLAGS} --wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
 
7284
    fi
7172
7285
fi
7173
7286
 
7174
7287
dnl ========================================================
7210
7323
fi
7211
7324
 
7212
7325
dnl ========================================================
7213
 
dnl = Use TraceVis
 
7326
dnl = Use incremental GC
7214
7327
dnl ========================================================
7215
 
MOZ_ARG_ENABLE_BOOL(tracevis,
7216
 
[  --enable-tracevis       Enable TraceVis tracing tool (default=no)],
7217
 
    MOZ_TRACEVIS=1,
7218
 
    MOZ_TRACEVIS= )
7219
 
if test -n "$MOZ_TRACEVIS"; then
7220
 
    AC_DEFINE(MOZ_TRACEVIS)
 
7328
JSGC_INCREMENTAL=1
 
7329
MOZ_ARG_DISABLE_BOOL(gcincremental,
 
7330
[  --disable-gcincremental Disable incremental GC],
 
7331
    JSGC_INCREMENTAL= )
 
7332
if test -n "$JSGC_INCREMENTAL"; then
 
7333
    AC_DEFINE(JSGC_INCREMENTAL)
7221
7334
fi
7222
7335
 
7223
7336
dnl ========================================================
7403
7516
AC_SUBST(STDCXX_COMPAT)
7404
7517
 
7405
7518
if test -n "$STDCXX_COMPAT"; then
7406
 
   eval $(CXX="$CXX" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
 
7519
   eval $(CXX="$CXX" MACOS_SDK_DIR="$MACOS_SDK_DIR" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
7407
7520
   AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
7408
7521
   AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
7409
7522
fi
7463
7576
    MOZ_QUANTIFY= )
7464
7577
 
7465
7578
dnl ========================================================
 
7579
dnl = Enable Radio Interface for B2G (Gonk usually)
 
7580
dnl ========================================================
 
7581
MOZ_ARG_ENABLE_BOOL(b2g-ril,
 
7582
[  --enable-b2g-ril      Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
 
7583
    MOZ_B2G_RIL=1,
 
7584
    MOZ_B2G_RIL= )
 
7585
if test -n "$MOZ_B2G_RIL"; then
 
7586
   AC_DEFINE(MOZ_B2G_RIL)
 
7587
fi
 
7588
AC_SUBST(MOZ_B2G_RIL)
 
7589
 
 
7590
dnl ========================================================
7466
7591
dnl = Support for demangling undefined symbols
7467
7592
dnl ========================================================
7468
7593
if test -z "$SKIP_LIBRARY_CHECKS"; then
7624
7749
dnl ========================================================
7625
7750
dnl Check for gcc -pipe support
7626
7751
dnl ========================================================
7627
 
AC_MSG_CHECKING([for gcc -pipe support])
7628
 
if test -n "$GNU_CC" -a -n "$GNU_CXX" -a -n "$GNU_AS"; then
7629
 
    echo '#include <stdio.h>' > dummy-hello.c
7630
 
    echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7631
 
    ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7632
 
    cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
7633
 
    if test $? = 0; then
7634
 
        _res_as_stdin="yes"
7635
 
    else
7636
 
        _res_as_stdin="no"
7637
 
    fi
7638
 
    if test "$_res_as_stdin" = "yes"; then
7639
 
        _SAVE_CFLAGS=$CFLAGS
7640
 
        CFLAGS="$CFLAGS -pipe"
7641
 
        AC_TRY_COMPILE( [ #include <stdio.h> ],
7642
 
            [printf("Hello World\n");],
7643
 
            [_res_gcc_pipe="yes"],
7644
 
            [_res_gcc_pipe="no"] )
7645
 
        CFLAGS=$_SAVE_CFLAGS
7646
 
    fi
7647
 
    if test "$_res_as_stdin" = "yes" -a "$_res_gcc_pipe" = "yes"; then
7648
 
        _res="yes";
7649
 
        CFLAGS="$CFLAGS -pipe"
7650
 
        CXXFLAGS="$CXXFLAGS -pipe"
7651
 
    else
7652
 
        _res="no"
7653
 
    fi
7654
 
    rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7655
 
    AC_MSG_RESULT([$_res])
 
7752
AC_MSG_CHECKING([for -pipe support])
 
7753
if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
 
7754
    dnl Any gcc that supports firefox supports -pipe.
 
7755
    CFLAGS="$CFLAGS -pipe"
 
7756
    CXXFLAGS="$CXXFLAGS -pipe"
 
7757
    AC_MSG_RESULT([yes])
7656
7758
else
7657
7759
    AC_MSG_RESULT([no])
7658
7760
fi
7710
7812
_PEDANTIC= )
7711
7813
if test "$_PEDANTIC"; then
7712
7814
    _SAVE_CXXFLAGS=$CXXFLAGS
7713
 
    CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
 
7815
    CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7714
7816
    AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7715
7817
    AC_TRY_COMPILE([$configure_static_assert_macros],
7716
7818
                   [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7720
7822
 
7721
7823
    case "$result" in
7722
7824
    no)
7723
 
        _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
7724
 
        _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
 
7825
        _WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long"
 
7826
        _WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7725
7827
        ;;
7726
7828
    yes)
7727
7829
        AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic.  Reconfigure using --disable-pedantic. ])
7942
8044
AC_SUBST(GLIB_GMODULE_LIBS)
7943
8045
 
7944
8046
dnl ========================================================
 
8047
dnl Graphics checks.
 
8048
dnl ========================================================
 
8049
 
 
8050
if test "${OS_ARCH}" = "Darwin" -o "${OS_TARGET}" = "Android"; then
 
8051
MOZ_ENABLE_SKIA=1
 
8052
else
 
8053
MOZ_ENABLE_SKIA=
 
8054
fi
 
8055
 
 
8056
MOZ_ARG_ENABLE_BOOL(skia,
 
8057
[  --enable-skia   Enable use of Skia],
 
8058
MOZ_ENABLE_SKIA=1,
 
8059
MOZ_ENABLE_SKIA=)
 
8060
 
 
8061
dnl ========================================================
7945
8062
dnl Check for cairo
7946
8063
dnl ========================================================
7947
8064
MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
8031
8148
      SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
8032
8149
    fi
8033
8150
 
8034
 
    PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
8035
 
 
8036
8151
    AC_SUBST(PS_SURFACE_FEATURE)
8037
8152
    AC_SUBST(PDF_SURFACE_FEATURE)
8038
8153
    AC_SUBST(SVG_SURFACE_FEATURE)
8103
8218
AC_SUBST(MOZ_HARFBUZZ_LIBS)
8104
8219
 
8105
8220
dnl ========================================================
 
8221
dnl SIL Graphite
 
8222
dnl ========================================================
 
8223
if test "$MOZ_GRAPHITE"; then
 
8224
  MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
 
8225
  AC_DEFINE(MOZ_GRAPHITE)
 
8226
else
 
8227
  MOZ_GRAPHITE_LIBS=
 
8228
fi
 
8229
AC_SUBST(MOZ_GRAPHITE)
 
8230
AC_SUBST(MOZ_GRAPHITE_LIBS)
 
8231
 
 
8232
dnl ========================================================
8106
8233
dnl OTS
8107
8234
dnl ========================================================
8108
8235
MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
8111
8238
dnl ========================================================
8112
8239
dnl Skia 
8113
8240
dnl ========================================================
8114
 
MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
 
8241
if test "$MOZ_ENABLE_SKIA"; then
 
8242
  MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
 
8243
  AC_DEFINE(MOZ_ENABLE_SKIA)
 
8244
else
 
8245
  MOZ_SKIA_LIBS=
 
8246
fi
 
8247
AC_SUBST(MOZ_ENABLE_SKIA)
8115
8248
AC_SUBST(MOZ_SKIA_LIBS)
8116
8249
 
8117
8250
dnl ========================================================
8328
8461
AC_SUBST(MOZ_UNIVERSALCHARDET)
8329
8462
AC_SUBST(ACCESSIBILITY)
8330
8463
AC_SUBST(MOZ_SPELLCHECK)
 
8464
AC_SUBST(MOZ_JAVA_COMPOSITOR)
8331
8465
AC_SUBST(MOZ_USER_DIR)
8332
8466
AC_SUBST(MOZ_CRASHREPORTER)
8333
8467
AC_SUBST(MOZ_UPDATER)
8340
8474
AC_SUBST(MOZ_D3DX9_DLL)
8341
8475
AC_SUBST(MOZ_D3DCOMPILER_DLL)
8342
8476
 
 
8477
AC_SUBST(MOZ_ANDROID_HISTORY)
8343
8478
AC_SUBST(ENABLE_STRIP)
8344
8479
AC_SUBST(PKG_SKIP_STRIP)
8345
8480
AC_SUBST(USE_ELF_DYNSTR_GC)
8395
8530
# - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
8396
8531
# Mac Bundle name, Updater, Installer), it is typically used for nightly
8397
8532
# builds (e.g. Aurora for Firefox).
 
8533
# - MOZ_APP_VERSION: Defines the application version number.
8398
8534
# - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
8399
8535
# defaults to a lowercase form of MOZ_APP_BASENAME.
8400
8536
# - MOZ_APP_PROFILE: When set, used for application.ini's
8401
8537
# "Profile" field, which controls profile location.
 
8538
# - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
 
8539
# crash reporter server url.
 
8540
# - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
 
8541
# - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.
8402
8542
 
8403
8543
if test -z "$MOZ_APP_NAME"; then
8404
8544
   MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
8409
8549
AC_SUBST(MOZ_APP_BASENAME)
8410
8550
AC_SUBST(MOZ_APP_VENDOR)
8411
8551
AC_SUBST(MOZ_APP_PROFILE)
 
8552
AC_SUBST(MOZ_APP_ID)
 
8553
AC_SUBST(MOZ_PROFILE_MIGRATOR)
 
8554
AC_SUBST(MOZ_EXTENSION_MANAGER)
8412
8555
AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
8413
8556
AC_SUBST(MOZ_APP_UA_NAME)
8414
8557
AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
8419
8562
AC_DEFINE_UNQUOTED(MOZ_UA_BUILDID, "$MOZ_UA_BUILDID")
8420
8563
AC_SUBST(MOZ_UA_BUILDID)
8421
8564
 
 
8565
# We can't use the static application.ini data when building against
 
8566
# a libxul SDK.
 
8567
if test -n "$LIBXUL_SDK"; then
 
8568
    MOZ_APP_STATIC_INI=
 
8569
fi
 
8570
AC_SUBST(MOZ_APP_STATIC_INI)
 
8571
 
8422
8572
AC_SUBST(MOZ_PKG_SPECIAL)
8423
8573
 
8424
8574
AC_SUBST(MOZILLA_OFFICIAL)
8638
8788
    if test "$COMPILE_ENVIRONMENT"; then
8639
8789
        _SAVE_CPPFLAGS="$CPPFLAGS"
8640
8790
        CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
8641
 
        AC_CHECK_HEADERS(fontconfig/fcfreetype.h, ,
8642
 
            [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)])
 
8791
        MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
 
8792
            [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
8643
8793
        CPPFLAGS="$_SAVE_CPPFLAGS"
8644
8794
    else
8645
8795
        AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
8695
8845
HAVE_CPP_AMBIGUITY_RESOLVING_USING
8696
8846
HAVE_CPP_CHAR16_T
8697
8847
HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8698
 
HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8699
8848
HAVE_CPP_PARTIAL_SPECIALIZATION
8700
8849
HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8701
8850
HAVE_STATVFS
8860
9009
   AC_OUTPUT_SUBDIRS(modules/freetype2)
8861
9010
fi
8862
9011
 
8863
 
dnl ========================================================
8864
 
dnl = Setup a nice relatively clean build environment for
8865
 
dnl = sub-configures.
8866
 
dnl ========================================================
8867
 
CC="$_SUBDIR_CC"
8868
 
CXX="$_SUBDIR_CXX"
8869
 
CFLAGS="$_SUBDIR_CFLAGS"
8870
 
CPPFLAGS="$_SUBDIR_CPPFLAGS"
8871
 
CXXFLAGS="$_SUBDIR_CXXFLAGS"
8872
 
LDFLAGS="$_SUBDIR_LDFLAGS"
8873
 
HOST_CC="$_SUBDIR_HOST_CC"
8874
 
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8875
 
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8876
 
RC=
 
9012
if test -z "$direct_nspr_config"; then
 
9013
    dnl ========================================================
 
9014
    dnl = Setup a nice relatively clean build environment for
 
9015
    dnl = sub-configures.
 
9016
    dnl ========================================================
 
9017
    CC="$_SUBDIR_CC"
 
9018
    CXX="$_SUBDIR_CXX"
 
9019
    CFLAGS="$_SUBDIR_CFLAGS"
 
9020
    CPPFLAGS="$_SUBDIR_CPPFLAGS"
 
9021
    CXXFLAGS="$_SUBDIR_CXXFLAGS"
 
9022
    LDFLAGS="$_SUBDIR_LDFLAGS"
 
9023
    HOST_CC="$_SUBDIR_HOST_CC"
 
9024
    HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
 
9025
    HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
 
9026
    RC=
 
9027
fi
8877
9028
 
8878
9029
unset MAKEFILES
8879
9030
unset CONFIG_FILES
8906
9057
    if test -n "$USE_ARM_KUSER"; then
8907
9058
        ac_configure_args="$ac_configure_args --with-arm-kuser"
8908
9059
    fi
 
9060
    if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a $ac_cv_func_dladdr = no ; then
 
9061
      # dladdr is supported by the new linker, even when the system linker doesn't
 
9062
      # support it. Trick nspr into using dladdr when it's not supported.
 
9063
      _SAVE_CPPFLAGS="$CPPFLAGS"
 
9064
      export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
 
9065
    fi
8909
9066
    AC_OUTPUT_SUBDIRS(nsprpub)
 
9067
    if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a $ac_cv_func_dladdr = no; then
 
9068
      unset CPPFLAGS
 
9069
      CPPFLAGS="$_SAVE_CFLAGS"
 
9070
    fi
8910
9071
    ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8911
9072
fi
8912
9073
 
8922
9083
    rm -f config/autoconf.mk.bak
8923
9084
fi
8924
9085
 
 
9086
if test -n "$direct_nspr_config"; then
 
9087
    dnl ========================================================
 
9088
    dnl = Setup a nice relatively clean build environment for
 
9089
    dnl = sub-configures.
 
9090
    dnl ========================================================
 
9091
    CC="$_SUBDIR_CC"
 
9092
    CXX="$_SUBDIR_CXX"
 
9093
    CFLAGS="$_SUBDIR_CFLAGS"
 
9094
    CPPFLAGS="$_SUBDIR_CPPFLAGS"
 
9095
    CXXFLAGS="$_SUBDIR_CXXFLAGS"
 
9096
    LDFLAGS="$_SUBDIR_LDFLAGS"
 
9097
    HOST_CC="$_SUBDIR_HOST_CC"
 
9098
    HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
 
9099
    HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
 
9100
    RC=
 
9101
fi
 
9102
 
8925
9103
# Run the SpiderMonkey 'configure' script.
8926
9104
dist=$MOZ_BUILD_ROOT/dist
8927
9105
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8942
9120
ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
8943
9121
if test "$MOZ_MEMORY"; then
8944
9122
   ac_configure_args="$ac_configure_args --enable-jemalloc"
8945
 
   if test -n "$MOZ_UTILS_LDFLAGS"; then
8946
 
     export MOZ_UTILS_LDFLAGS
 
9123
   if test -n "$MOZ_GLUE_LDFLAGS"; then
 
9124
     export MOZ_GLUE_LDFLAGS
8947
9125
   fi
8948
 
   if test -n "$MOZ_UTILS_PROGRAM_LDFLAGS"; then
8949
 
     export MOZ_UTILS_PROGRAM_LDFLAGS
 
9126
   if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then
 
9127
     export MOZ_GLUE_PROGRAM_LDFLAGS
8950
9128
   fi
8951
9129
fi
8952
9130
export MOZ_APP_NAME