Introduce an option to disable stripping during installation 87/1787/1
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 14 Sep 2012 14:04:59 +0000 (16:04 +0200)
committerThiago Macieira <thiago.macieira@intel.com>
Wed, 19 Sep 2012 10:10:06 +0000 (12:10 +0200)
The default is the current behaviour: strip on installing release, no
strip on installing debug. This option does not change the
installation of debug builds because qmake does not support that.

Change-Id: Ic208d5ffe860d5f1ee1cafdc944e12001673d33f
(cherry picked from commit 0de43851f519e44ddf47f026de6169c581d4df17)

configure
tools/configure/configureapp.cpp

index 7a72ba7..451c381 100755 (executable)
--- a/configure
+++ b/configure
@@ -745,6 +745,7 @@ MIN_DBUS_1_VERSION=0.93
 # initalize internal variables
 CFG_CONFIGURE_EXIT_ON_ERROR=yes
 CFG_PROFILE=no
+CFG_STRIP=yes
 CFG_GUI=auto # (yes|no|auto)
 CFG_WIDGETS=yes
 CFG_QCONFIG=full
@@ -1305,6 +1306,13 @@ while [ "$#" -gt 0 ]; do
             UNKNOWN_OPT=yes
         fi
         ;;
+    strip)
+        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+            CFG_STRIP=$VAL
+        else
+            UNKNOWN_OPT=yes
+        fi
+        ;;
     testcocoon)
         if [ "$VAL" = "yes" ]; then
             QTCONFIG_CONFIG="$QTCONFIG_CONFIG testcocoon"
@@ -3207,6 +3215,9 @@ Additional options:
  $CIN  -no-iconv .......... Do not compile support for iconv(3).
  $CIY  -iconv ............. Compile support for iconv(3).
 
+    -no-strip .......... Do not strip binaries and libraries of unneeded symbols.
+ *  -strip ............. Strip binaries and libraries of unneeded symbols when installing.
+
  $PHN  -no-pch ............ Do not use precompiled header support.
  $PHY  -pch ............... Use precompiled header support.
 
@@ -5323,6 +5334,7 @@ if [ "$CFG_USE_GNUMAKE" = "yes" ]; then
 fi
 [ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
 [ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
+[ "$CFG_STRIP" = "no" ] && QMAKE_CONFIG="$QMAKE_CONFIG nostrip"
 [ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
 if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
     QMakeVar add QMAKE_CFLAGS -g
index 7fc1c62..3a8c266 100644 (file)
@@ -210,6 +210,7 @@ Configure::Configure(int& argc, char** argv)
     dictionary[ "PROCESS" ]         = "partial";
     dictionary[ "WIDGETS" ]         = "yes";
     dictionary[ "RTTI" ]            = "yes";
+    dictionary[ "STRIP" ]           = "yes";
     dictionary[ "SSE2" ]            = "auto";
     dictionary[ "SSE3" ]            = "auto";
     dictionary[ "SSSE3" ]           = "auto";
@@ -814,6 +815,11 @@ void Configure::parseCmdLine()
         else if (configCmdLine.at(i) == "-no-rtti")
             dictionary[ "RTTI" ] = "no";
 
+        else if (configCmdLine.at(i) == "-strip")
+            dictionary[ "STRIP" ] = "yes";
+        else if (configCmdLine.at(i) == "-no-strip")
+            dictionary[ "STRIP" ] = "no";
+
         else if (configCmdLine.at(i) == "-accessibility")
             dictionary[ "ACCESSIBILITY" ] = "yes";
         else if (configCmdLine.at(i) == "-no-accessibility") {
@@ -1743,7 +1749,10 @@ bool Configure::displayHelp()
         desc("PROCESS", "no", "-dont-process",          "Do not generate Makefiles/Project files. This will override -no-fast if specified.");
 
         desc("RTTI", "no",      "-no-rtti",             "Do not compile runtime type information.");
-        desc("RTTI", "yes",     "-rtti",                "Compile runtime type information.\n");
+        desc("RTTI", "yes",     "-rtti",                "Compile runtime type information.");
+        desc("STRIP", "no",     "-no-strip",            "Do not strip libraries and executables of debug info when installing.");
+        desc("STRIP", "yes",    "-strip",               "Strip libraries and executables of debug info when installing.\n");
+
         desc("SSE2", "no",      "-no-sse2",             "Do not compile with use of SSE2 instructions");
         desc("SSE2", "yes",     "-sse2",                "Compile with use of SSE2 instructions");
         desc("SSE3", "no",      "-no-sse3",             "Do not compile with use of SSE3 instructions");
@@ -2693,6 +2702,8 @@ void Configure::generateCachefile()
             moduleStream << " neon";
         if (dictionary[ "LARGE_FILE" ] == "yes")
             moduleStream << " largefile";
+        if (dictionary[ "STRIP" ] == "no")
+            moduleStream << " nostrip";
         moduleStream << endl;
 
         moduleStream.flush();