[Build-common-hackers] Bug#523642: overrides CFLAGS too agressively

Robert Millan rmh.debian.bts at aybabtu.com
Sat Apr 11 15:35:26 UTC 2009


Package: cdbs
Version: 0.4.52
Severity: important
Tags: patch

CFLAGS are overriden too agressively.  Some packages have very specific
requirements when it comes to CFLAGS, and its upstream Makefiles will
know better.  If CFLAGS is important for them, they can do things like:

  # we want -foo and nothing else!
  CFLAGS := -foo

or

  # we absolutely need -foo, but other flags could be fine
  CFLAGS += -foo

or

  # -foo is nice, but maybe the user has another idea in mind
  CFLAGS ?= -foo

Passing CFLAGS as argument makes it cumbersome to override, and removes
this flexibility (either we override or we don't).  I think it's much
better to pass those as environment variables.

-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cdbs depends on:
ii  debhelper                     7.0.15     helper programs for debian/rules

Versions of packages cdbs recommends:
ii  autotools-dev                 20080123.1 Update infrastructure for config.{

Versions of packages cdbs suggests:
ii  devscripts                 2.10.35lenny3 scripts to make the life of a Debi
pn  doc-base                   <none>        (no description available)

-- no debconf information
-------------- next part --------------
--- /usr/share/cdbs/1/class/makefile-vars.mk	2008-04-01 17:51:40.000000000 +0800
+++ debian/makefile-vars.mk	2009-04-11 23:14:32.000000000 +0800
@@ -27,8 +27,8 @@
 include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
 
 DEB_MAKE_MAKEFILE =
-DEB_MAKE_ENVVARS = 
-DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(MAKE) $(if $(DEB_MAKE_MAKEFILE), -f $(DEB_MAKE_MAKEFILE),) -C $(DEB_BUILDDIR) CFLAGS=$(if $(CFLAGS_$(cdbs_curpkg)),"$(CFLAGS_$(cdbs_curpkg))","$(CFLAGS)") CXXFLAGS=$(if $(CXXFLAGS_$(cdbs_curpkg)),"$(CXXFLAGS_$(cdbs_curpkg))","$(CXXFLAGS)") CPPFLAGS=$(if $(CPPFLAGS_$(cdbs_curpkg)),"$(CPPFLAGS_$(cdbs_curpkg))","$(CPPFLAGS)") LDFLAGS=$(if $(LDFLAGS_$(cdbs_curpkg)),"$(LDFLAGS_$(cdbs_curpkg))","$(LDFLAGS)") 
+DEB_MAKE_ENVVARS += CFLAGS=$(if $(CFLAGS_$(cdbs_curpkg)),"$(CFLAGS_$(cdbs_curpkg))","$(CFLAGS)") CXXFLAGS=$(if $(CXXFLAGS_$(cdbs_curpkg)),"$(CXXFLAGS_$(cdbs_curpkg))","$(CXXFLAGS)") CPPFLAGS=$(if $(CPPFLAGS_$(cdbs_curpkg)),"$(CPPFLAGS_$(cdbs_curpkg))","$(CPPFLAGS)") LDFLAGS=$(if $(LDFLAGS_$(cdbs_curpkg)),"$(LDFLAGS_$(cdbs_curpkg))","$(LDFLAGS)")
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(MAKE) $(if $(DEB_MAKE_MAKEFILE), -f $(DEB_MAKE_MAKEFILE),) -C $(DEB_BUILDDIR) 
 
 # This variable is deprecated.
 DEB_BUILD_MAKE_TARGET = 


More information about the Build-common-hackers mailing list