aboutsummaryrefslogtreecommitdiffstats
path: root/m4/pthread.m4
diff options
context:
space:
mode:
authorMatthew Fioravante <matthew.fioravante@jhuapl.edu>2013-01-18 10:55:47 +0000
committerMatthew Fioravante <matthew.fioravante@jhuapl.edu>2013-01-18 10:55:47 +0000
commit1f44053686221af63cca7be601d74c835777d89b (patch)
tree27d24907804e6e78e16f8a2757c1b88a74c12883 /m4/pthread.m4
parente627fcdae7b08d3ec7b04284bd3f5f7ae277f4f5 (diff)
downloadxen-1f44053686221af63cca7be601d74c835777d89b.tar.gz
xen-1f44053686221af63cca7be601d74c835777d89b.tar.bz2
xen-1f44053686221af63cca7be601d74c835777d89b.zip
stubdom: Add autoconf
Stub domains now use autoconf to build. This configure script can enable or disable specific domains and also specify custom download locations for stubdom library packages. See ./configure --help for details. C and Caml are disabled by default. vtpm-stubdom is conditional on the presense of cmake. Rename vtpmmgrdom to vtpmmgr-stubdom Also update .*ignore Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'm4/pthread.m4')
-rw-r--r--m4/pthread.m441
1 files changed, 41 insertions, 0 deletions
diff --git a/m4/pthread.m4 b/m4/pthread.m4
new file mode 100644
index 0000000000..c8189991be
--- /dev/null
+++ b/m4/pthread.m4
@@ -0,0 +1,41 @@
+# We define, separately, PTHREAD_CFLAGS, _LDFLAGS and _LIBS
+# even though currently we don't set them very separately.
+# This means that the makefiles will not need to change in
+# the future if we make the test more sophisticated.
+
+AC_DEFUN([AX_PTHREAD_CV2VARS],[
+ PTHREAD_CFLAGS="$ax_cv_pthread_flags"
+ PTHREAD_LDFLAGS="$ax_cv_pthread_flags"
+ PTHREAD_LIBS=""
+])
+
+# We invoke AX_PTHREAD_VARS with the name of another macro
+# which is then expanded once for each variable.
+AC_DEFUN([AX_PTHREAD_VARS],[$1(CFLAGS) $1(LDFLAGS) $1(LIBS)])
+
+AC_DEFUN([AX_PTHREAD_VAR_APPLY],[
+ $1="$$1 $PTHREAD_$1"
+])
+AC_DEFUN([AX_PTHREAD_VAR_SUBST],[AC_SUBST(PTHREAD_$1)])
+
+AC_DEFUN([AX_CHECK_PTHREAD],[
+ AC_CACHE_CHECK([for pthread flag], [ax_cv_pthread_flags], [
+ ax_cv_pthread_flags=-pthread
+ AX_PTHREAD_CV2VARS
+ AX_PTHREAD_VARS([AX_SAVEVAR_SAVE])
+ AX_PTHREAD_VARS([AX_PTHREAD_VAR_APPLY])
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
+#include <pthread.h>
+int main(void) {
+ pthread_atfork(0,0,0);
+ pthread_create(0,0,0,0);
+}
+])],[],[ax_cv_pthread_flags=failed])
+ AX_PTHREAD_VARS([AX_SAVEVAR_RESTORE])
+ ])
+ if test "x$ax_cv_pthread_flags" = xfailed; then
+ AC_MSG_ERROR([-pthread does not work])
+ fi
+ AX_PTHREAD_CV2VARS
+ AX_PTHREAD_VARS([AX_PTHREAD_VAR_SUBST])
+])