aboutsummaryrefslogtreecommitdiffstats
path: root/Config.mk
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2010-09-21 12:17:04 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2010-09-21 12:17:04 +0100
commit39ae85c6eef75a8f5edeeb3cb2a86da5a93a32bc (patch)
tree1b8991c320bb86b95d1b376eee8b3baa6f72e680 /Config.mk
parent89acd8b4d60220b35bf97d94fe55a5cba47a5048 (diff)
downloadxen-39ae85c6eef75a8f5edeeb3cb2a86da5a93a32bc.tar.gz
xen-39ae85c6eef75a8f5edeeb3cb2a86da5a93a32bc.tar.bz2
xen-39ae85c6eef75a8f5edeeb3cb2a86da5a93a32bc.zip
tools, build system: Detect distro-variant directories at build-time
In b59f87f56b1e, the defaults for some of the directory config variables implicitly changed. In this commit we arrange for the defaults to be auto-detected (with the same logic as the run-time scripts use). This will make the build more likely to produce answers which the builder intends. (And, in particular, it should un-break the automated tests, which didn't set these variables explicitly and therefore got broken by b59f87f56b1e.) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'Config.mk')
-rw-r--r--Config.mk18
1 files changed, 14 insertions, 4 deletions
diff --git a/Config.mk b/Config.mk
index 4ae5cbd625..f80732a618 100644
--- a/Config.mk
+++ b/Config.mk
@@ -31,11 +31,21 @@ DOCDIR ?= $(SHAREDIR)/doc/xen
MANDIR ?= $(SHAREDIR)/man
BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
-# These are the Red Hat settings.
+# arguments: variable, common path part, path to test, if yes, if no
+define setvar_dir
+ ifndef $(1)
+ ifneq (,$(wildcard $(2)$(3)))
+ $(1) ?= $(2)$(4)
+ else
+ $(1) ?= $(2)$(5)
+ endif
+ endif
+endef
+
# See distro_mapping.txt for other options
-CONFIG_LEAF_DIR ?= sysconfig
-SUBSYS_DIR ?= /var/run/subsys
-INITD_DIR ?= /etc/rc.d/init.d
+$(eval $(call setvar_dir,CONFIG_LEAF_DIR,,/etc/sysconfig,sysconfig,default))
+$(eval $(call setvar_dir,SUBSYS_DIR,/var/run,/subsys,/subsys,))
+$(eval $(call setvar_dir,INITD_DIR,/etc,/rc.d/init.d,/rc.d/init.d,/init.d))
ifneq ($(EXTRA_PREFIX),)
EXTRA_INCLUDES += $(EXTRA_PREFIX)/include