Code

patches: Added CXXFLAGS.dpatch to remove -O3 from CXXFLAGS.
[pkg-pfstmo.git] / debian / patches / CXXFLAGS.dpatch
diff --git a/debian/patches/CXXFLAGS.dpatch b/debian/patches/CXXFLAGS.dpatch
new file mode 100755 (executable)
index 0000000..aafb391
--- /dev/null
@@ -0,0 +1,45 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## CXXFLAGS.dpatch by Sebastian Harl <tokkee@debian.org>
+##
+## DP: Remove -O3 from CXXFLAGS.
+
+@DPATCH@
+
+diff a/configure b/configure
+--- a/configure
++++ b/configure
+@@ -19378,8 +19378,6 @@ fi
+ # Check whether --enable-debug was given.
+ if test "${enable_debug+set}" = set; then
+   enableval=$enable_debug; if test "$enable_debug" = "yes" ; then
+-                     temp_CXXFLAGS=`echo $CXXFLAGS | sed "s/-O./ /; s/-g//"`
+-                   CXXFLAGS="-g $temp_CXXFLAGS"
+                    cat >>confdefs.h <<\_ACEOF
+ #define DEBUG 1
+ _ACEOF
+@@ -19387,8 +19385,6 @@ _ACEOF
+                 fi
+ else
+   enable_debug="no"
+-                     temp_CXXFLAGS=`echo $CXXFLAGS | sed "s/-O./ /; s/-g//"`
+-                   CXXFLAGS="-O3 $temp_CXXFLAGS"
+ cat >>confdefs.h <<\_ACEOF
+ #define NDEBUG 1
+diff a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -37,13 +37,9 @@ AC_ARG_ENABLE(debug,
+               AC_HELP_STRING([--enable-debug],
+                                [Enable debug symbols and asserts]),
+                [if test "$enable_debug" = "yes" ; then
+-                     temp_CXXFLAGS=`echo $CXXFLAGS | sed "s/-O./ /; s/-g//"`
+-                   CXXFLAGS="-g $temp_CXXFLAGS"
+                    AC_DEFINE([DEBUG])
+                 fi],
+                   [enable_debug="no"
+-                     temp_CXXFLAGS=`echo $CXXFLAGS | sed "s/-O./ /; s/-g//"`
+-                   CXXFLAGS="-O3 $temp_CXXFLAGS"
+                      AC_DEFINE(NDEBUG, 1, [Disable assertion checks])