Skip to contentSkip to conversation

tools: use --docdir option from configure

PATCH In review Olaf Hering 3 participants 6 messages Jun 13, 2012 – Jul 2, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: use --docdir option from configure

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1339598410 -7200
# Node ID 3a8cd926cd23170cd9d2eb127ef1e1074b369c04 # Parent 9d6fb03ba8e9266bbfd7a8dc92eb540a7b0a42f7
tools: use --docdir option from configure

Use configure to set the docdir location. Up to now it was a Makefile variable which had to be specified with each make invocation. Move the DODCIR define from Config.mk to config/Tools.mk. Adjust some Makefiles which use DOCDIR to source also config/Tools.mk.

Special care needs to be taken with qemu-xen-traditional. Internally it uses the variable datadir to set the path to keymaps and ROM files. It also makes use of tools/Rules.mk, which in turn sources config/Tools.mk. This overwrites the initial value of datadir and keymaps and ROM files will be installed into a wrong location. Fix this by specifying datadir as make option.

datadir itself needs to be present in config/Tools.mk.in, without it autoconf will print warnings and the newly added variables such as @docdir@ will not be expanded properly.

This patch does not move SHAREDIR and MANDIR from Config.mk to config/Tools.mk because qemu-xen-traditional is not prepared for that. It has ${prefix}/share hardcoded. This has to be adressed in a separate change.

Config.mk +0 -1
diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 Config.mk
@@ -45,7 +45,6 @@ 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
 
config/Tools.mk.in +5 -0
diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 config/Tools.mk.in
@@ -1,6 +1,11 @@
 # Prefix and install folder
 PREFIX              := @prefix@
+prefix              := @prefix@
 LIBLEAFDIR_x86_64   := @LIB_PATH@
+PACKAGE_TARNAME     := @PACKAGE_TARNAME@
+datarootdir         := @datarootdir@
+datadir             := @datadir@
+DOCDIR              := @docdir@
 
 # A debug build of tools?
 debug               := @debug@
docs/Makefile +1 -0
diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 docs/Makefile
@@ -2,6 +2,7 @@
 
 XEN_ROOT=$(CURDIR)/..
 include $(XEN_ROOT)/Config.mk
+-include $(XEN_ROOT)/config/Tools.mk
 include $(XEN_ROOT)/docs/Docs.mk
 
 VERSION		= xen-unstable
docs/xen-api/Makefile +1 -0
diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 docs/xen-api/Makefile
@@ -2,6 +2,7 @@
 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/Config.mk
+-include $(XEN_ROOT)/config/Tools.mk
 include $(XEN_ROOT)/docs/Docs.mk
 
 
stubdom/Makefile +1 -0
diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 stubdom/Makefile
@@ -6,6 +6,7 @@ export XEN_OS=MiniOS
 export stubdom=y
 export debug=y
 include $(XEN_ROOT)/Config.mk
+-include $(XEN_ROOT)/config/Tools.mk
 
 #ZLIB_URL?=http://www.zlib.net
 ZLIB_URL=$(XEN_EXTFILES_URL)
tools/Makefile +7 -3
diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 tools/Makefile
@@ -123,7 +123,8 @@ subdir-all-qemu-xen-traditional-dir: qem
 		$(buildmakevars2shellvars); \
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
-		$(MAKE) all
+		$(MAKE) all \
+			datadir="$(SHAREDIR)/xen/qemu"
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
@@ -132,11 +133,14 @@ subdir-install-qemu-xen-traditional-dir:
 		$(QEMU_ROOT)/xen-setup \
 		--extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
 		$(IOEMU_CONFIGURE_CROSS); \
-		$(MAKE) install
+		$(MAKE) install \
+			datadir="$(SHAREDIR)/xen/qemu"
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \
-		$(MAKE) -C qemu-xen-traditional-dir clean; \
+		$(MAKE) -C qemu-xen-traditional-dir clean \
+			datadir="$(SHAREDIR)/xen/qemu" \
+		; \
 	fi
 
 .PHONY: qemu-xen-dir-force-update
#1 lore raw
Quoted 6 lines · Olaf Hering

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1339598410 -7200
# Node ID 3a8cd926cd23170cd9d2eb127ef1e1074b369c04 # Parent 9d6fb03ba8e9266bbfd7a8dc92eb540a7b0a42f7
tools: use --docdir option from configure

Not just tools: but also docs: since one of the effects of this patch is that some "make *doc*" commands now require one to run ./configure first.

Are we happy with that?

Perhaps we should defer these sorts of build system changes to 4.3 at this point.

Quoted 11 lines

Use configure to set the docdir location. Up to now it was a Makefile variable which had to be specified with each make invocation. Move the DODCIR define from Config.mk to config/Tools.mk. Adjust some Makefiles which use DOCDIR to source also config/Tools.mk.

Special care needs to be taken with qemu-xen-traditional. Internally it uses the variable datadir to set the path to keymaps and ROM files. It also makes use of tools/Rules.mk, which in turn sources config/Tools.mk. This overwrites the initial value of datadir and keymaps and ROM files will be installed into a wrong location. Fix this by specifying datadir as make option.

Ewww... But necessary I suppose.

Quoted 106 lines

datadir itself needs to be present in config/Tools.mk.in, without it autoconf will print warnings and the newly added variables such as @docdir@ will not be expanded properly.

