All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR
@ 2014-10-01 16:41 Olaf Hering
  2014-10-01 16:41 ` [PATCH 01/28] tools: fix make uninstall Olaf Hering
                   ` (29 more replies)
  0 siblings, 30 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering

Konrad, you are in CC because I would like to see this in 4.5-rc1.


In my attempt to get a xen.rpm from 'make rpmball' which operates
entirely below the configured --prefix= I came up with these changes.

This is a resend of the remaining parts of this series with the
comments incorporated:
http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03003.html
http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03981.html

In v5 of this series the --libexec patch was updated to also remove
PRIVATE_PREFIX and PRIVATE_BINDIR from paths.m4, and it does not remove
$(LIBDIR)/xen/ anymore - just $(LIBEXEC). The patch to "separate runtime
debug info" is the simplified version.


With this series its now possible to run everything except pygrub
below the configured --prefix=.

NOTE: the renaming of tools/hotplug/Linux/init.d/xencommons.in may
cause trouble in configured working copies. Use 'git clean -dfx' to
wipe all and everything before git pull.

One outstanding bug is pygrub, which does not know about
$prefix/$lib/python/site-packages. This is still on my todo list.

Please rerun autogen.sh after applying this series.

Olaf



Olaf Hering (28):
  tools: fix make uninstall
  tools/hotplug: fix race during xen.conf creation
  tools/python: use also LDFLAGS for build
  Add configure --with-initddir=DIR
  tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
  tools/configure.ac: sort AC_CONFIG_FILES
  tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
  tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
  remove duplicate variables from config
  Substitue configure variables in Paths.mk.in
  tools: substitute bindir instead of BINDIR
  Use configure --mandir=DIR to set MANDIR
  Use configure --docdir=DIR to set DOCDIR
  Use configure --includedir=DIR to set INCLUDEDIR
  Use configure --libexecdir=BASEDIR to set LIBEXEC
  Use configure --prefix=DIR to set PREFIX
  Use configure --localstatedir=BASEDIR to set path to /var
  Add configure --enable-rpath
  Add configure --with-linux-backend-modules="mod1 mod2"
  Move variable to set bash_completion.d to Paths.mk
  Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR
  Make XENFIRMWAREDIR a subdir of libexecdir
  tools: remove private copies of includedir and libdir from libxenstat
  Use Paths.mk for docs, stubdom and tools build
  tools: use XEN_LIB_STORED instead of /var/lib/xenstored
  tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen
  move vtpmmgr helpers from tools to stubdom
  Separate runtime debug output from debug symbols

 .gitignore                                         |   7 ++
 Config.mk                                          |  14 +--
 Makefile                                           |  12 ---
 README                                             |  12 ---
 config/Docs.mk.in                                  |   7 +-
 config/Linux.mk                                    |   2 +
 config/Linux.modules                               |  20 ----
 config/NetBSD.mk                                   |   5 -
 config/NetBSDRump.mk                               |   2 -
 config/Paths.mk.in                                 |  44 +++++++--
 config/StdGNU.mk                                   |  23 -----
 config/Stubdom.mk.in                               |   7 --
 config/SunOS.mk                                    |  15 ---
 config/Tools.mk.in                                 |  13 +--
 docs/misc/distro_mapping.txt                       |   5 +-
 m4/paths.m4                                        | 101 ++++++++++++++-------
 m4/xenstored.m4                                    |   8 +-
 stubdom/Makefile                                   |   9 +-
 stubdom/vtpmmgr/Makefile                           |   5 +
 {tools => stubdom}/vtpmmgr/calc.pl                 |   0
 {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl       |   0
 tools/Makefile                                     |  46 ++++++++--
 tools/Rules.mk                                     |   1 -
 tools/configure.ac                                 |  53 +++++++++--
 tools/console/Makefile                             |   4 +-
 tools/hotplug/FreeBSD/Makefile                     |   5 +-
 .../FreeBSD/rc.d/{xencommons => xencommons.in}     |   6 +-
 tools/hotplug/FreeBSD/vif-bridge                   |   2 +-
 tools/hotplug/Linux/Makefile                       |  18 ++--
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in |  10 +-
 .../Linux/init.d/{xen-watchdog => xen-watchdog.in} |   2 +-
 .../init.d/{xencommons.in.in => xencommons.in}     |  13 ++-
 .../Linux/init.d/{xendomains => xendomains.in}     |  14 +--
 tools/hotplug/Linux/systemd/Makefile               |  37 ++------
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |   4 +-
 .../hotplug/Linux/systemd/xen-watchdog.service.in  |   2 +-
 tools/hotplug/Linux/systemd/xenconsoled.service.in |   2 +-
 tools/hotplug/Linux/systemd/xendomains.service.in  |   6 +-
 tools/hotplug/Linux/systemd/xenstored.service.in   |   4 +-
 tools/hotplug/Linux/update-modules.sh              |  36 --------
 tools/hotplug/Linux/{vif-setup => vif-setup.in}    |   2 +-
 .../{xen-backend.rules => xen-backend.rules.in}    |  16 ++--
 ...-hotplug-common.sh => xen-hotplug-common.sh.in} |   4 +-
 tools/hotplug/Linux/{xendomains => xendomains.in}  |   2 +-
 tools/hotplug/NetBSD/Makefile                      |   6 +-
 tools/hotplug/NetBSD/block                         |   2 +-
 .../NetBSD/rc.d/{xencommons => xencommons.in}      |   4 +-
 tools/hotplug/NetBSD/vif-bridge                    |   2 +-
 tools/hotplug/NetBSD/vif-ip                        |   2 +-
 tools/libxl/Makefile                               |   6 +-
 tools/libxl/libxl_dm.c                             |   4 +-
 tools/libxl/libxl_internal.h                       |   1 -
 tools/libxl/libxl_paths.c                          |   7 +-
 tools/libxl/libxl_save_callout.c                   |   2 +-
 tools/misc/Makefile                                |   4 +-
 tools/ocaml/common.make                            |   5 +-
 tools/pygrub/Makefile                              |   8 +-
 tools/python/Makefile                              |   4 +-
 tools/vtpmmgr/Makefile                             |  15 ---
 tools/xcutils/Makefile                             |   4 +-
 tools/xenpaging/Makefile                           |   4 +-
 tools/xenstat/libxenstat/Makefile                  |   4 -
 tools/xenstore/Makefile                            |   3 +-
 tools/xenstore/xs_lib.c                            |   2 +-
 tools/xentrace/Makefile                            |   4 +-
 xen/Rules.mk                                       |   3 +-
 66 files changed, 322 insertions(+), 374 deletions(-)
 delete mode 100644 config/Linux.modules
 rename {tools => stubdom}/vtpmmgr/calc.pl (100%)
 rename {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl (100%)
 rename tools/hotplug/FreeBSD/rc.d/{xencommons => xencommons.in} (96%)
 rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (97%)
 rename tools/hotplug/Linux/init.d/{xencommons.in.in => xencommons.in} (91%)
 rename tools/hotplug/Linux/init.d/{xendomains => xendomains.in} (79%)
 delete mode 100755 tools/hotplug/Linux/update-modules.sh
 rename tools/hotplug/Linux/{vif-setup => vif-setup.in} (61%)
 rename tools/hotplug/Linux/{xen-backend.rules => xen-backend.rules.in} (62%)
 rename tools/hotplug/Linux/{xen-hotplug-common.sh => xen-hotplug-common.sh.in} (94%)
 rename tools/hotplug/Linux/{xendomains => xendomains.in} (99%)
 rename tools/hotplug/NetBSD/rc.d/{xencommons => xencommons.in} (97%)
 delete mode 100644 tools/vtpmmgr/Makefile

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 01/28] tools: fix make uninstall
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-02 14:11   ` Ian Campbell
  2014-10-01 16:41 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
                   ` (28 subsequent siblings)
  29 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

The uninstall target does not know about the paths it removes because
the toplevel Makefile does not include the required files.

Move the commands to tools/Makefile because all files come from subdirs
in tools/ anyway. Drop the removal of $(XEN_RUN_DIR) because it gets
created at runtime. Drop the removal of systemd related files because
the wildcard matches everything.

The proper fix is to remove the files and directories in the Makefiles
which install them. But this version is the least intrusive change at
this point.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 Makefile       | 12 ------------
 tools/Makefile |  9 +++++++++
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index 3b9bf7a..bf8028a 100644
--- a/Makefile
+++ b/Makefile
@@ -232,19 +232,7 @@ help:
 .PHONY: uninstall
 uninstall: D=$(DESTDIR)
 uninstall:
-	[ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) $(D)$(XEN_CONFIG_DIR).old-`date +%s` || true
 	$(MAKE) -C xen uninstall
