Skip to contentSkip to conversation

configure: --with-confsuffix option

PATCH Superseded Eduardo Habkost 2 participants 20 messages Mar 30, 2012 – Apr 4, 2012 Kbuild

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/14 configure: rename $datadir to $qemu_datadir

In reply to Eduardo Habkost

The variable is used for the qemu-specific directory and has a different meaning of the autoconf "datadir" variable (that's used for the $prefix/share directory, not for $prefix/share/PACKAGE).

This doesn't change behavior or interfaces, it's just an internal variable rename.

---
 configure |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
configure +5 -5
index 14ef738..97294a6 100755
@@ -155,7 +155,7 @@ mingw32="no"
 EXESUF=""
 prefix="/usr/local"
 mandir="\${prefix}/share/man"
-datadir="\${prefix}/share/qemu"
+qemu_datadir="\${prefix}/share/qemu"
 docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"
@@ -521,7 +521,7 @@ EOF
   fi
   prefix="c:/Program Files/Qemu"
   mandir="\${prefix}"
-  datadir="\${prefix}"
+  qemu_datadir="\${prefix}"
   docdir="\${prefix}"
   bindir="\${prefix}"
   sysconfdir="\${prefix}"
@@ -589,7 +589,7 @@ for opt do
   ;;
   --includedir=*) includedir="$optarg"
   ;;
-  --datadir=*) datadir="$optarg"
+  --datadir=*) qemu_datadir="$optarg"
   ;;
   --docdir=*) docdir="$optarg"
   ;;
@@ -2865,7 +2865,7 @@ if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
 fi
 
 echo "Install prefix    $prefix"
-echo "BIOS directory    `eval echo $datadir`"
+echo "BIOS directory    `eval echo $qemu_datadir`"
 echo "binary directory  `eval echo $bindir`"
 echo "library directory `eval echo $libdir`"
 echo "include directory `eval echo $includedir`"
@@ -2973,7 +2973,7 @@ echo "bindir=$bindir" >> $config_host_mak
 echo "libdir=$libdir" >> $config_host_mak
 echo "includedir=$includedir" >> $config_host_mak
 echo "mandir=$mandir" >> $config_host_mak
-echo "datadir=$datadir" >> $config_host_mak
+echo "datadir=$qemu_datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "docdir=$docdir" >> $config_host_mak
 echo "confdir=$confdir" >> $config_host_mak
Signature · 1 line
1.7.3.2
#4 lore raw

PATCH 4/14 create_config: separate section for qemu_*dir variables

In reply to Eduardo Habkost

The generic *dir section will eventually go away and be replaced with qemu_* section. By now, both sections will be kept, while the variables get renamed on config-host.mak.

With this patch, a XXXdir variable will become a CONFIG_QEMU_XXXDIR define, and a qemu_XXXdir variable will become CONFIG_QEMU_XXXDIR as well (instead of becoming a CONFIG_QEMU_QEMU_XXXDIR define).

---
 scripts/create_config |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