This patch does not move SHAREDIR and MANDIR from Config.mk to config/Tools.mk because qemu-xen-traditional is not prepared for that. It has ${prefix}/share hardcoded. This has to be addressed in a separate change.

diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 Config.mk

Config.mk +0 -1
@@ -45,7 +45,6 @@ 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 -r 9d6fb03ba8e9 -r 3a8cd926cd23 config/Tools.mk.in

config/Tools.mk.in +5 -0
@@ -1,6 +1,11 @@
 # Prefix and install folder
 PREFIX              := @prefix@
+prefix              := @prefix@
 LIBLEAFDIR_x86_64   := @LIB_PATH@
+PACKAGE_TARNAME     := @PACKAGE_TARNAME@
+datarootdir         := @datarootdir@
+datadir             := @datadir@
+DOCDIR              := @docdir@
 
 # A debug build of tools?
 debug               := @debug@

diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 docs/Makefile

docs/Makefile +1 -0
@@ -2,6 +2,7 @@
 
 XEN_ROOT=$(CURDIR)/..
 include $(XEN_ROOT)/Config.mk
+-include $(XEN_ROOT)/config/Tools.mk
 include $(XEN_ROOT)/docs/Docs.mk
 
 VERSION		= xen-unstable

diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 docs/xen-api/Makefile

docs/xen-api/Makefile +1 -0
@@ -2,6 +2,7 @@
 
 XEN_ROOT=$(CURDIR)/../..
 include $(XEN_ROOT)/Config.mk
+-include $(XEN_ROOT)/config/Tools.mk
 include $(XEN_ROOT)/docs/Docs.mk
 
 

diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 stubdom/Makefile

stubdom/Makefile +1 -0
@@ -6,6 +6,7 @@ export XEN_OS=MiniOS
 export stubdom=y
 export debug=y
 include $(XEN_ROOT)/Config.mk
+-include $(XEN_ROOT)/config/Tools.mk
 
 #ZLIB_URL?=http://www.zlib.net
 ZLIB_URL=$(XEN_EXTFILES_URL)

diff -r 9d6fb03ba8e9 -r 3a8cd926cd23 tools/Makefile

tools/Makefile +7 -3
@@ -123,7 +123,8 @@ subdir-all-qemu-xen-traditional-dir: qem
 		$(buildmakevars2shellvars); \
 		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
-		$(MAKE) all
+		$(MAKE) all \
+			datadir="$(SHAREDIR)/xen/qemu"
 
 subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 	set -e; \
@@ -132,11 +133,14 @@ subdir-install-qemu-xen-traditional-dir:
 		$(QEMU_ROOT)/xen-setup \
 		--extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \
 		$(IOEMU_CONFIGURE_CROSS); \
-		$(MAKE) install
+		$(MAKE) install \
+			datadir="$(SHAREDIR)/xen/qemu"
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \
-		$(MAKE) -C qemu-xen-traditional-dir clean; \
+		$(MAKE) -C qemu-xen-traditional-dir clean \
+			datadir="$(SHAREDIR)/xen/qemu" \
+		; \
 	fi
 
 .PHONY: qemu-xen-dir-force-update

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 8 lines · Ian Campbell
Quoted 6 lines · Olaf Hering

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1339598410 -7200
# Node ID 3a8cd926cd23170cd9d2eb127ef1e1074b369c04 # Parent 9d6fb03ba8e9266bbfd7a8dc92eb540a7b0a42f7
tools: use --docdir option from configure

Quoted 5 lines

Not just tools: but also docs: since one of the effects of this patch is that some "make *doc*" commands now require one to run ./configure first.

Are we happy with that?

I dont care.
Was it a common usage pattern to just run make docs?

Olaf

#3 lore raw
Quoted 10 lines · Olaf Hering
Quoted 8 lines · Ian Campbell
Quoted 6 lines · Olaf Hering

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1339598410 -7200
# Node ID 3a8cd926cd23170cd9d2eb127ef1e1074b369c04 # Parent 9d6fb03ba8e9266bbfd7a8dc92eb540a7b0a42f7
tools: use --docdir option from configure

Quoted 8 lines
Quoted 5 lines

Not just tools: but also docs: since one of the effects of this patch is that some "make *doc*" commands now require one to run ./configure first.

Are we happy with that?

I dont care.
Was it a common usage pattern to just run make docs?

I don't know about common but e.g. the script which populates
http://xenbits.xen.org/docs/unstable/ does. I don't mind updating that one but I just wanted to see if anyone else had an opinion.

Ian.

#4 lore raw

Ian Campbell writes ("Re: [Xen-devel] [PATCH] tools: use --docdir option from configure"):

Quoted 3 lines

I don't know about common but e.g. the script which populates
http://xenbits.xen.org/docs/unstable/ does. I don't mind updating that one but I just wanted to see if anyone else had an opinion.

IMO this is certainly not 4.2 material.

Ian.

#5 lore raw
Quoted 6 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH] tools: use --docdir option from configure"):

Quoted 3 lines

I don't know about common but e.g. the script which populates
http://xenbits.xen.org/docs/unstable/ does. I don't mind updating that one but I just wanted to see if anyone else had an opinion.

IMO this is certainly not 4.2 material.

I wondered about that in my original reply.

I agree, lets leave until 4.3.

Ian.