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

Message ID 1507316415-2144-4-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • Another build system update
Related show

Commit Message

Github ODP bot Oct. 6, 2017, 6:59 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 213 (lumag:plat-def)
 ** https://github.com/Linaro/odp/pull/213
 ** Patch: https://github.com/Linaro/odp/pull/213.patch
 ** Base sha: a63f25ff2994b2df78c24f1f8b63d0e06628eb68
 ** Merge commit sha: d50e2e291ff11c1319e66c699d2f82260d59c383
 **/
 {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%)

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])