Patchwork [1/2] Better support for distros using /lib64 directories

login
register
mail settings
Submitter Saggi Mizrahi
Date Oct. 30, 2011, 4:51 p.m.
Message ID <1319993519-865-1-git-send-email-smizrahi@redhat.com>
Download mbox | patch
Permalink /patch/122650/
State New
Headers show

Comments

Saggi Mizrahi - Oct. 30, 2011, 4:51 p.m.
Some distributions use lib64 directories for 64 bit libraries. Currently
configure would always generate libdir as $PREFIX/lib. By checking if
the current distro has a /lib64 directory we can assume it is using this
convention.

Signed-off-by: Saggi Mizrahi <smizrahi@redhat.com>
---
 configure |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Paolo Bonzini - Oct. 31, 2011, 10:04 a.m.
On 10/30/2011 05:51 PM, Saggi Mizrahi wrote:
> Some distributions use lib64 directories for 64 bit libraries. Currently
> configure would always generate libdir as $PREFIX/lib. By checking if
> the current distro has a /lib64 directory we can assume it is using this
> convention.

This doesn't work if people compile a 32-bit version of QEMU.  The right 
directory could be obtained with "gcc --print-multi-os-directory 
$CFLAGS", but I'm not sure whether it is a good thing to do.  We should 
try to avoid gratuitous differences from Autoconf.

The right thing to do would be to tweak the command-line supported by 
configure to the point that packagers can just use the same command-line 
that Autoconf uses (in RPM parlance that would be "%configure").

Paolo

Patch

diff --git a/configure b/configure
index 4f87e0a..d361e91 100755
--- a/configure
+++ b/configure
@@ -147,6 +147,9 @@  datadir="\${prefix}/share/qemu"
 docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"
+if [ -d /lib64 ]; then
+libdir="\${prefix}/lib64"
+fi
 includedir="\${prefix}/include"
 sysconfdir="\${prefix}/etc"
 confsuffix="/qemu"