From 032c9178ca72aef93bfef6e4952bb98d3373b642 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Fri, 13 Feb 2015 19:10:10 +0000 Subject: [PATCH] conf: Set default global/etc from --with-confdir. --- conf/example.conf.in | 3 +++ configure | 5 +++++ configure.in | 2 ++ lib/config/defaults.h | 1 - lib/misc/configure.h.in | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/conf/example.conf.in b/conf/example.conf.in index 5ee0c4d2f..777280ec6 100644 --- a/conf/example.conf.in +++ b/conf/example.conf.in @@ -565,6 +565,9 @@ global { # Defaults to "lvm2". # format = "lvm2" + # Location of /etc system configuration directory. + etc = "@CONFDIR@" + # Location of proc filesystem proc = "/proc" diff --git a/configure b/configure index 318747347..ef0ae96b5 100755 --- a/configure +++ b/configure @@ -12260,6 +12260,11 @@ else fi +cat >>confdefs.h <<_ACEOF +#define DEFAULT_ETC_DIR "$CONFDIR" +_ACEOF + + # Check whether --with-staticdir was given. if test "${with_staticdir+set}" = set; then : diff --git a/configure.in b/configure.in index b4b9ec285..73ca4cd95 100644 --- a/configure.in +++ b/configure.in @@ -1452,6 +1452,8 @@ AC_ARG_WITH(confdir, AC_HELP_STRING([--with-confdir=DIR], [configuration files in DIR [/etc]]), CONFDIR=$withval, CONFDIR='/etc') +AC_DEFINE_UNQUOTED(DEFAULT_ETC_DIR, ["$CONFDIR"], + [Default system configuration directory.]) AC_ARG_WITH(staticdir, AC_HELP_STRING([--with-staticdir=DIR], diff --git a/lib/config/defaults.h b/lib/config/defaults.h index 77604ab29..9d2cff92e 100644 --- a/lib/config/defaults.h +++ b/lib/config/defaults.h @@ -29,7 +29,6 @@ #define DEFAULT_DEV_DIR "/dev" #define DEFAULT_PROC_DIR "/proc" -#define DEFAULT_ETC_DIR "/etc" #define DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV 1 #define DEFAULT_EXTERNAL_DEVICE_INFO_SOURCE "none" #define DEFAULT_SYSFS_SCAN 1 diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in index 9a002d235..ee9f85906 100644 --- a/lib/misc/configure.h.in +++ b/lib/misc/configure.h.in @@ -65,6 +65,9 @@ /* Default DM run directory. */ #undef DEFAULT_DM_RUN_DIR +/* Default system configuration directory. */ +#undef DEFAULT_ETC_DIR + /* Name of default locking directory. */ #undef DEFAULT_LOCK_DIR