aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-dpdk/m4
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2015-03-07 22:47:40 -0500
committerVenkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>2015-03-16 12:13:30 +0530
commit9a29c9544c19061a7c6d0bcf1716e9c25d65b2fd (patch)
tree4ab7e9ef0479afa50aa99e69d9671da99002bdce /platform/linux-dpdk/m4
parent0bb5f377e380fce106c0715f3299938c7933a50b (diff)
linux-dpdk: m4: add configure.m4
When reusing linux-generic atomic.h, use of the built support is checked at configure time, until the odp-dpdk implementation uses the dpdk defined http://dpdk.org/doc/api/rte__atomic_8h.html it should do the same. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
Diffstat (limited to 'platform/linux-dpdk/m4')
-rw-r--r--platform/linux-dpdk/m4/configure.m417
1 files changed, 17 insertions, 0 deletions
diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4
new file mode 100644
index 000000000..00f2f897b
--- /dev/null
+++ b/platform/linux-dpdk/m4/configure.m4
@@ -0,0 +1,17 @@
+AC_MSG_CHECKING(for GCC atomic builtins)
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [[int main() {
+ int v = 1;
+ __atomic_fetch_add(&v, 1, __ATOMIC_RELAXED);
+ __atomic_fetch_sub(&v, 1, __ATOMIC_RELAXED);
+ __atomic_store_n(&v, 1, __ATOMIC_RELAXED);
+ __atomic_load_n(&v, __ATOMIC_RELAXED);
+ return 0;
+ }
+ ]])],
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no)
+ echo "GCC-style __atomic builtins not supported by the compiler."
+ echo "Use newer version. For gcc > 4.7.0"
+ exit -1)