зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1293837 - Move HAVE_64BIT_BUILD test to python configure. r=chmanchester
Also, now that we're using modern C++11 compilers, we can just rely on static_assert, instead of the pile of macros used in the autoconf test. --HG-- extra : rebase_source : 85d507da653d07e6527a971082277486e3502ea2
This commit is contained in:
Родитель
93ac00658e
Коммит
a918e97bfa
|
@ -766,6 +766,13 @@ host_cxx_compiler = compiler('C++', host, c_compiler=host_c_compiler,
|
|||
|
||||
include('compile-checks.configure')
|
||||
|
||||
have_64_bit = try_compile(body='static_assert(sizeof(void *) == 8, "")',
|
||||
check_msg='for 64-bit OS')
|
||||
|
||||
set_config('HAVE_64BIT_BUILD', have_64_bit)
|
||||
set_define('HAVE_64BIT_BUILD', have_64_bit)
|
||||
add_old_configure_assignment('HAVE_64BIT_BUILD', have_64_bit)
|
||||
|
||||
@depends(c_compiler)
|
||||
def default_debug_flags(compiler_info):
|
||||
# Debug info is ON by default.
|
||||
|
|
|
@ -449,48 +449,6 @@ dnl Configure platform-specific CPU architecture compiler options.
|
|||
dnl ==============================================================
|
||||
MOZ_ARCH_OPTS
|
||||
|
||||
dnl =================================================================
|
||||
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
|
||||
dnl which is bad when cross compiling.
|
||||
dnl =================================================================
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
configure_static_assert_macros='
|
||||
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
|
||||
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
|
||||
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
|
||||
'
|
||||
|
||||
dnl test that the macros actually work:
|
||||
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
|
||||
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
ac_cv_static_assertion_macros_work="yes"
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(1)],
|
||||
,
|
||||
ac_cv_static_assertion_macros_work="no")
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(0)],
|
||||
ac_cv_static_assertion_macros_work="no",
|
||||
)
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(1)],
|
||||
,
|
||||
ac_cv_static_assertion_macros_work="no")
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(0)],
|
||||
ac_cv_static_assertion_macros_work="no",
|
||||
)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
|
||||
if test "$ac_cv_static_assertion_macros_work" = "no"; then
|
||||
AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
|
||||
fi
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl ========================================================
|
||||
dnl Android libstdc++, placed here so it can use MOZ_ARCH
|
||||
dnl computed above.
|
||||
|
@ -588,25 +546,6 @@ else
|
|||
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_JS_CONFDEFS_H_ $(ACDEFINES)'
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Checking for 64-bit OS
|
||||
dnl ========================================================
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
AC_MSG_CHECKING(for 64-bit OS)
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
|
||||
result="yes", result="no")
|
||||
AC_MSG_RESULT("$result")
|
||||
if test "$result" = "yes"; then
|
||||
AC_DEFINE(HAVE_64BIT_BUILD)
|
||||
HAVE_64BIT_BUILD=1
|
||||
fi
|
||||
AC_SUBST(HAVE_64BIT_BUILD)
|
||||
AC_LANG_RESTORE
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl ========================================================
|
||||
dnl System overrides of the defaults for host
|
||||
dnl ========================================================
|
||||
|
|
|
@ -609,48 +609,6 @@ else
|
|||
fi
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl =================================================================
|
||||
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
|
||||
dnl which is bad when cross compiling.
|
||||
dnl =================================================================
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
configure_static_assert_macros='
|
||||
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
|
||||
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
|
||||
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
|
||||
'
|
||||
|
||||
dnl test that the macros actually work:
|
||||
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
|
||||
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
ac_cv_static_assertion_macros_work="yes"
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(1)],
|
||||
,
|
||||
ac_cv_static_assertion_macros_work="no")
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(0)],
|
||||
ac_cv_static_assertion_macros_work="no",
|
||||
)
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(1)],
|
||||
,
|
||||
ac_cv_static_assertion_macros_work="no")
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(0)],
|
||||
ac_cv_static_assertion_macros_work="no",
|
||||
)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
|
||||
if test "$ac_cv_static_assertion_macros_work" = "no"; then
|
||||
AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
|
||||
fi
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
dnl ========================================================
|
||||
dnl Android libstdc++, placed here so it can use MOZ_ARCH
|
||||
dnl computed above.
|
||||
|
@ -816,26 +774,6 @@ else
|
|||
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Checking for 64-bit OS
|
||||
dnl ========================================================
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_C
|
||||
AC_MSG_CHECKING(for 64-bit OS)
|
||||
AC_TRY_COMPILE([$configure_static_assert_macros],
|
||||
[CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
|
||||
result="yes", result="no")
|
||||
AC_MSG_RESULT("$result")
|
||||
if test "$result" = "yes"; then
|
||||
AC_DEFINE(HAVE_64BIT_BUILD)
|
||||
HAVE_64BIT_BUILD=1
|
||||
fi
|
||||
AC_SUBST(HAVE_64BIT_BUILD)
|
||||
AC_LANG_RESTORE
|
||||
fi # COMPILE_ENVIRONMENT
|
||||
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use Valgrind
|
||||
dnl ========================================================
|
||||
|
|
|
@ -82,7 +82,7 @@ class ToolLauncher(object):
|
|||
env[e] = extra_env[e]
|
||||
|
||||
# For VC12+, make sure we can find the right bitness of pgort1x0.dll
|
||||
if not buildconfig.substs['HAVE_64BIT_BUILD']:
|
||||
if not buildconfig.substs.get('HAVE_64BIT_BUILD'):
|
||||
for e in ('VS140COMNTOOLS', 'VS120COMNTOOLS'):
|
||||
if e not in env:
|
||||
continue
|
||||
|
|
Загрузка…
Ссылка в новой задаче