diff mbox

[PATCHv2,2/3] linux-generic: move pthread checks inside linux-generic

Message ID 1438945258-12898-3-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit a2d4eb703033ba73d8ac0ac2368ce40ab1f44bab
Headers show

Commit Message

Maxim Uvarov Aug. 7, 2015, 11 a.m. UTC
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 configure.ac                             | 16 ----------------
 platform/linux-generic/m4/configure.m4   |  2 ++
 platform/linux-generic/m4/odp_pthread.m4 | 13 +++++++++++++
 3 files changed, 15 insertions(+), 16 deletions(-)
 create mode 100644 platform/linux-generic/m4/odp_pthread.m4
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index a994080..41646b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,8 +153,6 @@  AC_ARG_ENABLE([test-helper],
 AM_CONDITIONAL([test_helper], [test x$test_helper = xyes ])
 
 ##########################################################################
-
-##########################################################################
 # Enable/disable test-cpp
 ##########################################################################
 test_cpp=no
@@ -202,18 +200,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])
@@ -330,8 +316,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 bb92198..ddac90e 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -16,6 +16,8 @@  AC_LINK_IFELSE(
     echo "Use newer version. For gcc > 4.7.0"
     exit -1)
 
+m4_include([platform/linux-generic/m4/odp_pthread.m4])
+
 AC_CONFIG_FILES([platform/linux-generic/Makefile
 		 platform/linux-generic/test/Makefile
 		 platform/linux-generic/test/pktio/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"