Skip to content

Instantly share code, notes, and snippets.

@lygstate
Forked from luser/configure.py
Last active August 29, 2015 14:19
Show Gist options
  • Save lygstate/8197b1323fda4cb0454a to your computer and use it in GitHub Desktop.
Save lygstate/8197b1323fda4cb0454a to your computer and use it in GitHub Desktop.
import argparse
import fnmatch
import os
import string
import subprocess
import sys
from collections import defaultdict
SUBSTS = set(['MOZ_PERMISSIONS', 'MOZ_DMD', 'HAVE_64BIT_BUILD', 'MOZ_CAN_RUN_PROGRAMS', 'MOZ_WIDGET_TOOLKIT', 'MOZ_PNG_ARM_NEON_CHECK', 'MOZ_ALLOW_HEAP_EXECUTE_FLAGS', 'AR_EXTRACT', 'TAR', 'MOZ_SERVICES_COMMON', 'MOZ_VPX_ERROR_CONCEALMENT', 'ZLIB_IN_MOZGLUE', 'MOZ_JPROF', 'MOZ_SOCIAL', 'NONASCII', 'MOZ_MULET', 'VPX_ASFLAGS', 'MOZ_APP_ID', 'MOZ_NO_EV_CERTS', 'MOZ_PNG_CFLAGS', 'MOZ_CHILD_PROCESS_NAME', 'MOZ_OPUS', 'OBJCOPY', 'ASM_SUFFIX', 'MOZ_WEBSPEECH', 'MOZ_FIX_LINK_PATHS', 'GRE_MILESTONE', 'HOST_LDFLAGS', 'VISIBILITY_FLAGS', 'TARGET_MD_ARCH', 'MOZ_ASAN', 'MOZ_APP_UA_NAME', 'GST_API_VERSION', 'MOZ_DEVICES', 'MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS', 'MOZ_SERVICES_HEALTHREPORT', 'MOZ_JPEG_CFLAGS', 'MOZ_B2G_FM', 'MOZ_B2G_RIL', 'MOZ_ANDROID_OMTC', 'MOZ_METRO', 'DSO_LDOPTS', 'MOZ_OPTIMIZE_LDFLAGS', 'MOZ_DISABLE_PARENTAL_CONTROLS', 'OS_LDFLAGS', '_MSC_VER', 'MKSHLIB_FORCE_ALL', 'MOZ_NUWA_PROCESS', 'MOZ_OMX_PLUGIN', 'MOZ_AUDIO_OFFLOAD', 'GNU_LD', 'MOZ_B2G_BT_BLUEZ', 'NSPR_CFLAGS', 'MC', 'FILTER', 'MOZ_ENABLE_SKIA_GPU', 'MOZ_D3DCOMPILER_VISTA_DLL', 'MOZ_ENABLE_PROFILER_SPS', 'MOZ_DEBUG_SYMBOLS', 'MOZ_JEMALLOC3', 'ANDROID_SOURCE', 'MOZ_PEERCONNECTION', 'GTEST_USE_OWN_TR1_TUPLE', 'OS_ARCH', 'HOST_AR', 'MOZ_WIDGET_GTK', 'HAVE_TOOLCHAIN_SUPPORT_MSSSE3', 'MOZ_GLUE_LDFLAGS', 'PROFILE_GEN_CFLAGS', 'CC_VERSION', 'VPX_ARM_ASM', 'MOZ_GAMEPAD_BACKEND', 'EXTERNAL_SOURCE_DIR', 'MOZ_NATIVE_SQLITE', 'L10NBASEDIR', 'MOZ_TREE_FREETYPE', 'WGET', 'TARGET_OS', 'MOZ_B2G_LOADER', 'MOZ_LIBSTDCXX_HOST_VERSION', 'HOST_OS_ARCH', 'MOZ_DIRECTSHOW', 'VPX_AS_CONVERSION', 'MOZ_B2G_CAMERA', 'MOZ_DISTRIBUTION_ID', 'MOZ_UPDATER', 'HOST_NSPR_MDCPUCFG', 'MOZ_ENABLE_GNOMEUI', 'MOZ_PKG_SPECIAL', 'MOZ_B2G_BT_BLUEDROID', 'MOZ_TELEMETRY_DISPLAY_REV', 'OS_TARGET', 'PKG_SKIP_STRIP', 'LD', 'MACOSX_DEPLOYMENT_TARGET', 'MOZ_ENABLE_QT5FEEDBACK', 'MOZ_CHILD_PERMISSIONS', 'MOZ_SAFE_BROWSING', 'MOZ_DIRECTX_SDK_PATH', 'NS_TRACE_MALLOC', 'CRTDLLVERSION', 'SOLARIS_SUNPRO_CXX', 'MOZ_UPDATE_CHANNEL', 'MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS', 'MOZ_UNIVERSALCHARDET', 'QUARTZ_IMAGE_SURFACE_FEATURE', 'ac_configure_args', 'AR_LIST', 'CXX_VERSION', 'COMPILE_ENVIRONMENT', 'VPX_DASH_C_FLAG', 'LIBXUL_DIST', 'MOZ_ENABLE_D3D10_LAYER', 'MOZ_ENABLE_GTK2', 'MOZ_ENABLE_GTK3', 'JS_SHARED_LIBRARY', 'MACOS_SDK_DIR', 'DEHYDRA_PATH', 'HAVE_CLOCK_MONOTONIC', 'LIBJPEG_TURBO_AS', 'OMNIJAR_NAME', 'RC', 'MOZ_EXTENSION_MANAGER', 'OS_CXXFLAGS', 'MOZ_D3DCOMPILER_XP_CAB', 'JAR', 'AIX_OBJMODEL', 'OS_CPPFLAGS', 'MOZ_REPLACE_MALLOC', 'MOZ_TOOLKIT_SEARCH', 'MOZ_SERVICES_CRYPTO', 'FT_FONT_FEATURE', 'ENABLE_STRIP', 'UPLOAD_EXTRA_FILES', 'LIB_SUFFIX', 'TARGET_VENDOR', 'MOZ_WEBSMS_BACKEND', 'KEYTOOL', 'LIBJPEG_TURBO_X64_ASM', 'MOZ_PIXMAN_CFLAGS', 'MOZ_BING_API_CLIENTID', 'MOZ_FMP4', 'GMAKE', 'HAVE_DTRACE', 'HAVE_TOOLCHAIN_SUPPORT_MSSE4_1', 'MACOS_PRIVATE_FRAMEWORKS_DIR', 'QUARTZ_SURFACE_FEATURE', 'PROFILE_USE_CFLAGS', 'MOZ_MOZILLA_API_KEY', 'TARGET_NSPR_MDCPUCFG', 'AR_FLAGS', 'MOZ_B2G', 'PDF_SURFACE_FEATURE', 'MOZ_GOOGLE_API_KEY', 'WIN32_FONT_FEATURE', 'MOZ_RAW', 'MOZ_GSTREAMER', 'HOST_OPTIMIZE_FLAGS', 'LIBJPEG_TURBO_X86_ASM', 'MOZ_WEBRTC_ASSERT_ALWAYS', 'MOZ_CRASHREPORTER', 'MOZ_USE_PTHREADS', 'INTEL_CC', 'PROFILE_USE_LDFLAGS', 'OS_RELEASE', 'NSS_DISABLE_DBM', 'BIN_SUFFIX', 'HOST_CXXFLAGS', 'MOZ_PGO', 'MOZ_VALGRIND', 'HOST_RANLIB', 'MOZ_AUTH_EXTENSION', 'GTK_CONFIG', 'MOZ_DISABLE_GECKOVIEW', 'MOZ_VORBIS', 'GKMEDIAS_SHARED_LIBRARY', 'MOZ_ENABLE_SKIA', 'MOZ_APP_VENDOR', 'MOZ_SPELLCHECK', 'MOZ_OMX_DECODER', 'MOZ_D3DCOMPILER_XP_DLL', 'ENABLE_MARIONETTE', 'MOZ_NATIVE_BZ2', 'MOZ_SAMPLE_TYPE_S16', 'MOZ_LINKER_EXTRACT', 'FXOS_SIMULATOR', 'MOZ_SERVICES_SYNC', 'TARGET_CPU', 'A11Y_LOG', 'MOZ_WEBRTC', 'MOZ_NATIVE_PNG', 'MOZ_ANDROID_HISTORY', 'USE_DEPENDENT_LIBS', 'MOZ_GMP_SANDBOX', 'MAKEPRI', 'MOZ_VTUNE', 'MOZ_EM_DEBUG', 'MOZ_BUILD_ROOT', 'AS_DASH_C_FLAG', 'MOZ_ENABLE_GTK', 'IMPLIB', 'MOZ_NATIVE_HUNSPELL', 'WIN32_SURFACE_FEATURE', 'MOZ_ENABLE_D2D_SURFACE', 'MOZ_APP_NAME', 'WIN32_DWRITE_FONT_FEATURE', 'MOZ_INSTRUMENT_EVENT_LOOP', 'MOZ_DEBUG_DISABLE_DEFS', 'MOZ_VPX', 'IMPORT_LIB_SUFFIX', 'MKCSHLIB', 'MOZ_PROFILING', 'MOZ_GIO_COMPONENT', 'ANDROID_VERSION', 'MOZ_PNG_ARM_NEON', 'BIN_FLAGS', 'LIBJPEG_TURBO_ASFLAGS', 'MOZ_ENABLE_CONTENTACTION', 'HOST_BIN_SUFFIX', 'MOZ_REPLACE_MALLOC_LINKAGE', 'MOZ_WEBAPP_RUNTIME', 'MOZ_DOC_INPUT_DIRS', 'MOZ_CFLAGS_NSS', 'PS_SURFACE_FEATURE', 'DLL_SUFFIX', 'MOZ_XULRUNNER', 'MOZ_DEMANGLE_SYMBOLS', 'MOZ_OMX_ENCODER', 'MOZ_FRAMEPTR_FLAGS', 'HOST_AR_FLAGS', 'MOZ_NO_WLZDEFS', 'MOZ_WINSDK_MAXVER', 'MOZ_APPLEMEDIA', 'MOZ_MACBUNDLE_ID', 'MOZ_WEBRTC_LEAKING_TESTS', 'MOZ_ZIPWRITER', 'MOZ_ENABLE_GNOMEVFS', 'NECKO_COOKIES', 'MOZ_GAMEPAD', 'MOZILLA_OFFICIAL', 'WIN32_D2D_SURFACE_FEATURE', 'AR_DELETE', 'INCREMENTAL_LINKER', 'MOZ_LINKER', 'WRAP_LDFLAGS', 'DLLFLAGS', 'MOZ_MEMORY', 'MOZ_MAINTENANCE_SERVICE', 'MOZ_ENABLE_DBUS', 'MOZ_TOOLS_DIR', 'MOZ_APP_VERSION', 'TEE_SURFACE_FEATURE', 'MOZ_WAVE', 'CROSS_COMPILE', 'NS_ENABLE_TSF', 'TARGET_XPCOM_ABI', 'MOZ_LOCALE_SWITCHER', 'MOZ_DISABLE_CRYPTOLEGACY', 'MOZILLA_SYMBOLVERSION', 'MOZ_ENABLE_DIRECT2D1_1', 'MOZ_MACBUNDLE_NAME', 'MOZ_NATIVE_NSS', 'ASFLAGS', 'MOZ_SCTP', 'MOZ_ENABLE_GCONF', 'GAIADIR', 'MOZ_CAPTIVEDETECT', 'MOZ_INSTRUMENTS', 'MOZ_GLUE_PROGRAM_LDFLAGS', 'MOZ_JSDOWNLOADS', 'STRIP_FLAGS', 'MOZ_SZIP_FLAGS', 'MOZ_GL_PROVIDER', 'MOZ_X11', 'UNIVERSAL_BINARY', 'XLIB_SURFACE_FEATURE', 'LIB_PREFIX', 'MOZ_WEBGL', 'MOZ_FOLD_LIBS', 'DSO_CFLAGS', 'MAKENSISU', 'HOST_LD', 'MOZ_PACKAGER_FORMAT', 'MOC', 'MOZ_ENABLE_QTMOBILITY', 'MOZ_APP_PROFILE', 'GNU_CXX', 'MOZ_ENABLE_SIGNMAR', 'MOZ_PACKAGE_JSSHELL', 'HOST_CFLAGS', 'MOZ_PHOENIX', 'DLL_PREFIX', 'MOZ_POST_PROGRAM_COMMAND', 'NSS_NO_LIBPKIX', 'MOZ_ANGLE_RENDERER', 'ENABLE_CLANG_PLUGIN', 'RCFLAGS', 'MOZILLA_VERSION', 'QT_SURFACE_FEATURE', 'MKSHLIB', 'SVG_SURFACE_FEATURE', 'VPX_AS', 'MOZ_UI_LOCALE', 'OS_LIBS', 'MOZ_WEBM', 'MOZ_WEBRTC_SIGNALING', 'MOZ_BZ2_CFLAGS', 'MOZ_NATIVE_LIBVPX', 'RELEASE_BUILD', 'OS2_SURFACE_FEATURE', 'MOZ_ENABLE_LIBPROXY', 'MOZ_CHROME_FILE_FORMAT', 'CL_INCLUDES_PREFIX', 'FIREFOX_VERSION', 'MOZ_POST_DSO_LIB_COMMAND', 'MOZ_ENABLE_D3D9_LAYER', 'OS_COMPILE_CFLAGS', 'MOZ_ENABLE_XREMOTE', 'FC_FONT_FEATURE', 'ACCEPTED_MAR_CHANNEL_IDS', 'MOZ_PAY', 'MIDL_FLAGS', 'MOZ_ENABLE_STARTUP_NOTIFICATION', 'BUILD_CTYPES', 'MOZ_MSVC_STL_WRAP__RAISE', 'RCC', 'MOZ_MSVC_STL_WRAP__Throw', 'STL_FLAGS', 'MOZ_PGO_OPTIMIZE_FLAGS', 'VPX_ASM_SUFFIX', 'OS_COMPILE_CXXFLAGS', 'NSINSTALL_BIN', 'MOZ_OMNIJAR', 'INTEL_ARCHITECTURE', 'HAVE_GCC_ALIGN_ARG_POINTER', 'MOZ_TASK_TRACER', 'MOZ_ENABLE_QT5GEOPOSITION', 'MOZ_CHILD_PROCESS_BUNDLE', 'MOZ_GL_DEFAULT_PROVIDER', 'MOZ_FFMPEG', 'MSMANIFEST_TOOL', 'MOZ_ENABLE_CAIRO_FT', 'HOST_CC', 'INTEL_CXX', 'MOZ_OPTIMIZE', 'ENABLE_TESTS', 'MOZ_DOC_OUTPUT_DIR', 'WCHAR_CFLAGS', 'MOZ_DISABLE_UNIFIED_COMPILATION', 'MOZ_ACTIVITIES', 'MOZ_PLACES', 'PNG_FUNCTIONS_FEATURE', 'MOZ_PREF_EXTENSIONS', 'MOZ_PROFILELOCKING', 'CPU_ARCH', 'MOZ_OPTIMIZE_FLAGS', 'GNU_CC', 'MKSHLIB_UNFORCE_ALL', 'MOZ_STUB_INSTALLER', 'STLPORT_LIBS', 'MOZ_DEBUG_LDFLAGS', 'MOZ_B2G_VERSION', 'NECKO_WIFI_DBUS', 'MOZ_SERVICES_NOTIFICATIONS', 'MOZ_ENABLE_QMSYSTEM2', 'MOZ_XUL', 'MOZ_DEBUG_ENABLE_DEFS', 'MOZ_UPDATE_PACKAGING', 'MOZ_D3D_CPU_SUFFIX', 'CRTEXPDLLVERSION', 'MOZ_EXTENSIONS', 'WRAP_SYSTEM_INCLUDES', 'MOZ_DISABLE_STARTUPCACHE', 'DIRECTFB_SURFACE_FEATURE', 'RPMBUILD', 'MOZ_APP_MAXVERSION', 'MOZ_DOC_INCLUDE_DIRS', 'NO_INTEGRATED_AS_CFLAGS', 'MOZ_UPDATE_XTERM', 'MOZ_ENABLE_GIO', 'NO_LD_ARCHIVE_FLAGS', 'MOZ_TREE_PIXMAN', 'NS_PRINTING', 'MOZ_LIBSTDCXX_TARGET_VERSION', 'SOLARIS_SUNPRO_CC', 'USE_N32', 'WRAP_STL_INCLUDES', 'MOZ_ALSA', 'MOZ_TIME_MANAGER', 'MOZ_CRASHREPORTER_INJECTOR', 'MOZ_VERIFY_MAR_SIGNATURE', 'PROFILE_GEN_LDFLAGS', 'MOZ_URL_CLASSIFIER', 'NSS_CFLAGS', 'ANDROID_PACKAGE_NAME', 'MOZ_WEBM_ENCODER', 'MOZ_BRANDING_DIRECTORY', 'MOZ_ENABLE_DWRITE_FONT', 'MOZ_APP_BASENAME', 'UNIFY_DIST', 'MOZ_HELP_VIEWER', 'OS_TEST', 'LIBJPEG_TURBO_ARM_ASM', 'MOZ_ANDROID_MLS_STUMBLER', 'MOZ_NATIVE_JEMALLOC', 'MOZ_SHARK', 'VPX_X86_ASM', 'MOZ_BING_API_KEY', 'MOZ_APP_DISPLAYNAME', 'TOOLCHAIN_PREFIX', 'MOZ_DEBUG', 'MOZ_SERVICES_METRICS', 'MOZ_SYNTH_PICO', 'MOZ_PROFILE_MIGRATOR', 'MOZ_PULSEAUDIO', 'GTEST_OS_LINUX_ANDROID', 'MOZ_BUILD_APP', 'MOZ_NATIVE_LIBEVENT', 'MOZ_D3DCOMPILER_VISTA_DLL_PATH', 'MOZ_ENABLE_SZIP', 'MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI', 'MOZ_ANDROID_ANR_REPORTER', 'QUARTZ_FONT_FEATURE', 'MOZ_NATIVE_NSPR', 'WARNINGS_AS_ERRORS', 'HAVE_INTTYPES_H', 'MOZ_WMF', 'ACCESSIBILITY', 'NIGHTLY_BUILD', 'MOZ_OFFICIAL_BRANDING', 'MOZ_COMPONENT_NSPR_LIBS', 'MOZ_SRTP', 'EARLY_BETA_OR_EARLIER', 'GNU_AS', 'E10S_TESTING_ONLY', 'GTEST_HAS_RTTI', 'WINDRES', 'MOZ_CONTENT_SANDBOX', 'XLIB_XRENDER_SURFACE_FEATURE', 'MOZ_ENABLE_QTNETWORK', 'OS_CFLAGS', 'MOZ_UA_OS_AGNOSTIC', 'WIN32_REDIST_DIR', 'MAR_CHANNEL_ID', 'MOZ_ENABLE_GNOME_COMPONENT', 'MOZ_NATIVE_JPEG', 'JARSIGNER', 'MOZ_SAMPLE_TYPE_FLOAT32', 'MOZ_NFC', 'MOZ_THEME_FASTSTRIPE', 'USE_ELF_HACK', 'GTEST_HAS_CLONE', 'XULRUNNER_STUB_NAME', 'MOZ_ANDROID_OMX', 'MOZ_EME', 'MOZ_HAS_WINSDK_WITH_D3D', 'MOZ_ENABLE_QT', 'MOZ_DATA_REPORTING', 'MSVC_CXX_RUNTIME_DLL', 'MSVS_VERSION', 'MSVC_C_RUNTIME_DLL', 'MOZ_GFX_OPTIMIZE_MOBILE', 'VPX_NEED_OBJ_INT_EXTRACT', 'MOZ_AUDIO_CHANNEL_MANAGER', 'MOZ_B2G_BT', 'HAVE_X86_AVX2', 'MOZ_FS_LAYOUT', 'MOZ_FEEDS', 'MOZ_CALLGRIND', 'MOZ_IPDL_TESTS', 'NECKO_WIFI', 'MOZ_TREMOR', 'MOZ_PDF_PRINTING', 'MOZ_ANDROID_BEAM', 'AS', 'AR', 'GCC_USE_GNU_LD', 'MOZ_APP_STATIC_INI', 'DSO_PIC_CFLAGS', 'LLVM_SYMBOLIZER', 'MOZ_OPTIMIZE_SIZE_TWEAK', 'JAVA', 'JAVAC', 'HOST_CXX', 'JAVAH', 'LIBICONV', 'MOZ_BROWSE_INFO', 'OBJ_SUFFIX', 'MOZ_ANDROID_SEARCH_ACTIVITY', 'MOZ_TREE_CAIRO'])
def make_arg_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--enable-metro', dest='metro', action='store_true', help='Enable Windows Metro build targets')
parser.add_argument('--enable-address-sanitizer', dest='address_sanitizer', action='store_true', help='Enable Address Sanitizer (default=no)')
parser.add_argument('--enable-llvm-hacks', dest='llvm_hacks', action='store_true', help='Enable workarounds required for several LLVM instrumentations (default=no)')
parser.add_argument('--enable-profiling', dest='profiling', action='store_true', help='Set compile flags necessary for using sampling profilers (e.g. shark, perf)')
parser.add_argument('--enable-systrace', dest='systrace', action='store_true', help='Set compile flags necessary for using sampling profilers (e.g. shark, perf)')
parser.add_argument('--enable-valgrind', dest='valgrind', action='store_true', help='Enable Valgrind integration hooks (default=no)')
parser.add_argument('--enable-jprof', dest='jprof', action='store_true', help='Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.')
parser.add_argument('--enable-shark', dest='shark', action='store_true', help='Enable shark remote profiling. Implies --enable-profiling.')
parser.add_argument('--enable-instruments', dest='instruments', action='store_true', help='Enable instruments remote profiling. Implies --enable-profiling.')
parser.add_argument('--enable-callgrind', dest='callgrind', action='store_true', help='Enable callgrind profiling. Implies --enable-profiling.')
parser.add_argument('--enable-vtune', dest='vtune', action='store_true', help='Enable vtune profiling. Implies --enable-profiling.')
parser.add_argument('--enable-system-hunspell', dest='system_hunspell', action='store_true', help='Use system hunspell (located with pkgconfig)')
parser.add_argument('--enable-shared-js', dest='shared_js', action='store_true', help='Create a shared JavaScript library.')
parser.add_argument('--enable-startup-notification', dest='startup_notification', action='store_true', help='Enable startup-notification support (default: disabled) ')
parser.add_argument('--enable-official-branding', dest='official_branding', action='store_true', help='Enable Official mozilla.org Branding\n Do not distribute builds with\n --enable-official-branding unless you have\n permission to use trademarks per\n http://www.mozilla.org/foundation/trademarks/ .')
parser.add_argument('--enable-gnomevfs', dest='gnomevfs', action='store_true', help='Enable GnomeVFS support (default: disabled)')
parser.add_argument('--enable-libproxy', dest='libproxy', action='store_true', help='Enable libproxy support ')
parser.add_argument('--enable-gnomeui', dest='gnomeui', action='store_true', help='Enable libgnomeui instead of GIO & GTK for icon theme support ')
parser.add_argument('--enable-ipdl-tests', dest='ipdl_tests', action='store_true', help='Enable expensive IPDL tests')
parser.add_argument('--enable-raw', dest='raw', action='store_true', help='Enable support for RAW media')
parser.add_argument('--enable-android-omx', dest='android_omx', action='store_true', help='Enable support for Android OMX media backend')
parser.add_argument('--enable-media-navigator', dest='media_navigator', action='store_true', help='Enable support for getUserMedia')
parser.add_argument('--enable-omx-plugin', dest='omx_plugin', action='store_true', help='Enable building OMX plugin (B2G)')
parser.add_argument('--enable-alsa', dest='alsa', action='store_true', help='Enable Alsa support (default on Linux)')
parser.add_argument('--enable-require-all-d3dc-versions', dest='require_all_d3dc_versions', action='store_true', help=' --enable-require-all-d3dc-versions Require all versions of the D3D compiler needed for supported Windows systems.')
parser.add_argument('--enable-tree-freetype', dest='tree_freetype', action='store_true', help='Enable Tree FreeType')
parser.add_argument('--enable-maintenance-service', dest='maintenance_service', action='store_true', help='Enable building of maintenanceservice')
parser.add_argument('--enable-bundled-fonts', dest='bundled_fonts', action='store_true', help='Enable support for bundled fonts on desktop platforms')
parser.add_argument('--enable-verify-mar', dest='verify_mar', action='store_true', help='Enable verifying MAR signatures')
parser.add_argument('--enable-signmar', dest='signmar', action='store_true', help='Enable building the signmar program')
parser.add_argument('--enable-update-packaging', dest='update_packaging', action='store_true', help='Enable tools/update-packaging')
parser.add_argument('--enable-content-sandbox', dest='content_sandbox', action='store_true', help='Enable sandboxing support for content-processes')
parser.add_argument('--enable-system-sqlite', dest='system_sqlite', action='store_true', help='Use system sqlite (located with pkgconfig)')
parser.add_argument('--enable-safe-browsing', dest='safe_browsing', action='store_true', help='Enable safe browsing (anti-phishing) implementation')
parser.add_argument('--enable-url-classifier', dest='url_classifier', action='store_true', help='Enable url classifier module')
parser.add_argument('--enable-faststripe', dest='faststripe', action='store_true', help='Use faststripe theme')
parser.add_argument('--enable-mobile-optimize', dest='mobile_optimize', action='store_true', help='Enable mobile optimizations')
parser.add_argument('--enable-warnings-as-errors', dest='warnings_as_errors', action='store_true', help='Enable treating of warnings as errors')
parser.add_argument('--enable-logrefcnt', dest='logrefcnt', action='store_true', help='Enable logging of refcounts (default=debug) ')
parser.add_argument('--enable-dump-painting', dest='dump_painting', action='store_true', help='Enable paint debugging.')
parser.add_argument('--enable-trace-malloc', dest='trace_malloc', action='store_true', help='Enable malloc tracing; also disables DMD and jemalloc')
parser.add_argument('--enable-dmd', dest='dmd', action='store_true', help='Enable DMD; also enables jemalloc and replace-malloc')
parser.add_argument('--enable-jemalloc', dest='jemalloc', action='store_true', help='Replace memory allocator with jemalloc')
parser.add_argument('--enable-replace-malloc', dest='replace_malloc', action='store_true', help='Enable ability to dynamically replace the malloc implementation')
parser.add_argument('--enable-wrap-malloc', dest='wrap_malloc', action='store_true', help='Wrap malloc calls (gnu linker only)')
parser.add_argument('--enable-trace-jscalls', dest='trace_jscalls', action='store_true', help='Enable JS call enter/exit callback (default=no)')
parser.add_argument('--enable-js-diagnostics', dest='js_diagnostics', action='store_true', help='Enable JS diagnostic assertions and breakpad data')
parser.add_argument('--enable-small-chunk-size', dest='small_chunk_size', action='store_true', help='Allocate memory for JS GC things in smaller chunks')
parser.add_argument('--enable-gczeal', dest='gczeal', action='store_true', help='Enable zealous JavaScript GCing')
parser.add_argument('--enable-root-analysis', dest='root_analysis', action='store_true', help='Enable moving GC stack root analysis')
parser.add_argument('--enable-clang-plugin', dest='clang_plugin', action='store_true', help='Enable building with the mozilla clang plugin ')
parser.add_argument('--enable-strip', dest='strip', action='store_true', help='Enable stripping of libs & executables ')
parser.add_argument('--enable-install-strip', dest='install_strip', action='store_true', help='Enable stripping of libs & executables when packaging ')
parser.add_argument('--enable-stdcxx-compat', dest='stdcxx_compat', action='store_true', help='Enable compatibility with older libstdc++')
parser.add_argument('--enable-visual-event-tracer', dest='visual_event_tracer', action='store_true', help='Enable visual event tracer instrumentation')
parser.add_argument('--enable-tasktracer', dest='tasktracer', action='store_true', help='Set compile flags necessary for using TaskTracer')
parser.add_argument('--enable-reflow-perf', dest='reflow_perf', action='store_true', help='Enable reflow performance tracing')
parser.add_argument('--enable-b2g-ril', dest='b2g_ril', action='store_true', help=' --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ')
parser.add_argument('--enable-b2g-bt', dest='b2g_bt', action='store_true', help=' --enable-b2g-bt Set compile flags necessary for compiling Bluetooth API for B2G ')
parser.add_argument('--enable-nfc', dest='nfc', action='store_true', help='Set compile flags necessary for compiling NFC API ')
parser.add_argument('--enable-synth-pico', dest='synth_pico', action='store_true', help='Set compile flags necessary for compiling Pico Web Speech API ')
parser.add_argument('--enable-b2g-camera', dest='b2g_camera', action='store_true', help=' --enable-b2g-camera Set compile flags necessary for compiling camera API for B2G ')
parser.add_argument('--enable-xterm-updates', dest='xterm_updates', action='store_true', help='Update XTERM titles with current command.')
parser.add_argument('--enable-skia', dest='skia', action='store_true', help='Enable use of Skia')
parser.add_argument('--enable-system-cairo', dest='system_cairo', action='store_true', help='Use system cairo (located with pkgconfig)')
parser.add_argument('--enable-system-pixman', dest='system_pixman', action='store_true', help='Use system pixman (located with pkgconfig)')
return parser
def format(s, vars, extra):
d = defaultdict(str, vars)
for (k, v) in extra.iteritems():
d[k] = v
return string.Formatter().vformat(s, (), d)
class quoted():
def __init__(self, q):
self.q = q
def for_loop(things, vars, extra):
for t in things:
if isinstance(t, quoted):
yield format(t.q, vars, extra)
else:
for x in format(t, vars, extra).split():
yield x
def main(args):
vars = dict(os.environ)
for (i, a) in enumerate(args):
vars[('argv%d' % i)] = a
exports = set(vars.keys())
parser = make_arg_parser()
args = parser.parse_args(args)
vars['TARGET_CPU'] = vars.get('target_cpu', '')
vars['TARGET_VENDOR'] = vars.get('target_vendor', '')
vars['TARGET_OS'] = vars.get('target_os', '')
vars['CFLAGS'] = vars.get('CFLAGS', '')
vars['CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['CXXFLAGS'] = vars.get('CXXFLAGS', '')
vars['LDFLAGS'] = vars.get('LDFLAGS', '')
vars['HOST_CFLAGS'] = vars.get('HOST_CFLAGS', '')
vars['HOST_CXXFLAGS'] = vars.get('HOST_CXXFLAGS', '')
vars['HOST_LDFLAGS'] = vars.get('HOST_LDFLAGS', '')
vars['_SUBDIR_CC'] = vars.get('CC', '')
vars['_SUBDIR_CXX'] = vars.get('CXX', '')
vars['_SUBDIR_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SUBDIR_CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['_SUBDIR_CXXFLAGS'] = vars.get('CXXFLAGS', '')
vars['_SUBDIR_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SUBDIR_HOST_CC'] = vars.get('HOST_CC', '')
vars['_SUBDIR_HOST_CFLAGS'] = vars.get('HOST_CFLAGS', '')
vars['_SUBDIR_HOST_CXXFLAGS'] = vars.get('HOST_CXXFLAGS', '')
vars['_SUBDIR_HOST_LDFLAGS'] = vars.get('HOST_LDFLAGS', '')
vars['_SUBDIR_CONFIG_ARGS'] = vars.get('ac_configure_args', '')
vars['MOZJPEG'] = '62'
vars['MOZPNG'] = '10610'
vars['NSPR_VERSION'] = '4'
vars['NSPR_MINVER'] = '4.10.3'
vars['NSS_VERSION'] = '3'
vars['GLIB_VERSION'] = '1.2.0'
vars['PERL_VERSION'] = '5.006'
vars['CAIRO_VERSION'] = '1.10'
vars['PANGO_VERSION'] = '1.22.0'
vars['GTK2_VERSION'] = '2.10.0'
vars['GTK3_VERSION'] = '3.0.0'
vars['WINDRES_VERSION'] = '2.14.90'
vars['W32API_VERSION'] = '3.14'
vars['GNOMEVFS_VERSION'] = '2.0'
vars['GNOMEUI_VERSION'] = '2.2.0'
vars['GCONF_VERSION'] = '1.2.1'
vars['GIO_VERSION'] = '2.20'
vars['STARTUP_NOTIFICATION_VERSION'] = '0.8'
vars['DBUS_VERSION'] = '0.60'
vars['SQLITE_VERSION'] = '3.8.5'
vars['MSMANIFEST_TOOL'] = ''
vars['MISSING_X'] = ''
vars['MOZ_USE_PTHREADS'] = ''
vars['_PTHREAD_LDFLAGS'] = ''
vars['_topsrcdir'] = (os.path.dirname(__file__) or '.')
vars['_topsrcdir'] = subprocess.check_output('cd $_topsrcdir; pwd', shell=True, env=vars).rstrip('\n')
vars['_objdir'] = subprocess.check_output('pwd', shell=True, env=vars).rstrip('\n')
if (format('{_topsrcdir}', vars, {}) == (format('{_objdir}', vars, {}) and (not format('{with_l10n_base}', vars, {})))):
print ' ***'
print ' * Building directly in the main source directory is not allowed.'
print ' *'
print ' * To build, you must run configure from a separate directory'
print ' * (referred to as an object directory).'
print ' *'
print ' * If you are building with a mozconfig, you will need to change your'
print ' * mozconfig to point to a different object directory.'
print ' ***'
sys.exit('1')
vars['_conflict_files'] = ''
for file in for_loop(['{_topsrcdir}/Makefile', '{_topsrcdir}/config/autoconf.mk'], vars, {}):
vars['file'] = file
if os.path.isfile(vars.get('file', '')):
vars['_conflict_files'] = format('{_conflict_files} {file}', vars, {})
if vars.get('_conflict_files', ''):
print '***'
print '* Your source tree contains these files:'
for file in for_loop(['{_conflict_files}'], vars, {}):
vars['file'] = file
print format('* {file}', vars, {})
print '* This indicates that you previously built in the source tree.'
print '* A source tree build can confuse the separate objdir build.'
print '*'
print '* To clean up the source tree:'
print format('* 1. cd {_topsrcdir}', vars, {})
print '* 2. gmake distclean'
print '***'
sys.exit('1')
subprocess.call('break', shell=True, env=vars)
vars['MOZ_BUILD_ROOT'] = subprocess.check_output('pwd -W 2>/dev/null || pwd', shell=True, env=vars).rstrip('\n')
vars['COMPILE_ENVIRONMENT'] = '1'
if vars.get('L10NBASEDIR', ''):
if (vars.get('L10NBASEDIR', '') == ('yes' or (vars.get('L10NBASEDIR', '') == 'no'))):
sys.stderr.write('configure: error: --with-l10n-base must specify a path\n')
sys.exit(1)
elif os.path.isdir(vars.get('L10NBASEDIR', '')):
vars['L10NBASEDIR'] = subprocess.check_output('cd "$L10NBASEDIR" && pwd', shell=True, env=vars).rstrip('\n')
else:
sys.stderr.write("configure: error: Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist\n")
sys.exit(1)
if ((not vars.get('PERL', '')) or (vars.get('PERL', '') == ':')):
sys.stderr.write('configure: error: perl not found in \\$PATH\n')
sys.exit(1)
if (vars.get('GAIADIR', '') and (not os.path.isdir(vars.get('GAIADIR', '')))):
sys.stderr.write("configure: error: GAIADIR '$GAIADIR' isn't a valid directory\n")
sys.exit(1)
if vars.get('GAIADIR', ''):
pass
if (format('{FXOS_SIMULATOR}', vars, {}) and (not format('{GAIADIR}', vars, {}))):
sys.stderr.write('configure: error: FXOS_SIMULATOR=1 requires GAIADIR to be defined\n')
sys.exit(1)
if vars.get('FXOS_SIMULATOR', ''):
pass
if vars.get('gonkdir', ''):
vars['kernel_name'] = subprocess.check_output('uname -s | tr "[:upper:]" "[:lower:]"', shell=True, env=vars).rstrip('\n')
vars['android_source'] = vars.get('gonkdir', '')
vars['ANDROID_SOURCE'] = vars.get('android_source', '')
vars['ANDROID_NDK'] = format('{ANDROID_SOURCE}/ndk', vars, {})
vars['ANDROID_VERSION'] = '15'
if vars.get('PLATFORM_SDK_VERSION', ''):
vars['ANDROID_VERSION'] = vars.get('PLATFORM_SDK_VERSION', '')
vars['TOOLCHAIN_PREFIX'] = vars.get('gonk_toolchain_prefix', '')
vars['AS'] = format('{gonk_toolchain_prefix}as', vars, {})
vars['CC'] = format('{gonk_toolchain_prefix}gcc', vars, {})
vars['CXX'] = format('{gonk_toolchain_prefix}g++', vars, {})
vars['CPP'] = format('{gonk_toolchain_prefix}cpp', vars, {})
vars['LD'] = format('{gonk_toolchain_prefix}ld', vars, {})
vars['AR'] = format('{gonk_toolchain_prefix}ar', vars, {})
vars['RANLIB'] = format('{gonk_toolchain_prefix}ranlib', vars, {})
vars['STRIP'] = format('{gonk_toolchain_prefix}strip', vars, {})
vars['OBJCOPY'] = format('{gonk_toolchain_prefix}objcopy', vars, {})
if (not os.path.exists(format('{gonkdir}/ndk/sources/cxx-stl/stlport/src/iostream.cpp', vars, {}))):
sys.stderr.write("configure: error: Couldn't find path to stlport sources in the gonk tree\n")
sys.exit(1)
vars['STLPORT_CPPFLAGS'] = format('-I{_topsrcdir}/build/stlport/stlport -I{gonkdir}/ndk/sources/cxx-stl/system/include', vars, {})
vars['STLPORT_LIBS'] = format('{_objdir}/build/stlport/libstlport_static.a', vars, {})
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'arm'):
vars['ARCH_DIR'] = 'arch-arm'
elif fnmatch.fnmatch(case, 'i?86'):
vars['ARCH_DIR'] = 'arch-x86'
case = vars.get('ANDROID_VERSION', '')
if fnmatch.fnmatch(case, '15'):
vars['GONK_INCLUDES'] = format('-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', vars, {})
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEZ'] = '1'
vars['MOZ_NFC'] = '1'
vars['MOZ_B2G_CAMERA'] = '1'
vars['MOZ_OMX_DECODER'] = '1'
vars['MOZ_RTSP'] = '1'
elif (fnmatch.fnmatch(case, '17') or fnmatch.fnmatch(case, '18')):
vars['GONK_INCLUDES'] = format('-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', vars, {})
if os.path.isdir(format('{gonkdir}/external/bluetooth/bluez', vars, {})):
vars['GONK_INCLUDES'] = format('{GONK_INCLUDES} -I{gonkdir}/external/dbus -I{gonkdir}/external/bluetooth/bluez/lib', vars, {})
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEZ'] = '1'
elif os.path.isdir(format('{gonkdir}/external/bluetooth/bluedroid', vars, {})):
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEDROID'] = '1'
vars['MOZ_RTSP'] = '1'
vars['MOZ_NFC'] = '1'
vars['MOZ_B2G_CAMERA'] = '1'
vars['MOZ_OMX_DECODER'] = '1'
vars['MOZ_OMX_ENCODER'] = '1'
elif fnmatch.fnmatch(case, '19'):
vars['GONK_INCLUDES'] = format('-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', vars, {})
vars['MOZ_B2G_CAMERA'] = '1'
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEDROID'] = '1'
vars['MOZ_NFC'] = '1'
vars['MOZ_RTSP'] = '1'
vars['MOZ_OMX_DECODER'] = '1'
vars['MOZ_OMX_ENCODER'] = '1'
vars['MOZ_AUDIO_OFFLOAD'] = '1'
else:
sys.stderr.write('configure: error: Unsupported platform version: $ANDROID_VERSION\n')
sys.exit(1)
vars['CPPFLAGS'] = format('-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}', vars, {})
vars['CFLAGS'] = format('-mandroid -fno-short-enums -fno-exceptions {CFLAGS}', vars, {})
vars['CXXFLAGS'] = format('-mandroid -fno-short-enums -fno-exceptions -Wno-psabi {CXXFLAGS} {STLPORT_CPPFLAGS}', vars, {})
vars['LIBS'] = format('{LIBS} -llog', vars, {})
vars['LDFLAGS'] = format('-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}', vars, {})
if (not vars.get('HOST_CPPFLAGS', '')):
vars['HOST_CPPFLAGS'] = ' '
if (not vars.get('HOST_CFLAGS', '')):
vars['HOST_CFLAGS'] = ' '
if (not vars.get('HOST_CXXFLAGS', '')):
vars['HOST_CXXFLAGS'] = ' '
if (not vars.get('HOST_LDFLAGS', '')):
vars['HOST_LDFLAGS'] = ' '
vars['MOZ_CHROME_FILE_FORMAT'] = 'omni'
vars['direct_nspr_config'] = '1'
else:
subprocess.call('MOZ_ANDROID_NDK', shell=True, env=vars)
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
if (not vars.get('ANDROID_PACKAGE_NAME', '')):
vars['ANDROID_PACKAGE_NAME'] = 'org.mozilla.$(MOZ_APP_NAME)'
vars['MOZ_CHROME_FILE_FORMAT'] = 'omni'
vars['ZLIB_DIR'] = 'yes'
elif fnmatch.fnmatch(case, '*-linux*'):
pass
vars['AR_FLAGS'] = 'crs $@'
if vars.get('COMPILE_ENVIRONMENT', ''):
if (format('{target}', vars, {}) != format('{host}', vars, {})):
pass
else:
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
subprocess.call('sleep 2', shell=True, env=vars)
if (not vars.get('HOST_CC', '')):
vars['HOST_CC'] = vars.get('CC', '')
if (not vars.get('HOST_CFLAGS', '')):
vars['HOST_CFLAGS'] = vars.get('CFLAGS', '')
if (not vars.get('HOST_CXX', '')):
vars['HOST_CXX'] = vars.get('CXX', '')
if (not vars.get('HOST_CXXFLAGS', '')):
vars['HOST_CXXFLAGS'] = vars.get('CXXFLAGS', '')
if (not vars.get('HOST_LDFLAGS', '')):
vars['HOST_LDFLAGS'] = vars.get('LDFLAGS', '')
if (not vars.get('HOST_RANLIB', '')):
vars['HOST_RANLIB'] = vars.get('RANLIB', '')
if (not vars.get('HOST_AR', '')):
vars['HOST_AR'] = vars.get('AR', '')
if (not vars.get('HOST_AR_FLAGS', '')):
vars['HOST_AR_FLAGS'] = vars.get('AR_FLAGS', '')
if vars.get('MOZ_WINCONSOLE', ''):
pass
if (format('{GNU_CC}', vars, {}) and (not format('{CLANG_CC}', vars, {}))):
if (not ((not (format('{GCC_MAJOR_VERSION}', vars, {}) == ('4' and (format('{GCC_MINOR_VERSION}', vars, {}) < '4')))) or (not (vars.get('GCC_MAJOR_VERSION', '') < '4')))):
sys.stderr.write('configure: error: Only GCC 4.4 or newer supported\n')
sys.exit(1)
if args.metro:
vars['MOZ_METRO'] = '1'
else:
vars['MOZ_METRO'] = ''
if vars.get('MOZ_METRO', ''):
vars['WINSDK_TARGETVER'] = '602'
vars['WINVER'] = '502'
vars['CRTDLLVERSION'] = '110'
vars['CRTEXPDLLVERSION'] = '1-1-0'
else:
vars['WINSDK_TARGETVER'] = '601'
vars['WINVER'] = '502'
case = vars.get('WINSDK_TARGETVER', '')
if (fnmatch.fnmatch(case, '601') or fnmatch.fnmatch(case, '602')):
vars['MOZ_WINSDK_TARGETVER'] = format('0{WINSDK_TARGETVER}0000', vars, {})
else:
sys.stderr.write('configure: error: Invalid value for --with-windows-version ($WINSDK_TARGETVER)\n')
sys.exit(1)
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if (vars.get('GCC', '') != 'yes'):
vars['_WIN32_MSVC'] = '1'
vars['CFLAGS'] = format('{CFLAGS} -TC -nologo', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -TP -nologo', vars, {})
vars['_MSVC_VER_FILTER'] = 's|.*[^!-~]([0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?).*|\\1|p'
vars['_CC_MAJOR_VERSION'] = subprocess.check_output('echo ${CC_VERSION} | cut -c 1-2', shell=True, env=vars).rstrip('\n')
vars['_CC_MINOR_VERSION'] = subprocess.check_output('echo ${CC_VERSION} | cut -c 3-4', shell=True, env=vars).rstrip('\n')
vars['_MSC_VER'] = vars.get('CC_VERSION', '')
vars['_CXX_MAJOR_VERSION'] = subprocess.check_output('echo ${CXX_VERSION} | cut -c 1-2', shell=True, env=vars).rstrip('\n')
if (format('{_CC_MAJOR_VERSION}', vars, {}) != format('{_CXX_MAJOR_VERSION}', vars, {})):
sys.stderr.write('configure: error: The major versions of \\$CC and \\$CXX do not match.\n')
sys.exit(1)
if (vars.get('_CC_MAJOR_VERSION', '') == '16'):
vars['_CC_SUITE'] = '10'
vars['MSVS_VERSION'] = '2010'
vars['MSVC_C_RUNTIME_DLL'] = 'msvcr100.dll'
vars['MSVC_CXX_RUNTIME_DLL'] = 'msvcp100.dll'
elif (vars.get('_CC_MAJOR_VERSION', '') == '17'):
vars['_CC_SUITE'] = '11'
vars['MSVS_VERSION'] = '2012'
vars['MSVC_C_RUNTIME_DLL'] = 'msvcr110.dll'
vars['MSVC_CXX_RUNTIME_DLL'] = 'msvcp110.dll'
elif (vars.get('_CC_MAJOR_VERSION', '') == '18'):
vars['_CC_SUITE'] = '12'
vars['MSVS_VERSION'] = '2013'
vars['MSVC_C_RUNTIME_DLL'] = 'msvcr120.dll'
vars['MSVC_CXX_RUNTIME_DLL'] = 'msvcp120.dll'
else:
sys.stderr.write('configure: error: This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.\n')
sys.exit(1)
if (not vars.get('CLANG_CL', '')):
pass
if vars.get('WIN32_REDIST_DIR', ''):
if (not os.path.isdir(vars.get('WIN32_REDIST_DIR', ''))):
sys.stderr.write('configure: error: Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}\n')
sys.exit(1)
vars['WIN32_REDIST_DIR'] = subprocess.check_output('cd "$WIN32_REDIST_DIR" && pwd', shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_METRO', ''):
sys.stdout.write('configure: checking for makepri\n')
if (not 'MAKEPRI'):
sys.stderr.write('configure: error: makepri.exe is required for generating metro browser install components. It should be in the Win8 SDK.\n')
sys.exit(1)
vars['MSMT_TOOL'] = subprocess.check_output("mt 2>&1|grep 'Microsoft (R) Manifest Tool'", shell=True, env=vars).rstrip('\n')
if (not vars.get('MSMT_TOOL', '')):
sys.stderr.write('configure: error: Microsoft (R) Manifest Tool must be in your \\$PATH.\n')
sys.exit(1)
vars['_MSMT_VER_FILTER'] = 's|.*[^!-~]\\([0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\).*|\\1|p'
vars['MSMANIFEST_TOOL_VERSION'] = subprocess.check_output('echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"', shell=True, env=vars).rstrip('\n')
if (not vars.get('MSMANIFEST_TOOL_VERSION', '')):
sys.stdout.write('configure: warning: Unknown version of the Microsoft (R) Manifest Tool.\n')
vars['MSMANIFEST_TOOL'] = '1'
del vars['MSMT_TOOL']
vars['_LD_FULL_VERSION'] = subprocess.check_output('"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"', shell=True, env=vars).rstrip('\n')
vars['_LD_MAJOR_VERSION'] = subprocess.check_output("echo ${_LD_FULL_VERSION} | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
if (format('{_LD_MAJOR_VERSION}', vars, {}) != format('{_CC_SUITE}', vars, {})):
sys.stderr.write('configure: error: The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.\n')
sys.exit(1)
vars['INCREMENTAL_LINKER'] = '1'
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'i*86-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} -env win32', vars, {})
elif fnmatch.fnmatch(case, 'x86_64-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} -env x64', vars, {})
del vars['_MSVC_VER_FILTER']
if (vars.get('ac_cv_have_std__Throw', '') == 'yes'):
if (vars.get('ac_cv_have_dllimport_exception_bug', '') == 'no'):
vars['WRAP_STL_INCLUDES'] = '1'
vars['MOZ_MSVC_STL_WRAP__Throw'] = '1'
elif (vars.get('ac_cv_have__RAISE', '') == 'yes'):
vars['WRAP_STL_INCLUDES'] = '1'
vars['MOZ_MSVC_STL_WRAP__RAISE'] = '1'
else:
sys.stderr.write("configure: error: Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.\n")
sys.exit(1)
if (vars.get('WRAP_STL_INCLUDES', '') == '1'):
vars['STL_FLAGS'] = '-I$(DIST)/stl_wrappers'
vars['CFLAGS'] = format('{CFLAGS} -D_HAS_EXCEPTIONS=0', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -D_HAS_EXCEPTIONS=0', vars, {})
else:
vars['_W32API_MAJOR_VERSION'] = subprocess.check_output("echo $W32API_VERSION | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['_W32API_MINOR_VERSION'] = subprocess.check_output("echo $W32API_VERSION | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('configure: checking for w32api version >= $W32API_VERSION\n')
sys.stdout.write('$res\n')
if (vars.get('res', '') != 'yes'):
sys.stderr.write('configure: error: w32api version $W32API_VERSION or higher required.\n')
sys.exit(1)
sys.stdout.write('configure: checking for windres version >= $WINDRES_VERSION\n')
vars['_WINDRES_VERSION'] = subprocess.check_output("${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('$_WINDRES_VERSION\n')
vars['_WINDRES_MAJOR_VERSION'] = subprocess.check_output("echo $_WINDRES_VERSION | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['_WINDRES_MINOR_VERSION'] = subprocess.check_output("echo $_WINDRES_VERSION | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['_WINDRES_RELEASE_VERSION'] = subprocess.check_output("echo $_WINDRES_VERSION | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
vars['WINDRES_MAJOR_VERSION'] = subprocess.check_output("echo $WINDRES_VERSION | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['WINDRES_MINOR_VERSION'] = subprocess.check_output("echo $WINDRES_VERSION | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['WINDRES_RELEASE_VERSION'] = subprocess.check_output("echo $WINDRES_VERSION | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
if (format('{_WINDRES_MAJOR_VERSION}', vars, {}) < (format('{WINDRES_MAJOR_VERSION}', vars, {}) or (format('{_WINDRES_MAJOR_VERSION}', vars, {}) == (format('{WINDRES_MAJOR_VERSION}', vars, {}) and (format('{_WINDRES_MINOR_VERSION}', vars, {}) < (format('{WINDRES_MINOR_VERSION}', vars, {}) or (format('{_WINDRES_MAJOR_VERSION}', vars, {}) == (format('{WINDRES_MAJOR_VERSION}', vars, {}) and (format('{_WINDRES_MINOR_VERSION}', vars, {}) == (format('{WINDRES_MINOR_VERSION}', vars, {}) and (format('{_WINDRES_RELEASE_VERSION}', vars, {}) < format('{WINDRES_RELEASE_VERSION}', vars, {})))))))))))):
sys.stderr.write('configure: error: windres version $WINDRES_VERSION or higher is required to build.\n')
sys.exit(1)
if vars.get('MIDL', ''):
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'i*86-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} --win32 -m32', vars, {})
elif fnmatch.fnmatch(case, 'x86_64-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} --win64 -m64', vars, {})
vars['MOZ_WINSDK_MAXVER'] = '0x06020000'
sys.stdout.write('configure: checking for Windows SDK being recent enough\n')
if (not subprocess.call(format('{PERL} -e exit(0x{MOZ_WINSDK_TARGETVER} > {MOZ_WINSDK_MAXVER})', vars, {}), shell=True, env=vars)):
sys.stdout.write('"yes"\n')
else:
sys.stdout.write('"no"\n')
sys.stderr.write('configure: 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.\n')
sys.exit(1)
if vars.get('_WIN32_MSVC', ''):
vars['SKIP_PATH_CHECKS'] = '1'
vars['SKIP_COMPILER_CHECKS'] = '1'
vars['SKIP_LIBRARY_CHECKS'] = '1'
if (not vars.get('TINDERBOX_SKIP_PERL_VERSION_CHECK', '')):
sys.stdout.write('configure: checking for minimum required perl version >= $PERL_VERSION\n')
vars['_perl_version'] = subprocess.check_output('PERL_VERSION=$PERL_VERSION $PERL -e \'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }\' 2>&5', shell=True, env=vars).rstrip('\n')
vars['_perl_res'] = vars.get('?', '')
sys.stdout.write('$_perl_version\n')
if (vars.get('_perl_res', '') != '0'):
sys.stderr.write('configure: error: Perl $PERL_VERSION or higher is required.\n')
sys.exit(1)
sys.stdout.write('configure: checking for full perl installation\n')
vars['_perl_archlib'] = subprocess.check_output("$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5", shell=True, env=vars).rstrip('\n')
vars['_perl_res'] = vars.get('?', '')
if (vars.get('_perl_res', '') != '0'):
sys.stdout.write('no\n')
sys.stderr.write('configure: error: Cannot find Config.pm or \\$Config{archlib}. A full perl installation is required.\n')
sys.exit(1)
else:
sys.stdout.write('yes\n')
if (not vars.get('COMPILE_ENVIRONMENT', '')):
vars['NSINSTALL_BIN'] = '$(PYTHON) $(topsrcdir)/config/nsinstall.py'
if ((not vars.get('UNZIP', '')) or (vars.get('UNZIP', '') == ':')):
sys.stderr.write('configure: error: unzip not found in \\$PATH\n')
sys.exit(1)
if ((not vars.get('ZIP', '')) or (vars.get('ZIP', '') == ':')):
sys.stderr.write('configure: error: zip not found in \\$PATH\n')
sys.exit(1)
if ((not vars.get('XARGS', '')) or (vars.get('XARGS', '') == ':')):
sys.stderr.write('configure: error: xargs not found in \\$PATH .\n')
sys.exit(1)
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('UNIVERSAL_BINARY', ''):
if (not vars.get('UNIFY_DIST', '')):
sys.stderr.write('configure: error: You need to provide the --with-unify-dist=dir argument when performing a universal build\n')
sys.exit(1)
case = vars.get('UNIFY_DIST', '')
if fnmatch.fnmatch(case, '/*'):
pass else:
vars['UNIFY_DIST'] = format('{MOZ_BUILD_ROOT}/{UNIFY_DIST}', vars, {})
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-darwin*'):
if vars.get('_MACOSX_DEPLOYMENT_TARGET', ''):
vars['MACOSX_DEPLOYMENT_TARGET'] = vars.get('_MACOSX_DEPLOYMENT_TARGET', '')
exports.add('MACOSX_DEPLOYMENT_TARGET')
else:
vars['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
exports.add('MACOSX_DEPLOYMENT_TARGET')
vars['MACOS_SDK_DIR'] = ''
vars['MACOS_PRIVATE_FRAMEWORKS_DIR_DEFAULTED'] = ''
if (not vars.get('MACOS_PRIVATE_FRAMEWORKS_DEFAULTED', '')):
if (not vars.get('CROSS_COMPILE', '')):
sys.stdout.write('configure: warning: You should only be using --with-macos-private-frameworks when cross-compiling.\n')
if (not os.path.isdir(vars.get('MACOS_PRIVATE_FRAMEWORKS_DIR', ''))):
sys.stderr.write('configure: error: PrivateFrameworks directory not found.\n')
sys.exit(1)
if vars.get('MACOS_SDK_DIR', ''):
if (not os.path.isdir(vars.get('MACOS_SDK_DIR', ''))):
sys.stderr.write('configure: error: SDK not found. When using --with-macos-sdk, you must\nspecify a valid SDK. SDKs are installed when the optional cross-development\ntools are selected during the Xcode/Developer Tools installation.\n')
sys.exit(1)
vars['CFLAGS'] = format('{CFLAGS} -isysroot {MACOS_SDK_DIR}', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -isysroot {MACOS_SDK_DIR}', vars, {})
vars['CPP'] = format('{CPP} -isysroot {MACOS_SDK_DIR}', vars, {})
vars['CXXCPP'] = format('{CXXCPP} -isysroot {MACOS_SDK_DIR}', vars, {})
sys.stdout.write('configure: checking for valid compiler/Mac OS X SDK combination\n')
sys.stdout.write('$result\n')
if (vars.get('result', '') == 'no'):
sys.stderr.write('configure: error: The selected compiler and Mac OS X SDK are incompatible.\n')
sys.exit(1)
if vars.get('MAKE', ''):
if (subprocess.check_output('echo $MAKE | grep -c make.py', shell=True, env=vars).rstrip('\n') != '1'):
vars['NOT_PYMAKE'] = vars.get('MAKE', '')
case = vars.get('host_os', '')
if fnmatch.fnmatch(case, 'mingw*'):
pass
if (vars.get('GMAKE', '') == ':'):
sys.stderr.write('configure: error: GNU make not found\n')
sys.exit(1)
if (not vars.get('MAKE', '')):
vars['MAKE'] = vars.get('GMAKE', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
vars['XCFLAGS'] = vars.get('X_CFLAGS', '')
vars['AS_BIN'] = vars.get('AS', '')
vars['AR_LIST'] = '$(AR) t'
vars['AR_EXTRACT'] = '$(AR) x'
vars['AR_DELETE'] = '$(AR) d'
vars['AS'] = '$(CC)'
vars['AS_DASH_C_FLAG'] = '-c'
vars['DLL_PREFIX'] = 'lib'
vars['LIB_PREFIX'] = 'lib'
vars['DLL_SUFFIX'] = '.so'
vars['OBJ_SUFFIX'] = 'o'
vars['LIB_SUFFIX'] = 'a'
vars['ASM_SUFFIX'] = 's'
vars['IMPORT_LIB_SUFFIX'] = ''
vars['TARGET_MD_ARCH'] = 'unix'
vars['DIRENT_INO'] = 'd_ino'
vars['MOZ_USER_DIR'] = '.mozilla'
vars['MOZ_FIX_LINK_PATHS'] = '-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
vars['MOZ_FS_LAYOUT'] = 'unix'
vars['USE_DEPENDENT_LIBS'] = '1'
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-gtk2'
if vars.get('CROSS_COMPILE', ''):
vars['OS_TARGET'] = vars.get('target_os', '')
vars['OS_ARCH'] = subprocess.check_output("echo $target_os | sed -e 's|/|_|g'", shell=True, env=vars).rstrip('\n')
vars['OS_RELEASE'] = ''
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'linux*'):
vars['OS_ARCH'] = 'Linux'
vars['OS_TARGET'] = 'Linux'
elif fnmatch.fnmatch(case, 'kfreebsd*-gnu'):
vars['OS_ARCH'] = 'GNU_kFreeBSD'
vars['OS_TARGET'] = 'GNU/kFreeBSD'
elif fnmatch.fnmatch(case, 'gnu*'):
vars['OS_ARCH'] = 'GNU'
elif fnmatch.fnmatch(case, 'solaris*'):
vars['OS_ARCH'] = 'SunOS'
vars['OS_RELEASE'] = '5'
elif fnmatch.fnmatch(case, 'mingw*'):
vars['OS_ARCH'] = 'WINNT'
vars['OS_TARGET'] = 'WINNT'
elif fnmatch.fnmatch(case, 'darwin*'):
vars['OS_ARCH'] = 'Darwin'
vars['OS_TARGET'] = 'Darwin'
elif fnmatch.fnmatch(case, 'dragonfly*'):
vars['OS_ARCH'] = 'DragonFly'
vars['OS_TARGET'] = 'DragonFly'
elif fnmatch.fnmatch(case, 'freebsd*'):
vars['OS_ARCH'] = 'FreeBSD'
vars['OS_TARGET'] = 'FreeBSD'
elif fnmatch.fnmatch(case, 'netbsd*'):
vars['OS_ARCH'] = 'NetBSD'
vars['OS_TARGET'] = 'NetBSD'
elif fnmatch.fnmatch(case, 'openbsd*'):
vars['OS_ARCH'] = 'OpenBSD'
vars['OS_TARGET'] = 'OpenBSD'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
vars['OS_ARCH'] = 'Linux'
vars['OS_TARGET'] = 'Android'
else:
vars['OS_TARGET'] = subprocess.check_output('uname -s', shell=True, env=vars).rstrip('\n')
vars['OS_ARCH'] = subprocess.check_output("uname -s | sed -e 's|/|_|g'", shell=True, env=vars).rstrip('\n')
vars['OS_RELEASE'] = subprocess.check_output('uname -r', shell=True, env=vars).rstrip('\n')
vars['OS_TEST'] = vars.get('target_cpu', '')
vars['HOST_OS_ARCH'] = subprocess.check_output("echo $host_os | sed -e 's|/|_|g'", shell=True, env=vars).rstrip('\n')
case = vars.get('HOST_OS_ARCH', '')
if fnmatch.fnmatch(case, 'mingw*'):
vars['HOST_OS_ARCH'] = 'WINNT'
elif fnmatch.fnmatch(case, 'darwin*'):
vars['HOST_OS_ARCH'] = 'Darwin'
elif fnmatch.fnmatch(case, 'linux*'):
vars['HOST_OS_ARCH'] = 'Linux'
elif fnmatch.fnmatch(case, 'kfreebsd*-gnu'):
vars['HOST_OS_ARCH'] = 'GNU_kFreeBSD'
elif fnmatch.fnmatch(case, 'gnu*'):
vars['HOST_OS_ARCH'] = 'GNU'
elif fnmatch.fnmatch(case, 'dragonfly*'):
vars['HOST_OS_ARCH'] = 'DragonFly'
elif fnmatch.fnmatch(case, 'freebsd*'):
vars['HOST_OS_ARCH'] = 'FreeBSD'
elif fnmatch.fnmatch(case, 'netbsd*'):
vars['HOST_OS_ARCH'] = 'NetBSD'
elif fnmatch.fnmatch(case, 'openbsd*'):
vars['HOST_OS_ARCH'] = 'OpenBSD'
elif fnmatch.fnmatch(case, 'solaris*'):
vars['HOST_OS_ARCH'] = 'SunOS'
vars['SOLARIS_SUNPRO_CC'] = ''
vars['SOLARIS_SUNPRO_CXX'] = ''
if (not vars.get('GNU_CC', '')):
if (subprocess.check_output("$CC -V 2>&1 | egrep -c 'Sun.*C '", shell=True, env=vars).rstrip('\n') != '0'):
vars['SOLARIS_SUNPRO_CC'] = '1'
if (not vars.get('GNU_CXX', '')):
if (subprocess.check_output("$CXX -V 2>&1 | egrep -c 'Sun.*C\\+\\+ '", shell=True, env=vars).rstrip('\n') != '0'):
vars['SOLARIS_SUNPRO_CXX'] = '1'
case = vars.get('OS_ARCH', '')
if fnmatch.fnmatch(case, 'WINNT'):
if (not vars.get('CROSS_COMPILE', '')):
vars['OS_TEST'] = subprocess.check_output('uname -p', shell=True, env=vars).rstrip('\n')
elif fnmatch.fnmatch(case, 'Windows_NT'):
vars['OS_ARCH'] = 'WINNT'
vars['OS_TARGET'] = 'WINNT'
vars['OS_MINOR_RELEASE'] = subprocess.check_output('uname -v', shell=True, env=vars).rstrip('\n')
if (vars.get('OS_MINOR_RELEASE', '') == '00'):
vars['OS_MINOR_RELEASE'] = '0'
vars['OS_RELEASE'] = format('{OS_RELEASE}.{OS_MINOR_RELEASE}', vars, {})
elif fnmatch.fnmatch(case, 'MINGW*_NT*'):
vars['OS_RELEASE'] = subprocess.check_output("expr $OS_ARCH : '.*NT-\\(.*\\)'", shell=True, env=vars).rstrip('\n')
vars['OS_ARCH'] = 'WINNT'
vars['OS_TARGET'] = 'WINNT'
elif fnmatch.fnmatch(case, 'AIX'):
vars['OS_RELEASE'] = format('{cmd0}.{cmd1}', vars, {'cmd0':subprocess.check_output('uname -v', shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output('uname -r', shell=True, env=vars).rstrip('\n')})
vars['OS_TEST'] = vars.get('target_cpu', '')
elif fnmatch.fnmatch(case, 'Darwin'):
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'powerpc*'):
vars['OS_TEST'] = 'ppc'
elif fnmatch.fnmatch(case, 'i*86*'):
vars['OS_TEST'] = 'i386'
elif fnmatch.fnmatch(case, 'x86_64'):
vars['OS_TEST'] = 'x86_64'
elif (not vars.get('CROSS_COMPILE', '')):
vars['OS_TEST'] = subprocess.check_output('uname -p', shell=True, env=vars).rstrip('\n')
case = vars.get('OS_TEST', '')
if (fnmatch.fnmatch(case, '*86') or fnmatch.fnmatch(case, 'i86pc')):
vars['CPU_ARCH'] = 'x86'
elif (fnmatch.fnmatch(case, 'powerpc64') or fnmatch.fnmatch(case, 'ppc64') or fnmatch.fnmatch(case, 'powerpc64le') or fnmatch.fnmatch(case, 'ppc64le')):
vars['CPU_ARCH'] = 'ppc64'
elif (fnmatch.fnmatch(case, 'powerpc') or fnmatch.fnmatch(case, 'ppc') or fnmatch.fnmatch(case, 'rs6000')):
vars['CPU_ARCH'] = 'ppc'
elif (fnmatch.fnmatch(case, 'Alpha') or fnmatch.fnmatch(case, 'alpha') or fnmatch.fnmatch(case, 'ALPHA')):
vars['CPU_ARCH'] = 'Alpha'
elif fnmatch.fnmatch(case, 's390'):
vars['CPU_ARCH'] = 's390'
elif fnmatch.fnmatch(case, 's390x'):
vars['CPU_ARCH'] = 's390x'
elif (fnmatch.fnmatch(case, 'hppa*') or fnmatch.fnmatch(case, 'parisc')):
vars['CPU_ARCH'] = 'hppa'
elif (fnmatch.fnmatch(case, 'sun4u') or fnmatch.fnmatch(case, 'sparc*')):
vars['CPU_ARCH'] = 'sparc'
elif (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'ia64')):
vars['CPU_ARCH'] = vars.get('OS_TEST', '')
elif fnmatch.fnmatch(case, 'arm*'):
vars['CPU_ARCH'] = 'arm'
elif (fnmatch.fnmatch(case, 'mips') or fnmatch.fnmatch(case, 'mipsel')):
vars['CPU_ARCH'] = 'mips'
elif fnmatch.fnmatch(case, 'aarch64*'):
vars['CPU_ARCH'] = 'aarch64'
if (not vars.get('OS_TARGET', '')):
vars['OS_TARGET'] = vars.get('OS_ARCH', '')
vars['OS_CONFIG'] = format('{OS_TARGET}{OS_RELEASE}', vars, {})
vars['INTEL_ARCHITECTURE'] = ''
case = vars.get('OS_TEST', '')
if (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'i?86')):
vars['INTEL_ARCHITECTURE'] = '1'
if vars.get('COMPILE_ENVIRONMENT', ''):
vars['configure_static_assert_macros'] = '\n#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)\n#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)\n#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]\n'
sys.stdout.write('configure: checking that static assertion macros used in autoconf tests work\n')
sys.stdout.write('"$ac_cv_static_assertion_macros_work"\n')
if (vars.get('ac_cv_static_assertion_macros_work', '') == 'no'):
sys.stderr.write('configure: error: Compiler cannot compile macros used in autoconf tests.\n')
sys.exit(1)
if vars.get('CLANG_CC', ''):
vars['_WARNINGS_CFLAGS'] = format('-Qunused-arguments {_WARNINGS_CFLAGS}', vars, {})
vars['CPPFLAGS'] = format('-Qunused-arguments {CPPFLAGS}', vars, {})
if vars.get('CLANG_CXX', ''):
vars['_WARNINGS_CXXFLAGS'] = format('-Qunused-arguments {_WARNINGS_CXXFLAGS}', vars, {})
if args.address_sanitizer:
vars['MOZ_ASAN'] = '1'
else:
vars['MOZ_ASAN'] = ''
if vars.get('MOZ_ASAN', ''):
vars['MOZ_LLVM_HACKS'] = '1'
if args.llvm_hacks:
vars['MOZ_LLVM_HACKS'] = '1'
else:
vars['MOZ_LLVM_HACKS'] = ''
if vars.get('MOZ_LLVM_HACKS', ''):
vars['MOZ_NO_WLZDEFS'] = '1'
vars['MOZ_CFLAGS_NSS'] = '1'
if vars.get('GNU_CC', ''):
vars['MMX_FLAGS'] = '-mmmx'
vars['SSE_FLAGS'] = '-msse'
vars['SSE2_FLAGS'] = '-msse2'
vars['CFLAGS'] = format('{CFLAGS} -std=gnu99', vars, {})
if (vars.get('OS_ARCH', '') != 'Darwin'):
vars['CFLAGS'] = format('{CFLAGS} -fgnu89-inline', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -fno-strict-aliasing', vars, {})
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(DSO_SONAME) -o $@'
vars['WARNINGS_AS_ERRORS'] = '-Werror'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '-fPIC'
vars['ASFLAGS'] = format('{ASFLAGS} -fPIC', vars, {})
sys.stdout.write('configure: checking for --noexecstack option to as\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -Wa,--noexecstack', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
sys.stdout.write('configure: checking for -z noexecstack option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,noexecstack', vars, {})
sys.stdout.write('configure: checking for -z text option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,text', vars, {})
sys.stdout.write('configure: checking for --build-id option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,--build-id', vars, {})
sys.stdout.write('configure: checking for --ignore-unresolved-symbol option to ld\n')
vars['HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED'] = ''
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,--ignore-unresolved-symbol,environ', vars, {})
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
sys.stdout.write('configure: checking if toolchain supports -mssse3 option\n')
vars['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] = ''
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -mssse3', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
sys.stdout.write('configure: checking if toolchain supports -msse4.1 option\n')
vars['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1'] = ''
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -msse4.1', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'x86_64')):
sys.stdout.write('configure: checking for x86 AVX2 asm support in compiler\n')
sys.stdout.write('"$result"\n')
if (vars.get('result', '') == 'yes'):
vars['HAVE_X86_AVX2'] = '1'
vars['DSO_LDOPTS'] = '-shared'
if vars.get('GCC_USE_GNU_LD', ''):
if (not vars.get('MOZ_NO_WLZDEFS', '')):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -Wl,-z,defs', vars, {})
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'DragonFly') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'NetBSD') or fnmatch.fnmatch(case, 'OpenBSD')):
if vars.get('HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED', ''):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -Wl,--ignore-unresolved-symbol,environ', vars, {})
else:
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -Wl,--warn-unresolved-symbols', vars, {})
vars['_WARNINGS_CFLAGS'] = format('{_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement', vars, {})
vars['_WARNINGS_CFLAGS'] = format('{_WARNINGS_CFLAGS} -Wno-unused', vars, {})
if ((not format('{INTEL_CC}', vars, {})) and (not format('{CLANG_CC}', vars, {}))):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'hppa') or fnmatch.fnmatch(case, 'ia64') or fnmatch.fnmatch(case, 'sparc') or fnmatch.fnmatch(case, 'arm')):
pass else:
vars['_WARNINGS_CFLAGS'] = format('{_WARNINGS_CFLAGS} -Wcast-align', vars, {})
vars['_DEFINES_CFLAGS'] = '-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
vars['_USE_CPP_INCLUDE_FLAG'] = '1'
vars['ASFLAGS'] = format('{ASFLAGS} {_DEFINES_CFLAGS}', vars, {})
elif vars.get('SOLARIS_SUNPRO_CC', ''):
vars['DSO_CFLAGS'] = ''
if (vars.get('CPU_ARCH', '') == 'sparc'):
vars['DSO_PIC_CFLAGS'] = '-xcode=pic32'
else:
vars['DSO_PIC_CFLAGS'] = '-KPIC'
vars['_DEFINES_CFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else:
vars['MKSHLIB'] = '$(LD) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(LD) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['DSO_LDOPTS'] = '-shared'
if vars.get('GNU_LD', ''):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -z defs', vars, {})
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '-KPIC'
vars['_DEFINES_CFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
if vars.get('GNU_CXX', ''):
vars['CXXFLAGS'] = format('{CXXFLAGS} -fno-exceptions -fno-strict-aliasing', vars, {})
vars['_WARNINGS_CXXFLAGS'] = format('{_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual', vars, {})
if ((not format('{INTEL_CXX}', vars, {})) and (not format('{CLANG_CXX}', vars, {}))):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'hppa') or fnmatch.fnmatch(case, 'ia64') or fnmatch.fnmatch(case, 'sparc') or fnmatch.fnmatch(case, 'arm')):
pass else:
vars['_WARNINGS_CXXFLAGS'] = format('{_WARNINGS_CXXFLAGS} -Wcast-align', vars, {})
vars['_DEFINES_CXXFLAGS'] = '-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
vars['_USE_CPP_INCLUDE_FLAG'] = '1'
if vars.get('CLANG_CXX', ''):
vars['_WARNINGS_CXXFLAGS'] = format('{_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions', vars, {})
else:
vars['_DEFINES_CXXFLAGS'] = '-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
vars['MKSHLIB_FORCE_ALL'] = ''
vars['MKSHLIB_UNFORCE_ALL'] = ''
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('GNU_CC', ''):
sys.stdout.write('configure: checking whether ld has archive extraction flags\n')
if (vars.get('ac_cv_mkshlib_force_and_unforce', '') == 'no'):
sys.stdout.write('no\n')
else:
sys.stdout.write('yes\n')
subprocess.call(format('eval {ac_cv_mkshlib_force_and_unforce}', vars, {}), shell=True, env=vars)
vars['MKSHLIB_FORCE_ALL'] = vars.get('force', '')
vars['MKSHLIB_UNFORCE_ALL'] = vars.get('unforce', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
sys.stdout.write('configure: checking for 64-bit OS\n')
sys.stdout.write('"$result"\n')
if (vars.get('result', '') == 'yes'):
vars['HAVE_64BIT_BUILD'] = '1'
if args.profiling:
vars['MOZ_PROFILING'] = '1'
else:
vars['MOZ_PROFILING'] = ''
if args.systrace:
vars['MOZ_USE_SYSTRACE'] = '1'
else:
vars['MOZ_USE_SYSTRACE'] = ''
if vars.get('MOZ_USE_SYSTRACE', ''):
pass
if (format('{MOZ_PROFILING}', vars, {}) and (not format('{STRIP_FLAGS}', vars, {}))):
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'Linux') or fnmatch.fnmatch(case, 'DragonFly') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'NetBSD') or fnmatch.fnmatch(case, 'OpenBSD')):
vars['STRIP_FLAGS'] = '--strip-debug'
if args.valgrind:
vars['MOZ_VALGRIND'] = '1'
else:
vars['MOZ_VALGRIND'] = ''
if vars.get('MOZ_VALGRIND', ''):
pass
if args.jprof:
vars['MOZ_JPROF'] = '1'
else:
vars['MOZ_JPROF'] = ''
if vars.get('MOZ_JPROF', ''):
vars['MOZ_PROFILING'] = '1'
vars['MOZ_ENABLE_PROFILER_SPS'] = '1'
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Android'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'arm')):
pass else:
vars['MOZ_ENABLE_PROFILER_SPS'] = ''
elif fnmatch.fnmatch(case, 'Linux'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'x86_64')):
pass else:
vars['MOZ_ENABLE_PROFILER_SPS'] = ''
elif (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin')):
pass else:
vars['MOZ_ENABLE_PROFILER_SPS'] = ''
if vars.get('MOZ_ENABLE_PROFILER_SPS', ''):
pass
if args.shark:
vars['MOZ_SHARK'] = '1'
else:
vars['MOZ_SHARK'] = ''
if vars.get('MOZ_SHARK', ''):
vars['MOZ_PROFILING'] = '1'
if args.instruments:
vars['MOZ_INSTRUMENTS'] = '1'
else:
vars['MOZ_INSTRUMENTS'] = ''
if vars.get('MOZ_INSTRUMENTS', ''):
vars['MOZ_PROFILING'] = '1'
if args.callgrind:
vars['MOZ_CALLGRIND'] = '1'
else:
vars['MOZ_CALLGRIND'] = ''
if vars.get('MOZ_CALLGRIND', ''):
vars['MOZ_PROFILING'] = '1'
if args.vtune:
vars['MOZ_VTUNE'] = '1'
else:
vars['MOZ_VTUNE'] = ''
if vars.get('MOZ_VTUNE', ''):
vars['MOZ_PROFILING'] = '1'
if vars.get('MOZ_PROFILING', ''):
pass
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*mingw*'):
if vars.get('_WIN32_MSVC', ''):
vars['HOST_AR'] = 'lib'
vars['HOST_AR_FLAGS'] = '-NOLOGO -OUT:$@'
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -TC -nologo', vars, {})
vars['HOST_RANLIB'] = 'echo ranlib'
else:
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -mwindows', vars, {})
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS', vars, {})
vars['HOST_NSPR_MDCPUCFG'] = '\\"md/_winnt.cfg\\"'
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O2')
vars['HOST_BIN_SUFFIX'] = '.exe'
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*mingw*'):
vars['PERL'] = format('/bin/sh {_topsrcdir}/build/msys-perl-wrapper', vars, {})
case = vars.get('host_cpu', '')
if fnmatch.fnmatch(case, 'i*86'):
if vars.get('_WIN32_MSVC', ''):
vars['HOST_LDFLAGS'] = format('{HOST_LDFLAGS} -MACHINE:X86', vars, {})
elif fnmatch.fnmatch(case, 'x86_64'):
if vars.get('_WIN32_MSVC', ''):
vars['HOST_LDFLAGS'] = format('{HOST_LDFLAGS} -MACHINE:X64', vars, {})
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -D_AMD64_', vars, {})
elif fnmatch.fnmatch(case, '*-darwin*'):
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_UNIX -DXP_MACOSX -DNO_X11', vars, {})
vars['HOST_NSPR_MDCPUCFG'] = '\\"md/_darwin.cfg\\"'
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O3')
elif (fnmatch.fnmatch(case, '*-linux*') or fnmatch.fnmatch(case, '*-kfreebsd*-gnu') or fnmatch.fnmatch(case, '*-gnu*')):
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_UNIX', vars, {})
vars['HOST_NSPR_MDCPUCFG'] = '\\"md/_linux.cfg\\"'
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O3')
else:
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_UNIX', vars, {})
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O2')
sys.stdout.write('configure: checking for custom <inttypes.h> implementation\n')
if vars.get('MOZ_CUSTOM_INTTYPES_H', ''):
sys.stdout.write('using $MOZ_CUSTOM_INTTYPES_H\n')
else:
sys.stdout.write('none specified\n')
vars['MOZILLA_VERSION'] = subprocess.check_output('$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir', shell=True, env=vars).rstrip('\n')
vars['MOZILLA_UAVERSION'] = subprocess.check_output('$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion', shell=True, env=vars).rstrip('\n')
vars['MOZILLA_SYMBOLVERSION'] = subprocess.check_output('$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion', shell=True, env=vars).rstrip('\n')
vars['FIREFOX_VERSION'] = subprocess.check_output('cat $_topsrcdir/browser/config/version.txt', shell=True, env=vars).rstrip('\n')
if (not vars.get('FIREFOX_VERSION', '')):
sys.stderr.write('configure: error: FIREFOX_VERSION is unexpectedly blank.\n')
sys.exit(1)
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-aix*'):
if (not vars.get('GNU_CC', '')):
if (not vars.get('HAVE_64BIT_BUILD', '')):
if (vars.get('AIX_OBJMODEL', '') == 'ibm'):
vars['CXXFLAGS'] = format('{CXXFLAGS} -qobjmodel=ibm', vars, {})
else:
vars['AIX_OBJMODEL'] = 'compat'
else:
vars['AIX_OBJMODEL'] = 'compat'
vars['DSO_LDOPTS'] = '-qmkshrobj=1'
vars['DSO_CFLAGS'] = '-qflag=w:w'
vars['DSO_PIC_CFLAGS'] = ''
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-brtl -blibpath:/usr/lib:/lib', vars, {})
vars['MOZ_FIX_LINK_PATHS'] = ''
vars['MKSHLIB'] = '$(CXX) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(DSO_LDOPTS) -o $@'
if vars.get('COMPILE_ENVIRONMENT', ''):
sys.stdout.write('configure: checking for IBM XLC/C++ compiler version >= 9.0.0.7\n')
if vars.get('_BAD_COMPILER', ''):
sys.stdout.write('no\n')
sys.stderr.write('configure: error: IBM XLC/C++ 9.0.0.7 or higher is required to build.\n')
sys.exit(1)
else:
sys.stdout.write('yes\n')
vars['TARGET_COMPILER_ABI'] = 'ibmc'
vars['CC_VERSION'] = subprocess.check_output("lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'", shell=True, env=vars).rstrip('\n')
vars['CXX_VERSION'] = subprocess.check_output("lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'", shell=True, env=vars).rstrip('\n')
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'aix4.1*'):
vars['DLL_SUFFIX'] = '_shr.a'
if vars.get('COMPILE_ENVIRONMENT', ''):
pass
elif fnmatch.fnmatch(case, '*-darwin*'):
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
vars['MOZ_OPTIMIZE_FLAGS'] = '-O3'
if vars.get('HAVE_64BIT_BUILD', ''):
vars['MOZ_MEMORY'] = '1'
vars['DLL_SUFFIX'] = '.dylib'
vars['DSO_LDOPTS'] = ''
vars['STRIP_FLAGS'] = format('{STRIP_FLAGS} -x -S', vars, {})
if (vars.get('ac_cv_ios_target', '') == 'yes'):
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-uikit'
else:
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-cocoa'
vars['MOZ_DEBUG_LDFLAGS'] = format('{MOZ_DEBUG_LDFLAGS} -framework ExceptionHandling', vars, {})
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_darwin.cfg\\"'
if (format('x{lto_is_enabled}', vars, {}) == 'xyes'):
print 'Skipping -dead_strip because lto is enabled.'
elif (format('x{enable_dtrace}', vars, {}) == 'xyes'):
print 'Skipping -dead_strip because DTrace is enabled. See bug 403132.'
else:
sys.stdout.write('configure: checking for -dead_strip option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-dead_strip', vars, {})
if vars.get('_HAVE_DEAD_STRIP', ''):
sys.stdout.write('yes\n')
vars['MOZ_OPTIMIZE_LDFLAGS'] = '-Wl,-dead_strip'
else:
sys.stdout.write('no\n')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
sys.stdout.write('configure: checking for -allow_heap_execute option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-allow_heap_execute', vars, {})
if vars.get('_HAVE_ALLOW_HEAP_EXECUTE', ''):
sys.stdout.write('yes\n')
vars['MOZ_ALLOW_HEAP_EXECUTE_FLAGS'] = '-Wl,-allow_heap_execute'
else:
sys.stdout.write('no\n')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['MOZ_FIX_LINK_PATHS'] = '-Wl,-executable_path,$(LIBXUL_DIST)/bin'
elif fnmatch.fnmatch(case, 'ia64*-hpux*'):
vars['DLL_SUFFIX'] = '.so'
if (not vars.get('GNU_CC', '')):
vars['DSO_LDOPTS'] = '-b'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = ''
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
vars['CXXFLAGS'] = format('{CXXFLAGS} -Wc,-ansi_for_scope,on', vars, {})
else:
vars['DSO_LDOPTS'] = '-b -E'
vars['MKSHLIB'] = '$(LD) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(LD) $(DSO_LDOPTS) -o $@'
vars['MOZ_FIX_LINK_PATHS'] = ''
elif fnmatch.fnmatch(case, '*-hpux*'):
vars['DLL_SUFFIX'] = '.sl'
if (not vars.get('GNU_CC', '')):
vars['DSO_LDOPTS'] = '-b -Wl,+s'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '+Z'
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
vars['MKCSHLIB'] = '$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
vars['CXXFLAGS'] = format('{CXXFLAGS} -Wc,-ansi_for_scope,on', vars, {})
else:
vars['DSO_LDOPTS'] = '-b -E +s'
vars['MKSHLIB'] = '$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
vars['MKCSHLIB'] = '$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
vars['MOZ_POST_PROGRAM_COMMAND'] = 'chatr +s enable'
elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
vars['no_x'] = 'yes'
if vars.get('gonkdir', ''):
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-gonk'
vars['_PLATFORM_HAVE_RIL'] = '1'
vars['MOZ_B2G_FM'] = '1'
vars['MOZ_SYNTH_PICO'] = '1'
else:
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-android'
vars['MOZ_LINKER'] = '1'
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_linux.cfg\\"'
vars['MOZ_GFX_OPTIMIZE_MOBILE'] = '1'
vars['MOZ_OPTIMIZE_FLAGS'] = '-Os -freorder-blocks -fno-reorder-functions'
elif fnmatch.fnmatch(case, '*-*linux*'):
if (format('{INTEL_CC}', vars, {}) or format('{INTEL_CXX}', vars, {})):
vars['MOZ_OPTIMIZE_FLAGS'] = '-O2'
elif (format('{GNU_CC}', vars, {}) or format('{GNU_CXX}', vars, {})):
case = vars.get('GCC_VERSION', '')
if fnmatch.fnmatch(case, '4.5.*'):
vars['MOZ_OPTIMIZE_SIZE_TWEAK'] = '-finline-limit=50'
vars['MOZ_PGO_OPTIMIZE_FLAGS'] = '-O3'
vars['MOZ_OPTIMIZE_FLAGS'] = format('-Os -freorder-blocks {MOZ_OPTIMIZE_SIZE_TWEAK}', vars, {})
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_linux.cfg\\"'
vars['MOZ_MEMORY'] = '1'
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'alpha*'):
vars['CFLAGS'] = format('{CFLAGS} -mieee', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mieee', vars, {})
if (not vars.get('MC', '')):
vars['MC'] = 'mc.exe'
elif fnmatch.fnmatch(case, '*-mingw*'):
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = ''
vars['DLL_SUFFIX'] = '.dll'
vars['RC'] = 'rc.exe'
vars['MC'] = 'mc.exe'
if (format('{GNU_CC}', vars, {}) or format('{CLANG_CC}', vars, {})):
vars['CC'] = format('{CC} -mwindows', vars, {})
vars['CXX'] = format('{CXX} -mwindows', vars, {})
vars['CPP'] = format('{CPP} -mwindows', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -mms-bitfields', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mms-bitfields', vars, {})
vars['DSO_LDOPTS'] = '-shared'
vars['MKSHLIB'] = '$(CXX) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(DSO_LDOPTS) -o $@'
vars['RC'] = '$(WINDRES)'
vars['LDFLAGS'] = format('{LDFLAGS} -static-libgcc -static-libstdc++', vars, {})
vars['NSPR_LDFLAGS'] = format('{NSPR_LDFLAGS} -static-libgcc', vars, {})
vars['RCFLAGS'] = '-O coff --use-temp-file'
vars['LIBS'] = format('{LIBS} -luuid -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32 -lnetapi32', vars, {})
vars['MOZ_FIX_LINK_PATHS'] = ''
vars['DLL_PREFIX'] = ''
vars['IMPORT_LIB_SUFFIX'] = 'dll.a'
else:
vars['TARGET_COMPILER_ABI'] = 'msvc'
vars['HOST_CC'] = '$(CC)'
vars['HOST_CXX'] = '$(CXX)'
vars['HOST_LD'] = '$(LD)'
if vars.get('AS_BIN', ''):
vars['AS'] = subprocess.check_output('basename "$AS_BIN"', shell=True, env=vars).rstrip('\n')
vars['AR'] = 'lib'
vars['AR_FLAGS'] = '-NOLOGO -OUT:$@'
vars['AR_EXTRACT'] = ''
vars['RANLIB'] = 'echo not_ranlib'
vars['STRIP'] = 'echo not_strip'
vars['PKG_SKIP_STRIP'] = '1'
vars['XARGS'] = 'xargs'
vars['ZIP'] = 'zip'
vars['UNZIP'] = 'unzip'
vars['DOXYGEN'] = ':'
vars['ASM_SUFFIX'] = 'asm'
vars['OBJ_SUFFIX'] = 'obj'
vars['LIB_SUFFIX'] = 'lib'
vars['DLL_PREFIX'] = ''
vars['LIB_PREFIX'] = ''
vars['IMPORT_LIB_SUFFIX'] = 'lib'
vars['MKSHLIB'] = '$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
vars['MKCSHLIB'] = '$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
vars['MKSHLIB_FORCE_ALL'] = ''
vars['MKSHLIB_UNFORCE_ALL'] = ''
vars['DSO_LDOPTS'] = '-SUBSYSTEM:WINDOWS'
vars['_USE_CPP_INCLUDE_FLAG'] = '1'
vars['_DEFINES_CFLAGS'] = '-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
vars['_DEFINES_CXXFLAGS'] = '-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
vars['CFLAGS'] = format('{CFLAGS} -W3 -Gy', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -W3 -Gy', vars, {})
if (vars.get('_CC_SUITE', '') >= '11'):
vars['CFLAGS'] = format('{CFLAGS} -arch:IA32', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -arch:IA32', vars, {})
if (vars.get('_CC_SUITE', '') >= '12'):
vars['CFLAGS'] = format('{CFLAGS} -FS -Gw', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -FS -Gw', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -wd4244 -wd4819', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -wd4251 -wd4244 -wd4345 -wd4351 -wd4482 -wd4800 -wd4819', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -we4553', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -we4553', vars, {})
vars['LIBS'] = format('{LIBS} kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib netapi32.lib', vars, {})
vars['MOZ_DEBUG_LDFLAGS'] = '-DEBUG -DEBUGTYPE:CV'
vars['WARNINGS_AS_ERRORS'] = '-WX'
vars['MOZ_OPTIMIZE_FLAGS'] = '-O1 -Oi'
vars['MOZ_FIX_LINK_PATHS'] = ''
vars['MOZ_COMPONENT_NSPR_LIBS'] = '$(NSPR_LIBS)'
if (not vars.get('CLANG_CL', '')):
vars['LDFLAGS'] = format('{LDFLAGS} -LARGEADDRESSAWARE -NXCOMPAT', vars, {})
if (not vars.get('DEVELOPER_OPTIONS', '')):
vars['LDFLAGS'] = format('{LDFLAGS} -RELEASE', vars, {})
vars['PROFILE_GEN_CFLAGS'] = '-GL'
vars['PROFILE_GEN_LDFLAGS'] = '-LTCG:PGINSTRUMENT'
vars['PROFILE_USE_CFLAGS'] = '-GL -wd4624 -wd4952'
vars['PROFILE_USE_LDFLAGS'] = '-LTCG:PGUPDATE'
vars['LDFLAGS'] = format('{LDFLAGS} -DYNAMICBASE', vars, {})
vars['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] = '1'
vars['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1'] = '1'
vars['MOZ_MEMORY'] = '1'
vars['TARGET_MD_ARCH'] = 'win32'
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-windows'
vars['BIN_SUFFIX'] = '.exe'
vars['MOZ_USER_DIR'] = 'Mozilla'
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_win95.cfg\\"'
vars['no_x'] = 'yes'
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if vars.get('L10NBASEDIR', ''):
vars['L10NBASEDIR'] = subprocess.check_output('cd $L10NBASEDIR && pwd -W', shell=True, env=vars).rstrip('\n')
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if (not vars.get('MOZ_TOOLS', '')):
sys.stderr.write('configure: error: MOZ_TOOLS is not set\n')
sys.exit(1)
vars['MOZ_TOOLS_DIR'] = subprocess.check_output('cd $MOZ_TOOLS && pwd -W', shell=True, env=vars).rstrip('\n')
if (format('{?}', vars, {}) != ('0' or (not format('{MOZ_TOOLS_DIR}', vars, {})))):
sys.stderr.write('configure: error: cd \\$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS\n')
sys.exit(1)
vars['MOZ_TOOLS_BIN_DIR'] = subprocess.check_output('cd "$MOZ_TOOLS_DIR/bin" && pwd', shell=True, env=vars).rstrip('\n')
if (subprocess.check_output('echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"', shell=True, env=vars).rstrip('\n') == '0'):
sys.stderr.write('configure: error: \\$MOZ_TOOLS\\\\bin must be in your path.\n')
sys.exit(1)
case = vars.get('host_os', '')
if (fnmatch.fnmatch(case, 'cygwin*') or fnmatch.fnmatch(case, 'msvc*') or fnmatch.fnmatch(case, 'mks*')):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'i*86-*'):
if vars.get('HAVE_64BIT_BUILD', ''):
sys.stderr.write('configure: error: You are targeting i386 but using the 64-bit compiler.\n')
sys.exit(1)
if vars.get('GNU_CC', ''):
vars['CFLAGS'] = format('{CFLAGS} -mstackrealign -fno-keep-inline-dllexport', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mstackrealign -fno-keep-inline-dllexport', vars, {})
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,--enable-stdcall-fixup -Wl,--large-address-aware', vars, {})
else:
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -MACHINE:X86', vars, {})
if (not vars.get('CLANG_CL', '')):
vars['LDFLAGS'] = format('{LDFLAGS} -SAFESEH', vars, {})
elif fnmatch.fnmatch(case, 'x86_64-*'):
if vars.get('_WIN32_MSVC', ''):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -MACHINE:X64', vars, {})
elif fnmatch.fnmatch(case, '*-netbsd*'):
vars['DSO_CFLAGS'] = ''
vars['CFLAGS'] = format('{CFLAGS} -Dunix', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -Dunix', vars, {})
if (not subprocess.call('$CC -E - -dM </dev/null | grep __ELF__ >/dev/null', shell=True, env=vars)):
vars['DLL_SUFFIX'] = '.so'
vars['DSO_PIC_CFLAGS'] = '-fPIC -DPIC'
vars['DSO_LDOPTS'] = '-shared'
vars['BIN_FLAGS'] = '-Wl,--export-dynamic'
else:
vars['DSO_PIC_CFLAGS'] = '-fPIC -DPIC'
vars['DLL_SUFFIX'] = '.so.1.0'
vars['DSO_LDOPTS'] = '-shared'
vars['MKSHLIB_FORCE_ALL'] = '-Wl,--whole-archive'
vars['MKSHLIB_UNFORCE_ALL'] = '-Wl,--no-whole-archive'
if vars.get('LIBRUNPATH', ''):
vars['DSO_LDOPTS'] = format('-Wl,-R{LIBRUNPATH} {DSO_LDOPTS}', vars, {})
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
elif fnmatch.fnmatch(case, '*-openbsd*'):
if vars.get('SO_VERSION', ''):
vars['DLL_SUFFIX'] = format('.so.{SO_VERSION}', vars, {})
else:
vars['DLL_SUFFIX'] = '.so.1.0'
vars['MOZ_FIX_LINK_PATHS'] = '-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '-fPIC'
vars['DSO_LDOPTS'] = '-shared -fPIC'
if vars.get('LIBRUNPATH', ''):
vars['DSO_LDOPTS'] = format('-R{LIBRUNPATH} {DSO_LDOPTS}', vars, {})
elif fnmatch.fnmatch(case, '*-solaris*'):
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_solaris.cfg\\"'
vars['MOZ_FIX_LINK_PATHS'] = ''
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['LDFLAGS'] = format("{LDFLAGS} -z ignore -R '$$ORIGIN:$$ORIGIN/..' -z lazyload -z combreloc -z muldefs", vars, {})
vars['LIBS'] = format('-lCrun -lCstd -lc {LIBS}', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef', vars, {})
vars['LDFLAGS'] = format('-xildoff {LDFLAGS}', vars, {})
vars['MMX_FLAGS'] = '-xarch=mmx -xO4'
vars['SSE_FLAGS'] = '-xarch=sse'
vars['SSE2_FLAGS'] = '-xarch=ssei2 -xO4'
if ((not vars.get('CROSS_COMPILE', '')) and os.path.isfile('/usr/lib/ld/map.noexstk')):
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('-M /usr/lib/ld/map.noexstk {LDFLAGS}', vars, {})
vars['MOZ_OPTIMIZE_FLAGS'] = '-xO4'
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['MKSHLIB_FORCE_ALL'] = '-z allextract'
vars['MKSHLIB_UNFORCE_ALL'] = '-z defaultextract'
vars['DSO_LDOPTS'] = '-G'
vars['AR_LIST'] = format('{AR} t', vars, {})
vars['AR_EXTRACT'] = format('{AR} x', vars, {})
vars['AR_DELETE'] = format('{AR} d', vars, {})
vars['AR'] = '$(CXX) -xar'
vars['AR_FLAGS'] = '-o $@'
vars['AS'] = '/usr/ccs/bin/as'
vars['ASFLAGS'] = format('{ASFLAGS} -K PIC -L -P -D_ASM -D__STDC__=0', vars, {})
vars['AS_DASH_C_FLAG'] = ''
vars['TARGET_COMPILER_ABI'] = 'sunc'
vars['CC_VERSION'] = subprocess.check_output("$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\\: '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['CXX_VERSION'] = subprocess.check_output("$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\\: '{ print $2 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('configure: checking for Sun C++ compiler version >= 5.9\n')
if vars.get('_BAD_COMPILER', ''):
vars['_res'] = 'no'
sys.stderr.write('configure: error: Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .\n')
sys.exit(1)
else:
vars['_res'] = 'yes'
if vars.get('_ABOVE_SS12U1', ''):
vars['CXXFLAGS'] = format('{CXXFLAGS} -xannotate=no', vars, {})
sys.stdout.write('$_res\n')
else:
vars['LDFLAGS'] = format("{LDFLAGS} -Wl,-z,ignore -Wl,-R,'$$ORIGIN:$$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs", vars, {})
vars['LIBS'] = format('-lc {LIBS}', vars, {})
vars['MKSHLIB_FORCE_ALL'] = '-Wl,-z -Wl,allextract'
vars['MKSHLIB_UNFORCE_ALL'] = '-Wl,-z -Wl,defaultextract'
vars['ASFLAGS'] = format('{ASFLAGS} -fPIC', vars, {})
vars['DSO_LDOPTS'] = '-shared'
vars['WARNINGS_AS_ERRORS'] = '-Werror'
vars['_WARNINGS_CFLAGS'] = ''
vars['_WARNINGS_CXXFLAGS'] = ''
if (vars.get('OS_RELEASE', '') == '5.3'):
pass
if (vars.get('OS_RELEASE', '') == '5.5.1'):
pass
elif fnmatch.fnmatch(case, '*-sunos*'):
vars['DSO_LDOPTS'] = '-Bdynamic'
vars['MKSHLIB'] = '-$(LD) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '-$(LD) $(DSO_LDOPTS) -o $@'
case = subprocess.check_output('target_os', shell=True, env=vars).rstrip('\n')
if fnmatch.fnmatch(case, 'sunos4.1*'):
vars['DLL_SUFFIX'] = '.so.1.0'
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-*linux*'):
pass
if vars.get('MOZ_LINKER', ''):
pass
vars['NO_LD_ARCHIVE_FLAGS'] = ''
if ((not format('{MKSHLIB_FORCE_ALL}', vars, {})) or (not format('{MKSHLIB_UNFORCE_ALL}', vars, {}))):
vars['NO_LD_ARCHIVE_FLAGS'] = '1'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-aix4.3*') or fnmatch.fnmatch(case, '*-aix5*')):
vars['NO_LD_ARCHIVE_FLAGS'] = ''
elif fnmatch.fnmatch(case, '*-mingw*'):
if (not vars.get('GNU_CC', '')):
vars['NO_LD_ARCHIVE_FLAGS'] = ''
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-linux*') or fnmatch.fnmatch(case, '*-kfreebsd*-gnu') or fnmatch.fnmatch(case, '*-gnu*')):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
elif fnmatch.fnmatch(case, '*-solaris*'):
if (not vars.get('GNU_CC', '')):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
elif (not vars.get('GCC_USE_GNU_LD', '')):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
else:
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
elif fnmatch.fnmatch(case, '*-darwin*'):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
elif fnmatch.fnmatch(case, '*-mingw*'):
if vars.get('GNU_CC', ''):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
if (not vars.get('COMPILE_ENVIRONMENT', '')):
vars['SKIP_COMPILER_CHECKS'] = '1'
vars['SKIP_LIBRARY_CHECKS'] = '1'
if (not vars.get('SKIP_COMPILER_CHECKS', '')):
sys.stdout.write('configure: checking for ssize_t\n')
if (vars.get('ac_cv_type_ssize_t', '') == 'true'):
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
sys.stdout.write('configure: checking for siginfo_t\n')
if (vars.get('ac_cv_siginfo_t', '') == 'true'):
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
if (format('{GNU_CC}', vars, {}) and (format('{OS_TARGET}', vars, {}) != 'WINNT')):
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Darwin'):
vars['VISIBILITY_FLAGS'] = '-fvisibility=hidden'
else:
case = vars.get('GCC_VERSION', '')
if (fnmatch.fnmatch(case, '4.4*') or fnmatch.fnmatch(case, '4.6*')):
vars['VISIBILITY_FLAGS'] = '-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden_dso_handle.h'
else:
vars['VISIBILITY_FLAGS'] = '-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
vars['WRAP_SYSTEM_INCLUDES'] = '1'
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['VISIBILITY_FLAGS'] = '-xldscope=hidden'
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android')):
pass else:
vars['STL_FLAGS'] = '-I$(DIST)/stl_wrappers'
vars['WRAP_STL_INCLUDES'] = '1'
if (vars.get('OS_TARGET', '') != 'WINNT'):
pass
if vars.get('GNU_CC', ''):
vars['CFLAGS_save'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -Werror', vars, {})
vars['CFLAGS'] = vars.get('CFLAGS_save', '')
if (vars.get('ac_cv_force_align_arg_pointer', '') == 'yes'):
vars['HAVE_GCC_ALIGN_ARG_POINTER'] = '1'
else:
vars['HAVE_GCC_ALIGN_ARG_POINTER'] = ''
case = vars.get('target_os', '')
if (fnmatch.fnmatch(case, 'freebsd*') or fnmatch.fnmatch(case, 'openbsd*')):
vars['CPPFLAGS'] = format('{CPPFLAGS} {X_CFLAGS}', vars, {})
if (vars.get('ac_cv_sockaddr_in_sin_len', '') == 'true'):
pass
if (vars.get('ac_cv_sockaddr_in6_sin6_len', '') == 'true'):
pass
if (vars.get('ac_cv_sockaddr_sa_len', '') == 'true'):
pass
if (format('x{enable_dtrace}', vars, {}) == 'xyes'):
if vars.get('HAVE_DTRACE', ''):
pass
else:
sys.stderr.write('configure: error: dtrace enabled but sys/sdt.h not found\n')
sys.exit(1)
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-aix4.3*') or fnmatch.fnmatch(case, '*-aix5*')):
pass
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-hpux11.*'):
pass
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-darwin*'):
pass
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -D_GNU_SOURCE', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if (not vars.get('GNU_CXX', '')):
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-aix*'):
pass
vars['XLDFLAGS'] = vars.get('X_LIBS', '')
vars['XLIBS'] = vars.get('X_EXTRA_LIBS', '')
if (vars.get('no_x', '') == 'yes'):
pass
else:
vars['XLIBS'] = format('-lX11 {XLIBS}', vars, {})
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{XLDFLAGS} {LDFLAGS}', vars, {})
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'aix*'):
vars['XT_LIBS'] = format('-lXm {XT_LIBS}', vars, {})
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'darwin*'):
vars['MOZ_USE_PTHREADS'] = '1'
if (format('{MOZ_USE_PTHREADS}x', vars, {}) != 'x'):
subprocess.call('rm -f conftest*', shell=True, env=vars)
vars['ac_cv_have_dash_pthread'] = 'no'
sys.stdout.write('configure: checking whether ${CC-cc} accepts -pthread\n')
subprocess.call("echo 'int main() { return 0; }' | cat >conftest.c", shell=True, env=vars)
subprocess.call('${CC-cc} -pthread -o conftest conftest.c >conftest.out 2>&1', shell=True, env=vars)
if (vars.get('?', '') == '0'):
if ((not format('{cmd0}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthread", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')})) and (not format('{cmd1}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthread", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')}))):
vars['ac_cv_have_dash_pthread'] = 'yes'
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'freebsd*'):
pass else:
vars['CFLAGS'] = format('{CFLAGS} -pthread', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -pthread', vars, {})
subprocess.call('rm -f conftest*', shell=True, env=vars)
sys.stdout.write('$ac_cv_have_dash_pthread\n')
vars['ac_cv_have_dash_pthreads'] = 'no'
if (vars.get('ac_cv_have_dash_pthread', '') == 'no'):
sys.stdout.write('configure: checking whether ${CC-cc} accepts -pthreads\n')
subprocess.call("echo 'int main() { return 0; }' | cat >conftest.c", shell=True, env=vars)
subprocess.call('${CC-cc} -pthreads -o conftest conftest.c >conftest.out 2>&1', shell=True, env=vars)
if (vars.get('?', '') == '0'):
if ((not format('{cmd0}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')})) and (not format('{cmd1}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')}))):
vars['ac_cv_have_dash_pthreads'] = 'yes'
vars['CFLAGS'] = format('{CFLAGS} -pthreads', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -pthreads', vars, {})
subprocess.call('rm -f conftest*', shell=True, env=vars)
sys.stdout.write('$ac_cv_have_dash_pthreads\n')
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-*-freebsd*'):
if (vars.get('ac_cv_have_dash_pthread', '') == 'yes'):
vars['_PTHREAD_LDFLAGS'] = '-pthread'
elif (fnmatch.fnmatch(case, '*-*-openbsd*') or fnmatch.fnmatch(case, '*-*-bsdi*')):
if (vars.get('ac_cv_have_dash_pthread', '') == 'yes'):
vars['_PTHREAD_LDFLAGS'] = '-pthread'
elif (fnmatch.fnmatch(case, '*-*-linux*') or fnmatch.fnmatch(case, '*-*-kfreebsd*-gnu') or fnmatch.fnmatch(case, '*-*-gnu*')):
pass elif (fnmatch.fnmatch(case, '*-aix4.3*') or fnmatch.fnmatch(case, '*-aix5*')):
pass elif fnmatch.fnmatch(case, '*-hpux11.*'):
pass elif fnmatch.fnmatch(case, '*-*-solaris*'):
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['CFLAGS'] = format('{CFLAGS} -mt', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mt', vars, {})
vars['LDFLAGS'] = format('{_PTHREAD_LDFLAGS} {LDFLAGS}', vars, {})
if (vars.get('ac_cv_clock_monotonic', '') != 'no'):
vars['HAVE_CLOCK_MONOTONIC'] = '1'
vars['REALTIME_LIBS'] = vars.get('ac_cv_clock_monotonic', '')
if (not ((not (not vars.get('MACOS_DEPLOYMENT_TARGET', ''))) or (not (vars.get('MACOS_DEPLOYMENT_TARGET', '') >= '100300')))):
if (vars.get('ac_cv_have_wcrtomb', '') == 'yes'):
pass
if (vars.get('ac_cv_have_mbrtowc', '') == 'yes'):
pass
if (vars.get('ac_cv_func_res_ninit', '') == 'yes'):
pass
vars['ICONV_LIBS'] = ''
case = vars.get('target_os', '')
if (fnmatch.fnmatch(case, 'darwin*') or fnmatch.fnmatch(case, 'mingw*')):
pass else:
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {ICONV_LIBS}', vars, {})
if (vars.get('ac_cv_func_iconv', '') == 'yes'):
vars['LIBICONV'] = vars.get('ICONV_LIBS', '')
if (vars.get('ac_cv_func_const_iconv', '') == 'yes'):
pass
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_va_copy}', vars, {}) == 'xyes'):
pass
if (format('x{ac_cv_va_val_copy}', vars, {}) == 'xno'):
pass
vars['ARM_ABI_PREFIX'] = ''
if vars.get('GNU_CC', ''):
if (vars.get('CPU_ARCH', '') == 'arm'):
if (vars.get('ac_cv_gcc_arm_eabi', '') == 'yes'):
vars['HAVE_ARM_EABI'] = '1'
vars['ARM_ABI_PREFIX'] = 'eabi-'
else:
vars['ARM_ABI_PREFIX'] = 'oabi-'
if (not vars.get('TARGET_COMPILER_ABI', '')):
vars['TARGET_COMPILER_ABI'] = format('{ARM_ABI_PREFIX}gcc3', vars, {})
if (vars.get('ac_cv_cpp_ambiguity_resolving_using', '') == 'yes'):
pass
if (vars.get('ac_cv_cpp_dynamic_cast_void_ptr', '') == 'yes'):
pass
if (vars.get('ac_cv_cpp_unused_required', '') == 'yes'):
pass
if (vars.get('ac_cv_trouble_comparing_to_zero', '') == 'yes'):
pass
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} {DSO_PIC_CFLAGS} {DSO_LDOPTS} {MOZ_OPTIMIZE_LDFLAGS}', vars, {})
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['MOZ_TLS'] = ''
if (format('{ac_cv_thread_keyword}', vars, {}) == ('yes' and (format('{MOZ_LINKER}', vars, {}) != '1'))):
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'mips*-*'):
subprocess.call(':', shell=True, env=vars)
elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
subprocess.call(':', shell=True, env=vars)
elif fnmatch.fnmatch(case, '*-openbsd*'):
subprocess.call(':', shell=True, env=vars)
else:
vars['MOZ_TLS'] = '1'
if vars.get('MOZ_LINKER', ''):
if (vars.get('CPU_ARCH', '') == 'arm'):
if (not ((not vars.get('ARM_ARCH', '')) and (not (vars.get('ARM_ARCH', '') < '7')))):
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000', vars, {})
vars['_SUBDIR_LDFLAGS'] = format('{_SUBDIR_LDFLAGS} -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000', vars, {})
if (format('{MOZ_LINKER}', vars, {}) and (format('{OS_TARGET}', vars, {}) == 'Android')):
if (vars.get('ac_cv_crt_has_text_relocations', '') == 'yes'):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -nostartfiles', vars, {})
vars['NSPR_LDFLAGS'] = format('{NSPR_LDFLAGS} -nostartfiles', vars, {})
vars['MALLOC_HEADERS'] = 'malloc.h malloc_np.h malloc/malloc.h sys/malloc.h'
vars['MALLOC_H'] = ''
for file in for_loop(['{MALLOC_HEADERS}'], vars, {}):
vars['file'] = file
if (vars.get('MALLOC_H', '') != ''):
subprocess.call('break', shell=True, env=vars)
if (vars.get('ac_cv_i18n_lc_messages', '') == 'yes'):
pass
vars['TARGET_XPCOM_ABI'] = ''
if (format('{CPU_ARCH}', vars, {}) and format('{TARGET_COMPILER_ABI}', vars, {})):
vars['TARGET_XPCOM_ABI'] = format('{CPU_ARCH}-{TARGET_COMPILER_ABI}', vars, {})
if (vars.get('ac_cv_attribute_malloc', '') == 'yes'):
pass
if (vars.get('ac_cv_attribute_warn_unused', '') == 'yes'):
pass
if vars.get('SKIP_COMPILER_CHECKS', ''):
pass
vars['LIBXUL_DIST'] = format('{MOZ_BUILD_ROOT}/dist', vars, {})
if vars.get('LIBXUL_SDK', ''):
vars['GRE_MILESTONE'] = subprocess.check_output('$PYTHON "$_topsrcdir"/config/printconfigsetting.py "$LIBXUL_DIST"/bin/platform.ini Build Milestone', shell=True, env=vars).rstrip('\n')
else:
vars['GRE_MILESTONE'] = subprocess.check_output('tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt', shell=True, env=vars).rstrip('\n')
case = vars.get('GRE_MILESTONE', '')
if fnmatch.fnmatch(case, '*a1*'):
vars['NIGHTLY_BUILD'] = '1'
elif fnmatch.fnmatch(case, '*a*'):
pass else:
vars['RELEASE_BUILD'] = '1'
if (not vars.get('NIGHTLY_BUILD', '')):
vars['MOZ_DISABLE_UNIFIED_COMPILATION'] = '1'
if (not vars.get('NIGHTLY_BUILD', '')):
vars['E10S_TESTING_ONLY'] = '1'
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('LIBEVENT_DIR', '') == 'yes'):
pass
if ((not vars.get('LIBEVENT_DIR', '')) or (vars.get('LIBEVENT_DIR', '') == 'no')):
vars['MOZ_NATIVE_LIBEVENT'] = ''
elif (not vars.get('MOZ_NATIVE_LIBEVENT', '')):
vars['CFLAGS'] = format('-I{LIBEVENT_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{LIBEVENT_DIR}/lib {LDFLAGS}', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if vars.get('_USE_SYSTEM_NSS', ''):
pass
if vars.get('MOZ_NATIVE_NSS', ''):
vars['NSS_LIBS'] = format('{NSS_LIBS} -lcrmf', vars, {})
else:
vars['NSS_CFLAGS'] = '-I$(LIBXUL_DIST)/include/nss'
if ((not format('{GNU_CC}', vars, {})) and (format('{OS_ARCH}', vars, {}) == 'WINNT')):
vars['NSS_LIBS'] = format(' $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)smime{NSS_VERSION}.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)ssl{NSS_VERSION}.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nss{NSS_VERSION}.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nssutil{NSS_VERSION}.$(LIB_SUFFIX)', vars, {})
else:
vars['NSS_LIBS'] = format('-L$(LIBXUL_DIST)/lib -lcrmf -lsmime{NSS_VERSION} -lssl{NSS_VERSION} -lnss{NSS_VERSION} -lnssutil{NSS_VERSION}', vars, {})
sys.stdout.write('configure: checking for YASM assembler\n')
if vars.get('YASM', ''):
vars['YASM_VERSION'] = subprocess.check_output("yasm --version | $AWK '/^yasm/ { print $2 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_MAJOR_VERSION'] = subprocess.check_output("echo ${YASM_VERSION} | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_MINOR_VERSION'] = subprocess.check_output("echo ${YASM_VERSION} | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_RELEASE'] = subprocess.check_output(" echo ${YASM_VERSION} | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_BUILD'] = subprocess.check_output(" echo ${YASM_VERSION} | $AWK -F\\. '{ print $4 }'", shell=True, env=vars).rstrip('\n')
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('JPEG_DIR', '') and (vars.get('JPEG_DIR', '') != 'yes')):
vars['CFLAGS'] = format('-I{JPEG_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{JPEG_DIR}/lib {LDFLAGS}', vars, {})
if ((not vars.get('JPEG_DIR', '')) or (vars.get('JPEG_DIR', '') == 'no')):
vars['MOZ_NATIVE_JPEG'] = ''
if (vars.get('MOZ_NATIVE_JPEG', '') == '1'):
pass
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('{JPEG_DIR}', vars, {}) and (os.path.isdir(format('{JPEG_DIR}', vars, {})) and (format('{MOZ_NATIVE_JPEG}', vars, {}) == '1'))):
vars['MOZ_JPEG_CFLAGS'] = format('-I{JPEG_DIR}/include', vars, {})
vars['MOZ_JPEG_LIBS'] = format('-L{JPEG_DIR}/lib {MOZ_JPEG_LIBS}', vars, {})
if (format('{MOZ_LINKER}', vars, {}) == ('1' and (format('{MOZ_NATIVE_ZLIB}', vars, {}) != '1'))):
sys.stderr.write('configure: error: Custom dynamic linker requires --with-system-zlib\n')
sys.exit(1)
vars['MOZ_PNG_ARM_NEON'] = ''
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('BZ2_DIR', '') and (vars.get('BZ2_DIR', '') != 'yes')):
vars['CFLAGS'] = format('-I{BZ2_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{BZ2_DIR}/lib {LDFLAGS}', vars, {})
if ((not vars.get('BZ2_DIR', '')) or (vars.get('BZ2_DIR', '') == 'no')):
vars['MOZ_NATIVE_BZ2'] = ''
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('{BZ2_DIR}', vars, {}) and (os.path.isdir(format('{BZ2_DIR}', vars, {})) and (format('{MOZ_NATIVE_BZ2}', vars, {}) == '1'))):
vars['MOZ_BZ2_CFLAGS'] = format('-I{BZ2_DIR}/include', vars, {})
vars['MOZ_BZ2_LIBS'] = format('-L{BZ2_DIR}/lib {MOZ_BZ2_LIBS}', vars, {})
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('PNG_DIR', '') and (vars.get('PNG_DIR', '') != 'yes')):
vars['CFLAGS'] = format('-I{PNG_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{PNG_DIR}/lib {LDFLAGS}', vars, {})
if ((not vars.get('PNG_DIR', '')) or (vars.get('PNG_DIR', '') == 'no')):
vars['MOZ_NATIVE_PNG'] = ''
if (vars.get('MOZ_NATIVE_PNG', '') == '1'):
pass
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('{PNG_DIR}', vars, {}) and (os.path.isdir(format('{PNG_DIR}', vars, {})) and (format('{MOZ_NATIVE_PNG}', vars, {}) == '1'))):
vars['MOZ_PNG_CFLAGS'] = format('-I{PNG_DIR}/include', vars, {})
vars['MOZ_PNG_LIBS'] = format('-L{PNG_DIR}/lib {MOZ_PNG_LIBS}', vars, {})
vars['MOZ_PNG_ARM_NEON_CHECK'] = ''
if (format('{MOZ_NATIVE_PNG}', vars, {}) != ('1' and (format('{CPU_ARCH}', vars, {}) == 'arm'))):
case = vars.get('MOZ_PNG_ARM_NEON_SUPPORT', '')
if fnmatch.fnmatch(case, 'no'):
pass elif fnmatch.fnmatch(case, 'nocheck'):
vars['MOZ_PNG_ARM_NEON'] = '1'
else:
vars['MOZ_PNG_ARM_NEON'] = '1'
vars['MOZ_PNG_ARM_NEON_CHECK'] = '1'
if args.system_hunspell:
vars['MOZ_NATIVE_HUNSPELL'] = '1'
if vars.get('MOZ_NATIVE_HUNSPELL', ''):
pass
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['JS_SHARED_LIBRARY'] = '1'
if args.shared_js:
vars['JS_SHARED_LIBRARY'] = '1'
else:
vars['JS_SHARED_LIBRARY'] = ''
vars['JAVA_BIN_PATH'] = ''
vars['ENABLE_TESTS'] = '1'
vars['ENABLE_SYSTEM_EXTENSION_DIRS'] = '1'
vars['MOZ_BRANDING_DIRECTORY'] = ''
vars['MOZ_OFFICIAL_BRANDING'] = ''
vars['MOZ_FEEDS'] = '1'
vars['MOZ_WEBAPP_RUNTIME'] = ''
vars['MOZ_AUTH_EXTENSION'] = '1'
vars['MOZ_RAW'] = ''
vars['MOZ_VORBIS'] = ''
vars['MOZ_TREMOR'] = ''
vars['MOZ_WAVE'] = '1'
vars['MOZ_SAMPLE_TYPE_FLOAT32'] = ''
vars['MOZ_SAMPLE_TYPE_S16'] = ''
vars['MOZ_OPUS'] = '1'
vars['MOZ_WEBM'] = '1'
vars['MOZ_GSTREAMER'] = ''
vars['MOZ_DIRECTSHOW'] = ''
vars['MOZ_WMF'] = ''
vars['MOZ_FMP4'] = ''
vars['MOZ_EME'] = '1'
vars['MOZ_FFMPEG'] = ''
vars['MOZ_WEBRTC'] = '1'
vars['MOZ_PEERCONNECTION'] = ''
vars['MOZ_SRTP'] = ''
vars['MOZ_WEBRTC_SIGNALING'] = ''
vars['MOZ_WEBRTC_ASSERT_ALWAYS'] = '1'
vars['MOZ_SCTP'] = ''
vars['MOZ_ANDROID_OMX'] = ''
vars['MOZ_MEDIA_NAVIGATOR'] = ''
vars['MOZ_OMX_PLUGIN'] = ''
vars['MOZ_VPX'] = ''
vars['MOZ_VPX_ERROR_CONCEALMENT'] = ''
vars['MOZ_WEBSPEECH'] = '1'
vars['VPX_AS'] = ''
vars['VPX_ASFLAGS'] = ''
vars['VPX_AS_DASH_C_FLAG'] = ''
vars['VPX_AS_CONVERSION'] = ''
vars['VPX_ASM_SUFFIX'] = ''
vars['VPX_X86_ASM'] = ''
vars['VPX_ARM_ASM'] = ''
vars['LIBJPEG_TURBO_AS'] = ''
vars['LIBJPEG_TURBO_ASFLAGS'] = ''
vars['LIBJPEG_TURBO_X86_ASM'] = ''
vars['LIBJPEG_TURBO_X64_ASM'] = ''
vars['LIBJPEG_TURBO_ARM_ASM'] = ''
vars['MOZ_PERMISSIONS'] = '1'
vars['MOZ_PLACES'] = '1'
vars['MOZ_SOCIAL'] = '1'
vars['MOZ_PREF_EXTENSIONS'] = '1'
vars['MOZ_PROFILELOCKING'] = '1'
vars['MOZ_REFLOW_PERF'] = ''
vars['MOZ_SAFE_BROWSING'] = ''
vars['MOZ_HELP_VIEWER'] = ''
vars['MOZ_SPELLCHECK'] = '1'
vars['MOZ_ANDROID_OMTC'] = ''
vars['MOZ_TOOLKIT_SEARCH'] = '1'
vars['MOZ_UI_LOCALE'] = 'en-US'
vars['MOZ_UNIVERSALCHARDET'] = '1'
vars['MOZ_URL_CLASSIFIER'] = ''
vars['MOZ_XUL'] = '1'
vars['MOZ_ZIPWRITER'] = '1'
vars['NS_PRINTING'] = '1'
vars['MOZ_PDF_PRINTING'] = ''
vars['MOZ_DISABLE_CRYPTOLEGACY'] = ''
vars['NSS_DISABLE_DBM'] = ''
vars['NECKO_COOKIES'] = '1'
vars['NECKO_PROTOCOLS_DEFAULT'] = 'about app data file ftp http res viewsource websocket wyciwyg device'
if vars.get('MOZ_RTSP', ''):
vars['NECKO_PROTOCOLS_DEFAULT'] = format('{NECKO_PROTOCOLS_DEFAULT} rtsp', vars, {})
vars['USE_ARM_KUSER'] = ''
vars['BUILD_CTYPES'] = '1'
vars['MOZ_USE_NATIVE_POPUP_WINDOWS'] = ''
vars['MOZ_ANDROID_HISTORY'] = ''
vars['MOZ_WEBSMS_BACKEND'] = ''
vars['MOZ_ANDROID_BEAM'] = ''
vars['MOZ_LOCALE_SWITCHER'] = ''
vars['MOZ_ANDROID_SEARCH_ACTIVITY'] = ''
vars['MOZ_ANDROID_MLS_STUMBLER'] = ''
vars['ACCESSIBILITY'] = '1'
vars['MOZ_TIME_MANAGER'] = ''
vars['MOZ_PAY'] = ''
vars['MOZ_AUDIO_CHANNEL_MANAGER'] = ''
vars['NSS_NO_LIBPKIX'] = ''
vars['MOZ_CONTENT_SANDBOX'] = ''
vars['MOZ_GMP_SANDBOX'] = ''
vars['JSGC_USE_EXACT_ROOTING'] = '1'
vars['JSGC_GENERATIONAL'] = ''
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'mingw*'):
vars['NS_ENABLE_TSF'] = '1'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
if (vars.get('CPU_ARCH', '') == 'arm'):
vars['USE_ARM_KUSER'] = '1'
vars['NSS_DISABLE_DBM'] = '1'
vars['MOZ_THEME_FASTSTRIPE'] = '1'
vars['MOZ_TREE_FREETYPE'] = '1'
vars['MOZ_MEMORY'] = '1'
vars['MOZ_RAW'] = '1'
if (not vars.get('XULRUNNER_STUB_NAME', '')):
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'darwin*'):
vars['XULRUNNER_STUB_NAME'] = 'xulrunner'
else:
vars['XULRUNNER_STUB_NAME'] = 'xulrunner-stub'
sys.stdout.write('configure: checking for application to build\n')
if (not vars.get('MOZ_BUILD_APP', '')):
sys.stdout.write('browser\n')
vars['MOZ_BUILD_APP'] = 'browser'
else:
if (vars.get('MOZ_BUILD_APP', '') == 'mobile'):
sys.stdout.write('none\n')
sys.stderr.write('configure: error: --enable-application=mobile is no longer supported.\n')
sys.exit(1)
if (not os.path.isfile(format('{srcdir}/{MOZ_BUILD_APP}/build.mk', vars, {}))):
sys.stdout.write('none\n')
sys.stderr.write('configure: error: --enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).\n')
sys.exit(1)
else:
sys.stdout.write('$MOZ_BUILD_APP\n')
if (not vars.get('MOZ_UPDATE_CHANNEL', '')):
vars['MOZ_UPDATE_CHANNEL'] = 'default'
if (not vars.get('MOZ_MOZILLA_API_KEY', '')):
vars['MOZ_MOZILLA_API_KEY'] = 'no-mozilla-api-key'
if (not vars.get('MOZ_GOOGLE_API_KEY', '')):
vars['MOZ_GOOGLE_API_KEY'] = 'no-google-api-key'
if (not vars.get('MOZ_BING_API_CLIENTID', '')):
vars['MOZ_BING_API_CLIENTID'] = 'no-bing-api-clientid'
vars['MOZ_BING_API_KEY'] = 'no-bing-api-key'
sys.stdout.write('configure: checking if app-specific confvars.sh exists\n')
if os.path.isfile(format('{srcdir}/{MOZ_BUILD_APP}/confvars.sh', vars, {})):
sys.stdout.write('${srcdir}/${MOZ_BUILD_APP}/confvars.sh\n')
subprocess.call(format('. {srcdir}/{MOZ_BUILD_APP}/confvars.sh', vars, {}), shell=True, env=vars)
else:
sys.stdout.write('no\n')
subprocess.call(format('. {srcdir}/build/defines.sh', vars, {}), shell=True, env=vars)
if vars.get('BUILDING_RELEASE', ''):
vars['EARLY_BETA_OR_EARLIER'] = ''
elif vars.get('EARLY_BETA_OR_EARLIER', ''):
pass
if os.path.isfile(format('{srcdir}/{MOZ_BUILD_APP}/configure.in', vars, {})):
pass
if vars.get('WITH_APP_NAME', ''):
vars['MOZ_APP_NAME'] = vars.get('WITH_APP_NAME', '')
if vars.get('WITH_APP_BASENAME', ''):
vars['MOZ_APP_BASENAME'] = vars.get('WITH_APP_BASENAME', '')
case = vars.get('MOZ_BUILD_APP', '')
if fnmatch.fnmatch(case, 'xulrunner'):
if vars.get('LIBXUL_SDK', ''):
sys.stderr.write("configure: error: Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.\n")
sys.exit(1)
case = vars.get('MOZ_BUILD_APP', '')
if fnmatch.fnmatch(case, 'browser'):
pass elif fnmatch.fnmatch(case, 'xulrunner'):
pass elif fnmatch.fnmatch(case, 'b2g'):
pass elif fnmatch.fnmatch(case, 'b2g/dev'):
pass
if (not vars.get('gonkdir', '')):
case = vars.get('MOZ_BUILD_APP', '')
if fnmatch.fnmatch(case, 'mobile/android'):
vars['android_min_api_level'] = '17'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
subprocess.call(':', shell=True, env=vars)
else:
sys.stderr.write('configure: 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\n')
sys.exit(1)
if (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-windows' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-gtk2' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-gtk2-x11' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-gtk3' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-qt' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-cocoa' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-uikit' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-android' or (vars.get('_DEFAULT_TOOLKIT', '') == 'cairo-gonk'))))))))))))))))):
vars['MOZ_WIDGET_TOOLKIT'] = subprocess.check_output('echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"', shell=True, env=vars).rstrip('\n')
else:
sys.stderr.write('configure: error: You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).\n')
sys.exit(1)
vars['MOZ_WIDGET_GTK'] = ''
case = vars.get('MOZ_WIDGET_TOOLKIT', '')
if fnmatch.fnmatch(case, 'cairo-windows'):
vars['MOZ_WIDGET_TOOLKIT'] = 'windows'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
if vars.get('GNU_CC', ''):
vars['MOZ_FOLD_LIBS'] = ''
elif fnmatch.fnmatch(case, 'cairo-gtk3'):
vars['MOZ_WIDGET_TOOLKIT'] = 'gtk3'
vars['MOZ_ENABLE_GTK'] = '1'
vars['MOZ_ENABLE_GTK3'] = '1'
vars['MOZ_ENABLE_XREMOTE'] = '1'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_GL_DEFAULT_PROVIDER'] = 'GLX'
vars['MOZ_X11'] = '1'
vars['USE_FC_FREETYPE'] = '1'
vars['TK_CFLAGS'] = '$(MOZ_GTK3_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_GTK3_LIBS)'
vars['MOZ_WIDGET_GTK'] = '3'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif (fnmatch.fnmatch(case, 'cairo-gtk2') or fnmatch.fnmatch(case, 'cairo-gtk2-x11')):
vars['MOZ_WIDGET_TOOLKIT'] = 'gtk2'
vars['MOZ_ENABLE_GTK'] = '1'
vars['MOZ_ENABLE_GTK2'] = '1'
vars['MOZ_ENABLE_XREMOTE'] = '1'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_GL_DEFAULT_PROVIDER'] = 'GLX'
vars['MOZ_X11'] = '1'
vars['USE_FC_FREETYPE'] = '1'
vars['TK_CFLAGS'] = '$(MOZ_GTK2_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_GTK2_LIBS)'
vars['MOZ_WIDGET_GTK'] = '2'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif fnmatch.fnmatch(case, 'cairo-qt'):
vars['MOZ_WIDGET_TOOLKIT'] = 'qt'
vars['MOZ_ENABLE_QT'] = '1'
if (not vars.get('WITHOUT_X11', '')):
vars['MOZ_ENABLE_XREMOTE'] = '1'
vars['MOZ_GL_DEFAULT_PROVIDER'] = 'GLX'
vars['MOZ_X11'] = '1'
vars['XT_LIBS'] = ''
vars['MOZ_WEBGL'] = '1'
vars['USE_FC_FREETYPE'] = '1'
vars['TK_CFLAGS'] = '$(MOZ_QT_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_QT_LIBS)'
vars['MOZ_PDF_PRINTING'] = '1'
elif fnmatch.fnmatch(case, 'cairo-cocoa'):
vars['MOZ_WIDGET_TOOLKIT'] = 'cocoa'
vars['LDFLAGS'] = format('{LDFLAGS} -framework Cocoa -lobjc', vars, {})
vars['TK_LIBS'] = '-Wl,-framework,CoreLocation -Wl,-framework,QuartzCore -Wl,-framework,Carbon -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,AddressBook -Wl,-framework,OpenGL'
vars['TK_CFLAGS'] = '-DNO_X11'
vars['CFLAGS'] = format('{CFLAGS} {TK_CFLAGS}', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} {TK_CFLAGS}', vars, {})
vars['MOZ_USER_DIR'] = 'Mozilla'
vars['MOZ_FS_LAYOUT'] = 'bundle'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif fnmatch.fnmatch(case, 'cairo-uikit'):
vars['MOZ_WIDGET_TOOLKIT'] = 'uikit'
vars['LDFLAGS'] = format('{LDFLAGS} -framework UIKit -lobjc', vars, {})
vars['TK_CFLAGS'] = '-DNO_X11'
vars['TK_LIBS'] = '-Wl,-framework,Foundation -Wl,-framework,CoreFoundation -Wl,-framework,CoreGraphics -Wl,-framework,CoreText'
vars['CFLAGS'] = format('{CFLAGS} {TK_CFLAGS}', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} {TK_CFLAGS}', vars, {})
vars['MOZ_USER_DIR'] = 'Mozilla'
vars['MOZ_FS_LAYOUT'] = 'bundle'
elif fnmatch.fnmatch(case, 'cairo-android'):
vars['MOZ_WIDGET_TOOLKIT'] = 'android'
vars['TK_CFLAGS'] = '$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif fnmatch.fnmatch(case, 'cairo-gonk'):
vars['MOZ_WIDGET_TOOLKIT'] = 'gonk'
vars['TK_CFLAGS'] = '$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_TOUCH'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
if vars.get('MOZ_PDF_PRINTING', ''):
vars['PDF_SURFACE_FEATURE'] = '#define CAIRO_HAS_PDF_SURFACE 1'
if vars.get('MOZ_ENABLE_XREMOTE', ''):
pass
if vars.get('MOZ_INSTRUMENT_EVENT_LOOP', ''):
pass
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('MOZ_ENABLE_GTK3', ''):
vars['MOZ_GTK3_CFLAGS'] = format('-I{_topsrcdir}/widget/gtk/compat-gtk3 {MOZ_GTK3_CFLAGS}', vars, {})
if vars.get('MOZ_ENABLE_GTK', ''):
if vars.get('MOZ_X11', ''):
vars['GDK_PACKAGES'] = 'gdk-x11-2.0'
vars['MOZ_GTK2_CFLAGS'] = format('-I{_topsrcdir}/widget/gtk/compat {MOZ_GTK2_CFLAGS}', vars, {})
if vars.get('USE_ARM_KUSER', ''):
pass
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_ENABLE_STARTUP_NOTIFICATION'] = ''
if args.startup_notification:
vars['MOZ_ENABLE_STARTUP_NOTIFICATION'] = 'force'
else:
vars['MOZ_ENABLE_STARTUP_NOTIFICATION'] = ''
if vars.get('MOZ_ENABLE_STARTUP_NOTIFICATION', ''):
pass
if vars.get('MOZ_ENABLE_STARTUP_NOTIFICATION', ''):
pass
vars['TK_LIBS'] = format('{TK_LIBS} {MOZ_STARTUP_NOTIFICATION_LIBS}', vars, {})
if vars.get('NS_PRINTING', ''):
pass
if vars.get('MOZ_ENABLE_QT', ''):
if (not vars.get('QTDIR', '')):
pass
else:
vars['HOST_QMAKE'] = format('{QTDIR}/bin/qmake', vars, {})
vars['QT_VERSION'] = subprocess.check_output("$HOST_QMAKE -v | grep 'Using Qt version' | egrep -o '[0-9]+\\.[0-9]+\\.[0-9]+'", shell=True, env=vars).rstrip('\n')
if (not vars.get('QTDIR', '')):
case = vars.get('QT_VERSION', '')
if fnmatch.fnmatch(case, '5.*'):
sys.stdout.write('"Using qt5: $QT_VERSION"\n')
vars['QT5INCDIR'] = subprocess.check_output('pkg-config --variable=includedir Qt5Gui', shell=True, env=vars).rstrip('\n')
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QT5INCDIR}/QtGui/{QT_VERSION}/QtGui', vars, {})
if vars.get('NS_PRINTING', ''):
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {MOZ_QT_WIDGETS_LIBS}', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {MOZ_QT_WIDGETS_CFLAGS}', vars, {})
else:
sys.stderr.write('configure: error: * * * Unsupported Qt Version: $QT_VERSION\n')
sys.exit(1)
else:
vars['MOZ_QT_CFLAGS'] = '-DQT_SHARED'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtGui', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtCore', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtNetwork', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtXml', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtDeclarative', vars, {})
case = vars.get('QT_VERSION', '')
if fnmatch.fnmatch(case, '5.*'):
sys.stdout.write('"Using qt5: $QT_VERSION"\n')
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} -L{QTDIR}/lib/ -lQt5Gui -lQt5Network -lQt5Core -lQt5Xml', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtGui/{QT_VERSION}/QtGui', vars, {})
if vars.get('NS_PRINTING', ''):
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} -lQt5Widgets -lQt5PrintSupport', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtPrintSupport', vars, {})
else:
sys.stderr.write('configure: error: * * * Unsupported Qt Version: $QT_VERSION\n')
sys.exit(1)
vars['HOST_MOC'] = format('{QTDIR}/bin/moc', vars, {})
vars['HOST_RCC'] = format('{QTDIR}/bin/rcc', vars, {})
if (not vars.get('HOST_MOC', '')):
sys.stderr.write('configure: error: No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is incorrect\n')
sys.exit(1)
if (not vars.get('HOST_RCC', '')):
sys.stderr.write('configure: error: No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is incorrect\n')
sys.exit(1)
vars['MOC'] = vars.get('HOST_MOC', '')
vars['RCC'] = vars.get('HOST_RCC', '')
vars['MOZ_ENABLE_QMSYSTEM2'] = ''
if vars.get('MOZ_ENABLE_QMSYSTEM2', ''):
vars['MOZ_ENABLE_QMSYSTEM2'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QMSYSTEM2_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QMSYSTEM2_LIBS}', vars, {})
vars['MOZ_ENABLE_QTNETWORK'] = ''
if vars.get('MOZ_ENABLE_QTNETWORK', ''):
vars['MOZ_ENABLE_QTNETWORK'] = '1'
vars['MOZ_ENABLE_QTMOBILITY'] = ''
if vars.get('MOZ_ENABLE_QTMOBILITY', ''):
vars['MOZ_ENABLE_QTMOBILITY'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QTMOBILITY_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QTMOBILITY_LIBS}', vars, {})
vars['MOZ_ENABLE_QT5FEEDBACK'] = ''
if vars.get('MOZ_ENABLE_QT5FEEDBACK', ''):
vars['MOZ_ENABLE_QT5FEEDBACK'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QT5FEEDBACK_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QT5FEEDBACK_LIBS}', vars, {})
vars['MOZ_ENABLE_QT5GEOPOSITION'] = ''
if vars.get('MOZ_ENABLE_QT5GEOPOSITION', ''):
vars['MOZ_ENABLE_QT5GEOPOSITION'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QT5GEOPOSITION_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QT5GEOPOSITION_LIBS}', vars, {})
if vars.get('MOZ_ENABLE_CONTENTACTION', ''):
vars['MOZ_ENABLE_CONTENTACTION'] = '1'
vars['MOZ_ENABLE_CONTENTACTION'] = ''
if vars.get('MOZ_ENABLE_CONTENTACTION', ''):
vars['MOZ_ENABLE_CONTENTACTION'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_CONTENTACTION_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_CONTENTACTION_LIBS}', vars, {})
if args.official_branding:
if (not vars.get('MOZ_OFFICIAL_BRANDING_DIRECTORY', '')):
sys.stderr.write('configure: error: You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.\n')
sys.exit(1)
else:
vars['MOZ_BRANDING_DIRECTORY'] = vars.get('MOZ_OFFICIAL_BRANDING_DIRECTORY', '')
vars['MOZ_OFFICIAL_BRANDING'] = '1'
else:
vars['MOZ_OFFICIAL_BRANDING'] = ''
if vars.get('MOZ_OFFICIAL_BRANDING', ''):
pass
vars['REAL_BRANDING_DIRECTORY'] = vars.get('MOZ_BRANDING_DIRECTORY', '')
if (not vars.get('REAL_BRANDING_DIRECTORY', '')):
vars['REAL_BRANDING_DIRECTORY'] = format('{MOZ_BUILD_APP}/branding/nightly', vars, {})
if os.path.isfile(format('{_topsrcdir}/{REAL_BRANDING_DIRECTORY}/configure.sh', vars, {})):
subprocess.call(format('. {_topsrcdir}/{REAL_BRANDING_DIRECTORY}/configure.sh', vars, {}), shell=True, env=vars)
if (not vars.get('MOZ_DISTRIBUTION_ID', '')):
vars['MOZ_DISTRIBUTION_ID'] = 'org.mozilla'
if (format('{MOZ_ENABLE_GTK}', vars, {}) or format('{MOZ_ENABLE_QT}', vars, {})):
pass
if vars.get('MOZ_X11', ''):
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_ENABLE_GIO'] = '1'
vars['MOZ_ENABLE_GCONF'] = '1'
if args.gnomevfs:
vars['MOZ_ENABLE_GNOMEVFS'] = 'force'
else:
vars['MOZ_ENABLE_GNOMEVFS'] = ''
if vars.get('MOZ_ENABLE_GNOMEVFS', ''):
pass
if (format('{MOZ_ENABLE_GIO}', vars, {}) and format('{MOZ_ENABLE_GTK}', vars, {})):
if vars.get('MOZ_ENABLE_GTK2', ''):
pass
if vars.get('MOZ_ENABLE_GCONF', ''):
pass
if vars.get('MOZ_ENABLE_GCONF', ''):
pass
if (format('{MOZ_ENABLE_GTK}', vars, {}) or format('{MOZ_ENABLE_QT}', vars, {})):
vars['MOZ_ENABLE_LIBPROXY'] = ''
if args.libproxy:
vars['MOZ_ENABLE_LIBPROXY'] = '1'
else:
vars['MOZ_ENABLE_LIBPROXY'] = ''
if vars.get('MOZ_ENABLE_LIBPROXY', ''):
pass
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_ENABLE_GNOME_COMPONENT'] = '1'
if vars.get('MOZ_ENABLE_GTK', ''):
if args.gnomeui:
vars['MOZ_ENABLE_GNOMEUI'] = 'force'
else:
vars['MOZ_ENABLE_GNOMEUI'] = ''
if vars.get('MOZ_ENABLE_GNOMEUI', ''):
pass
if vars.get('MOZ_ENABLE_GNOMEUI', ''):
pass
if (format('{MOZ_ENABLE_GTK}', vars, {}) or format('{MOZ_ENABLE_QT}', vars, {})):
vars['MOZ_ENABLE_DBUS'] = '1'
if vars.get('MOZ_ENABLE_DBUS', ''):
pass
if vars.get('MOZ_ANDROID_HISTORY', ''):
if (not vars.get('MOZ_PLACES', '')):
pass
else:
sys.stderr.write('configure: error: Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.\n')
sys.exit(1)
if vars.get('MOZ_ANDROID_OMTC', ''):
pass
if vars.get('MOZ_WEBSMS_BACKEND', ''):
pass
if vars.get('MOZ_LOCALE_SWITCHER', ''):
pass
if vars.get('MOZ_ANDROID_BEAM', ''):
pass
if vars.get('MOZ_ANDROID_SEARCH_ACTIVITY', ''):
pass
if vars.get('MOZ_ANDROID_MLS_STUMBLER', ''):
pass
vars['MOZ_IPDL_TESTS'] = ''
if args.ipdl_tests:
vars['MOZ_IPDL_TESTS'] = '1'
else:
vars['MOZ_IPDL_TESTS'] = ''
if vars.get('MOZ_IPDL_TESTS', ''):
pass
if vars.get('ACCESSIBILITY', ''):
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if (not vars.get('MIDL', '')):
if (vars.get('GCC', '') != 'yes'):
sys.stderr.write('configure: error: MIDL could not be found. Building accessibility without MIDL is not supported.\n')
sys.exit(1)
else:
sys.stderr.write('configure: 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.\n')
sys.exit(1)
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('linuxgl' and (format('{ACCESSIBILITY}', vars, {}) != '1'))):
sys.stderr.write('configure: error: "Accessibility is required for the linuxgl widget backend"\n')
sys.exit(1)
if vars.get('MOZ_WEBRTC', ''):
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-linux*') or fnmatch.fnmatch(case, '*-mingw*') or fnmatch.fnmatch(case, '*-darwin*') or fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*') or fnmatch.fnmatch(case, '*-dragonfly*') or fnmatch.fnmatch(case, '*-freebsd*') or fnmatch.fnmatch(case, '*-netbsd*') or fnmatch.fnmatch(case, '*-openbsd*')):
pass else:
vars['MOZ_WEBRTC'] = ''
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'arm') or fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'ppc*') or fnmatch.fnmatch(case, 'ia64')):
subprocess.call(':', shell=True, env=vars)
else:
vars['MOZ_WEBRTC'] = ''
if vars.get('MOZ_WEBRTC', ''):
vars['MOZ_RAW'] = '1'
vars['MOZ_VPX'] = '1'
vars['MOZ_VPX_ERROR_CONCEALMENT'] = '1'
vars['MOZ_WEBRTC_SIGNALING'] = '1'
vars['MOZ_PEERCONNECTION'] = '1'
vars['MOZ_SCTP'] = '1'
vars['MOZ_SRTP'] = '1'
if vars.get('MOZ_X11', ''):
vars['MOZ_WEBRTC_X11_LIBS'] = '-lXext -lXdamage -lXfixes -lXcomposite'
else:
vars['MOZ_SYNTH_PICO'] = ''
if (format('{OS_TARGET}', vars, {}) == ('Android' or (format('{CPU_ARCH}', vars, {}) == 'arm'))):
vars['MOZ_SAMPLE_TYPE_S16'] = '1'
else:
vars['MOZ_SAMPLE_TYPE_FLOAT32'] = '1'
if vars.get('MOZ_WEBSPEECH', ''):
pass
if args.raw:
vars['MOZ_RAW'] = '1'
else:
vars['MOZ_RAW'] = ''
if vars.get('MOZ_RAW', ''):
pass
if (vars.get('ac_cv_c_attribute_aligned', '') != '0'):
pass
if vars.get('MOZ_WEBM', ''):
vars['MOZ_VPX'] = '1'
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'cocoa'):
vars['MOZ_APPLEMEDIA'] = '1'
if vars.get('MOZ_APPLEMEDIA', ''):
vars['LDFLAGS'] = format('{LDFLAGS} -framework AudioToolbox', vars, {})
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['MOZ_DIRECTSHOW'] = '1'
if vars.get('MOZ_DIRECTSHOW', ''):
pass
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['MOZ_WMF'] = '1'
if vars.get('MOZ_WMF', ''):
pass
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android')):
pass else:
vars['MOZ_FFMPEG'] = '1'
if vars.get('MOZ_FFMPEG', ''):
pass
if (format('{MOZ_WMF}', vars, {}) or (format('{MOZ_FFMPEG}', vars, {}) or format('{MOZ_APPLEMEDIA}', vars, {}))):
vars['MOZ_FMP4'] = '1'
if vars.get('MOZ_FMP4', ''):
pass
if vars.get('MOZ_EME', ''):
pass
if (format('{OS_TARGET}', vars, {}) == ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk'))):
vars['MOZ_ANDROID_OMX'] = '1'
if args.android_omx:
vars['MOZ_ANDROID_OMX'] = '1'
else:
vars['MOZ_ANDROID_OMX'] = ''
if vars.get('MOZ_ANDROID_OMX', ''):
pass
if args.media_navigator:
vars['MOZ_MEDIA_NAVIGATOR'] = '1'
else:
vars['MOZ_MEDIA_NAVIGATOR'] = ''
if vars.get('MOZ_MEDIA_NAVIGATOR', ''):
pass
if (format('{OS_TARGET}', vars, {}) == ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk'))):
vars['MOZ_OMX_PLUGIN'] = '1'
if args.omx_plugin:
vars['MOZ_OMX_PLUGIN'] = '1'
else:
vars['MOZ_OMX_PLUGIN'] = ''
if vars.get('MOZ_OMX_PLUGIN', ''):
if (vars.get('OS_TARGET', '') == 'Android'):
pass
else:
sys.stderr.write('configure: error: OMX media plugin can only be built on B2G or Android\n')
sys.exit(1)
vars['MOZ_LIBVPX_CFLAGS'] = ''
vars['MOZ_LIBVPX_LIBS'] = ''
if vars.get('MOZ_VPX', ''):
if vars.get('MOZ_VPX_ERROR_CONCEALMENT', ''):
pass
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if vars.get('MOZ_NATIVE_LIBVPX', ''):
vars['CFLAGS'] = format('{CFLAGS} {MOZ_LIBVPX_CFLAGS}', vars, {})
vars['LIBS'] = format('{LIBS} {MOZ_LIBVPX_LIBS}', vars, {})
if (format('{ac_cv_header_vpx_mem_vpx_mem_h}', vars, {}) == ('no' or (format('{ac_cv_func_vpx_mem_set_functions}', vars, {}) == 'no'))):
pass
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if vars.get('MOZ_WEBM', ''):
if vars.get('MOZ_SAMPLE_TYPE_FLOAT32', ''):
vars['MOZ_VORBIS'] = '1'
else:
vars['MOZ_TREMOR'] = '1'
if (format('{MOZ_VPX}', vars, {}) and (not format('{MOZ_NATIVE_LIBVPX}', vars, {}))):
vars['VPX_AS'] = vars.get('YASM', '')
vars['VPX_ASM_SUFFIX'] = 'asm'
vars['VPX_NEED_OBJ_INT_EXTRACT'] = ''
case = format('{OS_ARCH}:{CPU_ARCH}', vars, {})
if fnmatch.fnmatch(case, 'Darwin:x86'):
vars['VPX_ASFLAGS'] = '-f macho32 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'Darwin:x86_64'):
vars['VPX_ASFLAGS'] = '-f macho64 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'WINNT:x86_64'):
vars['VPX_ASFLAGS'] = '-f x64 -rnasm -pnasm'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'WINNT:x86'):
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (not format('{YASM}', vars, {}))):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
elif (format('{COMPILE_ENVIRONMENT}', vars, {}) and (format('{_YASM_MAJOR_VERSION}', vars, {}) < ('1' or (format('{_YASM_MAJOR_VERSION}', vars, {}) == ('1' and (format('{_YASM_MINOR_VERSION}', vars, {}) < '1')))))):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
else:
vars['VPX_ASFLAGS'] = '-f win32 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:arm*'):
if vars.get('GNU_AS', ''):
vars['VPX_AS'] = vars.get('AS', '')
vars['VPX_ASFLAGS'] = '-march=armv7-a -mfpu=neon'
vars['VPX_DASH_C_FLAG'] = '-c'
vars['VPX_AS_CONVERSION'] = '$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
vars['VPX_ASM_SUFFIX'] = vars.get('ASM_SUFFIX', '')
vars['VPX_ARM_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:x86'):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['VPX_ASFLAGS'] = '-f elf32 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:x86_64'):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['VPX_ASFLAGS'] = '-f elf64 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (format('{VPX_X86_ASM}', vars, {}) and (not format('{VPX_AS}', vars, {})))):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
if ((not format('{GNU_CC}', vars, {})) and ((not format('{INTEL_CC}', vars, {})) and (not format('{CLANG_CC}', vars, {})))):
vars['VPX_NEED_OBJ_INT_EXTRACT'] = '1'
if vars.get('VPX_X86_ASM', ''):
pass
elif vars.get('VPX_ARM_ASM', ''):
pass
else:
sys.stdout.write('configure: warning: No assembler or assembly support for libvpx. Using unoptimized C routines.\n')
if vars.get('MOZ_WAVE', ''):
pass
if (format('{MOZ_VORBIS}', vars, {}) and format('{MOZ_TREMOR}', vars, {})):
sys.stderr.write('configure: 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/\n')
sys.exit(1)
if (format('{MOZ_WEBRTC}', vars, {}) and (not format('{MOZ_OPUS}', vars, {}))):
sys.stderr.write('configure: error: MOZ_WEBRTC requires MOZ_OPUS which is disabled.\n')
sys.exit(1)
if vars.get('MOZ_VORBIS', ''):
pass
if vars.get('MOZ_TREMOR', ''):
vars['MOZ_WEBM_ENCODER'] = ''
if vars.get('MOZ_OPUS', ''):
pass
if vars.get('MOZ_WEBM_ENCODER', ''):
pass
if (vars.get('OS_TARGET', '') == 'Linux'):
vars['MOZ_ALSA'] = '1'
if args.alsa:
vars['MOZ_ALSA'] = '1'
else:
vars['MOZ_ALSA'] = ''
if vars.get('MOZ_ALSA', ''):
pass
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android') or fnmatch.fnmatch(case, 'OpenBSD')):
pass elif (not vars.get('MOZ_B2G', '')):
vars['MOZ_PULSEAUDIO'] = '1'
if vars.get('MOZ_PULSEAUDIO', ''):
if (not vars.get('gonkdir', '')):
pass
else:
vars['MOZ_PULSEAUDIO_CFLAGS'] = format('-I{gonkdir}/external/pulseaudio/pulseaudio/src', vars, {})
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android')):
pass else:
vars['MOZ_GSTREAMER'] = '1'
vars['GST_API_VERSION'] = '0.10'
if vars.get('MOZ_GSTREAMER', ''):
if (vars.get('GST_API_VERSION', '') == '1.0'):
vars['GST_VERSION'] = '1.0'
else:
vars['GST_VERSION'] = '0.10.25'
if (not vars.get('_HAVE_GSTREAMER', '')):
sys.stderr.write('configure: error: gstreamer and gstreamer-plugins-base development packages are needed to build gstreamer backend. Install them or disable gstreamer support with --disable-gstreamer\n')
sys.exit(1)
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} {GSTREAMER_LIBS} -lgstvideo-{GST_API_VERSION}', vars, {})
if vars.get('_HAVE_LIBGSTVIDEO', ''):
vars['GSTREAMER_LIBS'] = format('{GSTREAMER_LIBS} -lgstvideo-{GST_API_VERSION}', vars, {})
else:
sys.stderr.write('configure: 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.\n')
sys.exit(1)
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
if vars.get('MOZ_GSTREAMER', ''):
pass
if vars.get('MOZ_B2G', ''):
if vars.get('MOZ_PERMISSIONS', ''):
vars['MOZ_CHILD_PERMISSIONS'] = '1'
else:
sys.stderr.write('configure: error: You need to enable MOZ_PERMISSIONS for MOZ_CHILD_PERMISSIONS\n')
sys.exit(1)
if vars.get('ENABLE_SYSTEM_EXTENSION_DIRS', ''):
pass
if vars.get('JAVA_BIN_PATH', ''):
vars['JAVA_PATH'] = vars.get('JAVA_BIN_PATH', '')
else:
vars['JAVA_PATH'] = format('{JAVA_HOME}/bin:{PATH}', vars, {})
if (format('{JAVA_BIN_PATH}', vars, {}) or (format('{OS_TARGET}', vars, {}) == ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk')))):
if ((not vars.get('JAVA', '')) or (vars.get('JAVA', '') == ':')):
sys.stderr.write('configure: error: The program java was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JAVAC', '')) or (vars.get('JAVAC', '') == ':')):
sys.stderr.write('configure: error: The program javac was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JAVAH', '')) or (vars.get('JAVAH', '') == ':')):
sys.stderr.write('configure: error: The program javah was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JAR', '')) or (vars.get('JAR', '') == ':')):
sys.stderr.write('configure: error: The program jar was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JARSIGNER', '')) or (vars.get('JARSIGNER', '') == ':')):
sys.stderr.write('configure: error: The program jarsigner was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('KEYTOOL', '')) or (vars.get('KEYTOOL', '') == ':')):
sys.stderr.write('configure: error: The program keytool was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
vars['MOZ_ANGLE_RENDERER'] = ''
vars['MOZ_D3D_CPU_SUFFIX'] = ''
vars['MOZ_HAS_WINSDK_WITH_D3D'] = ''
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = ''
vars['MOZ_D3DCOMPILER_VISTA_DLL_PATH'] = ''
vars['MOZ_DIRECTX_SDK_PATH'] = ''
vars['MOZ_D3DCOMPILER_XP_DLL'] = ''
vars['MOZ_D3DCOMPILER_XP_CAB'] = ''
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, '*mingw*'):
vars['MOZ_ANGLE_RENDERER'] = '1'
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'i*86'):
vars['MOZ_D3D_CPU_SUFFIX'] = 'x86'
elif fnmatch.fnmatch(case, 'x86_64'):
vars['MOZ_D3D_CPU_SUFFIX'] = 'x64'
if args.require_all_d3dc_versions:
vars['MOZ_REQUIRE_ALL_D3DCS'] = '1'
else:
vars['MOZ_REQUIRE_ALL_D3DCS'] = ''
if vars.get('MOZ_WEBGL_DISABLED', ''):
vars['MOZ_WEBGL'] = ''
vars['MOZ_ANGLE_RENDERER'] = ''
if vars.get('MOZ_WEBGL', ''):
pass
if vars.get('MOZ_WEBGL_CONFORMANT', ''):
pass
vars['MOZ_FOUND_D3D_COMPILERS'] = ''
if vars.get('MOZ_ANGLE_RENDERER', ''):
if (not vars.get('MOZ_D3D_CPU_SUFFIX', '')):
sys.stderr.write("configure: error: Couldn't determine MOZ_D3D_CPU_SUFFIX.\n")
sys.exit(1)
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = ''
case = vars.get('MOZ_WINSDK_MAXVER', '')
if fnmatch.fnmatch(case, '0x0603*'):
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = 'd3dcompiler_47.dll'
sys.stdout.write('Found D3D compiler in Windows SDK 8.1.\n')
elif fnmatch.fnmatch(case, '0x0602*'):
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = 'd3dcompiler_46.dll'
sys.stdout.write('Found D3D compiler in Windows SDK 8.0.\n')
if vars.get('MOZ_D3DCOMPILER_VISTA_DLL', ''):
if vars.get('WINDOWSSDKDIR', ''):
vars['MOZ_D3DCOMPILER_VISTA_DLL_PATH'] = format('{WINDOWSSDKDIR}/Redist/D3D/{MOZ_D3D_CPU_SUFFIX}/{MOZ_D3DCOMPILER_VISTA_DLL}', vars, {})
if os.path.isfile(vars.get('MOZ_D3DCOMPILER_VISTA_DLL_PATH', '')):
sys.stdout.write('Found MOZ_D3DCOMPILER_VISTA_DLL_PATH: $MOZ_D3DCOMPILER_VISTA_DLL_PATH\n')
vars['MOZ_HAS_WINSDK_WITH_D3D'] = '1'
else:
sys.stdout.write("MOZ_D3DCOMPILER_VISTA_DLL_PATH doesn't exist: $MOZ_D3DCOMPILER_VISTA_DLL_PATH\n")
sys.stderr.write('configure: error: Windows SDK at "$WINDOWSSDKDIR" appears broken. Try updating to MozillaBuild 1.9 final or higher.\n')
sys.exit(1)
vars['MOZ_D3DCOMPILER_VISTA_DLL_PATH'] = ''
else:
sys.stdout.write('Windows SDK not found.\n')
if (not vars.get('MOZ_D3DCOMPILER_VISTA_DLL_PATH', '')):
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = ''
if vars.get('GNU_CC', ''):
pass
vars['MOZ_DIRECTX_SDK_REG_KEY'] = subprocess.check_output("reg query 'HKLM\\Software\\Microsoft\\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1", shell=True, env=vars).rstrip('\n')
if (not vars.get('MOZ_DIRECTX_SDK_REG_KEY', '')):
vars['MOZ_DIRECTX_SDK_REG_KEY'] = subprocess.check_output("reg query 'HKLM\\Software\\Microsoft\\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1", shell=True, env=vars).rstrip('\n')
vars['MOZ_DIRECTX_SDK_PATH'] = subprocess.check_output('reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed \'s/.*\\([a-zA-Z]\\)\\\\:\\\\\\\\/\\\\1\\\\:\\\\\\\\/\' | sed \'s,\\\\\\\\,/,g\'', shell=True, env=vars).rstrip('\n')
if (not ((not vars.get('MOZ_DIRECTX_SDK_PATH', '')) and (not os.path.isfile(format('{MOZ_DIRECTX_SDK_PATH}/lib/{MOZ_D3D_CPU_SUFFIX}/dxguid.lib', vars, {}))))):
sys.stdout.write('Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH\n')
else:
sys.stdout.write('DirectX SDK not found.\n')
vars['MOZ_DIRECTX_SDK_PATH'] = ''
if vars.get('MOZ_DIRECTX_SDK_PATH', ''):
if subprocess.check_output("echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'", shell=True, env=vars).rstrip('\n'):
sys.stdout.write('Found the February 2010 DirectX SDK, which is unacceptable to ANGLE.\n')
vars['MOZ_DIRECTX_SDK_PATH'] = ''
if vars.get('MOZ_DIRECTX_SDK_PATH', ''):
vars['MOZ_D3DX9_VERSION'] = subprocess.check_output('dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_D3D_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[0-9][0-9]\\.dll | head -n1 | sed \'s/.*\\([0-9][0-9]\\).*/\\\\1/g\'', shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_D3DX9_VERSION', ''):
vars['MOZ_D3DCOMPILER_XP_CAB'] = subprocess.check_output('find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_D3D_CPU_SUFFIX}.cab | head -n1', shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_D3DCOMPILER_XP_CAB', ''):
vars['MOZ_D3DCOMPILER_XP_DLL'] = format('D3DCompiler_{MOZ_D3DX9_VERSION}.dll', vars, {})
else:
sys.stdout.write("Couldn't find a CAB containing the D3D compiler DLL.\n")
sys.stderr.write('configure: error: DirectX SDK at "$MOZ_DIRECTX_SDK_PATH" appears broken.\n')
sys.exit(1)
vars['MOZ_DIRECTX_SDK_PATH'] = ''
else:
sys.stdout.write("Couldn't determine the D3DX9 version for the DirectX SDK.\n")
vars['MOZ_DIRECTX_SDK_PATH'] = ''
else:
sys.stdout.write("Couldn't find an acceptable DirectX SDK for ANGLE, needed for d3dcompiler_43.\n")
sys.stdout.write(' Either ignore, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.\n')
vars['MOZ_FOUND_A_D3D_COMPILER'] = ''
vars['MOZ_FOUND_BOTH_D3D_COMPILERS'] = '1'
if vars.get('MOZ_D3DCOMPILER_VISTA_DLL', ''):
vars['MOZ_FOUND_A_D3D_COMPILER'] = '1'
sys.stdout.write('Found d3dcompiler DLL for Vista+: $MOZ_D3DCOMPILER_VISTA_DLL\n')
else:
vars['MOZ_FOUND_BOTH_D3D_COMPILERS'] = ''
if vars.get('MOZ_D3DCOMPILER_XP_DLL', ''):
vars['MOZ_FOUND_A_D3D_COMPILER'] = '1'
sys.stdout.write('Found d3dcompiler DLL for XP: $MOZ_D3DCOMPILER_XP_DLL\n')
else:
vars['MOZ_FOUND_BOTH_D3D_COMPILERS'] = ''
if (not vars.get('CROSS_COMPILE', '')):
if (not 'MOZ_FOUND_A_D3D_COMPILER'):
sys.stderr.write("configure: error: Couldn't find an acceptable D3D compiler DLL.\n")
sys.exit(1)
sys.stderr.write('configure: error: Either install Windows SDK 8.0+, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.\n')
sys.exit(1)
if (format('{MOZ_REQUIRE_ALL_D3DCS}', vars, {}) and (not format('{MOZ_FOUND_BOTH_D3D_COMPILERS}', vars, {}))):
sys.stderr.write('configure: error: Both D3D compilers _43 and _46+ are required by --enable-require-d3d-compilers.\n')
sys.exit(1)
sys.stderr.write('configure: error: Install Windows SDK 8.0+, as well as DirectX SDK (June 2010 version or newer), or reconfigure without this flag.\n')
sys.exit(1)
vars['MOZ_GAMEPAD'] = ''
vars['MOZ_GAMEPAD_BACKEND'] = 'stub'
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Linux')):
vars['MOZ_GAMEPAD'] = '1'
elif fnmatch.fnmatch(case, 'Android'):
if (vars.get('MOZ_WIDGET_TOOLKIT', '') != 'gonk'):
vars['MOZ_GAMEPAD'] = '1'
if vars.get('MOZ_GAMEPAD', ''):
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Darwin'):
vars['MOZ_GAMEPAD_BACKEND'] = 'cocoa'
elif fnmatch.fnmatch(case, 'WINNT'):
case = vars.get('MOZ_WINSDK_MAXVER', '')
if fnmatch.fnmatch(case, '0x0601*'):
sys.stderr.write('configure: error: The Windows 8 SDK or newer is required to build Gamepad support. Please install a newer Windows SDK or reconfigure with --disable-gamepad to disable gamepad support.\n')
sys.exit(1)
vars['MOZ_GAMEPAD_BACKEND'] = 'windows'
elif fnmatch.fnmatch(case, 'Linux'):
if (vars.get('ac_cv_header_linux_joystick_h', '') != 'yes'):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
vars['MOZ_GAMEPAD_BACKEND'] = 'linux'
elif fnmatch.fnmatch(case, 'Android'):
vars['MOZ_GAMEPAD_BACKEND'] = 'android'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, 'i?86-*-mingw*') or fnmatch.fnmatch(case, 'x86_64-*-mingw*')):
vars['MOZ_CRASHREPORTER'] = '1'
elif (fnmatch.fnmatch(case, 'i?86-apple-darwin*') or fnmatch.fnmatch(case, 'x86_64-apple-darwin*')):
vars['MOZ_CRASHREPORTER'] = '1'
elif (fnmatch.fnmatch(case, 'i?86-*-linux*') or fnmatch.fnmatch(case, 'x86_64-*-linux*') or fnmatch.fnmatch(case, 'arm-*-linux*')):
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_CRASHREPORTER'] = '1'
elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
vars['MOZ_CRASHREPORTER'] = '1'
elif fnmatch.fnmatch(case, '*solaris*'):
vars['MOZ_CRASHREPORTER'] = '1'
if (format('{OS_ARCH}', vars, {}) != (format('{HOST_OS_ARCH}', vars, {}) and (format('{OS_ARCH}', vars, {}) != 'WINNT'))):
if (vars.get('MOZ_CRASHREPORTER', '') == 'F'):
sys.stderr.write('configure: error: Cannot --enable-crashreporter, as breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH.\n')
sys.exit(1)
vars['MOZ_CRASHREPORTER'] = ''
if vars.get('MOZ_CRASHREPORTER', ''):
if (not ((not (format('{OS_TARGET}', vars, {}) == ('Linux' or (format('{OS_ARCH}', vars, {}) == 'SunOS')))) and (not (not vars.get('SKIP_LIBRARY_CHECKS', ''))))):
pass
if (vars.get('OS_ARCH', '') == 'WINNT'):
if (not vars.get('HAVE_64BIT_BUILD', '')):
vars['MOZ_CRASHREPORTER_INJECTOR'] = '1'
if (not vars.get('MOZ_CRASHREPORTER_ENABLE_PERCENT', '')):
vars['MOZ_CRASHREPORTER_ENABLE_PERCENT'] = '100'
vars['MOZ_LIBJPEG_TURBO'] = ''
if (not vars.get('MOZ_NATIVE_JPEG', '')):
vars['MOZ_LIBJPEG_TURBO'] = '1'
if (format('{MOZ_NATIVE_JPEG}', vars, {}) == ('1' and (format('{MOZ_LIBJPEG_TURBO}', vars, {}) == '1'))):
sys.stderr.write('configure: error: cannot use --with-system-jpeg with --enable-libjpeg-turbo.\n')
sys.exit(1)
if vars.get('MOZ_LIBJPEG_TURBO', ''):
case = format('{OS_ARCH}:{OS_TEST}', vars, {})
if fnmatch.fnmatch(case, 'Darwin:i?86'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f macho32 -rnasm -pnasm -DPIC -DMACHO'
vars['LIBJPEG_TURBO_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'Darwin:x86_64'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO'
vars['LIBJPEG_TURBO_X64_ASM'] = '1'
elif (fnmatch.fnmatch(case, 'WINNT:x86') or fnmatch.fnmatch(case, 'WINNT:i?86')):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f win32 -rnasm -pnasm -DPIC -DWIN32'
vars['LIBJPEG_TURBO_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'WINNT:x86_64'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC'
vars['LIBJPEG_TURBO_X64_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:arm*'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-march=armv7-a -mfpu=neon'
vars['LIBJPEG_TURBO_ARM_ASM'] = '1'
elif (fnmatch.fnmatch(case, '*:x86') or fnmatch.fnmatch(case, '*:i?86')):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f elf32 -rnasm -pnasm -DPIC -DELF'
vars['LIBJPEG_TURBO_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:x86_64'):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF'
vars['LIBJPEG_TURBO_X64_ASM'] = '1'
if (format('{LIBJPEG_TURBO_X86_ASM}', vars, {}) or format('{LIBJPEG_TURBO_X64_ASM}', vars, {})):
vars['LIBJPEG_TURBO_AS'] = vars.get('YASM', '')
if (not vars.get('LIBJPEG_TURBO_AS', '')):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
if (vars.get('OS_ARCH', '') == 'Linux'):
if (format('{_YASM_MAJOR_VERSION}', vars, {}) < ('1' or (format('{_YASM_MAJOR_VERSION}', vars, {}) == ('1' and (format('{_YASM_MINOR_VERSION}', vars, {}) == ('0' and (format('{_YASM_RELEASE}', vars, {}) < '1'))))))):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
elif (format('{_YASM_MAJOR_VERSION}', vars, {}) < ('1' or (format('{_YASM_MAJOR_VERSION}', vars, {}) == ('1' and (format('{_YASM_MINOR_VERSION}', vars, {}) < '1'))))):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
if vars.get('LIBJPEG_TURBO_ARM_ASM', ''):
print format('Using {AS} as the assembler for ARM code.', vars, {})
vars['LIBJPEG_TURBO_AS'] = vars.get('AS', '')
if vars.get('LIBJPEG_TURBO_X86_ASM', ''):
pass
elif vars.get('LIBJPEG_TURBO_X64_ASM', ''):
pass
elif vars.get('LIBJPEG_TURBO_ARM_ASM', ''):
pass
elif vars.get('MOZ_LIBJPEG_TURBO', ''):
sys.stdout.write('configure: warning: No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.\n')
if ((not format('{MOZ_ENABLE_GNOMEVFS}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n')})) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n') != '0')):
if vars.get('MOZ_X11', ''):
sys.stdout.write('configure: warning: Removing gnomevfs from MOZ_EXTENSIONS due to no --enable-gnomevfs.\n')
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'", shell=True, env=vars).rstrip('\n')
if (format('{LIBXUL_SDK_DIR}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n')}) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n') != '0')):
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'", shell=True, env=vars).rstrip('\n')
if ((not format('{MOZ_ENABLE_GIO}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n')})) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n') != '0')):
if vars.get('MOZ_X11', ''):
sys.stdout.write('configure: warning: Removing gio from MOZ_EXTENSIONS due to --disable-gio.\n')
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gio||'", shell=True, env=vars).rstrip('\n')
if (format('{LIBXUL_SDK_DIR}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n')}) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n') != '0')):
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gio||'", shell=True, env=vars).rstrip('\n')
if (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n') != '0'):
vars['MOZ_GIO_COMPONENT'] = '1'
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gio||'", shell=True, env=vars).rstrip('\n')
vars['MOZ_EXTENSIONS'] = subprocess.check_output('${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}', shell=True, env=vars).rstrip('\n')
for extension in for_loop(['{MOZ_EXTENSIONS}'], vars, {}):
vars['extension'] = extension
if (not os.path.isdir(format('{srcdir}/extensions/{extension}', vars, {}))):
sys.stderr.write('configure: error: Unrecognized extension provided to --enable-extensions: ${extension}.\n')
sys.exit(1)
if vars.get('MOZ_USE_NATIVE_POPUP_WINDOWS', ''):
pass
if args.tree_freetype:
vars['MOZ_TREE_FREETYPE'] = '1'
else:
vars['MOZ_TREE_FREETYPE'] = ''
if vars.get('MOZ_TREE_FREETYPE', ''):
if vars.get('_WIN32_MSVC', ''):
sys.stderr.write('configure: error: "building with in-tree freetype is not supported on MSVC"\n')
sys.exit(1)
vars['MOZ_ENABLE_CAIRO_FT'] = '1'
vars['FT_FONT_FEATURE'] = '#define CAIRO_HAS_FT_FONT 1'
vars['FT2_CFLAGS'] = '-I$(topsrcdir)/modules/freetype2/include'
vars['CAIRO_FT_CFLAGS'] = '-I$(topsrcdir)/modules/freetype2/include'
vars['FT2_LIBS'] = '$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
vars['CAIRO_FT_OSLIBS'] = ''
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['MIN_NSIS_MAJOR_VER'] = '2'
vars['MIN_NSIS_MINOR_VER'] = '46'
if (vars.get('MAKENSISU', '') and (vars.get('MAKENSISU', '') != ':')):
sys.stdout.write('yes\n')
vars['MAKENSISU_VER'] = subprocess.check_output('"$MAKENSISU" -version 2>/dev/null', shell=True, env=vars).rstrip('\n')
vars['MAKENSISU_PARSED_VER'] = subprocess.check_output('echo "$MAKENSISU_VER" | sed -e \'/-Unicode/!s/.*//g\' -e \'s/^v\\([0-9]\\+\\.[0-9]\\+\\).*\\-Unicode$/\\1/g\'', shell=True, env=vars).rstrip('\n')
if (vars.get('MAKENSISU_PARSED_VER', '') == ''):
vars['MAKENSISU_PARSED_VER'] = subprocess.check_output('echo "$MAKENSISU_VER" | sed -e \'s/^v\\([0-9]\\+\\.[0-9]\\+\\).*$/\\1/g\'', shell=True, env=vars).rstrip('\n')
vars['MAKENSISU_MAJOR_VER'] = '0'
vars['MAKENSISU_MINOR_VER'] = '0'
if (not (vars.get('MAKENSISU_PARSED_VER', '') == '')):
vars['MAKENSISU_MAJOR_VER'] = subprocess.check_output("echo $MAKENSISU_PARSED_VER | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['MAKENSISU_MINOR_VER'] = subprocess.check_output("echo $MAKENSISU_PARSED_VER | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('configure: checking for Unicode NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater\n')
if (not ((not (format('{MAKENSISU_MAJOR_VER}', vars, {}) == (format('{MIN_NSIS_MAJOR_VER}', vars, {}) and (format('{MAKENSISU_MINOR_VER}', vars, {}) >= format('{MIN_NSIS_MINOR_VER}', vars, {}))))) or (not (format('{MAKENSISU_MAJOR_VER}', vars, {}) > format('{MIN_NSIS_MAJOR_VER}', vars, {}))))):
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
if (not vars.get('CROSS_COMPILE', '')):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
else:
vars['MAKENSISU'] = ''
elif (not vars.get('CROSS_COMPILE', '')):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
else:
vars['MAKENSISU'] = ''
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) != ('windows' and (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) != ('cocoa' and (not format('{MOZ_WIDGET_GTK}', vars, {})))))):
vars['MOZ_WEBAPP_RUNTIME'] = ''
if (format('{OS_ARCH}', vars, {}) == ('WINNT' and ((not format('{MAKENSISU}', vars, {})) and format('{CROSS_COMPILE}', vars, {})))):
vars['MOZ_WEBAPP_RUNTIME'] = ''
if vars.get('MOZ_WEBAPP_RUNTIME', ''):
pass
if (not vars.get('TAR', '')):
sys.stderr.write('configure: error: no tar archiver found in \\$PATH\n')
sys.exit(1)
if vars.get('MOZ_SIGN_CMD', ''):
pass
if args.maintenance_service:
vars['MOZ_MAINTENANCE_SERVICE'] = '1'
else:
vars['MOZ_MAINTENANCE_SERVICE'] = ''
if vars.get('MOZ_MAINTENANCE_SERVICE', ''):
if (vars.get('OS_ARCH', '') == 'WINNT'):
pass
else:
sys.stderr.write('configure: error: Can only build with --enable-maintenance-service with a Windows target\n')
sys.exit(1)
if args.bundled_fonts:
vars['MOZ_BUNDLED_FONTS'] = '1'
else:
vars['MOZ_BUNDLED_FONTS'] = ''
if vars.get('MOZ_BUNDLED_FONTS', ''):
pass
if args.verify_mar:
vars['MOZ_VERIFY_MAR_SIGNATURE'] = '1'
else:
vars['MOZ_VERIFY_MAR_SIGNATURE'] = ''
if vars.get('MOZ_VERIFY_MAR_SIGNATURE', ''):
if (vars.get('OS_ARCH', '') == 'WINNT'):
pass
else:
sys.stderr.write('configure: error: Can only build with --enable-verify-mar with a Windows target\n')
sys.exit(1)
if args.signmar:
vars['MOZ_ENABLE_SIGNMAR'] = '1'
else:
vars['MOZ_ENABLE_SIGNMAR'] = ''
if vars.get('MOZ_ENABLE_SIGNMAR', ''):
pass
if vars.get('MOZ_UPDATER', ''):
pass
if args.update_packaging:
vars['MOZ_UPDATE_PACKAGING'] = '1'
else:
vars['MOZ_UPDATE_PACKAGING'] = ''
if vars.get('ENABLE_TESTS', ''):
vars['GTEST_HAS_RTTI'] = '0'
if vars.get('_WIN32_MSVC', ''):
pass
if (vars.get('OS_TARGET', '') == 'Android'):
pass
if vars.get('MOZ_DISABLE_PARENTAL_CONTROLS', ''):
pass
if vars.get('MOZ_DISABLE_CRYPTOLEGACY', ''):
pass
if vars.get('MOZ_NO_EV_CERTS', ''):
pass
if vars.get('NSS_NO_LIBPKIX', ''):
pass
if vars.get('gonkdir', ''):
vars['MOZ_CONTENT_SANDBOX'] = '1'
if args.content_sandbox:
vars['MOZ_CONTENT_SANDBOX'] = '1'
else:
vars['MOZ_CONTENT_SANDBOX'] = ''
if vars.get('MOZ_CONTENT_SANDBOX', ''):
pass
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'WINNT'):
vars['MOZ_GMP_SANDBOX'] = '1'
elif fnmatch.fnmatch(case, 'Linux'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'x86')):
vars['MOZ_GMP_SANDBOX'] = '1'
if vars.get('MOZ_GMP_SANDBOX', ''):
pass
if vars.get('MOZ_FEEDS', ''):
pass
elif (vars.get('MOZ_BUILD_APP', '') == 'browser'):
sys.stderr.write('configure: error: Cannot build Firefox with --disable-feeds.\n')
sys.exit(1)
vars['MOZ_NATIVE_SQLITE'] = ''
if args.system_sqlite:
vars['MOZ_NATIVE_SQLITE'] = '1'
else:
vars['MOZ_NATIVE_SQLITE'] = ''
if vars.get('MOZ_NATIVE_SQLITE', ''):
sys.stdout.write('configure: checking for SQLITE_SECURE_DELETE support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_secure_delete\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_secure_delete}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_SECURE_DELETE.\n')
sys.exit(1)
sys.stdout.write('configure: checking for SQLITE_THREADSAFE support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_threadsafe\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_threadsafe}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_THREADSAFE.\n')
sys.exit(1)
sys.stdout.write('configure: checking for SQLITE_ENABLE_FTS3 support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_enable_fts3\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_enable_fts3}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_ENABLE_FTS3.\n')
sys.exit(1)
sys.stdout.write('configure: checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_enable_unlock_notify\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_enable_unlock_notify}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.\n')
sys.exit(1)
if vars.get('MOZ_NATIVE_SQLITE', ''):
pass
if vars.get('MOZ_HELP_VIEWER', ''):
pass
if args.safe_browsing:
vars['MOZ_SAFE_BROWSING'] = '1'
else:
vars['MOZ_SAFE_BROWSING'] = ''
if vars.get('MOZ_SAFE_BROWSING', ''):
pass
if vars.get('MOZ_SAFE_BROWSING', ''):
vars['MOZ_URL_CLASSIFIER'] = '1'
if args.url_classifier:
vars['MOZ_URL_CLASSIFIER'] = '1'
else:
vars['MOZ_URL_CLASSIFIER'] = ''
if vars.get('MOZ_URL_CLASSIFIER', ''):
pass
vars['MOZ_GL_PROVIDER'] = ''
if vars.get('MOZ_GL_PROVIDER', ''):
vars['MOZ_GL_DEFAULT_PROVIDER'] = vars.get('MOZ_GL_PROVIDER', '')
if args.faststripe:
vars['MOZ_THEME_FASTSTRIPE'] = '1'
else:
vars['MOZ_THEME_FASTSTRIPE'] = ''
if args.mobile_optimize:
vars['MOZ_GFX_OPTIMIZE_MOBILE'] = '1'
if vars.get('MOZ_GFX_OPTIMIZE_MOBILE', ''):
pass
if (not vars.get('MOZ_OPTIMIZE_FLAGS', '')):
vars['MOZ_OPTIMIZE_FLAGS'] = '-O'
subprocess.call('MOZ_SET_FRAMEPTR_FLAGS', shell=True, env=vars)
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('MOZ_OPTIMIZE', ''):
sys.stdout.write('configure: checking for valid optimization flags\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {MOZ_OPTIMIZE_FLAGS}', vars, {})
sys.stdout.write('$_results\n')
if (vars.get('_results', '') == 'no'):
sys.stderr.write('configure: error: These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS\n')
sys.exit(1)
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if args.warnings_as_errors:
vars['MOZ_ENABLE_WARNINGS_AS_ERRORS'] = '1'
else:
vars['MOZ_ENABLE_WARNINGS_AS_ERRORS'] = ''
if (not vars.get('MOZ_ENABLE_WARNINGS_AS_ERRORS', '')):
vars['WARNINGS_AS_ERRORS'] = ''
elif vars.get('GNU_CC', ''):
if vars.get('MOZ_PGO', ''):
pass
if vars.get('NS_DISABLE_LOGGING', ''):
pass
vars['_ENABLE_LOGREFCNT'] = '42'
if args.logrefcnt:
vars['_ENABLE_LOGREFCNT'] = '1'
else:
vars['_ENABLE_LOGREFCNT'] = ''
if (vars.get('_ENABLE_LOGREFCNT', '') == '1'):
pass
elif (not vars.get('_ENABLE_LOGREFCNT', '')):
pass
if args.dump_painting:
vars['MOZ_DUMP_PAINTING'] = '1'
else:
vars['MOZ_DUMP_PAINTING'] = ''
if vars.get('MOZ_DUMP_PAINTING', ''):
pass
if vars.get('MOZ_DEBUG', ''):
pass
vars['NS_TRACE_MALLOC'] = vars.get('MOZ_TRACE_MALLOC', '')
if args.trace_malloc:
vars['NS_TRACE_MALLOC'] = '1'
else:
vars['NS_TRACE_MALLOC'] = ''
if vars.get('NS_TRACE_MALLOC', ''):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = ''
if args.dmd:
vars['MOZ_DMD'] = '1'
else:
vars['MOZ_DMD'] = ''
if (format('{NS_TRACE_MALLOC}', vars, {}) and format('{MOZ_DMD}', vars, {})):
sys.stderr.write('configure: error: --enable-trace-malloc and --enable-dmd are conflicting options\n')
sys.exit(1)
if vars.get('MOZ_DMD', ''):
if (vars.get('CPU_ARCH', '') == 'arm'):
vars['CFLAGS'] = format('{CFLAGS} -funwind-tables', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -funwind-tables', vars, {})
vars['MOZ_MEMORY'] = '1'
vars['MOZ_REPLACE_MALLOC'] = '1'
if args.jemalloc:
vars['MOZ_MEMORY'] = '1'
else:
vars['MOZ_MEMORY'] = ''
if vars.get('NS_TRACE_MALLOC', ''):
vars['MOZ_MEMORY'] = ''
if (vars.get('OS_TARGET', '') == 'Android'):
subprocess.call(':', shell=True, env=vars)
elif (vars.get('OS_TARGET', '') == ('WINNT' or (vars.get('OS_TARGET', '') == 'Darwin'))):
if (not vars.get('GNU_CC', '')):
vars['MOZ_GLUE_LDFLAGS'] = '$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
else:
vars['MOZ_GLUE_LDFLAGS'] = '-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
else:
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = '$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
if (format('{MOZ_MEMORY}', vars, {}) == ('1' or (format('{LIBXUL_SDK}', vars, {}) and os.path.isfile(format('{LIBXUL_SDK}/lib/{LIB_PREFIX}memory.{LIB_SUFFIX}', vars, {}))))):
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} $(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)', vars, {})
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} $(MKSHLIB_UNFORCE_ALL)', vars, {})
if vars.get('GNU_CC', ''):
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} -rdynamic', vars, {})
if (vars.get('MOZ_LINKER', '') == '1'):
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} {MOZ_ZLIB_LIBS}', vars, {})
if (format('{NIGHTLY_BUILD}', vars, {}) and format('{MOZ_MEMORY}', vars, {})):
vars['MOZ_REPLACE_MALLOC'] = '1'
if args.replace_malloc:
vars['MOZ_REPLACE_MALLOC'] = '1'
else:
vars['MOZ_REPLACE_MALLOC'] = ''
if (format('{NS_TRACE_MALLOC}', vars, {}) and format('{MOZ_REPLACE_MALLOC}', vars, {})):
sys.stderr.write('configure: error: --enable-trace-malloc and --enable-replace-malloc are conflicting options\n')
sys.exit(1)
if (format('{MOZ_REPLACE_MALLOC}', vars, {}) and (not format('{MOZ_MEMORY}', vars, {}))):
sys.stderr.write('configure: error: --enable-replace-malloc requires --enable-jemalloc\n')
sys.exit(1)
elif vars.get('MOZ_REPLACE_MALLOC', ''):
vars['MOZ_NATIVE_JEMALLOC'] = ''
if vars.get('MACOSX_DEPLOYMENT_TARGET', ''):
vars['MOZ_REPLACE_MALLOC_LINKAGE'] = vars.get('ac_cv_weak_dynamic_linking', '')
if (not vars.get('MOZ_MEMORY', '')):
if (format('{MOZ_JEMALLOC3}', vars, {}) and (not format('{MOZ_REPLACE_MALLOC}', vars, {}))):
vars['MOZ_NATIVE_JEMALLOC'] = '1'
if vars.get('MOZ_NATIVE_JEMALLOC', ''):
vars['MOZ_MEMORY'] = '1'
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if ((not format('{WIN32_REDIST_DIR}', vars, {})) and (not format('{MOZ_DEBUG}', vars, {}))):
sys.stdout.write('configure: warning: 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.\n')
else:
if vars.get('MOZ_JEMALLOC3', ''):
pass
if (format('x{MOZ_DEBUG}', vars, {}) == 'x1'):
pass
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-darwin*'):
pass elif fnmatch.fnmatch(case, '*-*freebsd*'):
pass elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
if (not vars.get('gonkdir', '')):
vars['_WRAP_MALLOC'] = '1'
vars['MOZ_GLUE_LDFLAGS'] = ''
elif fnmatch.fnmatch(case, '*-*linux*'):
pass elif fnmatch.fnmatch(case, '*-netbsd*'):
pass elif fnmatch.fnmatch(case, '*-solaris*'):
pass elif fnmatch.fnmatch(case, '*-mingw*'):
vars['MOZ_NO_DEBUG_RTL'] = '1'
exports.add('MOZ_NO_DEBUG_RTL')
vars['WIN32_CRT_LIBS'] = 'msvcrt.lib msvcprt.lib'
vars['WIN32_CRTDLL_FULLPATH'] = subprocess.check_output('lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\\\.obj', shell=True, env=vars).rstrip('\n')
subprocess.call(format('lib -NOLOGO -OUT:crtdll.obj {WIN32_CRT_LIBS} -EXTRACT:{WIN32_CRTDLL_FULLPATH}', vars, {}), shell=True, env=vars)
if (not subprocess.call('grep -q __imp__\\{0,1\\}free crtdll.obj', shell=True, env=vars)):
vars['MOZ_GLUE_LDFLAGS'] = '-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcprt -DEFAULTLIB:mozcrt'
vars['DLLFLAGS'] = format('{DLLFLAGS} {MOZ_GLUE_LDFLAGS}', vars, {})
else:
vars['DLLFLAGS'] = format('{DLLFLAGS} -LIBPATH:$(DIST)/lib -DEFAULTLIB:mozglue', vars, {})
subprocess.call('rm crtdll.obj', shell=True, env=vars)
exports.add('DLLFLAGS')
else:
sys.stderr.write('configure: error: --enable-jemalloc not supported on ${target}\n')
sys.exit(1)
if (vars.get('OS_TARGET', '') == 'Android'):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -L{_objdir}/dist/lib -lmozglue', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv', vars, {})
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'android'):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror', vars, {})
if (not vars.get('gonkdir', '')):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=memccpy,--wrap=memchr,--wrap=memrchr,--wrap=memcmp,--wrap=memcpy,--wrap=memmove,--wrap=memset,--wrap=memmem,--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', vars, {})
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_NUWA_PROCESS}', vars, {}))):
vars['WRAP_LDFLAGS'] = format('{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', vars, {})
if args.wrap_malloc:
vars['_WRAP_MALLOC'] = '1'
else:
vars['_WRAP_MALLOC'] = ''
if vars.get('_WRAP_MALLOC', ''):
if vars.get('GNU_CC', ''):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size', vars, {})
if (vars.get('OS_TARGET', '') == 'Android'):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=_ZnwjRKSt9nothrow_t,--wrap=_ZnajRKSt9nothrow_t,--wrap=_ZdlPvRKSt9nothrow_t,--wrap=_ZdaPvRKSt9nothrow_t', vars, {})
else:
sys.stderr.write('configure: error: --enable-wrap-malloc is not supported for non-GNU toolchains\n')
sys.exit(1)
if args.trace_jscalls:
vars['MOZ_TRACE_JSCALLS'] = '1'
else:
vars['MOZ_TRACE_JSCALLS'] = ''
if vars.get('MOZ_TRACE_JSCALLS', ''):
pass
if args.js_diagnostics:
vars['JS_CRASH_DIAGNOSTICS'] = '1'
else:
vars['JS_CRASH_DIAGNOSTICS'] = ''
if vars.get('JS_CRASH_DIAGNOSTICS', ''):
pass
vars['JSGC_INCREMENTAL'] = '1'
if vars.get('JSGC_INCREMENTAL', ''):
pass
if vars.get('JSGC_USE_EXACT_ROOTING', ''):
pass
if vars.get('JSGC_GENERATIONAL', ''):
pass
if args.small_chunk_size:
vars['JS_GC_SMALL_CHUNK_SIZE'] = '1'
else:
vars['JS_GC_SMALL_CHUNK_SIZE'] = ''
if vars.get('JS_GC_SMALL_CHUNK_SIZE', ''):
pass
if args.gczeal:
vars['JS_GC_ZEAL'] = '1'
else:
vars['JS_GC_ZEAL'] = ''
if (format('{JS_GC_ZEAL}', vars, {}) or format('{MOZ_DEBUG}', vars, {})):
pass
if args.root_analysis:
vars['JSGC_ROOT_ANALYSIS'] = '1'
else:
vars['JSGC_ROOT_ANALYSIS'] = ''
if vars.get('JSGC_ROOT_ANALYSIS', ''):
pass
if vars.get('DEHYDRA_PATH', ''):
if (not os.path.isfile(vars.get('DEHYDRA_PATH', ''))):
sys.stderr.write('configure: error: The dehydra plugin is not at the specified path.\n')
sys.exit(1)
if args.clang_plugin:
vars['ENABLE_CLANG_PLUGIN'] = '1'
else:
vars['ENABLE_CLANG_PLUGIN'] = ''
if vars.get('ENABLE_CLANG_PLUGIN', ''):
if (not vars.get('CLANG_CC', '')):
sys.stderr.write("configure: error: Can't use clang plugin without clang.\n")
sys.exit(1)
if args.strip:
vars['ENABLE_STRIP'] = '1'
else:
vars['ENABLE_STRIP'] = ''
if args.install_strip:
vars['PKG_SKIP_STRIP'] = ''
else:
vars['PKG_SKIP_STRIP'] = '1'
vars['USE_ELF_HACK'] = '1'
if (vars.get('MOZ_PROFILING', '') == '1'):
if (vars.get('USE_ELF_HACK', '') == 'F'):
sys.stderr.write('configure: error: --enable-elf-hack is not compatible with --enable-profiling\n')
sys.exit(1)
vars['USE_ELF_HACK'] = ''
if (vars.get('USE_ELF_HACK', '') == '1'):
case = format('{HOST_OS_ARCH},{OS_ARCH}', vars, {})
if fnmatch.fnmatch(case, 'Linux,Linux'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'arm') or fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'x86_64')):
vars['USE_ELF_HACK'] = '1'
else:
vars['USE_ELF_HACK'] = ''
else:
vars['USE_ELF_HACK'] = ''
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and format('{USE_ELF_HACK}', vars, {})):
if (vars.get('LINK_WITH_PT_GNU_RELRO', '') == 'yes'):
if (vars.get('USE_ELF_HACK', '') == 'F'):
sys.stdout.write('configure: checking for -z norelro option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,norelro', vars, {})
vars['USE_ELF_HACK'] = '1'
else:
sys.stdout.write('configure: warning: Disabling elfhack\n')
vars['USE_ELF_HACK'] = ''
vars['STDCXX_COMPAT'] = ''
if args.stdcxx_compat:
vars['STDCXX_COMPAT'] = '1'
if vars.get('STDCXX_COMPAT', ''):
subprocess.call(format('eval {cmd0}', vars, {'cmd0':subprocess.check_output('CXX="$CXX" HOST_CXX="$HOST_CXX" $PYTHON -m mozbuild.configure.libstdcxx', shell=True, env=vars).rstrip('\n')}), shell=True, env=vars)
if args.visual_event_tracer:
vars['MOZ_VISUAL_EVENT_TRACER'] = '1'
else:
vars['MOZ_VISUAL_EVENT_TRACER'] = ''
if vars.get('MOZ_VISUAL_EVENT_TRACER', ''):
pass
if args.tasktracer:
vars['MOZ_TASK_TRACER'] = '1'
else:
vars['MOZ_TASK_TRACER'] = ''
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_TASK_TRACER}', vars, {}))):
pass
if args.reflow_perf:
vars['MOZ_REFLOW_PERF'] = '1'
else:
vars['MOZ_REFLOW_PERF'] = ''
if vars.get('MOZ_REFLOW_PERF', ''):
pass
vars['MOZ_DISABLE_STARTUPCACHE'] = ''
if vars.get('MOZ_B2G', ''):
vars['MOZ_DISABLE_STARTUPCACHE'] = '1'
if args.b2g_ril:
vars['MOZ_B2G_RIL'] = '1'
else:
vars['MOZ_B2G_RIL'] = ''
if vars.get('MOZ_B2G_RIL', ''):
if vars.get('_PLATFORM_HAVE_RIL', ''):
pass
else:
sys.stderr.write("configure: error: b2g-ril cannot be enabled because target platform doesn't support it.\n")
sys.exit(1)
if vars.get('MOZ_B2G_FM', ''):
pass
if args.b2g_bt:
vars['MOZ_B2G_BT'] = '1'
else:
vars['MOZ_B2G_BT'] = ''
if vars.get('MOZ_B2G_BT', ''):
pass
if args.nfc:
vars['MOZ_NFC'] = '1'
else:
vars['MOZ_NFC'] = ''
if vars.get('MOZ_NFC', ''):
pass
if args.synth_pico:
vars['MOZ_SYNTH_PICO'] = '1'
else:
vars['MOZ_SYNTH_PICO'] = ''
if vars.get('MOZ_SYNTH_PICO', ''):
pass
if vars.get('MOZ_TIME_MANAGER', ''):
pass
if args.b2g_camera:
vars['MOZ_B2G_CAMERA'] = '1'
else:
vars['MOZ_B2G_CAMERA'] = ''
if vars.get('MOZ_B2G_CAMERA', ''):
pass
if vars.get('MOZ_PAY', ''):
pass
if vars.get('MOZ_ACTIVITIES', ''):
pass
if vars.get('MOZ_AUDIO_CHANNEL_MANAGER', ''):
pass
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
pass
vars['MOZ_DEMANGLE_SYMBOLS'] = ''
if (not ((not vars.get('HAVE_DEMANGLE', '')) and (not (format('{MOZ_DEBUG}', vars, {}) or (format('{NS_TRACE_MALLOC}', vars, {}) or format('{MOZ_DMD}', vars, {})))))):
vars['MOZ_DEMANGLE_SYMBOLS'] = '1'
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
pass
if args.xterm_updates:
vars['MOZ_UPDATE_XTERM'] = '1'
else:
vars['MOZ_UPDATE_XTERM'] = ''
if (not vars.get('MOZ_CHROME_FILE_FORMAT', '')):
vars['MOZ_CHROME_FILE_FORMAT'] = 'jar'
if (vars.get('MOZ_CHROME_FILE_FORMAT', '') == 'symlink'):
sys.stderr.write('configure: error: --enable-chrome-format=symlink has been deprecated. It is now used by default in $DIST/bin on platforms that support it\n')
sys.exit(1)
if (not (((not (vars.get('MOZ_CHROME_FILE_FORMAT', '') != 'jar')) and (not (vars.get('MOZ_CHROME_FILE_FORMAT', '') != 'flat'))) and (not (vars.get('MOZ_CHROME_FILE_FORMAT', '') != 'omni')))):
sys.stderr.write('configure: error: --enable-chrome-format must be set to either jar, flat, or omni\n')
sys.exit(1)
if (vars.get('MOZ_CHROME_FILE_FORMAT', '') == 'omni'):
vars['MOZ_OMNIJAR'] = '1'
vars['MOZ_PACKAGER_FORMAT'] = vars.get('MOZ_CHROME_FILE_FORMAT', '')
if (format('{OS_ARCH}', vars, {}) == ('WINNT' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == 'android'))):
vars['MOZ_CHROME_FILE_FORMAT'] = 'flat'
else:
vars['MOZ_CHROME_FILE_FORMAT'] = 'symlink'
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'android'):
vars['OMNIJAR_NAME'] = 'assets/omni.ja'
else:
vars['OMNIJAR_NAME'] = 'omni.ja'
vars['MOZ_DOC_INPUT_DIRS'] = './dist/include ./dist/idl'
vars['MOZ_DOC_INCLUDE_DIRS'] = './dist/include ./dist/include/nspr'
vars['MOZ_DOC_OUTPUT_DIR'] = './dist/docs'
if (not vars.get('SKIP_COMPILER_CHECKS', '')):
sys.stdout.write('configure: checking for -pipe support\n')
if (format('{GNU_CC}', vars, {}) and format('{GNU_CXX}', vars, {})):
vars['CFLAGS'] = format('{CFLAGS} -pipe', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -pipe', vars, {})
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -fprofile-generate -fprofile-correction', vars, {})
sys.stdout.write('configure: checking whether C compiler supports -fprofile-generate\n')
sys.stdout.write('$result\n')
if (vars.get('result', '') == 'yes'):
vars['PROFILE_GEN_LDFLAGS'] = '-fprofile-generate'
vars['PROFILE_USE_CFLAGS'] = '-fprofile-use -fprofile-correction -Wcoverage-mismatch'
vars['PROFILE_USE_LDFLAGS'] = '-fprofile-use'
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if vars.get('INTEL_CC', ''):
vars['PROFILE_GEN_CFLAGS'] = '-prof-gen -prof-dir .'
vars['PROFILE_GEN_LDFLAGS'] = ''
vars['PROFILE_USE_CFLAGS'] = '-prof-use -prof-dir .'
vars['PROFILE_USE_LDFLAGS'] = ''
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['PROFILE_GEN_CFLAGS'] = format('-xprofile=collect:{_objdir}/{enable_application}', vars, {})
vars['PROFILE_GEN_LDFLAGS'] = format('-xprofile=collect:{_objdir}/{enable_application}', vars, {})
vars['PROFILE_USE_CFLAGS'] = format('-xprofile=use:{_objdir}/{enable_application}', vars, {})
vars['PROFILE_USE_LDFLAGS'] = format('-xprofile=use:{_objdir}/{enable_application}', vars, {})
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -fno-integrated-as -S', vars, {})
sys.stdout.write('configure: checking whether C compiler supports -fno-integrated-as\n')
sys.stdout.write('$result\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
subprocess.call('MOZ_EXPAND_LIBS', shell=True, env=vars)
if (format('{GNU_CC}', vars, {}) and format('{GNU_CXX}', vars, {})):
vars['_DEPEND_CFLAGS'] = '-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
elif vars.get('SOLARIS_SUNPRO_CC', ''):
vars['_DEPEND_CFLAGS'] = ''
elif (not vars.get('_WIN32_MSVC', '')):
vars['_USE_CPP_INCLUDE_FLAG'] = ''
vars['_DEFINES_CFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
vars['_DEFINES_CXXFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else:
subprocess.call("echo '#include <stdio.h>' >dummy-hello.c", shell=True, env=vars)
vars['_CL_PREFIX_REGEX'] = '^\\([^:]*:.*[ :] \\)\\(.*\\\\stdio.h\\)$'
vars['CL_INCLUDES_PREFIX'] = subprocess.check_output('${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne \'s/\'"$_CL_PREFIX_REGEX"\'/\\1/p\'', shell=True, env=vars).rstrip('\n')
vars['_CL_STDIO_PATH'] = subprocess.check_output('${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne \'s/\'"$_CL_PREFIX_REGEX"\'/\\2/p\'', shell=True, env=vars).rstrip('\n')
if (not os.path.exists(vars.get('_CL_STDIO_PATH', ''))):
sys.stderr.write("configure: error: Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.\n")
sys.exit(1)
if (not vars.get('CL_INCLUDES_PREFIX', '')):
sys.stderr.write('configure: error: Cannot find cl -showIncludes prefix.\n')
sys.exit(1)
subprocess.call('rm -f dummy-hello.c', shell=True, env=vars)
vars['NONASCII'] = '$\\241\\241'
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['GKMEDIAS_SHARED_LIBRARY'] = '1'
if (not vars.get('MOZ_NATIVE_ZLIB', '')):
if (format('{JS_SHARED_LIBRARY}', vars, {}) or format('{GKMEDIAS_SHARED_LIBRARY}', vars, {})):
vars['ZLIB_IN_MOZGLUE'] = '1'
if (not vars.get('SKIP_PATH_CHECKS', '')):
if ((not format('{GLIB_CFLAGS}', vars, {})) or (not format('{GLIB_LIBS}', vars, {}))):
if vars.get('MOZ_ENABLE_GTK', ''):
pass
if ((not format('{GLIB_GMODULE_LIBS}', vars, {})) and (format('{GLIB_CONFIG}', vars, {}) and (format('{GLIB_CONFIG}', vars, {}) != 'no'))):
vars['GLIB_GMODULE_LIBS'] = subprocess.check_output('$GLIB_CONFIG gmodule --libs', shell=True, env=vars).rstrip('\n')
if (vars.get('OS_TARGET', '') == 'WINNT'):
if (not subprocess.call(format('{PERL} -e exit({MOZ_WINSDK_MAXVER} < 0x06020000)', vars, {}), shell=True, env=vars)):
vars['MOZ_ENABLE_DIRECT2D1_1'] = '1'
if (format('{OS_TARGET}', vars, {}) == ('WINNT' or (format('{OS_ARCH}', vars, {}) == ('Darwin' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('android' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gtk2' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == 'gtk3'))))))))))):
case = vars.get('target_cpu', '')
if (fnmatch.fnmatch(case, 'i*86*') or fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'arm')):
vars['MOZ_ENABLE_SKIA'] = '1'
else:
vars['MOZ_ENABLE_SKIA'] = ''
else:
vars['MOZ_ENABLE_SKIA'] = ''
if args.skia:
vars['MOZ_ENABLE_SKIA'] = '1'
else:
vars['MOZ_ENABLE_SKIA'] = ''
if vars.get('USE_FC_FREETYPE', ''):
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('_HAVE_FREETYPE2', ''):
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['LIBS'] = format('{LIBS} {FT2_LIBS}', vars, {})
vars['CFLAGS'] = format('{CFLAGS} {FT2_CFLAGS}', vars, {})
if (vars.get('ac_cv_member_FT_Bitmap_Size_y_ppem', '') == 'yes'):
vars['HAVE_FT_BITMAP_SIZE_Y_PPEM'] = '1'
else:
vars['HAVE_FT_BITMAP_SIZE_Y_PPEM'] = '0'
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['_SAVE_CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['CPPFLAGS'] = format('{CPPFLAGS} {FT2_CFLAGS} {XCFLAGS}', vars, {})
vars['CPPFLAGS'] = vars.get('_SAVE_CPPFLAGS', '')
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'gtk3'):
vars['MOZ_TREE_CAIRO'] = ''
else:
vars['MOZ_TREE_CAIRO'] = '1'
if args.system_cairo:
vars['MOZ_TREE_CAIRO'] = ''
else:
vars['MOZ_TREE_CAIRO'] = '1'
vars['MOZ_TREE_PIXMAN'] = '1'
if args.system_pixman:
vars['MOZ_TREE_PIXMAN'] = ''
else:
vars['MOZ_TREE_PIXMAN'] = 'force'
if (vars.get('MOZ_TREE_PIXMAN', '') == 'force'):
if (not vars.get('MOZ_TREE_CAIRO', '')):
sys.stderr.write('configure: error: --disable-system-pixman is incompatible with --enable-system-cairo.\n')
sys.exit(1)
else:
vars['MOZ_TREE_PIXMAN'] = '1'
elif (not vars.get('MOZ_TREE_CAIRO', '')):
vars['MOZ_TREE_PIXMAN'] = ''
if vars.get('MOZ_TREE_PIXMAN', ''):
pass
else:
vars['MOZ_PIXMAN_CFLAGS'] = vars.get('PIXMAN_CFLAGS', '')
vars['MOZ_PIXMAN_LIBS'] = vars.get('PIXMAN_LIBS', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
if (vars.get('ac_cv_header_inttypes_h', '') == 'yes'):
vars['HAVE_INTTYPES_H'] = '1'
if vars.get('MOZ_TREE_CAIRO', ''):
vars['MOZ_CAIRO_CFLAGS'] = '-I$(LIBXUL_DIST)/include/cairo'
if (vars.get('OS_ARCH', '') == 'WINNT'):
pass
vars['TEE_SURFACE_FEATURE'] = '#define CAIRO_HAS_TEE_SURFACE 1'
if vars.get('MOZ_X11', ''):
vars['XLIB_SURFACE_FEATURE'] = '#define CAIRO_HAS_XLIB_SURFACE 1'
vars['XLIB_XRENDER_SURFACE_FEATURE'] = '#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1'
vars['PS_SURFACE_FEATURE'] = '#define CAIRO_HAS_PS_SURFACE 1'
if vars.get('_HAVE_FREETYPE2', ''):
vars['FT_FONT_FEATURE'] = '#define CAIRO_HAS_FT_FONT 1'
vars['MOZ_ENABLE_CAIRO_FT'] = '1'
vars['CAIRO_FT_CFLAGS'] = vars.get('FT2_CFLAGS', '')
case = vars.get('MOZ_WIDGET_TOOLKIT', '')
if fnmatch.fnmatch(case, 'qt'):
vars['QT_SURFACE_FEATURE'] = '#define CAIRO_HAS_QT_SURFACE 1'
elif (fnmatch.fnmatch(case, 'cocoa') or fnmatch.fnmatch(case, 'uikit')):
vars['QUARTZ_SURFACE_FEATURE'] = '#define CAIRO_HAS_QUARTZ_SURFACE 1'
vars['QUARTZ_IMAGE_SURFACE_FEATURE'] = '#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1'
vars['QUARTZ_FONT_FEATURE'] = '#define CAIRO_HAS_QUARTZ_FONT 1'
elif fnmatch.fnmatch(case, 'windows'):
vars['WIN32_SURFACE_FEATURE'] = '#define CAIRO_HAS_WIN32_SURFACE 1'
vars['WIN32_FONT_FEATURE'] = '#define CAIRO_HAS_WIN32_FONT 1'
if (vars.get('MOZ_WINSDK_TARGETVER', '') >= '06010000'):
vars['WIN32_DWRITE_FONT_FEATURE'] = '#define CAIRO_HAS_DWRITE_FONT 1'
vars['WIN32_D2D_SURFACE_FEATURE'] = '#define CAIRO_HAS_D2D_SURFACE 1'
vars['MOZ_ENABLE_D2D_SURFACE'] = '1'
vars['MOZ_ENABLE_DWRITE_FONT'] = '1'
else:
vars['WIN32_DWRITE_FONT_FEATURE'] = ''
vars['WIN32_D2D_SURFACE_FEATURE'] = ''
if vars.get('WIN32_D2D_SURFACE_FEATURE', ''):
pass
elif fnmatch.fnmatch(case, 'gtk3'):
sys.stderr.write('configure: error: cairo-gtk3 toolkit is incompatible with in-tree cairo. Please add --enable-system-cairo to your build config.\n')
sys.exit(1)
if vars.get('USE_FC_FREETYPE', ''):
vars['FC_FONT_FEATURE'] = '#define CAIRO_HAS_FC_FONT 1'
vars['MOZ_CAIRO_OSLIBS'] = '${CAIRO_FT_OSLIBS}'
if vars.get('MOZ_X11', ''):
vars['MOZ_CAIRO_OSLIBS'] = format('{MOZ_CAIRO_OSLIBS} {XLDFLAGS} -lXrender', vars, {})
vars['CAIRO_FEATURES_H'] = 'gfx/cairo/cairo/src/cairo-features.h'
else:
vars['MOZ_CAIRO_CFLAGS'] = vars.get('CAIRO_CFLAGS', '')
vars['MOZ_CAIRO_LIBS'] = vars.get('CAIRO_LIBS', '')
if vars.get('MOZ_X11', ''):
vars['MOZ_CAIRO_LIBS'] = format('{MOZ_CAIRO_LIBS} {XLDFLAGS} {CAIRO_XRENDER_LIBS}', vars, {})
vars['MOZ_CAIRO_OSLIBS'] = vars.get('MOZ_CAIRO_LIBS', '')
vars['MOZ_CAIRO_CFLAGS'] = format('{MOZ_CAIRO_CFLAGS} {CAIRO_XRENDER_CFLAGS}', vars, {})
if vars.get('MOZ_ENABLE_SKIA', ''):
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == ('android' or (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) == 'xgonk'))):
pass
if (vars.get('CPU_ARCH', '') != ('ppc' and (vars.get('CPU_ARCH', '') != ('ppc64' and (vars.get('CPU_ARCH', '') != 'sparc'))))):
vars['MOZ_ENABLE_SKIA_GPU'] = '1'
if vars.get('MOZ_XUL', ''):
pass
else:
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/irc//' -e 's/tasks//'", shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_PROFILELOCKING', ''):
pass
vars['NECKO_PROTOCOLS'] = subprocess.check_output('${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}', shell=True, env=vars).rstrip('\n')
for p in for_loop(['{NECKO_PROTOCOLS}'], vars, {}):
vars['p'] = p
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES} NECKO_PROTOCOL_{p}', vars, {})
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Android'):
if vars.get('gonkdir', ''):
vars['NECKO_WIFI'] = '1'
elif (fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'SunOS') or fnmatch.fnmatch(case, 'WINNT')):
vars['NECKO_WIFI'] = '1'
elif fnmatch.fnmatch(case, 'Linux'):
vars['NECKO_WIFI'] = '1'
vars['NECKO_WIFI_DBUS'] = '1'
if vars.get('NECKO_WIFI', ''):
if ((not format('{MOZ_ENABLE_DBUS}', vars, {})) and format('{NECKO_WIFI_DBUS}', vars, {})):
sys.stderr.write('configure: error: Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi\n')
sys.exit(1)
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES} NECKO_WIFI', vars, {})
if vars.get('NECKO_COOKIES', ''):
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES} NECKO_COOKIES', vars, {})
if (format('{OS_TARGET}', vars, {}) != ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk'))):
pass
if vars.get('ENABLE_MARIONETTE', ''):
pass
if vars.get('BUILD_CTYPES', ''):
pass
if vars.get('MOZ_PLACES', ''):
pass
if vars.get('MOZ_SOCIAL', ''):
pass
if vars.get('MOZ_SERVICES_COMMON', ''):
pass
if vars.get('MOZ_SERVICES_CRYPTO', ''):
pass
if vars.get('MOZ_SERVICES_HEALTHREPORT', ''):
pass
if vars.get('MOZ_SERVICES_METRICS', ''):
pass
if vars.get('MOZ_SERVICES_NOTIFICATIONS', ''):
pass
if vars.get('MOZ_SERVICES_SYNC', ''):
pass
if vars.get('MOZ_CAPTIVEDETECT', ''):
pass
if vars.get('MOZ_DEVICES', ''):
pass
if (format('{MOZ_DEBUG}', vars, {}) or (format('{NS_TRACE_MALLOC}', vars, {}) or format('{MOZ_DMD}', vars, {}))):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = ''
if vars.get('MOZ_APP_COMPONENT_INCLUDE', ''):
pass
if vars.get('MOZ_APP_COMPONENT_MODULES', ''):
pass
if vars.get('MOZ_JSDOWNLOADS', ''):
pass
vars['MOZ_MACBUNDLE_NAME'] = subprocess.check_output("echo $MOZ_APP_DISPLAYNAME | tr -d ' '", shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_MACBUNDLE_NAME_PREFIX', ''):
vars['MOZ_MACBUNDLE_NAME'] = format('{MOZ_MACBUNDLE_NAME_PREFIX}{MOZ_MACBUNDLE_NAME}', vars, {})
if vars.get('MOZ_DEBUG', ''):
vars['MOZ_MACBUNDLE_NAME'] = format('{MOZ_MACBUNDLE_NAME}Debug.app', vars, {})
else:
vars['MOZ_MACBUNDLE_NAME'] = format('{MOZ_MACBUNDLE_NAME}.app', vars, {})
vars['MOZ_MACBUNDLE_ID'] = subprocess.check_output("echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z'", shell=True, env=vars).rstrip('\n')
vars['MOZ_MACBUNDLE_ID'] = format('{MOZ_DISTRIBUTION_ID}.{MOZ_MACBUNDLE_ID}', vars, {})
if vars.get('MOZ_DEBUG', ''):
vars['MOZ_MACBUNDLE_ID'] = format('{MOZ_MACBUNDLE_ID}debug', vars, {})
if (vars.get('MOZ_WIDGET_TOOLKIT', '') != 'android'):
vars['MOZ_CHILD_PROCESS_NAME'] = format('plugin-container{BIN_SUFFIX}', vars, {})
else:
vars['MOZ_CHILD_PROCESS_NAME'] = 'lib/libplugin-container.so'
vars['MOZ_CHILD_PROCESS_BUNDLE'] = 'plugin-container.app/Contents/MacOS/'
if (not vars.get('MOZ_APP_NAME', '')):
vars['MOZ_APP_NAME'] = subprocess.check_output('echo $MOZ_APP_BASENAME | tr A-Z a-z', shell=True, env=vars).rstrip('\n')
vars['IS_ALPHA'] = subprocess.check_output('echo $MOZ_APP_VERSION | grep a', shell=True, env=vars).rstrip('\n')
if (not vars.get('IS_ALPHA', '')):
vars['MOZ_APP_MAXVERSION'] = format('{cmd0}.*', vars, {'cmd0':subprocess.check_output('echo $MOZ_APP_VERSION | sed "s|\\(^[0-9]*\\).*|\\1|"', shell=True, env=vars).rstrip('\n')})
else:
vars['MOZ_APP_MAXVERSION'] = vars.get('MOZ_APP_VERSION', '')
if (not vars.get('MOZ_B2G_VERSION', '')):
vars['MOZ_B2G_VERSION'] = '1.0.0'
if vars.get('MOZ_UA_OS_AGNOSTIC', ''):
pass
if vars.get('MOZ_TELEMETRY_REPORTING', ''):
if (not vars.get('RELEASE_BUILD', '')):
pass
if (not (((not vars.get('MOZ_TELEMETRY_REPORTING', '')) or (not vars.get('MOZ_SERVICES_HEALTHREPORT', ''))) or (not vars.get('MOZ_CRASHREPORTER', '')))):
vars['MOZ_DATA_REPORTING'] = '1'
vars['CFLAGS'] = subprocess.check_output('echo $_WARNINGS_CFLAGS $CFLAGS', shell=True, env=vars).rstrip('\n')
vars['CXXFLAGS'] = subprocess.check_output('echo $_WARNINGS_CXXFLAGS $CXXFLAGS', shell=True, env=vars).rstrip('\n')
vars['COMPILE_CFLAGS'] = subprocess.check_output('echo $_DEFINES_CFLAGS $_DEPEND_CFLAGS $COMPILE_CFLAGS', shell=True, env=vars).rstrip('\n')
vars['COMPILE_CXXFLAGS'] = subprocess.check_output('echo $_DEFINES_CXXFLAGS $_DEPEND_CFLAGS $COMPILE_CXXFLAGS', shell=True, env=vars).rstrip('\n')
vars['HOST_CFLAGS'] = subprocess.check_output('echo $HOST_CFLAGS $_DEPEND_CFLAGS', shell=True, env=vars).rstrip('\n')
vars['HOST_CXXFLAGS'] = subprocess.check_output('echo $HOST_CXXFLAGS $_DEPEND_CFLAGS', shell=True, env=vars).rstrip('\n')
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_NUWA_PROCESS}', vars, {}))):
exports.add('MOZ_NUWA_PROCESS')
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_B2G_LOADER}', vars, {}))):
if (not vars.get('MOZ_NUWA_PROCESS', '')):
sys.stderr.write('configure: error: B2G loader works with Nuwa\n')
sys.exit(1)
exports.add('MOZ_B2G_LOADER')
vars['OS_CFLAGS'] = vars.get('CFLAGS', '')
vars['OS_CXXFLAGS'] = vars.get('CXXFLAGS', '')
vars['OS_CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['OS_COMPILE_CFLAGS'] = vars.get('COMPILE_CFLAGS', '')
vars['OS_COMPILE_CXXFLAGS'] = vars.get('COMPILE_CXXFLAGS', '')
vars['OS_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['OS_LIBS'] = vars.get('LIBS', '')
if vars.get('MOZ_DEBUG', ''):
vars['MOZ_EM_DEBUG'] = '1'
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('MOZ_X11', ''):
if vars.get('WITHOUT_X11', ''):
sys.stderr.write('configure: error: --without-x specified and MOZ_X11 still defined\n')
sys.exit(1)
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {XCFLAGS}', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if vars.get('MISSING_X', ''):
sys.stderr.write('configure: error: Could not find the following X libraries: $MISSING_X \n')
sys.exit(1)
if (vars.get('OS_ARCH', '') != 'WINNT'):
pass
if vars.get('MOZ_DEBUG', ''):
pass
if (format('{ACCESSIBILITY}', vars, {}) and format('{MOZ_ENABLE_GTK}', vars, {})):
vars['ATK_FULL_VERSION'] = subprocess.check_output('$PKG_CONFIG --modversion atk', shell=True, env=vars).rstrip('\n')
vars['ATK_MAJOR_VERSION'] = subprocess.check_output("echo ${ATK_FULL_VERSION} | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['ATK_MINOR_VERSION'] = subprocess.check_output("echo ${ATK_FULL_VERSION} | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['ATK_REV_VERSION'] = subprocess.check_output("echo ${ATK_FULL_VERSION} | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_DEBUG', ''):
vars['A11Y_LOG'] = '1'
case = vars.get('MOZ_UPDATE_CHANNEL', '')
if (fnmatch.fnmatch(case, 'aurora') or fnmatch.fnmatch(case, 'beta') or fnmatch.fnmatch(case, 'release') or fnmatch.fnmatch(case, 'esr')):
pass else:
vars['A11Y_LOG'] = '1'
if vars.get('A11Y_LOG', ''):
pass
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES}\nCPP_THROW_NEW\nHAVE_CPP_AMBIGUITY_RESOLVING_USING\nHAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR\nHAVE_CPP_PARTIAL_SPECIALIZATION\nHAVE_CPP_TROUBLE_COMPARING_TO_ZERO\nNEED_CPP_UNUSED_IMPLEMENTATIONS\nHAVE_GETPAGESIZE\nHAVE_ICONV\nHAVE_ICONV_WITH_CONST_INPUT\nHAVE_MBRTOWC\nHAVE_WCRTOMB\nHAVE_STATVFS64\nHAVE_STATVFS\nHAVE_STATFS64\nHAVE_STATFS\nHAVE_SYS_STATVFS_H\nHAVE_SYS_STATFS_H\nHAVE_SYS_VFS_H\nHAVE_SYS_MOUNT_H\n', vars, {})
if (not ((not (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'android')) or (not (vars.get('MOZ_BUILD_APP', '') == 'b2g')))):
vars['_INTL_API'] = 'no'
else:
vars['_INTL_API'] = 'yes'
if (not vars.get('JS_SHARED_LIBRARY', '')):
pass
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (not format('{LIBXUL_SDK_DIR}', vars, {}))):
pass
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*-apple-darwin11*'):
vars['FIXED_EGREP'] = 'env ARCHPREFERENCE=i386,x86_64 arch egrep'
else:
vars['FIXED_EGREP'] = 'egrep'
if (not ((not ((not format('{MOZ_NATIVE_JEMALLOC}', vars, {})) and format('{MOZ_MEMORY}', vars, {}))) and (not (format('{MOZ_JEMALLOC3}', vars, {}) or format('{MOZ_REPLACE_MALLOC}', vars, {}))))):
vars['ac_configure_args'] = format('--build={build} --host={target} --enable-stats --with-jemalloc-prefix=je_', vars, {})
if vars.get('MOZ_REPLACE_MALLOC', ''):
vars['ac_configure_args'] = format('{ac_configure_args} ac_cv_func_memalign=yes', vars, {})
vars['ac_configure_args'] = format('{ac_configure_args} ac_cv_func_valloc=yes', vars, {})
if vars.get('MOZ_JEMALLOC3', ''):
case = vars.get('OS_ARCH', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin')):
vars['ac_configure_args'] = format('{ac_configure_args} --without-export', vars, {})
elif (vars.get('OS_ARCH', '') == 'Darwin'):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-zone-allocator', vars, {})
vars['_MANGLE'] = 'malloc posix_memalign aligned_alloc calloc realloc free memalign valloc malloc_usable_size'
vars['JEMALLOC_WRAPPER'] = ''
if (not vars.get('MOZ_REPLACE_MALLOC', '')):
case = vars.get('OS_ARCH', '')
if (fnmatch.fnmatch(case, 'Linux') or fnmatch.fnmatch(case, 'DragonFly') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'NetBSD') or fnmatch.fnmatch(case, 'OpenBSD')):
vars['MANGLE'] = vars.get('_MANGLE', '')
elif (not vars.get('MOZ_JEMALLOC3', '')):
vars['MANGLE'] = vars.get('_MANGLE', '')
vars['JEMALLOC_WRAPPER'] = 'replace_'
if vars.get('MANGLE', ''):
vars['MANGLED'] = ''
if (format('{_WRAP_MALLOC}', vars, {}) and (not format('{JEMALLOC_WRAPPER}', vars, {}))):
vars['JEMALLOC_WRAPPER'] = '__wrap_'
for mangle in for_loop(['{MANGLE}'], vars, {}):
vars['mangle'] = mangle
if vars.get('MANGLED', ''):
vars['MANGLED'] = format('{mangle}:{JEMALLOC_WRAPPER}{mangle},{MANGLED}', vars, {})
else:
vars['MANGLED'] = format('{mangle}:{JEMALLOC_WRAPPER}{mangle}', vars, {})
vars['ac_configure_args'] = format('{ac_configure_args} --with-mangling={MANGLED}', vars, {})
del vars['CONFIG_FILES']
if (not vars.get('MOZ_TLS', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-tls', vars, {})
vars['EXTRA_CFLAGS'] = vars.get('CFLAGS', '')
for var in ['AS', 'CC', 'CXX', 'CPP', 'LD', 'AR', 'RANLIB', 'STRIP', 'CPPFLAGS', 'EXTRA_CFLAGS', 'LDFLAGS']:
vars['var'] = var
vars['ac_configure_args'] = format("{ac_configure_args} {var}='{cmd0}'", vars, {'cmd0':subprocess.check_output('eval echo \\\\${${var}}', shell=True, env=vars).rstrip('\n')})
if vars.get('CROSS_COMPILE', ''):
vars['ac_configure_args'] = format('{ac_configure_args} je_cv_static_page_shift=12', vars, {})
if (not os.path.exists('memory/jemalloc')):
subprocess.call('mkdir -p memory/jemalloc', shell=True, env=vars)
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
if vars.get('MOZ_TREE_FREETYPE', ''):
vars['CFLAGS'] = format('{CFLAGS} {MOZ_DEBUG_FLAGS} -std=c99', vars, {})
exports.add('CFLAGS')
vars['CPPFLAGS'] = format('{CPPFLAGS} {MOZ_DEBUG_FLAGS}', vars, {})
exports.add('CPPFLAGS')
vars['CXXFLAGS'] = format('{CXXFLAGS} {MOZ_DEBUG_FLAGS}', vars, {})
exports.add('CXXFLAGS')
vars['LDFLAGS'] = format('{LDFLAGS} {MOZ_DEBUG_LDFLAGS}', vars, {})
exports.add('LDFLAGS')
if vars.get('MOZ_NATIVE_PNG', ''):
vars['LIBPNG_CFLAGS'] = format('{MOZ_PNG_CFLAGS} ', vars, {})
exports.add('LIBPNG_CFLAGS')
else:
vars['LIBPNG_CFLAGS'] = format('-I{_objdir}/dist/include', vars, {})
exports.add('LIBPNG_CFLAGS')
vars['LIBPNG_LIBS'] = format('{MOZ_PNG_LIBS} ', vars, {})
exports.add('LIBPNG_LIBS')
vars['ZLIB_CFLAGS'] = format('{MOZ_ZLIB_CFLAGS} ', vars, {})
exports.add('ZLIB_CFLAGS')
vars['ZLIB_LIBS'] = format('{MOZ_ZLIB_LIBS} ', vars, {})
exports.add('ZLIB_LIBS')
vars['CONFIG_FILES'] = 'unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in'
exports.add('CONFIG_FILES')
vars['ac_configure_args'] = format('{ac_configure_args} --host={target} --disable-shared --with-pic=yes --with-zlib=yes --without-bzip2 --with-png=yes --without-harfbuzz', vars, {})
if (not os.path.exists('modules')):
subprocess.call('mkdir modules', shell=True, env=vars)
if (not vars.get('direct_nspr_config', '')):
vars['CC'] = vars.get('_SUBDIR_CC', '')
vars['CXX'] = vars.get('_SUBDIR_CXX', '')
vars['CFLAGS'] = vars.get('_SUBDIR_CFLAGS', '')
vars['CPPFLAGS'] = vars.get('_SUBDIR_CPPFLAGS', '')
vars['CXXFLAGS'] = vars.get('_SUBDIR_CXXFLAGS', '')
vars['LDFLAGS'] = vars.get('_SUBDIR_LDFLAGS', '')
vars['HOST_CC'] = vars.get('_SUBDIR_HOST_CC', '')
vars['HOST_CFLAGS'] = vars.get('_SUBDIR_HOST_CFLAGS', '')
vars['HOST_CXXFLAGS'] = vars.get('_SUBDIR_HOST_CXXFLAGS', '')
vars['HOST_LDFLAGS'] = vars.get('_SUBDIR_HOST_LDFLAGS', '')
vars['RC'] = ''
del vars['MAKEFILES']
del vars['CONFIG_FILES']
if vars.get('_subconfigure_subdir', ''):
vars['_save_ac_configure_args'] = vars.get('ac_configure_args', '')
vars['ac_configure_args'] = vars.get('_subconfigure_config_args', '')
vars['ac_configure_args'] = vars.get('_save_ac_configure_args', '')
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (not format('{LIBXUL_SDK_DIR}', vars, {}))):
exports.add('WRAP_LDFLAGS')
if vars.get('_WRAP_MALLOC', ''):
vars['_SUBDIR_CONFIG_ARGS'] = subprocess.check_output("echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'", shell=True, env=vars).rstrip('\n')
vars['CC'] = vars.get('_SUBDIR_CC', '')
vars['CXX'] = vars.get('_SUBDIR_CXX', '')
vars['CFLAGS'] = vars.get('_SUBDIR_CFLAGS', '')
vars['CPPFLAGS'] = vars.get('_SUBDIR_CPPFLAGS', '')
vars['CXXFLAGS'] = vars.get('_SUBDIR_CXXFLAGS', '')
vars['LDFLAGS'] = vars.get('_SUBDIR_LDFLAGS', '')
vars['HOST_CC'] = vars.get('_SUBDIR_HOST_CC', '')
vars['HOST_CFLAGS'] = vars.get('_SUBDIR_HOST_CFLAGS', '')
vars['HOST_CXXFLAGS'] = vars.get('_SUBDIR_HOST_CXXFLAGS', '')
vars['HOST_LDFLAGS'] = vars.get('_SUBDIR_HOST_LDFLAGS', '')
vars['RC'] = ''
if vars.get('ENABLE_CLANG_PLUGIN', ''):
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
vars['dist'] = format('{MOZ_BUILD_ROOT}/dist', vars, {})
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
vars['ac_configure_args'] = subprocess.check_output("echo $ac_configure_args | sed -e 's/--with-system-nspr\\S* *//'", shell=True, env=vars).rstrip('\n')
vars['ac_configure_args'] = format('{ac_configure_args} --enable-threadsafe', vars, {})
if (vars.get('_INTL_API', '') == 'no'):
vars['ac_configure_args'] = format('{ac_configure_args} --without-intl-api', vars, {})
if vars.get('BUILD_CTYPES', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --enable-ctypes', vars, {})
if (not vars.get('JS_SHARED_LIBRARY', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-shared-js', vars, {})
if vars.get('MOZ_DISABLE_EXPORT_JS', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-export-js', vars, {})
if (not vars.get('JSGC_USE_EXACT_ROOTING', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-exact-rooting', vars, {})
if (not vars.get('JSGC_GENERATIONAL', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-gcgenerational', vars, {})
if vars.get('JS_GC_SMALL_CHUNK_SIZE', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --enable-small-chunk-size', vars, {})
if (format('{NSPR_CFLAGS}', vars, {}) or format('{NSPR_LIBS}', vars, {})):
vars['ac_configure_args'] = format("{ac_configure_args} --with-nspr-cflags='{NSPR_CFLAGS}'", vars, {})
vars['ac_configure_args'] = format("{ac_configure_args} --with-nspr-libs='{NSPR_LIBS}'", vars, {})
vars['ac_configure_args'] = format('{ac_configure_args} --prefix={dist}', vars, {})
if vars.get('MOZ_MEMORY', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --enable-jemalloc', vars, {})
if vars.get('MOZ_GLUE_LDFLAGS', ''):
exports.add('MOZ_GLUE_LDFLAGS')
if vars.get('MOZ_GLUE_PROGRAM_LDFLAGS', ''):
exports.add('MOZ_GLUE_PROGRAM_LDFLAGS')
if vars.get('ZLIB_IN_MOZGLUE', ''):
vars['MOZ_ZLIB_LIBS'] = ''
exports.add('MOZ_NATIVE_ZLIB')
exports.add('MOZ_ZLIB_CFLAGS')
exports.add('MOZ_ZLIB_LIBS')
exports.add('MOZ_APP_NAME')
vars['DONT_POPULATE_VIRTUALENV'] = '1'
exports.add('DONT_POPULATE_VIRTUALENV')
exports.add('PYTHON')
vars['MOZILLA_CENTRAL_PATH'] = vars.get('_topsrcdir', '')
exports.add('MOZILLA_CENTRAL_PATH')
exports.add('STLPORT_CPPFLAGS')
exports.add('STLPORT_LDFLAGS')
exports.add('STLPORT_LIBS')
vars['JS_STANDALONE'] = 'no'
exports.add('JS_STANDALONE')
exports.add('MOZ_LINKER')
exports.add('ZLIB_IN_MOZGLUE')
if (not os.path.exists('js')):
subprocess.call('mkdir js', shell=True, env=vars)
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
vars['WRITE_MOZINFO'] = '1'
exports.add('WRITE_MOZINFO')
del vars['WRITE_MOZINFO']
if (__name__ == '__main__'):
main(sys.argv[1:])
import argparse
import fnmatch
import os
import string
import subprocess
import sys
from collections import defaultdict
SUBSTS = set(['MOZ_PERMISSIONS', 'MOZ_DMD', 'HAVE_64BIT_BUILD', 'MOZ_CAN_RUN_PROGRAMS', 'MOZ_WIDGET_TOOLKIT', 'MOZ_PNG_ARM_NEON_CHECK', 'MOZ_ALLOW_HEAP_EXECUTE_FLAGS', 'AR_EXTRACT', 'TAR', 'MOZ_SERVICES_COMMON', 'MOZ_VPX_ERROR_CONCEALMENT', 'ZLIB_IN_MOZGLUE', 'MOZ_JPROF', 'MOZ_SOCIAL', 'NONASCII', 'MOZ_MULET', 'VPX_ASFLAGS', 'MOZ_APP_ID', 'MOZ_NO_EV_CERTS', 'MOZ_PNG_CFLAGS', 'MOZ_CHILD_PROCESS_NAME', 'MOZ_OPUS', 'OBJCOPY', 'ASM_SUFFIX', 'MOZ_WEBSPEECH', 'MOZ_FIX_LINK_PATHS', 'GRE_MILESTONE', 'HOST_LDFLAGS', 'VISIBILITY_FLAGS', 'TARGET_MD_ARCH', 'MOZ_ASAN', 'MOZ_APP_UA_NAME', 'GST_API_VERSION', 'MOZ_DEVICES', 'MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS', 'MOZ_SERVICES_HEALTHREPORT', 'MOZ_JPEG_CFLAGS', 'MOZ_B2G_FM', 'MOZ_B2G_RIL', 'MOZ_ANDROID_OMTC', 'MOZ_METRO', 'DSO_LDOPTS', 'MOZ_OPTIMIZE_LDFLAGS', 'MOZ_DISABLE_PARENTAL_CONTROLS', 'OS_LDFLAGS', '_MSC_VER', 'MKSHLIB_FORCE_ALL', 'MOZ_NUWA_PROCESS', 'MOZ_OMX_PLUGIN', 'MOZ_AUDIO_OFFLOAD', 'GNU_LD', 'MOZ_B2G_BT_BLUEZ', 'NSPR_CFLAGS', 'MC', 'FILTER', 'MOZ_ENABLE_SKIA_GPU', 'MOZ_D3DCOMPILER_VISTA_DLL', 'MOZ_ENABLE_PROFILER_SPS', 'MOZ_DEBUG_SYMBOLS', 'MOZ_JEMALLOC3', 'ANDROID_SOURCE', 'MOZ_PEERCONNECTION', 'GTEST_USE_OWN_TR1_TUPLE', 'OS_ARCH', 'HOST_AR', 'MOZ_WIDGET_GTK', 'HAVE_TOOLCHAIN_SUPPORT_MSSSE3', 'MOZ_GLUE_LDFLAGS', 'PROFILE_GEN_CFLAGS', 'CC_VERSION', 'VPX_ARM_ASM', 'MOZ_GAMEPAD_BACKEND', 'EXTERNAL_SOURCE_DIR', 'MOZ_NATIVE_SQLITE', 'L10NBASEDIR', 'MOZ_TREE_FREETYPE', 'WGET', 'TARGET_OS', 'MOZ_B2G_LOADER', 'MOZ_LIBSTDCXX_HOST_VERSION', 'HOST_OS_ARCH', 'MOZ_DIRECTSHOW', 'VPX_AS_CONVERSION', 'MOZ_B2G_CAMERA', 'MOZ_DISTRIBUTION_ID', 'MOZ_UPDATER', 'HOST_NSPR_MDCPUCFG', 'MOZ_ENABLE_GNOMEUI', 'MOZ_PKG_SPECIAL', 'MOZ_B2G_BT_BLUEDROID', 'MOZ_TELEMETRY_DISPLAY_REV', 'OS_TARGET', 'PKG_SKIP_STRIP', 'LD', 'MACOSX_DEPLOYMENT_TARGET', 'MOZ_ENABLE_QT5FEEDBACK', 'MOZ_CHILD_PERMISSIONS', 'MOZ_SAFE_BROWSING', 'MOZ_DIRECTX_SDK_PATH', 'NS_TRACE_MALLOC', 'CRTDLLVERSION', 'SOLARIS_SUNPRO_CXX', 'MOZ_UPDATE_CHANNEL', 'MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS', 'MOZ_UNIVERSALCHARDET', 'QUARTZ_IMAGE_SURFACE_FEATURE', 'ac_configure_args', 'AR_LIST', 'CXX_VERSION', 'COMPILE_ENVIRONMENT', 'VPX_DASH_C_FLAG', 'LIBXUL_DIST', 'MOZ_ENABLE_D3D10_LAYER', 'MOZ_ENABLE_GTK2', 'MOZ_ENABLE_GTK3', 'JS_SHARED_LIBRARY', 'MACOS_SDK_DIR', 'DEHYDRA_PATH', 'HAVE_CLOCK_MONOTONIC', 'LIBJPEG_TURBO_AS', 'OMNIJAR_NAME', 'RC', 'MOZ_EXTENSION_MANAGER', 'OS_CXXFLAGS', 'MOZ_D3DCOMPILER_XP_CAB', 'JAR', 'AIX_OBJMODEL', 'OS_CPPFLAGS', 'MOZ_REPLACE_MALLOC', 'MOZ_TOOLKIT_SEARCH', 'MOZ_SERVICES_CRYPTO', 'FT_FONT_FEATURE', 'ENABLE_STRIP', 'UPLOAD_EXTRA_FILES', 'LIB_SUFFIX', 'TARGET_VENDOR', 'MOZ_WEBSMS_BACKEND', 'KEYTOOL', 'LIBJPEG_TURBO_X64_ASM', 'MOZ_PIXMAN_CFLAGS', 'MOZ_BING_API_CLIENTID', 'MOZ_FMP4', 'GMAKE', 'HAVE_DTRACE', 'HAVE_TOOLCHAIN_SUPPORT_MSSE4_1', 'MACOS_PRIVATE_FRAMEWORKS_DIR', 'QUARTZ_SURFACE_FEATURE', 'PROFILE_USE_CFLAGS', 'MOZ_MOZILLA_API_KEY', 'TARGET_NSPR_MDCPUCFG', 'AR_FLAGS', 'MOZ_B2G', 'PDF_SURFACE_FEATURE', 'MOZ_GOOGLE_API_KEY', 'WIN32_FONT_FEATURE', 'MOZ_RAW', 'MOZ_GSTREAMER', 'HOST_OPTIMIZE_FLAGS', 'LIBJPEG_TURBO_X86_ASM', 'MOZ_WEBRTC_ASSERT_ALWAYS', 'MOZ_CRASHREPORTER', 'MOZ_USE_PTHREADS', 'INTEL_CC', 'PROFILE_USE_LDFLAGS', 'OS_RELEASE', 'NSS_DISABLE_DBM', 'BIN_SUFFIX', 'HOST_CXXFLAGS', 'MOZ_PGO', 'MOZ_VALGRIND', 'HOST_RANLIB', 'MOZ_AUTH_EXTENSION', 'GTK_CONFIG', 'MOZ_DISABLE_GECKOVIEW', 'MOZ_VORBIS', 'GKMEDIAS_SHARED_LIBRARY', 'MOZ_ENABLE_SKIA', 'MOZ_APP_VENDOR', 'MOZ_SPELLCHECK', 'MOZ_OMX_DECODER', 'MOZ_D3DCOMPILER_XP_DLL', 'ENABLE_MARIONETTE', 'MOZ_NATIVE_BZ2', 'MOZ_SAMPLE_TYPE_S16', 'MOZ_LINKER_EXTRACT', 'FXOS_SIMULATOR', 'MOZ_SERVICES_SYNC', 'TARGET_CPU', 'A11Y_LOG', 'MOZ_WEBRTC', 'MOZ_NATIVE_PNG', 'MOZ_ANDROID_HISTORY', 'USE_DEPENDENT_LIBS', 'MOZ_GMP_SANDBOX', 'MAKEPRI', 'MOZ_VTUNE', 'MOZ_EM_DEBUG', 'MOZ_BUILD_ROOT', 'AS_DASH_C_FLAG', 'MOZ_ENABLE_GTK', 'IMPLIB', 'MOZ_NATIVE_HUNSPELL', 'WIN32_SURFACE_FEATURE', 'MOZ_ENABLE_D2D_SURFACE', 'MOZ_APP_NAME', 'WIN32_DWRITE_FONT_FEATURE', 'MOZ_INSTRUMENT_EVENT_LOOP', 'MOZ_DEBUG_DISABLE_DEFS', 'MOZ_VPX', 'IMPORT_LIB_SUFFIX', 'MKCSHLIB', 'MOZ_PROFILING', 'MOZ_GIO_COMPONENT', 'ANDROID_VERSION', 'MOZ_PNG_ARM_NEON', 'BIN_FLAGS', 'LIBJPEG_TURBO_ASFLAGS', 'MOZ_ENABLE_CONTENTACTION', 'HOST_BIN_SUFFIX', 'MOZ_REPLACE_MALLOC_LINKAGE', 'MOZ_WEBAPP_RUNTIME', 'MOZ_DOC_INPUT_DIRS', 'MOZ_CFLAGS_NSS', 'PS_SURFACE_FEATURE', 'DLL_SUFFIX', 'MOZ_XULRUNNER', 'MOZ_DEMANGLE_SYMBOLS', 'MOZ_OMX_ENCODER', 'MOZ_FRAMEPTR_FLAGS', 'HOST_AR_FLAGS', 'MOZ_NO_WLZDEFS', 'MOZ_WINSDK_MAXVER', 'MOZ_APPLEMEDIA', 'MOZ_MACBUNDLE_ID', 'MOZ_WEBRTC_LEAKING_TESTS', 'MOZ_ZIPWRITER', 'MOZ_ENABLE_GNOMEVFS', 'NECKO_COOKIES', 'MOZ_GAMEPAD', 'MOZILLA_OFFICIAL', 'WIN32_D2D_SURFACE_FEATURE', 'AR_DELETE', 'INCREMENTAL_LINKER', 'MOZ_LINKER', 'WRAP_LDFLAGS', 'DLLFLAGS', 'MOZ_MEMORY', 'MOZ_MAINTENANCE_SERVICE', 'MOZ_ENABLE_DBUS', 'MOZ_TOOLS_DIR', 'MOZ_APP_VERSION', 'TEE_SURFACE_FEATURE', 'MOZ_WAVE', 'CROSS_COMPILE', 'NS_ENABLE_TSF', 'TARGET_XPCOM_ABI', 'MOZ_LOCALE_SWITCHER', 'MOZ_DISABLE_CRYPTOLEGACY', 'MOZILLA_SYMBOLVERSION', 'MOZ_ENABLE_DIRECT2D1_1', 'MOZ_MACBUNDLE_NAME', 'MOZ_NATIVE_NSS', 'ASFLAGS', 'MOZ_SCTP', 'MOZ_ENABLE_GCONF', 'GAIADIR', 'MOZ_CAPTIVEDETECT', 'MOZ_INSTRUMENTS', 'MOZ_GLUE_PROGRAM_LDFLAGS', 'MOZ_JSDOWNLOADS', 'STRIP_FLAGS', 'MOZ_SZIP_FLAGS', 'MOZ_GL_PROVIDER', 'MOZ_X11', 'UNIVERSAL_BINARY', 'XLIB_SURFACE_FEATURE', 'LIB_PREFIX', 'MOZ_WEBGL', 'MOZ_FOLD_LIBS', 'DSO_CFLAGS', 'MAKENSISU', 'HOST_LD', 'MOZ_PACKAGER_FORMAT', 'MOC', 'MOZ_ENABLE_QTMOBILITY', 'MOZ_APP_PROFILE', 'GNU_CXX', 'MOZ_ENABLE_SIGNMAR', 'MOZ_PACKAGE_JSSHELL', 'HOST_CFLAGS', 'MOZ_PHOENIX', 'DLL_PREFIX', 'MOZ_POST_PROGRAM_COMMAND', 'NSS_NO_LIBPKIX', 'MOZ_ANGLE_RENDERER', 'ENABLE_CLANG_PLUGIN', 'RCFLAGS', 'MOZILLA_VERSION', 'QT_SURFACE_FEATURE', 'MKSHLIB', 'SVG_SURFACE_FEATURE', 'VPX_AS', 'MOZ_UI_LOCALE', 'OS_LIBS', 'MOZ_WEBM', 'MOZ_WEBRTC_SIGNALING', 'MOZ_BZ2_CFLAGS', 'MOZ_NATIVE_LIBVPX', 'RELEASE_BUILD', 'OS2_SURFACE_FEATURE', 'MOZ_ENABLE_LIBPROXY', 'MOZ_CHROME_FILE_FORMAT', 'CL_INCLUDES_PREFIX', 'FIREFOX_VERSION', 'MOZ_POST_DSO_LIB_COMMAND', 'MOZ_ENABLE_D3D9_LAYER', 'OS_COMPILE_CFLAGS', 'MOZ_ENABLE_XREMOTE', 'FC_FONT_FEATURE', 'ACCEPTED_MAR_CHANNEL_IDS', 'MOZ_PAY', 'MIDL_FLAGS', 'MOZ_ENABLE_STARTUP_NOTIFICATION', 'BUILD_CTYPES', 'MOZ_MSVC_STL_WRAP__RAISE', 'RCC', 'MOZ_MSVC_STL_WRAP__Throw', 'STL_FLAGS', 'MOZ_PGO_OPTIMIZE_FLAGS', 'VPX_ASM_SUFFIX', 'OS_COMPILE_CXXFLAGS', 'NSINSTALL_BIN', 'MOZ_OMNIJAR', 'INTEL_ARCHITECTURE', 'HAVE_GCC_ALIGN_ARG_POINTER', 'MOZ_TASK_TRACER', 'MOZ_ENABLE_QT5GEOPOSITION', 'MOZ_CHILD_PROCESS_BUNDLE', 'MOZ_GL_DEFAULT_PROVIDER', 'MOZ_FFMPEG', 'MSMANIFEST_TOOL', 'MOZ_ENABLE_CAIRO_FT', 'HOST_CC', 'INTEL_CXX', 'MOZ_OPTIMIZE', 'ENABLE_TESTS', 'MOZ_DOC_OUTPUT_DIR', 'WCHAR_CFLAGS', 'MOZ_DISABLE_UNIFIED_COMPILATION', 'MOZ_ACTIVITIES', 'MOZ_PLACES', 'PNG_FUNCTIONS_FEATURE', 'MOZ_PREF_EXTENSIONS', 'MOZ_PROFILELOCKING', 'CPU_ARCH', 'MOZ_OPTIMIZE_FLAGS', 'GNU_CC', 'MKSHLIB_UNFORCE_ALL', 'MOZ_STUB_INSTALLER', 'STLPORT_LIBS', 'MOZ_DEBUG_LDFLAGS', 'MOZ_B2G_VERSION', 'NECKO_WIFI_DBUS', 'MOZ_SERVICES_NOTIFICATIONS', 'MOZ_ENABLE_QMSYSTEM2', 'MOZ_XUL', 'MOZ_DEBUG_ENABLE_DEFS', 'MOZ_UPDATE_PACKAGING', 'MOZ_D3D_CPU_SUFFIX', 'CRTEXPDLLVERSION', 'MOZ_EXTENSIONS', 'WRAP_SYSTEM_INCLUDES', 'MOZ_DISABLE_STARTUPCACHE', 'DIRECTFB_SURFACE_FEATURE', 'RPMBUILD', 'MOZ_APP_MAXVERSION', 'MOZ_DOC_INCLUDE_DIRS', 'NO_INTEGRATED_AS_CFLAGS', 'MOZ_UPDATE_XTERM', 'MOZ_ENABLE_GIO', 'NO_LD_ARCHIVE_FLAGS', 'MOZ_TREE_PIXMAN', 'NS_PRINTING', 'MOZ_LIBSTDCXX_TARGET_VERSION', 'SOLARIS_SUNPRO_CC', 'USE_N32', 'WRAP_STL_INCLUDES', 'MOZ_ALSA', 'MOZ_TIME_MANAGER', 'MOZ_CRASHREPORTER_INJECTOR', 'MOZ_VERIFY_MAR_SIGNATURE', 'PROFILE_GEN_LDFLAGS', 'MOZ_URL_CLASSIFIER', 'NSS_CFLAGS', 'ANDROID_PACKAGE_NAME', 'MOZ_WEBM_ENCODER', 'MOZ_BRANDING_DIRECTORY', 'MOZ_ENABLE_DWRITE_FONT', 'MOZ_APP_BASENAME', 'UNIFY_DIST', 'MOZ_HELP_VIEWER', 'OS_TEST', 'LIBJPEG_TURBO_ARM_ASM', 'MOZ_ANDROID_MLS_STUMBLER', 'MOZ_NATIVE_JEMALLOC', 'MOZ_SHARK', 'VPX_X86_ASM', 'MOZ_BING_API_KEY', 'MOZ_APP_DISPLAYNAME', 'TOOLCHAIN_PREFIX', 'MOZ_DEBUG', 'MOZ_SERVICES_METRICS', 'MOZ_SYNTH_PICO', 'MOZ_PROFILE_MIGRATOR', 'MOZ_PULSEAUDIO', 'GTEST_OS_LINUX_ANDROID', 'MOZ_BUILD_APP', 'MOZ_NATIVE_LIBEVENT', 'MOZ_D3DCOMPILER_VISTA_DLL_PATH', 'MOZ_ENABLE_SZIP', 'MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI', 'MOZ_ANDROID_ANR_REPORTER', 'QUARTZ_FONT_FEATURE', 'MOZ_NATIVE_NSPR', 'WARNINGS_AS_ERRORS', 'HAVE_INTTYPES_H', 'MOZ_WMF', 'ACCESSIBILITY', 'NIGHTLY_BUILD', 'MOZ_OFFICIAL_BRANDING', 'MOZ_COMPONENT_NSPR_LIBS', 'MOZ_SRTP', 'EARLY_BETA_OR_EARLIER', 'GNU_AS', 'E10S_TESTING_ONLY', 'GTEST_HAS_RTTI', 'WINDRES', 'MOZ_CONTENT_SANDBOX', 'XLIB_XRENDER_SURFACE_FEATURE', 'MOZ_ENABLE_QTNETWORK', 'OS_CFLAGS', 'MOZ_UA_OS_AGNOSTIC', 'WIN32_REDIST_DIR', 'MAR_CHANNEL_ID', 'MOZ_ENABLE_GNOME_COMPONENT', 'MOZ_NATIVE_JPEG', 'JARSIGNER', 'MOZ_SAMPLE_TYPE_FLOAT32', 'MOZ_NFC', 'MOZ_THEME_FASTSTRIPE', 'USE_ELF_HACK', 'GTEST_HAS_CLONE', 'XULRUNNER_STUB_NAME', 'MOZ_ANDROID_OMX', 'MOZ_EME', 'MOZ_HAS_WINSDK_WITH_D3D', 'MOZ_ENABLE_QT', 'MOZ_DATA_REPORTING', 'MSVC_CXX_RUNTIME_DLL', 'MSVS_VERSION', 'MSVC_C_RUNTIME_DLL', 'MOZ_GFX_OPTIMIZE_MOBILE', 'VPX_NEED_OBJ_INT_EXTRACT', 'MOZ_AUDIO_CHANNEL_MANAGER', 'MOZ_B2G_BT', 'HAVE_X86_AVX2', 'MOZ_FS_LAYOUT', 'MOZ_FEEDS', 'MOZ_CALLGRIND', 'MOZ_IPDL_TESTS', 'NECKO_WIFI', 'MOZ_TREMOR', 'MOZ_PDF_PRINTING', 'MOZ_ANDROID_BEAM', 'AS', 'AR', 'GCC_USE_GNU_LD', 'MOZ_APP_STATIC_INI', 'DSO_PIC_CFLAGS', 'LLVM_SYMBOLIZER', 'MOZ_OPTIMIZE_SIZE_TWEAK', 'JAVA', 'JAVAC', 'HOST_CXX', 'JAVAH', 'LIBICONV', 'MOZ_BROWSE_INFO', 'OBJ_SUFFIX', 'MOZ_ANDROID_SEARCH_ACTIVITY', 'MOZ_TREE_CAIRO'])
def make_arg_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--enable-metro', dest='metro', action='store_true', help='Enable Windows Metro build targets')
parser.add_argument('--enable-address-sanitizer', dest='address_sanitizer', action='store_true', help='Enable Address Sanitizer (default=no)')
parser.add_argument('--enable-llvm-hacks', dest='llvm_hacks', action='store_true', help='Enable workarounds required for several LLVM instrumentations (default=no)')
parser.add_argument('--enable-profiling', dest='profiling', action='store_true', help='Set compile flags necessary for using sampling profilers (e.g. shark, perf)')
parser.add_argument('--enable-systrace', dest='systrace', action='store_true', help='Set compile flags necessary for using sampling profilers (e.g. shark, perf)')
parser.add_argument('--enable-valgrind', dest='valgrind', action='store_true', help='Enable Valgrind integration hooks (default=no)')
parser.add_argument('--enable-jprof', dest='jprof', action='store_true', help='Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.')
parser.add_argument('--enable-shark', dest='shark', action='store_true', help='Enable shark remote profiling. Implies --enable-profiling.')
parser.add_argument('--enable-instruments', dest='instruments', action='store_true', help='Enable instruments remote profiling. Implies --enable-profiling.')
parser.add_argument('--enable-callgrind', dest='callgrind', action='store_true', help='Enable callgrind profiling. Implies --enable-profiling.')
parser.add_argument('--enable-vtune', dest='vtune', action='store_true', help='Enable vtune profiling. Implies --enable-profiling.')
parser.add_argument('--enable-system-hunspell', dest='system_hunspell', action='store_true', help='Use system hunspell (located with pkgconfig)')
parser.add_argument('--enable-shared-js', dest='shared_js', action='store_true', help='Create a shared JavaScript library.')
parser.add_argument('--enable-startup-notification', dest='startup_notification', action='store_true', help='Enable startup-notification support (default: disabled) ')
parser.add_argument('--enable-official-branding', dest='official_branding', action='store_true', help='Enable Official mozilla.org Branding\n Do not distribute builds with\n --enable-official-branding unless you have\n permission to use trademarks per\n http://www.mozilla.org/foundation/trademarks/ .')
parser.add_argument('--enable-gnomevfs', dest='gnomevfs', action='store_true', help='Enable GnomeVFS support (default: disabled)')
parser.add_argument('--enable-libproxy', dest='libproxy', action='store_true', help='Enable libproxy support ')
parser.add_argument('--enable-gnomeui', dest='gnomeui', action='store_true', help='Enable libgnomeui instead of GIO & GTK for icon theme support ')
parser.add_argument('--enable-ipdl-tests', dest='ipdl_tests', action='store_true', help='Enable expensive IPDL tests')
parser.add_argument('--enable-raw', dest='raw', action='store_true', help='Enable support for RAW media')
parser.add_argument('--enable-android-omx', dest='android_omx', action='store_true', help='Enable support for Android OMX media backend')
parser.add_argument('--enable-media-navigator', dest='media_navigator', action='store_true', help='Enable support for getUserMedia')
parser.add_argument('--enable-omx-plugin', dest='omx_plugin', action='store_true', help='Enable building OMX plugin (B2G)')
parser.add_argument('--enable-alsa', dest='alsa', action='store_true', help='Enable Alsa support (default on Linux)')
parser.add_argument('--enable-require-all-d3dc-versions', dest='require_all_d3dc_versions', action='store_true', help=' --enable-require-all-d3dc-versions Require all versions of the D3D compiler needed for supported Windows systems.')
parser.add_argument('--enable-tree-freetype', dest='tree_freetype', action='store_true', help='Enable Tree FreeType')
parser.add_argument('--enable-maintenance-service', dest='maintenance_service', action='store_true', help='Enable building of maintenanceservice')
parser.add_argument('--enable-bundled-fonts', dest='bundled_fonts', action='store_true', help='Enable support for bundled fonts on desktop platforms')
parser.add_argument('--enable-verify-mar', dest='verify_mar', action='store_true', help='Enable verifying MAR signatures')
parser.add_argument('--enable-signmar', dest='signmar', action='store_true', help='Enable building the signmar program')
parser.add_argument('--enable-update-packaging', dest='update_packaging', action='store_true', help='Enable tools/update-packaging')
parser.add_argument('--enable-content-sandbox', dest='content_sandbox', action='store_true', help='Enable sandboxing support for content-processes')
parser.add_argument('--enable-system-sqlite', dest='system_sqlite', action='store_true', help='Use system sqlite (located with pkgconfig)')
parser.add_argument('--enable-safe-browsing', dest='safe_browsing', action='store_true', help='Enable safe browsing (anti-phishing) implementation')
parser.add_argument('--enable-url-classifier', dest='url_classifier', action='store_true', help='Enable url classifier module')
parser.add_argument('--enable-faststripe', dest='faststripe', action='store_true', help='Use faststripe theme')
parser.add_argument('--enable-mobile-optimize', dest='mobile_optimize', action='store_true', help='Enable mobile optimizations')
parser.add_argument('--enable-warnings-as-errors', dest='warnings_as_errors', action='store_true', help='Enable treating of warnings as errors')
parser.add_argument('--enable-logrefcnt', dest='logrefcnt', action='store_true', help='Enable logging of refcounts (default=debug) ')
parser.add_argument('--enable-dump-painting', dest='dump_painting', action='store_true', help='Enable paint debugging.')
parser.add_argument('--enable-trace-malloc', dest='trace_malloc', action='store_true', help='Enable malloc tracing; also disables DMD and jemalloc')
parser.add_argument('--enable-dmd', dest='dmd', action='store_true', help='Enable DMD; also enables jemalloc and replace-malloc')
parser.add_argument('--enable-jemalloc', dest='jemalloc', action='store_true', help='Replace memory allocator with jemalloc')
parser.add_argument('--enable-replace-malloc', dest='replace_malloc', action='store_true', help='Enable ability to dynamically replace the malloc implementation')
parser.add_argument('--enable-wrap-malloc', dest='wrap_malloc', action='store_true', help='Wrap malloc calls (gnu linker only)')
parser.add_argument('--enable-trace-jscalls', dest='trace_jscalls', action='store_true', help='Enable JS call enter/exit callback (default=no)')
parser.add_argument('--enable-js-diagnostics', dest='js_diagnostics', action='store_true', help='Enable JS diagnostic assertions and breakpad data')
parser.add_argument('--enable-small-chunk-size', dest='small_chunk_size', action='store_true', help='Allocate memory for JS GC things in smaller chunks')
parser.add_argument('--enable-gczeal', dest='gczeal', action='store_true', help='Enable zealous JavaScript GCing')
parser.add_argument('--enable-root-analysis', dest='root_analysis', action='store_true', help='Enable moving GC stack root analysis')
parser.add_argument('--enable-clang-plugin', dest='clang_plugin', action='store_true', help='Enable building with the mozilla clang plugin ')
parser.add_argument('--enable-strip', dest='strip', action='store_true', help='Enable stripping of libs & executables ')
parser.add_argument('--enable-install-strip', dest='install_strip', action='store_true', help='Enable stripping of libs & executables when packaging ')
parser.add_argument('--enable-stdcxx-compat', dest='stdcxx_compat', action='store_true', help='Enable compatibility with older libstdc++')
parser.add_argument('--enable-visual-event-tracer', dest='visual_event_tracer', action='store_true', help='Enable visual event tracer instrumentation')
parser.add_argument('--enable-tasktracer', dest='tasktracer', action='store_true', help='Set compile flags necessary for using TaskTracer')
parser.add_argument('--enable-reflow-perf', dest='reflow_perf', action='store_true', help='Enable reflow performance tracing')
parser.add_argument('--enable-b2g-ril', dest='b2g_ril', action='store_true', help=' --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ')
parser.add_argument('--enable-b2g-bt', dest='b2g_bt', action='store_true', help=' --enable-b2g-bt Set compile flags necessary for compiling Bluetooth API for B2G ')
parser.add_argument('--enable-nfc', dest='nfc', action='store_true', help='Set compile flags necessary for compiling NFC API ')
parser.add_argument('--enable-synth-pico', dest='synth_pico', action='store_true', help='Set compile flags necessary for compiling Pico Web Speech API ')
parser.add_argument('--enable-b2g-camera', dest='b2g_camera', action='store_true', help=' --enable-b2g-camera Set compile flags necessary for compiling camera API for B2G ')
parser.add_argument('--enable-xterm-updates', dest='xterm_updates', action='store_true', help='Update XTERM titles with current command.')
parser.add_argument('--enable-skia', dest='skia', action='store_true', help='Enable use of Skia')
parser.add_argument('--enable-system-cairo', dest='system_cairo', action='store_true', help='Use system cairo (located with pkgconfig)')
parser.add_argument('--enable-system-pixman', dest='system_pixman', action='store_true', help='Use system pixman (located with pkgconfig)')
return parser
def format(s, vars, extra):
d = defaultdict(str, vars)
for (k, v) in extra.iteritems():
d[k] = v
return string.Formatter().vformat(s, (), d)
class quoted():
def __init__(self, q):
self.q = q
def for_loop(things, vars, extra):
for t in things:
if isinstance(t, quoted):
yield format(t.q, vars, extra)
else:
for x in format(t, vars, extra).split():
yield x
def main(args):
vars = dict(os.environ)
for (i, a) in enumerate(args):
vars[('argv%d' % i)] = a
exports = set(vars.keys())
parser = make_arg_parser()
args = parser.parse_args(args)
vars['TARGET_CPU'] = vars.get('target_cpu', '')
vars['TARGET_VENDOR'] = vars.get('target_vendor', '')
vars['TARGET_OS'] = vars.get('target_os', '')
vars['CFLAGS'] = vars.get('CFLAGS', '')
vars['CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['CXXFLAGS'] = vars.get('CXXFLAGS', '')
vars['LDFLAGS'] = vars.get('LDFLAGS', '')
vars['HOST_CFLAGS'] = vars.get('HOST_CFLAGS', '')
vars['HOST_CXXFLAGS'] = vars.get('HOST_CXXFLAGS', '')
vars['HOST_LDFLAGS'] = vars.get('HOST_LDFLAGS', '')
vars['_SUBDIR_CC'] = vars.get('CC', '')
vars['_SUBDIR_CXX'] = vars.get('CXX', '')
vars['_SUBDIR_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SUBDIR_CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['_SUBDIR_CXXFLAGS'] = vars.get('CXXFLAGS', '')
vars['_SUBDIR_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SUBDIR_HOST_CC'] = vars.get('HOST_CC', '')
vars['_SUBDIR_HOST_CFLAGS'] = vars.get('HOST_CFLAGS', '')
vars['_SUBDIR_HOST_CXXFLAGS'] = vars.get('HOST_CXXFLAGS', '')
vars['_SUBDIR_HOST_LDFLAGS'] = vars.get('HOST_LDFLAGS', '')
vars['_SUBDIR_CONFIG_ARGS'] = vars.get('ac_configure_args', '')
vars['MOZJPEG'] = '62'
vars['MOZPNG'] = '10610'
vars['NSPR_VERSION'] = '4'
vars['NSPR_MINVER'] = '4.10.3'
vars['NSS_VERSION'] = '3'
vars['GLIB_VERSION'] = '1.2.0'
vars['PERL_VERSION'] = '5.006'
vars['CAIRO_VERSION'] = '1.10'
vars['PANGO_VERSION'] = '1.22.0'
vars['GTK2_VERSION'] = '2.10.0'
vars['GTK3_VERSION'] = '3.0.0'
vars['WINDRES_VERSION'] = '2.14.90'
vars['W32API_VERSION'] = '3.14'
vars['GNOMEVFS_VERSION'] = '2.0'
vars['GNOMEUI_VERSION'] = '2.2.0'
vars['GCONF_VERSION'] = '1.2.1'
vars['GIO_VERSION'] = '2.20'
vars['STARTUP_NOTIFICATION_VERSION'] = '0.8'
vars['DBUS_VERSION'] = '0.60'
vars['SQLITE_VERSION'] = '3.8.5'
vars['MSMANIFEST_TOOL'] = ''
vars['MISSING_X'] = ''
vars['MOZ_USE_PTHREADS'] = ''
vars['_PTHREAD_LDFLAGS'] = ''
vars['_topsrcdir'] = (os.path.dirname(__file__) or '.')
vars['_topsrcdir'] = subprocess.check_output('cd $_topsrcdir; pwd', shell=True, env=vars).rstrip('\n')
vars['_objdir'] = subprocess.check_output('pwd', shell=True, env=vars).rstrip('\n')
if (format('{_topsrcdir}', vars, {}) == (format('{_objdir}', vars, {}) and (not format('{with_l10n_base}', vars, {})))):
print ' ***'
print ' * Building directly in the main source directory is not allowed.'
print ' *'
print ' * To build, you must run configure from a separate directory'
print ' * (referred to as an object directory).'
print ' *'
print ' * If you are building with a mozconfig, you will need to change your'
print ' * mozconfig to point to a different object directory.'
print ' ***'
sys.exit('1')
vars['_conflict_files'] = ''
for file in for_loop(['{_topsrcdir}/Makefile', '{_topsrcdir}/config/autoconf.mk'], vars, {}):
vars['file'] = file
if os.path.isfile(vars.get('file', '')):
vars['_conflict_files'] = format('{_conflict_files} {file}', vars, {})
if vars.get('_conflict_files', ''):
print '***'
print '* Your source tree contains these files:'
for file in for_loop(['{_conflict_files}'], vars, {}):
vars['file'] = file
print format('* {file}', vars, {})
print '* This indicates that you previously built in the source tree.'
print '* A source tree build can confuse the separate objdir build.'
print '*'
print '* To clean up the source tree:'
print format('* 1. cd {_topsrcdir}', vars, {})
print '* 2. gmake distclean'
print '***'
sys.exit('1')
subprocess.call('break', shell=True, env=vars)
vars['MOZ_BUILD_ROOT'] = subprocess.check_output('pwd -W 2>/dev/null || pwd', shell=True, env=vars).rstrip('\n')
vars['COMPILE_ENVIRONMENT'] = '1'
if vars.get('L10NBASEDIR', ''):
if (vars.get('L10NBASEDIR', '') == ('yes' or (vars.get('L10NBASEDIR', '') == 'no'))):
sys.stderr.write('configure: error: --with-l10n-base must specify a path\n')
sys.exit(1)
elif os.path.isdir(vars.get('L10NBASEDIR', '')):
vars['L10NBASEDIR'] = subprocess.check_output('cd "$L10NBASEDIR" && pwd', shell=True, env=vars).rstrip('\n')
else:
sys.stderr.write("configure: error: Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist\n")
sys.exit(1)
if ((not vars.get('PERL', '')) or (vars.get('PERL', '') == ':')):
sys.stderr.write('configure: error: perl not found in \\$PATH\n')
sys.exit(1)
if (vars.get('GAIADIR', '') and (not os.path.isdir(vars.get('GAIADIR', '')))):
sys.stderr.write("configure: error: GAIADIR '$GAIADIR' isn't a valid directory\n")
sys.exit(1)
if vars.get('GAIADIR', ''):
pass
if (format('{FXOS_SIMULATOR}', vars, {}) and (not format('{GAIADIR}', vars, {}))):
sys.stderr.write('configure: error: FXOS_SIMULATOR=1 requires GAIADIR to be defined\n')
sys.exit(1)
if vars.get('FXOS_SIMULATOR', ''):
pass
if vars.get('gonkdir', ''):
vars['kernel_name'] = subprocess.check_output('uname -s | tr "[:upper:]" "[:lower:]"', shell=True, env=vars).rstrip('\n')
vars['android_source'] = vars.get('gonkdir', '')
vars['ANDROID_SOURCE'] = vars.get('android_source', '')
vars['ANDROID_NDK'] = format('{ANDROID_SOURCE}/ndk', vars, {})
vars['ANDROID_VERSION'] = '15'
if vars.get('PLATFORM_SDK_VERSION', ''):
vars['ANDROID_VERSION'] = vars.get('PLATFORM_SDK_VERSION', '')
vars['TOOLCHAIN_PREFIX'] = vars.get('gonk_toolchain_prefix', '')
vars['AS'] = format('{gonk_toolchain_prefix}as', vars, {})
vars['CC'] = format('{gonk_toolchain_prefix}gcc', vars, {})
vars['CXX'] = format('{gonk_toolchain_prefix}g++', vars, {})
vars['CPP'] = format('{gonk_toolchain_prefix}cpp', vars, {})
vars['LD'] = format('{gonk_toolchain_prefix}ld', vars, {})
vars['AR'] = format('{gonk_toolchain_prefix}ar', vars, {})
vars['RANLIB'] = format('{gonk_toolchain_prefix}ranlib', vars, {})
vars['STRIP'] = format('{gonk_toolchain_prefix}strip', vars, {})
vars['OBJCOPY'] = format('{gonk_toolchain_prefix}objcopy', vars, {})
if (not os.path.exists(format('{gonkdir}/ndk/sources/cxx-stl/stlport/src/iostream.cpp', vars, {}))):
sys.stderr.write("configure: error: Couldn't find path to stlport sources in the gonk tree\n")
sys.exit(1)
vars['STLPORT_CPPFLAGS'] = format('-I{_topsrcdir}/build/stlport/stlport -I{gonkdir}/ndk/sources/cxx-stl/system/include', vars, {})
vars['STLPORT_LIBS'] = format('{_objdir}/build/stlport/libstlport_static.a', vars, {})
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'arm'):
vars['ARCH_DIR'] = 'arch-arm'
elif fnmatch.fnmatch(case, 'i?86'):
vars['ARCH_DIR'] = 'arch-x86'
case = vars.get('ANDROID_VERSION', '')
if fnmatch.fnmatch(case, '15'):
vars['GONK_INCLUDES'] = format('-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', vars, {})
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEZ'] = '1'
vars['MOZ_NFC'] = '1'
vars['MOZ_B2G_CAMERA'] = '1'
vars['MOZ_OMX_DECODER'] = '1'
vars['MOZ_RTSP'] = '1'
elif (fnmatch.fnmatch(case, '17') or fnmatch.fnmatch(case, '18')):
vars['GONK_INCLUDES'] = format('-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', vars, {})
if os.path.isdir(format('{gonkdir}/external/bluetooth/bluez', vars, {})):
vars['GONK_INCLUDES'] = format('{GONK_INCLUDES} -I{gonkdir}/external/dbus -I{gonkdir}/external/bluetooth/bluez/lib', vars, {})
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEZ'] = '1'
elif os.path.isdir(format('{gonkdir}/external/bluetooth/bluedroid', vars, {})):
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEDROID'] = '1'
vars['MOZ_RTSP'] = '1'
vars['MOZ_NFC'] = '1'
vars['MOZ_B2G_CAMERA'] = '1'
vars['MOZ_OMX_DECODER'] = '1'
vars['MOZ_OMX_ENCODER'] = '1'
elif fnmatch.fnmatch(case, '19'):
vars['GONK_INCLUDES'] = format('-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', vars, {})
vars['MOZ_B2G_CAMERA'] = '1'
vars['MOZ_B2G_BT'] = '1'
vars['MOZ_B2G_BT_BLUEDROID'] = '1'
vars['MOZ_NFC'] = '1'
vars['MOZ_RTSP'] = '1'
vars['MOZ_OMX_DECODER'] = '1'
vars['MOZ_OMX_ENCODER'] = '1'
vars['MOZ_AUDIO_OFFLOAD'] = '1'
else:
sys.stderr.write('configure: error: Unsupported platform version: $ANDROID_VERSION\n')
sys.exit(1)
vars['CPPFLAGS'] = format('-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}', vars, {})
vars['CFLAGS'] = format('-mandroid -fno-short-enums -fno-exceptions {CFLAGS}', vars, {})
vars['CXXFLAGS'] = format('-mandroid -fno-short-enums -fno-exceptions -Wno-psabi {CXXFLAGS} {STLPORT_CPPFLAGS}', vars, {})
vars['LIBS'] = format('{LIBS} -llog', vars, {})
vars['LDFLAGS'] = format('-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}', vars, {})
if (not vars.get('HOST_CPPFLAGS', '')):
vars['HOST_CPPFLAGS'] = ' '
if (not vars.get('HOST_CFLAGS', '')):
vars['HOST_CFLAGS'] = ' '
if (not vars.get('HOST_CXXFLAGS', '')):
vars['HOST_CXXFLAGS'] = ' '
if (not vars.get('HOST_LDFLAGS', '')):
vars['HOST_LDFLAGS'] = ' '
vars['MOZ_CHROME_FILE_FORMAT'] = 'omni'
vars['direct_nspr_config'] = '1'
else:
subprocess.call('MOZ_ANDROID_NDK', shell=True, env=vars)
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
if (not vars.get('ANDROID_PACKAGE_NAME', '')):
vars['ANDROID_PACKAGE_NAME'] = 'org.mozilla.$(MOZ_APP_NAME)'
vars['MOZ_CHROME_FILE_FORMAT'] = 'omni'
vars['ZLIB_DIR'] = 'yes'
elif fnmatch.fnmatch(case, '*-linux*'):
pass
vars['AR_FLAGS'] = 'crs $@'
if vars.get('COMPILE_ENVIRONMENT', ''):
if (format('{target}', vars, {}) != format('{host}', vars, {})):
pass
else:
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
subprocess.call('sleep 2', shell=True, env=vars)
if (not vars.get('HOST_CC', '')):
vars['HOST_CC'] = vars.get('CC', '')
if (not vars.get('HOST_CFLAGS', '')):
vars['HOST_CFLAGS'] = vars.get('CFLAGS', '')
if (not vars.get('HOST_CXX', '')):
vars['HOST_CXX'] = vars.get('CXX', '')
if (not vars.get('HOST_CXXFLAGS', '')):
vars['HOST_CXXFLAGS'] = vars.get('CXXFLAGS', '')
if (not vars.get('HOST_LDFLAGS', '')):
vars['HOST_LDFLAGS'] = vars.get('LDFLAGS', '')
if (not vars.get('HOST_RANLIB', '')):
vars['HOST_RANLIB'] = vars.get('RANLIB', '')
if (not vars.get('HOST_AR', '')):
vars['HOST_AR'] = vars.get('AR', '')
if (not vars.get('HOST_AR_FLAGS', '')):
vars['HOST_AR_FLAGS'] = vars.get('AR_FLAGS', '')
if vars.get('MOZ_WINCONSOLE', ''):
pass
if (format('{GNU_CC}', vars, {}) and (not format('{CLANG_CC}', vars, {}))):
if (not ((not (format('{GCC_MAJOR_VERSION}', vars, {}) == ('4' and (format('{GCC_MINOR_VERSION}', vars, {}) < '4')))) or (not (vars.get('GCC_MAJOR_VERSION', '') < '4')))):
sys.stderr.write('configure: error: Only GCC 4.4 or newer supported\n')
sys.exit(1)
if args.metro:
vars['MOZ_METRO'] = '1'
else:
vars['MOZ_METRO'] = ''
if vars.get('MOZ_METRO', ''):
vars['WINSDK_TARGETVER'] = '602'
vars['WINVER'] = '502'
vars['CRTDLLVERSION'] = '110'
vars['CRTEXPDLLVERSION'] = '1-1-0'
else:
vars['WINSDK_TARGETVER'] = '601'
vars['WINVER'] = '502'
case = vars.get('WINSDK_TARGETVER', '')
if (fnmatch.fnmatch(case, '601') or fnmatch.fnmatch(case, '602')):
vars['MOZ_WINSDK_TARGETVER'] = format('0{WINSDK_TARGETVER}0000', vars, {})
else:
sys.stderr.write('configure: error: Invalid value for --with-windows-version ($WINSDK_TARGETVER)\n')
sys.exit(1)
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if (vars.get('GCC', '') != 'yes'):
vars['_WIN32_MSVC'] = '1'
vars['CFLAGS'] = format('{CFLAGS} -TC -nologo', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -TP -nologo', vars, {})
vars['_MSVC_VER_FILTER'] = 's|.*[^!-~]([0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?).*|\\1|p'
vars['_CC_MAJOR_VERSION'] = subprocess.check_output('echo ${CC_VERSION} | cut -c 1-2', shell=True, env=vars).rstrip('\n')
vars['_CC_MINOR_VERSION'] = subprocess.check_output('echo ${CC_VERSION} | cut -c 3-4', shell=True, env=vars).rstrip('\n')
vars['_MSC_VER'] = vars.get('CC_VERSION', '')
vars['_CXX_MAJOR_VERSION'] = subprocess.check_output('echo ${CXX_VERSION} | cut -c 1-2', shell=True, env=vars).rstrip('\n')
if (format('{_CC_MAJOR_VERSION}', vars, {}) != format('{_CXX_MAJOR_VERSION}', vars, {})):
sys.stderr.write('configure: error: The major versions of \\$CC and \\$CXX do not match.\n')
sys.exit(1)
if (vars.get('_CC_MAJOR_VERSION', '') == '16'):
vars['_CC_SUITE'] = '10'
vars['MSVS_VERSION'] = '2010'
vars['MSVC_C_RUNTIME_DLL'] = 'msvcr100.dll'
vars['MSVC_CXX_RUNTIME_DLL'] = 'msvcp100.dll'
elif (vars.get('_CC_MAJOR_VERSION', '') == '17'):
vars['_CC_SUITE'] = '11'
vars['MSVS_VERSION'] = '2012'
vars['MSVC_C_RUNTIME_DLL'] = 'msvcr110.dll'
vars['MSVC_CXX_RUNTIME_DLL'] = 'msvcp110.dll'
elif (vars.get('_CC_MAJOR_VERSION', '') == '18'):
vars['_CC_SUITE'] = '12'
vars['MSVS_VERSION'] = '2013'
vars['MSVC_C_RUNTIME_DLL'] = 'msvcr120.dll'
vars['MSVC_CXX_RUNTIME_DLL'] = 'msvcp120.dll'
else:
sys.stderr.write('configure: error: This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.\n')
sys.exit(1)
if (not vars.get('CLANG_CL', '')):
pass
if vars.get('WIN32_REDIST_DIR', ''):
if (not os.path.isdir(vars.get('WIN32_REDIST_DIR', ''))):
sys.stderr.write('configure: error: Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}\n')
sys.exit(1)
vars['WIN32_REDIST_DIR'] = subprocess.check_output('cd "$WIN32_REDIST_DIR" && pwd', shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_METRO', ''):
sys.stdout.write('configure: checking for makepri\n')
if (not 'MAKEPRI'):
sys.stderr.write('configure: error: makepri.exe is required for generating metro browser install components. It should be in the Win8 SDK.\n')
sys.exit(1)
vars['MSMT_TOOL'] = subprocess.check_output("mt 2>&1|grep 'Microsoft (R) Manifest Tool'", shell=True, env=vars).rstrip('\n')
if (not vars.get('MSMT_TOOL', '')):
sys.stderr.write('configure: error: Microsoft (R) Manifest Tool must be in your \\$PATH.\n')
sys.exit(1)
vars['_MSMT_VER_FILTER'] = 's|.*[^!-~]\\([0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\).*|\\1|p'
vars['MSMANIFEST_TOOL_VERSION'] = subprocess.check_output('echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"', shell=True, env=vars).rstrip('\n')
if (not vars.get('MSMANIFEST_TOOL_VERSION', '')):
sys.stdout.write('configure: warning: Unknown version of the Microsoft (R) Manifest Tool.\n')
vars['MSMANIFEST_TOOL'] = '1'
del vars['MSMT_TOOL']
vars['_LD_FULL_VERSION'] = subprocess.check_output('"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"', shell=True, env=vars).rstrip('\n')
vars['_LD_MAJOR_VERSION'] = subprocess.check_output("echo ${_LD_FULL_VERSION} | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
if (format('{_LD_MAJOR_VERSION}', vars, {}) != format('{_CC_SUITE}', vars, {})):
sys.stderr.write('configure: error: The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.\n')
sys.exit(1)
vars['INCREMENTAL_LINKER'] = '1'
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'i*86-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} -env win32', vars, {})
elif fnmatch.fnmatch(case, 'x86_64-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} -env x64', vars, {})
del vars['_MSVC_VER_FILTER']
if (vars.get('ac_cv_have_std__Throw', '') == 'yes'):
if (vars.get('ac_cv_have_dllimport_exception_bug', '') == 'no'):
vars['WRAP_STL_INCLUDES'] = '1'
vars['MOZ_MSVC_STL_WRAP__Throw'] = '1'
elif (vars.get('ac_cv_have__RAISE', '') == 'yes'):
vars['WRAP_STL_INCLUDES'] = '1'
vars['MOZ_MSVC_STL_WRAP__RAISE'] = '1'
else:
sys.stderr.write("configure: error: Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.\n")
sys.exit(1)
if (vars.get('WRAP_STL_INCLUDES', '') == '1'):
vars['STL_FLAGS'] = '-I$(DIST)/stl_wrappers'
vars['CFLAGS'] = format('{CFLAGS} -D_HAS_EXCEPTIONS=0', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -D_HAS_EXCEPTIONS=0', vars, {})
else:
vars['_W32API_MAJOR_VERSION'] = subprocess.check_output("echo $W32API_VERSION | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['_W32API_MINOR_VERSION'] = subprocess.check_output("echo $W32API_VERSION | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('configure: checking for w32api version >= $W32API_VERSION\n')
sys.stdout.write('$res\n')
if (vars.get('res', '') != 'yes'):
sys.stderr.write('configure: error: w32api version $W32API_VERSION or higher required.\n')
sys.exit(1)
sys.stdout.write('configure: checking for windres version >= $WINDRES_VERSION\n')
vars['_WINDRES_VERSION'] = subprocess.check_output("${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('$_WINDRES_VERSION\n')
vars['_WINDRES_MAJOR_VERSION'] = subprocess.check_output("echo $_WINDRES_VERSION | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['_WINDRES_MINOR_VERSION'] = subprocess.check_output("echo $_WINDRES_VERSION | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['_WINDRES_RELEASE_VERSION'] = subprocess.check_output("echo $_WINDRES_VERSION | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
vars['WINDRES_MAJOR_VERSION'] = subprocess.check_output("echo $WINDRES_VERSION | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['WINDRES_MINOR_VERSION'] = subprocess.check_output("echo $WINDRES_VERSION | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['WINDRES_RELEASE_VERSION'] = subprocess.check_output("echo $WINDRES_VERSION | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
if (format('{_WINDRES_MAJOR_VERSION}', vars, {}) < (format('{WINDRES_MAJOR_VERSION}', vars, {}) or (format('{_WINDRES_MAJOR_VERSION}', vars, {}) == (format('{WINDRES_MAJOR_VERSION}', vars, {}) and (format('{_WINDRES_MINOR_VERSION}', vars, {}) < (format('{WINDRES_MINOR_VERSION}', vars, {}) or (format('{_WINDRES_MAJOR_VERSION}', vars, {}) == (format('{WINDRES_MAJOR_VERSION}', vars, {}) and (format('{_WINDRES_MINOR_VERSION}', vars, {}) == (format('{WINDRES_MINOR_VERSION}', vars, {}) and (format('{_WINDRES_RELEASE_VERSION}', vars, {}) < format('{WINDRES_RELEASE_VERSION}', vars, {})))))))))))):
sys.stderr.write('configure: error: windres version $WINDRES_VERSION or higher is required to build.\n')
sys.exit(1)
if vars.get('MIDL', ''):
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'i*86-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} --win32 -m32', vars, {})
elif fnmatch.fnmatch(case, 'x86_64-*'):
vars['MIDL_FLAGS'] = format('{MIDL_FLAGS} --win64 -m64', vars, {})
vars['MOZ_WINSDK_MAXVER'] = '0x06020000'
sys.stdout.write('configure: checking for Windows SDK being recent enough\n')
if (not subprocess.call(format('{PERL} -e exit(0x{MOZ_WINSDK_TARGETVER} > {MOZ_WINSDK_MAXVER})', vars, {}), shell=True, env=vars)):
sys.stdout.write('"yes"\n')
else:
sys.stdout.write('"no"\n')
sys.stderr.write('configure: 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.\n')
sys.exit(1)
if vars.get('_WIN32_MSVC', ''):
vars['SKIP_PATH_CHECKS'] = '1'
vars['SKIP_COMPILER_CHECKS'] = '1'
vars['SKIP_LIBRARY_CHECKS'] = '1'
if (not vars.get('TINDERBOX_SKIP_PERL_VERSION_CHECK', '')):
sys.stdout.write('configure: checking for minimum required perl version >= $PERL_VERSION\n')
vars['_perl_version'] = subprocess.check_output('PERL_VERSION=$PERL_VERSION $PERL -e \'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }\' 2>&5', shell=True, env=vars).rstrip('\n')
vars['_perl_res'] = vars.get('?', '')
sys.stdout.write('$_perl_version\n')
if (vars.get('_perl_res', '') != '0'):
sys.stderr.write('configure: error: Perl $PERL_VERSION or higher is required.\n')
sys.exit(1)
sys.stdout.write('configure: checking for full perl installation\n')
vars['_perl_archlib'] = subprocess.check_output("$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5", shell=True, env=vars).rstrip('\n')
vars['_perl_res'] = vars.get('?', '')
if (vars.get('_perl_res', '') != '0'):
sys.stdout.write('no\n')
sys.stderr.write('configure: error: Cannot find Config.pm or \\$Config{archlib}. A full perl installation is required.\n')
sys.exit(1)
else:
sys.stdout.write('yes\n')
if (not vars.get('COMPILE_ENVIRONMENT', '')):
vars['NSINSTALL_BIN'] = '$(PYTHON) $(topsrcdir)/config/nsinstall.py'
if ((not vars.get('UNZIP', '')) or (vars.get('UNZIP', '') == ':')):
sys.stderr.write('configure: error: unzip not found in \\$PATH\n')
sys.exit(1)
if ((not vars.get('ZIP', '')) or (vars.get('ZIP', '') == ':')):
sys.stderr.write('configure: error: zip not found in \\$PATH\n')
sys.exit(1)
if ((not vars.get('XARGS', '')) or (vars.get('XARGS', '') == ':')):
sys.stderr.write('configure: error: xargs not found in \\$PATH .\n')
sys.exit(1)
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('UNIVERSAL_BINARY', ''):
if (not vars.get('UNIFY_DIST', '')):
sys.stderr.write('configure: error: You need to provide the --with-unify-dist=dir argument when performing a universal build\n')
sys.exit(1)
case = vars.get('UNIFY_DIST', '')
if fnmatch.fnmatch(case, '/*'):
pass else:
vars['UNIFY_DIST'] = format('{MOZ_BUILD_ROOT}/{UNIFY_DIST}', vars, {})
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-darwin*'):
if vars.get('_MACOSX_DEPLOYMENT_TARGET', ''):
vars['MACOSX_DEPLOYMENT_TARGET'] = vars.get('_MACOSX_DEPLOYMENT_TARGET', '')
exports.add('MACOSX_DEPLOYMENT_TARGET')
else:
vars['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
exports.add('MACOSX_DEPLOYMENT_TARGET')
vars['MACOS_SDK_DIR'] = ''
vars['MACOS_PRIVATE_FRAMEWORKS_DIR_DEFAULTED'] = ''
if (not vars.get('MACOS_PRIVATE_FRAMEWORKS_DEFAULTED', '')):
if (not vars.get('CROSS_COMPILE', '')):
sys.stdout.write('configure: warning: You should only be using --with-macos-private-frameworks when cross-compiling.\n')
if (not os.path.isdir(vars.get('MACOS_PRIVATE_FRAMEWORKS_DIR', ''))):
sys.stderr.write('configure: error: PrivateFrameworks directory not found.\n')
sys.exit(1)
if vars.get('MACOS_SDK_DIR', ''):
if (not os.path.isdir(vars.get('MACOS_SDK_DIR', ''))):
sys.stderr.write('configure: error: SDK not found. When using --with-macos-sdk, you must\nspecify a valid SDK. SDKs are installed when the optional cross-development\ntools are selected during the Xcode/Developer Tools installation.\n')
sys.exit(1)
vars['CFLAGS'] = format('{CFLAGS} -isysroot {MACOS_SDK_DIR}', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -isysroot {MACOS_SDK_DIR}', vars, {})
vars['CPP'] = format('{CPP} -isysroot {MACOS_SDK_DIR}', vars, {})
vars['CXXCPP'] = format('{CXXCPP} -isysroot {MACOS_SDK_DIR}', vars, {})
sys.stdout.write('configure: checking for valid compiler/Mac OS X SDK combination\n')
sys.stdout.write('$result\n')
if (vars.get('result', '') == 'no'):
sys.stderr.write('configure: error: The selected compiler and Mac OS X SDK are incompatible.\n')
sys.exit(1)
if vars.get('MAKE', ''):
if (subprocess.check_output('echo $MAKE | grep -c make.py', shell=True, env=vars).rstrip('\n') != '1'):
vars['NOT_PYMAKE'] = vars.get('MAKE', '')
case = vars.get('host_os', '')
if fnmatch.fnmatch(case, 'mingw*'):
pass
if (vars.get('GMAKE', '') == ':'):
sys.stderr.write('configure: error: GNU make not found\n')
sys.exit(1)
if (not vars.get('MAKE', '')):
vars['MAKE'] = vars.get('GMAKE', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
vars['XCFLAGS'] = vars.get('X_CFLAGS', '')
vars['AS_BIN'] = vars.get('AS', '')
vars['AR_LIST'] = '$(AR) t'
vars['AR_EXTRACT'] = '$(AR) x'
vars['AR_DELETE'] = '$(AR) d'
vars['AS'] = '$(CC)'
vars['AS_DASH_C_FLAG'] = '-c'
vars['DLL_PREFIX'] = 'lib'
vars['LIB_PREFIX'] = 'lib'
vars['DLL_SUFFIX'] = '.so'
vars['OBJ_SUFFIX'] = 'o'
vars['LIB_SUFFIX'] = 'a'
vars['ASM_SUFFIX'] = 's'
vars['IMPORT_LIB_SUFFIX'] = ''
vars['TARGET_MD_ARCH'] = 'unix'
vars['DIRENT_INO'] = 'd_ino'
vars['MOZ_USER_DIR'] = '.mozilla'
vars['MOZ_FIX_LINK_PATHS'] = '-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
vars['MOZ_FS_LAYOUT'] = 'unix'
vars['USE_DEPENDENT_LIBS'] = '1'
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-gtk2'
if vars.get('CROSS_COMPILE', ''):
vars['OS_TARGET'] = vars.get('target_os', '')
vars['OS_ARCH'] = subprocess.check_output("echo $target_os | sed -e 's|/|_|g'", shell=True, env=vars).rstrip('\n')
vars['OS_RELEASE'] = ''
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'linux*'):
vars['OS_ARCH'] = 'Linux'
vars['OS_TARGET'] = 'Linux'
elif fnmatch.fnmatch(case, 'kfreebsd*-gnu'):
vars['OS_ARCH'] = 'GNU_kFreeBSD'
vars['OS_TARGET'] = 'GNU/kFreeBSD'
elif fnmatch.fnmatch(case, 'gnu*'):
vars['OS_ARCH'] = 'GNU'
elif fnmatch.fnmatch(case, 'solaris*'):
vars['OS_ARCH'] = 'SunOS'
vars['OS_RELEASE'] = '5'
elif fnmatch.fnmatch(case, 'mingw*'):
vars['OS_ARCH'] = 'WINNT'
vars['OS_TARGET'] = 'WINNT'
elif fnmatch.fnmatch(case, 'darwin*'):
vars['OS_ARCH'] = 'Darwin'
vars['OS_TARGET'] = 'Darwin'
elif fnmatch.fnmatch(case, 'dragonfly*'):
vars['OS_ARCH'] = 'DragonFly'
vars['OS_TARGET'] = 'DragonFly'
elif fnmatch.fnmatch(case, 'freebsd*'):
vars['OS_ARCH'] = 'FreeBSD'
vars['OS_TARGET'] = 'FreeBSD'
elif fnmatch.fnmatch(case, 'netbsd*'):
vars['OS_ARCH'] = 'NetBSD'
vars['OS_TARGET'] = 'NetBSD'
elif fnmatch.fnmatch(case, 'openbsd*'):
vars['OS_ARCH'] = 'OpenBSD'
vars['OS_TARGET'] = 'OpenBSD'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
vars['OS_ARCH'] = 'Linux'
vars['OS_TARGET'] = 'Android'
else:
vars['OS_TARGET'] = subprocess.check_output('uname -s', shell=True, env=vars).rstrip('\n')
vars['OS_ARCH'] = subprocess.check_output("uname -s | sed -e 's|/|_|g'", shell=True, env=vars).rstrip('\n')
vars['OS_RELEASE'] = subprocess.check_output('uname -r', shell=True, env=vars).rstrip('\n')
vars['OS_TEST'] = vars.get('target_cpu', '')
vars['HOST_OS_ARCH'] = subprocess.check_output("echo $host_os | sed -e 's|/|_|g'", shell=True, env=vars).rstrip('\n')
case = vars.get('HOST_OS_ARCH', '')
if fnmatch.fnmatch(case, 'mingw*'):
vars['HOST_OS_ARCH'] = 'WINNT'
elif fnmatch.fnmatch(case, 'darwin*'):
vars['HOST_OS_ARCH'] = 'Darwin'
elif fnmatch.fnmatch(case, 'linux*'):
vars['HOST_OS_ARCH'] = 'Linux'
elif fnmatch.fnmatch(case, 'kfreebsd*-gnu'):
vars['HOST_OS_ARCH'] = 'GNU_kFreeBSD'
elif fnmatch.fnmatch(case, 'gnu*'):
vars['HOST_OS_ARCH'] = 'GNU'
elif fnmatch.fnmatch(case, 'dragonfly*'):
vars['HOST_OS_ARCH'] = 'DragonFly'
elif fnmatch.fnmatch(case, 'freebsd*'):
vars['HOST_OS_ARCH'] = 'FreeBSD'
elif fnmatch.fnmatch(case, 'netbsd*'):
vars['HOST_OS_ARCH'] = 'NetBSD'
elif fnmatch.fnmatch(case, 'openbsd*'):
vars['HOST_OS_ARCH'] = 'OpenBSD'
elif fnmatch.fnmatch(case, 'solaris*'):
vars['HOST_OS_ARCH'] = 'SunOS'
vars['SOLARIS_SUNPRO_CC'] = ''
vars['SOLARIS_SUNPRO_CXX'] = ''
if (not vars.get('GNU_CC', '')):
if (subprocess.check_output("$CC -V 2>&1 | egrep -c 'Sun.*C '", shell=True, env=vars).rstrip('\n') != '0'):
vars['SOLARIS_SUNPRO_CC'] = '1'
if (not vars.get('GNU_CXX', '')):
if (subprocess.check_output("$CXX -V 2>&1 | egrep -c 'Sun.*C\\+\\+ '", shell=True, env=vars).rstrip('\n') != '0'):
vars['SOLARIS_SUNPRO_CXX'] = '1'
case = vars.get('OS_ARCH', '')
if fnmatch.fnmatch(case, 'WINNT'):
if (not vars.get('CROSS_COMPILE', '')):
vars['OS_TEST'] = subprocess.check_output('uname -p', shell=True, env=vars).rstrip('\n')
elif fnmatch.fnmatch(case, 'Windows_NT'):
vars['OS_ARCH'] = 'WINNT'
vars['OS_TARGET'] = 'WINNT'
vars['OS_MINOR_RELEASE'] = subprocess.check_output('uname -v', shell=True, env=vars).rstrip('\n')
if (vars.get('OS_MINOR_RELEASE', '') == '00'):
vars['OS_MINOR_RELEASE'] = '0'
vars['OS_RELEASE'] = format('{OS_RELEASE}.{OS_MINOR_RELEASE}', vars, {})
elif fnmatch.fnmatch(case, 'MINGW*_NT*'):
vars['OS_RELEASE'] = subprocess.check_output("expr $OS_ARCH : '.*NT-\\(.*\\)'", shell=True, env=vars).rstrip('\n')
vars['OS_ARCH'] = 'WINNT'
vars['OS_TARGET'] = 'WINNT'
elif fnmatch.fnmatch(case, 'AIX'):
vars['OS_RELEASE'] = format('{cmd0}.{cmd1}', vars, {'cmd0':subprocess.check_output('uname -v', shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output('uname -r', shell=True, env=vars).rstrip('\n')})
vars['OS_TEST'] = vars.get('target_cpu', '')
elif fnmatch.fnmatch(case, 'Darwin'):
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'powerpc*'):
vars['OS_TEST'] = 'ppc'
elif fnmatch.fnmatch(case, 'i*86*'):
vars['OS_TEST'] = 'i386'
elif fnmatch.fnmatch(case, 'x86_64'):
vars['OS_TEST'] = 'x86_64'
elif (not vars.get('CROSS_COMPILE', '')):
vars['OS_TEST'] = subprocess.check_output('uname -p', shell=True, env=vars).rstrip('\n')
case = vars.get('OS_TEST', '')
if (fnmatch.fnmatch(case, '*86') or fnmatch.fnmatch(case, 'i86pc')):
vars['CPU_ARCH'] = 'x86'
elif (fnmatch.fnmatch(case, 'powerpc64') or fnmatch.fnmatch(case, 'ppc64') or fnmatch.fnmatch(case, 'powerpc64le') or fnmatch.fnmatch(case, 'ppc64le')):
vars['CPU_ARCH'] = 'ppc64'
elif (fnmatch.fnmatch(case, 'powerpc') or fnmatch.fnmatch(case, 'ppc') or fnmatch.fnmatch(case, 'rs6000')):
vars['CPU_ARCH'] = 'ppc'
elif (fnmatch.fnmatch(case, 'Alpha') or fnmatch.fnmatch(case, 'alpha') or fnmatch.fnmatch(case, 'ALPHA')):
vars['CPU_ARCH'] = 'Alpha'
elif fnmatch.fnmatch(case, 's390'):
vars['CPU_ARCH'] = 's390'
elif fnmatch.fnmatch(case, 's390x'):
vars['CPU_ARCH'] = 's390x'
elif (fnmatch.fnmatch(case, 'hppa*') or fnmatch.fnmatch(case, 'parisc')):
vars['CPU_ARCH'] = 'hppa'
elif (fnmatch.fnmatch(case, 'sun4u') or fnmatch.fnmatch(case, 'sparc*')):
vars['CPU_ARCH'] = 'sparc'
elif (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'ia64')):
vars['CPU_ARCH'] = vars.get('OS_TEST', '')
elif fnmatch.fnmatch(case, 'arm*'):
vars['CPU_ARCH'] = 'arm'
elif (fnmatch.fnmatch(case, 'mips') or fnmatch.fnmatch(case, 'mipsel')):
vars['CPU_ARCH'] = 'mips'
elif fnmatch.fnmatch(case, 'aarch64*'):
vars['CPU_ARCH'] = 'aarch64'
if (not vars.get('OS_TARGET', '')):
vars['OS_TARGET'] = vars.get('OS_ARCH', '')
vars['OS_CONFIG'] = format('{OS_TARGET}{OS_RELEASE}', vars, {})
vars['INTEL_ARCHITECTURE'] = ''
case = vars.get('OS_TEST', '')
if (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'i?86')):
vars['INTEL_ARCHITECTURE'] = '1'
if vars.get('COMPILE_ENVIRONMENT', ''):
vars['configure_static_assert_macros'] = '\n#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)\n#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)\n#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]\n'
sys.stdout.write('configure: checking that static assertion macros used in autoconf tests work\n')
sys.stdout.write('"$ac_cv_static_assertion_macros_work"\n')
if (vars.get('ac_cv_static_assertion_macros_work', '') == 'no'):
sys.stderr.write('configure: error: Compiler cannot compile macros used in autoconf tests.\n')
sys.exit(1)
if vars.get('CLANG_CC', ''):
vars['_WARNINGS_CFLAGS'] = format('-Qunused-arguments {_WARNINGS_CFLAGS}', vars, {})
vars['CPPFLAGS'] = format('-Qunused-arguments {CPPFLAGS}', vars, {})
if vars.get('CLANG_CXX', ''):
vars['_WARNINGS_CXXFLAGS'] = format('-Qunused-arguments {_WARNINGS_CXXFLAGS}', vars, {})
if args.address_sanitizer:
vars['MOZ_ASAN'] = '1'
else:
vars['MOZ_ASAN'] = ''
if vars.get('MOZ_ASAN', ''):
vars['MOZ_LLVM_HACKS'] = '1'
if args.llvm_hacks:
vars['MOZ_LLVM_HACKS'] = '1'
else:
vars['MOZ_LLVM_HACKS'] = ''
if vars.get('MOZ_LLVM_HACKS', ''):
vars['MOZ_NO_WLZDEFS'] = '1'
vars['MOZ_CFLAGS_NSS'] = '1'
if vars.get('GNU_CC', ''):
vars['MMX_FLAGS'] = '-mmmx'
vars['SSE_FLAGS'] = '-msse'
vars['SSE2_FLAGS'] = '-msse2'
vars['CFLAGS'] = format('{CFLAGS} -std=gnu99', vars, {})
if (vars.get('OS_ARCH', '') != 'Darwin'):
vars['CFLAGS'] = format('{CFLAGS} -fgnu89-inline', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -fno-strict-aliasing', vars, {})
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(DSO_SONAME) -o $@'
vars['WARNINGS_AS_ERRORS'] = '-Werror'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '-fPIC'
vars['ASFLAGS'] = format('{ASFLAGS} -fPIC', vars, {})
sys.stdout.write('configure: checking for --noexecstack option to as\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -Wa,--noexecstack', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
sys.stdout.write('configure: checking for -z noexecstack option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,noexecstack', vars, {})
sys.stdout.write('configure: checking for -z text option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,text', vars, {})
sys.stdout.write('configure: checking for --build-id option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,--build-id', vars, {})
sys.stdout.write('configure: checking for --ignore-unresolved-symbol option to ld\n')
vars['HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED'] = ''
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,--ignore-unresolved-symbol,environ', vars, {})
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
sys.stdout.write('configure: checking if toolchain supports -mssse3 option\n')
vars['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] = ''
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -mssse3', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
sys.stdout.write('configure: checking if toolchain supports -msse4.1 option\n')
vars['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1'] = ''
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -msse4.1', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'x86_64')):
sys.stdout.write('configure: checking for x86 AVX2 asm support in compiler\n')
sys.stdout.write('"$result"\n')
if (vars.get('result', '') == 'yes'):
vars['HAVE_X86_AVX2'] = '1'
vars['DSO_LDOPTS'] = '-shared'
if vars.get('GCC_USE_GNU_LD', ''):
if (not vars.get('MOZ_NO_WLZDEFS', '')):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -Wl,-z,defs', vars, {})
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'DragonFly') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'NetBSD') or fnmatch.fnmatch(case, 'OpenBSD')):
if vars.get('HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED', ''):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -Wl,--ignore-unresolved-symbol,environ', vars, {})
else:
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -Wl,--warn-unresolved-symbols', vars, {})
vars['_WARNINGS_CFLAGS'] = format('{_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement', vars, {})
vars['_WARNINGS_CFLAGS'] = format('{_WARNINGS_CFLAGS} -Wno-unused', vars, {})
if ((not format('{INTEL_CC}', vars, {})) and (not format('{CLANG_CC}', vars, {}))):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'hppa') or fnmatch.fnmatch(case, 'ia64') or fnmatch.fnmatch(case, 'sparc') or fnmatch.fnmatch(case, 'arm')):
pass else:
vars['_WARNINGS_CFLAGS'] = format('{_WARNINGS_CFLAGS} -Wcast-align', vars, {})
vars['_DEFINES_CFLAGS'] = '-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
vars['_USE_CPP_INCLUDE_FLAG'] = '1'
vars['ASFLAGS'] = format('{ASFLAGS} {_DEFINES_CFLAGS}', vars, {})
elif vars.get('SOLARIS_SUNPRO_CC', ''):
vars['DSO_CFLAGS'] = ''
if (vars.get('CPU_ARCH', '') == 'sparc'):
vars['DSO_PIC_CFLAGS'] = '-xcode=pic32'
else:
vars['DSO_PIC_CFLAGS'] = '-KPIC'
vars['_DEFINES_CFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else:
vars['MKSHLIB'] = '$(LD) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(LD) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['DSO_LDOPTS'] = '-shared'
if vars.get('GNU_LD', ''):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -z defs', vars, {})
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '-KPIC'
vars['_DEFINES_CFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
if vars.get('GNU_CXX', ''):
vars['CXXFLAGS'] = format('{CXXFLAGS} -fno-exceptions -fno-strict-aliasing', vars, {})
vars['_WARNINGS_CXXFLAGS'] = format('{_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual', vars, {})
if ((not format('{INTEL_CXX}', vars, {})) and (not format('{CLANG_CXX}', vars, {}))):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'hppa') or fnmatch.fnmatch(case, 'ia64') or fnmatch.fnmatch(case, 'sparc') or fnmatch.fnmatch(case, 'arm')):
pass else:
vars['_WARNINGS_CXXFLAGS'] = format('{_WARNINGS_CXXFLAGS} -Wcast-align', vars, {})
vars['_DEFINES_CXXFLAGS'] = '-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
vars['_USE_CPP_INCLUDE_FLAG'] = '1'
if vars.get('CLANG_CXX', ''):
vars['_WARNINGS_CXXFLAGS'] = format('{_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions', vars, {})
else:
vars['_DEFINES_CXXFLAGS'] = '-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
vars['MKSHLIB_FORCE_ALL'] = ''
vars['MKSHLIB_UNFORCE_ALL'] = ''
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('GNU_CC', ''):
sys.stdout.write('configure: checking whether ld has archive extraction flags\n')
if (vars.get('ac_cv_mkshlib_force_and_unforce', '') == 'no'):
sys.stdout.write('no\n')
else:
sys.stdout.write('yes\n')
subprocess.call(format('eval {ac_cv_mkshlib_force_and_unforce}', vars, {}), shell=True, env=vars)
vars['MKSHLIB_FORCE_ALL'] = vars.get('force', '')
vars['MKSHLIB_UNFORCE_ALL'] = vars.get('unforce', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
sys.stdout.write('configure: checking for 64-bit OS\n')
sys.stdout.write('"$result"\n')
if (vars.get('result', '') == 'yes'):
vars['HAVE_64BIT_BUILD'] = '1'
if args.profiling:
vars['MOZ_PROFILING'] = '1'
else:
vars['MOZ_PROFILING'] = ''
if args.systrace:
vars['MOZ_USE_SYSTRACE'] = '1'
else:
vars['MOZ_USE_SYSTRACE'] = ''
if vars.get('MOZ_USE_SYSTRACE', ''):
pass
if (format('{MOZ_PROFILING}', vars, {}) and (not format('{STRIP_FLAGS}', vars, {}))):
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'Linux') or fnmatch.fnmatch(case, 'DragonFly') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'NetBSD') or fnmatch.fnmatch(case, 'OpenBSD')):
vars['STRIP_FLAGS'] = '--strip-debug'
if args.valgrind:
vars['MOZ_VALGRIND'] = '1'
else:
vars['MOZ_VALGRIND'] = ''
if vars.get('MOZ_VALGRIND', ''):
pass
if args.jprof:
vars['MOZ_JPROF'] = '1'
else:
vars['MOZ_JPROF'] = ''
if vars.get('MOZ_JPROF', ''):
vars['MOZ_PROFILING'] = '1'
vars['MOZ_ENABLE_PROFILER_SPS'] = '1'
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Android'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'arm')):
pass else:
vars['MOZ_ENABLE_PROFILER_SPS'] = ''
elif fnmatch.fnmatch(case, 'Linux'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'x86_64')):
pass else:
vars['MOZ_ENABLE_PROFILER_SPS'] = ''
elif (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin')):
pass else:
vars['MOZ_ENABLE_PROFILER_SPS'] = ''
if vars.get('MOZ_ENABLE_PROFILER_SPS', ''):
pass
if args.shark:
vars['MOZ_SHARK'] = '1'
else:
vars['MOZ_SHARK'] = ''
if vars.get('MOZ_SHARK', ''):
vars['MOZ_PROFILING'] = '1'
if args.instruments:
vars['MOZ_INSTRUMENTS'] = '1'
else:
vars['MOZ_INSTRUMENTS'] = ''
if vars.get('MOZ_INSTRUMENTS', ''):
vars['MOZ_PROFILING'] = '1'
if args.callgrind:
vars['MOZ_CALLGRIND'] = '1'
else:
vars['MOZ_CALLGRIND'] = ''
if vars.get('MOZ_CALLGRIND', ''):
vars['MOZ_PROFILING'] = '1'
if args.vtune:
vars['MOZ_VTUNE'] = '1'
else:
vars['MOZ_VTUNE'] = ''
if vars.get('MOZ_VTUNE', ''):
vars['MOZ_PROFILING'] = '1'
if vars.get('MOZ_PROFILING', ''):
pass
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*mingw*'):
if vars.get('_WIN32_MSVC', ''):
vars['HOST_AR'] = 'lib'
vars['HOST_AR_FLAGS'] = '-NOLOGO -OUT:$@'
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -TC -nologo', vars, {})
vars['HOST_RANLIB'] = 'echo ranlib'
else:
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -mwindows', vars, {})
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS', vars, {})
vars['HOST_NSPR_MDCPUCFG'] = '\\"md/_winnt.cfg\\"'
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O2')
vars['HOST_BIN_SUFFIX'] = '.exe'
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*mingw*'):
vars['PERL'] = format('/bin/sh {_topsrcdir}/build/msys-perl-wrapper', vars, {})
case = vars.get('host_cpu', '')
if fnmatch.fnmatch(case, 'i*86'):
if vars.get('_WIN32_MSVC', ''):
vars['HOST_LDFLAGS'] = format('{HOST_LDFLAGS} -MACHINE:X86', vars, {})
elif fnmatch.fnmatch(case, 'x86_64'):
if vars.get('_WIN32_MSVC', ''):
vars['HOST_LDFLAGS'] = format('{HOST_LDFLAGS} -MACHINE:X64', vars, {})
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -D_AMD64_', vars, {})
elif fnmatch.fnmatch(case, '*-darwin*'):
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_UNIX -DXP_MACOSX -DNO_X11', vars, {})
vars['HOST_NSPR_MDCPUCFG'] = '\\"md/_darwin.cfg\\"'
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O3')
elif (fnmatch.fnmatch(case, '*-linux*') or fnmatch.fnmatch(case, '*-kfreebsd*-gnu') or fnmatch.fnmatch(case, '*-gnu*')):
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_UNIX', vars, {})
vars['HOST_NSPR_MDCPUCFG'] = '\\"md/_linux.cfg\\"'
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O3')
else:
vars['HOST_CFLAGS'] = format('{HOST_CFLAGS} -DXP_UNIX', vars, {})
vars['HOST_OPTIMIZE_FLAGS'] = vars.get('HOST_OPTIMIZE_FLAGS', '-O2')
sys.stdout.write('configure: checking for custom <inttypes.h> implementation\n')
if vars.get('MOZ_CUSTOM_INTTYPES_H', ''):
sys.stdout.write('using $MOZ_CUSTOM_INTTYPES_H\n')
else:
sys.stdout.write('none specified\n')
vars['MOZILLA_VERSION'] = subprocess.check_output('$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir', shell=True, env=vars).rstrip('\n')
vars['MOZILLA_UAVERSION'] = subprocess.check_output('$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion', shell=True, env=vars).rstrip('\n')
vars['MOZILLA_SYMBOLVERSION'] = subprocess.check_output('$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -symbolversion', shell=True, env=vars).rstrip('\n')
vars['FIREFOX_VERSION'] = subprocess.check_output('cat $_topsrcdir/browser/config/version.txt', shell=True, env=vars).rstrip('\n')
if (not vars.get('FIREFOX_VERSION', '')):
sys.stderr.write('configure: error: FIREFOX_VERSION is unexpectedly blank.\n')
sys.exit(1)
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-aix*'):
if (not vars.get('GNU_CC', '')):
if (not vars.get('HAVE_64BIT_BUILD', '')):
if (vars.get('AIX_OBJMODEL', '') == 'ibm'):
vars['CXXFLAGS'] = format('{CXXFLAGS} -qobjmodel=ibm', vars, {})
else:
vars['AIX_OBJMODEL'] = 'compat'
else:
vars['AIX_OBJMODEL'] = 'compat'
vars['DSO_LDOPTS'] = '-qmkshrobj=1'
vars['DSO_CFLAGS'] = '-qflag=w:w'
vars['DSO_PIC_CFLAGS'] = ''
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-brtl -blibpath:/usr/lib:/lib', vars, {})
vars['MOZ_FIX_LINK_PATHS'] = ''
vars['MKSHLIB'] = '$(CXX) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(DSO_LDOPTS) -o $@'
if vars.get('COMPILE_ENVIRONMENT', ''):
sys.stdout.write('configure: checking for IBM XLC/C++ compiler version >= 9.0.0.7\n')
if vars.get('_BAD_COMPILER', ''):
sys.stdout.write('no\n')
sys.stderr.write('configure: error: IBM XLC/C++ 9.0.0.7 or higher is required to build.\n')
sys.exit(1)
else:
sys.stdout.write('yes\n')
vars['TARGET_COMPILER_ABI'] = 'ibmc'
vars['CC_VERSION'] = subprocess.check_output("lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'", shell=True, env=vars).rstrip('\n')
vars['CXX_VERSION'] = subprocess.check_output("lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'", shell=True, env=vars).rstrip('\n')
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'aix4.1*'):
vars['DLL_SUFFIX'] = '_shr.a'
if vars.get('COMPILE_ENVIRONMENT', ''):
pass
elif fnmatch.fnmatch(case, '*-darwin*'):
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
vars['MOZ_OPTIMIZE_FLAGS'] = '-O3'
if vars.get('HAVE_64BIT_BUILD', ''):
vars['MOZ_MEMORY'] = '1'
vars['DLL_SUFFIX'] = '.dylib'
vars['DSO_LDOPTS'] = ''
vars['STRIP_FLAGS'] = format('{STRIP_FLAGS} -x -S', vars, {})
if (vars.get('ac_cv_ios_target', '') == 'yes'):
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-uikit'
else:
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-cocoa'
vars['MOZ_DEBUG_LDFLAGS'] = format('{MOZ_DEBUG_LDFLAGS} -framework ExceptionHandling', vars, {})
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_darwin.cfg\\"'
if (format('x{lto_is_enabled}', vars, {}) == 'xyes'):
print 'Skipping -dead_strip because lto is enabled.'
elif (format('x{enable_dtrace}', vars, {}) == 'xyes'):
print 'Skipping -dead_strip because DTrace is enabled. See bug 403132.'
else:
sys.stdout.write('configure: checking for -dead_strip option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-dead_strip', vars, {})
if vars.get('_HAVE_DEAD_STRIP', ''):
sys.stdout.write('yes\n')
vars['MOZ_OPTIMIZE_LDFLAGS'] = '-Wl,-dead_strip'
else:
sys.stdout.write('no\n')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
sys.stdout.write('configure: checking for -allow_heap_execute option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-allow_heap_execute', vars, {})
if vars.get('_HAVE_ALLOW_HEAP_EXECUTE', ''):
sys.stdout.write('yes\n')
vars['MOZ_ALLOW_HEAP_EXECUTE_FLAGS'] = '-Wl,-allow_heap_execute'
else:
sys.stdout.write('no\n')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['MOZ_FIX_LINK_PATHS'] = '-Wl,-executable_path,$(LIBXUL_DIST)/bin'
elif fnmatch.fnmatch(case, 'ia64*-hpux*'):
vars['DLL_SUFFIX'] = '.so'
if (not vars.get('GNU_CC', '')):
vars['DSO_LDOPTS'] = '-b'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = ''
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
vars['CXXFLAGS'] = format('{CXXFLAGS} -Wc,-ansi_for_scope,on', vars, {})
else:
vars['DSO_LDOPTS'] = '-b -E'
vars['MKSHLIB'] = '$(LD) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(LD) $(DSO_LDOPTS) -o $@'
vars['MOZ_FIX_LINK_PATHS'] = ''
elif fnmatch.fnmatch(case, '*-hpux*'):
vars['DLL_SUFFIX'] = '.sl'
if (not vars.get('GNU_CC', '')):
vars['DSO_LDOPTS'] = '-b -Wl,+s'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '+Z'
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
vars['MKCSHLIB'] = '$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
vars['CXXFLAGS'] = format('{CXXFLAGS} -Wc,-ansi_for_scope,on', vars, {})
else:
vars['DSO_LDOPTS'] = '-b -E +s'
vars['MKSHLIB'] = '$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
vars['MKCSHLIB'] = '$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
vars['MOZ_POST_PROGRAM_COMMAND'] = 'chatr +s enable'
elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
vars['no_x'] = 'yes'
if vars.get('gonkdir', ''):
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-gonk'
vars['_PLATFORM_HAVE_RIL'] = '1'
vars['MOZ_B2G_FM'] = '1'
vars['MOZ_SYNTH_PICO'] = '1'
else:
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-android'
vars['MOZ_LINKER'] = '1'
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_linux.cfg\\"'
vars['MOZ_GFX_OPTIMIZE_MOBILE'] = '1'
vars['MOZ_OPTIMIZE_FLAGS'] = '-Os -freorder-blocks -fno-reorder-functions'
elif fnmatch.fnmatch(case, '*-*linux*'):
if (format('{INTEL_CC}', vars, {}) or format('{INTEL_CXX}', vars, {})):
vars['MOZ_OPTIMIZE_FLAGS'] = '-O2'
elif (format('{GNU_CC}', vars, {}) or format('{GNU_CXX}', vars, {})):
case = vars.get('GCC_VERSION', '')
if fnmatch.fnmatch(case, '4.5.*'):
vars['MOZ_OPTIMIZE_SIZE_TWEAK'] = '-finline-limit=50'
vars['MOZ_PGO_OPTIMIZE_FLAGS'] = '-O3'
vars['MOZ_OPTIMIZE_FLAGS'] = format('-Os -freorder-blocks {MOZ_OPTIMIZE_SIZE_TWEAK}', vars, {})
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_linux.cfg\\"'
vars['MOZ_MEMORY'] = '1'
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'alpha*'):
vars['CFLAGS'] = format('{CFLAGS} -mieee', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mieee', vars, {})
if (not vars.get('MC', '')):
vars['MC'] = 'mc.exe'
elif fnmatch.fnmatch(case, '*-mingw*'):
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = ''
vars['DLL_SUFFIX'] = '.dll'
vars['RC'] = 'rc.exe'
vars['MC'] = 'mc.exe'
if (format('{GNU_CC}', vars, {}) or format('{CLANG_CC}', vars, {})):
vars['CC'] = format('{CC} -mwindows', vars, {})
vars['CXX'] = format('{CXX} -mwindows', vars, {})
vars['CPP'] = format('{CPP} -mwindows', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -mms-bitfields', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mms-bitfields', vars, {})
vars['DSO_LDOPTS'] = '-shared'
vars['MKSHLIB'] = '$(CXX) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '$(CC) $(DSO_LDOPTS) -o $@'
vars['RC'] = '$(WINDRES)'
vars['LDFLAGS'] = format('{LDFLAGS} -static-libgcc -static-libstdc++', vars, {})
vars['NSPR_LDFLAGS'] = format('{NSPR_LDFLAGS} -static-libgcc', vars, {})
vars['RCFLAGS'] = '-O coff --use-temp-file'
vars['LIBS'] = format('{LIBS} -luuid -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32 -lnetapi32', vars, {})
vars['MOZ_FIX_LINK_PATHS'] = ''
vars['DLL_PREFIX'] = ''
vars['IMPORT_LIB_SUFFIX'] = 'dll.a'
else:
vars['TARGET_COMPILER_ABI'] = 'msvc'
vars['HOST_CC'] = '$(CC)'
vars['HOST_CXX'] = '$(CXX)'
vars['HOST_LD'] = '$(LD)'
if vars.get('AS_BIN', ''):
vars['AS'] = subprocess.check_output('basename "$AS_BIN"', shell=True, env=vars).rstrip('\n')
vars['AR'] = 'lib'
vars['AR_FLAGS'] = '-NOLOGO -OUT:$@'
vars['AR_EXTRACT'] = ''
vars['RANLIB'] = 'echo not_ranlib'
vars['STRIP'] = 'echo not_strip'
vars['PKG_SKIP_STRIP'] = '1'
vars['XARGS'] = 'xargs'
vars['ZIP'] = 'zip'
vars['UNZIP'] = 'unzip'
vars['DOXYGEN'] = ':'
vars['ASM_SUFFIX'] = 'asm'
vars['OBJ_SUFFIX'] = 'obj'
vars['LIB_SUFFIX'] = 'lib'
vars['DLL_PREFIX'] = ''
vars['LIB_PREFIX'] = ''
vars['IMPORT_LIB_SUFFIX'] = 'lib'
vars['MKSHLIB'] = '$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
vars['MKCSHLIB'] = '$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
vars['MKSHLIB_FORCE_ALL'] = ''
vars['MKSHLIB_UNFORCE_ALL'] = ''
vars['DSO_LDOPTS'] = '-SUBSYSTEM:WINDOWS'
vars['_USE_CPP_INCLUDE_FLAG'] = '1'
vars['_DEFINES_CFLAGS'] = '-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
vars['_DEFINES_CXXFLAGS'] = '-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
vars['CFLAGS'] = format('{CFLAGS} -W3 -Gy', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -W3 -Gy', vars, {})
if (vars.get('_CC_SUITE', '') >= '11'):
vars['CFLAGS'] = format('{CFLAGS} -arch:IA32', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -arch:IA32', vars, {})
if (vars.get('_CC_SUITE', '') >= '12'):
vars['CFLAGS'] = format('{CFLAGS} -FS -Gw', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -FS -Gw', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -wd4244 -wd4819', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -wd4251 -wd4244 -wd4345 -wd4351 -wd4482 -wd4800 -wd4819', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -we4553', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -we4553', vars, {})
vars['LIBS'] = format('{LIBS} kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib netapi32.lib', vars, {})
vars['MOZ_DEBUG_LDFLAGS'] = '-DEBUG -DEBUGTYPE:CV'
vars['WARNINGS_AS_ERRORS'] = '-WX'
vars['MOZ_OPTIMIZE_FLAGS'] = '-O1 -Oi'
vars['MOZ_FIX_LINK_PATHS'] = ''
vars['MOZ_COMPONENT_NSPR_LIBS'] = '$(NSPR_LIBS)'
if (not vars.get('CLANG_CL', '')):
vars['LDFLAGS'] = format('{LDFLAGS} -LARGEADDRESSAWARE -NXCOMPAT', vars, {})
if (not vars.get('DEVELOPER_OPTIONS', '')):
vars['LDFLAGS'] = format('{LDFLAGS} -RELEASE', vars, {})
vars['PROFILE_GEN_CFLAGS'] = '-GL'
vars['PROFILE_GEN_LDFLAGS'] = '-LTCG:PGINSTRUMENT'
vars['PROFILE_USE_CFLAGS'] = '-GL -wd4624 -wd4952'
vars['PROFILE_USE_LDFLAGS'] = '-LTCG:PGUPDATE'
vars['LDFLAGS'] = format('{LDFLAGS} -DYNAMICBASE', vars, {})
vars['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] = '1'
vars['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1'] = '1'
vars['MOZ_MEMORY'] = '1'
vars['TARGET_MD_ARCH'] = 'win32'
vars['_PLATFORM_DEFAULT_TOOLKIT'] = 'cairo-windows'
vars['BIN_SUFFIX'] = '.exe'
vars['MOZ_USER_DIR'] = 'Mozilla'
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_win95.cfg\\"'
vars['no_x'] = 'yes'
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if vars.get('L10NBASEDIR', ''):
vars['L10NBASEDIR'] = subprocess.check_output('cd $L10NBASEDIR && pwd -W', shell=True, env=vars).rstrip('\n')
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if (not vars.get('MOZ_TOOLS', '')):
sys.stderr.write('configure: error: MOZ_TOOLS is not set\n')
sys.exit(1)
vars['MOZ_TOOLS_DIR'] = subprocess.check_output('cd $MOZ_TOOLS && pwd -W', shell=True, env=vars).rstrip('\n')
if (format('{?}', vars, {}) != ('0' or (not format('{MOZ_TOOLS_DIR}', vars, {})))):
sys.stderr.write('configure: error: cd \\$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS\n')
sys.exit(1)
vars['MOZ_TOOLS_BIN_DIR'] = subprocess.check_output('cd "$MOZ_TOOLS_DIR/bin" && pwd', shell=True, env=vars).rstrip('\n')
if (subprocess.check_output('echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"', shell=True, env=vars).rstrip('\n') == '0'):
sys.stderr.write('configure: error: \\$MOZ_TOOLS\\\\bin must be in your path.\n')
sys.exit(1)
case = vars.get('host_os', '')
if (fnmatch.fnmatch(case, 'cygwin*') or fnmatch.fnmatch(case, 'msvc*') or fnmatch.fnmatch(case, 'mks*')):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'i*86-*'):
if vars.get('HAVE_64BIT_BUILD', ''):
sys.stderr.write('configure: error: You are targeting i386 but using the 64-bit compiler.\n')
sys.exit(1)
if vars.get('GNU_CC', ''):
vars['CFLAGS'] = format('{CFLAGS} -mstackrealign -fno-keep-inline-dllexport', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mstackrealign -fno-keep-inline-dllexport', vars, {})
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,--enable-stdcall-fixup -Wl,--large-address-aware', vars, {})
else:
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -MACHINE:X86', vars, {})
if (not vars.get('CLANG_CL', '')):
vars['LDFLAGS'] = format('{LDFLAGS} -SAFESEH', vars, {})
elif fnmatch.fnmatch(case, 'x86_64-*'):
if vars.get('_WIN32_MSVC', ''):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -MACHINE:X64', vars, {})
elif fnmatch.fnmatch(case, '*-netbsd*'):
vars['DSO_CFLAGS'] = ''
vars['CFLAGS'] = format('{CFLAGS} -Dunix', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -Dunix', vars, {})
if (not subprocess.call('$CC -E - -dM </dev/null | grep __ELF__ >/dev/null', shell=True, env=vars)):
vars['DLL_SUFFIX'] = '.so'
vars['DSO_PIC_CFLAGS'] = '-fPIC -DPIC'
vars['DSO_LDOPTS'] = '-shared'
vars['BIN_FLAGS'] = '-Wl,--export-dynamic'
else:
vars['DSO_PIC_CFLAGS'] = '-fPIC -DPIC'
vars['DLL_SUFFIX'] = '.so.1.0'
vars['DSO_LDOPTS'] = '-shared'
vars['MKSHLIB_FORCE_ALL'] = '-Wl,--whole-archive'
vars['MKSHLIB_UNFORCE_ALL'] = '-Wl,--no-whole-archive'
if vars.get('LIBRUNPATH', ''):
vars['DSO_LDOPTS'] = format('-Wl,-R{LIBRUNPATH} {DSO_LDOPTS}', vars, {})
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
elif fnmatch.fnmatch(case, '*-openbsd*'):
if vars.get('SO_VERSION', ''):
vars['DLL_SUFFIX'] = format('.so.{SO_VERSION}', vars, {})
else:
vars['DLL_SUFFIX'] = '.so.1.0'
vars['MOZ_FIX_LINK_PATHS'] = '-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib'
vars['DSO_CFLAGS'] = ''
vars['DSO_PIC_CFLAGS'] = '-fPIC'
vars['DSO_LDOPTS'] = '-shared -fPIC'
if vars.get('LIBRUNPATH', ''):
vars['DSO_LDOPTS'] = format('-R{LIBRUNPATH} {DSO_LDOPTS}', vars, {})
elif fnmatch.fnmatch(case, '*-solaris*'):
vars['TARGET_NSPR_MDCPUCFG'] = '\\"md/_solaris.cfg\\"'
vars['MOZ_FIX_LINK_PATHS'] = ''
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['LDFLAGS'] = format("{LDFLAGS} -z ignore -R '$$ORIGIN:$$ORIGIN/..' -z lazyload -z combreloc -z muldefs", vars, {})
vars['LIBS'] = format('-lCrun -lCstd -lc {LIBS}', vars, {})
vars['CFLAGS'] = format('{CFLAGS} -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef', vars, {})
vars['LDFLAGS'] = format('-xildoff {LDFLAGS}', vars, {})
vars['MMX_FLAGS'] = '-xarch=mmx -xO4'
vars['SSE_FLAGS'] = '-xarch=sse'
vars['SSE2_FLAGS'] = '-xarch=ssei2 -xO4'
if ((not vars.get('CROSS_COMPILE', '')) and os.path.isfile('/usr/lib/ld/map.noexstk')):
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('-M /usr/lib/ld/map.noexstk {LDFLAGS}', vars, {})
vars['MOZ_OPTIMIZE_FLAGS'] = '-xO4'
vars['MKSHLIB'] = '$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['MKCSHLIB'] = '$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $(DSO_SONAME) -o $@'
vars['MKSHLIB_FORCE_ALL'] = '-z allextract'
vars['MKSHLIB_UNFORCE_ALL'] = '-z defaultextract'
vars['DSO_LDOPTS'] = '-G'
vars['AR_LIST'] = format('{AR} t', vars, {})
vars['AR_EXTRACT'] = format('{AR} x', vars, {})
vars['AR_DELETE'] = format('{AR} d', vars, {})
vars['AR'] = '$(CXX) -xar'
vars['AR_FLAGS'] = '-o $@'
vars['AS'] = '/usr/ccs/bin/as'
vars['ASFLAGS'] = format('{ASFLAGS} -K PIC -L -P -D_ASM -D__STDC__=0', vars, {})
vars['AS_DASH_C_FLAG'] = ''
vars['TARGET_COMPILER_ABI'] = 'sunc'
vars['CC_VERSION'] = subprocess.check_output("$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\\: '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['CXX_VERSION'] = subprocess.check_output("$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\\: '{ print $2 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('configure: checking for Sun C++ compiler version >= 5.9\n')
if vars.get('_BAD_COMPILER', ''):
vars['_res'] = 'no'
sys.stderr.write('configure: error: Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .\n')
sys.exit(1)
else:
vars['_res'] = 'yes'
if vars.get('_ABOVE_SS12U1', ''):
vars['CXXFLAGS'] = format('{CXXFLAGS} -xannotate=no', vars, {})
sys.stdout.write('$_res\n')
else:
vars['LDFLAGS'] = format("{LDFLAGS} -Wl,-z,ignore -Wl,-R,'$$ORIGIN:$$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs", vars, {})
vars['LIBS'] = format('-lc {LIBS}', vars, {})
vars['MKSHLIB_FORCE_ALL'] = '-Wl,-z -Wl,allextract'
vars['MKSHLIB_UNFORCE_ALL'] = '-Wl,-z -Wl,defaultextract'
vars['ASFLAGS'] = format('{ASFLAGS} -fPIC', vars, {})
vars['DSO_LDOPTS'] = '-shared'
vars['WARNINGS_AS_ERRORS'] = '-Werror'
vars['_WARNINGS_CFLAGS'] = ''
vars['_WARNINGS_CXXFLAGS'] = ''
if (vars.get('OS_RELEASE', '') == '5.3'):
pass
if (vars.get('OS_RELEASE', '') == '5.5.1'):
pass
elif fnmatch.fnmatch(case, '*-sunos*'):
vars['DSO_LDOPTS'] = '-Bdynamic'
vars['MKSHLIB'] = '-$(LD) $(DSO_LDOPTS) -o $@'
vars['MKCSHLIB'] = '-$(LD) $(DSO_LDOPTS) -o $@'
case = subprocess.check_output('target_os', shell=True, env=vars).rstrip('\n')
if fnmatch.fnmatch(case, 'sunos4.1*'):
vars['DLL_SUFFIX'] = '.so.1.0'
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-*linux*'):
pass
if vars.get('MOZ_LINKER', ''):
pass
vars['NO_LD_ARCHIVE_FLAGS'] = ''
if ((not format('{MKSHLIB_FORCE_ALL}', vars, {})) or (not format('{MKSHLIB_UNFORCE_ALL}', vars, {}))):
vars['NO_LD_ARCHIVE_FLAGS'] = '1'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-aix4.3*') or fnmatch.fnmatch(case, '*-aix5*')):
vars['NO_LD_ARCHIVE_FLAGS'] = ''
elif fnmatch.fnmatch(case, '*-mingw*'):
if (not vars.get('GNU_CC', '')):
vars['NO_LD_ARCHIVE_FLAGS'] = ''
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-linux*') or fnmatch.fnmatch(case, '*-kfreebsd*-gnu') or fnmatch.fnmatch(case, '*-gnu*')):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
elif fnmatch.fnmatch(case, '*-solaris*'):
if (not vars.get('GNU_CC', '')):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
elif (not vars.get('GCC_USE_GNU_LD', '')):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
else:
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
elif fnmatch.fnmatch(case, '*-darwin*'):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
elif fnmatch.fnmatch(case, '*-mingw*'):
if vars.get('GNU_CC', ''):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = '-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
if (not vars.get('COMPILE_ENVIRONMENT', '')):
vars['SKIP_COMPILER_CHECKS'] = '1'
vars['SKIP_LIBRARY_CHECKS'] = '1'
if (not vars.get('SKIP_COMPILER_CHECKS', '')):
sys.stdout.write('configure: checking for ssize_t\n')
if (vars.get('ac_cv_type_ssize_t', '') == 'true'):
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
sys.stdout.write('configure: checking for siginfo_t\n')
if (vars.get('ac_cv_siginfo_t', '') == 'true'):
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
if (format('{GNU_CC}', vars, {}) and (format('{OS_TARGET}', vars, {}) != 'WINNT')):
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Darwin'):
vars['VISIBILITY_FLAGS'] = '-fvisibility=hidden'
else:
case = vars.get('GCC_VERSION', '')
if (fnmatch.fnmatch(case, '4.4*') or fnmatch.fnmatch(case, '4.6*')):
vars['VISIBILITY_FLAGS'] = '-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden_dso_handle.h'
else:
vars['VISIBILITY_FLAGS'] = '-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
vars['WRAP_SYSTEM_INCLUDES'] = '1'
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['VISIBILITY_FLAGS'] = '-xldscope=hidden'
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android')):
pass else:
vars['STL_FLAGS'] = '-I$(DIST)/stl_wrappers'
vars['WRAP_STL_INCLUDES'] = '1'
if (vars.get('OS_TARGET', '') != 'WINNT'):
pass
if vars.get('GNU_CC', ''):
vars['CFLAGS_save'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -Werror', vars, {})
vars['CFLAGS'] = vars.get('CFLAGS_save', '')
if (vars.get('ac_cv_force_align_arg_pointer', '') == 'yes'):
vars['HAVE_GCC_ALIGN_ARG_POINTER'] = '1'
else:
vars['HAVE_GCC_ALIGN_ARG_POINTER'] = ''
case = vars.get('target_os', '')
if (fnmatch.fnmatch(case, 'freebsd*') or fnmatch.fnmatch(case, 'openbsd*')):
vars['CPPFLAGS'] = format('{CPPFLAGS} {X_CFLAGS}', vars, {})
if (vars.get('ac_cv_sockaddr_in_sin_len', '') == 'true'):
pass
if (vars.get('ac_cv_sockaddr_in6_sin6_len', '') == 'true'):
pass
if (vars.get('ac_cv_sockaddr_sa_len', '') == 'true'):
pass
if (format('x{enable_dtrace}', vars, {}) == 'xyes'):
if vars.get('HAVE_DTRACE', ''):
pass
else:
sys.stderr.write('configure: error: dtrace enabled but sys/sdt.h not found\n')
sys.exit(1)
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-aix4.3*') or fnmatch.fnmatch(case, '*-aix5*')):
pass
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-hpux11.*'):
pass
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-darwin*'):
pass
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -D_GNU_SOURCE', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if (not vars.get('GNU_CXX', '')):
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-aix*'):
pass
vars['XLDFLAGS'] = vars.get('X_LIBS', '')
vars['XLIBS'] = vars.get('X_EXTRA_LIBS', '')
if (vars.get('no_x', '') == 'yes'):
pass
else:
vars['XLIBS'] = format('-lX11 {XLIBS}', vars, {})
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{XLDFLAGS} {LDFLAGS}', vars, {})
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'aix*'):
vars['XT_LIBS'] = format('-lXm {XT_LIBS}', vars, {})
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'darwin*'):
vars['MOZ_USE_PTHREADS'] = '1'
if (format('{MOZ_USE_PTHREADS}x', vars, {}) != 'x'):
subprocess.call('rm -f conftest*', shell=True, env=vars)
vars['ac_cv_have_dash_pthread'] = 'no'
sys.stdout.write('configure: checking whether ${CC-cc} accepts -pthread\n')
subprocess.call("echo 'int main() { return 0; }' | cat >conftest.c", shell=True, env=vars)
subprocess.call('${CC-cc} -pthread -o conftest conftest.c >conftest.out 2>&1', shell=True, env=vars)
if (vars.get('?', '') == '0'):
if ((not format('{cmd0}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthread", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')})) and (not format('{cmd1}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthread", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')}))):
vars['ac_cv_have_dash_pthread'] = 'yes'
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'freebsd*'):
pass else:
vars['CFLAGS'] = format('{CFLAGS} -pthread', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -pthread', vars, {})
subprocess.call('rm -f conftest*', shell=True, env=vars)
sys.stdout.write('$ac_cv_have_dash_pthread\n')
vars['ac_cv_have_dash_pthreads'] = 'no'
if (vars.get('ac_cv_have_dash_pthread', '') == 'no'):
sys.stdout.write('configure: checking whether ${CC-cc} accepts -pthreads\n')
subprocess.call("echo 'int main() { return 0; }' | cat >conftest.c", shell=True, env=vars)
subprocess.call('${CC-cc} -pthreads -o conftest conftest.c >conftest.out 2>&1', shell=True, env=vars)
if (vars.get('?', '') == '0'):
if ((not format('{cmd0}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')})) and (not format('{cmd1}', vars, {'cmd0':subprocess.check_output("egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads", shell=True, env=vars).rstrip('\n'), 'cmd1':subprocess.check_output("egrep -i '(error|incorrect)' conftest.out", shell=True, env=vars).rstrip('\n')}))):
vars['ac_cv_have_dash_pthreads'] = 'yes'
vars['CFLAGS'] = format('{CFLAGS} -pthreads', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -pthreads', vars, {})
subprocess.call('rm -f conftest*', shell=True, env=vars)
sys.stdout.write('$ac_cv_have_dash_pthreads\n')
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-*-freebsd*'):
if (vars.get('ac_cv_have_dash_pthread', '') == 'yes'):
vars['_PTHREAD_LDFLAGS'] = '-pthread'
elif (fnmatch.fnmatch(case, '*-*-openbsd*') or fnmatch.fnmatch(case, '*-*-bsdi*')):
if (vars.get('ac_cv_have_dash_pthread', '') == 'yes'):
vars['_PTHREAD_LDFLAGS'] = '-pthread'
elif (fnmatch.fnmatch(case, '*-*-linux*') or fnmatch.fnmatch(case, '*-*-kfreebsd*-gnu') or fnmatch.fnmatch(case, '*-*-gnu*')):
pass elif (fnmatch.fnmatch(case, '*-aix4.3*') or fnmatch.fnmatch(case, '*-aix5*')):
pass elif fnmatch.fnmatch(case, '*-hpux11.*'):
pass elif fnmatch.fnmatch(case, '*-*-solaris*'):
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['CFLAGS'] = format('{CFLAGS} -mt', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -mt', vars, {})
vars['LDFLAGS'] = format('{_PTHREAD_LDFLAGS} {LDFLAGS}', vars, {})
if (vars.get('ac_cv_clock_monotonic', '') != 'no'):
vars['HAVE_CLOCK_MONOTONIC'] = '1'
vars['REALTIME_LIBS'] = vars.get('ac_cv_clock_monotonic', '')
if (not ((not (not vars.get('MACOS_DEPLOYMENT_TARGET', ''))) or (not (vars.get('MACOS_DEPLOYMENT_TARGET', '') >= '100300')))):
if (vars.get('ac_cv_have_wcrtomb', '') == 'yes'):
pass
if (vars.get('ac_cv_have_mbrtowc', '') == 'yes'):
pass
if (vars.get('ac_cv_func_res_ninit', '') == 'yes'):
pass
vars['ICONV_LIBS'] = ''
case = vars.get('target_os', '')
if (fnmatch.fnmatch(case, 'darwin*') or fnmatch.fnmatch(case, 'mingw*')):
pass else:
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {ICONV_LIBS}', vars, {})
if (vars.get('ac_cv_func_iconv', '') == 'yes'):
vars['LIBICONV'] = vars.get('ICONV_LIBS', '')
if (vars.get('ac_cv_func_const_iconv', '') == 'yes'):
pass
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_va_copy}', vars, {}) == 'xyes'):
pass
if (format('x{ac_cv_va_val_copy}', vars, {}) == 'xno'):
pass
vars['ARM_ABI_PREFIX'] = ''
if vars.get('GNU_CC', ''):
if (vars.get('CPU_ARCH', '') == 'arm'):
if (vars.get('ac_cv_gcc_arm_eabi', '') == 'yes'):
vars['HAVE_ARM_EABI'] = '1'
vars['ARM_ABI_PREFIX'] = 'eabi-'
else:
vars['ARM_ABI_PREFIX'] = 'oabi-'
if (not vars.get('TARGET_COMPILER_ABI', '')):
vars['TARGET_COMPILER_ABI'] = format('{ARM_ABI_PREFIX}gcc3', vars, {})
if (vars.get('ac_cv_cpp_ambiguity_resolving_using', '') == 'yes'):
pass
if (vars.get('ac_cv_cpp_dynamic_cast_void_ptr', '') == 'yes'):
pass
if (vars.get('ac_cv_cpp_unused_required', '') == 'yes'):
pass
if (vars.get('ac_cv_trouble_comparing_to_zero', '') == 'yes'):
pass
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} {DSO_PIC_CFLAGS} {DSO_LDOPTS} {MOZ_OPTIMIZE_LDFLAGS}', vars, {})
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['MOZ_TLS'] = ''
if (format('{ac_cv_thread_keyword}', vars, {}) == ('yes' and (format('{MOZ_LINKER}', vars, {}) != '1'))):
case = vars.get('target', '')
if fnmatch.fnmatch(case, 'mips*-*'):
subprocess.call(':', shell=True, env=vars)
elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
subprocess.call(':', shell=True, env=vars)
elif fnmatch.fnmatch(case, '*-openbsd*'):
subprocess.call(':', shell=True, env=vars)
else:
vars['MOZ_TLS'] = '1'
if vars.get('MOZ_LINKER', ''):
if (vars.get('CPU_ARCH', '') == 'arm'):
if (not ((not vars.get('ARM_ARCH', '')) and (not (vars.get('ARM_ARCH', '') < '7')))):
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000', vars, {})
vars['_SUBDIR_LDFLAGS'] = format('{_SUBDIR_LDFLAGS} -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000', vars, {})
if (format('{MOZ_LINKER}', vars, {}) and (format('{OS_TARGET}', vars, {}) == 'Android')):
if (vars.get('ac_cv_crt_has_text_relocations', '') == 'yes'):
vars['DSO_LDOPTS'] = format('{DSO_LDOPTS} -nostartfiles', vars, {})
vars['NSPR_LDFLAGS'] = format('{NSPR_LDFLAGS} -nostartfiles', vars, {})
vars['MALLOC_HEADERS'] = 'malloc.h malloc_np.h malloc/malloc.h sys/malloc.h'
vars['MALLOC_H'] = ''
for file in for_loop(['{MALLOC_HEADERS}'], vars, {}):
vars['file'] = file
if (vars.get('MALLOC_H', '') != ''):
subprocess.call('break', shell=True, env=vars)
if (vars.get('ac_cv_i18n_lc_messages', '') == 'yes'):
pass
vars['TARGET_XPCOM_ABI'] = ''
if (format('{CPU_ARCH}', vars, {}) and format('{TARGET_COMPILER_ABI}', vars, {})):
vars['TARGET_XPCOM_ABI'] = format('{CPU_ARCH}-{TARGET_COMPILER_ABI}', vars, {})
if (vars.get('ac_cv_attribute_malloc', '') == 'yes'):
pass
if (vars.get('ac_cv_attribute_warn_unused', '') == 'yes'):
pass
if vars.get('SKIP_COMPILER_CHECKS', ''):
pass
vars['LIBXUL_DIST'] = format('{MOZ_BUILD_ROOT}/dist', vars, {})
if vars.get('LIBXUL_SDK', ''):
vars['GRE_MILESTONE'] = subprocess.check_output('$PYTHON "$_topsrcdir"/config/printconfigsetting.py "$LIBXUL_DIST"/bin/platform.ini Build Milestone', shell=True, env=vars).rstrip('\n')
else:
vars['GRE_MILESTONE'] = subprocess.check_output('tail -n 1 "$_topsrcdir"/config/milestone.txt 2>/dev/null || tail -1 "$_topsrcdir"/config/milestone.txt', shell=True, env=vars).rstrip('\n')
case = vars.get('GRE_MILESTONE', '')
if fnmatch.fnmatch(case, '*a1*'):
vars['NIGHTLY_BUILD'] = '1'
elif fnmatch.fnmatch(case, '*a*'):
pass else:
vars['RELEASE_BUILD'] = '1'
if (not vars.get('NIGHTLY_BUILD', '')):
vars['MOZ_DISABLE_UNIFIED_COMPILATION'] = '1'
if (not vars.get('NIGHTLY_BUILD', '')):
vars['E10S_TESTING_ONLY'] = '1'
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('LIBEVENT_DIR', '') == 'yes'):
pass
if ((not vars.get('LIBEVENT_DIR', '')) or (vars.get('LIBEVENT_DIR', '') == 'no')):
vars['MOZ_NATIVE_LIBEVENT'] = ''
elif (not vars.get('MOZ_NATIVE_LIBEVENT', '')):
vars['CFLAGS'] = format('-I{LIBEVENT_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{LIBEVENT_DIR}/lib {LDFLAGS}', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if vars.get('_USE_SYSTEM_NSS', ''):
pass
if vars.get('MOZ_NATIVE_NSS', ''):
vars['NSS_LIBS'] = format('{NSS_LIBS} -lcrmf', vars, {})
else:
vars['NSS_CFLAGS'] = '-I$(LIBXUL_DIST)/include/nss'
if ((not format('{GNU_CC}', vars, {})) and (format('{OS_ARCH}', vars, {}) == 'WINNT')):
vars['NSS_LIBS'] = format(' $(LIBXUL_DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)smime{NSS_VERSION}.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)ssl{NSS_VERSION}.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nss{NSS_VERSION}.$(LIB_SUFFIX) $(LIBXUL_DIST)/lib/$(LIB_PREFIX)nssutil{NSS_VERSION}.$(LIB_SUFFIX)', vars, {})
else:
vars['NSS_LIBS'] = format('-L$(LIBXUL_DIST)/lib -lcrmf -lsmime{NSS_VERSION} -lssl{NSS_VERSION} -lnss{NSS_VERSION} -lnssutil{NSS_VERSION}', vars, {})
sys.stdout.write('configure: checking for YASM assembler\n')
if vars.get('YASM', ''):
vars['YASM_VERSION'] = subprocess.check_output("yasm --version | $AWK '/^yasm/ { print $2 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_MAJOR_VERSION'] = subprocess.check_output("echo ${YASM_VERSION} | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_MINOR_VERSION'] = subprocess.check_output("echo ${YASM_VERSION} | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_RELEASE'] = subprocess.check_output(" echo ${YASM_VERSION} | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
vars['_YASM_BUILD'] = subprocess.check_output(" echo ${YASM_VERSION} | $AWK -F\\. '{ print $4 }'", shell=True, env=vars).rstrip('\n')
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('JPEG_DIR', '') and (vars.get('JPEG_DIR', '') != 'yes')):
vars['CFLAGS'] = format('-I{JPEG_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{JPEG_DIR}/lib {LDFLAGS}', vars, {})
if ((not vars.get('JPEG_DIR', '')) or (vars.get('JPEG_DIR', '') == 'no')):
vars['MOZ_NATIVE_JPEG'] = ''
if (vars.get('MOZ_NATIVE_JPEG', '') == '1'):
pass
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('{JPEG_DIR}', vars, {}) and (os.path.isdir(format('{JPEG_DIR}', vars, {})) and (format('{MOZ_NATIVE_JPEG}', vars, {}) == '1'))):
vars['MOZ_JPEG_CFLAGS'] = format('-I{JPEG_DIR}/include', vars, {})
vars['MOZ_JPEG_LIBS'] = format('-L{JPEG_DIR}/lib {MOZ_JPEG_LIBS}', vars, {})
if (format('{MOZ_LINKER}', vars, {}) == ('1' and (format('{MOZ_NATIVE_ZLIB}', vars, {}) != '1'))):
sys.stderr.write('configure: error: Custom dynamic linker requires --with-system-zlib\n')
sys.exit(1)
vars['MOZ_PNG_ARM_NEON'] = ''
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('BZ2_DIR', '') and (vars.get('BZ2_DIR', '') != 'yes')):
vars['CFLAGS'] = format('-I{BZ2_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{BZ2_DIR}/lib {LDFLAGS}', vars, {})
if ((not vars.get('BZ2_DIR', '')) or (vars.get('BZ2_DIR', '') == 'no')):
vars['MOZ_NATIVE_BZ2'] = ''
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('{BZ2_DIR}', vars, {}) and (os.path.isdir(format('{BZ2_DIR}', vars, {})) and (format('{MOZ_NATIVE_BZ2}', vars, {}) == '1'))):
vars['MOZ_BZ2_CFLAGS'] = format('-I{BZ2_DIR}/include', vars, {})
vars['MOZ_BZ2_LIBS'] = format('-L{BZ2_DIR}/lib {MOZ_BZ2_LIBS}', vars, {})
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if (vars.get('PNG_DIR', '') and (vars.get('PNG_DIR', '') != 'yes')):
vars['CFLAGS'] = format('-I{PNG_DIR}/include {CFLAGS}', vars, {})
vars['LDFLAGS'] = format('-L{PNG_DIR}/lib {LDFLAGS}', vars, {})
if ((not vars.get('PNG_DIR', '')) or (vars.get('PNG_DIR', '') == 'no')):
vars['MOZ_NATIVE_PNG'] = ''
if (vars.get('MOZ_NATIVE_PNG', '') == '1'):
pass
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('{PNG_DIR}', vars, {}) and (os.path.isdir(format('{PNG_DIR}', vars, {})) and (format('{MOZ_NATIVE_PNG}', vars, {}) == '1'))):
vars['MOZ_PNG_CFLAGS'] = format('-I{PNG_DIR}/include', vars, {})
vars['MOZ_PNG_LIBS'] = format('-L{PNG_DIR}/lib {MOZ_PNG_LIBS}', vars, {})
vars['MOZ_PNG_ARM_NEON_CHECK'] = ''
if (format('{MOZ_NATIVE_PNG}', vars, {}) != ('1' and (format('{CPU_ARCH}', vars, {}) == 'arm'))):
case = vars.get('MOZ_PNG_ARM_NEON_SUPPORT', '')
if fnmatch.fnmatch(case, 'no'):
pass elif fnmatch.fnmatch(case, 'nocheck'):
vars['MOZ_PNG_ARM_NEON'] = '1'
else:
vars['MOZ_PNG_ARM_NEON'] = '1'
vars['MOZ_PNG_ARM_NEON_CHECK'] = '1'
if args.system_hunspell:
vars['MOZ_NATIVE_HUNSPELL'] = '1'
if vars.get('MOZ_NATIVE_HUNSPELL', ''):
pass
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['JS_SHARED_LIBRARY'] = '1'
if args.shared_js:
vars['JS_SHARED_LIBRARY'] = '1'
else:
vars['JS_SHARED_LIBRARY'] = ''
vars['JAVA_BIN_PATH'] = ''
vars['ENABLE_TESTS'] = '1'
vars['ENABLE_SYSTEM_EXTENSION_DIRS'] = '1'
vars['MOZ_BRANDING_DIRECTORY'] = ''
vars['MOZ_OFFICIAL_BRANDING'] = ''
vars['MOZ_FEEDS'] = '1'
vars['MOZ_WEBAPP_RUNTIME'] = ''
vars['MOZ_AUTH_EXTENSION'] = '1'
vars['MOZ_RAW'] = ''
vars['MOZ_VORBIS'] = ''
vars['MOZ_TREMOR'] = ''
vars['MOZ_WAVE'] = '1'
vars['MOZ_SAMPLE_TYPE_FLOAT32'] = ''
vars['MOZ_SAMPLE_TYPE_S16'] = ''
vars['MOZ_OPUS'] = '1'
vars['MOZ_WEBM'] = '1'
vars['MOZ_GSTREAMER'] = ''
vars['MOZ_DIRECTSHOW'] = ''
vars['MOZ_WMF'] = ''
vars['MOZ_FMP4'] = ''
vars['MOZ_EME'] = '1'
vars['MOZ_FFMPEG'] = ''
vars['MOZ_WEBRTC'] = '1'
vars['MOZ_PEERCONNECTION'] = ''
vars['MOZ_SRTP'] = ''
vars['MOZ_WEBRTC_SIGNALING'] = ''
vars['MOZ_WEBRTC_ASSERT_ALWAYS'] = '1'
vars['MOZ_SCTP'] = ''
vars['MOZ_ANDROID_OMX'] = ''
vars['MOZ_MEDIA_NAVIGATOR'] = ''
vars['MOZ_OMX_PLUGIN'] = ''
vars['MOZ_VPX'] = ''
vars['MOZ_VPX_ERROR_CONCEALMENT'] = ''
vars['MOZ_WEBSPEECH'] = '1'
vars['VPX_AS'] = ''
vars['VPX_ASFLAGS'] = ''
vars['VPX_AS_DASH_C_FLAG'] = ''
vars['VPX_AS_CONVERSION'] = ''
vars['VPX_ASM_SUFFIX'] = ''
vars['VPX_X86_ASM'] = ''
vars['VPX_ARM_ASM'] = ''
vars['LIBJPEG_TURBO_AS'] = ''
vars['LIBJPEG_TURBO_ASFLAGS'] = ''
vars['LIBJPEG_TURBO_X86_ASM'] = ''
vars['LIBJPEG_TURBO_X64_ASM'] = ''
vars['LIBJPEG_TURBO_ARM_ASM'] = ''
vars['MOZ_PERMISSIONS'] = '1'
vars['MOZ_PLACES'] = '1'
vars['MOZ_SOCIAL'] = '1'
vars['MOZ_PREF_EXTENSIONS'] = '1'
vars['MOZ_PROFILELOCKING'] = '1'
vars['MOZ_REFLOW_PERF'] = ''
vars['MOZ_SAFE_BROWSING'] = ''
vars['MOZ_HELP_VIEWER'] = ''
vars['MOZ_SPELLCHECK'] = '1'
vars['MOZ_ANDROID_OMTC'] = ''
vars['MOZ_TOOLKIT_SEARCH'] = '1'
vars['MOZ_UI_LOCALE'] = 'en-US'
vars['MOZ_UNIVERSALCHARDET'] = '1'
vars['MOZ_URL_CLASSIFIER'] = ''
vars['MOZ_XUL'] = '1'
vars['MOZ_ZIPWRITER'] = '1'
vars['NS_PRINTING'] = '1'
vars['MOZ_PDF_PRINTING'] = ''
vars['MOZ_DISABLE_CRYPTOLEGACY'] = ''
vars['NSS_DISABLE_DBM'] = ''
vars['NECKO_COOKIES'] = '1'
vars['NECKO_PROTOCOLS_DEFAULT'] = 'about app data file ftp http res viewsource websocket wyciwyg device'
if vars.get('MOZ_RTSP', ''):
vars['NECKO_PROTOCOLS_DEFAULT'] = format('{NECKO_PROTOCOLS_DEFAULT} rtsp', vars, {})
vars['USE_ARM_KUSER'] = ''
vars['BUILD_CTYPES'] = '1'
vars['MOZ_USE_NATIVE_POPUP_WINDOWS'] = ''
vars['MOZ_ANDROID_HISTORY'] = ''
vars['MOZ_WEBSMS_BACKEND'] = ''
vars['MOZ_ANDROID_BEAM'] = ''
vars['MOZ_LOCALE_SWITCHER'] = ''
vars['MOZ_ANDROID_SEARCH_ACTIVITY'] = ''
vars['MOZ_ANDROID_MLS_STUMBLER'] = ''
vars['ACCESSIBILITY'] = '1'
vars['MOZ_TIME_MANAGER'] = ''
vars['MOZ_PAY'] = ''
vars['MOZ_AUDIO_CHANNEL_MANAGER'] = ''
vars['NSS_NO_LIBPKIX'] = ''
vars['MOZ_CONTENT_SANDBOX'] = ''
vars['MOZ_GMP_SANDBOX'] = ''
vars['JSGC_USE_EXACT_ROOTING'] = '1'
vars['JSGC_GENERATIONAL'] = ''
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'mingw*'):
vars['NS_ENABLE_TSF'] = '1'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
if (vars.get('CPU_ARCH', '') == 'arm'):
vars['USE_ARM_KUSER'] = '1'
vars['NSS_DISABLE_DBM'] = '1'
vars['MOZ_THEME_FASTSTRIPE'] = '1'
vars['MOZ_TREE_FREETYPE'] = '1'
vars['MOZ_MEMORY'] = '1'
vars['MOZ_RAW'] = '1'
if (not vars.get('XULRUNNER_STUB_NAME', '')):
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, 'darwin*'):
vars['XULRUNNER_STUB_NAME'] = 'xulrunner'
else:
vars['XULRUNNER_STUB_NAME'] = 'xulrunner-stub'
sys.stdout.write('configure: checking for application to build\n')
if (not vars.get('MOZ_BUILD_APP', '')):
sys.stdout.write('browser\n')
vars['MOZ_BUILD_APP'] = 'browser'
else:
if (vars.get('MOZ_BUILD_APP', '') == 'mobile'):
sys.stdout.write('none\n')
sys.stderr.write('configure: error: --enable-application=mobile is no longer supported.\n')
sys.exit(1)
if (not os.path.isfile(format('{srcdir}/{MOZ_BUILD_APP}/build.mk', vars, {}))):
sys.stdout.write('none\n')
sys.stderr.write('configure: error: --enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).\n')
sys.exit(1)
else:
sys.stdout.write('$MOZ_BUILD_APP\n')
if (not vars.get('MOZ_UPDATE_CHANNEL', '')):
vars['MOZ_UPDATE_CHANNEL'] = 'default'
if (not vars.get('MOZ_MOZILLA_API_KEY', '')):
vars['MOZ_MOZILLA_API_KEY'] = 'no-mozilla-api-key'
if (not vars.get('MOZ_GOOGLE_API_KEY', '')):
vars['MOZ_GOOGLE_API_KEY'] = 'no-google-api-key'
if (not vars.get('MOZ_BING_API_CLIENTID', '')):
vars['MOZ_BING_API_CLIENTID'] = 'no-bing-api-clientid'
vars['MOZ_BING_API_KEY'] = 'no-bing-api-key'
sys.stdout.write('configure: checking if app-specific confvars.sh exists\n')
if os.path.isfile(format('{srcdir}/{MOZ_BUILD_APP}/confvars.sh', vars, {})):
sys.stdout.write('${srcdir}/${MOZ_BUILD_APP}/confvars.sh\n')
subprocess.call(format('. {srcdir}/{MOZ_BUILD_APP}/confvars.sh', vars, {}), shell=True, env=vars)
else:
sys.stdout.write('no\n')
subprocess.call(format('. {srcdir}/build/defines.sh', vars, {}), shell=True, env=vars)
if vars.get('BUILDING_RELEASE', ''):
vars['EARLY_BETA_OR_EARLIER'] = ''
elif vars.get('EARLY_BETA_OR_EARLIER', ''):
pass
if os.path.isfile(format('{srcdir}/{MOZ_BUILD_APP}/configure.in', vars, {})):
pass
if vars.get('WITH_APP_NAME', ''):
vars['MOZ_APP_NAME'] = vars.get('WITH_APP_NAME', '')
if vars.get('WITH_APP_BASENAME', ''):
vars['MOZ_APP_BASENAME'] = vars.get('WITH_APP_BASENAME', '')
case = vars.get('MOZ_BUILD_APP', '')
if fnmatch.fnmatch(case, 'xulrunner'):
if vars.get('LIBXUL_SDK', ''):
sys.stderr.write("configure: error: Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.\n")
sys.exit(1)
case = vars.get('MOZ_BUILD_APP', '')
if fnmatch.fnmatch(case, 'browser'):
pass elif fnmatch.fnmatch(case, 'xulrunner'):
pass elif fnmatch.fnmatch(case, 'b2g'):
pass elif fnmatch.fnmatch(case, 'b2g/dev'):
pass
if (not vars.get('gonkdir', '')):
case = vars.get('MOZ_BUILD_APP', '')
if fnmatch.fnmatch(case, 'mobile/android'):
vars['android_min_api_level'] = '17'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
subprocess.call(':', shell=True, env=vars)
else:
sys.stderr.write('configure: 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\n')
sys.exit(1)
if (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-windows' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-gtk2' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-gtk2-x11' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-gtk3' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-qt' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-cocoa' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-uikit' or (vars.get('_DEFAULT_TOOLKIT', '') == ('cairo-android' or (vars.get('_DEFAULT_TOOLKIT', '') == 'cairo-gonk'))))))))))))))))):
vars['MOZ_WIDGET_TOOLKIT'] = subprocess.check_output('echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"', shell=True, env=vars).rstrip('\n')
else:
sys.stderr.write('configure: error: You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).\n')
sys.exit(1)
vars['MOZ_WIDGET_GTK'] = ''
case = vars.get('MOZ_WIDGET_TOOLKIT', '')
if fnmatch.fnmatch(case, 'cairo-windows'):
vars['MOZ_WIDGET_TOOLKIT'] = 'windows'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
if vars.get('GNU_CC', ''):
vars['MOZ_FOLD_LIBS'] = ''
elif fnmatch.fnmatch(case, 'cairo-gtk3'):
vars['MOZ_WIDGET_TOOLKIT'] = 'gtk3'
vars['MOZ_ENABLE_GTK'] = '1'
vars['MOZ_ENABLE_GTK3'] = '1'
vars['MOZ_ENABLE_XREMOTE'] = '1'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_GL_DEFAULT_PROVIDER'] = 'GLX'
vars['MOZ_X11'] = '1'
vars['USE_FC_FREETYPE'] = '1'
vars['TK_CFLAGS'] = '$(MOZ_GTK3_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_GTK3_LIBS)'
vars['MOZ_WIDGET_GTK'] = '3'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif (fnmatch.fnmatch(case, 'cairo-gtk2') or fnmatch.fnmatch(case, 'cairo-gtk2-x11')):
vars['MOZ_WIDGET_TOOLKIT'] = 'gtk2'
vars['MOZ_ENABLE_GTK'] = '1'
vars['MOZ_ENABLE_GTK2'] = '1'
vars['MOZ_ENABLE_XREMOTE'] = '1'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_GL_DEFAULT_PROVIDER'] = 'GLX'
vars['MOZ_X11'] = '1'
vars['USE_FC_FREETYPE'] = '1'
vars['TK_CFLAGS'] = '$(MOZ_GTK2_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_GTK2_LIBS)'
vars['MOZ_WIDGET_GTK'] = '2'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif fnmatch.fnmatch(case, 'cairo-qt'):
vars['MOZ_WIDGET_TOOLKIT'] = 'qt'
vars['MOZ_ENABLE_QT'] = '1'
if (not vars.get('WITHOUT_X11', '')):
vars['MOZ_ENABLE_XREMOTE'] = '1'
vars['MOZ_GL_DEFAULT_PROVIDER'] = 'GLX'
vars['MOZ_X11'] = '1'
vars['XT_LIBS'] = ''
vars['MOZ_WEBGL'] = '1'
vars['USE_FC_FREETYPE'] = '1'
vars['TK_CFLAGS'] = '$(MOZ_QT_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_QT_LIBS)'
vars['MOZ_PDF_PRINTING'] = '1'
elif fnmatch.fnmatch(case, 'cairo-cocoa'):
vars['MOZ_WIDGET_TOOLKIT'] = 'cocoa'
vars['LDFLAGS'] = format('{LDFLAGS} -framework Cocoa -lobjc', vars, {})
vars['TK_LIBS'] = '-Wl,-framework,CoreLocation -Wl,-framework,QuartzCore -Wl,-framework,Carbon -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,AddressBook -Wl,-framework,OpenGL'
vars['TK_CFLAGS'] = '-DNO_X11'
vars['CFLAGS'] = format('{CFLAGS} {TK_CFLAGS}', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} {TK_CFLAGS}', vars, {})
vars['MOZ_USER_DIR'] = 'Mozilla'
vars['MOZ_FS_LAYOUT'] = 'bundle'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif fnmatch.fnmatch(case, 'cairo-uikit'):
vars['MOZ_WIDGET_TOOLKIT'] = 'uikit'
vars['LDFLAGS'] = format('{LDFLAGS} -framework UIKit -lobjc', vars, {})
vars['TK_CFLAGS'] = '-DNO_X11'
vars['TK_LIBS'] = '-Wl,-framework,Foundation -Wl,-framework,CoreFoundation -Wl,-framework,CoreGraphics -Wl,-framework,CoreText'
vars['CFLAGS'] = format('{CFLAGS} {TK_CFLAGS}', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} {TK_CFLAGS}', vars, {})
vars['MOZ_USER_DIR'] = 'Mozilla'
vars['MOZ_FS_LAYOUT'] = 'bundle'
elif fnmatch.fnmatch(case, 'cairo-android'):
vars['MOZ_WIDGET_TOOLKIT'] = 'android'
vars['TK_CFLAGS'] = '$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
elif fnmatch.fnmatch(case, 'cairo-gonk'):
vars['MOZ_WIDGET_TOOLKIT'] = 'gonk'
vars['TK_CFLAGS'] = '$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
vars['TK_LIBS'] = '$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
vars['MOZ_WEBGL'] = '1'
vars['MOZ_PDF_PRINTING'] = '1'
vars['MOZ_TOUCH'] = '1'
vars['MOZ_INSTRUMENT_EVENT_LOOP'] = '1'
if vars.get('MOZ_PDF_PRINTING', ''):
vars['PDF_SURFACE_FEATURE'] = '#define CAIRO_HAS_PDF_SURFACE 1'
if vars.get('MOZ_ENABLE_XREMOTE', ''):
pass
if vars.get('MOZ_INSTRUMENT_EVENT_LOOP', ''):
pass
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('MOZ_ENABLE_GTK3', ''):
vars['MOZ_GTK3_CFLAGS'] = format('-I{_topsrcdir}/widget/gtk/compat-gtk3 {MOZ_GTK3_CFLAGS}', vars, {})
if vars.get('MOZ_ENABLE_GTK', ''):
if vars.get('MOZ_X11', ''):
vars['GDK_PACKAGES'] = 'gdk-x11-2.0'
vars['MOZ_GTK2_CFLAGS'] = format('-I{_topsrcdir}/widget/gtk/compat {MOZ_GTK2_CFLAGS}', vars, {})
if vars.get('USE_ARM_KUSER', ''):
pass
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_ENABLE_STARTUP_NOTIFICATION'] = ''
if args.startup_notification:
vars['MOZ_ENABLE_STARTUP_NOTIFICATION'] = 'force'
else:
vars['MOZ_ENABLE_STARTUP_NOTIFICATION'] = ''
if vars.get('MOZ_ENABLE_STARTUP_NOTIFICATION', ''):
pass
if vars.get('MOZ_ENABLE_STARTUP_NOTIFICATION', ''):
pass
vars['TK_LIBS'] = format('{TK_LIBS} {MOZ_STARTUP_NOTIFICATION_LIBS}', vars, {})
if vars.get('NS_PRINTING', ''):
pass
if vars.get('MOZ_ENABLE_QT', ''):
if (not vars.get('QTDIR', '')):
pass
else:
vars['HOST_QMAKE'] = format('{QTDIR}/bin/qmake', vars, {})
vars['QT_VERSION'] = subprocess.check_output("$HOST_QMAKE -v | grep 'Using Qt version' | egrep -o '[0-9]+\\.[0-9]+\\.[0-9]+'", shell=True, env=vars).rstrip('\n')
if (not vars.get('QTDIR', '')):
case = vars.get('QT_VERSION', '')
if fnmatch.fnmatch(case, '5.*'):
sys.stdout.write('"Using qt5: $QT_VERSION"\n')
vars['QT5INCDIR'] = subprocess.check_output('pkg-config --variable=includedir Qt5Gui', shell=True, env=vars).rstrip('\n')
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QT5INCDIR}/QtGui/{QT_VERSION}/QtGui', vars, {})
if vars.get('NS_PRINTING', ''):
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {MOZ_QT_WIDGETS_LIBS}', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {MOZ_QT_WIDGETS_CFLAGS}', vars, {})
else:
sys.stderr.write('configure: error: * * * Unsupported Qt Version: $QT_VERSION\n')
sys.exit(1)
else:
vars['MOZ_QT_CFLAGS'] = '-DQT_SHARED'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtGui', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtCore', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtNetwork', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtXml', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtDeclarative', vars, {})
case = vars.get('QT_VERSION', '')
if fnmatch.fnmatch(case, '5.*'):
sys.stdout.write('"Using qt5: $QT_VERSION"\n')
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} -L{QTDIR}/lib/ -lQt5Gui -lQt5Network -lQt5Core -lQt5Xml', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtGui/{QT_VERSION}/QtGui', vars, {})
if vars.get('NS_PRINTING', ''):
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} -lQt5Widgets -lQt5PrintSupport', vars, {})
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} -I{QTDIR}/include/QtPrintSupport', vars, {})
else:
sys.stderr.write('configure: error: * * * Unsupported Qt Version: $QT_VERSION\n')
sys.exit(1)
vars['HOST_MOC'] = format('{QTDIR}/bin/moc', vars, {})
vars['HOST_RCC'] = format('{QTDIR}/bin/rcc', vars, {})
if (not vars.get('HOST_MOC', '')):
sys.stderr.write('configure: error: No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is incorrect\n')
sys.exit(1)
if (not vars.get('HOST_RCC', '')):
sys.stderr.write('configure: error: No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is incorrect\n')
sys.exit(1)
vars['MOC'] = vars.get('HOST_MOC', '')
vars['RCC'] = vars.get('HOST_RCC', '')
vars['MOZ_ENABLE_QMSYSTEM2'] = ''
if vars.get('MOZ_ENABLE_QMSYSTEM2', ''):
vars['MOZ_ENABLE_QMSYSTEM2'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QMSYSTEM2_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QMSYSTEM2_LIBS}', vars, {})
vars['MOZ_ENABLE_QTNETWORK'] = ''
if vars.get('MOZ_ENABLE_QTNETWORK', ''):
vars['MOZ_ENABLE_QTNETWORK'] = '1'
vars['MOZ_ENABLE_QTMOBILITY'] = ''
if vars.get('MOZ_ENABLE_QTMOBILITY', ''):
vars['MOZ_ENABLE_QTMOBILITY'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QTMOBILITY_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QTMOBILITY_LIBS}', vars, {})
vars['MOZ_ENABLE_QT5FEEDBACK'] = ''
if vars.get('MOZ_ENABLE_QT5FEEDBACK', ''):
vars['MOZ_ENABLE_QT5FEEDBACK'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QT5FEEDBACK_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QT5FEEDBACK_LIBS}', vars, {})
vars['MOZ_ENABLE_QT5GEOPOSITION'] = ''
if vars.get('MOZ_ENABLE_QT5GEOPOSITION', ''):
vars['MOZ_ENABLE_QT5GEOPOSITION'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_QT5GEOPOSITION_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_QT5GEOPOSITION_LIBS}', vars, {})
if vars.get('MOZ_ENABLE_CONTENTACTION', ''):
vars['MOZ_ENABLE_CONTENTACTION'] = '1'
vars['MOZ_ENABLE_CONTENTACTION'] = ''
if vars.get('MOZ_ENABLE_CONTENTACTION', ''):
vars['MOZ_ENABLE_CONTENTACTION'] = '1'
vars['MOZ_QT_CFLAGS'] = format('{MOZ_QT_CFLAGS} {_CONTENTACTION_CFLAGS}', vars, {})
vars['MOZ_QT_LIBS'] = format('{MOZ_QT_LIBS} {_CONTENTACTION_LIBS}', vars, {})
if args.official_branding:
if (not vars.get('MOZ_OFFICIAL_BRANDING_DIRECTORY', '')):
sys.stderr.write('configure: error: You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.\n')
sys.exit(1)
else:
vars['MOZ_BRANDING_DIRECTORY'] = vars.get('MOZ_OFFICIAL_BRANDING_DIRECTORY', '')
vars['MOZ_OFFICIAL_BRANDING'] = '1'
else:
vars['MOZ_OFFICIAL_BRANDING'] = ''
if vars.get('MOZ_OFFICIAL_BRANDING', ''):
pass
vars['REAL_BRANDING_DIRECTORY'] = vars.get('MOZ_BRANDING_DIRECTORY', '')
if (not vars.get('REAL_BRANDING_DIRECTORY', '')):
vars['REAL_BRANDING_DIRECTORY'] = format('{MOZ_BUILD_APP}/branding/nightly', vars, {})
if os.path.isfile(format('{_topsrcdir}/{REAL_BRANDING_DIRECTORY}/configure.sh', vars, {})):
subprocess.call(format('. {_topsrcdir}/{REAL_BRANDING_DIRECTORY}/configure.sh', vars, {}), shell=True, env=vars)
if (not vars.get('MOZ_DISTRIBUTION_ID', '')):
vars['MOZ_DISTRIBUTION_ID'] = 'org.mozilla'
if (format('{MOZ_ENABLE_GTK}', vars, {}) or format('{MOZ_ENABLE_QT}', vars, {})):
pass
if vars.get('MOZ_X11', ''):
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_ENABLE_GIO'] = '1'
vars['MOZ_ENABLE_GCONF'] = '1'
if args.gnomevfs:
vars['MOZ_ENABLE_GNOMEVFS'] = 'force'
else:
vars['MOZ_ENABLE_GNOMEVFS'] = ''
if vars.get('MOZ_ENABLE_GNOMEVFS', ''):
pass
if (format('{MOZ_ENABLE_GIO}', vars, {}) and format('{MOZ_ENABLE_GTK}', vars, {})):
if vars.get('MOZ_ENABLE_GTK2', ''):
pass
if vars.get('MOZ_ENABLE_GCONF', ''):
pass
if vars.get('MOZ_ENABLE_GCONF', ''):
pass
if (format('{MOZ_ENABLE_GTK}', vars, {}) or format('{MOZ_ENABLE_QT}', vars, {})):
vars['MOZ_ENABLE_LIBPROXY'] = ''
if args.libproxy:
vars['MOZ_ENABLE_LIBPROXY'] = '1'
else:
vars['MOZ_ENABLE_LIBPROXY'] = ''
if vars.get('MOZ_ENABLE_LIBPROXY', ''):
pass
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_ENABLE_GNOME_COMPONENT'] = '1'
if vars.get('MOZ_ENABLE_GTK', ''):
if args.gnomeui:
vars['MOZ_ENABLE_GNOMEUI'] = 'force'
else:
vars['MOZ_ENABLE_GNOMEUI'] = ''
if vars.get('MOZ_ENABLE_GNOMEUI', ''):
pass
if vars.get('MOZ_ENABLE_GNOMEUI', ''):
pass
if (format('{MOZ_ENABLE_GTK}', vars, {}) or format('{MOZ_ENABLE_QT}', vars, {})):
vars['MOZ_ENABLE_DBUS'] = '1'
if vars.get('MOZ_ENABLE_DBUS', ''):
pass
if vars.get('MOZ_ANDROID_HISTORY', ''):
if (not vars.get('MOZ_PLACES', '')):
pass
else:
sys.stderr.write('configure: error: Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.\n')
sys.exit(1)
if vars.get('MOZ_ANDROID_OMTC', ''):
pass
if vars.get('MOZ_WEBSMS_BACKEND', ''):
pass
if vars.get('MOZ_LOCALE_SWITCHER', ''):
pass
if vars.get('MOZ_ANDROID_BEAM', ''):
pass
if vars.get('MOZ_ANDROID_SEARCH_ACTIVITY', ''):
pass
if vars.get('MOZ_ANDROID_MLS_STUMBLER', ''):
pass
vars['MOZ_IPDL_TESTS'] = ''
if args.ipdl_tests:
vars['MOZ_IPDL_TESTS'] = '1'
else:
vars['MOZ_IPDL_TESTS'] = ''
if vars.get('MOZ_IPDL_TESTS', ''):
pass
if vars.get('ACCESSIBILITY', ''):
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if (not vars.get('MIDL', '')):
if (vars.get('GCC', '') != 'yes'):
sys.stderr.write('configure: error: MIDL could not be found. Building accessibility without MIDL is not supported.\n')
sys.exit(1)
else:
sys.stderr.write('configure: 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.\n')
sys.exit(1)
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('linuxgl' and (format('{ACCESSIBILITY}', vars, {}) != '1'))):
sys.stderr.write('configure: error: "Accessibility is required for the linuxgl widget backend"\n')
sys.exit(1)
if vars.get('MOZ_WEBRTC', ''):
case = vars.get('target', '')
if (fnmatch.fnmatch(case, '*-linux*') or fnmatch.fnmatch(case, '*-mingw*') or fnmatch.fnmatch(case, '*-darwin*') or fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*') or fnmatch.fnmatch(case, '*-dragonfly*') or fnmatch.fnmatch(case, '*-freebsd*') or fnmatch.fnmatch(case, '*-netbsd*') or fnmatch.fnmatch(case, '*-openbsd*')):
pass else:
vars['MOZ_WEBRTC'] = ''
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'arm') or fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'ppc*') or fnmatch.fnmatch(case, 'ia64')):
subprocess.call(':', shell=True, env=vars)
else:
vars['MOZ_WEBRTC'] = ''
if vars.get('MOZ_WEBRTC', ''):
vars['MOZ_RAW'] = '1'
vars['MOZ_VPX'] = '1'
vars['MOZ_VPX_ERROR_CONCEALMENT'] = '1'
vars['MOZ_WEBRTC_SIGNALING'] = '1'
vars['MOZ_PEERCONNECTION'] = '1'
vars['MOZ_SCTP'] = '1'
vars['MOZ_SRTP'] = '1'
if vars.get('MOZ_X11', ''):
vars['MOZ_WEBRTC_X11_LIBS'] = '-lXext -lXdamage -lXfixes -lXcomposite'
else:
vars['MOZ_SYNTH_PICO'] = ''
if (format('{OS_TARGET}', vars, {}) == ('Android' or (format('{CPU_ARCH}', vars, {}) == 'arm'))):
vars['MOZ_SAMPLE_TYPE_S16'] = '1'
else:
vars['MOZ_SAMPLE_TYPE_FLOAT32'] = '1'
if vars.get('MOZ_WEBSPEECH', ''):
pass
if args.raw:
vars['MOZ_RAW'] = '1'
else:
vars['MOZ_RAW'] = ''
if vars.get('MOZ_RAW', ''):
pass
if (vars.get('ac_cv_c_attribute_aligned', '') != '0'):
pass
if vars.get('MOZ_WEBM', ''):
vars['MOZ_VPX'] = '1'
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'cocoa'):
vars['MOZ_APPLEMEDIA'] = '1'
if vars.get('MOZ_APPLEMEDIA', ''):
vars['LDFLAGS'] = format('{LDFLAGS} -framework AudioToolbox', vars, {})
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['MOZ_DIRECTSHOW'] = '1'
if vars.get('MOZ_DIRECTSHOW', ''):
pass
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['MOZ_WMF'] = '1'
if vars.get('MOZ_WMF', ''):
pass
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android')):
pass else:
vars['MOZ_FFMPEG'] = '1'
if vars.get('MOZ_FFMPEG', ''):
pass
if (format('{MOZ_WMF}', vars, {}) or (format('{MOZ_FFMPEG}', vars, {}) or format('{MOZ_APPLEMEDIA}', vars, {}))):
vars['MOZ_FMP4'] = '1'
if vars.get('MOZ_FMP4', ''):
pass
if vars.get('MOZ_EME', ''):
pass
if (format('{OS_TARGET}', vars, {}) == ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk'))):
vars['MOZ_ANDROID_OMX'] = '1'
if args.android_omx:
vars['MOZ_ANDROID_OMX'] = '1'
else:
vars['MOZ_ANDROID_OMX'] = ''
if vars.get('MOZ_ANDROID_OMX', ''):
pass
if args.media_navigator:
vars['MOZ_MEDIA_NAVIGATOR'] = '1'
else:
vars['MOZ_MEDIA_NAVIGATOR'] = ''
if vars.get('MOZ_MEDIA_NAVIGATOR', ''):
pass
if (format('{OS_TARGET}', vars, {}) == ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk'))):
vars['MOZ_OMX_PLUGIN'] = '1'
if args.omx_plugin:
vars['MOZ_OMX_PLUGIN'] = '1'
else:
vars['MOZ_OMX_PLUGIN'] = ''
if vars.get('MOZ_OMX_PLUGIN', ''):
if (vars.get('OS_TARGET', '') == 'Android'):
pass
else:
sys.stderr.write('configure: error: OMX media plugin can only be built on B2G or Android\n')
sys.exit(1)
vars['MOZ_LIBVPX_CFLAGS'] = ''
vars['MOZ_LIBVPX_LIBS'] = ''
if vars.get('MOZ_VPX', ''):
if vars.get('MOZ_VPX_ERROR_CONCEALMENT', ''):
pass
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
if vars.get('MOZ_NATIVE_LIBVPX', ''):
vars['CFLAGS'] = format('{CFLAGS} {MOZ_LIBVPX_CFLAGS}', vars, {})
vars['LIBS'] = format('{LIBS} {MOZ_LIBVPX_LIBS}', vars, {})
if (format('{ac_cv_header_vpx_mem_vpx_mem_h}', vars, {}) == ('no' or (format('{ac_cv_func_vpx_mem_set_functions}', vars, {}) == 'no'))):
pass
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if vars.get('MOZ_WEBM', ''):
if vars.get('MOZ_SAMPLE_TYPE_FLOAT32', ''):
vars['MOZ_VORBIS'] = '1'
else:
vars['MOZ_TREMOR'] = '1'
if (format('{MOZ_VPX}', vars, {}) and (not format('{MOZ_NATIVE_LIBVPX}', vars, {}))):
vars['VPX_AS'] = vars.get('YASM', '')
vars['VPX_ASM_SUFFIX'] = 'asm'
vars['VPX_NEED_OBJ_INT_EXTRACT'] = ''
case = format('{OS_ARCH}:{CPU_ARCH}', vars, {})
if fnmatch.fnmatch(case, 'Darwin:x86'):
vars['VPX_ASFLAGS'] = '-f macho32 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'Darwin:x86_64'):
vars['VPX_ASFLAGS'] = '-f macho64 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'WINNT:x86_64'):
vars['VPX_ASFLAGS'] = '-f x64 -rnasm -pnasm'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'WINNT:x86'):
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (not format('{YASM}', vars, {}))):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
elif (format('{COMPILE_ENVIRONMENT}', vars, {}) and (format('{_YASM_MAJOR_VERSION}', vars, {}) < ('1' or (format('{_YASM_MAJOR_VERSION}', vars, {}) == ('1' and (format('{_YASM_MINOR_VERSION}', vars, {}) < '1')))))):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
else:
vars['VPX_ASFLAGS'] = '-f win32 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:arm*'):
if vars.get('GNU_AS', ''):
vars['VPX_AS'] = vars.get('AS', '')
vars['VPX_ASFLAGS'] = '-march=armv7-a -mfpu=neon'
vars['VPX_DASH_C_FLAG'] = '-c'
vars['VPX_AS_CONVERSION'] = '$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
vars['VPX_ASM_SUFFIX'] = vars.get('ASM_SUFFIX', '')
vars['VPX_ARM_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:x86'):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['VPX_ASFLAGS'] = '-f elf32 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:x86_64'):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['VPX_ASFLAGS'] = '-f elf64 -rnasm -pnasm -DPIC'
vars['VPX_X86_ASM'] = '1'
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (format('{VPX_X86_ASM}', vars, {}) and (not format('{VPX_AS}', vars, {})))):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
if ((not format('{GNU_CC}', vars, {})) and ((not format('{INTEL_CC}', vars, {})) and (not format('{CLANG_CC}', vars, {})))):
vars['VPX_NEED_OBJ_INT_EXTRACT'] = '1'
if vars.get('VPX_X86_ASM', ''):
pass
elif vars.get('VPX_ARM_ASM', ''):
pass
else:
sys.stdout.write('configure: warning: No assembler or assembly support for libvpx. Using unoptimized C routines.\n')
if vars.get('MOZ_WAVE', ''):
pass
if (format('{MOZ_VORBIS}', vars, {}) and format('{MOZ_TREMOR}', vars, {})):
sys.stderr.write('configure: 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/\n')
sys.exit(1)
if (format('{MOZ_WEBRTC}', vars, {}) and (not format('{MOZ_OPUS}', vars, {}))):
sys.stderr.write('configure: error: MOZ_WEBRTC requires MOZ_OPUS which is disabled.\n')
sys.exit(1)
if vars.get('MOZ_VORBIS', ''):
pass
if vars.get('MOZ_TREMOR', ''):
vars['MOZ_WEBM_ENCODER'] = ''
if vars.get('MOZ_OPUS', ''):
pass
if vars.get('MOZ_WEBM_ENCODER', ''):
pass
if (vars.get('OS_TARGET', '') == 'Linux'):
vars['MOZ_ALSA'] = '1'
if args.alsa:
vars['MOZ_ALSA'] = '1'
else:
vars['MOZ_ALSA'] = ''
if vars.get('MOZ_ALSA', ''):
pass
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android') or fnmatch.fnmatch(case, 'OpenBSD')):
pass elif (not vars.get('MOZ_B2G', '')):
vars['MOZ_PULSEAUDIO'] = '1'
if vars.get('MOZ_PULSEAUDIO', ''):
if (not vars.get('gonkdir', '')):
pass
else:
vars['MOZ_PULSEAUDIO_CFLAGS'] = format('-I{gonkdir}/external/pulseaudio/pulseaudio/src', vars, {})
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'Android')):
pass else:
vars['MOZ_GSTREAMER'] = '1'
vars['GST_API_VERSION'] = '0.10'
if vars.get('MOZ_GSTREAMER', ''):
if (vars.get('GST_API_VERSION', '') == '1.0'):
vars['GST_VERSION'] = '1.0'
else:
vars['GST_VERSION'] = '0.10.25'
if (not vars.get('_HAVE_GSTREAMER', '')):
sys.stderr.write('configure: error: gstreamer and gstreamer-plugins-base development packages are needed to build gstreamer backend. Install them or disable gstreamer support with --disable-gstreamer\n')
sys.exit(1)
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} {GSTREAMER_LIBS} -lgstvideo-{GST_API_VERSION}', vars, {})
if vars.get('_HAVE_LIBGSTVIDEO', ''):
vars['GSTREAMER_LIBS'] = format('{GSTREAMER_LIBS} -lgstvideo-{GST_API_VERSION}', vars, {})
else:
sys.stderr.write('configure: 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.\n')
sys.exit(1)
vars['LDFLAGS'] = vars.get('_SAVE_LDFLAGS', '')
if vars.get('MOZ_GSTREAMER', ''):
pass
if vars.get('MOZ_B2G', ''):
if vars.get('MOZ_PERMISSIONS', ''):
vars['MOZ_CHILD_PERMISSIONS'] = '1'
else:
sys.stderr.write('configure: error: You need to enable MOZ_PERMISSIONS for MOZ_CHILD_PERMISSIONS\n')
sys.exit(1)
if vars.get('ENABLE_SYSTEM_EXTENSION_DIRS', ''):
pass
if vars.get('JAVA_BIN_PATH', ''):
vars['JAVA_PATH'] = vars.get('JAVA_BIN_PATH', '')
else:
vars['JAVA_PATH'] = format('{JAVA_HOME}/bin:{PATH}', vars, {})
if (format('{JAVA_BIN_PATH}', vars, {}) or (format('{OS_TARGET}', vars, {}) == ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk')))):
if ((not vars.get('JAVA', '')) or (vars.get('JAVA', '') == ':')):
sys.stderr.write('configure: error: The program java was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JAVAC', '')) or (vars.get('JAVAC', '') == ':')):
sys.stderr.write('configure: error: The program javac was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JAVAH', '')) or (vars.get('JAVAH', '') == ':')):
sys.stderr.write('configure: error: The program javah was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JAR', '')) or (vars.get('JAR', '') == ':')):
sys.stderr.write('configure: error: The program jar was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('JARSIGNER', '')) or (vars.get('JARSIGNER', '') == ':')):
sys.stderr.write('configure: error: The program jarsigner was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
if ((not vars.get('KEYTOOL', '')) or (vars.get('KEYTOOL', '') == ':')):
sys.stderr.write('configure: error: The program keytool was not found. Set \\$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}\n')
sys.exit(1)
vars['MOZ_ANGLE_RENDERER'] = ''
vars['MOZ_D3D_CPU_SUFFIX'] = ''
vars['MOZ_HAS_WINSDK_WITH_D3D'] = ''
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = ''
vars['MOZ_D3DCOMPILER_VISTA_DLL_PATH'] = ''
vars['MOZ_DIRECTX_SDK_PATH'] = ''
vars['MOZ_D3DCOMPILER_XP_DLL'] = ''
vars['MOZ_D3DCOMPILER_XP_CAB'] = ''
case = vars.get('target_os', '')
if fnmatch.fnmatch(case, '*mingw*'):
vars['MOZ_ANGLE_RENDERER'] = '1'
case = vars.get('target_cpu', '')
if fnmatch.fnmatch(case, 'i*86'):
vars['MOZ_D3D_CPU_SUFFIX'] = 'x86'
elif fnmatch.fnmatch(case, 'x86_64'):
vars['MOZ_D3D_CPU_SUFFIX'] = 'x64'
if args.require_all_d3dc_versions:
vars['MOZ_REQUIRE_ALL_D3DCS'] = '1'
else:
vars['MOZ_REQUIRE_ALL_D3DCS'] = ''
if vars.get('MOZ_WEBGL_DISABLED', ''):
vars['MOZ_WEBGL'] = ''
vars['MOZ_ANGLE_RENDERER'] = ''
if vars.get('MOZ_WEBGL', ''):
pass
if vars.get('MOZ_WEBGL_CONFORMANT', ''):
pass
vars['MOZ_FOUND_D3D_COMPILERS'] = ''
if vars.get('MOZ_ANGLE_RENDERER', ''):
if (not vars.get('MOZ_D3D_CPU_SUFFIX', '')):
sys.stderr.write("configure: error: Couldn't determine MOZ_D3D_CPU_SUFFIX.\n")
sys.exit(1)
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = ''
case = vars.get('MOZ_WINSDK_MAXVER', '')
if fnmatch.fnmatch(case, '0x0603*'):
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = 'd3dcompiler_47.dll'
sys.stdout.write('Found D3D compiler in Windows SDK 8.1.\n')
elif fnmatch.fnmatch(case, '0x0602*'):
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = 'd3dcompiler_46.dll'
sys.stdout.write('Found D3D compiler in Windows SDK 8.0.\n')
if vars.get('MOZ_D3DCOMPILER_VISTA_DLL', ''):
if vars.get('WINDOWSSDKDIR', ''):
vars['MOZ_D3DCOMPILER_VISTA_DLL_PATH'] = format('{WINDOWSSDKDIR}/Redist/D3D/{MOZ_D3D_CPU_SUFFIX}/{MOZ_D3DCOMPILER_VISTA_DLL}', vars, {})
if os.path.isfile(vars.get('MOZ_D3DCOMPILER_VISTA_DLL_PATH', '')):
sys.stdout.write('Found MOZ_D3DCOMPILER_VISTA_DLL_PATH: $MOZ_D3DCOMPILER_VISTA_DLL_PATH\n')
vars['MOZ_HAS_WINSDK_WITH_D3D'] = '1'
else:
sys.stdout.write("MOZ_D3DCOMPILER_VISTA_DLL_PATH doesn't exist: $MOZ_D3DCOMPILER_VISTA_DLL_PATH\n")
sys.stderr.write('configure: error: Windows SDK at "$WINDOWSSDKDIR" appears broken. Try updating to MozillaBuild 1.9 final or higher.\n')
sys.exit(1)
vars['MOZ_D3DCOMPILER_VISTA_DLL_PATH'] = ''
else:
sys.stdout.write('Windows SDK not found.\n')
if (not vars.get('MOZ_D3DCOMPILER_VISTA_DLL_PATH', '')):
vars['MOZ_D3DCOMPILER_VISTA_DLL'] = ''
if vars.get('GNU_CC', ''):
pass
vars['MOZ_DIRECTX_SDK_REG_KEY'] = subprocess.check_output("reg query 'HKLM\\Software\\Microsoft\\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1", shell=True, env=vars).rstrip('\n')
if (not vars.get('MOZ_DIRECTX_SDK_REG_KEY', '')):
vars['MOZ_DIRECTX_SDK_REG_KEY'] = subprocess.check_output("reg query 'HKLM\\Software\\Microsoft\\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1", shell=True, env=vars).rstrip('\n')
vars['MOZ_DIRECTX_SDK_PATH'] = subprocess.check_output('reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed \'s/.*\\([a-zA-Z]\\)\\\\:\\\\\\\\/\\\\1\\\\:\\\\\\\\/\' | sed \'s,\\\\\\\\,/,g\'', shell=True, env=vars).rstrip('\n')
if (not ((not vars.get('MOZ_DIRECTX_SDK_PATH', '')) and (not os.path.isfile(format('{MOZ_DIRECTX_SDK_PATH}/lib/{MOZ_D3D_CPU_SUFFIX}/dxguid.lib', vars, {}))))):
sys.stdout.write('Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH\n')
else:
sys.stdout.write('DirectX SDK not found.\n')
vars['MOZ_DIRECTX_SDK_PATH'] = ''
if vars.get('MOZ_DIRECTX_SDK_PATH', ''):
if subprocess.check_output("echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'", shell=True, env=vars).rstrip('\n'):
sys.stdout.write('Found the February 2010 DirectX SDK, which is unacceptable to ANGLE.\n')
vars['MOZ_DIRECTX_SDK_PATH'] = ''
if vars.get('MOZ_DIRECTX_SDK_PATH', ''):
vars['MOZ_D3DX9_VERSION'] = subprocess.check_output('dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_D3D_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[0-9][0-9]\\.dll | head -n1 | sed \'s/.*\\([0-9][0-9]\\).*/\\\\1/g\'', shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_D3DX9_VERSION', ''):
vars['MOZ_D3DCOMPILER_XP_CAB'] = subprocess.check_output('find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_D3D_CPU_SUFFIX}.cab | head -n1', shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_D3DCOMPILER_XP_CAB', ''):
vars['MOZ_D3DCOMPILER_XP_DLL'] = format('D3DCompiler_{MOZ_D3DX9_VERSION}.dll', vars, {})
else:
sys.stdout.write("Couldn't find a CAB containing the D3D compiler DLL.\n")
sys.stderr.write('configure: error: DirectX SDK at "$MOZ_DIRECTX_SDK_PATH" appears broken.\n')
sys.exit(1)
vars['MOZ_DIRECTX_SDK_PATH'] = ''
else:
sys.stdout.write("Couldn't determine the D3DX9 version for the DirectX SDK.\n")
vars['MOZ_DIRECTX_SDK_PATH'] = ''
else:
sys.stdout.write("Couldn't find an acceptable DirectX SDK for ANGLE, needed for d3dcompiler_43.\n")
sys.stdout.write(' Either ignore, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.\n')
vars['MOZ_FOUND_A_D3D_COMPILER'] = ''
vars['MOZ_FOUND_BOTH_D3D_COMPILERS'] = '1'
if vars.get('MOZ_D3DCOMPILER_VISTA_DLL', ''):
vars['MOZ_FOUND_A_D3D_COMPILER'] = '1'
sys.stdout.write('Found d3dcompiler DLL for Vista+: $MOZ_D3DCOMPILER_VISTA_DLL\n')
else:
vars['MOZ_FOUND_BOTH_D3D_COMPILERS'] = ''
if vars.get('MOZ_D3DCOMPILER_XP_DLL', ''):
vars['MOZ_FOUND_A_D3D_COMPILER'] = '1'
sys.stdout.write('Found d3dcompiler DLL for XP: $MOZ_D3DCOMPILER_XP_DLL\n')
else:
vars['MOZ_FOUND_BOTH_D3D_COMPILERS'] = ''
if (not vars.get('CROSS_COMPILE', '')):
if (not 'MOZ_FOUND_A_D3D_COMPILER'):
sys.stderr.write("configure: error: Couldn't find an acceptable D3D compiler DLL.\n")
sys.exit(1)
sys.stderr.write('configure: error: Either install Windows SDK 8.0+, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.\n')
sys.exit(1)
if (format('{MOZ_REQUIRE_ALL_D3DCS}', vars, {}) and (not format('{MOZ_FOUND_BOTH_D3D_COMPILERS}', vars, {}))):
sys.stderr.write('configure: error: Both D3D compilers _43 and _46+ are required by --enable-require-d3d-compilers.\n')
sys.exit(1)
sys.stderr.write('configure: error: Install Windows SDK 8.0+, as well as DirectX SDK (June 2010 version or newer), or reconfigure without this flag.\n')
sys.exit(1)
vars['MOZ_GAMEPAD'] = ''
vars['MOZ_GAMEPAD_BACKEND'] = 'stub'
case = vars.get('OS_TARGET', '')
if (fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Linux')):
vars['MOZ_GAMEPAD'] = '1'
elif fnmatch.fnmatch(case, 'Android'):
if (vars.get('MOZ_WIDGET_TOOLKIT', '') != 'gonk'):
vars['MOZ_GAMEPAD'] = '1'
if vars.get('MOZ_GAMEPAD', ''):
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Darwin'):
vars['MOZ_GAMEPAD_BACKEND'] = 'cocoa'
elif fnmatch.fnmatch(case, 'WINNT'):
case = vars.get('MOZ_WINSDK_MAXVER', '')
if fnmatch.fnmatch(case, '0x0601*'):
sys.stderr.write('configure: error: The Windows 8 SDK or newer is required to build Gamepad support. Please install a newer Windows SDK or reconfigure with --disable-gamepad to disable gamepad support.\n')
sys.exit(1)
vars['MOZ_GAMEPAD_BACKEND'] = 'windows'
elif fnmatch.fnmatch(case, 'Linux'):
if (vars.get('ac_cv_header_linux_joystick_h', '') != 'yes'):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
vars['MOZ_GAMEPAD_BACKEND'] = 'linux'
elif fnmatch.fnmatch(case, 'Android'):
vars['MOZ_GAMEPAD_BACKEND'] = 'android'
case = vars.get('target', '')
if (fnmatch.fnmatch(case, 'i?86-*-mingw*') or fnmatch.fnmatch(case, 'x86_64-*-mingw*')):
vars['MOZ_CRASHREPORTER'] = '1'
elif (fnmatch.fnmatch(case, 'i?86-apple-darwin*') or fnmatch.fnmatch(case, 'x86_64-apple-darwin*')):
vars['MOZ_CRASHREPORTER'] = '1'
elif (fnmatch.fnmatch(case, 'i?86-*-linux*') or fnmatch.fnmatch(case, 'x86_64-*-linux*') or fnmatch.fnmatch(case, 'arm-*-linux*')):
if vars.get('MOZ_ENABLE_GTK', ''):
vars['MOZ_CRASHREPORTER'] = '1'
elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
vars['MOZ_CRASHREPORTER'] = '1'
elif fnmatch.fnmatch(case, '*solaris*'):
vars['MOZ_CRASHREPORTER'] = '1'
if (format('{OS_ARCH}', vars, {}) != (format('{HOST_OS_ARCH}', vars, {}) and (format('{OS_ARCH}', vars, {}) != 'WINNT'))):
if (vars.get('MOZ_CRASHREPORTER', '') == 'F'):
sys.stderr.write('configure: error: Cannot --enable-crashreporter, as breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH.\n')
sys.exit(1)
vars['MOZ_CRASHREPORTER'] = ''
if vars.get('MOZ_CRASHREPORTER', ''):
if (not ((not (format('{OS_TARGET}', vars, {}) == ('Linux' or (format('{OS_ARCH}', vars, {}) == 'SunOS')))) and (not (not vars.get('SKIP_LIBRARY_CHECKS', ''))))):
pass
if (vars.get('OS_ARCH', '') == 'WINNT'):
if (not vars.get('HAVE_64BIT_BUILD', '')):
vars['MOZ_CRASHREPORTER_INJECTOR'] = '1'
if (not vars.get('MOZ_CRASHREPORTER_ENABLE_PERCENT', '')):
vars['MOZ_CRASHREPORTER_ENABLE_PERCENT'] = '100'
vars['MOZ_LIBJPEG_TURBO'] = ''
if (not vars.get('MOZ_NATIVE_JPEG', '')):
vars['MOZ_LIBJPEG_TURBO'] = '1'
if (format('{MOZ_NATIVE_JPEG}', vars, {}) == ('1' and (format('{MOZ_LIBJPEG_TURBO}', vars, {}) == '1'))):
sys.stderr.write('configure: error: cannot use --with-system-jpeg with --enable-libjpeg-turbo.\n')
sys.exit(1)
if vars.get('MOZ_LIBJPEG_TURBO', ''):
case = format('{OS_ARCH}:{OS_TEST}', vars, {})
if fnmatch.fnmatch(case, 'Darwin:i?86'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f macho32 -rnasm -pnasm -DPIC -DMACHO'
vars['LIBJPEG_TURBO_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'Darwin:x86_64'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO'
vars['LIBJPEG_TURBO_X64_ASM'] = '1'
elif (fnmatch.fnmatch(case, 'WINNT:x86') or fnmatch.fnmatch(case, 'WINNT:i?86')):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f win32 -rnasm -pnasm -DPIC -DWIN32'
vars['LIBJPEG_TURBO_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, 'WINNT:x86_64'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC'
vars['LIBJPEG_TURBO_X64_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:arm*'):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-march=armv7-a -mfpu=neon'
vars['LIBJPEG_TURBO_ARM_ASM'] = '1'
elif (fnmatch.fnmatch(case, '*:x86') or fnmatch.fnmatch(case, '*:i?86')):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f elf32 -rnasm -pnasm -DPIC -DELF'
vars['LIBJPEG_TURBO_X86_ASM'] = '1'
elif fnmatch.fnmatch(case, '*:x86_64'):
if (not subprocess.call('$CC -E -dM - </dev/null | grep -q __ELF__', shell=True, env=vars)):
vars['LIBJPEG_TURBO_ASFLAGS'] = '-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF'
vars['LIBJPEG_TURBO_X64_ASM'] = '1'
if (format('{LIBJPEG_TURBO_X86_ASM}', vars, {}) or format('{LIBJPEG_TURBO_X64_ASM}', vars, {})):
vars['LIBJPEG_TURBO_AS'] = vars.get('YASM', '')
if (not vars.get('LIBJPEG_TURBO_AS', '')):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
if (vars.get('OS_ARCH', '') == 'Linux'):
if (format('{_YASM_MAJOR_VERSION}', vars, {}) < ('1' or (format('{_YASM_MAJOR_VERSION}', vars, {}) == ('1' and (format('{_YASM_MINOR_VERSION}', vars, {}) == ('0' and (format('{_YASM_RELEASE}', vars, {}) < '1'))))))):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
elif (format('{_YASM_MAJOR_VERSION}', vars, {}) < ('1' or (format('{_YASM_MAJOR_VERSION}', vars, {}) == ('1' and (format('{_YASM_MINOR_VERSION}', vars, {}) < '1'))))):
sys.stderr.write("configure: 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.\n")
sys.exit(1)
if vars.get('LIBJPEG_TURBO_ARM_ASM', ''):
print format('Using {AS} as the assembler for ARM code.', vars, {})
vars['LIBJPEG_TURBO_AS'] = vars.get('AS', '')
if vars.get('LIBJPEG_TURBO_X86_ASM', ''):
pass
elif vars.get('LIBJPEG_TURBO_X64_ASM', ''):
pass
elif vars.get('LIBJPEG_TURBO_ARM_ASM', ''):
pass
elif vars.get('MOZ_LIBJPEG_TURBO', ''):
sys.stdout.write('configure: warning: No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.\n')
if ((not format('{MOZ_ENABLE_GNOMEVFS}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n')})) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n') != '0')):
if vars.get('MOZ_X11', ''):
sys.stdout.write('configure: warning: Removing gnomevfs from MOZ_EXTENSIONS due to no --enable-gnomevfs.\n')
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'", shell=True, env=vars).rstrip('\n')
if (format('{LIBXUL_SDK_DIR}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n')}) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gnomevfs', shell=True, env=vars).rstrip('\n') != '0')):
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'", shell=True, env=vars).rstrip('\n')
if ((not format('{MOZ_ENABLE_GIO}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n')})) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n') != '0')):
if vars.get('MOZ_X11', ''):
sys.stdout.write('configure: warning: Removing gio from MOZ_EXTENSIONS due to --disable-gio.\n')
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gio||'", shell=True, env=vars).rstrip('\n')
if (format('{LIBXUL_SDK_DIR}', vars, {'cmd0':subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n')}) and (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n') != '0')):
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gio||'", shell=True, env=vars).rstrip('\n')
if (subprocess.check_output('echo "$MOZ_EXTENSIONS" | grep -c gio', shell=True, env=vars).rstrip('\n') != '0'):
vars['MOZ_GIO_COMPONENT'] = '1'
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's|gio||'", shell=True, env=vars).rstrip('\n')
vars['MOZ_EXTENSIONS'] = subprocess.check_output('${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}', shell=True, env=vars).rstrip('\n')
for extension in for_loop(['{MOZ_EXTENSIONS}'], vars, {}):
vars['extension'] = extension
if (not os.path.isdir(format('{srcdir}/extensions/{extension}', vars, {}))):
sys.stderr.write('configure: error: Unrecognized extension provided to --enable-extensions: ${extension}.\n')
sys.exit(1)
if vars.get('MOZ_USE_NATIVE_POPUP_WINDOWS', ''):
pass
if args.tree_freetype:
vars['MOZ_TREE_FREETYPE'] = '1'
else:
vars['MOZ_TREE_FREETYPE'] = ''
if vars.get('MOZ_TREE_FREETYPE', ''):
if vars.get('_WIN32_MSVC', ''):
sys.stderr.write('configure: error: "building with in-tree freetype is not supported on MSVC"\n')
sys.exit(1)
vars['MOZ_ENABLE_CAIRO_FT'] = '1'
vars['FT_FONT_FEATURE'] = '#define CAIRO_HAS_FT_FONT 1'
vars['FT2_CFLAGS'] = '-I$(topsrcdir)/modules/freetype2/include'
vars['CAIRO_FT_CFLAGS'] = '-I$(topsrcdir)/modules/freetype2/include'
vars['FT2_LIBS'] = '$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
vars['CAIRO_FT_OSLIBS'] = ''
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['MIN_NSIS_MAJOR_VER'] = '2'
vars['MIN_NSIS_MINOR_VER'] = '46'
if (vars.get('MAKENSISU', '') and (vars.get('MAKENSISU', '') != ':')):
sys.stdout.write('yes\n')
vars['MAKENSISU_VER'] = subprocess.check_output('"$MAKENSISU" -version 2>/dev/null', shell=True, env=vars).rstrip('\n')
vars['MAKENSISU_PARSED_VER'] = subprocess.check_output('echo "$MAKENSISU_VER" | sed -e \'/-Unicode/!s/.*//g\' -e \'s/^v\\([0-9]\\+\\.[0-9]\\+\\).*\\-Unicode$/\\1/g\'', shell=True, env=vars).rstrip('\n')
if (vars.get('MAKENSISU_PARSED_VER', '') == ''):
vars['MAKENSISU_PARSED_VER'] = subprocess.check_output('echo "$MAKENSISU_VER" | sed -e \'s/^v\\([0-9]\\+\\.[0-9]\\+\\).*$/\\1/g\'', shell=True, env=vars).rstrip('\n')
vars['MAKENSISU_MAJOR_VER'] = '0'
vars['MAKENSISU_MINOR_VER'] = '0'
if (not (vars.get('MAKENSISU_PARSED_VER', '') == '')):
vars['MAKENSISU_MAJOR_VER'] = subprocess.check_output("echo $MAKENSISU_PARSED_VER | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['MAKENSISU_MINOR_VER'] = subprocess.check_output("echo $MAKENSISU_PARSED_VER | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
sys.stdout.write('configure: checking for Unicode NSIS version $MIN_NSIS_MAJOR_VER.$MIN_NSIS_MINOR_VER or greater\n')
if (not ((not (format('{MAKENSISU_MAJOR_VER}', vars, {}) == (format('{MIN_NSIS_MAJOR_VER}', vars, {}) and (format('{MAKENSISU_MINOR_VER}', vars, {}) >= format('{MIN_NSIS_MINOR_VER}', vars, {}))))) or (not (format('{MAKENSISU_MAJOR_VER}', vars, {}) > format('{MIN_NSIS_MAJOR_VER}', vars, {}))))):
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
if (not vars.get('CROSS_COMPILE', '')):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
else:
vars['MAKENSISU'] = ''
elif (not vars.get('CROSS_COMPILE', '')):
sys.stderr.write('configure: 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.\n')
sys.exit(1)
else:
vars['MAKENSISU'] = ''
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) != ('windows' and (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) != ('cocoa' and (not format('{MOZ_WIDGET_GTK}', vars, {})))))):
vars['MOZ_WEBAPP_RUNTIME'] = ''
if (format('{OS_ARCH}', vars, {}) == ('WINNT' and ((not format('{MAKENSISU}', vars, {})) and format('{CROSS_COMPILE}', vars, {})))):
vars['MOZ_WEBAPP_RUNTIME'] = ''
if vars.get('MOZ_WEBAPP_RUNTIME', ''):
pass
if (not vars.get('TAR', '')):
sys.stderr.write('configure: error: no tar archiver found in \\$PATH\n')
sys.exit(1)
if vars.get('MOZ_SIGN_CMD', ''):
pass
if args.maintenance_service:
vars['MOZ_MAINTENANCE_SERVICE'] = '1'
else:
vars['MOZ_MAINTENANCE_SERVICE'] = ''
if vars.get('MOZ_MAINTENANCE_SERVICE', ''):
if (vars.get('OS_ARCH', '') == 'WINNT'):
pass
else:
sys.stderr.write('configure: error: Can only build with --enable-maintenance-service with a Windows target\n')
sys.exit(1)
if args.bundled_fonts:
vars['MOZ_BUNDLED_FONTS'] = '1'
else:
vars['MOZ_BUNDLED_FONTS'] = ''
if vars.get('MOZ_BUNDLED_FONTS', ''):
pass
if args.verify_mar:
vars['MOZ_VERIFY_MAR_SIGNATURE'] = '1'
else:
vars['MOZ_VERIFY_MAR_SIGNATURE'] = ''
if vars.get('MOZ_VERIFY_MAR_SIGNATURE', ''):
if (vars.get('OS_ARCH', '') == 'WINNT'):
pass
else:
sys.stderr.write('configure: error: Can only build with --enable-verify-mar with a Windows target\n')
sys.exit(1)
if args.signmar:
vars['MOZ_ENABLE_SIGNMAR'] = '1'
else:
vars['MOZ_ENABLE_SIGNMAR'] = ''
if vars.get('MOZ_ENABLE_SIGNMAR', ''):
pass
if vars.get('MOZ_UPDATER', ''):
pass
if args.update_packaging:
vars['MOZ_UPDATE_PACKAGING'] = '1'
else:
vars['MOZ_UPDATE_PACKAGING'] = ''
if vars.get('ENABLE_TESTS', ''):
vars['GTEST_HAS_RTTI'] = '0'
if vars.get('_WIN32_MSVC', ''):
pass
if (vars.get('OS_TARGET', '') == 'Android'):
pass
if vars.get('MOZ_DISABLE_PARENTAL_CONTROLS', ''):
pass
if vars.get('MOZ_DISABLE_CRYPTOLEGACY', ''):
pass
if vars.get('MOZ_NO_EV_CERTS', ''):
pass
if vars.get('NSS_NO_LIBPKIX', ''):
pass
if vars.get('gonkdir', ''):
vars['MOZ_CONTENT_SANDBOX'] = '1'
if args.content_sandbox:
vars['MOZ_CONTENT_SANDBOX'] = '1'
else:
vars['MOZ_CONTENT_SANDBOX'] = ''
if vars.get('MOZ_CONTENT_SANDBOX', ''):
pass
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'WINNT'):
vars['MOZ_GMP_SANDBOX'] = '1'
elif fnmatch.fnmatch(case, 'Linux'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'x86')):
vars['MOZ_GMP_SANDBOX'] = '1'
if vars.get('MOZ_GMP_SANDBOX', ''):
pass
if vars.get('MOZ_FEEDS', ''):
pass
elif (vars.get('MOZ_BUILD_APP', '') == 'browser'):
sys.stderr.write('configure: error: Cannot build Firefox with --disable-feeds.\n')
sys.exit(1)
vars['MOZ_NATIVE_SQLITE'] = ''
if args.system_sqlite:
vars['MOZ_NATIVE_SQLITE'] = '1'
else:
vars['MOZ_NATIVE_SQLITE'] = ''
if vars.get('MOZ_NATIVE_SQLITE', ''):
sys.stdout.write('configure: checking for SQLITE_SECURE_DELETE support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_secure_delete\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_secure_delete}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_SECURE_DELETE.\n')
sys.exit(1)
sys.stdout.write('configure: checking for SQLITE_THREADSAFE support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_threadsafe\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_threadsafe}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_THREADSAFE.\n')
sys.exit(1)
sys.stdout.write('configure: checking for SQLITE_ENABLE_FTS3 support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_enable_fts3\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_enable_fts3}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_ENABLE_FTS3.\n')
sys.exit(1)
sys.stdout.write('configure: checking for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {SQLITE_CFLAGS}', vars, {})
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['LIBS'] = format('{LIBS} {SQLITE_LIBS}', vars, {})
sys.stdout.write('$ac_cv_sqlite_enable_unlock_notify\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
if (format('x{ac_cv_sqlite_enable_unlock_notify}', vars, {}) == 'xno'):
sys.stderr.write('configure: error: System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.\n')
sys.exit(1)
if vars.get('MOZ_NATIVE_SQLITE', ''):
pass
if vars.get('MOZ_HELP_VIEWER', ''):
pass
if args.safe_browsing:
vars['MOZ_SAFE_BROWSING'] = '1'
else:
vars['MOZ_SAFE_BROWSING'] = ''
if vars.get('MOZ_SAFE_BROWSING', ''):
pass
if vars.get('MOZ_SAFE_BROWSING', ''):
vars['MOZ_URL_CLASSIFIER'] = '1'
if args.url_classifier:
vars['MOZ_URL_CLASSIFIER'] = '1'
else:
vars['MOZ_URL_CLASSIFIER'] = ''
if vars.get('MOZ_URL_CLASSIFIER', ''):
pass
vars['MOZ_GL_PROVIDER'] = ''
if vars.get('MOZ_GL_PROVIDER', ''):
vars['MOZ_GL_DEFAULT_PROVIDER'] = vars.get('MOZ_GL_PROVIDER', '')
if args.faststripe:
vars['MOZ_THEME_FASTSTRIPE'] = '1'
else:
vars['MOZ_THEME_FASTSTRIPE'] = ''
if args.mobile_optimize:
vars['MOZ_GFX_OPTIMIZE_MOBILE'] = '1'
if vars.get('MOZ_GFX_OPTIMIZE_MOBILE', ''):
pass
if (not vars.get('MOZ_OPTIMIZE_FLAGS', '')):
vars['MOZ_OPTIMIZE_FLAGS'] = '-O'
subprocess.call('MOZ_SET_FRAMEPTR_FLAGS', shell=True, env=vars)
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('MOZ_OPTIMIZE', ''):
sys.stdout.write('configure: checking for valid optimization flags\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {MOZ_OPTIMIZE_FLAGS}', vars, {})
sys.stdout.write('$_results\n')
if (vars.get('_results', '') == 'no'):
sys.stderr.write('configure: error: These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS\n')
sys.exit(1)
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if args.warnings_as_errors:
vars['MOZ_ENABLE_WARNINGS_AS_ERRORS'] = '1'
else:
vars['MOZ_ENABLE_WARNINGS_AS_ERRORS'] = ''
if (not vars.get('MOZ_ENABLE_WARNINGS_AS_ERRORS', '')):
vars['WARNINGS_AS_ERRORS'] = ''
elif vars.get('GNU_CC', ''):
if vars.get('MOZ_PGO', ''):
pass
if vars.get('NS_DISABLE_LOGGING', ''):
pass
vars['_ENABLE_LOGREFCNT'] = '42'
if args.logrefcnt:
vars['_ENABLE_LOGREFCNT'] = '1'
else:
vars['_ENABLE_LOGREFCNT'] = ''
if (vars.get('_ENABLE_LOGREFCNT', '') == '1'):
pass
elif (not vars.get('_ENABLE_LOGREFCNT', '')):
pass
if args.dump_painting:
vars['MOZ_DUMP_PAINTING'] = '1'
else:
vars['MOZ_DUMP_PAINTING'] = ''
if vars.get('MOZ_DUMP_PAINTING', ''):
pass
if vars.get('MOZ_DEBUG', ''):
pass
vars['NS_TRACE_MALLOC'] = vars.get('MOZ_TRACE_MALLOC', '')
if args.trace_malloc:
vars['NS_TRACE_MALLOC'] = '1'
else:
vars['NS_TRACE_MALLOC'] = ''
if vars.get('NS_TRACE_MALLOC', ''):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = ''
if args.dmd:
vars['MOZ_DMD'] = '1'
else:
vars['MOZ_DMD'] = ''
if (format('{NS_TRACE_MALLOC}', vars, {}) and format('{MOZ_DMD}', vars, {})):
sys.stderr.write('configure: error: --enable-trace-malloc and --enable-dmd are conflicting options\n')
sys.exit(1)
if vars.get('MOZ_DMD', ''):
if (vars.get('CPU_ARCH', '') == 'arm'):
vars['CFLAGS'] = format('{CFLAGS} -funwind-tables', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -funwind-tables', vars, {})
vars['MOZ_MEMORY'] = '1'
vars['MOZ_REPLACE_MALLOC'] = '1'
if args.jemalloc:
vars['MOZ_MEMORY'] = '1'
else:
vars['MOZ_MEMORY'] = ''
if vars.get('NS_TRACE_MALLOC', ''):
vars['MOZ_MEMORY'] = ''
if (vars.get('OS_TARGET', '') == 'Android'):
subprocess.call(':', shell=True, env=vars)
elif (vars.get('OS_TARGET', '') == ('WINNT' or (vars.get('OS_TARGET', '') == 'Darwin'))):
if (not vars.get('GNU_CC', '')):
vars['MOZ_GLUE_LDFLAGS'] = '$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
else:
vars['MOZ_GLUE_LDFLAGS'] = '-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
else:
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = '$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
if (format('{MOZ_MEMORY}', vars, {}) == ('1' or (format('{LIBXUL_SDK}', vars, {}) and os.path.isfile(format('{LIBXUL_SDK}/lib/{LIB_PREFIX}memory.{LIB_SUFFIX}', vars, {}))))):
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} $(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)', vars, {})
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} $(MKSHLIB_UNFORCE_ALL)', vars, {})
if vars.get('GNU_CC', ''):
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} -rdynamic', vars, {})
if (vars.get('MOZ_LINKER', '') == '1'):
vars['MOZ_GLUE_PROGRAM_LDFLAGS'] = format('{MOZ_GLUE_PROGRAM_LDFLAGS} {MOZ_ZLIB_LIBS}', vars, {})
if (format('{NIGHTLY_BUILD}', vars, {}) and format('{MOZ_MEMORY}', vars, {})):
vars['MOZ_REPLACE_MALLOC'] = '1'
if args.replace_malloc:
vars['MOZ_REPLACE_MALLOC'] = '1'
else:
vars['MOZ_REPLACE_MALLOC'] = ''
if (format('{NS_TRACE_MALLOC}', vars, {}) and format('{MOZ_REPLACE_MALLOC}', vars, {})):
sys.stderr.write('configure: error: --enable-trace-malloc and --enable-replace-malloc are conflicting options\n')
sys.exit(1)
if (format('{MOZ_REPLACE_MALLOC}', vars, {}) and (not format('{MOZ_MEMORY}', vars, {}))):
sys.stderr.write('configure: error: --enable-replace-malloc requires --enable-jemalloc\n')
sys.exit(1)
elif vars.get('MOZ_REPLACE_MALLOC', ''):
vars['MOZ_NATIVE_JEMALLOC'] = ''
if vars.get('MACOSX_DEPLOYMENT_TARGET', ''):
vars['MOZ_REPLACE_MALLOC_LINKAGE'] = vars.get('ac_cv_weak_dynamic_linking', '')
if (not vars.get('MOZ_MEMORY', '')):
if (format('{MOZ_JEMALLOC3}', vars, {}) and (not format('{MOZ_REPLACE_MALLOC}', vars, {}))):
vars['MOZ_NATIVE_JEMALLOC'] = '1'
if vars.get('MOZ_NATIVE_JEMALLOC', ''):
vars['MOZ_MEMORY'] = '1'
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-mingw*'):
if ((not format('{WIN32_REDIST_DIR}', vars, {})) and (not format('{MOZ_DEBUG}', vars, {}))):
sys.stdout.write('configure: warning: 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.\n')
else:
if vars.get('MOZ_JEMALLOC3', ''):
pass
if (format('x{MOZ_DEBUG}', vars, {}) == 'x1'):
pass
case = vars.get('target', '')
if fnmatch.fnmatch(case, '*-darwin*'):
pass elif fnmatch.fnmatch(case, '*-*freebsd*'):
pass elif (fnmatch.fnmatch(case, '*-android*') or fnmatch.fnmatch(case, '*-linuxandroid*')):
if (not vars.get('gonkdir', '')):
vars['_WRAP_MALLOC'] = '1'
vars['MOZ_GLUE_LDFLAGS'] = ''
elif fnmatch.fnmatch(case, '*-*linux*'):
pass elif fnmatch.fnmatch(case, '*-netbsd*'):
pass elif fnmatch.fnmatch(case, '*-solaris*'):
pass elif fnmatch.fnmatch(case, '*-mingw*'):
vars['MOZ_NO_DEBUG_RTL'] = '1'
exports.add('MOZ_NO_DEBUG_RTL')
vars['WIN32_CRT_LIBS'] = 'msvcrt.lib msvcprt.lib'
vars['WIN32_CRTDLL_FULLPATH'] = subprocess.check_output('lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\\\.obj', shell=True, env=vars).rstrip('\n')
subprocess.call(format('lib -NOLOGO -OUT:crtdll.obj {WIN32_CRT_LIBS} -EXTRACT:{WIN32_CRTDLL_FULLPATH}', vars, {}), shell=True, env=vars)
if (not subprocess.call('grep -q __imp__\\{0,1\\}free crtdll.obj', shell=True, env=vars)):
vars['MOZ_GLUE_LDFLAGS'] = '-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcprt -DEFAULTLIB:mozcrt'
vars['DLLFLAGS'] = format('{DLLFLAGS} {MOZ_GLUE_LDFLAGS}', vars, {})
else:
vars['DLLFLAGS'] = format('{DLLFLAGS} -LIBPATH:$(DIST)/lib -DEFAULTLIB:mozglue', vars, {})
subprocess.call('rm crtdll.obj', shell=True, env=vars)
exports.add('DLLFLAGS')
else:
sys.stderr.write('configure: error: --enable-jemalloc not supported on ${target}\n')
sys.exit(1)
if (vars.get('OS_TARGET', '') == 'Android'):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -L{_objdir}/dist/lib -lmozglue', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv', vars, {})
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'android'):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror', vars, {})
if (not vars.get('gonkdir', '')):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=memccpy,--wrap=memchr,--wrap=memrchr,--wrap=memcmp,--wrap=memcpy,--wrap=memmove,--wrap=memset,--wrap=memmem,--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', vars, {})
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_NUWA_PROCESS}', vars, {}))):
vars['WRAP_LDFLAGS'] = format('{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', vars, {})
if args.wrap_malloc:
vars['_WRAP_MALLOC'] = '1'
else:
vars['_WRAP_MALLOC'] = ''
if vars.get('_WRAP_MALLOC', ''):
if vars.get('GNU_CC', ''):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size', vars, {})
if (vars.get('OS_TARGET', '') == 'Android'):
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv', vars, {})
vars['WRAP_LDFLAGS'] = format('{WRAP_LDFLAGS} -Wl,--wrap=_ZnwjRKSt9nothrow_t,--wrap=_ZnajRKSt9nothrow_t,--wrap=_ZdlPvRKSt9nothrow_t,--wrap=_ZdaPvRKSt9nothrow_t', vars, {})
else:
sys.stderr.write('configure: error: --enable-wrap-malloc is not supported for non-GNU toolchains\n')
sys.exit(1)
if args.trace_jscalls:
vars['MOZ_TRACE_JSCALLS'] = '1'
else:
vars['MOZ_TRACE_JSCALLS'] = ''
if vars.get('MOZ_TRACE_JSCALLS', ''):
pass
if args.js_diagnostics:
vars['JS_CRASH_DIAGNOSTICS'] = '1'
else:
vars['JS_CRASH_DIAGNOSTICS'] = ''
if vars.get('JS_CRASH_DIAGNOSTICS', ''):
pass
vars['JSGC_INCREMENTAL'] = '1'
if vars.get('JSGC_INCREMENTAL', ''):
pass
if vars.get('JSGC_USE_EXACT_ROOTING', ''):
pass
if vars.get('JSGC_GENERATIONAL', ''):
pass
if args.small_chunk_size:
vars['JS_GC_SMALL_CHUNK_SIZE'] = '1'
else:
vars['JS_GC_SMALL_CHUNK_SIZE'] = ''
if vars.get('JS_GC_SMALL_CHUNK_SIZE', ''):
pass
if args.gczeal:
vars['JS_GC_ZEAL'] = '1'
else:
vars['JS_GC_ZEAL'] = ''
if (format('{JS_GC_ZEAL}', vars, {}) or format('{MOZ_DEBUG}', vars, {})):
pass
if args.root_analysis:
vars['JSGC_ROOT_ANALYSIS'] = '1'
else:
vars['JSGC_ROOT_ANALYSIS'] = ''
if vars.get('JSGC_ROOT_ANALYSIS', ''):
pass
if vars.get('DEHYDRA_PATH', ''):
if (not os.path.isfile(vars.get('DEHYDRA_PATH', ''))):
sys.stderr.write('configure: error: The dehydra plugin is not at the specified path.\n')
sys.exit(1)
if args.clang_plugin:
vars['ENABLE_CLANG_PLUGIN'] = '1'
else:
vars['ENABLE_CLANG_PLUGIN'] = ''
if vars.get('ENABLE_CLANG_PLUGIN', ''):
if (not vars.get('CLANG_CC', '')):
sys.stderr.write("configure: error: Can't use clang plugin without clang.\n")
sys.exit(1)
if args.strip:
vars['ENABLE_STRIP'] = '1'
else:
vars['ENABLE_STRIP'] = ''
if args.install_strip:
vars['PKG_SKIP_STRIP'] = ''
else:
vars['PKG_SKIP_STRIP'] = '1'
vars['USE_ELF_HACK'] = '1'
if (vars.get('MOZ_PROFILING', '') == '1'):
if (vars.get('USE_ELF_HACK', '') == 'F'):
sys.stderr.write('configure: error: --enable-elf-hack is not compatible with --enable-profiling\n')
sys.exit(1)
vars['USE_ELF_HACK'] = ''
if (vars.get('USE_ELF_HACK', '') == '1'):
case = format('{HOST_OS_ARCH},{OS_ARCH}', vars, {})
if fnmatch.fnmatch(case, 'Linux,Linux'):
case = vars.get('CPU_ARCH', '')
if (fnmatch.fnmatch(case, 'arm') or fnmatch.fnmatch(case, 'x86') or fnmatch.fnmatch(case, 'x86_64')):
vars['USE_ELF_HACK'] = '1'
else:
vars['USE_ELF_HACK'] = ''
else:
vars['USE_ELF_HACK'] = ''
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and format('{USE_ELF_HACK}', vars, {})):
if (vars.get('LINK_WITH_PT_GNU_RELRO', '') == 'yes'):
if (vars.get('USE_ELF_HACK', '') == 'F'):
sys.stdout.write('configure: checking for -z norelro option to ld\n')
vars['_SAVE_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['LDFLAGS'] = format('{LDFLAGS} -Wl,-z,norelro', vars, {})
vars['USE_ELF_HACK'] = '1'
else:
sys.stdout.write('configure: warning: Disabling elfhack\n')
vars['USE_ELF_HACK'] = ''
vars['STDCXX_COMPAT'] = ''
if args.stdcxx_compat:
vars['STDCXX_COMPAT'] = '1'
if vars.get('STDCXX_COMPAT', ''):
subprocess.call(format('eval {cmd0}', vars, {'cmd0':subprocess.check_output('CXX="$CXX" HOST_CXX="$HOST_CXX" $PYTHON -m mozbuild.configure.libstdcxx', shell=True, env=vars).rstrip('\n')}), shell=True, env=vars)
if args.visual_event_tracer:
vars['MOZ_VISUAL_EVENT_TRACER'] = '1'
else:
vars['MOZ_VISUAL_EVENT_TRACER'] = ''
if vars.get('MOZ_VISUAL_EVENT_TRACER', ''):
pass
if args.tasktracer:
vars['MOZ_TASK_TRACER'] = '1'
else:
vars['MOZ_TASK_TRACER'] = ''
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_TASK_TRACER}', vars, {}))):
pass
if args.reflow_perf:
vars['MOZ_REFLOW_PERF'] = '1'
else:
vars['MOZ_REFLOW_PERF'] = ''
if vars.get('MOZ_REFLOW_PERF', ''):
pass
vars['MOZ_DISABLE_STARTUPCACHE'] = ''
if vars.get('MOZ_B2G', ''):
vars['MOZ_DISABLE_STARTUPCACHE'] = '1'
if args.b2g_ril:
vars['MOZ_B2G_RIL'] = '1'
else:
vars['MOZ_B2G_RIL'] = ''
if vars.get('MOZ_B2G_RIL', ''):
if vars.get('_PLATFORM_HAVE_RIL', ''):
pass
else:
sys.stderr.write("configure: error: b2g-ril cannot be enabled because target platform doesn't support it.\n")
sys.exit(1)
if vars.get('MOZ_B2G_FM', ''):
pass
if args.b2g_bt:
vars['MOZ_B2G_BT'] = '1'
else:
vars['MOZ_B2G_BT'] = ''
if vars.get('MOZ_B2G_BT', ''):
pass
if args.nfc:
vars['MOZ_NFC'] = '1'
else:
vars['MOZ_NFC'] = ''
if vars.get('MOZ_NFC', ''):
pass
if args.synth_pico:
vars['MOZ_SYNTH_PICO'] = '1'
else:
vars['MOZ_SYNTH_PICO'] = ''
if vars.get('MOZ_SYNTH_PICO', ''):
pass
if vars.get('MOZ_TIME_MANAGER', ''):
pass
if args.b2g_camera:
vars['MOZ_B2G_CAMERA'] = '1'
else:
vars['MOZ_B2G_CAMERA'] = ''
if vars.get('MOZ_B2G_CAMERA', ''):
pass
if vars.get('MOZ_PAY', ''):
pass
if vars.get('MOZ_ACTIVITIES', ''):
pass
if vars.get('MOZ_AUDIO_CHANNEL_MANAGER', ''):
pass
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
pass
vars['MOZ_DEMANGLE_SYMBOLS'] = ''
if (not ((not vars.get('HAVE_DEMANGLE', '')) and (not (format('{MOZ_DEBUG}', vars, {}) or (format('{NS_TRACE_MALLOC}', vars, {}) or format('{MOZ_DMD}', vars, {})))))):
vars['MOZ_DEMANGLE_SYMBOLS'] = '1'
if (not vars.get('SKIP_LIBRARY_CHECKS', '')):
pass
if args.xterm_updates:
vars['MOZ_UPDATE_XTERM'] = '1'
else:
vars['MOZ_UPDATE_XTERM'] = ''
if (not vars.get('MOZ_CHROME_FILE_FORMAT', '')):
vars['MOZ_CHROME_FILE_FORMAT'] = 'jar'
if (vars.get('MOZ_CHROME_FILE_FORMAT', '') == 'symlink'):
sys.stderr.write('configure: error: --enable-chrome-format=symlink has been deprecated. It is now used by default in $DIST/bin on platforms that support it\n')
sys.exit(1)
if (not (((not (vars.get('MOZ_CHROME_FILE_FORMAT', '') != 'jar')) and (not (vars.get('MOZ_CHROME_FILE_FORMAT', '') != 'flat'))) and (not (vars.get('MOZ_CHROME_FILE_FORMAT', '') != 'omni')))):
sys.stderr.write('configure: error: --enable-chrome-format must be set to either jar, flat, or omni\n')
sys.exit(1)
if (vars.get('MOZ_CHROME_FILE_FORMAT', '') == 'omni'):
vars['MOZ_OMNIJAR'] = '1'
vars['MOZ_PACKAGER_FORMAT'] = vars.get('MOZ_CHROME_FILE_FORMAT', '')
if (format('{OS_ARCH}', vars, {}) == ('WINNT' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == 'android'))):
vars['MOZ_CHROME_FILE_FORMAT'] = 'flat'
else:
vars['MOZ_CHROME_FILE_FORMAT'] = 'symlink'
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'android'):
vars['OMNIJAR_NAME'] = 'assets/omni.ja'
else:
vars['OMNIJAR_NAME'] = 'omni.ja'
vars['MOZ_DOC_INPUT_DIRS'] = './dist/include ./dist/idl'
vars['MOZ_DOC_INCLUDE_DIRS'] = './dist/include ./dist/include/nspr'
vars['MOZ_DOC_OUTPUT_DIR'] = './dist/docs'
if (not vars.get('SKIP_COMPILER_CHECKS', '')):
sys.stdout.write('configure: checking for -pipe support\n')
if (format('{GNU_CC}', vars, {}) and format('{GNU_CXX}', vars, {})):
vars['CFLAGS'] = format('{CFLAGS} -pipe', vars, {})
vars['CXXFLAGS'] = format('{CXXFLAGS} -pipe', vars, {})
sys.stdout.write('yes\n')
else:
sys.stdout.write('no\n')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -fprofile-generate -fprofile-correction', vars, {})
sys.stdout.write('configure: checking whether C compiler supports -fprofile-generate\n')
sys.stdout.write('$result\n')
if (vars.get('result', '') == 'yes'):
vars['PROFILE_GEN_LDFLAGS'] = '-fprofile-generate'
vars['PROFILE_USE_CFLAGS'] = '-fprofile-use -fprofile-correction -Wcoverage-mismatch'
vars['PROFILE_USE_LDFLAGS'] = '-fprofile-use'
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if vars.get('INTEL_CC', ''):
vars['PROFILE_GEN_CFLAGS'] = '-prof-gen -prof-dir .'
vars['PROFILE_GEN_LDFLAGS'] = ''
vars['PROFILE_USE_CFLAGS'] = '-prof-use -prof-dir .'
vars['PROFILE_USE_LDFLAGS'] = ''
if vars.get('SOLARIS_SUNPRO_CC', ''):
vars['PROFILE_GEN_CFLAGS'] = format('-xprofile=collect:{_objdir}/{enable_application}', vars, {})
vars['PROFILE_GEN_LDFLAGS'] = format('-xprofile=collect:{_objdir}/{enable_application}', vars, {})
vars['PROFILE_USE_CFLAGS'] = format('-xprofile=use:{_objdir}/{enable_application}', vars, {})
vars['PROFILE_USE_LDFLAGS'] = format('-xprofile=use:{_objdir}/{enable_application}', vars, {})
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} -fno-integrated-as -S', vars, {})
sys.stdout.write('configure: checking whether C compiler supports -fno-integrated-as\n')
sys.stdout.write('$result\n')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
subprocess.call('MOZ_EXPAND_LIBS', shell=True, env=vars)
if (format('{GNU_CC}', vars, {}) and format('{GNU_CXX}', vars, {})):
vars['_DEPEND_CFLAGS'] = '-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
elif vars.get('SOLARIS_SUNPRO_CC', ''):
vars['_DEPEND_CFLAGS'] = ''
elif (not vars.get('_WIN32_MSVC', '')):
vars['_USE_CPP_INCLUDE_FLAG'] = ''
vars['_DEFINES_CFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
vars['_DEFINES_CXXFLAGS'] = '$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else:
subprocess.call("echo '#include <stdio.h>' >dummy-hello.c", shell=True, env=vars)
vars['_CL_PREFIX_REGEX'] = '^\\([^:]*:.*[ :] \\)\\(.*\\\\stdio.h\\)$'
vars['CL_INCLUDES_PREFIX'] = subprocess.check_output('${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne \'s/\'"$_CL_PREFIX_REGEX"\'/\\1/p\'', shell=True, env=vars).rstrip('\n')
vars['_CL_STDIO_PATH'] = subprocess.check_output('${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne \'s/\'"$_CL_PREFIX_REGEX"\'/\\2/p\'', shell=True, env=vars).rstrip('\n')
if (not os.path.exists(vars.get('_CL_STDIO_PATH', ''))):
sys.stderr.write("configure: error: Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.\n")
sys.exit(1)
if (not vars.get('CL_INCLUDES_PREFIX', '')):
sys.stderr.write('configure: error: Cannot find cl -showIncludes prefix.\n')
sys.exit(1)
subprocess.call('rm -f dummy-hello.c', shell=True, env=vars)
vars['NONASCII'] = '$\\241\\241'
if (vars.get('OS_ARCH', '') == 'WINNT'):
vars['GKMEDIAS_SHARED_LIBRARY'] = '1'
if (not vars.get('MOZ_NATIVE_ZLIB', '')):
if (format('{JS_SHARED_LIBRARY}', vars, {}) or format('{GKMEDIAS_SHARED_LIBRARY}', vars, {})):
vars['ZLIB_IN_MOZGLUE'] = '1'
if (not vars.get('SKIP_PATH_CHECKS', '')):
if ((not format('{GLIB_CFLAGS}', vars, {})) or (not format('{GLIB_LIBS}', vars, {}))):
if vars.get('MOZ_ENABLE_GTK', ''):
pass
if ((not format('{GLIB_GMODULE_LIBS}', vars, {})) and (format('{GLIB_CONFIG}', vars, {}) and (format('{GLIB_CONFIG}', vars, {}) != 'no'))):
vars['GLIB_GMODULE_LIBS'] = subprocess.check_output('$GLIB_CONFIG gmodule --libs', shell=True, env=vars).rstrip('\n')
if (vars.get('OS_TARGET', '') == 'WINNT'):
if (not subprocess.call(format('{PERL} -e exit({MOZ_WINSDK_MAXVER} < 0x06020000)', vars, {}), shell=True, env=vars)):
vars['MOZ_ENABLE_DIRECT2D1_1'] = '1'
if (format('{OS_TARGET}', vars, {}) == ('WINNT' or (format('{OS_ARCH}', vars, {}) == ('Darwin' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('android' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gtk2' or (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == 'gtk3'))))))))))):
case = vars.get('target_cpu', '')
if (fnmatch.fnmatch(case, 'i*86*') or fnmatch.fnmatch(case, 'x86_64') or fnmatch.fnmatch(case, 'arm')):
vars['MOZ_ENABLE_SKIA'] = '1'
else:
vars['MOZ_ENABLE_SKIA'] = ''
else:
vars['MOZ_ENABLE_SKIA'] = ''
if args.skia:
vars['MOZ_ENABLE_SKIA'] = '1'
else:
vars['MOZ_ENABLE_SKIA'] = ''
if vars.get('USE_FC_FREETYPE', ''):
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('_HAVE_FREETYPE2', ''):
vars['_SAVE_LIBS'] = vars.get('LIBS', '')
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['LIBS'] = format('{LIBS} {FT2_LIBS}', vars, {})
vars['CFLAGS'] = format('{CFLAGS} {FT2_CFLAGS}', vars, {})
if (vars.get('ac_cv_member_FT_Bitmap_Size_y_ppem', '') == 'yes'):
vars['HAVE_FT_BITMAP_SIZE_Y_PPEM'] = '1'
else:
vars['HAVE_FT_BITMAP_SIZE_Y_PPEM'] = '0'
vars['LIBS'] = vars.get('_SAVE_LIBS', '')
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
vars['_SAVE_CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['CPPFLAGS'] = format('{CPPFLAGS} {FT2_CFLAGS} {XCFLAGS}', vars, {})
vars['CPPFLAGS'] = vars.get('_SAVE_CPPFLAGS', '')
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'gtk3'):
vars['MOZ_TREE_CAIRO'] = ''
else:
vars['MOZ_TREE_CAIRO'] = '1'
if args.system_cairo:
vars['MOZ_TREE_CAIRO'] = ''
else:
vars['MOZ_TREE_CAIRO'] = '1'
vars['MOZ_TREE_PIXMAN'] = '1'
if args.system_pixman:
vars['MOZ_TREE_PIXMAN'] = ''
else:
vars['MOZ_TREE_PIXMAN'] = 'force'
if (vars.get('MOZ_TREE_PIXMAN', '') == 'force'):
if (not vars.get('MOZ_TREE_CAIRO', '')):
sys.stderr.write('configure: error: --disable-system-pixman is incompatible with --enable-system-cairo.\n')
sys.exit(1)
else:
vars['MOZ_TREE_PIXMAN'] = '1'
elif (not vars.get('MOZ_TREE_CAIRO', '')):
vars['MOZ_TREE_PIXMAN'] = ''
if vars.get('MOZ_TREE_PIXMAN', ''):
pass
else:
vars['MOZ_PIXMAN_CFLAGS'] = vars.get('PIXMAN_CFLAGS', '')
vars['MOZ_PIXMAN_LIBS'] = vars.get('PIXMAN_LIBS', '')
if vars.get('COMPILE_ENVIRONMENT', ''):
if (vars.get('ac_cv_header_inttypes_h', '') == 'yes'):
vars['HAVE_INTTYPES_H'] = '1'
if vars.get('MOZ_TREE_CAIRO', ''):
vars['MOZ_CAIRO_CFLAGS'] = '-I$(LIBXUL_DIST)/include/cairo'
if (vars.get('OS_ARCH', '') == 'WINNT'):
pass
vars['TEE_SURFACE_FEATURE'] = '#define CAIRO_HAS_TEE_SURFACE 1'
if vars.get('MOZ_X11', ''):
vars['XLIB_SURFACE_FEATURE'] = '#define CAIRO_HAS_XLIB_SURFACE 1'
vars['XLIB_XRENDER_SURFACE_FEATURE'] = '#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1'
vars['PS_SURFACE_FEATURE'] = '#define CAIRO_HAS_PS_SURFACE 1'
if vars.get('_HAVE_FREETYPE2', ''):
vars['FT_FONT_FEATURE'] = '#define CAIRO_HAS_FT_FONT 1'
vars['MOZ_ENABLE_CAIRO_FT'] = '1'
vars['CAIRO_FT_CFLAGS'] = vars.get('FT2_CFLAGS', '')
case = vars.get('MOZ_WIDGET_TOOLKIT', '')
if fnmatch.fnmatch(case, 'qt'):
vars['QT_SURFACE_FEATURE'] = '#define CAIRO_HAS_QT_SURFACE 1'
elif (fnmatch.fnmatch(case, 'cocoa') or fnmatch.fnmatch(case, 'uikit')):
vars['QUARTZ_SURFACE_FEATURE'] = '#define CAIRO_HAS_QUARTZ_SURFACE 1'
vars['QUARTZ_IMAGE_SURFACE_FEATURE'] = '#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1'
vars['QUARTZ_FONT_FEATURE'] = '#define CAIRO_HAS_QUARTZ_FONT 1'
elif fnmatch.fnmatch(case, 'windows'):
vars['WIN32_SURFACE_FEATURE'] = '#define CAIRO_HAS_WIN32_SURFACE 1'
vars['WIN32_FONT_FEATURE'] = '#define CAIRO_HAS_WIN32_FONT 1'
if (vars.get('MOZ_WINSDK_TARGETVER', '') >= '06010000'):
vars['WIN32_DWRITE_FONT_FEATURE'] = '#define CAIRO_HAS_DWRITE_FONT 1'
vars['WIN32_D2D_SURFACE_FEATURE'] = '#define CAIRO_HAS_D2D_SURFACE 1'
vars['MOZ_ENABLE_D2D_SURFACE'] = '1'
vars['MOZ_ENABLE_DWRITE_FONT'] = '1'
else:
vars['WIN32_DWRITE_FONT_FEATURE'] = ''
vars['WIN32_D2D_SURFACE_FEATURE'] = ''
if vars.get('WIN32_D2D_SURFACE_FEATURE', ''):
pass
elif fnmatch.fnmatch(case, 'gtk3'):
sys.stderr.write('configure: error: cairo-gtk3 toolkit is incompatible with in-tree cairo. Please add --enable-system-cairo to your build config.\n')
sys.exit(1)
if vars.get('USE_FC_FREETYPE', ''):
vars['FC_FONT_FEATURE'] = '#define CAIRO_HAS_FC_FONT 1'
vars['MOZ_CAIRO_OSLIBS'] = '${CAIRO_FT_OSLIBS}'
if vars.get('MOZ_X11', ''):
vars['MOZ_CAIRO_OSLIBS'] = format('{MOZ_CAIRO_OSLIBS} {XLDFLAGS} -lXrender', vars, {})
vars['CAIRO_FEATURES_H'] = 'gfx/cairo/cairo/src/cairo-features.h'
else:
vars['MOZ_CAIRO_CFLAGS'] = vars.get('CAIRO_CFLAGS', '')
vars['MOZ_CAIRO_LIBS'] = vars.get('CAIRO_LIBS', '')
if vars.get('MOZ_X11', ''):
vars['MOZ_CAIRO_LIBS'] = format('{MOZ_CAIRO_LIBS} {XLDFLAGS} {CAIRO_XRENDER_LIBS}', vars, {})
vars['MOZ_CAIRO_OSLIBS'] = vars.get('MOZ_CAIRO_LIBS', '')
vars['MOZ_CAIRO_CFLAGS'] = format('{MOZ_CAIRO_CFLAGS} {CAIRO_XRENDER_CFLAGS}', vars, {})
if vars.get('MOZ_ENABLE_SKIA', ''):
if (vars.get('MOZ_WIDGET_TOOLKIT', '') == ('android' or (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) == 'xgonk'))):
pass
if (vars.get('CPU_ARCH', '') != ('ppc' and (vars.get('CPU_ARCH', '') != ('ppc64' and (vars.get('CPU_ARCH', '') != 'sparc'))))):
vars['MOZ_ENABLE_SKIA_GPU'] = '1'
if vars.get('MOZ_XUL', ''):
pass
else:
vars['MOZ_EXTENSIONS'] = subprocess.check_output("echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/irc//' -e 's/tasks//'", shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_PROFILELOCKING', ''):
pass
vars['NECKO_PROTOCOLS'] = subprocess.check_output('${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}', shell=True, env=vars).rstrip('\n')
for p in for_loop(['{NECKO_PROTOCOLS}'], vars, {}):
vars['p'] = p
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES} NECKO_PROTOCOL_{p}', vars, {})
case = vars.get('OS_TARGET', '')
if fnmatch.fnmatch(case, 'Android'):
if vars.get('gonkdir', ''):
vars['NECKO_WIFI'] = '1'
elif (fnmatch.fnmatch(case, 'Darwin') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'SunOS') or fnmatch.fnmatch(case, 'WINNT')):
vars['NECKO_WIFI'] = '1'
elif fnmatch.fnmatch(case, 'Linux'):
vars['NECKO_WIFI'] = '1'
vars['NECKO_WIFI_DBUS'] = '1'
if vars.get('NECKO_WIFI', ''):
if ((not format('{MOZ_ENABLE_DBUS}', vars, {})) and format('{NECKO_WIFI_DBUS}', vars, {})):
sys.stderr.write('configure: error: Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi\n')
sys.exit(1)
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES} NECKO_WIFI', vars, {})
if vars.get('NECKO_COOKIES', ''):
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES} NECKO_COOKIES', vars, {})
if (format('{OS_TARGET}', vars, {}) != ('Android' and (format('x{MOZ_WIDGET_TOOLKIT}', vars, {}) != 'xgonk'))):
pass
if vars.get('ENABLE_MARIONETTE', ''):
pass
if vars.get('BUILD_CTYPES', ''):
pass
if vars.get('MOZ_PLACES', ''):
pass
if vars.get('MOZ_SOCIAL', ''):
pass
if vars.get('MOZ_SERVICES_COMMON', ''):
pass
if vars.get('MOZ_SERVICES_CRYPTO', ''):
pass
if vars.get('MOZ_SERVICES_HEALTHREPORT', ''):
pass
if vars.get('MOZ_SERVICES_METRICS', ''):
pass
if vars.get('MOZ_SERVICES_NOTIFICATIONS', ''):
pass
if vars.get('MOZ_SERVICES_SYNC', ''):
pass
if vars.get('MOZ_CAPTIVEDETECT', ''):
pass
if vars.get('MOZ_DEVICES', ''):
pass
if (format('{MOZ_DEBUG}', vars, {}) or (format('{NS_TRACE_MALLOC}', vars, {}) or format('{MOZ_DMD}', vars, {}))):
vars['MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS'] = ''
if vars.get('MOZ_APP_COMPONENT_INCLUDE', ''):
pass
if vars.get('MOZ_APP_COMPONENT_MODULES', ''):
pass
if vars.get('MOZ_JSDOWNLOADS', ''):
pass
vars['MOZ_MACBUNDLE_NAME'] = subprocess.check_output("echo $MOZ_APP_DISPLAYNAME | tr -d ' '", shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_MACBUNDLE_NAME_PREFIX', ''):
vars['MOZ_MACBUNDLE_NAME'] = format('{MOZ_MACBUNDLE_NAME_PREFIX}{MOZ_MACBUNDLE_NAME}', vars, {})
if vars.get('MOZ_DEBUG', ''):
vars['MOZ_MACBUNDLE_NAME'] = format('{MOZ_MACBUNDLE_NAME}Debug.app', vars, {})
else:
vars['MOZ_MACBUNDLE_NAME'] = format('{MOZ_MACBUNDLE_NAME}.app', vars, {})
vars['MOZ_MACBUNDLE_ID'] = subprocess.check_output("echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z'", shell=True, env=vars).rstrip('\n')
vars['MOZ_MACBUNDLE_ID'] = format('{MOZ_DISTRIBUTION_ID}.{MOZ_MACBUNDLE_ID}', vars, {})
if vars.get('MOZ_DEBUG', ''):
vars['MOZ_MACBUNDLE_ID'] = format('{MOZ_MACBUNDLE_ID}debug', vars, {})
if (vars.get('MOZ_WIDGET_TOOLKIT', '') != 'android'):
vars['MOZ_CHILD_PROCESS_NAME'] = format('plugin-container{BIN_SUFFIX}', vars, {})
else:
vars['MOZ_CHILD_PROCESS_NAME'] = 'lib/libplugin-container.so'
vars['MOZ_CHILD_PROCESS_BUNDLE'] = 'plugin-container.app/Contents/MacOS/'
if (not vars.get('MOZ_APP_NAME', '')):
vars['MOZ_APP_NAME'] = subprocess.check_output('echo $MOZ_APP_BASENAME | tr A-Z a-z', shell=True, env=vars).rstrip('\n')
vars['IS_ALPHA'] = subprocess.check_output('echo $MOZ_APP_VERSION | grep a', shell=True, env=vars).rstrip('\n')
if (not vars.get('IS_ALPHA', '')):
vars['MOZ_APP_MAXVERSION'] = format('{cmd0}.*', vars, {'cmd0':subprocess.check_output('echo $MOZ_APP_VERSION | sed "s|\\(^[0-9]*\\).*|\\1|"', shell=True, env=vars).rstrip('\n')})
else:
vars['MOZ_APP_MAXVERSION'] = vars.get('MOZ_APP_VERSION', '')
if (not vars.get('MOZ_B2G_VERSION', '')):
vars['MOZ_B2G_VERSION'] = '1.0.0'
if vars.get('MOZ_UA_OS_AGNOSTIC', ''):
pass
if vars.get('MOZ_TELEMETRY_REPORTING', ''):
if (not vars.get('RELEASE_BUILD', '')):
pass
if (not (((not vars.get('MOZ_TELEMETRY_REPORTING', '')) or (not vars.get('MOZ_SERVICES_HEALTHREPORT', ''))) or (not vars.get('MOZ_CRASHREPORTER', '')))):
vars['MOZ_DATA_REPORTING'] = '1'
vars['CFLAGS'] = subprocess.check_output('echo $_WARNINGS_CFLAGS $CFLAGS', shell=True, env=vars).rstrip('\n')
vars['CXXFLAGS'] = subprocess.check_output('echo $_WARNINGS_CXXFLAGS $CXXFLAGS', shell=True, env=vars).rstrip('\n')
vars['COMPILE_CFLAGS'] = subprocess.check_output('echo $_DEFINES_CFLAGS $_DEPEND_CFLAGS $COMPILE_CFLAGS', shell=True, env=vars).rstrip('\n')
vars['COMPILE_CXXFLAGS'] = subprocess.check_output('echo $_DEFINES_CXXFLAGS $_DEPEND_CFLAGS $COMPILE_CXXFLAGS', shell=True, env=vars).rstrip('\n')
vars['HOST_CFLAGS'] = subprocess.check_output('echo $HOST_CFLAGS $_DEPEND_CFLAGS', shell=True, env=vars).rstrip('\n')
vars['HOST_CXXFLAGS'] = subprocess.check_output('echo $HOST_CXXFLAGS $_DEPEND_CFLAGS', shell=True, env=vars).rstrip('\n')
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_NUWA_PROCESS}', vars, {}))):
exports.add('MOZ_NUWA_PROCESS')
if (format('{MOZ_WIDGET_TOOLKIT}', vars, {}) == ('gonk' and format('{MOZ_B2G_LOADER}', vars, {}))):
if (not vars.get('MOZ_NUWA_PROCESS', '')):
sys.stderr.write('configure: error: B2G loader works with Nuwa\n')
sys.exit(1)
exports.add('MOZ_B2G_LOADER')
vars['OS_CFLAGS'] = vars.get('CFLAGS', '')
vars['OS_CXXFLAGS'] = vars.get('CXXFLAGS', '')
vars['OS_CPPFLAGS'] = vars.get('CPPFLAGS', '')
vars['OS_COMPILE_CFLAGS'] = vars.get('COMPILE_CFLAGS', '')
vars['OS_COMPILE_CXXFLAGS'] = vars.get('COMPILE_CXXFLAGS', '')
vars['OS_LDFLAGS'] = vars.get('LDFLAGS', '')
vars['OS_LIBS'] = vars.get('LIBS', '')
if vars.get('MOZ_DEBUG', ''):
vars['MOZ_EM_DEBUG'] = '1'
if vars.get('COMPILE_ENVIRONMENT', ''):
if vars.get('MOZ_X11', ''):
if vars.get('WITHOUT_X11', ''):
sys.stderr.write('configure: error: --without-x specified and MOZ_X11 still defined\n')
sys.exit(1)
vars['_SAVE_CFLAGS'] = vars.get('CFLAGS', '')
vars['CFLAGS'] = format('{CFLAGS} {XCFLAGS}', vars, {})
vars['CFLAGS'] = vars.get('_SAVE_CFLAGS', '')
if vars.get('MISSING_X', ''):
sys.stderr.write('configure: error: Could not find the following X libraries: $MISSING_X \n')
sys.exit(1)
if (vars.get('OS_ARCH', '') != 'WINNT'):
pass
if vars.get('MOZ_DEBUG', ''):
pass
if (format('{ACCESSIBILITY}', vars, {}) and format('{MOZ_ENABLE_GTK}', vars, {})):
vars['ATK_FULL_VERSION'] = subprocess.check_output('$PKG_CONFIG --modversion atk', shell=True, env=vars).rstrip('\n')
vars['ATK_MAJOR_VERSION'] = subprocess.check_output("echo ${ATK_FULL_VERSION} | $AWK -F\\. '{ print $1 }'", shell=True, env=vars).rstrip('\n')
vars['ATK_MINOR_VERSION'] = subprocess.check_output("echo ${ATK_FULL_VERSION} | $AWK -F\\. '{ print $2 }'", shell=True, env=vars).rstrip('\n')
vars['ATK_REV_VERSION'] = subprocess.check_output("echo ${ATK_FULL_VERSION} | $AWK -F\\. '{ print $3 }'", shell=True, env=vars).rstrip('\n')
if vars.get('MOZ_DEBUG', ''):
vars['A11Y_LOG'] = '1'
case = vars.get('MOZ_UPDATE_CHANNEL', '')
if (fnmatch.fnmatch(case, 'aurora') or fnmatch.fnmatch(case, 'beta') or fnmatch.fnmatch(case, 'release') or fnmatch.fnmatch(case, 'esr')):
pass else:
vars['A11Y_LOG'] = '1'
if vars.get('A11Y_LOG', ''):
pass
vars['_NON_GLOBAL_ACDEFINES'] = format('{_NON_GLOBAL_ACDEFINES}\nCPP_THROW_NEW\nHAVE_CPP_AMBIGUITY_RESOLVING_USING\nHAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR\nHAVE_CPP_PARTIAL_SPECIALIZATION\nHAVE_CPP_TROUBLE_COMPARING_TO_ZERO\nNEED_CPP_UNUSED_IMPLEMENTATIONS\nHAVE_GETPAGESIZE\nHAVE_ICONV\nHAVE_ICONV_WITH_CONST_INPUT\nHAVE_MBRTOWC\nHAVE_WCRTOMB\nHAVE_STATVFS64\nHAVE_STATVFS\nHAVE_STATFS64\nHAVE_STATFS\nHAVE_SYS_STATVFS_H\nHAVE_SYS_STATFS_H\nHAVE_SYS_VFS_H\nHAVE_SYS_MOUNT_H\n', vars, {})
if (not ((not (vars.get('MOZ_WIDGET_TOOLKIT', '') == 'android')) or (not (vars.get('MOZ_BUILD_APP', '') == 'b2g')))):
vars['_INTL_API'] = 'no'
else:
vars['_INTL_API'] = 'yes'
if (not vars.get('JS_SHARED_LIBRARY', '')):
pass
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (not format('{LIBXUL_SDK_DIR}', vars, {}))):
pass
case = vars.get('host', '')
if fnmatch.fnmatch(case, '*-apple-darwin11*'):
vars['FIXED_EGREP'] = 'env ARCHPREFERENCE=i386,x86_64 arch egrep'
else:
vars['FIXED_EGREP'] = 'egrep'
if (not ((not ((not format('{MOZ_NATIVE_JEMALLOC}', vars, {})) and format('{MOZ_MEMORY}', vars, {}))) and (not (format('{MOZ_JEMALLOC3}', vars, {}) or format('{MOZ_REPLACE_MALLOC}', vars, {}))))):
vars['ac_configure_args'] = format('--build={build} --host={target} --enable-stats --with-jemalloc-prefix=je_', vars, {})
if vars.get('MOZ_REPLACE_MALLOC', ''):
vars['ac_configure_args'] = format('{ac_configure_args} ac_cv_func_memalign=yes', vars, {})
vars['ac_configure_args'] = format('{ac_configure_args} ac_cv_func_valloc=yes', vars, {})
if vars.get('MOZ_JEMALLOC3', ''):
case = vars.get('OS_ARCH', '')
if (fnmatch.fnmatch(case, 'WINNT') or fnmatch.fnmatch(case, 'Darwin')):
vars['ac_configure_args'] = format('{ac_configure_args} --without-export', vars, {})
elif (vars.get('OS_ARCH', '') == 'Darwin'):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-zone-allocator', vars, {})
vars['_MANGLE'] = 'malloc posix_memalign aligned_alloc calloc realloc free memalign valloc malloc_usable_size'
vars['JEMALLOC_WRAPPER'] = ''
if (not vars.get('MOZ_REPLACE_MALLOC', '')):
case = vars.get('OS_ARCH', '')
if (fnmatch.fnmatch(case, 'Linux') or fnmatch.fnmatch(case, 'DragonFly') or fnmatch.fnmatch(case, 'FreeBSD') or fnmatch.fnmatch(case, 'NetBSD') or fnmatch.fnmatch(case, 'OpenBSD')):
vars['MANGLE'] = vars.get('_MANGLE', '')
elif (not vars.get('MOZ_JEMALLOC3', '')):
vars['MANGLE'] = vars.get('_MANGLE', '')
vars['JEMALLOC_WRAPPER'] = 'replace_'
if vars.get('MANGLE', ''):
vars['MANGLED'] = ''
if (format('{_WRAP_MALLOC}', vars, {}) and (not format('{JEMALLOC_WRAPPER}', vars, {}))):
vars['JEMALLOC_WRAPPER'] = '__wrap_'
for mangle in for_loop(['{MANGLE}'], vars, {}):
vars['mangle'] = mangle
if vars.get('MANGLED', ''):
vars['MANGLED'] = format('{mangle}:{JEMALLOC_WRAPPER}{mangle},{MANGLED}', vars, {})
else:
vars['MANGLED'] = format('{mangle}:{JEMALLOC_WRAPPER}{mangle}', vars, {})
vars['ac_configure_args'] = format('{ac_configure_args} --with-mangling={MANGLED}', vars, {})
del vars['CONFIG_FILES']
if (not vars.get('MOZ_TLS', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-tls', vars, {})
vars['EXTRA_CFLAGS'] = vars.get('CFLAGS', '')
for var in ['AS', 'CC', 'CXX', 'CPP', 'LD', 'AR', 'RANLIB', 'STRIP', 'CPPFLAGS', 'EXTRA_CFLAGS', 'LDFLAGS']:
vars['var'] = var
vars['ac_configure_args'] = format("{ac_configure_args} {var}='{cmd0}'", vars, {'cmd0':subprocess.check_output('eval echo \\\\${${var}}', shell=True, env=vars).rstrip('\n')})
if vars.get('CROSS_COMPILE', ''):
vars['ac_configure_args'] = format('{ac_configure_args} je_cv_static_page_shift=12', vars, {})
if (not os.path.exists('memory/jemalloc')):
subprocess.call('mkdir -p memory/jemalloc', shell=True, env=vars)
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
if vars.get('MOZ_TREE_FREETYPE', ''):
vars['CFLAGS'] = format('{CFLAGS} {MOZ_DEBUG_FLAGS} -std=c99', vars, {})
exports.add('CFLAGS')
vars['CPPFLAGS'] = format('{CPPFLAGS} {MOZ_DEBUG_FLAGS}', vars, {})
exports.add('CPPFLAGS')
vars['CXXFLAGS'] = format('{CXXFLAGS} {MOZ_DEBUG_FLAGS}', vars, {})
exports.add('CXXFLAGS')
vars['LDFLAGS'] = format('{LDFLAGS} {MOZ_DEBUG_LDFLAGS}', vars, {})
exports.add('LDFLAGS')
if vars.get('MOZ_NATIVE_PNG', ''):
vars['LIBPNG_CFLAGS'] = format('{MOZ_PNG_CFLAGS} ', vars, {})
exports.add('LIBPNG_CFLAGS')
else:
vars['LIBPNG_CFLAGS'] = format('-I{_objdir}/dist/include', vars, {})
exports.add('LIBPNG_CFLAGS')
vars['LIBPNG_LIBS'] = format('{MOZ_PNG_LIBS} ', vars, {})
exports.add('LIBPNG_LIBS')
vars['ZLIB_CFLAGS'] = format('{MOZ_ZLIB_CFLAGS} ', vars, {})
exports.add('ZLIB_CFLAGS')
vars['ZLIB_LIBS'] = format('{MOZ_ZLIB_LIBS} ', vars, {})
exports.add('ZLIB_LIBS')
vars['CONFIG_FILES'] = 'unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in'
exports.add('CONFIG_FILES')
vars['ac_configure_args'] = format('{ac_configure_args} --host={target} --disable-shared --with-pic=yes --with-zlib=yes --without-bzip2 --with-png=yes --without-harfbuzz', vars, {})
if (not os.path.exists('modules')):
subprocess.call('mkdir modules', shell=True, env=vars)
if (not vars.get('direct_nspr_config', '')):
vars['CC'] = vars.get('_SUBDIR_CC', '')
vars['CXX'] = vars.get('_SUBDIR_CXX', '')
vars['CFLAGS'] = vars.get('_SUBDIR_CFLAGS', '')
vars['CPPFLAGS'] = vars.get('_SUBDIR_CPPFLAGS', '')
vars['CXXFLAGS'] = vars.get('_SUBDIR_CXXFLAGS', '')
vars['LDFLAGS'] = vars.get('_SUBDIR_LDFLAGS', '')
vars['HOST_CC'] = vars.get('_SUBDIR_HOST_CC', '')
vars['HOST_CFLAGS'] = vars.get('_SUBDIR_HOST_CFLAGS', '')
vars['HOST_CXXFLAGS'] = vars.get('_SUBDIR_HOST_CXXFLAGS', '')
vars['HOST_LDFLAGS'] = vars.get('_SUBDIR_HOST_LDFLAGS', '')
vars['RC'] = ''
del vars['MAKEFILES']
del vars['CONFIG_FILES']
if vars.get('_subconfigure_subdir', ''):
vars['_save_ac_configure_args'] = vars.get('ac_configure_args', '')
vars['ac_configure_args'] = vars.get('_subconfigure_config_args', '')
vars['ac_configure_args'] = vars.get('_save_ac_configure_args', '')
if (format('{COMPILE_ENVIRONMENT}', vars, {}) and (not format('{LIBXUL_SDK_DIR}', vars, {}))):
exports.add('WRAP_LDFLAGS')
if vars.get('_WRAP_MALLOC', ''):
vars['_SUBDIR_CONFIG_ARGS'] = subprocess.check_output("echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'", shell=True, env=vars).rstrip('\n')
vars['CC'] = vars.get('_SUBDIR_CC', '')
vars['CXX'] = vars.get('_SUBDIR_CXX', '')
vars['CFLAGS'] = vars.get('_SUBDIR_CFLAGS', '')
vars['CPPFLAGS'] = vars.get('_SUBDIR_CPPFLAGS', '')
vars['CXXFLAGS'] = vars.get('_SUBDIR_CXXFLAGS', '')
vars['LDFLAGS'] = vars.get('_SUBDIR_LDFLAGS', '')
vars['HOST_CC'] = vars.get('_SUBDIR_HOST_CC', '')
vars['HOST_CFLAGS'] = vars.get('_SUBDIR_HOST_CFLAGS', '')
vars['HOST_CXXFLAGS'] = vars.get('_SUBDIR_HOST_CXXFLAGS', '')
vars['HOST_LDFLAGS'] = vars.get('_SUBDIR_HOST_LDFLAGS', '')
vars['RC'] = ''
if vars.get('ENABLE_CLANG_PLUGIN', ''):
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
vars['dist'] = format('{MOZ_BUILD_ROOT}/dist', vars, {})
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
vars['ac_configure_args'] = subprocess.check_output("echo $ac_configure_args | sed -e 's/--with-system-nspr\\S* *//'", shell=True, env=vars).rstrip('\n')
vars['ac_configure_args'] = format('{ac_configure_args} --enable-threadsafe', vars, {})
if (vars.get('_INTL_API', '') == 'no'):
vars['ac_configure_args'] = format('{ac_configure_args} --without-intl-api', vars, {})
if vars.get('BUILD_CTYPES', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --enable-ctypes', vars, {})
if (not vars.get('JS_SHARED_LIBRARY', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-shared-js', vars, {})
if vars.get('MOZ_DISABLE_EXPORT_JS', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-export-js', vars, {})
if (not vars.get('JSGC_USE_EXACT_ROOTING', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-exact-rooting', vars, {})
if (not vars.get('JSGC_GENERATIONAL', '')):
vars['ac_configure_args'] = format('{ac_configure_args} --disable-gcgenerational', vars, {})
if vars.get('JS_GC_SMALL_CHUNK_SIZE', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --enable-small-chunk-size', vars, {})
if (format('{NSPR_CFLAGS}', vars, {}) or format('{NSPR_LIBS}', vars, {})):
vars['ac_configure_args'] = format("{ac_configure_args} --with-nspr-cflags='{NSPR_CFLAGS}'", vars, {})
vars['ac_configure_args'] = format("{ac_configure_args} --with-nspr-libs='{NSPR_LIBS}'", vars, {})
vars['ac_configure_args'] = format('{ac_configure_args} --prefix={dist}', vars, {})
if vars.get('MOZ_MEMORY', ''):
vars['ac_configure_args'] = format('{ac_configure_args} --enable-jemalloc', vars, {})
if vars.get('MOZ_GLUE_LDFLAGS', ''):
exports.add('MOZ_GLUE_LDFLAGS')
if vars.get('MOZ_GLUE_PROGRAM_LDFLAGS', ''):
exports.add('MOZ_GLUE_PROGRAM_LDFLAGS')
if vars.get('ZLIB_IN_MOZGLUE', ''):
vars['MOZ_ZLIB_LIBS'] = ''
exports.add('MOZ_NATIVE_ZLIB')
exports.add('MOZ_ZLIB_CFLAGS')
exports.add('MOZ_ZLIB_LIBS')
exports.add('MOZ_APP_NAME')
vars['DONT_POPULATE_VIRTUALENV'] = '1'
exports.add('DONT_POPULATE_VIRTUALENV')
exports.add('PYTHON')
vars['MOZILLA_CENTRAL_PATH'] = vars.get('_topsrcdir', '')
exports.add('MOZILLA_CENTRAL_PATH')
exports.add('STLPORT_CPPFLAGS')
exports.add('STLPORT_LDFLAGS')
exports.add('STLPORT_LIBS')
vars['JS_STANDALONE'] = 'no'
exports.add('JS_STANDALONE')
exports.add('MOZ_LINKER')
exports.add('ZLIB_IN_MOZGLUE')
if (not os.path.exists('js')):
subprocess.call('mkdir js', shell=True, env=vars)
vars['ac_configure_args'] = vars.get('_SUBDIR_CONFIG_ARGS', '')
vars['WRITE_MOZINFO'] = '1'
exports.add('WRITE_MOZINFO')
del vars['WRITE_MOZINFO']
if (__name__ == '__main__'):
main(sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment