diff options
author | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2010-03-11 02:50:25 +0200 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2010-05-05 11:02:37 +0200 |
commit | 26010a37d1196ada662c239f33eef41396b9b353 (patch) | |
tree | fc5dfd67d82ef31c10e3ac9b5cfb99de13bd0823 /configure.ac | |
parent | be486b72eb0695684307e1c169b7a76337d12581 (diff) | |
download | xcb-pthread-stubs-26010a37d1196ada662c239f33eef41396b9b353.tar.gz |
Generate stubs.c at autogen time from a template file.
It's easier to add a line to a list of functions in a template
file than copy-pasting five lines of template from other entries
and editing configure.ac.
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 3a12a1a..ef300ad 100644 --- a/configure.ac +++ b/configure.ac @@ -29,10 +29,17 @@ 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 +dnl Grab the list of functions to test for from our template file. +m4_define([funclist], []) +m4_define([alias], [m4_if([$1],[na],[], [m4_append([funclist], [$3 ])])]) +m4_divert_push([KILL]) +m4_include([list.m4]) +m4_divert_pop([KILL]) +dnl Check which functions we need to provide aliases for. 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_condattr_init pthread_condattr_destroy pthread_cond_wait pthread_cond_timedwait pthread_cond_signal pthread_cond_broadcast pthread_equal pthread_exit], - [], [PKG_CONFIG_LIBS='-L${libdir} -lpthread-stubs']) +AC_CHECK_FUNCS(funclist, [], [PKG_CONFIG_LIBS='-L${libdir} -lpthread-stubs']) + AC_SUBST([PKG_CONFIG_LIBS]) AM_CONDITIONAL(BUILD_LIB, test "x$PKG_CONFIG_LIBS" != x) |