-	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
-	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
-	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
-	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
-	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
-	rm -f  $(D)$(SBINDIR)/xendomains
-	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
-	rm -f  $(D)$(XEN_SYSTEMD_DIR)/*.service
-	rm -f  $(D)$(XEN_SYSTEMD_DIR)/*.mount
-	rm -f  $(D)$(XEN_SYSTEMD_MODULES_LOAD)/*.conf
-	rm -rf $(D)$(XEN_RUN_DIR)* $(D)/var/lib/xen*
 	make -C tools uninstall
 	rm -rf $(D)/boot/tboot*
 
diff --git a/tools/Makefile b/tools/Makefile
index 00f539a..99e5694 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -67,6 +67,15 @@ install: subdirs-install
 .PHONY: uninstall
 uninstall: D=$(DESTDIR)
 uninstall:
+	[ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) $(D)$(XEN_CONFIG_DIR).old-`date +%s` || true
+	rm -rf $(D)$(CONFIG_DIR)/init.d/xendomains $(D)$(CONFIG_DIR)/init.d/xend
+	rm -rf $(D)$(CONFIG_DIR)/init.d/xencommons $(D)$(CONFIG_DIR)/init.d/xen-watchdog
+	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
+	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
+	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
+	rm -f  $(D)$(SBINDIR)/xendomains
+	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
+	rm -rf $(D)/var/lib/xen*
 	rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
 	rm -rf $(D)$(BINDIR)/xc_shadow
 	rm -rf $(D)$(BINDIR)/pygrub

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 02/28] tools/hotplug: fix race during xen.conf creation
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
  2014-10-01 16:41 ` [PATCH 01/28] tools: fix make uninstall Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-06 13:48   ` Konrad Rzeszutek Wilk
  2014-10-01 16:41 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
                   ` (27 subsequent siblings)
  29 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

A make -j8 will call the xen.conf rule twice. The move-if-changed
macro may fail of the tmp file was already removed by the other make
process. Fix this by let the all target depend on install.
Also remove the generated file with make clean.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/Linux/systemd/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index dc98b67..90ba16e 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -21,10 +21,11 @@ ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
 			$(XEN_SYSTEMD_SERVICE)
 
 .PHONY: all
-all:	$(ALL_XEN_SYSTEMD)
+all:	install
 
 .PHONY: clean
 clean:
+	rm -f $(ALL_XEN_SYSTEMD)
 
 .PHONY: install
 install: $(ALL_XEN_SYSTEMD)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 03/28] tools/python: use also LDFLAGS for build
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
  2014-10-01 16:41 ` [PATCH 01/28] tools: fix make uninstall Olaf Hering
  2014-10-01 16:41 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

An upcoming change will pass -Wl,-rpath to xc.so. Make sure such LDFLAGS
will be used for python libs.

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>
---
 tools/python/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/python/Makefile b/tools/python/Makefile
index 4918229..533d3de 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -11,11 +11,11 @@ build: genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		xen/lowlevel/xl/_pyxl_types.h \
 		xen/lowlevel/xl/_pyxl_types.c
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build
+	CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py build
 
 .PHONY: install
 install:
-	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
+	CC="$(CC)" CFLAGS="$(CFLAGS) $(LDFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
 
 .PHONY: test

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 04/28] Add configure --with-initddir=DIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (2 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Preserve existing behaviour: Fedora gets rc.d/init.d, BSD gets rc.d,
everyone else gets init.d.

Please rerun autogen.sh after applying this patch.

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>
---
 Config.mk                    |  1 -
 config/Paths.mk.in           |  1 +
 docs/misc/distro_mapping.txt |  5 +++--
 m4/paths.m4                  | 20 ++++++++++++++++++++
 4 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 2bb8dcc..e4ff64d 100644
--- 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
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 507b6d1..c01d0ef 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -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@
 
diff --git a/docs/misc/distro_mapping.txt b/docs/misc/distro_mapping.txt
index f849d07..d2b1399 100644
--- a/docs/misc/distro_mapping.txt
+++ b/docs/misc/distro_mapping.txt
@@ -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.
diff --git a/m4/paths.m4 b/m4/paths.m4
index b183845..19b6481 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -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)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (3 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Helper scripts get installed into XEN_SCRIPT_DIR, but initscripts,
helper scripts and udev rules still refer to the hardcoded location
/etc/xen/scripts/. Update scripts, rules and Makefile to refer to
@XEN_SCRIPT_DIR@ instead.

Update configure.ac to substitute the path in files using
XEN_SCRIPT_DIR. Remove XEN_SCRIPT_DIR from StdGNU.mk and SunOS.mk, its
already in Paths.mk.

Note: In SunOS.mk it refered to PRIVATE_PREFIX, which was introduced by
9f6d07bac9f14aaa8bafe38b4a217e61a3a57842 ("tools: get rid of hardcoded
config dirs").

Please rerun autogen.sh after applying this patch.

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>
---
 .gitignore                                               |  6 ++++++
 config/StdGNU.mk                                         |  1 -
 config/SunOS.mk                                          |  1 -
 tools/configure.ac                                       |  6 ++++++
 .../Linux/init.d/{xen-watchdog => xen-watchdog.in}       |  2 +-
 tools/hotplug/Linux/init.d/xencommons.in.in              |  2 +-
 tools/hotplug/Linux/init.d/{xendomains => xendomains.in} |  2 +-
 tools/hotplug/Linux/{vif-setup => vif-setup.in}          |  2 +-
 .../Linux/{xen-backend.rules => xen-backend.rules.in}    | 16 ++++++++--------
 .../{xen-hotplug-common.sh => xen-hotplug-common.sh.in}  |  2 +-
 tools/hotplug/Linux/{xendomains => xendomains.in}        |  2 +-
 11 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/.gitignore b/.gitignore
index 67ed7cb..4344c52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -160,6 +160,12 @@ tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
 tools/fs-back/fs-backend
 tools/hotplug/common/hotplugpath.sh
+tools/hotplug/Linux/init.d/xen-watchdog
+tools/hotplug/Linux/init.d/xendomains
+tools/hotplug/Linux/vif-setup
+tools/hotplug/Linux/xen-backend.rules
+tools/hotplug/Linux/xen-hotplug-common.sh
+tools/hotplug/Linux/xendomains
 tools/include/xen/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index ddf83d7..4cc3a01 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -48,7 +48,6 @@ XEN_PAGING_DIR = /var/lib/xen/xenpaging
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
 XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
-XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts
 
 BOOT_DIR ?= /boot
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index d493eca..1470514 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -32,7 +32,6 @@ PRIVATE_PREFIX = $(LIBDIR)/xen
 PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
 
 XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
-XEN_SCRIPT_DIR = $(PRIVATE_PREFIX)/scripts
 
 BOOT_DIR ?= /boot
 
diff --git a/tools/configure.ac b/tools/configure.ac
index cfa4dd6..cb77811 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -9,6 +9,8 @@ AC_CONFIG_FILES([
 ../config/Tools.mk
 hotplug/Linux/init.d/xencommons.in
 hotplug/Linux/init.d/sysconfig.xencommons
+hotplug/Linux/init.d/xen-watchdog
+hotplug/Linux/init.d/xendomains
 hotplug/Linux/systemd/proc-xen.mount
 hotplug/Linux/systemd/var-lib-xenstored.mount
 hotplug/Linux/systemd/xenstored.socket
@@ -18,6 +20,10 @@ hotplug/Linux/systemd/xenconsoled.service
 hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
 hotplug/Linux/systemd/xendomains.service
 hotplug/Linux/systemd/xen-watchdog.service
+hotplug/Linux/vif-setup
+hotplug/Linux/xen-backend.rules
+hotplug/Linux/xen-hotplug-common.sh
+hotplug/Linux/xendomains
 ])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
diff --git a/tools/hotplug/Linux/init.d/xen-watchdog b/tools/hotplug/Linux/init.d/xen-watchdog.in
similarity index 97%
rename from tools/hotplug/Linux/init.d/xen-watchdog
rename to tools/hotplug/Linux/init.d/xen-watchdog.in
index 3592fda..32c7268 100644
--- a/tools/hotplug/Linux/init.d/xen-watchdog
+++ b/tools/hotplug/Linux/init.d/xen-watchdog.in
@@ -17,7 +17,7 @@
 ### END INIT INFO
 #
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 DAEMON=${SBINDIR}/xenwatchdogd
 base=$(basename $DAEMON)
diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in.in
index a723eb4..bd1d9ba 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in.in
@@ -20,7 +20,7 @@
 
 XENSTORED=@XENSTORED@
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 if [ -d /etc/sysconfig ]; then
 	xencommons_config=/etc/sysconfig
diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains.in
similarity index 97%
rename from tools/hotplug/Linux/init.d/xendomains
rename to tools/hotplug/Linux/init.d/xendomains.in
index 3857602..5b88e2d 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains.in
@@ -24,7 +24,7 @@
 #                    systemd systems.
 ### END INIT INFO
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 case "$1" in
     start)
diff --git a/tools/hotplug/Linux/vif-setup b/tools/hotplug/Linux/vif-setup.in
similarity index 61%
rename from tools/hotplug/Linux/vif-setup
rename to tools/hotplug/Linux/vif-setup.in
index bcc462e..c3bc662 100644
--- a/tools/hotplug/Linux/vif-setup
+++ b/tools/hotplug/Linux/vif-setup.in
@@ -4,6 +4,6 @@ if test "$script"
 then
     exec $script $*
 else
-    exec /etc/xen/scripts/vif-bridge $*
+    exec @XEN_SCRIPT_DIR@/vif-bridge $*
 fi
 
diff --git a/tools/hotplug/Linux/xen-backend.rules b/tools/hotplug/Linux/xen-backend.rules.in
similarity index 62%
rename from tools/hotplug/Linux/xen-backend.rules
rename to tools/hotplug/Linux/xen-backend.rules.in
index a0d409e..7d2f914 100644
--- a/tools/hotplug/Linux/xen-backend.rules
+++ b/tools/hotplug/Linux/xen-backend.rules.in
@@ -1,10 +1,10 @@
-SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/blktap $env{ACTION}"
-SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/block $env{ACTION}"
-SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="/etc/xen/scripts/vif2 $env{ACTION}"
-SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="/etc/xen/scripts/vif-setup online type_if=vif"
-SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="/etc/xen/scripts/vif-setup offline type_if=vif"
-SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", RUN+="/etc/xen/scripts/vscsi $env{ACTION}"
-SUBSYSTEM=="xen-backend", ACTION=="remove", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/xen-hotplug-cleanup"
+SUBSYSTEM=="xen-backend", KERNEL=="tap*", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/blktap $env{ACTION}"
+SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/block $env{ACTION}"
+SUBSYSTEM=="xen-backend", KERNEL=="vif2-*", RUN+="@XEN_SCRIPT_DIR@/vif2 $env{ACTION}"
+SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="online", RUN+="@XEN_SCRIPT_DIR@/vif-setup online type_if=vif"
+SUBSYSTEM=="xen-backend", KERNEL=="vif-*", ENV{UDEV_CALL}="1", ACTION=="offline", RUN+="@XEN_SCRIPT_DIR@/vif-setup offline type_if=vif"
+SUBSYSTEM=="xen-backend", KERNEL=="vscsi*", RUN+="@XEN_SCRIPT_DIR@/vscsi $env{ACTION}"
+SUBSYSTEM=="xen-backend", ACTION=="remove", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/xen-hotplug-cleanup"
 KERNEL=="evtchn", NAME="xen/%k"
 SUBSYSTEM=="xen", KERNEL=="blktap[0-9]*", NAME="xen/%k", MODE="0600"
 SUBSYSTEM=="blktap2", KERNEL=="blktap[0-9]*", NAME="xen/blktap-2/%k", MODE="0600"
@@ -12,4 +12,4 @@ KERNEL=="blktap-control", NAME="xen/blktap-2/control", MODE="0600"
 KERNEL=="gntdev", NAME="xen/%k", MODE="0600"
 KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600"
 KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600"
-SUBSYSTEM=="net", KERNEL=="vif*-emu", ACTION=="add", ENV{UDEV_CALL}="1", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
+SUBSYSTEM=="net", KERNEL=="vif*-emu", ACTION=="add", ENV{UDEV_CALL}="1", RUN+="@XEN_SCRIPT_DIR@/vif-setup $env{ACTION} type_if=tap"
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh b/tools/hotplug/Linux/xen-hotplug-common.sh.in
similarity index 98%
rename from tools/hotplug/Linux/xen-hotplug-common.sh
rename to tools/hotplug/Linux/xen-hotplug-common.sh.in
index 7af4688..996e974 100644
--- a/tools/hotplug/Linux/xen-hotplug-common.sh
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh.in
@@ -112,7 +112,7 @@ xenstore_write() {
 # Execute each hook in the <hook> directory.
 #
 call_hooks() {
-  for f in /etc/xen/scripts/${1}-${2}.d/*.hook; do
+  for f in @XEN_SCRIPT_DIR@/${1}-${2}.d/*.hook; do
     if [ -x "$f" ]; then . "$f"; fi
   done
 }
diff --git a/tools/hotplug/Linux/xendomains b/tools/hotplug/Linux/xendomains.in
similarity index 99%
rename from tools/hotplug/Linux/xendomains
rename to tools/hotplug/Linux/xendomains.in
index c45f132..de711b7 100644
--- a/tools/hotplug/Linux/xendomains
+++ b/tools/hotplug/Linux/xendomains.in
@@ -27,7 +27,7 @@
 #                    boots / shuts down.
 ### END INIT INFO
 
-. /etc/xen/scripts/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 CMD=${SBINDIR}/xl
 HEADCOMP="Xen saved domain"

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (4 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 07/28] tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Please rerun autogen.sh after applying this patch.

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>
---
 tools/configure.ac | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index cb77811..686f499 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -7,19 +7,19 @@ AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([
 ../config/Tools.mk
-hotplug/Linux/init.d/xencommons.in
 hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
+hotplug/Linux/init.d/xencommons.in
 hotplug/Linux/init.d/xendomains
 hotplug/Linux/systemd/proc-xen.mount
 hotplug/Linux/systemd/var-lib-xenstored.mount
-hotplug/Linux/systemd/xenstored.socket
-hotplug/Linux/systemd/xenstored_ro.socket
-hotplug/Linux/systemd/xenstored.service
-hotplug/Linux/systemd/xenconsoled.service
 hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
-hotplug/Linux/systemd/xendomains.service
 hotplug/Linux/systemd/xen-watchdog.service
+hotplug/Linux/systemd/xenconsoled.service
+hotplug/Linux/systemd/xendomains.service
+hotplug/Linux/systemd/xenstored.service
+hotplug/Linux/systemd/xenstored.socket
+hotplug/Linux/systemd/xenstored_ro.socket
 hotplug/Linux/vif-setup
 hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 07/28] tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (5 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@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>
---
 tools/hotplug/FreeBSD/Makefile | 4 ++--
 tools/hotplug/NetBSD/Makefile  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index 6480aa5..e21f046 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -31,10 +31,10 @@ install-scripts:
 
 .PHONY: install-rcd
 install-rcd:
-	$(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/rc.d
+	$(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
 	set -e; for i in $(XEN_RCD_PROG); \
 	   do \
-	   $(INSTALL_PROG) $$i $(DESTDIR)$(CONFIG_DIR)/rc.d; \
+	   $(INSTALL_PROG) $$i $(DESTDIR)$(INITD_DIR); \
 	   sed -i '' 's,@xen_script_dir@,$(DESTDIR)$(XEN_SCRIPT_DIR),g' $(DESTDIR)$(CONFIG_DIR)/$$i; \
 	done
 	$(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(XEN_SCRIPT_DIR)
diff --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile
index fc61162..9084859 100644
--- a/tools/hotplug/NetBSD/Makefile
+++ b/tools/hotplug/NetBSD/Makefile
@@ -33,12 +33,12 @@ install-scripts:
 
 .PHONY: install-rcd
 install-rcd:
-	$(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/rc.d
+	$(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
 	set -e; for i in $(XEN_RCD_PROG); \
 	   do \
-	   $(INSTALL_PROG) $$i $(DESTDIR)$(CONFIG_DIR)/rc.d; \
+	   $(INSTALL_PROG) $$i $(DESTDIR)$(INITD_DIR); \
 	done
-	$(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(CONFIG_DIR)/rc.d/xen-hotplugpath.sh
+	$(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(INITD_DIR)/xen-hotplugpath.sh
 
 .PHONY: clean
 clean:

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

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (6 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 07/28] tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Also remove DESTDIR from the path, this was most likely not intended.

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@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>
---
 .gitignore                                               | 1 +
 tools/configure.ac                                       | 1 +
 tools/hotplug/FreeBSD/Makefile                           | 1 -
 tools/hotplug/FreeBSD/rc.d/{xencommons => xencommons.in} | 2 +-
 4 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4344c52..2201cb0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -160,6 +160,7 @@ tools/flask/utils/flask-set-bool
 tools/flask/utils/flask-label-pci
 tools/fs-back/fs-backend
 tools/hotplug/common/hotplugpath.sh
+tools/hotplug/FreeBSD/rc.d/xencommons
 tools/hotplug/Linux/init.d/xen-watchdog
 tools/hotplug/Linux/init.d/xendomains
 tools/hotplug/Linux/vif-setup
diff --git a/tools/configure.ac b/tools/configure.ac
index 686f499..788ba72 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -7,6 +7,7 @@ AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([
 ../config/Tools.mk
+hotplug/FreeBSD/rc.d/xencommons
 hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
 hotplug/Linux/init.d/xencommons.in
diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index e21f046..169a124 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -35,7 +35,6 @@ install-rcd:
 	set -e; for i in $(XEN_RCD_PROG); \
 	   do \
 	   $(INSTALL_PROG) $$i $(DESTDIR)$(INITD_DIR); \
-	   sed -i '' 's,@xen_script_dir@,$(DESTDIR)$(XEN_SCRIPT_DIR),g' $(DESTDIR)$(CONFIG_DIR)/$$i; \
 	done
 	$(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(XEN_SCRIPT_DIR)
 
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons b/tools/hotplug/FreeBSD/rc.d/xencommons.in
similarity index 98%
rename from tools/hotplug/FreeBSD/rc.d/xencommons
rename to tools/hotplug/FreeBSD/rc.d/xencommons.in
index 2d9034c..8b051ec 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -5,7 +5,7 @@
 
 . /etc/rc.subr
 
-. @xen_script_dir@/hotplugpath.sh
+. @XEN_SCRIPT_DIR@/hotplugpath.sh
 
 LD_LIBRARY_PATH="${LIBDIR}"
 export LD_LIBRARY_PATH

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

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 09/28] remove duplicate variables from config
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (7 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

... because they are already in Paths.mk:
BINDIR, LIBEXEC, PRIVATE_BINDIR, PRIVATE_PREFIX, SBINDIR, SHAREDIR,
XEN_CONFIG_DIR, XENFIRMWAREDIR, XEN_LOCK_DIR, XEN_PAGING_DIR,
XEN_RUN_DIR. Remove unused PKG_XEN_PREFIX, which was also incorrectly
assigned to PRIVATE_PREFIX.

Please rerun autogen.sh after applying this patch.

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>
---
 Config.mk            |  1 -
 config/NetBSD.mk     |  5 -----
 config/NetBSDRump.mk |  2 --
 config/Paths.mk.in   |  1 -
 config/StdGNU.mk     | 14 --------------
 config/SunOS.mk      |  8 --------
 m4/paths.m4          | 20 ++++++++++++++------
 7 files changed, 14 insertions(+), 37 deletions(-)

diff --git a/Config.mk b/Config.mk
index e4ff64d..9bda626 100644
--- a/Config.mk
+++ b/Config.mk
@@ -58,7 +58,6 @@ endif
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
 
-SHAREDIR    ?= $(PREFIX)/share
 DOCDIR      ?= $(SHAREDIR)/doc/xen
 MANDIR      ?= $(SHAREDIR)/man
 BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
diff --git a/config/NetBSD.mk b/config/NetBSD.mk
index 141de7c..21318d6 100644
--- a/config/NetBSD.mk
+++ b/config/NetBSD.mk
@@ -1,11 +1,6 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
 # Override settings for this OS
-LIBEXEC = $(PREFIX)/libexec
-PRIVATE_BINDIR = $(BINDIR)
-
 DLOPEN_LIBS =
 
-XEN_LOCK_DIR = /var/lib
-
 WGET = ftp
diff --git a/config/NetBSDRump.mk b/config/NetBSDRump.mk
index 8daade8..2a87218 100644
--- a/config/NetBSDRump.mk
+++ b/config/NetBSDRump.mk
@@ -3,8 +3,6 @@ include $(XEN_ROOT)/config/StdGNU.mk
 DLOPEN_LIBS =
 PTHREAD_LIBS =
 
-XEN_LOCK_DIR = /var/lib
-
 WGET = ftp
 
 XENSTORE_XENSTORED=n
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index c01d0ef..4bded93 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -29,7 +29,6 @@ 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@
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 4cc3a01..dd6170c 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -28,27 +28,13 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
-BINDIR = $(PREFIX)/bin
 INCLUDEDIR = $(PREFIX)/include
-LIBEXEC = $(PREFIX)/lib/xen/bin
-SHAREDIR = $(PREFIX)/share
 MANDIR = $(SHAREDIR)/man
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
-SBINDIR = $(PREFIX)/sbin
-XENFIRMWAREDIR = $(PREFIX)/lib/xen/boot
-
-PRIVATE_PREFIX = $(LIBDIR)/xen
-PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
-
-XEN_LOCK_DIR = /var/lock
-XEN_RUN_DIR = /var/run/xen
-XEN_PAGING_DIR = /var/lib/xen/xenpaging
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
-XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
-
 BOOT_DIR ?= /boot
 
 SOCKET_LIBS =
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 1470514..92bde78 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -20,18 +20,10 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
-BINDIR = $(PREFIX)/bin
 INCLUDEDIR = $(PREFIX)/include
 MANDIR = $(PREFIX)/share/man
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
-SBINDIR = $(PREFIX)/sbin
-XENFIRMWAREDIR = $(LIBDIR)/xen/boot
-
-PRIVATE_PREFIX = $(LIBDIR)/xen
-PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
-
-XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
 
 BOOT_DIR ?= /boot
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index 19b6481..178b9a9 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -47,7 +47,10 @@ 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
+case "$host_os" in
+*netbsd*)  LIBEXEC=$prefix/libexec ;;
+*) LIBEXEC=$prefix/lib/xen/bin ;;
+esac
 AC_SUBST(LIBEXEC)
 
 LIBDIR=`eval echo $libdir`
@@ -68,10 +71,11 @@ 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
+case "$host_os" in
+*freebsd*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;;
+*netbsd*) PRIVATE_BINDIR=$BINDIR ;;
+*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;;
+esac
 AC_SUBST(PRIVATE_BINDIR)
 
 XENFIRMWAREDIR=$prefix/lib/xen/boot
@@ -89,7 +93,11 @@ AC_SUBST(XEN_CONFIG_DIR)
 XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
 AC_SUBST(XEN_SCRIPT_DIR)
 
-XEN_LOCK_DIR=/var/lock
+case "$host_os" in
+*freebsd*) XEN_LOCK_DIR=/var/lib ;;
+*netbsd*) XEN_LOCK_DIR=/var/lib ;;
+*) XEN_LOCK_DIR=/var/lock ;;
+esac
 AC_SUBST(XEN_LOCK_DIR)
 
 XEN_RUN_DIR=/var/run/xen

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 10/28] Substitue configure variables in Paths.mk.in
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (8 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

This patch lays the groundwork to convert variables used in Makefiles
to the common automake style, i.e. PREFIX becomes prefix, MANDIR becomes
mandir and so on.

The reason is that configure variables such as mandir expand to
${datarootdir}/man, and datarootdir expands to ${prefix}/share. This
requires extra expansion in configure.ac before assigning to MANDIR.

Special care must be taken when variable substition is done in other
files, such as xencommons.in. All @VARIABLES@ used in these files have
to be the expanded version, or all other variables must be available at
runtime.

This patch by itself changes nothing, but upcoming changes will make use
of the lowercase variables.

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>
---
 config/Paths.mk.in | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 4bded93..65ca37b 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -12,6 +12,23 @@
 #
 # http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration
 
+PACKAGE_TARNAME          := @PACKAGE_TARNAME@
+prefix                   := @prefix@
+bindir                   := @bindir@
+sbindir                  := @sbindir@
+libdir                   := @libdir@
+libexecdir               := @libexecdir@
+datarootdir              := @datarootdir@
+mandir                   := @mandir@
+docdir                   := @docdir@
+dvidir                   := @dvidir@
+htmldir                  := @htmldir@
+pdfdir                   := @pdfdir@
+psdir                    := @psdir@
+includedir               := @includedir@
+localstatedir            := @localstatedir@
+sysconfdir               := @sysconfdir@
+
 SBINDIR                  := @SBINDIR@
 BINDIR                   := @BINDIR@
 LIBEXEC                  := @LIBEXEC@

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 11/28] tools: substitute bindir instead of BINDIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (9 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

... and same for sbindir and libdir.
Expand usage of exec_prefix so that it does not appear in substituted
variables in systemd files.

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Akced-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>
---
 config/Paths.mk.in                                  |  6 +++---
 m4/paths.m4                                         | 15 +++++----------
 m4/xenstored.m4                                     |  8 ++++----
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in  |  4 ++--
 tools/hotplug/Linux/systemd/xen-watchdog.service.in |  2 +-
 tools/hotplug/Linux/systemd/xenconsoled.service.in  |  2 +-
 tools/hotplug/Linux/systemd/xenstored.service.in    |  4 ++--
 7 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 65ca37b..c3c9897 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -29,12 +29,12 @@ includedir               := @includedir@
 localstatedir            := @localstatedir@
 sysconfdir               := @sysconfdir@
 
-SBINDIR                  := @SBINDIR@
-BINDIR                   := @BINDIR@
+SBINDIR                  := $(sbindir)
+BINDIR                   := $(bindir)
 LIBEXEC                  := @LIBEXEC@
 
 SHAREDIR                 := @SHAREDIR@
-LIBDIR                   := @LIBDIR@
+LIBDIR                   := $(libdir)
 
 XEN_RUN_DIR              := @XEN_RUN_DIR@
 XEN_LOG_DIR              := @XEN_LOG_DIR@
diff --git a/m4/paths.m4 b/m4/paths.m4
index 178b9a9..a9c6ebd 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -2,6 +2,10 @@ 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=${prefix}
+dnl expand exec_prefix or it will endup in substituted variables
+bindir=`eval echo $bindir`
+sbindir=`eval echo $sbindir`
+libdir=`eval echo $libdir`
 
 dnl
 if test "x$sysconfdir" = 'x${prefix}/etc' ; then
@@ -39,12 +43,6 @@ AC_ARG_WITH([initddir],
          ;;
      esac])
 
-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
 case "$host_os" in
@@ -53,9 +51,6 @@ case "$host_os" in
 esac
 AC_SUBST(LIBEXEC)
 
-LIBDIR=`eval echo $libdir`
-AC_SUBST(LIBDIR)
-
 XEN_RUN_DIR=/var/run/xen
 AC_SUBST(XEN_RUN_DIR)
 
@@ -68,7 +63,7 @@ AC_SUBST(XEN_LIB_STORED)
 SHAREDIR=$prefix/share
 AC_SUBST(SHAREDIR)
 
-PRIVATE_PREFIX=$LIBDIR/xen
+PRIVATE_PREFIX=`eval echo $libdir`
 AC_SUBST(PRIVATE_PREFIX)
 
 case "$host_os" in
diff --git a/m4/xenstored.m4 b/m4/xenstored.m4
index 30b44c9..b268fc2 100644
--- a/m4/xenstored.m4
+++ b/m4/xenstored.m4
@@ -6,10 +6,10 @@ AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
 
 AC_DEFUN([AX_XEN_OCAML_XENSTORE_DEFAULTS], [
 	xenstore="oxenstored"
-	xenstored=$SBINDIR/oxenstored
+	xenstored=$sbindir/oxenstored
 	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
 		xenstore="xenstored"
-		xenstored=$SBINDIR/xenstored
+		xenstored=$sbindir/xenstored
 	])
 ])
 
@@ -29,11 +29,11 @@ AC_ARG_WITH([xenstored],
 	[
 		AS_IF([test "x$withval" = "xxenstored"], [
 			xenstore=$withval
-			xenstored=$SBINDIR/xenstored
+			xenstored=$sbindir/xenstored
 		])
 		AS_IF([test "x$withval" = "xoxenstored"], [
 			xenstore=$withval
-			xenstored=$SBINDIR/oxenstored
+			xenstored=$sbindir/oxenstored
 			AX_XEN_OCAML_XENSTORE_CHECK()
 		])
 		AS_IF([test "x$withval" != "xoxenstored" && test "x$withval" != "xxenstored"], [
diff --git a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
index d423ff8..4d76d6b 100644
--- a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
@@ -14,8 +14,8 @@
 # the XENSTORED variable there.
 #
 # This can be either of:
-#  * @SBINDIR@/oxenstored
-#  * @SBINDIR@/xenstored
+#  * @sbindir@/oxenstored
+#  * @sbindir@/xenstored
 #
 # Changing this requires a reboot to take effect.
 #XENSTORED=@XENSTORED@
diff --git a/tools/hotplug/Linux/systemd/xen-watchdog.service.in b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
index acb2b77..ee77bf9 100644
--- a/tools/hotplug/Linux/systemd/xen-watchdog.service.in
+++ b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
@@ -6,7 +6,7 @@ ConditionVirtualization=xen
 
 [Service]
 Type=forking
-ExecStart=@SBINDIR@/xenwatchdogd 30 15
+ExecStart=@sbindir@/xenwatchdogd 30 15
 KillSignal=USR1
 
 [Install]
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index 15fad35..7ca0264 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -14,7 +14,7 @@ EnvironmentFile=-/etc/sysconfig/xenconsoled
 PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=/bin/mkdir -p ${XENCONSOLED_LOG_DIR}
-ExecStart=@SBINDIR@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
+ExecStart=@sbindir@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
 
 [Install]
 WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
index 4a9fcee..013e69e 100644
--- a/tools/hotplug/Linux/systemd/xenstored.service.in
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -17,8 +17,8 @@ ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb*
 ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
 ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS"
-ExecStartPost=-@BINDIR@/xenstore-write "/local/domain/0/name" "Domain-0"
-ExecStartPost=-@BINDIR@/xenstore-write "/local/domain/0/domid" 0
+ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/name" "Domain-0"
+ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/domid" 0
 
 [Install]
 WantedBy=multi-user.target

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 12/28] Use configure --mandir=DIR to set MANDIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (10 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Also move common MAN8DIR and MAN1DIR to Paths.mk.in

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>
---
 Config.mk          | 1 -
 config/Paths.mk.in | 3 +++
 config/StdGNU.mk   | 3 ---
 config/SunOS.mk    | 3 ---
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/Config.mk b/Config.mk
index 9bda626..b8afa43 100644
--- a/Config.mk
+++ b/Config.mk
@@ -59,7 +59,6 @@ include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
 
 DOCDIR      ?= $(SHAREDIR)/doc/xen
-MANDIR      ?= $(SHAREDIR)/man
 BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
 
 # arguments: variable, common path part, path to test, if yes, if no
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index c3c9897..3ba4f77 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -34,6 +34,9 @@ BINDIR                   := $(bindir)
 LIBEXEC                  := @LIBEXEC@
 
 SHAREDIR                 := @SHAREDIR@
+MANDIR                   := $(mandir)
+MAN1DIR                  := $(MANDIR)/man1
+MAN8DIR                  := $(MANDIR)/man8
 LIBDIR                   := $(libdir)
 
 XEN_RUN_DIR              := @XEN_RUN_DIR@
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index dd6170c..bcf02ea 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -29,9 +29,6 @@ INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
 INCLUDEDIR = $(PREFIX)/include
-MANDIR = $(SHAREDIR)/man
-MAN1DIR = $(MANDIR)/man1
-MAN8DIR = $(MANDIR)/man8
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 92bde78..c88fc2a 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -21,9 +21,6 @@ INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
 INCLUDEDIR = $(PREFIX)/include
-MANDIR = $(PREFIX)/share/man
-MAN1DIR = $(MANDIR)/man1
-MAN8DIR = $(MANDIR)/man8
 
 BOOT_DIR ?= /boot

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (11 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

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>
---
 Config.mk          | 1 -
 config/Paths.mk.in | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index b8afa43..569f4ab 100644
--- a/Config.mk
+++ b/Config.mk
@@ -58,7 +58,6 @@ endif
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
 
-DOCDIR      ?= $(SHAREDIR)/doc/xen
 BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
 
 # arguments: variable, common path part, path to test, if yes, if no
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 3ba4f77..a2221c8 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -38,6 +38,7 @@ MANDIR                   := $(mandir)
 MAN1DIR                  := $(MANDIR)/man1
 MAN8DIR                  := $(MANDIR)/man8
 LIBDIR                   := $(libdir)
+DOCDIR                   := $(docdir)
 
 XEN_RUN_DIR              := @XEN_RUN_DIR@
 XEN_LOG_DIR              := @XEN_LOG_DIR@

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (12 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

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>
---
 config/Paths.mk.in | 1 +
 config/StdGNU.mk   | 1 -
 config/SunOS.mk    | 1 -
 3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index a2221c8..2151c14 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -33,6 +33,7 @@ SBINDIR                  := $(sbindir)
 BINDIR                   := $(bindir)
 LIBEXEC                  := @LIBEXEC@
 
+INCLUDEDIR               := $(includedir)
 SHAREDIR                 := @SHAREDIR@
 MANDIR                   := $(mandir)
 MAN1DIR                  := $(MANDIR)/man1
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index bcf02ea..b28a077 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -28,7 +28,6 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
-INCLUDEDIR = $(PREFIX)/include
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
diff --git a/config/SunOS.mk b/config/SunOS.mk
index c88fc2a..1eaf0f8 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -20,7 +20,6 @@ INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
 PREFIX ?= /usr
-INCLUDEDIR = $(PREFIX)/include
 
 BOOT_DIR ?= /boot

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (13 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-06 15:40   ` Ian Campbell
  2014-10-01 16:41 ` [PATCH 16/28] Use configure --prefix=DIR to set PREFIX Olaf Hering
                   ` (14 subsequent siblings)
  29 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap,
	Stefano Stabellini, Ian Jackson, Samuel Thibault

The current usage of LIBEXEC is bogus. It describes the directory for
private xen executables. Other places create their own, similar
libexecdir path as $prefix/lib/xen/*.

Additional two other variables are used to describe similar paths:
PRIVATE_BINDIR and PRIVATE_PREFIX

The autoconf documentation refers to libexec as a directory for
executables and stuff which is called by other programs, not by the
user.

Adjust all places that want libexecdir as a target path. LIBEXEC refers
now to the base directory. Three convenience variables are used to refer
to paths to private binaries, libs and include files.

In the systemd files LIBEXEC_BIN is substituted, so this variable has to
be present in autoconf. All other variables are expanded in Paths.mk
because they are only used in Makefiles.

Most users of LIBEXEC are updated to use LIBEXEC_BIN because that is
what they want.

Users of PRIVATE_BINDIR are updated to use LIBEXEC_BIN because that is
what they want. PRIVATE_BINDIR and PRIVATE_PREFIX usage is removed by
this patch, in favour of LIBXEC_BIN and LIBEXEC

An internal libxl function was removed. A single helper to retrieve
LIBEXEC_BIN remains.

As suggested by the autoconf documentation, configure appends the
package name to LIBEXEC to make sure the provided directory really
refers to xen. This makes sure "make uninstall" preserves the real
libexecdir.

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 Config.mk                                          |  2 +-
 config/Paths.mk.in                                 |  8 +++---
 m4/paths.m4                                        | 31 ++++++++++------------
 stubdom/Makefile                                   |  6 ++---
 tools/Makefile                                     | 11 ++++----
 tools/console/Makefile                             |  4 +--
 tools/hotplug/FreeBSD/rc.d/xencommons.in           |  2 +-
 tools/hotplug/FreeBSD/vif-bridge                   |  2 +-
 tools/hotplug/Linux/Makefile                       |  4 +--
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in |  2 +-
 tools/hotplug/Linux/init.d/xencommons.in.in        |  4 +--
 tools/hotplug/Linux/init.d/xendomains.in           | 12 ++++-----
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |  2 +-
 tools/hotplug/Linux/systemd/xendomains.service.in  |  6 ++---
 tools/hotplug/Linux/xen-hotplug-common.sh.in       |  2 +-
 tools/hotplug/NetBSD/block                         |  2 +-
 tools/hotplug/NetBSD/rc.d/xencommons               |  2 +-
 tools/hotplug/NetBSD/vif-bridge                    |  2 +-
 tools/hotplug/NetBSD/vif-ip                        |  2 +-
 tools/libxl/Makefile                               |  6 ++---
 tools/libxl/libxl_dm.c                             |  4 +--
 tools/libxl/libxl_internal.h                       |  1 -
 tools/libxl/libxl_paths.c                          |  7 +----
 tools/libxl/libxl_save_callout.c                   |  2 +-
 tools/misc/Makefile                                |  4 +--
 tools/pygrub/Makefile                              |  8 +++---
 tools/vtpmmgr/Makefile                             |  6 ++---
 tools/xcutils/Makefile                             |  4 +--
 tools/xenpaging/Makefile                           |  4 +--
 tools/xentrace/Makefile                            |  4 +--
 30 files changed, 73 insertions(+), 83 deletions(-)

diff --git a/Config.mk b/Config.mk
index 569f4ab..ca400a7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -162,7 +162,7 @@ define move-if-changed
 	if ! cmp -s $(1) $(2); then mv -f $(1) $(2); else rm -f $(1); fi
 endef
 
-BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR \
+BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBEXEC_BIN LIBDIR SHAREDIR \
                    XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
                    XEN_RUN_DIR XEN_PAGING_DIR
 
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 2151c14..8755785 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -31,7 +31,10 @@ sysconfdir               := @sysconfdir@
 
 SBINDIR                  := $(sbindir)
 BINDIR                   := $(bindir)
-LIBEXEC                  := @LIBEXEC@
+LIBEXEC                  := $(libexecdir)/$(PACKAGE_TARNAME)
+LIBEXEC_BIN              := @LIBEXEC_BIN@
+LIBEXEC_LIB              := $(LIBEXEC)/lib
+LIBEXEC_INC              := $(LIBEXEC)/include
 
 INCLUDEDIR               := $(includedir)
 SHAREDIR                 := @SHAREDIR@
@@ -50,9 +53,6 @@ INITD_DIR                := @INITD_DIR@
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@
 
-PRIVATE_PREFIX           := @PRIVATE_PREFIX@
-PRIVATE_BINDIR           := @PRIVATE_BINDIR@
-
 XENFIRMWAREDIR           := @XENFIRMWAREDIR@
 
 XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
diff --git a/m4/paths.m4 b/m4/paths.m4
index a9c6ebd..b7b351c 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -43,13 +43,20 @@ AC_ARG_WITH([initddir],
          ;;
      esac])
 
-dnl XXX: this should be changed to use the passed $libexec
-dnl but can be done as a second step
-case "$host_os" in
-*netbsd*)  LIBEXEC=$prefix/libexec ;;
-*) LIBEXEC=$prefix/lib/xen/bin ;;
-esac
-AC_SUBST(LIBEXEC)
+if test "$libexecdir" = '${exec_prefix}/libexec' ; then
+    case "$host_os" in
+         *netbsd*) ;;
+         *)
+         libexecdir='${exec_prefix}/lib'
+         ;;
+    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)
 
 XEN_RUN_DIR=/var/run/xen
 AC_SUBST(XEN_RUN_DIR)
@@ -63,16 +70,6 @@ AC_SUBST(XEN_LIB_STORED)
 SHAREDIR=$prefix/share
 AC_SUBST(SHAREDIR)
 
-PRIVATE_PREFIX=`eval echo $libdir`
-AC_SUBST(PRIVATE_PREFIX)
-
-case "$host_os" in
-*freebsd*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;;
-*netbsd*) PRIVATE_BINDIR=$BINDIR ;;
-*) PRIVATE_BINDIR=$PRIVATE_PREFIX/bin ;;
-esac
-AC_SUBST(PRIVATE_BINDIR)
-
 XENFIRMWAREDIR=$prefix/lib/xen/boot
 AC_SUBST(XENFIRMWAREDIR)
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 81f6d5a..9dac103 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -462,9 +462,9 @@ install-readme:
 	$(INSTALL_DATA) README $(DESTDIR)$(DOCDIR)/README.stubdom
 
 install-ioemu: ioemu-stubdom
-	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC)"
-	$(INSTALL_PROG) stubdom-dm "$(DESTDIR)$(LIBEXEC)"
-	$(INSTALL_DATA) stubdompath.sh "$(DESTDIR)$(LIBEXEC)"
+	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)"
+	$(INSTALL_PROG) stubdom-dm "$(DESTDIR)$(LIBEXEC_BIN)"
+	$(INSTALL_DATA) stubdompath.sh "$(DESTDIR)$(LIBEXEC_BIN)"
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/ioemu-stubdom.gz"
 
diff --git a/tools/Makefile b/tools/Makefile
index 99e5694..fced437 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -94,8 +94,7 @@ uninstall:
 	rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
 	rm -rf $(D)$(LIBDIR)/libxenstore* $(D)$(LIBDIR)/libxlutil*
 	rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
-	rm -rf $(D)$(LIBDIR)/xen/
-	rm -rf $(D)$(LIBEXEC)/xen*
+	rm -rf $(D)$(LIBEXEC)
 	rm -rf $(D)$(SBINDIR)/setmask
 	rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm
 	rm -rf $(D)$(SHAREDIR)/doc/xen
@@ -196,9 +195,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
-		--prefix=$(PREFIX)/lib/xen \
-		--libdir=$(PREFIX)/lib/xen/lib \
-		--includedir=$(PREFIX)/lib/xen/include \
+		--prefix=$(LIBEXEC) \
+		--libdir=$(LIBEXEC_LIB) \
+		--includedir=$(LIBEXEC_INC) \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libxc/include \
@@ -208,7 +207,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
 		-Wl,-rpath=$(PREFIX)/lib/xen/lib" \
-		--bindir=$(LIBEXEC) \
+		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--localstatedir=/var \
 		--disable-kvm \
diff --git a/tools/console/Makefile b/tools/console/Makefile
index 3e38252..6e55618 100644
--- a/tools/console/Makefile
+++ b/tools/console/Makefile
@@ -32,7 +32,7 @@ xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c))
 install: $(BIN)
 	$(INSTALL_DIR) $(DESTDIR)/$(SBINDIR)
 	$(INSTALL_PROG) xenconsoled $(DESTDIR)/$(SBINDIR)
-	$(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
-	$(INSTALL_PROG) xenconsole $(DESTDIR)$(PRIVATE_BINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) xenconsole $(DESTDIR)$(LIBEXEC_BIN)
 
 -include $(DEPS)
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons.in b/tools/hotplug/FreeBSD/rc.d/xencommons.in
index 8b051ec..c73616e 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons.in
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -65,7 +65,7 @@ xen_startcmd()
 	printf "\n"
 
 	printf "Setting domain 0 name, domid and JSON config...\n"
-	${PRIVATE_BINDIR}/xen-init-dom0
+	${LIBEXEC_BIN}/xen-init-dom0
 }
 
 xen_stop()
diff --git a/tools/hotplug/FreeBSD/vif-bridge b/tools/hotplug/FreeBSD/vif-bridge
index fa7570d..d350df4 100644
--- a/tools/hotplug/FreeBSD/vif-bridge
+++ b/tools/hotplug/FreeBSD/vif-bridge
@@ -13,7 +13,7 @@
 DIR=$(dirname "$0")
 . "${DIR}/hotplugpath.sh"
 
-PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
 path=$1
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 5317fef..184f56d 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -56,8 +56,8 @@ install: all install-initd install-scripts install-udev subdirs-install
 install-initd: all
 	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
 	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
-	[ -d $(DESTDIR)$(LIBEXEC) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
-	$(INSTALL_PROG) $(XENDOMAINS_LIBEXEC) $(DESTDIR)$(LIBEXEC)
+	[ -d $(DESTDIR)$(LIBEXEC_BIN) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(XENDOMAINS_LIBEXEC) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
 	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
diff --git a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
index 4d76d6b..4322081 100644
--- a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
@@ -39,4 +39,4 @@
 #XENBACKENDD_DEBUG=[yes|on|1]
 
 # qemu path
-#QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386
+#QEMU_XEN=@LIBEXEC_BIN@/qemu-system-i386
diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in.in
index bd1d9ba..590f745 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in.in
@@ -92,14 +92,14 @@ do_start () {
 		fi
 
 		echo Setting domain 0 name, domid and JSON config...
-		${PRIVATE_BINDIR}/xen-init-dom0
+		${LIBEXEC_BIN}/xen-init-dom0
 	fi
 
 	echo Starting xenconsoled...
 	test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
 	${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
 	echo Starting QEMU as disk backend for dom0
-	test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386"
+	test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC_BIN}/qemu-system-i386"
 	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
 		-monitor /dev/null -serial /dev/null -parallel /dev/null \
 		-pidfile $QEMU_PIDFILE
diff --git a/tools/hotplug/Linux/init.d/xendomains.in b/tools/hotplug/Linux/init.d/xendomains.in
index 5b88e2d..dcd330c 100644
--- a/tools/hotplug/Linux/init.d/xendomains.in
+++ b/tools/hotplug/Linux/init.d/xendomains.in
@@ -20,7 +20,7 @@
 # Short-Description: Wrapper to start/stop secondary xen domains
 # Description:       Wrapper for starting / stopping domains automatically
 #                    when domain 0 boots / shuts down on systems using init.
-#                    The $LIBEXEC/xendomains helper is shared between init and
+#                    The $LIBEXEC_BIN/xendomains helper is shared between init and
 #                    systemd systems.
 ### END INIT INFO
 
@@ -28,19 +28,19 @@
 
 case "$1" in
     start)
-	$LIBEXEC/xendomains start
+	$LIBEXEC_BIN/xendomains start
 	;;
     stop)
-	$LIBEXEC/xendomains stop
+	$LIBEXEC_BIN/xendomains stop
 	;;
     restart)
-	$LIBEXEC/xendomains restart
+	$LIBEXEC_BIN/xendomains restart
 	;;
     reload)
-	$LIBEXEC/xendomains reload
+	$LIBEXEC_BIN/xendomains reload
 	;;
     status)
-	$LIBEXEC/xendomains status
+	$LIBEXEC_BIN/xendomains status
 	;;
     *)
 	echo "Usage: $0 {start|stop|restart|reload|status}"
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 8dbd110..806bcaa 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -13,7 +13,7 @@ EnvironmentFile=-/etc/sysconfig/xenstored
 PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
 ExecStartPre=/bin/mkdir -p /var/run/xen
-ExecStart=@LIBEXEC@/qemu-system-i386 -xen-domid 0 \
+ExecStart=@LIBEXEC_BIN@/qemu-system-i386 -xen-domid 0 \
 	-xen-attach -name dom0 -nographic -M xenpv -daemonize \
 	-monitor /dev/null -serial /dev/null -parallel /dev/null \
 	-pidfile @XEN_RUN_DIR@/qemu-dom0.pid
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 70ce7c0..f88c336 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -8,9 +8,9 @@ ConditionVirtualization=xen
 Type=oneshot
 RemainAfterExit=true
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
-ExecStart=-@LIBEXEC@/xendomains start
-ExecStop=@LIBEXEC@/xendomains stop
-ExecReload=@LIBEXEC@/xendomains restart
+ExecStart=-@LIBEXEC_BIN@/xendomains start
+ExecStop=@LIBEXEC_BIN@/xendomains stop
+ExecReload=@LIBEXEC_BIN@/xendomains restart
 
 [Install]
 WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/xen-hotplug-common.sh.in b/tools/hotplug/Linux/xen-hotplug-common.sh.in
index 996e974..1deafe1 100644
--- a/tools/hotplug/Linux/xen-hotplug-common.sh.in
+++ b/tools/hotplug/Linux/xen-hotplug-common.sh.in
@@ -30,7 +30,7 @@ dir=$(dirname "$0")
 
 exec 2>>/var/log/xen/xen-hotplug.log
 
-export PATH="${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
+export PATH="${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/sbin:/bin:/usr/bin:/usr/sbin:$PATH"
 export LD_LIBRARY_PATH="${LIBDIR}${LD_LIBRARY_PATH+:}$LD_LIBRARY_PATH"
 export LANG="POSIX"
 unset $(set | grep ^LC_ | cut -d= -f1)
diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block
index f1146b5..b2e9af5 100644
--- a/tools/hotplug/NetBSD/block
+++ b/tools/hotplug/NetBSD/block
@@ -7,7 +7,7 @@
 DIR=$(dirname "$0")
 . "${DIR}/hotplugpath.sh"
 
-PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
 error() {
diff --git a/tools/hotplug/NetBSD/rc.d/xencommons b/tools/hotplug/NetBSD/rc.d/xencommons
index 7ac87e2..793bede 100644
--- a/tools/hotplug/NetBSD/rc.d/xencommons
+++ b/tools/hotplug/NetBSD/rc.d/xencommons
@@ -69,7 +69,7 @@ xen_startcmd()
 	printf "\n"
 
 	printf "Setting domain 0 name, domid and JSON config...\n"
-	${PRIVATE_BINDIR}/xen-init-dom0
+	${LIBEXEC_BIN}/xen-init-dom0
 }
 
 xen_stop()
diff --git a/tools/hotplug/NetBSD/vif-bridge b/tools/hotplug/NetBSD/vif-bridge
index 64162a8..960303e 100644
--- a/tools/hotplug/NetBSD/vif-bridge
+++ b/tools/hotplug/NetBSD/vif-bridge
@@ -7,7 +7,7 @@
 DIR=$(dirname "$0")
 . "${DIR}/hotplugpath.sh"
 
-PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
 xpath=$1
diff --git a/tools/hotplug/NetBSD/vif-ip b/tools/hotplug/NetBSD/vif-ip
index 583e277..28c43de 100644
--- a/tools/hotplug/NetBSD/vif-ip
+++ b/tools/hotplug/NetBSD/vif-ip
@@ -7,7 +7,7 @@
 DIR=$(dirname "$0")
 . "${DIR}/hotplugpath.sh"
 
-PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
 xpath=$1
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 7bfcdd9..0bf666f 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -254,10 +254,10 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(BASH_COMPLETION_DIR)
-	$(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PROG) xl $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(PRIVATE_BINDIR)
-	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(PRIVATE_BINDIR)
+	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
 	$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenlight.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenlight.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenlight.so
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 0018113..d8992bb 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -38,7 +38,7 @@ static const char *qemu_xen_path(libxl__gc *gc)
 #ifdef QEMU_XEN_PATH
     return QEMU_XEN_PATH;
 #else
-    return libxl__abs_path(gc, "qemu-system-i386", libxl__libexec_path());
+    return libxl__abs_path(gc, "qemu-system-i386", libxl__private_bindir_path());
 #endif
 }
 
@@ -73,7 +73,7 @@ const char *libxl__domain_device_model(libxl__gc *gc,
     } else {
         switch (info->device_model_version) {
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
-            dm = libxl__abs_path(gc, "qemu-dm", libxl__libexec_path());
+            dm = libxl__abs_path(gc, "qemu-dm", libxl__private_bindir_path());
             break;
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
             dm = qemu_xen_path(gc);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b87c5e2..83bef59 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2070,7 +2070,6 @@ _hidden int libxl__carefd_close(libxl__carefd*);
 _hidden int libxl__carefd_fd(const libxl__carefd*);
 
 /* common paths */