scripts/create_config +9 -0
index 0098e68..3281551 100755
@@ -13,6 +13,15 @@ case $line in
     pkgversion=${line#*=}
     echo "#define QEMU_PKGVERSION \"$pkgversion\""
     ;;
+ qemu_*dir=*) # qemu-specific directory configuration
+    name=${line%=*}
+    value=${line#*=}
+    define_name=`echo $name | tr '[:lower:]' '[:upper:]'`
+    eval "define_value=\"$value\""
+    echo "#define CONFIG_$define_name \"$define_value\""
+    # save for the next definitions
+    eval "$name=\$define_value"
+    ;;
  prefix=* | [a-z]*dir=*) # directory configuration
     name=${line%=*}
     value=${line#*=}
Signature · 1 line
1.7.3.2
#2 lore raw

PATCH 2/14 configure: rename $docdir to $qemu_docdir

In reply to Eduardo Habkost

The autoconf "docdir" variable is used for the program-specific subdirectory, but anyway it's better to make it clear that the variable is used for the qemu-specific subdirectory path.

---
 configure |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
configure +4 -4
index 97294a6..8e8f2af 100755
@@ -156,7 +156,7 @@ EXESUF=""
 prefix="/usr/local"
 mandir="\${prefix}/share/man"
 qemu_datadir="\${prefix}/share/qemu"
-docdir="\${prefix}/share/doc/qemu"
+qemu_docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"
 includedir="\${prefix}/include"
@@ -522,7 +522,7 @@ EOF
   prefix="c:/Program Files/Qemu"
   mandir="\${prefix}"
   qemu_datadir="\${prefix}"
-  docdir="\${prefix}"
+  qemu_docdir="\${prefix}"
   bindir="\${prefix}"
   sysconfdir="\${prefix}"
   confsuffix=""
@@ -591,7 +591,7 @@ for opt do
   ;;
   --datadir=*) qemu_datadir="$optarg"
   ;;
-  --docdir=*) docdir="$optarg"
+  --docdir=*) qemu_docdir="$optarg"
   ;;
   --sysconfdir=*) sysconfdir="$optarg"
   ;;
@@ -2975,7 +2975,7 @@ echo "includedir=$includedir" >> $config_host_mak
 echo "mandir=$mandir" >> $config_host_mak
 echo "datadir=$qemu_datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
-echo "docdir=$docdir" >> $config_host_mak
+echo "docdir=$qemu_docdir" >> $config_host_mak
 echo "confdir=$confdir" >> $config_host_mak
 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
 echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
Signature · 1 line
1.7.3.2
#3 lore raw

PATCH 3/14 configure: rename $confdir to $qemu_confdir

In reply to Eduardo Habkost

There's no "confdir" variable on Autoconf, but it's good to make it clear that it's a variable for the Qemu-specific subdirectory inside $sysconfdir.

---
 configure |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 8e8f2af..ab08498 100755
@@ -2830,7 +2830,7 @@ if test "$mingw32" = "yes" ; then
     done
 fi
 
-confdir=$sysconfdir$confsuffix
+qemu_confdir=$sysconfdir$confsuffix
 
 tools=
 if test "$softmmu" = yes ; then
@@ -2976,7 +2976,7 @@ echo "mandir=$mandir" >> $config_host_mak
 echo "datadir=$qemu_datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "docdir=$qemu_docdir" >> $config_host_mak
-echo "confdir=$confdir" >> $config_host_mak
+echo "confdir=$qemu_confdir" >> $config_host_mak
 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
 echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
 echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak
Signature · 1 line
1.7.3.2
#5 lore raw

PATCH 5/14 config-host.mak: rename datadir to qemu_datadir

In reply to Eduardo Habkost

Autoconf concept of "datadir" is supposed to be "$prefix/share", not "$prefix/share/PACKAGE", so using datadir for the Qemu-specific directory is confusing.

The current C code that uses CONFIG_QEMU_DATADIR should be safe, as now create_config generates the same #define name (CONFIG_QEMU_DATADIR) for both "datadir" and "qemu_datadir" variables.

---
 Makefile        |    8 ++++----
 Makefile.target |    4 ++--
 configure       |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
Makefile +4 -4
index d8e1f36..605f1aa 100644
@@ -293,14 +293,14 @@ ifneq ($(HELPERS-y),)
 	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
 endif
 ifneq ($(BLOBS),)
-	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)"
 	set -e; for x in $(BLOBS); do \
-		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
+		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
 	done
 endif
-	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps"
 	set -e; for x in $(KEYMAPS); do \
-		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
+		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
 	done
 	for d in $(TARGET_DIRS); do \
 	$(MAKE) -C $$d $@ || exit 1 ; \
