203
203
if test -z "$MIDL"; then MIDL=midl; fi
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++)
294
MOZ_ARG_WITH_STRING(gonk,
296
location of gonk dir],
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
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
313
STLPORT_CPPFLAGS="-I$gonkdir/ndk/sources/cxx-stl/stlport/stlport/"
314
STLPORT_LIBS="-lstlport"
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"
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"
324
dnl prevent cross compile section from using these flags as host flags
325
if test -z "$HOST_CPPFLAGS" ; then
328
if test -z "$HOST_CFLAGS" ; then
331
if test -z "$HOST_CXXFLAGS" ; then
334
if test -z "$HOST_LDFLAGS" ; then
340
MOZ_CHROME_FILE_FORMAT=omni
292
344
case "$target" in
293
345
*-android*|*-linuxandroid*)
294
346
if test -z "$android_ndk" ; then
1708
1760
AC_SUBST(HAVE_ARM_SIMD)
1709
1761
AC_SUBST(HAVE_ARM_NEON)
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]
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,
1779
ac_cv_static_assertion_macros_work="yes"
1780
AC_TRY_COMPILE([$configure_static_assert_macros],
1781
[CONFIGURE_STATIC_ASSERT(1)],
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",
1789
AC_TRY_COMPILE([$configure_static_assert_macros],
1790
[CONFIGURE_STATIC_ASSERT(1)],
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",
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.])
1803
fi # COMPILE_ENVIRONMENT
1711
1805
dnl ========================================================
1712
1806
dnl Android libstdc++, placed here so it can use MOZ_ARCH
1713
1807
dnl computed above.
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
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
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"
1951
AC_CACHE_CHECK(whether the compiler supports -Wno-extended-offsetof,
1952
ac_has_wno_extended_offsetof,
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
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"
1968
if test "$ac_has_wno_extended_offsetof" = "yes"; then
1969
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-extended-offsetof"
1847
1972
AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1848
1973
ac_has_wno_invalid_offsetof,
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([],
1856
1981
ac_has_wno_invalid_offsetof="yes",
1859
1984
AC_LANG_RESTORE
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"
1865
1990
AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
1877
2002
AC_LANG_RESTORE
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"
1883
2008
AC_CACHE_CHECK(whether the compiler supports -Werror=return-type,
1943
2068
fi # COMPILE_ENVIRONMENT
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]
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,
1961
ac_cv_static_assertion_macros_work="yes"
1962
AC_TRY_COMPILE([$configure_static_assert_macros],
1963
[CONFIGURE_STATIC_ASSERT(1)],
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",
1971
AC_TRY_COMPILE([$configure_static_assert_macros],
1972
[CONFIGURE_STATIC_ASSERT(1)],
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",
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.])
1985
fi # COMPILE_ENVIRONMENT
1987
2070
dnl ========================================================
1988
2071
dnl Checking for 64-bit OS
1989
2072
dnl ========================================================
2034
2117
[--enable-valgrind specified but Valgrind is not installed]))
2035
2118
AC_DEFINE(MOZ_VALGRIND)
2038
2120
AC_SUBST(MOZ_VALGRIND)
2040
2122
dnl ========================================================
2124
dnl ========================================================
2125
MOZ_ARG_ENABLE_BOOL(dmd,
2126
[ --enable-dmd Enable DMD; also disables jemalloc (default=no)],
2129
if test -n "$MOZ_DMD"; then
2130
MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
2132
[--enable-dmd specified but Valgrind is not installed]))
2137
dnl ========================================================
2042
2139
dnl ========================================================
2043
2140
MOZ_ARG_ENABLE_BOOL(jprof,
2171
2268
AC_MSG_RESULT([yes])
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)
2278
AC_MSG_RESULT(none specified)
2173
2281
dnl Get mozilla version from central milestone file
2174
2282
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
2379
2487
*-android*|*-linuxandroid*)
2380
2488
AC_DEFINE(NO_PW_GECOS)
2382
_PLATFORM_DEFAULT_TOOLKIT=cairo-android
2490
if test -n "$gonkdir"; then
2491
_PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
2493
_PLATFORM_DEFAULT_TOOLKIT=cairo-android
2383
2496
TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2385
2498
MOZ_GFX_OPTIMIZE_MOBILE=1
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"
2592
2705
AC_DEFINE(HAVE_STDCALL)
2932
3047
AC_MSG_RESULT(no)
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>],
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)
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>],
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)
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>],
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)
2976
3052
AC_MSG_CHECKING(for int64)
2977
3053
AC_CACHE_VAL(ac_cv_int64,
2978
3054
[AC_TRY_COMPILE([#include <stdio.h>
3013
3089
AC_MSG_RESULT(no)
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)
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}"
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
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)
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])
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)])
4090
AC_CACHE_CHECK(for __attribute__((noreturn)),
4091
ac_cv_attribute_noreturn,
4092
[AC_TRY_COMPILE([void f(void) __attribute__((noreturn));],
4094
ac_cv_attribute_noreturn=yes,
4095
ac_cv_attribute_noreturn=no)])
4097
4148
dnl End of C++ language/feature checks
4149
4200
AC_DEFINE(NS_WARN_UNUSED_RESULT,)
4152
if test "$ac_cv_attribute_noreturn" = yes ; then
4153
AC_DEFINE(NS_NORETURN, [__attribute__((noreturn))])
4155
AC_DEFINE(NS_NORETURN,)
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.
4210
4255
_USE_SYSTEM_NSPR=1 )
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])])
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
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"],
4272
#error PR_UINT64 not defined or requires including prtypes.h
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
4227
4278
if test "$OS_ARCH" = "WINNT"; then
4284
4335
_USE_SYSTEM_NSS=1 )
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])])
4290
4341
if test -n "$MOZ_NATIVE_NSS"; then
4411
4462
ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4465
if test "$MOZ_LINKER" = 1 -a "$SYSTEM_ZLIB" != 1; then
4466
AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib])
4414
4469
dnl system BZIP2 Support
4415
4470
dnl ========================================================
4416
4471
MOZ_ARG_WITH_STRING(system-bz2,
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"
4770
4832
dnl nglayout only supports building with one toolkit,
4771
4833
dnl so ignore everything after the first comma (",").
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)'
4887
4950
MOZ_PDF_PRINTING=1
4888
4951
MOZ_INSTRUMENT_EVENT_LOOP=1
4952
if test "$MOZ_BUILD_APP" = "mobile/xul"; then
4959
AC_DEFINE(MOZ_WIDGET_GONK)
4960
MOZ_WIDGET_TOOLKIT=gonk
4961
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4962
TK_LIBS='$(MOZ_CAIRO_LIBS)'
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)
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)
5514
dnl ========================================================
5428
5515
dnl = Build Personal Security Manager
5429
5516
dnl ========================================================
5430
5517
MOZ_ARG_DISABLE_BOOL(crypto,
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
5930
Disable pref extensions such as autoconfig],
5844
5931
MOZ_PREF_EXTENSIONS=,
5845
5932
MOZ_PREF_EXTENSIONS=1 )
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)
7122
if test -n "$MOZ_DEBUG"; then
7123
AC_DEFINE(MOZ_DUMP_PAINTING)
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
7153
if test "$MOZ_DMD"; then
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
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)'
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"
7170
if test "$MOZ_LINKER" = 1; then
7171
MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $ZLIB_LIBS"
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"
7142
DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozutils"
7250
DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue"
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"
7283
WRAP_LDFLAGS="${WRAP_LDFLAGS} --wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
7174
7287
dnl ========================================================
7212
7325
dnl ========================================================
7326
dnl = Use incremental GC
7214
7327
dnl ========================================================
7215
MOZ_ARG_ENABLE_BOOL(tracevis,
7216
[ --enable-tracevis Enable TraceVis tracing tool (default=no)],
7219
if test -n "$MOZ_TRACEVIS"; then
7220
AC_DEFINE(MOZ_TRACEVIS)
7329
MOZ_ARG_DISABLE_BOOL(gcincremental,
7330
[ --disable-gcincremental Disable incremental GC],
7332
if test -n "$JSGC_INCREMENTAL"; then
7333
AC_DEFINE(JSGC_INCREMENTAL)
7223
7336
dnl ========================================================
7403
7516
AC_SUBST(STDCXX_COMPAT)
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)
7463
7576
MOZ_QUANTIFY= )
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 ],
7585
if test -n "$MOZ_B2G_RIL"; then
7586
AC_DEFINE(MOZ_B2G_RIL)
7588
AC_SUBST(MOZ_B2G_RIL)
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
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
7647
if test "$_res_as_stdin" = "yes" -a "$_res_gcc_pipe" = "yes"; then
7649
CFLAGS="$CFLAGS -pipe"
7650
CXXFLAGS="$CXXFLAGS -pipe"
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])
7657
7759
AC_MSG_RESULT([no])
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)],
7721
7823
case "$result" in
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"
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)
7944
8046
dnl ========================================================
8047
dnl Graphics checks.
8048
dnl ========================================================
8050
if test "${OS_ARCH}" = "Darwin" -o "${OS_TARGET}" = "Android"; then
8056
MOZ_ARG_ENABLE_BOOL(skia,
8057
[ --enable-skia Enable use of Skia],
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"
8034
PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
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)
8105
8220
dnl ========================================================
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)
8229
AC_SUBST(MOZ_GRAPHITE)
8230
AC_SUBST(MOZ_GRAPHITE_LIBS)
8232
dnl ========================================================
8107
8234
dnl ========================================================
8108
8235
MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
8111
8238
dnl ========================================================
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)
8247
AC_SUBST(MOZ_ENABLE_SKIA)
8115
8248
AC_SUBST(MOZ_SKIA_LIBS)
8117
8250
dnl ========================================================
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.
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)
8565
# We can't use the static application.ini data when building against
8567
if test -n "$LIBXUL_SDK"; then
8570
AC_SUBST(MOZ_APP_STATIC_INI)
8422
8572
AC_SUBST(MOZ_PKG_SPECIAL)
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"
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
8860
9009
AC_OUTPUT_SUBDIRS(modules/freetype2)
8863
dnl ========================================================
8864
dnl = Setup a nice relatively clean build environment for
8865
dnl = sub-configures.
8866
dnl ========================================================
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"
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 ========================================================
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"
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"
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"
8909
9066
AC_OUTPUT_SUBDIRS(nsprpub)
9067
if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a $ac_cv_func_dladdr = no; then
9069
CPPFLAGS="$_SAVE_CFLAGS"
8910
9071
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8922
9083
rm -f config/autoconf.mk.bak
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 ========================================================
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"
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
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
8952
9130
export MOZ_APP_NAME