-_hidden const char *libxl__libexec_path(void);
 _hidden const char *libxl__private_bindir_path(void);
 _hidden const char *libxl__xenfirmwaredir_path(void);
 _hidden const char *libxl__xen_config_dir_path(void);
diff --git a/tools/libxl/libxl_paths.c b/tools/libxl/libxl_paths.c
index 14b28d1..9b7b0d5 100644
--- a/tools/libxl/libxl_paths.c
+++ b/tools/libxl/libxl_paths.c
@@ -15,14 +15,9 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 #include "libxl_internal.h"
 
-const char *libxl__libexec_path(void)
-{
-    return LIBEXEC;
-}
-
 const char *libxl__private_bindir_path(void)
 {
-    return PRIVATE_BINDIR;
+    return LIBEXEC_BIN;
 }
 
 const char *libxl__xenfirmwaredir_path(void)
diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index 1c9f806..40b25e4 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -174,7 +174,7 @@ static void run_helper(libxl__egc *egc, libxl__save_helper_state *shs,
     shs->stdout_what = GCSPRINTF("domain %"PRIu32" save/restore helper"
                                  " stdout pipe", domid);
 
-    *arg++ = getenv("LIBXL_SAVE_HELPER") ?: PRIVATE_BINDIR "/" "libxl-save-helper";
+    *arg++ = getenv("LIBXL_SAVE_HELPER") ?: LIBEXEC_BIN "/" "libxl-save-helper";
     *arg++ = mode_arg;
     const char **stream_fd_arg = arg++;
     for (i=0; i<num_argnums; i++)
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 266fd16..3237461 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -45,10 +45,10 @@ build: $(TARGETS)
 install: build
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
-	$(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR)
 	$(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR)
-	$(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(PRIVATE_BINDIR)
+	$(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(LIBEXEC_BIN)
 	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
 
 .PHONY: clean
diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index a37a8b1..3dff608 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -12,11 +12,11 @@ build:
 install: all
 	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
-		--install-scripts=$(PRIVATE_BINDIR) --force
-	set -e; if [ $(BINDIR) != $(PRIVATE_BINDIR) -a \
+		--install-scripts=$(LIBEXEC_BIN) --force
+	set -e; if [ $(BINDIR) != $(LIBEXEC_BIN) -a \
 	             "`readlink -f $(DESTDIR)/$(BINDIR)`" != \
-	             "`readlink -f $(PRIVATE_BINDIR)`" ]; then \
-	    ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR); \
+	             "`readlink -f $(LIBEXEC_BIN)`" ]; then \
+	    ln -sf $(LIBEXEC_BIN)/pygrub $(DESTDIR)/$(BINDIR); \
 	fi
 
 .PHONY: clean
diff --git a/tools/vtpmmgr/Makefile b/tools/vtpmmgr/Makefile
index 8890b06..b14c170 100644
--- a/tools/vtpmmgr/Makefile
+++ b/tools/vtpmmgr/Makefile
@@ -5,9 +5,9 @@ all:
 	@true
 
 install:
-	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC)"
-	$(INSTALL_DATA) calc.pl "$(DESTDIR)$(LIBEXEC)"
-	$(INSTALL_DATA) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC)"
+	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)"
+	$(INSTALL_DATA) calc.pl "$(DESTDIR)$(LIBEXEC_BIN)"
+	$(INSTALL_DATA) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC_BIN)"
 
 clean:
 	@true
diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile
index f71703d..1c5237c 100644
--- a/tools/xcutils/Makefile
+++ b/tools/xcutils/Makefile
@@ -33,8 +33,8 @@ lsevtchn: lsevtchn.o
 
 .PHONY: install
 install: build
-	$(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
-	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(PRIVATE_BINDIR)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(PROGRAMS) $(DESTDIR)$(LIBEXEC_BIN)
 
 
 .PHONY: clean
diff --git a/tools/xenpaging/Makefile b/tools/xenpaging/Makefile
index 3734ca6..c742e62 100644
--- a/tools/xenpaging/Makefile
+++ b/tools/xenpaging/Makefile
@@ -25,8 +25,8 @@ xenpaging: $(OBJS)
 
 install: all
 	$(INSTALL_DIR) -m 0700 $(DESTDIR)$(XEN_PAGING_DIR)
-	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
-	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC)
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(LIBEXEC_BIN)
 
 clean:
 	rm -f *.o *~ $(DEPS) xen TAGS $(IBINS) $(LIB)
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index 63b09c0..b821952 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -21,12 +21,12 @@ build: $(BIN) $(LIBBIN)
 .PHONY: install
 install: build
 	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
-	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
+	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_DIR) $(DESTDIR)$(MAN1DIR)
 	$(INSTALL_DIR) $(DESTDIR)$(MAN8DIR)
 	$(INSTALL_PROG) $(BIN) $(DESTDIR)$(BINDIR)
 	$(INSTALL_PYTHON_PROG) $(SCRIPTS) $(DESTDIR)$(BINDIR)
-	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(PRIVATE_BINDIR)
+	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1DIR)
 	$(INSTALL_DATA) $(MAN8) $(DESTDIR)$(MAN8DIR)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 16/28] Use configure --prefix=DIR to set PREFIX
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (14 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

PREFIX is set by configure --prefix=DIR, nothing outside
tools,docs,stubdom is using this variable.

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>
---
 config/StdGNU.mk | 2 --
 config/SunOS.mk  | 2 --
 2 files changed, 4 deletions(-)

diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index b28a077..16c3043 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -27,8 +27,6 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-PREFIX ?= /usr
-
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
 BOOT_DIR ?= /boot
diff --git a/config/SunOS.mk b/config/SunOS.mk
index 1eaf0f8..bb8073f 100644
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -19,8 +19,6 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-PREFIX ?= /usr
-
 BOOT_DIR ?= /boot
 
 SunOS_LIBDIR = /usr/sfw/lib

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (15 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 16/28] Use configure --prefix=DIR to set PREFIX Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

This is helpful to test make uninstall with --prefix=/private/dir as
unprivileged user. No change in behaviour is expected by this change.

Please rerun autogen.sh after applying this patch.

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>
---
 m4/paths.m4    | 24 ++++++++++++++++--------
 tools/Makefile |  2 +-
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/m4/paths.m4 b/m4/paths.m4
index b7b351c..53fb7b7 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -2,6 +2,14 @@ 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=${prefix}
+
+dnl Use /var instead of /usr/local/var because there can be only one
+dnl xenstored active at a time. All tools have to share this dir, even
+dnl if they come from a different --prefix=.
+if test "$localstatedir" = '${prefix}/var' ; then
+    localstatedir=/var
+fi
+
 dnl expand exec_prefix or it will endup in substituted variables
 bindir=`eval echo $bindir`
 sbindir=`eval echo $sbindir`
@@ -58,13 +66,13 @@ dnl This variable will be substituted in various .in files
 LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
 AC_SUBST(LIBEXEC_BIN)
 
-XEN_RUN_DIR=/var/run/xen
+XEN_RUN_DIR=$localstatedir/run/xen
 AC_SUBST(XEN_RUN_DIR)
 
-XEN_LOG_DIR=/var/log/xen
+XEN_LOG_DIR=$localstatedir/log/xen
 AC_SUBST(XEN_LOG_DIR)
 
-XEN_LIB_STORED=/var/lib/xenstored
+XEN_LIB_STORED=$localstatedir/lib/xenstored
 AC_SUBST(XEN_LIB_STORED)
 
 SHAREDIR=$prefix/share
@@ -86,15 +94,15 @@ XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
 AC_SUBST(XEN_SCRIPT_DIR)
 
 case "$host_os" in
-*freebsd*) XEN_LOCK_DIR=/var/lib ;;
-*netbsd*) XEN_LOCK_DIR=/var/lib ;;
-*) XEN_LOCK_DIR=/var/lock ;;
+*freebsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*netbsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*) XEN_LOCK_DIR=$localstatedir/lock ;;
 esac
 AC_SUBST(XEN_LOCK_DIR)
 
-XEN_RUN_DIR=/var/run/xen
+XEN_RUN_DIR=$localstatedir/run/xen
 AC_SUBST(XEN_RUN_DIR)
 
-XEN_PAGING_DIR=/var/lib/xen/xenpaging
+XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 AC_SUBST(XEN_PAGING_DIR)
 ])
diff --git a/tools/Makefile b/tools/Makefile
index fced437..b4a26c4 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -209,7 +209,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-Wl,-rpath=$(PREFIX)/lib/xen/lib" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
-		--localstatedir=/var \
+		--localstatedir=$(localstatedir) \
 		--disable-kvm \
 		--disable-docs \
 		--disable-guest-agent \

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 18/28] Add configure --enable-rpath
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (16 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

This fixes the tools when xen is configured with --prefix=/odd/path

Please rerun autogen.sh after applying this patch.

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>
---
 Config.mk          |  3 +++
 config/Tools.mk.in |  1 +
 tools/Makefile     | 16 ++++++++++++++--
 tools/configure.ac |  1 +
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index ca400a7..73281d8 100644
--- a/Config.mk
+++ b/Config.mk
@@ -208,6 +208,9 @@ LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
 LDFLAGS += $(foreach i, $(PREPEND_LIB), -L$(i))
 CFLAGS += $(foreach i, $(PREPEND_INCLUDES), -I$(i))
+ifeq ($(XEN_TOOLS_RPATH),y)
+LDFLAGS += -Wl,-rpath,$(LIBDIR)
+endif
 APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i))
 APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index a69b846..7183c32 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -45,6 +45,7 @@ PTYFUNCS_LIBS       := @PTYFUNCS_LIBS@
 
 LIBNL3_LIBS         := @LIBNL3_LIBS@
 LIBNL3_CFLAGS       := @LIBNL3_CFLAGS@
+XEN_TOOLS_RPATH     := @rpath@
 
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
diff --git a/tools/Makefile b/tools/Makefile
index b4a26c4..452510a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -118,6 +118,14 @@ IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
 			 --interp-prefix=$(CROSS_SYS_ROOT)
 endif
 
+ifeq ($(XEN_TOOLS_RPATH),y)
+QEMU_UPSTREAM_RPATH := -Wl,-rpath,$(LIBEXEC_LIB):$(LIBDIR)
+IOEMU_EXTRA_LDFLAGS := --extra-ldflags="-Wl,-rpath,$(LIBDIR)"
+else
+QEMU_UPSTREAM_RPATH := -Wl,-rpath,$(LIBEXEC_LIB)
+IOEMU_EXTRA_LDFLAGS :=
+endif
+
 QEMU_ROOT := $(shell if [ -d "$(QEMU_TRADITIONAL_LOC)" ]; then echo "$(QEMU_TRADITIONAL_LOC)"; else echo .; fi)
 ifneq ($(QEMU_ROOT),.)
 export QEMU_ROOT
@@ -153,7 +161,10 @@ subdir-all-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
 		$(buildmakevars2shellvars); \
 		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup --cpu=$(IOEMU_CPU_ARCH) $(IOEMU_CONFIGURE_CROSS); \
+		$(QEMU_ROOT)/xen-setup \
+		$(IOEMU_EXTRA_LDFLAGS) \
+		--cpu=$(IOEMU_CPU_ARCH) \
+		$(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) all
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
@@ -162,6 +173,7 @@ subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup \
 		--extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
+		$(IOEMU_EXTRA_LDFLAGS) \
 		--cpu=$(IOEMU_CPU_ARCH) \
 		$(IOEMU_CONFIGURE_CROSS); \
 		$(MAKE) install
@@ -206,7 +218,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
 		-L$(XEN_ROOT)/tools/xenstore \
-		-Wl,-rpath=$(PREFIX)/lib/xen/lib" \
+		$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--localstatedir=$(localstatedir) \
diff --git a/tools/configure.ac b/tools/configure.ac
index 788ba72..b9a1f6e 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -80,6 +80,7 @@ m4_include([../m4/systemd.m4])
 AX_XEN_EXPAND_CONFIG()
 
 # Enable/disable options
+AX_ARG_DEFAULT_DISABLE([rpath], [Build tools with -Wl,-rpath,LIBDIR])
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
 AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (17 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 20/28] Move variable to set bash_completion.d to Paths.mk Olaf Hering
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

This replaces config/Linux.modules with a configure option. As a result
of this change only a single xencomons.in is required, instead of a
xencomons.in.in and sed hackery.

After this change blktap2 and blktap will be loaded at the same time.
This is already done in out-of-tree xencommons scripts, and systemd will
load both modules as well. No harm is expected by loading both modules.

Please rerun autogen.sh after applying this patch.

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>
---
 README                                             | 12 --------
 config/Linux.modules                               | 20 ------------
 config/Tools.mk.in                                 |  2 ++
 tools/configure.ac                                 | 34 +++++++++++++++++++-
 tools/hotplug/Linux/Makefile                       | 14 +++------
 .../init.d/{xencommons.in.in => xencommons.in}     |  5 ++-
 tools/hotplug/Linux/systemd/Makefile               | 34 ++++----------------
 tools/hotplug/Linux/update-modules.sh              | 36 ----------------------
 8 files changed, 49 insertions(+), 108 deletions(-)

diff --git a/README b/README
index 78c5db2..e860644 100644
--- a/README
+++ b/README
@@ -235,15 +235,3 @@ There are optional targets as part of Xen's top-level makefile that will
 download and build tboot: install-tboot, build-tboot, dist-tboot, clean-tboot.
 These will download the latest tar file from the SourceForge site using wget,
 then build/install/dist according to Xen's settings.
-
-Required Kernel modules
-======================
-
-Xen has a set of Kernel modules which the init scripts ensure to load before
-before starting Xen guests. The list of modules are maintained in one place:
-
-  * config/$(XEN_OS).modules
-
-For more details refer to:
-
-http://wiki.xen.org/wiki/Category:Host_Configuration#Kernel_modules
diff --git a/config/Linux.modules b/config/Linux.modules
deleted file mode 100644
index 8a764df..0000000
--- a/config/Linux.modules
+++ /dev/null
@@ -1,20 +0,0 @@
-# The file supports a simple language, comments are ignored, and if you there
-# are module replacements this can be listed by using a pipe to show preference
-# for the first module, followed by the older module.
-
-xen-evtchn
-xen-gntdev
-xen-gntalloc
-xen-blkback
-xen-netback
-xen-pciback
-evtchn
-gntdev
-netbk
-blkbk
-xen-scsibk
-usbbk
-pciback
-xen-acpi-processor
-# Prefer to load blktap2 if found, otherwise load blktap
-blktap2|blktap
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 7183c32..bf437f6 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -74,6 +74,8 @@ SYSTEMD_LIBS        := @SYSTEMD_LIBS@
 XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
 XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
 
+LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@
+
 #System options
 ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
diff --git a/tools/configure.ac b/tools/configure.ac
index b9a1f6e..a882948 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -10,7 +10,7 @@ AC_CONFIG_FILES([
 hotplug/FreeBSD/rc.d/xencommons
 hotplug/Linux/init.d/sysconfig.xencommons
 hotplug/Linux/init.d/xen-watchdog
-hotplug/Linux/init.d/xencommons.in
+hotplug/Linux/init.d/xencommons
 hotplug/Linux/init.d/xendomains
 hotplug/Linux/systemd/proc-xen.mount
 hotplug/Linux/systemd/var-lib-xenstored.mount
@@ -90,6 +90,38 @@ AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
 AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools])
 AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools])
 
