aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-07-12 23:53:55 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-07-12 23:53:55 +0000
commit12efa1daab03424c213845607285594e5c475bbe (patch)
treeaceaa9dd4c3bd52c31a20cc8390f98b3d10626cd
parent42f23f2f68533a73f2537cec672c2bcfa5f65fa0 (diff)
downloadpaludis-12efa1daab03424c213845607285594e5c475bbe.tar.gz
paludis-12efa1daab03424c213845607285594e5c475bbe.tar.xz
(Better) fix for threads with Python and Ruby.
-rw-r--r--configure.ac102
-rw-r--r--python/Makefile.am1
2 files changed, 51 insertions, 52 deletions
diff --git a/configure.ac b/configure.ac
index bab8148..cff41cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -434,6 +434,57 @@ then
AC_MSG_RESULT([no])
fi
+AC_MSG_CHECKING([whether to enable threads])
+PTHREAD_LIBS=""
+AC_ARG_ENABLE([threads],
+ AS_HELP_STRING([--enable-threads], [Enable threads (experimental)]),
+ [ENABLE_THREADS=$enableval],
+ [ENABLE_THREADS=no])
+AC_MSG_RESULT([$ENABLE_THREADS])
+AC_SUBST([ENABLE_THREADS])
+if test "x$ENABLE_THREADS" = "xyes" ; then
+ AC_MSG_CHECKING([for compiler __thread support])
+ AC_COMPILE_IFELSE([
+int main(int, char **)
+{
+ static __thread int x(0);
+ return x;
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([--enable-threads requires compiler __thread support])])
+
+ AC_MSG_CHECKING([whether -pthread -lpthread gets us posix threads])
+ save_CXXFLAGS=$CXXFLAGS
+ save_LDFLAGS=$LDFLAGS
+ CXXFLAGS="$CXXFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread -lpthread"
+ AC_LINK_IFELSE([
+#include <pthread.h>
+int main(int, char **)
+{
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_init(&attr);
+ return 0;
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([don't know how to enable pthreads for your compiler])])
+ CXXFLAGS=$save_CXXFLAGS
+ LDFLAGS=$save_LDFLAGS
+ PALUDIS_CXXFLAGS="$PALUDIS_CXXFLAGS -DPALUDIS_ENABLE_THREADS=1 -pthread"
+ PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_ENABLE_THREADS=1 -pthread"
+ PTHREAD_LIBS="-pthread -lpthread"
+ PALUDIS_PC_LIBS="${PALUDIS_PC_LIBS} -pthread -lpthread"
+ PALUDIS_ENABLE_THREADS=1
+else
+ PALUDIS_ENABLE_THREADS=0
+fi
+AC_SUBST([PALUDIS_ENABLE_THREADS])
+AC_SUBST([PTHREAD_LIBS])
+
PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST=
PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS=
PALUDIS_CXXFLAGS_NO_WSHADOW=
@@ -561,57 +612,6 @@ else
fi
AC_SUBST([PALUDIS_ENABLE_VISIBILITY])
AC_SUBST([PALUDIS_CXXFLAGS_VISIBILITY])
-
-AC_MSG_CHECKING([whether to enable threads])
-PTHREAD_LIBS=""
-AC_ARG_ENABLE([threads],
- AS_HELP_STRING([--enable-threads], [Enable threads (experimental)]),
- [ENABLE_THREADS=$enableval],
- [ENABLE_THREADS=no])
-AC_MSG_RESULT([$ENABLE_THREADS])
-AC_SUBST([ENABLE_THREADS])
-if test "x$ENABLE_THREADS" = "xyes" ; then
- AC_MSG_CHECKING([for compiler __thread support])
- AC_COMPILE_IFELSE([
-int main(int, char **)
-{
- static __thread int x(0);
- return x;
-}
-],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([--enable-threads requires compiler __thread support])])
-
- AC_MSG_CHECKING([whether -pthread -lpthread gets us posix threads])
- save_CXXFLAGS=$CXXFLAGS
- save_LDFLAGS=$LDFLAGS
- CXXFLAGS="$CXXFLAGS -pthread"
- LDFLAGS="$LDFLAGS -pthread -lpthread"
- AC_LINK_IFELSE([
-#include <pthread.h>
-int main(int, char **)
-{
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- return 0;
-}
-],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([don't know how to enable pthreads for your compiler])])
- CXXFLAGS=$save_CXXFLAGS
- LDFLAGS=$save_LDFLAGS
- PALUDIS_CXXFLAGS="$PALUDIS_CXXFLAGS -DPALUDIS_ENABLE_THREADS=1 -pthread"
- PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_ENABLE_THREADS=1 -pthread"
- PTHREAD_LIBS="-pthread -lpthread"
- PALUDIS_PC_LIBS="${PALUDIS_PC_LIBS} -pthread -lpthread"
- PALUDIS_ENABLE_THREADS=1
-else
- PALUDIS_ENABLE_THREADS=0
-fi
-AC_SUBST([PALUDIS_ENABLE_THREADS])
-AC_SUBST([PTHREAD_LIBS])
dnl }}}
dnl {{{ sandbox
diff --git a/python/Makefile.am b/python/Makefile.am
index fef149a..a200e94 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -2,7 +2,6 @@ SUBDIRS = .
AM_CXXFLAGS = -I$(top_srcdir) -I$(srcdir)/ \
-I$(top_builddir)/ \
- @PALUDIS_CXXFLAGS@ \
@PALUDIS_CXXFLAGS_WITHOUT_PEDANTIC@ \
@PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS@ \
@PALUDIS_CXXFLAGS_NO_WUNUSED@ \