Bug#312250: Setting DEB_CONFIGURE_SCRIPT_ENV overwrites default CFLAGS

Michael Banck Michael Banck <mbanck@debian.org>, 312250@bugs.debian.org
Mon, 6 Jun 2005 19:58:16 +0200


--gKMricLos+KVdGMg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: gamin
Severity: normal
Version: 0.0.26-1
Tags: patch

Hi,

I was wondering why setting DEB_BUILD_OPTIONS=noopt does not work with
gamin and looked around a bit in CDBS.  It turned out that debian/rules
has this bit:

DEB_CONFIGURE_SCRIPT_ENV := LDFLAGS="-Wl,-O1"

However, DEB_CONFIGURE_SCRIPT_ENV usually holds the default variables,
like CFLAGS; CXXFLAGS and so on (from 1/class/autotools-vars.mk):

DEB_CONFIGURE_SCRIPT_ENV = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)"
CXXFLAGS="$(CXXFLAGS)"

which get overwritten and later not set anymore currently:

if test ""; then cd ""; else cd "."; fi && LDFLAGS="-Wl,-O1"
/build/mbanck/gamin-0.0.26/./configure

Thus, I propose to not use the := operator, but rather += which should
simply append LDFLAGS to the others.  This leads to the desired effect:

if test ""; then cd ""; else cd "."; fi && CC="cc" CXX="g++" CFLAGS="-g
-Wall -O2" CXXFLAGS="-g -Wall -O2" LDFLAGS="-Wl,-O1"
/build/mbanck/gamin-0.0.26/./configure


trivial patch attached.

cheers,

Michael

--gKMricLos+KVdGMg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gamin.rules.diff"

--- debian/rules.orig	2005-06-06 21:56:10.000000000 +0200
+++ debian/rules	2005-06-06 19:48:24.000000000 +0200
@@ -8,7 +8,7 @@
 include /usr/share/cdbs/1/class/gnome.mk
 
 DEB_CONFIGURE_EXTRA_FLAGS := --disable-inotify
-DEB_CONFIGURE_SCRIPT_ENV := LDFLAGS="-Wl,-O1"
+DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS="-Wl,-O1"
 
 DEB_INSTALL_DOCS_ALL :=
 DEB_INSTALL_DOCS_gamin := AUTHORS NEWS README TODO

--gKMricLos+KVdGMg--