diff mbox series

[v3,3/20] m4: move timer_create check to common place

Message ID 1507226415-26756-4-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v3,1/20] .gitignore: ignore only libtool m4 files | expand

Commit Message

Github ODP bot Oct. 5, 2017, 5:59 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 213 (lumag:plat-def)
 ** https://github.com/Linaro/odp/pull/213
 ** Patch: https://github.com/Linaro/odp/pull/213.patch
 ** Base sha: 52cfe7ba6d2541cf5ee464e46e91b2da5efe1497
 ** Merge commit sha: 4157d06d3a16265d7d6152d7ae4918ec5623c10c
 **/
 {platform/linux-generic/m4 => m4}/odp_timer.m4 | 7 +++++--
 platform/linux-generic/m4/configure.m4         | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
 rename {platform/linux-generic/m4 => m4}/odp_timer.m4 (63%)
diff mbox series

Patch

diff --git a/platform/linux-generic/m4/odp_timer.m4 b/m4/odp_timer.m4
similarity index 63%
rename from platform/linux-generic/m4/odp_timer.m4
rename to m4/odp_timer.m4
index 3122c92b4..9a552f9ff 100644
--- a/platform/linux-generic/m4/odp_timer.m4
+++ b/m4/odp_timer.m4
@@ -1,8 +1,11 @@ 
+# ODP_TIMER([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 ##########################################################################
 # Check for POSIX timer functions
 ##########################################################################
-
+AC_DEFUN([ODP_TIMER], [dnl
 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])])])
+			   [m4_default([$2], [AC_MSG_FAILURE([timer_create not found])])])])
+m4_default([$1], [:])
 AC_SUBST([TIMER_LIBS])
+]) # ODP_TIMER
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 63540c7eb..4d6ef49b9 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -75,7 +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])
+ODP_TIMER
 ODP_OPENSSL
 m4_include([platform/linux-generic/m4/odp_pcap.m4])
 m4_include([platform/linux-generic/m4/odp_netmap.m4])