[4/4] linux-generic: move pthread checks inside linux-generic

Message ID 1438679443-3047-5-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Aug. 4, 2015, 9:10 a.m.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 configure.ac                             | 14 --------------
 platform/linux-generic/m4/configure.m4   |  1 +
 platform/linux-generic/m4/odp_pthread.m4 | 13 +++++++++++++
 3 files changed, 14 insertions(+), 14 deletions(-)
 create mode 100644 platform/linux-generic/m4/odp_pthread.m4

Patch

diff --git a/configure.ac b/configure.ac
index 0d246dc..7e4f6d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,18 +202,6 @@  AC_ARG_ENABLE([debug],
 ODP_CFLAGS="$ODP_CFLAGS -DODP_DEBUG=$ODP_DEBUG"
 
 ##########################################################################
-# Check for pthreads availability
-##########################################################################
-
-AX_PTHREAD([CC="$PTHREAD_CC"], [
-    echo "Error! We require pthreads to be available"
-    exit -1
-    ])
-LIBS="$PTHREAD_LIBS $LIBS"
-AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
-AM_LDFLAGS="$AM_LDFLAGS $PTHREAD_LDFLAGS"
-
-##########################################################################
 # Check for doxygen availability
 ##########################################################################
 AC_CHECK_PROGS([DOXYGEN], [doxygen])
@@ -296,8 +284,6 @@  AC_SEARCH_LIBS([timer_create],[rt posix4])
 ##########################################################################
 # distribute the changed variables among the Makefiles
 
-AM_LDFLAGS="$AM_LDFLAGS -pthread -lrt"
-
 AC_SUBST([LIBS])
 AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([CPPFLAGS])
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 22add4b..afdef7b 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -17,6 +17,7 @@  AC_LINK_IFELSE(
     exit -1)
 
 m4_include([platform/linux-generic/m4/odp_openssl.m4])
+m4_include([platform/linux-generic/m4/odp_pthread.m4])
 
 AC_CONFIG_FILES([platform/linux-generic/Makefile
 		 platform/linux-generic/test/Makefile
diff --git a/platform/linux-generic/m4/odp_pthread.m4 b/platform/linux-generic/m4/odp_pthread.m4
new file mode 100644
index 0000000..7f39103
--- /dev/null
+++ b/platform/linux-generic/m4/odp_pthread.m4
@@ -0,0 +1,13 @@ 
+##########################################################################
+# Check for pthreads availability
+##########################################################################
+
+AX_PTHREAD([CC="$PTHREAD_CC"], [
+    echo "Error! We require pthreads to be available"
+    exit -1
+    ])
+LIBS="$PTHREAD_LIBS $LIBS"
+AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
+AM_LDFLAGS="$AM_LDFLAGS $PTHREAD_LDFLAGS"
+
+AM_LDFLAGS="$AM_LDFLAGS -pthread -lrt"