summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2006-11-21 22:01:39 -0800
committerJamey Sharp <jamey@minilop.net>2006-11-21 22:01:39 -0800
commit5d98a6e665f62127a884fdc5534163ece807aba1 (patch)
tree8778e62f90237e984a1f1bde0821c223e32a0ad6 /configure.ac
downloadxcb-pthread-stubs-5d98a6e665f62127a884fdc5534163ece807aba1.tar.gz
Library that provides pthread stubs that are missing from your platform libc.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..c08f62d
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,40 @@
+AC_INIT([libpthread-stubs],
+ 0.1,
+ [xcb@lists.freedesktop.org])
+AC_CONFIG_SRCDIR([pthread-stubs.pc.in])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+
+AC_CONFIG_HEADERS([config.h])
+
+AC_PROG_LIBTOOL
+AC_PROG_CC
+
+
+dnl Detection code for compilers supporting the __attribute__((weak, alias))
+dnl feature. Original code present in unieject's repository
+dnl Diego Pettenò <flameeyes@gentoo.org>
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+AC_CACHE_CHECK([if compiler supports __attribute__((weak, alias))],
+ [cc_cv_attribute_alias],
+ [AC_COMPILE_IFELSE([
+ void other_function(void *foo) { }
+ void some_function(void *foo) __attribute__((weak, alias("other_function")));
+ ],
+ [cc_cv_attribute_alias=yes],
+ [cc_cv_attribute_alias=no])
+ ])
+CFLAGS="$ac_save_CFLAGS"
+if test "x$cc_cv_attribute_alias" = "xyes"; then
+ AC_DEFINE([SUPPORT_ATTRIBUTE_ALIAS], 1, [Define this if the compiler supports the alias attribute])
+fi
+
+
+PKG_CONFIG_LIBS=
+AC_CHECK_FUNCS([pthread_self pthread_mutex_init pthread_mutex_destroy pthread_mutex_lock pthread_mutex_unlock pthread_cond_init pthread_cond_destroy pthread_cond_wait pthread_cond_signal pthread_cond_broadcast pthread_equal],
+ [], [PKG_CONFIG_LIBS='-L${libdir} -lpthread-stubs'])
+AC_SUBST([PKG_CONFIG_LIBS])
+AM_CONDITIONAL(BUILD_LIB, test x$PKG_CONFIG_LIBS != x)
+
+AC_CONFIG_FILES([Makefile pthread-stubs.pc])
+AC_OUTPUT