Code

patches: Added CXXFLAGS.dpatch to remove -O3 from CXXFLAGS.
authorSebastian Harl <sh@tokkee.org>
Wed, 17 Jun 2009 18:35:18 +0000 (20:35 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 17 Jun 2009 18:51:28 +0000 (20:51 +0200)
debian/changelog
debian/control
debian/patches/00list [new file with mode: 0644]
debian/patches/CXXFLAGS.dpatch [new file with mode: 0755]
debian/rules

index 149b7228883e71699756c1fb9a1a700a54b6bdb1..8e3372bba71effff8a7fc99871a32358ab55ebbf 100644 (file)
@@ -7,8 +7,10 @@ pfstmo (1.4-1) unstable; urgency=low
     - Updated standards-version to 3.8.2 - no changes.
   * debian/rules:
     - Pass appropriate CFLAGS and CXXFLAGS to configure.
+  * debian/patches:
+    - Added CXXFLAGS.dpatch to remove -O3 from CXXFLAGS.
 
- -- Sebastian Harl <tokkee@debian.org>  Wed, 17 Jun 2009 19:36:23 +0200
+ -- Sebastian Harl <tokkee@debian.org>  Wed, 17 Jun 2009 20:34:35 +0200
 
 pfstmo (1.1-1) unstable; urgency=low
 
index 3c1bee970220787c96dd670542eb66aa30cba76d..56148a0d4d3dd8e4126035583fe0b446e6ce7541 100644 (file)
@@ -3,7 +3,7 @@ Section: graphics
 Priority: optional
 Maintainer: Debian PhotoTools Maintainers <pkg-phototools-devel@lists.alioth.debian.org>
 Uploaders: Sebastian Harl <tokkee@debian.org>
-Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.6), autotools-dev, pkg-config, libpfs-dev, fftw3-dev, libgsl0-dev
+Build-Depends: debhelper (>= 5), dpatch, dpkg-dev (>= 1.14.6), autotools-dev, pkg-config, libpfs-dev, fftw3-dev, libgsl0-dev
 Standards-Version: 3.8.2
 Homepage: http://www.mpi-inf.mpg.de/resources/tmo/
 Vcs-Git: git://git.debian.org/git/pkg-phototools/pfstmo.git
diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644 (file)
index 0000000..cee4d00
--- /dev/null
@@ -0,0 +1,2 @@
+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])
index c8625e78510285c23e2e0539f2c37316d54cb398..382daf723d494e5cd0fde8e902adfa82d53d42ff 100755 (executable)
@@ -22,9 +22,15 @@ else
        CXXFLAGS += -O2
 endif
 
-config.status: configure
+include /usr/share/dpatch/dpatch.make
+
+config.status: configure $(DPATCH_STAMPFN)
        dh_testdir
        
+       # do not rebuild the build system
+       touch aclocal.m4 acinclude.m4 configure.ac configure config.h.in \
+               config.status Makefile.am Makefile.in Makefile
+       
        for file in config.guess config.sub; do \
                if [ ! -e $$file.upstream ]; then \
                        mv $$file $$file.upstream; \
@@ -59,6 +65,8 @@ clean:
                fi \
        done
        
+       $(MAKE) -f debian/rules unpatch
+       
        dh_clean
 
 install: build