aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/m4/odp_netmap.m4
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/m4/odp_netmap.m4')
-rw-r--r--platform/linux-generic/m4/odp_netmap.m447
1 files changed, 47 insertions, 0 deletions
diff --git a/platform/linux-generic/m4/odp_netmap.m4 b/platform/linux-generic/m4/odp_netmap.m4
new file mode 100644
index 000000000..72c3fab2e
--- /dev/null
+++ b/platform/linux-generic/m4/odp_netmap.m4
@@ -0,0 +1,47 @@
+##########################################################################
+# Enable netmap support
+##########################################################################
+AC_ARG_ENABLE([netmap_support],
+ [ --enable-netmap-support include netmap IO support],
+ [if test x$enableval = xyes; then
+ netmap_support=yes
+ fi])
+
+##########################################################################
+# Set optional netmap path
+##########################################################################
+AC_ARG_WITH([netmap-path],
+AC_HELP_STRING([--with-netmap-path=DIR path to netmap root directory],
+ [(or in the default path if not specified).]),
+ [NETMAP_PATH=$withval
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$NETMAP_PATH/sys"
+ netmap_support=yes],[])
+
+##########################################################################
+# Save and set temporary compilation flags
+##########################################################################
+OLD_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
+
+##########################################################################
+# Check for netmap availability
+##########################################################################
+if test x$netmap_support = xyes
+then
+ AC_CHECK_HEADERS([net/netmap_user.h], [],
+ [AC_MSG_FAILURE(["can't find netmap header"])])
+ ODP_CFLAGS="$ODP_CFLAGS -DODP_NETMAP"
+else
+ netmap_support=no
+fi
+
+# Disable cast errors until the problem in netmap_user.h is fixed upstream
+if test x$netmap_support = xyes
+then
+ODP_CFLAGS_EXTRA="$ODP_CFLAGS_EXTRA -Wno-cast-qual"
+fi
+
+##########################################################################
+# Restore old saved variables
+##########################################################################
+CPPFLAGS=$OLD_CPPFLAGS \ No newline at end of file