Makefile.target +2 -2
index 44b2e83..ca0f85f 100644
@@ -473,8 +473,8 @@ ifneq ($(STRIP),)
 endif
 endif
 ifdef CONFIG_TRACE_SYSTEMTAP
-	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/../systemtap/tapset"
-	$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(datadir)/../systemtap/tapset"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
+	$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
 endif
 
 # Include automatically generated dependency files
configure +1 -1
index ab08498..15bb48d 100755
@@ -2973,7 +2973,7 @@ echo "bindir=$bindir" >> $config_host_mak
 echo "libdir=$libdir" >> $config_host_mak
 echo "includedir=$includedir" >> $config_host_mak
 echo "mandir=$mandir" >> $config_host_mak
-echo "datadir=$qemu_datadir" >> $config_host_mak
+echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "docdir=$qemu_docdir" >> $config_host_mak
 echo "confdir=$qemu_confdir" >> $config_host_mak
Signature · 1 line
1.7.3.2
#6 lore raw

PATCH 6/14 config-host.mak: rename confdir to qemu_confdir

In reply to Eduardo Habkost

$confdir is a confusing name, as it's not clear if it's "the system config dir" or "the Qemus-specific directory inside the config dir". $qemu_confdir makes it more clear.

The current C code that uses CONFIG_QEMU_CONFDIR should be safe, as now create_config generates the same #define name (CONFIG_QEMU_CONFDIR) for both "confdir" and "qemu_confdir" variables.

---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
index 15bb48d..58c6f17 100755
@@ -2976,7 +2976,7 @@ echo "mandir=$mandir" >> $config_host_mak
 echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "docdir=$qemu_docdir" >> $config_host_mak
-echo "confdir=$qemu_confdir" >> $config_host_mak
+echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
 echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
 echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak
Signature · 1 line
1.7.3.2
#7 lore raw

PATCH 7/14 Makefile: use $(qemu_confdir) instead of $(sysconfdir)/qemu

In reply to Eduardo Habkost

Instead of hardcoding the directory suffix, use the qemu-specific directory variable.

---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 605f1aa..bda3680 100644
@@ -280,8 +280,8 @@ ifdef CONFIG_VIRTFS
 	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
 endif
 install-sysconfig:
-	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
-	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_confdir)"
+	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
 
 install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
 	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
Signature · 1 line
1.7.3.2
#8 lore raw

PATCH 8/14 config-host.mak: rename docdir to qemu_docdir

In reply to Eduardo Habkost
---
 Makefile  |    4 ++--
 configure |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Makefile +2 -2
index bda3680..a308471 100644
@@ -267,8 +267,8 @@ BLOBS=
 endif
 
 install-doc: $(DOCS)
-	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
-	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
+	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
 ifdef CONFIG_POSIX
 	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
 	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
configure +1 -1
index 58c6f17..fc206ff 100755
@@ -2975,7 +2975,7 @@ echo "includedir=$includedir" >> $config_host_mak
 echo "mandir=$mandir" >> $config_host_mak
 echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
-echo "docdir=$qemu_docdir" >> $config_host_mak
+echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
 echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
 echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
Signature · 1 line
1.7.3.2
#12 lore raw

PATCH 12/14 create_config: simplify prefix=* block, remove CONFIG_QEMU_PREFIX

In reply to Eduardo Habkost

As now that block handles only the prefix variable, the code can be much simpler. This also removes the CONFIG_QEMU_PREFIX define as it is not used by any C code.

---
 scripts/create_config |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
scripts/create_config +1 -6
index 44a1033..835510e 100755
@@ -23,13 +23,8 @@ case $line in
     eval "$name=\$define_value"
     ;;
  prefix=*)
