On Sun, 03 Mar 2019 06:08:33 +0300 "Arthur D." <spinal...@mail.ru> wrote:
> Package: debhelper
> Version: 10.2.5
> Severity: normal
> 
> Dear Maintainer,
> 

Hi,

Thanks for filing the report.

Unfortunately, we cannot solve the root cause at the moment, so I will
have to point you to a "work around".

In Debian packages using dh, you can use the DEB_<FLAG>_APPEND and
DEB_<FLAG>_STRIP flags to control the value of the <FLAG> (where <FLAG>
is CFLAGS, CPPFLAGS, CXXFLAGS, LDFLAGS, etc.).  Mind you, you will have
to *export* those variables.

So you would  use something like:

"""
ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEB_CPPFLAGS_APPEND += -DG_DEBUG_DISABLE
else
DEB_CFLAGS_APPEND += -O0
endif

export DEB_CPPFLAGS_APPEND
export DEB_CFLAGS_APPEND
"""

(Here I have been "pedantic" and put the -DG_DEBUG_DISABLE in CPPFLAGS
because it looks like an option for the C Pre-processor; though that
assumes the upstream build system respects CPPFLAGS and handles it
correctly)

>     * What led up to the situation?
> 
>       I've written simple debian/rules and added some conditional CFLAGS+=
>       statements. After I ran dpkg-buildpackage I found the flags were not
>       in place.
> 

I suspect you would have seen them if you had exported CFLAGS.  But it
would have neutered all the default flags.

The difference occurs inside an override target because it is a
recursive call to make and the Debian default CFLAGS is already exported
here (making your change to it visible to dh_auto_configure).

> [...]
> 
> I'm not sure why, but with this override_dh_auto_configure it works.
> It's probably needed to document this behaviour or fix it shomehow.
> 
> [...]

Can you tell a bit about where you expected this to be documented?  I.e.
where would you have found it if it had been documented?

Thanks,
~Niels

Reply via email to