Commit graph

16 commits

Author SHA1 Message Date
Andrea Canciani
190d8d7290 build: Silence autoconf warnings
Autoconf 2.86 reports:

warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
2011-06-20 11:07:33 +02:00
M Joonas Pihlaja
47c35e5e86 build: Purge CAIRO_CC_TRY_LINK_FLAG.
Use CAIRO_CC_TRY_FLAG instead in the one place where we used
CAIRO_CC_TRY_LINK_FLAG and make the build system one macro
smaller.
2010-07-11 21:40:26 +03:00
M Joonas Pihlaja
d2f5592e0e build: Factor out a more pliable CAIRO_CC_TRY_LINK_WITH_ENV_SILENT.
Introduce a new CAIRO_CC_TRY_LINK_WITH_ENV_SILENT macro for running
generic link tests with arbitrary CFLAGS/LIBS/LDFLAGS and no muttering
of autoconf messages.  Rewrite the previous CAIRO_CC_TRY_FLAG in terms
of it.
2010-07-11 21:40:25 +03:00
Andrea Canciani
248af38b3e atomic: Add MacOSX atomic implementation
Enable atomic operation on MacOS X, using the functions provided by
libkern/OSAtomic.h

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-04-29 10:52:48 +02:00
M Joonas Pihlaja
d5609ca04e [build] Check compiler flags using AC_TRY_LINK instead of AC_TRY_COMPILE.
Turns out we were passing suncc warning suppression flags to gcc
by mistake since -e<entry point> is actually a valid option for
gcc.  This caused the -erroff=E_ENUM_TYPE_MISMATCH_ARG and other
-erroff options to be passed to the linker.  In the normal case
of a GNU ld linker this doesn't matter since it ignores bogus
entry points, but the GNU gold linker replaces a bogus entry
point with NULL.  This patch makes the CAIRO_CC_TRY_FLAG()
check stricter by testing that the flag doesn't interfere with
linking executables.
2009-10-15 17:47:33 +03:00
Chris Wilson
ef9286751d [atomic] Fallback to libatomic-ops-dev
Use libatomic-ops-dev in preference to mutex-based atomics, if we do not
have the builtin atomic intrinsics available.
2009-10-15 13:05:46 +01:00
M Joonas Pihlaja
c086b40a93 [build] Hush the Solaris compiler about enum abuse.
Sun Studio 12 doesn't like it when we mix our
enum values and types.  We do that a lot on purpose
so the warnings from compiles were very verbose.
2009-09-02 06:38:15 +03:00
M Joonas Pihlaja
f081a5ff55 [build] Refine the -Wno-attribute test to check our use cases.
We don't actually check that -Wno-attribute does what
we think it does.  On clang it doesn't since it happily
seems to recognize but ignore the attribute.

This patch factors out a silent version of CAIRO_CC_TRY_FLAG
which accepts an optional program argument and actually tests
that the compiler doesn't produce any warning messages.  It
is then used to check that -Wno-attribute doesn't complain
when the __warn_unused_result__ attribute is applied to
void functions or variables.
2009-09-02 06:35:14 +03:00
Chris Wilson
195fd27cc6 [build] Use AC_LINK_IFELSE for testing linker flags.
Richard Hult reported that -Wl,--allow-shlib-undefined was incorrectly
being identified as supported by gcc under Mac OS/X:

configure:25103: checking whether gcc supports -Wl,--allow-shlib-undefined
configure:25117: gcc -c -Werror -Wl,--allow-shlib-undefined  conftest.c
>&5
i686-apple-darwin9-gcc-4.0.1: --allow-shlib-undefined: linker input file
unused because linking not done

So instead of just checking whether the compiler accepts the flag, check
that we can actually link a dummy file.
2008-10-23 11:16:40 +01:00
Chris Wilson
fd1f3c27e0 [configure] Check for atomic xchg.
Bug 18140 identifies a case where we have an atomic increment, but not an
atomic exchange. We need both to implement atomic reference counting, so
add a second check to detect whether __sync_val_compare_and_swap
generates a non-atomic instruction.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=18140.
2008-10-21 09:23:15 +01:00
Behdad Esfahbod
d84752605a Make sure (and check) that all private headers include some cairo header first
The macros CAIRO_BEGIN_DECLS and CAIRO_END_DECLS are declared in two
places: config.h and cairo.h.  On Win32 build there is no config.h.  So,
we can't rely on pulling CAIRO_BEGIN_DECLS from there.  Hence, we now:

  * Not add those declarations to config.h anymore,

  * Test that every cairo private header includes some other cairo
    header before any other includes.

These two are fairly enough to ensure that cairo.h is seen from all
private headers.  There's still the case of headers not including
any header file at all.  I'll fix that later.
2008-09-19 17:19:10 -04:00
Behdad Esfahbod
24c51ee177 [acinclude.m4] Add compat macros for autoconf 2.59 2008-09-18 03:12:03 -04:00
Behdad Esfahbod
2161cb5baf [configure.ac] Warn if no native surface backend is enabled, err if no native font 2008-09-16 19:45:02 -04:00
Behdad Esfahbod
879b5c7057 [aclocal] Move CAIRO_PARSE_VERSION to acinclude.m4
It belongs there as it includes other files.  It was breaking build
on older autoconf it seems.
2008-09-15 19:18:06 -04:00
Behdad Esfahbod
2b4a26f097 [configure.ac] Add CAIRO_BEGINEND_DECLS 2008-09-11 04:21:29 -04:00
Behdad Esfahbod
b7a838261b Move m4 macros into build/aclocal.*.m4 files 2008-09-11 04:17:43 -04:00