diff mbox series

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

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

Commit Message

Github ODP bot July 1, 2017, 6 a.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: eee6b6add9a03184bf2f3198f07e983bb88c0e0a
 **/
 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 4c23d136..efe5777e 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -260,6 +260,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)
 
 if HAVE_PCAP
 __LIB__libodp_linux_la_LIBADD += $(PCAP_LIBS)
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])