Bug 967300 - enable cairo's atomic support on gcc-esque compilers; r=mshal

Cairo has a number of nifty features predicated on support for atomic
operations on integer types.  Normally, such support would be determined
by cairo's configure script.  But since we don't run cairo's configure
script, we need to manually define HAVE_INTEL_ATOMIC_PRIMITIVES during
cairo's build.  That macro enables codepaths that depend on certain
SIZEOF_* variables being defined by autoconf, so we also need to add the
necessary code in moz.build to set those.
This commit is contained in:
Nathan Froyd 2015-01-15 15:53:28 -05:00
parent 6052813f7f
commit bde3bbdb83

View File

@ -199,6 +199,18 @@ for var in ('MOZ_TREE_CAIRO', 'MOZ_TREE_PIXMAN'):
if CONFIG[var]:
DEFINES[var] = True
if CONFIG['GNU_CC']:
DEFINES['HAVE_INTEL_ATOMIC_PRIMITIVES'] = True
# We would normally use autoconf to set these up, using AC_CHECK_SIZEOF.
# But AC_CHECK_SIZEOF requires running programs to determine the sizes,
# and that doesn't work so well with cross-compiling. So instead we
# use these magic macros, available since at least GCC 4.3, to define
# the preprocessor macros cairo wanted from autoconf.
DEFINES['SIZEOF_VOID_P'] = '__SIZEOF_POINTER__'
DEFINES['SIZEOF_INT'] = '__SIZEOF_INT__'
DEFINES['SIZEOF_LONG'] = '__SIZEOF_LONG__'
DEFINES['SIZEOF_LONG_LONG'] = '__SIZEOF_LONG_LONG__'
# Normally determined by cairo's configure script.
DEFINES['HAVE_UINT64_T'] = True