+AC_ARG_WITH([linux-backend-modules],
+    AS_HELP_STRING([--with-linux-backend-modules="mod1 mod2"],
+    [List of Linux backend module or modalias names to be autoloaded on startup.]),
+    [LINUX_BACKEND_MODULES="$withval"],
+    [case "$host_os" in
+*linux*)
+LINUX_BACKEND_MODULES="
+xen-evtchn
+xen-gntdev
+xen-gntalloc
+xen-blkback
+xen-netback
+xen-pciback
+evtchn
+gntdev
+netbk
+blkbk
+xen-scsibk
+usbbk
+pciback
+xen-acpi-processor
+blktap2
+blktap
+"
+;;
+*)
+LINUX_BACKEND_MODULES=
+;;
+esac])
+LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
+AC_SUBST(LINUX_BACKEND_MODULES)
+
 dnl Enable blktap2 on Linux only.
 AC_ARG_ENABLE([blktap2],
     AS_HELP_STRING([--enable-blktap2],
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 184f56d..8cdaa9a 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -37,23 +37,17 @@ UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
 
 .PHONY: all
-all: $(XENCOMMONS_INITD) subdirs-all
-
-$(XENCOMMONS_INITD): $(XEN_ROOT)/config/$(XEN_OS).modules $(XENCOMMONS_INITD).in
-	$(XEN_ROOT)/tools/hotplug/Linux/update-modules.sh \
-		$(XEN_ROOT) \
-		$(XEN_OS) \
-		$(XENCOMMONS_INITD) > $@
+all: subdirs-all
 
 .PHONY: build
-build: all
+build:
 
 .PHONY: install
 install: all install-initd install-scripts install-udev subdirs-install
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
-install-initd: all
+install-initd:
 	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
 	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
 	[ -d $(DESTDIR)$(LIBEXEC_BIN) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
@@ -65,7 +59,7 @@ install-initd: all
 	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
 
 .PHONY: install-scripts
-install-scripts: all
+install-scripts:
 	[ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
 		$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
 	set -e; for i in $(XEN_SCRIPTS); \
diff --git a/tools/hotplug/Linux/init.d/xencommons.in.in b/tools/hotplug/Linux/init.d/xencommons.in
similarity index 96%
rename from tools/hotplug/Linux/init.d/xencommons.in.in
rename to tools/hotplug/Linux/init.d/xencommons.in
index 590f745..10edf29 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -19,6 +19,7 @@
 ### END INIT INFO
 
 XENSTORED=@XENSTORED@
+BACKEND_MODULES="@LINUX_BACKEND_MODULES@"
 
 . @XEN_SCRIPT_DIR@/hotplugpath.sh
 
@@ -58,8 +59,10 @@ fi
 do_start () {
         local time=0
 	local timeout=30
+	local mod
+
+	for mod in $BACKEND_MODULES ; do modprobe "$mod" &>/dev/null ; done
 
-	@LOAD_MODULES@
 	mkdir -p ${XEN_RUN_DIR}
 	mkdir -p ${XEN_LOCK_DIR}
 
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index 90ba16e..6950d24 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -38,31 +38,9 @@ install: $(ALL_XEN_SYSTEMD)
 	$(INSTALL_DATA) *.mount $(DESTDIR)$(XEN_SYSTEMD_DIR)
 	$(INSTALL_DATA) *.conf $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
 
-$(XEN_SYSTEMD_MODULES): $(XEN_ROOT)/config/$(XEN_OS).modules
-	@set -e ;							\
-	IFS=''								;\
-	cat  $(XEN_ROOT)/config/$(XEN_OS).modules	| (		\
-		while read l ; do					\
-			if echo $${l} | egrep -q "^#" ; then		\
-				continue				;\
-			fi						;\
-			if echo "$${l}" | egrep -q "\|" ; then		\
-				m1=$${l%%|*}				;\
-				m2=$${l#*|} 				;\
-				# Systemd modules-load.d lacks support	;\
-				# for module replacement options, we	;\
-				# need to add that support upstream but ;\
-				# its best instead to ensure this file	;\
-				# is no longer needed. Some folks	;\
-				# however have reported issues with	;\
-				# some modules automatically loading	;\
-				# so we just load all necessary xen	;\
-				# modules and for replacements we load	;\
-				# the latest module			;\
-				echo "$$m1" ;\
-				echo "$$m2" ;\
-			else						\
-				echo "$$l"				;\
-			fi						;\
-		done							\
-	) > $@
+$(XEN_SYSTEMD_MODULES):
+	rm -f $@.tmp
+	for mod in $(LINUX_BACKEND_MODULES) ; do \
+		echo $$mod ; \
+		done > $@.tmp
+	$(call move-if-changed,$@.tmp,$@)
diff --git a/tools/hotplug/Linux/update-modules.sh b/tools/hotplug/Linux/update-modules.sh
deleted file mode 100755
index 692d220..0000000
--- a/tools/hotplug/Linux/update-modules.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-IFS=''
-
-XEN_ROOT=$1
-XEN_OS=$2
-XENCOMMONS_INITD=$3
-
-cat  $XEN_ROOT/config/${XEN_OS}.modules	| (
-	while read l ; do
-		if echo $l | egrep -q "^#" ; then
-			continue
-		fi
-		if echo "$l" | egrep -q "\|" ; then
-			m1=${l%%|*}
-			m2=${l#*|}
-			echo "        modprobe $m1 2>/dev/null || modprobe $m2 2>/dev/null"
-		else
-			echo "        modprobe $l 2>/dev/null"
-		fi
-	done
-) > ${XENCOMMONS_INITD}.modules
-
-cat  ${XENCOMMONS_INITD}.in	| (
-	while read l ; do
-		if echo "$l" | egrep -q "@LOAD_MODULES@" ; then
-			cat ${XENCOMMONS_INITD}.modules
-		else
-			echo $l
-		fi
-	done
-)
-
-rm -f ${XENCOMMONS_INITD}.modules

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 20/28] Move variable to set bash_completion.d to Paths.mk
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (18 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Olaf Hering
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

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>
---
 Config.mk          | 2 --
 config/Paths.mk.in | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 73281d8..cf7af12 100644
--- a/Config.mk
+++ b/Config.mk
@@ -58,8 +58,6 @@ endif
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
 
-BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
-
 # arguments: variable, common path part, path to test, if yes, if no
 define setvar_dir
   ifndef $(1)
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 8755785..e1fe4a3 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -50,6 +50,7 @@ XEN_LIB_STORED           := @XEN_LIB_STORED@
 
 CONFIG_DIR               := @CONFIG_DIR@
 INITD_DIR                := @INITD_DIR@
+BASH_COMPLETION_DIR      := $(CONFIG_DIR)/bash_completion.d
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (19 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 20/28] Move variable to set bash_completion.d to Paths.mk Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 22/28] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Set CONFIG_LEAF_DIR with configure to give control if needed. The
check for the correct value if the option is not specified is tricky.
Since other packages (such as grub2) started to populate also
/etc/default/ a given system may have both directories.
Use "default" only if /etc/sysconfig does not exist. "sysconfig"
remains the default.

Move the variable from StdGNU.mk to Linux.mk because thats the only
place where it is used.

Please rerun autogen.sh after applying this patch.

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>
---
 Config.mk                    |  3 ---
 config/Linux.mk              |  2 ++
 config/Paths.mk.in           |  1 +
 config/StdGNU.mk             |  2 --
 docs/misc/distro_mapping.txt |  4 ++--
 m4/paths.m4                  | 11 +++++++++++
 6 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/Config.mk b/Config.mk
index cf7af12..dff71b3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -69,9 +69,6 @@ define setvar_dir
   endif
 endef
 
-# See distro_mapping.txt for other options
-$(eval $(call setvar_dir,CONFIG_LEAF_DIR,,/etc/sysconfig,sysconfig,default))
-
 ifneq ($(EXTRA_PREFIX),)
 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
 EXTRA_LIB += $(EXTRA_PREFIX)/lib
diff --git a/config/Linux.mk b/config/Linux.mk
index b421a1c..2a84b6b 100644
--- a/config/Linux.mk
+++ b/config/Linux.mk
@@ -1 +1,3 @@
 include $(XEN_ROOT)/config/StdGNU.mk
+
+SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index e1fe4a3..9fd87c5 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -50,6 +50,7 @@ XEN_LIB_STORED           := @XEN_LIB_STORED@
 
 CONFIG_DIR               := @CONFIG_DIR@
 INITD_DIR                := @INITD_DIR@
+CONFIG_LEAF_DIR          := @CONFIG_LEAF_DIR@
 BASH_COMPLETION_DIR      := $(CONFIG_DIR)/bash_completion.d
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 16c3043..1566d7f 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -27,8 +27,6 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
-
 BOOT_DIR ?= /boot
 
 SOCKET_LIBS =
diff --git a/docs/misc/distro_mapping.txt b/docs/misc/distro_mapping.txt
index d2b1399..2e46592 100644
--- a/docs/misc/distro_mapping.txt
+++ b/docs/misc/distro_mapping.txt
@@ -14,8 +14,8 @@ scripts at run-time.  If the Red Hat directory exists, it is used;
 otherwise the Debian one is used.
 
 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). 
+The CONFIG_LEAF_DIR name can be changed with configure
+--with-sysconfig-leaf-dir=SUBDIR.
 
 To add support for new distributions that don't use the above locations,
 one must grep for the above elements and add appropriate checks.
diff --git a/m4/paths.m4 b/m4/paths.m4
index 53fb7b7..dcb8f28 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -51,6 +51,17 @@ AC_ARG_WITH([initddir],
          ;;
      esac])
 
+AC_ARG_WITH([sysconfig-leaf-dir],
+    AS_HELP_STRING([--with-sysconfig-leaf-dir=SUBDIR],
+    [Name of subdirectory in /etc to store runtime options for runlevel
+    scripts and daemons such as xenstoerd.
+    This should be either "sysconfig" or "default". [sysconfig]]),
+    [config_leaf_dir=$withval],
+    [config_leaf_dir=sysconfig
+    if test ! -d /etc/sysconfig ; then config_leaf_dir=default ; fi])
+CONFIG_LEAF_DIR=$config_leaf_dir
+AC_SUBST(CONFIG_LEAF_DIR)
+
 if test "$libexecdir" = '${exec_prefix}/libexec' ; then
     case "$host_os" in
          *netbsd*) ;;

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 22/28] Make XENFIRMWAREDIR a subdir of libexecdir
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (20 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 23/28] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Put the firmware files below libexecdir. This is essentially just a new
name for the existing path. It has the benefit that it can be configured
via --libexecdir= if required.

Please rerun autogen.sh after applying this patch.

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>
---
 config/Paths.mk.in | 2 +-
 m4/paths.m4        | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 9fd87c5..50d40cc 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -55,7 +55,7 @@ BASH_COMPLETION_DIR      := $(CONFIG_DIR)/bash_completion.d
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@
 
-XENFIRMWAREDIR           := @XENFIRMWAREDIR@
+XENFIRMWAREDIR           := $(LIBEXEC)/boot
 
 XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
 XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
diff --git a/m4/paths.m4 b/m4/paths.m4
index dcb8f28..46172cb 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -89,9 +89,6 @@ AC_SUBST(XEN_LIB_STORED)
 SHAREDIR=$prefix/share
 AC_SUBST(SHAREDIR)
 
-XENFIRMWAREDIR=$prefix/lib/xen/boot
-AC_SUBST(XENFIRMWAREDIR)
-
 CONFIG_DIR=$sysconfdir
 AC_SUBST(CONFIG_DIR)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 23/28] tools: remove private copies of includedir and libdir from libxenstat
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (21 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 22/28] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build Olaf Hering
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

They are wrong and unused.

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>
---
 tools/xenstat/libxenstat/Makefile | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile
index f64a45c..86068cb 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -15,10 +15,6 @@
 XEN_ROOT=$(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-prefix=$(PREFIX)
-includedir=$(prefix)/include
-libdir=$(prefix)/lib
-
 LDCONFIG=ldconfig
 MAKE_LINK=ln -sf

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (22 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 23/28] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, Samuel Thibault

Paths.mk contains just directories set by configure.
Source this file first when building docs,stubdom or tools.
Remove unused path variables from $subsystem.mk.

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: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 config/Docs.mk.in    | 7 +------
 config/Paths.mk.in   | 2 ++
 config/Stubdom.mk.in | 6 ------
 config/Tools.mk.in   | 9 ++-------
 tools/Rules.mk       | 1 -
 5 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/config/Docs.mk.in b/config/Docs.mk.in
index 497650f..33bd529 100644
--- a/config/Docs.mk.in
+++ b/config/Docs.mk.in
@@ -1,9 +1,4 @@
-# Prefix and install folder
-prefix              := @prefix@
-PREFIX              := $(prefix)
-exec_prefix         := @exec_prefix@
-libdir              := @libdir@
-LIBDIR              := $(libdir)
+-include $(XEN_ROOT)/config/Paths.mk
 
 # Tools
 FIG2DEV             := @FIG2DEV@
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index 50d40cc..fe10f76 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -29,6 +29,8 @@ includedir               := @includedir@
 localstatedir            := @localstatedir@
 sysconfdir               := @sysconfdir@
 
+PREFIX                   := $(prefix)
+
 SBINDIR                  := $(sbindir)
 BINDIR                   := $(bindir)
 LIBEXEC                  := $(libexecdir)/$(PACKAGE_TARNAME)
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index c1c83bc..9098cbf 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -1,10 +1,4 @@
-# Prefix and install folder
 -include $(XEN_ROOT)/config/Paths.mk
-prefix              := @prefix@
-PREFIX              := $(prefix)
-exec_prefix         := @exec_prefix@
-libdir              := @libdir@
-LIBDIR              := $(libdir)
 
 # Path Programs
 CMAKE               := @CMAKE@
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index bf437f6..545bdc0 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -1,15 +1,10 @@
+-include $(XEN_ROOT)/config/Paths.mk
+
 CONFIG_RUMP         := @CONFIG_RUMP@
 ifeq ($(CONFIG_RUMP),y)
 XEN_OS              := NetBSDRump
 endif
 
-# Prefix and install folder
-prefix              := @prefix@
-PREFIX              := $(prefix)
-exec_prefix         := @exec_prefix@
-libdir              := @libdir@
-LIBDIR              := $(libdir)
-
 # A debug build of tools?
 debug               := @debug@
 
diff --git a/tools/Rules.mk b/tools/Rules.mk
index e2fdf63..87a56dc 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -5,7 +5,6 @@ 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

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (23 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 26/28] tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Remove hardcoded /var/lib/xenstored instead of using the existing
XEN_LIB_STORED variable.

Please rerun autogen.sh after applying this patch.

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>
---
 tools/configure.ac                                      | 1 +
 tools/hotplug/FreeBSD/rc.d/xencommons.in                | 2 +-
 tools/hotplug/Linux/init.d/sysconfig.xencommons.in      | 4 ++--
 tools/hotplug/Linux/init.d/xencommons.in                | 2 +-
 tools/hotplug/NetBSD/rc.d/{xencommons => xencommons.in} | 2 +-
 tools/xenstore/Makefile                                 | 3 ++-
 tools/xenstore/xs_lib.c                                 | 2 +-
 7 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/tools/configure.ac b/tools/configure.ac
index a882948..98b2455 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -25,6 +25,7 @@ hotplug/Linux/vif-setup
 hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh
 hotplug/Linux/xendomains
+hotplug/NetBSD/rc.d/xencommons
 ])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons.in b/tools/hotplug/FreeBSD/rc.d/xencommons.in
index c73616e..900990b 100644
--- a/tools/hotplug/FreeBSD/rc.d/xencommons.in
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons.in
@@ -37,7 +37,7 @@ xen_startcmd()
 	if test -z "$xenstored_pid"; then
 		printf "Cleaning xenstore database.\n"
 		if [ -z "${XENSTORED_ROOTDIR}" ]; then
-			XENSTORED_ROOTDIR="/var/lib/xenstored"
+			XENSTORED_ROOTDIR="@XEN_LIB_STORED@"
 		fi
 		rm -f ${XENSTORED_ROOTDIR}/tdb* >/dev/null 2>&1
 		printf "Starting xenservices: xenstored, xenconsoled."
diff --git a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
index 4322081..c12fc8a 100644
--- a/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons.in
@@ -27,10 +27,10 @@
 #XENSTORED_TRACE=[yes|on|1]
 
 ## Type: string
-## Default: "/var/lib/xenstored"
+## Default: "@XEN_LIB_STORED@"
 #
 # Running xenstored on XENSTORED_ROOTDIR
-#XENSTORED_ROOTDIR=/var/lib/xenstored
+#XENSTORED_ROOTDIR=@XEN_LIB_STORED@
 
 ## Type: string
 ## Default: Not defined, xenbackendd debug mode off
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index 10edf29..d53a1f3 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -68,7 +68,7 @@ do_start () {
 
 	if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
 	then
-		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
+		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="@XEN_LIB_STORED@"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
 		test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
 
diff --git a/tools/hotplug/NetBSD/rc.d/xencommons b/tools/hotplug/NetBSD/rc.d/xencommons.in
similarity index 98%
rename from tools/hotplug/NetBSD/rc.d/xencommons
rename to tools/hotplug/NetBSD/rc.d/xencommons.in
index 793bede..db03f22 100644
--- a/tools/hotplug/NetBSD/rc.d/xencommons
+++ b/tools/hotplug/NetBSD/rc.d/xencommons.in
@@ -41,7 +41,7 @@ xen_startcmd()
 	if test -z "$xenstored_pid"; then
 		printf "Cleaning xenstore database.\n"
 		if [ -z "${XENSTORED_ROOTDIR}" ]; then
-			XENSTORED_ROOTDIR="/var/lib/xenstored"
+			XENSTORED_ROOTDIR="@XEN_LIB_STORED@"
 		fi
 		rm -f ${XENSTORED_ROOTDIR}/tdb* >/dev/null 2>&1
 		printf "Starting xenservices: xenstored, xenconsoled."
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index cff57ed..563abd4 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -9,6 +9,7 @@ CFLAGS += -I.
 CFLAGS += -I$(XEN_ROOT)/tools/
 CFLAGS += -I./include
 CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += -DXEN_LIB_STORED="\"$(XEN_LIB_STORED)\""
 
 CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
 LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
@@ -129,7 +130,7 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xenstore-compat
 ifeq ($(XENSTORE_XENSTORED),y)
-	$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_STORED)
 	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
 endif
 	$(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
diff --git a/tools/xenstore/xs_lib.c b/tools/xenstore/xs_lib.c
index 9a78755..d166497 100644
--- a/tools/xenstore/xs_lib.c
+++ b/tools/xenstore/xs_lib.c
@@ -30,7 +30,7 @@
 const char *xs_daemon_rootdir(void)
 {
 	char *s = getenv("XENSTORED_ROOTDIR");
-	return (s ? s : "/var/lib/xenstored");
+	return (s ? s : XEN_LIB_STORED);
 }
 
 const char *xs_daemon_rundir(void)

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 26/28] tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (24 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 16:41 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Also remove duplicate XEN_RUN_DIR from m4/paths.m4.

Please rerun autogen.sh after applying this patch.

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>
---
 m4/paths.m4                                                       | 3 ---
 tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/m4/paths.m4 b/m4/paths.m4
index 46172cb..b35596c 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -108,9 +108,6 @@ case "$host_os" in
 esac
 AC_SUBST(XEN_LOCK_DIR)
 
-XEN_RUN_DIR=$localstatedir/run/xen
-AC_SUBST(XEN_RUN_DIR)
-
 XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 AC_SUBST(XEN_PAGING_DIR)
 ])
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
index 806bcaa..d3470fc 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -12,7 +12,7 @@ EnvironmentFile=-/etc/default/xenstored
 EnvironmentFile=-/etc/sysconfig/xenstored
 PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid
 ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
-ExecStartPre=/bin/mkdir -p /var/run/xen
+ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
 ExecStart=@LIBEXEC_BIN@/qemu-system-i386 -xen-domid 0 \
 	-xen-attach -name dom0 -nographic -M xenpv -daemonize \
 	-monitor /dev/null -serial /dev/null -parallel /dev/null \

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 27/28] move vtpmmgr helpers from tools to stubdom
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (25 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 26/28] tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-01 21:51   ` Daniel De Graaf
  2014-10-01 16:41 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
                   ` (2 subsequent siblings)
  29 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, Samuel Thibault, Daniel De Graaf

Tools.mk contains a dead CONFIG_VTPM, @vtpm@ is never expanded because
@vtpm@ is only known by stubdom/configure.ac. Move the two perl scripts
to stubdom/vtpmmgr and install them as executeable. This was introduced
by the recent commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
add example control tools")
Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently)
not used by make itself.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 config/Stubdom.mk.in                         |  1 -
 config/Tools.mk.in                           |  1 -
 stubdom/vtpmmgr/Makefile                     |  5 +++++
 {tools => stubdom}/vtpmmgr/calc.pl           |  0
 {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl |  0
 tools/Makefile                               |  1 -
 tools/vtpmmgr/Makefile                       | 15 ---------------
 7 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index 9098cbf..5990fc4 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -6,7 +6,6 @@ FETCHER             := @FETCHER@
 
 # A debug build of stubdom? //FIXME: Someone make this do something
 debug               := @debug@
-vtpm = @vtpm@
 
 STUBDOM_TARGETS     := @STUBDOM_TARGETS@
 STUBDOM_BUILD       := @STUBDOM_BUILD@
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 545bdc0..89de5bd 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -59,7 +59,6 @@ CONFIG_QEMU_TRAD    := @qemu_traditional@
 CONFIG_QEMU_XEN     := @qemu_xen@
 CONFIG_BLKTAP1      := @blktap1@
 CONFIG_BLKTAP2      := @blktap2@
-CONFIG_VTPM         := @vtpm@
 CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@
 CONFIG_REMUS_NETBUF := @remus_netbuf@
 
diff --git a/stubdom/vtpmmgr/Makefile b/stubdom/vtpmmgr/Makefile
index a39a22c..c5e17c5 100644
--- a/stubdom/vtpmmgr/Makefile
+++ b/stubdom/vtpmmgr/Makefile
@@ -23,6 +23,11 @@ build: $(TARGET)
 $(TARGET): $(OBJS)
 	ar -rcs $@ $^
 
+install:
+	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)"
+	$(INSTALL_PROG) calc.pl "$(DESTDIR)$(LIBEXEC_BIN)"
+	$(INSTALL_PROG) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC_BIN)"
+
 clean:
 	rm -f $(TARGET) $(OBJS)
 
diff --git a/tools/vtpmmgr/calc.pl b/stubdom/vtpmmgr/calc.pl
similarity index 100%
rename from tools/vtpmmgr/calc.pl
rename to stubdom/vtpmmgr/calc.pl
diff --git a/tools/vtpmmgr/manage-vtpmmgr.pl b/stubdom/vtpmmgr/manage-vtpmmgr.pl
similarity index 100%
rename from tools/vtpmmgr/manage-vtpmmgr.pl
rename to stubdom/vtpmmgr/manage-vtpmmgr.pl
diff --git a/tools/Makefile b/tools/Makefile
index 452510a..543cd29 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -34,7 +34,6 @@ SUBDIRS-$(CONFIG_X86) += xenpaging
 SUBDIRS-$(CONFIG_X86) += debugger/gdbsx
 SUBDIRS-$(CONFIG_X86) += debugger/kdd
 SUBDIRS-$(CONFIG_TESTS) += tests
-SUBDIRS-$(CONFIG_VTPM) += vtpmmgr
 
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
diff --git a/tools/vtpmmgr/Makefile b/tools/vtpmmgr/Makefile
deleted file mode 100644
index b14c170..0000000
--- a/tools/vtpmmgr/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-XEN_ROOT=$(CURDIR)/../..
-include $(XEN_ROOT)/tools/Rules.mk
-
-all:
-	@true
-
-install:
-	$(INSTALL_DIR) "$(DESTDIR)$(LIBEXEC_BIN)"
-	$(INSTALL_DATA) calc.pl "$(DESTDIR)$(LIBEXEC_BIN)"
-	$(INSTALL_DATA) manage-vtpmmgr.pl "$(DESTDIR)$(LIBEXEC_BIN)"
-
-clean:
-	@true
-
-.PHONY: all install clean

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (26 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-02  7:26   ` Jan Beulich
                     ` (2 more replies)
  2014-10-06 14:05 ` [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Konrad Rzeszutek Wilk
  2014-10-06 16:32 ` Ian Campbell
  29 siblings, 3 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-01 16:41 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Keir Fraser, David Scott, Tim Deegan,
	Stefano Stabellini, Ian Jackson, Jan Beulich, Samuel Thibault,
	Ian Campbell

With this change debug and debug_symbols is used consistently.
With 'make debug=yn debug_symbols=yn' my rebuild time and diskspace
usage goes down:
   105275K clean xen.git checkout.
y 1247041K build time: 5:57
n  812112K build time: 5:34

No change in behaviour is expected by that patch for tools and xen.
For stubdom CFLAGS change from -O1 to O2 with debug=n.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Scott <dave.scott@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 stubdom/Makefile        | 3 +--
 tools/Makefile          | 7 +++++++
 tools/ocaml/common.make | 5 ++++-
 xen/Rules.mk            | 3 ++-
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9dac103..60dc0b8 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -4,9 +4,8 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os
 export XEN_OS=MiniOS
 
 export stubdom=y
-export debug=y
-include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Stubdom.mk
+include $(XEN_ROOT)/Config.mk
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
 ifeq ($(XEN_TARGET_ARCH),x86_32)
diff --git a/tools/Makefile b/tools/Makefile
index 543cd29..884dc91 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -197,6 +197,12 @@ else
 QEMU_XEN_ENABLE_DEBUG :=
 endif
 
+ifeq ($(debug_symbols),y)
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip
+else
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info
+endif
+
 subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	if test -d $(QEMU_UPSTREAM_LOC) ; then \
 		source=$(QEMU_UPSTREAM_LOC); \
@@ -206,6 +212,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
+		$(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \
 		--prefix=$(LIBEXEC) \
 		--libdir=$(LIBEXEC_LIB) \
 		--includedir=$(LIBEXEC_INC) \
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index d5478f6..33b3142 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
 OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
-OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
+ifeq ($(debug_symbols),y)
+OCAMLCFLAGS += -g
+endif
+OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F
 
 VERSION := 4.1
 
diff --git a/xen/Rules.mk b/xen/Rules.mk
index a97405c..2d414ab 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -43,7 +43,8 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
 CFLAGS += -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+CFLAGS-$(debug_symbols) += -g
+CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += -nostdinc
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH 27/28] move vtpmmgr helpers from tools to stubdom
  2014-10-01 16:41 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
@ 2014-10-01 21:51   ` Daniel De Graaf
  0 siblings, 0 replies; 63+ messages in thread
From: Daniel De Graaf @ 2014-10-01 21:51 UTC (permalink / raw)
  To: Olaf Hering, xen-devel
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson, Samuel Thibault

On 10/01/2014 12:41 PM, Olaf Hering wrote:
> Tools.mk contains a dead CONFIG_VTPM, @vtpm@ is never expanded because
> @vtpm@ is only known by stubdom/configure.ac. Move the two perl scripts
> to stubdom/vtpmmgr and install them as executeable. This was introduced
> by the recent commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
> add example control tools")
> Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently)
> not used by make itself.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Looks good to me.

Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-01 16:41 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
@ 2014-10-02  7:26   ` Jan Beulich
  2014-10-02  8:00     ` Olaf Hering
  2014-10-02 14:15   ` Ian Campbell
  2014-10-06  8:55   ` [PATCH v2] " Olaf Hering
  2 siblings, 1 reply; 63+ messages in thread
From: Jan Beulich @ 2014-10-02  7:26 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Tim Deegan, Wei Liu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

>>> On 01.10.14 at 18:41, <olaf@aepfle.de> wrote:
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -43,7 +43,8 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
>  
>  CFLAGS += -fno-builtin -fno-common
>  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
> -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> +CFLAGS-$(debug_symbols) += -g
> +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
>  CFLAGS += -nostdinc
>  
>  CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE

I'm fine with this change, but will make my ack depend on Andrew at
least not objecting (iirc he had reservations on a previous iteration).

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-02  7:26   ` Jan Beulich
@ 2014-10-02  8:00     ` Olaf Hering
  2014-10-02  8:06       ` Jan Beulich
  0 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-10-02  8:00 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Tim Deegan, Wei Liu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

On Thu, Oct 02, Jan Beulich wrote:

> >>> On 01.10.14 at 18:41, <olaf@aepfle.de> wrote:
> > --- a/xen/Rules.mk
> > +++ b/xen/Rules.mk
> > @@ -43,7 +43,8 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
> >  
> >  CFLAGS += -fno-builtin -fno-common
> >  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
> > -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> > +CFLAGS-$(debug_symbols) += -g
> > +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> >  CFLAGS += -nostdinc
> >  
> >  CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
> 
> I'm fine with this change, but will make my ack depend on Andrew at
> least not objecting (iirc he had reservations on a previous iteration).

Does that still stand? Quote:

...
> I am not sure this is correct.  Xen needs to embed its full symbol
> table for backtraces, so does need to be built unconditionally with -g

What does -g have to do with backtrace generation? If you're
after .debug_frame, that can be had as .eh_frame without -g (and
with -fasynchronous-unwind-tables passed instead). Yet whether
everyone wants this is not at all clear, so providing a knob to turn  
it on/off seems quite desirable to me.

Jan
...


The point of the change is that building with -g has most likely not
much benefit for most users. Please clearify if -g is really a hard
requirement to build the hypervisor.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-02  8:00     ` Olaf Hering
@ 2014-10-02  8:06       ` Jan Beulich
  2014-10-02  9:52         ` Tim Deegan
  2014-10-02 10:45         ` Olaf Hering
  0 siblings, 2 replies; 63+ messages in thread
From: Jan Beulich @ 2014-10-02  8:06 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Tim Deegan, Wei Liu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

>>> On 02.10.14 at 10:00, <olaf@aepfle.de> wrote:
> On Thu, Oct 02, Jan Beulich wrote:
> 
>> >>> On 01.10.14 at 18:41, <olaf@aepfle.de> wrote:
>> > --- a/xen/Rules.mk
>> > +++ b/xen/Rules.mk
>> > @@ -43,7 +43,8 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
>> >  
>> >  CFLAGS += -fno-builtin -fno-common
>> >  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
>> > -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
>> > +CFLAGS-$(debug_symbols) += -g
>> > +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
>> >  CFLAGS += -nostdinc
>> >  
>> >  CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
>> 
>> I'm fine with this change, but will make my ack depend on Andrew at
>> least not objecting (iirc he had reservations on a previous iteration).
> 
> Does that still stand? Quote:

Is that a question to me or to him?

> ...
>> I am not sure this is correct.  Xen needs to embed its full symbol
>> table for backtraces, so does need to be built unconditionally with -g
> 
> What does -g have to do with backtrace generation? If you're
> after .debug_frame, that can be had as .eh_frame without -g (and
> with -fasynchronous-unwind-tables passed instead). Yet whether
> everyone wants this is not at all clear, so providing a knob to turn  
> it on/off seems quite desirable to me.

My position didn't change, but I'm also not going to ignore his
comment. Hence my desire for him to clarify whether he objects
to the change (in which case I'd expect him to offer alternatives
aiming in this...

> The point of the change is that building with -g has most likely not
> much benefit for most users. Please clearify if -g is really a hard
> requirement to build the hypervisor.

... direction).

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-02  8:06       ` Jan Beulich
@ 2014-10-02  9:52         ` Tim Deegan
  2014-10-02 10:27           ` Jan Beulich
  2014-10-02 10:45         ` Olaf Hering
  1 sibling, 1 reply; 63+ messages in thread
From: Tim Deegan @ 2014-10-02  9:52 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Olaf Hering, Wei Liu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

At 09:06 +0100 on 02 Oct (1412237217), Jan Beulich wrote:
> >>> On 02.10.14 at 10:00, <olaf@aepfle.de> wrote:
> > On Thu, Oct 02, Jan Beulich wrote:
> > 
> >> >>> On 01.10.14 at 18:41, <olaf@aepfle.de> wrote:
> >> > --- a/xen/Rules.mk
> >> > +++ b/xen/Rules.mk
> >> > @@ -43,7 +43,8 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
> >> >  
> >> >  CFLAGS += -fno-builtin -fno-common
> >> >  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
> >> > -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> >> > +CFLAGS-$(debug_symbols) += -g
> >> > +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> >> >  CFLAGS += -nostdinc
> >> >  
> >> >  CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
> >> 
> >> I'm fine with this change, but will make my ack depend on Andrew at
> >> least not objecting (iirc he had reservations on a previous iteration).
> > 
> > Does that still stand? Quote:
> 
> Is that a question to me or to him?
> 
> > ...
> >> I am not sure this is correct.  Xen needs to embed its full symbol
> >> table for backtraces, so does need to be built unconditionally with -g
> > 
> > What does -g have to do with backtrace generation? If you're
> > after .debug_frame, that can be had as .eh_frame without -g (and
> > with -fasynchronous-unwind-tables passed instead). Yet whether
> > everyone wants this is not at all clear, so providing a knob to turn  
> > it on/off seems quite desirable to me.

I think Andrew is talking about the symbol table rather than the debug
info - xen's backtrace walker doesn't speak DWARF.  AFAICT the symbol
tables generated without '-g' are just fine for xen's own use printing
backtraces &c, though possibly post-mortem tools for crash analysis
might need more?

Tim.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-02  9:52         ` Tim Deegan
@ 2014-10-02 10:27           ` Jan Beulich
  2014-10-02 16:52             ` Andrew Cooper
  0 siblings, 1 reply; 63+ messages in thread
From: Jan Beulich @ 2014-10-02 10:27 UTC (permalink / raw)
  To: Tim Deegan
  Cc: Olaf Hering, Wei Liu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

>>> On 02.10.14 at 11:52, <tim@xen.org> wrote:
> I think Andrew is talking about the symbol table rather than the debug
> info - xen's backtrace walker doesn't speak DWARF.  AFAICT the symbol
> tables generated without '-g' are just fine for xen's own use printing
> backtraces &c,

Right.

> though possibly post-mortem tools for crash analysis
> might need more?

Perhaps. In which case people interested in this can enable
debug info generation (and iirc Olaf's patch also doesn't change
any defaults here).

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-02  8:06       ` Jan Beulich
  2014-10-02  9:52         ` Tim Deegan
@ 2014-10-02 10:45         ` Olaf Hering
  1 sibling, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-02 10:45 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Tim Deegan, Wei Liu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

On Thu, Oct 02, Jan Beulich wrote:

> >>> On 02.10.14 at 10:00, <olaf@aepfle.de> wrote:
> > Does that still stand? Quote:
> Is that a question to me or to him?

For both of you.
My guess is that -g is not required for normal operation, backtraces
will continue to work. Perhaps Andrew had something else in mind?

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 01/28] tools: fix make uninstall
  2014-10-01 16:41 ` [PATCH 01/28] tools: fix make uninstall Olaf Hering
@ 2014-10-02 14:11   ` Ian Campbell
  0 siblings, 0 replies; 63+ messages in thread
From: Ian Campbell @ 2014-10-02 14:11 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Ian Jackson, Stefano Stabellini, xen-devel

On Wed, 2014-10-01 at 18:41 +0200, Olaf Hering wrote:
> The uninstall target does not know about the paths it removes because
> the toplevel Makefile does not include the required files.
> 
> Move the commands to tools/Makefile because all files come from subdirs
> in tools/ anyway. Drop the removal of $(XEN_RUN_DIR) because it gets
> created at runtime. Drop the removal of systemd related files because
> the wildcard matches everything.
> 
> The proper fix is to remove the files and directories in the Makefiles
> which install them. But this version is the least intrusive change at
> this point.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-01 16:41 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
  2014-10-02  7:26   ` Jan Beulich
@ 2014-10-02 14:15   ` Ian Campbell
  2014-10-06  8:55   ` [PATCH v2] " Olaf Hering
  2 siblings, 0 replies; 63+ messages in thread
From: Ian Campbell @ 2014-10-02 14:15 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Keir Fraser, David Scott, Tim Deegan,
	Stefano Stabellini, Ian Jackson, xen-devel, Jan Beulich,
	Samuel Thibault

On Wed, 2014-10-01 at 18:41 +0200, Olaf Hering wrote:
> With this change debug and debug_symbols is used consistently.
> With 'make debug=yn debug_symbols=yn'

What does this "yn" syntax do?

It's not clear to me what "this change" actually is, perhaps I'm just
lacking the context, but could you explain in the commit message what it
is you are actually changing. (You could assume I'd never heard of
debug_symbols before today, because I hadn't...)

>  my rebuild time and diskspace
> usage goes down:
>    105275K clean xen.git checkout.
> y 1247041K build time: 5:57
> n  812112K build time: 5:34
> 
> No change in behaviour is expected by that patch for tools and xen.
> For stubdom CFLAGS change from -O1 to O2 with debug=n.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: David Scott <dave.scott@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
>  stubdom/Makefile        | 3 +--
>  tools/Makefile          | 7 +++++++
>  tools/ocaml/common.make | 5 ++++-
>  xen/Rules.mk            | 3 ++-
>  4 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index 9dac103..60dc0b8 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -4,9 +4,8 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os
>  export XEN_OS=MiniOS
>  
>  export stubdom=y
> -export debug=y
> -include $(XEN_ROOT)/Config.mk
>  -include $(XEN_ROOT)/config/Stubdom.mk
> +include $(XEN_ROOT)/Config.mk
>  
>  GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
>  ifeq ($(XEN_TARGET_ARCH),x86_32)
> diff --git a/tools/Makefile b/tools/Makefile
> index 543cd29..884dc91 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -197,6 +197,12 @@ else
>  QEMU_XEN_ENABLE_DEBUG :=
>  endif
>  
> +ifeq ($(debug_symbols),y)
> +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip
> +else
> +QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info
> +endif
> +
>  subdir-all-qemu-xen-dir: qemu-xen-dir-find
>  	if test -d $(QEMU_UPSTREAM_LOC) ; then \
>  		source=$(QEMU_UPSTREAM_LOC); \
> @@ -206,6 +212,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
>  	cd qemu-xen-dir; \
>  	$$source/configure --enable-xen --target-list=i386-softmmu \
>  		$(QEMU_XEN_ENABLE_DEBUG) \
> +		$(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \
>  		--prefix=$(LIBEXEC) \
>  		--libdir=$(LIBEXEC_LIB) \
>  		--includedir=$(LIBEXEC_INC) \
> diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
> index d5478f6..33b3142 100644
> --- a/tools/ocaml/common.make
> +++ b/tools/ocaml/common.make
> @@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
>  
>  OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
>  OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
> -OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
> +ifeq ($(debug_symbols),y)
> +OCAMLCFLAGS += -g
> +endif
> +OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F
>  
>  VERSION := 4.1
>  
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index a97405c..2d414ab 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -43,7 +43,8 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
>  
>  CFLAGS += -fno-builtin -fno-common
>  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
> -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> +CFLAGS-$(debug_symbols) += -g
> +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
>  CFLAGS += -nostdinc
>  
>  CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-02 10:27           ` Jan Beulich
@ 2014-10-02 16:52             ` Andrew Cooper
  2014-10-06  7:31               ` Jan Beulich
  0 siblings, 1 reply; 63+ messages in thread
From: Andrew Cooper @ 2014-10-02 16:52 UTC (permalink / raw)
  To: Jan Beulich, Tim Deegan
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

On 02/10/14 11:27, Jan Beulich wrote:
>>>> On 02.10.14 at 11:52, <tim@xen.org> wrote:
>> I think Andrew is talking about the symbol table rather than the debug
>> info - xen's backtrace walker doesn't speak DWARF.  AFAICT the symbol
>> tables generated without '-g' are just fine for xen's own use printing
>> backtraces &c,
> Right.
>
>> though possibly post-mortem tools for crash analysis
>> might need more?
> Perhaps. In which case people interested in this can enable
> debug info generation (and iirc Olaf's patch also doesn't change
> any defaults here).
>
> Jan
>

After some investigation of my own, I have confirmed that neither
System.map nor xen.gz are altered.

I do find it somewhat silly to generate a xen-syms without debugging
symbols, but as that doesn't affect the eventual xen.gz, I am less
worried about it.

However, you may have noticed that there are actually two -g's on the
Xen build command line, the first of which is directly inherited
directly from the root Config.mk.

Therefore, I think you can just unilaterally drop the -g from xen/Rules.mk

~Andrew

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-02 16:52             ` Andrew Cooper
@ 2014-10-06  7:31               ` Jan Beulich
  2014-10-06  7:40                 ` Olaf Hering
  0 siblings, 1 reply; 63+ messages in thread
From: Jan Beulich @ 2014-10-06  7:31 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Tim Deegan, WeiLiu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

>>> On 02.10.14 at 18:52, <andrew.cooper3@citrix.com> wrote:
> On 02/10/14 11:27, Jan Beulich wrote:
>>>>> On 02.10.14 at 11:52, <tim@xen.org> wrote:
>>> I think Andrew is talking about the symbol table rather than the debug
>>> info - xen's backtrace walker doesn't speak DWARF.  AFAICT the symbol
>>> tables generated without '-g' are just fine for xen's own use printing
>>> backtraces &c,
>> Right.
>>
>>> though possibly post-mortem tools for crash analysis
>>> might need more?
>> Perhaps. In which case people interested in this can enable
>> debug info generation (and iirc Olaf's patch also doesn't change
>> any defaults here).
> 
> After some investigation of my own, I have confirmed that neither
> System.map nor xen.gz are altered.
> 
> I do find it somewhat silly to generate a xen-syms without debugging
> symbols, but as that doesn't affect the eventual xen.gz, I am less
> worried about it.
> 
> However, you may have noticed that there are actually two -g's on the
> Xen build command line, the first of which is directly inherited
> directly from the root Config.mk.
> 
> Therefore, I think you can just unilaterally drop the -g from xen/Rules.mk

Indeed. Olaf, can you take adjust the patch accordingly please?

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-10-06  7:31               ` Jan Beulich
@ 2014-10-06  7:40                 ` Olaf Hering
  0 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-06  7:40 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Tim Deegan, WeiLiu, David Scott, Stefano Stabellini,
	Andrew Cooper, Ian Jackson, xen-devel, Samuel Thibault,
	Keir Fraser, Ian Campbell

On Mon, Oct 06, Jan Beulich wrote:

> >>> On 02.10.14 at 18:52, <andrew.cooper3@citrix.com> wrote:
> > Therefore, I think you can just unilaterally drop the -g from xen/Rules.mk
> Indeed. Olaf, can you take adjust the patch accordingly please?

I did not get around to redo the patch with that change and the updated
description. Will do that today.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH v2] Separate runtime debug output from debug symbols
  2014-10-01 16:41 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
  2014-10-02  7:26   ` Jan Beulich
  2014-10-02 14:15   ` Ian Campbell
@ 2014-10-06  8:55   ` Olaf Hering
  2014-10-06  9:03     ` Jan Beulich
  2 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-10-06  8:55 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Keir Fraser, David Scott, Tim Deegan,
	Stefano Stabellini, Ian Jackson, Jan Beulich, Samuel Thibault,
	Ian Campbell

Two make variables exist (debug=y and debug_symbols=y) to control either
the creation of additional runtime debug or the creation of debug
symbols for tools like gdb.  Some places in the code still passed -g
unconditionally to the compiler. Wrap them into a "debug_symbols"
conditional. The xen build passed -g unconditional, reuse the existing
debug_symbols=y check in Config.mk. There are still parts of the code
that hardcode -g, namely the external qemu-traditional and stubdom
packages. They are not changed by this patch.

No change in behaviour is expected by that patch for tools and xen.
For stubdom CFLAGS change from -O1 to O2 with debug=n.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Scott <dave.scott@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 stubdom/Makefile        | 3 +--
 tools/Makefile          | 7 +++++++
 tools/ocaml/common.make | 5 ++++-
 xen/Rules.mk            | 2 +-
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9dac103..60dc0b8 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -4,9 +4,8 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os
 export XEN_OS=MiniOS
 
 export stubdom=y
-export debug=y
-include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Stubdom.mk
+include $(XEN_ROOT)/Config.mk
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
 ifeq ($(XEN_TARGET_ARCH),x86_32)
diff --git a/tools/Makefile b/tools/Makefile
index 543cd29..884dc91 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -197,6 +197,12 @@ else
 QEMU_XEN_ENABLE_DEBUG :=
 endif
 
+ifeq ($(debug_symbols),y)
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip
+else
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info
+endif
+
 subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	if test -d $(QEMU_UPSTREAM_LOC) ; then \
 		source=$(QEMU_UPSTREAM_LOC); \
@@ -206,6 +212,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
+		$(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \
 		--prefix=$(LIBEXEC) \
 		--libdir=$(LIBEXEC_LIB) \
 		--includedir=$(LIBEXEC_INC) \
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index d5478f6..33b3142 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
 OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
-OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
+ifeq ($(debug_symbols),y)
+OCAMLCFLAGS += -g
+endif
+OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F
 
 VERSION := 4.1
 
diff --git a/xen/Rules.mk b/xen/Rules.mk
index a97405c..60cd173 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -43,7 +43,7 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
 CFLAGS += -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += -nostdinc
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH v2] Separate runtime debug output from debug symbols
  2014-10-06  8:55   ` [PATCH v2] " Olaf Hering
@ 2014-10-06  9:03     ` Jan Beulich
  2014-10-08 12:45       ` Ian Campbell
  0 siblings, 1 reply; 63+ messages in thread
From: Jan Beulich @ 2014-10-06  9:03 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

>>> On 06.10.14 at 10:55, <olaf@aepfle.de> wrote:
> Two make variables exist (debug=y and debug_symbols=y) to control either
> the creation of additional runtime debug or the creation of debug
> symbols for tools like gdb.  Some places in the code still passed -g
> unconditionally to the compiler. Wrap them into a "debug_symbols"
> conditional. The xen build passed -g unconditional, reuse the existing
> debug_symbols=y check in Config.mk. There are still parts of the code
> that hardcode -g, namely the external qemu-traditional and stubdom
> packages. They are not changed by this patch.
> 
> No change in behaviour is expected by that patch for tools and xen.
> For stubdom CFLAGS change from -O1 to O2 with debug=n.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>[...]
>  xen/Rules.mk            | 2 +-

For just this small part of the patch:
Acked-by: Jan Beulich <jbeulich@suse.com>

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 02/28] tools/hotplug: fix race during xen.conf creation
  2014-10-01 16:41 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
@ 2014-10-06 13:48   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 63+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-10-06 13:48 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Stefano Stabellini, Ian Jackson, Ian Campbell, xen-devel

On Wed, Oct 01, 2014 at 06:41:04PM +0200, Olaf Hering wrote:
> A make -j8 will call the xen.conf rule twice. The move-if-changed
> macro may fail of the tmp file was already removed by the other make

s/of/if/
> process. Fix this by let the all target depend on install.
> Also remove the generated file with make clean.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
>  tools/hotplug/Linux/systemd/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
> index dc98b67..90ba16e 100644
> --- a/tools/hotplug/Linux/systemd/Makefile
> +++ b/tools/hotplug/Linux/systemd/Makefile
> @@ -21,10 +21,11 @@ ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
>  			$(XEN_SYSTEMD_SERVICE)
>  
>  .PHONY: all
> -all:	$(ALL_XEN_SYSTEMD)
> +all:	install
>  
>  .PHONY: clean
>  clean:
> +	rm -f $(ALL_XEN_SYSTEMD)
>  
>  .PHONY: install
>  install: $(ALL_XEN_SYSTEMD)

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (27 preceding siblings ...)
  2014-10-01 16:41 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
