|
1 |
|
2 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*- |
|
3 dnl vi: set tabstop=4 shiftwidth=4 expandtab syntax=m4: |
|
4 dnl This Source Code Form is subject to the terms of the Mozilla Public |
|
5 dnl License, v. 2.0. If a copy of the MPL was not distributed with this |
|
6 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
7 |
|
8 dnl Process this file with autoconf to produce a configure script. |
|
9 dnl ======================================================== |
|
10 |
|
11 AC_PREREQ(2.13) |
|
12 AC_INIT(config/config.mk) |
|
13 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf) |
|
14 AC_CANONICAL_SYSTEM |
|
15 TARGET_CPU="${target_cpu}" |
|
16 TARGET_VENDOR="${target_vendor}" |
|
17 TARGET_OS="${target_os}" |
|
18 |
|
19 dnl ======================================================== |
|
20 dnl = |
|
21 dnl = Don't change the following two lines. Doing so breaks: |
|
22 dnl = |
|
23 dnl = CFLAGS="-foo" ./configure |
|
24 dnl = |
|
25 dnl ======================================================== |
|
26 CFLAGS="${CFLAGS=}" |
|
27 CPPFLAGS="${CPPFLAGS=}" |
|
28 CXXFLAGS="${CXXFLAGS=}" |
|
29 LDFLAGS="${LDFLAGS=}" |
|
30 HOST_CFLAGS="${HOST_CFLAGS=}" |
|
31 HOST_CXXFLAGS="${HOST_CXXFLAGS=}" |
|
32 HOST_LDFLAGS="${HOST_LDFLAGS=}" |
|
33 |
|
34 dnl ======================================================== |
|
35 dnl = Preserve certain environment flags passed to configure |
|
36 dnl = We want sub projects to receive the same flags |
|
37 dnl = untainted by this configure script |
|
38 dnl ======================================================== |
|
39 _SUBDIR_CC="$CC" |
|
40 _SUBDIR_CXX="$CXX" |
|
41 _SUBDIR_CFLAGS="$CFLAGS" |
|
42 _SUBDIR_CPPFLAGS="$CPPFLAGS" |
|
43 _SUBDIR_CXXFLAGS="$CXXFLAGS" |
|
44 _SUBDIR_LDFLAGS="$LDFLAGS" |
|
45 _SUBDIR_HOST_CC="$HOST_CC" |
|
46 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS" |
|
47 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS" |
|
48 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS" |
|
49 _SUBDIR_CONFIG_ARGS="$ac_configure_args" |
|
50 |
|
51 dnl Set the version number of the libs included with mozilla |
|
52 dnl ======================================================== |
|
53 MOZJPEG=62 |
|
54 MOZPNG=10610 |
|
55 NSPR_VERSION=4 |
|
56 NSS_VERSION=3 |
|
57 |
|
58 dnl Set the minimum version of toolkit libs used by mozilla |
|
59 dnl ======================================================== |
|
60 GLIB_VERSION=1.2.0 |
|
61 PERL_VERSION=5.006 |
|
62 CAIRO_VERSION=1.10 |
|
63 PANGO_VERSION=1.22.0 |
|
64 GTK2_VERSION=2.10.0 |
|
65 GTK3_VERSION=3.0.0 |
|
66 WINDRES_VERSION=2.14.90 |
|
67 W32API_VERSION=3.14 |
|
68 GNOMEVFS_VERSION=2.0 |
|
69 GNOMEUI_VERSION=2.2.0 |
|
70 GCONF_VERSION=1.2.1 |
|
71 GIO_VERSION=2.20 |
|
72 STARTUP_NOTIFICATION_VERSION=0.8 |
|
73 DBUS_VERSION=0.60 |
|
74 SQLITE_VERSION=3.8.4.2 |
|
75 |
|
76 MSMANIFEST_TOOL= |
|
77 |
|
78 dnl Set various checks |
|
79 dnl ======================================================== |
|
80 MISSING_X= |
|
81 AC_PROG_AWK |
|
82 |
|
83 dnl Initialize the Pthread test variables early so they can be |
|
84 dnl overridden by each platform. |
|
85 dnl ======================================================== |
|
86 MOZ_USE_PTHREADS= |
|
87 _PTHREAD_LDFLAGS="" |
|
88 |
|
89 dnl Do not allow objdir == srcdir builds. |
|
90 dnl ============================================================== |
|
91 _topsrcdir=`cd \`dirname $0\`; pwd` |
|
92 _objdir=`pwd` |
|
93 |
|
94 |
|
95 dnl TODO Don't exempt L10N builds once bug 842760 is resolved. |
|
96 if test "$_topsrcdir" = "$_objdir" -a "${with_l10n_base+set}" != set; then |
|
97 echo " ***" |
|
98 echo " * Building directly in the main source directory is not allowed." |
|
99 echo " *" |
|
100 echo " * To build, you must run configure from a separate directory" |
|
101 echo " * (referred to as an object directory)." |
|
102 echo " *" |
|
103 echo " * If you are building with a mozconfig, you will need to change your" |
|
104 echo " * mozconfig to point to a different object directory." |
|
105 echo " ***" |
|
106 exit 1 |
|
107 fi |
|
108 |
|
109 # Check for a couple representative files in the source tree |
|
110 _conflict_files= |
|
111 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do |
|
112 if test -f $file; then |
|
113 _conflict_files="$_conflict_files $file" |
|
114 fi |
|
115 done |
|
116 if test "$_conflict_files"; then |
|
117 echo "***" |
|
118 echo "* Your source tree contains these files:" |
|
119 for file in $_conflict_files; do |
|
120 echo "* $file" |
|
121 done |
|
122 cat 1>&2 <<-EOF |
|
123 * This indicates that you previously built in the source tree. |
|
124 * A source tree build can confuse the separate objdir build. |
|
125 * |
|
126 * To clean up the source tree: |
|
127 * 1. cd $_topsrcdir |
|
128 * 2. gmake distclean |
|
129 *** |
|
130 EOF |
|
131 exit 1 |
|
132 break |
|
133 fi |
|
134 MOZ_BUILD_ROOT=`pwd` |
|
135 |
|
136 MOZ_PYTHON |
|
137 |
|
138 MOZ_DEFAULT_COMPILER |
|
139 |
|
140 COMPILE_ENVIRONMENT=1 |
|
141 MOZ_ARG_DISABLE_BOOL(compile-environment, |
|
142 [ --disable-compile-environment |
|
143 Disable compiler/library checks.], |
|
144 COMPILE_ENVIRONMENT= ) |
|
145 AC_SUBST(COMPILE_ENVIRONMENT) |
|
146 |
|
147 MOZ_ARG_WITH_STRING(l10n-base, |
|
148 [ --with-l10n-base=DIR path to l10n repositories], |
|
149 L10NBASEDIR=$withval) |
|
150 if test -n "$L10NBASEDIR"; then |
|
151 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then |
|
152 AC_MSG_ERROR([--with-l10n-base must specify a path]) |
|
153 elif test -d "$L10NBASEDIR"; then |
|
154 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd` |
|
155 else |
|
156 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist]) |
|
157 fi |
|
158 fi |
|
159 AC_SUBST(L10NBASEDIR) |
|
160 |
|
161 dnl Check for Perl first -- needed for win32 SDK checks |
|
162 MOZ_PATH_PROGS(PERL, $PERL perl5 perl ) |
|
163 if test -z "$PERL" -o "$PERL" = ":"; then |
|
164 AC_MSG_ERROR([perl not found in \$PATH]) |
|
165 fi |
|
166 |
|
167 if test -n "$GAIADIR" -a ! -d "$GAIADIR" ; then |
|
168 AC_MSG_ERROR([GAIADIR '$GAIADIR' isn't a valid directory]) |
|
169 fi |
|
170 |
|
171 AC_SUBST(GAIADIR) |
|
172 if test -n "$GAIADIR" ; then |
|
173 AC_DEFINE(PACKAGE_GAIA) |
|
174 fi |
|
175 |
|
176 if test -n "$FXOS_SIMULATOR" -a -z "$GAIADIR" ; then |
|
177 AC_MSG_ERROR([FXOS_SIMULATOR=1 requires GAIADIR to be defined]) |
|
178 fi |
|
179 |
|
180 if test -n "$FXOS_SIMULATOR" ; then |
|
181 AC_DEFINE(FXOS_SIMULATOR) |
|
182 AC_SUBST(FXOS_SIMULATOR) |
|
183 fi |
|
184 |
|
185 MOZ_ARG_WITH_STRING(gonk, |
|
186 [ --with-gonk=DIR |
|
187 location of gonk dir], |
|
188 gonkdir=$withval) |
|
189 |
|
190 MOZ_ARG_WITH_STRING(gonk-toolchain-prefix, |
|
191 [ --with-gonk-toolchain-prefix=DIR |
|
192 prefix to gonk toolchain commands], |
|
193 gonk_toolchain_prefix=$withval) |
|
194 |
|
195 if test -n "$gonkdir" ; then |
|
196 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"` |
|
197 android_source="$gonkdir" |
|
198 ANDROID_SOURCE="$android_source" |
|
199 ANDROID_NDK="${ANDROID_SOURCE}/ndk" |
|
200 dnl Default to ICS |
|
201 ANDROID_VERSION=15 |
|
202 if test -n "${PLATFORM_SDK_VERSION}"; then |
|
203 ANDROID_VERSION="${PLATFORM_SDK_VERSION}" |
|
204 fi |
|
205 |
|
206 dnl set up compilers |
|
207 TOOLCHAIN_PREFIX="$gonk_toolchain_prefix" |
|
208 AS="$gonk_toolchain_prefix"as |
|
209 CC="$gonk_toolchain_prefix"gcc |
|
210 CXX="$gonk_toolchain_prefix"g++ |
|
211 CPP="$gonk_toolchain_prefix"cpp |
|
212 LD="$gonk_toolchain_prefix"ld |
|
213 AR="$gonk_toolchain_prefix"ar |
|
214 RANLIB="$gonk_toolchain_prefix"ranlib |
|
215 STRIP="$gonk_toolchain_prefix"strip |
|
216 OBJCOPY="$gonk_toolchain_prefix"objcopy |
|
217 |
|
218 if ! test -e "$gonkdir/ndk/sources/cxx-stl/stlport/src/iostream.cpp"; then |
|
219 AC_MSG_ERROR([Couldn't find path to stlport sources in the gonk tree]) |
|
220 fi |
|
221 STLPORT_CPPFLAGS="-I$_topsrcdir/build/stlport/stlport -I$gonkdir/ndk/sources/cxx-stl/system/include" |
|
222 STLPORT_LIBS="$_objdir/build/stlport/libstlport_static.a" |
|
223 |
|
224 case "$target_cpu" in |
|
225 arm) |
|
226 ARCH_DIR=arch-arm |
|
227 ;; |
|
228 i?86) |
|
229 ARCH_DIR=arch-x86 |
|
230 ;; |
|
231 esac |
|
232 |
|
233 case "$ANDROID_VERSION" in |
|
234 15) |
|
235 GONK_INCLUDES="-I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/frameworks/base/include -I$gonkdir/frameworks/base/services/camera -I$gonkdir/frameworks/base/include/media/ -I$gonkdir/frameworks/base/include/media/stagefright -I$gonkdir/frameworks/base/include/media/stagefright/openmax -I$gonkdir/frameworks/base/media/libstagefright/rtsp -I$gonkdir/frameworks/base/media/libstagefright/include -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib -I$gonkdir/dalvik/libnativehelper/include/nativehelper" |
|
236 MOZ_B2G_BT=1 |
|
237 MOZ_B2G_BT_BLUEZ=1 |
|
238 MOZ_NFC=1 |
|
239 MOZ_B2G_CAMERA=1 |
|
240 MOZ_OMX_DECODER=1 |
|
241 AC_SUBST(MOZ_OMX_DECODER) |
|
242 MOZ_RTSP=1 |
|
243 ;; |
|
244 17|18) |
|
245 GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include" |
|
246 if test -d "$gonkdir/external/bluetooth/bluez"; then |
|
247 GONK_INCLUDES="$GONK_INCLUDES -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib" |
|
248 MOZ_B2G_BT=1 |
|
249 MOZ_B2G_BT_BLUEZ=1 |
|
250 elif test -d "$gonkdir/external/bluetooth/bluedroid"; then |
|
251 MOZ_B2G_BT=1 |
|
252 MOZ_B2G_BT_BLUEDROID=1 |
|
253 fi |
|
254 |
|
255 MOZ_RTSP=1 |
|
256 MOZ_NFC=1 |
|
257 MOZ_B2G_CAMERA=1 |
|
258 MOZ_OMX_DECODER=1 |
|
259 AC_SUBST(MOZ_OMX_DECODER) |
|
260 MOZ_OMX_ENCODER=1 |
|
261 AC_SUBST(MOZ_OMX_ENCODER) |
|
262 AC_DEFINE(MOZ_OMX_ENCODER) |
|
263 ;; |
|
264 19) |
|
265 GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include" |
|
266 MOZ_B2G_CAMERA=1 |
|
267 MOZ_B2G_BT=1 |
|
268 MOZ_B2G_BT_BLUEDROID=1 |
|
269 MOZ_NFC=1 |
|
270 MOZ_RTSP=1 |
|
271 MOZ_OMX_DECODER=1 |
|
272 MOZ_OMX_ENCODER=1 |
|
273 AC_DEFINE(MOZ_OMX_ENCODER) |
|
274 MOZ_AUDIO_OFFLOAD=1 |
|
275 AC_SUBST(MOZ_AUDIO_OFFLOAD) |
|
276 AC_DEFINE(MOZ_AUDIO_OFFLOAD) |
|
277 |
|
278 ;; |
|
279 *) |
|
280 AC_MSG_ERROR([Unsupported platform version: $ANDROID_VERSION]) |
|
281 ;; |
|
282 esac |
|
283 CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/hardware/libhardware/include -I$gonkdir/external/valgrind/fxos-include $GONK_INCLUDES $CPPFLAGS" |
|
284 CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS" |
|
285 CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS $STLPORT_CPPFLAGS" |
|
286 dnl Add -llog by default, since we use it all over the place. |
|
287 LIBS="$LIBS -llog" |
|
288 |
|
289 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/ $LDFLAGS" |
|
290 |
|
291 dnl prevent cross compile section from using these flags as host flags |
|
292 if test -z "$HOST_CPPFLAGS" ; then |
|
293 HOST_CPPFLAGS=" " |
|
294 fi |
|
295 if test -z "$HOST_CFLAGS" ; then |
|
296 HOST_CFLAGS=" " |
|
297 fi |
|
298 if test -z "$HOST_CXXFLAGS" ; then |
|
299 HOST_CXXFLAGS=" " |
|
300 fi |
|
301 if test -z "$HOST_LDFLAGS" ; then |
|
302 HOST_LDFLAGS=" " |
|
303 fi |
|
304 |
|
305 AC_DEFINE(ANDROID) |
|
306 AC_DEFINE_UNQUOTED(ANDROID_VERSION, $ANDROID_VERSION) |
|
307 AC_SUBST(ANDROID_VERSION) |
|
308 AC_DEFINE(HAVE_SYS_UIO_H) |
|
309 AC_DEFINE(HAVE_PTHREADS) |
|
310 MOZ_CHROME_FILE_FORMAT=omni |
|
311 direct_nspr_config=1 |
|
312 else |
|
313 MOZ_ANDROID_NDK |
|
314 |
|
315 case "$target" in |
|
316 *-android*|*-linuxandroid*) |
|
317 if test -z "$ANDROID_PACKAGE_NAME" ; then |
|
318 ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)' |
|
319 fi |
|
320 MOZ_CHROME_FILE_FORMAT=omni |
|
321 ZLIB_DIR=yes |
|
322 ;; |
|
323 *-linux*) |
|
324 AC_PATH_PROG(OBJCOPY,objcopy) |
|
325 ;; |
|
326 esac |
|
327 fi |
|
328 |
|
329 AC_SUBST(ANDROID_SOURCE) |
|
330 AC_SUBST(ANDROID_PACKAGE_NAME) |
|
331 AC_SUBST(OBJCOPY) |
|
332 |
|
333 dnl ======================================================== |
|
334 dnl Checks for compilers. |
|
335 dnl ======================================================== |
|
336 |
|
337 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269) |
|
338 AR_FLAGS='crs $@' |
|
339 |
|
340 if test "$COMPILE_ENVIRONMENT"; then |
|
341 |
|
342 if test "$target" != "$host"; then |
|
343 MOZ_CROSS_COMPILER |
|
344 else |
|
345 AC_PROG_CC |
|
346 case "$target" in |
|
347 *-mingw*) |
|
348 # Work around the conftest.exe access problem on Windows |
|
349 sleep 2 |
|
350 esac |
|
351 AC_PROG_CXX |
|
352 AC_PROG_RANLIB |
|
353 MOZ_PATH_PROGS(AS, $AS as, $CC) |
|
354 AC_CHECK_PROGS(AR, ar, :) |
|
355 AC_CHECK_PROGS(LD, ld, :) |
|
356 AC_CHECK_PROGS(STRIP, strip, :) |
|
357 AC_CHECK_PROGS(WINDRES, windres, :) |
|
358 if test -z "$HOST_CC"; then |
|
359 HOST_CC="$CC" |
|
360 fi |
|
361 if test -z "$HOST_CFLAGS"; then |
|
362 HOST_CFLAGS="$CFLAGS" |
|
363 fi |
|
364 if test -z "$HOST_CXX"; then |
|
365 HOST_CXX="$CXX" |
|
366 fi |
|
367 if test -z "$HOST_CXXFLAGS"; then |
|
368 HOST_CXXFLAGS="$CXXFLAGS" |
|
369 fi |
|
370 if test -z "$HOST_LDFLAGS"; then |
|
371 HOST_LDFLAGS="$LDFLAGS" |
|
372 fi |
|
373 if test -z "$HOST_RANLIB"; then |
|
374 HOST_RANLIB="$RANLIB" |
|
375 fi |
|
376 if test -z "$HOST_AR"; then |
|
377 HOST_AR="$AR" |
|
378 fi |
|
379 if test -z "$HOST_AR_FLAGS"; then |
|
380 HOST_AR_FLAGS="$AR_FLAGS" |
|
381 fi |
|
382 fi |
|
383 |
|
384 if test -n "$MOZ_WINCONSOLE"; then |
|
385 AC_DEFINE(MOZ_WINCONSOLE) |
|
386 fi |
|
387 |
|
388 MOZ_TOOL_VARIABLES |
|
389 |
|
390 MOZ_CHECK_COMPILER_WRAPPER |
|
391 |
|
392 if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then |
|
393 if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 4 || |
|
394 test "$GCC_MAJOR_VERSION" -lt 4; then |
|
395 AC_MSG_ERROR([Only GCC 4.4 or newer supported]) |
|
396 fi |
|
397 fi |
|
398 |
|
399 dnl ======================================================== |
|
400 dnl Special win32 checks |
|
401 dnl ======================================================== |
|
402 |
|
403 MOZ_ARG_ENABLE_BOOL(metro, |
|
404 [ --enable-metro Enable Windows Metro build targets], |
|
405 MOZ_METRO=1, |
|
406 MOZ_METRO=) |
|
407 if test -n "$MOZ_METRO"; then |
|
408 AC_DEFINE(MOZ_METRO) |
|
409 # Target the Windows 8 Kit |
|
410 WINSDK_TARGETVER=602 |
|
411 WINVER=502 |
|
412 # toolkit/library/makefile.in needs these, see nsDllMain. |
|
413 CRTDLLVERSION=110 |
|
414 CRTEXPDLLVERSION=1-1-0 |
|
415 else |
|
416 # Target the Windows 7 SDK by default |
|
417 WINSDK_TARGETVER=601 |
|
418 WINVER=502 |
|
419 fi |
|
420 |
|
421 AC_SUBST(CRTDLLVERSION) |
|
422 AC_SUBST(CRTEXPDLLVERSION) |
|
423 |
|
424 MOZ_ARG_WITH_STRING(windows-version, |
|
425 [ --with-windows-version=WINSDK_TARGETVER |
|
426 Windows SDK version to target. Lowest version |
|
427 currently allowed is 601 (Win7), highest is 602 (Win8)], |
|
428 WINSDK_TARGETVER=$withval) |
|
429 |
|
430 # Currently only two sdk versions allowed, 601 and 602 |
|
431 case "$WINSDK_TARGETVER" in |
|
432 601|602) |
|
433 MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000 |
|
434 ;; |
|
435 |
|
436 *) |
|
437 AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER)]); |
|
438 ;; |
|
439 esac |
|
440 |
|
441 case "$target" in |
|
442 *-mingw*) |
|
443 if test "$GCC" != "yes" -a -z "$CLANG_CC"; then |
|
444 # Check to see if we are really running in a msvc environemnt |
|
445 _WIN32_MSVC=1 |
|
446 AC_CHECK_PROGS(MIDL, midl) |
|
447 |
|
448 # Make sure compilers are valid |
|
449 CFLAGS="$CFLAGS -TC -nologo" |
|
450 CXXFLAGS="$CXXFLAGS -TP -nologo" |
|
451 AC_LANG_SAVE |
|
452 AC_LANG_C |
|
453 AC_TRY_COMPILE([#include <stdio.h>], |
|
454 [ printf("Hello World\n"); ],, |
|
455 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) ) |
|
456 |
|
457 AC_LANG_CPLUSPLUS |
|
458 AC_TRY_COMPILE([#include <new.h>], |
|
459 [ unsigned *test = new unsigned(42); ],, |
|
460 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) ) |
|
461 AC_LANG_RESTORE |
|
462 |
|
463 changequote(,) |
|
464 _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p' |
|
465 changequote([,]) |
|
466 |
|
467 # Determine compiler version |
|
468 CC_VERSION=`${CC} -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"` |
|
469 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'` |
|
470 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'` |
|
471 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'` |
|
472 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'` |
|
473 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION} |
|
474 |
|
475 CXX_VERSION=`${CXX} -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"` |
|
476 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'` |
|
477 |
|
478 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then |
|
479 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.]) |
|
480 fi |
|
481 |
|
482 AC_DEFINE(_CRT_SECURE_NO_WARNINGS) |
|
483 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS) |
|
484 |
|
485 if test "$_CC_MAJOR_VERSION" = "16"; then |
|
486 _CC_SUITE=10 |
|
487 MSVS_VERSION=2010 |
|
488 elif test "$_CC_MAJOR_VERSION" = "17"; then |
|
489 _CC_SUITE=11 |
|
490 MSVS_VERSION=2012 |
|
491 elif test "$_CC_MAJOR_VERSION" = "18"; then |
|
492 _CC_SUITE=12 |
|
493 MSVS_VERSION=2013 |
|
494 else |
|
495 AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.]) |
|
496 fi |
|
497 AC_SUBST(MSVS_VERSION) |
|
498 |
|
499 AC_DEFINE(HAVE_SEH_EXCEPTIONS) |
|
500 |
|
501 if test -n "$WIN32_REDIST_DIR"; then |
|
502 if test ! -d "$WIN32_REDIST_DIR"; then |
|
503 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}]) |
|
504 fi |
|
505 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd` |
|
506 fi |
|
507 |
|
508 dnl Confirm we have the pri tools on win8 builds |
|
509 if test -n "$MOZ_METRO"; then |
|
510 AC_MSG_CHECKING([for makepri]) |
|
511 AC_CHECK_PROGS(MAKEPRI, makepri, "") |
|
512 if test -z "MAKEPRI" ; then |
|
513 AC_MSG_ERROR([makepri.exe is required for generating metro browser install components. It should be in the Win8 SDK.]) |
|
514 fi |
|
515 AC_SUBST(MAKEPRI) |
|
516 fi |
|
517 |
|
518 dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool', |
|
519 dnl not something else like "magnetic tape manipulation utility". |
|
520 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'` |
|
521 if test -z "$MSMT_TOOL"; then |
|
522 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.]) |
|
523 fi |
|
524 |
|
525 changequote(,) |
|
526 _MSMT_VER_FILTER='s|.*[^!-~]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p' |
|
527 changequote([,]) |
|
528 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"` |
|
529 if test -z "$MSMANIFEST_TOOL_VERSION"; then |
|
530 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.]) |
|
531 fi |
|
532 |
|
533 MSMANIFEST_TOOL=1 |
|
534 unset MSMT_TOOL |
|
535 |
|
536 # Check linker version |
|
537 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"` |
|
538 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'` |
|
539 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then |
|
540 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.]) |
|
541 fi |
|
542 |
|
543 INCREMENTAL_LINKER=1 |
|
544 |
|
545 # Set midl environment |
|
546 case "$target" in |
|
547 i*86-*) |
|
548 MIDL_FLAGS="${MIDL_FLAGS} -env win32" |
|
549 ;; |
|
550 x86_64-*) |
|
551 MIDL_FLAGS="${MIDL_FLAGS} -env x64" |
|
552 ;; |
|
553 esac |
|
554 |
|
555 unset _MSVC_VER_FILTER |
|
556 |
|
557 AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw, |
|
558 [ |
|
559 AC_LANG_SAVE |
|
560 AC_LANG_CPLUSPLUS |
|
561 _SAVE_CXXFLAGS="$CXXFLAGS" |
|
562 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" |
|
563 AC_TRY_COMPILE([#include <exception>], |
|
564 [std::_Throw(std::exception()); return 0;], |
|
565 ac_cv_have_std__Throw="yes", |
|
566 ac_cv_have_std__Throw="no") |
|
567 CXXFLAGS="$_SAVE_CXXFLAGS" |
|
568 AC_LANG_RESTORE |
|
569 ]) |
|
570 |
|
571 if test "$ac_cv_have_std__Throw" = "yes"; then |
|
572 AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug, |
|
573 ac_cv_have_dllimport_exception_bug, |
|
574 [ |
|
575 AC_LANG_SAVE |
|
576 AC_LANG_CPLUSPLUS |
|
577 _SAVE_CXXFLAGS="$CXXFLAGS" |
|
578 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" |
|
579 AC_TRY_LINK([#include <vector>], |
|
580 [std::vector<int> v; return v.at(1);], |
|
581 ac_cv_have_dllimport_exception_bug="no", |
|
582 ac_cv_have_dllimport_exception_bug="yes") |
|
583 CXXFLAGS="$_SAVE_CXXFLAGS" |
|
584 AC_LANG_RESTORE |
|
585 ]) |
|
586 if test "$ac_cv_have_dllimport_exception_bug" = "no"; then |
|
587 WRAP_STL_INCLUDES=1 |
|
588 MOZ_MSVC_STL_WRAP__Throw=1 |
|
589 AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw) |
|
590 fi |
|
591 else |
|
592 AC_CACHE_CHECK(for overridable _RAISE, |
|
593 ac_cv_have__RAISE, |
|
594 [ |
|
595 AC_LANG_SAVE |
|
596 AC_LANG_CPLUSPLUS |
|
597 _SAVE_CXXFLAGS="$CXXFLAGS" |
|
598 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0" |
|
599 AC_TRY_COMPILE([#include <xstddef> |
|
600 #undef _RAISE |
|
601 #define _RAISE(x) externallyDefinedFunction((x).what()) |
|
602 #include <vector> |
|
603 ], |
|
604 [std::vector<int> v; return v.at(1);], |
|
605 ac_cv_have__RAISE="no", |
|
606 ac_cv_have__RAISE="yes") |
|
607 CXXFLAGS="$_SAVE_CXXFLAGS" |
|
608 AC_LANG_RESTORE |
|
609 ]) |
|
610 if test "$ac_cv_have__RAISE" = "yes"; then |
|
611 WRAP_STL_INCLUDES=1 |
|
612 MOZ_MSVC_STL_WRAP__RAISE=1 |
|
613 AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE) |
|
614 else |
|
615 AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.]) |
|
616 fi |
|
617 fi |
|
618 |
|
619 if test "$WRAP_STL_INCLUDES" = "1"; then |
|
620 STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers' |
|
621 fi |
|
622 elif test -z "$CLANG_CC"; then |
|
623 # Check w32api version |
|
624 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'` |
|
625 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'` |
|
626 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION]) |
|
627 AC_TRY_COMPILE([#include <w32api.h>], |
|
628 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \ |
|
629 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \ |
|
630 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION) |
|
631 #error "test failed." |
|
632 #endif |
|
633 , [ res=yes ], [ res=no ]) |
|
634 AC_MSG_RESULT([$res]) |
|
635 if test "$res" != "yes"; then |
|
636 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.]) |
|
637 fi |
|
638 # Check windres version |
|
639 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION]) |
|
640 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'` |
|
641 AC_MSG_RESULT([$_WINDRES_VERSION]) |
|
642 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'` |
|
643 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'` |
|
644 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'` |
|
645 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'` |
|
646 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'` |
|
647 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'` |
|
648 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \ |
|
649 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \ |
|
650 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \ |
|
651 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \ |
|
652 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \ |
|
653 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION" |
|
654 then |
|
655 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.]) |
|
656 fi |
|
657 |
|
658 AC_CHECK_PROGS(MIDL, $target-widl widl) |
|
659 if test -n "$MIDL"; then |
|
660 case "$target" in |
|
661 i*86-*) |
|
662 MIDL_FLAGS="$MIDL_FLAGS --win32 -m32" |
|
663 ;; |
|
664 x86_64-*) |
|
665 MIDL_FLAGS="$MIDL_FLAGS --win64 -m64" |
|
666 ;; |
|
667 esac |
|
668 fi |
|
669 |
|
670 # strsafe.h on mingw uses macros for function deprecation that pollutes namespace |
|
671 # causing problems with local implementations with the same name. |
|
672 AC_DEFINE(STRSAFE_NO_DEPRECATE) |
|
673 |
|
674 MOZ_WINSDK_MAXVER=0x06020000 |
|
675 fi # !GNU_CC |
|
676 |
|
677 # If MSVC or clang |
|
678 if test "$GCC" != "yes" -o -n "$CLANG_CC" ; then |
|
679 MOZ_FIND_WINSDK_VERSION |
|
680 fi |
|
681 |
|
682 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER) |
|
683 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER) |
|
684 # Require OS features provided by IE 6.0 SP2 (XP SP2) |
|
685 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0603) |
|
686 |
|
687 # If the maximum version supported by this SDK is lower than the target |
|
688 # version, error out |
|
689 AC_MSG_CHECKING([for Windows SDK being recent enough]) |
|
690 if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then |
|
691 AC_MSG_RESULT("yes") |
|
692 else |
|
693 AC_MSG_RESULT("no") |
|
694 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.]) |
|
695 fi |
|
696 |
|
697 AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER) |
|
698 # Definitions matching sdkddkver.h |
|
699 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000) |
|
700 AC_DEFINE_UNQUOTED(MOZ_WINSDK_MAXVER,$MOZ_WINSDK_MAXVER) |
|
701 AC_SUBST(MOZ_WINSDK_MAXVER) |
|
702 ;; |
|
703 esac |
|
704 |
|
705 AC_PROG_CPP |
|
706 AC_PROG_CXXCPP |
|
707 |
|
708 if test -n "$_WIN32_MSVC"; then |
|
709 SKIP_PATH_CHECKS=1 |
|
710 SKIP_COMPILER_CHECKS=1 |
|
711 SKIP_LIBRARY_CHECKS=1 |
|
712 |
|
713 # Since we're skipping compiler and library checks, hard-code |
|
714 # some facts here. |
|
715 AC_DEFINE(HAVE_IO_H) |
|
716 AC_DEFINE(HAVE_SETBUF) |
|
717 AC_DEFINE(HAVE_ISATTY) |
|
718 fi |
|
719 |
|
720 fi # COMPILE_ENVIRONMENT |
|
721 |
|
722 AC_SUBST(MIDL_FLAGS) |
|
723 AC_SUBST(_MSC_VER) |
|
724 |
|
725 AC_SUBST(GNU_AS) |
|
726 AC_SUBST(GNU_LD) |
|
727 AC_SUBST(GNU_CC) |
|
728 AC_SUBST(GNU_CXX) |
|
729 AC_SUBST(INTEL_CC) |
|
730 AC_SUBST(INTEL_CXX) |
|
731 |
|
732 AC_SUBST(STL_FLAGS) |
|
733 AC_SUBST(WRAP_STL_INCLUDES) |
|
734 AC_SUBST(MOZ_MSVC_STL_WRAP__Throw) |
|
735 AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE) |
|
736 |
|
737 dnl ======================================================== |
|
738 dnl Checks for programs. |
|
739 dnl ======================================================== |
|
740 AC_PROG_INSTALL |
|
741 AC_PROG_LN_S |
|
742 |
|
743 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then |
|
744 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION]) |
|
745 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5` |
|
746 _perl_res=$? |
|
747 AC_MSG_RESULT([$_perl_version]) |
|
748 |
|
749 if test "$_perl_res" != 0; then |
|
750 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.]) |
|
751 fi |
|
752 fi |
|
753 |
|
754 AC_MSG_CHECKING([for full perl installation]) |
|
755 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5` |
|
756 _perl_res=$? |
|
757 if test "$_perl_res" != 0; then |
|
758 AC_MSG_RESULT([no]) |
|
759 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.]) |
|
760 else |
|
761 AC_MSG_RESULT([yes]) |
|
762 fi |
|
763 |
|
764 if test -z "$COMPILE_ENVIRONMENT"; then |
|
765 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py' |
|
766 fi |
|
767 AC_SUBST(NSINSTALL_BIN) |
|
768 |
|
769 MOZ_PATH_PROG(DOXYGEN, doxygen, :) |
|
770 MOZ_PATH_PROG(AUTOCONF, autoconf, :) |
|
771 MOZ_PATH_PROGS(UNZIP, unzip) |
|
772 if test -z "$UNZIP" -o "$UNZIP" = ":"; then |
|
773 AC_MSG_ERROR([unzip not found in \$PATH]) |
|
774 fi |
|
775 MOZ_PATH_PROGS(ZIP, zip) |
|
776 if test -z "$ZIP" -o "$ZIP" = ":"; then |
|
777 AC_MSG_ERROR([zip not found in \$PATH]) |
|
778 fi |
|
779 MOZ_PATH_PROG(XARGS, xargs) |
|
780 if test -z "$XARGS" -o "$XARGS" = ":"; then |
|
781 AC_MSG_ERROR([xargs not found in \$PATH .]) |
|
782 fi |
|
783 |
|
784 MOZ_PATH_PROG(RPMBUILD, rpmbuild, :) |
|
785 AC_SUBST(RPMBUILD) |
|
786 |
|
787 if test "$COMPILE_ENVIRONMENT"; then |
|
788 |
|
789 dnl ======================================================== |
|
790 dnl = Mac OS X toolchain support |
|
791 dnl ======================================================== |
|
792 |
|
793 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk |
|
794 dnl that a universal binary is being produced and MOZ_CAN_RUN_PROGRAMS |
|
795 dnl when we can run target binaries. |
|
796 AC_SUBST(UNIVERSAL_BINARY) |
|
797 AC_SUBST(MOZ_CAN_RUN_PROGRAMS) |
|
798 |
|
799 MOZ_ARG_WITH_STRING(unify-dist, |
|
800 [ --with-unify-dist=dir Location of the dist directory to unify with at packaging time (Mac OS X universal build only)], |
|
801 UNIFY_DIST=$withval) |
|
802 if test -n "$UNIVERSAL_BINARY"; then |
|
803 if test -z "$UNIFY_DIST"; then |
|
804 AC_MSG_ERROR([You need to provide the --with-unify-dist=dir argument when performing a universal build]) |
|
805 fi |
|
806 case "$UNIFY_DIST" in |
|
807 /*) |
|
808 ;; |
|
809 *) |
|
810 UNIFY_DIST="${MOZ_BUILD_ROOT}/${UNIFY_DIST}" |
|
811 ;; |
|
812 esac |
|
813 fi |
|
814 AC_SUBST(UNIFY_DIST) |
|
815 |
|
816 dnl ======================================================== |
|
817 dnl Check for MacOS deployment target version |
|
818 dnl ======================================================== |
|
819 |
|
820 MOZ_ARG_ENABLE_STRING(macos-target, |
|
821 [ --enable-macos-target=VER (default=10.6) |
|
822 Set the minimum MacOS version needed at runtime], |
|
823 [_MACOSX_DEPLOYMENT_TARGET=$enableval]) |
|
824 |
|
825 case "$target" in |
|
826 *-darwin*) |
|
827 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then |
|
828 dnl Use the specified value |
|
829 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET |
|
830 else |
|
831 dnl No value specified on the command line or in the environment, |
|
832 dnl use architecture minimum. |
|
833 export MACOSX_DEPLOYMENT_TARGET=10.6 |
|
834 fi |
|
835 ;; |
|
836 esac |
|
837 |
|
838 AC_SUBST(MACOSX_DEPLOYMENT_TARGET) |
|
839 |
|
840 dnl ======================================================== |
|
841 dnl = Mac OS X SDK support |
|
842 dnl ======================================================== |
|
843 MACOS_SDK_DIR= |
|
844 MOZ_ARG_WITH_STRING(macos-sdk, |
|
845 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)], |
|
846 MACOS_SDK_DIR=$withval) |
|
847 |
|
848 MACOS_PRIVATE_FRAMEWORKS_DIR_DEFAULTED= |
|
849 MOZ_ARG_WITH_STRING(macos-private-frameworks, |
|
850 [ --with-macos-private-frameworks=dir Location of private frameworks to use (Mac OS X only)], |
|
851 MACOS_PRIVATE_FRAMEWORKS_DIR=$withval, |
|
852 MACOS_PRIVATE_FRAMEWORKS_DIR=/System/Library/PrivateFrameworks |
|
853 MACOS_PRIVATE_FRAMEWORKS_DEFAULTED=1) |
|
854 |
|
855 if test -z "${MACOS_PRIVATE_FRAMEWORKS_DEFAULTED}"; then |
|
856 if test -z "$CROSS_COMPILE"; then |
|
857 AC_MSG_WARN([You should only be using --with-macos-private-frameworks when cross-compiling.]) |
|
858 fi |
|
859 if test ! -d "$MACOS_PRIVATE_FRAMEWORKS_DIR"; then |
|
860 AC_MSG_ERROR([PrivateFrameworks directory not found.]) |
|
861 fi |
|
862 fi |
|
863 |
|
864 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use. |
|
865 AC_SUBST(MACOS_SDK_DIR) |
|
866 AC_SUBST(MACOS_PRIVATE_FRAMEWORKS_DIR) |
|
867 |
|
868 if test "$MACOS_SDK_DIR"; then |
|
869 dnl Sync this section with the ones in NSPR and NSS. |
|
870 dnl Changes to the cross environment here need to be accounted for in |
|
871 dnl the libIDL checks (below) and xpidl build. |
|
872 |
|
873 if test ! -d "$MACOS_SDK_DIR"; then |
|
874 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must |
|
875 specify a valid SDK. SDKs are installed when the optional cross-development |
|
876 tools are selected during the Xcode/Developer Tools installation.]) |
|
877 fi |
|
878 |
|
879 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}" |
|
880 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}" |
|
881 |
|
882 dnl CPP/CXXCPP needs to be set for MOZ_CHECK_HEADER. |
|
883 CPP="$CPP -isysroot ${MACOS_SDK_DIR}" |
|
884 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}" |
|
885 |
|
886 AC_LANG_SAVE |
|
887 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination]) |
|
888 AC_LANG_CPLUSPLUS |
|
889 AC_TRY_COMPILE([#include <new>],[], |
|
890 result=yes, |
|
891 result=no) |
|
892 AC_LANG_RESTORE |
|
893 AC_MSG_RESULT($result) |
|
894 |
|
895 if test "$result" = "no" ; then |
|
896 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.]) |
|
897 fi |
|
898 fi |
|
899 |
|
900 fi # COMPILE_ENVIRONMENT |
|
901 |
|
902 AC_MSG_CHECKING([compiler version]) |
|
903 # Just print it so it shows up in the logs. |
|
904 cc_version=$($CC --version) |
|
905 AC_MSG_RESULT([$cc_version]) |
|
906 |
|
907 if test -n "$MAKE"; then |
|
908 if test `echo $MAKE | grep -c make.py` != 1; then |
|
909 NOT_PYMAKE=$MAKE |
|
910 fi |
|
911 fi |
|
912 |
|
913 case "$host_os" in |
|
914 mingw*) |
|
915 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :) |
|
916 ;; |
|
917 *) |
|
918 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :) |
|
919 ;; |
|
920 esac |
|
921 if test "$GMAKE" = ":"; then |
|
922 AC_MSG_ERROR([GNU make not found]) |
|
923 fi |
|
924 AC_SUBST(GMAKE) |
|
925 |
|
926 if test -z "$MAKE"; then |
|
927 MAKE=$GMAKE |
|
928 fi |
|
929 |
|
930 if test "$COMPILE_ENVIRONMENT"; then |
|
931 |
|
932 AC_PATH_XTRA |
|
933 |
|
934 XCFLAGS="$X_CFLAGS" |
|
935 |
|
936 fi # COMPILE_ENVIRONMENT |
|
937 |
|
938 dnl ======================================================== |
|
939 dnl set the defaults first |
|
940 dnl ======================================================== |
|
941 AS_BIN=$AS |
|
942 AR_LIST='$(AR) t' |
|
943 AR_EXTRACT='$(AR) x' |
|
944 AR_DELETE='$(AR) d' |
|
945 AS='$(CC)' |
|
946 AS_DASH_C_FLAG='-c' |
|
947 DLL_PREFIX=lib |
|
948 LIB_PREFIX=lib |
|
949 DLL_SUFFIX=.so |
|
950 OBJ_SUFFIX=o |
|
951 LIB_SUFFIX=a |
|
952 ASM_SUFFIX=s |
|
953 IMPORT_LIB_SUFFIX= |
|
954 TARGET_MD_ARCH=unix |
|
955 DIRENT_INO=d_ino |
|
956 MOZ_USER_DIR=".mozilla" |
|
957 |
|
958 MOZ_JPEG_CFLAGS= |
|
959 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)' |
|
960 MOZ_BZ2_CFLAGS= |
|
961 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)' |
|
962 MOZ_PNG_CFLAGS="-I$_objdir/dist/include" # needed for freetype compilation |
|
963 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)' |
|
964 |
|
965 MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)' |
|
966 MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)' |
|
967 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib' |
|
968 XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/bin)' |
|
969 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS)' |
|
970 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)' |
|
971 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)' |
|
972 |
|
973 # These are specially defined on Windows only |
|
974 case "$target" in |
|
975 *-mingw*) |
|
976 XPCOM_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)' |
|
977 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime.$(LIB_SUFFIX)' |
|
978 ;; |
|
979 *) |
|
980 XPCOM_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_GLUE_LDOPTS |
|
981 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_STANDALONE_GLUE_LDOPTS |
|
982 ;; |
|
983 esac |
|
984 |
|
985 MOZ_FS_LAYOUT=unix |
|
986 |
|
987 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)' |
|
988 |
|
989 USE_DEPENDENT_LIBS=1 |
|
990 |
|
991 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2 |
|
992 |
|
993 if test -n "$CROSS_COMPILE"; then |
|
994 OS_TARGET="${target_os}" |
|
995 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'` |
|
996 OS_RELEASE= |
|
997 case "${target_os}" in |
|
998 linux*) OS_ARCH=Linux OS_TARGET=Linux ;; |
|
999 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU/kFreeBSD ;; |
|
1000 gnu*) OS_ARCH=GNU ;; |
|
1001 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;; |
|
1002 mingw*) OS_ARCH=WINNT OS_TARGET=WINNT ;; |
|
1003 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;; |
|
1004 dragonfly*) OS_ARCH=DragonFly OS_TARGET=DragonFly ;; |
|
1005 freebsd*) OS_ARCH=FreeBSD OS_TARGET=FreeBSD ;; |
|
1006 netbsd*) OS_ARCH=NetBSD OS_TARGET=NetBSD ;; |
|
1007 openbsd*) OS_ARCH=OpenBSD OS_TARGET=OpenBSD ;; |
|
1008 esac |
|
1009 case "${target}" in |
|
1010 *-android*|*-linuxandroid*) OS_ARCH=Linux OS_TARGET=Android ;; |
|
1011 esac |
|
1012 else |
|
1013 OS_TARGET=`uname -s` |
|
1014 OS_ARCH=`uname -s | sed -e 's|/|_|g'` |
|
1015 OS_RELEASE=`uname -r` |
|
1016 fi |
|
1017 |
|
1018 # Before this used `uname -m` when not cross compiling |
|
1019 # but that breaks when you have a 64 bit kernel with a 32 bit userland. |
|
1020 OS_TEST="${target_cpu}" |
|
1021 |
|
1022 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'` |
|
1023 |
|
1024 ####################################################################### |
|
1025 # Master "Core Components" macros for getting the OS target # |
|
1026 ####################################################################### |
|
1027 |
|
1028 # |
|
1029 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no |
|
1030 # cross-compilation. |
|
1031 # |
|
1032 |
|
1033 # |
|
1034 # Define and override various archtecture-specific variables, including |
|
1035 # HOST_OS_ARCH |
|
1036 # OS_ARCH |
|
1037 # OS_TEST |
|
1038 # OS_TARGET |
|
1039 # OS_RELEASE |
|
1040 # OS_MINOR_RELEASE |
|
1041 # |
|
1042 |
|
1043 case "$HOST_OS_ARCH" in |
|
1044 mingw*) |
|
1045 HOST_OS_ARCH=WINNT |
|
1046 ;; |
|
1047 darwin*) |
|
1048 HOST_OS_ARCH=Darwin |
|
1049 ;; |
|
1050 linux*) |
|
1051 HOST_OS_ARCH=Linux |
|
1052 ;; |
|
1053 kfreebsd*-gnu) |
|
1054 HOST_OS_ARCH=GNU_kFreeBSD |
|
1055 ;; |
|
1056 gnu*) |
|
1057 HOST_OS_ARCH=GNU |
|
1058 ;; |
|
1059 dragonfly*) |
|
1060 HOST_OS_ARCH=DragonFly |
|
1061 ;; |
|
1062 freebsd*) |
|
1063 HOST_OS_ARCH=FreeBSD |
|
1064 ;; |
|
1065 netbsd*) |
|
1066 HOST_OS_ARCH=NetBSD |
|
1067 ;; |
|
1068 openbsd*) |
|
1069 HOST_OS_ARCH=OpenBSD |
|
1070 ;; |
|
1071 solaris*) |
|
1072 HOST_OS_ARCH=SunOS |
|
1073 SOLARIS_SUNPRO_CC= |
|
1074 SOLARIS_SUNPRO_CXX= |
|
1075 if test -z "$GNU_CC"; then |
|
1076 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then |
|
1077 SOLARIS_SUNPRO_CC=1 |
|
1078 fi |
|
1079 fi |
|
1080 |
|
1081 if test -z "$GNU_CXX"; then |
|
1082 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then |
|
1083 SOLARIS_SUNPRO_CXX=1 |
|
1084 fi |
|
1085 fi |
|
1086 AC_SUBST(SOLARIS_SUNPRO_CC) |
|
1087 AC_SUBST(SOLARIS_SUNPRO_CXX) |
|
1088 ;; |
|
1089 esac |
|
1090 |
|
1091 case "$OS_ARCH" in |
|
1092 WINNT) |
|
1093 if test -z "$CROSS_COMPILE" ; then |
|
1094 OS_TEST=`uname -p` |
|
1095 fi |
|
1096 ;; |
|
1097 Windows_NT) |
|
1098 # |
|
1099 # If uname -s returns "Windows_NT", we assume that we are using |
|
1100 # the uname.exe in MKS toolkit. |
|
1101 # |
|
1102 # The -r option of MKS uname only returns the major version number. |
|
1103 # So we need to use its -v option to get the minor version number. |
|
1104 # Moreover, it doesn't have the -p option, so we need to use uname -m. |
|
1105 # |
|
1106 OS_ARCH=WINNT |
|
1107 OS_TARGET=WINNT |
|
1108 OS_MINOR_RELEASE=`uname -v` |
|
1109 if test "$OS_MINOR_RELEASE" = "00"; then |
|
1110 OS_MINOR_RELEASE=0 |
|
1111 fi |
|
1112 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}" |
|
1113 ;; |
|
1114 MINGW*_NT*) |
|
1115 # |
|
1116 # If uname -s returns MINGW32_NT-5.1, we assume that we are using |
|
1117 # the uname.exe in the MSYS tools. |
|
1118 # |
|
1119 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'` |
|
1120 OS_ARCH=WINNT |
|
1121 OS_TARGET=WINNT |
|
1122 ;; |
|
1123 AIX) |
|
1124 OS_RELEASE=`uname -v`.`uname -r` |
|
1125 OS_TEST=${target_cpu} |
|
1126 ;; |
|
1127 Darwin) |
|
1128 case "${target_cpu}" in |
|
1129 powerpc*) |
|
1130 OS_TEST=ppc |
|
1131 ;; |
|
1132 i*86*) |
|
1133 OS_TEST=i386 |
|
1134 ;; |
|
1135 x86_64) |
|
1136 OS_TEST=x86_64 |
|
1137 ;; |
|
1138 *) |
|
1139 if test -z "$CROSS_COMPILE" ; then |
|
1140 OS_TEST=`uname -p` |
|
1141 fi |
|
1142 ;; |
|
1143 esac |
|
1144 ;; |
|
1145 esac |
|
1146 |
|
1147 # Only set CPU_ARCH if we recognize the value of OS_TEST |
|
1148 |
|
1149 case "$OS_TEST" in |
|
1150 *86 | i86pc) |
|
1151 CPU_ARCH=x86 |
|
1152 ;; |
|
1153 |
|
1154 powerpc64 | ppc64 | powerpc64le | ppc64le) |
|
1155 CPU_ARCH=ppc64 |
|
1156 ;; |
|
1157 |
|
1158 powerpc | ppc | rs6000) |
|
1159 CPU_ARCH=ppc |
|
1160 ;; |
|
1161 |
|
1162 Alpha | alpha | ALPHA) |
|
1163 CPU_ARCH=Alpha |
|
1164 ;; |
|
1165 |
|
1166 s390) |
|
1167 CPU_ARCH=s390 |
|
1168 ;; |
|
1169 |
|
1170 s390x) |
|
1171 CPU_ARCH=s390x |
|
1172 ;; |
|
1173 |
|
1174 hppa* | parisc) |
|
1175 CPU_ARCH=hppa |
|
1176 ;; |
|
1177 |
|
1178 sun4u | sparc*) |
|
1179 CPU_ARCH=sparc |
|
1180 ;; |
|
1181 |
|
1182 x86_64 | ia64) |
|
1183 CPU_ARCH="$OS_TEST" |
|
1184 ;; |
|
1185 |
|
1186 arm*) |
|
1187 CPU_ARCH=arm |
|
1188 ;; |
|
1189 |
|
1190 mips|mipsel) |
|
1191 CPU_ARCH="mips" |
|
1192 ;; |
|
1193 |
|
1194 aarch64*) |
|
1195 CPU_ARCH=aarch64 |
|
1196 ;; |
|
1197 esac |
|
1198 |
|
1199 if test -z "$OS_TARGET"; then |
|
1200 OS_TARGET=$OS_ARCH |
|
1201 fi |
|
1202 OS_CONFIG="${OS_TARGET}${OS_RELEASE}" |
|
1203 |
|
1204 dnl Set INTEL_ARCHITECTURE if we're compiling for x86-32 or x86-64. |
|
1205 dnl =============================================================== |
|
1206 INTEL_ARCHITECTURE= |
|
1207 case "$OS_TEST" in |
|
1208 x86_64|i?86) |
|
1209 INTEL_ARCHITECTURE=1 |
|
1210 esac |
|
1211 |
|
1212 dnl Configure platform-specific CPU architecture compiler options. |
|
1213 dnl ============================================================== |
|
1214 MOZ_ARCH_OPTS |
|
1215 |
|
1216 dnl ================================================================= |
|
1217 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN, |
|
1218 dnl which is bad when cross compiling. |
|
1219 dnl ================================================================= |
|
1220 if test "$COMPILE_ENVIRONMENT"; then |
|
1221 configure_static_assert_macros=' |
|
1222 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__) |
|
1223 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) |
|
1224 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1] |
|
1225 ' |
|
1226 |
|
1227 dnl test that the macros actually work: |
|
1228 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work) |
|
1229 AC_CACHE_VAL(ac_cv_static_assertion_macros_work, |
|
1230 [AC_LANG_SAVE |
|
1231 AC_LANG_C |
|
1232 ac_cv_static_assertion_macros_work="yes" |
|
1233 AC_TRY_COMPILE([$configure_static_assert_macros], |
|
1234 [CONFIGURE_STATIC_ASSERT(1)], |
|
1235 , |
|
1236 ac_cv_static_assertion_macros_work="no") |
|
1237 AC_TRY_COMPILE([$configure_static_assert_macros], |
|
1238 [CONFIGURE_STATIC_ASSERT(0)], |
|
1239 ac_cv_static_assertion_macros_work="no", |
|
1240 ) |
|
1241 AC_LANG_CPLUSPLUS |
|
1242 AC_TRY_COMPILE([$configure_static_assert_macros], |
|
1243 [CONFIGURE_STATIC_ASSERT(1)], |
|
1244 , |
|
1245 ac_cv_static_assertion_macros_work="no") |
|
1246 AC_TRY_COMPILE([$configure_static_assert_macros], |
|
1247 [CONFIGURE_STATIC_ASSERT(0)], |
|
1248 ac_cv_static_assertion_macros_work="no", |
|
1249 ) |
|
1250 AC_LANG_RESTORE |
|
1251 ]) |
|
1252 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work") |
|
1253 if test "$ac_cv_static_assertion_macros_work" = "no"; then |
|
1254 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.]) |
|
1255 fi |
|
1256 fi # COMPILE_ENVIRONMENT |
|
1257 |
|
1258 dnl ======================================================== |
|
1259 dnl Android libstdc++, placed here so it can use MOZ_ARCH |
|
1260 dnl computed above. |
|
1261 dnl ======================================================== |
|
1262 |
|
1263 MOZ_ANDROID_STLPORT |
|
1264 |
|
1265 dnl ======================================================== |
|
1266 dnl Suppress Clang Argument Warnings |
|
1267 dnl ======================================================== |
|
1268 if test -n "$CLANG_CC"; then |
|
1269 _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}" |
|
1270 CPPFLAGS="-Qunused-arguments ${CPPFLAGS}" |
|
1271 fi |
|
1272 if test -n "$CLANG_CXX"; then |
|
1273 _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}" |
|
1274 fi |
|
1275 |
|
1276 dnl ======================================================== |
|
1277 dnl = Use Address Sanitizer |
|
1278 dnl ======================================================== |
|
1279 MOZ_ARG_ENABLE_BOOL(address-sanitizer, |
|
1280 [ --enable-address-sanitizer Enable Address Sanitizer (default=no)], |
|
1281 MOZ_ASAN=1, |
|
1282 MOZ_ASAN= ) |
|
1283 if test -n "$MOZ_ASAN"; then |
|
1284 MOZ_LLVM_HACKS=1 |
|
1285 AC_DEFINE(MOZ_ASAN) |
|
1286 MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer) |
|
1287 fi |
|
1288 AC_SUBST(MOZ_ASAN) |
|
1289 AC_SUBST(LLVM_SYMBOLIZER) |
|
1290 |
|
1291 dnl ======================================================== |
|
1292 dnl = Enable hacks required for LLVM instrumentations |
|
1293 dnl ======================================================== |
|
1294 MOZ_ARG_ENABLE_BOOL(llvm-hacks, |
|
1295 [ --enable-llvm-hacks Enable workarounds required for several LLVM instrumentations (default=no)], |
|
1296 MOZ_LLVM_HACKS=1, |
|
1297 MOZ_LLVM_HACKS= ) |
|
1298 if test -n "$MOZ_LLVM_HACKS"; then |
|
1299 MOZ_NO_WLZDEFS=1 |
|
1300 MOZ_CFLAGS_NSS=1 |
|
1301 fi |
|
1302 AC_SUBST(MOZ_NO_WLZDEFS) |
|
1303 AC_SUBST(MOZ_CFLAGS_NSS) |
|
1304 |
|
1305 dnl ======================================================== |
|
1306 dnl GNU specific defaults |
|
1307 dnl ======================================================== |
|
1308 if test "$GNU_CC"; then |
|
1309 MMX_FLAGS="-mmmx" |
|
1310 SSE_FLAGS="-msse" |
|
1311 SSE2_FLAGS="-msse2" |
|
1312 # Per bug 719659 comment 2, some of the headers on ancient build machines |
|
1313 # may require gnu89 inline semantics. But otherwise, we use C99. |
|
1314 # But on OS X we just use C99 plus GNU extensions, in order to fix |
|
1315 # bug 917526. |
|
1316 CFLAGS="$CFLAGS -std=gnu99" |
|
1317 if test "${OS_ARCH}" != Darwin; then |
|
1318 CFLAGS="$CFLAGS -fgnu89-inline" |
|
1319 fi |
|
1320 # FIXME: Let us build with strict aliasing. bug 414641. |
|
1321 CFLAGS="$CFLAGS -fno-strict-aliasing" |
|
1322 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@' |
|
1323 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(notdir $@) -o $@' |
|
1324 WARNINGS_AS_ERRORS='-Werror' |
|
1325 DSO_CFLAGS='' |
|
1326 DSO_PIC_CFLAGS='-fPIC' |
|
1327 ASFLAGS="$ASFLAGS -fPIC" |
|
1328 AC_MSG_CHECKING([for --noexecstack option to as]) |
|
1329 _SAVE_CFLAGS=$CFLAGS |
|
1330 CFLAGS="$CFLAGS -Wa,--noexecstack" |
|
1331 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes]) |
|
1332 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"], |
|
1333 AC_MSG_RESULT([no])) |
|
1334 CFLAGS=$_SAVE_CFLAGS |
|
1335 AC_MSG_CHECKING([for -z noexecstack option to ld]) |
|
1336 _SAVE_LDFLAGS=$LDFLAGS |
|
1337 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" |
|
1338 AC_TRY_LINK(,,AC_MSG_RESULT([yes]), |
|
1339 AC_MSG_RESULT([no]) |
|
1340 LDFLAGS=$_SAVE_LDFLAGS) |
|
1341 |
|
1342 AC_MSG_CHECKING([for -z text option to ld]) |
|
1343 _SAVE_LDFLAGS=$LDFLAGS |
|
1344 LDFLAGS="$LDFLAGS -Wl,-z,text" |
|
1345 AC_TRY_LINK(,,AC_MSG_RESULT([yes]) |
|
1346 [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,text"], |
|
1347 AC_MSG_RESULT([no]) |
|
1348 LDFLAGS=$_SAVE_LDFLAGS) |
|
1349 |
|
1350 AC_MSG_CHECKING([for --build-id option to ld]) |
|
1351 _SAVE_LDFLAGS=$LDFLAGS |
|
1352 LDFLAGS="$LDFLAGS -Wl,--build-id" |
|
1353 AC_TRY_LINK(,,AC_MSG_RESULT([yes]) |
|
1354 [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,--build-id"], |
|
1355 AC_MSG_RESULT([no]) |
|
1356 LDFLAGS=$_SAVE_LDFLAGS) |
|
1357 |
|
1358 AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld]) |
|
1359 HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED= |
|
1360 _SAVE_LDFLAGS=$LDFLAGS |
|
1361 LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ" |
|
1362 AC_TRY_LINK(,,AC_MSG_RESULT([yes]) |
|
1363 [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1], |
|
1364 AC_MSG_RESULT([no])) |
|
1365 LDFLAGS=$_SAVE_LDFLAGS |
|
1366 |
|
1367 # Check for -mssse3 on $CC |
|
1368 AC_MSG_CHECKING([if toolchain supports -mssse3 option]) |
|
1369 HAVE_TOOLCHAIN_SUPPORT_MSSSE3= |
|
1370 _SAVE_CFLAGS=$CFLAGS |
|
1371 CFLAGS="$CFLAGS -mssse3" |
|
1372 AC_TRY_COMPILE([asm ("pmaddubsw %xmm2,%xmm3");],,AC_MSG_RESULT([yes]) |
|
1373 [HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1], |
|
1374 AC_MSG_RESULT([no])) |
|
1375 CFLAGS=$_SAVE_CFLAGS |
|
1376 |
|
1377 # Check for -msse4.1 on $CC |
|
1378 AC_MSG_CHECKING([if toolchain supports -msse4.1 option]) |
|
1379 HAVE_TOOLCHAIN_SUPPORT_MSSE4_1= |
|
1380 _SAVE_CFLAGS=$CFLAGS |
|
1381 CFLAGS="$CFLAGS -msse4.1" |
|
1382 AC_TRY_COMPILE([asm ("pmulld %xmm6,%xmm0");],,AC_MSG_RESULT([yes]) |
|
1383 [HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1], |
|
1384 AC_MSG_RESULT([no])) |
|
1385 CFLAGS=$_SAVE_CFLAGS |
|
1386 |
|
1387 case "${CPU_ARCH}" in |
|
1388 x86 | x86_64) |
|
1389 AC_MSG_CHECKING(for x86 AVX2 asm support in compiler) |
|
1390 AC_TRY_COMPILE([], |
|
1391 [asm volatile ("vpermq \$0xd8,%ymm0,%ymm0 \n");], |
|
1392 result="yes", result="no") |
|
1393 AC_MSG_RESULT("$result") |
|
1394 if test "$result" = "yes"; then |
|
1395 HAVE_X86_AVX2=1 |
|
1396 AC_DEFINE(HAVE_X86_AVX2) |
|
1397 AC_SUBST(HAVE_X86_AVX2) |
|
1398 fi |
|
1399 esac |
|
1400 |
|
1401 DSO_LDOPTS='-shared' |
|
1402 if test "$GCC_USE_GNU_LD"; then |
|
1403 # Some tools like ASan use a runtime library that is only |
|
1404 # linked against executables, so we must allow undefined |
|
1405 # symbols for shared objects in some cases. |
|
1406 if test -z "$MOZ_NO_WLZDEFS"; then |
|
1407 # Don't allow undefined symbols in libraries |
|
1408 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs" |
|
1409 |
|
1410 # BSDs need `environ' exposed for posix_spawn (bug 753046) |
|
1411 case "$OS_TARGET" in |
|
1412 DragonFly|FreeBSD|NetBSD|OpenBSD) |
|
1413 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then |
|
1414 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ" |
|
1415 else |
|
1416 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols" |
|
1417 fi |
|
1418 ;; |
|
1419 esac |
|
1420 fi |
|
1421 fi |
|
1422 |
|
1423 # Turn on GNU-specific warnings: |
|
1424 # -Wall - turn on a lot of warnings |
|
1425 # -Wpointer-arith - good to have |
|
1426 # -Wdeclaration-after-statement - MSVC doesn't like these |
|
1427 # -Werror=return-type - catches missing returns, zero false positives |
|
1428 # -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size |
|
1429 # -Wtype-limits - catches overflow bugs, few false positives |
|
1430 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives |
|
1431 # -Wsign-compare - catches comparison of signed and unsigned types |
|
1432 # |
|
1433 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement" |
|
1434 MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type) |
|
1435 MOZ_C_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_c_has_werror_int_to_pointer_cast) |
|
1436 MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits) |
|
1437 MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body) |
|
1438 MOZ_C_SUPPORTS_WARNING(-W, sign-compare, ac_c_has_sign_compare) |
|
1439 |
|
1440 # Turn off the following warnings that -Wall turns on: |
|
1441 # -Wno-unused - lots of violations in third-party code |
|
1442 # |
|
1443 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused" |
|
1444 |
|
1445 if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then |
|
1446 # Don't use -Wcast-align with ICC or clang |
|
1447 case "$CPU_ARCH" in |
|
1448 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there |
|
1449 hppa | ia64 | sparc | arm) |
|
1450 ;; |
|
1451 *) |
|
1452 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align" |
|
1453 ;; |
|
1454 esac |
|
1455 fi |
|
1456 |
|
1457 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT' |
|
1458 _USE_CPP_INCLUDE_FLAG=1 |
|
1459 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS" |
|
1460 |
|
1461 elif test "$SOLARIS_SUNPRO_CC"; then |
|
1462 DSO_CFLAGS='' |
|
1463 if test "$CPU_ARCH" = "sparc"; then |
|
1464 # for Sun Studio on Solaris/SPARC |
|
1465 DSO_PIC_CFLAGS='-xcode=pic32' |
|
1466 else |
|
1467 DSO_PIC_CFLAGS='-KPIC' |
|
1468 fi |
|
1469 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT' |
|
1470 else |
|
1471 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@' |
|
1472 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $(notdir $@) -o $@' |
|
1473 |
|
1474 DSO_LDOPTS='-shared' |
|
1475 if test "$GNU_LD"; then |
|
1476 # Don't allow undefined symbols in libraries |
|
1477 DSO_LDOPTS="$DSO_LDOPTS -z defs" |
|
1478 fi |
|
1479 |
|
1480 DSO_CFLAGS='' |
|
1481 DSO_PIC_CFLAGS='-KPIC' |
|
1482 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT' |
|
1483 fi |
|
1484 |
|
1485 if test "$GNU_CXX"; then |
|
1486 # FIXME: Let us build with strict aliasing. bug 414641. |
|
1487 CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing" |
|
1488 |
|
1489 # Turn on GNU-specific warnings: |
|
1490 # -Wall - turn on a lot of warnings |
|
1491 # -Wpointer-arith - good to have |
|
1492 # -Woverloaded-virtual - ??? |
|
1493 # -Werror=return-type - catches missing returns, zero false positives |
|
1494 # -Werror=int-to-pointer-cast - catches cast to pointer from integer of different size |
|
1495 # -Wtype-limits - catches overflow bugs, few false positives |
|
1496 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives |
|
1497 # -Wsign-compare - catches comparison of signed and unsigned types |
|
1498 # |
|
1499 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual" |
|
1500 MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type) |
|
1501 MOZ_CXX_SUPPORTS_WARNING(-W, error=int-to-pointer-cast, ac_cxx_has_werror_int_to_pointer_cast) |
|
1502 MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits) |
|
1503 MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body) |
|
1504 MOZ_CXX_SUPPORTS_WARNING(-W, sign-compare, ac_cxx_has_sign_compare) |
|
1505 |
|
1506 # Turn off the following warnings that -Wall turns on: |
|
1507 # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently |
|
1508 # -Wno-inline-new-delete - we inline 'new' and 'delete' in mozalloc |
|
1509 # for performance reasons, and because GCC and clang accept it (though |
|
1510 # clang warns about it). |
|
1511 # |
|
1512 MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof) |
|
1513 MOZ_CXX_SUPPORTS_WARNING(-Wno-, inline-new-delete, ac_cxx_has_wno_inline_new_delete) |
|
1514 |
|
1515 if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then |
|
1516 # Don't use -Wcast-align with ICC or clang |
|
1517 case "$CPU_ARCH" in |
|
1518 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there |
|
1519 hppa | ia64 | sparc | arm) |
|
1520 ;; |
|
1521 *) |
|
1522 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align" |
|
1523 ;; |
|
1524 esac |
|
1525 fi |
|
1526 |
|
1527 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h' |
|
1528 _USE_CPP_INCLUDE_FLAG=1 |
|
1529 |
|
1530 # Recent clang and gcc support C++11 deleted functions without warnings if |
|
1531 # compiling with -std=c++0x or -std=gnu++0x (or c++11 or gnu++11 in very new |
|
1532 # versions). We can't use -std=c++0x yet, so gcc's support must remain |
|
1533 # unused. But clang's warning can be disabled, so when compiling with clang |
|
1534 # we use it to opt out of the warning, enabling (macro-encapsulated) use of |
|
1535 # deleted function syntax. |
|
1536 if test "$CLANG_CXX"; then |
|
1537 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions" |
|
1538 MOZ_CXX_SUPPORTS_WARNING(-Wno-, extended-offsetof, ac_cxx_has_wno_extended_offsetof) |
|
1539 fi |
|
1540 |
|
1541 else |
|
1542 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)' |
|
1543 fi |
|
1544 |
|
1545 dnl gcc can come with its own linker so it is better to use the pass-thru calls |
|
1546 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object |
|
1547 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to |
|
1548 dnl normal behavior. |
|
1549 dnl ======================================================== |
|
1550 MKSHLIB_FORCE_ALL= |
|
1551 MKSHLIB_UNFORCE_ALL= |
|
1552 |
|
1553 if test "$COMPILE_ENVIRONMENT"; then |
|
1554 if test "$GNU_CC"; then |
|
1555 AC_MSG_CHECKING(whether ld has archive extraction flags) |
|
1556 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce, |
|
1557 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS |
|
1558 ac_cv_mkshlib_force_and_unforce="no" |
|
1559 exec 3<&0 <<LOOP_INPUT |
|
1560 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive" |
|
1561 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract" |
|
1562 force="-Wl,-all"; unforce="-Wl,-none" |
|
1563 LOOP_INPUT |
|
1564 while read line |
|
1565 do |
|
1566 eval $line |
|
1567 LDFLAGS=$force |
|
1568 LIBS=$unforce |
|
1569 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break) |
|
1570 done |
|
1571 exec 0<&3 3<&- |
|
1572 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS |
|
1573 ]) |
|
1574 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then |
|
1575 AC_MSG_RESULT(no) |
|
1576 else |
|
1577 AC_MSG_RESULT(yes) |
|
1578 eval $ac_cv_mkshlib_force_and_unforce |
|
1579 MKSHLIB_FORCE_ALL=$force |
|
1580 MKSHLIB_UNFORCE_ALL=$unforce |
|
1581 fi |
|
1582 fi # GNU_CC |
|
1583 fi # COMPILE_ENVIRONMENT |
|
1584 |
|
1585 dnl ======================================================== |
|
1586 dnl Checking for 64-bit OS |
|
1587 dnl ======================================================== |
|
1588 if test "$COMPILE_ENVIRONMENT"; then |
|
1589 AC_LANG_SAVE |
|
1590 AC_LANG_C |
|
1591 AC_MSG_CHECKING(for 64-bit OS) |
|
1592 AC_TRY_COMPILE([$configure_static_assert_macros], |
|
1593 [CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)], |
|
1594 result="yes", result="no") |
|
1595 AC_MSG_RESULT("$result") |
|
1596 if test "$result" = "yes"; then |
|
1597 AC_DEFINE(HAVE_64BIT_OS) |
|
1598 HAVE_64BIT_OS=1 |
|
1599 fi |
|
1600 AC_SUBST(HAVE_64BIT_OS) |
|
1601 AC_LANG_RESTORE |
|
1602 fi # COMPILE_ENVIRONMENT |
|
1603 |
|
1604 dnl ======================================================== |
|
1605 dnl = Use profiling compile flags |
|
1606 dnl ======================================================== |
|
1607 MOZ_ARG_ENABLE_BOOL(profiling, |
|
1608 [ --enable-profiling Set compile flags necessary for using sampling profilers (e.g. shark, perf)], |
|
1609 MOZ_PROFILING=1, |
|
1610 MOZ_PROFILING= ) |
|
1611 |
|
1612 dnl ======================================================== |
|
1613 dnl = Turn on systrace for android/b2g. |
|
1614 dnl ======================================================== |
|
1615 MOZ_ARG_ENABLE_BOOL(systrace, |
|
1616 [ --enable-systrace Set compile flags necessary for using sampling profilers (e.g. shark, perf)], |
|
1617 MOZ_USE_SYSTRACE=1, |
|
1618 MOZ_USE_SYSTRACE= ) |
|
1619 if test -n "$MOZ_USE_SYSTRACE"; then |
|
1620 AC_DEFINE(MOZ_USE_SYSTRACE) |
|
1621 fi |
|
1622 |
|
1623 # For profiling builds keep the symbol information |
|
1624 if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then |
|
1625 case "$OS_TARGET" in |
|
1626 Linux|DragonFly|FreeBSD|NetBSD|OpenBSD) |
|
1627 STRIP_FLAGS="--strip-debug" |
|
1628 ;; |
|
1629 esac |
|
1630 fi |
|
1631 |
|
1632 dnl ======================================================== |
|
1633 dnl = Use Valgrind |
|
1634 dnl ======================================================== |
|
1635 MOZ_ARG_ENABLE_BOOL(valgrind, |
|
1636 [ --enable-valgrind Enable Valgrind integration hooks (default=no)], |
|
1637 MOZ_VALGRIND=1, |
|
1638 MOZ_VALGRIND= ) |
|
1639 if test -n "$MOZ_VALGRIND"; then |
|
1640 MOZ_CHECK_HEADER([valgrind/valgrind.h], [], |
|
1641 AC_MSG_ERROR( |
|
1642 [--enable-valgrind specified but Valgrind is not installed])) |
|
1643 AC_DEFINE(MOZ_VALGRIND) |
|
1644 fi |
|
1645 AC_SUBST(MOZ_VALGRIND) |
|
1646 |
|
1647 dnl ======================================================== |
|
1648 dnl jprof |
|
1649 dnl ======================================================== |
|
1650 MOZ_ARG_ENABLE_BOOL(jprof, |
|
1651 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.], |
|
1652 MOZ_JPROF=1, |
|
1653 MOZ_JPROF= ) |
|
1654 if test -n "$MOZ_JPROF"; then |
|
1655 MOZ_PROFILING=1 |
|
1656 AC_DEFINE(MOZ_JPROF) |
|
1657 fi |
|
1658 |
|
1659 dnl ======================================================== |
|
1660 dnl SPS Profiler |
|
1661 dnl ======================================================== |
|
1662 MOZ_ENABLE_PROFILER_SPS=1 |
|
1663 |
|
1664 case "${OS_TARGET}" in |
|
1665 Android) |
|
1666 case "${CPU_ARCH}" in |
|
1667 x86 | arm) ;; |
|
1668 *) |
|
1669 MOZ_ENABLE_PROFILER_SPS= |
|
1670 esac |
|
1671 ;; |
|
1672 Linux) |
|
1673 case "${CPU_ARCH}" in |
|
1674 x86 | x86_64) ;; |
|
1675 *) |
|
1676 MOZ_ENABLE_PROFILER_SPS= |
|
1677 esac |
|
1678 ;; |
|
1679 WINNT|Darwin) ;; |
|
1680 *) |
|
1681 MOZ_ENABLE_PROFILER_SPS= |
|
1682 ;; |
|
1683 esac |
|
1684 |
|
1685 if test -n "$MOZ_ENABLE_PROFILER_SPS"; then |
|
1686 AC_DEFINE(MOZ_ENABLE_PROFILER_SPS) |
|
1687 fi |
|
1688 |
|
1689 dnl ======================================================== |
|
1690 dnl shark |
|
1691 dnl ======================================================== |
|
1692 MOZ_ARG_ENABLE_BOOL(shark, |
|
1693 [ --enable-shark Enable shark remote profiling. Implies --enable-profiling.], |
|
1694 MOZ_SHARK=1, |
|
1695 MOZ_SHARK= ) |
|
1696 if test -n "$MOZ_SHARK"; then |
|
1697 MOZ_PROFILING=1 |
|
1698 AC_DEFINE(MOZ_SHARK) |
|
1699 fi |
|
1700 |
|
1701 dnl ======================================================== |
|
1702 dnl instruments |
|
1703 dnl ======================================================== |
|
1704 MOZ_ARG_ENABLE_BOOL(instruments, |
|
1705 [ --enable-instruments Enable instruments remote profiling. Implies --enable-profiling.], |
|
1706 MOZ_INSTRUMENTS=1, |
|
1707 MOZ_INSTRUMENTS= ) |
|
1708 if test -n "$MOZ_INSTRUMENTS"; then |
|
1709 MOZ_PROFILING=1 |
|
1710 AC_DEFINE(MOZ_INSTRUMENTS) |
|
1711 fi |
|
1712 |
|
1713 dnl ======================================================== |
|
1714 dnl callgrind |
|
1715 dnl ======================================================== |
|
1716 MOZ_ARG_ENABLE_BOOL(callgrind, |
|
1717 [ --enable-callgrind Enable callgrind profiling. Implies --enable-profiling.], |
|
1718 MOZ_CALLGRIND=1, |
|
1719 MOZ_CALLGRIND= ) |
|
1720 if test -n "$MOZ_CALLGRIND"; then |
|
1721 MOZ_PROFILING=1 |
|
1722 AC_DEFINE(MOZ_CALLGRIND) |
|
1723 fi |
|
1724 |
|
1725 dnl ======================================================== |
|
1726 dnl vtune |
|
1727 dnl ======================================================== |
|
1728 MOZ_ARG_ENABLE_BOOL(vtune, |
|
1729 [ --enable-vtune Enable vtune profiling. Implies --enable-profiling.], |
|
1730 MOZ_VTUNE=1, |
|
1731 MOZ_VTUNE= ) |
|
1732 if test -n "$MOZ_VTUNE"; then |
|
1733 MOZ_PROFILING=1 |
|
1734 AC_DEFINE(MOZ_VTUNE) |
|
1735 fi |
|
1736 |
|
1737 dnl ======================================================== |
|
1738 dnl Profiling |
|
1739 dnl ======================================================== |
|
1740 if test -n "$MOZ_PROFILING"; then |
|
1741 AC_DEFINE(MOZ_PROFILING) |
|
1742 fi |
|
1743 |
|
1744 dnl ======================================================== |
|
1745 dnl System overrides of the defaults for host |
|
1746 dnl ======================================================== |
|
1747 case "$host" in |
|
1748 *mingw*) |
|
1749 if test -n "$_WIN32_MSVC"; then |
|
1750 HOST_AR=lib |
|
1751 HOST_AR_FLAGS='-NOLOGO -OUT:$@' |
|
1752 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo" |
|
1753 HOST_RANLIB='echo ranlib' |
|
1754 else |
|
1755 HOST_CFLAGS="$HOST_CFLAGS -mwindows" |
|
1756 fi |
|
1757 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS" |
|
1758 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"' |
|
1759 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}" |
|
1760 HOST_BIN_SUFFIX=.exe |
|
1761 case "$host" in |
|
1762 *mingw*) |
|
1763 PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper" |
|
1764 ;; |
|
1765 esac |
|
1766 |
|
1767 case "${host_cpu}" in |
|
1768 i*86) |
|
1769 if test -n "$_WIN32_MSVC"; then |
|
1770 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86" |
|
1771 fi |
|
1772 ;; |
|
1773 x86_64) |
|
1774 if test -n "$_WIN32_MSVC"; then |
|
1775 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64" |
|
1776 fi |
|
1777 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_" |
|
1778 ;; |
|
1779 esac |
|
1780 ;; |
|
1781 |
|
1782 *-darwin*) |
|
1783 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11" |
|
1784 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"' |
|
1785 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" |
|
1786 ;; |
|
1787 |
|
1788 *-linux*|*-kfreebsd*-gnu|*-gnu*) |
|
1789 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX" |
|
1790 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"' |
|
1791 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" |
|
1792 ;; |
|
1793 |
|
1794 *) |
|
1795 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX" |
|
1796 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}" |
|
1797 ;; |
|
1798 esac |
|
1799 |
|
1800 dnl Check for using a custom <inttypes.h> implementation |
|
1801 dnl ======================================================== |
|
1802 AC_MSG_CHECKING(for custom <inttypes.h> implementation) |
|
1803 if test "$MOZ_CUSTOM_INTTYPES_H"; then |
|
1804 AC_DEFINE_UNQUOTED(MOZ_CUSTOM_INTTYPES_H, "$MOZ_CUSTOM_INTTYPES_H") |
|
1805 AC_MSG_RESULT(using $MOZ_CUSTOM_INTTYPES_H) |
|
1806 else |
|
1807 AC_MSG_RESULT(none specified) |
|
1808 fi |
|
1809 |
|
1810 dnl Get mozilla version from central milestone file |
|
1811 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir` |
|
1812 MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion` |
|
1813 MOZILLA_SYMBOLVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion` |
|
1814 |
|
1815 dnl Get version of various core apps from the version files. |
|
1816 FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt` |
|
1817 |
|
1818 if test -z "$FIREFOX_VERSION"; then |
|
1819 AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.]) |
|
1820 fi |
|
1821 |
|
1822 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION") |
|
1823 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION) |
|
1824 AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION") |
|
1825 AC_SUBST(MOZILLA_SYMBOLVERSION) |
|
1826 |
|
1827 MOZ_DOING_LTO(lto_is_enabled) |
|
1828 |
|
1829 dnl ======================================================== |
|
1830 dnl System overrides of the defaults for target |
|
1831 dnl ======================================================== |
|
1832 |
|
1833 case "$target" in |
|
1834 *-aix*) |
|
1835 AC_DEFINE(AIX) |
|
1836 if test ! "$GNU_CC"; then |
|
1837 if test ! "$HAVE_64BIT_OS"; then |
|
1838 # Compiling with Visual Age C++ object model compat is the |
|
1839 # default. To compile with object model ibm, add |
|
1840 # AIX_OBJMODEL=ibm to .mozconfig. |
|
1841 if test "$AIX_OBJMODEL" = "ibm"; then |
|
1842 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm" |
|
1843 else |
|
1844 AIX_OBJMODEL=compat |
|
1845 fi |
|
1846 else |
|
1847 AIX_OBJMODEL=compat |
|
1848 fi |
|
1849 AC_SUBST(AIX_OBJMODEL) |
|
1850 DSO_LDOPTS='-qmkshrobj=1' |
|
1851 DSO_CFLAGS='-qflag=w:w' |
|
1852 DSO_PIC_CFLAGS= |
|
1853 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib" |
|
1854 MOZ_FIX_LINK_PATHS= |
|
1855 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@' |
|
1856 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@' |
|
1857 if test "$COMPILE_ENVIRONMENT"; then |
|
1858 AC_LANG_SAVE |
|
1859 AC_LANG_CPLUSPLUS |
|
1860 AC_MSG_CHECKING([for IBM XLC/C++ compiler version >= 9.0.0.7]) |
|
1861 AC_TRY_COMPILE([], |
|
1862 [#if (__IBMCPP__ < 900) |
|
1863 #error "Bad compiler" |
|
1864 #endif], |
|
1865 _BAD_COMPILER=,_BAD_COMPILER=1) |
|
1866 if test -n "$_BAD_COMPILER"; then |
|
1867 AC_MSG_RESULT([no]) |
|
1868 AC_MSG_ERROR([IBM XLC/C++ 9.0.0.7 or higher is required to build.]) |
|
1869 else |
|
1870 AC_MSG_RESULT([yes]) |
|
1871 fi |
|
1872 AC_LANG_RESTORE |
|
1873 TARGET_COMPILER_ABI="ibmc" |
|
1874 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'` |
|
1875 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'` |
|
1876 fi |
|
1877 fi |
|
1878 case "${target_os}" in |
|
1879 aix4.1*) |
|
1880 DLL_SUFFIX='_shr.a' |
|
1881 ;; |
|
1882 esac |
|
1883 if test "$COMPILE_ENVIRONMENT"; then |
|
1884 MOZ_CHECK_HEADERS(sys/inttypes.h) |
|
1885 fi |
|
1886 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) |
|
1887 ;; |
|
1888 |
|
1889 *-darwin*) |
|
1890 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' |
|
1891 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@' |
|
1892 MOZ_OPTIMIZE_FLAGS="-O3" |
|
1893 # Statically disable jemalloc on 10.5 and 32-bit 10.6. See bug 702250. |
|
1894 if test "$HAVE_64BIT_OS"; then |
|
1895 MOZ_MEMORY=1 |
|
1896 fi |
|
1897 DLL_SUFFIX=".dylib" |
|
1898 DSO_LDOPTS='' |
|
1899 STRIP_FLAGS="$STRIP_FLAGS -x -S" |
|
1900 # Check whether we're targeting OS X or iOS |
|
1901 AC_CACHE_CHECK(for iOS target, |
|
1902 ac_cv_ios_target, |
|
1903 [AC_TRY_COMPILE([#include <TargetConditionals.h> |
|
1904 #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) |
|
1905 #error not iOS |
|
1906 #endif], |
|
1907 [], |
|
1908 ac_cv_ios_target="yes", |
|
1909 ac_cv_ios_target="no")]) |
|
1910 if test "$ac_cv_ios_target" = "yes"; then |
|
1911 AC_DEFINE(XP_IOS) |
|
1912 AC_DEFINE(XP_DARWIN) |
|
1913 _PLATFORM_DEFAULT_TOOLKIT='cairo-uikit' |
|
1914 else |
|
1915 AC_DEFINE(XP_MACOSX) |
|
1916 AC_DEFINE(XP_DARWIN) |
|
1917 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa' |
|
1918 # The ExceptionHandling framework is needed for Objective-C exception |
|
1919 # logging code in nsObjCExceptions.h. Currently we only use that in debug |
|
1920 # builds. |
|
1921 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"; |
|
1922 fi |
|
1923 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"' |
|
1924 |
|
1925 if test "x$lto_is_enabled" = "xyes"; then |
|
1926 echo "Skipping -dead_strip because lto is enabled." |
|
1927 dnl DTrace and -dead_strip don't interact well. See bug 403132. |
|
1928 dnl =================================================================== |
|
1929 elif test "x$enable_dtrace" = "xyes"; then |
|
1930 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132." |
|
1931 else |
|
1932 dnl check for the presence of the -dead_strip linker flag |
|
1933 AC_MSG_CHECKING([for -dead_strip option to ld]) |
|
1934 _SAVE_LDFLAGS=$LDFLAGS |
|
1935 LDFLAGS="$LDFLAGS -Wl,-dead_strip" |
|
1936 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=) |
|
1937 if test -n "$_HAVE_DEAD_STRIP" ; then |
|
1938 AC_MSG_RESULT([yes]) |
|
1939 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip" |
|
1940 else |
|
1941 AC_MSG_RESULT([no]) |
|
1942 fi |
|
1943 |
|
1944 LDFLAGS=$_SAVE_LDFLAGS |
|
1945 fi |
|
1946 |
|
1947 dnl With newer linkers we need to pass -allow_heap_execute because of |
|
1948 dnl Microsoft Silverlight (5.1.10411.0 at least). |
|
1949 AC_MSG_CHECKING([for -allow_heap_execute option to ld]) |
|
1950 _SAVE_LDFLAGS=$LDFLAGS |
|
1951 LDFLAGS="$LDFLAGS -Wl,-allow_heap_execute" |
|
1952 AC_TRY_LINK(,[return 0;],_HAVE_ALLOW_HEAP_EXECUTE=1, |
|
1953 _HAVE_ALLOW_HEAP_EXECUTE=) |
|
1954 if test -n "$_HAVE_ALLOW_HEAP_EXECUTE" ; then |
|
1955 AC_MSG_RESULT([yes]) |
|
1956 MOZ_ALLOW_HEAP_EXECUTE_FLAGS="-Wl,-allow_heap_execute" |
|
1957 else |
|
1958 AC_MSG_RESULT([no]) |
|
1959 fi |
|
1960 LDFLAGS=$_SAVE_LDFLAGS |
|
1961 |
|
1962 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin' |
|
1963 ;; |
|
1964 |
|
1965 ia64*-hpux*) |
|
1966 DLL_SUFFIX=".so" |
|
1967 if test ! "$GNU_CC"; then |
|
1968 DSO_LDOPTS='-b' |
|
1969 DSO_CFLAGS="" |
|
1970 DSO_PIC_CFLAGS= |
|
1971 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@' |
|
1972 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@' |
|
1973 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on" |
|
1974 else |
|
1975 DSO_LDOPTS='-b -E' |
|
1976 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@' |
|
1977 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@' |
|
1978 fi |
|
1979 MOZ_FIX_LINK_PATHS= |
|
1980 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) |
|
1981 AC_DEFINE(_LARGEFILE64_SOURCE) |
|
1982 ;; |
|
1983 |
|
1984 *-hpux*) |
|
1985 DLL_SUFFIX=".sl" |
|
1986 if test ! "$GNU_CC"; then |
|
1987 DSO_LDOPTS='-b -Wl,+s' |
|
1988 DSO_CFLAGS="" |
|
1989 DSO_PIC_CFLAGS="+Z" |
|
1990 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@' |
|
1991 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@' |
|
1992 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on" |
|
1993 else |
|
1994 DSO_LDOPTS='-b -E +s' |
|
1995 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@' |
|
1996 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@' |
|
1997 fi |
|
1998 MOZ_POST_PROGRAM_COMMAND='chatr +s enable' |
|
1999 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) |
|
2000 ;; |
|
2001 |
|
2002 *-android*|*-linuxandroid*) |
|
2003 AC_DEFINE(NO_PW_GECOS) |
|
2004 no_x=yes |
|
2005 if test -n "$gonkdir"; then |
|
2006 _PLATFORM_DEFAULT_TOOLKIT=cairo-gonk |
|
2007 _PLATFORM_HAVE_RIL=1 |
|
2008 MOZ_B2G_FM=1 |
|
2009 MOZ_SYNTH_PICO=1 |
|
2010 else |
|
2011 _PLATFORM_DEFAULT_TOOLKIT=cairo-android |
|
2012 MOZ_LINKER=1 |
|
2013 fi |
|
2014 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"' |
|
2015 |
|
2016 MOZ_GFX_OPTIMIZE_MOBILE=1 |
|
2017 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions" |
|
2018 ;; |
|
2019 |
|
2020 *-*linux*) |
|
2021 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler. |
|
2022 # Similarly for GNU_CXX and INTEL_CXX. |
|
2023 if test "$INTEL_CC" -o "$INTEL_CXX"; then |
|
2024 # -Os has been broken on Intel's C/C++ compilers for quite a |
|
2025 # while; Intel recommends against using it. |
|
2026 MOZ_OPTIMIZE_FLAGS="-O2" |
|
2027 elif test "$GNU_CC" -o "$GNU_CXX"; then |
|
2028 case $GCC_VERSION in |
|
2029 4.5.*) |
|
2030 # -Os is broken on gcc 4.5.x we need to tweak it to get good results. |
|
2031 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50" |
|
2032 esac |
|
2033 MOZ_PGO_OPTIMIZE_FLAGS="-O3" |
|
2034 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK" |
|
2035 fi |
|
2036 |
|
2037 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"' |
|
2038 |
|
2039 MOZ_MEMORY=1 |
|
2040 |
|
2041 case "${target_cpu}" in |
|
2042 alpha*) |
|
2043 CFLAGS="$CFLAGS -mieee" |
|
2044 CXXFLAGS="$CXXFLAGS -mieee" |
|
2045 ;; |
|
2046 esac |
|
2047 |
|
2048 if test -z "$MC"; then |
|
2049 MC=mc.exe |
|
2050 fi |
|
2051 ;; |
|
2052 *-mingw*) |
|
2053 DSO_CFLAGS= |
|
2054 DSO_PIC_CFLAGS= |
|
2055 DLL_SUFFIX=.dll |
|
2056 RC=rc.exe |
|
2057 MC=mc.exe |
|
2058 # certain versions of cygwin's makedepend barf on the |
|
2059 # #include <string> vs -I./dist/include/string issue so don't use it |
|
2060 XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/lib)' |
|
2061 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then |
|
2062 CC="$CC -mwindows" |
|
2063 CXX="$CXX -mwindows" |
|
2064 CPP="$CPP -mwindows" |
|
2065 CFLAGS="$CFLAGS -mms-bitfields" |
|
2066 CXXFLAGS="$CXXFLAGS -mms-bitfields" |
|
2067 DSO_LDOPTS='-shared' |
|
2068 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@' |
|
2069 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@' |
|
2070 RC='$(WINDRES)' |
|
2071 # Use static libgcc and libstdc++ |
|
2072 LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++" |
|
2073 NSPR_LDFLAGS="$NSPR_LDFLAGS -static-libgcc" |
|
2074 # Use temp file for windres (bug 213281) |
|
2075 RCFLAGS='-O coff --use-temp-file' |
|
2076 # mingw doesn't require kernel32, user32, and advapi32 explicitly |
|
2077 LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32 -lnetapi32" |
|
2078 MOZ_FIX_LINK_PATHS= |
|
2079 DLL_PREFIX= |
|
2080 IMPORT_LIB_SUFFIX=dll.a |
|
2081 |
|
2082 # We use mix of both POSIX and Win32 printf format across the tree, so format |
|
2083 # warnings are useless on mingw. |
|
2084 MOZ_C_SUPPORTS_WARNING(-Wno-, format, ac_c_has_wno_format) |
|
2085 MOZ_CXX_SUPPORTS_WARNING(-Wno-, format, ac_cxx_has_wno_format) |
|
2086 else |
|
2087 TARGET_COMPILER_ABI=msvc |
|
2088 HOST_CC='$(CC)' |
|
2089 HOST_CXX='$(CXX)' |
|
2090 HOST_LD='$(LD)' |
|
2091 if test "$AS_BIN"; then |
|
2092 AS="$(basename "$AS_BIN")" |
|
2093 fi |
|
2094 AR='lib' |
|
2095 AR_FLAGS='-NOLOGO -OUT:$@' |
|
2096 AR_EXTRACT= |
|
2097 RANLIB='echo not_ranlib' |
|
2098 STRIP='echo not_strip' |
|
2099 PKG_SKIP_STRIP=1 |
|
2100 XARGS=xargs |
|
2101 ZIP=zip |
|
2102 UNZIP=unzip |
|
2103 DOXYGEN=: |
|
2104 ASM_SUFFIX=asm |
|
2105 OBJ_SUFFIX=obj |
|
2106 LIB_SUFFIX=lib |
|
2107 DLL_PREFIX= |
|
2108 LIB_PREFIX= |
|
2109 IMPORT_LIB_SUFFIX=lib |
|
2110 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)' |
|
2111 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)' |
|
2112 MKSHLIB_FORCE_ALL= |
|
2113 MKSHLIB_UNFORCE_ALL= |
|
2114 DSO_LDOPTS=-SUBSYSTEM:WINDOWS |
|
2115 _USE_CPP_INCLUDE_FLAG=1 |
|
2116 _DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT' |
|
2117 _DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT' |
|
2118 CFLAGS="$CFLAGS -W3 -Gy" |
|
2119 CXXFLAGS="$CXXFLAGS -W3 -Gy" |
|
2120 if test "$_CC_SUITE" -ge "12"; then |
|
2121 dnl VS2013+ requires -FS when parallel building by make -jN. |
|
2122 dnl If nothing, compiler sometimes causes C1041 error. |
|
2123 dnl |
|
2124 dnl Visual Studio 2013 supports -Gw flags |
|
2125 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx |
|
2126 CFLAGS="$CFLAGS -FS -Gw" |
|
2127 CXXFLAGS="$CXXFLAGS -FS -Gw" |
|
2128 fi |
|
2129 # khuey says we can safely ignore MSVC warning C4251 |
|
2130 # MSVC warning C4244 (implicit type conversion may lose data) warns |
|
2131 # and requires workarounds for perfectly valid code. Also, GCC/clang |
|
2132 # don't warn about it by default. So for consistency/sanity, we turn |
|
2133 # it off on MSVC, too. |
|
2134 # MSVC warning C4345 warns of newly conformant behavior as of VS2003. |
|
2135 # MSVC warning C4351 warns of newly conformant behavior as of VS2005. |
|
2136 # MSVC warning C4482 warns when an enum value is refered specifing the |
|
2137 # name of the enum itself. This behavior is allowed in C++11, and the |
|
2138 # warning has been removed in VS2012. |
|
2139 # MSVC warning C4800 warns when a value is implicitly cast to bool, |
|
2140 # because this also forces narrowing to a single byte, which can be a |
|
2141 # perf hit. But this matters so little in practice (and often we want |
|
2142 # that behavior) that it's better to turn it off. |
|
2143 # MSVC warning C4819 warns some UTF-8 characters (e.g. copyright sign) |
|
2144 # on non-Western system locales even if it is in a comment. |
|
2145 CFLAGS="$CFLAGS -wd4244 -wd4819" |
|
2146 CXXFLAGS="$CXXFLAGS -wd4251 -wd4244 -wd4345 -wd4351 -wd4482 -wd4800 -wd4819" |
|
2147 # make 'foo == bar;' error out |
|
2148 CFLAGS="$CFLAGS -we4553" |
|
2149 CXXFLAGS="$CXXFLAGS -we4553" |
|
2150 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib netapi32.lib" |
|
2151 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV' |
|
2152 WARNINGS_AS_ERRORS='-WX' |
|
2153 MOZ_OPTIMIZE_FLAGS='-O1' |
|
2154 MOZ_FIX_LINK_PATHS= |
|
2155 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)' |
|
2156 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT" |
|
2157 if test -z "$DEVELOPER_OPTIONS"; then |
|
2158 LDFLAGS="$LDFLAGS -RELEASE" |
|
2159 fi |
|
2160 dnl For profile-guided optimization |
|
2161 PROFILE_GEN_CFLAGS="-GL" |
|
2162 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT" |
|
2163 dnl XXX: PGO builds can fail with warnings treated as errors, |
|
2164 dnl specifically "no profile data available" appears to be |
|
2165 dnl treated as an error sometimes. This might be a consequence |
|
2166 dnl of using WARNINGS_AS_ERRORS in some modules, combined |
|
2167 dnl with the linker doing most of the work in the whole-program |
|
2168 dnl optimization/PGO case. I think it's probably a compiler bug, |
|
2169 dnl but we work around it here. |
|
2170 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952" |
|
2171 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul. |
|
2172 dnl Probably also a compiler bug, but what can you do? |
|
2173 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE" |
|
2174 LDFLAGS="$LDFLAGS -DYNAMICBASE" |
|
2175 dnl Minimum reqiurement of Gecko is VS2010 or later which supports |
|
2176 dnl both SSSE3 and SSE4.1. |
|
2177 HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1 |
|
2178 HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1 |
|
2179 fi |
|
2180 AC_DEFINE(HAVE_SNPRINTF) |
|
2181 AC_DEFINE(_WINDOWS) |
|
2182 AC_DEFINE(WIN32) |
|
2183 AC_DEFINE(XP_WIN) |
|
2184 AC_DEFINE(XP_WIN32) |
|
2185 AC_DEFINE(HW_THREADS) |
|
2186 AC_DEFINE(STDC_HEADERS) |
|
2187 AC_DEFINE(WIN32_LEAN_AND_MEAN) |
|
2188 TARGET_MD_ARCH=win32 |
|
2189 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows' |
|
2190 BIN_SUFFIX='.exe' |
|
2191 MOZ_USER_DIR="Mozilla" |
|
2192 |
|
2193 dnl Hardcode to win95 for now - cls |
|
2194 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"' |
|
2195 |
|
2196 dnl set NO_X11 defines here as the general check is skipped on win32 |
|
2197 no_x=yes |
|
2198 AC_DEFINE(NO_X11) |
|
2199 |
|
2200 case "$host" in |
|
2201 *-mingw*) |
|
2202 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W` |
|
2203 if test -n "$L10NBASEDIR"; then |
|
2204 L10NBASEDIR=`cd $L10NBASEDIR && pwd -W` |
|
2205 fi |
|
2206 ;; |
|
2207 esac |
|
2208 |
|
2209 case "$host" in |
|
2210 *-mingw*) |
|
2211 if test -z "$MOZ_TOOLS"; then |
|
2212 AC_MSG_ERROR([MOZ_TOOLS is not set]) |
|
2213 fi |
|
2214 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W` |
|
2215 if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then |
|
2216 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS]) |
|
2217 fi |
|
2218 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)" |
|
2219 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then |
|
2220 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.]) |
|
2221 fi |
|
2222 ;; |
|
2223 esac |
|
2224 |
|
2225 case "$host_os" in |
|
2226 cygwin*|msvc*|mks*) |
|
2227 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.]) |
|
2228 ;; |
|
2229 esac |
|
2230 |
|
2231 case "$target" in |
|
2232 i*86-*) |
|
2233 if test "$HAVE_64BIT_OS"; then |
|
2234 AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.]) |
|
2235 fi |
|
2236 |
|
2237 if test -n "$GNU_CC"; then |
|
2238 CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport" |
|
2239 CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport" |
|
2240 LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup -Wl,--large-address-aware" |
|
2241 else |
|
2242 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86" |
|
2243 LDFLAGS="$LDFLAGS -SAFESEH" |
|
2244 fi |
|
2245 |
|
2246 AC_DEFINE(_X86_) |
|
2247 ;; |
|
2248 x86_64-*) |
|
2249 if test -n "$_WIN32_MSVC"; then |
|
2250 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64" |
|
2251 fi |
|
2252 AC_DEFINE(_AMD64_) |
|
2253 ;; |
|
2254 *) |
|
2255 AC_DEFINE(_CPU_ARCH_NOT_DEFINED) |
|
2256 ;; |
|
2257 esac |
|
2258 ;; |
|
2259 |
|
2260 *-netbsd*) |
|
2261 DSO_CFLAGS='' |
|
2262 CFLAGS="$CFLAGS -Dunix" |
|
2263 CXXFLAGS="$CXXFLAGS -Dunix" |
|
2264 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then |
|
2265 DLL_SUFFIX=".so" |
|
2266 DSO_PIC_CFLAGS='-fPIC -DPIC' |
|
2267 DSO_LDOPTS='-shared' |
|
2268 BIN_FLAGS='-Wl,--export-dynamic' |
|
2269 else |
|
2270 DSO_PIC_CFLAGS='-fPIC -DPIC' |
|
2271 DLL_SUFFIX=".so.1.0" |
|
2272 DSO_LDOPTS='-shared' |
|
2273 fi |
|
2274 # This will fail on a.out systems prior to 1.5.1_ALPHA. |
|
2275 MKSHLIB_FORCE_ALL='-Wl,--whole-archive' |
|
2276 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive' |
|
2277 if test "$LIBRUNPATH"; then |
|
2278 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS" |
|
2279 fi |
|
2280 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@) -o $@' |
|
2281 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(notdir $@)) -o $@' |
|
2282 ;; |
|
2283 |
|
2284 *-openbsd*) |
|
2285 if test "$SO_VERSION"; then |
|
2286 DLL_SUFFIX=".so.$SO_VERSION" |
|
2287 else |
|
2288 DLL_SUFFIX=".so.1.0" |
|
2289 fi |
|
2290 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib' |
|
2291 DSO_CFLAGS='' |
|
2292 DSO_PIC_CFLAGS='-fPIC' |
|
2293 DSO_LDOPTS='-shared -fPIC' |
|
2294 if test "$LIBRUNPATH"; then |
|
2295 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS" |
|
2296 fi |
|
2297 ;; |
|
2298 |
|
2299 *-solaris*) |
|
2300 AC_DEFINE(SOLARIS) |
|
2301 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"' |
|
2302 MOZ_FIX_LINK_PATHS= |
|
2303 # $ORIGIN/.. is for shared libraries under components/ to locate shared |
|
2304 # libraries one level up (e.g. libnspr4.so) |
|
2305 if test "$SOLARIS_SUNPRO_CC"; then |
|
2306 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs" |
|
2307 LIBS="-lCrun -lCstd -lc $LIBS" |
|
2308 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) |
|
2309 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__" |
|
2310 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef" |
|
2311 LDFLAGS="-xildoff $LDFLAGS" |
|
2312 MMX_FLAGS="-xarch=mmx -xO4" |
|
2313 SSE_FLAGS="-xarch=sse" |
|
2314 SSE2_FLAGS="-xarch=ssei2 -xO4" |
|
2315 if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then |
|
2316 _SAVE_LDFLAGS=$LDFLAGS |
|
2317 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS" |
|
2318 AC_TRY_LINK([#include <stdio.h>], |
|
2319 [printf("Hello World\n");], |
|
2320 , |
|
2321 [LDFLAGS=$_SAVE_LDFLAGS]) |
|
2322 fi |
|
2323 MOZ_OPTIMIZE_FLAGS="-xO4" |
|
2324 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@' |
|
2325 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(notdir $@) -o $@' |
|
2326 MKSHLIB_FORCE_ALL='-z allextract' |
|
2327 MKSHLIB_UNFORCE_ALL='-z defaultextract' |
|
2328 DSO_LDOPTS='-G' |
|
2329 AR_LIST="$AR t" |
|
2330 AR_EXTRACT="$AR x" |
|
2331 AR_DELETE="$AR d" |
|
2332 AR='$(CXX) -xar' |
|
2333 AR_FLAGS='-o $@' |
|
2334 AS='/usr/ccs/bin/as' |
|
2335 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0" |
|
2336 AS_DASH_C_FLAG='' |
|
2337 TARGET_COMPILER_ABI="sunc" |
|
2338 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'` |
|
2339 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'` |
|
2340 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9]) |
|
2341 AC_LANG_SAVE |
|
2342 AC_LANG_CPLUSPLUS |
|
2343 AC_TRY_COMPILE([], |
|
2344 [#if (__SUNPRO_CC < 0x590) |
|
2345 #error "Denied" |
|
2346 #endif], |
|
2347 _BAD_COMPILER=,_BAD_COMPILER=1) |
|
2348 if test -n "$_BAD_COMPILER"; then |
|
2349 _res="no" |
|
2350 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .]) |
|
2351 else |
|
2352 _res="yes" |
|
2353 fi |
|
2354 AC_TRY_COMPILE([], |
|
2355 [#if (__SUNPRO_CC >= 0x5100) |
|
2356 #error "Sun C++ 5.10 or above" |
|
2357 #endif], |
|
2358 _ABOVE_SS12U1=,_ABOVE_SS12U1=1) |
|
2359 if test "$_ABOVE_SS12U1"; then |
|
2360 # disable xannotate |
|
2361 CXXFLAGS="$CXXFLAGS -xannotate=no" |
|
2362 fi |
|
2363 AC_MSG_RESULT([$_res]) |
|
2364 AC_LANG_RESTORE |
|
2365 else |
|
2366 LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs" |
|
2367 LIBS="-lc $LIBS" |
|
2368 MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract' |
|
2369 MKSHLIB_UNFORCE_ALL='-Wl,-z -Wl,defaultextract' |
|
2370 ASFLAGS="$ASFLAGS -fPIC" |
|
2371 DSO_LDOPTS='-shared' |
|
2372 WARNINGS_AS_ERRORS='-Werror' |
|
2373 _WARNINGS_CFLAGS='' |
|
2374 _WARNINGS_CXXFLAGS='' |
|
2375 if test "$OS_RELEASE" = "5.3"; then |
|
2376 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES) |
|
2377 fi |
|
2378 fi |
|
2379 if test "$OS_RELEASE" = "5.5.1"; then |
|
2380 AC_DEFINE(NEED_USLEEP_PROTOTYPE) |
|
2381 fi |
|
2382 ;; |
|
2383 |
|
2384 *-sunos*) |
|
2385 DSO_LDOPTS='-Bdynamic' |
|
2386 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@' |
|
2387 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@' |
|
2388 AC_DEFINE(SUNOS4) |
|
2389 AC_DEFINE(SPRINTF_RETURNS_STRING) |
|
2390 case "$(target_os)" in |
|
2391 sunos4.1*) |
|
2392 DLL_SUFFIX='.so.1.0' |
|
2393 ;; |
|
2394 esac |
|
2395 ;; |
|
2396 |
|
2397 esac |
|
2398 |
|
2399 AC_SUBST_LIST(MMX_FLAGS) |
|
2400 AC_SUBST_LIST(SSE_FLAGS) |
|
2401 AC_SUBST_LIST(SSE2_FLAGS) |
|
2402 |
|
2403 case "$target" in |
|
2404 *-*linux*) |
|
2405 # Includes linux-android |
|
2406 AC_DEFINE(XP_LINUX) |
|
2407 ;; |
|
2408 esac |
|
2409 |
|
2410 AC_SUBST(MOZ_LINKER) |
|
2411 if test -n "$MOZ_LINKER"; then |
|
2412 AC_DEFINE(MOZ_LINKER) |
|
2413 fi |
|
2414 |
|
2415 dnl Only one oddball right now (QNX), but this gives us flexibility |
|
2416 dnl if any other platforms need to override this in the future. |
|
2417 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO) |
|
2418 |
|
2419 dnl ======================================================== |
|
2420 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined |
|
2421 dnl by now will not have any way to link most binaries (tests |
|
2422 dnl as well as viewer, apprunner, etc.), because some symbols |
|
2423 dnl will be left out of the "composite" .so's by ld as unneeded. |
|
2424 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms, |
|
2425 dnl they can link in the static libs that provide the missing |
|
2426 dnl symbols. |
|
2427 dnl ======================================================== |
|
2428 NO_LD_ARCHIVE_FLAGS= |
|
2429 if test -z "$MKSHLIB_FORCE_ALL" -o -z "$MKSHLIB_UNFORCE_ALL"; then |
|
2430 NO_LD_ARCHIVE_FLAGS=1 |
|
2431 fi |
|
2432 case "$target" in |
|
2433 *-aix4.3*|*-aix5*) |
|
2434 NO_LD_ARCHIVE_FLAGS= |
|
2435 ;; |
|
2436 *-mingw*) |
|
2437 if test -z "$GNU_CC"; then |
|
2438 NO_LD_ARCHIVE_FLAGS= |
|
2439 fi |
|
2440 ;; |
|
2441 esac |
|
2442 AC_SUBST(NO_LD_ARCHIVE_FLAGS) |
|
2443 |
|
2444 dnl ======================================================== |
|
2445 dnl = Flags to strip unused symbols from .so components and |
|
2446 dnl = to export jemalloc symbols when linking a program |
|
2447 dnl ======================================================== |
|
2448 case "$target" in |
|
2449 *-linux*|*-kfreebsd*-gnu|*-gnu*) |
|
2450 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script' |
|
2451 ;; |
|
2452 *-solaris*) |
|
2453 if test -z "$GNU_CC"; then |
|
2454 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile' |
|
2455 else |
|
2456 if test -z "$GCC_USE_GNU_LD"; then |
|
2457 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile' |
|
2458 else |
|
2459 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script' |
|
2460 fi |
|
2461 fi |
|
2462 ;; |
|
2463 *-darwin*) |
|
2464 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list' |
|
2465 ;; |
|
2466 *-mingw*) |
|
2467 if test -n "$GNU_CC"; then |
|
2468 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script' |
|
2469 fi |
|
2470 ;; |
|
2471 esac |
|
2472 |
|
2473 if test -z "$COMPILE_ENVIRONMENT"; then |
|
2474 SKIP_COMPILER_CHECKS=1 |
|
2475 SKIP_LIBRARY_CHECKS=1 |
|
2476 else |
|
2477 MOZ_COMPILER_OPTS |
|
2478 fi |
|
2479 |
|
2480 if test -z "$SKIP_COMPILER_CHECKS"; then |
|
2481 dnl Checks for typedefs, structures, and compiler characteristics. |
|
2482 dnl ======================================================== |
|
2483 AC_HEADER_STDC |
|
2484 AC_C_CONST |
|
2485 AC_TYPE_MODE_T |
|
2486 AC_TYPE_OFF_T |
|
2487 AC_TYPE_PID_T |
|
2488 AC_TYPE_SIZE_T |
|
2489 AC_LANG_CPLUSPLUS |
|
2490 AC_LANG_C |
|
2491 AC_MSG_CHECKING(for ssize_t) |
|
2492 AC_CACHE_VAL(ac_cv_type_ssize_t, |
|
2493 [AC_TRY_COMPILE([#include <stdio.h> |
|
2494 #include <sys/types.h>], |
|
2495 [ssize_t foo = 0;], |
|
2496 [ac_cv_type_ssize_t=true], |
|
2497 [ac_cv_type_ssize_t=false])]) |
|
2498 if test "$ac_cv_type_ssize_t" = true ; then |
|
2499 AC_DEFINE(HAVE_SSIZE_T) |
|
2500 AC_MSG_RESULT(yes) |
|
2501 else |
|
2502 AC_MSG_RESULT(no) |
|
2503 fi |
|
2504 AC_STRUCT_ST_BLKSIZE |
|
2505 AC_MSG_CHECKING(for siginfo_t) |
|
2506 AC_CACHE_VAL(ac_cv_siginfo_t, |
|
2507 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L |
|
2508 #include <signal.h>], |
|
2509 [siginfo_t* info;], |
|
2510 [ac_cv_siginfo_t=true], |
|
2511 [ac_cv_siginfo_t=false])]) |
|
2512 if test "$ac_cv_siginfo_t" = true ; then |
|
2513 AC_DEFINE(HAVE_SIGINFO_T) |
|
2514 AC_MSG_RESULT(yes) |
|
2515 else |
|
2516 AC_MSG_RESULT(no) |
|
2517 fi |
|
2518 |
|
2519 AC_LANG_CPLUSPLUS |
|
2520 |
|
2521 MOZ_CXX11 |
|
2522 |
|
2523 AC_LANG_C |
|
2524 |
|
2525 dnl Check for .hidden assembler directive and visibility attribute. |
|
2526 dnl Borrowed from glibc configure.in |
|
2527 dnl =============================================================== |
|
2528 if test "$GNU_CC"; then |
|
2529 AC_CACHE_CHECK(for visibility(hidden) attribute, |
|
2530 ac_cv_visibility_hidden, |
|
2531 [cat > conftest.c <<EOF |
|
2532 int foo __attribute__ ((visibility ("hidden"))) = 1; |
|
2533 EOF |
|
2534 ac_cv_visibility_hidden=no |
|
2535 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then |
|
2536 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then |
|
2537 ac_cv_visibility_hidden=yes |
|
2538 fi |
|
2539 fi |
|
2540 rm -f conftest.[cs] |
|
2541 ]) |
|
2542 if test "$ac_cv_visibility_hidden" = "yes"; then |
|
2543 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE) |
|
2544 |
|
2545 AC_CACHE_CHECK(for visibility(default) attribute, |
|
2546 ac_cv_visibility_default, |
|
2547 [cat > conftest.c <<EOF |
|
2548 int foo __attribute__ ((visibility ("default"))) = 1; |
|
2549 EOF |
|
2550 ac_cv_visibility_default=no |
|
2551 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then |
|
2552 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then |
|
2553 ac_cv_visibility_default=yes |
|
2554 fi |
|
2555 fi |
|
2556 rm -f conftest.[cs] |
|
2557 ]) |
|
2558 if test "$ac_cv_visibility_default" = "yes"; then |
|
2559 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE) |
|
2560 |
|
2561 AC_CACHE_CHECK(for visibility pragma support, |
|
2562 ac_cv_visibility_pragma, |
|
2563 [cat > conftest.c <<EOF |
|
2564 #pragma GCC visibility push(hidden) |
|
2565 int foo_hidden = 1; |
|
2566 #pragma GCC visibility push(default) |
|
2567 int foo_default = 1; |
|
2568 EOF |
|
2569 ac_cv_visibility_pragma=no |
|
2570 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then |
|
2571 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then |
|
2572 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then |
|
2573 ac_cv_visibility_pragma=yes |
|
2574 fi |
|
2575 fi |
|
2576 fi |
|
2577 rm -f conftest.[cs] |
|
2578 ]) |
|
2579 if test "$ac_cv_visibility_pragma" = "yes"; then |
|
2580 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905), |
|
2581 ac_cv_have_visibility_class_bug, |
|
2582 [cat > conftest.c <<EOF |
|
2583 #pragma GCC visibility push(hidden) |
|
2584 struct __attribute__ ((visibility ("default"))) TestStruct { |
|
2585 static void Init(); |
|
2586 }; |
|
2587 __attribute__ ((visibility ("default"))) void TestFunc() { |
|
2588 TestStruct::Init(); |
|
2589 } |
|
2590 EOF |
|
2591 ac_cv_have_visibility_class_bug=no |
|
2592 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then |
|
2593 ac_cv_have_visibility_class_bug=yes |
|
2594 else |
|
2595 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then |
|
2596 ac_cv_have_visibility_class_bug=yes |
|
2597 fi |
|
2598 fi |
|
2599 rm -rf conftest.{c,S} |
|
2600 ]) |
|
2601 |
|
2602 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297), |
|
2603 ac_cv_have_visibility_builtin_bug, |
|
2604 [cat > conftest.c <<EOF |
|
2605 #pragma GCC visibility push(hidden) |
|
2606 #pragma GCC visibility push(default) |
|
2607 #include <string.h> |
|
2608 #pragma GCC visibility pop |
|
2609 |
|
2610 __attribute__ ((visibility ("default"))) void Func() { |
|
2611 char c[[100]]; |
|
2612 memset(c, 0, sizeof(c)); |
|
2613 } |
|
2614 EOF |
|
2615 ac_cv_have_visibility_builtin_bug=no |
|
2616 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then |
|
2617 ac_cv_have_visibility_builtin_bug=yes |
|
2618 else |
|
2619 if test `grep -c "@PLT" conftest.S` = 0; then |
|
2620 ac_cv_visibility_builtin_bug=yes |
|
2621 fi |
|
2622 fi |
|
2623 rm -f conftest.{c,S} |
|
2624 ]) |
|
2625 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ |
|
2626 "$ac_cv_have_visibility_class_bug" = "no"; then |
|
2627 VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h' |
|
2628 WRAP_SYSTEM_INCLUDES=1 |
|
2629 STL_FLAGS='-I$(DIST)/stl_wrappers' |
|
2630 WRAP_STL_INCLUDES=1 |
|
2631 else |
|
2632 VISIBILITY_FLAGS='-fvisibility=hidden' |
|
2633 fi # have visibility pragma bug |
|
2634 fi # have visibility pragma |
|
2635 fi # have visibility(default) attribute |
|
2636 fi # have visibility(hidden) attribute |
|
2637 fi # GNU_CC |
|
2638 |
|
2639 # visibility hidden flag for Sun Studio on Solaris |
|
2640 if test "$SOLARIS_SUNPRO_CC"; then |
|
2641 VISIBILITY_FLAGS='-xldscope=hidden' |
|
2642 fi # Sun Studio on Solaris |
|
2643 |
|
2644 AC_SUBST(WRAP_SYSTEM_INCLUDES) |
|
2645 AC_SUBST(VISIBILITY_FLAGS) |
|
2646 |
|
2647 MOZ_GCC_PR49911 |
|
2648 MOZ_GCC_PR39608 |
|
2649 if test "$OS_TARGET" != WINNT; then |
|
2650 # Only run this test with clang on non-Windows platforms, because clang |
|
2651 # cannot do enough code gen for now to make this test work correctly. |
|
2652 MOZ_LLVM_PR8927 |
|
2653 fi |
|
2654 |
|
2655 dnl Check for __force_align_arg_pointer__ for SSE2 on gcc |
|
2656 dnl ======================================================== |
|
2657 if test "$GNU_CC"; then |
|
2658 CFLAGS_save="${CFLAGS}" |
|
2659 CFLAGS="${CFLAGS} -Werror" |
|
2660 AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute, |
|
2661 ac_cv_force_align_arg_pointer, |
|
2662 [AC_TRY_COMPILE([__attribute__ ((__force_align_arg_pointer__)) void test() {}], |
|
2663 [], |
|
2664 ac_cv_force_align_arg_pointer="yes", |
|
2665 ac_cv_force_align_arg_pointer="no")]) |
|
2666 CFLAGS="${CFLAGS_save}" |
|
2667 if test "$ac_cv_force_align_arg_pointer" = "yes"; then |
|
2668 HAVE_GCC_ALIGN_ARG_POINTER=1 |
|
2669 else |
|
2670 HAVE_GCC_ALIGN_ARG_POINTER= |
|
2671 fi |
|
2672 fi |
|
2673 AC_SUBST(HAVE_GCC_ALIGN_ARG_POINTER) |
|
2674 |
|
2675 dnl Checks for header files. |
|
2676 dnl ======================================================== |
|
2677 AC_HEADER_DIRENT |
|
2678 case "$target_os" in |
|
2679 freebsd*|openbsd*) |
|
2680 # for stuff like -lXshm |
|
2681 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}" |
|
2682 ;; |
|
2683 esac |
|
2684 MOZ_CHECK_COMMON_HEADERS |
|
2685 |
|
2686 dnl These are all the places some variant of statfs can be hiding. |
|
2687 MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h) |
|
2688 |
|
2689 dnl Quota support |
|
2690 MOZ_CHECK_HEADERS(sys/quota.h sys/sysmacros.h) |
|
2691 MOZ_CHECK_HEADERS([linux/quota.h],,,[#include <sys/socket.h>]) |
|
2692 |
|
2693 dnl SCTP support - needs various network include headers |
|
2694 MOZ_CHECK_HEADERS([linux/if_addr.h linux/rtnetlink.h],,,[#include <sys/socket.h>]) |
|
2695 |
|
2696 MOZ_CHECK_HEADERS(sys/types.h netinet/in.h byteswap.h) |
|
2697 |
|
2698 dnl Check for sin_len and sin6_len - used by SCTP; only appears in Mac/*BSD generally |
|
2699 AC_CACHE_CHECK(for sockaddr_in.sin_len, |
|
2700 ac_cv_sockaddr_in_sin_len, |
|
2701 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H |
|
2702 #include <sys/types.h> |
|
2703 #endif |
|
2704 #include <netinet/in.h> |
|
2705 struct sockaddr_in x; |
|
2706 void *foo = (void*) &x.sin_len;], |
|
2707 [], |
|
2708 [ac_cv_sockaddr_in_sin_len=true], |
|
2709 [ac_cv_sockaddr_in_sin_len=false])]) |
|
2710 if test "$ac_cv_sockaddr_in_sin_len" = true ; then |
|
2711 AC_DEFINE(HAVE_SIN_LEN) |
|
2712 dnl HAVE_CONN_LEN must be the same as HAVE_SIN_LEN (and HAVE_SIN6_LEN too) |
|
2713 AC_DEFINE(HAVE_SCONN_LEN) |
|
2714 fi |
|
2715 |
|
2716 AC_CACHE_CHECK(for sockaddr_in6.sin6_len, |
|
2717 ac_cv_sockaddr_in6_sin6_len, |
|
2718 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H |
|
2719 #include <sys/types.h> |
|
2720 #endif |
|
2721 #include <netinet/in.h> |
|
2722 struct sockaddr_in6 x; |
|
2723 void *foo = (void*) &x.sin6_len;], |
|
2724 [], |
|
2725 [ac_cv_sockaddr_in6_sin6_len=true], |
|
2726 [ac_cv_sockaddr_in6_sin6_len=false])]) |
|
2727 if test "$ac_cv_sockaddr_in6_sin6_len" = true ; then |
|
2728 AC_DEFINE(HAVE_SIN6_LEN) |
|
2729 fi |
|
2730 |
|
2731 AC_CACHE_CHECK(for sockaddr.sa_len, |
|
2732 ac_cv_sockaddr_sa_len, |
|
2733 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H |
|
2734 #include <sys/types.h> |
|
2735 #endif |
|
2736 #include <sys/socket.h> |
|
2737 struct sockaddr x; |
|
2738 void *foo = (void*) &x.sa_len;], |
|
2739 [], |
|
2740 [ac_cv_sockaddr_sa_len=true], |
|
2741 [ac_cv_sockaddr_sa_len=false])]) |
|
2742 if test "$ac_cv_sockaddr_sa_len" = true ; then |
|
2743 AC_DEFINE(HAVE_SA_LEN) |
|
2744 fi |
|
2745 |
|
2746 AC_ARG_ENABLE(dtrace, |
|
2747 [ --enable-dtrace build with dtrace support if available (default=no)], |
|
2748 [enable_dtrace="yes"],) |
|
2749 if test "x$enable_dtrace" = "xyes"; then |
|
2750 MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1) |
|
2751 if test -n "$HAVE_DTRACE"; then |
|
2752 AC_DEFINE(INCLUDE_MOZILLA_DTRACE) |
|
2753 else |
|
2754 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]); |
|
2755 fi |
|
2756 fi |
|
2757 AC_SUBST(HAVE_DTRACE) |
|
2758 |
|
2759 case $target in |
|
2760 *-aix4.3*|*-aix5*) |
|
2761 ;; |
|
2762 *) |
|
2763 MOZ_CHECK_HEADERS(sys/cdefs.h) |
|
2764 ;; |
|
2765 esac |
|
2766 |
|
2767 MOZ_LINUX_PERF_EVENT |
|
2768 |
|
2769 dnl Checks for libraries. |
|
2770 dnl ======================================================== |
|
2771 case $target in |
|
2772 *-hpux11.*) |
|
2773 ;; |
|
2774 *) |
|
2775 AC_CHECK_LIB(c_r, gethostbyname_r) |
|
2776 ;; |
|
2777 esac |
|
2778 |
|
2779 dnl We don't want to link with libdl even if it's present on OS X, since |
|
2780 dnl it's not used and not part of the default installation. OS/2 has dlfcn |
|
2781 dnl in libc. |
|
2782 dnl We don't want to link against libm or libpthread on Darwin since |
|
2783 dnl they both are just symlinks to libSystem and explicitly linking |
|
2784 dnl against libSystem causes issues when debugging (see bug 299601). |
|
2785 case $target in |
|
2786 *-darwin*) |
|
2787 ;; |
|
2788 *) |
|
2789 AC_SEARCH_LIBS(dlopen, dl, |
|
2790 MOZ_CHECK_HEADER(dlfcn.h, |
|
2791 AC_DEFINE(HAVE_DLOPEN))) |
|
2792 ;; |
|
2793 esac |
|
2794 |
|
2795 _SAVE_CFLAGS="$CFLAGS" |
|
2796 CFLAGS="$CFLAGS -D_GNU_SOURCE" |
|
2797 AC_CHECK_FUNCS(dladdr memmem) |
|
2798 CFLAGS="$_SAVE_CFLAGS" |
|
2799 |
|
2800 if test ! "$GNU_CXX"; then |
|
2801 |
|
2802 case $target in |
|
2803 *-aix*) |
|
2804 AC_CHECK_LIB(C_r, demangle) |
|
2805 ;; |
|
2806 *) |
|
2807 AC_CHECK_LIB(C, demangle) |
|
2808 ;; |
|
2809 esac |
|
2810 fi |
|
2811 |
|
2812 AC_CHECK_LIB(socket, socket) |
|
2813 |
|
2814 XLDFLAGS="$X_LIBS" |
|
2815 XLIBS="$X_EXTRA_LIBS" |
|
2816 |
|
2817 dnl ======================================================== |
|
2818 dnl Checks for X libraries. |
|
2819 dnl Ordering is important. |
|
2820 dnl Xt is dependent upon SM as of X11R6 |
|
2821 dnl ======================================================== |
|
2822 if test "$no_x" = "yes"; then |
|
2823 AC_DEFINE(NO_X11) |
|
2824 else |
|
2825 AC_DEFINE_UNQUOTED(FUNCPROTO,15) |
|
2826 XLIBS="-lX11 $XLIBS" |
|
2827 _SAVE_LDFLAGS="$LDFLAGS" |
|
2828 LDFLAGS="$XLDFLAGS $LDFLAGS" |
|
2829 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"], |
|
2830 [MISSING_X="$MISSING_X -lX11"], $XLIBS) |
|
2831 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"], |
|
2832 [MISSING_X="$MISSING_X -lXext"], $XLIBS) |
|
2833 |
|
2834 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [ |
|
2835 unset ac_cv_lib_Xt_XtFree |
|
2836 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS) |
|
2837 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS) |
|
2838 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"], |
|
2839 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS) |
|
2840 ]) |
|
2841 |
|
2842 # AIX needs the motif library linked before libXt to prevent |
|
2843 # crashes in plugins linked against Motif - Bug #98892 |
|
2844 case "${target_os}" in |
|
2845 aix*) |
|
2846 XT_LIBS="-lXm $XT_LIBS" |
|
2847 ;; |
|
2848 esac |
|
2849 |
|
2850 dnl ======================================================== |
|
2851 dnl = Check for XShm |
|
2852 dnl ======================================================== |
|
2853 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,, |
|
2854 $XLIBS $XEXT_LIBS) |
|
2855 |
|
2856 dnl ======================================================== |
|
2857 dnl = Check for Xss |
|
2858 dnl ======================================================== |
|
2859 MOZ_CHECK_HEADER(X11/extensions/scrnsaver.h, |
|
2860 AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, |
|
2861 [XSS_LIBS="-lXss $XEXT_LIBS $XLIBS" |
|
2862 AC_DEFINE(HAVE_LIBXSS)],, $XEXT_LIBS $XLIBS)) |
|
2863 |
|
2864 LDFLAGS="$_SAVE_LDFLAGS" |
|
2865 fi # $no_x |
|
2866 |
|
2867 AC_SUBST(XCFLAGS) |
|
2868 AC_SUBST(XLDFLAGS) |
|
2869 AC_SUBST(XLIBS) |
|
2870 AC_SUBST(XEXT_LIBS) |
|
2871 AC_SUBST(XT_LIBS) |
|
2872 AC_SUBST(XSS_LIBS) |
|
2873 |
|
2874 dnl ======================================================== |
|
2875 dnl = pthread support |
|
2876 dnl = Start by checking whether the system support pthreads |
|
2877 dnl ======================================================== |
|
2878 case "$target_os" in |
|
2879 darwin*) |
|
2880 MOZ_USE_PTHREADS=1 |
|
2881 ;; |
|
2882 *) |
|
2883 MOZ_CHECK_PTHREADS(pthreads, |
|
2884 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads", |
|
2885 MOZ_CHECK_PTHREADS(pthread, |
|
2886 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread", |
|
2887 MOZ_CHECK_PTHREADS(c_r, |
|
2888 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r", |
|
2889 MOZ_CHECK_PTHREADS(c, |
|
2890 MOZ_USE_PTHREADS=1 |
|
2891 ) |
|
2892 ) |
|
2893 ) |
|
2894 ) |
|
2895 ;; |
|
2896 esac |
|
2897 |
|
2898 dnl ======================================================== |
|
2899 dnl Check the command line for --with-pthreads |
|
2900 dnl ======================================================== |
|
2901 MOZ_ARG_WITH_BOOL(pthreads, |
|
2902 [ --with-pthreads Force use of system pthread library with NSPR ], |
|
2903 [ if test "$MOZ_USE_PTHREADS"x = x; then |
|
2904 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]); |
|
2905 fi], |
|
2906 MOZ_USE_PTHREADS= |
|
2907 _PTHREAD_LDFLAGS= |
|
2908 ) |
|
2909 |
|
2910 dnl ======================================================== |
|
2911 dnl Do the platform specific pthread hackery |
|
2912 dnl ======================================================== |
|
2913 if test "$MOZ_USE_PTHREADS"x != x |
|
2914 then |
|
2915 dnl |
|
2916 dnl See if -pthread is supported. |
|
2917 dnl |
|
2918 rm -f conftest* |
|
2919 ac_cv_have_dash_pthread=no |
|
2920 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread) |
|
2921 echo 'int main() { return 0; }' | cat > conftest.c |
|
2922 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 |
|
2923 if test $? -eq 0; then |
|
2924 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then |
|
2925 ac_cv_have_dash_pthread=yes |
|
2926 case "$target_os" in |
|
2927 freebsd*) |
|
2928 # Freebsd doesn't use -pthread for compiles, it uses them for linking |
|
2929 ;; |
|
2930 *) |
|
2931 CFLAGS="$CFLAGS -pthread" |
|
2932 CXXFLAGS="$CXXFLAGS -pthread" |
|
2933 ;; |
|
2934 esac |
|
2935 fi |
|
2936 fi |
|
2937 rm -f conftest* |
|
2938 AC_MSG_RESULT($ac_cv_have_dash_pthread) |
|
2939 |
|
2940 dnl |
|
2941 dnl See if -pthreads is supported. |
|
2942 dnl |
|
2943 ac_cv_have_dash_pthreads=no |
|
2944 if test "$ac_cv_have_dash_pthread" = "no"; then |
|
2945 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads) |
|
2946 echo 'int main() { return 0; }' | cat > conftest.c |
|
2947 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 |
|
2948 if test $? -eq 0; then |
|
2949 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then |
|
2950 ac_cv_have_dash_pthreads=yes |
|
2951 CFLAGS="$CFLAGS -pthreads" |
|
2952 CXXFLAGS="$CXXFLAGS -pthreads" |
|
2953 fi |
|
2954 fi |
|
2955 rm -f conftest* |
|
2956 AC_MSG_RESULT($ac_cv_have_dash_pthreads) |
|
2957 fi |
|
2958 |
|
2959 case "$target" in |
|
2960 *-*-freebsd*) |
|
2961 AC_DEFINE(_REENTRANT) |
|
2962 AC_DEFINE(_THREAD_SAFE) |
|
2963 dnl -pthread links in -lpthread, so don't specify it explicitly. |
|
2964 if test "$ac_cv_have_dash_pthread" = "yes"; then |
|
2965 _PTHREAD_LDFLAGS="-pthread" |
|
2966 fi |
|
2967 ;; |
|
2968 |
|
2969 *-*-openbsd*|*-*-bsdi*) |
|
2970 AC_DEFINE(_REENTRANT) |
|
2971 AC_DEFINE(_THREAD_SAFE) |
|
2972 dnl -pthread links in -lc_r, so don't specify it explicitly. |
|
2973 if test "$ac_cv_have_dash_pthread" = "yes"; then |
|
2974 _PTHREAD_LDFLAGS="-pthread" |
|
2975 fi |
|
2976 ;; |
|
2977 |
|
2978 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*) |
|
2979 AC_DEFINE(_REENTRANT) |
|
2980 ;; |
|
2981 |
|
2982 *-aix4.3*|*-aix5*) |
|
2983 AC_DEFINE(_REENTRANT) |
|
2984 ;; |
|
2985 |
|
2986 *-hpux11.*) |
|
2987 AC_DEFINE(_REENTRANT) |
|
2988 ;; |
|
2989 |
|
2990 *-*-solaris*) |
|
2991 AC_DEFINE(_REENTRANT) |
|
2992 if test "$SOLARIS_SUNPRO_CC"; then |
|
2993 CFLAGS="$CFLAGS -mt" |
|
2994 CXXFLAGS="$CXXFLAGS -mt" |
|
2995 fi |
|
2996 ;; |
|
2997 esac |
|
2998 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}" |
|
2999 AC_SUBST(MOZ_USE_PTHREADS) |
|
3000 fi |
|
3001 |
|
3002 |
|
3003 dnl Checks for library functions. |
|
3004 dnl ======================================================== |
|
3005 AC_PROG_GCC_TRADITIONAL |
|
3006 AC_FUNC_MEMCMP |
|
3007 AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r) |
|
3008 |
|
3009 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock |
|
3010 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC), |
|
3011 ac_cv_clock_monotonic, |
|
3012 [for libs in "" -lrt; do |
|
3013 _SAVE_LIBS="$LIBS" |
|
3014 LIBS="$LIBS $libs" |
|
3015 AC_TRY_LINK([#include <time.h>], |
|
3016 [ struct timespec ts; |
|
3017 clock_gettime(CLOCK_MONOTONIC, &ts); ], |
|
3018 ac_cv_clock_monotonic=$libs |
|
3019 LIBS="$_SAVE_LIBS" |
|
3020 break, |
|
3021 ac_cv_clock_monotonic=no) |
|
3022 LIBS="$_SAVE_LIBS" |
|
3023 done]) |
|
3024 if test "$ac_cv_clock_monotonic" != "no"; then |
|
3025 HAVE_CLOCK_MONOTONIC=1 |
|
3026 REALTIME_LIBS=$ac_cv_clock_monotonic |
|
3027 AC_DEFINE(HAVE_CLOCK_MONOTONIC) |
|
3028 AC_SUBST(HAVE_CLOCK_MONOTONIC) |
|
3029 AC_SUBST(REALTIME_LIBS) |
|
3030 fi |
|
3031 |
|
3032 dnl check for wcrtomb/mbrtowc |
|
3033 dnl ======================================================================= |
|
3034 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then |
|
3035 AC_LANG_SAVE |
|
3036 AC_LANG_CPLUSPLUS |
|
3037 AC_CACHE_CHECK(for wcrtomb, |
|
3038 ac_cv_have_wcrtomb, |
|
3039 [AC_TRY_LINK([#include <wchar.h>], |
|
3040 [mbstate_t ps={0};wcrtomb(0,'f',&ps);], |
|
3041 ac_cv_have_wcrtomb="yes", |
|
3042 ac_cv_have_wcrtomb="no")]) |
|
3043 if test "$ac_cv_have_wcrtomb" = "yes"; then |
|
3044 AC_DEFINE(HAVE_WCRTOMB) |
|
3045 fi |
|
3046 AC_CACHE_CHECK(for mbrtowc, |
|
3047 ac_cv_have_mbrtowc, |
|
3048 [AC_TRY_LINK([#include <wchar.h>], |
|
3049 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);], |
|
3050 ac_cv_have_mbrtowc="yes", |
|
3051 ac_cv_have_mbrtowc="no")]) |
|
3052 if test "$ac_cv_have_mbrtowc" = "yes"; then |
|
3053 AC_DEFINE(HAVE_MBRTOWC) |
|
3054 fi |
|
3055 AC_LANG_RESTORE |
|
3056 fi |
|
3057 |
|
3058 AC_CACHE_CHECK( |
|
3059 [for res_ninit()], |
|
3060 ac_cv_func_res_ninit, |
|
3061 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then |
|
3062 dnl no need for res_ninit() on NetBSD and OpenBSD |
|
3063 ac_cv_func_res_ninit=no |
|
3064 else |
|
3065 AC_TRY_LINK([ |
|
3066 #ifdef linux |
|
3067 #define _BSD_SOURCE 1 |
|
3068 #endif |
|
3069 #include <sys/types.h> |
|
3070 #include <netinet/in.h> |
|
3071 #include <arpa/nameser.h> |
|
3072 #include <resolv.h> |
|
3073 ], |
|
3074 [int foo = res_ninit(&_res);], |
|
3075 [ac_cv_func_res_ninit=yes], |
|
3076 [ac_cv_func_res_ninit=no]) |
|
3077 fi |
|
3078 ]) |
|
3079 |
|
3080 if test "$ac_cv_func_res_ninit" = "yes"; then |
|
3081 AC_DEFINE(HAVE_RES_NINIT) |
|
3082 dnl must add the link line we do something as foolish as this... dougt |
|
3083 dnl else |
|
3084 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT), |
|
3085 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT))) |
|
3086 fi |
|
3087 |
|
3088 AC_LANG_CPLUSPLUS |
|
3089 |
|
3090 case $target_os in |
|
3091 darwin*|mingw*) |
|
3092 ;; |
|
3093 *) |
|
3094 |
|
3095 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"], |
|
3096 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"], |
|
3097 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"]))) |
|
3098 _SAVE_LIBS=$LIBS |
|
3099 LIBS="$LIBS $_ICONV_LIBS" |
|
3100 AC_CACHE_CHECK( |
|
3101 [for iconv()], |
|
3102 ac_cv_func_iconv, |
|
3103 [AC_TRY_LINK([ |
|
3104 #include <stdlib.h> |
|
3105 #include <iconv.h> |
|
3106 ], |
|
3107 [ |
|
3108 iconv_t h = iconv_open("", ""); |
|
3109 iconv(h, NULL, NULL, NULL, NULL); |
|
3110 iconv_close(h); |
|
3111 ], |
|
3112 [ac_cv_func_iconv=yes], |
|
3113 [ac_cv_func_iconv=no] |
|
3114 )] |
|
3115 ) |
|
3116 if test "$ac_cv_func_iconv" = "yes"; then |
|
3117 AC_DEFINE(HAVE_ICONV) |
|
3118 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS" |
|
3119 LIBICONV="$_ICONV_LIBS" |
|
3120 AC_CACHE_CHECK( |
|
3121 [for iconv() with const input], |
|
3122 ac_cv_func_const_iconv, |
|
3123 [AC_TRY_COMPILE([ |
|
3124 #include <stdlib.h> |
|
3125 #include <iconv.h> |
|
3126 ], |
|
3127 [ |
|
3128 const char *input = "testing"; |
|
3129 iconv_t h = iconv_open("", ""); |
|
3130 iconv(h, &input, NULL, NULL, NULL); |
|
3131 iconv_close(h); |
|
3132 ], |
|
3133 [ac_cv_func_const_iconv=yes], |
|
3134 [ac_cv_func_const_iconv=no] |
|
3135 )] |
|
3136 ) |
|
3137 if test "$ac_cv_func_const_iconv" = "yes"; then |
|
3138 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT) |
|
3139 fi |
|
3140 fi |
|
3141 LIBS=$_SAVE_LIBS |
|
3142 |
|
3143 ;; |
|
3144 esac |
|
3145 |
|
3146 AM_LANGINFO_CODESET |
|
3147 |
|
3148 AC_LANG_C |
|
3149 |
|
3150 dnl ********************** |
|
3151 dnl *** va_copy checks *** |
|
3152 AC_CACHE_CHECK([for an implementation of va_copy()], |
|
3153 ac_cv_va_copy, |
|
3154 [AC_TRY_COMPILE([#include <stdarg.h> |
|
3155 #include <stdlib.h> |
|
3156 void f (int i, ...) { |
|
3157 va_list args1, args2; |
|
3158 va_start (args1, i); |
|
3159 va_copy (args2, args1); |
|
3160 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) |
|
3161 exit (1); |
|
3162 va_end (args1); va_end (args2); |
|
3163 }], |
|
3164 [f(0, 42); return 0], |
|
3165 [ac_cv_va_copy=yes], |
|
3166 [ac_cv_va_copy=no] |
|
3167 )] |
|
3168 ) |
|
3169 AC_CACHE_CHECK([whether va_list can be copied by value], |
|
3170 ac_cv_va_val_copy, |
|
3171 [AC_TRY_COMPILE([#include <stdarg.h> |
|
3172 #include <stdlib.h> |
|
3173 void f (int i, ...) { |
|
3174 va_list args1, args2; |
|
3175 va_start (args1, i); |
|
3176 args2 = args1; |
|
3177 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) |
|
3178 exit (1); |
|
3179 va_end (args1); va_end (args2); |
|
3180 }], |
|
3181 [f(0, 42); return 0], |
|
3182 [ac_cv_va_val_copy=yes], |
|
3183 [ac_cv_va_val_copy=no], |
|
3184 )] |
|
3185 ) |
|
3186 if test "x$ac_cv_va_copy" = "xyes"; then |
|
3187 AC_DEFINE(VA_COPY, va_copy) |
|
3188 AC_DEFINE(HAVE_VA_COPY) |
|
3189 fi |
|
3190 |
|
3191 if test "x$ac_cv_va_val_copy" = "xno"; then |
|
3192 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY) |
|
3193 fi |
|
3194 |
|
3195 dnl =================================================================== |
|
3196 dnl ======================================================== |
|
3197 dnl Put your C++ language/feature checks below |
|
3198 dnl ======================================================== |
|
3199 AC_LANG_CPLUSPLUS |
|
3200 |
|
3201 ARM_ABI_PREFIX= |
|
3202 if test "$GNU_CC"; then |
|
3203 if test "$CPU_ARCH" = "arm" ; then |
|
3204 AC_CACHE_CHECK(for ARM EABI, |
|
3205 ac_cv_gcc_arm_eabi, |
|
3206 [AC_TRY_COMPILE([], |
|
3207 [ |
|
3208 #if defined(__ARM_EABI__) |
|
3209 return 0; |
|
3210 #else |
|
3211 #error Not ARM EABI. |
|
3212 #endif |
|
3213 ], |
|
3214 ac_cv_gcc_arm_eabi="yes", |
|
3215 ac_cv_gcc_arm_eabi="no")]) |
|
3216 if test "$ac_cv_gcc_arm_eabi" = "yes"; then |
|
3217 HAVE_ARM_EABI=1 |
|
3218 ARM_ABI_PREFIX=eabi- |
|
3219 else |
|
3220 ARM_ABI_PREFIX=oabi- |
|
3221 fi |
|
3222 fi |
|
3223 |
|
3224 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}" |
|
3225 fi |
|
3226 |
|
3227 dnl Check to see if we can resolve ambiguity with |using|. |
|
3228 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity, |
|
3229 ac_cv_cpp_ambiguity_resolving_using, |
|
3230 [AC_TRY_COMPILE(class X { |
|
3231 public: int go(const X&) {return 3;} |
|
3232 int jo(const X&) {return 3;} |
|
3233 }; |
|
3234 class Y : public X { |
|
3235 public: int go(int) {return 2;} |
|
3236 int jo(int) {return 2;} |
|
3237 using X::jo; |
|
3238 private: using X::go; |
|
3239 };, |
|
3240 X x; Y y; y.jo(x);, |
|
3241 ac_cv_cpp_ambiguity_resolving_using=yes, |
|
3242 ac_cv_cpp_ambiguity_resolving_using=no)]) |
|
3243 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then |
|
3244 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING) |
|
3245 fi |
|
3246 |
|
3247 dnl See if a dynamic_cast to void* gives the most derived object. |
|
3248 AC_CACHE_CHECK(for C++ dynamic_cast to void*, |
|
3249 ac_cv_cpp_dynamic_cast_void_ptr, |
|
3250 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } }; |
|
3251 class Y { int j; public: virtual ~Y() { } }; |
|
3252 class Z : public X, public Y { int k; }; |
|
3253 |
|
3254 int main() { |
|
3255 Z mdo; |
|
3256 X *subx = (X*)&mdo; |
|
3257 Y *suby = (Y*)&mdo; |
|
3258 return !((((void*)&mdo != (void*)subx) && |
|
3259 ((void*)&mdo == dynamic_cast<void*>(subx))) || |
|
3260 (((void*)&mdo != (void*)suby) && |
|
3261 ((void*)&mdo == dynamic_cast<void*>(suby)))); |
|
3262 }], |
|
3263 ac_cv_cpp_dynamic_cast_void_ptr=yes, |
|
3264 ac_cv_cpp_dynamic_cast_void_ptr=no, |
|
3265 ac_cv_cpp_dynamic_cast_void_ptr=no)]) |
|
3266 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then |
|
3267 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR) |
|
3268 fi |
|
3269 |
|
3270 |
|
3271 dnl note that this one is reversed - if the test fails, then |
|
3272 dnl we require implementations of unused virtual methods. Which |
|
3273 dnl really blows because it means we'll have useless vtable |
|
3274 dnl bloat. |
|
3275 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods, |
|
3276 ac_cv_cpp_unused_required, |
|
3277 [AC_TRY_LINK(class X {private: virtual void never_called();};, |
|
3278 X x;, |
|
3279 ac_cv_cpp_unused_required=no, |
|
3280 ac_cv_cpp_unused_required=yes)]) |
|
3281 if test "$ac_cv_cpp_unused_required" = yes ; then |
|
3282 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS) |
|
3283 fi |
|
3284 |
|
3285 |
|
3286 dnl Some compilers have trouble comparing a constant reference to a templatized |
|
3287 dnl class to zero, and require an explicit operator==() to be defined that takes |
|
3288 dnl an int. This test separates the strong from the weak. |
|
3289 |
|
3290 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(), |
|
3291 ac_cv_trouble_comparing_to_zero, |
|
3292 [AC_TRY_COMPILE([#include <algorithm> |
|
3293 template <class T> class Foo {}; |
|
3294 class T2; |
|
3295 template <class T> int operator==(const T2*, const T&) { return 0; } |
|
3296 template <class T> int operator!=(const T2*, const T&) { return 0; }], |
|
3297 [Foo<int> f; return (0 != f);], |
|
3298 ac_cv_trouble_comparing_to_zero=no, |
|
3299 ac_cv_trouble_comparing_to_zero=yes)]) |
|
3300 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then |
|
3301 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO) |
|
3302 fi |
|
3303 |
|
3304 # try harder, when checking for __thread support, see bug 521750 comment #33 and below |
|
3305 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is |
|
3306 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when |
|
3307 # linking XUL. |
|
3308 _SAVE_LDFLAGS=$LDFLAGS |
|
3309 LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS" |
|
3310 AC_CACHE_CHECK(for __thread keyword for TLS variables, |
|
3311 ac_cv_thread_keyword, |
|
3312 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;], |
|
3313 [return tlsIsMainThread;], |
|
3314 ac_cv_thread_keyword=yes, |
|
3315 ac_cv_thread_keyword=no)]) |
|
3316 LDFLAGS=$_SAVE_LDFLAGS |
|
3317 # The custom dynamic linker doesn't support TLS variables |
|
3318 MOZ_TLS= |
|
3319 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then |
|
3320 # mips builds fail with TLS variables because of a binutils bug. |
|
3321 # See bug 528687 |
|
3322 # OpenBSD doesn't have TLS support, and the test succeeds with clang++ |
|
3323 case "${target}" in |
|
3324 mips*-*) |
|
3325 : |
|
3326 ;; |
|
3327 *-android*|*-linuxandroid*) |
|
3328 : |
|
3329 ;; |
|
3330 *-openbsd*) |
|
3331 : |
|
3332 ;; |
|
3333 *) |
|
3334 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD) |
|
3335 MOZ_TLS=1 |
|
3336 ;; |
|
3337 esac |
|
3338 fi |
|
3339 |
|
3340 dnl Using the custom linker on ARMv6 requires 16k alignment of ELF segments. |
|
3341 if test -n "$MOZ_LINKER"; then |
|
3342 if test "$CPU_ARCH" = arm; then |
|
3343 dnl When building for < ARMv7, we need to ensure 16k alignment of ELF segments |
|
3344 if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then |
|
3345 LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000" |
|
3346 _SUBDIR_LDFLAGS="$_SUBDIR_LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000" |
|
3347 fi |
|
3348 fi |
|
3349 fi |
|
3350 |
|
3351 dnl The custom linker doesn't support text relocations, but NDK >= r6b |
|
3352 dnl creates some (http://code.google.com/p/android/issues/detail?id=23203) |
|
3353 dnl We however want to avoid these text relocations, and this can be done |
|
3354 dnl by making gcc not link crtbegin and crtend. In the broken NDKs, crtend |
|
3355 dnl doesn't contain anything at all, beside placeholders for some sections, |
|
3356 dnl and crtbegin only contains a finalizer function that calls |
|
3357 dnl __cxa_finalize. The custom linker actually takes care of calling |
|
3358 dnl __cxa_finalize when the library doesn't call it itself, which makes it |
|
3359 dnl safe not to link crtbegin. Besides, previous versions of the NDK didn't |
|
3360 dnl link crtbegin and crtend at all. |
|
3361 if test -n "$MOZ_LINKER" -a "$OS_TARGET" = "Android"; then |
|
3362 AC_CACHE_CHECK([whether the CRT objects have text relocations], |
|
3363 ac_cv_crt_has_text_relocations, |
|
3364 [echo 'int foo() { return 0; }' > conftest.cpp |
|
3365 if AC_TRY_COMMAND(${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5) && |
|
3366 test -s conftest${DLL_SUFFIX}; then |
|
3367 if ${TOOLCHAIN_PREFIX}readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then |
|
3368 ac_cv_crt_has_text_relocations=yes |
|
3369 else |
|
3370 ac_cv_crt_has_text_relocations=no |
|
3371 fi |
|
3372 else |
|
3373 AC_ERROR([couldn't compile a simple C file]) |
|
3374 fi |
|
3375 rm -rf conftest*]) |
|
3376 if test "$ac_cv_crt_has_text_relocations" = yes; then |
|
3377 dnl While we want libraries to skip the CRT files, we don't want |
|
3378 dnl executables to be treated the same way. We thus set the flag |
|
3379 dnl in DSO_LDOPTS and not LDFLAGS. However, to pass it to nspr, |
|
3380 dnl we need to use LDFLAGS because nspr doesn't inherit DSO_LDOPTS. |
|
3381 dnl Using LDFLAGS in nspr is safe, since we only really build |
|
3382 dnl libraries there. |
|
3383 DSO_LDOPTS="$DSO_LDOPTS -nostartfiles" |
|
3384 NSPR_LDFLAGS="$NSPR_LDFLAGS -nostartfiles" |
|
3385 fi |
|
3386 fi |
|
3387 |
|
3388 dnl Check for the existence of various allocation headers/functions |
|
3389 |
|
3390 MALLOC_HEADERS="malloc.h malloc_np.h malloc/malloc.h sys/malloc.h" |
|
3391 MALLOC_H= |
|
3392 |
|
3393 for file in $MALLOC_HEADERS; do |
|
3394 MOZ_CHECK_HEADER($file, [MALLOC_H=$file]) |
|
3395 if test "$MALLOC_H" != ""; then |
|
3396 AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>) |
|
3397 break |
|
3398 fi |
|
3399 done |
|
3400 |
|
3401 AC_CHECK_FUNCS(strndup posix_memalign memalign valloc) |
|
3402 |
|
3403 AC_CHECK_FUNCS(malloc_usable_size) |
|
3404 |
|
3405 dnl See if compiler supports some gcc-style attributes |
|
3406 |
|
3407 AC_CACHE_CHECK(for __attribute__((always_inline)), |
|
3408 ac_cv_attribute_always_inline, |
|
3409 [AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));], |
|
3410 [], |
|
3411 ac_cv_attribute_always_inline=yes, |
|
3412 ac_cv_attribute_always_inline=no)]) |
|
3413 |
|
3414 AC_CACHE_CHECK(for __attribute__((malloc)), |
|
3415 ac_cv_attribute_malloc, |
|
3416 [AC_TRY_COMPILE([void* f(int) __attribute__((malloc));], |
|
3417 [], |
|
3418 ac_cv_attribute_malloc=yes, |
|
3419 ac_cv_attribute_malloc=no)]) |
|
3420 |
|
3421 AC_CACHE_CHECK(for __attribute__((warn_unused_result)), |
|
3422 ac_cv_attribute_warn_unused, |
|
3423 [AC_TRY_COMPILE([int f(void) __attribute__((warn_unused_result));], |
|
3424 [], |
|
3425 ac_cv_attribute_warn_unused=yes, |
|
3426 ac_cv_attribute_warn_unused=no)]) |
|
3427 |
|
3428 dnl End of C++ language/feature checks |
|
3429 AC_LANG_C |
|
3430 |
|
3431 dnl ======================================================== |
|
3432 dnl = Internationalization checks |
|
3433 dnl ======================================================== |
|
3434 dnl |
|
3435 dnl Internationalization and Locale support is different |
|
3436 dnl on various UNIX platforms. Checks for specific i18n |
|
3437 dnl features go here. |
|
3438 |
|
3439 dnl check for LC_MESSAGES |
|
3440 AC_CACHE_CHECK(for LC_MESSAGES, |
|
3441 ac_cv_i18n_lc_messages, |
|
3442 [AC_TRY_COMPILE([#include <locale.h>], |
|
3443 [int category = LC_MESSAGES;], |
|
3444 ac_cv_i18n_lc_messages=yes, |
|
3445 ac_cv_i18n_lc_messages=no)]) |
|
3446 if test "$ac_cv_i18n_lc_messages" = yes; then |
|
3447 AC_DEFINE(HAVE_I18N_LC_MESSAGES) |
|
3448 fi |
|
3449 |
|
3450 AC_HAVE_FUNCS(localeconv) |
|
3451 fi # ! SKIP_COMPILER_CHECKS |
|
3452 |
|
3453 TARGET_XPCOM_ABI= |
|
3454 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then |
|
3455 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}" |
|
3456 fi |
|
3457 |
|
3458 dnl Mozilla specific options |
|
3459 dnl ======================================================== |
|
3460 dnl The macros used for command line options |
|
3461 dnl are defined in build/autoconf/altoptions.m4. |
|
3462 |
|
3463 dnl If the compiler supports these attributes, define them as |
|
3464 dnl convenience macros. |
|
3465 if test "$ac_cv_attribute_malloc" = yes ; then |
|
3466 AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))]) |
|
3467 else |
|
3468 AC_DEFINE(NS_ATTR_MALLOC,) |
|
3469 fi |
|
3470 |
|
3471 if test "$ac_cv_attribute_warn_unused" = yes ; then |
|
3472 AC_DEFINE(NS_WARN_UNUSED_RESULT, [__attribute__((warn_unused_result))]) |
|
3473 else |
|
3474 AC_DEFINE(NS_WARN_UNUSED_RESULT,) |
|
3475 fi |
|
3476 |
|
3477 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some |
|
3478 dnl features that Windows actually does support. |
|
3479 |
|
3480 if test -n "$SKIP_COMPILER_CHECKS"; then |
|
3481 dnl Windows has malloc.h |
|
3482 AC_DEFINE(MALLOC_H, [<malloc.h>]) |
|
3483 AC_DEFINE(HAVE_FORCEINLINE) |
|
3484 AC_DEFINE(HAVE_LOCALECONV) |
|
3485 fi # SKIP_COMPILER_CHECKS |
|
3486 |
|
3487 dnl ======================================================== |
|
3488 dnl = |
|
3489 dnl = Check for external package dependencies |
|
3490 dnl = |
|
3491 dnl ======================================================== |
|
3492 MOZ_ARG_HEADER(External Packages) |
|
3493 |
|
3494 MOZ_ARG_WITH_STRING(libxul-sdk, |
|
3495 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>], |
|
3496 LIBXUL_SDK_DIR=$withval) |
|
3497 |
|
3498 if test "$LIBXUL_SDK_DIR" = "yes"; then |
|
3499 AC_MSG_ERROR([--with-libxul-sdk must specify a path]) |
|
3500 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then |
|
3501 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd` |
|
3502 |
|
3503 if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then |
|
3504 AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist]) |
|
3505 fi |
|
3506 |
|
3507 fi |
|
3508 AC_SUBST(LIBXUL_SDK) |
|
3509 |
|
3510 if test -n "$LIBXUL_SDK"; then |
|
3511 LIBXUL_DIST="$LIBXUL_SDK" |
|
3512 else |
|
3513 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist" |
|
3514 fi |
|
3515 AC_SUBST(LIBXUL_DIST) |
|
3516 |
|
3517 SYSTEM_LIBXUL= |
|
3518 |
|
3519 MOZ_ARG_WITH_BOOL(system-libxul, |
|
3520 [ --with-system-libxul Use system installed libxul SDK], |
|
3521 SYSTEM_LIBXUL=1) |
|
3522 |
|
3523 dnl ======================================================== |
|
3524 dnl = If NSPR was not detected in the system, |
|
3525 dnl = use the one in the source tree (mozilla/nsprpub) |
|
3526 dnl ======================================================== |
|
3527 MOZ_ARG_WITH_BOOL(system-nspr, |
|
3528 [ --with-system-nspr Use system installed NSPR], |
|
3529 _USE_SYSTEM_NSPR=1 ) |
|
3530 |
|
3531 if test -n "$_USE_SYSTEM_NSPR"; then |
|
3532 AM_PATH_NSPR(4.10.6, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])]) |
|
3533 fi |
|
3534 |
|
3535 if test -n "$MOZ_NATIVE_NSPR"; then |
|
3536 _SAVE_CFLAGS=$CFLAGS |
|
3537 CFLAGS="$CFLAGS $NSPR_CFLAGS" |
|
3538 AC_TRY_COMPILE([#include "prtypes.h"], |
|
3539 [#ifndef PR_STATIC_ASSERT |
|
3540 #error PR_STATIC_ASSERT not defined or requires including prtypes.h |
|
3541 #endif], |
|
3542 [MOZ_NATIVE_NSPR=1], |
|
3543 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it])) |
|
3544 AC_TRY_COMPILE([#include "prtypes.h"], |
|
3545 [#ifndef PR_UINT64 |
|
3546 #error PR_UINT64 not defined or requires including prtypes.h |
|
3547 #endif], |
|
3548 [MOZ_NATIVE_NSPR=1], |
|
3549 AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it])) |
|
3550 CFLAGS=$_SAVE_CFLAGS |
|
3551 else |
|
3552 if test -z "$LIBXUL_SDK"; then |
|
3553 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr" |
|
3554 if test -n "$GNU_CC"; then |
|
3555 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}" |
|
3556 else |
|
3557 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib " |
|
3558 fi |
|
3559 else |
|
3560 NSPR_CFLAGS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --includedir="${LIBXUL_DIST}/include/nspr" --cflags` |
|
3561 NSPR_LIBS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --libdir="${LIBXUL_DIST}"/lib --libs` |
|
3562 fi |
|
3563 fi |
|
3564 |
|
3565 dnl set GRE_MILESTONE |
|
3566 dnl ======================================================== |
|
3567 if test -n "$LIBXUL_SDK"; then |
|
3568 GRE_MILESTONE=`$PYTHON "$_topsrcdir"/config/printconfigsetting.py "$LIBXUL_DIST"/bin/platform.ini Build Milestone` |
|
3569 else |
|
3570 GRE_MILESTONE=`tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt` |
|
3571 fi |
|
3572 AC_SUBST(GRE_MILESTONE) |
|
3573 |
|
3574 # set RELEASE_BUILD and NIGHTLY_BUILD variables depending on the cycle we're in |
|
3575 # The logic works like this: |
|
3576 # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD) |
|
3577 # - otherwise, we're building Release/Beta (define RELEASE_BUILD) |
|
3578 case "$GRE_MILESTONE" in |
|
3579 *a1*) |
|
3580 NIGHTLY_BUILD=1 |
|
3581 AC_DEFINE(NIGHTLY_BUILD) |
|
3582 ;; |
|
3583 *) |
|
3584 RELEASE_BUILD=1 |
|
3585 AC_DEFINE(RELEASE_BUILD) |
|
3586 ;; |
|
3587 esac |
|
3588 AC_SUBST(NIGHTLY_BUILD) |
|
3589 AC_SUBST(RELEASE_BUILD) |
|
3590 |
|
3591 dnl ======================================================== |
|
3592 dnl Disable compiling sources in unified mode. |
|
3593 dnl ======================================================== |
|
3594 |
|
3595 if test -z "$NIGHTLY_BUILD"; then |
|
3596 MOZ_DISABLE_UNIFIED_COMPILATION=1 |
|
3597 fi |
|
3598 |
|
3599 MOZ_ARG_DISABLE_BOOL(unified-compilation, |
|
3600 [ --disable-unified-compilation |
|
3601 Disable unified compilation of some C/C++ sources], |
|
3602 MOZ_DISABLE_UNIFIED_COMPILATION=1, |
|
3603 MOZ_DISABLE_UNIFIED_COMPILATION=) |
|
3604 AC_SUBST(MOZ_DISABLE_UNIFIED_COMPILATION) |
|
3605 |
|
3606 dnl system libevent Support |
|
3607 dnl ======================================================== |
|
3608 MOZ_ARG_WITH_STRING(system-libevent, |
|
3609 [ --with-system-libevent[=PFX] |
|
3610 Use system libevent [installed at prefix PFX]], |
|
3611 LIBEVENT_DIR=$withval) |
|
3612 |
|
3613 _SAVE_CFLAGS=$CFLAGS |
|
3614 _SAVE_LDFLAGS=$LDFLAGS |
|
3615 _SAVE_LIBS=$LIBS |
|
3616 if test "$LIBEVENT_DIR" = yes; then |
|
3617 PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent, |
|
3618 MOZ_NATIVE_LIBEVENT=1, |
|
3619 LIBEVENT_DIR=/usr) |
|
3620 fi |
|
3621 if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then |
|
3622 MOZ_NATIVE_LIBEVENT= |
|
3623 elif test -z "$MOZ_NATIVE_LIBEVENT"; then |
|
3624 CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS" |
|
3625 LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS" |
|
3626 MOZ_CHECK_HEADER(event.h, |
|
3627 [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then |
|
3628 AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include]) |
|
3629 fi], |
|
3630 AC_MSG_ERROR([--with-system-libevent requested but event.h not found])) |
|
3631 AC_CHECK_LIB(event, event_init, |
|
3632 [MOZ_NATIVE_LIBEVENT=1 |
|
3633 MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include" |
|
3634 MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"], |
|
3635 [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=]) |
|
3636 fi |
|
3637 CFLAGS=$_SAVE_CFLAGS |
|
3638 LDFLAGS=$_SAVE_LDFLAGS |
|
3639 LIBS=$_SAVE_LIBS |
|
3640 |
|
3641 AC_SUBST(MOZ_NATIVE_LIBEVENT) |
|
3642 AC_SUBST(MOZ_LIBEVENT_CFLAGS) |
|
3643 AC_SUBST(MOZ_LIBEVENT_LIBS) |
|
3644 |
|
3645 dnl ======================================================== |
|
3646 dnl = If NSS was not detected in the system, |
|
3647 dnl = use the one in the source tree (mozilla/security/nss) |
|
3648 dnl ======================================================== |
|
3649 |
|
3650 MOZ_ARG_WITH_BOOL(system-nss, |
|
3651 [ --with-system-nss Use system installed NSS], |
|
3652 _USE_SYSTEM_NSS=1 ) |
|
3653 |
|
3654 if test -n "$_USE_SYSTEM_NSS"; then |
|
3655 AM_PATH_NSS(3.16.2.3, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])]) |
|
3656 fi |
|
3657 |
|
3658 if test -n "$MOZ_NATIVE_NSS"; then |
|
3659 NSS_LIBS="$NSS_LIBS -lcrmf" |
|
3660 else |
|
3661 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss' |
|
3662 |
|
3663 if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT"; then |
|
3664 NSS_LIBS="\ |
|
3665 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \ |
|
3666 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \ |
|
3667 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \ |
|
3668 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \ |
|
3669 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)" |
|
3670 else |
|
3671 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION" |
|
3672 fi |
|
3673 fi |
|
3674 |
|
3675 dnl ====================== |
|
3676 dnl Detect yasm |
|
3677 dnl ====================== |
|
3678 |
|
3679 AC_MSG_CHECKING([for YASM assembler]) |
|
3680 AC_CHECK_PROGS(YASM, yasm, "") |
|
3681 |
|
3682 if test -n "$YASM"; then |
|
3683 dnl Pull out yasm's version string |
|
3684 YASM_VERSION=`yasm --version | $AWK '/^yasm/ { print $2 }'` |
|
3685 _YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'` |
|
3686 _YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'` |
|
3687 _YASM_RELEASE=` echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'` |
|
3688 _YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'` |
|
3689 fi |
|
3690 |
|
3691 if test -z "$SKIP_LIBRARY_CHECKS"; then |
|
3692 dnl system JPEG support |
|
3693 dnl ======================================================== |
|
3694 MOZ_ARG_WITH_STRING(system-jpeg, |
|
3695 [ --with-system-jpeg[=PFX] |
|
3696 Use system libjpeg [installed at prefix PFX]], |
|
3697 JPEG_DIR=$withval) |
|
3698 |
|
3699 _SAVE_CFLAGS=$CFLAGS |
|
3700 _SAVE_LDFLAGS=$LDFLAGS |
|
3701 _SAVE_LIBS=$LIBS |
|
3702 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then |
|
3703 CFLAGS="-I${JPEG_DIR}/include $CFLAGS" |
|
3704 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS" |
|
3705 fi |
|
3706 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then |
|
3707 MOZ_NATIVE_JPEG= |
|
3708 else |
|
3709 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [MOZ_NATIVE_JPEG=1 MOZ_JPEG_LIBS="-ljpeg"], MOZ_NATIVE_JPEG=) |
|
3710 fi |
|
3711 |
|
3712 if test "$MOZ_NATIVE_JPEG" = 1; then |
|
3713 AC_TRY_COMPILE([ #include <stdio.h> |
|
3714 #include <sys/types.h> |
|
3715 #include <jpeglib.h> ], |
|
3716 [ #if JPEG_LIB_VERSION < $MOZJPEG |
|
3717 #error "Insufficient JPEG library version ($MOZJPEG required)." |
|
3718 #endif |
|
3719 #ifndef JCS_EXTENSIONS |
|
3720 #error "libjpeg-turbo JCS_EXTENSIONS required" |
|
3721 #endif |
|
3722 ], |
|
3723 MOZ_NATIVE_JPEG=1, |
|
3724 AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg])) |
|
3725 fi |
|
3726 CFLAGS=$_SAVE_CFLAGS |
|
3727 LDFLAGS=$_SAVE_LDFLAGS |
|
3728 LIBS=$_SAVE_LIBS |
|
3729 |
|
3730 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$MOZ_NATIVE_JPEG" = 1; then |
|
3731 MOZ_JPEG_CFLAGS="-I${JPEG_DIR}/include" |
|
3732 MOZ_JPEG_LIBS="-L${JPEG_DIR}/lib ${MOZ_JPEG_LIBS}" |
|
3733 fi |
|
3734 fi # SKIP_LIBRARY_CHECKS |
|
3735 |
|
3736 dnl system ZLIB support |
|
3737 dnl ======================================================== |
|
3738 MOZ_ZLIB_CHECK([1.2.3]) |
|
3739 |
|
3740 if test "$MOZ_NATIVE_ZLIB" != 1; then |
|
3741 MOZ_ZLIB_CFLAGS="-I${_topsrcdir}/modules/zlib/src" |
|
3742 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,'"$MOZ_BUILD_ROOT"'/modules/zlib/src)' |
|
3743 fi |
|
3744 |
|
3745 if test "$MOZ_LINKER" = 1 -a "$MOZ_NATIVE_ZLIB" != 1; then |
|
3746 AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib]) |
|
3747 fi |
|
3748 |
|
3749 MOZ_PNG_ARM_NEON= |
|
3750 |
|
3751 if test -z "$SKIP_LIBRARY_CHECKS"; then |
|
3752 dnl system BZIP2 Support |
|
3753 dnl ======================================================== |
|
3754 MOZ_ARG_WITH_STRING(system-bz2, |
|
3755 [ --with-system-bz2[=PFX] |
|
3756 Use system libbz2 [installed at prefix PFX]], |
|
3757 BZ2_DIR=$withval) |
|
3758 |
|
3759 _SAVE_CFLAGS=$CFLAGS |
|
3760 _SAVE_LDFLAGS=$LDFLAGS |
|
3761 _SAVE_LIBS=$LIBS |
|
3762 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then |
|
3763 CFLAGS="-I${BZ2_DIR}/include $CFLAGS" |
|
3764 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS" |
|
3765 fi |
|
3766 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then |
|
3767 MOZ_NATIVE_BZ2= |
|
3768 else |
|
3769 AC_CHECK_LIB(bz2, BZ2_bzread, [MOZ_NATIVE_BZ2=1 MOZ_BZ2_LIBS="-lbz2"], |
|
3770 [MOZ_NATIVE_BZ2= MOZ_BZ2_CFLAGS= MOZ_BZ2_LIBS=]) |
|
3771 fi |
|
3772 CFLAGS=$_SAVE_CFLAGS |
|
3773 LDFLAGS=$_SAVE_LDFLAGS |
|
3774 LIBS=$_SAVE_LIBS |
|
3775 |
|
3776 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_NATIVE_BZ2" = 1; then |
|
3777 MOZ_BZ2_CFLAGS="-I${BZ2_DIR}/include" |
|
3778 MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}" |
|
3779 fi |
|
3780 |
|
3781 dnl ======================================================== |
|
3782 dnl system PNG Support |
|
3783 dnl ======================================================== |
|
3784 MOZ_ARG_WITH_STRING(system-png, |
|
3785 [ --with-system-png[=PFX] |
|
3786 Use system libpng [installed at prefix PFX]], |
|
3787 PNG_DIR=$withval) |
|
3788 |
|
3789 _SAVE_CFLAGS=$CFLAGS |
|
3790 _SAVE_LDFLAGS=$LDFLAGS |
|
3791 _SAVE_LIBS=$LIBS |
|
3792 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then |
|
3793 CFLAGS="-I${PNG_DIR}/include $CFLAGS" |
|
3794 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS" |
|
3795 fi |
|
3796 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then |
|
3797 MOZ_NATIVE_PNG= |
|
3798 else |
|
3799 AC_CHECK_LIB(png, png_get_valid, [MOZ_NATIVE_PNG=1 MOZ_PNG_LIBS="-lpng"], |
|
3800 AC_MSG_ERROR([--with-system-png requested but no working libpng found])) |
|
3801 AC_CHECK_LIB(png, png_get_acTL, , |
|
3802 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support])) |
|
3803 fi |
|
3804 if test "$MOZ_NATIVE_PNG" = 1; then |
|
3805 AC_TRY_COMPILE([ #include <stdio.h> |
|
3806 #include <sys/types.h> |
|
3807 #include <png.h> ], |
|
3808 [ #if PNG_LIBPNG_VER < $MOZPNG |
|
3809 #error "Insufficient libpng version ($MOZPNG required)." |
|
3810 #endif |
|
3811 #ifndef PNG_UINT_31_MAX |
|
3812 #error "Insufficient libpng version." |
|
3813 #endif ], |
|
3814 MOZ_NATIVE_PNG=1, |
|
3815 AC_MSG_ERROR([--with-system-png requested but no working libpng found])) |
|
3816 fi |
|
3817 CFLAGS=$_SAVE_CFLAGS |
|
3818 LDFLAGS=$_SAVE_LDFLAGS |
|
3819 LIBS=$_SAVE_LIBS |
|
3820 |
|
3821 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_NATIVE_PNG" = 1; then |
|
3822 MOZ_PNG_CFLAGS="-I${PNG_DIR}/include" |
|
3823 MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}" |
|
3824 fi |
|
3825 |
|
3826 MOZ_PNG_ARM_NEON_CHECK= |
|
3827 if test "$MOZ_NATIVE_PNG" != 1 -a "$CPU_ARCH" = "arm" ; then |
|
3828 MOZ_ARG_ENABLE_STRING(png-arm-neon-support, |
|
3829 [ --enable-png-arm-neon-support=TYPE |
|
3830 Options include: |
|
3831 no |
|
3832 check (default) |
|
3833 nocheck (faster but unsafe)], |
|
3834 [MOZ_PNG_ARM_NEON_SUPPORT=$enableval ] ) |
|
3835 case "$MOZ_PNG_ARM_NEON_SUPPORT" in |
|
3836 no) |
|
3837 # enable-png-arm-neon-support = no |
|
3838 ;; |
|
3839 nocheck) |
|
3840 # enable-png-arm-neon-support = nocheck |
|
3841 MOZ_PNG_ARM_NEON=1 |
|
3842 ;; |
|
3843 *) |
|
3844 MOZ_PNG_ARM_NEON=1 |
|
3845 MOZ_PNG_ARM_NEON_CHECK=1 |
|
3846 ;; |
|
3847 esac |
|
3848 fi |
|
3849 |
|
3850 AC_SUBST(MOZ_PNG_ARM_NEON_CHECK) |
|
3851 |
|
3852 fi # SKIP_LIBRARY_CHECKS |
|
3853 |
|
3854 AC_SUBST(MOZ_PNG_ARM_NEON) |
|
3855 |
|
3856 dnl ======================================================== |
|
3857 dnl system HunSpell Support |
|
3858 dnl ======================================================== |
|
3859 MOZ_ARG_ENABLE_BOOL(system-hunspell, |
|
3860 [ --enable-system-hunspell |
|
3861 Use system hunspell (located with pkgconfig)], |
|
3862 MOZ_NATIVE_HUNSPELL=1 ) |
|
3863 |
|
3864 if test -n "$MOZ_NATIVE_HUNSPELL"; then |
|
3865 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell) |
|
3866 fi |
|
3867 |
|
3868 AC_SUBST(MOZ_NATIVE_HUNSPELL) |
|
3869 |
|
3870 dnl ======================================================== |
|
3871 dnl system libffi Support |
|
3872 dnl ======================================================== |
|
3873 MOZ_CONFIG_FFI() |
|
3874 |
|
3875 if test -n "$MOZ_NATIVE_FFI"; then |
|
3876 MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS" |
|
3877 fi |
|
3878 |
|
3879 # split JS out by default to avoid VS2005 PGO crash (bug 591836). |
|
3880 if test "$OS_ARCH" = "WINNT"; then |
|
3881 JS_SHARED_LIBRARY=1 |
|
3882 fi |
|
3883 |
|
3884 MOZ_ARG_ENABLE_BOOL(shared-js, |
|
3885 [ --enable-shared-js |
|
3886 Create a shared JavaScript library.], |
|
3887 JS_SHARED_LIBRARY=1, |
|
3888 JS_SHARED_LIBRARY=) |
|
3889 |
|
3890 dnl ======================================================== |
|
3891 dnl Java SDK support |
|
3892 dnl ======================================================== |
|
3893 |
|
3894 JAVA_BIN_PATH= |
|
3895 MOZ_ARG_WITH_STRING(java-bin-path, |
|
3896 [ --with-java-bin-path=dir |
|
3897 Location of Java binaries (java, javac, jar)], |
|
3898 JAVA_BIN_PATH=$withval) |
|
3899 |
|
3900 dnl ======================================================== |
|
3901 dnl = |
|
3902 dnl = Application |
|
3903 dnl = |
|
3904 dnl ======================================================== |
|
3905 |
|
3906 MOZ_ARG_HEADER(Application) |
|
3907 |
|
3908 ENABLE_TESTS=1 |
|
3909 ENABLE_SYSTEM_EXTENSION_DIRS=1 |
|
3910 MOZ_BRANDING_DIRECTORY= |
|
3911 MOZ_OFFICIAL_BRANDING= |
|
3912 MOZ_FEEDS=1 |
|
3913 MOZ_WEBAPP_RUNTIME= |
|
3914 MOZ_JSDEBUGGER=1 |
|
3915 MOZ_AUTH_EXTENSION=1 |
|
3916 MOZ_RAW= |
|
3917 MOZ_VORBIS= |
|
3918 MOZ_TREMOR= |
|
3919 MOZ_WAVE=1 |
|
3920 MOZ_SAMPLE_TYPE_FLOAT32= |
|
3921 MOZ_SAMPLE_TYPE_S16= |
|
3922 MOZ_OPUS=1 |
|
3923 MOZ_WEBM=1 |
|
3924 MOZ_GSTREAMER= |
|
3925 MOZ_DIRECTSHOW= |
|
3926 MOZ_WMF= |
|
3927 MOZ_FMP4= |
|
3928 MOZ_FFMPEG= |
|
3929 MOZ_WEBRTC=1 |
|
3930 MOZ_PEERCONNECTION= |
|
3931 MOZ_SRTP= |
|
3932 MOZ_WEBRTC_SIGNALING= |
|
3933 MOZ_WEBRTC_ASSERT_ALWAYS=1 |
|
3934 MOZ_SCTP= |
|
3935 MOZ_MEDIA_PLUGINS= |
|
3936 MOZ_MEDIA_NAVIGATOR= |
|
3937 MOZ_OMX_PLUGIN= |
|
3938 MOZ_VPX= |
|
3939 MOZ_VPX_ERROR_CONCEALMENT= |
|
3940 MOZ_WEBSPEECH=1 |
|
3941 VPX_AS= |
|
3942 VPX_ASFLAGS= |
|
3943 VPX_AS_DASH_C_FLAG= |
|
3944 VPX_AS_CONVERSION= |
|
3945 VPX_ASM_SUFFIX= |
|
3946 VPX_X86_ASM= |
|
3947 VPX_ARM_ASM= |
|
3948 LIBJPEG_TURBO_AS= |
|
3949 LIBJPEG_TURBO_ASFLAGS= |
|
3950 LIBJPEG_TURBO_X86_ASM= |
|
3951 LIBJPEG_TURBO_X64_ASM= |
|
3952 LIBJPEG_TURBO_ARM_ASM= |
|
3953 MOZ_PERMISSIONS=1 |
|
3954 MOZ_PLACES=1 |
|
3955 MOZ_SOCIAL=1 |
|
3956 MOZ_PREF_EXTENSIONS=1 |
|
3957 MOZ_PROFILELOCKING=1 |
|
3958 MOZ_REFLOW_PERF= |
|
3959 MOZ_SAFE_BROWSING= |
|
3960 MOZ_HELP_VIEWER= |
|
3961 MOZ_SPELLCHECK=1 |
|
3962 MOZ_ANDROID_OMTC= |
|
3963 MOZ_TOOLKIT_SEARCH=1 |
|
3964 MOZ_UI_LOCALE=en-US |
|
3965 MOZ_UNIVERSALCHARDET=1 |
|
3966 MOZ_URL_CLASSIFIER= |
|
3967 MOZ_XUL=1 |
|
3968 MOZ_ZIPWRITER=1 |
|
3969 NS_PRINTING=1 |
|
3970 MOZ_PDF_PRINTING= |
|
3971 MOZ_DISABLE_CRYPTOLEGACY= |
|
3972 NSS_DISABLE_DBM= |
|
3973 NECKO_COOKIES=1 |
|
3974 NECKO_PROTOCOLS_DEFAULT="about app data file ftp http res viewsource websocket wyciwyg device" |
|
3975 if test -n "$MOZ_RTSP"; then |
|
3976 NECKO_PROTOCOLS_DEFAULT="$NECKO_PROTOCOLS_DEFAULT rtsp" |
|
3977 fi |
|
3978 USE_ARM_KUSER= |
|
3979 BUILD_CTYPES=1 |
|
3980 MOZ_USE_NATIVE_POPUP_WINDOWS= |
|
3981 MOZ_ANDROID_HISTORY= |
|
3982 MOZ_WEBSMS_BACKEND= |
|
3983 MOZ_ANDROID_BEAM= |
|
3984 MOZ_ANDROID_SYNTHAPKS= |
|
3985 ACCESSIBILITY=1 |
|
3986 MOZ_TIME_MANAGER= |
|
3987 MOZ_PAY= |
|
3988 MOZ_AUDIO_CHANNEL_MANAGER= |
|
3989 NSS_NO_LIBPKIX= |
|
3990 MOZ_CONTENT_SANDBOX= |
|
3991 MOZ_CONTENT_SANDBOX_REPORTER=1 |
|
3992 |
|
3993 case "$target_os" in |
|
3994 mingw*) |
|
3995 NS_ENABLE_TSF=1 |
|
3996 AC_DEFINE(NS_ENABLE_TSF) |
|
3997 ;; |
|
3998 esac |
|
3999 |
|
4000 case "${target}" in |
|
4001 *-android*|*-linuxandroid*) |
|
4002 if test "$CPU_ARCH" = "arm" ; then |
|
4003 USE_ARM_KUSER=1 |
|
4004 fi |
|
4005 |
|
4006 NSS_DISABLE_DBM=1 |
|
4007 MOZ_THEME_FASTSTRIPE=1 |
|
4008 MOZ_TREE_FREETYPE=1 |
|
4009 MOZ_MEMORY=1 |
|
4010 MOZ_RAW=1 |
|
4011 ;; |
|
4012 |
|
4013 esac |
|
4014 |
|
4015 MOZ_ARG_WITH_STRING(external-source-dir, |
|
4016 [ --with-external-source-dir=dir |
|
4017 External directory containing additional build files.], |
|
4018 [ EXTERNAL_SOURCE_DIR=$withval]) |
|
4019 AC_SUBST(EXTERNAL_SOURCE_DIR) |
|
4020 |
|
4021 MOZ_ARG_ENABLE_STRING(application, |
|
4022 [ --enable-application=APP |
|
4023 Options include: |
|
4024 browser (Firefox) |
|
4025 xulrunner |
|
4026 tools/update-packaging (AUS-related packaging tools)], |
|
4027 [ MOZ_BUILD_APP=$enableval ] ) |
|
4028 |
|
4029 MOZ_ARG_WITH_STRING(xulrunner-stub-name, |
|
4030 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name], |
|
4031 XULRUNNER_STUB_NAME=$withval) |
|
4032 |
|
4033 if test -z "$XULRUNNER_STUB_NAME"; then |
|
4034 case "$target_os" in |
|
4035 darwin*) |
|
4036 XULRUNNER_STUB_NAME=xulrunner |
|
4037 ;; |
|
4038 *) |
|
4039 XULRUNNER_STUB_NAME=xulrunner-stub |
|
4040 esac |
|
4041 fi |
|
4042 AC_SUBST(XULRUNNER_STUB_NAME) |
|
4043 |
|
4044 AC_MSG_CHECKING([for application to build]) |
|
4045 if test -z "$MOZ_BUILD_APP"; then |
|
4046 AC_MSG_RESULT([browser]) |
|
4047 MOZ_BUILD_APP=browser |
|
4048 else |
|
4049 # "mobile" no longer exists. |
|
4050 if test "$MOZ_BUILD_APP" = "mobile" ; then |
|
4051 AC_MSG_RESULT([none]) |
|
4052 AC_MSG_ERROR([--enable-application=mobile is no longer supported.]) |
|
4053 fi |
|
4054 # We have a valid application only if it has a build.mk file in its top |
|
4055 # directory. |
|
4056 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then |
|
4057 AC_MSG_RESULT([none]) |
|
4058 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).]) |
|
4059 else |
|
4060 AC_MSG_RESULT([$MOZ_BUILD_APP]) |
|
4061 fi |
|
4062 fi |
|
4063 |
|
4064 # The app update channel is 'default' when not supplied. The value is used in |
|
4065 # the application's confvars.sh so it must be set before confvars.sh is called. |
|
4066 MOZ_ARG_ENABLE_STRING([update-channel], |
|
4067 [ --enable-update-channel=CHANNEL |
|
4068 Select application update channel (default=default)], |
|
4069 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`) |
|
4070 |
|
4071 if test -z "$MOZ_UPDATE_CHANNEL"; then |
|
4072 MOZ_UPDATE_CHANNEL=default |
|
4073 fi |
|
4074 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL) |
|
4075 AC_SUBST(MOZ_UPDATE_CHANNEL) |
|
4076 |
|
4077 # Allow to specify a Mozilla API key file that contains the secret key to be |
|
4078 # used for various Mozilla API requests. |
|
4079 MOZ_ARG_WITH_STRING(mozilla-api-keyfile, |
|
4080 [ --with-mozilla-api-keyfile=file Use the secret key contained in the given keyfile for Mozilla API requests], |
|
4081 MOZ_MOZILLA_API_KEY=`cat $withval`) |
|
4082 if test -z "$MOZ_MOZILLA_API_KEY"; then |
|
4083 MOZ_MOZILLA_API_KEY=no-mozilla-api-key |
|
4084 fi |
|
4085 AC_SUBST(MOZ_MOZILLA_API_KEY) |
|
4086 |
|
4087 # Allow to specify a Google API key file that contains the secret key to be |
|
4088 # used for various Google API requests. |
|
4089 MOZ_ARG_WITH_STRING(google-api-keyfile, |
|
4090 [ --with-google-api-keyfile=file Use the secret key contained in the given keyfile for Google API requests], |
|
4091 MOZ_GOOGLE_API_KEY=`cat $withval`) |
|
4092 if test -z "$MOZ_GOOGLE_API_KEY"; then |
|
4093 MOZ_GOOGLE_API_KEY=no-google-api-key |
|
4094 fi |
|
4095 AC_SUBST(MOZ_GOOGLE_API_KEY) |
|
4096 |
|
4097 # Allow the application to influence configure with a confvars.sh script. |
|
4098 AC_MSG_CHECKING([if app-specific confvars.sh exists]) |
|
4099 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then |
|
4100 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh]) |
|
4101 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" |
|
4102 else |
|
4103 AC_MSG_RESULT([no]) |
|
4104 fi |
|
4105 |
|
4106 # Allow influencing configure with a defines.sh script. |
|
4107 . "${srcdir}/build/defines.sh" |
|
4108 |
|
4109 # If we're not building a release build, define EARLY_BETA_OR_EARLIER if it is |
|
4110 # set in defines.sh |
|
4111 if test "$BUILDING_RELEASE"; then |
|
4112 # Override value in defines.sh, if any |
|
4113 EARLY_BETA_OR_EARLIER= |
|
4114 elif test "$EARLY_BETA_OR_EARLIER"; then |
|
4115 AC_DEFINE(EARLY_BETA_OR_EARLIER) |
|
4116 fi |
|
4117 AC_SUBST(EARLY_BETA_OR_EARLIER) |
|
4118 |
|
4119 # Allow the application to provide a subconfigure script |
|
4120 if test -f "${srcdir}/${MOZ_BUILD_APP}/configure.in" ; then |
|
4121 do_output_subdirs() { |
|
4122 if test -n "$_subconfigure_subdirs"; then |
|
4123 AC_MSG_ERROR([Cannot specify more than one sub-sub-configure]) |
|
4124 fi |
|
4125 _subconfigure_subdir="$1" |
|
4126 _subconfigure_config_args="$ac_configure_args" |
|
4127 } |
|
4128 tmpscript=`$PYTHON -c 'import os, tempfile; print tempfile.mktemp(prefix="subscript.").replace(os.sep, "/")'` || exit 1 |
|
4129 m4 "${srcdir}/build/autoconf/subconfigure.m4" \ |
|
4130 "${srcdir}/build/autoconf/altoptions.m4" \ |
|
4131 "${srcdir}/${MOZ_BUILD_APP}/configure.in" > $tmpscript |
|
4132 . $tmpscript |
|
4133 rm -f $tmpscript |
|
4134 fi |
|
4135 |
|
4136 # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig |
|
4137 MOZ_ARG_WITH_STRING(app-name, |
|
4138 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME], |
|
4139 WITH_APP_NAME=$withval, |
|
4140 ) |
|
4141 |
|
4142 if test -n "$WITH_APP_NAME" ; then |
|
4143 MOZ_APP_NAME="$WITH_APP_NAME" |
|
4144 fi |
|
4145 |
|
4146 MOZ_ARG_WITH_STRING(app-basename, |
|
4147 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME], |
|
4148 WITH_APP_BASENAME=$withval, |
|
4149 ) |
|
4150 |
|
4151 if test -n "$WITH_APP_BASENAME" ; then |
|
4152 MOZ_APP_BASENAME="$WITH_APP_BASENAME" |
|
4153 fi |
|
4154 |
|
4155 # Now is a good time to test for logic errors, define mismatches, etc. |
|
4156 case "$MOZ_BUILD_APP" in |
|
4157 xulrunner) |
|
4158 if test "$LIBXUL_SDK"; then |
|
4159 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.]) |
|
4160 fi |
|
4161 ;; |
|
4162 esac |
|
4163 |
|
4164 # Special cases where we need to AC_DEFINE something. Also a holdover for apps |
|
4165 # that haven't made a confvars.sh yet. Don't add new stuff here, use |
|
4166 # MOZ_BUILD_APP. |
|
4167 case "$MOZ_BUILD_APP" in |
|
4168 browser) |
|
4169 AC_DEFINE(MOZ_PHOENIX) |
|
4170 ;; |
|
4171 |
|
4172 xulrunner) |
|
4173 AC_DEFINE(MOZ_XULRUNNER) |
|
4174 ;; |
|
4175 b2g) |
|
4176 AC_DEFINE(MOZ_B2G) |
|
4177 ;; |
|
4178 esac |
|
4179 |
|
4180 AC_SUBST(MOZ_BUILD_APP) |
|
4181 AC_SUBST(MOZ_PHOENIX) |
|
4182 AC_SUBST(MOZ_XULRUNNER) |
|
4183 AC_SUBST(MOZ_B2G) |
|
4184 AC_SUBST(MOZ_B2G_VERSION) |
|
4185 |
|
4186 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP) |
|
4187 |
|
4188 dnl ======================================================== |
|
4189 dnl Check android sdk version depending on mobile target |
|
4190 dnl ======================================================== |
|
4191 |
|
4192 if test -z "$gonkdir" ; then |
|
4193 # Minimum Android SDK API Level we require. |
|
4194 case "$MOZ_BUILD_APP" in |
|
4195 mobile/android) |
|
4196 android_min_api_level=16 |
|
4197 case "$target" in |
|
4198 *-android*|*-linuxandroid*) |
|
4199 : |
|
4200 ;; |
|
4201 *) |
|
4202 AC_MSG_ERROR([You must specify --target=arm-linux-androideabi (or some other valid android target) when building with --enable-application=mobile/android. See https://wiki.mozilla.org/Mobile/Fennec/Android#Setup_Fennec_mozconfig for more information about the necessary options]) |
|
4203 ;; |
|
4204 esac |
|
4205 ;; |
|
4206 esac |
|
4207 |
|
4208 MOZ_ANDROID_SDK($android_min_api_level) |
|
4209 fi |
|
4210 |
|
4211 dnl ======================================================== |
|
4212 dnl = |
|
4213 dnl = Toolkit Options |
|
4214 dnl = |
|
4215 dnl ======================================================== |
|
4216 MOZ_ARG_HEADER(Toolkit Options) |
|
4217 |
|
4218 dnl ======================================================== |
|
4219 dnl = Select the default toolkit |
|
4220 dnl ======================================================== |
|
4221 MOZ_ARG_ENABLE_STRING(default-toolkit, |
|
4222 [ --enable-default-toolkit=TK |
|
4223 Select default toolkit |
|
4224 Platform specific defaults: |
|
4225 Mac OS X - cairo-cocoa |
|
4226 Win32 - cairo-windows |
|
4227 * - cairo-gtk2 |
|
4228 * - cairo-gtk3 |
|
4229 * - cairo-qt], |
|
4230 [ _DEFAULT_TOOLKIT=$enableval ], |
|
4231 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT]) |
|
4232 |
|
4233 if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \ |
|
4234 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \ |
|
4235 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \ |
|
4236 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk3" \ |
|
4237 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \ |
|
4238 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \ |
|
4239 -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \ |
|
4240 -o "$_DEFAULT_TOOLKIT" = "cairo-android" \ |
|
4241 -o "$_DEFAULT_TOOLKIT" = "cairo-gonk" |
|
4242 then |
|
4243 dnl nglayout only supports building with one toolkit, |
|
4244 dnl so ignore everything after the first comma (","). |
|
4245 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"` |
|
4246 else |
|
4247 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).]) |
|
4248 fi |
|
4249 |
|
4250 MOZ_ARG_WITHOUT_BOOL(x, |
|
4251 [ --without-x Build without X11], |
|
4252 WITHOUT_X11=1) |
|
4253 |
|
4254 dnl ======================================================== |
|
4255 dnl = Enable the toolkit as needed = |
|
4256 dnl ======================================================== |
|
4257 |
|
4258 MOZ_WIDGET_GTK= |
|
4259 |
|
4260 case "$MOZ_WIDGET_TOOLKIT" in |
|
4261 |
|
4262 cairo-windows) |
|
4263 MOZ_WIDGET_TOOLKIT=windows |
|
4264 MOZ_WEBGL=1 |
|
4265 MOZ_PDF_PRINTING=1 |
|
4266 MOZ_INSTRUMENT_EVENT_LOOP=1 |
|
4267 if test -n "$GNU_CC"; then |
|
4268 MOZ_FOLD_LIBS= |
|
4269 fi |
|
4270 ;; |
|
4271 |
|
4272 cairo-gtk3) |
|
4273 MOZ_WIDGET_TOOLKIT=gtk3 |
|
4274 MOZ_ENABLE_GTK=1 |
|
4275 MOZ_ENABLE_GTK3=1 |
|
4276 MOZ_ENABLE_XREMOTE=1 |
|
4277 MOZ_WEBGL=1 |
|
4278 MOZ_GL_DEFAULT_PROVIDER=GLX |
|
4279 |
|
4280 AC_DEFINE(MOZ_X11) |
|
4281 MOZ_X11=1 |
|
4282 USE_FC_FREETYPE=1 |
|
4283 |
|
4284 TK_CFLAGS='$(MOZ_GTK3_CFLAGS)' |
|
4285 TK_LIBS='$(MOZ_GTK3_LIBS)' |
|
4286 MOZ_WIDGET_GTK=3 |
|
4287 AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK) |
|
4288 MOZ_PDF_PRINTING=1 |
|
4289 MOZ_INSTRUMENT_EVENT_LOOP=1 |
|
4290 ;; |
|
4291 |
|
4292 cairo-gtk2|cairo-gtk2-x11) |
|
4293 MOZ_WIDGET_TOOLKIT=gtk2 |
|
4294 MOZ_ENABLE_GTK=1 |
|
4295 MOZ_ENABLE_GTK2=1 |
|
4296 MOZ_ENABLE_XREMOTE=1 |
|
4297 MOZ_WEBGL=1 |
|
4298 MOZ_GL_DEFAULT_PROVIDER=GLX |
|
4299 |
|
4300 AC_DEFINE(MOZ_X11) |
|
4301 MOZ_X11=1 |
|
4302 USE_FC_FREETYPE=1 |
|
4303 |
|
4304 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)' |
|
4305 TK_LIBS='$(MOZ_GTK2_LIBS)' |
|
4306 AC_DEFINE(MOZ_WIDGET_GTK2) |
|
4307 MOZ_WIDGET_GTK=2 |
|
4308 AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK) |
|
4309 MOZ_PDF_PRINTING=1 |
|
4310 MOZ_INSTRUMENT_EVENT_LOOP=1 |
|
4311 ;; |
|
4312 |
|
4313 cairo-qt) |
|
4314 MOZ_WIDGET_TOOLKIT=qt |
|
4315 MOZ_ENABLE_QT=1 |
|
4316 if test -z "$WITHOUT_X11"; then |
|
4317 MOZ_ENABLE_XREMOTE=1 |
|
4318 MOZ_GL_DEFAULT_PROVIDER=GLX |
|
4319 MOZ_X11=1 |
|
4320 AC_DEFINE(MOZ_X11) |
|
4321 XT_LIBS= |
|
4322 fi |
|
4323 |
|
4324 MOZ_WEBGL=1 |
|
4325 USE_FC_FREETYPE=1 |
|
4326 TK_CFLAGS='$(MOZ_QT_CFLAGS)' |
|
4327 TK_LIBS='$(MOZ_QT_LIBS)' |
|
4328 AC_DEFINE(MOZ_WIDGET_QT) |
|
4329 MOZ_PDF_PRINTING=1 |
|
4330 AC_DEFINE(QT_NO_KEYWORDS) |
|
4331 ;; |
|
4332 |
|
4333 cairo-cocoa) |
|
4334 MOZ_WIDGET_TOOLKIT=cocoa |
|
4335 AC_DEFINE(MOZ_WIDGET_COCOA) |
|
4336 LDFLAGS="$LDFLAGS -framework Cocoa -lobjc" |
|
4337 TK_LIBS='-framework CoreLocation -framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL' |
|
4338 TK_CFLAGS="-DNO_X11" |
|
4339 CFLAGS="$CFLAGS $TK_CFLAGS" |
|
4340 CXXFLAGS="$CXXFLAGS $TK_CFLAGS" |
|
4341 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL $(call EXPAND_LIBNAME_PATH,mozalloc,$(LIBXUL_DIST)/bin)' |
|
4342 MOZ_USER_DIR="Mozilla" |
|
4343 MOZ_FS_LAYOUT=bundle |
|
4344 MOZ_WEBGL=1 |
|
4345 MOZ_INSTRUMENT_EVENT_LOOP=1 |
|
4346 ;; |
|
4347 |
|
4348 cairo-uikit) |
|
4349 MOZ_WIDGET_TOOLKIT=uikit |
|
4350 AC_DEFINE(MOZ_WIDGET_UIKIT) |
|
4351 LDFLAGS="$LDFLAGS -framework UIKit -lobjc" |
|
4352 TK_CFLAGS="-DNO_X11" |
|
4353 TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText' |
|
4354 CFLAGS="$CFLAGS $TK_CFLAGS" |
|
4355 CXXFLAGS="$CXXFLAGS $TK_CFLAGS" |
|
4356 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/bin/XUL $(call EXPAND_LIBNAME_PATH,mozalloc,$(LIBXUL_DIST)/bin)' |
|
4357 MOZ_USER_DIR="Mozilla" |
|
4358 MOZ_FS_LAYOUT=bundle |
|
4359 ;; |
|
4360 |
|
4361 cairo-android) |
|
4362 AC_DEFINE(MOZ_WIDGET_ANDROID) |
|
4363 MOZ_WIDGET_TOOLKIT=android |
|
4364 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)' |
|
4365 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)' |
|
4366 MOZ_WEBGL=1 |
|
4367 MOZ_PDF_PRINTING=1 |
|
4368 MOZ_INSTRUMENT_EVENT_LOOP=1 |
|
4369 ;; |
|
4370 |
|
4371 cairo-gonk) |
|
4372 XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/lib)' |
|
4373 AC_DEFINE(MOZ_WIDGET_GONK) |
|
4374 AC_DEFINE(MOZ_TOUCH) |
|
4375 MOZ_WIDGET_TOOLKIT=gonk |
|
4376 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)' |
|
4377 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)' |
|
4378 MOZ_WEBGL=1 |
|
4379 MOZ_PDF_PRINTING=1 |
|
4380 MOZ_TOUCH=1 |
|
4381 MOZ_INSTRUMENT_EVENT_LOOP=1 |
|
4382 ;; |
|
4383 |
|
4384 esac |
|
4385 |
|
4386 AC_SUBST(MOZ_PDF_PRINTING) |
|
4387 if test "$MOZ_PDF_PRINTING"; then |
|
4388 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1" |
|
4389 AC_DEFINE(MOZ_PDF_PRINTING) |
|
4390 fi |
|
4391 |
|
4392 if test "$MOZ_ENABLE_XREMOTE"; then |
|
4393 AC_DEFINE(MOZ_ENABLE_XREMOTE) |
|
4394 fi |
|
4395 |
|
4396 if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then |
|
4397 AC_DEFINE(MOZ_INSTRUMENT_EVENT_LOOP) |
|
4398 fi |
|
4399 |
|
4400 if test "$COMPILE_ENVIRONMENT"; then |
|
4401 if test "$MOZ_ENABLE_GTK3"; then |
|
4402 PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES) |
|
4403 fi |
|
4404 if test "$MOZ_ENABLE_GTK2"; then |
|
4405 if test "$MOZ_X11"; then |
|
4406 GDK_PACKAGES=gdk-x11-2.0 |
|
4407 fi |
|
4408 |
|
4409 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES) |
|
4410 fi |
|
4411 |
|
4412 fi # COMPILE_ENVIRONMENT |
|
4413 |
|
4414 AC_SUBST(MOZ_FS_LAYOUT) |
|
4415 |
|
4416 dnl ======================================================== |
|
4417 dnl Use ARM userspace kernel helpers; tell NSPR to enable |
|
4418 dnl their usage and use them in spidermonkey. |
|
4419 dnl ======================================================== |
|
4420 MOZ_ARG_WITH_BOOL(arm-kuser, |
|
4421 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)], |
|
4422 USE_ARM_KUSER=1,) |
|
4423 if test -n "$USE_ARM_KUSER"; then |
|
4424 AC_DEFINE(USE_ARM_KUSER) |
|
4425 fi |
|
4426 |
|
4427 dnl ======================================================== |
|
4428 dnl = startup-notification support module |
|
4429 dnl ======================================================== |
|
4430 |
|
4431 if test "$MOZ_ENABLE_GTK" |
|
4432 then |
|
4433 MOZ_ENABLE_STARTUP_NOTIFICATION= |
|
4434 |
|
4435 MOZ_ARG_ENABLE_BOOL(startup-notification, |
|
4436 [ --enable-startup-notification |
|
4437 Enable startup-notification support (default: disabled) ], |
|
4438 MOZ_ENABLE_STARTUP_NOTIFICATION=force, |
|
4439 MOZ_ENABLE_STARTUP_NOTIFICATION=) |
|
4440 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" |
|
4441 then |
|
4442 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION, |
|
4443 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION, |
|
4444 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [ |
|
4445 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force" |
|
4446 then |
|
4447 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION]) |
|
4448 fi |
|
4449 MOZ_ENABLE_STARTUP_NOTIFICATION= |
|
4450 ]) |
|
4451 fi |
|
4452 |
|
4453 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then |
|
4454 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION) |
|
4455 fi |
|
4456 |
|
4457 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS" |
|
4458 fi |
|
4459 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION) |
|
4460 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS) |
|
4461 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS) |
|
4462 |
|
4463 dnl ======================================================== |
|
4464 dnl Disable printing |
|
4465 dnl ======================================================== |
|
4466 MOZ_ARG_DISABLE_BOOL(printing, |
|
4467 [ --disable-printing Disable printing support], |
|
4468 NS_PRINTING=, |
|
4469 NS_PRINTING=1) |
|
4470 |
|
4471 if test "$NS_PRINTING"; then |
|
4472 AC_DEFINE(NS_PRINTING) |
|
4473 AC_DEFINE(NS_PRINT_PREVIEW) |
|
4474 fi |
|
4475 |
|
4476 dnl ======================================================== |
|
4477 dnl = QT support |
|
4478 dnl ======================================================== |
|
4479 if test "$MOZ_ENABLE_QT" |
|
4480 then |
|
4481 MOZ_ARG_WITH_STRING(qtdir, |
|
4482 [ --with-qtdir=\$dir Specify Qt directory ], |
|
4483 [ QTDIR=$withval]) |
|
4484 |
|
4485 if test -z "$QTDIR"; then |
|
4486 AC_CHECK_PROGS(HOST_QMAKE, $HOST_QMAKE qmake, "") |
|
4487 else |
|
4488 HOST_QMAKE="$QTDIR/bin/qmake" |
|
4489 fi |
|
4490 QT_VERSION=`$HOST_QMAKE -v | grep 'Using Qt version' | egrep -o '[[0-9]]+\.[[0-9]]+\.[[0-9]]+'` |
|
4491 |
|
4492 if test -z "$QTDIR"; then |
|
4493 case $QT_VERSION in |
|
4494 5.*) |
|
4495 AC_MSG_RESULT("Using qt5: $QT_VERSION") |
|
4496 PKG_CHECK_MODULES(MOZ_QT, Qt5Gui Qt5Network Qt5Core Qt5Quick, , |
|
4497 [ |
|
4498 AC_MSG_ERROR([$MOZ_QT_PKG_ERRORS Need qtbase development packages, (On Ubuntu, you might try installing the packages qtbase5-dev libqt5opengl5-dev.)]) |
|
4499 ]) |
|
4500 QT5INCDIR=`pkg-config --variable=includedir Qt5Gui` |
|
4501 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QT5INCDIR/QtGui/$QT_VERSION/QtGui" |
|
4502 if test "$NS_PRINTING"; then |
|
4503 PKG_CHECK_MODULES(MOZ_QT_WIDGETS, Qt5PrintSupport, , |
|
4504 [ |
|
4505 AC_MSG_ERROR([$MOZ_QT_PKG_ERRORS Need qtbase widgets development package]) |
|
4506 ]) |
|
4507 MOZ_QT_LIBS="$MOZ_QT_LIBS $MOZ_QT_WIDGETS_LIBS" |
|
4508 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $MOZ_QT_WIDGETS_CFLAGS" |
|
4509 fi |
|
4510 ;; |
|
4511 *) |
|
4512 AC_MSG_ERROR([* * * Unsupported Qt Version: $QT_VERSION]) |
|
4513 ;; |
|
4514 esac |
|
4515 |
|
4516 AC_CHECK_PROGS(HOST_MOC, $MOC moc, "") |
|
4517 AC_CHECK_PROGS(HOST_RCC, $RCC rcc, "") |
|
4518 else |
|
4519 MOZ_QT_CFLAGS="-DQT_SHARED" |
|
4520 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include" |
|
4521 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui" |
|
4522 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore" |
|
4523 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork" |
|
4524 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml" |
|
4525 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDeclarative" |
|
4526 case $QT_VERSION in |
|
4527 5.*) |
|
4528 AC_MSG_RESULT("Using qt5: $QT_VERSION") |
|
4529 MOZ_QT_LIBS="$MOZ_QT_LIBS -L$QTDIR/lib/ -lQt5Gui -lQt5Network -lQt5Core -lQt5Xml" |
|
4530 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui/$QT_VERSION/QtGui" |
|
4531 if test "$NS_PRINTING"; then |
|
4532 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQt5Widgets -lQt5PrintSupport" |
|
4533 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport" |
|
4534 fi |
|
4535 ;; |
|
4536 *) |
|
4537 AC_MSG_ERROR([* * * Unsupported Qt Version: $QT_VERSION]) |
|
4538 ;; |
|
4539 esac |
|
4540 |
|
4541 HOST_MOC="$QTDIR/bin/moc" |
|
4542 HOST_RCC="$QTDIR/bin/rcc" |
|
4543 fi |
|
4544 if test -z "$HOST_MOC"; then |
|
4545 AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is incorrect]) |
|
4546 fi |
|
4547 if test -z "$HOST_RCC"; then |
|
4548 AC_MSG_ERROR([No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is incorrect]) |
|
4549 fi |
|
4550 |
|
4551 MOC=$HOST_MOC |
|
4552 RCC=$HOST_RCC |
|
4553 |
|
4554 MOZ_ENABLE_QMSYSTEM2= |
|
4555 PKG_CHECK_MODULES(_QMSYSTEM2, qmsystem2, |
|
4556 MOZ_ENABLE_QMSYSTEM2=1, |
|
4557 MOZ_ENABLE_QMSYSTEM2=) |
|
4558 |
|
4559 if test "$MOZ_ENABLE_QMSYSTEM2"; then |
|
4560 MOZ_ENABLE_QMSYSTEM2=1 |
|
4561 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QMSYSTEM2_CFLAGS" |
|
4562 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QMSYSTEM2_LIBS" |
|
4563 AC_DEFINE(MOZ_ENABLE_QMSYSTEM2) |
|
4564 fi |
|
4565 |
|
4566 MOZ_ENABLE_QTNETWORK= |
|
4567 PKG_CHECK_MODULES(_QTNETWORK, QtNetwork >= 4.7, |
|
4568 MOZ_ENABLE_QTNETWORK=1, |
|
4569 MOZ_ENABLE_QTNETWORK=) |
|
4570 |
|
4571 if test "$MOZ_ENABLE_QTNETWORK"; then |
|
4572 MOZ_ENABLE_QTNETWORK=1 |
|
4573 AC_DEFINE(MOZ_ENABLE_QTNETWORK) |
|
4574 fi |
|
4575 |
|
4576 MOZ_ENABLE_QTMOBILITY= |
|
4577 PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback QtLocation, |
|
4578 MOZ_ENABLE_QTMOBILITY=1, |
|
4579 MOZ_ENABLE_QTMOBILITY=) |
|
4580 if test "$MOZ_ENABLE_QTMOBILITY"; then |
|
4581 MOZ_ENABLE_QTMOBILITY=1 |
|
4582 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS" |
|
4583 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS" |
|
4584 AC_DEFINE(MOZ_ENABLE_QTMOBILITY) |
|
4585 AC_SUBST(MOZ_ENABLE_QTMOBILITY) |
|
4586 else |
|
4587 AC_CHECK_LIB(QtSensors, main, [ |
|
4588 MOZ_ENABLE_QTMOBILITY=1 |
|
4589 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMobility" |
|
4590 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtSensors" |
|
4591 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtFeedback" |
|
4592 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtLocation" |
|
4593 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation" |
|
4594 ]) |
|
4595 fi |
|
4596 |
|
4597 MOZ_ENABLE_QT5FEEDBACK= |
|
4598 PKG_CHECK_MODULES(_QT5FEEDBACK, Qt0Feedback, |
|
4599 MOZ_ENABLE_QT5FEEDBACK=1, |
|
4600 MOZ_ENABLE_QT5FEEDBACK=) |
|
4601 if test "$MOZ_ENABLE_QT5FEEDBACK"; then |
|
4602 MOZ_ENABLE_QT5FEEDBACK=1 |
|
4603 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QT5FEEDBACK_CFLAGS" |
|
4604 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QT5FEEDBACK_LIBS" |
|
4605 AC_DEFINE(MOZ_ENABLE_QT5FEEDBACK) |
|
4606 AC_SUBST(MOZ_ENABLE_QT5FEEDBACK) |
|
4607 fi |
|
4608 |
|
4609 MOZ_ENABLE_QT5GEOPOSITION= |
|
4610 PKG_CHECK_MODULES(_QT5GEOPOSITION, Qt5Positioning, |
|
4611 MOZ_ENABLE_QT5GEOPOSITION=1, |
|
4612 MOZ_ENABLE_QT5GEOPOSITION=) |
|
4613 if test "$MOZ_ENABLE_QT5GEOPOSITION"; then |
|
4614 MOZ_ENABLE_QT5GEOPOSITION=1 |
|
4615 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QT5GEOPOSITION_CFLAGS" |
|
4616 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QT5GEOPOSITION_LIBS" |
|
4617 AC_DEFINE(MOZ_ENABLE_QT5GEOPOSITION) |
|
4618 AC_SUBST(MOZ_ENABLE_QT5GEOPOSITION) |
|
4619 fi |
|
4620 |
|
4621 if test "$MOZ_ENABLE_CONTENTACTION"; then |
|
4622 MOZ_ENABLE_CONTENTACTION=1 |
|
4623 AC_DEFINE(MOZ_ENABLE_CONTENTACTION) |
|
4624 fi |
|
4625 |
|
4626 MOZ_ENABLE_CONTENTACTION= |
|
4627 PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=) |
|
4628 if test "$MOZ_ENABLE_CONTENTACTION"; then |
|
4629 MOZ_ENABLE_CONTENTACTION=1 |
|
4630 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_CONTENTACTION_CFLAGS" |
|
4631 MOZ_QT_LIBS="$MOZ_QT_LIBS $_CONTENTACTION_LIBS" |
|
4632 AC_DEFINE(MOZ_ENABLE_CONTENTACTION) |
|
4633 AC_SUBST(MOZ_ENABLE_CONTENTACTION) |
|
4634 fi |
|
4635 fi |
|
4636 |
|
4637 AC_SUBST(GTK_CONFIG) |
|
4638 AC_SUBST(TK_CFLAGS) |
|
4639 AC_SUBST(TK_LIBS) |
|
4640 |
|
4641 AC_SUBST(MOZ_ENABLE_GTK2) |
|
4642 AC_SUBST(MOZ_ENABLE_GTK3) |
|
4643 AC_SUBST(MOZ_ENABLE_GTK) |
|
4644 AC_SUBST(MOZ_ENABLE_QT) |
|
4645 AC_SUBST(MOZ_ENABLE_QTNETWORK) |
|
4646 AC_SUBST(MOZ_ENABLE_QMSYSTEM2) |
|
4647 AC_SUBST(MOZ_ENABLE_QTMOBILITY) |
|
4648 AC_SUBST(MOZ_ENABLE_XREMOTE) |
|
4649 AC_SUBST(MOZ_GTK2_CFLAGS) |
|
4650 AC_SUBST(MOZ_GTK2_LIBS) |
|
4651 AC_SUBST(MOZ_GTK3_CFLAGS) |
|
4652 AC_SUBST(MOZ_GTK3_LIBS) |
|
4653 AC_SUBST(MOZ_WIDGET_GTK) |
|
4654 AC_SUBST(MOZ_QT_CFLAGS) |
|
4655 AC_SUBST(MOZ_QT_LIBS) |
|
4656 |
|
4657 AC_SUBST(MOC) |
|
4658 AC_SUBST(RCC) |
|
4659 |
|
4660 AC_SUBST(MOZ_X11) |
|
4661 |
|
4662 dnl ======================================================== |
|
4663 dnl = |
|
4664 dnl = Components & Features |
|
4665 dnl = |
|
4666 dnl ======================================================== |
|
4667 MOZ_ARG_HEADER(Components and Features) |
|
4668 |
|
4669 dnl ======================================================== |
|
4670 dnl = Localization |
|
4671 dnl ======================================================== |
|
4672 MOZ_ARG_ENABLE_STRING(ui-locale, |
|
4673 [ --enable-ui-locale=ab-CD |
|
4674 Select the user interface locale (default: en-US)], |
|
4675 MOZ_UI_LOCALE=$enableval ) |
|
4676 AC_SUBST(MOZ_UI_LOCALE) |
|
4677 |
|
4678 dnl ======================================================== |
|
4679 dnl = Trademarked Branding |
|
4680 dnl ======================================================== |
|
4681 MOZ_ARG_ENABLE_BOOL(official-branding, |
|
4682 [ --enable-official-branding |
|
4683 Enable Official mozilla.org Branding |
|
4684 Do not distribute builds with |
|
4685 --enable-official-branding unless you have |
|
4686 permission to use trademarks per |
|
4687 http://www.mozilla.org/foundation/trademarks/ .], |
|
4688 [ |
|
4689 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then |
|
4690 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.]) |
|
4691 else |
|
4692 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY} |
|
4693 MOZ_OFFICIAL_BRANDING=1 |
|
4694 fi |
|
4695 ], MOZ_OFFICIAL_BRANDING=) |
|
4696 |
|
4697 AC_SUBST(MOZ_OFFICIAL_BRANDING) |
|
4698 if test -n "$MOZ_OFFICIAL_BRANDING"; then |
|
4699 AC_DEFINE(MOZ_OFFICIAL_BRANDING) |
|
4700 fi |
|
4701 |
|
4702 MOZ_ARG_WITH_STRING(branding, |
|
4703 [ --with-branding=dir Use branding from the specified directory.], |
|
4704 MOZ_BRANDING_DIRECTORY=$withval) |
|
4705 |
|
4706 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}" |
|
4707 if test -z "$REAL_BRANDING_DIRECTORY"; then |
|
4708 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly |
|
4709 fi |
|
4710 |
|
4711 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then |
|
4712 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh" |
|
4713 fi |
|
4714 |
|
4715 AC_SUBST(MOZ_BRANDING_DIRECTORY) |
|
4716 |
|
4717 dnl ======================================================== |
|
4718 dnl = Distribution ID |
|
4719 dnl ======================================================== |
|
4720 MOZ_ARG_WITH_STRING(distribution-id, |
|
4721 [ --with-distribution-id=ID |
|
4722 Set distribution-specific id (default=org.mozilla)], |
|
4723 [ val=`echo $withval` |
|
4724 MOZ_DISTRIBUTION_ID="$val"]) |
|
4725 |
|
4726 if test -z "$MOZ_DISTRIBUTION_ID"; then |
|
4727 MOZ_DISTRIBUTION_ID="org.mozilla" |
|
4728 fi |
|
4729 |
|
4730 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID") |
|
4731 AC_SUBST(MOZ_DISTRIBUTION_ID) |
|
4732 |
|
4733 |
|
4734 dnl ======================================================== |
|
4735 dnl = Pango |
|
4736 dnl ======================================================== |
|
4737 if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT" |
|
4738 then |
|
4739 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION) |
|
4740 |
|
4741 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION) |
|
4742 AC_SUBST(MOZ_PANGO_CFLAGS) |
|
4743 AC_SUBST(MOZ_PANGO_LIBS) |
|
4744 fi |
|
4745 |
|
4746 dnl ======================================================== |
|
4747 dnl = GnomeVFS, GIO and GConf support module |
|
4748 dnl ======================================================== |
|
4749 |
|
4750 if test "$MOZ_X11" |
|
4751 then |
|
4752 dnl build the GIO extension by default only when the |
|
4753 dnl GTK2 toolkit is in use. |
|
4754 if test "$MOZ_ENABLE_GTK" |
|
4755 then |
|
4756 MOZ_ENABLE_GIO=1 |
|
4757 MOZ_ENABLE_GCONF=1 |
|
4758 fi |
|
4759 |
|
4760 dnl ======================================================== |
|
4761 dnl = GnomeVFS support module |
|
4762 dnl ======================================================== |
|
4763 MOZ_ARG_ENABLE_BOOL(gnomevfs, |
|
4764 [ --enable-gnomevfs Enable GnomeVFS support (default: disabled)], |
|
4765 MOZ_ENABLE_GNOMEVFS=force, |
|
4766 MOZ_ENABLE_GNOMEVFS=) |
|
4767 |
|
4768 if test "$MOZ_ENABLE_GNOMEVFS" |
|
4769 then |
|
4770 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[ |
|
4771 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'` |
|
4772 MOZ_ENABLE_GNOMEVFS=1 |
|
4773 AC_DEFINE(MOZ_ENABLE_GNOMEVFS) |
|
4774 ],[ |
|
4775 if test "$MOZ_ENABLE_GNOMEVFS" = "force" |
|
4776 then |
|
4777 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION]) |
|
4778 fi |
|
4779 MOZ_ENABLE_GNOMEVFS= |
|
4780 ]) |
|
4781 fi |
|
4782 |
|
4783 AC_SUBST(MOZ_ENABLE_GNOMEVFS) |
|
4784 AC_SUBST(MOZ_GNOMEVFS_CFLAGS) |
|
4785 AC_SUBST(MOZ_GNOMEVFS_LIBS) |
|
4786 |
|
4787 dnl ======================================================== |
|
4788 dnl = GIO support module |
|
4789 dnl ======================================================== |
|
4790 MOZ_ARG_DISABLE_BOOL(gio, |
|
4791 [ --disable-gio Disable GIO support], |
|
4792 MOZ_ENABLE_GIO=, |
|
4793 MOZ_ENABLE_GIO=force) |
|
4794 |
|
4795 if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK" |
|
4796 then |
|
4797 if test "$MOZ_ENABLE_GTK2" |
|
4798 then |
|
4799 PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, , |
|
4800 [AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])]) |
|
4801 fi |
|
4802 PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[ |
|
4803 MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'` |
|
4804 MOZ_ENABLE_GIO=1 |
|
4805 AC_DEFINE(MOZ_ENABLE_GIO) |
|
4806 ],[ |
|
4807 if test "$MOZ_ENABLE_GIO" = "force" |
|
4808 then |
|
4809 AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION]) |
|
4810 fi |
|
4811 MOZ_ENABLE_GIO= |
|
4812 ]) |
|
4813 fi |
|
4814 |
|
4815 AC_SUBST(MOZ_ENABLE_GIO) |
|
4816 AC_SUBST(MOZ_GIO_CFLAGS) |
|
4817 AC_SUBST(MOZ_GIO_LIBS) |
|
4818 |
|
4819 dnl ======================================================== |
|
4820 dnl = GConf support module |
|
4821 dnl ======================================================== |
|
4822 MOZ_ARG_DISABLE_BOOL(gconf, |
|
4823 [ --disable-gconf Disable Gconf support ], |
|
4824 MOZ_ENABLE_GCONF=, |
|
4825 MOZ_ENABLE_GCONF=force) |
|
4826 |
|
4827 if test "$MOZ_ENABLE_GCONF" |
|
4828 then |
|
4829 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[ |
|
4830 MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0` |
|
4831 MOZ_ENABLE_GCONF=1 |
|
4832 ],[ |
|
4833 if test "$MOZ_ENABLE_GCONF" = "force" |
|
4834 then |
|
4835 AC_MSG_ERROR([* * * Could not find gconf-2.0 ]) |
|
4836 fi |
|
4837 MOZ_ENABLE_GCONF= |
|
4838 ]) |
|
4839 fi |
|
4840 |
|
4841 if test "$MOZ_ENABLE_GCONF"; then |
|
4842 AC_DEFINE(MOZ_ENABLE_GCONF) |
|
4843 fi |
|
4844 |
|
4845 AC_SUBST(MOZ_ENABLE_GCONF) |
|
4846 AC_SUBST(MOZ_GCONF_CFLAGS) |
|
4847 AC_SUBST(MOZ_GCONF_LIBS) |
|
4848 fi |
|
4849 |
|
4850 dnl ======================================================== |
|
4851 dnl = libproxy support |
|
4852 dnl ======================================================== |
|
4853 |
|
4854 if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT" |
|
4855 then |
|
4856 MOZ_ENABLE_LIBPROXY= |
|
4857 |
|
4858 MOZ_ARG_ENABLE_BOOL(libproxy, |
|
4859 [ --enable-libproxy Enable libproxy support ], |
|
4860 MOZ_ENABLE_LIBPROXY=1, |
|
4861 MOZ_ENABLE_LIBPROXY=) |
|
4862 |
|
4863 if test "$MOZ_ENABLE_LIBPROXY" |
|
4864 then |
|
4865 PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0) |
|
4866 AC_DEFINE(MOZ_ENABLE_LIBPROXY) |
|
4867 fi |
|
4868 fi |
|
4869 AC_SUBST(MOZ_ENABLE_LIBPROXY) |
|
4870 AC_SUBST(MOZ_LIBPROXY_CFLAGS) |
|
4871 AC_SUBST(MOZ_LIBPROXY_LIBS) |
|
4872 |
|
4873 dnl ======================================================== |
|
4874 dnl = GNOME component (mozgnome) |
|
4875 dnl ======================================================== |
|
4876 |
|
4877 if test "$MOZ_ENABLE_GTK" |
|
4878 then |
|
4879 MOZ_ENABLE_GNOME_COMPONENT=1 |
|
4880 fi |
|
4881 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT) |
|
4882 |
|
4883 dnl ======================================================== |
|
4884 dnl = libgnomeui support module |
|
4885 dnl ======================================================== |
|
4886 |
|
4887 if test "$MOZ_ENABLE_GTK" |
|
4888 then |
|
4889 MOZ_ARG_ENABLE_BOOL(gnomeui, |
|
4890 [ --enable-gnomeui Enable libgnomeui instead of GIO & GTK for icon theme support ], |
|
4891 MOZ_ENABLE_GNOMEUI=force, |
|
4892 MOZ_ENABLE_GNOMEUI=) |
|
4893 |
|
4894 if test "$MOZ_ENABLE_GNOMEUI" |
|
4895 then |
|
4896 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION, |
|
4897 [ |
|
4898 MOZ_ENABLE_GNOMEUI=1 |
|
4899 ],[ |
|
4900 if test "$MOZ_ENABLE_GNOMEUI" = "force" |
|
4901 then |
|
4902 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION]) |
|
4903 fi |
|
4904 MOZ_ENABLE_GNOMEUI= |
|
4905 ]) |
|
4906 fi |
|
4907 |
|
4908 if test "$MOZ_ENABLE_GNOMEUI"; then |
|
4909 AC_DEFINE(MOZ_ENABLE_GNOMEUI) |
|
4910 fi |
|
4911 fi |
|
4912 |
|
4913 AC_SUBST(MOZ_ENABLE_GNOMEUI) |
|
4914 AC_SUBST(MOZ_GNOMEUI_CFLAGS) |
|
4915 |
|
4916 dnl ======================================================== |
|
4917 dnl = dbus support |
|
4918 dnl ======================================================== |
|
4919 |
|
4920 if test "$MOZ_ENABLE_GTK" -o "$MOZ_ENABLE_QT" |
|
4921 then |
|
4922 MOZ_ENABLE_DBUS=1 |
|
4923 |
|
4924 MOZ_ARG_DISABLE_BOOL(dbus, |
|
4925 [ --disable-dbus Disable dbus support ], |
|
4926 MOZ_ENABLE_DBUS=, |
|
4927 MOZ_ENABLE_DBUS=1) |
|
4928 |
|
4929 if test "$MOZ_ENABLE_DBUS" |
|
4930 then |
|
4931 PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION) |
|
4932 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION) |
|
4933 AC_DEFINE(MOZ_ENABLE_DBUS) |
|
4934 fi |
|
4935 fi |
|
4936 AC_SUBST(MOZ_ENABLE_DBUS) |
|
4937 AC_SUBST(MOZ_DBUS_CFLAGS) |
|
4938 AC_SUBST(MOZ_DBUS_LIBS) |
|
4939 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS) |
|
4940 AC_SUBST(MOZ_DBUS_GLIB_LIBS) |
|
4941 |
|
4942 dnl ======================================================== |
|
4943 dnl = Enable Android History instead of Places |
|
4944 dnl ======================================================== |
|
4945 if test -n "$MOZ_ANDROID_HISTORY"; then |
|
4946 if test -z "$MOZ_PLACES"; then |
|
4947 AC_DEFINE(MOZ_ANDROID_HISTORY) |
|
4948 else |
|
4949 AC_MSG_ERROR([Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.]) |
|
4950 fi |
|
4951 fi |
|
4952 |
|
4953 dnl ======================================================== |
|
4954 dnl = Build with the Android compositor |
|
4955 dnl ======================================================== |
|
4956 if test -n "$MOZ_ANDROID_OMTC"; then |
|
4957 dnl Do this if defined in confvars.sh |
|
4958 AC_DEFINE(MOZ_ANDROID_OMTC) |
|
4959 fi |
|
4960 |
|
4961 dnl ======================================================== |
|
4962 dnl = Disable WebSMS backend |
|
4963 dnl ======================================================== |
|
4964 MOZ_ARG_DISABLE_BOOL(websms-backend, |
|
4965 [ --disable-websms-backend |
|
4966 Disable WebSMS backend], |
|
4967 MOZ_WEBSMS_BACKEND=, |
|
4968 MOZ_WEBSMS_BACKEND=1) |
|
4969 |
|
4970 if test -n "$MOZ_WEBSMS_BACKEND"; then |
|
4971 AC_DEFINE(MOZ_WEBSMS_BACKEND) |
|
4972 fi |
|
4973 |
|
4974 dnl ======================================================== |
|
4975 dnl = Enable NFC permission on Android |
|
4976 dnl ======================================================== |
|
4977 if test -n "$MOZ_ANDROID_BEAM"; then |
|
4978 AC_DEFINE(MOZ_ANDROID_BEAM) |
|
4979 fi |
|
4980 |
|
4981 dnl ======================================================== |
|
4982 dnl = Synthesized Webapp APKs on Android |
|
4983 dnl ======================================================== |
|
4984 MOZ_ARG_ENABLE_BOOL(android-synthapks, |
|
4985 [ --enable-android-synthapks Enable synthesized APKs], |
|
4986 MOZ_ANDROID_SYNTHAPKS=1, |
|
4987 MOZ_ANDROID_SYNTHAPKS=) |
|
4988 |
|
4989 if test -n "$MOZ_ANDROID_SYNTHAPKS"; then |
|
4990 AC_DEFINE(MOZ_ANDROID_SYNTHAPKS) |
|
4991 fi |
|
4992 |
|
4993 dnl ======================================================== |
|
4994 dnl = JS Debugger XPCOM component (js/jsd) |
|
4995 dnl ======================================================== |
|
4996 MOZ_ARG_DISABLE_BOOL(jsd, |
|
4997 [ --disable-jsd Disable JavaScript debug library], |
|
4998 MOZ_JSDEBUGGER=, |
|
4999 MOZ_JSDEBUGGER=1) |
|
5000 |
|
5001 |
|
5002 dnl ======================================================== |
|
5003 dnl = Enable IPDL's "expensive" unit tests |
|
5004 dnl ======================================================== |
|
5005 MOZ_IPDL_TESTS= |
|
5006 |
|
5007 MOZ_ARG_ENABLE_BOOL(ipdl-tests, |
|
5008 [ --enable-ipdl-tests Enable expensive IPDL tests], |
|
5009 MOZ_IPDL_TESTS=1, |
|
5010 MOZ_IPDL_TESTS=) |
|
5011 |
|
5012 if test -n "$MOZ_IPDL_TESTS"; then |
|
5013 AC_DEFINE(MOZ_IPDL_TESTS) |
|
5014 fi |
|
5015 |
|
5016 AC_SUBST(MOZ_IPDL_TESTS) |
|
5017 |
|
5018 dnl ======================================================== |
|
5019 dnl = Disable building dbm |
|
5020 dnl ======================================================== |
|
5021 MOZ_ARG_DISABLE_BOOL(dbm, |
|
5022 [ --disable-dbm Disable building dbm], |
|
5023 NSS_DISABLE_DBM=1, |
|
5024 NSS_DISABLE_DBM=) |
|
5025 |
|
5026 dnl ======================================================== |
|
5027 dnl accessibility support on by default on all platforms |
|
5028 dnl ======================================================== |
|
5029 MOZ_ARG_DISABLE_BOOL(accessibility, |
|
5030 [ --disable-accessibility Disable accessibility support], |
|
5031 ACCESSIBILITY=, |
|
5032 ACCESSIBILITY=1 ) |
|
5033 if test "$ACCESSIBILITY"; then |
|
5034 case "$target" in |
|
5035 *-mingw*) |
|
5036 if test -z "$MIDL"; then |
|
5037 if test "$GCC" != "yes"; then |
|
5038 AC_MSG_ERROR([MIDL could not be found. Building accessibility without MIDL is not supported.]) |
|
5039 else |
|
5040 AC_MSG_ERROR([You have accessibility enabled, but widl could not be found. Add --disable-accessibility to your mozconfig or install widl. See https://developer.mozilla.org/en-US/docs/Cross_Compile_Mozilla_for_Mingw32 for details.]) |
|
5041 fi |
|
5042 fi |
|
5043 esac |
|
5044 AC_DEFINE(ACCESSIBILITY) |
|
5045 fi |
|
5046 |
|
5047 dnl ======================================================== |
|
5048 dnl Accessibility is required for the linuxgl widget |
|
5049 dnl backend |
|
5050 dnl ======================================================== |
|
5051 if test "${MOZ_WIDGET_TOOLKIT}" = "linuxgl" -a "$ACCESSIBILITY" != "1"; then |
|
5052 AC_MSG_ERROR(["Accessibility is required for the linuxgl widget backend"]) |
|
5053 fi |
|
5054 |
|
5055 dnl Turn off webrtc for OS's we don't handle yet, but allow |
|
5056 dnl --enable-webrtc to override. Can disable for everything in |
|
5057 dnl the master list above. |
|
5058 if test -n "$MOZ_WEBRTC"; then |
|
5059 case "$target" in |
|
5060 *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*) |
|
5061 dnl Leave enabled |
|
5062 ;; |
|
5063 *) |
|
5064 dnl default to disabled for all others |
|
5065 MOZ_WEBRTC= |
|
5066 ;; |
|
5067 esac |
|
5068 fi |
|
5069 |
|
5070 AC_TRY_COMPILE([#include <linux/ethtool.h>], |
|
5071 [ struct ethtool_cmd cmd; cmd.speed_hi = 0; ], |
|
5072 MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI=1) |
|
5073 |
|
5074 AC_SUBST(MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI) |
|
5075 |
|
5076 # target_arch is from {ia32|x64|arm|ppc} |
|
5077 case "$CPU_ARCH" in |
|
5078 x86_64 | arm | x86 | ppc* | ia64) |
|
5079 : |
|
5080 ;; |
|
5081 *) |
|
5082 # unsupported arch for webrtc |
|
5083 MOZ_WEBRTC= |
|
5084 ;; |
|
5085 |
|
5086 esac |
|
5087 |
|
5088 dnl ======================================================== |
|
5089 dnl = Disable WebRTC code |
|
5090 dnl ======================================================== |
|
5091 MOZ_ARG_DISABLE_BOOL(webrtc, |
|
5092 [ --disable-webrtc Disable support for WebRTC], |
|
5093 MOZ_WEBRTC=, |
|
5094 MOZ_WEBRTC=1) |
|
5095 |
|
5096 if test -n "$MOZ_WEBRTC"; then |
|
5097 AC_DEFINE(MOZ_WEBRTC) |
|
5098 dnl MOZ_WEBRTC_ASSERT_ALWAYS turns on a number of safety asserts in |
|
5099 dnl opt/production builds (via MOZ_CRASH()) |
|
5100 AC_DEFINE(MOZ_WEBRTC_ASSERT_ALWAYS) |
|
5101 MOZ_RAW=1 |
|
5102 MOZ_VPX=1 |
|
5103 MOZ_VPX_ERROR_CONCEALMENT=1 |
|
5104 |
|
5105 dnl enable once Signaling lands |
|
5106 MOZ_WEBRTC_SIGNALING=1 |
|
5107 AC_DEFINE(MOZ_WEBRTC_SIGNALING) |
|
5108 dnl enable once PeerConnection lands |
|
5109 MOZ_PEERCONNECTION=1 |
|
5110 AC_DEFINE(MOZ_PEERCONNECTION) |
|
5111 MOZ_SCTP=1 |
|
5112 MOZ_SRTP=1 |
|
5113 AC_DEFINE(MOZ_SCTP) |
|
5114 AC_DEFINE(MOZ_SRTP) |
|
5115 else |
|
5116 MOZ_SYNTH_PICO= |
|
5117 fi |
|
5118 |
|
5119 AC_SUBST(MOZ_WEBRTC) |
|
5120 AC_SUBST(MOZ_WEBRTC_LEAKING_TESTS) |
|
5121 AC_SUBST(MOZ_WEBRTC_SIGNALING) |
|
5122 AC_SUBST(MOZ_PEERCONNECTION) |
|
5123 AC_SUBST(MOZ_WEBRTC_ASSERT_ALWAYS) |
|
5124 AC_SUBST(MOZ_SCTP) |
|
5125 AC_SUBST(MOZ_SRTP) |
|
5126 |
|
5127 dnl Use integers over floats for audio on B2G and Android |
|
5128 dnl (regarless of the CPU architecture, because audio |
|
5129 dnl backends for those platforms don't support floats. We also |
|
5130 dnl use integers on ARM with other OS, because it's more efficient. |
|
5131 if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then |
|
5132 MOZ_SAMPLE_TYPE_S16=1 |
|
5133 AC_DEFINE(MOZ_SAMPLE_TYPE_S16) |
|
5134 AC_SUBST(MOZ_SAMPLE_TYPE_S16) |
|
5135 else |
|
5136 MOZ_SAMPLE_TYPE_FLOAT32=1 |
|
5137 AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32) |
|
5138 AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32) |
|
5139 fi |
|
5140 |
|
5141 dnl ======================================================== |
|
5142 dnl = Disable Speech API code |
|
5143 dnl ======================================================== |
|
5144 MOZ_ARG_DISABLE_BOOL(webspeech, |
|
5145 [ --disable-webspeech Disable support for HTML Speech API], |
|
5146 MOZ_WEBSPEECH=, |
|
5147 MOZ_WEBSPEECH=1) |
|
5148 |
|
5149 if test -n "$MOZ_WEBSPEECH"; then |
|
5150 AC_DEFINE(MOZ_WEBSPEECH) |
|
5151 fi |
|
5152 |
|
5153 AC_SUBST(MOZ_WEBSPEECH) |
|
5154 |
|
5155 dnl ======================================================== |
|
5156 dnl = Enable Raw Codecs |
|
5157 dnl ======================================================== |
|
5158 MOZ_ARG_ENABLE_BOOL(raw, |
|
5159 [ --enable-raw Enable support for RAW media], |
|
5160 MOZ_RAW=1, |
|
5161 MOZ_RAW=) |
|
5162 |
|
5163 if test -n "$MOZ_RAW"; then |
|
5164 AC_DEFINE(MOZ_RAW) |
|
5165 fi |
|
5166 |
|
5167 AC_SUBST(MOZ_RAW) |
|
5168 |
|
5169 dnl Checks for __attribute__(aligned()) directive need by libogg |
|
5170 AC_CACHE_CHECK([__attribute__ ((aligned ())) support], |
|
5171 [ac_cv_c_attribute_aligned], |
|
5172 [ac_cv_c_attribute_aligned=0 |
|
5173 CFLAGS_save="${CFLAGS}" |
|
5174 CFLAGS="${CFLAGS} -Werror" |
|
5175 for ac_cv_c_attr_align_try in 64 32 16 8; do |
|
5176 echo "trying $ac_cv_c_attr_align_try" |
|
5177 AC_TRY_COMPILE([], |
|
5178 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;], |
|
5179 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"]) |
|
5180 if test "$ac_cv_c_attribute_aligned" != 0; then |
|
5181 break; |
|
5182 fi |
|
5183 done |
|
5184 CFLAGS="${CFLAGS_save}"]) |
|
5185 if test "${ac_cv_c_attribute_aligned}" != "0"; then |
|
5186 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], |
|
5187 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment]) |
|
5188 fi |
|
5189 |
|
5190 dnl ======================================================== |
|
5191 dnl = Disable Opus audio codec support |
|
5192 dnl ======================================================== |
|
5193 MOZ_ARG_DISABLE_BOOL(opus, |
|
5194 [ --disable-opus Disable support for Opus audio], |
|
5195 MOZ_OPUS=, |
|
5196 MOZ_OPUS=1) |
|
5197 |
|
5198 dnl ======================================================== |
|
5199 dnl = Disable VP8 decoder support |
|
5200 dnl ======================================================== |
|
5201 MOZ_ARG_DISABLE_BOOL(webm, |
|
5202 [ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)], |
|
5203 MOZ_WEBM=, |
|
5204 MOZ_WEBM=1) |
|
5205 |
|
5206 if test -n "$MOZ_WEBM"; then |
|
5207 AC_DEFINE(MOZ_WEBM) |
|
5208 MOZ_VPX=1 |
|
5209 fi; |
|
5210 |
|
5211 dnl ======================================================== |
|
5212 dnl = DirectShow support |
|
5213 dnl ======================================================== |
|
5214 if test "$OS_ARCH" = "WINNT"; then |
|
5215 dnl Enable DirectShow support by default. |
|
5216 MOZ_DIRECTSHOW=1 |
|
5217 fi |
|
5218 |
|
5219 MOZ_ARG_DISABLE_BOOL(directshow, |
|
5220 [ --disable-directshow Disable support for DirectShow], |
|
5221 MOZ_DIRECTSHOW=, |
|
5222 MOZ_DIRECTSHOW=1) |
|
5223 |
|
5224 if test -n "$MOZ_DIRECTSHOW"; then |
|
5225 AC_DEFINE(MOZ_DIRECTSHOW) |
|
5226 fi; |
|
5227 |
|
5228 dnl ======================================================== |
|
5229 dnl = Windows Media Foundation support |
|
5230 dnl ======================================================== |
|
5231 if test "$OS_ARCH" = "WINNT"; then |
|
5232 dnl Enable Windows Media Foundation support by default. |
|
5233 dnl Note our minimum SDK version is Windows 7 SDK, so we are (currently) |
|
5234 dnl guaranteed to have a recent-enough SDK to build WMF. |
|
5235 MOZ_WMF=1 |
|
5236 fi |
|
5237 |
|
5238 MOZ_ARG_DISABLE_BOOL(wmf, |
|
5239 [ --disable-wmf Disable support for Windows Media Foundation], |
|
5240 MOZ_WMF=, |
|
5241 MOZ_WMF=1) |
|
5242 |
|
5243 if test -n "$MOZ_WMF"; then |
|
5244 AC_DEFINE(MOZ_WMF) |
|
5245 fi; |
|
5246 |
|
5247 dnl ======================================================== |
|
5248 dnl FFmpeg H264/AAC Decoding Support |
|
5249 dnl ======================================================== |
|
5250 case "$OS_TARGET" in |
|
5251 WINNT|Darwin|Android) |
|
5252 ;; |
|
5253 *) |
|
5254 MOZ_FFMPEG=1 |
|
5255 ;; |
|
5256 esac |
|
5257 |
|
5258 MOZ_ARG_DISABLE_BOOL(ffmpeg, |
|
5259 [ --disable-ffmpeg Disable FFmpeg for fragmented H264/AAC decoding], |
|
5260 MOZ_FFMPEG=, |
|
5261 MOZ_FFMPEG=1 |
|
5262 ) |
|
5263 |
|
5264 if test -n "$MOZ_FFMPEG"; then |
|
5265 AC_DEFINE(MOZ_FFMPEG) |
|
5266 fi; |
|
5267 |
|
5268 dnl ======================================================== |
|
5269 dnl = Built-in fragmented MP4 support. |
|
5270 dnl ======================================================== |
|
5271 if test -n "$MOZ_WMF" -o -n "$MOZ_FFMPEG"; then |
|
5272 dnl Enable fragmented MP4 parser on Windows by default. |
|
5273 dnl We will also need to enable it on other platforms as we implement |
|
5274 dnl platform decoder support there too. |
|
5275 MOZ_FMP4=1 |
|
5276 fi |
|
5277 |
|
5278 MOZ_ARG_DISABLE_BOOL(fmp4, |
|
5279 [ --disable-fmp4 Disable support for in built Fragmented MP4 parsing], |
|
5280 MOZ_FMP4=, |
|
5281 MOZ_FMP4=1) |
|
5282 |
|
5283 if test -n "$MOZ_FMP4"; then |
|
5284 AC_DEFINE(MOZ_FMP4) |
|
5285 fi; |
|
5286 |
|
5287 |
|
5288 dnl ======================================================== |
|
5289 dnl = Enable media plugin support |
|
5290 dnl ======================================================== |
|
5291 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then |
|
5292 dnl Enable support on android by default |
|
5293 MOZ_MEDIA_PLUGINS=1 |
|
5294 fi |
|
5295 |
|
5296 MOZ_ARG_ENABLE_BOOL(media-plugins, |
|
5297 [ --enable-media-plugins Enable support for media plugins], |
|
5298 MOZ_MEDIA_PLUGINS=1, |
|
5299 MOZ_MEDIA_PLUGINS=) |
|
5300 |
|
5301 if test -n "$MOZ_MEDIA_PLUGINS"; then |
|
5302 AC_DEFINE(MOZ_MEDIA_PLUGINS) |
|
5303 fi |
|
5304 |
|
5305 dnl ======================================================== |
|
5306 dnl = Disable platform MP3 decoder on OSX |
|
5307 dnl ======================================================== |
|
5308 if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then |
|
5309 MOZ_APPLEMEDIA=1 |
|
5310 fi |
|
5311 |
|
5312 MOZ_ARG_DISABLE_BOOL(apple-media, |
|
5313 [ --disable-apple-media Disable support for Apple AudioToolbox/VideoToolbox], |
|
5314 MOZ_APPLEMEDIA=, |
|
5315 MOZ_APPLEMEDIA=1) |
|
5316 |
|
5317 if test -n "$MOZ_APPLEMEDIA"; then |
|
5318 AC_DEFINE(MOZ_APPLEMEDIA) |
|
5319 fi |
|
5320 |
|
5321 dnl ======================================================== |
|
5322 dnl = Enable getUserMedia support |
|
5323 dnl ======================================================== |
|
5324 MOZ_ARG_ENABLE_BOOL(media-navigator, |
|
5325 [ --enable-media-navigator Enable support for getUserMedia], |
|
5326 MOZ_MEDIA_NAVIGATOR=1, |
|
5327 MOZ_MEDIA_NAVIGATOR=) |
|
5328 |
|
5329 if test -n "$MOZ_MEDIA_NAVIGATOR"; then |
|
5330 AC_DEFINE(MOZ_MEDIA_NAVIGATOR) |
|
5331 fi |
|
5332 |
|
5333 dnl ======================================================== |
|
5334 dnl = Enable building OMX media plugin (B2G or Android) |
|
5335 dnl ======================================================== |
|
5336 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then |
|
5337 dnl Enable support on android by default |
|
5338 MOZ_OMX_PLUGIN=1 |
|
5339 fi |
|
5340 |
|
5341 MOZ_ARG_ENABLE_BOOL(omx-plugin, |
|
5342 [ --enable-omx-plugin Enable building OMX plugin (B2G)], |
|
5343 MOZ_OMX_PLUGIN=1, |
|
5344 MOZ_OMX_PLUGIN=) |
|
5345 |
|
5346 if test -n "$MOZ_OMX_PLUGIN"; then |
|
5347 if test "$OS_TARGET" = "Android"; then |
|
5348 dnl Only allow building OMX plugin on Gonk (B2G) or Android |
|
5349 AC_DEFINE(MOZ_OMX_PLUGIN) |
|
5350 else |
|
5351 dnl fail if we're not building on Gonk or Android |
|
5352 AC_MSG_ERROR([OMX media plugin can only be built on B2G or Android]) |
|
5353 fi |
|
5354 fi |
|
5355 |
|
5356 dnl system libvpx Support |
|
5357 dnl ======================================================== |
|
5358 MOZ_ARG_WITH_BOOL(system-libvpx, |
|
5359 [ --with-system-libvpx Use system libvpx (located with pkgconfig)], |
|
5360 MOZ_NATIVE_LIBVPX=1) |
|
5361 |
|
5362 MOZ_LIBVPX_CFLAGS= |
|
5363 MOZ_LIBVPX_LIBS= |
|
5364 |
|
5365 if test -n "$MOZ_VPX"; then |
|
5366 AC_DEFINE(MOZ_VPX) |
|
5367 if test -n "$MOZ_VPX_ERROR_CONCEALMENT" ; then |
|
5368 AC_DEFINE(MOZ_VPX_ERROR_CONCEALMENT) |
|
5369 fi |
|
5370 |
|
5371 _SAVE_CFLAGS=$CFLAGS |
|
5372 _SAVE_LIBS=$LIBS |
|
5373 if test -n "$MOZ_NATIVE_LIBVPX"; then |
|
5374 dnl ============================ |
|
5375 dnl === libvpx Version check === |
|
5376 dnl ============================ |
|
5377 dnl Check to see if we have a system libvpx package. |
|
5378 PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.3.0) |
|
5379 |
|
5380 CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS" |
|
5381 LIBS="$LIBS $MOZ_LIBVPX_LIBS" |
|
5382 |
|
5383 MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [], |
|
5384 [AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])]) |
|
5385 |
|
5386 AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [], |
|
5387 [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])]) |
|
5388 |
|
5389 MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h], |
|
5390 [AC_CHECK_FUNC(vpx_mem_set_functions)]) |
|
5391 if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \ |
|
5392 "$ac_cv_func_vpx_mem_set_functions" = no; then |
|
5393 AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING) |
|
5394 fi |
|
5395 fi |
|
5396 CFLAGS=$_SAVE_CFLAGS |
|
5397 LIBS=$_SAVE_LIBS |
|
5398 fi |
|
5399 |
|
5400 AC_SUBST(MOZ_NATIVE_LIBVPX) |
|
5401 AC_SUBST(MOZ_LIBVPX_CFLAGS) |
|
5402 AC_SUBST(MOZ_LIBVPX_LIBS) |
|
5403 |
|
5404 if test "$MOZ_WEBM"; then |
|
5405 if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then |
|
5406 MOZ_VORBIS=1 |
|
5407 else |
|
5408 MOZ_TREMOR=1 |
|
5409 fi |
|
5410 fi |
|
5411 |
|
5412 if test -n "$MOZ_VPX" -a -z "$MOZ_NATIVE_LIBVPX"; then |
|
5413 |
|
5414 dnl Detect if we can use an assembler to compile optimized assembly for libvpx. |
|
5415 dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32. |
|
5416 dnl We currently require gcc on all arm platforms. |
|
5417 VPX_AS=$YASM |
|
5418 VPX_ASM_SUFFIX=asm |
|
5419 VPX_NEED_OBJ_INT_EXTRACT= |
|
5420 |
|
5421 dnl See if we have assembly on this platform. |
|
5422 case "$OS_ARCH:$CPU_ARCH" in |
|
5423 Darwin:x86) |
|
5424 VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC" |
|
5425 VPX_X86_ASM=1 |
|
5426 ;; |
|
5427 Darwin:x86_64) |
|
5428 VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC" |
|
5429 VPX_X86_ASM=1 |
|
5430 ;; |
|
5431 WINNT:x86_64) |
|
5432 VPX_ASFLAGS="-f x64 -rnasm -pnasm" |
|
5433 VPX_X86_ASM=1 |
|
5434 ;; |
|
5435 WINNT:x86) |
|
5436 dnl Check for yasm 1.1 or greater. |
|
5437 if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then |
|
5438 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.]) |
|
5439 elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then |
|
5440 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.]) |
|
5441 else |
|
5442 VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC" |
|
5443 VPX_X86_ASM=1 |
|
5444 dnl The encoder needs obj_int_extract to get asm offsets. |
|
5445 fi |
|
5446 ;; |
|
5447 *:arm*) |
|
5448 if test -n "$GNU_AS" ; then |
|
5449 VPX_AS=$AS |
|
5450 dnl These flags are a lie; they're just used to enable the requisite |
|
5451 dnl opcodes; actual arch detection is done at runtime. |
|
5452 VPX_ASFLAGS="-march=armv7-a -mfpu=neon" |
|
5453 VPX_DASH_C_FLAG="-c" |
|
5454 VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl' |
|
5455 VPX_ASM_SUFFIX="$ASM_SUFFIX" |
|
5456 VPX_ARM_ASM=1 |
|
5457 fi |
|
5458 ;; |
|
5459 *:x86) |
|
5460 if $CC -E -dM -</dev/null | grep -q __ELF__; then |
|
5461 VPX_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC" |
|
5462 VPX_X86_ASM=1 |
|
5463 fi |
|
5464 ;; |
|
5465 *:x86_64) |
|
5466 if $CC -E -dM -</dev/null | grep -q __ELF__; then |
|
5467 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC" |
|
5468 VPX_X86_ASM=1 |
|
5469 fi |
|
5470 ;; |
|
5471 esac |
|
5472 |
|
5473 if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then |
|
5474 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.]) |
|
5475 fi |
|
5476 |
|
5477 if test -z "$GNU_CC" -a -z "$INTEL_CC" -a -z "$CLANG_CC" ; then |
|
5478 dnl We prefer to get asm offsets using inline assembler, which the above |
|
5479 dnl compilers can do. When we're not using one of those, we have to fall |
|
5480 dnl back to obj_int_extract, which reads them from a compiled object |
|
5481 dnl file. Unfortunately, that only works if we're compiling on a system |
|
5482 dnl with the header files for the appropriate object file format. |
|
5483 VPX_NEED_OBJ_INT_EXTRACT=1 |
|
5484 fi |
|
5485 |
|
5486 if test -n "$VPX_X86_ASM"; then |
|
5487 AC_DEFINE(VPX_X86_ASM) |
|
5488 elif test -n "$VPX_ARM_ASM"; then |
|
5489 AC_DEFINE(VPX_ARM_ASM) |
|
5490 else |
|
5491 AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.]) |
|
5492 fi |
|
5493 fi |
|
5494 |
|
5495 dnl ======================================================== |
|
5496 dnl = Disable Wave decoder support |
|
5497 dnl ======================================================== |
|
5498 MOZ_ARG_DISABLE_BOOL(wave, |
|
5499 [ --disable-wave Disable Wave decoder support], |
|
5500 MOZ_WAVE=, |
|
5501 MOZ_WAVE=1) |
|
5502 |
|
5503 if test -n "$MOZ_WAVE"; then |
|
5504 AC_DEFINE(MOZ_WAVE) |
|
5505 fi |
|
5506 |
|
5507 dnl ======================================================== |
|
5508 dnl = Handle dependent MEDIA defines |
|
5509 dnl ======================================================== |
|
5510 |
|
5511 if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then |
|
5512 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/]) |
|
5513 fi |
|
5514 |
|
5515 if test -n "$MOZ_WEBRTC" -a -z "$MOZ_OPUS"; then |
|
5516 AC_MSG_ERROR([MOZ_WEBRTC requires MOZ_OPUS which is disabled.]) |
|
5517 fi |
|
5518 |
|
5519 if test -n "$MOZ_VORBIS"; then |
|
5520 AC_DEFINE(MOZ_VORBIS) |
|
5521 fi |
|
5522 |
|
5523 if test -n "$MOZ_TREMOR"; then |
|
5524 AC_DEFINE(MOZ_TREMOR) |
|
5525 # Tremor doesn't have an encoder. |
|
5526 MOZ_WEBM_ENCODER= |
|
5527 fi |
|
5528 |
|
5529 if test -n "$MOZ_OPUS"; then |
|
5530 AC_DEFINE(MOZ_OPUS) |
|
5531 fi |
|
5532 |
|
5533 if test -n "$MOZ_WEBM_ENCODER"; then |
|
5534 AC_DEFINE(MOZ_WEBM_ENCODER) |
|
5535 fi |
|
5536 AC_SUBST(MOZ_WEBM_ENCODER) |
|
5537 |
|
5538 dnl ================================== |
|
5539 dnl = Check alsa availability on Linux |
|
5540 dnl ================================== |
|
5541 |
|
5542 dnl If using Linux, ensure that the alsa library is available |
|
5543 if test "$OS_TARGET" = "Linux"; then |
|
5544 MOZ_ALSA=1 |
|
5545 fi |
|
5546 |
|
5547 MOZ_ARG_ENABLE_BOOL(alsa, |
|
5548 [ --enable-alsa Enable Alsa support (default on Linux)], |
|
5549 MOZ_ALSA=1, |
|
5550 MOZ_ALSA=) |
|
5551 |
|
5552 if test -n "$MOZ_ALSA"; then |
|
5553 PKG_CHECK_MODULES(MOZ_ALSA, alsa, , |
|
5554 [echo "$MOZ_ALSA_PKG_ERRORS" |
|
5555 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.)])]) |
|
5556 fi |
|
5557 |
|
5558 AC_SUBST(MOZ_ALSA) |
|
5559 AC_SUBST(MOZ_ALSA_CFLAGS) |
|
5560 AC_SUBST(MOZ_ALSA_LIBS) |
|
5561 |
|
5562 dnl ======================================================== |
|
5563 dnl = Disable PulseAudio |
|
5564 dnl ======================================================== |
|
5565 |
|
5566 dnl If using Linux, ensure that the PA library is available |
|
5567 case "$OS_TARGET" in |
|
5568 WINNT|Darwin|Android|OpenBSD) |
|
5569 ;; |
|
5570 *) |
|
5571 if test -z "$MOZ_B2G"; then |
|
5572 MOZ_PULSEAUDIO=1 |
|
5573 fi |
|
5574 ;; |
|
5575 esac |
|
5576 |
|
5577 MOZ_ARG_DISABLE_BOOL(pulseaudio, |
|
5578 [ --disable-pulseaudio Disable PulseAudio support], |
|
5579 MOZ_PULSEAUDIO=, |
|
5580 MOZ_PULSEAUDIO=1) |
|
5581 |
|
5582 if test -n "$MOZ_PULSEAUDIO"; then |
|
5583 if test -z "$gonkdir"; then |
|
5584 PKG_CHECK_MODULES(MOZ_PULSEAUDIO, libpulse, , |
|
5585 [echo "$MOZ_PULSEAUDIO_PKG_ERRORS" |
|
5586 AC_MSG_ERROR([pulseaudio audio backend requires libpulse development package])]) |
|
5587 else |
|
5588 MOZ_PULSEAUDIO_CFLAGS="-I$gonkdir/external/pulseaudio/pulseaudio/src" |
|
5589 fi |
|
5590 fi |
|
5591 |
|
5592 AC_SUBST(MOZ_PULSEAUDIO) |
|
5593 AC_SUBST(MOZ_PULSEAUDIO_CFLAGS) |
|
5594 |
|
5595 dnl ======================================================== |
|
5596 dnl = Enable GStreamer |
|
5597 dnl ======================================================== |
|
5598 case "$OS_TARGET" in |
|
5599 WINNT|Darwin|Android) |
|
5600 ;; |
|
5601 *) |
|
5602 MOZ_GSTREAMER=1 |
|
5603 GST_API_VERSION=0.10 |
|
5604 ;; |
|
5605 esac |
|
5606 |
|
5607 MOZ_ARG_ENABLE_STRING(gstreamer, |
|
5608 [ --enable-gstreamer[=0.10] Enable GStreamer support], |
|
5609 [ MOZ_GSTREAMER=1 |
|
5610 # API version, eg 0.10, 1.0 etc |
|
5611 if test -z "$enableval" -o "$enableval" = "yes"; then |
|
5612 GST_API_VERSION=0.10 |
|
5613 elif test "$enableval" = "no"; then |
|
5614 MOZ_GSTREAMER= |
|
5615 else |
|
5616 GST_API_VERSION=$enableval |
|
5617 fi], |
|
5618 ) |
|
5619 |
|
5620 if test -n "$MOZ_GSTREAMER"; then |
|
5621 # core/base release number |
|
5622 if test "$GST_API_VERSION" = "1.0"; then |
|
5623 GST_VERSION=1.0 |
|
5624 else |
|
5625 GST_VERSION=0.10.25 |
|
5626 fi |
|
5627 |
|
5628 PKG_CHECK_MODULES(GSTREAMER, |
|
5629 gstreamer-$GST_API_VERSION >= $GST_VERSION |
|
5630 gstreamer-app-$GST_API_VERSION |
|
5631 gstreamer-plugins-base-$GST_API_VERSION, |
|
5632 [_HAVE_GSTREAMER=1], |
|
5633 [_HAVE_GSTREAMER=]) |
|
5634 if test -z "$_HAVE_GSTREAMER"; then |
|
5635 AC_MSG_ERROR([gstreamer and gstreamer-plugins-base development packages are needed to build gstreamer backend. Install them or disable gstreamer support with --disable-gstreamer]) |
|
5636 fi |
|
5637 |
|
5638 _SAVE_LDFLAGS=$LDFLAGS |
|
5639 LDFLAGS="$LDFLAGS $GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION" |
|
5640 AC_TRY_LINK(,[return 0;],_HAVE_LIBGSTVIDEO=1,_HAVE_LIBGSTVIDEO=) |
|
5641 if test -n "$_HAVE_LIBGSTVIDEO" ; then |
|
5642 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION" |
|
5643 else |
|
5644 AC_MSG_ERROR([gstreamer-plugins-base found, but no libgstvideo. Something has gone terribly wrong. Try reinstalling gstreamer-plugins-base; failing that, disable the gstreamer backend with --disable-gstreamer.]) |
|
5645 fi |
|
5646 LDFLAGS=$_SAVE_LDFLAGS |
|
5647 |
|
5648 AC_SUBST(GSTREAMER_CFLAGS) |
|
5649 AC_SUBST(GSTREAMER_LIBS) |
|
5650 fi |
|
5651 |
|
5652 AC_SUBST(MOZ_GSTREAMER) |
|
5653 AC_SUBST(GST_API_VERSION) |
|
5654 |
|
5655 if test -n "$MOZ_GSTREAMER"; then |
|
5656 AC_DEFINE(MOZ_GSTREAMER) |
|
5657 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION") |
|
5658 fi |
|
5659 |
|
5660 |
|
5661 dnl ======================================================== |
|
5662 dnl Permissions System |
|
5663 dnl ======================================================== |
|
5664 MOZ_ARG_DISABLE_BOOL(permissions, |
|
5665 [ --disable-permissions Disable permissions (popup and cookie blocking)], |
|
5666 MOZ_PERMISSIONS=, |
|
5667 MOZ_PERMISSIONS=1 |
|
5668 ) |
|
5669 |
|
5670 dnl ======================================================== |
|
5671 dnl Child permissions, currently only used for b2g |
|
5672 dnl ======================================================== |
|
5673 if test -n "$MOZ_B2G"; then |
|
5674 if test -n "$MOZ_PERMISSIONS"; then |
|
5675 MOZ_CHILD_PERMISSIONS=1 |
|
5676 else |
|
5677 AC_MSG_ERROR([You need to enable MOZ_PERMISSIONS for MOZ_CHILD_PERMISSIONS]) |
|
5678 fi |
|
5679 fi |
|
5680 AC_SUBST(MOZ_CHILD_PERMISSIONS) |
|
5681 |
|
5682 dnl ======================================================== |
|
5683 dnl NegotiateAuth |
|
5684 dnl ======================================================== |
|
5685 MOZ_ARG_DISABLE_BOOL(negotiateauth, |
|
5686 [ --disable-negotiateauth Disable GSS-API negotiation ], |
|
5687 MOZ_AUTH_EXTENSION=, |
|
5688 MOZ_AUTH_EXTENSION=1 ) |
|
5689 |
|
5690 dnl ======================================================== |
|
5691 dnl Pref extensions (autoconfig) |
|
5692 dnl ======================================================== |
|
5693 MOZ_ARG_DISABLE_BOOL(pref-extensions, |
|
5694 [ --disable-pref-extensions |
|
5695 Disable pref extensions such as autoconfig], |
|
5696 MOZ_PREF_EXTENSIONS=, |
|
5697 MOZ_PREF_EXTENSIONS=1 ) |
|
5698 |
|
5699 dnl ======================================================== |
|
5700 dnl Searching of system directories for extensions. |
|
5701 dnl Note: this switch is meant to be used for test builds |
|
5702 dnl whose behavior should not depend on what happens to be |
|
5703 dnl installed on the local machine. |
|
5704 dnl ======================================================== |
|
5705 MOZ_ARG_DISABLE_BOOL(system-extension-dirs, |
|
5706 [ --disable-system-extension-dirs |
|
5707 Disable searching system- and account-global |
|
5708 directories for extensions of any kind; use |
|
5709 only profile-specific extension directories], |
|
5710 ENABLE_SYSTEM_EXTENSION_DIRS=, |
|
5711 ENABLE_SYSTEM_EXTENSION_DIRS=1 ) |
|
5712 if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then |
|
5713 AC_DEFINE(ENABLE_SYSTEM_EXTENSION_DIRS) |
|
5714 fi |
|
5715 |
|
5716 dnl ======================================================== |
|
5717 dnl = Universalchardet |
|
5718 dnl ======================================================== |
|
5719 MOZ_ARG_DISABLE_BOOL(universalchardet, |
|
5720 [ --disable-universalchardet |
|
5721 Disable universal encoding detection], |
|
5722 MOZ_UNIVERSALCHARDET=, |
|
5723 MOZ_UNIVERSALCHARDET=1 ) |
|
5724 |
|
5725 if test -n "${JAVA_BIN_PATH}"; then |
|
5726 dnl Look for javac and jar in the specified path. |
|
5727 JAVA_PATH="$JAVA_BIN_PATH" |
|
5728 else |
|
5729 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH. |
|
5730 JAVA_PATH="$JAVA_HOME/bin:$PATH" |
|
5731 fi |
|
5732 |
|
5733 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH]) |
|
5734 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH]) |
|
5735 MOZ_PATH_PROG(JAVAH, javah, :, [$JAVA_PATH]) |
|
5736 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH]) |
|
5737 MOZ_PATH_PROG(JARSIGNER, jarsigner, :, [$JAVA_PATH]) |
|
5738 MOZ_PATH_PROG(KEYTOOL, keytool, :, [$JAVA_PATH]) |
|
5739 |
|
5740 if test -n "${JAVA_BIN_PATH}" -o \ |
|
5741 \( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then |
|
5742 if test -z "$JAVA" -o "$JAVA" = ":"; then |
|
5743 AC_MSG_ERROR([The program java was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}]) |
|
5744 fi |
|
5745 if test -z "$JAVAC" -o "$JAVAC" = ":"; then |
|
5746 AC_MSG_ERROR([The program javac was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}]) |
|
5747 fi |
|
5748 if test -z "$JAVAH" -o "$JAVAH" = ":"; then |
|
5749 AC_MSG_ERROR([The program javah was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}]) |
|
5750 fi |
|
5751 if test -z "$JAR" -o "$JAR" = ":"; then |
|
5752 AC_MSG_ERROR([The program jar was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}]) |
|
5753 fi |
|
5754 if test -z "$JARSIGNER" -o "$JARSIGNER" = ":"; then |
|
5755 AC_MSG_ERROR([The program jarsigner was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}]) |
|
5756 fi |
|
5757 if test -z "$KEYTOOL" -o "$KEYTOOL" = ":"; then |
|
5758 AC_MSG_ERROR([The program keytool was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}]) |
|
5759 fi |
|
5760 fi |
|
5761 |
|
5762 dnl ======================================================== |
|
5763 dnl = ANGLE OpenGL->D3D translator for WebGL |
|
5764 dnl = * only applies to win32 |
|
5765 dnl = * enabled by default (shipping build); requires explicit --disable to disable |
|
5766 dnl ======================================================== |
|
5767 MOZ_ANGLE_RENDERER= |
|
5768 MOZ_DIRECTX_SDK_CPU_SUFFIX= |
|
5769 MOZ_DIRECTX_SDK_PATH= |
|
5770 MOZ_D3DCOMPILER_DLL= |
|
5771 MOZ_HAS_WINSDK_WITH_D3D= |
|
5772 MOZ_D3DCOMPILER_DLL_PATH= |
|
5773 MOZ_D3DCOMPILER_CAB= |
|
5774 case "$target_os" in |
|
5775 *mingw*) |
|
5776 MOZ_ANGLE_RENDERER=1 |
|
5777 ;; |
|
5778 esac |
|
5779 |
|
5780 # The DirectX SDK libraries are split into x86 and x64 sub-directories |
|
5781 case "${target_cpu}" in |
|
5782 i*86) |
|
5783 MOZ_DIRECTX_SDK_CPU_SUFFIX=x86 |
|
5784 ;; |
|
5785 x86_64) |
|
5786 MOZ_DIRECTX_SDK_CPU_SUFFIX=x64 |
|
5787 ;; |
|
5788 esac |
|
5789 |
|
5790 MOZ_ARG_DISABLE_BOOL(webgl, |
|
5791 [ --disable-webgl Disable building of the WebGL implementation], |
|
5792 MOZ_WEBGL_DISABLED=1, |
|
5793 MOZ_WEBGL_DISABLED=) |
|
5794 |
|
5795 MOZ_ARG_ENABLE_BOOL(winsdk-directx, |
|
5796 [ --enable-winsdk-directx use DirectX SDK in Windows SDK], |
|
5797 MOZ_WINSDK_DIRECTX=1, |
|
5798 MOZ_WINSDK_DIRECTX=) |
|
5799 |
|
5800 if test -n "$MOZ_WEBGL_DISABLED"; then |
|
5801 MOZ_WEBGL= |
|
5802 MOZ_ANGLE_RENDERER= |
|
5803 fi |
|
5804 |
|
5805 if test -n "$MOZ_WEBGL"; then |
|
5806 AC_DEFINE(MOZ_WEBGL) |
|
5807 fi |
|
5808 |
|
5809 if test -n "$MOZ_WEBGL_CONFORMANT"; then |
|
5810 AC_DEFINE(MOZ_WEBGL_CONFORMANT) |
|
5811 fi |
|
5812 |
|
5813 |
|
5814 # Locate a DirectX SDK here so we can use it for both ANGLE and |
|
5815 # Joystick support. |
|
5816 if test "$OS_TARGET" = "WINNT" -a -z "$CROSS_COMPILE"; then |
|
5817 # Get the SDK path from the registry. |
|
5818 # First try to get the June 2010 SDK |
|
5819 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1` |
|
5820 if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then |
|
5821 # Otherwise just take whatever comes first |
|
5822 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1` |
|
5823 fi |
|
5824 MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/' | sed 's,\\\\,/,g'` |
|
5825 |
|
5826 if test -n "$MOZ_DIRECTX_SDK_PATH" && |
|
5827 test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then |
|
5828 AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH]) |
|
5829 else |
|
5830 AC_MSG_RESULT([Couldn't find the DirectX SDK.]) |
|
5831 fi |
|
5832 fi |
|
5833 |
|
5834 # On mingw, check if headers are provided by toolchain. |
|
5835 if test "$OS_TARGET" = "WINNT" -a -n "$GNU_CC"; then |
|
5836 MOZ_CHECK_HEADER(d3d10.h, MOZ_HAS_WINSDK_WITH_D3D=1) |
|
5837 fi |
|
5838 |
|
5839 dnl ======================================================== |
|
5840 dnl D3D compiler DLL |
|
5841 dnl ======================================================== |
|
5842 |
|
5843 if test -n "$MOZ_ANGLE_RENDERER"; then |
|
5844 # Check that our DirectX SDK is acceptable. |
|
5845 if test -n "$MOZ_DIRECTX_SDK_PATH"; then |
|
5846 if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then |
|
5847 AC_MSG_RESULT([Found the February 2010 DirectX SDK, which is unacceptable to ANGLE.]) |
|
5848 MOZ_DIRECTX_SDK_PATH_BAD=1 |
|
5849 fi |
|
5850 |
|
5851 if test -n "$MOZ_DIRECTX_SDK_PATH" && |
|
5852 test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h && |
|
5853 test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then |
|
5854 AC_MSG_RESULT([Found acceptable DirectX SDK for ANGLE.]) |
|
5855 else |
|
5856 AC_MSG_RESULT([Found DirectX SDK is unacceptable for ANGLE.]) |
|
5857 MOZ_DIRECTX_SDK_PATH_BAD=1 |
|
5858 fi |
|
5859 fi |
|
5860 |
|
5861 if test -n "$MOZ_DIRECTX_SDK_PATH_BAD"; then |
|
5862 AC_MSG_ERROR([Couldn't find an acceptable DirectX SDK for ANGLE. Either install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.]) |
|
5863 fi |
|
5864 |
|
5865 # Find a D3D compiler DLL in a Windows SDK. |
|
5866 MOZ_D3DCOMPILER_DLL= |
|
5867 if test -n "$MOZ_WINSDK_DIRECTX"; then |
|
5868 case "$MOZ_WINSDK_MAXVER" in |
|
5869 0x0603*) |
|
5870 MOZ_D3DCOMPILER_DLL=d3dcompiler_47.dll |
|
5871 AC_MSG_RESULT([Found D3D compiler in Windows SDK 8.1.]) |
|
5872 ;; |
|
5873 0x0602*) |
|
5874 MOZ_D3DCOMPILER_DLL=d3dcompiler_46.dll |
|
5875 AC_MSG_RESULT([Found D3D compiler in Windows SDK 8.0.]) |
|
5876 ;; |
|
5877 esac |
|
5878 fi |
|
5879 |
|
5880 if test -n "$MOZ_D3DCOMPILER_DLL"; then |
|
5881 # We have a name, now track down the path. |
|
5882 if test -n "$WINDOWSSDKDIR"; then |
|
5883 MOZ_D3DCOMPILER_DLL_PATH="$WINDOWSSDKDIR/Redist/D3D/$MOZ_DIRECTX_SDK_CPU_SUFFIX/$MOZ_D3DCOMPILER_DLL" |
|
5884 if test -f "$MOZ_D3DCOMPILER_DLL_PATH"; then |
|
5885 MOZ_HAS_WINSDK_WITH_D3D=1 |
|
5886 AC_MSG_RESULT([Found MOZ_D3DCOMPILER_DLL_PATH: $MOZ_D3DCOMPILER_DLL_PATH]) |
|
5887 else |
|
5888 AC_MSG_RESULT([MOZ_D3DCOMPILER_DLL_PATH doesn't exist: $MOZ_D3DCOMPILER_DLL_PATH]) |
|
5889 fi |
|
5890 else |
|
5891 AC_MSG_RESULT([WINDOWSSDKDIR is missing.]) |
|
5892 fi |
|
5893 fi |
|
5894 |
|
5895 # Find a D3D compiler DLL in the DirectX SDK, if we didn't find one already. |
|
5896 # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib |
|
5897 if test -z "$MOZ_HAS_WINSDK_WITH_D3D"; then |
|
5898 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'` |
|
5899 |
|
5900 if test -n "$MOZ_D3DX9_VERSION" ; then |
|
5901 MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1` |
|
5902 MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll |
|
5903 else |
|
5904 AC_MSG_RESULT([Couldn't determine the D3DX9 version for the DirectX SDK.]) |
|
5905 fi |
|
5906 |
|
5907 if test -z "$MOZ_D3DCOMPILER_CAB"; then |
|
5908 AC_MSG_RESULT([Couldn't find a CAB containing the D3D compiler DLL.]) |
|
5909 fi |
|
5910 fi |
|
5911 |
|
5912 if test -z "$MOZ_D3DCOMPILER_DLL_PATH" -a -z "$MOZ_D3DCOMPILER_CAB" -a -z "$CROSS_COMPILE"; then |
|
5913 AC_MSG_ERROR([Couldn't find an acceptable D3D compiler DLL. Either install Windows SDK 8.0+ and reconfigure with --enable-winsdk-directx, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.]) |
|
5914 fi |
|
5915 fi |
|
5916 |
|
5917 |
|
5918 dnl ======================================================== |
|
5919 dnl Gamepad support |
|
5920 dnl ======================================================== |
|
5921 MOZ_GAMEPAD= |
|
5922 MOZ_GAMEPAD_BACKEND=stub |
|
5923 |
|
5924 # Gamepad DOM is built on supported platforms by default. |
|
5925 case "$OS_TARGET" in |
|
5926 Darwin|WINNT|Linux) |
|
5927 MOZ_GAMEPAD=1 |
|
5928 ;; |
|
5929 *) |
|
5930 ;; |
|
5931 esac |
|
5932 |
|
5933 MOZ_ARG_DISABLE_BOOL(gamepad, |
|
5934 [ --disable-gamepad Disable gamepad support], |
|
5935 MOZ_GAMEPAD=, |
|
5936 MOZ_GAMEPAD=1) |
|
5937 |
|
5938 if test "$MOZ_GAMEPAD"; then |
|
5939 case "$OS_TARGET" in |
|
5940 Darwin) |
|
5941 MOZ_GAMEPAD_BACKEND=cocoa |
|
5942 ;; |
|
5943 WINNT) |
|
5944 if test -z "$MOZ_HAS_WINSDK_WITH_D3D"; then |
|
5945 if test -n "$MOZ_DIRECTX_SDK_PATH" ; then |
|
5946 if ! test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then |
|
5947 MOZ_GAMEPAD= |
|
5948 fi |
|
5949 elif test "$GCC" != "yes"; then |
|
5950 MOZ_GAMEPAD= |
|
5951 fi |
|
5952 fi |
|
5953 if test -z "$MOZ_GAMEPAD"; then |
|
5954 AC_MSG_ERROR([Couldn't find the DirectX SDK, needed for gamepad support. Please install it or, reconfigure with --disable-gamepad to disable gamepad support.]) |
|
5955 fi |
|
5956 MOZ_GAMEPAD_BACKEND=windows |
|
5957 ;; |
|
5958 Linux) |
|
5959 MOZ_CHECK_HEADER([linux/joystick.h]) |
|
5960 if test "$ac_cv_header_linux_joystick_h" != "yes"; then |
|
5961 AC_MSG_ERROR([Can't find header linux/joystick.h, needed for gamepad support. Please install Linux kernel headers or reconfigure with --disable-gamepad to disable gamepad support.]) |
|
5962 fi |
|
5963 MOZ_GAMEPAD_BACKEND=linux |
|
5964 ;; |
|
5965 *) |
|
5966 ;; |
|
5967 esac |
|
5968 |
|
5969 AC_DEFINE(MOZ_GAMEPAD) |
|
5970 fi |
|
5971 AC_SUBST(MOZ_GAMEPAD) |
|
5972 AC_SUBST(MOZ_GAMEPAD_BACKEND) |
|
5973 |
|
5974 dnl ======================================================== |
|
5975 dnl = Breakpad crash reporting (on by default on supported platforms) |
|
5976 dnl ======================================================== |
|
5977 |
|
5978 case $target in |
|
5979 i?86-*-mingw*|x86_64-*-mingw*) |
|
5980 MOZ_CRASHREPORTER=1 |
|
5981 ;; |
|
5982 i?86-apple-darwin*|x86_64-apple-darwin*) |
|
5983 MOZ_CRASHREPORTER=1 |
|
5984 ;; |
|
5985 i?86-*-linux*|x86_64-*-linux*|arm-*-linux*) |
|
5986 if test "$MOZ_ENABLE_GTK"; then |
|
5987 MOZ_CRASHREPORTER=1 |
|
5988 fi |
|
5989 ;; |
|
5990 *-android*|*-linuxandroid*) |
|
5991 MOZ_CRASHREPORTER=1 |
|
5992 ;; |
|
5993 *solaris*) |
|
5994 MOZ_CRASHREPORTER=1 |
|
5995 ;; |
|
5996 esac |
|
5997 |
|
5998 MOZ_ARG_DISABLE_BOOL(crashreporter, |
|
5999 [ --disable-crashreporter Disable breakpad crash reporting], |
|
6000 [MOZ_CRASHREPORTER=], |
|
6001 [MOZ_CRASHREPORTER=F # Force enable breakpad]) |
|
6002 |
|
6003 if test "$OS_ARCH" != "$HOST_OS_ARCH" -a "$OS_ARCH" != "WINNT"; then |
|
6004 if test "$MOZ_CRASHREPORTER" = F; then |
|
6005 AC_MSG_ERROR([Cannot --enable-crashreporter, as breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH.]) |
|
6006 fi |
|
6007 MOZ_CRASHREPORTER= |
|
6008 fi |
|
6009 |
|
6010 if test -n "$MOZ_CRASHREPORTER"; then |
|
6011 AC_DEFINE(MOZ_CRASHREPORTER) |
|
6012 |
|
6013 if test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS" && \ |
|
6014 test -z "$SKIP_LIBRARY_CHECKS"; then |
|
6015 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0) |
|
6016 AC_SUBST(MOZ_GTHREAD_CFLAGS) |
|
6017 AC_SUBST(MOZ_GTHREAD_LIBS) |
|
6018 fi |
|
6019 |
|
6020 if test "$OS_ARCH" = "WINNT"; then |
|
6021 if test -z "$HAVE_64BIT_OS"; then |
|
6022 MOZ_CRASHREPORTER_INJECTOR=1 |
|
6023 AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR) |
|
6024 fi |
|
6025 fi |
|
6026 fi |
|
6027 |
|
6028 MOZ_ARG_WITH_STRING(crashreporter-enable-percent, |
|
6029 [ --with-crashreporter-enable-percent=NN |
|
6030 Enable sending crash reports by default on NN% of users. (default=100)], |
|
6031 [ val=`echo $withval | sed 's/[^0-9]//g'` |
|
6032 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"]) |
|
6033 |
|
6034 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then |
|
6035 MOZ_CRASHREPORTER_ENABLE_PERCENT=100 |
|
6036 fi |
|
6037 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT) |
|
6038 |
|
6039 dnl ======================================================== |
|
6040 dnl = libjpeg-turbo configuration |
|
6041 dnl ======================================================== |
|
6042 MOZ_LIBJPEG_TURBO= |
|
6043 if test -z "$MOZ_NATIVE_JPEG"; then |
|
6044 MOZ_LIBJPEG_TURBO=1 |
|
6045 fi |
|
6046 |
|
6047 MOZ_ARG_DISABLE_BOOL(libjpeg_turbo, |
|
6048 [ --disable-libjpeg-turbo Disable optimized jpeg decoding routines], |
|
6049 MOZ_LIBJPEG_TURBO=, |
|
6050 MOZ_LIBJPEG_TURBO=1) |
|
6051 |
|
6052 if test "$MOZ_NATIVE_JPEG" = 1 -a "$MOZ_LIBJPEG_TURBO" = 1; then |
|
6053 AC_MSG_ERROR([cannot use --with-system-jpeg with --enable-libjpeg-turbo.]) |
|
6054 fi |
|
6055 |
|
6056 dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly |
|
6057 dnl files. |
|
6058 |
|
6059 if test -n "$MOZ_LIBJPEG_TURBO"; then |
|
6060 |
|
6061 dnl Do we support libjpeg-turbo on this platform? |
|
6062 case "$OS_ARCH:$OS_TEST" in |
|
6063 Darwin:i?86) |
|
6064 LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO" |
|
6065 LIBJPEG_TURBO_X86_ASM=1 |
|
6066 ;; |
|
6067 Darwin:x86_64) |
|
6068 LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO" |
|
6069 LIBJPEG_TURBO_X64_ASM=1 |
|
6070 ;; |
|
6071 WINNT:x86|WINNT:i?86) |
|
6072 LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32" |
|
6073 LIBJPEG_TURBO_X86_ASM=1 |
|
6074 ;; |
|
6075 WINNT:x86_64) |
|
6076 LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC" |
|
6077 LIBJPEG_TURBO_X64_ASM=1 |
|
6078 ;; |
|
6079 *:arm*) |
|
6080 LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon" |
|
6081 LIBJPEG_TURBO_ARM_ASM=1 |
|
6082 ;; |
|
6083 *:x86|*:i?86) |
|
6084 if $CC -E -dM -</dev/null | grep -q __ELF__; then |
|
6085 LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF" |
|
6086 LIBJPEG_TURBO_X86_ASM=1 |
|
6087 fi |
|
6088 ;; |
|
6089 *:x86_64) |
|
6090 if $CC -E -dM -</dev/null | grep -q __ELF__; then |
|
6091 LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF" |
|
6092 LIBJPEG_TURBO_X64_ASM=1 |
|
6093 fi |
|
6094 ;; |
|
6095 esac |
|
6096 |
|
6097 fi |
|
6098 |
|
6099 dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines |
|
6100 dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if |
|
6101 dnl it doesn't exist or we have too old of a version. |
|
6102 if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then |
|
6103 LIBJPEG_TURBO_AS=$YASM |
|
6104 |
|
6105 if test -z "$LIBJPEG_TURBO_AS" ; then |
|
6106 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.]) |
|
6107 fi |
|
6108 |
|
6109 dnl Check that we have the right yasm version. We require 1.0.1 or newer |
|
6110 dnl on Linux and 1.1 or newer everywhere else. |
|
6111 if test "$OS_ARCH" = "Linux" ; then |
|
6112 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 |
|
6113 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_RELEASE. 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.]) |
|
6114 fi |
|
6115 else |
|
6116 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then |
|
6117 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.]) |
|
6118 fi |
|
6119 fi |
|
6120 fi |
|
6121 |
|
6122 dnl If we're on an ARM system which supports libjpeg-turbo's asm routines and |
|
6123 dnl --disable-libjpeg-turbo wasn't passed, use the C compiler as the assembler. |
|
6124 if test -n "$LIBJPEG_TURBO_ARM_ASM" ; then |
|
6125 echo "Using $AS as the assembler for ARM code." |
|
6126 LIBJPEG_TURBO_AS=$AS |
|
6127 fi |
|
6128 |
|
6129 if test -n "$LIBJPEG_TURBO_X86_ASM"; then |
|
6130 AC_DEFINE(LIBJPEG_TURBO_X86_ASM) |
|
6131 elif test -n "$LIBJPEG_TURBO_X64_ASM"; then |
|
6132 AC_DEFINE(LIBJPEG_TURBO_X64_ASM) |
|
6133 elif test -n "$LIBJPEG_TURBO_ARM_ASM"; then |
|
6134 AC_DEFINE(LIBJPEG_TURBO_ARM_ASM) |
|
6135 elif test -n "$MOZ_LIBJPEG_TURBO"; then |
|
6136 dnl Warn if we're not building the optimized routines, even though the user |
|
6137 dnl didn't specify --disable-libjpeg-turbo. |
|
6138 AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.]) |
|
6139 fi |
|
6140 |
|
6141 dnl ======================================================== |
|
6142 dnl = Enable compilation of specific extension modules |
|
6143 dnl ======================================================== |
|
6144 |
|
6145 MOZ_ARG_ENABLE_STRING(extensions, |
|
6146 [ --enable-extensions Enable extensions], |
|
6147 [ for option in `echo $enableval | sed 's/,/ /g'`; do |
|
6148 if test "$option" = "yes" -o "$option" = "all"; then |
|
6149 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.]) |
|
6150 elif test "$option" = "no" -o "$option" = "none"; then |
|
6151 MOZ_EXTENSIONS="" |
|
6152 elif test "$option" = "default"; then |
|
6153 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT" |
|
6154 elif test `echo "$option" | grep -c \^-` != 0; then |
|
6155 option=`echo $option | sed 's/^-//'` |
|
6156 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"` |
|
6157 else |
|
6158 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option" |
|
6159 fi |
|
6160 done], |
|
6161 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT") |
|
6162 |
|
6163 if test -z "$MOZ_ENABLE_GNOMEVFS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then |
|
6164 # Suppress warning on non-X11 platforms |
|
6165 if test -n "$MOZ_X11"; then |
|
6166 AC_MSG_WARN([Removing gnomevfs from MOZ_EXTENSIONS due to no --enable-gnomevfs.]) |
|
6167 fi |
|
6168 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'` |
|
6169 fi |
|
6170 |
|
6171 dnl Do not build gnomevfs with libxul based apps |
|
6172 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then |
|
6173 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'` |
|
6174 fi |
|
6175 |
|
6176 if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then |
|
6177 # Suppress warning on non-X11 platforms |
|
6178 if test -n "$MOZ_X11"; then |
|
6179 AC_MSG_WARN([Removing gio from MOZ_EXTENSIONS due to --disable-gio.]) |
|
6180 fi |
|
6181 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'` |
|
6182 fi |
|
6183 |
|
6184 dnl Do not build gio with libxul based apps |
|
6185 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then |
|
6186 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'` |
|
6187 fi |
|
6188 |
|
6189 if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then |
|
6190 MOZ_GIO_COMPONENT=1 |
|
6191 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'` |
|
6192 fi |
|
6193 AC_SUBST(MOZ_GIO_COMPONENT) |
|
6194 |
|
6195 if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then |
|
6196 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.]) |
|
6197 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'` |
|
6198 fi |
|
6199 |
|
6200 dnl Remove dupes |
|
6201 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}` |
|
6202 |
|
6203 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages |
|
6204 dnl when trying to build a nonexistent extension. |
|
6205 for extension in $MOZ_EXTENSIONS; do |
|
6206 if test ! -d "${srcdir}/extensions/${extension}"; then |
|
6207 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.]) |
|
6208 fi |
|
6209 done |
|
6210 |
|
6211 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then |
|
6212 AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS) |
|
6213 fi |
|
6214 |
|
6215 dnl ======================================================== |
|
6216 dnl Build Freetype in the tree |
|
6217 dnl ======================================================== |
|
6218 MOZ_ARG_ENABLE_BOOL(tree-freetype, |
|
6219 [ --enable-tree-freetype Enable Tree FreeType], |
|
6220 MOZ_TREE_FREETYPE=1, |
|
6221 MOZ_TREE_FREETYPE= ) |
|
6222 if test -n "$MOZ_TREE_FREETYPE"; then |
|
6223 if test -n "$_WIN32_MSVC"; then |
|
6224 AC_ERROR("building with in-tree freetype is not supported on MSVC") |
|
6225 fi |
|
6226 AC_DEFINE(MOZ_TREE_FREETYPE) |
|
6227 AC_SUBST(MOZ_TREE_FREETYPE) |
|
6228 MOZ_ENABLE_CAIRO_FT=1 |
|
6229 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" |
|
6230 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include' |
|
6231 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include' |
|
6232 FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)' |
|
6233 CAIRO_FT_OSLIBS='' |
|
6234 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM) |
|
6235 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN) |
|
6236 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE) |
|
6237 AC_SUBST(CAIRO_FT_CFLAGS) |
|
6238 fi |
|
6239 |
|
6240 dnl ======================================================== |
|
6241 dnl Installer |
|
6242 dnl ======================================================== |
|
6243 dnl Abort Windows build if the required major version and |
|
6244 dnl minimum minor version of Unicode NSIS isn't in the path |
|
6245 dnl (unless in case of cross compiling, for which Unicode |
|
6246 dnl is not yet sufficient). |
|
6247 if test "$OS_ARCH" = "WINNT"; then |
|
6248 MIN_NSIS_MAJOR_VER=2 |
|
6249 MIN_NSIS_MINOR_VER=46 |
|
6250 MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-3.0a2.exe makensisu-2.46.exe makensis) |
|
6251 if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then |
|
6252 AC_MSG_RESULT([yes]) |
|
6253 MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null` |
|
6254 changequote(,) |
|
6255 MAKENSISU_PARSED_VER=`echo "$MAKENSISU_VER" | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\).*\-Unicode$/\1/g'` |
|
6256 changequote([,]) |
|
6257 if test "$MAKENSISU_PARSED_VER" = ""; then |
|
6258 changequote(,) |
|
6259 MAKENSISU_PARSED_VER=`echo "$MAKENSISU_VER" | sed -e 's/^v\([0-9]\+\.[0-9]\+\).*$/\1/g'` |
|
6260 changequote([,]) |
|
6261 fi |
|
6262 MAKENSISU_MAJOR_VER=0 |
|
6263 MAKENSISU_MINOR_VER=0 |
|
6264 if test ! "$MAKENSISU_PARSED_VER" = ""; then |
|
6265 MAKENSISU_MAJOR_VER=`echo $MAKENSISU_PARSED_VER | $AWK -F\. '{ print $1 }'` |
|
6266 MAKENSISU_MINOR_VER=`echo $MAKENSISU_PARSED_VER | $AWK -F\. '{ print $2 }'` |
|
6267 fi |
|
6268 AC_MSG_CHECKING([for Unicode NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater]) |
|
6269 if test "$MAKENSISU_MAJOR_VER" -eq $MIN_NSIS_MAJOR_VER -a \ |
|
6270 "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER || |
|
6271 test "$MAKENSISU_MAJOR_VER" -gt $MIN_NSIS_MAJOR_VER; then |
|
6272 AC_MSG_RESULT([yes]) |
|
6273 else |
|
6274 AC_MSG_RESULT([no]) |
|
6275 if test -z "$CROSS_COMPILE"; then |
|
6276 AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS version $REQ_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater in your path.]) |
|
6277 else |
|
6278 MAKENSISU= |
|
6279 fi |
|
6280 fi |
|
6281 elif test -z "$CROSS_COMPILE"; then |
|
6282 AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS version $REQ_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater in your path.]) |
|
6283 else |
|
6284 MAKENSISU= |
|
6285 fi |
|
6286 fi |
|
6287 |
|
6288 dnl ======================================================== |
|
6289 dnl Web App Runtime |
|
6290 dnl ======================================================== |
|
6291 MOZ_ARG_DISABLE_BOOL(webapp-runtime, |
|
6292 [ --disable-webapp-runtime Disable Web App Runtime], |
|
6293 MOZ_WEBAPP_RUNTIME=, |
|
6294 MOZ_WEBAPP_RUNTIME=1) |
|
6295 if test "$MOZ_WIDGET_TOOLKIT" != "windows" -a "$MOZ_WIDGET_TOOLKIT" != "cocoa" -a "$MOZ_WIDGET_TOOLKIT" != "gtk2"; then |
|
6296 MOZ_WEBAPP_RUNTIME= |
|
6297 fi |
|
6298 if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then |
|
6299 MOZ_WEBAPP_RUNTIME= |
|
6300 fi |
|
6301 AC_SUBST(MOZ_WEBAPP_RUNTIME) |
|
6302 if test "$MOZ_WEBAPP_RUNTIME"; then |
|
6303 AC_DEFINE(MOZ_WEBAPP_RUNTIME) |
|
6304 fi |
|
6305 |
|
6306 AC_MSG_CHECKING([for tar archiver]) |
|
6307 AC_CHECK_PROGS(TAR, gnutar gtar tar, "") |
|
6308 if test -z "$TAR"; then |
|
6309 AC_MSG_ERROR([no tar archiver found in \$PATH]) |
|
6310 fi |
|
6311 AC_MSG_RESULT([$TAR]) |
|
6312 AC_SUBST(TAR) |
|
6313 |
|
6314 AC_MSG_CHECKING([for wget]) |
|
6315 AC_CHECK_PROGS(WGET, wget, "") |
|
6316 AC_MSG_RESULT([$WGET]) |
|
6317 AC_SUBST(WGET) |
|
6318 |
|
6319 dnl ======================================================== |
|
6320 dnl Signing |
|
6321 dnl ======================================================== |
|
6322 |
|
6323 if test -n "$MOZ_SIGN_CMD"; then |
|
6324 AC_DEFINE(MOZ_SIGNING) |
|
6325 fi |
|
6326 |
|
6327 dnl ======================================================== |
|
6328 dnl Maintenance Service |
|
6329 dnl ======================================================== |
|
6330 |
|
6331 MOZ_ARG_ENABLE_BOOL(maintenance-service, |
|
6332 [ --enable-maintenance-service Enable building of maintenanceservice], |
|
6333 MOZ_MAINTENANCE_SERVICE=1, |
|
6334 MOZ_MAINTENANCE_SERVICE= ) |
|
6335 |
|
6336 if test -n "$MOZ_MAINTENANCE_SERVICE"; then |
|
6337 if test "$OS_ARCH" = "WINNT"; then |
|
6338 AC_DEFINE(MOZ_MAINTENANCE_SERVICE) |
|
6339 else |
|
6340 AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target]) |
|
6341 fi |
|
6342 fi |
|
6343 |
|
6344 dnl ======================================================== |
|
6345 dnl Verify MAR signatures |
|
6346 dnl ======================================================== |
|
6347 |
|
6348 MOZ_ARG_ENABLE_BOOL(verify-mar, |
|
6349 [ --enable-verify-mar Enable verifying MAR signatures], |
|
6350 MOZ_VERIFY_MAR_SIGNATURE=1, |
|
6351 MOZ_VERIFY_MAR_SIGNATURE= ) |
|
6352 |
|
6353 if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then |
|
6354 if test "$OS_ARCH" = "WINNT"; then |
|
6355 AC_DEFINE(MOZ_VERIFY_MAR_SIGNATURE) |
|
6356 else |
|
6357 AC_MSG_ERROR([Can only build with --enable-verify-mar with a Windows target]) |
|
6358 fi |
|
6359 fi |
|
6360 |
|
6361 dnl ======================================================== |
|
6362 dnl Enable building the signmar program. |
|
6363 dnl This option is much different than the --enable-verify-mar option. |
|
6364 dnl --enable-verify-mar is for enabling the verification check on MAR |
|
6365 dnl files in the updater. The --enable-signmar option is for building |
|
6366 dnl the signmar program. |
|
6367 dnl ======================================================== |
|
6368 |
|
6369 MOZ_ARG_ENABLE_BOOL(signmar, |
|
6370 [ --enable-signmar Enable building the signmar program], |
|
6371 MOZ_ENABLE_SIGNMAR=1, |
|
6372 MOZ_ENABLE_SIGNMAR= ) |
|
6373 |
|
6374 if test -n "$MOZ_ENABLE_SIGNMAR"; then |
|
6375 AC_DEFINE(MOZ_ENABLE_SIGNMAR) |
|
6376 fi |
|
6377 |
|
6378 dnl ======================================================== |
|
6379 dnl Updater |
|
6380 dnl ======================================================== |
|
6381 |
|
6382 MOZ_ARG_DISABLE_BOOL(updater, |
|
6383 [ --disable-updater Disable building of updater], |
|
6384 MOZ_UPDATER=, |
|
6385 MOZ_UPDATER=1 ) |
|
6386 |
|
6387 if test -n "$MOZ_UPDATER"; then |
|
6388 AC_DEFINE(MOZ_UPDATER) |
|
6389 fi |
|
6390 |
|
6391 # tools/update-packaging is not checked out by default. |
|
6392 MOZ_ARG_ENABLE_BOOL(update-packaging, |
|
6393 [ --enable-update-packaging |
|
6394 Enable tools/update-packaging], |
|
6395 MOZ_UPDATE_PACKAGING=1, |
|
6396 MOZ_UPDATE_PACKAGING= ) |
|
6397 AC_SUBST(MOZ_UPDATE_PACKAGING) |
|
6398 |
|
6399 dnl ======================================================== |
|
6400 dnl Tor Additions |
|
6401 dnl ======================================================== |
|
6402 MOZ_ARG_WITH_STRING(tor-browser-version, |
|
6403 [ --with-tor-browser-version=VERSION |
|
6404 Set Tor Browser version, e.g., 4.0b1], |
|
6405 TOR_BROWSER_VERSION="$withval") |
|
6406 |
|
6407 MOZ_ARG_ENABLE_BOOL(tor-browser-update, |
|
6408 [ --enable-tor-browser-update |
|
6409 Enable Tor Browser update], |
|
6410 TOR_BROWSER_UPDATE=1, |
|
6411 TOR_BROWSER_UPDATE= ) |
|
6412 |
|
6413 if test -n "$TOR_BROWSER_UPDATE"; then |
|
6414 if test -z "$TOR_BROWSER_VERSION"; then |
|
6415 AC_MSG_ERROR([--enable-tor-browser-update requires --with-tor-browser-version.]) |
|
6416 fi |
|
6417 AC_DEFINE(TOR_BROWSER_UPDATE) |
|
6418 fi |
|
6419 |
|
6420 AC_DEFINE_UNQUOTED(TOR_BROWSER_VERSION,"$TOR_BROWSER_VERSION") |
|
6421 AC_SUBST(TOR_BROWSER_VERSION) |
|
6422 AC_SUBST(TOR_BROWSER_UPDATE) |
|
6423 |
|
6424 dnl ======================================================== |
|
6425 dnl build the tests by default |
|
6426 dnl ======================================================== |
|
6427 MOZ_ARG_DISABLE_BOOL(tests, |
|
6428 [ --disable-tests Do not build test libraries & programs], |
|
6429 ENABLE_TESTS=, |
|
6430 ENABLE_TESTS=1 ) |
|
6431 |
|
6432 if test -n "$ENABLE_TESTS"; then |
|
6433 GTEST_HAS_RTTI=0 |
|
6434 AC_DEFINE_UNQUOTED(GTEST_HAS_RTTI, 0) |
|
6435 AC_SUBST(GTEST_HAS_RTTI) |
|
6436 if test -n "$_WIN32_MSVC"; then |
|
6437 AC_DEFINE_UNQUOTED(_VARIADIC_MAX, 10) |
|
6438 fi |
|
6439 if test "${OS_TARGET}" = "Android"; then |
|
6440 AC_DEFINE(GTEST_OS_LINUX_ANDROID) |
|
6441 AC_DEFINE(GTEST_USE_OWN_TR1_TUPLE) |
|
6442 AC_DEFINE_UNQUOTED(GTEST_HAS_CLONE, 0) |
|
6443 AC_SUBST(GTEST_OS_LINUX_ANDROID) |
|
6444 AC_SUBST(GTEST_USE_OWN_TR1_TUPLE) |
|
6445 AC_SUBST(GTEST_HAS_CLONE) |
|
6446 fi |
|
6447 fi |
|
6448 |
|
6449 dnl ======================================================== |
|
6450 dnl parental controls (for Windows Vista) |
|
6451 dnl ======================================================== |
|
6452 MOZ_ARG_DISABLE_BOOL(parental-controls, |
|
6453 [ --disable-parental-controls |
|
6454 Do not build parental controls], |
|
6455 MOZ_DISABLE_PARENTAL_CONTROLS=1, |
|
6456 MOZ_DISABLE_PARENTAL_CONTROLS=) |
|
6457 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then |
|
6458 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS) |
|
6459 fi |
|
6460 |
|
6461 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS) |
|
6462 |
|
6463 dnl ======================================================== |
|
6464 dnl = Disable DOMCrypto |
|
6465 dnl ======================================================== |
|
6466 if test -n "$MOZ_DISABLE_CRYPTOLEGACY"; then |
|
6467 AC_DEFINE(MOZ_DISABLE_CRYPTOLEGACY) |
|
6468 fi |
|
6469 AC_SUBST(MOZ_DISABLE_CRYPTOLEGACY) |
|
6470 |
|
6471 dnl ======================================================== |
|
6472 dnl = Disable EV certificate verification |
|
6473 dnl ======================================================== |
|
6474 if test -n "$MOZ_NO_EV_CERTS"; then |
|
6475 AC_DEFINE(MOZ_NO_EV_CERTS) |
|
6476 fi |
|
6477 AC_SUBST(MOZ_NO_EV_CERTS) |
|
6478 |
|
6479 dnl ======================================================== |
|
6480 dnl = Disable libpkix |
|
6481 dnl ======================================================== |
|
6482 if test -n "$NSS_NO_LIBPKIX"; then |
|
6483 AC_DEFINE(NSS_NO_LIBPKIX) |
|
6484 fi |
|
6485 AC_SUBST(NSS_NO_LIBPKIX) |
|
6486 |
|
6487 dnl ======================================================== |
|
6488 dnl = Content process sandboxing |
|
6489 dnl ======================================================== |
|
6490 if test -n "$gonkdir"; then |
|
6491 MOZ_CONTENT_SANDBOX=1 |
|
6492 fi |
|
6493 |
|
6494 MOZ_ARG_ENABLE_BOOL(content-sandbox, |
|
6495 [ --enable-content-sandbox Enable sandboxing support for content-processes], |
|
6496 MOZ_CONTENT_SANDBOX=1, |
|
6497 MOZ_CONTENT_SANDBOX=) |
|
6498 |
|
6499 if test -n "$MOZ_CONTENT_SANDBOX"; then |
|
6500 AC_DEFINE(MOZ_CONTENT_SANDBOX) |
|
6501 fi |
|
6502 |
|
6503 AC_SUBST(MOZ_CONTENT_SANDBOX) |
|
6504 |
|
6505 MOZ_ARG_ENABLE_BOOL(content-sandbox-reporter, |
|
6506 [ --enable-content-sandbox-reporter Enable syscall reporter to troubleshoot syscalls denied by the content-processes sandbox], |
|
6507 MOZ_CONTENT_SANDBOX_REPORTER=1, |
|
6508 MOZ_CONTENT_SANDBOX_REPORTER=) |
|
6509 |
|
6510 if test -n "$MOZ_CONTENT_SANDBOX_REPORTER"; then |
|
6511 AC_DEFINE(MOZ_CONTENT_SANDBOX_REPORTER) |
|
6512 fi |
|
6513 |
|
6514 AC_SUBST(MOZ_CONTENT_SANDBOX_REPORTER) |
|
6515 |
|
6516 dnl ======================================================== |
|
6517 dnl = |
|
6518 dnl = Module specific options |
|
6519 dnl = |
|
6520 dnl ======================================================== |
|
6521 MOZ_ARG_HEADER(Individual module options) |
|
6522 |
|
6523 dnl ======================================================== |
|
6524 dnl = Disable feed handling components |
|
6525 dnl ======================================================== |
|
6526 MOZ_ARG_DISABLE_BOOL(feeds, |
|
6527 [ --disable-feeds Disable feed handling and processing components], |
|
6528 MOZ_FEEDS=, |
|
6529 MOZ_FEEDS=1 ) |
|
6530 if test -n "$MOZ_FEEDS"; then |
|
6531 AC_DEFINE(MOZ_FEEDS) |
|
6532 else |
|
6533 if test "$MOZ_BUILD_APP" = "browser"; then |
|
6534 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.]) |
|
6535 fi |
|
6536 fi |
|
6537 |
|
6538 dnl ======================================================== |
|
6539 dnl Check for sqlite |
|
6540 dnl ======================================================== |
|
6541 |
|
6542 MOZ_NATIVE_SQLITE= |
|
6543 MOZ_ARG_ENABLE_BOOL(system-sqlite, |
|
6544 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)], |
|
6545 MOZ_NATIVE_SQLITE=1, |
|
6546 MOZ_NATIVE_SQLITE= ) |
|
6547 |
|
6548 if test -z "$MOZ_NATIVE_SQLITE" |
|
6549 then |
|
6550 SQLITE_CFLAGS= |
|
6551 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)' |
|
6552 else |
|
6553 dnl ============================ |
|
6554 dnl === SQLite Version check === |
|
6555 dnl ============================ |
|
6556 dnl Check to see if the system SQLite package is new enough. |
|
6557 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION) |
|
6558 |
|
6559 dnl ================================== |
|
6560 dnl === SQLITE_SECURE_DELETE check === |
|
6561 dnl ================================== |
|
6562 dnl Check to see if the system SQLite package is compiled with |
|
6563 dnl SQLITE_SECURE_DELETE enabled. |
|
6564 AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite) |
|
6565 _SAVE_CFLAGS="$CFLAGS" |
|
6566 CFLAGS="$CFLAGS $SQLITE_CFLAGS" |
|
6567 _SAVE_LIBS="$LIBS" |
|
6568 LIBS="$LIBS $SQLITE_LIBS" |
|
6569 AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[ |
|
6570 AC_TRY_RUN([ |
|
6571 #include "sqlite3.h" |
|
6572 |
|
6573 int main(int argc, char **argv){ |
|
6574 return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE"); |
|
6575 }], |
|
6576 ac_cv_sqlite_secure_delete=yes, |
|
6577 ac_cv_sqlite_secure_delete=no, |
|
6578 ac_cv_sqlite_secure_delete=no |
|
6579 ) |
|
6580 ]) |
|
6581 AC_MSG_RESULT($ac_cv_sqlite_secure_delete) |
|
6582 CFLAGS="$_SAVE_CFLAGS" |
|
6583 LIBS="$_SAVE_LIBS" |
|
6584 if test "x$ac_cv_sqlite_secure_delete" = "xno"; then |
|
6585 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.]) |
|
6586 fi |
|
6587 |
|
6588 dnl =============================== |
|
6589 dnl === SQLITE_THREADSAFE check === |
|
6590 dnl =============================== |
|
6591 dnl Check to see if the system SQLite package is compiled with |
|
6592 dnl SQLITE_THREADSAFE enabled. |
|
6593 AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite) |
|
6594 _SAVE_CFLAGS="$CFLAGS" |
|
6595 CFLAGS="$CFLAGS $SQLITE_CFLAGS" |
|
6596 _SAVE_LIBS="$LIBS" |
|
6597 LIBS="$LIBS $SQLITE_LIBS" |
|
6598 AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[ |
|
6599 AC_TRY_RUN([ |
|
6600 #include "sqlite3.h" |
|
6601 |
|
6602 int main(int argc, char **argv){ |
|
6603 return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1"); |
|
6604 }], |
|
6605 ac_cv_sqlite_threadsafe=yes, |
|
6606 ac_cv_sqlite_threadsafe=no, |
|
6607 ac_cv_sqlite_threadsafe=no |
|
6608 ) |
|
6609 ]) |
|
6610 AC_MSG_RESULT($ac_cv_sqlite_threadsafe) |
|
6611 CFLAGS="$_SAVE_CFLAGS" |
|
6612 LIBS="$_SAVE_LIBS" |
|
6613 if test "x$ac_cv_sqlite_threadsafe" = "xno"; then |
|
6614 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.]) |
|
6615 fi |
|
6616 |
|
6617 dnl ================================ |
|
6618 dnl === SQLITE_ENABLE_FTS3 check === |
|
6619 dnl ================================ |
|
6620 dnl check to see if the system SQLite package is compiled with |
|
6621 dnl SQLITE_ENABLE_FTS3 enabled. |
|
6622 AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite) |
|
6623 _SAVE_CFLAGS="$CFLAGS" |
|
6624 CFLAGS="$CFLAGS $SQLITE_CFLAGS" |
|
6625 _SAVE_LIBS="$LIBS" |
|
6626 LIBS="$LIBS $SQLITE_LIBS" |
|
6627 AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[ |
|
6628 AC_TRY_RUN([ |
|
6629 #include "sqlite3.h" |
|
6630 |
|
6631 int main(int argc, char **argv){ |
|
6632 return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3"); |
|
6633 }], |
|
6634 ac_cv_sqlite_enable_fts3=yes, |
|
6635 ac_cv_sqlite_enable_fts3=no, |
|
6636 ac_cv_sqlite_enable_fts3=no |
|
6637 ) |
|
6638 ]) |
|
6639 AC_MSG_RESULT($ac_cv_sqlite_enable_fts3) |
|
6640 CFLAGS="$_SAVE_CFLAGS" |
|
6641 LIBS="$_SAVE_LIBS" |
|
6642 if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then |
|
6643 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.]) |
|
6644 fi |
|
6645 |
|
6646 dnl ========================================= |
|
6647 dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check === |
|
6648 dnl ========================================= |
|
6649 dnl check to see if the system SQLite package is compiled with |
|
6650 dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled. |
|
6651 AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite) |
|
6652 _SAVE_CFLAGS="$CFLAGS" |
|
6653 CFLAGS="$CFLAGS $SQLITE_CFLAGS" |
|
6654 _SAVE_LIBS="$LIBS" |
|
6655 LIBS="$LIBS $SQLITE_LIBS" |
|
6656 AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[ |
|
6657 AC_TRY_RUN([ |
|
6658 #include "sqlite3.h" |
|
6659 |
|
6660 int main(int argc, char **argv){ |
|
6661 return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY"); |
|
6662 }], |
|
6663 ac_cv_sqlite_enable_unlock_notify=yes, |
|
6664 ac_cv_sqlite_enable_unlock_notify=no, |
|
6665 ac_cv_sqlite_enable_unlock_notify=no |
|
6666 ) |
|
6667 ]) |
|
6668 AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify) |
|
6669 CFLAGS="$_SAVE_CFLAGS" |
|
6670 LIBS="$_SAVE_LIBS" |
|
6671 if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then |
|
6672 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.]) |
|
6673 fi |
|
6674 fi |
|
6675 |
|
6676 if test -n "$MOZ_NATIVE_SQLITE"; then |
|
6677 AC_DEFINE(MOZ_NATIVE_SQLITE) |
|
6678 fi |
|
6679 AC_SUBST(MOZ_NATIVE_SQLITE) |
|
6680 |
|
6681 dnl ======================================================== |
|
6682 dnl = Enable help viewer (off by default) |
|
6683 dnl ======================================================== |
|
6684 if test -n "$MOZ_HELP_VIEWER"; then |
|
6685 dnl Do this if defined in confvars.sh |
|
6686 AC_DEFINE(MOZ_HELP_VIEWER) |
|
6687 fi |
|
6688 |
|
6689 dnl ======================================================== |
|
6690 dnl = Enable safe browsing (anti-phishing) |
|
6691 dnl ======================================================== |
|
6692 MOZ_ARG_ENABLE_BOOL(safe-browsing, |
|
6693 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation], |
|
6694 MOZ_SAFE_BROWSING=1, |
|
6695 MOZ_SAFE_BROWSING= ) |
|
6696 if test -n "$MOZ_SAFE_BROWSING"; then |
|
6697 AC_DEFINE(MOZ_SAFE_BROWSING) |
|
6698 fi |
|
6699 AC_SUBST(MOZ_SAFE_BROWSING) |
|
6700 |
|
6701 dnl ======================================================== |
|
6702 dnl = Enable url-classifier |
|
6703 dnl ======================================================== |
|
6704 dnl Implicitly enabled by default if building with safe-browsing |
|
6705 if test -n "$MOZ_SAFE_BROWSING"; then |
|
6706 MOZ_URL_CLASSIFIER=1 |
|
6707 fi |
|
6708 MOZ_ARG_ENABLE_BOOL(url-classifier, |
|
6709 [ --enable-url-classifier Enable url classifier module], |
|
6710 MOZ_URL_CLASSIFIER=1, |
|
6711 MOZ_URL_CLASSIFIER= ) |
|
6712 if test -n "$MOZ_URL_CLASSIFIER"; then |
|
6713 AC_DEFINE(MOZ_URL_CLASSIFIER) |
|
6714 fi |
|
6715 AC_SUBST(MOZ_URL_CLASSIFIER) |
|
6716 |
|
6717 dnl ======================================================== |
|
6718 dnl = Disable zipwriter |
|
6719 dnl ======================================================== |
|
6720 MOZ_ARG_DISABLE_BOOL(zipwriter, |
|
6721 [ --disable-zipwriter Disable zipwriter component], |
|
6722 MOZ_ZIPWRITER=, |
|
6723 MOZ_ZIPWRITER=1 ) |
|
6724 AC_SUBST(MOZ_ZIPWRITER) |
|
6725 |
|
6726 dnl ======================================================== |
|
6727 dnl GL provider |
|
6728 dnl ======================================================== |
|
6729 MOZ_GL_PROVIDER= |
|
6730 MOZ_ARG_WITH_STRING(gl-provider, |
|
6731 [ --with-gl-provider=ID |
|
6732 Set GL provider backend type], |
|
6733 [ val=`echo $withval` |
|
6734 MOZ_GL_PROVIDER="$val"]) |
|
6735 |
|
6736 if test -n "$MOZ_GL_PROVIDER"; then |
|
6737 MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER |
|
6738 AC_SUBST(MOZ_GL_PROVIDER) |
|
6739 AC_DEFINE_UNQUOTED(MOZ_GL_PROVIDER, GLContextProvider$MOZ_GL_PROVIDER) |
|
6740 fi |
|
6741 AC_SUBST(MOZ_GL_DEFAULT_PROVIDER) |
|
6742 AC_DEFINE_UNQUOTED(GL_PROVIDER_$MOZ_GL_DEFAULT_PROVIDER) |
|
6743 |
|
6744 dnl ======================================================== |
|
6745 dnl = faststripe theme |
|
6746 dnl ======================================================== |
|
6747 MOZ_ARG_ENABLE_BOOL(faststripe, |
|
6748 [ --enable-faststripe Use faststripe theme], |
|
6749 MOZ_THEME_FASTSTRIPE=1, |
|
6750 MOZ_THEME_FASTSTRIPE= ) |
|
6751 AC_SUBST(MOZ_THEME_FASTSTRIPE) |
|
6752 |
|
6753 dnl ======================================================== |
|
6754 dnl = |
|
6755 dnl = Feature options that require extra sources to be pulled |
|
6756 dnl = |
|
6757 dnl ======================================================== |
|
6758 dnl MOZ_ARG_HEADER(Features that require extra sources) |
|
6759 |
|
6760 dnl ======================================================== |
|
6761 dnl = |
|
6762 dnl = Runtime debugging and Optimization Options |
|
6763 dnl = |
|
6764 dnl ======================================================== |
|
6765 MOZ_ARG_HEADER(Runtime debugging and Optimizations) |
|
6766 |
|
6767 dnl ======================================================== |
|
6768 dnl enable mobile optimizations |
|
6769 dnl ======================================================== |
|
6770 MOZ_ARG_ENABLE_BOOL(mobile-optimize, |
|
6771 [ --enable-mobile-optimize |
|
6772 Enable mobile optimizations], |
|
6773 MOZ_GFX_OPTIMIZE_MOBILE=1) |
|
6774 |
|
6775 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE) |
|
6776 |
|
6777 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then |
|
6778 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE) |
|
6779 fi |
|
6780 |
|
6781 dnl ======================================================== |
|
6782 dnl = Enable code optimization. ON by default. |
|
6783 dnl ======================================================== |
|
6784 if test -z "$MOZ_OPTIMIZE_FLAGS"; then |
|
6785 MOZ_OPTIMIZE_FLAGS="-O" |
|
6786 fi |
|
6787 |
|
6788 MOZ_ARG_ENABLE_STRING(optimize, |
|
6789 [ --disable-optimize Disable compiler optimization |
|
6790 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]], |
|
6791 [ if test "$enableval" != "no"; then |
|
6792 MOZ_OPTIMIZE=1 |
|
6793 if test -n "$enableval" -a "$enableval" != "yes"; then |
|
6794 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'` |
|
6795 MOZ_OPTIMIZE=2 |
|
6796 fi |
|
6797 else |
|
6798 MOZ_OPTIMIZE= |
|
6799 fi ], MOZ_OPTIMIZE=1) |
|
6800 |
|
6801 MOZ_SET_FRAMEPTR_FLAGS |
|
6802 |
|
6803 if test "$COMPILE_ENVIRONMENT"; then |
|
6804 if test -n "$MOZ_OPTIMIZE"; then |
|
6805 AC_MSG_CHECKING([for valid optimization flags]) |
|
6806 _SAVE_CFLAGS=$CFLAGS |
|
6807 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS" |
|
6808 AC_TRY_COMPILE([#include <stdio.h>], |
|
6809 [printf("Hello World\n");], |
|
6810 _results=yes, |
|
6811 _results=no) |
|
6812 AC_MSG_RESULT([$_results]) |
|
6813 if test "$_results" = "no"; then |
|
6814 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS]) |
|
6815 fi |
|
6816 CFLAGS=$_SAVE_CFLAGS |
|
6817 fi |
|
6818 fi # COMPILE_ENVIRONMENT |
|
6819 |
|
6820 AC_SUBST(MOZ_OPTIMIZE) |
|
6821 AC_SUBST(MOZ_FRAMEPTR_FLAGS) |
|
6822 AC_SUBST(MOZ_OPTIMIZE_FLAGS) |
|
6823 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS) |
|
6824 AC_SUBST(MOZ_ALLOW_HEAP_EXECUTE_FLAGS) |
|
6825 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK) |
|
6826 AC_SUBST(MOZ_PGO) |
|
6827 AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS) |
|
6828 |
|
6829 dnl ======================================================== |
|
6830 dnl = Enable any treating of compile warnings as errors |
|
6831 dnl ======================================================== |
|
6832 MOZ_ARG_ENABLE_BOOL(warnings-as-errors, |
|
6833 [ --enable-warnings-as-errors |
|
6834 Enable treating of warnings as errors], |
|
6835 MOZ_ENABLE_WARNINGS_AS_ERRORS=1, |
|
6836 MOZ_ENABLE_WARNINGS_AS_ERRORS=) |
|
6837 if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then |
|
6838 WARNINGS_AS_ERRORS='' |
|
6839 elif test "$GNU_CC"; then |
|
6840 # Prevent the following GCC warnings from being treated as errors: |
|
6841 # -Wuninitialized - too many false positives |
|
6842 # -Wmaybe-uninitialized - too many false positives |
|
6843 # -Wdeprecated-declarations - we don't want our builds held hostage when a |
|
6844 # platform-specific API becomes deprecated. |
|
6845 MOZ_C_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_c_has_noerror_uninitialized) |
|
6846 MOZ_CXX_SUPPORTS_WARNING(-W, no-error=uninitialized, ac_cxx_has_noerror_uninitialized) |
|
6847 MOZ_C_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_c_has_noerror_maybe_uninitialized) |
|
6848 MOZ_CXX_SUPPORTS_WARNING(-W, no-error=maybe-uninitialized, ac_cxx_has_noerror_maybe_uninitialized) |
|
6849 MOZ_C_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_c_has_noerror_deprecated_declarations) |
|
6850 MOZ_CXX_SUPPORTS_WARNING(-W, no-error=deprecated-declarations, ac_cxx_has_noerror_deprecated_declarations) |
|
6851 fi |
|
6852 |
|
6853 dnl ======================================================== |
|
6854 dnl = Disable runtime logging checks |
|
6855 dnl ======================================================== |
|
6856 MOZ_ARG_DISABLE_BOOL(logging, |
|
6857 [ --disable-logging Disable logging facilities], |
|
6858 NS_DISABLE_LOGGING=1, |
|
6859 NS_DISABLE_LOGGING= ) |
|
6860 if test "$NS_DISABLE_LOGGING"; then |
|
6861 AC_DEFINE(NS_DISABLE_LOGGING) |
|
6862 else |
|
6863 AC_DEFINE(MOZ_LOGGING) |
|
6864 fi |
|
6865 |
|
6866 dnl ======================================================== |
|
6867 dnl = This will enable logging of addref, release, ctor, dtor. |
|
6868 dnl ======================================================== |
|
6869 _ENABLE_LOGREFCNT=42 |
|
6870 MOZ_ARG_ENABLE_BOOL(logrefcnt, |
|
6871 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ], |
|
6872 _ENABLE_LOGREFCNT=1, |
|
6873 _ENABLE_LOGREFCNT= ) |
|
6874 if test "$_ENABLE_LOGREFCNT" = "1"; then |
|
6875 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING) |
|
6876 elif test -z "$_ENABLE_LOGREFCNT"; then |
|
6877 AC_DEFINE(NO_BUILD_REFCNT_LOGGING) |
|
6878 fi |
|
6879 |
|
6880 dnl ======================================================== |
|
6881 dnl moz_dump_painting |
|
6882 dnl ======================================================== |
|
6883 MOZ_ARG_ENABLE_BOOL(dump-painting, |
|
6884 [ --enable-dump-painting Enable paint debugging.], |
|
6885 MOZ_DUMP_PAINTING=1, |
|
6886 MOZ_DUMP_PAINTING= ) |
|
6887 if test -n "$MOZ_DUMP_PAINTING"; then |
|
6888 AC_DEFINE(MOZ_DUMP_PAINTING) |
|
6889 AC_DEFINE(MOZ_LAYERS_HAVE_LOG) |
|
6890 fi |
|
6891 if test -n "$MOZ_DEBUG"; then |
|
6892 AC_DEFINE(MOZ_DUMP_PAINTING) |
|
6893 fi |
|
6894 |
|
6895 dnl ======================================================== |
|
6896 dnl = Enable trace malloc |
|
6897 dnl ======================================================== |
|
6898 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC} |
|
6899 MOZ_ARG_ENABLE_BOOL(trace-malloc, |
|
6900 [ --enable-trace-malloc Enable malloc tracing; also disables DMD and jemalloc], |
|
6901 NS_TRACE_MALLOC=1, |
|
6902 NS_TRACE_MALLOC= ) |
|
6903 if test "$NS_TRACE_MALLOC"; then |
|
6904 # Please, Mr. Linker Man, don't take away our symbol names |
|
6905 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS= |
|
6906 AC_DEFINE(NS_TRACE_MALLOC) |
|
6907 fi |
|
6908 AC_SUBST(NS_TRACE_MALLOC) |
|
6909 |
|
6910 dnl ======================================================== |
|
6911 dnl = Enable DMD |
|
6912 dnl ======================================================== |
|
6913 |
|
6914 MOZ_ARG_ENABLE_BOOL(dmd, |
|
6915 [ --enable-dmd Enable DMD; also enables jemalloc and replace-malloc], |
|
6916 MOZ_DMD=1, |
|
6917 MOZ_DMD= ) |
|
6918 |
|
6919 dnl The two options are conflicting. Fails the configure to alert the user. |
|
6920 if test "$NS_TRACE_MALLOC" -a "$MOZ_DMD"; then |
|
6921 AC_MSG_ERROR([--enable-trace-malloc and --enable-dmd are conflicting options]) |
|
6922 fi |
|
6923 |
|
6924 if test "$MOZ_DMD"; then |
|
6925 AC_DEFINE(MOZ_DMD) |
|
6926 |
|
6927 if test "${CPU_ARCH}" = "arm"; then |
|
6928 CFLAGS="$CFLAGS -funwind-tables" |
|
6929 CXXFLAGS="$CXXFLAGS -funwind-tables" |
|
6930 fi |
|
6931 |
|
6932 MOZ_MEMORY=1 # DMD enables jemalloc |
|
6933 MOZ_REPLACE_MALLOC=1 # DMD enables replace-malloc |
|
6934 fi |
|
6935 AC_SUBST(MOZ_DMD) |
|
6936 |
|
6937 dnl ======================================================== |
|
6938 dnl = Enable jemalloc |
|
6939 dnl ======================================================== |
|
6940 MOZ_ARG_ENABLE_BOOL(jemalloc, |
|
6941 [ --enable-jemalloc Replace memory allocator with jemalloc], |
|
6942 MOZ_MEMORY=1, |
|
6943 MOZ_MEMORY=) |
|
6944 |
|
6945 if test "$NS_TRACE_MALLOC"; then |
|
6946 MOZ_MEMORY= |
|
6947 fi |
|
6948 |
|
6949 if test "${OS_TARGET}" = "Android"; then |
|
6950 dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue |
|
6951 : |
|
6952 elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin"; then |
|
6953 dnl On Windows and OSX, we want to link all our binaries against mozglue |
|
6954 if test -z "$GNU_CC"; then |
|
6955 MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)' |
|
6956 else |
|
6957 MOZ_GLUE_LDFLAGS='-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)' |
|
6958 fi |
|
6959 else |
|
6960 dnl On other Unix systems, we only want to link executables against mozglue |
|
6961 MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)' |
|
6962 dnl On other Unix systems, where mozglue is a static library, jemalloc is |
|
6963 dnl separated for the SDK, so we need to add it here. |
|
6964 if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then |
|
6965 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)' |
|
6966 fi |
|
6967 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)' |
|
6968 if test -n "$GNU_CC"; then |
|
6969 dnl And we need mozglue symbols to be exported. |
|
6970 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic" |
|
6971 fi |
|
6972 if test "$MOZ_LINKER" = 1; then |
|
6973 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $MOZ_ZLIB_LIBS" |
|
6974 fi |
|
6975 fi |
|
6976 |
|
6977 dnl ======================================================== |
|
6978 dnl = Enable dynamic replacement of malloc implementation |
|
6979 dnl ======================================================== |
|
6980 MOZ_ARG_ENABLE_BOOL(replace-malloc, |
|
6981 [ --enable-replace-malloc Enable ability to dynamically replace the malloc implementation], |
|
6982 MOZ_REPLACE_MALLOC=1, |
|
6983 MOZ_REPLACE_MALLOC= ) |
|
6984 |
|
6985 dnl The two options are conflicting. Fails the configure to alert the user. |
|
6986 if test "$NS_TRACE_MALLOC" -a "$MOZ_REPLACE_MALLOC"; then |
|
6987 AC_MSG_ERROR([--enable-trace-malloc and --enable-replace-malloc are conflicting options]) |
|
6988 fi |
|
6989 |
|
6990 if test -n "$MOZ_REPLACE_MALLOC" -a -z "$MOZ_MEMORY"; then |
|
6991 dnl We don't want to enable jemalloc unconditionally because it may be a |
|
6992 dnl deliberate choice not to enable it (bug 702250, for instance) |
|
6993 AC_MSG_ERROR([--enable-replace-malloc requires --enable-jemalloc]) |
|
6994 elif test -n "$MOZ_REPLACE_MALLOC"; then |
|
6995 MOZ_NATIVE_JEMALLOC= |
|
6996 |
|
6997 dnl Replace-malloc Mac linkage quirks |
|
6998 if test -n "$MACOSX_DEPLOYMENT_TARGET"; then |
|
6999 AC_CACHE_CHECK([how to do weak dynamic linking], |
|
7000 ac_cv_weak_dynamic_linking, |
|
7001 [echo 'extern void foo() __attribute__((weak_import));int bar() { if (foo) foo(); return 0; }' > conftest.c |
|
7002 if AC_TRY_COMMAND([${CC-cc} -o conftest${DLL_SUFFIX} $CFLAGS -dynamiclib $LDFLAGS -Wl,-U,_foo conftest.c $LIBS 1>&5]) && |
|
7003 test -s conftest${DLL_SUFFIX}; then |
|
7004 dnl There are several ways the linker can put link edit rules in a binary: |
|
7005 dnl - classic info only (for OSX < 10.6) |
|
7006 dnl - dyld info only |
|
7007 dnl - both |
|
7008 if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO_ONLY" > /dev/null; then |
|
7009 _CLASSIC_INFO= |
|
7010 else |
|
7011 _CLASSIC_INFO=1 |
|
7012 fi |
|
7013 if otool -l conftest${DLL_SUFFIX} 2> /dev/null | grep "LC_DYLD_INFO" > /dev/null; then |
|
7014 _DYLD_INFO=1 |
|
7015 else |
|
7016 _DYLD_INFO= |
|
7017 fi |
|
7018 dnl With classic info, we need to build with -flat_namespace. |
|
7019 dnl With dyld info, Xcode 4.5 does the right thing without additional flags, |
|
7020 dnl but Xcode < 4.5 requires a dummy library and -flat_namespace because it |
|
7021 dnl forgets to set the weak flag in the dyld info. |
|
7022 dnl See http://glandium.org/blog/?p=2764 for more details. |
|
7023 dnl |
|
7024 dnl Values for ac_cv_weak_dynamic_linking, and subsequently |
|
7025 dnl MOZ_REPLACE_MALLOC_LINKAGE are thus: |
|
7026 dnl - "flat namespace" when -flat_namespace alone is needed |
|
7027 dnl - "dummy library" when a dummy library and -flat_namespace are needed |
|
7028 dnl - "compiler support" when nothing is needed |
|
7029 if test -n "$_DYLD_INFO" && dyldinfo -bind conftest${DLL_SUFFIX} 2> /dev/null | grep "_foo (weak import)" > /dev/null; then |
|
7030 if test -n "$_CLASSIC_INFO"; then |
|
7031 ac_cv_weak_dynamic_linking="flat namespace" |
|
7032 else |
|
7033 ac_cv_weak_dynamic_linking="compiler support" |
|
7034 fi |
|
7035 else |
|
7036 if test -n "$_DYLD_INFO"; then |
|
7037 ac_cv_weak_dynamic_linking="dummy library" |
|
7038 else |
|
7039 ac_cv_weak_dynamic_linking="flat namespace" |
|
7040 fi |
|
7041 fi |
|
7042 else |
|
7043 AC_ERROR([couldn't compile a simple C file]) |
|
7044 fi |
|
7045 rm -rf conftest*]) |
|
7046 MOZ_REPLACE_MALLOC_LINKAGE="$ac_cv_weak_dynamic_linking" |
|
7047 fi |
|
7048 fi |
|
7049 AC_SUBST(MOZ_REPLACE_MALLOC) |
|
7050 AC_SUBST(MOZ_REPLACE_MALLOC_LINKAGE) |
|
7051 |
|
7052 dnl ======================================================== |
|
7053 dnl = Jemalloc build setup |
|
7054 dnl ======================================================== |
|
7055 if test -z "$MOZ_MEMORY"; then |
|
7056 if test -n "$MOZ_JEMALLOC3" -a -z "$MOZ_REPLACE_MALLOC"; then |
|
7057 MOZ_NATIVE_JEMALLOC=1 |
|
7058 AC_CHECK_FUNCS(mallctl nallocm,, |
|
7059 [MOZ_NATIVE_JEMALLOC= |
|
7060 break]) |
|
7061 if test -n "$MOZ_NATIVE_JEMALLOC"; then |
|
7062 MOZ_MEMORY=1 |
|
7063 AC_DEFINE(MOZ_MEMORY) |
|
7064 AC_DEFINE(MOZ_JEMALLOC3) |
|
7065 AC_DEFINE(MOZ_NATIVE_JEMALLOC) |
|
7066 fi |
|
7067 fi |
|
7068 case "${target}" in |
|
7069 *-mingw*) |
|
7070 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then |
|
7071 AC_MSG_WARN([When not building jemalloc, you need to set WIN32_REDIST_DIR to the path to the Visual C++ Redist (usually VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT, for VC++ v8) if you intend to distribute your build.]) |
|
7072 fi |
|
7073 ;; |
|
7074 esac |
|
7075 else |
|
7076 AC_DEFINE(MOZ_MEMORY) |
|
7077 if test -n "$MOZ_JEMALLOC3"; then |
|
7078 AC_DEFINE(MOZ_JEMALLOC3) |
|
7079 fi |
|
7080 if test "x$MOZ_DEBUG" = "x1"; then |
|
7081 AC_DEFINE(MOZ_MEMORY_DEBUG) |
|
7082 fi |
|
7083 dnl The generic feature tests that determine how to compute ncpus are long and |
|
7084 dnl complicated. Therefore, simply define special cpp variables for the |
|
7085 dnl platforms we have special knowledge of. |
|
7086 case "${target}" in |
|
7087 *-darwin*) |
|
7088 AC_DEFINE(MOZ_MEMORY_DARWIN) |
|
7089 ;; |
|
7090 *-*freebsd*) |
|
7091 AC_DEFINE(MOZ_MEMORY_BSD) |
|
7092 ;; |
|
7093 *-android*|*-linuxandroid*) |
|
7094 AC_DEFINE(MOZ_MEMORY_LINUX) |
|
7095 AC_DEFINE(MOZ_MEMORY_ANDROID) |
|
7096 if test -z "$gonkdir"; then |
|
7097 _WRAP_MALLOC=1 |
|
7098 else |
|
7099 AC_DEFINE(MOZ_MEMORY_GONK) |
|
7100 fi |
|
7101 MOZ_GLUE_LDFLAGS= |
|
7102 ;; |
|
7103 *-*linux*) |
|
7104 AC_DEFINE(MOZ_MEMORY_LINUX) |
|
7105 ;; |
|
7106 *-netbsd*) |
|
7107 AC_DEFINE(MOZ_MEMORY_BSD) |
|
7108 ;; |
|
7109 *-solaris*) |
|
7110 AC_DEFINE(MOZ_MEMORY_SOLARIS) |
|
7111 ;; |
|
7112 *-mingw*) |
|
7113 AC_DEFINE(MOZ_MEMORY_WINDOWS) |
|
7114 if test -z "$MOZ_DEBUG"; then |
|
7115 WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib" |
|
7116 else |
|
7117 WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib" |
|
7118 fi |
|
7119 dnl Look for a broken crtdll.obj |
|
7120 WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj` |
|
7121 lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH |
|
7122 if grep -q '__imp__\{0,1\}free' crtdll.obj; then |
|
7123 MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt' |
|
7124 dnl Also pass this to NSPR/NSS |
|
7125 DLLFLAGS="$DLLFLAGS $MOZ_GLUE_LDFLAGS" |
|
7126 else |
|
7127 DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue" |
|
7128 fi |
|
7129 rm crtdll.obj |
|
7130 |
|
7131 export DLLFLAGS |
|
7132 ;; |
|
7133 *) |
|
7134 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}]) |
|
7135 ;; |
|
7136 esac |
|
7137 fi # MOZ_MEMORY |
|
7138 AC_SUBST(MOZ_MEMORY) |
|
7139 AC_SUBST(MOZ_JEMALLOC3) |
|
7140 AC_SUBST(MOZ_NATIVE_JEMALLOC) |
|
7141 AC_SUBST(MOZ_GLUE_LDFLAGS) |
|
7142 AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS) |
|
7143 AC_SUBST(WIN32_CRT_LIBS) |
|
7144 dnl Need to set this for make because NSS doesn't have configure |
|
7145 AC_SUBST(DLLFLAGS) |
|
7146 |
|
7147 dnl We need to wrap dlopen and related functions on Android because we use |
|
7148 dnl our own linker. |
|
7149 if test "$OS_TARGET" = Android; then |
|
7150 WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue" |
|
7151 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv" |
|
7152 if test "$MOZ_WIDGET_TOOLKIT" = android; then |
|
7153 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror" |
|
7154 fi |
|
7155 if test -z "$gonkdir"; then |
|
7156 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise" |
|
7157 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=memccpy,--wrap=memchr,--wrap=memrchr,--wrap=memcmp,--wrap=memcpy,--wrap=memmove,--wrap=memset,--wrap=memmem,--wrap=memswap,--wrap=index,--wrap=strchr,--wrap=strrchr,--wrap=strlen,--wrap=strcmp,--wrap=strcpy,--wrap=strcat,--wrap=strcasecmp,--wrap=strncasecmp,--wrap=strstr,--wrap=strcasestr,--wrap=strtok,--wrap=strtok_r,--wrap=strerror,--wrap=strerror_r,--wrap=strnlen,--wrap=strncat,--wrap=strncmp,--wrap=strncpy,--wrap=strlcat,--wrap=strlcpy,--wrap=strcspn,--wrap=strpbrk,--wrap=strsep,--wrap=strspn,--wrap=strcoll,--wrap=strxfrm" |
|
7158 fi |
|
7159 if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then |
|
7160 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=pthread_create,--wrap=epoll_wait,--wrap=poll,--wrap=pthread_cond_timedwait,--wrap=__pthread_cond_timedwait,--wrap=pthread_cond_wait,--wrap=epoll_create,--wrap=epoll_ctl,--wrap=close,--wrap=pthread_key_create,--wrap=pthread_key_delete,--wrap=socketpair,--wrap=pthread_self,--wrap=pthread_mutex_lock,--wrap=pthread_join,--wrap=pipe,--wrap=pipe2,--wrap=tgkill" |
|
7161 fi |
|
7162 fi |
|
7163 |
|
7164 dnl ======================================================== |
|
7165 dnl = Use malloc wrapper lib |
|
7166 dnl ======================================================== |
|
7167 MOZ_ARG_ENABLE_BOOL(wrap-malloc, |
|
7168 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)], |
|
7169 _WRAP_MALLOC=1, |
|
7170 _WRAP_MALLOC= ) |
|
7171 |
|
7172 if test -n "$_WRAP_MALLOC"; then |
|
7173 if test -n "$GNU_CC"; then |
|
7174 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign" |
|
7175 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete" |
|
7176 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup" |
|
7177 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf" |
|
7178 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size" |
|
7179 dnl Wrap operator new and operator delete on Android. |
|
7180 if test "$OS_TARGET" = "Android"; then |
|
7181 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv" |
|
7182 dnl Wrap the nothrow variants too. |
|
7183 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_ZnwjRKSt9nothrow_t,--wrap=_ZnajRKSt9nothrow_t,--wrap=_ZdlPvRKSt9nothrow_t,--wrap=_ZdaPvRKSt9nothrow_t" |
|
7184 fi |
|
7185 else |
|
7186 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains]) |
|
7187 fi |
|
7188 fi |
|
7189 |
|
7190 dnl ======================================================== |
|
7191 dnl = Location of malloc wrapper lib |
|
7192 dnl ======================================================== |
|
7193 MOZ_ARG_WITH_STRING(wrap-malloc, |
|
7194 [ --with-wrap-malloc=DIR Location of malloc wrapper library], |
|
7195 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval") |
|
7196 |
|
7197 dnl ======================================================== |
|
7198 dnl = Use JS Call tracing |
|
7199 dnl ======================================================== |
|
7200 MOZ_ARG_ENABLE_BOOL(trace-jscalls, |
|
7201 [ --enable-trace-jscalls Enable JS call enter/exit callback (default=no)], |
|
7202 MOZ_TRACE_JSCALLS=1, |
|
7203 MOZ_TRACE_JSCALLS= ) |
|
7204 if test -n "$MOZ_TRACE_JSCALLS"; then |
|
7205 AC_DEFINE(MOZ_TRACE_JSCALLS) |
|
7206 fi |
|
7207 |
|
7208 dnl ======================================================== |
|
7209 dnl JS opt-mode assertions and minidump instrumentation |
|
7210 dnl ======================================================== |
|
7211 MOZ_ARG_ENABLE_BOOL(js-diagnostics, |
|
7212 [ --enable-js-diagnostics |
|
7213 Enable JS diagnostic assertions and breakpad data], |
|
7214 JS_CRASH_DIAGNOSTICS=1, |
|
7215 JS_CRASH_DIAGNOSTICS= ) |
|
7216 if test -n "$JS_CRASH_DIAGNOSTICS"; then |
|
7217 AC_DEFINE(JS_CRASH_DIAGNOSTICS) |
|
7218 fi |
|
7219 |
|
7220 MOZ_CHECK_CCACHE |
|
7221 |
|
7222 dnl ======================================================== |
|
7223 dnl = Enable static checking using gcc-dehydra |
|
7224 dnl ======================================================== |
|
7225 |
|
7226 MOZ_ARG_WITH_STRING(static-checking, |
|
7227 [ --with-static-checking=path/to/gcc_dehydra.so |
|
7228 Enable static checking of code using GCC-dehydra], |
|
7229 DEHYDRA_PATH=$withval, |
|
7230 DEHYDRA_PATH= ) |
|
7231 |
|
7232 if test -n "$DEHYDRA_PATH"; then |
|
7233 if test ! -f "$DEHYDRA_PATH"; then |
|
7234 AC_MSG_ERROR([The dehydra plugin is not at the specified path.]) |
|
7235 fi |
|
7236 AC_DEFINE(NS_STATIC_CHECKING) |
|
7237 fi |
|
7238 AC_SUBST(DEHYDRA_PATH) |
|
7239 |
|
7240 dnl ======================================================== |
|
7241 dnl = Enable using the clang plugin to build |
|
7242 dnl ======================================================== |
|
7243 |
|
7244 MOZ_ARG_ENABLE_BOOL(clang-plugin, |
|
7245 [ --enable-clang-plugin Enable building with the mozilla clang plugin ], |
|
7246 ENABLE_CLANG_PLUGIN=1, |
|
7247 ENABLE_CLANG_PLUGIN= ) |
|
7248 if test -n "$ENABLE_CLANG_PLUGIN"; then |
|
7249 if test -z "$CLANG_CC"; then |
|
7250 AC_MSG_ERROR([Can't use clang plugin without clang.]) |
|
7251 fi |
|
7252 AC_DEFINE(MOZ_CLANG_PLUGIN) |
|
7253 fi |
|
7254 |
|
7255 AC_SUBST(ENABLE_CLANG_PLUGIN) |
|
7256 |
|
7257 dnl ======================================================== |
|
7258 dnl = Enable stripping of libs & executables |
|
7259 dnl ======================================================== |
|
7260 MOZ_ARG_ENABLE_BOOL(strip, |
|
7261 [ --enable-strip Enable stripping of libs & executables ], |
|
7262 ENABLE_STRIP=1, |
|
7263 ENABLE_STRIP= ) |
|
7264 |
|
7265 dnl ======================================================== |
|
7266 dnl = Enable stripping of libs & executables when packaging |
|
7267 dnl ======================================================== |
|
7268 MOZ_ARG_ENABLE_BOOL(install-strip, |
|
7269 [ --enable-install-strip Enable stripping of libs & executables when packaging ], |
|
7270 PKG_SKIP_STRIP= , |
|
7271 PKG_SKIP_STRIP=1) |
|
7272 |
|
7273 dnl ======================================================== |
|
7274 dnl = --disable-elf-hack |
|
7275 dnl ======================================================== |
|
7276 |
|
7277 USE_ELF_HACK=1 |
|
7278 MOZ_ARG_DISABLE_BOOL(elf-hack, |
|
7279 [ --disable-elf-hack Disable elf hacks], |
|
7280 [USE_ELF_HACK=], |
|
7281 [USE_ELF_HACK=F # Force enable elf-hack]) |
|
7282 |
|
7283 # Disable elf hack for profiling because the built in profiler |
|
7284 # doesn't read the segments properly with elf hack. This is |
|
7285 # temporary and should be fixed soon in the profiler. |
|
7286 if test "$MOZ_PROFILING" = 1; then |
|
7287 if test "$USE_ELF_HACK" = F; then |
|
7288 AC_ERROR([--enable-elf-hack is not compatible with --enable-profiling]) |
|
7289 fi |
|
7290 USE_ELF_HACK= |
|
7291 fi |
|
7292 |
|
7293 # Only enable elfhack where supported |
|
7294 if test "$USE_ELF_HACK" = 1; then |
|
7295 case "${HOST_OS_ARCH},${OS_ARCH}" in |
|
7296 Linux,Linux) |
|
7297 case "${CPU_ARCH}" in |
|
7298 arm | x86 | x86_64) |
|
7299 USE_ELF_HACK=1 |
|
7300 ;; |
|
7301 *) |
|
7302 USE_ELF_HACK= |
|
7303 ;; |
|
7304 esac |
|
7305 ;; |
|
7306 *) |
|
7307 USE_ELF_HACK= |
|
7308 ;; |
|
7309 esac |
|
7310 fi |
|
7311 |
|
7312 if test -n "$COMPILE_ENVIRONMENT" -a -n "$USE_ELF_HACK"; then |
|
7313 dnl PT_GNU_RELRO segment makes the dynamic linker set a read-only flag on |
|
7314 dnl memory addresses it maps to. The result is that by the time elfhack |
|
7315 dnl kicks in, it is not possible to apply relocations because of that, |
|
7316 dnl thus elfhack effectively skips relocations inside the PT_GNU_RELRO |
|
7317 dnl segment. It makes elfhack mostly useless, so considering the problems |
|
7318 dnl we have we PT_GNU_RELRO (e.g. bug 664366), and until elfhack can deal |
|
7319 dnl with PT_GNU_RELRO segments, it's just simpler to disable elfhack when |
|
7320 dnl the linker creates PT_GNU_RELRO segments. However, when we do want |
|
7321 dnl elfhack enabled, disable PT_GNU_RELRO instead. |
|
7322 AC_CACHE_CHECK([whether linker creates PT_GNU_RELRO segments], |
|
7323 LINK_WITH_PT_GNU_RELRO, |
|
7324 [echo "int main() {return 0;}" > conftest.${ac_ext} |
|
7325 if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2) && |
|
7326 test -s conftest${ac_exeext}; then |
|
7327 if ${TOOLCHAIN_PREFIX}readelf -l conftest${ac_exeext} | grep GNU_RELRO > /dev/null; then |
|
7328 LINK_WITH_PT_GNU_RELRO=yes |
|
7329 else |
|
7330 LINK_WITH_PT_GNU_RELRO=no |
|
7331 fi |
|
7332 else |
|
7333 dnl We really don't expect to get here, but just in case |
|
7334 AC_ERROR([couldn't compile a simple C file]) |
|
7335 fi |
|
7336 rm -rf conftest*]) |
|
7337 if test "$LINK_WITH_PT_GNU_RELRO" = yes; then |
|
7338 if test "$USE_ELF_HACK" = F; then |
|
7339 AC_MSG_CHECKING([for -z norelro option to ld]) |
|
7340 _SAVE_LDFLAGS=$LDFLAGS |
|
7341 LDFLAGS="$LDFLAGS -Wl,-z,norelro" |
|
7342 AC_TRY_LINK(,,AC_MSG_RESULT([yes]) |
|
7343 [NSPR_LDFLAGS="$NSPR_LDFLAGS -Wl,-z,norelro"], |
|
7344 AC_ERROR([--enable-elf-hack is not compatible with a linker creating a PT_GNU_RELRO segment and that doesn't support the "-z norelro" option.])) |
|
7345 USE_ELF_HACK=1 |
|
7346 else |
|
7347 AC_MSG_WARN([Disabling elfhack]) |
|
7348 USE_ELF_HACK= |
|
7349 fi |
|
7350 fi |
|
7351 fi |
|
7352 |
|
7353 dnl ======================================================== |
|
7354 dnl = libstdc++ compatibility hacks |
|
7355 dnl ======================================================== |
|
7356 |
|
7357 STDCXX_COMPAT= |
|
7358 MOZ_ARG_ENABLE_BOOL(stdcxx-compat, |
|
7359 [ --enable-stdcxx-compat Enable compatibility with older libstdc++], |
|
7360 STDCXX_COMPAT=1) |
|
7361 |
|
7362 if test -n "$STDCXX_COMPAT"; then |
|
7363 eval $(CXX="$CXX" HOST_CXX="$HOST_CXX" $PYTHON -m mozbuild.configure.libstdcxx) |
|
7364 AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION) |
|
7365 AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION) |
|
7366 fi |
|
7367 |
|
7368 dnl ======================================================== |
|
7369 dnl = |
|
7370 dnl = Profiling and Instrumenting |
|
7371 dnl = |
|
7372 dnl ======================================================== |
|
7373 MOZ_ARG_HEADER(Profiling and Instrumenting) |
|
7374 |
|
7375 dnl ======================================================== |
|
7376 dnl = Enable runtime visual profiling logger |
|
7377 dnl ======================================================== |
|
7378 MOZ_ARG_ENABLE_BOOL(visual-event-tracer, |
|
7379 [ --enable-visual-event-tracer Enable visual event tracer instrumentation], |
|
7380 MOZ_VISUAL_EVENT_TRACER=1, |
|
7381 MOZ_VISUAL_EVENT_TRACER=) |
|
7382 if test -n "$MOZ_VISUAL_EVENT_TRACER"; then |
|
7383 AC_DEFINE(MOZ_VISUAL_EVENT_TRACER) |
|
7384 fi |
|
7385 |
|
7386 dnl ======================================================== |
|
7387 dnl = Enable TaskTracer |
|
7388 dnl ======================================================== |
|
7389 MOZ_ARG_ENABLE_BOOL(tasktracer, |
|
7390 [ --enable-tasktracer Set compile flags necessary for using TaskTracer], |
|
7391 MOZ_TASK_TRACER=1, |
|
7392 MOZ_TASK_TRACER= ) |
|
7393 if test "$MOZ_WIDGET_TOOLKIT" = "gonk" -a -n "$MOZ_TASK_TRACER"; then |
|
7394 AC_DEFINE(MOZ_TASK_TRACER) |
|
7395 AC_SUBST(MOZ_TASK_TRACER) |
|
7396 fi |
|
7397 |
|
7398 dnl ======================================================== |
|
7399 dnl Turn on reflow counting |
|
7400 dnl ======================================================== |
|
7401 MOZ_ARG_ENABLE_BOOL(reflow-perf, |
|
7402 [ --enable-reflow-perf Enable reflow performance tracing], |
|
7403 MOZ_REFLOW_PERF=1, |
|
7404 MOZ_REFLOW_PERF= ) |
|
7405 if test -n "$MOZ_REFLOW_PERF"; then |
|
7406 AC_DEFINE(MOZ_REFLOW_PERF) |
|
7407 fi |
|
7408 |
|
7409 dnl ======================================================== |
|
7410 dnl = Enable Radio Interface for B2G (Gonk usually) |
|
7411 dnl ======================================================== |
|
7412 MOZ_ARG_ENABLE_BOOL(b2g-ril, |
|
7413 [ --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ], |
|
7414 MOZ_B2G_RIL=1, |
|
7415 MOZ_B2G_RIL=, |
|
7416 MOZ_B2G_RIL=$_PLATFORM_HAVE_RIL ) |
|
7417 if test -n "$MOZ_B2G_RIL"; then |
|
7418 if test -n "$_PLATFORM_HAVE_RIL"; then |
|
7419 AC_DEFINE(MOZ_B2G_RIL) |
|
7420 else |
|
7421 AC_MSG_ERROR([b2g-ril cannot be enabled because target platform doesn't support it.]) |
|
7422 fi |
|
7423 fi |
|
7424 AC_SUBST(MOZ_B2G_RIL) |
|
7425 |
|
7426 dnl ======================================================== |
|
7427 dnl = Enable Radio FM for B2G (Gonk usually) |
|
7428 dnl ======================================================== |
|
7429 if test -n "$MOZ_B2G_FM"; then |
|
7430 AC_DEFINE(MOZ_B2G_FM) |
|
7431 fi |
|
7432 AC_SUBST(MOZ_B2G_FM) |
|
7433 |
|
7434 dnl ======================================================== |
|
7435 dnl = Enable Bluetooth Interface for B2G (Gonk usually) |
|
7436 dnl ======================================================== |
|
7437 MOZ_ARG_ENABLE_BOOL(b2g-bt, |
|
7438 [ --enable-b2g-bt Set compile flags necessary for compiling Bluetooth API for B2G ], |
|
7439 MOZ_B2G_BT=1, |
|
7440 MOZ_B2G_BT= ) |
|
7441 if test -n "$MOZ_B2G_BT"; then |
|
7442 AC_DEFINE(MOZ_B2G_BT) |
|
7443 fi |
|
7444 AC_SUBST(MOZ_B2G_BT) |
|
7445 AC_SUBST(MOZ_B2G_BT_BLUEZ) |
|
7446 AC_SUBST(MOZ_B2G_BT_BLUEDROID) |
|
7447 |
|
7448 dnl ======================================================== |
|
7449 dnl = Enable NFC Interface for B2G (Gonk usually) |
|
7450 dnl ======================================================== |
|
7451 MOZ_ARG_ENABLE_BOOL(nfc, |
|
7452 [ --enable-nfc Set compile flags necessary for compiling NFC API ], |
|
7453 MOZ_NFC=1, |
|
7454 MOZ_NFC= ) |
|
7455 if test -n "$MOZ_NFC"; then |
|
7456 AC_DEFINE(MOZ_NFC) |
|
7457 fi |
|
7458 AC_SUBST(MOZ_NFC) |
|
7459 |
|
7460 dnl ======================================================== |
|
7461 dnl = Enable Pico Speech Synthesis (Gonk usually) |
|
7462 dnl ======================================================== |
|
7463 MOZ_ARG_ENABLE_BOOL(synth-pico, |
|
7464 [ --enable-synth-pico Set compile flags necessary for compiling Pico Web Speech API ], |
|
7465 MOZ_SYNTH_PICO=1, |
|
7466 MOZ_SYNTH_PICO= ) |
|
7467 if test -n "$MOZ_SYNTH_PICO"; then |
|
7468 AC_DEFINE(MOZ_SYNTH_PICO) |
|
7469 fi |
|
7470 AC_SUBST(MOZ_SYNTH_PICO) |
|
7471 |
|
7472 dnl ======================================================== |
|
7473 dnl = Enable Support for Time Manager API |
|
7474 dnl ======================================================== |
|
7475 if test -n "$MOZ_TIME_MANAGER"; then |
|
7476 AC_DEFINE(MOZ_TIME_MANAGER) |
|
7477 fi |
|
7478 AC_SUBST(MOZ_TIME_MANAGER) |
|
7479 |
|
7480 dnl ======================================================== |
|
7481 dnl = Enable Camera Interface for B2G (Gonk usually) |
|
7482 dnl ======================================================== |
|
7483 MOZ_ARG_ENABLE_BOOL(b2g-camera, |
|
7484 [ --enable-b2g-camera Set compile flags necessary for compiling camera API for B2G ], |
|
7485 MOZ_B2G_CAMERA=1, |
|
7486 MOZ_B2G_CAMERA= ) |
|
7487 if test -n "$MOZ_B2G_CAMERA"; then |
|
7488 AC_DEFINE(MOZ_B2G_CAMERA) |
|
7489 fi |
|
7490 AC_SUBST(MOZ_B2G_CAMERA) |
|
7491 |
|
7492 dnl ======================================================== |
|
7493 dnl = Enable Support B2G-specific changes to the NSS |
|
7494 dnl = certificate trust database. |
|
7495 dnl ======================================================== |
|
7496 if test -n "$MOZ_B2G_CERTDATA"; then |
|
7497 AC_DEFINE(MOZ_B2G_CERTDATA) |
|
7498 fi |
|
7499 AC_SUBST(MOZ_B2G_CERTDATA) |
|
7500 |
|
7501 dnl ======================================================== |
|
7502 dnl = Enable Support for Payment API |
|
7503 dnl ======================================================== |
|
7504 if test -n "$MOZ_PAY"; then |
|
7505 AC_DEFINE(MOZ_PAY) |
|
7506 fi |
|
7507 AC_SUBST(MOZ_PAY) |
|
7508 |
|
7509 dnl ======================================================== |
|
7510 dnl = Enable Browser Support for Activities |
|
7511 dnl ======================================================== |
|
7512 if test -n "$MOZ_ACTIVITIES"; then |
|
7513 AC_DEFINE(MOZ_ACTIVITIES) |
|
7514 fi |
|
7515 AC_SUBST(MOZ_ACTIVITIES) |
|
7516 |
|
7517 dnl ======================================================== |
|
7518 dnl = Enable Support for AudioChannelManager API |
|
7519 dnl ======================================================== |
|
7520 if test -n "$MOZ_AUDIO_CHANNEL_MANAGER"; then |
|
7521 AC_DEFINE(MOZ_AUDIO_CHANNEL_MANAGER) |
|
7522 fi |
|
7523 AC_SUBST(MOZ_AUDIO_CHANNEL_MANAGER) |
|
7524 |
|
7525 dnl ======================================================== |
|
7526 dnl = Enable Support for Firefox Accounts (services/fxaccounts) |
|
7527 dnl ======================================================== |
|
7528 if test -n "$MOZ_SERVICES_FXACCOUNTS"; then |
|
7529 AC_DEFINE(MOZ_SERVICES_FXACCOUNTS) |
|
7530 fi |
|
7531 AC_SUBST(MOZ_SERVICES_FXACCOUNTS) |
|
7532 |
|
7533 dnl ======================================================== |
|
7534 dnl = Support for demangling undefined symbols |
|
7535 dnl ======================================================== |
|
7536 if test -z "$SKIP_LIBRARY_CHECKS"; then |
|
7537 AC_LANG_SAVE |
|
7538 AC_LANG_CPLUSPLUS |
|
7539 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=) |
|
7540 AC_LANG_RESTORE |
|
7541 fi |
|
7542 |
|
7543 # Demangle only for debug or trace-malloc or DMD builds |
|
7544 MOZ_DEMANGLE_SYMBOLS= |
|
7545 if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC" -o "$MOZ_DMD"; then |
|
7546 MOZ_DEMANGLE_SYMBOLS=1 |
|
7547 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS) |
|
7548 fi |
|
7549 AC_SUBST(MOZ_DEMANGLE_SYMBOLS) |
|
7550 |
|
7551 dnl ======================================================== |
|
7552 dnl = Support for gcc stack unwinding (from gcc 3.3) |
|
7553 dnl ======================================================== |
|
7554 if test -z "$SKIP_LIBRARY_CHECKS"; then |
|
7555 AC_LANG_SAVE |
|
7556 AC_LANG_CPLUSPLUS |
|
7557 MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace)) |
|
7558 AC_LANG_RESTORE |
|
7559 fi |
|
7560 |
|
7561 dnl ======================================================== |
|
7562 dnl JIT observers |
|
7563 dnl ======================================================== |
|
7564 |
|
7565 MOZ_ARG_WITH_STRING(jitreport-granularity, |
|
7566 [ --jitreport-granularity=N |
|
7567 Default granularity at which to report JIT code |
|
7568 to external tools |
|
7569 0 - no info |
|
7570 1 - code ranges for whole functions only |
|
7571 2 - per-line information |
|
7572 3 - per-op information], |
|
7573 JITREPORT_GRANULARITY=$withval, |
|
7574 JITREPORT_GRANULARITY=3) |
|
7575 |
|
7576 AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY) |
|
7577 |
|
7578 dnl ======================================================== |
|
7579 dnl = |
|
7580 dnl = Misc. Options |
|
7581 dnl = |
|
7582 dnl ======================================================== |
|
7583 MOZ_ARG_HEADER(Misc. Options) |
|
7584 |
|
7585 dnl ======================================================== |
|
7586 dnl update xterm title |
|
7587 dnl ======================================================== |
|
7588 MOZ_ARG_ENABLE_BOOL(xterm-updates, |
|
7589 [ --enable-xterm-updates Update XTERM titles with current command.], |
|
7590 MOZ_UPDATE_XTERM=1, |
|
7591 MOZ_UPDATE_XTERM= ) |
|
7592 |
|
7593 dnl ========================================================= |
|
7594 dnl = Chrome format |
|
7595 dnl ========================================================= |
|
7596 MOZ_ARG_ENABLE_STRING([chrome-format], |
|
7597 [ --enable-chrome-format=jar|flat|omni |
|
7598 Select FORMAT of chrome files during packaging], |
|
7599 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`) |
|
7600 |
|
7601 if test -z "$MOZ_CHROME_FILE_FORMAT"; then |
|
7602 MOZ_CHROME_FILE_FORMAT=jar |
|
7603 fi |
|
7604 |
|
7605 if test "$MOZ_CHROME_FILE_FORMAT" = "symlink"; then |
|
7606 AC_MSG_ERROR([--enable-chrome-format=symlink has been deprecated. It is now used by default in $DIST/bin on platforms that support it]) |
|
7607 fi |
|
7608 |
|
7609 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" && |
|
7610 test "$MOZ_CHROME_FILE_FORMAT" != "flat" && |
|
7611 test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then |
|
7612 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, or omni]) |
|
7613 fi |
|
7614 |
|
7615 dnl ========================================================= |
|
7616 dnl Omnijar packaging (bug 552121) |
|
7617 dnl ========================================================= |
|
7618 dnl Omnijar packaging is compatible with flat packaging. |
|
7619 dnl In unpackaged builds, omnijar looks for files as if |
|
7620 dnl things were flat packaged. After packaging, all files |
|
7621 dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT |
|
7622 dnl is set to flat since putting files into jars is only |
|
7623 dnl done during packaging with omnijar. |
|
7624 if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then |
|
7625 MOZ_OMNIJAR=1 |
|
7626 AC_DEFINE(MOZ_OMNIJAR) |
|
7627 fi |
|
7628 MOZ_PACKAGER_FORMAT="$MOZ_CHROME_FILE_FORMAT" |
|
7629 if test "$OS_ARCH" = "WINNT" -o "$MOZ_WIDGET_TOOLKIT" = "android"; then |
|
7630 MOZ_CHROME_FILE_FORMAT=flat |
|
7631 else |
|
7632 MOZ_CHROME_FILE_FORMAT=symlink |
|
7633 fi |
|
7634 |
|
7635 if test "$MOZ_WIDGET_TOOLKIT" = "android"; then |
|
7636 dnl Fennec's static resources live in the assets/ folder of the |
|
7637 dnl APK. Adding a path to the name here works because we only |
|
7638 dnl have one omnijar file in the final package (which is not the |
|
7639 dnl case on desktop), and necessitates some contortions during |
|
7640 dnl packaging so that the resources in the omnijar are considered |
|
7641 dnl as rooted at / and not as rooted at assets/ (which again is |
|
7642 dnl not the case on desktop: there are omnijars rooted at webrtc/, |
|
7643 dnl etc). packager.mk handles changing the rooting of the single |
|
7644 dnl omnijar. |
|
7645 OMNIJAR_NAME=assets/omni.ja |
|
7646 else |
|
7647 OMNIJAR_NAME=omni.ja |
|
7648 fi |
|
7649 |
|
7650 AC_SUBST(OMNIJAR_NAME) |
|
7651 AC_SUBST(MOZ_OMNIJAR) |
|
7652 AC_SUBST(MOZ_PACKAGER_FORMAT) |
|
7653 |
|
7654 dnl ======================================================== |
|
7655 dnl = Define default location for MOZILLA_FIVE_HOME |
|
7656 dnl ======================================================== |
|
7657 MOZ_ARG_WITH_STRING(default-mozilla-five-home, |
|
7658 [ --with-default-mozilla-five-home |
|
7659 Set the default value for MOZILLA_FIVE_HOME], |
|
7660 [ val=`echo $withval` |
|
7661 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ]) |
|
7662 |
|
7663 dnl ======================================================== |
|
7664 dnl = Location of the mozilla user directory (default is ~/.mozilla).], |
|
7665 dnl ======================================================== |
|
7666 MOZ_ARG_WITH_STRING(user-appdir, |
|
7667 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)], |
|
7668 [ val=`echo $withval` |
|
7669 if echo "$val" | grep "\/" >/dev/null; then |
|
7670 AC_MSG_ERROR("Homedir must be single relative path.") |
|
7671 else |
|
7672 MOZ_USER_DIR="$val" |
|
7673 fi]) |
|
7674 |
|
7675 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR") |
|
7676 |
|
7677 dnl ======================================================== |
|
7678 dnl = Doxygen configuration |
|
7679 dnl ======================================================== |
|
7680 dnl Use commas to specify multiple dirs to this arg |
|
7681 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl' |
|
7682 MOZ_ARG_WITH_STRING(doc-input-dirs, |
|
7683 [ --with-doc-input-dirs=DIRS |
|
7684 Header/idl dirs to create docs from], |
|
7685 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] ) |
|
7686 AC_SUBST(MOZ_DOC_INPUT_DIRS) |
|
7687 |
|
7688 dnl Use commas to specify multiple dirs to this arg |
|
7689 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr' |
|
7690 MOZ_ARG_WITH_STRING(doc-include-dirs, |
|
7691 [ --with-doc-include-dirs=DIRS |
|
7692 Include dirs to preprocess doc headers], |
|
7693 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] ) |
|
7694 AC_SUBST(MOZ_DOC_INCLUDE_DIRS) |
|
7695 |
|
7696 MOZ_DOC_OUTPUT_DIR='./dist/docs' |
|
7697 MOZ_ARG_WITH_STRING(doc-output-dir, |
|
7698 [ --with-doc-output-dir=DIR |
|
7699 Dir to generate docs into], |
|
7700 [ MOZ_DOC_OUTPUT_DIR=$withval ] ) |
|
7701 AC_SUBST(MOZ_DOC_OUTPUT_DIR) |
|
7702 |
|
7703 if test -z "$SKIP_COMPILER_CHECKS"; then |
|
7704 dnl ======================================================== |
|
7705 dnl = |
|
7706 dnl = Compiler Options |
|
7707 dnl = |
|
7708 dnl ======================================================== |
|
7709 MOZ_ARG_HEADER(Compiler Options) |
|
7710 |
|
7711 dnl ======================================================== |
|
7712 dnl Check for gcc -pipe support |
|
7713 dnl ======================================================== |
|
7714 AC_MSG_CHECKING([for -pipe support]) |
|
7715 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then |
|
7716 dnl Any gcc that supports firefox supports -pipe. |
|
7717 CFLAGS="$CFLAGS -pipe" |
|
7718 CXXFLAGS="$CXXFLAGS -pipe" |
|
7719 AC_MSG_RESULT([yes]) |
|
7720 else |
|
7721 AC_MSG_RESULT([no]) |
|
7722 fi |
|
7723 |
|
7724 dnl ======================================================== |
|
7725 dnl Profile guided optimization (gcc checks) |
|
7726 dnl ======================================================== |
|
7727 dnl Test for profiling options |
|
7728 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use |
|
7729 |
|
7730 _SAVE_CFLAGS="$CFLAGS" |
|
7731 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" |
|
7732 |
|
7733 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate]) |
|
7734 AC_TRY_COMPILE([], [return 0;], |
|
7735 [ PROFILE_GEN_CFLAGS="-fprofile-generate" |
|
7736 result="yes" ], result="no") |
|
7737 AC_MSG_RESULT([$result]) |
|
7738 |
|
7739 if test $result = "yes"; then |
|
7740 PROFILE_GEN_LDFLAGS="-fprofile-generate" |
|
7741 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" |
|
7742 PROFILE_USE_LDFLAGS="-fprofile-use" |
|
7743 fi |
|
7744 |
|
7745 CFLAGS="$_SAVE_CFLAGS" |
|
7746 |
|
7747 if test -n "$INTEL_CC"; then |
|
7748 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ." |
|
7749 PROFILE_GEN_LDFLAGS= |
|
7750 PROFILE_USE_CFLAGS="-prof-use -prof-dir ." |
|
7751 PROFILE_USE_LDFLAGS= |
|
7752 fi |
|
7753 |
|
7754 dnl Sun Studio on Solaris |
|
7755 if test "$SOLARIS_SUNPRO_CC"; then |
|
7756 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application" |
|
7757 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application" |
|
7758 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application" |
|
7759 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application" |
|
7760 fi |
|
7761 |
|
7762 AC_SUBST(PROFILE_GEN_CFLAGS) |
|
7763 AC_SUBST(PROFILE_GEN_LDFLAGS) |
|
7764 AC_SUBST(PROFILE_USE_CFLAGS) |
|
7765 AC_SUBST(PROFILE_USE_LDFLAGS) |
|
7766 |
|
7767 AC_LANG_CPLUSPLUS |
|
7768 |
|
7769 dnl ======================================================== |
|
7770 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't |
|
7771 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to |
|
7772 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.) |
|
7773 dnl ======================================================== |
|
7774 _SAVE_CXXFLAGS=$CXXFLAGS |
|
7775 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}" |
|
7776 AC_CACHE_CHECK(for correct overload resolution with const and templates, |
|
7777 ac_nscap_nonconst_opeq_bug, |
|
7778 [AC_TRY_COMPILE([ |
|
7779 template <class T> |
|
7780 class Pointer |
|
7781 { |
|
7782 public: |
|
7783 T* myPtr; |
|
7784 }; |
|
7785 |
|
7786 template <class T, class U> |
|
7787 int operator==(const Pointer<T>& rhs, U* lhs) |
|
7788 { |
|
7789 return rhs.myPtr == lhs; |
|
7790 } |
|
7791 |
|
7792 template <class T, class U> |
|
7793 int operator==(const Pointer<T>& rhs, const U* lhs) |
|
7794 { |
|
7795 return rhs.myPtr == lhs; |
|
7796 } |
|
7797 ], |
|
7798 [ |
|
7799 Pointer<int> foo; |
|
7800 const int* bar; |
|
7801 return foo == bar; |
|
7802 ], |
|
7803 ac_nscap_nonconst_opeq_bug="no", |
|
7804 ac_nscap_nonconst_opeq_bug="yes")]) |
|
7805 CXXFLAGS="$_SAVE_CXXFLAGS" |
|
7806 |
|
7807 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then |
|
7808 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ) |
|
7809 fi |
|
7810 fi # ! SKIP_COMPILER_CHECKS |
|
7811 |
|
7812 AC_DEFINE(CPP_THROW_NEW, [throw()]) |
|
7813 AC_LANG_C |
|
7814 |
|
7815 if test "$COMPILE_ENVIRONMENT"; then |
|
7816 MOZ_EXPAND_LIBS |
|
7817 fi # COMPILE_ENVIRONMENT |
|
7818 |
|
7819 dnl ======================================================== |
|
7820 dnl = |
|
7821 dnl = Build depencency options |
|
7822 dnl = |
|
7823 dnl ======================================================== |
|
7824 MOZ_ARG_HEADER(Build dependencies) |
|
7825 |
|
7826 if test "$GNU_CC" -a "$GNU_CXX"; then |
|
7827 _DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp' |
|
7828 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk |
|
7829 elif test "$SOLARIS_SUNPRO_CC"; then |
|
7830 _DEPEND_CFLAGS= |
|
7831 else |
|
7832 dnl Don't override this for MSVC |
|
7833 if test -z "$_WIN32_MSVC"; then |
|
7834 _USE_CPP_INCLUDE_FLAG= |
|
7835 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT' |
|
7836 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT' |
|
7837 else |
|
7838 echo '#include <stdio.h>' > dummy-hello.c |
|
7839 changequote(,) |
|
7840 dnl This output is localized, split at the first double space or colon and space. |
|
7841 _CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*stdio.h\)$" |
|
7842 CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'` |
|
7843 _CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'` |
|
7844 changequote([,]) |
|
7845 if ! test -e "$_CL_STDIO_PATH"; then |
|
7846 AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.]) |
|
7847 fi |
|
7848 if test -z "$CL_INCLUDES_PREFIX"; then |
|
7849 AC_MSG_ERROR([Cannot find cl -showIncludes prefix.]) |
|
7850 fi |
|
7851 AC_SUBST(CL_INCLUDES_PREFIX) |
|
7852 rm -f dummy-hello.c |
|
7853 |
|
7854 dnl Make sure that the build system can handle non-ASCII characters |
|
7855 dnl in environment variables to prevent it from breaking silently on |
|
7856 dnl non-English systems. |
|
7857 NONASCII=$'\241\241' |
|
7858 AC_SUBST(NONASCII) |
|
7859 fi |
|
7860 fi |
|
7861 |
|
7862 dnl ======================================================== |
|
7863 dnl = |
|
7864 dnl = Static Build Options |
|
7865 dnl = |
|
7866 dnl ======================================================== |
|
7867 MOZ_ARG_HEADER(Static build options) |
|
7868 |
|
7869 AC_SUBST(LIBXUL_LIBS) |
|
7870 XPCOM_LIBS="$LIBXUL_LIBS" |
|
7871 |
|
7872 if test "$OS_ARCH" = "WINNT"; then |
|
7873 GKMEDIAS_SHARED_LIBRARY=1 |
|
7874 AC_DEFINE(GKMEDIAS_SHARED_LIBRARY) |
|
7875 fi |
|
7876 AC_SUBST(GKMEDIAS_SHARED_LIBRARY) |
|
7877 |
|
7878 if test -z "$MOZ_NATIVE_ZLIB"; then |
|
7879 if test -n "$JS_SHARED_LIBRARY" -o "$GKMEDIAS_SHARED_LIBRARY"; then |
|
7880 ZLIB_IN_MOZGLUE=1 |
|
7881 AC_DEFINE(ZLIB_IN_MOZGLUE) |
|
7882 fi |
|
7883 fi |
|
7884 |
|
7885 AC_SUBST(ZLIB_IN_MOZGLUE) |
|
7886 |
|
7887 dnl ======================================================== |
|
7888 dnl = |
|
7889 dnl = Standalone module options |
|
7890 dnl = |
|
7891 dnl ======================================================== |
|
7892 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla)) |
|
7893 |
|
7894 dnl Check for GLib. |
|
7895 dnl ======================================================== |
|
7896 |
|
7897 if test -z "$SKIP_PATH_CHECKS"; then |
|
7898 if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then |
|
7899 if test "$MOZ_ENABLE_GTK" ; then |
|
7900 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0) |
|
7901 fi |
|
7902 fi |
|
7903 fi |
|
7904 |
|
7905 if test -z "${GLIB_GMODULE_LIBS}" \ |
|
7906 -a -n "${GLIB_CONFIG}"\ |
|
7907 -a "${GLIB_CONFIG}" != no\ |
|
7908 ; then |
|
7909 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs` |
|
7910 fi |
|
7911 |
|
7912 AC_SUBST(GLIB_CFLAGS) |
|
7913 AC_SUBST(GLIB_LIBS) |
|
7914 AC_SUBST(GLIB_GMODULE_LIBS) |
|
7915 |
|
7916 dnl ======================================================== |
|
7917 dnl Graphics checks. |
|
7918 dnl ======================================================== |
|
7919 |
|
7920 if test "${OS_TARGET}" = "WINNT"; then |
|
7921 if $PERL -e "exit($MOZ_WINSDK_MAXVER < 0x06020000)"; then |
|
7922 MOZ_ENABLE_DIRECT2D1_1=1 |
|
7923 AC_SUBST(MOZ_ENABLE_DIRECT2D1_1) |
|
7924 fi |
|
7925 fi |
|
7926 |
|
7927 if test "${OS_TARGET}" = "WINNT" -o \ |
|
7928 "${OS_ARCH}" = "Darwin" -o \ |
|
7929 "${MOZ_WIDGET_TOOLKIT}" = "android" -o \ |
|
7930 "${MOZ_WIDGET_TOOLKIT}" = "gonk" -o \ |
|
7931 "${MOZ_WIDGET_TOOLKIT}" = "gtk2" -o \ |
|
7932 "${MOZ_WIDGET_TOOLKIT}" = "gtk3"; then |
|
7933 case "${target_cpu}" in |
|
7934 i*86*|x86_64|arm) |
|
7935 MOZ_ENABLE_SKIA=1 |
|
7936 ;; |
|
7937 *) |
|
7938 MOZ_ENABLE_SKIA= |
|
7939 ;; |
|
7940 esac |
|
7941 else |
|
7942 MOZ_ENABLE_SKIA= |
|
7943 fi |
|
7944 |
|
7945 MOZ_ARG_ENABLE_BOOL(skia, |
|
7946 [ --enable-skia Enable use of Skia], |
|
7947 MOZ_ENABLE_SKIA=1, |
|
7948 MOZ_ENABLE_SKIA=) |
|
7949 |
|
7950 if test "$USE_FC_FREETYPE"; then |
|
7951 if test "$COMPILE_ENVIRONMENT"; then |
|
7952 dnl ======================================================== |
|
7953 dnl = Check for freetype2 and its functionality |
|
7954 dnl ======================================================== |
|
7955 PKG_CHECK_MODULES(FT2, freetype2 >= 6.1.0, _HAVE_FREETYPE2=1, _HAVE_FREETYPE2=) |
|
7956 |
|
7957 if test "$_HAVE_FREETYPE2"; then |
|
7958 _SAVE_LIBS="$LIBS" |
|
7959 _SAVE_CFLAGS="$CFLAGS" |
|
7960 LIBS="$LIBS $FT2_LIBS" |
|
7961 CFLAGS="$CFLAGS $FT2_CFLAGS" |
|
7962 |
|
7963 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem, |
|
7964 ac_cv_member_FT_Bitmap_Size_y_ppem, |
|
7965 [AC_TRY_COMPILE([#include <ft2build.h> |
|
7966 #include FT_FREETYPE_H], |
|
7967 [FT_Bitmap_Size s; |
|
7968 if (sizeof s.y_ppem) return 0; |
|
7969 return 1], |
|
7970 ac_cv_member_FT_Bitmap_Size_y_ppem=yes, |
|
7971 ac_cv_member_FT_Bitmap_Size_y_ppem=no)]) |
|
7972 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then |
|
7973 HAVE_FT_BITMAP_SIZE_Y_PPEM=1 |
|
7974 else |
|
7975 HAVE_FT_BITMAP_SIZE_Y_PPEM=0 |
|
7976 fi |
|
7977 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM, |
|
7978 $HAVE_FT_BITMAP_SIZE_Y_PPEM, |
|
7979 [FT_Bitmap_Size structure includes y_ppem field]) |
|
7980 |
|
7981 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table) |
|
7982 |
|
7983 LIBS="$_SAVE_LIBS" |
|
7984 CFLAGS="$_SAVE_CFLAGS" |
|
7985 fi |
|
7986 |
|
7987 _SAVE_CPPFLAGS="$CPPFLAGS" |
|
7988 CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS" |
|
7989 MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], , |
|
7990 [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>]) |
|
7991 CPPFLAGS="$_SAVE_CPPFLAGS" |
|
7992 else |
|
7993 AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H) |
|
7994 fi |
|
7995 |
|
7996 PKG_CHECK_MODULES(_FONTCONFIG, fontconfig, |
|
7997 [ |
|
7998 if test "$MOZ_PANGO"; then |
|
7999 MOZ_PANGO_CFLAGS="$MOZ_PANGO_CFLAGS $_FONTCONFIG_CFLAGS" |
|
8000 MOZ_PANGO_LIBS="$MOZ_PANGO_LIBS $_FONTCONFIG_LIBS" |
|
8001 else |
|
8002 FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS" |
|
8003 FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS" |
|
8004 fi |
|
8005 ]) |
|
8006 fi |
|
8007 |
|
8008 dnl ======================================================== |
|
8009 dnl Check for pixman and cairo |
|
8010 dnl ======================================================== |
|
8011 |
|
8012 if test "$MOZ_WIDGET_TOOLKIT" = "gtk3" ; then |
|
8013 # cairo-gtk3 can be build with system-cairo only |
|
8014 MOZ_TREE_CAIRO= |
|
8015 else |
|
8016 MOZ_TREE_CAIRO=1 |
|
8017 fi |
|
8018 |
|
8019 MOZ_ARG_ENABLE_BOOL(system-cairo, |
|
8020 [ --enable-system-cairo Use system cairo (located with pkgconfig)], |
|
8021 MOZ_TREE_CAIRO=, |
|
8022 MOZ_TREE_CAIRO=1 ) |
|
8023 |
|
8024 MOZ_TREE_PIXMAN=1 |
|
8025 MOZ_ARG_ENABLE_BOOL(system-pixman, |
|
8026 [ --enable-system-pixman Use system pixman (located with pkgconfig)], |
|
8027 MOZ_TREE_PIXMAN=, |
|
8028 MOZ_TREE_PIXMAN=force, |
|
8029 MOZ_TREE_PIXMAN=1 ) |
|
8030 |
|
8031 # System cairo depends on system pixman |
|
8032 if test "$MOZ_TREE_PIXMAN" = "force"; then |
|
8033 if test -z "$MOZ_TREE_CAIRO"; then |
|
8034 AC_MSG_ERROR([--disable-system-pixman is incompatible with --enable-system-cairo.]) |
|
8035 else |
|
8036 MOZ_TREE_PIXMAN=1 |
|
8037 fi |
|
8038 elif test -z "$MOZ_TREE_CAIRO"; then |
|
8039 MOZ_TREE_PIXMAN= |
|
8040 fi |
|
8041 |
|
8042 if test "$MOZ_TREE_PIXMAN"; then |
|
8043 AC_DEFINE(MOZ_TREE_PIXMAN) |
|
8044 MOZ_PIXMAN_CFLAGS="" |
|
8045 MOZ_PIXMAN_LIBS='$(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)' |
|
8046 else |
|
8047 PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2) |
|
8048 MOZ_PIXMAN_CFLAGS="$PIXMAN_CFLAGS" |
|
8049 MOZ_PIXMAN_LIBS="$PIXMAN_LIBS" |
|
8050 fi |
|
8051 AC_SUBST(MOZ_PIXMAN_CFLAGS) |
|
8052 AC_SUBST(MOZ_PIXMAN_LIBS) |
|
8053 |
|
8054 # Check for headers defining standard int types. |
|
8055 if test -n "$COMPILE_ENVIRONMENT"; then |
|
8056 MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h) |
|
8057 fi |
|
8058 |
|
8059 if test "$MOZ_TREE_CAIRO"; then |
|
8060 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo' |
|
8061 AC_DEFINE(MOZ_TREE_CAIRO) |
|
8062 |
|
8063 if test "$OS_ARCH" = "WINNT"; then |
|
8064 # For now we assume that we will have a uint64_t available through |
|
8065 # one of the above headers or mozstdint.h. |
|
8066 AC_DEFINE(HAVE_UINT64_T) |
|
8067 fi |
|
8068 |
|
8069 # Define macros for cairo-features.h |
|
8070 TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1" |
|
8071 if test "$MOZ_X11"; then |
|
8072 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1" |
|
8073 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1" |
|
8074 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1" |
|
8075 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" |
|
8076 MOZ_ENABLE_CAIRO_FT=1 |
|
8077 CAIRO_FT_CFLAGS="$FT2_CFLAGS" |
|
8078 fi |
|
8079 case "$MOZ_WIDGET_TOOLKIT" in |
|
8080 qt) |
|
8081 QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1" |
|
8082 ;; |
|
8083 cocoa | uikit) |
|
8084 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1" |
|
8085 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1" |
|
8086 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1" |
|
8087 ;; |
|
8088 windows) |
|
8089 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1" |
|
8090 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1" |
|
8091 if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then |
|
8092 WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1" |
|
8093 WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1" |
|
8094 MOZ_ENABLE_D2D_SURFACE=1 |
|
8095 MOZ_ENABLE_DWRITE_FONT=1 |
|
8096 else |
|
8097 WIN32_DWRITE_FONT_FEATURE= |
|
8098 WIN32_D2D_SURFACE_FEATURE= |
|
8099 fi |
|
8100 |
|
8101 MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1) |
|
8102 |
|
8103 dnl D3D10 Layers depend on D2D Surfaces. |
|
8104 if test -n "$WIN32_D2D_SURFACE_FEATURE"; then |
|
8105 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1) |
|
8106 fi |
|
8107 ;; |
|
8108 gtk3) |
|
8109 AC_MSG_ERROR([cairo-gtk3 toolkit is incompatible with in-tree cairo. Please add --enable-system-cairo to your build config.]) |
|
8110 ;; |
|
8111 esac |
|
8112 if test "$USE_FC_FREETYPE"; then |
|
8113 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1" |
|
8114 fi |
|
8115 AC_SUBST(MOZ_ENABLE_CAIRO_FT) |
|
8116 AC_SUBST(MOZ_ENABLE_DWRITE_FONT) |
|
8117 AC_SUBST(MOZ_ENABLE_D2D_SURFACE) |
|
8118 AC_SUBST(MOZ_ENABLE_D3D9_LAYER) |
|
8119 AC_SUBST(MOZ_ENABLE_D3D10_LAYER) |
|
8120 AC_SUBST(CAIRO_FT_CFLAGS) |
|
8121 |
|
8122 AC_SUBST(PS_SURFACE_FEATURE) |
|
8123 AC_SUBST(PDF_SURFACE_FEATURE) |
|
8124 AC_SUBST(SVG_SURFACE_FEATURE) |
|
8125 AC_SUBST(XLIB_SURFACE_FEATURE) |
|
8126 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE) |
|
8127 AC_SUBST(QUARTZ_SURFACE_FEATURE) |
|
8128 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE) |
|
8129 AC_SUBST(WIN32_SURFACE_FEATURE) |
|
8130 AC_SUBST(OS2_SURFACE_FEATURE) |
|
8131 AC_SUBST(DIRECTFB_SURFACE_FEATURE) |
|
8132 AC_SUBST(FT_FONT_FEATURE) |
|
8133 AC_SUBST(FC_FONT_FEATURE) |
|
8134 AC_SUBST(WIN32_FONT_FEATURE) |
|
8135 AC_SUBST(WIN32_DWRITE_FONT_FEATURE) |
|
8136 AC_SUBST(WIN32_D2D_SURFACE_FEATURE) |
|
8137 AC_SUBST(QUARTZ_FONT_FEATURE) |
|
8138 AC_SUBST(PNG_FUNCTIONS_FEATURE) |
|
8139 AC_SUBST(QT_SURFACE_FEATURE) |
|
8140 AC_SUBST(TEE_SURFACE_FEATURE) |
|
8141 |
|
8142 MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}' |
|
8143 |
|
8144 if test "$MOZ_X11"; then |
|
8145 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender" |
|
8146 fi |
|
8147 |
|
8148 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h |
|
8149 else |
|
8150 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION) |
|
8151 MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS" |
|
8152 MOZ_CAIRO_LIBS="$CAIRO_LIBS" |
|
8153 PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION) |
|
8154 if test "$MOZ_X11"; then |
|
8155 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION) |
|
8156 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS" |
|
8157 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_LIBS" |
|
8158 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS" |
|
8159 fi |
|
8160 fi |
|
8161 |
|
8162 AC_SUBST(MOZ_TREE_CAIRO) |
|
8163 AC_SUBST(MOZ_CAIRO_CFLAGS) |
|
8164 AC_SUBST(MOZ_CAIRO_LIBS) |
|
8165 AC_SUBST(MOZ_CAIRO_OSLIBS) |
|
8166 AC_SUBST(MOZ_TREE_PIXMAN) |
|
8167 |
|
8168 dnl ======================================================== |
|
8169 dnl Skia |
|
8170 dnl ======================================================== |
|
8171 if test "$MOZ_ENABLE_SKIA"; then |
|
8172 AC_DEFINE(MOZ_ENABLE_SKIA) |
|
8173 AC_DEFINE(USE_SKIA) |
|
8174 if test "${MOZ_WIDGET_TOOLKIT}" = "android" -o x"$MOZ_WIDGET_TOOLKIT" = x"gonk"; then |
|
8175 AC_DEFINE(SK_BUILD_FOR_ANDROID_NDK) |
|
8176 fi |
|
8177 |
|
8178 if test "${CPU_ARCH}" != "ppc" -a "${CPU_ARCH}" != "ppc64" -a "${CPU_ARCH}" != "sparc" ; then |
|
8179 MOZ_ENABLE_SKIA_GPU=1 |
|
8180 AC_DEFINE(USE_SKIA_GPU) |
|
8181 AC_SUBST(MOZ_ENABLE_SKIA_GPU) |
|
8182 fi |
|
8183 fi |
|
8184 AC_SUBST(MOZ_ENABLE_SKIA) |
|
8185 |
|
8186 dnl ======================================================== |
|
8187 dnl disable xul |
|
8188 dnl ======================================================== |
|
8189 MOZ_ARG_DISABLE_BOOL(xul, |
|
8190 [ --disable-xul Disable XUL], |
|
8191 MOZ_XUL= ) |
|
8192 if test "$MOZ_XUL"; then |
|
8193 AC_DEFINE(MOZ_XUL) |
|
8194 else |
|
8195 dnl remove extensions that require XUL |
|
8196 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'` |
|
8197 fi |
|
8198 |
|
8199 AC_SUBST(MOZ_XUL) |
|
8200 |
|
8201 dnl ======================================================== |
|
8202 dnl disable profile locking |
|
8203 dnl do no use this in applications that can have more than |
|
8204 dnl one process accessing the profile directory. |
|
8205 dnl ======================================================== |
|
8206 MOZ_ARG_DISABLE_BOOL(profilelocking, |
|
8207 [ --disable-profilelocking |
|
8208 Disable profile locking], |
|
8209 MOZ_PROFILELOCKING=, |
|
8210 MOZ_PROFILELOCKING=1 ) |
|
8211 if test "$MOZ_PROFILELOCKING"; then |
|
8212 AC_DEFINE(MOZ_PROFILELOCKING) |
|
8213 fi |
|
8214 |
|
8215 dnl ======================================================== |
|
8216 dnl necko configuration options |
|
8217 dnl ======================================================== |
|
8218 |
|
8219 dnl |
|
8220 dnl option to disable various necko protocols |
|
8221 dnl |
|
8222 MOZ_ARG_ENABLE_STRING(necko-protocols, |
|
8223 [ --enable-necko-protocols[={http,ftp,default,all,none}] |
|
8224 Enable/disable specific protocol handlers], |
|
8225 [ for option in `echo $enableval | sed 's/,/ /g'`; do |
|
8226 if test "$option" = "yes" -o "$option" = "all"; then |
|
8227 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT" |
|
8228 elif test "$option" = "no" -o "$option" = "none"; then |
|
8229 NECKO_PROTOCOLS="" |
|
8230 elif test "$option" = "default"; then |
|
8231 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT" |
|
8232 elif test `echo "$option" | grep -c \^-` != 0; then |
|
8233 option=`echo $option | sed 's/^-//'` |
|
8234 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"` |
|
8235 else |
|
8236 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option" |
|
8237 fi |
|
8238 done], |
|
8239 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT") |
|
8240 dnl Remove dupes |
|
8241 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}` |
|
8242 AC_SUBST_SET(NECKO_PROTOCOLS) |
|
8243 for p in $NECKO_PROTOCOLS; do |
|
8244 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p) |
|
8245 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_PROTOCOL_$p" |
|
8246 done |
|
8247 |
|
8248 dnl |
|
8249 dnl option to disable necko's wifi scanner |
|
8250 dnl |
|
8251 |
|
8252 case "$OS_TARGET" in |
|
8253 Android) |
|
8254 if test -n "$gonkdir"; then |
|
8255 NECKO_WIFI=1 |
|
8256 fi |
|
8257 ;; |
|
8258 Darwin|FreeBSD|SunOS|WINNT) |
|
8259 NECKO_WIFI=1 |
|
8260 ;; |
|
8261 Linux) |
|
8262 NECKO_WIFI=1 |
|
8263 NECKO_WIFI_DBUS=1 |
|
8264 ;; |
|
8265 esac |
|
8266 |
|
8267 MOZ_ARG_DISABLE_BOOL(necko-wifi, |
|
8268 [ --disable-necko-wifi Disable necko wifi scanner], |
|
8269 NECKO_WIFI=, |
|
8270 NECKO_WIFI=1) |
|
8271 |
|
8272 if test "$NECKO_WIFI"; then |
|
8273 if test -z "$MOZ_ENABLE_DBUS" -a -n "$NECKO_WIFI_DBUS"; then |
|
8274 AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi]) |
|
8275 fi |
|
8276 AC_DEFINE(NECKO_WIFI) |
|
8277 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI" |
|
8278 fi |
|
8279 AC_SUBST(NECKO_WIFI) |
|
8280 AC_SUBST(NECKO_WIFI_DBUS) |
|
8281 |
|
8282 dnl |
|
8283 dnl option to disable cookies |
|
8284 dnl |
|
8285 MOZ_ARG_DISABLE_BOOL(cookies, |
|
8286 [ --disable-cookies Disable cookie support], |
|
8287 NECKO_COOKIES=, |
|
8288 NECKO_COOKIES=1) |
|
8289 AC_SUBST(NECKO_COOKIES) |
|
8290 if test "$NECKO_COOKIES"; then |
|
8291 AC_DEFINE(NECKO_COOKIES) |
|
8292 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES" |
|
8293 fi |
|
8294 |
|
8295 dnl |
|
8296 dnl Always build Marionette if not Android or B2G |
|
8297 dnl |
|
8298 if test "$OS_TARGET" != Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then |
|
8299 AC_DEFINE(ENABLE_MARIONETTE) |
|
8300 fi |
|
8301 AC_SUBST(ENABLE_MARIONETTE) |
|
8302 if test "$ENABLE_MARIONETTE"; then |
|
8303 AC_DEFINE(ENABLE_MARIONETTE) |
|
8304 fi |
|
8305 |
|
8306 dnl |
|
8307 dnl Build jsctypes on the platforms we can, unless it's explicitly disabled. |
|
8308 dnl |
|
8309 MOZ_ARG_DISABLE_BOOL(ctypes, |
|
8310 [ --disable-ctypes Disable js-ctypes], |
|
8311 BUILD_CTYPES=, |
|
8312 BUILD_CTYPES=1) |
|
8313 AC_SUBST(BUILD_CTYPES) |
|
8314 if test "$BUILD_CTYPES"; then |
|
8315 AC_DEFINE(BUILD_CTYPES) |
|
8316 fi |
|
8317 |
|
8318 dnl Build Places if required |
|
8319 if test "$MOZ_PLACES"; then |
|
8320 AC_DEFINE(MOZ_PLACES) |
|
8321 fi |
|
8322 |
|
8323 dnl Build SocialAPI if required |
|
8324 if test "$MOZ_SOCIAL"; then |
|
8325 AC_DEFINE(MOZ_SOCIAL) |
|
8326 fi |
|
8327 |
|
8328 dnl Build Common JS modules provided by services. |
|
8329 AC_SUBST(MOZ_SERVICES_COMMON) |
|
8330 if test -n "$MOZ_SERVICES_COMMON"; then |
|
8331 AC_DEFINE(MOZ_SERVICES_COMMON) |
|
8332 fi |
|
8333 |
|
8334 dnl Build Services crypto component (used by Sync) |
|
8335 AC_SUBST(MOZ_SERVICES_CRYPTO) |
|
8336 if test -n "$MOZ_SERVICES_CRYPTO"; then |
|
8337 AC_DEFINE(MOZ_SERVICES_CRYPTO) |
|
8338 fi |
|
8339 |
|
8340 dnl Build Firefox Health Reporter Service |
|
8341 AC_SUBST(MOZ_SERVICES_HEALTHREPORT) |
|
8342 if test -n "$MOZ_SERVICES_HEALTHREPORT"; then |
|
8343 AC_DEFINE(MOZ_SERVICES_HEALTHREPORT) |
|
8344 fi |
|
8345 |
|
8346 dnl Build Services metrics component |
|
8347 AC_SUBST(MOZ_SERVICES_METRICS) |
|
8348 if test -n "$MOZ_SERVICES_METRICS"; then |
|
8349 AC_DEFINE(MOZ_SERVICES_METRICS) |
|
8350 fi |
|
8351 |
|
8352 dnl Build Notifications if required |
|
8353 AC_SUBST(MOZ_SERVICES_NOTIFICATIONS) |
|
8354 if test -n "$MOZ_SERVICES_NOTIFICATIONS"; then |
|
8355 AC_DEFINE(MOZ_SERVICES_NOTIFICATIONS) |
|
8356 fi |
|
8357 |
|
8358 dnl Build Sync Services if required |
|
8359 AC_SUBST(MOZ_SERVICES_SYNC) |
|
8360 if test -n "$MOZ_SERVICES_SYNC"; then |
|
8361 AC_DEFINE(MOZ_SERVICES_SYNC) |
|
8362 fi |
|
8363 |
|
8364 dnl Build Captive Portal Detector if required |
|
8365 AC_SUBST(MOZ_CAPTIVEDETECT) |
|
8366 if test -n "$MOZ_CAPTIVEDETECT"; then |
|
8367 AC_DEFINE(MOZ_CAPTIVEDETECT) |
|
8368 fi |
|
8369 |
|
8370 dnl ======================================================== |
|
8371 if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC" -o "$MOZ_DMD"; then |
|
8372 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS= |
|
8373 fi |
|
8374 |
|
8375 if test "$MOZ_APP_COMPONENT_INCLUDE"; then |
|
8376 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE") |
|
8377 fi |
|
8378 |
|
8379 if test "$MOZ_APP_COMPONENT_MODULES"; then |
|
8380 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_MODULES, $MOZ_APP_COMPONENT_MODULES) |
|
8381 fi |
|
8382 |
|
8383 dnl ======================================================== |
|
8384 dnl = |
|
8385 dnl = Maintainer debug option (no --enable equivalent) |
|
8386 dnl = |
|
8387 dnl ======================================================== |
|
8388 |
|
8389 AC_SUBST(AR) |
|
8390 AC_SUBST(AR_FLAGS) |
|
8391 AC_SUBST(AR_LIST) |
|
8392 AC_SUBST(AR_EXTRACT) |
|
8393 AC_SUBST(AR_DELETE) |
|
8394 AC_SUBST(AS) |
|
8395 AC_SUBST(ASFLAGS) |
|
8396 AC_SUBST(AS_DASH_C_FLAG) |
|
8397 AC_SUBST(LD) |
|
8398 AC_SUBST(RC) |
|
8399 AC_SUBST(RCFLAGS) |
|
8400 AC_SUBST(MC) |
|
8401 AC_SUBST(WINDRES) |
|
8402 AC_SUBST(IMPLIB) |
|
8403 AC_SUBST(FILTER) |
|
8404 AC_SUBST(BIN_FLAGS) |
|
8405 AC_SUBST(MOZ_WIDGET_TOOLKIT) |
|
8406 AC_SUBST(MOZ_UPDATE_XTERM) |
|
8407 AC_SUBST(MOZ_AUTH_EXTENSION) |
|
8408 AC_SUBST(MOZ_PERMISSIONS) |
|
8409 AC_SUBST(MOZ_PREF_EXTENSIONS) |
|
8410 AC_SUBST(MOZ_JS_LIBS) |
|
8411 AC_SUBST(MOZ_DEBUG) |
|
8412 AC_SUBST(MOZ_DEBUG_SYMBOLS) |
|
8413 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS) |
|
8414 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS) |
|
8415 AC_SUBST(MOZ_DEBUG_LDFLAGS) |
|
8416 AC_SUBST(WARNINGS_AS_ERRORS) |
|
8417 AC_SUBST(MOZ_EXTENSIONS) |
|
8418 AC_SUBST(MOZ_JSDEBUGGER) |
|
8419 AC_SUBST(MOZ_ENABLE_PROFILER_SPS) |
|
8420 AC_SUBST(MOZ_JPROF) |
|
8421 AC_SUBST(MOZ_SHARK) |
|
8422 AC_SUBST(MOZ_INSTRUMENTS) |
|
8423 AC_SUBST(MOZ_CALLGRIND) |
|
8424 AC_SUBST(MOZ_VTUNE) |
|
8425 AC_SUBST(MOZ_PROFILING) |
|
8426 AC_SUBST(LIBICONV) |
|
8427 AC_SUBST(MOZ_PLACES) |
|
8428 AC_SUBST(MOZ_SOCIAL) |
|
8429 AC_SUBST(MOZ_TOOLKIT_SEARCH) |
|
8430 AC_SUBST(MOZ_FEEDS) |
|
8431 AC_SUBST(NS_PRINTING) |
|
8432 AC_SUBST(MOZ_WEBGL) |
|
8433 AC_SUBST(MOZ_HELP_VIEWER) |
|
8434 AC_SUBST(TOOLCHAIN_PREFIX) |
|
8435 |
|
8436 AC_SUBST(JAVA) |
|
8437 AC_SUBST(JAVAC) |
|
8438 AC_SUBST(JAVAH) |
|
8439 AC_SUBST(JAR) |
|
8440 AC_SUBST(JARSIGNER) |
|
8441 AC_SUBST(KEYTOOL) |
|
8442 |
|
8443 AC_SUBST(MOZ_PROFILELOCKING) |
|
8444 |
|
8445 AC_SUBST(ENABLE_TESTS) |
|
8446 AC_SUBST(MOZ_UNIVERSALCHARDET) |
|
8447 AC_SUBST(ACCESSIBILITY) |
|
8448 AC_SUBST(MOZ_SPELLCHECK) |
|
8449 AC_SUBST(MOZ_ANDROID_OMTC) |
|
8450 AC_SUBST(MOZ_ANDROID_ANR_REPORTER) |
|
8451 AC_SUBST(MOZ_CRASHREPORTER) |
|
8452 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR) |
|
8453 AC_SUBST(MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS) |
|
8454 AC_SUBST(MOZ_MAINTENANCE_SERVICE) |
|
8455 AC_SUBST(MOZ_STUB_INSTALLER) |
|
8456 AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE) |
|
8457 AC_SUBST(MOZ_ENABLE_SIGNMAR) |
|
8458 AC_SUBST(MOZ_UPDATER) |
|
8459 |
|
8460 AC_SUBST(MOZ_ANGLE_RENDERER) |
|
8461 AC_SUBST(MOZ_DIRECTX_SDK_CPU_SUFFIX) |
|
8462 AC_SUBST(MOZ_DIRECTX_SDK_PATH) |
|
8463 AC_SUBST(MOZ_D3DCOMPILER_DLL) |
|
8464 AC_SUBST(MOZ_HAS_WINSDK_WITH_D3D) |
|
8465 AC_SUBST(MOZ_D3DCOMPILER_DLL_PATH) |
|
8466 AC_SUBST(MOZ_D3DCOMPILER_CAB) |
|
8467 |
|
8468 AC_SUBST(MOZ_METRO) |
|
8469 |
|
8470 AC_SUBST(MOZ_ANDROID_HISTORY) |
|
8471 AC_SUBST(MOZ_WEBSMS_BACKEND) |
|
8472 AC_SUBST(MOZ_ANDROID_BEAM) |
|
8473 AC_SUBST(MOZ_ANDROID_SYNTHAPKS) |
|
8474 AC_SUBST(MOZ_DISABLE_GECKOVIEW) |
|
8475 AC_SUBST(ENABLE_STRIP) |
|
8476 AC_SUBST(PKG_SKIP_STRIP) |
|
8477 AC_SUBST(STRIP_FLAGS) |
|
8478 AC_SUBST(USE_ELF_HACK) |
|
8479 AC_SUBST(INCREMENTAL_LINKER) |
|
8480 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS) |
|
8481 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS) |
|
8482 |
|
8483 AC_SUBST(MOZ_FIX_LINK_PATHS) |
|
8484 AC_SUBST(XPCOM_LIBS) |
|
8485 AC_SUBST(XPCOM_FROZEN_LDOPTS) |
|
8486 AC_SUBST(XPCOM_GLUE_LDOPTS) |
|
8487 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS) |
|
8488 AC_SUBST(XPCOM_STATICRUNTIME_GLUE_LDOPTS) |
|
8489 AC_SUBST(XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS) |
|
8490 |
|
8491 AC_SUBST(USE_DEPENDENT_LIBS) |
|
8492 |
|
8493 AC_SUBST(MOZ_BUILD_ROOT) |
|
8494 |
|
8495 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND) |
|
8496 AC_SUBST(MOZ_POST_PROGRAM_COMMAND) |
|
8497 AC_SUBST(MOZ_LINKER_EXTRACT) |
|
8498 |
|
8499 AC_SUBST(MOZ_JSDOWNLOADS) |
|
8500 if test -n "$MOZ_JSDOWNLOADS"; then |
|
8501 AC_DEFINE(MOZ_JSDOWNLOADS) |
|
8502 fi |
|
8503 |
|
8504 dnl ======================================================== |
|
8505 dnl = Mac bundle name prefix |
|
8506 dnl ======================================================== |
|
8507 MOZ_ARG_WITH_STRING(macbundlename-prefix, |
|
8508 [ --with-macbundlename-prefix=prefix |
|
8509 Prefix for MOZ_MACBUNDLE_NAME], |
|
8510 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"]) |
|
8511 |
|
8512 MOZ_MACBUNDLE_NAME=`echo $MOZ_APP_DISPLAYNAME | tr -d ' '` |
|
8513 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then |
|
8514 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}" |
|
8515 fi |
|
8516 |
|
8517 if test "$MOZ_DEBUG"; then |
|
8518 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}Debug.app |
|
8519 else |
|
8520 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app |
|
8521 fi |
|
8522 AC_SUBST(MOZ_MACBUNDLE_NAME) |
|
8523 |
|
8524 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME) |
|
8525 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr '[A-Z]' '[a-z]'` |
|
8526 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID} |
|
8527 if test "$MOZ_DEBUG"; then |
|
8528 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug |
|
8529 fi |
|
8530 |
|
8531 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID) |
|
8532 AC_SUBST(MOZ_MACBUNDLE_ID) |
|
8533 |
|
8534 dnl ======================================================== |
|
8535 dnl = Child Process Name for IPC |
|
8536 dnl ======================================================== |
|
8537 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then |
|
8538 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}" |
|
8539 else |
|
8540 # We want to let Android unpack the file at install time, but it only does |
|
8541 # so if the file is named libsomething.so. The lib/ path is also required |
|
8542 # because the unpacked file will be under the lib/ subdirectory and will |
|
8543 # need to be executed from that path. |
|
8544 MOZ_CHILD_PROCESS_NAME="lib/libplugin-container.so" |
|
8545 fi |
|
8546 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/" |
|
8547 |
|
8548 AC_SUBST(MOZ_CHILD_PROCESS_NAME) |
|
8549 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE) |
|
8550 |
|
8551 # The following variables are available to branding and application |
|
8552 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh): |
|
8553 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also |
|
8554 # impacts profile location and user-visible fields. |
|
8555 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded |
|
8556 # versions of a given application (e.g. Aurora and Firefox both use |
|
8557 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used |
|
8558 # for application.ini's "Name" field, which controls profile location in |
|
8559 # the absence of a "Profile" field (see below), and various system |
|
8560 # integration hooks (Unix remoting, Windows MessageWindow name, etc.) |
|
8561 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties, |
|
8562 # Mac Bundle name, Updater, Installer), it is typically used for nightly |
|
8563 # builds (e.g. Aurora for Firefox). |
|
8564 # - MOZ_APP_VERSION: Defines the application version number. |
|
8565 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set, |
|
8566 # defaults to a lowercase form of MOZ_APP_BASENAME. |
|
8567 # - MOZ_APP_PROFILE: When set, used for application.ini's |
|
8568 # "Profile" field, which controls profile location. |
|
8569 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and |
|
8570 # crash reporter server url. |
|
8571 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator. |
|
8572 # - MOZ_EXTENSION_MANAGER: When set, enabled extension manager. |
|
8573 |
|
8574 if test -z "$MOZ_APP_NAME"; then |
|
8575 MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z` |
|
8576 fi |
|
8577 |
|
8578 # For extensions and langpacks, we require a max version that is compatible |
|
8579 # across security releases. MOZ_APP_MAXVERSION is our method for doing that. |
|
8580 # 24.0a1 and 24.0a2 aren't affected |
|
8581 # 24.0 becomes 24.* |
|
8582 # 24.1.1 becomes 24.* |
|
8583 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a` |
|
8584 if test -z "$IS_ALPHA"; then |
|
8585 changequote(,) |
|
8586 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.* |
|
8587 changequote([,]) |
|
8588 else |
|
8589 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION |
|
8590 fi |
|
8591 |
|
8592 MOZ_B2G_VERSION=${MOZ_B2G_VERSION:-"1.0.0"} |
|
8593 AC_DEFINE_UNQUOTED(MOZ_B2G_VERSION,"$MOZ_B2G_VERSION") |
|
8594 AC_DEFINE_UNQUOTED(MOZ_B2G_OS_NAME,"$MOZ_B2G_OS_NAME") |
|
8595 |
|
8596 AC_SUBST(MOZ_APP_NAME) |
|
8597 AC_SUBST(MOZ_APP_DISPLAYNAME) |
|
8598 AC_SUBST(MOZ_APP_BASENAME) |
|
8599 AC_SUBST(MOZ_APP_VENDOR) |
|
8600 AC_SUBST(MOZ_APP_PROFILE) |
|
8601 AC_SUBST(MOZ_APP_ID) |
|
8602 AC_SUBST(MAR_CHANNEL_ID) |
|
8603 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS) |
|
8604 AC_SUBST(MOZ_PROFILE_MIGRATOR) |
|
8605 AC_SUBST(MOZ_EXTENSION_MANAGER) |
|
8606 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME") |
|
8607 AC_SUBST(MOZ_APP_UA_NAME) |
|
8608 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION") |
|
8609 AC_SUBST(MOZ_APP_VERSION) |
|
8610 AC_SUBST(MOZ_APP_MAXVERSION) |
|
8611 AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION) |
|
8612 AC_SUBST(FIREFOX_VERSION) |
|
8613 AC_SUBST(MOZ_UA_OS_AGNOSTIC) |
|
8614 if test -n "$MOZ_UA_OS_AGNOSTIC"; then |
|
8615 AC_DEFINE(MOZ_UA_OS_AGNOSTIC) |
|
8616 fi |
|
8617 |
|
8618 AC_SUBST(MOZ_APP_STATIC_INI) |
|
8619 |
|
8620 AC_SUBST(MOZ_PKG_SPECIAL) |
|
8621 |
|
8622 AC_SUBST(MOZILLA_OFFICIAL) |
|
8623 |
|
8624 AC_DEFINE_UNQUOTED(MOZ_TELEMETRY_DISPLAY_REV, 2) |
|
8625 AC_SUBST(MOZ_TELEMETRY_DISPLAY_REV) |
|
8626 |
|
8627 if test "$MOZ_TELEMETRY_REPORTING"; then |
|
8628 AC_DEFINE(MOZ_TELEMETRY_REPORTING) |
|
8629 |
|
8630 # Enable Telemetry by default for nightly and aurora channels |
|
8631 if test -z "$RELEASE_BUILD"; then |
|
8632 AC_DEFINE(MOZ_TELEMETRY_ON_BY_DEFAULT) |
|
8633 fi |
|
8634 fi |
|
8635 |
|
8636 dnl If we have any service that uploads data (and requires data submission |
|
8637 dnl policy alert), set MOZ_DATA_REPORTING. |
|
8638 dnl We need SUBST for build system and DEFINE for xul preprocessor. |
|
8639 if test -n "$MOZ_TELEMETRY_REPORTING" || test -n "$MOZ_SERVICES_HEALTHREPORT" || test -n "$MOZ_CRASHREPORTER"; then |
|
8640 MOZ_DATA_REPORTING=1 |
|
8641 AC_DEFINE(MOZ_DATA_REPORTING) |
|
8642 AC_SUBST(MOZ_DATA_REPORTING) |
|
8643 fi |
|
8644 |
|
8645 dnl win32 options |
|
8646 AC_SUBST(MOZ_BROWSE_INFO) |
|
8647 AC_SUBST(MOZ_TOOLS_DIR) |
|
8648 AC_SUBST(WIN32_REDIST_DIR) |
|
8649 AC_SUBST(MAKENSISU) |
|
8650 |
|
8651 dnl Echo the CFLAGS to remove extra whitespace. |
|
8652 CFLAGS=`echo \ |
|
8653 $_WARNINGS_CFLAGS \ |
|
8654 $CFLAGS` |
|
8655 |
|
8656 CXXFLAGS=`echo \ |
|
8657 $_WARNINGS_CXXFLAGS \ |
|
8658 $CXXFLAGS` |
|
8659 |
|
8660 COMPILE_CFLAGS=`echo \ |
|
8661 $_DEFINES_CFLAGS \ |
|
8662 $_DEPEND_CFLAGS \ |
|
8663 $COMPILE_CFLAGS` |
|
8664 |
|
8665 COMPILE_CXXFLAGS=`echo \ |
|
8666 $_DEFINES_CXXFLAGS \ |
|
8667 $_DEPEND_CFLAGS \ |
|
8668 $COMPILE_CXXFLAGS` |
|
8669 |
|
8670 HOST_CFLAGS=`echo \ |
|
8671 $HOST_CFLAGS \ |
|
8672 $_DEPEND_CFLAGS` |
|
8673 |
|
8674 HOST_CXXFLAGS=`echo \ |
|
8675 $HOST_CXXFLAGS \ |
|
8676 $_DEPEND_CFLAGS` |
|
8677 |
|
8678 AC_SUBST(SYSTEM_LIBXUL) |
|
8679 AC_SUBST(MOZ_NATIVE_JPEG) |
|
8680 AC_SUBST(MOZ_NATIVE_PNG) |
|
8681 AC_SUBST(MOZ_NATIVE_BZ2) |
|
8682 |
|
8683 AC_SUBST(MOZ_JPEG_CFLAGS) |
|
8684 AC_SUBST(MOZ_JPEG_LIBS) |
|
8685 AC_SUBST(MOZ_BZ2_CFLAGS) |
|
8686 AC_SUBST(MOZ_BZ2_LIBS) |
|
8687 AC_SUBST(MOZ_PNG_CFLAGS) |
|
8688 AC_SUBST(MOZ_PNG_LIBS) |
|
8689 |
|
8690 if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then |
|
8691 export MOZ_NUWA_PROCESS |
|
8692 AC_DEFINE(MOZ_NUWA_PROCESS) |
|
8693 fi |
|
8694 AC_SUBST(MOZ_NUWA_PROCESS) |
|
8695 |
|
8696 AC_SUBST(NSPR_CFLAGS) |
|
8697 AC_SUBST(NSPR_LIBS) |
|
8698 AC_SUBST(MOZ_NATIVE_NSPR) |
|
8699 |
|
8700 AC_SUBST(NSS_CFLAGS) |
|
8701 AC_SUBST(NSS_LIBS) |
|
8702 AC_SUBST(MOZ_NATIVE_NSS) |
|
8703 AC_SUBST(NSS_DISABLE_DBM) |
|
8704 |
|
8705 OS_CFLAGS="$CFLAGS" |
|
8706 OS_CXXFLAGS="$CXXFLAGS" |
|
8707 OS_CPPFLAGS="$CPPFLAGS" |
|
8708 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS" |
|
8709 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS" |
|
8710 OS_LDFLAGS="$LDFLAGS" |
|
8711 OS_LIBS="$LIBS" |
|
8712 AC_SUBST(OS_CFLAGS) |
|
8713 AC_SUBST(OS_CXXFLAGS) |
|
8714 AC_SUBST(OS_CPPFLAGS) |
|
8715 AC_SUBST(OS_COMPILE_CFLAGS) |
|
8716 AC_SUBST(OS_COMPILE_CXXFLAGS) |
|
8717 AC_SUBST(OS_LDFLAGS) |
|
8718 AC_SUBST(OS_LIBS) |
|
8719 AC_SUBST(CROSS_COMPILE) |
|
8720 AC_SUBST(WCHAR_CFLAGS) |
|
8721 |
|
8722 AC_SUBST(HOST_CC) |
|
8723 AC_SUBST(HOST_CXX) |
|
8724 AC_SUBST(HOST_CFLAGS) |
|
8725 AC_SUBST(HOST_CXXFLAGS) |
|
8726 AC_SUBST(HOST_LDFLAGS) |
|
8727 AC_SUBST(HOST_OPTIMIZE_FLAGS) |
|
8728 AC_SUBST(HOST_AR) |
|
8729 AC_SUBST(HOST_AR_FLAGS) |
|
8730 AC_SUBST(HOST_LD) |
|
8731 AC_SUBST(HOST_RANLIB) |
|
8732 AC_SUBST(HOST_NSPR_MDCPUCFG) |
|
8733 AC_SUBST(HOST_BIN_SUFFIX) |
|
8734 AC_SUBST(HOST_OS_ARCH) |
|
8735 |
|
8736 AC_SUBST(TARGET_CPU) |
|
8737 AC_SUBST(TARGET_VENDOR) |
|
8738 AC_SUBST(TARGET_OS) |
|
8739 AC_SUBST(TARGET_NSPR_MDCPUCFG) |
|
8740 AC_SUBST(TARGET_MD_ARCH) |
|
8741 AC_SUBST(TARGET_XPCOM_ABI) |
|
8742 AC_SUBST(OS_TARGET) |
|
8743 AC_SUBST(OS_ARCH) |
|
8744 AC_SUBST(OS_RELEASE) |
|
8745 AC_SUBST(OS_TEST) |
|
8746 AC_SUBST(CPU_ARCH) |
|
8747 AC_SUBST(INTEL_ARCHITECTURE) |
|
8748 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3) |
|
8749 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1) |
|
8750 |
|
8751 AC_SUBST(MOZ_CHROME_FILE_FORMAT) |
|
8752 |
|
8753 AC_SUBST(WRAP_LDFLAGS) |
|
8754 AC_SUBST(MKSHLIB) |
|
8755 AC_SUBST(MKCSHLIB) |
|
8756 AC_SUBST(MKSHLIB_FORCE_ALL) |
|
8757 AC_SUBST(MKSHLIB_UNFORCE_ALL) |
|
8758 AC_SUBST(DSO_CFLAGS) |
|
8759 AC_SUBST(DSO_PIC_CFLAGS) |
|
8760 AC_SUBST(DSO_LDOPTS) |
|
8761 AC_SUBST(LIB_PREFIX) |
|
8762 AC_SUBST(DLL_PREFIX) |
|
8763 AC_SUBST(DLL_SUFFIX) |
|
8764 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX") |
|
8765 AC_SUBST(LIB_SUFFIX) |
|
8766 AC_SUBST(OBJ_SUFFIX) |
|
8767 AC_SUBST(BIN_SUFFIX) |
|
8768 AC_SUBST(ASM_SUFFIX) |
|
8769 AC_SUBST(IMPORT_LIB_SUFFIX) |
|
8770 AC_SUBST(USE_N32) |
|
8771 AC_SUBST(CC_VERSION) |
|
8772 AC_SUBST(CXX_VERSION) |
|
8773 AC_SUBST(MSMANIFEST_TOOL) |
|
8774 AC_SUBST(NS_ENABLE_TSF) |
|
8775 AC_SUBST(MOZ_NSS_PATCH) |
|
8776 AC_SUBST(MOZ_APP_COMPONENT_LIBS) |
|
8777 AC_SUBST(MOZ_APP_EXTRA_LIBS) |
|
8778 |
|
8779 AC_SUBST(MOZ_WAVE) |
|
8780 AC_SUBST(MOZ_VORBIS) |
|
8781 AC_SUBST(MOZ_TREMOR) |
|
8782 AC_SUBST(MOZ_OPUS) |
|
8783 AC_SUBST(MOZ_WEBM) |
|
8784 AC_SUBST(MOZ_WMF) |
|
8785 AC_SUBST(MOZ_FFMPEG) |
|
8786 AC_SUBST(MOZ_FMP4) |
|
8787 AC_SUBST(MOZ_DIRECTSHOW) |
|
8788 AC_SUBST(MOZ_MEDIA_PLUGINS) |
|
8789 AC_SUBST(MOZ_APPLEMEDIA) |
|
8790 AC_SUBST(MOZ_OMX_PLUGIN) |
|
8791 AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT) |
|
8792 AC_SUBST(MOZ_VPX) |
|
8793 AC_SUBST(VPX_AS) |
|
8794 AC_SUBST(VPX_ASFLAGS) |
|
8795 AC_SUBST(VPX_DASH_C_FLAG) |
|
8796 AC_SUBST(VPX_AS_CONVERSION) |
|
8797 AC_SUBST(VPX_ASM_SUFFIX) |
|
8798 AC_SUBST(VPX_X86_ASM) |
|
8799 AC_SUBST(VPX_ARM_ASM) |
|
8800 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT) |
|
8801 AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP) |
|
8802 AC_SUBST(LIBJPEG_TURBO_AS) |
|
8803 AC_SUBST(LIBJPEG_TURBO_ASFLAGS) |
|
8804 AC_SUBST(LIBJPEG_TURBO_X86_ASM) |
|
8805 AC_SUBST(LIBJPEG_TURBO_X64_ASM) |
|
8806 AC_SUBST(LIBJPEG_TURBO_ARM_ASM) |
|
8807 |
|
8808 AC_SUBST(MOZ_PACKAGE_JSSHELL) |
|
8809 AC_SUBST(MOZ_FOLD_LIBS) |
|
8810 |
|
8811 AC_SUBST(MOZ_ENABLE_SZIP) |
|
8812 AC_SUBST(MOZ_SZIP_FLAGS) |
|
8813 |
|
8814 if test "$MOZ_DEBUG"; then |
|
8815 MOZ_EM_DEBUG=1 |
|
8816 fi |
|
8817 AC_SUBST(MOZ_EM_DEBUG) |
|
8818 |
|
8819 if test -n "$COMPILE_ENVIRONMENT"; then |
|
8820 AC_CHECK_FUNCS(posix_fadvise posix_fallocate) |
|
8821 |
|
8822 dnl Check for missing components |
|
8823 if test "$MOZ_X11"; then |
|
8824 if test "$WITHOUT_X11"; then |
|
8825 AC_MSG_ERROR([--without-x specified and MOZ_X11 still defined]) |
|
8826 fi |
|
8827 dnl ==================================================== |
|
8828 dnl = Check if X headers exist |
|
8829 dnl ==================================================== |
|
8830 _SAVE_CFLAGS=$CFLAGS |
|
8831 CFLAGS="$CFLAGS $XCFLAGS" |
|
8832 AC_TRY_COMPILE([ |
|
8833 #include <stdio.h> |
|
8834 #include <stdlib.h> |
|
8835 #include <X11/Xlib.h> |
|
8836 #include <X11/Intrinsic.h> |
|
8837 #include <X11/extensions/XShm.h> |
|
8838 ], |
|
8839 [ |
|
8840 Display *dpy = 0; |
|
8841 if ((dpy = XOpenDisplay(NULL)) == NULL) { |
|
8842 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL)); |
|
8843 exit(1); |
|
8844 } |
|
8845 ], [], |
|
8846 [ AC_MSG_ERROR([Can't find X headers (install libxt-dev (Debian/Ubuntu), libXt-devel (Fedora), or xorg-x11-libXt-devel (SuSE)).]) ]) |
|
8847 CFLAGS="$_SAVE_CFLAGS" |
|
8848 |
|
8849 if test -n "$MISSING_X"; then |
|
8850 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]); |
|
8851 fi |
|
8852 |
|
8853 fi # MOZ_X11 |
|
8854 |
|
8855 fi # COMPILE_ENVIRONMENT |
|
8856 |
|
8857 dnl Set various defines and substitutions |
|
8858 dnl ======================================================== |
|
8859 |
|
8860 if test "$OS_ARCH" != "WINNT"; then |
|
8861 AC_DEFINE(XP_UNIX) |
|
8862 fi |
|
8863 |
|
8864 if test "$MOZ_DEBUG"; then |
|
8865 AC_DEFINE(MOZ_REFLOW_PERF) |
|
8866 AC_DEFINE(MOZ_REFLOW_PERF_DSP) |
|
8867 fi |
|
8868 |
|
8869 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then |
|
8870 AC_DEFINE(MOZ_ACCESSIBILITY_ATK) |
|
8871 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk` |
|
8872 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'` |
|
8873 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'` |
|
8874 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'` |
|
8875 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION) |
|
8876 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION) |
|
8877 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION) |
|
8878 fi |
|
8879 |
|
8880 if test "$MOZ_DEBUG"; then |
|
8881 A11Y_LOG=1 |
|
8882 fi |
|
8883 case "$MOZ_UPDATE_CHANNEL" in |
|
8884 aurora|beta|release|esr) |
|
8885 ;; |
|
8886 *) |
|
8887 A11Y_LOG=1 |
|
8888 ;; |
|
8889 esac |
|
8890 AC_SUBST(A11Y_LOG) |
|
8891 if test -n "$A11Y_LOG"; then |
|
8892 AC_DEFINE(A11Y_LOG) |
|
8893 fi |
|
8894 |
|
8895 AC_SUBST(MOZILLA_VERSION) |
|
8896 |
|
8897 AC_SUBST(ac_configure_args) |
|
8898 |
|
8899 dnl Spit out some output |
|
8900 dnl ======================================================== |
|
8901 |
|
8902 dnl The following defines are used by xpcom |
|
8903 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES |
|
8904 CPP_THROW_NEW |
|
8905 HAVE_CPP_AMBIGUITY_RESOLVING_USING |
|
8906 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR |
|
8907 HAVE_CPP_PARTIAL_SPECIALIZATION |
|
8908 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO |
|
8909 NEED_CPP_UNUSED_IMPLEMENTATIONS |
|
8910 HAVE_GETPAGESIZE |
|
8911 HAVE_ICONV |
|
8912 HAVE_ICONV_WITH_CONST_INPUT |
|
8913 HAVE_MBRTOWC |
|
8914 HAVE_WCRTOMB |
|
8915 HAVE_STATVFS64 |
|
8916 HAVE_STATVFS |
|
8917 HAVE_STATFS64 |
|
8918 HAVE_STATFS |
|
8919 HAVE_SYS_STATVFS_H |
|
8920 HAVE_SYS_STATFS_H |
|
8921 HAVE_SYS_VFS_H |
|
8922 HAVE_SYS_MOUNT_H |
|
8923 " |
|
8924 |
|
8925 AC_SUBST(STLPORT_LIBS) |
|
8926 |
|
8927 dnl ======================================================== |
|
8928 dnl ICU Support |
|
8929 dnl ======================================================== |
|
8930 |
|
8931 if test "$MOZ_BUILD_APP" = "browser"; then |
|
8932 _INTL_API=yes |
|
8933 else |
|
8934 # Internationalization isn't built or exposed by default in non-desktop |
|
8935 # builds. Bugs to enable: |
|
8936 # |
|
8937 # Android: bug 864843 |
|
8938 # B2G: bug 866301 |
|
8939 _INTL_API=no |
|
8940 fi |
|
8941 |
|
8942 MOZ_CONFIG_ICU() |
|
8943 |
|
8944 if test -n "$MOZ_NATIVE_ICU"; then |
|
8945 MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS" |
|
8946 fi |
|
8947 |
|
8948 if test -n "$JS_SHARED_LIBRARY"; then |
|
8949 MOZ_JS_LIBS="$MOZ_JS_SHARED_LIBS" |
|
8950 else |
|
8951 MOZ_JS_LIBS="$MOZ_JS_STATIC_LIBS" |
|
8952 AC_DEFINE(MOZ_STATIC_JS) |
|
8953 fi |
|
8954 AC_SUBST(JS_SHARED_LIBRARY) |
|
8955 |
|
8956 MOZ_CREATE_CONFIG_STATUS() |
|
8957 |
|
8958 # No need to run subconfigures when building with LIBXUL_SDK_DIR |
|
8959 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then |
|
8960 MOZ_SUBCONFIGURE_ICU() |
|
8961 MOZ_SUBCONFIGURE_FFI() |
|
8962 fi |
|
8963 |
|
8964 # Hack around an Apple bug that affects the egrep that comes with OS X 10.7. |
|
8965 # "env ARCHPREFERENCE=i386,x86_64 arch egrep" first tries to use the 32-bit |
|
8966 # Intel part of the egrep fat binary, even on 64-bit systems, and falls back on |
|
8967 # the 64-bit part if it's not a fat binary, as can happen with MacPorts. We |
|
8968 # (apparently) only need this hack when egrep's "pattern" is particularly long |
|
8969 # (as in the following code) and the first egrep on our $PATH is Apple's. See |
|
8970 # bug 655339. |
|
8971 case "$host" in |
|
8972 *-apple-darwin11*) |
|
8973 FIXED_EGREP="env ARCHPREFERENCE=i386,x86_64 arch egrep" |
|
8974 ;; |
|
8975 *) |
|
8976 FIXED_EGREP="egrep" |
|
8977 ;; |
|
8978 esac |
|
8979 |
|
8980 # Run jemalloc configure script |
|
8981 |
|
8982 if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_MEMORY" && test -n "$MOZ_JEMALLOC3" -o -n "$MOZ_REPLACE_MALLOC"; then |
|
8983 ac_configure_args="--build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_" |
|
8984 if test -n "$MOZ_REPLACE_MALLOC"; then |
|
8985 # When using replace_malloc, we always want memalign and valloc exported from jemalloc. |
|
8986 ac_configure_args="$ac_configure_args ac_cv_func_memalign=yes" |
|
8987 ac_configure_args="$ac_configure_args ac_cv_func_valloc=yes" |
|
8988 fi |
|
8989 if test -n "$MOZ_JEMALLOC3"; then |
|
8990 case "${OS_ARCH}" in |
|
8991 WINNT|Darwin) |
|
8992 # We want jemalloc functions to be kept hidden on both Mac and Windows |
|
8993 # See memory/build/mozmemory_wrap.h for details. |
|
8994 ac_configure_args="$ac_configure_args --without-export" |
|
8995 ;; |
|
8996 esac |
|
8997 elif test "${OS_ARCH}" = Darwin; then |
|
8998 # When building as a replace-malloc lib, disabling the zone allocator |
|
8999 # forces to use pthread_atfork. |
|
9000 ac_configure_args="$ac_configure_args --disable-zone-allocator" |
|
9001 fi |
|
9002 _MANGLE="malloc posix_memalign aligned_alloc calloc realloc free memalign valloc malloc_usable_size" |
|
9003 JEMALLOC_WRAPPER= |
|
9004 if test -z "$MOZ_REPLACE_MALLOC"; then |
|
9005 case "$OS_ARCH" in |
|
9006 Linux|DragonFly|FreeBSD|NetBSD|OpenBSD) |
|
9007 MANGLE=$_MANGLE |
|
9008 ;; |
|
9009 esac |
|
9010 elif test -z "$MOZ_JEMALLOC3"; then |
|
9011 MANGLE=$_MANGLE |
|
9012 JEMALLOC_WRAPPER=replace_ |
|
9013 fi |
|
9014 if test -n "$MANGLE"; then |
|
9015 MANGLED= |
|
9016 if test -n "$_WRAP_MALLOC" -a -z "$JEMALLOC_WRAPPER"; then |
|
9017 JEMALLOC_WRAPPER=__wrap_ |
|
9018 fi |
|
9019 for mangle in ${MANGLE}; do |
|
9020 if test -n "$MANGLED"; then |
|
9021 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED" |
|
9022 else |
|
9023 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle" |
|
9024 fi |
|
9025 done |
|
9026 ac_configure_args="$ac_configure_args --with-mangling=$MANGLED" |
|
9027 fi |
|
9028 unset CONFIG_FILES |
|
9029 if test -z "$MOZ_TLS"; then |
|
9030 ac_configure_args="$ac_configure_args --disable-tls" |
|
9031 fi |
|
9032 EXTRA_CFLAGS="$CFLAGS" |
|
9033 for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do |
|
9034 ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'" |
|
9035 done |
|
9036 if test "$CROSS_COMPILE"; then |
|
9037 ac_configure_args="$ac_configure_args je_cv_static_page_shift=12" |
|
9038 fi |
|
9039 _save_cache_file="$cache_file" |
|
9040 cache_file=$_objdir/memory/jemalloc/src/config.cache |
|
9041 |
|
9042 if ! test -e memory/jemalloc; then |
|
9043 mkdir -p memory/jemalloc |
|
9044 fi |
|
9045 |
|
9046 AC_OUTPUT_SUBDIRS(memory/jemalloc/src) |
|
9047 cache_file="$_save_cache_file" |
|
9048 ac_configure_args="$_SUBDIR_CONFIG_ARGS" |
|
9049 fi |
|
9050 |
|
9051 # Run freetype configure script |
|
9052 |
|
9053 if test "$MOZ_TREE_FREETYPE"; then |
|
9054 export CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS -std=c99" |
|
9055 export CPPFLAGS="$CPPFLAGS $MOZ_DEBUG_FLAGS" |
|
9056 export CXXFLAGS="$CXXFLAGS $MOZ_DEBUG_FLAGS" |
|
9057 export LDFLAGS="$LDFLAGS $MOZ_DEBUG_LDFLAGS" |
|
9058 # Spaces in the *_CFLAGS and *_LIBS variables are intentionally placed |
|
9059 # to force freetype to use our settings rather than autodetecting |
|
9060 export LIBPNG_CFLAGS="$MOZ_PNG_CFLAGS " |
|
9061 export LIBPNG_LIBS="$MOZ_PNG_LIBS " |
|
9062 export ZLIB_CFLAGS="$MOZ_ZLIB_CFLAGS " |
|
9063 export ZLIB_LIBS="$MOZ_ZLIB_LIBS " |
|
9064 export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in" |
|
9065 ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes --with-zlib=yes --without-bzip2 --with-png=yes --without-harfbuzz" |
|
9066 |
|
9067 if ! test -e modules; then |
|
9068 mkdir modules |
|
9069 fi |
|
9070 # Only export CC, CXX and RANLIB for the subconfigure, and avoid spilling |
|
9071 # that further down the road. |
|
9072 (export CC CXX RANLIB; |
|
9073 AC_OUTPUT_SUBDIRS(modules/freetype2) |
|
9074 ) || exit 1 |
|
9075 fi |
|
9076 |
|
9077 if test -z "$direct_nspr_config"; then |
|
9078 dnl ======================================================== |
|
9079 dnl = Setup a nice relatively clean build environment for |
|
9080 dnl = sub-configures. |
|
9081 dnl ======================================================== |
|
9082 CC="$_SUBDIR_CC" |
|
9083 CXX="$_SUBDIR_CXX" |
|
9084 CFLAGS="$_SUBDIR_CFLAGS" |
|
9085 CPPFLAGS="$_SUBDIR_CPPFLAGS" |
|
9086 CXXFLAGS="$_SUBDIR_CXXFLAGS" |
|
9087 LDFLAGS="$_SUBDIR_LDFLAGS" |
|
9088 HOST_CC="$_SUBDIR_HOST_CC" |
|
9089 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS" |
|
9090 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS" |
|
9091 RC= |
|
9092 fi |
|
9093 |
|
9094 unset MAKEFILES |
|
9095 unset CONFIG_FILES |
|
9096 |
|
9097 # Run all configure scripts specified by a subconfigure |
|
9098 if test -n "$_subconfigure_subdir"; then |
|
9099 _save_ac_configure_args="$ac_configure_args" |
|
9100 ac_configure_args="$_subconfigure_config_args" |
|
9101 AC_OUTPUT_SUBDIRS("$_subconfigure_subdir") |
|
9102 ac_configure_args="$_save_ac_configure_args" |
|
9103 fi |
|
9104 |
|
9105 # No need to run subconfigures when building with LIBXUL_SDK_DIR |
|
9106 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then |
|
9107 |
|
9108 export WRAP_LDFLAGS |
|
9109 |
|
9110 if test -n "$_WRAP_MALLOC"; then |
|
9111 # Avoid doubling wrap malloc arguments |
|
9112 _SUBDIR_CONFIG_ARGS="`echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'`" |
|
9113 fi |
|
9114 |
|
9115 if test -z "$MOZ_NATIVE_NSPR"; then |
|
9116 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla" |
|
9117 if test -z "$MOZ_DEBUG"; then |
|
9118 ac_configure_args="$ac_configure_args --disable-debug" |
|
9119 else |
|
9120 ac_configure_args="$ac_configure_args --enable-debug" |
|
9121 fi |
|
9122 if test "$MOZ_OPTIMIZE" = "1"; then |
|
9123 ac_configure_args="$ac_configure_args --enable-optimize" |
|
9124 elif test -z "$MOZ_OPTIMIZE"; then |
|
9125 ac_configure_args="$ac_configure_args --disable-optimize" |
|
9126 fi |
|
9127 if test -n "$HAVE_64BIT_OS"; then |
|
9128 ac_configure_args="$ac_configure_args --enable-64bit" |
|
9129 fi |
|
9130 if test -n "$USE_ARM_KUSER"; then |
|
9131 ac_configure_args="$ac_configure_args --with-arm-kuser" |
|
9132 fi |
|
9133 # A configure script generated by autoconf 2.68 does not allow the cached |
|
9134 # values of "precious" variables such as CFLAGS and LDFLAGS to differ from |
|
9135 # the values passed to the configure script. Since we modify CFLAGS and |
|
9136 # LDFLAGS before passing them to NSPR's configure script, we cannot share |
|
9137 # config.cache with NSPR. As a result, we cannot pass AS, CC, CXX, etc. to |
|
9138 # NSPR via a shared config.cache file and must pass them to NSPR on the |
|
9139 # configure command line. |
|
9140 for var in AS CC CXX CPP LD AR RANLIB STRIP; do |
|
9141 ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'" |
|
9142 done |
|
9143 # A configure script generated by autoconf 2.68 warns if --host is |
|
9144 # specified but --build isn't. So we always pass --build to NSPR's |
|
9145 # configure script. |
|
9146 ac_configure_args="$ac_configure_args --build=$build" |
|
9147 ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_ARGS" |
|
9148 |
|
9149 # Save these, so we can mess with them for the subconfigure .. |
|
9150 _SAVE_CFLAGS="$CFLAGS" |
|
9151 _SAVE_CPPFLAGS="$CPPFLAGS" |
|
9152 _SAVE_LDFLAGS="$LDFLAGS" |
|
9153 |
|
9154 if test -n "$MOZ_LINKER" -a "$ac_cv_func_dladdr" = no ; then |
|
9155 # dladdr is supported by the new linker, even when the system linker doesn't |
|
9156 # support it. Trick nspr into using dladdr when it's not supported. |
|
9157 export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS" |
|
9158 fi |
|
9159 export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS" |
|
9160 export CFLAGS="$CFLAGS $MOZ_FRAMEPTR_FLAGS" |
|
9161 |
|
9162 # Use a separate cache file for NSPR since it uses autoconf 2.68. |
|
9163 _save_cache_file="$cache_file" |
|
9164 cache_file=$_objdir/nsprpub/config.cache |
|
9165 |
|
9166 AC_OUTPUT_SUBDIRS(nsprpub) |
|
9167 |
|
9168 # .. and restore them |
|
9169 cache_file="$_save_cache_file" |
|
9170 CFLAGS="$_SAVE_CFLAGS" |
|
9171 CPPFLAGS="$_SAVE_CPPFLAGS" |
|
9172 LDFLAGS="$_SAVE_LDFLAGS" |
|
9173 |
|
9174 ac_configure_args="$_SUBDIR_CONFIG_ARGS" |
|
9175 fi |
|
9176 |
|
9177 dnl ======================================================== |
|
9178 dnl = Setup a nice relatively clean build environment for |
|
9179 dnl = sub-configures. |
|
9180 dnl ======================================================== |
|
9181 CC="$_SUBDIR_CC" |
|
9182 CXX="$_SUBDIR_CXX" |
|
9183 CFLAGS="$_SUBDIR_CFLAGS" |
|
9184 CPPFLAGS="$_SUBDIR_CPPFLAGS" |
|
9185 CXXFLAGS="$_SUBDIR_CXXFLAGS" |
|
9186 LDFLAGS="$_SUBDIR_LDFLAGS" |
|
9187 HOST_CC="$_SUBDIR_HOST_CC" |
|
9188 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS" |
|
9189 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS" |
|
9190 RC= |
|
9191 |
|
9192 if test -n "$ENABLE_CLANG_PLUGIN"; then |
|
9193 ac_configure_args="$_SUBDIR_CONFIG_ARGS" |
|
9194 AC_OUTPUT_SUBDIRS(build/clang-plugin) |
|
9195 fi |
|
9196 |
|
9197 |
|
9198 # Run the SpiderMonkey 'configure' script. |
|
9199 dist=$MOZ_BUILD_ROOT/dist |
|
9200 ac_configure_args="$_SUBDIR_CONFIG_ARGS" |
|
9201 ac_configure_args="$ac_configure_args --enable-threadsafe" |
|
9202 |
|
9203 if test "$_INTL_API" = no; then |
|
9204 ac_configure_args="$ac_configure_args --without-intl-api" |
|
9205 fi |
|
9206 |
|
9207 if test "$BUILD_CTYPES"; then |
|
9208 # Build js-ctypes on the platforms we can. |
|
9209 ac_configure_args="$ac_configure_args --enable-ctypes" |
|
9210 fi |
|
9211 if test -z "$JS_SHARED_LIBRARY" ; then |
|
9212 ac_configure_args="$ac_configure_args --disable-shared-js" |
|
9213 if test -n "$MOZ_DISABLE_EXPORT_JS"; then |
|
9214 ac_configure_args="$ac_configure_args --disable-export-js" |
|
9215 fi |
|
9216 fi |
|
9217 if test -z "$MOZ_NATIVE_NSPR"; then |
|
9218 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'" |
|
9219 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'" |
|
9220 fi |
|
9221 ac_configure_args="$ac_configure_args --prefix=$dist" |
|
9222 if test "$MOZ_MEMORY"; then |
|
9223 ac_configure_args="$ac_configure_args --enable-jemalloc" |
|
9224 fi |
|
9225 if test -n "$MOZ_GLUE_LDFLAGS"; then |
|
9226 export MOZ_GLUE_LDFLAGS |
|
9227 fi |
|
9228 if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then |
|
9229 export MOZ_GLUE_PROGRAM_LDFLAGS |
|
9230 fi |
|
9231 if test -n "$ZLIB_IN_MOZGLUE"; then |
|
9232 MOZ_ZLIB_LIBS= |
|
9233 fi |
|
9234 export MOZ_NATIVE_ZLIB |
|
9235 export MOZ_ZLIB_CFLAGS |
|
9236 export MOZ_ZLIB_LIBS |
|
9237 export MOZ_APP_NAME |
|
9238 export DONT_POPULATE_VIRTUALENV=1 |
|
9239 export PYTHON |
|
9240 export MOZILLA_CENTRAL_PATH=$_topsrcdir |
|
9241 export STLPORT_CPPFLAGS |
|
9242 export STLPORT_LDFLAGS |
|
9243 export STLPORT_LIBS |
|
9244 export JS_STANDALONE=no |
|
9245 export MOZ_LINKER |
|
9246 export ZLIB_IN_MOZGLUE |
|
9247 |
|
9248 if ! test -e js; then |
|
9249 mkdir js |
|
9250 fi |
|
9251 |
|
9252 AC_OUTPUT_SUBDIRS(js/src) |
|
9253 ac_configure_args="$_SUBDIR_CONFIG_ARGS" |
|
9254 |
|
9255 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR |
|
9256 |
|
9257 export WRITE_MOZINFO=1 |
|
9258 dnl we need to run config.status after js/src subconfigure because we're |
|
9259 dnl traversing its moz.build and we need its config.status for that. |
|
9260 dnl However, writing our own config.status needs to happen before |
|
9261 dnl subconfigures because the setup surrounding subconfigures alters |
|
9262 dnl many AC_SUBSTed variables. |
|
9263 MOZ_RUN_CONFIG_STATUS() |
|
9264 unset WRITE_MOZINFO |