aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2018-02-21 17:19:12 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-03-06 19:31:28 +0300
commit534667daec58ce8b2e417709e788934bea6f8f09 (patch)
tree2bb72f5d120817e516e97cdac56c00e2d9729e49 /m4
parentf3cf9c3583364af7625679d0021c4d55c3414994 (diff)
linux-gen: add runtime configuration file
Enables changing ODP runtime configuration options by using an optional configuration file (libconfig). Path to the conf file is passed using environment variable ODP_CONF_FILE. If ODP_CONF_FILE or a particular option is not set, hardcoded default values are used instead. An template configuration file is provided in config/odp-linux.conf. Runtime configuration is initially used by DPDK pktio to set NIC options. Adds new dependency to libconfig library. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'm4')
-rw-r--r--m4/odp_libconfig.m420
1 files changed, 20 insertions, 0 deletions
diff --git a/m4/odp_libconfig.m4 b/m4/odp_libconfig.m4
new file mode 100644
index 000000000..18275f075
--- /dev/null
+++ b/m4/odp_libconfig.m4
@@ -0,0 +1,20 @@
+# ODP_LIBCONFIG
+# -------------
+AC_DEFUN([ODP_LIBCONFIG],
+[dnl
+##########################################################################
+# Check for libconfig availability
+##########################################################################
+PKG_CHECK_MODULES([LIBCONFIG], [libconfig])
+
+##########################################################################
+# Create a header file odp_libconfig_config.h which containins null
+# terminated hex dump of odp-linux.conf
+##########################################################################
+AC_CONFIG_COMMANDS([platform/${with_platform}/include/odp_libconfig_config.h],
+[mkdir -p platform/${with_platform}/include
+ (cd ${srcdir}/config ; xxd -i odp-${with_platform}.conf) | \
+ sed 's/\([[0-9a-f]]\)$/\0, 0x00/' > \
+ platform/${with_platform}/include/odp_libconfig_config.h],
+ [with_platform=$with_platform])
+]) # ODP_LIBCONFIG