@ 2014-10-06 14:05 ` Konrad Rzeszutek Wilk
  2014-10-06 16:32 ` Ian Campbell
  29 siblings, 0 replies; 63+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-10-06 14:05 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel

On Wed, Oct 01, 2014 at 06:41:02PM +0200, Olaf Hering wrote:
> Konrad, you are in CC because I would like to see this in 4.5-rc1.

Thank you.
> 
> 
> In my attempt to get a xen.rpm from 'make rpmball' which operates
> entirely below the configured --prefix= I came up with these changes.

Released-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Regression wise it will be quite easy to figure out if something is broken -
it hasn't been built. Hence the error reporting of that should be fairly easy.

The benefit of this change is that it does an good cleanup of
Makefile/configure.ac and in the long term that should make it better
and easier to compile Xen on other platforms.

> 
> This is a resend of the remaining parts of this series with the
> comments incorporated:
> http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03003.html
> http://lists.xenproject.org/archives/html/xen-devel/2014-09/msg03981.html
> 
> In v5 of this series the --libexec patch was updated to also remove
> PRIVATE_PREFIX and PRIVATE_BINDIR from paths.m4, and it does not remove
> $(LIBDIR)/xen/ anymore - just $(LIBEXEC). The patch to "separate runtime
> debug info" is the simplified version.
> 
> 
> With this series its now possible to run everything except pygrub
> below the configured --prefix=.

Yeey!
> 
> NOTE: the renaming of tools/hotplug/Linux/init.d/xencommons.in may
> cause trouble in configured working copies. Use 'git clean -dfx' to
> wipe all and everything before git pull.
> 
> One outstanding bug is pygrub, which does not know about
> $prefix/$lib/python/site-packages. This is still on my todo list.
> 
> Please rerun autogen.sh after applying this series.
> 
> Olaf
> 
> 
> 
> Olaf Hering (28):
>   tools: fix make uninstall
>   tools/hotplug: fix race during xen.conf creation
>   tools/python: use also LDFLAGS for build
>   Add configure --with-initddir=DIR
>   tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
>   tools/configure.ac: sort AC_CONFIG_FILES
>   tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
>   tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
>   remove duplicate variables from config
>   Substitue configure variables in Paths.mk.in
>   tools: substitute bindir instead of BINDIR
>   Use configure --mandir=DIR to set MANDIR
>   Use configure --docdir=DIR to set DOCDIR
>   Use configure --includedir=DIR to set INCLUDEDIR
>   Use configure --libexecdir=BASEDIR to set LIBEXEC
>   Use configure --prefix=DIR to set PREFIX
>   Use configure --localstatedir=BASEDIR to set path to /var
>   Add configure --enable-rpath
>   Add configure --with-linux-backend-modules="mod1 mod2"
>   Move variable to set bash_completion.d to Paths.mk
>   Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR
>   Make XENFIRMWAREDIR a subdir of libexecdir
>   tools: remove private copies of includedir and libdir from libxenstat
>   Use Paths.mk for docs, stubdom and tools build
>   tools: use XEN_LIB_STORED instead of /var/lib/xenstored
>   tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen
>   move vtpmmgr helpers from tools to stubdom
>   Separate runtime debug output from debug symbols
> 
>  .gitignore                                         |   7 ++
>  Config.mk                                          |  14 +--
>  Makefile                                           |  12 ---
>  README                                             |  12 ---
>  config/Docs.mk.in                                  |   7 +-
>  config/Linux.mk                                    |   2 +
>  config/Linux.modules                               |  20 ----
>  config/NetBSD.mk                                   |   5 -
>  config/NetBSDRump.mk                               |   2 -
>  config/Paths.mk.in                                 |  44 +++++++--
>  config/StdGNU.mk                                   |  23 -----
>  config/Stubdom.mk.in                               |   7 --
>  config/SunOS.mk                                    |  15 ---
>  config/Tools.mk.in                                 |  13 +--
>  docs/misc/distro_mapping.txt                       |   5 +-
>  m4/paths.m4                                        | 101 ++++++++++++++-------
>  m4/xenstored.m4                                    |   8 +-
>  stubdom/Makefile                                   |   9 +-
>  stubdom/vtpmmgr/Makefile                           |   5 +
>  {tools => stubdom}/vtpmmgr/calc.pl                 |   0
>  {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl       |   0
>  tools/Makefile                                     |  46 ++++++++--
>  tools/Rules.mk                                     |   1 -
>  tools/configure.ac                                 |  53 +++++++++--
>  tools/console/Makefile                             |   4 +-
>  tools/hotplug/FreeBSD/Makefile                     |   5 +-
>  .../FreeBSD/rc.d/{xencommons => xencommons.in}     |   6 +-
>  tools/hotplug/FreeBSD/vif-bridge                   |   2 +-
>  tools/hotplug/Linux/Makefile                       |  18 ++--
>  tools/hotplug/Linux/init.d/sysconfig.xencommons.in |  10 +-
>  .../Linux/init.d/{xen-watchdog => xen-watchdog.in} |   2 +-
>  .../init.d/{xencommons.in.in => xencommons.in}     |  13 ++-
>  .../Linux/init.d/{xendomains => xendomains.in}     |  14 +--
>  tools/hotplug/Linux/systemd/Makefile               |  37 ++------
>  .../systemd/xen-qemu-dom0-disk-backend.service.in  |   4 +-
>  .../hotplug/Linux/systemd/xen-watchdog.service.in  |   2 +-
>  tools/hotplug/Linux/systemd/xenconsoled.service.in |   2 +-
>  tools/hotplug/Linux/systemd/xendomains.service.in  |   6 +-
>  tools/hotplug/Linux/systemd/xenstored.service.in   |   4 +-
>  tools/hotplug/Linux/update-modules.sh              |  36 --------
>  tools/hotplug/Linux/{vif-setup => vif-setup.in}    |   2 +-
>  .../{xen-backend.rules => xen-backend.rules.in}    |  16 ++--
>  ...-hotplug-common.sh => xen-hotplug-common.sh.in} |   4 +-
>  tools/hotplug/Linux/{xendomains => xendomains.in}  |   2 +-
>  tools/hotplug/NetBSD/Makefile                      |   6 +-
>  tools/hotplug/NetBSD/block                         |   2 +-
>  .../NetBSD/rc.d/{xencommons => xencommons.in}      |   4 +-
>  tools/hotplug/NetBSD/vif-bridge                    |   2 +-
>  tools/hotplug/NetBSD/vif-ip                        |   2 +-
>  tools/libxl/Makefile                               |   6 +-
>  tools/libxl/libxl_dm.c                             |   4 +-
>  tools/libxl/libxl_internal.h                       |   1 -
>  tools/libxl/libxl_paths.c                          |   7 +-
>  tools/libxl/libxl_save_callout.c                   |   2 +-
>  tools/misc/Makefile                                |   4 +-
>  tools/ocaml/common.make                            |   5 +-
>  tools/pygrub/Makefile                              |   8 +-
>  tools/python/Makefile                              |   4 +-
>  tools/vtpmmgr/Makefile                             |  15 ---
>  tools/xcutils/Makefile                             |   4 +-
>  tools/xenpaging/Makefile                           |   4 +-
>  tools/xenstat/libxenstat/Makefile                  |   4 -
>  tools/xenstore/Makefile                            |   3 +-
>  tools/xenstore/xs_lib.c                            |   2 +-
>  tools/xentrace/Makefile                            |   4 +-
>  xen/Rules.mk                                       |   3 +-
>  66 files changed, 322 insertions(+), 374 deletions(-)
>  delete mode 100644 config/Linux.modules
>  rename {tools => stubdom}/vtpmmgr/calc.pl (100%)
>  rename {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl (100%)
>  rename tools/hotplug/FreeBSD/rc.d/{xencommons => xencommons.in} (96%)
>  rename tools/hotplug/Linux/init.d/{xen-watchdog => xen-watchdog.in} (97%)
>  rename tools/hotplug/Linux/init.d/{xencommons.in.in => xencommons.in} (91%)
>  rename tools/hotplug/Linux/init.d/{xendomains => xendomains.in} (79%)
>  delete mode 100755 tools/hotplug/Linux/update-modules.sh
>  rename tools/hotplug/Linux/{vif-setup => vif-setup.in} (61%)
>  rename tools/hotplug/Linux/{xen-backend.rules => xen-backend.rules.in} (62%)
>  rename tools/hotplug/Linux/{xen-hotplug-common.sh => xen-hotplug-common.sh.in} (94%)
>  rename tools/hotplug/Linux/{xendomains => xendomains.in} (99%)
>  rename tools/hotplug/NetBSD/rc.d/{xencommons => xencommons.in} (97%)
>  delete mode 100644 tools/vtpmmgr/Makefile
> 

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-10-01 16:41 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
@ 2014-10-06 15:40   ` Ian Campbell
  2014-10-06 15:53     ` [PATCH] QEMU_TAG update FOR FOLDING INTO LIBEXEC PATCH Ian Jackson
  2014-10-07  6:52     ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
  0 siblings, 2 replies; 63+ messages in thread
From: Ian Campbell @ 2014-10-06 15:40 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, George Dunlap, Stefano Stabellini, Ian Jackson,
	xen-devel, Samuel Thibault

On Wed, 2014-10-01 at 18:41 +0200, Olaf Hering wrote:
> Most users of LIBEXEC are updated to use LIBEXEC_BIN because that is
> what they want.

This caused the qemu-dm binary to move from
dist/install/usr/local/lib/xen/bin/qemu-dm has become
dist/install/usr/local/lib/xen/qemu-dm, because you missed the hidden
reliance on LIBEXEC inside the qemu-trad tree.

I propose that Ian J reviews and applies the following and I will fold
the associated Config.mk change into this changeset.

I've done builds locally for both x86_32 and x86_64 and it has put
qemu-dm back where it belongs...

Ian.

>From 6e0f43aa9d7af043347abe2ddbdf0e1eb0dbff0c Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Mon, 6 Oct 2014 16:24:46 +0100
Subject: [PATCH] qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)

The meaning of LIBEXEC in the Xen build system has been made to
follow the more conventional meaning.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen-config.mak    |    2 +-
 xen-setup-stubdom |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen-config.mak b/xen-config.mak
index 77fef4f..280af0c 100644
--- a/xen-config.mak
+++ b/xen-config.mak
@@ -9,4 +9,4 @@ CONFIG_SOFTMMU=yes
 
 CFLAGS += -I$(QEMU_ROOT)/hw
 
-bindir = ${LIBEXEC}
+bindir = ${LIBEXEC_BIN}
diff --git a/xen-setup-stubdom b/xen-setup-stubdom
index 4f1b081..b523509 100755
--- a/xen-setup-stubdom
+++ b/xen-setup-stubdom
@@ -22,7 +22,7 @@ TARGET_CPPFLAGS += $TARGET_CPPFLAGS -DCONFIG_STUBDOM
-D__XEN_TOOLS__
 TARGET_CFLAGS= $TARGET_CFLAGS
 TARGET_LDFLAGS= $TARGET_LDFLAGS
 
-bindir = \${LIBEXEC}
+bindir = \${LIBEXEC_BIN}
 END
 mv -f $target/config.mak.new $target/config.mak
 #----------
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* [PATCH] QEMU_TAG update FOR FOLDING INTO LIBEXEC PATCH
  2014-10-06 15:40   ` Ian Campbell
@ 2014-10-06 15:53     ` Ian Jackson
  2014-10-07  6:52     ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
  1 sibling, 0 replies; 63+ messages in thread
From: Ian Jackson @ 2014-10-06 15:53 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.campbell, Ian Jackson

** do not apply on its own **

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Config.mk |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 2bb8dcc..e61b3ec 100644
--- a/Config.mk
+++ b/Config.mk
@@ -266,9 +266,9 @@ SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
 
-QEMU_TRADITIONAL_REVISION ?= 58fac0693d8ad591add917e939011fe069720b0c
-# Fri Aug 1 16:32:18 2014 +0100
-# qemu-xen-trad: -I tools/libxc/include and tools/xenstore/include
+QEMU_TRADITIONAL_REVISION ?= b0d42741f8e9a00854c3b3faca1da84bfc69bf22
+# Mon Oct 6 16:24:46 2014 +0100
+# qemu-xen-trad: Switch to $(LIBEXEC_BIN) from $(LIBEXEC)
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 63+ messages in thread

* Re: [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR
  2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (28 preceding siblings ...)
  2014-10-06 14:05 ` [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Konrad Rzeszutek Wilk
@ 2014-10-06 16:32 ` Ian Campbell
  29 siblings, 0 replies; 63+ messages in thread
From: Ian Campbell @ 2014-10-06 16:32 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel

On Wed, 2014-10-01 at 18:41 +0200, Olaf Hering wrote:

I've pushed everything but the final patch since that had discussion and
it looked like it needed Xen-side acks etc.

See other mails for what had to happen to your libexec patch. With those
changes I don't see any change of path with a default build

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-10-06 15:40   ` Ian Campbell
  2014-10-06 15:53     ` [PATCH] QEMU_TAG update FOR FOLDING INTO LIBEXEC PATCH Ian Jackson
@ 2014-10-07  6:52     ` Olaf Hering
  1 sibling, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-07  6:52 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Wei Liu, George Dunlap, Stefano Stabellini, Ian Jackson,
	xen-devel, Samuel Thibault

On Mon, Oct 06, Ian Campbell wrote:

> On Wed, 2014-10-01 at 18:41 +0200, Olaf Hering wrote:
> > Most users of LIBEXEC are updated to use LIBEXEC_BIN because that is
> > what they want.
> 
> This caused the qemu-dm binary to move from
> dist/install/usr/local/lib/xen/bin/qemu-dm has become
> dist/install/usr/local/lib/xen/qemu-dm, because you missed the hidden
> reliance on LIBEXEC inside the qemu-trad tree.

Hmm, git grep does not curse into subtrees. Perhaps the proper fix would
be to pass --bindir to qemu-trad? I will have a look.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH v2] Separate runtime debug output from debug symbols
  2014-10-06  9:03     ` Jan Beulich
@ 2014-10-08 12:45       ` Ian Campbell
  2014-10-08 12:55         ` Olaf Hering
  0 siblings, 1 reply; 63+ messages in thread
From: Ian Campbell @ 2014-10-08 12:45 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Olaf Hering, Wei Liu, David Scott, Stefano Stabellini,
	Tim Deegan, Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser

On Mon, 2014-10-06 at 10:03 +0100, Jan Beulich wrote:
> >>> On 06.10.14 at 10:55, <olaf@aepfle.de> wrote:
> > Two make variables exist (debug=y and debug_symbols=y) to control either
> > the creation of additional runtime debug or the creation of debug
> > symbols for tools like gdb.  Some places in the code still passed -g
> > unconditionally to the compiler. Wrap them into a "debug_symbols"
> > conditional. The xen build passed -g unconditional, reuse the existing
> > debug_symbols=y check in Config.mk. There are still parts of the code
> > that hardcode -g, namely the external qemu-traditional and stubdom
> > packages. They are not changed by this patch.
> > 
> > No change in behaviour is expected by that patch for tools and xen.
> > For stubdom CFLAGS change from -O1 to O2 with debug=n.
> > 
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> >[...]
> >  xen/Rules.mk            | 2 +-
> 
> For just this small part of the patch:
> Acked-by: Jan Beulich <jbeulich@suse.com>

Unfortunately this seems to cause:

        /usr/bin/wget -c -O zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz
        /zlib-1.2.3.tar.gz: Scheme missing.

I think the reordering in stubdom/Makefile has caused XEN_EXTFILES_URL
to not be defined at the correct point in time.

Ian.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH v2] Separate runtime debug output from debug symbols
  2014-10-08 12:45       ` Ian Campbell
@ 2014-10-08 12:55         ` Olaf Hering
  2014-10-08 13:18           ` Olaf Hering
  0 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-10-08 12:55 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Wei Liu, David Scott, Stefano Stabellini, Tim Deegan,
	Ian Jackson, Jan Beulich, xen-devel, Samuel Thibault,
	Keir Fraser

On Wed, Oct 08, Ian Campbell wrote:

> Unfortunately this seems to cause:
> 
>         /usr/bin/wget -c -O zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz
>         /zlib-1.2.3.tar.gz: Scheme missing.
> 
> I think the reordering in stubdom/Makefile has caused XEN_EXTFILES_URL
> to not be defined at the correct point in time.

My stubdom build used to work. I will have a look.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH v2] Separate runtime debug output from debug symbols
  2014-10-08 12:55         ` Olaf Hering
@ 2014-10-08 13:18           ` Olaf Hering
  0 siblings, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-10-08 13:18 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Wei Liu, David Scott, Stefano Stabellini, Tim Deegan,
	Ian Jackson, Jan Beulich, xen-devel, Samuel Thibault,
	Keir Fraser

On Wed, Oct 08, Olaf Hering wrote:

> On Wed, Oct 08, Ian Campbell wrote:
> 
> > Unfortunately this seems to cause:
> > 
> >         /usr/bin/wget -c -O zlib-1.2.3.tar.gz /zlib-1.2.3.tar.gz
> >         /zlib-1.2.3.tar.gz: Scheme missing.
> > 
> > I think the reordering in stubdom/Makefile has caused XEN_EXTFILES_URL
> > to not be defined at the correct point in time.
> 
> My stubdom build used to work. I will have a look.

It used to work, but I have it now disabled in my wrapper. So I did not
notice the breakage anymore. Leaving stubdom/Makefile unchanged will not
alter the meaning of this patch because in the end it is supposed to
handle just debug_symbols. The 'exports debug=y' needs more
investigation on my side.

I will resend an new version that does not touch stubdom/Makefile.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-26  9:22           ` Olaf Hering
@ 2014-09-26  9:37             ` Jan Beulich
  0 siblings, 0 replies; 63+ messages in thread
From: Jan Beulich @ 2014-09-26  9:37 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

>>> On 26.09.14 at 11:22, <olaf@aepfle.de> wrote:
> On Fri, Sep 26, Jan Beulich wrote:
> 
>> >>> On 26.09.14 at 10:54, <olaf@aepfle.de> wrote:
>> > But I wonder how all that is supposed to work anyway for tools and xen?
>> > If I do "configure --disable-debug --disable-debug-info && make rpmball"
>> > xen still is built with debug=y. And to change that I have to use 'make
>> > rpmball debug=n' which affects also tools build.
>> With the hypervisor part of the build intentionally not being
>> controlled by the configure mechanism, I don't see how this can
>> be properly separated using the same command line override
>> mechanism to control both kinds of build sub-components.
> 
> I think the bug is that everything uses debug=N.
> Perhaps that variable should be controlled by the subsystems?

Yes, I think so (except that I don't like underscores in variables
like this and would prefer dashes, but that's surely a personal
taste thing).

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-26  9:06         ` Jan Beulich
@ 2014-09-26  9:22           ` Olaf Hering
  2014-09-26  9:37             ` Jan Beulich
  0 siblings, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-09-26  9:22 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

On Fri, Sep 26, Jan Beulich wrote:

> >>> On 26.09.14 at 10:54, <olaf@aepfle.de> wrote:
> > But I wonder how all that is supposed to work anyway for tools and xen?
> > If I do "configure --disable-debug --disable-debug-info && make rpmball"
> > xen still is built with debug=y. And to change that I have to use 'make
> > rpmball debug=n' which affects also tools build.
> With the hypervisor part of the build intentionally not being
> controlled by the configure mechanism, I don't see how this can
> be properly separated using the same command line override
> mechanism to control both kinds of build sub-components.

I think the bug is that everything uses debug=N.
Perhaps that variable should be controlled by the subsystems?
Like 'make debug_$subsys=N rpmbuild' which sets debug=N before the
'include $(XEN_ROOT)/Config.mk'.  Then configure --enable-debug will set
debug_$subsys in config/$subsys.mk which in turn sets debug=.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-26  8:54       ` Olaf Hering
@ 2014-09-26  9:06         ` Jan Beulich
  2014-09-26  9:22           ` Olaf Hering
  0 siblings, 1 reply; 63+ messages in thread
From: Jan Beulich @ 2014-09-26  9:06 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

>>> On 26.09.14 at 10:54, <olaf@aepfle.de> wrote:
> On Fri, Sep 26, Olaf Hering wrote:
> 
>> So for xen builds the patch will not change much except that it
>> separates runtime debug from debug symbols. For the tools+stubdom side I
>> suggest to have to knobs: --enable-debug for runtime debug like it is
>> done today, and a new --enable-debug-info or --enable-debug_symbols
>> which controls just the "-g" flag.
> 
> But I wonder how all that is supposed to work anyway for tools and xen?
> If I do "configure --disable-debug --disable-debug-info && make rpmball"
> xen still is built with debug=y. And to change that I have to use 'make
> rpmball debug=n' which affects also tools build.

With the hypervisor part of the build intentionally not being
controlled by the configure mechanism, I don't see how this can
be properly separated using the same command line override
mechanism to control both kinds of build sub-components.

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-26  8:17     ` Olaf Hering
  2014-09-26  8:54       ` Olaf Hering
@ 2014-09-26  8:56       ` Jan Beulich
  1 sibling, 0 replies; 63+ messages in thread
