diff mbox series

[v3,7/9] linux-gen: move timer_create check to platform directory

Message ID 1498863614-26294-8-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v3,1/9] pkgconfig: provide minimal proper static linking flags | expand

Commit Message

Github ODP bot June 30, 2017, 11 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 45 (lumag:m4)
 ** https://github.com/Linaro/odp/pull/45
 ** Patch: https://github.com/Linaro/odp/pull/45.patch
 ** Base sha: ceeab69f3af67701adb524c7b9757d19cefb1110
 ** Merge commit sha: bc5ee5a9b895a630b180cd264a55c8e4817de750
 **/
 configure.ac                           | 2 --
 pkgconfig/libodp-linux.pc.in           | 2 +-
 platform/linux-generic/Makefile.am     | 1 +
 platform/linux-generic/m4/configure.m4 | 1 +
 platform/linux-generic/m4/odp_timer.m4 | 8 ++++++++
 5 files changed, 11 insertions(+), 3 deletions(-)
 create mode 100644 platform/linux-generic/m4/odp_timer.m4
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 8e518a16..d3059ffb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -363,8 +363,6 @@  AC_CONFIG_FILES([Makefile
 		 pkgconfig/libodphelper.pc
 		 ])
 
-AC_SEARCH_LIBS([timer_create],[rt posix4])
-
 ##########################################################################
 # distribute the changed variables among the Makefiles
 
diff --git a/pkgconfig/libodp-linux.pc.in b/pkgconfig/libodp-linux.pc.in
index 860c1cae..220dbc9c 100644
--- a/pkgconfig/libodp-linux.pc.in
+++ b/pkgconfig/libodp-linux.pc.in
@@ -7,5 +7,5 @@  Name: libodp-linux
 Description: The ODP packet processing engine
 Version: @PKGCONFIG_VERSION@
 Libs: -L${libdir} -lodp-linux @DPDK_LIBS@
-Libs.private: @OPENSSL_STATIC_LIBS@ @DPDK_PMDS@ @DPDK_LIBS@ @PCAP_LIBS@ @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@
+Libs.private: @OPENSSL_STATIC_LIBS@ @DPDK_PMDS@ @DPDK_LIBS@ @PCAP_LIBS@ @PTHREAD_LIBS@ @TIMER_LIBS@ -lpthread @ATOMIC_LIBS@
 Cflags: -I${includedir}
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index e81057e5..dff10980 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -261,6 +261,7 @@  __LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS)
 __LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS)
 __LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS) $(DPDK_PMDS)
 __LIB__libodp_linux_la_LIBADD += $(PTHREAD_LIBS)
+__LIB__libodp_linux_la_LIBADD += $(TIMER_LIBS)
 
 # Create symlink for ABI header files. Application does not need to use the arch
 # specific include path for installed files.
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index c8164b8c..8e008de4 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -75,6 +75,7 @@  fi
 AC_SUBST([ATOMIC_LIBS])
 
 m4_include([platform/linux-generic/m4/odp_pthread.m4])
+m4_include([platform/linux-generic/m4/odp_timer.m4])
 m4_include([platform/linux-generic/m4/odp_openssl.m4])
 m4_include([platform/linux-generic/m4/odp_pcap.m4])
 m4_include([platform/linux-generic/m4/odp_netmap.m4])
diff --git a/platform/linux-generic/m4/odp_timer.m4 b/platform/linux-generic/m4/odp_timer.m4
new file mode 100644
index 00000000..3122c92b
--- /dev/null
+++ b/platform/linux-generic/m4/odp_timer.m4
@@ -0,0 +1,8 @@ 
+##########################################################################
+# Check for POSIX timer functions
+##########################################################################
+
+AC_CHECK_LIB([rt], [timer_create], [TIMER_LIBS="-lrt"],
+	     [AC_CHECK_LIB([posix4], [timer_create], [TIMER_LIBS="-lposix4"],
+			   [AC_MSG_FAILURE([timer_create not found])])])
+AC_SUBST([TIMER_LIBS])