-    name=${line%=*}
-    value=${line#*=}
-    define_name=`echo $name | tr '[:lower:]' '[:upper:]'`
-    eval "define_value=\"$value\""
-    echo "#define CONFIG_QEMU_$define_name \"$define_value\""
     # save for the next definitions
-    eval "$name=\$define_value"
+    prefix=${line#*=}
     ;;
  CONFIG_AUDIO_DRIVERS=*)
     drivers=${line#*=}
Signature · 1 line
1.7.3.2
#13 lore raw

PATCH 13/14 configure: change meaning of --datadir to Autoconf convention

In reply to Eduardo Habkost

Autoconf uses --datadir for the /usr/share directory, not the program-specific subdirectory inside /usr/share. This changes configure to match autoconf behavior.

Note that this will break compatibility with existing build scripts.

---
 configure |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
configure +5 -4
index 5de58cb..b74efe2 100755
@@ -155,7 +155,7 @@ mingw32="no"
 EXESUF=""
 prefix="/usr/local"
 mandir="\${prefix}/share/man"
-qemu_datadir="\${prefix}/share/qemu"
+datadir="\${prefix}/share"
 qemu_docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"
@@ -521,7 +521,7 @@ EOF
   fi
   prefix="c:/Program Files/Qemu"
   mandir="\${prefix}"
-  qemu_datadir="\${prefix}"
+  datadir="\${prefix}"
   qemu_docdir="\${prefix}"
   bindir="\${prefix}"
   sysconfdir="\${prefix}"
@@ -589,7 +589,7 @@ for opt do
   ;;
   --includedir=*) includedir="$optarg"
   ;;
-  --datadir=*) qemu_datadir="$optarg"
+  --datadir=*) datadir="$optarg"
   ;;
   --docdir=*) qemu_docdir="$optarg"
   ;;
@@ -1007,7 +1007,7 @@ echo "  --python=PYTHON          use specified python [$python]"
 echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
-echo "  --datadir=PATH           install firmware in PATH"
+echo "  --datadir=PATH           install firmware in PATH/qemu"
 echo "  --docdir=PATH            install documentation in PATH"
 echo "  --bindir=PATH            install binaries in PATH"
 echo "  --sysconfdir=PATH        install config in PATH/qemu"
@@ -2831,6 +2831,7 @@ if test "$mingw32" = "yes" ; then
 fi
 
 qemu_confdir=$sysconfdir$confsuffix
+qemu_datadir=$datadir$confsuffix
 
 tools=
 if test "$softmmu" = yes ; then
Signature · 1 line
1.7.3.2
#9 lore raw

PATCH 9/14 config-host.mak: remove CONFIG_QEMU_SHAREDIR

In reply to Eduardo Habkost

There is no code using that variable according to 'git grep', so kill it.

---
 configure |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
configure +0 -1
index fc206ff..b02dfa3 100755
@@ -2978,7 +2978,6 @@ echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
 echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
-echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
 echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak
 
 echo "ARCH=$ARCH" >> $config_host_mak
Signature · 1 line
1.7.3.2
#10 lore raw

PATCH 10/14 config-host.mak: reorder variables a bit

In reply to Eduardo Habkost

Cosmetic change.

---
 configure |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index b02dfa3..5de58cb 100755
@@ -2973,10 +2973,10 @@ echo "bindir=$bindir" >> $config_host_mak
 echo "libdir=$libdir" >> $config_host_mak
 echo "includedir=$includedir" >> $config_host_mak
 echo "mandir=$mandir" >> $config_host_mak
-echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
-echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
 echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
+echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
+echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
 echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak
 
Signature · 1 line
1.7.3.2
#11 lore raw

PATCH 11/14 create_config: remove *dir block

In reply to Eduardo Habkost

Now only the qemu_*dir variables will become #defines. The other directory names aren't used by the C code.

That means the following #defines won't be available in C code anymore:

- CONFIG_QEMU_BINDIR
- CONFIG_QEMU_LIBDIR
- CONFIG_QEMU_INCLUDEDIR
- CONFIG_QEMU_MANDIR
- CONFIG_QEMU_SYSCONFDIR
- CONFIG_QEMU_LIBEXECDIR

