[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] tools: allow configure time choice of libexec subdirectory.



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.

Please rerun autogen.sh when applying.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: 805508@xxxxxxxxxxxxxxx
---
 config/Paths.mk.in |  6 +++---
 m4/paths.m4        | 24 ++++++++++++++++++------
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index d36504f..1c7afb4 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -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
diff --git a/m4/paths.m4 b/m4/paths.m4
index 63e0f6b..1a558e1 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -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
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.