Skip to contentSkip to conversation

First batch of configure cleanups

PATCH In review Paolo Bonzini 3 participants 11 messages Dec 17, 2020

lore
Share & tools
lore
#0 lore raw

cover First batch of configure cleanups

After the Meson cleanups from yesterday, here are some small improvements to configure, mostly removing obsolete code.

Paolo

Paolo Bonzini (4):
configure: remove useless code to check for Xen PCI passthrough
configure: remove variable bogus_os
configure: accept --enable-slirp
configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION

 configure  | 27 +++------------------------
 version.rc |  4 ++--
 2 files changed, 5 insertions(+), 26 deletions(-)
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/4 configure: remove useless code to check for Xen PCI passthrough

meson.build is already doing the same check, so remove it from configure.

---
 configure | 12 ------------
 1 file changed, 12 deletions(-)
configure +0 -12
index 708cf365f0..085a5ad7ff 100755
@@ -2879,18 +2879,6 @@ EOF
   fi
 fi
 
-if test "$xen_pci_passthrough" != "disabled"; then
-  if test "$xen" = "enabled" && test "$linux" = "yes"; then
-    xen_pci_passthrough=enabled
-  else
-    if test "$xen_pci_passthrough" = "enabled"; then
-      error_exit "User requested feature Xen PCI Passthrough" \
-          " but this feature requires /sys from Linux"
-    fi
-    xen_pci_passthrough=disabled
-  fi
-fi
-
 ##########################################
 # X11 probe
 if $pkg_config --exists "x11"; then
Signature · 1 line
2.29.2
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] configure: remove useless code to check for Xen PCI passthrough

Quoted 5 lines · Paolo Bonzini

meson.build is already doing the same check, so remove it from configure.

---

Quoted 32 lines
 configure | 12 ------------
 1 file changed, 12 deletions(-)
configure +0 -13
index 708cf365f0..085a5ad7ff 100755
@@ -2879,18 +2879,6 @@ EOF
   fi
 fi
 
-if test "$xen_pci_passthrough" != "disabled"; then
-  if test "$xen" = "enabled" && test "$linux" = "yes"; then
-    xen_pci_passthrough=enabled
-  else
-    if test "$xen_pci_passthrough" = "enabled"; then
-      error_exit "User requested feature Xen PCI Passthrough" \
-          " but this feature requires /sys from Linux"
-    fi
-    xen_pci_passthrough=disabled
-  fi
-fi
-
 ##########################################
 # X11 probe
 if $pkg_config --exists "x11"; then
--

2.29.2

Signature · 1 line
Marc-André Lureau
#3 lore raw

PATCH 2/4 configure: remove variable bogus_os

In reply to Paolo Bonzini

The condition can be tested also from $targetos, clean up.

---
 configure | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
configure +1 -3
index 085a5ad7ff..18af8207d9 100755
@@ -467,7 +467,6 @@ gettext="auto"
 fuse="auto"
 fuse_lseek="auto"
 
-bogus_os="no"
 malloc_trim="auto"
 
 # parse CC options second
@@ -620,7 +619,6 @@ else
   # might be going to just print the --help text, or it might
   # be the result of a missing compiler.
   targetos='bogus'
-  bogus_os='yes'
 fi
 
 # Some host OSes need non-standard checks for which CPU to use.
@@ -2016,7 +2014,7 @@ if test -z "$werror" ; then
     fi
 fi
 
-if test "$bogus_os" = "yes"; then
+if test "$targetos" = "bogus"; then
     # Now that we know that we're not printing the help and that
     # the compiler works (so the results of the check_defines we used
     # to identify the OS are reliable), if we didn't recognize the
Signature · 1 line
2.29.2
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH 2/4] configure: remove variable bogus_os

Quoted 29 lines · Paolo Bonzini

The condition can be tested also from $targetos, clean up.

---
 configure | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
configure +0 -2
index 085a5ad7ff..18af8207d9 100755
@@ -467,7 +467,6 @@ gettext="auto"
 fuse="auto"
 fuse_lseek="auto"
 
-bogus_os="no"
 malloc_trim="auto"
 
 # parse CC options second
@@ -620,7 +619,6 @@ else
   # might be going to just print the --help text, or it might
   # be the result of a missing compiler.
   targetos='bogus'
-  bogus_os='yes'
 fi
 
 # Some host OSes need non-standard checks for which CPU to use.

configure if test -z "$werror" ; then · line 2020

Quoted 8 lines
configure +1 -1
@@ -2016,7 +2014,7 @@ if test -z "$werror" ; then
     fi
 fi
 
-if test "$bogus_os" = "yes"; then
+if test "$targetos" = "bogus"; then
     # Now that we know that we're not printing the help and that
     # the compiler works (so the results of the check_defines we used
     # to identify the OS are reliable), if we didn't recognize the
Reviewed-by on v1 2/4
#5 lore raw

Re: [PATCH 2/4] configure: remove variable bogus_os

In reply to Paolo Bonzini
Quoted 4 lines · Paolo Bonzini

The condition can be tested also from $targetos, clean up.

---

Quoted 38 lines
 configure | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
configure +1 -4
index 085a5ad7ff..18af8207d9 100755
@@ -467,7 +467,6 @@ gettext="auto"
 fuse="auto"
 fuse_lseek="auto"
 
-bogus_os="no"
 malloc_trim="auto"
 
 # parse CC options second
@@ -620,7 +619,6 @@ else
   # might be going to just print the --help text, or it might
   # be the result of a missing compiler.
   targetos='bogus'
-  bogus_os='yes'
 fi
 
 # Some host OSes need non-standard checks for which CPU to use.
@@ -2016,7 +2014,7 @@ if test -z "$werror" ; then
     fi
 fi
 
