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

Re: [Xen-devel] [PATCH v5 11/14] autoconf: xen: move standard variables to a generic place



On Wed, May 21, 2014 at 04:26:33PM +0100, Ian Campbell wrote:
> On Tue, 2014-05-20 at 05:31 -0700, Luis R. Rodriguez wrote:
> > diff --git a/README b/README
> > index 9bbe734..079e6a9 100644
> > --- a/README
> > +++ b/README
> > @@ -129,6 +129,22 @@ performed with root privileges.]
> >     versions of those scripts, so that you can copy the dist directory
> >     to another machine and install from that distribution.
> >  
> > +Xen system configuration
> > +========================
> > +
> > +Xen uses a set of variables for system configuration and upon build time,
> 
> s/upon/at/

Ammended.

> > +because of this these variables are defined on a top level general input
> > +source and are generated after running ./configure. There are two versions
> > +of the input files, one for scripts (bash, python) and another for C / 
> > header
> > +files:
> > +
> > +  * config/xen-environment-header.in - used to generate 
> > config/xen-environment-header 
> > +  * config/xen-environment-scripts.in - used to generate 
> > config/xen-environment-scripts
> > +
> > +Further documentation can be found on the wiki:
> 
> This all seems very developer focused (why would users care about
> this?). I think most of this would be better as a comment in the
> relevant files.
> 
> > +
> > +http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration
> 
> This might be useful if it were more user focused in particular if it
> referred to the installed locations of things and not the source which
> users don't care about.

OK tossed it into config/xen-environment-scripts.in.

> > +
> >  Python Runtime Libraries
> >  ========================
> >  
> > diff --git a/config/StdGNU.mk b/config/StdGNU.mk
> > index c6439f6..273f1e8 100644
> > --- a/config/StdGNU.mk
> > +++ b/config/StdGNU.mk
> > @@ -1,3 +1,17 @@
> > +# These are standard defaults which you can use to avoid having
> > +# to run ./configure -- you can use this to compile the hypervisor
> > +# and the mini os:
> > +#
> > +# make xen
> > +# sudo make -C xen install
> > +#
> > +# make -C extras/mini-os
> > +include $(XEN_ROOT)/config/defaults.mk
> > +
> > +# This comes from running configure and will override
> > +# the defaults.
> > +-include $(XEN_ROOT)/config/Toplevel.mk
> 
> As I said in the reply to the subthread started by Jan I don't think any
> of this belongs here.

OK.

> > new file mode 100644
> > index 0000000..7dd7a53
> > --- /dev/null
> > +++ b/config/xen-environment-header.in
> > @@ -0,0 +1,13 @@
> > +#define SBINDIR "@SBINDIR@"
> > +#define BINDIR "@BINDIR@"
> > +#define LIBEXEC "@LIBEXEC@"
> > +#define LIBDIR "@LIBDIR@"
> > +#define SHAREDIR "@SHAREDIR@"
> > +
> > +#define PRIVATE_BINDIR "@PRIVATE_BINDIR@"
> > +#define XENFIRMWAREDIR "@XENFIRMWAREDIR@"
> > +#define XEN_CONFIG_DIR "@XEN_CONFIG_DIR@"
> > +#define XEN_SCRIPT_DIR "@XEN_SCRIPT_DIR@"
> > +#define XEN_LOCK_DIR "@XEN_LOCK_DIR@"
> > +#define XEN_RUN_DIR "@XEN_RUN_DIR@"
> > +#define XEN_PAGING_DIR "@XEN_PAGING_DIR@"
> > diff --git a/config/xen-environment-scripts.in 
> > b/config/xen-environment-scripts.in
> > new file mode 100644
> > index 0000000..9623231
> > --- /dev/null
> > +++ b/config/xen-environment-scripts.in
> > @@ -0,0 +1,15 @@
> > +SBINDIR="@SBINDIR@"
> > +BINDIR="@BINDIR@"
> > +LIBEXEC="@LIBEXEC@"
> > +LIBDIR="@LIBDIR@"
> > +SHAREDIR="@SHAREDIR@"
> > +
> > +PRIVATE_BINDIR="@PRIVATE_BINDIR@"
> > +XENFIRMWAREDIR="@XENFIRMWAREDIR@"
> > +XEN_CONFIG_DIR="@XEN_CONFIG_DIR@"
> > +XEN_SCRIPT_DIR="@XEN_SCRIPT_DIR@"
> > +XEN_LOCK_DIR="@XEN_LOCK_DIR@"
> > +XEN_LOG_DIR="@XEN_LOG_DIR@"
> > +XEN_LIB_STORED="@XEN_LIB_STORED@"
> > +XEN_RUN_DIR="@XEN_RUN_DIR@"
> > +XEN_PAGING_DIR="@XEN_PAGING_DIR@"
> 
> The downside of these is that we now need to keep both in sync. I think
> a reasonable compromise would be to generate the scripts version of this
> via autoconf and create the C version using a mechanism similar to the
> existing buildmakevars2file etc stuff.

