From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Date: Thu, 25 Sep 2014 17:20:16 +0200 Message-ID: <1411658423-18877-22-git-send-email-olaf@aepfle.de> References: <1411658423-18877-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1411658423-18877-1-git-send-email-olaf@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Wei Liu , Olaf Hering , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Set CONFIG_LEAF_DIR with configure to give control if needed. The check for the correct value if the option is not specified is tricky. Since other packages (such as grub2) started to populate also /etc/default/ a given system may have both directories. Use "default" only if /etc/sysconfig does not exist. "sysconfig" remains the default. Move the variable from StdGNU.mk to Linux.mk because thats the only place where it is used. Please rerun autogen.sh after applying this patch. Signed-off-by: Olaf Hering Cc: Ian Campbell Cc: Ian Jackson Cc: Stefano Stabellini Cc: Wei Liu --- Config.mk | 3 --- config/Linux.mk | 2 ++ config/Paths.mk.in | 1 + config/StdGNU.mk | 2 -- docs/misc/distro_mapping.txt | 4 ++-- m4/paths.m4 | 11 +++++++++++ 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Config.mk b/Config.mk index cf7af12..dff71b3 100644 --- a/Config.mk +++ b/Config.mk @@ -69,9 +69,6 @@ define setvar_dir endif endef -# See distro_mapping.txt for other options -$(eval $(call setvar_dir,CONFIG_LEAF_DIR,,/etc/sysconfig,sysconfig,default)) - ifneq ($(EXTRA_PREFIX),) EXTRA_INCLUDES += $(EXTRA_PREFIX)/include EXTRA_LIB += $(EXTRA_PREFIX)/lib diff --git a/config/Linux.mk b/config/Linux.mk index b421a1c..2a84b6b 100644 --- a/config/Linux.mk +++ b/config/Linux.mk @@ -1 +1,3 @@ include $(XEN_ROOT)/config/StdGNU.mk + +SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) diff --git a/config/Paths.mk.in b/config/Paths.mk.in index e1fe4a3..9fd87c5 100644 --- a/config/Paths.mk.in +++ b/config/Paths.mk.in @@ -50,6 +50,7 @@ XEN_LIB_STORED := @XEN_LIB_STORED@ CONFIG_DIR := @CONFIG_DIR@ INITD_DIR := @INITD_DIR@ +CONFIG_LEAF_DIR := @CONFIG_LEAF_DIR@ BASH_COMPLETION_DIR := $(CONFIG_DIR)/bash_completion.d XEN_LOCK_DIR := @XEN_LOCK_DIR@ XEN_PAGING_DIR := @XEN_PAGING_DIR@ diff --git a/config/StdGNU.mk b/config/StdGNU.mk index 16c3043..1566d7f 100644 --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -27,8 +27,6 @@ INSTALL_DIR = $(INSTALL) -d -m0755 -p INSTALL_DATA = $(INSTALL) -m0644 -p INSTALL_PROG = $(INSTALL) -m0755 -p -SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR) - BOOT_DIR ?= /boot SOCKET_LIBS = diff --git a/docs/misc/distro_mapping.txt b/docs/misc/distro_mapping.txt index d2b1399..2e46592 100644 --- a/docs/misc/distro_mapping.txt +++ b/docs/misc/distro_mapping.txt @@ -14,8 +14,8 @@ scripts at run-time. If the Red Hat directory exists, it is used; otherwise the Debian one is used. The INITD_DIR path can be changed with configure --with-initddir=DIR. -The CONFIG_LEAF_DIR path can be changed by setting the variables in -the environment or your ".config" (which is included by Config.mk). +The CONFIG_LEAF_DIR name can be changed with configure +--with-sysconfig-leaf-dir=SUBDIR. To add support for new distributions that don't use the above locations, one must grep for the above elements and add appropriate checks. diff --git a/m4/paths.m4 b/m4/paths.m4 index 7ca4e53..9fb4fcd 100644 --- a/m4/paths.m4 +++ b/m4/paths.m4 @@ -51,6 +51,17 @@ AC_ARG_WITH([initddir], ;; esac]) +AC_ARG_WITH([sysconfig-leaf-dir], + AS_HELP_STRING([--with-sysconfig-leaf-dir=SUBDIR], + [Name of subdirectory in /etc to store runtime options for runlevel + scripts and daemons such as xenstoerd. + This should be either "sysconfig" or "default". [sysconfig]]), + [config_leaf_dir=$withval], + [config_leaf_dir=sysconfig + if test ! -d /etc/sysconfig ; then config_leaf_dir=default ; fi]) +CONFIG_LEAF_DIR=$config_leaf_dir +AC_SUBST(CONFIG_LEAF_DIR) + if test "$libexecdir" = '${exec_prefix}/libexec' ; then case "$host_os" in *netbsd*) ;;