[Build-common-hackers] Bug#205743: marked as done (cdbs: shouldn't clobber CFLAGS in makefile)

Debian Bug Tracking System owner@bugs.debian.org
Sat, 16 Aug 2003 18:03:10 -0500


Your message dated Sat, 16 Aug 2003 18:52:15 -0400
with message-id <1061074335.20740.9.camel@columbia>
and subject line [Build-common-hackers] Bug#205743: cdbs: shouldn't clobber CFLAGS in makefile
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 16 Aug 2003 20:32:21 +0000
>From dilinger@voxel.net Sat Aug 16 15:32:16 2003
Return-path: <dilinger@voxel.net>
Received: from hq.voxel.net (wax) [66.109.37.2] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19o7ih-0003Gn-00; Sat, 16 Aug 2003 15:32:15 -0500
Received: by wax (Postfix, from userid 1000)
	id 8D1622077D; Sat, 16 Aug 2003 16:32:14 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Andres Salomon <dilinger@voxel.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: cdbs: shouldn't clobber CFLAGS in makefile
X-Mailer: reportbug 2.22
Date: Sat, 16 Aug 2003 16:32:14 -0400
Message-Id: <20030816203214.8D1622077D@wax>
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0
	tests=BAYES_01,HAS_PACKAGE
	version=2.53-bugs.debian.org_2003_8_15
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_8_15 (1.174.2.15-2003-03-30-exp)

Package: cdbs
Version: 0.4.5.2
Severity: normal

I'm attempting to convert keepalived to cdbs; however, it would appear that
the autotools.mk rules expect automake to be used.  Keepalived uses only
autoconf; in one of its Makefile.in's, it contains the following:

CC   = @CC@
INCLUDES = -I../include -I../../lib
CFLAGS   = @CFLAGS@ $(INCLUDES) \
       -Wall -Wunused -Wstrict-prototypes
DEFS     = -D@KERN@ -D@IPVS_SUPPORT@ -D@VRRP_SUPPORT@ @DFLAGS@
COMPILE  = $(CC) $(CFLAGS) $(DEFS)

.c.o:
    $(COMPILE) -c $<

When using a rules file similar to:

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
DEB_CONFIGURE_EXTRA_FLAGS := --with-kernel-dir=$(CURDIR)/debian

the CFLAGS in the makefile gets clobbered.  It's set correctly during
configuration; the resulting Makefile contains:

CFLAGS   = -g -Wall -O2 -I/home/dilinger/keepalived-1.0.3/debian/include $(INCLUDES) \
       -Wall -Wunused -Wstrict-prototypes

Unfortunately, DEB_MAKE_INVOKE appears to expect automake to have put
upstream CFLAGS into CFLAGS_<pkg>, and clobbers CFLAGS.  If I rename
the CFLAGS variable in Makefile.in to CFLAGS_keepalived, it allows keepalived
to compile, but this really shouldn't be necessary.




-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux wax 2.4.21 #1 Wed Jul 9 14:15:24 EDT 2003 i686
Locale: LANG=C, LC_CTYPE=C

-- no debconf information


---------------------------------------
Received: (at 205743-done) by bugs.debian.org; 16 Aug 2003 22:55:05 +0000
>From walters@verbum.org Sat Aug 16 17:55:02 2003
Return-path: <walters@verbum.org>
Received: from monk.debian.net (monk.verbum.org) [216.226.142.128] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19o9ws-0004QZ-00; Sat, 16 Aug 2003 17:55:02 -0500
Received: from columbia (dhcp024-208-189-249.columbus.rr.com [24.208.189.249])
	(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
	(Client CN "columbia.verbum.org", Issuer "verbum.org CA" (verified OK))
	by monk.verbum.org (Postfix (Debian/GNU)) with ESMTP id 8E84132A6BB
	for <205743-done@bugs.debian.org>; Sat, 16 Aug 2003 18:56:19 -0400 (EDT)
Received: by columbia (Postfix, from userid 1000)
	id DD25626F0CD; Sat, 16 Aug 2003 18:52:15 -0400 (EDT)
Subject: Re: [Build-common-hackers] Bug#205743: cdbs: shouldn't clobber
	CFLAGS in makefile
From: Colin Walters <walters@verbum.org>
To: 205743-done@bugs.debian.org
In-Reply-To: <20030816203214.8D1622077D@wax>
References: <20030816203214.8D1622077D@wax>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Message-Id: <1061074335.20740.9.camel@columbia>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.4 
Date: Sat, 16 Aug 2003 18:52:15 -0400
Delivered-To: 205743-done@bugs.debian.org
X-Spam-Status: No, hits=-11.3 required=4.0
	tests=BAYES_30,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES,
	      REPLY_WITH_QUOTES,USER_AGENT_XIMIAN
	autolearn=ham version=2.53-bugs.debian.org_2003_8_15
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_8_15 (1.174.2.15-2003-03-30-exp)

On Sat, 2003-08-16 at 16:32, Andres Salomon wrote:
> Package: cdbs
> Version: 0.4.5.2
> Severity: normal
> 
> I'm attempting to convert keepalived to cdbs; however, it would appear that
> the autotools.mk rules expect automake to be used. 

Right.

[...]

> the CFLAGS in the makefile gets clobbered.  

In my opinion, this is upstream's bug.  The autotools.mk was designed to
use CFLAGS.  Users should always be able to set CFLAGS to whatever they
want, and not have to worry about breaking the package's internal build
system (-Ifoo) when they do.

Here is a better Makefile.in:

CC   = @CC@
INCLUDES = -I../include -I../../lib
CFLAGS   = -Wall -Wunused -Wstrict-prototypes
DEFS     = -D@KERN@ -D@IPVS_SUPPORT@ -D@VRRP_SUPPORT@ @DFLAGS@
COMPILE  = $(CC) $(CFLAGS) $(KEEPALIVED_CFLAGS) $(INCLUDES) $(DEFS)

.c.o:
    $(COMPILE) -c $<

Also to use this, your upstream should change their configure.in to not
add -I things to CFLAGS; instead, put them in KEEPALIVED_CFLAGS, and
subst that.

I hope that helps!