Blob Blame History Raw
From: Riku Voipio <riku.voipio@iki.fi>
Subject: [Qemu-devel] [PATCH] Make binary stripping conditional

Currently qemu unconditionally strips binaries on install. This
is a problem for packagers who may want to store/ship debug symbols
of compiled packages for debugging purposes.

Keep stripping as default for the oldtimers and add a
--disable-strip flag to override.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 Makefile        |    2 +-
 Makefile.target |    2 +-
 configure       |    9 ++++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff -urNp qemu-kvm-0.10.4.orig/configure qemu-kvm-0.10.4/configure
--- qemu-kvm-0.10.4.orig/configure	2009-05-12 21:40:25.000000000 +0100
+++ qemu-kvm-0.10.4/configure	2009-05-12 21:42:34.000000000 +0100
@@ -165,6 +165,7 @@ kvm_version() {
 
 gprof="no"
 sparse="no"
+strip_opt="yes"
 bigendian="no"
 mingw32="no"
 EXESUF=""
@@ -416,6 +417,8 @@ for opt do
   ;;
   --disable-sparse) sparse="no"
   ;;
+  --disable-strip) strip_opt="no"
+  ;;
   --disable-vnc-tls) vnc_tls="no"
   ;;
   --disable-vnc-sasl) vnc_sasl="no"
@@ -571,6 +574,7 @@ echo "  --install=INSTALL        use spe
 echo "  --static                 enable static build [$static]"
 echo "  --enable-sparse          enable sparse checker"
 echo "  --disable-sparse         disable sparse checker (default)"
+echo "  --disable-strip          disable stripping binaries"
 echo "  --disable-werror         disable compilation abort on warning"
 echo "  --disable-sdl            disable SDL"
 echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
@@ -1258,6 +1262,7 @@ echo "host big endian   $bigendian"
 echo "target list       $target_list"
 echo "gprof enabled     $gprof"
 echo "sparse enabled    $sparse"
+echo "strip binaries    $strip_opt"
 echo "profiler          $profiler"
 echo "static build      $static"
 echo "-Werror enabled   $werror"
@@ -1334,7 +1339,6 @@ echo "INSTALL=$install" >> $config_mak
 echo "CC=$cc" >> $config_mak
 echo "HOST_CC=$host_cc" >> $config_mak
 echo "AR=$ar" >> $config_mak
-echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
 # XXX: only use CFLAGS and LDFLAGS ?  
 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
 # compilation of dyngen tool (useful for win32 build on Linux host)
@@ -1421,6 +1425,9 @@ if test "$sparse" = "yes" ; then
   echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc"  >> $config_mak
   echo "CFLAGS  += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
 fi
+if test "$strip_opt" = "yes" ; then
+  echo "STRIP_OPT=-s" >> $config_mak
+fi
 if test "$bigendian" = "yes" ; then
   echo "WORDS_BIGENDIAN=yes" >> $config_mak
   echo "#define WORDS_BIGENDIAN 1" >> $config_h
diff -urNp qemu-kvm-0.10.4.orig/configure.orig qemu-kvm-0.10.4/configure.orig
--- qemu-kvm-0.10.4.orig/configure.orig	2009-05-12 21:40:25.000000000 +0100
+++ qemu-kvm-0.10.4/configure.orig	2009-05-12 21:40:25.000000000 +0100
@@ -942,6 +942,21 @@ EOF
 fi
 
 ##########################################
+# fnmatch() probe, used for ACL routines
+fnmatch="no"
+cat > $TMPC << EOF
+#include <fnmatch.h>
+int main(void)
+{
+    fnmatch("foo", "foo", 0);
+    return 0;
+}
+EOF
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+   fnmatch="yes"
+fi
+
+##########################################
 # vde libraries probe
 if test "$vde" = "yes" ; then
   cat > $TMPC << EOF
@@ -1517,6 +1532,9 @@ if test "$vnc_sasl" = "yes" ; then
   echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
   echo "#define CONFIG_VNC_SASL 1" >> $config_h
 fi
+if test "$fnmatch" = "yes" ; then
+  echo "#define HAVE_FNMATCH_H 1" >> $config_h
+fi
 qemu_version=`head $source_path/VERSION`
 echo "VERSION=$qemu_version" >>$config_mak
 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
diff -urNp qemu-kvm-0.10.4.orig/Makefile qemu-kvm-0.10.4/Makefile
--- qemu-kvm-0.10.4.orig/Makefile	2009-05-12 21:40:25.000000000 +0100
+++ qemu-kvm-0.10.4/Makefile	2009-05-12 21:42:34.000000000 +0100
@@ -256,7 +256,7 @@ endif
 install: all $(if $(BUILD_DOCS),install-doc)
 	mkdir -p "$(DESTDIR)$(bindir)"
 ifneq ($(TOOLS),)
-	$(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
+	$(INSTALL) -m 755 $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
 endif
 ifneq ($(BLOBS),)
 	mkdir -p "$(DESTDIR)$(datadir)"