diff options
author | Thomas Pansiot <thomas.pansiot@nokia.com> | 2020-06-04 12:15:09 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2020-06-10 08:12:38 +0300 |
commit | 065e4d728ffb4f11d2510ade23559da6abc746dd (patch) | |
tree | 18e2ddec6bed23897bbdec10019a257731fe019a | |
parent | 7c984fc96d20b76c2734a540e79d827665076fa1 (diff) |
linux-gen: use provided conf file for install and rebuild
When providing a conf file with "--with-config-file",
- In case of change in this file, rebuild was not doing anything
- In case of change in generic conf file, rebuild was using
generic conf file instead of provided one to regenerate / rebuild
- Generic conf file was installed
Signed-off-by: Thomas Pansiot <thomas.pansiot@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | platform/Makefile.inc | 4 | ||||
-rw-r--r-- | platform/linux-generic/Makefile.am | 4 | ||||
-rw-r--r-- | platform/linux-generic/m4/odp_libconfig.m4 | 9 |
4 files changed, 13 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 697e4f486..d22858d09 100644 --- a/configure.ac +++ b/configure.ac @@ -498,6 +498,7 @@ AC_MSG_RESULT([ test_example: ${test_example} user_guides: ${user_guides} pcapng: ${have_pcapng} + default_config_path: ${default_config_path} ]) AS_IF([test "${with_openssl}" = "no"], diff --git a/platform/Makefile.inc b/platform/Makefile.inc index f99d39ffc..74de74a8e 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -7,8 +7,8 @@ EXTRA_DIST = doc/platform_specific.dox configdir = $(sysconfdir)/odp if ODP_USE_CONFIG -config_DATA = $(top_srcdir)/config/odp-$(with_platform).conf -EXTRA_DIST += $(top_srcdir)/config/odp-$(with_platform).conf +config_DATA = $(top_builddir)/$(rel_default_config_path) +EXTRA_DIST += $(top_builddir)/$(rel_default_config_path) endif VPATH = $(srcdir) $(builddir) diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 2986e08e8..35233eabe 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -17,7 +17,7 @@ AM_CFLAGS += $(DPDK_CFLAGS) AM_CFLAGS += $(LIBCONFIG_CFLAGS) DISTCLEANFILES = include/odp_libconfig_config.h -include/odp_libconfig_config.h: $(top_srcdir)/config/odp-$(with_platform).conf $(top_builddir)/config.status +include/odp_libconfig_config.h: $(top_builddir)/$(rel_default_config_path) $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ odpapiabiarchincludedir = $(archincludedir)/odp/api/abi @@ -148,7 +148,7 @@ noinst_HEADERS = \ include/protocols/tcp.h \ include/protocols/thash.h \ include/protocols/udp.h -nodist_noinst_HEADERS = \ +BUILT_SOURCES = \ include/odp_libconfig_config.h __LIB__libodp_linux_la_SOURCES = \ diff --git a/platform/linux-generic/m4/odp_libconfig.m4 b/platform/linux-generic/m4/odp_libconfig.m4 index f042d65d7..d13fcf274 100644 --- a/platform/linux-generic/m4/odp_libconfig.m4 +++ b/platform/linux-generic/m4/odp_libconfig.m4 @@ -20,9 +20,16 @@ AC_SUBST(_ODP_CONFIG_VERSION_MINOR) ########################################################################## default_config_path="${srcdir}/config/odp-$with_platform.conf" +AC_CHECK_PROGS([REALPATH], [realpath]) +AS_IF([test -z "$REALPATH"], [AC_MSG_ERROR([Could not find 'realpath'])]) + 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]) +rel_default_config_path=`realpath --relative-to=$(pwd) ${default_config_path}` +AC_SUBST(default_config_path) +AC_SUBST(rel_default_config_path) + +ODP_LIBCONFIG([$with_platform], [$rel_default_config_path]) |