The following #defines are going to be kept because they are handled by the qemu_* block on create_config:

- CONFIG_QEMU_CONFDIR
- CONFIG_QEMU_DATADIR
- CONFIG_QEMU_DOCDIR

This one will be kept because it is set directly by ./configure:

- CONFIG_QEMU_HELPERDIR

This patch keeps the 'prefix=*' (CONFIG_QEMU_PREFIX) pattern because other variables may use $prefix on their config-host.mak definitions. The remaining code will be simplified on a further patch.

---
 scripts/create_config |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/create_config +1 -1
index 3281551..44a1033 100755
@@ -22,7 +22,7 @@ case $line in
     # save for the next definitions
     eval "$name=\$define_value"
     ;;
- prefix=* | [a-z]*dir=*) # directory configuration
+ prefix=*)
     name=${line%=*}
     value=${line#*=}
     define_name=`echo $name | tr '[:lower:]' '[:upper:]'`
Signature · 1 line
1.7.3.2
#16 lore raw

PATCH 14/14 configure: add --confsuffix option

In reply to Eduardo Habkost

This will allow the user to make Qemu use a different subdirectory name inside $datadir and $sysconfdir, instead of "/qemu".

---
 configure |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
configure +6 -3
index b74efe2..e56c569 100755
@@ -591,6 +591,8 @@ for opt do
   ;;
   --datadir=*) datadir="$optarg"
   ;;
+  --with-confsuffix=*) confsuffix="$optarg"
+  ;;
   --docdir=*) qemu_docdir="$optarg"
   ;;
   --sysconfdir=*) sysconfdir="$optarg"
@@ -1007,10 +1009,11 @@ echo "  --python=PYTHON          use specified python [$python]"
 echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
-echo "  --datadir=PATH           install firmware in PATH/qemu"
-echo "  --docdir=PATH            install documentation in PATH"
+echo "  --datadir=PATH           install firmware in PATH$confsuffix"
+echo "  --docdir=PATH            install documentation in PATH$confsuffix"
 echo "  --bindir=PATH            install binaries in PATH"
-echo "  --sysconfdir=PATH        install config in PATH/qemu"
+echo "  --sysconfdir=PATH        install config in PATH$confsuffix"
+echo "  --with-confsuffix=SUFFIX      suffix for Qemu data inside datadir and sysconfdir [$confsuffix]"
 echo "  --enable-debug-tcg       enable TCG debugging"
 echo "  --disable-debug-tcg      disable TCG debugging (default)"
 echo "  --enable-debug           enable common debug build options"
Signature · 1 line
1.7.3.2
#0 lore raw

cover configure: --with-confsuffix option

This series is the third version of the --confsuffix/--confdir changes I have submitted before. Now it does two interface changes:

- Changes --datadir meaning to match Autoconf convention (meaning that it should point to /usr/share, not /usr/share/qemu).
NOTE: this breaks compatibility.
I don't know of anybody who uses that option today. Neither Fedora, Debian, Arch Linux, Gentoo, or FreeBSD use it[1].
- Add --with-confsuffix option, to allow the /etc/qemu and /usr/share/qemu directories to have a different names.

[1] http://article.gmane.org/gmane.comp.emulators.qemu/142924

Most of the patches are variable renames and cleanups. The actual changes are only on the last 2 patches.

First, internal configure variables are renamed, without changing config-host.mak:

configure: rename $datadir to $qemu_datadir
configure: rename $docdir to $qemu_docdir
configure: rename $confdir to $qemu_confdir

Then create_config gets ready for config-host.mak variable renames (Qemu-specific directories will now have a "qemu_" prefix):

create_config: separate section for qemu_*dir variables

Then, variables are renamed on config-host.mak and Makefiles:

  config-host.mak: rename datadir to qemu_datadir
  config-host.mak: rename confdir to qemu_confdir
  Makefile: use $(qemu_confdir) instead of $(sysconfdir)/qemu
  config-host.mak: rename docdir to qemu_docdir
  config-host.mak: remove CONFIG_QEMU_SHAREDIR
  config-host.mak: reorder variables a bit

