Help!

CDBS DEB_CONFIGURE_SCRIPT_ENV with/versus LDFLAGS/CFLAGS


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> GTK-GNOME RSS
Next:  Totally OutOfDebt Overnight  
Author Message
Loïc
External


Since: Nov 11, 2004
Posts: 471



PostPosted: Wed Dec 06, 2006 11:20 am    Post subject: CDBS DEB_CONFIGURE_SCRIPT_ENV with/versus LDFLAGS/CFLAGS
Archived from groups: linux>debian>maint>gtk>gnome (more info?)

Hi,

(This is not a question, just a two cents trick for people using CDBS
in gnomish packages.)

Today, I had to add CFLAGS and LDFLAGS to a package's build process.
The package had the --as-needed clob in its debian/rules:
DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS="-Wl,-O1 -Wl,--as-needed"

I could have added the LDFLAGS I needed at the end of the above line,
even with CFLAGS, but it wouldn't have been very maintainable or simply
readable.
Digging up the DEB_CONFIGURE_SCRIPT_ENV usage, I think it makes more
sense to simply set LDFLAGS:
# drop unneeded ELF deps
LDFLAGS += -Wl,-O1 -Wl,--as-needed
(DEB_CONFIGURE_SCRIPT_ENV contains LDFLAGS="$(LDFLAGS)" by default)

Adding or removing options is then as simple as adding or
removing/commenting CFLAGS / LDFLAGS lines:
# build with TCP wrappers
LDFLAGS += -lwrap
CFLAGS += -DUSE_LIBWRAP

Make sure you always use "+=".

As a side effect, any LDFLAGS set by CDBS isn't overwritten anymore.


There's a high number of DEB_CONFIGURE_SCRIPT_ENV occurrences in
pkg-gnome so I thought this is a common pattern. In the interest of
readability, I suggest that people start updating their packages to
augment LDFLAGS or CFLAGS directly. Thanks for your attention!

Cheers,
--
Loïc Minier <lool RemoveThis @dooz.org>
"I have no strong feelings one way or the other." -- Neutral President


--
To UNSUBSCRIBE, email to debian-gtk-gnome-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> GTK-GNOME All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum