All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR
@ 2014-09-25 15:19 Olaf Hering
  2014-09-25 15:19 ` [PATCH 01/28] Neutralize make uninstall Olaf Hering
                   ` (27 more replies)
  0 siblings, 28 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:19 UTC (permalink / raw)
  To: xen-devel; +Cc: Olaf Hering

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

In v4 of this series configure is updated to provide all paths:
prefix, bindir, sbindir, libdir, libexecdir, datarootdir, mandir,
docdir, dvidir, htmldir, pdfdir, psdir, includedir, localstatedir,
sysconfdir
These variables are used to feed the private variables used in the xen
source tree. At some later point another patch may convert them all to
the common automake variants.

Additional options: with-initddir, with-linux-backend-modules,
with-sysconfig-leaf-dir and enable-rpath.

Removed options: --disable-debug, in favour of 'make debug=yn
debug_symbols=yn'.

Every path is now stored in config/Paths.mk.

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.


Olaf Hering (28):
  Neutralize 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: 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"
  Put bash_completion.d below --sysconfdir=DIR
  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
  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                                          |  19 ++--
 Makefile                                           |  15 +--
 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                               |  10 --
 config/SunOS.mk                                    |  15 ---
 config/Tools.mk.in                                 |  17 ++--
 docs/misc/distro_mapping.txt                       |   5 +-
 m4/paths.m4                                        | 103 +++++++++++++++------
 m4/xenstored.m4                                    |   8 +-
 stubdom/Makefile                                   |   7 +-
 stubdom/configure.ac                               |   1 -
 stubdom/vtpmmgr/Makefile                           |   5 +
 {tools => stubdom}/vtpmmgr/calc.pl                 |   0
 {tools => stubdom}/vtpmmgr/manage-vtpmmgr.pl       |   0
 tools/Makefile                                     |  36 +++++--
 tools/Rules.mk                                     |   1 -
 tools/configure.ac                                 |  54 +++++++++--
 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/tests/vhpet/Makefile                         |   2 +-
 tools/tests/x86_emulator/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                                       |   5 +-
 xen/arch/x86/Makefile                              |   2 +-
 70 files changed, 330 insertions(+), 383 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] 89+ messages in thread

* [PATCH 01/28] Neutralize make uninstall
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
@ 2014-09-25 15:19 ` Olaf Hering
  2014-09-29 13:48   ` Ian Campbell
  2014-09-29 13:49   ` Ian Campbell
  2014-09-25 15:19 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
                   ` (26 subsequent siblings)
  27 siblings, 2 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:19 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Keir Fraser, Ian Campbell, Tim Deegan, Ian Jackson,
	Jan Beulich

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

Remove all dangerous commands. There is no replacement.

The proper fix is to remove the files and directories in the Makefiles
which install them.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
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: Tim Deegan <tim@xen.org>
---
 Makefile | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 3b9bf7a..abef019 100644
--- a/Makefile
+++ b/Makefile
@@ -232,21 +232,8 @@ 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*
+	$(MAKE) -C tools uninstall
 
 .PHONY: xenversion
 xenversion:

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

* [PATCH 02/28] tools/hotplug: fix race during xen.conf creation
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
  2014-09-25 15:19 ` [PATCH 01/28] Neutralize make uninstall Olaf Hering
@ 2014-09-25 15:19 ` Olaf Hering
  2014-09-30 15:46   ` Ian Campbell
  2014-09-25 15:19 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
                   ` (25 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:19 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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] 89+ messages in thread

* [PATCH 03/28] tools/python: use also LDFLAGS for build
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
  2014-09-25 15:19 ` [PATCH 01/28] Neutralize make uninstall Olaf Hering
  2014-09-25 15:19 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
@ 2014-09-25 15:19 ` Olaf Hering
  2014-09-30 15:46   ` Ian Campbell
  2014-09-25 15:19 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
                   ` (24 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:19 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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] 89+ messages in thread

* [PATCH 04/28] Add configure --with-initddir=DIR
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (2 preceding siblings ...)
  2014-09-25 15:19 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
@ 2014-09-25 15:19 ` Olaf Hering
  2014-09-30 15:47   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
                   ` (23 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:19 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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] 89+ messages in thread

* [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (3 preceding siblings ...)
  2014-09-25 15:19 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-25 15:20 ` [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
                   ` (22 subsequent siblings)
  27 siblings, 0 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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 4f45418..cc351c7 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] 89+ messages in thread

* [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (4 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-25 15:20 ` [PATCH 07/28] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
                   ` (21 subsequent siblings)
  27 siblings, 0 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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 cc351c7..29d13ff 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] 89+ messages in thread

* [PATCH 07/28] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (5 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 16:06   ` Roger Pau Monné
  2014-09-25 15:20 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
                   ` (20 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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/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:

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

* [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (6 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 07/28] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 16:06   ` Roger Pau Monné
  2014-09-25 15:20 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
                   ` (19 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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 29d13ff..80754ea 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

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

* [PATCH 09/28] remove duplicate variables from config
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (7 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 16:11   ` Roger Pau Monné
  2014-09-25 15:20 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
                   ` (18 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

... 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] 89+ messages in thread

* [PATCH 10/28] Substitue configure variables in Paths.mk.in
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (8 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:48   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
                   ` (17 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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] 89+ messages in thread

* [PATCH 11/28] tools: substitute bindir instead of BINDIR
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (9 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:51   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
                   ` (16 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

... 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>
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] 89+ messages in thread

* [PATCH 12/28] Use configure --mandir=DIR to set MANDIR
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (10 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:51   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
                   ` (15 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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

Signed-off-by: Olaf Hering <olaf@aepfle.de>
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] 89+ messages in thread

* [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (11 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:52   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
                   ` (14 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

Signed-off-by: Olaf Hering <olaf@aepfle.de>
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] 89+ messages in thread

* [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (12 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:52   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
                   ` (13 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

Signed-off-by: Olaf Hering <olaf@aepfle.de>
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] 89+ messages in thread

* [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (13 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:55   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 16/28] Use configure --prefix=DIR to set PREFIX Olaf Hering
                   ` (12 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	George Dunlap, 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>
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                                         | 21 ++++++++++++++-------
 stubdom/Makefile                                    |  6 +++---
 tools/Makefile                                      | 10 +++++-----
 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(+), 72 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..b924ffc 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)
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 00f539a..284b73e 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -86,7 +86,7 @@ uninstall:
 	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
@@ -187,9 +187,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 \
@@ -199,7 +199,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 d5a9ed2..4361f68 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -54,8 +54,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 496a269..602dc9b 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -239,10 +239,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 fbc82fd..a4ea749 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 f61673c..e13a37e 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] 89+ messages in thread

* [PATCH 16/28] Use configure --prefix=DIR to set PREFIX
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (14 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-25 15:20 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
                   ` (11 subsequent siblings)
  27 siblings, 0 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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] 89+ messages in thread

* [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (15 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 16/28] Use configure --prefix=DIR to set PREFIX Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:55   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
                   ` (10 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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 b924ffc..7ca4e53 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
@@ -96,15 +104,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 284b73e..67e1dc5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -201,7 +201,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] 89+ messages in thread

* [PATCH 18/28] Add configure --enable-rpath
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (16 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:56   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
                   ` (9 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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 |  2 ++
 tools/Makefile     | 16 ++++++++++++++--
 tools/configure.ac |  1 +
 4 files changed, 20 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 974e28e..5126bb1 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -43,6 +43,8 @@ PTHREAD_LIBS        := @PTHREAD_LIBS@
 
 PTYFUNCS_LIBS       := @PTYFUNCS_LIBS@
 
+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
 # may block it). We make it the default, but if your GIT repository downloads
diff --git a/tools/Makefile b/tools/Makefile
index 67e1dc5..38b4c48 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -110,6 +110,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
@@ -145,7 +153,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
@@ -154,6 +165,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
@@ -198,7 +210,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 80754ea..abc5033 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] 89+ messages in thread

* [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (17 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:57   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 20/28] Put bash_completion.d below --sysconfdir=DIR Olaf Hering
                   ` (8 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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 81bf938..3203d8a 100644
--- a/README
+++ b/README
@@ -231,15 +231,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 5126bb1..23ae8b1 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -71,6 +71,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 abc5033..87e14cd 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 4361f68..e6e7bcb 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -35,23 +35,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)
@@ -63,7 +57,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] 89+ messages in thread

* [PATCH 20/28] Put bash_completion.d below --sysconfdir=DIR
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (18 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:58   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Olaf Hering
                   ` (7 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

Signed-off-by: Olaf Hering <olaf@aepfle.de>
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] 89+ messages in thread

* [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (19 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 20/28] Put bash_completion.d below --sysconfdir=DIR Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 15:59   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 22/28] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
                   ` (6 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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 7ca4e53..9fb4fcd 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] 89+ messages in thread

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

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 9fb4fcd..d647f65 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -99,9 +99,6 @@ case "$host_os" in
 esac
 AC_SUBST(PRIVATE_BINDIR)
 
-XENFIRMWAREDIR=$prefix/lib/xen/boot
-AC_SUBST(XENFIRMWAREDIR)
-
 CONFIG_DIR=$sysconfdir
 AC_SUBST(CONFIG_DIR)

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

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

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] 89+ messages in thread

* [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (22 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 23/28] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 16:00   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
                   ` (3 subsequent siblings)
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 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>
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 23ae8b1..73b578a 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] 89+ messages in thread

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

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 87e14cd..4595976 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] 89+ messages in thread

* [PATCH 26/28] Use XEN_RUN_DIR instead of /var/run/xen
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (24 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 16:00   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
  2014-09-25 15:20 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 UTC (permalink / raw)
  To: xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
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 d647f65..0943886 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -118,9 +118,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] 89+ messages in thread

* [PATCH 27/28] move vtpmmgr helpers from tools to stubdom
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (25 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 26/28] Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-30 16:02   ` Ian Campbell
  2014-09-25 15:20 ` [PATCH 28/28] Separate runtime debug output from debug symbols Olaf Hering
  27 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-25 15:20 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>
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 73b578a..5239f4e 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -57,7 +57,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_SYSTEMD      := @systemd@
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 38b4c48..4afadfd 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] 89+ messages in thread

* [PATCH 28/28] Separate runtime debug output from debug symbols
  2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
                   ` (26 preceding siblings ...)
  2014-09-25 15:20 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
@ 2014-09-25 15:20 ` Olaf Hering
  2014-09-25 15:41   ` Andrew Cooper
                     ` (2 more replies)
  27 siblings, 3 replies; 89+ 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] 89+ 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
  2014-09-26 11:40   ` [PATCH 28/28 v2] " Olaf Hering
  2 siblings, 2 replies; 89+ 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] 89+ 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; 89+ 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] 89+ 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
  2014-09-26 11:40   ` [PATCH 28/28 v2] " Olaf Hering
  2 siblings, 1 reply; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ messages in thread

* [PATCH 28/28 v2] 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 11:40   ` Olaf Hering
  2014-09-26 11:56     ` Jan Beulich
  2 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-26 11:40 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

Add make variable debug_(stubdom|tools|xen)= to control debug= for
runtime debug.  Add make variable debuginfo_(stubdom|tools|xen)= to
control debug_symbols= for gcc -g.  Add configure --enable-debuginfo
to set debuginf_(stubdom|tools) once at configure time. The existing
--enable-debug will set debug_(stubdom|tools) once at configure time.

Currently two variables control runtime and compiletime debug info:
debug= for tools,stubdom 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.

No change in behaviour is expected by that patch for tools and xen.
For stubdom CFLAGS change from -O1 to O2 with debug=n.
It is still possible to use 'make debug=N debug_symbols=N'. But with
this patch it is now possible to do 'configure --disable-debug
--enable-debuginfo && make rpmbuild debug_xen=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                         | 3 +++
 config/Stubdom.mk.in              | 8 +++++---
 config/Tools.mk.in                | 8 +++++---
 stubdom/Makefile                  | 3 +--
 stubdom/configure.ac              | 3 ++-
 tools/Makefile                    | 7 +++++++
 tools/configure.ac                | 3 ++-
 tools/ocaml/common.make           | 5 ++++-
 tools/tests/vhpet/Makefile        | 2 +-
 tools/tests/x86_emulator/Makefile | 4 ++--
 xen/Rules.mk                      | 9 ++++++++-
 xen/arch/x86/Makefile             | 2 +-
 12 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/Config.mk b/Config.mk
index dff71b3..8a65adf 100644
--- a/Config.mk
+++ b/Config.mk
@@ -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..0576a2c 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -1,12 +1,14 @@
 -include $(XEN_ROOT)/config/Paths.mk
 
+debug_stubdom       := @debug@
+debuginfo_stubdom   := @debuginfo@
+debug               := $(debug_stubdom)
+debug_symbols       := $(debuginfo_stubdom)
+
 # Path Programs
 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..ab7598c 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -1,13 +1,15 @@
 -include $(XEN_ROOT)/config/Paths.mk
 
+debug_tools         := @debug@
+debuginfo_tools     := @debuginfo@
+debug               := $(debug_tools)
+debug_symbols       := $(debuginfo_tools)
+
 CONFIG_RUMP         := @CONFIG_RUMP@
 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..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/stubdom/configure.ac b/stubdom/configure.ac
index 6468203..f2c9dfd 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -45,7 +45,8 @@ 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([debug], [Disable runtime debug of stubdom])
+AX_ARG_DEFAULT_ENABLE([debuginfo], [Disable creation of debuginfo symbols during 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..f896bbb 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -88,7 +88,8 @@ 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_ENABLE([debug], [Disable runtime debug of tools])
+AX_ARG_DEFAULT_ENABLE([debuginfo], [Disable creation of debuginfo symbols during 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..442ffaa 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -10,6 +10,10 @@ lock_profile  ?= n
 crash_debug   ?= n
 frame_pointer ?= n
 lto           ?= n
+debug_xen     ?= y
+debuginfo_xen ?= y
+debug         := $(debug_xen)
+debug_symbols := $(debuginfo_xen)
 
 include $(XEN_ROOT)/Config.mk
 
@@ -43,7 +47,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] 89+ messages in thread

* Re: [PATCH 28/28 v2] Separate runtime debug output from debug symbols
  2014-09-26 11:40   ` [PATCH 28/28 v2] " Olaf Hering
@ 2014-09-26 11:56     ` Jan Beulich
  2014-09-26 14:02       ` Olaf Hering
  0 siblings, 1 reply; 89+ messages in thread
From: Jan Beulich @ 2014-09-26 11: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 13:40, <olaf@aepfle.de> wrote:
> --- 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:
> --- 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 $@ $<

I question this for all three instances above: These are purely testing
tools which don't even get built by default. There's nothing wrong with
them always being built with debug info, allowing to immediately run
them usefully in a debugger without consideration of build mode.

> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -10,6 +10,10 @@ lock_profile  ?= n
>  crash_debug   ?= n
>  frame_pointer ?= n
>  lto           ?= n
> +debug_xen     ?= y
> +debuginfo_xen ?= y
> +debug         := $(debug_xen)
> +debug_symbols := $(debuginfo_xen)

I'm not sure I want to see this do away with the old mechanism
altogether - various of my testing build flavors depend on overriding
the "debug" variable, and I wouldn't want to change all their .config
files. At least for a certain period of time the latter two should
probably continue to use ?=.

> @@ -43,7 +47,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

The context here shows that CFLAGS-y gets used elsewhere, so
please do so too above. And if possible this should be considered
elsewhere too.

In any event I don't see this change as important enough to
warrant overriding the feature freeze.

Jan

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

* Re: [PATCH 28/28 v2] Separate runtime debug output from debug symbols
  2014-09-26 11:56     ` Jan Beulich
@ 2014-09-26 14:02       ` Olaf Hering
  2014-09-26 14:43         ` Jan Beulich
  0 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-26 14:02 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 13:40, <olaf@aepfle.de> wrote:
> > --- a/xen/Rules.mk
> > +++ b/xen/Rules.mk
> > @@ -10,6 +10,10 @@ lock_profile  ?= n
> >  crash_debug   ?= n
> >  frame_pointer ?= n
> >  lto           ?= n
> > +debug_xen     ?= y
> > +debuginfo_xen ?= y
> > +debug         := $(debug_xen)
> > +debug_symbols := $(debuginfo_xen)
> 
> I'm not sure I want to see this do away with the old mechanism
> altogether - various of my testing build flavors depend on overriding
> the "debug" variable, and I wouldn't want to change all their .config
> files. At least for a certain period of time the latter two should
> probably continue to use ?=.

I think .config will continue to work with a "debug := y" and also 'make
debug=y'.

> > @@ -43,7 +47,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
> 
> The context here shows that CFLAGS-y gets used elsewhere, so
> please do so too above. And if possible this should be considered
> elsewhere too.

I'm not sure what you mean? The hunk just makes "-g" conditional.

> In any event I don't see this change as important enough to
> warrant overriding the feature freeze.

Regarding feature freeze, that small version below for 'make debug=yn
debug_symbols=yn' will work for me as well.

Olaf


    Separate runtime debug output from debug symbols
    
    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>
    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>

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 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/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 e2f9e36..a8bbd8e 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] 89+ messages in thread

* Re: [PATCH 28/28 v2] Separate runtime debug output from debug symbols
  2014-09-26 14:02       ` Olaf Hering
@ 2014-09-26 14:43         ` Jan Beulich
  2014-09-26 19:12           ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 89+ messages in thread
From: Jan Beulich @ 2014-09-26 14:43 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 16:02, <olaf@aepfle.de> wrote:
> On Fri, Sep 26, Jan Beulich wrote:
> 
>> >>> On 26.09.14 at 13:40, <olaf@aepfle.de> wrote:
>> > --- a/xen/Rules.mk
>> > +++ b/xen/Rules.mk
>> > @@ -10,6 +10,10 @@ lock_profile  ?= n
>> >  crash_debug   ?= n
>> >  frame_pointer ?= n
>> >  lto           ?= n
>> > +debug_xen     ?= y
>> > +debuginfo_xen ?= y
>> > +debug         := $(debug_xen)
>> > +debug_symbols := $(debuginfo_xen)
>> 
>> I'm not sure I want to see this do away with the old mechanism
>> altogether - various of my testing build flavors depend on overriding
>> the "debug" variable, and I wouldn't want to change all their .config
>> files. At least for a certain period of time the latter two should
>> probably continue to use ?=.
> 
> I think .config will continue to work with a "debug := y" and also 'make
> debug=y'.

Ah, right, you do this before the inclusion point of Config.mk.

>> > @@ -43,7 +47,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
>> 
>> The context here shows that CFLAGS-y gets used elsewhere, so
>> please do so too above. And if possible this should be considered
>> elsewhere too.
> 
> I'm not sure what you mean? The hunk just makes "-g" conditional.

Looks like you nevertheless understood, as your shrunk down
patch does what I was asking for here (quoted below).

>> In any event I don't see this change as important enough to
>> warrant overriding the feature freeze.
> 
> Regarding feature freeze, that small version below for 'make debug=yn
> debug_symbols=yn' will work for me as well.

This indeed seems more acceptable at this point. But the final
say would be with Konrad anyway.

> --- 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

(This one.)

Jan

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

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

On Fri, Sep 26, 2014 at 03:43:19PM +0100, Jan Beulich wrote:
> >>> On 26.09.14 at 16:02, <olaf@aepfle.de> wrote:
> > On Fri, Sep 26, Jan Beulich wrote:
> > 
> >> >>> On 26.09.14 at 13:40, <olaf@aepfle.de> wrote:
> >> > --- a/xen/Rules.mk
> >> > +++ b/xen/Rules.mk
> >> > @@ -10,6 +10,10 @@ lock_profile  ?= n
> >> >  crash_debug   ?= n
> >> >  frame_pointer ?= n
> >> >  lto           ?= n
> >> > +debug_xen     ?= y
> >> > +debuginfo_xen ?= y
> >> > +debug         := $(debug_xen)
> >> > +debug_symbols := $(debuginfo_xen)
> >> 
> >> I'm not sure I want to see this do away with the old mechanism
> >> altogether - various of my testing build flavors depend on overriding
> >> the "debug" variable, and I wouldn't want to change all their .config
> >> files. At least for a certain period of time the latter two should
> >> probably continue to use ?=.
> > 
> > I think .config will continue to work with a "debug := y" and also 'make
> > debug=y'.
> 
> Ah, right, you do this before the inclusion point of Config.mk.
> 
> >> > @@ -43,7 +47,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
> >> 
> >> The context here shows that CFLAGS-y gets used elsewhere, so
> >> please do so too above. And if possible this should be considered
> >> elsewhere too.
> > 
> > I'm not sure what you mean? The hunk just makes "-g" conditional.
> 
> Looks like you nevertheless understood, as your shrunk down
> patch does what I was asking for here (quoted below).
> 
> >> In any event I don't see this change as important enough to
> >> warrant overriding the feature freeze.
> > 
> > Regarding feature freeze, that small version below for 'make debug=yn
> > debug_symbols=yn' will work for me as well.
> 
> This indeed seems more acceptable at this point. But the final
> say would be with Konrad anyway.

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

I don't see this introducing an regressions. If there is an regression
it will be during build time so pretty easy to spot.


> 
> > --- 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
> 
> (This one.)
> 
> Jan
> 

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-09-25 15:19 ` [PATCH 01/28] Neutralize make uninstall Olaf Hering
@ 2014-09-29 13:48   ` Ian Campbell
  2014-09-30 12:07     ` Olaf Hering
  2014-09-29 13:49   ` Ian Campbell
  1 sibling, 1 reply; 89+ messages in thread
From: Ian Campbell @ 2014-09-29 13:48 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Keir Fraser, Ian Jackson, Tim Deegan, xen-devel, Jan Beulich

On Thu, 2014-09-25 at 17:19 +0200, Olaf Hering wrote:

(I seem to have misplaced the 00/28 mail so replying here. In fact I
missing a bunch of pieces which did go to the list according to the
archives, almost certainly an issue on my end.).

Are you still targeting all this at 4.5? If so then since the code
freeze you need mail Konrad and provide an argument for a release
exception.

I've not been through it myself yet so I don't know what I think,
although I think it will turn out I acked a fair chunk of it on the
previous rounds.

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-09-25 15:19 ` [PATCH 01/28] Neutralize make uninstall Olaf Hering
  2014-09-29 13:48   ` Ian Campbell
@ 2014-09-29 13:49   ` Ian Campbell
  2014-09-30 12:09     ` Olaf Hering
  1 sibling, 1 reply; 89+ messages in thread
From: Ian Campbell @ 2014-09-29 13:49 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Tim Deegan, Keir Fraser, Ian Jackson, Jan Beulich, xen-devel

On Thu, 2014-09-25 at 17:19 +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.
> 
> Remove all dangerous commands.

Of these only "rm -f $(D)$(XEN_RUN_DIR)*" seems especially dangerous. 

The rest will remove things like /*.conf and /xendomains which is
bad/wrong but not usually catastrophic 

>  There is no replacement.

Yet? Will this be replaced by additions to the appropriate submake files
in the course of this series?
 
> The proper fix is to remove the files and directories in the Makefiles
> which install them.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 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: Tim Deegan <tim@xen.org>
> ---
>  Makefile | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 3b9bf7a..abef019 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -232,21 +232,8 @@ 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*
> +	$(MAKE) -C tools uninstall
>  
>  .PHONY: xenversion
>  xenversion:
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-09-29 13:48   ` Ian Campbell
@ 2014-09-30 12:07     ` Olaf Hering
  2014-09-30 12:26       ` Ian Campbell
  0 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-30 12:07 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Keir Fraser, Ian Jackson, Tim Deegan, xen-devel, Jan Beulich

On Mon, Sep 29, Ian Campbell wrote:

> Are you still targeting all this at 4.5? If so then since the code
> freeze you need mail Konrad and provide an argument for a release
> exception.

Yes, the --prefix series should go into 4.5.

> I've not been through it myself yet so I don't know what I think,
> although I think it will turn out I acked a fair chunk of it on the
> previous rounds.

You already acked most of it, they are included in the v4 of the series.


Olaf

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-09-29 13:49   ` Ian Campbell
@ 2014-09-30 12:09     ` Olaf Hering
  2014-09-30 12:26       ` Ian Campbell
  2014-10-01  5:52       ` Olaf Hering
  0 siblings, 2 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-30 12:09 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Tim Deegan, Keir Fraser, Ian Jackson, Jan Beulich, xen-devel

On Mon, Sep 29, Ian Campbell wrote:

> On Thu, 2014-09-25 at 17:19 +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.
> > 
> > Remove all dangerous commands.
> 
> Of these only "rm -f $(D)$(XEN_RUN_DIR)*" seems especially dangerous. 
> 
> The rest will remove things like /*.conf and /xendomains which is
> bad/wrong but not usually catastrophic 
> 
> >  There is no replacement.
> 
> Yet? Will this be replaced by additions to the appropriate submake files
> in the course of this series?

No. Unless I miss something, make uninstall can not work today. At least
for the toplevel Makefile. If you want I can add more uninstall parts to
the tools Makefiles in a separate series. Either for 4.5 or later.

Olaf

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-09-30 12:09     ` Olaf Hering
@ 2014-09-30 12:26       ` Ian Campbell
  2014-10-01  5:52       ` Olaf Hering
  1 sibling, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 12:26 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Keir Fraser, Tim Deegan, Ian Jackson, Jan Beulich, xen-devel

On Tue, 2014-09-30 at 14:09 +0200, Olaf Hering wrote:
> On Mon, Sep 29, Ian Campbell wrote:
> 
> > On Thu, 2014-09-25 at 17:19 +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.
> > > 
> > > Remove all dangerous commands.
> > 
> > Of these only "rm -f $(D)$(XEN_RUN_DIR)*" seems especially dangerous. 
> > 
> > The rest will remove things like /*.conf and /xendomains which is
> > bad/wrong but not usually catastrophic 
> > 
> > >  There is no replacement.
> > 
> > Yet? Will this be replaced by additions to the appropriate submake files
> > in the course of this series?
> 
> No. Unless I miss something, make uninstall can not work today. At least
> for the toplevel Makefile. If you want I can add more uninstall parts to
> the tools Makefiles in a separate series. Either for 4.5 or later.

Later for sure.

Ian.

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-09-30 12:07     ` Olaf Hering
@ 2014-09-30 12:26       ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 12:26 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Keir Fraser, Ian Jackson, Tim Deegan, xen-devel, Jan Beulich

On Tue, 2014-09-30 at 14:07 +0200, Olaf Hering wrote:
> On Mon, Sep 29, Ian Campbell wrote:
> 
> > Are you still targeting all this at 4.5? If so then since the code
> > freeze you need mail Konrad and provide an argument for a release
> > exception.
> 
> Yes, the --prefix series should go into 4.5.

I expect Konrad is going to ask you why, and what are the risks vs
benefits.

> > I've not been through it myself yet so I don't know what I think,
> > although I think it will turn out I acked a fair chunk of it on the
> > previous rounds.
> 
> You already acked most of it, they are included in the v4 of the series.

Ian.

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

* Re: [PATCH 02/28] tools/hotplug: fix race during xen.conf creation
  2014-09-25 15:19 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
@ 2014-09-30 15:46   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:46 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:19 +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
> 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>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: 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)
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH 03/28] tools/python: use also LDFLAGS for build
  2014-09-25 15:19 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
@ 2014-09-30 15:46   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:46 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:19 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 04/28] Add configure --with-initddir=DIR
  2014-09-25 15:19 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
@ 2014-09-30 15:47   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:47 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:19 +0200, Olaf Hering wrote:
> 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 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)
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH 10/28] Substitue configure variables in Paths.mk.in
  2014-09-25 15:20 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
@ 2014-09-30 15:48   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:48 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 11/28] tools: substitute bindir instead of BINDIR
  2014-09-25 15:20 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
@ 2014-09-30 15:51   ` Ian Campbell
  2014-09-30 15:55     ` Olaf Hering
  0 siblings, 1 reply; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:51 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> ... 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>
> 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)

You switch all the users of these to the lower case version, don't you?
Or only partially perhaps?

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

* Re: [PATCH 12/28] Use configure --mandir=DIR to set MANDIR
  2014-09-25 15:20 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
@ 2014-09-30 15:51   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:51 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Stefano Stabellini, Ian Jackson, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR
  2014-09-25 15:20 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
@ 2014-09-30 15:52   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:52 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

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

* Re: [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR
  2014-09-25 15:20 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
@ 2014-09-30 15:52   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:52 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>

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

* Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-25 15:20 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
@ 2014-09-30 15:55   ` Ian Campbell
  2014-09-30 15:58     ` Olaf Hering
  0 siblings, 1 reply; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:55 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Stefano Stabellini, George Dunlap, Ian Jackson,
	xen-devel, Samuel Thibault

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> diff --git a/tools/Makefile b/tools/Makefile
> index 00f539a..284b73e 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -86,7 +86,7 @@ uninstall:
>  	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)

Won't this erase ${exec_prefix}/lib? (rather than the xen subtree)?


Everything else looked good.

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

* Re: [PATCH 11/28] tools: substitute bindir instead of BINDIR
  2014-09-30 15:51   ` Ian Campbell
@ 2014-09-30 15:55     ` Olaf Hering
  2014-09-30 16:04       ` Ian Campbell
  0 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-30 15:55 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Tue, Sep 30, Ian Campbell wrote:

> On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> > +SBINDIR                  := $(sbindir)
> > +BINDIR                   := $(bindir)
> You switch all the users of these to the lower case version, don't you?
> Or only partially perhaps?

Just the users in this file. Doing the conversion tree-wide, removing
BINDIR/SBINDIR, can be done after 4.5.

Olaf

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

* Re: [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var
  2014-09-25 15:20 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
@ 2014-09-30 15:55   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:55 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Stefano Stabellini, Ian Jackson, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 18/28] Add configure --enable-rpath
  2014-09-25 15:20 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
@ 2014-09-30 15:56   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:56 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2"
  2014-09-25 15:20 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
@ 2014-09-30 15:57   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:57 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Stefano Stabellini, Ian Jackson, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 20/28] Put bash_completion.d below --sysconfdir=DIR
  2014-09-25 15:20 ` [PATCH 20/28] Put bash_completion.d below --sysconfdir=DIR Olaf Hering
@ 2014-09-30 15:58   ` Ian Campbell
  2014-09-30 16:01     ` Olaf Hering
  0 siblings, 1 reply; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:58 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

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

Not sure the subject is 100% accurate, since it seems to just be moving
the location of the definition, not changing it in any way?

> 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@
>  
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-30 15:55   ` Ian Campbell
@ 2014-09-30 15:58     ` Olaf Hering
  2014-09-30 16:02       ` Ian Campbell
  0 siblings, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-09-30 15:58 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Wei Liu, Stefano Stabellini, George Dunlap, Ian Jackson,
	xen-devel, Samuel Thibault

On Tue, Sep 30, Ian Campbell wrote:

> On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> > diff --git a/tools/Makefile b/tools/Makefile
> > index 00f539a..284b73e 100644
> > --- a/tools/Makefile
> > +++ b/tools/Makefile
> > @@ -86,7 +86,7 @@ uninstall:
> >  	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)
> 
> Won't this erase ${exec_prefix}/lib? (rather than the xen subtree)?

No, the internal variable LIBEXEC has to include the subdir name "xen",
otherwise everything would end up in "/usr/lib". An earlier patch in
series adds this change:

config/Paths.mk.in:LIBEXEC := $(libexecdir)/$(PACKAGE_TARNAME)

Olaf

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

* Re: [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR
  2014-09-25 15:20 ` [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Olaf Hering
@ 2014-09-30 15:59   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 15:59 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Stefano Stabellini, Ian Jackson, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build
  2014-09-25 15:20 ` [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build Olaf Hering
@ 2014-09-30 16:00   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 16:00 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Samuel Thibault, Stefano Stabellini, Ian Jackson, Wei Liu, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 26/28] Use XEN_RUN_DIR instead of /var/run/xen
  2014-09-25 15:20 ` [PATCH 26/28] Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
@ 2014-09-30 16:00   ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 16:00 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Stefano Stabellini, Ian Jackson, xen-devel

On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> 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>

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

* Re: [PATCH 20/28] Put bash_completion.d below --sysconfdir=DIR
  2014-09-30 15:58   ` Ian Campbell
@ 2014-09-30 16:01     ` Olaf Hering
  0 siblings, 0 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-30 16:01 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Tue, Sep 30, Ian Campbell wrote:

> On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> Not sure the subject is 100% accurate, since it seems to just be moving
> the location of the definition, not changing it in any way?

You are right. I will reword this part.

Olaf

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

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

On Thu, 2014-09-25 at 17:20 +0200, 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")

Not exactly recent any more ;-)

> Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently)
> not used by make itself.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>

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

I'd like to see Daniels opinion though.

> 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 73b578a..5239f4e 100644
> --- a/config/Tools.mk.in
> +++ b/config/Tools.mk.in
> @@ -57,7 +57,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_SYSTEMD      := @systemd@
> 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 38b4c48..4afadfd 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	[flat|nested] 89+ messages in thread

* Re: [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC
  2014-09-30 15:58     ` Olaf Hering
@ 2014-09-30 16:02       ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 16:02 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Stefano Stabellini, George Dunlap, Ian Jackson,
	xen-devel, Samuel Thibault

On Tue, 2014-09-30 at 17:58 +0200, Olaf Hering wrote:
> On Tue, Sep 30, Ian Campbell wrote:
> 
> > On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> > > diff --git a/tools/Makefile b/tools/Makefile
> > > index 00f539a..284b73e 100644
> > > --- a/tools/Makefile
> > > +++ b/tools/Makefile
> > > @@ -86,7 +86,7 @@ uninstall:
> > >  	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)
> > 
> > Won't this erase ${exec_prefix}/lib? (rather than the xen subtree)?
> 
> No, the internal variable LIBEXEC has to include the subdir name "xen",
> otherwise everything would end up in "/usr/lib". An earlier patch in
> series adds this change:
> 
> config/Paths.mk.in:LIBEXEC := $(libexecdir)/$(PACKAGE_TARNAME)

Ah, ok. thanks

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

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

* Re: [PATCH 11/28] tools: substitute bindir instead of BINDIR
  2014-09-30 15:55     ` Olaf Hering
@ 2014-09-30 16:04       ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-09-30 16:04 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, xen-devel, Ian Jackson, Stefano Stabellini

On Tue, 2014-09-30 at 17:55 +0200, Olaf Hering wrote:
> On Tue, Sep 30, Ian Campbell wrote:
> 
> > On Thu, 2014-09-25 at 17:20 +0200, Olaf Hering wrote:
> > > +SBINDIR                  := $(sbindir)
> > > +BINDIR                   := $(bindir)
> > You switch all the users of these to the lower case version, don't you?
> > Or only partially perhaps?
> 
> Just the users in this file. Doing the conversion tree-wide, removing
> BINDIR/SBINDIR, can be done after 4.5.


OK.

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

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

* Re: [PATCH 07/28] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
  2014-09-25 15:20 ` [PATCH 07/28] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
@ 2014-09-30 16:06   ` Roger Pau Monné
  0 siblings, 0 replies; 89+ messages in thread
From: Roger Pau Monné @ 2014-09-30 16:06 UTC (permalink / raw)
  To: Olaf Hering, xen-devel
  Cc: Ian Jackson, Wei Liu, Ian Campbell, Stefano Stabellini

El 25/09/14 a les 17.20, Olaf Hering ha escrit:
> 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>

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

* Re: [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
  2014-09-25 15:20 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
@ 2014-09-30 16:06   ` Roger Pau Monné
  0 siblings, 0 replies; 89+ messages in thread
From: Roger Pau Monné @ 2014-09-30 16:06 UTC (permalink / raw)
  To: Olaf Hering, xen-devel
  Cc: Ian Jackson, Wei Liu, Ian Campbell, Stefano Stabellini

El 25/09/14 a les 17.20, Olaf Hering ha escrit:
> 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>

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

* Re: [PATCH 09/28] remove duplicate variables from config
  2014-09-25 15:20 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
@ 2014-09-30 16:11   ` Roger Pau Monné
  2014-09-30 16:30     ` Olaf Hering
  0 siblings, 1 reply; 89+ messages in thread
From: Roger Pau Monné @ 2014-09-30 16:11 UTC (permalink / raw)
  To: Olaf Hering, xen-devel
  Cc: Ian Jackson, Wei Liu, Ian Campbell, Stefano Stabellini

El 25/09/14 a les 17.20, Olaf Hering ha escrit:
[...]
> 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 ;;

Is it really necessary to introduce a FreeBSD case? It could just use
the wildcard one since it's the same.

> +*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
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 

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

* Re: [PATCH 09/28] remove duplicate variables from config
  2014-09-30 16:11   ` Roger Pau Monné
@ 2014-09-30 16:30     ` Olaf Hering
  0 siblings, 0 replies; 89+ messages in thread
From: Olaf Hering @ 2014-09-30 16:30 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Ian Jackson, Stefano Stabellini, Wei Liu, Ian Campbell, xen-devel

On Tue, Sep 30, Roger Pau Monné wrote:

> El 25/09/14 a les 17.20, Olaf Hering ha escrit:
> > +++ b/m4/paths.m4
> > @@ -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 ;;
> Is it really necessary to introduce a FreeBSD case? It could just use
> the wildcard one since it's the same.

PRIVATE_BINDIR and PRIVATE_PREFIX will be removed in a later patch
(--libexec). But I just realized those two variables are not removed by
that later patch. I will fix that with v5.

Olaf

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

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-09-30 12:09     ` Olaf Hering
  2014-09-30 12:26       ` Ian Campbell
@ 2014-10-01  5:52       ` Olaf Hering
  2014-10-01 10:44         ` Ian Campbell
  1 sibling, 1 reply; 89+ messages in thread
From: Olaf Hering @ 2014-10-01  5:52 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Tim Deegan, Keir Fraser, Ian Jackson, Jan Beulich, xen-devel

On Tue, Sep 30, Olaf Hering wrote:

> On Mon, Sep 29, Ian Campbell wrote:
> > Yet? Will this be replaced by additions to the appropriate submake files
> > in the course of this series?
> No. Unless I miss something, make uninstall can not work today. At least
> for the toplevel Makefile. If you want I can add more uninstall parts to
> the tools Makefiles in a separate series. Either for 4.5 or later.

Ian,

now that I look at staging-4.4 I see that the toplevel Makefile includes
config/StdGNU.mk which sets path variables used by the uninstall target.
So my series broke uninstall because the variables are not available
anymore during 'make uninstall'. I think the right fix is to move the
uninstall target to the invividual Makefiles in tools/hotplug/.
XEN_RUN_DIR is created at runtime now, it should be left alone by
uninstall. /var/lib/xen is created in tools/Makefile, so it should be
removed there.

I will adjust this patch and include it in v5 of this series.

Olaf

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

* Re: [PATCH 01/28] Neutralize make uninstall
  2014-10-01  5:52       ` Olaf Hering
@ 2014-10-01 10:44         ` Ian Campbell
  0 siblings, 0 replies; 89+ messages in thread
From: Ian Campbell @ 2014-10-01 10:44 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Tim Deegan, Keir Fraser, Ian Jackson, Jan Beulich, xen-devel

On Wed, 2014-10-01 at 07:52 +0200, Olaf Hering wrote:
> On Tue, Sep 30, Olaf Hering wrote:
> 
> > On Mon, Sep 29, Ian Campbell wrote:
> > > Yet? Will this be replaced by additions to the appropriate submake files
> > > in the course of this series?
> > No. Unless I miss something, make uninstall can not work today. At least
> > for the toplevel Makefile. If you want I can add more uninstall parts to
> > the tools Makefiles in a separate series. Either for 4.5 or later.
> 
> Ian,
> 
> now that I look at staging-4.4 I see that the toplevel Makefile includes
> config/StdGNU.mk which sets path variables used by the uninstall target.
> So my series broke uninstall because the variables are not available
> anymore during 'make uninstall'.

Ah, I assumed it had already been broken by e.g. refactoring done for
systemd.

>  I think the right fix is to move the
> uninstall target to the invividual Makefiles in tools/hotplug/.
> XEN_RUN_DIR is created at runtime now, it should be left alone by
> uninstall. /var/lib/xen is created in tools/Makefile, so it should be
> removed there.

I agree. Having the uninstall rule near to the install will be helpful.

> I will adjust this patch and include it in v5 of this series.

Thanks.

Ian.

^ permalink raw reply	[flat|nested] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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
  1 sibling, 0 replies; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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; 89+ 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] 89+ 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
  1 sibling, 1 reply; 89+ 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] 89+ 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
@ 2014-10-01 16:41 ` Olaf Hering
  2014-10-02  7:26   ` Jan Beulich
  2014-10-02 14:15   ` Ian Campbell
  0 siblings, 2 replies; 89+ 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] 89+ messages in thread

end of thread, other threads:[~2014-10-06  7:40 UTC | newest]

Thread overview: 89+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25 15:19 [PATCH 00/28 v4] tool changes to honor configure --prefix=DIR Olaf Hering
2014-09-25 15:19 ` [PATCH 01/28] Neutralize make uninstall Olaf Hering
2014-09-29 13:48   ` Ian Campbell
2014-09-30 12:07     ` Olaf Hering
2014-09-30 12:26       ` Ian Campbell
2014-09-29 13:49   ` Ian Campbell
2014-09-30 12:09     ` Olaf Hering
2014-09-30 12:26       ` Ian Campbell
2014-10-01  5:52       ` Olaf Hering
2014-10-01 10:44         ` Ian Campbell
2014-09-25 15:19 ` [PATCH 02/28] tools/hotplug: fix race during xen.conf creation Olaf Hering
2014-09-30 15:46   ` Ian Campbell
2014-09-25 15:19 ` [PATCH 03/28] tools/python: use also LDFLAGS for build Olaf Hering
2014-09-30 15:46   ` Ian Campbell
2014-09-25 15:19 ` [PATCH 04/28] Add configure --with-initddir=DIR Olaf Hering
2014-09-30 15:47   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 05/28] tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path Olaf Hering
2014-09-25 15:20 ` [PATCH 06/28] tools/configure.ac: sort AC_CONFIG_FILES Olaf Hering
2014-09-25 15:20 ` [PATCH 07/28] tools: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d Olaf Hering
2014-09-30 16:06   ` Roger Pau Monné
2014-09-25 15:20 ` [PATCH 08/28] tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD Olaf Hering
2014-09-30 16:06   ` Roger Pau Monné
2014-09-25 15:20 ` [PATCH 09/28] remove duplicate variables from config Olaf Hering
2014-09-30 16:11   ` Roger Pau Monné
2014-09-30 16:30     ` Olaf Hering
2014-09-25 15:20 ` [PATCH 10/28] Substitue configure variables in Paths.mk.in Olaf Hering
2014-09-30 15:48   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 11/28] tools: substitute bindir instead of BINDIR Olaf Hering
2014-09-30 15:51   ` Ian Campbell
2014-09-30 15:55     ` Olaf Hering
2014-09-30 16:04       ` Ian Campbell
2014-09-25 15:20 ` [PATCH 12/28] Use configure --mandir=DIR to set MANDIR Olaf Hering
2014-09-30 15:51   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 13/28] Use configure --docdir=DIR to set DOCDIR Olaf Hering
2014-09-30 15:52   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 14/28] Use configure --includedir=DIR to set INCLUDEDIR Olaf Hering
2014-09-30 15:52   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 15/28] Use configure --libexecdir=BASEDIR to set LIBEXEC Olaf Hering
2014-09-30 15:55   ` Ian Campbell
2014-09-30 15:58     ` Olaf Hering
2014-09-30 16:02       ` Ian Campbell
2014-09-25 15:20 ` [PATCH 16/28] Use configure --prefix=DIR to set PREFIX Olaf Hering
2014-09-25 15:20 ` [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var Olaf Hering
2014-09-30 15:55   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 18/28] Add configure --enable-rpath Olaf Hering
2014-09-30 15:56   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 19/28] Add configure --with-linux-backend-modules="mod1 mod2" Olaf Hering
2014-09-30 15:57   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 20/28] Put bash_completion.d below --sysconfdir=DIR Olaf Hering
2014-09-30 15:58   ` Ian Campbell
2014-09-30 16:01     ` Olaf Hering
2014-09-25 15:20 ` [PATCH 21/28] Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR Olaf Hering
2014-09-30 15:59   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 22/28] Make XENFIRMWAREDIR a subdir of libexecdir Olaf Hering
2014-09-25 15:20 ` [PATCH 23/28] tools: remove private copies of includedir and libdir from libxenstat Olaf Hering
2014-09-25 15:20 ` [PATCH 24/28] Use Paths.mk for docs, stubdom and tools build Olaf Hering
2014-09-30 16:00   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 25/28] tools: use XEN_LIB_STORED instead of /var/lib/xenstored Olaf Hering
2014-09-25 15:20 ` [PATCH 26/28] Use XEN_RUN_DIR instead of /var/run/xen Olaf Hering
2014-09-30 16:00   ` Ian Campbell
2014-09-25 15:20 ` [PATCH 27/28] move vtpmmgr helpers from tools to stubdom Olaf Hering
2014-09-30 16:02   ` Ian Campbell
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
2014-09-26 11:40   ` [PATCH 28/28 v2] " Olaf Hering
2014-09-26 11:56     ` Jan Beulich
2014-09-26 14:02       ` Olaf Hering
2014-09-26 14:43         ` Jan Beulich
2014-09-26 19:12           ` Konrad Rzeszutek Wilk
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 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

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.