Then old code on create_config is removed:

create_config: remove *dir block
create_config: simplify prefix=* block, remove CONFIG_QEMU_PREFIX

Finally, the user-visible changes:

configure: change meaning of --datadir to Autoconf convention
configure: add --confsuffix option

Eduardo Habkost (14):
configure: rename $datadir to $qemu_datadir
configure: rename $docdir to $qemu_docdir
configure: rename $confdir to $qemu_confdir
create_config: separate section for qemu_*dir variables config-host.mak: rename datadir to qemu_datadir config-host.mak: rename confdir to qemu_confdir
Makefile: use $(qemu_confdir) instead of $(sysconfdir)/qemu config-host.mak: rename docdir to qemu_docdir config-host.mak: remove CONFIG_QEMU_SHAREDIR config-host.mak: reorder variables a bit
create_config: remove *dir block
create_config: simplify prefix=* block, remove CONFIG_QEMU_PREFIX
configure: change meaning of --datadir to Autoconf convention
configure: add --confsuffix option

 Makefile              |   16 ++++++++--------
 Makefile.target       |    4 ++--
 configure             |   29 ++++++++++++++++-------------
 scripts/create_config |    8 ++++++--
 4 files changed, 32 insertions(+), 25 deletions(-)
Signature · 1 line
1.7.3.2
#14 lore raw

Re: [Qemu-devel] [PATCH 13/14] configure: change meaning of --datadir to Autoconf convention

In reply to Eduardo Habkost

Il 30/03/2012 19:33, Eduardo Habkost ha scritto:

Quoted 25 lines

Autoconf uses --datadir for the /usr/share directory, not the program-specific subdirectory inside /usr/share. This changes configure to match autoconf behavior.

Note that this will break compatibility with existing build scripts.

---
 configure |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
configure +1 -1
index 5de58cb..b74efe2 100755
@@ -155,7 +155,7 @@ mingw32="no"
 EXESUF=""
 prefix="/usr/local"
 mandir="\${prefix}/share/man"
-qemu_datadir="\${prefix}/share/qemu"
+datadir="\${prefix}/share"
 qemu_docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"

configure EOF · line 527

Quoted 8 lines
configure +1 -1
@@ -521,7 +521,7 @@ EOF
   fi
   prefix="c:/Program Files/Qemu"
   mandir="\${prefix}"
-  qemu_datadir="\${prefix}"
+  datadir="\${prefix}"
   qemu_docdir="\${prefix}"
   bindir="\${prefix}"
   sysconfdir="\${prefix}"

This does not change anything because the next line is

confsuffix=""

Nice. :)

Paolo

Quoted 26 lines
configure +3 -2
@@ -589,7 +589,7 @@ for opt do
   ;;
   --includedir=*) includedir="$optarg"
   ;;
-  --datadir=*) qemu_datadir="$optarg"
+  --datadir=*) datadir="$optarg"
   ;;
   --docdir=*) qemu_docdir="$optarg"
   ;;
@@ -1007,7 +1007,7 @@ echo "  --python=PYTHON          use specified python [$python]"
 echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
-echo "  --datadir=PATH           install firmware in PATH"
+echo "  --datadir=PATH           install firmware in PATH/qemu"
 echo "  --docdir=PATH            install documentation in PATH"
 echo "  --bindir=PATH            install binaries in PATH"
 echo "  --sysconfdir=PATH        install config in PATH/qemu"
@@ -2831,6 +2831,7 @@ if test "$mingw32" = "yes" ; then
 fi
 
 qemu_confdir=$sysconfdir$confsuffix
+qemu_datadir=$datadir$confsuffix
 
 tools=
 if test "$softmmu" = yes ; then
