Add configure --with-initddir=DIR
authorOlaf Hering <olaf@aepfle.de>
Wed, 1 Oct 2014 16:41:06 +0000 (18:41 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 6 Oct 2014 14:51:22 +0000 (15:51 +0100)
Preserve existing behaviour: Fedora gets rc.d/init.d, BSD gets rc.d,
everyone else gets init.d.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

Config.mk
config/Paths.mk.in
configure
docs/misc/distro_mapping.txt
m4/paths.m4
tools/configure

index 2bb8dcca1bbf4ef146060fd0b77c251cb58fa8e6..e4ff64d3a1aa0f9ecbb51ab05b94233966a3edd9 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -76,7 +76,6 @@ endef
 
 # See distro_mapping.txt for other options
 $(eval $(call setvar_dir,CONFIG_LEAF_DIR,,/etc/sysconfig,sysconfig,default))
-$(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
index 507b6d17445509d74c1cb4c7a32f32ac91785e97..c01d0ef44945c7ecf533d163ba14568659c54288 100644 (file)
@@ -24,6 +24,7 @@ XEN_LOG_DIR              := @XEN_LOG_DIR@
 XEN_LIB_STORED           := @XEN_LIB_STORED@
 
 CONFIG_DIR               := @CONFIG_DIR@
+INITD_DIR                := @INITD_DIR@
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@
 
index 68e6eb00b2b65bd909b2773ffba8b6c8413a151c..7a3d444232122ce3947f2b1d419aa92feaee319a 100755 (executable)
--- a/configure
+++ b/configure
@@ -598,6 +598,7 @@ XEN_PAGING_DIR
 XEN_LOCK_DIR
 XEN_SCRIPT_DIR
 XEN_CONFIG_DIR
+INITD_DIR
 CONFIG_DIR
 XENFIRMWAREDIR
 PRIVATE_BINDIR
@@ -660,6 +661,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+with_initddir
 enable_xen
 enable_tools
 enable_stubdom
@@ -1289,6 +1291,12 @@ Optional Features:
   --enable-stubdom        Enable build and install of stubdom
   --disable-docs          Disable build and install of docs
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-initddir=DIR     Path to directory with sysv runlevel scripts.
+                          [SYSCONFDIR/init.d]
+
 Report bugs to <xen-devel@lists.xen.org>.
 Xen Hypervisor home page: <http://www.xen.org/>.
 _ACEOF
@@ -1870,6 +1878,26 @@ if test "x$sysconfdir" = 'x${prefix}/etc' ; then
     esac
 fi
 
+
+# Check whether --with-initddir was given.
+if test "${with_initddir+set}" = set; then :
+  withval=$with_initddir; initddir_path=$withval
+else
+  case "$host_os" in
+         *linux*)
+         if test -d $sysconfdir/rc.d/init.d ; then
+             initddir_path=$sysconfdir/rc.d/init.d
+         else
+             initddir_path=$sysconfdir/init.d
+         fi
+         ;;
+         *)
+         initddir_path=$sysconfdir/rc.d
+         ;;
+     esac
+fi
+
+
 BINDIR=$prefix/bin
 
 
@@ -1909,6 +1937,9 @@ XENFIRMWAREDIR=$prefix/lib/xen/boot
 CONFIG_DIR=$sysconfdir
 
 
+INITD_DIR=$initddir_path
+
+
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
 
 
index f849d070076cd1bd092615e73e425576fb4fb1a8..0e8bf0cebd8dcc4b5ddee56cc2e96a88ed6b6d99 100644 (file)
@@ -13,8 +13,9 @@ build host, via the "setvar_dir" macro in Config.mk) and for some
 scripts at run-time.  If the Red Hat directory exists, it is used;
 otherwise the Debian one is used.
 
-You can override this by setting the variables in the environment or
-your ".config" (which is included by .config).
+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).
 
 To add support for new distributions that don't use the above locations,
 one must grep for the above elements and add appropriate checks.
index b183845c5dd52d01d4113103196f752f538221c5..19b64816b439bde57eb858cfdb5fbe772ca77cc1 100644 (file)
@@ -22,6 +22,23 @@ if test "x$sysconfdir" = 'x${prefix}/etc' ; then
     esac
 fi
 
+AC_ARG_WITH([initddir],
+    AS_HELP_STRING([--with-initddir=DIR],
+    [Path to directory with sysv runlevel scripts. [SYSCONFDIR/init.d]]),
+    [initddir_path=$withval],
+    [case "$host_os" in
+         *linux*)
+         if test -d $sysconfdir/rc.d/init.d ; then
+             initddir_path=$sysconfdir/rc.d/init.d
+         else
+             initddir_path=$sysconfdir/init.d
+         fi
+         ;;
+         *)
+         initddir_path=$sysconfdir/rc.d
+         ;;
+     esac])
+
 BINDIR=$prefix/bin
 AC_SUBST(BINDIR)
 
@@ -63,6 +80,9 @@ AC_SUBST(XENFIRMWAREDIR)
 CONFIG_DIR=$sysconfdir
 AC_SUBST(CONFIG_DIR)
 
+INITD_DIR=$initddir_path
+AC_SUBST(INITD_DIR)
+
 XEN_CONFIG_DIR=$CONFIG_DIR/xen
 AC_SUBST(XEN_CONFIG_DIR)
 
index fe44b4e643576c7ce34d1d924150418c022c31ee..b61d3e4c0127a1bfe350db0ebb219a71c034da6d 100755 (executable)
@@ -711,6 +711,7 @@ XEN_PAGING_DIR
 XEN_LOCK_DIR
 XEN_SCRIPT_DIR
 XEN_CONFIG_DIR
+INITD_DIR
 CONFIG_DIR
 XENFIRMWAREDIR
 PRIVATE_BINDIR
@@ -783,6 +784,7 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 enable_largefile
+with_initddir
 enable_githttp
 enable_monitors
 enable_ocamltools
@@ -1472,6 +1474,8 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-initddir=DIR     Path to directory with sysv runlevel scripts.
+                          [SYSCONFDIR/init.d]
   --with-system-qemu[=PATH]
                           Use system supplied qemu PATH or qemu (taken from
                           $PATH) as qemu-xen device model instead of building
@@ -3709,6 +3713,26 @@ if test "x$sysconfdir" = 'x${prefix}/etc' ; then
     esac
 fi
 
+
+# Check whether --with-initddir was given.
+if test "${with_initddir+set}" = set; then :
+  withval=$with_initddir; initddir_path=$withval
+else
+  case "$host_os" in
+         *linux*)
+         if test -d $sysconfdir/rc.d/init.d ; then
+             initddir_path=$sysconfdir/rc.d/init.d
+         else
+             initddir_path=$sysconfdir/init.d
+         fi
+         ;;
+         *)
+         initddir_path=$sysconfdir/rc.d
+         ;;
+     esac
+fi
+
+
 BINDIR=$prefix/bin
 
 
@@ -3748,6 +3772,9 @@ XENFIRMWAREDIR=$prefix/lib/xen/boot
 CONFIG_DIR=$sysconfdir
 
 
+INITD_DIR=$initddir_path
+
+
 XEN_CONFIG_DIR=$CONFIG_DIR/xen