-if test "$bogus_os" = "yes"; then
+if test "$targetos" = "bogus"; then
     # Now that we know that we're not printing the help and that
     # the compiler works (so the results of the check_defines we used
     # to identify the OS are reliable), if we didn't recognize the
--

2.29.2

Signature · 1 line
Marc-André Lureau
#6 lore raw

PATCH 3/4 configure: accept --enable-slirp

In reply to Paolo Bonzini

Meson understands -Dslirp=enabled, so there is no reason not to accept the configure option as well.

---
 configure | 2 ++
 1 file changed, 2 insertions(+)
configure +2 -0
index 18af8207d9..568818e72d 100755
@@ -1083,6 +1083,8 @@ for opt do
   ;;
   --disable-slirp) slirp="disabled"
   ;;
+  --enable-slirp) slirp="enabled"
+  ;;
   --enable-slirp=git) slirp="internal"
   ;;
   --enable-slirp=system) slirp="system"
Signature · 1 line
2.29.2
Reviewed-by on v1 3/4
#7 lore raw

Re: [PATCH 3/4] configure: accept --enable-slirp

Quoted 14 lines · Paolo Bonzini

Meson understands -Dslirp=enabled, so there is no reason not to accept the configure option as well.

---
 configure | 2 ++
 1 file changed, 2 insertions(+)
configure +0 -0
index 18af8207d9..568818e72d 100755

configure for opt do · line 1090

Quoted 8 lines
configure +2 -0
@@ -1083,6 +1083,8 @@ for opt do
   ;;
   --disable-slirp) slirp="disabled"
   ;;
+  --enable-slirp) slirp="enabled"
+  ;;
   --enable-slirp=git) slirp="internal"
   ;;
   --enable-slirp=system) slirp="system"
Reviewed-by on v1 3/4
#8 lore raw

Re: [PATCH 3/4] configure: accept --enable-slirp

In reply to Paolo Bonzini
Quoted 5 lines · Paolo Bonzini

Meson understands -Dslirp=enabled, so there is no reason not to accept the configure option as well.

---

Quoted 22 lines
 configure | 2 ++
 1 file changed, 2 insertions(+)
configure +2 -1
index 18af8207d9..568818e72d 100755
@@ -1083,6 +1083,8 @@ for opt do
   ;;
   --disable-slirp) slirp="disabled"
   ;;
+  --enable-slirp) slirp="enabled"
+  ;;
   --enable-slirp=git) slirp="internal"
   ;;
   --enable-slirp=system) slirp="system"
--

2.29.2

Signature · 1 line
Marc-André Lureau
#9 lore raw

PATCH 4/4 configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION

In reply to Paolo Bonzini

version.rc can just use existing preprocessor symbols.

---
 configure  | 9 ---------
 version.rc | 4 ++--
 2 files changed, 2 insertions(+), 11 deletions(-)
configure +0 -9
index 568818e72d..74eebfd692 100755
@@ -5929,15 +5929,6 @@ if test "$bigendian" = "yes" ; then
 fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
-  rc_version=$(cat $source_path/VERSION)
-  version_major=${rc_version%%.*}
-  rc_version=${rc_version#*.}
-  version_minor=${rc_version%%.*}
-  rc_version=${rc_version#*.}
-  version_subminor=${rc_version%%.*}
-  version_micro=0
-  echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
-  echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
   if test "$guest_agent_with_vss" = "yes" ; then
     echo "CONFIG_QGA_VSS=y" >> $config_host_mak
     echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak
version.rc +2 -2
index d8e1569991..0daadbf981 100644
@@ -2,8 +2,8 @@
 #include "config-host.h"
 
 VS_VERSION_INFO VERSIONINFO
-FILEVERSION CONFIG_FILEVERSION
-PRODUCTVERSION CONFIG_PRODUCTVERSION
+FILEVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0
+PRODUCTVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0
 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
 FILEOS VOS_NT_WINDOWS32
 FILETYPE VFT_APP
Signature · 1 line
2.29.2
Reviewed-by on v1 4/4
#10 lore raw

Re: [PATCH 4/4] configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION

Quoted 4 lines · Paolo Bonzini

version.rc can just use existing preprocessor symbols.

---

Quoted 46 lines
 configure  | 9 ---------
 version.rc | 4 ++--
 2 files changed, 2 insertions(+), 11 deletions(-)
configure +0 -8
index 568818e72d..74eebfd692 100755
@@ -5929,15 +5929,6 @@ if test "$bigendian" = "yes" ; then
 fi
 if test "$mingw32" = "yes" ; then
   echo "CONFIG_WIN32=y" >> $config_host_mak
-  rc_version=$(cat $source_path/VERSION)
-  version_major=${rc_version%%.*}
-  rc_version=${rc_version#*.}
-  version_minor=${rc_version%%.*}
-  rc_version=${rc_version#*.}
-  version_subminor=${rc_version%%.*}
-  version_micro=0
-  echo

"CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro"

Quoted 1 line
Quoted 1 line

$config_host_mak

- echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro"

Quoted 1 line
Quoted 1 line

$config_host_mak

if test "$guest_agent_with_vss" = "yes" ; then
echo "CONFIG_QGA_VSS=y" >> $config_host_mak
echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak

version.rc +2 -3
index d8e1569991..0daadbf981 100644
@@ -2,8 +2,8 @@
 #include "config-host.h"
 
 VS_VERSION_INFO VERSIONINFO
-FILEVERSION CONFIG_FILEVERSION
-PRODUCTVERSION CONFIG_PRODUCTVERSION
+FILEVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0
+PRODUCTVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0
 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
 FILEOS VOS_NT_WINDOWS32
 FILETYPE VFT_APP
--

2.29.2

Signature · 1 line
Marc-André Lureau