Reviewed-by on the v1 series
#19 lore raw
In reply to Eduardo Habkost

Il 30/03/2012 19:32, Eduardo Habkost ha scritto:

Quoted 65 lines

This series is the third version of the --confsuffix/--confdir changes I have submitted before. Now it does two interface changes:

- Changes --datadir meaning to match Autoconf convention (meaning that it should point to /usr/share, not /usr/share/qemu).
NOTE: this breaks compatibility.
I don't know of anybody who uses that option today. Neither Fedora, Debian, Arch Linux, Gentoo, or FreeBSD use it[1].
- Add --with-confsuffix option, to allow the /etc/qemu and /usr/share/qemu directories to have a different names.

[1] http://article.gmane.org/gmane.comp.emulators.qemu/142924

Most of the patches are variable renames and cleanups. The actual changes are only on the last 2 patches.

First, internal configure variables are renamed, without changing config-host.mak:

configure: rename $datadir to $qemu_datadir
configure: rename $docdir to $qemu_docdir
configure: rename $confdir to $qemu_confdir

Then create_config gets ready for config-host.mak variable renames (Qemu-specific directories will now have a "qemu_" prefix):

create_config: separate section for qemu_*dir variables

Then, variables are renamed on config-host.mak and Makefiles:

  config-host.mak: rename datadir to qemu_datadir
  config-host.mak: rename confdir to qemu_confdir
  Makefile: use $(qemu_confdir) instead of $(sysconfdir)/qemu
  config-host.mak: rename docdir to qemu_docdir
  config-host.mak: remove CONFIG_QEMU_SHAREDIR
  config-host.mak: reorder variables a bit

Then old code on create_config is removed:

create_config: remove *dir block
create_config: simplify prefix=* block, remove CONFIG_QEMU_PREFIX

Finally, the user-visible changes:

configure: change meaning of --datadir to Autoconf convention
configure: add --confsuffix option

Eduardo Habkost (14):
configure: rename $datadir to $qemu_datadir
configure: rename $docdir to $qemu_docdir
configure: rename $confdir to $qemu_confdir
create_config: separate section for qemu_*dir variables config-host.mak: rename datadir to qemu_datadir config-host.mak: rename confdir to qemu_confdir
Makefile: use $(qemu_confdir) instead of $(sysconfdir)/qemu config-host.mak: rename docdir to qemu_docdir config-host.mak: remove CONFIG_QEMU_SHAREDIR config-host.mak: reorder variables a bit
create_config: remove *dir block
create_config: simplify prefix=* block, remove CONFIG_QEMU_PREFIX
configure: change meaning of --datadir to Autoconf convention
configure: add --confsuffix option

Quoted 6 lines
 Makefile              |   16 ++++++++--------
 Makefile.target       |    4 ++--
 configure             |   29 ++++++++++++++++-------------
 scripts/create_config |    8 ++++++--
 4 files changed, 32 insertions(+), 25 deletions(-)
#17 lore raw

Re: [Qemu-devel] [PATCH 14/14] configure: add --confsuffix option

In reply to Eduardo Habkost

Il 30/03/2012 19:33, Eduardo Habkost ha scritto:

Quoted 26 lines

This will allow the user to make Qemu use a different subdirectory name inside $datadir and $sysconfdir, instead of "/qemu".

---
 configure |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
configure +2 -1
index b74efe2..e56c569 100755
@@ -591,6 +591,8 @@ for opt do
   ;;
   --datadir=*) datadir="$optarg"
   ;;
+  --with-confsuffix=*) confsuffix="$optarg"
+  ;;
   --docdir=*) qemu_docdir="$optarg"
   ;;
   --sysconfdir=*) sysconfdir="$optarg"
@@ -1007,10 +1009,11 @@ echo "  --python=PYTHON          use specified python [$python]"
 echo "  --smbd=SMBD              use specified smbd [$smbd]"
 echo "  --static                 enable static build [$static]"
 echo "  --mandir=PATH            install man pages in PATH"
