Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

set CXXFLAGS for dpkg-buildpackage

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
hurryup
Posts: 2
Joined: 2014-10-15 10:41

set CXXFLAGS for dpkg-buildpackage

#1 Post by hurryup »

Could you please explain me how can i set CXXFLAGS from the environment for dpkg-buildpackage.
debian/rules
%:
dh $@
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
I try CFLAGS+="-g -O6" dpkg-buildpackage -us -uc, but I see -g -O2 when package builds.

PeterB
Posts: 123
Joined: 2010-10-03 16:53
Has thanked: 1 time
Been thanked: 2 times

Re: set CXXFLAGS for dpkg-buildpackage

#2 Post by PeterB »

Can't help you much with compiler flags, but in a rules file, the environment stuff must go before the first target. Also the white-space needs to be correctly formatted. Recipes need a single leading tab. Make sure there is a empty/blank line right at the end. Start by trying this instead;

Code: Select all

#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@


User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: set CXXFLAGS for dpkg-buildpackage

#3 Post by stevepusser »

I'm pretty sure you just add to the rules fileL

debian/rules

Code: Select all

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

CXXFLAGS=-g -O6  

%:
dh $@
MX Linux packager and developer

User avatar
slackguy
Posts: 91
Joined: 2014-11-29 03:22

Re: set CXXFLAGS for dpkg-buildpackage

#4 Post by slackguy »

for automake(1) or typical Makefile one can use:

export CXXFLAGS="foo"

(which is used where appropriate not necessarily everywhere)

likely debian should consume the same

Post Reply