4063
4065
# try harder, when checking for __thread support, see bug 521750 comment #33 and below
4066
# We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
4067
# enabled, the linker in xcode 4.1 will crash. Without this it would crash when
4064
4069
_SAVE_LDFLAGS=$LDFLAGS
4065
LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS"
4070
LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
4066
4071
AC_CACHE_CHECK(for __thread keyword for TLS variables,
4067
4072
ac_cv_thread_keyword,
4068
4073
[AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
5519
5522
MOZ_UPDATE_CHANNEL=default
5521
5524
AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
5525
AC_SUBST(MOZ_UPDATE_CHANNEL)
5523
5527
# tools/update-packaging is not checked out by default.
5524
5528
MOZ_ARG_ENABLE_BOOL(update-packaging,
5884
if test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
5885
dnl On Windows, OSX and OS2, we want to link all our binaries against mozutils
5886
MOZ_UTILS_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozutils,$(LIBXUL_DIST)/lib)'
5888
dnl On other Unix systems, we only want to link executables against mozutils
5889
MOZ_UTILS_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozutils,$(LIBXUL_DIST)/lib) $(MKSHLIB_UNFORCE_ALL)'
5890
if test -n "$GNU_CC"; then
5891
dnl And we need mozutils symbols to be exported.
5892
MOZ_UTILS_PROGRAM_LDFLAGS="$MOZ_UTILS_PROGRAM_LDFLAGS -rdynamic"
5880
5896
if test "$MOZ_MEMORY"; then
5882
5897
dnl Don't try to run compiler tests on Windows
5883
5898
if test "$OS_ARCH" = "WINNT"; then
5884
5899
if test -z "$HAVE_64BIT_OS"; then
5927
5942
*-msvc*|*-mks*|*-mingw*)
5928
5943
AC_DEFINE(MOZ_MEMORY_WINDOWS)
5929
dnl This is sort of awful. Will revisit if we add support for more versions
5930
if test "$CC_VERSION" != "14.00.50727.762" -a "$CC_VERSION" != "15.00.30729.01"; then
5931
AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 or 2008 SP1 currently.])
5933
if test -z "$WIN32_CRT_SRC_DIR"; then
5934
if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
5935
AC_MSG_ERROR([When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you).])
5937
WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
5940
case "${target_cpu}" in
5942
MOZ_CRT_CPU_ARCH=intel
5945
MOZ_CRT_CPU_ARCH=amd64
5948
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
5952
AC_SUBST(MOZ_CRT_CPU_ARCH)
5954
if test ! -d "$WIN32_CRT_SRC_DIR"; then
5955
AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
5957
WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
5958
_objdir_win=`pwd -W`
5959
WIN32_CUSTOM_CRT_DIR="$_objdir_win/mozilla/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
5960
MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
5944
if test -z "$MOZ_DEBUG"; then
5945
WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
5947
WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
5949
dnl Look for a broken crtdll.obj
5950
WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
5951
lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
5952
if grep -q '__imp__\{0,1\}free' crtdll.obj; then
5953
MOZ_UTILS_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
5961
5957
dnl Also pass this to NSPR/NSS
5962
DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
5958
DLLFLAGS="$DLLFLAGS $MOZ_UTILS_LDFLAGS"
5963
5959
export DLLFLAGS
5983
5979
AC_SUBST(MOZ_MEMORY)
5984
AC_SUBST(MOZ_MEMORY_LDFLAGS)
5985
AC_SUBST(WIN32_CRT_SRC_DIR)
5980
AC_SUBST(MOZ_UTILS_LDFLAGS)
5981
AC_SUBST(MOZ_UTILS_PROGRAM_LDFLAGS)
5982
AC_SUBST(WIN32_CRT_LIBS)
5986
5983
dnl Need to set this for make because NSS doesn't have configure
5987
5984
AC_SUBST(DLLFLAGS)
7231
7228
cat >> $_CONFIG_TMP <<\EOF
7230
/* The c99 defining the limit macros (UINT32_MAX for example), says:
7231
* C++ implementations should define these macros only when __STDC_LIMIT_MACROS
7232
* is defined before <stdint.h> is included. */
7233
#define __STDC_LIMIT_MACROS
7233
7235
#endif /* _COMM_CONFIG_H_ */