OK I kept only config/xen-environment-scripts.in and repurposed
buildmakevars2file for C header generation.

> > diff --git a/m4/expand_config.m4 b/m4/expand_config.m4
> 
> expand_config is a strange name for this, paths.m4 would be more
> descriptive, wouldn't it?

Sure.

> Or this sort of thing wouldn't be out of place in confgure.ac I think.

More on this below.

> > new file mode 100644
> > index 0000000..717fcd1
> > --- /dev/null
> > +++ b/m4/expand_config.m4
> > @@ -0,0 +1,61 @@
> > +AC_DEFUN([AX_XEN_EXPAND_CONFIG], [
> > +dnl expand these early so we can use this for substitutions
> > +test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
> > +test "x$exec_prefix" = "xNONE" && exec_prefix=$ac_default_prefix
> > +
> > +BINDIR=$prefix/bin
> > +AC_SUBST(BINDIR)
> > +
> > +SBINDIR=$prefix/sbin
> > +AC_SUBST(SBINDIR)
> 
> TBH I thought that after going through all this fuss --bindir and
> --sbindir might worl.

We can surely do that but that is an atomic change and I'd much prefer
this was treated separately as a separate patch given that this would
change existing behavior. If you want me to roll this in I can do so
but do not think that's a good idea for regression analysis.

> > diff --git a/stubdom/Makefile b/stubdom/Makefile
> > index c41de27..f0f624a 100644
> > --- a/stubdom/Makefile
> > +++ b/stubdom/Makefile
> > @@ -48,18 +48,19 @@ TARGET_LDFLAGS += -nostdlib 
> > -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
> >  
> >  TARGETS=$(STUBDOM_TARGETS)
> >  
> > +STUBDOMPATH="stubdompath.sh"
> > +
> > +$(STUBDOMPATH): $(XEN_ROOT)/config/xen-environment-scripts
> > +   @cp $(XEN_ROOT)/config/xen-environment-scripts $@
> 
>       cp $< $@
> 
> Not sure it needs hiding from the user either.
> 
> (there are a few of these)

OK.

> > diff --git a/stubdom/configure.ac b/stubdom/configure.ac
> > index 6468203..d6b0fbf 100644
> > --- a/stubdom/configure.ac
> > +++ b/stubdom/configure.ac
> > @@ -16,6 +16,9 @@ m4_include([../m4/features.m4])
> >  m4_include([../m4/path_or_fail.m4])
> >  m4_include([../m4/depends.m4])
> >  m4_include([../m4/fetcher.m4])
> > +m4_include([../m4/expand_config.m4])
> > +
> > +AX_XEN_EXPAND_CONFIG()
> 
> Doesn't only the toplevel configure.ac need this, because you've put the
> things into config/Toplevel.mk (soon to be config/Paths.mk).

I had similar expectations and was equally surprised to see this didn't fly.

Here's the latest version of the patch let me know what you folks think,
I think its pointless to foll in a new series just to address this rather
more important change.

From: "Luis R. Rodriguez" <mcgrof@xxxxxxxx>
Date: Mon, 28 Apr 2014 03:52:29 -0700
Subject: [PATCH] autoconf: xen: move standard path variables to
 config/Paths.mk.in

This moves all generic path variables to a new the config/Paths.mk.in
input source file to be processed at configure time, tons of files use
these so this just share them. This also paves the way to let us
easily dynamically configure these with autoconf, for now we leave the
same presets as was present before.

This work was prompted by looking for an autoconf way to do
replacements for the hotplug global file, while at it I realized
that a few other files use the same variables and have in places
around the tree the same constructs for generating their own
files. This replaces all that with a *one* central file script file,
and lets us generate the C header file from the first one. To do
this we repuropose buildmakevars2file Makefile helper to generate
the header file.

This has no impact on building the hypervisor and extras/mini-os,
you do not need to, and are not expected to, run configure to build
those targets.

While at it lets add some documentation on the for the two files on
the source file, we can expand further details on the wiki [0].

[0] 
http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration

Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Keir Fraser <keir@xxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxx>
---
 .gitignore                        |  3 ++
 Config.mk                         |  9 +++++-
 Makefile                          | 18 +++++++++++-
 config/Paths.mk.in                | 23 +++++++++++++++
 config/Stubdom.mk.in              |  1 +
 config/xen-environment-scripts.in | 35 ++++++++++++++++++++++
 configure.ac                      |  9 +++++-
 m4/paths.m4                       | 61 +++++++++++++++++++++++++++++++++++++++
 stubdom/Makefile                  | 18 +++++++-----
 stubdom/configure.ac              |  3 ++
 tools/Rules.mk                    |  1 +
 tools/configure.ac                |  3 ++
 tools/hotplug/common/Makefile     |  6 ++--
 tools/libxl/Makefile              | 11 ++-----
 tools/python/Makefile             |  6 ++--
 15 files changed, 182 insertions(+), 25 deletions(-)
 create mode 100644 config/Paths.mk.in
 create mode 100644 config/xen-environment-scripts.in
 create mode 100644 m4/paths.m4

diff --git a/.gitignore b/.gitignore
index 562c262..4792070 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,9 @@ config.log
 config.status
 config.cache
 config/Toplevel.mk
+config/Paths.mk
+config/xen-environment-scripts
+config/xen-environment-header
 
 build-*
 dist/*
diff --git a/Config.mk b/Config.mk
index 6a93533..6580e47 100644
--- a/Config.mk
+++ b/Config.mk
@@ -175,10 +175,17 @@ define buildmakevars2file-closure
                  SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR     \
                  XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
                  XEN_RUN_DIR XEN_PAGING_DIR,                               \
-                 echo "$(var)=\"$($(var))\"" >>$(1).tmp;)        \
+                 echo "#define $(var) \"$($(var))\"" >>$(1).tmp;)        \
        $(call move-if-changed,$(1).tmp,$(1))
 endef
 
+empty_genpath = $(eval $(call empty_genpath-closure))
+define empty_genpath-closure
+    .PHONY: genpath-skip
+    genpath-skip:
+       @# do nothing
+endef
+
 ifeq ($(debug_symbols),y)
 CFLAGS += -g
 endif
diff --git a/Makefile b/Makefile
index 41dabbf..fa3427e 100644
--- a/Makefile
+++ b/Makefile
@@ -39,10 +39,26 @@ endif
 test:
        $(MAKE) -C tools/python test
 
+XEN_ENV_HEADER="$(XEN_ROOT)/config/xen-environment-header"
+CONFIG_RUN="$(XEN_ROOT)/config.status"
+
+genpath-target = $(call buildmakevars2file,$(XEN_ENV_HEADER))
+$(eval $(genpath-target))
+
+genpath-ignore = $(call empty_genpath)
+$(eval $(genpath-ignore))
+
+# This generates xen-environment-header only if configure has been run
+ifneq ("$(wildcard $(CONFIG_RUN))","")
+   XENGENPATH=genpath-skip
+else
+   XENGENPATH=genpath
+endif
+
 # build and install everything into local dist directory
 .PHONY: dist
 dist: DESTDIR=$(DISTDIR)/install
-dist: $(TARGS_DIST) dist-misc
+dist: $(XENGENPATH) $(TARGS_DIST) dist-misc
 
 dist-misc:
        $(INSTALL_DIR) $(DISTDIR)/
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
new file mode 100644
index 0000000..4f22960
--- /dev/null
+++ b/config/Paths.mk.in
@@ -0,0 +1,23 @@
+SBINDIR                  := @SBINDIR@
+BINDIR                   := @BINDIR@
+LIBEXEC                  := @LIBEXEC@
+
+SHAREDIR                 := @SHAREDIR@
+LIBDIR                   := @LIBDIR@
+
+XEN_RUN_DIR              := @XEN_RUN_DIR@
+XEN_LOG_DIR              := @XEN_LOG_DIR@
+XEN_LIB_STORED           := @XEN_LIB_STORED@
+
+CONFIG_DIR               := @CONFIG_DIR@
+XEN_LOCK_DIR             := @XEN_LOCK_DIR@
+XEN_PAGING_DIR           := @XEN_PAGING_DIR@
+
+PRIVATE_PREFIX           := @PRIVATE_PREFIX@
+PRIVATE_PREFIX           := @PKG_XEN_PREFIX@
+PRIVATE_BINDIR           := @PRIVATE_BINDIR@
+
+XENFIRMWAREDIR           := @XENFIRMWAREDIR@
+
+XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
+XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index 302842e..6bce206 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -1,4 +1,5 @@
 # Prefix and install folder
+include $(XEN_ROOT)/config/Paths.mk
 prefix              := @prefix@
 PREFIX              := $(prefix)
 exec_prefix         := @exec_prefix@
diff --git a/config/xen-environment-scripts.in 
b/config/xen-environment-scripts.in
new file mode 100644
index 0000000..06913f8
--- /dev/null
+++ b/config/xen-environment-scripts.in
@@ -0,0 +1,35 @@
+# Xen system configuration
+# ========================
+#
+# Xen uses a set of variables for system configuration and at build time,
+# because of this these variables are defined one master input source file
+# and is generated after running ./configure. The master source is located
+# on the xen source tree at under config/xen-environment-scripts.in and it
+# is used to generate config/xen-environment-scripts after ./configure has
+# been run. The C header file is generated after make is run. There are two
+# files the build system can then use, one for scripts (bash, python) and
+# another for C / header files:
+#
+# * config/xen-environment-scripts
+# * config/xen-environment-header
+#
+# These files may be used by the build system to generate local copies
+# for their own purpose. For more documentation you can refer to the wiki:
+#
+# 
http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration
+
+SBINDIR="@SBINDIR@"
+BINDIR="@BINDIR@"
+LIBEXEC="@LIBEXEC@"
+LIBDIR="@LIBDIR@"
+SHAREDIR="@SHAREDIR@"
+
+PRIVATE_BINDIR="@PRIVATE_BINDIR@"
+XENFIRMWAREDIR="@XENFIRMWAREDIR@"
+XEN_CONFIG_DIR="@XEN_CONFIG_DIR@"
+XEN_SCRIPT_DIR="@XEN_SCRIPT_DIR@"
+XEN_LOCK_DIR="@XEN_LOCK_DIR@"
+XEN_LOG_DIR="@XEN_LOG_DIR@"
+XEN_LIB_STORED="@XEN_LIB_STORED@"
+XEN_RUN_DIR="@XEN_RUN_DIR@"
+XEN_PAGING_DIR="@XEN_PAGING_DIR@"
diff --git a/configure.ac b/configure.ac
index 6c14524..96c6e75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,12 +5,19 @@ AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
     [xen-devel@xxxxxxxxxxxxx], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([./xen/common/kernel.c])
-AC_CONFIG_FILES([./config/Toplevel.mk])
+AC_CONFIG_FILES([
+       config/Toplevel.mk
+       config/Paths.mk
+       config/xen-environment-scripts
+])
 
 AC_CANONICAL_HOST
 
 m4_include([m4/features.m4])
 m4_include([m4/subsystem.m4])
+m4_include([m4/paths.m4])
+
+AX_XEN_EXPAND_CONFIG()
 
 dnl mini-os is only ported to certain platforms
 case "$host_cpu" in
diff --git a/m4/paths.m4 b/m4/paths.m4
new file mode 100644
index 0000000..717fcd1
--- /dev/null
+++ b/m4/paths.m4
@@ -0,0 +1,61 @@
+AC_DEFUN([AX_XEN_EXPAND_CONFIG], [
+dnl expand these early so we can use this for substitutions
+test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
+test "x$exec_prefix" = "xNONE" && exec_prefix=$ac_default_prefix
+
+BINDIR=$prefix/bin
+AC_SUBST(BINDIR)
+
+SBINDIR=$prefix/sbin
+AC_SUBST(SBINDIR)
+
+dnl XXX: this should be changed to use the passed $libexec
+dnl but can be done as a second step
+LIBEXEC=$prefix/lib/xen/bin
+AC_SUBST(LIBEXEC)
+
+LIBDIR=`eval echo $libdir`
+AC_SUBST(LIBDIR)
+
+XEN_RUN_DIR=/var/run/xen
+AC_SUBST(XEN_RUN_DIR)
+
+XEN_LOG_DIR=/var/log/xen
+AC_SUBST(XEN_LOG_DIR)
+
+XEN_LIB_STORED=/var/lib/xenstored
+AC_SUBST(XEN_LIB_STORED)
+
+SHAREDIR=$prefix/share
+AC_SUBST(SHAREDIR)
+
+PRIVATE_PREFIX=$LIBDIR/xen
+AC_SUBST(PRIVATE_PREFIX)
+
+PKG_XEN_PREFIX=$LIBDIR/xen
+AC_SUBST(PKG_XEN_PREFIX)
+
+PRIVATE_BINDIR=$PRIVATE_PREFIX/bin
+AC_SUBST(PRIVATE_BINDIR)
+
+XENFIRMWAREDIR=$prefix/lib/xen/boot
+AC_SUBST(XENFIRMWAREDIR)
+
+CONFIG_DIR=/etc
+AC_SUBST(CONFIG_DIR)
+
+XEN_CONFIG_DIR=$CONFIG_DIR/xen
+AC_SUBST(XEN_CONFIG_DIR)
+
+XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
+AC_SUBST(XEN_SCRIPT_DIR)
+
+XEN_LOCK_DIR=/var/lock
+AC_SUBST(XEN_LOCK_DIR)
+
+XEN_RUN_DIR=/var/run/xen
+AC_SUBST(XEN_RUN_DIR)
+
+XEN_PAGING_DIR=/var/lib/xen/xenpaging
+AC_SUBST(XEN_PAGING_DIR)
+])
diff --git a/stubdom/Makefile b/stubdom/Makefile
index c41de27..147848f 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -7,6 +7,7 @@ export stubdom=y
 export debug=y
 include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Stubdom.mk
+include $(XEN_ROOT)/config/Paths.mk
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
 ifeq ($(XEN_TARGET_ARCH),x86_32)
@@ -48,18 +49,19 @@ TARGET_LDFLAGS += -nostdlib 
-L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
 TARGETS=$(STUBDOM_TARGETS)
 
+STUBDOMPATH="stubdompath.sh"
+
+$(STUBDOMPATH): $(XEN_ROOT)/config/xen-environment-scripts
+       cp $(XEN_ROOT)/config/xen-environment-scripts $@
+
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath $(STUBDOM_BUILD)
+build: $(STUBDOMPATH) $(STUBDOM_BUILD)
 else
-build: genpath
+build: $(STUBDOMPATH)
 endif
 
-STUBDOMPATH="stubdompath.sh"
-genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
-$(eval $(genpath-target))
-
 ##############
 # Cross-newlib
 ##############
@@ -448,9 +450,9 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc 
xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme $(STUBDOM_INSTALL)
+install: $(STUBDOMPATH) install-readme $(STUBDOM_INSTALL)
 else
-install: genpath
+install: $(STUBDOMPATH)
 endif
 
 install-readme:
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 6468203..f1bea4c 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -16,6 +16,9 @@ m4_include([../m4/features.m4])
 m4_include([../m4/path_or_fail.m4])
 m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
+m4_include([../m4/paths.m4])
+
+AX_XEN_EXPAND_CONFIG()
 
 # Enable/disable stub domains
 AX_STUBDOM_CONDITIONAL([ioemu-stubdom], [ioemu])
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 13d8fc1..423f2b1 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -5,6 +5,7 @@ all:
 
 -include $(XEN_ROOT)/config/Tools.mk
 include $(XEN_ROOT)/Config.mk
+include $(XEN_ROOT)/config/Paths.mk
 
 export _INSTALL := $(INSTALL)
 INSTALL = $(XEN_ROOT)/tools/cross-install
diff --git a/tools/configure.ac b/tools/configure.ac
index 25d7ca3..05b2f4f 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -47,6 +47,9 @@ m4_include([../m4/ptyfuncs.m4])
 m4_include([../m4/extfs.m4])
 m4_include([../m4/fetcher.m4])
 m4_include([../m4/ax_compare_version.m4])
+m4_include([../m4/paths.m4])
+
+AX_XEN_EXPAND_CONFIG()
 
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 18d87aa..3afc6d5 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -9,14 +9,14 @@ HOTPLUGPATH="hotplugpath.sh"
 XEN_SCRIPTS =
 XEN_SCRIPT_DATA = $(HOTPLUGPATH)
 
-genpath-target = $(call buildmakevars2file,$(HOTPLUGPATH))
-$(eval $(genpath-target))
+$(HOTPLUGPATH): $(XEN_ROOT)/config/xen-environment-scripts
+       cp $(XEN_ROOT)/config/xen-environment-scripts $@
 
 .PHONY: all
 all: build
 
 .PHONY: build
-build: genpath
+build: $(HOTPLUGPATH)
 
 .PHONY: install
 install: all install-scripts
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 4cfa275..fedfd62 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -97,6 +97,9 @@ TEST_PROGS += $(foreach t, $(LIBXL_TESTS),test_$t)
 
 $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include 
$(XEN_ROOT)/tools/config.h
 
+_paths.h: $(XEN_ROOT)/config/xen-environment-header
+       @cp $(XEN_ROOT)/config/xen-environment-header $@
+
 AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \
        libxlu_disk_l.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
 AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c
@@ -141,9 +144,6 @@ $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS) 
\
        @rm -f $*.[ch]
        $(FLEX) --header-file=$*.h --outfile=$*.c $<
 
-genpath-target = $(call buildmakevars2file,_paths.h.tmp)
-$(eval $(genpath-target))
-
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
        $(PERL) $^
        touch $@
@@ -154,11 +154,6 @@ _%.api-for-check: %.h $(AUTOINCS)
                >$@.new
        mv -f $@.new $@
 
-_paths.h: genpath
-       sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp
-       rm -f $@.tmp
-       $(call move-if-changed,$@.2.tmp,$@)
-
 _libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery 
$(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
        $(PERL) $^ --prefix=libxl >$@.new
        $(call move-if-changed,$@.new,$@)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index c433cbe..b1887e0 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -6,11 +6,11 @@ all: build
 
 XENPATH = "xen/util/path.py"
 
-genpath-target = $(call buildmakevars2file,$(XENPATH))
-$(eval $(genpath-target))
+$(XENPATH): $(XEN_ROOT)/config/xen-environment-scripts
+       cp $(XEN_ROOT)/config/xen-environment-scripts $@
 
 .PHONY: build
-build: genpath genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
+build: $(XENPATH) genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
                $(XEN_ROOT)/tools/libxl/idl.py
        PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
                $(XEN_ROOT)/tools/libxl/libxl_types.idl \
-- 
2.0.0.rc3.18.g00a5b79


_______________________________________________
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®.