summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2010-07-11 17:29:07 +0300
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2010-07-11 21:40:26 +0300
commit3f1d7de8e1620ad385930477b63454107dd8ffd3 (patch)
treecd09df0035c487c16d6cda7a5e7a70ac8741c1af /build
parentfca8977219b857e2e61dd86ac39ae9f40086f306 (diff)
build: Fix regression provoked by newer autoconf and dodgy configuring.
We're not supposed to be redefining PACKAGE_VERSION, PACKAGE_... from the configure generated confdefs.h. This patch rudely adds paper over the problem. The compiler warnings are a problem for us since our checking of various compiler flags assumes that no news is good news, and that any warning messages are due to the flags under test. The regression appears when using an autoconf >= 2.64, at least, but not with 2.61. The same issue appears in the pthread test because our conftest unconditionally #defines _GNU_SOURCE, but autoconf ends up doing that in the confdefs.h.
Diffstat (limited to 'build')
-rw-r--r--build/configure.ac.noversion13
-rw-r--r--build/configure.ac.pthread2
2 files changed, 14 insertions, 1 deletions
diff --git a/build/configure.ac.noversion b/build/configure.ac.noversion
index 1e145482..18c4bd5f 100644
--- a/build/configure.ac.noversion
+++ b/build/configure.ac.noversion
@@ -5,8 +5,19 @@ dnl
dnl Disable autoconf's version macros. We try hard to not rebuild the entire
dnl library just because version changed. The PACKAGE_VERSION* stuff in
dnl config.h is negating all the effort.
+dnl
+dnl We're not actually supposed to be doing this, and indeed adding the
+dnl AC_DEFINEs below causes confdefs.h to contain duplicate incompatible
+dnl #defines for the same PACKAGE_* symbols. Those are provoking warnings
+dnl from the compiler, and that throws our CAIRO_TRY_LINK_*_ checks off,
+dnl because they think that there's something wrong with some flag they're
+dnl testing rather than confdefs.h! So let's do the gross thing and puke
+dnl into confdefs.h some #undefs.
+echo '#undef PACKAGE_VERSION' >>confdefs.h
+echo '#undef PACKAGE_STRING' >>confdefs.h
+echo '#undef PACKAGE_NAME' >>confdefs.h
+echo '#undef PACKAGE_TARNAME' >>confdefs.h
AC_DEFINE(PACKAGE_VERSION, [USE_cairo_version_OR_cairo_version_string_INSTEAD])
AC_DEFINE(PACKAGE_STRING, [USE_cairo_version_OR_cairo_version_string_INSTEAD])
AC_DEFINE(PACKAGE_NAME, [USE_cairo_INSTEAD])
AC_DEFINE(PACKAGE_TARNAME, [USE_cairo_INSTEAD])
-
diff --git a/build/configure.ac.pthread b/build/configure.ac.pthread
index 93c967a7..b25d6b71 100644
--- a/build/configure.ac.pthread
+++ b/build/configure.ac.pthread
@@ -46,7 +46,9 @@ dnl A program to test all the pthread features we need to be able to
dnl compile libcairo itself. We could test the features independently,
dnl but we need all of them anyway.
m4_define([libcairo_pthread_program],[dnl
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* for PTHREAD_MUTEX_INITIALIZER under linux */
+#endif
#include <pthread.h>
pthread_mutex_t test_mutex_initializer = PTHREAD_MUTEX_INITIALIZER;