Check for pthread in Libc
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 Check for pthread in Libc
Some libc like Googles's Bionic for
Android include pThread. Instead of checking
for Android as in commit 58a052effb2305655ff1b7233c78ab24fc25257e this patch checks for pthread in libc as proposed
by Thomas Petazzoni <[email protected]>
--- Makefile.am | 2 +- configure.ac | 9 +++++++++ tests/benchmark/Makefile.am | 2 +- tests/regression/Makefile.am | 2 +- tests/unit/Makefile.am | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-)
Makefile.am +1 -1
@@ -5,7 +5,7 @@ INCLUDES = -I$(top_builddir)/urcu #Add the -version-info directly here since we are only building # library that use the version-info AM_LDFLAGS=-version-info $(URCU_LIBRARY_VERSION) -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS+=-lpthread endif AM_CFLAGS=-Wall
configure.ac +9 -0
@@ -165,6 +165,15 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ compat_futex_test=1 ]) +# Check for pthread +AC_CHECK_LIB([pthread], [pthread_create], + [AM_CONDITIONAL(LIBC_INCLUDES_PTHREAD, false)], + [AC_CHECK_LIB([c], [pthread_create], + [AM_CONDITIONAL(LIBC_INCLUDES_PTHREAD, true)], + [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] + )] +) + AM_CONDITIONAL([COMPAT_FUTEX], [test "x$compat_futex_test" = "x1"]) AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = "xx86compat"]) AM_CONDITIONAL([NO_SHARED], [test "x$enable_shared" = "xno"])
tests/benchmark/Makefile.am +1 -1
@@ -1,4 +1,4 @@ -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS=-lpthread endif AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g
tests/regression/Makefile.am +1 -1
@@ -1,4 +1,4 @@ -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS=-lpthread endif AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g
tests/unit/Makefile.am +1 -1
@@ -1,4 +1,4 @@ -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS=-lpthread endif AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g
Signature · 1 line
1.8.4.2
A message that is not in the archive (sent off-list or not yet received): [email protected]
Both patches merged, thanks!
Mathieu
----- Original Message -----
Quoted 89 lines
From: "Charles Briere" <[email protected]>
To: "mathieu desnoyers" <[email protected]>
Cc: [email protected], "Charles Briere" <[email protected]>
Sent: Monday, December 2, 2013 3:00:50 AM
Subject: [PATCH liburcu 2/2] Check for pthread in LibcSome libc like Googles's Bionic for
Android include pThread. Instead of checking
for Android as in commit58a052effb2305655ff1b7233c78ab24fc25257ethis patch checks for pthread in libc as proposed
by Thomas Petazzoni <[email protected]>Signed-off-by Charles Briere <[email protected]>--- Makefile.am | 2 +- configure.ac | 9 +++++++++ tests/benchmark/Makefile.am | 2 +- tests/regression/Makefile.am | 2 +- tests/unit/Makefile.am | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-)Makefile.am +1
-1@@ -5,7 +5,7 @@ INCLUDES = -I$(top_builddir)/urcu #Add the -version-info directly here since we are only building # library that use the version-info AM_LDFLAGS=-version-info $(URCU_LIBRARY_VERSION) -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS+=-lpthread endif AM_CFLAGS=-Wallconfigure.ac +6
-0@@ -165,6 +165,15 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ compat_futex_test=1 ]) +# Check for pthread +AC_CHECK_LIB([pthread], [pthread_create], + [AM_CONDITIONAL(LIBC_INCLUDES_PTHREAD, false)], + [AC_CHECK_LIB([c], [pthread_create], + [AM_CONDITIONAL(LIBC_INCLUDES_PTHREAD, true)], + [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify itslocation.])]
configure.ac +3
-0+ )] +) + AM_CONDITIONAL([COMPAT_FUTEX], [test "x$compat_futex_test" = "x1"]) AM_CONDITIONAL([COMPAT_ARCH], [test "x$SUBARCHTYPE" = "xx86compat"]) AM_CONDITIONAL([NO_SHARED], [test "x$enable_shared" = "xno"])tests/benchmark/Makefile.am +1
-1@@ -1,4 +1,4 @@ -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS=-lpthread endif AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -gtests/regression/Makefile.am +1
-1@@ -1,4 +1,4 @@ -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS=-lpthread endif AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -gtests/unit/Makefile.am +1
-2@@ -1,4 +1,4 @@ -if !TARGET_IS_ANDROID +if !LIBC_INCLUDES_PTHREAD AM_LDFLAGS=-lpthread endif AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g --1.8.4.2
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com