diff options
-rw-r--r-- | m4/odp_libconfig.m4 | 14 | ||||
-rw-r--r-- | platform/linux-generic/m4/odp_libconfig.m4 | 12 |
2 files changed, 21 insertions, 5 deletions
diff --git a/m4/odp_libconfig.m4 b/m4/odp_libconfig.m4 index 6b5bca268..d25a41422 100644 --- a/m4/odp_libconfig.m4 +++ b/m4/odp_libconfig.m4 @@ -1,5 +1,5 @@ -# ODP_LIBCONFIG(PLATFORM) -# ----------------------- +# ODP_LIBCONFIG(PLATFORM, CONFIG-FILE-PATH) +# ----------------------------------------- AC_DEFUN([ODP_LIBCONFIG], [dnl ########################################################################## @@ -14,6 +14,12 @@ AC_CHECK_PROGS([OD], [od]) AC_PROG_SED AS_IF([test -z "$OD"], [AC_MSG_ERROR([Could not find 'od'])]) +########################################################################## +# Check default configuration file +########################################################################## +AS_IF([test -z "$2"] || [test ! -f $2], + [AC_MSG_ERROR([Default configuration file not found])], []) + odp_use_config=true ########################################################################## # Create a header file odp_libconfig_config.h which containins null @@ -22,9 +28,9 @@ odp_use_config=true AC_CONFIG_COMMANDS([platform/$1/include/odp_libconfig_config.h], [mkdir -p platform/$1/include (echo "static const char config_builtin[[]] = {"; \ - $OD -An -v -tx1 < ${srcdir}/config/odp-$1.conf | \ + $OD -An -v -tx1 < $CONFIG_FILE | \ $SED -e 's/[[0-9a-f]]\+/0x\0,/g' ; \ echo "0x00 };") > \ platform/$1/include/odp_libconfig_config.h], - [with_platform=$with_platform OD=$OD SED=$SED]) + [with_platform=$1 OD=$OD SED=$SED CONFIG_FILE=$2]) ]) # ODP_LIBCONFIG diff --git a/platform/linux-generic/m4/odp_libconfig.m4 b/platform/linux-generic/m4/odp_libconfig.m4 index 9bc1ba1be..f042d65d7 100644 --- a/platform/linux-generic/m4/odp_libconfig.m4 +++ b/platform/linux-generic/m4/odp_libconfig.m4 @@ -15,4 +15,14 @@ AC_SUBST(_ODP_CONFIG_VERSION_MAJOR) _ODP_CONFIG_VERSION_MINOR=_odp_config_version_minor AC_SUBST(_ODP_CONFIG_VERSION_MINOR) -ODP_LIBCONFIG([$with_platform]) +########################################################################## +# Set optional path for the default configuration file +########################################################################## +default_config_path="${srcdir}/config/odp-$with_platform.conf" + +AC_ARG_WITH([config-file], +AS_HELP_STRING([--with-config-file=FILE path to the default configuration file], + [(this file must include all configuration options).]), + [default_config_path=$withval], []) + +ODP_LIBCONFIG([$with_platform], [$default_config_path]) |