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

Message ID 1497391207-13288-8-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series
  • Rework the way ODP links with other libraries
Related show

Commit Message

Github ODP bot June 13, 2017, 10 p.m.
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: 7cf390d11e69f6b677e6fbfd6414944737406fc3
 ** Merge commit sha: 3808f2b5af9d034f6157eb2c7eec543ee8055fbf
 **/
 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

Patch

diff --git a/configure.ac b/configure.ac
index 883cd337..cf824d3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -345,8 +345,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 d421931d..7928f54a 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -226,6 +226,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_SOURCES += pktio/pcap.c
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 6a429f1d..34f36d92 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -74,6 +74,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])