From 3425b16d521b8846b95df2b7d32a548d93341f3b Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 14 Nov 2010 21:29:32 +0000 Subject: xserver pixman libX11 libXext 14/11/2010 --- pixman/configure.ac | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'pixman/configure.ac') diff --git a/pixman/configure.ac b/pixman/configure.ac index ad975f494..d1265ab11 100644 --- a/pixman/configure.ac +++ b/pixman/configure.ac @@ -740,6 +740,33 @@ AC_SUBST(HAVE_PTHREAD_SETSPECIFIC) AC_SUBST(PTHREAD_LDFLAGS) AC_SUBST(PTHREAD_LIBS) +dnl ===================================== +dnl __attribute__((constructor)) + +support_for_attribute_constructor=no + +AC_MSG_CHECKING(for __attribute__((constructor))) +AC_LINK_IFELSE([ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) +/* attribute 'constructor' is supported since gcc 2.7, but some compilers + * may only pretend to be gcc, so let's try to actually use it + */ +static int x = 1; +static void __attribute__((constructor)) constructor_function () { x = 0; } +int main (void) { return x; } +#else +#error not gcc or gcc version is older than 2.7 +#endif +], support_for_attribute_constructor=yes) + +if test x$support_for_attribute_constructor = xyes; then + AC_DEFINE([TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR], + [],[Whether the tool chain supports __attribute__((constructor))]) +fi + +AC_MSG_RESULT($support_for_attribute_constructor) +AC_SUBST(TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR) + AC_OUTPUT([pixman-1.pc pixman-1-uninstalled.pc Makefile -- cgit v1.2.3