-echo "  --datadir=PATH           install firmware in PATH/qemu"

configure echo " --python=PYTHON use specified python [$python]" · line 1019

Quoted 10 lines
configure +4 -2
-echo "  --docdir=PATH            install documentation in PATH"
+echo "  --datadir=PATH           install firmware in PATH$confsuffix"
+echo "  --docdir=PATH            install documentation in PATH$confsuffix"
 echo "  --bindir=PATH            install binaries in PATH"
-echo "  --sysconfdir=PATH        install config in PATH/qemu"
+echo "  --sysconfdir=PATH        install config in PATH$confsuffix"
+echo "  --with-confsuffix=SUFFIX      suffix for Qemu data inside datadir and sysconfdir [$confsuffix]"
 echo "  --enable-debug-tcg       enable TCG debugging"
 echo "  --disable-debug-tcg      disable TCG debugging (default)"
 echo "  --enable-debug           enable common debug build options"

The subject was not adjusted, perhaps you can send a v2 of this patch only?

Paolo

#18 lore raw

Re: [Qemu-devel] [PATCH 14/14] configure: add --confsuffix option

Quoted 1 line · Paolo Bonzini

Il 30/03/2012 19:33, Eduardo Habkost ha scritto:

[...]

Quoted 8 lines

configure echo " --python=PYTHON use specified python [$python]" · line 1019

Quoted 6 lines
configure +2 -1
-echo "  --sysconfdir=PATH        install config in PATH/qemu"
+echo "  --sysconfdir=PATH        install config in PATH$confsuffix"
+echo "  --with-confsuffix=SUFFIX      suffix for Qemu data inside datadir and sysconfdir [$confsuffix]"
 echo "  --enable-debug-tcg       enable TCG debugging"
 echo "  --disable-debug-tcg      disable TCG debugging (default)"
 echo "  --enable-debug           enable common debug build options"

The subject was not adjusted, perhaps you can send a v2 of this patch only?

Yes, I will do.

Signature · 1 line
Eduardo
#15 lore raw

Re: [Qemu-devel] [PATCH 13/14] configure: change meaning of --datadir to Autoconf convention

In reply to Paolo Bonzini
Quoted 37 lines · Paolo Bonzini

Il 30/03/2012 19:33, Eduardo Habkost ha scritto:

Quoted 25 lines

Autoconf uses --datadir for the /usr/share directory, not the program-specific subdirectory inside /usr/share. This changes configure to match autoconf behavior.

Note that this will break compatibility with existing build scripts.

---
 configure |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
configure +1 -1
index 5de58cb..b74efe2 100755
@@ -155,7 +155,7 @@ mingw32="no"
 EXESUF=""
 prefix="/usr/local"
 mandir="\${prefix}/share/man"
-qemu_datadir="\${prefix}/share/qemu"
+datadir="\${prefix}/share"
 qemu_docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"

configure EOF · line 527

Quoted 8 lines
configure +1 -1
@@ -521,7 +521,7 @@ EOF
   fi
   prefix="c:/Program Files/Qemu"
   mandir="\${prefix}"
-  qemu_datadir="\${prefix}"
+  datadir="\${prefix}"
   qemu_docdir="\${prefix}"
   bindir="\${prefix}"
   sysconfdir="\${prefix}"

This does not change anything because the next line is

Quoted 3 lines

confsuffix=""

Nice. :)

Yes, in the case of mingw32 it does not change anything. The change above is only necessary because qemu_datadir is now set later, at:

[...]

Quoted 8 lines
Quoted 8 lines
configure +1 -0
@@ -2831,6 +2831,7 @@ if test "$mingw32" = "yes" ; then
 fi
 
 qemu_confdir=$sysconfdir$confsuffix
+qemu_datadir=$datadir$confsuffix
 
 tools=
 if test "$softmmu" = yes ; then
Signature · 1 line
Eduardo