tools: allow configure time choice of libexec subdirectory.
authorIan Campbell <ian.campbell@citrix.com>
Wed, 16 Dec 2015 15:06:35 +0000 (15:06 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 5 Jan 2016 11:32:21 +0000 (11:32 +0000)
Currently we hardcode various paths such as $libexec/xen/{bin,boot},
however some downstreams (notably Debian) would like instead to
install things into $libexec/xen-X.Y/{bin,boot} as part of allowing
multiple versions of the tools packages to be installed.

Since this currently involves patching configure its a bit fiddly,
provide a configure option for the leaf dir instead, name it
--with-libexec-leaf-dir similar to the existing
--with-sysconfig-leaf-dir.

Rather than have the determination of the full path in both configure
and config/Paths.mk.in move it into configure only. Also for
consistency move the other LIBEXEC_* to configure, even though they
are only substituted into Paths.mk.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: 805508@bugs.debian.org
[ ijc -- removed stray ` ]

config/Paths.mk.in
configure
m4/paths.m4
tools/configure

index d36504f25f481139939dc39c9fe717f3648395de..1c7afb4198fbe54147a99476909c21b0ab352117 100644 (file)
@@ -29,10 +29,10 @@ includedir               := @includedir@
 localstatedir            := @localstatedir@
 sysconfdir               := @sysconfdir@
 
-LIBEXEC                  := $(libexecdir)/$(PACKAGE_TARNAME)
+LIBEXEC                  := @LIBEXEC@
 LIBEXEC_BIN              := @LIBEXEC_BIN@
-LIBEXEC_LIB              := $(LIBEXEC)/lib
-LIBEXEC_INC              := $(LIBEXEC)/include
+LIBEXEC_LIB              := @LIBEXEC_LIB@
+LIBEXEC_INC              := @LIBEXEC_INC@
 
 SHAREDIR                 := @SHAREDIR@
 MAN1DIR                  := $(mandir)/man1
index 3c269fab38f388ad288fcac9c8d0737f545cdb0c..c200eed7318959497d4ec48a1b091de4496f102f 100755 (executable)
--- a/configure
+++ b/configure
@@ -606,7 +606,10 @@ XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 XENFIRMWAREDIR
+LIBEXEC_INC
+LIBEXEC_LIB
 LIBEXEC_BIN
+LIBEXEC
 CONFIG_LEAF_DIR
 host_os
 host_vendor
@@ -659,6 +662,7 @@ ac_user_opts='
 enable_option_checking
 with_initddir
 with_sysconfig_leaf_dir
+with_libexec_leaf_dir
 with_xen_dumpdir
 enable_xen
 enable_tools
@@ -1299,6 +1303,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-libexec-leaf-dir=SUBDIR
+                          Name of subdirectory in libexecdir to use.
   --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
                           [LOCALSTATEDIR/lib/xen/dump]
 
@@ -1924,6 +1930,15 @@ CONFIG_LEAF_DIR=$config_leaf_dir
 
 
 
+# Check whether --with-libexec-leaf-dir was given.
+if test "${with_libexec_leaf_dir+set}" = set; then :
+  withval=$with_libexec_leaf_dir; libexec_subdir=$withval
+else
+  libexec_subdir=$PACKAGE_TARNAME
+fi
+
+
+
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
   withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
@@ -1940,11 +1955,16 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
          ;;
     esac
 fi
-libexecdir=`eval echo $libexecdir`
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+
+
+LIBEXEC_BIN=${LIBEXEC}/bin
+
+LIBEXEC_LIB=${LIBEXEC}/lib
 
+LIBEXEC_INC=${LIBEXEC}/include
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
 XEN_RUN_DIR=$localstatedir/run/xen
index 63e0f6b4db5887e4656b8173f2b086780cb3d733..fa902bb35fcff1ba5287d1f1d0881c8f6d57e81b 100644 (file)
@@ -62,6 +62,14 @@ AC_ARG_WITH([sysconfig-leaf-dir],
 CONFIG_LEAF_DIR=$config_leaf_dir
 AC_SUBST(CONFIG_LEAF_DIR)
 
+dnl autoconf docs suggest to use a "package name" subdir. We make it
+dnl configurable for the benefit of those who want e.g. xen-X.Y instead.
+AC_ARG_WITH([libexec-leaf-dir],
+    AS_HELP_STRING([--with-libexec-leaf-dir=SUBDIR],
+    [Name of subdirectory in libexecdir to use.]),
+    [libexec_subdir=$withval],
+    [libexec_subdir=$PACKAGE_TARNAME])
+
 AC_ARG_WITH([xen-dumpdir],
     AS_HELP_STRING([--with-xen-dumpdir=DIR],
     [Path to directory for domU crash dumps. [LOCALSTATEDIR/lib/xen/dump]]),
@@ -77,13 +85,17 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
     esac
 fi
 dnl expand exec_prefix or it will endup in substituted variables
-libexecdir=`eval echo $libexecdir`
-dnl autoconf doc suggest to use a "package name" subdir
-dnl This variable will be substituted in various .in files
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
-AC_SUBST(LIBEXEC_BIN)
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+AC_SUBST(LIBEXEC)
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+dnl These variables will be substituted in various .in files
+LIBEXEC_BIN=${LIBEXEC}/bin
+AC_SUBST(LIBEXEC_BIN)
+LIBEXEC_LIB=${LIBEXEC}/lib
+AC_SUBST(LIBEXEC_LIB)
+LIBEXEC_INC=${LIBEXEC}/include
+AC_SUBST(LIBEXEC_INC)
+XENFIRMWAREDIR=${LIBEXEC}/boot
 AC_SUBST(XENFIRMWAREDIR)
 
 XEN_RUN_DIR=$localstatedir/run/xen
index 41bed7712ad3ec0ac0c7a1d30d9b43065b1958ab..cd41b26a78a2ec5a27f2663234db4c45a9477f0d 100755 (executable)
@@ -726,7 +726,10 @@ XEN_LIB_STORED
 XEN_LOG_DIR
 XEN_RUN_DIR
 XENFIRMWAREDIR
+LIBEXEC_INC
+LIBEXEC_LIB
 LIBEXEC_BIN
+LIBEXEC
 CONFIG_LEAF_DIR
 FILE_OFFSET_BITS
 OBJEXT
@@ -789,6 +792,7 @@ enable_option_checking
 enable_largefile
 with_initddir
 with_sysconfig_leaf_dir
+with_libexec_leaf_dir
 with_xen_dumpdir
 enable_rpath
 enable_githttp
@@ -1490,6 +1494,8 @@ Optional Packages:
                           options for runlevel scripts and daemons such as
                           xenstored. This should be either "sysconfig" or
                           "default". [sysconfig]
+  --with-libexec-leaf-dir=SUBDIR
+                          Name of subdirectory in libexecdir to use.
   --with-xen-dumpdir=DIR  Path to directory for domU crash dumps.
                           [LOCALSTATEDIR/lib/xen/dump]
   --with-linux-backend-modules="mod1 mod2"
@@ -3887,6 +3893,15 @@ CONFIG_LEAF_DIR=$config_leaf_dir
 
 
 
+# Check whether --with-libexec-leaf-dir was given.
+if test "${with_libexec_leaf_dir+set}" = set; then :
+  withval=$with_libexec_leaf_dir; libexec_subdir=$withval
+else
+  libexec_subdir=$PACKAGE_TARNAME
+fi
+
+
+
 # Check whether --with-xen-dumpdir was given.
 if test "${with_xen_dumpdir+set}" = set; then :
   withval=$with_xen_dumpdir; xen_dumpdir_path=$withval
@@ -3903,11 +3918,16 @@ if test "$libexecdir" = '${exec_prefix}/libexec' ; then
          ;;
     esac
 fi
-libexecdir=`eval echo $libexecdir`
-LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
+LIBEXEC=`eval echo $libexecdir/$libexec_subdir`
+
+
+LIBEXEC_BIN=${LIBEXEC}/bin
+
+LIBEXEC_LIB=${LIBEXEC}/lib
 
+LIBEXEC_INC=${LIBEXEC}/include
 
-XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+XENFIRMWAREDIR=${LIBEXEC}/boot
 
 
 XEN_RUN_DIR=$localstatedir/run/xen