From: Jan Beulich @ 2014-09-26  8:56 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

>>> On 26.09.14 at 10:17, <olaf@aepfle.de> wrote:
> On Thu, Sep 25, Jan Beulich wrote:
> 
>> I'm having mixed feelings with this: On one hand it's nice to control
>> this on the command line. Otoh, since you don't force a full rebuild
>> when the setting changes between (incremental) builds, I'm not
>> certain a proper binary will result (or the build even succeed). Yes,
>> that's already a problem for the hypervisor build without this patch
>> (and I think such settings should only be passed through .config,
>> which should never be changed after an initial build), but extending
>> this doesn't necessarily seem like the right route.
> 
> After spending some more time on this it looks my change regarding tools
> and stubdom can be done in a different way. Initially I was thinking
> that "var ?= val" will override "var := val", but its exactly the
> opposite.
> 
> So for xen builds the patch will not change much except that it
> separates runtime debug from debug symbols. For the tools+stubdom side I
> suggest to have to knobs: --enable-debug for runtime debug like it is
> done today, and a new --enable-debug-info or --enable-debug_symbols
> which controls just the "-g" flag.
> 
> Any objections to that approach?

Sounds reasonable.

> Regarding the rebuild if the compile environment changes: I'm in favour
> of that. Just recently I upgraded from SLE11 to SLE12 and I had to
> cleanup first before running make again. Maybe there is a way that
> everything depends on some header (or knob) which contains CFLAGS,
> LDFLAGS, the toolchain path and other build related things. If some of
> that changes, force a rebuild.

We could certain borrow some of Linux'es build machinery for this,
but iirc even they don't go as far as rebuilding when tool chain
component versions change (and unless there are bugs in the tool
chain I also don't think that's necessary).

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-26  8:17     ` Olaf Hering
@ 2014-09-26  8:54       ` Olaf Hering
  2014-09-26  9:06         ` Jan Beulich
  2014-09-26  8:56       ` Jan Beulich
  1 sibling, 1 reply; 63+ messages in thread
From: Olaf Hering @ 2014-09-26  8:54 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

On Fri, Sep 26, Olaf Hering wrote:

> So for xen builds the patch will not change much except that it
> separates runtime debug from debug symbols. For the tools+stubdom side I
> suggest to have to knobs: --enable-debug for runtime debug like it is
> done today, and a new --enable-debug-info or --enable-debug_symbols
> which controls just the "-g" flag.

But I wonder how all that is supposed to work anyway for tools and xen?
If I do "configure --disable-debug --disable-debug-info && make rpmball"
xen still is built with debug=y. And to change that I have to use 'make
rpmball debug=n' which affects also tools build.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-25 16:01   ` Jan Beulich
@ 2014-09-26  8:17     ` Olaf Hering
  2014-09-26  8:54       ` Olaf Hering
  2014-09-26  8:56       ` Jan Beulich
  0 siblings, 2 replies; 63+ messages in thread
From: Olaf Hering @ 2014-09-26  8:17 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

On Thu, Sep 25, Jan Beulich wrote:

> I'm having mixed feelings with this: On one hand it's nice to control
> this on the command line. Otoh, since you don't force a full rebuild
> when the setting changes between (incremental) builds, I'm not
> certain a proper binary will result (or the build even succeed). Yes,
> that's already a problem for the hypervisor build without this patch
> (and I think such settings should only be passed through .config,
> which should never be changed after an initial build), but extending
> this doesn't necessarily seem like the right route.

After spending some more time on this it looks my change regarding tools
and stubdom can be done in a different way. Initially I was thinking
that "var ?= val" will override "var := val", but its exactly the
opposite.

So for xen builds the patch will not change much except that it
separates runtime debug from debug symbols. For the tools+stubdom side I
suggest to have to knobs: --enable-debug for runtime debug like it is
done today, and a new --enable-debug-info or --enable-debug_symbols
which controls just the "-g" flag.

Any objections to that approach?


Regarding the rebuild if the compile environment changes: I'm in favour
of that. Just recently I upgraded from SLE11 to SLE12 and I had to
cleanup first before running make again. Maybe there is a way that
everything depends on some header (or knob) which contains CFLAGS,
LDFLAGS, the toolchain path and other build related things. If some of
that changes, force a rebuild.


Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-25 15:41   ` Andrew Cooper
  2014-09-25 15:57     ` Jan Beulich
@ 2014-09-26  6:07     ` Olaf Hering
  1 sibling, 0 replies; 63+ messages in thread
From: Olaf Hering @ 2014-09-26  6:07 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Keir Fraser, David Scott, Stefano Stabellini, Ian Jackson,
	Tim Deegan, xen-devel, Jan Beulich, Samuel Thibault, Wei Liu,
	Ian Campbell

On Thu, Sep 25, Andrew Cooper wrote:

> On 25/09/14 16:20, Olaf Hering wrote:
> > --- a/xen/Rules.mk
> > +++ b/xen/Rules.mk
> > @@ -43,7 +43,10 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
> >  
> >  CFLAGS += -fno-builtin -fno-common
> >  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
> > -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> > +ifeq ($(debug_symbols),y)
> > +CFLAGS += -g
> > +endif
> > +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> 
> I am not sure this is correct.  Xen needs to embed its full symbol table
> for backtraces, so does need to be built unconditionally with -g

Ok, please discard this patch. 

After thinking  about the approach some more I'm not sure if configure
for tools/stubdom and env vars for xen will work at the same time.
I will find out.

Olaf

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-25 15:20 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
  2014-09-25 15:41   ` Andrew Cooper
@ 2014-09-25 16:01   ` Jan Beulich
  2014-09-26  8:17     ` Olaf Hering
  1 sibling, 1 reply; 63+ messages in thread
From: Jan Beulich @ 2014-09-25 16:01 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault, Keir Fraser,
	David Scott

>>> On 25.09.14 at 17:20, <olaf@aepfle.de> wrote:
> With this change debug and debug_symbols is used consistently.
> With 'make debug=yn debug_symbols=yn' my rebuild time and diskspace
> usage goes down:
>    105275K clean xen.git checkout.
> y 1247041K build time: 5:57
> n  812112K build time: 5:34
> 
> Two variables exist to control runtime and compiletime debug info:
> debug= for tools,stubdom,docs selects either -O1 or -O2 builds, and
> passes the flag down to qemu-upstream to enable additional runtime
> debugging.
> debug= for xen enables some asserts and extra checks in the code.
> debug_symbols= is used in few places to pass -g to gcc. Other places
> still pass -g unconditionally to gcc.
> 
> Wrap all -g assigments to CFLAGS into debug_symbols==y.
> Pass --enable-debug-info --disable-strip to qemu-upstream build.
> 
> Remove the --enable-debug configure option. Its now controlled by
> calling make with debug=yn and/or debug_symbols=yn for xen, tools and
> stubdom builds.

I'm having mixed feelings with this: On one hand it's nice to control
this on the command line. Otoh, since you don't force a full rebuild
when the setting changes between (incremental) builds, I'm not
certain a proper binary will result (or the build even succeed). Yes,
that's already a problem for the hypervisor build without this patch
(and I think such settings should only be passed through .config,
which should never be changed after an initial build), but extending
this doesn't necessarily seem like the right route.

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-25 15:41   ` Andrew Cooper
@ 2014-09-25 15:57     ` Jan Beulich
  2014-09-26  6:07     ` Olaf Hering
  1 sibling, 0 replies; 63+ messages in thread
From: Jan Beulich @ 2014-09-25 15:57 UTC (permalink / raw)
  To: Olaf Hering, Andrew Cooper, xen-devel
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Tim Deegan,
	Ian Jackson, Samuel Thibault, Keir Fraser, David Scott

>>> On 25.09.14 at 17:41, <andrew.cooper3@citrix.com> wrote:
> On 25/09/14 16:20, Olaf Hering wrote:
>> --- a/xen/Rules.mk
>> +++ b/xen/Rules.mk
>> @@ -43,7 +43,10 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
>>  
>>  CFLAGS += -fno-builtin -fno-common
>>  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
>> -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
>> +ifeq ($(debug_symbols),y)
>> +CFLAGS += -g
>> +endif
>> +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> 
> I am not sure this is correct.  Xen needs to embed its full symbol table
> for backtraces, so does need to be built unconditionally with -g

What does -g have to do with backtrace generation? If you're
after .debug_frame, that can be had as .eh_frame without -g (and
with -fasynchronous-unwind-tables passed instead). Yet whether
everyone wants this is not at all clear, so providing a knob to turn
it on/off seems quite desirable to me.

Jan

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-25 15:20 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
@ 2014-09-25 15:41   ` Andrew Cooper
  2014-09-25 15:57     ` Jan Beulich
  2014-09-26  6:07     ` Olaf Hering
  2014-09-25 16:01   ` Jan Beulich
  1 sibling, 2 replies; 63+ messages in thread
From: Andrew Cooper @ 2014-09-25 15:41 UTC (permalink / raw)
  To: Olaf Hering, xen-devel
  Cc: Keir Fraser, David Scott, Stefano Stabellini, Tim Deegan,
	Ian Jackson, Jan Beulich, Samuel Thibault, Wei Liu, Ian Campbell

On 25/09/14 16:20, Olaf Hering wrote:
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -43,7 +43,10 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
>  
>  CFLAGS += -fno-builtin -fno-common
>  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
> -CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
> +ifeq ($(debug_symbols),y)
> +CFLAGS += -g
> +endif
> +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h

I am not sure this is correct.  Xen needs to embed its full symbol table
for backtraces, so does need to be built unconditionally with -g

~Andrew

^ permalink raw reply	[flat|nested] 63+ messages in thread

* [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-25 15:19 [PATCH 00/28 v4] " Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-25 15:41   ` Andrew Cooper
  2014-09-25 16:01   ` Jan Beulich
  0 siblings, 2 replies; 63+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Keir Fraser, David Scott,
	Stefano Stabellini, Tim Deegan, Ian Jackson, Jan Beulich,
	Samuel Thibault, Ian Campbell

With this change debug and debug_symbols is used consistently.
With 'make debug=yn debug_symbols=yn' my rebuild time and diskspace
usage goes down:
   105275K clean xen.git checkout.
y 1247041K build time: 5:57
n  812112K build time: 5:34

Two variables exist to control runtime and compiletime debug info:
debug= for tools,stubdom,docs selects either -O1 or -O2 builds, and
passes the flag down to qemu-upstream to enable additional runtime
debugging.
debug= for xen enables some asserts and extra checks in the code.
debug_symbols= is used in few places to pass -g to gcc. Other places
still pass -g unconditionally to gcc.

Wrap all -g assigments to CFLAGS into debug_symbols==y.
Pass --enable-debug-info --disable-strip to qemu-upstream build.

Remove the --enable-debug configure option. Its now controlled by
calling make with debug=yn and/or debug_symbols=yn for xen, tools and
stubdom builds.

No change in behaviour is expected by that patch for tools and xen.
For stubdom CFLAGS change from -O1 to O2 with debug=n.

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: David Scott <dave.scott@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 Config.mk                         | 5 ++++-
 config/Stubdom.mk.in              | 3 ---
 config/Tools.mk.in                | 3 ---
 stubdom/Makefile                  | 1 -
 stubdom/configure.ac              | 1 -
 tools/Makefile                    | 7 +++++++
 tools/configure.ac                | 1 -
 tools/ocaml/common.make           | 5 ++++-
 tools/tests/vhpet/Makefile        | 2 +-
 tools/tests/x86_emulator/Makefile | 4 ++--
 xen/Rules.mk                      | 5 ++++-
 xen/arch/x86/Makefile             | 2 +-
 12 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/Config.mk b/Config.mk
index dff71b3..7781dd5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -16,7 +16,7 @@ or       = $(if $(strip $(1)),$(1),$(if $(strip $(2)),$(2),$(if $(strip $(3)),$(
 
 -include $(XEN_ROOT)/.config
 
-# A debug build of Xen and tools?
+# A debug build of Xen?
 debug ?= y
 debug_symbols ?= $(debug)
 
@@ -39,6 +39,9 @@ SHELL     ?= /bin/sh
 HOSTCC      = gcc
 HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
 HOSTCFLAGS += -fno-strict-aliasing
+ifeq ($(debug_symbols),y)
+HOSTCFLAGS += -g
+endif
 
 DISTDIR     ?= $(XEN_ROOT)/dist
 DESTDIR     ?= /
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index 5990fc4..65c7b23 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -4,9 +4,6 @@
 CMAKE               := @CMAKE@
 FETCHER             := @FETCHER@
 
-# A debug build of stubdom? //FIXME: Someone make this do something
-debug               := @debug@
-
 STUBDOM_TARGETS     := @STUBDOM_TARGETS@
 STUBDOM_BUILD       := @STUBDOM_BUILD@
 STUBDOM_INSTALL     := @STUBDOM_INSTALL@
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 5239f4e..762d047 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -5,9 +5,6 @@ ifeq ($(CONFIG_RUMP),y)
 XEN_OS              := NetBSDRump
 endif
 
-# A debug build of tools?
-debug               := @debug@
-
 # Tools path
 BISON               := @BISON@
 FLEX                := @FLEX@
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9dac103..e3eb502 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -4,7 +4,6 @@ MINI_OS = $(XEN_ROOT)/extras/mini-os
 export XEN_OS=MiniOS
 
 export stubdom=y
-export debug=y
 include $(XEN_ROOT)/Config.mk
 -include $(XEN_ROOT)/config/Stubdom.mk
 
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 6468203..0caa3bf 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -45,7 +45,6 @@ AS_IF([test "x$ioemu$qemu_traditional" = "xyn"], [
     AC_MSG_ERROR(IOEMU stubdomain requires qemu-traditional)
 ])
 
-AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of stubdom])
 AX_ARG_DEFAULT_ENABLE([extfiles], [Use xen extfiles repository for libraries])
 
 AC_ARG_VAR([CMAKE], [Path to the cmake program])
diff --git a/tools/Makefile b/tools/Makefile
index 4afadfd..9ae1ab1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -189,6 +189,12 @@ else
 QEMU_XEN_ENABLE_DEBUG :=
 endif
 
+ifeq ($(debug_symbols),y)
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --enable-debug-info --disable-strip
+else
+QEMU_XEN_ENABLE_DEBUG_SYMBOLS := --disable-debug-info
+endif
+
 subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	if test -d $(QEMU_UPSTREAM_LOC) ; then \
 		source=$(QEMU_UPSTREAM_LOC); \
@@ -198,6 +204,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
+		$(QEMU_XEN_ENABLE_DEBUG_SYMBOLS) \
 		--prefix=$(LIBEXEC) \
 		--libdir=$(LIBEXEC_LIB) \
 		--includedir=$(LIBEXEC_INC) \
diff --git a/tools/configure.ac b/tools/configure.ac
index 4595976..1cdd7d0 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -88,7 +88,6 @@ AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])
 AX_ARG_DEFAULT_DISABLE([ovmf], [Enable OVMF])
 AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
-AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools])
 AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools])
 
 AC_ARG_WITH([linux-backend-modules],
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index d5478f6..33b3142 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -13,7 +13,10 @@ CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
 OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
-OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
+ifeq ($(debug_symbols),y)
+OCAMLCFLAGS += -g
+endif
+OCAMLCFLAGS += $(OCAMLINCLUDE) -w F -warn-error F
 
 VERSION := 4.1
 
diff --git a/tools/tests/vhpet/Makefile b/tools/tests/vhpet/Makefile
index 763409d..e4f5c14 100644
--- a/tools/tests/vhpet/Makefile
+++ b/tools/tests/vhpet/Makefile
@@ -20,7 +20,7 @@ run: $(TARGET)
 	./$(TARGET) 200 1 0 20 0x0103 > $(TARGET).200.1.0.20.0x0103.out
 
 $(TARGET): hpet.c main.c hpet.h emul.h Makefile
-	$(HOSTCC) -g -o $@ hpet.c main.c
+	$(HOSTCC) $(HOSTCFLAGS) -o $@ hpet.c main.c
 
 .PHONY: clean
 clean:
diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 73517b7..edfd832 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -43,7 +43,7 @@ x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h:
 HOSTCFLAGS += $(CFLAGS_xeninclude)
 
 x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h
-	$(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $<
+	$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
 
 test_x86_emulator.o: test_x86_emulator.c blowfish.h x86_emulate/x86_emulate.h
-	$(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $<
+	$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
diff --git a/xen/Rules.mk b/xen/Rules.mk
index e2f9e36..a8bbd8e 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -43,7 +43,10 @@ ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
 
 CFLAGS += -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
-CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
+ifeq ($(debug_symbols),y)
+CFLAGS += -g
+endif
+CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += -nostdinc
 
 CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index c1e244d..b994bfa 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -163,7 +163,7 @@ boot/mkelf32: boot/mkelf32.c
 	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
 
 efi/mkreloc: efi/mkreloc.c
-	$(HOSTCC) $(HOSTCFLAGS) -g -o $@ $<
+	$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
 
 .PHONY: clean
 clean::

^ permalink raw reply related	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2014-10-08 13:21 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 16:41 [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Olaf Hering
2014-10-01 16:41 ` [PATCH 01/28] tools: fix make uninstall Olaf Hering
2014-10-02 14:11   ` Ian Campbell
2014-10-01 16:41 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
2014-10-06 13:48   ` Konrad Rzeszutek Wilk
2014-10-01 16:41 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
2014-10-01 16:41 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
2014-10-01 16:41 ` [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
2014-10-01 16:41 ` [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
2014-10-01 16:41 ` [PATCH 07/28] tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
2014-10-01 16:41 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
2014-10-01 16:41 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
2014-10-01 16:41 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
2014-10-01 16:41 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
2014-10-01 16:41 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
2014-10-06 15:40   ` Ian Campbell
2014-10-06 15:53     ` [PATCH] QEMU_TAG update FOR FOLDING INTO LIBEXEC PATCH Ian Jackson
2014-10-07  6:52     ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
2014-10-01 16:41 ` [PATCH 16/28] Use configure --prefix=DIR to set PREFIX Olaf Hering
2014-10-01 16:41 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
2014-10-01 16:41 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
2014-10-01 16:41 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
2014-10-01 16:41 ` [PATCH 20/28] Move variable to set bash_completion.d to Paths.mk Olaf Hering
2014-10-01 16:41 ` [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Olaf Hering
2014-10-01 16:41 ` [PATCH 22/28] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
2014-10-01 16:41 ` [PATCH 23/28] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
2014-10-01 16:41 ` [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build Olaf Hering
2014-10-01 16:41 ` [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
2014-10-01 16:41 ` [PATCH 26/28] tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
2014-10-01 16:41 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
2014-10-01 21:51   ` Daniel De Graaf
2014-10-01 16:41 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
2014-10-02  7:26   ` Jan Beulich
2014-10-02  8:00     ` Olaf Hering
2014-10-02  8:06       ` Jan Beulich
2014-10-02  9:52         ` Tim Deegan
2014-10-02 10:27           ` Jan Beulich
2014-10-02 16:52             ` Andrew Cooper
2014-10-06  7:31               ` Jan Beulich
2014-10-06  7:40                 ` Olaf Hering
2014-10-02 10:45         ` Olaf Hering
2014-10-02 14:15   ` Ian Campbell
2014-10-06  8:55   ` [PATCH v2] " Olaf Hering
2014-10-06  9:03     ` Jan Beulich
2014-10-08 12:45       ` Ian Campbell
2014-10-08 12:55         ` Olaf Hering
2014-10-08 13:18           ` Olaf Hering
2014-10-06 14:05 ` [PATCH 00/28 v5 for-xen-4.5] tool changes to honor configure --prefix=DIR Konrad Rzeszutek Wilk
2014-10-06 16:32 ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2014-09-25 15:19 [PATCH 00/28 v4] " Olaf Hering
2014-09-25 15:20 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
2014-09-25 15:41   ` Andrew Cooper
2014-09-25 15:57     ` Jan Beulich
2014-09-26  6:07     ` Olaf Hering
2014-09-25 16:01   ` Jan Beulich
2014-09-26  8:17     ` Olaf Hering
2014-09-26  8:54       ` Olaf Hering
2014-09-26  9:06         ` Jan Beulich
2014-09-26  9:22           ` Olaf Hering
2014-09-26  9:37             ` Jan Beulich
2014-09-26  8:56       ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.