Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/6] package infra: remove CPPFLAGS from CFLAGS
Date: Tue, 14 May 2013 01:02:45 +0200	[thread overview]
Message-ID: <51917115.7090501@mind.be> (raw)
In-Reply-To: <5191647F.6010408@zacarias.com.ar>

On 14/05/13 00:09, Gustavo Zacarias wrote:
> On 05/13/2013 03:20 PM, Thomas Petazzoni wrote:
>> I believe there should be first an audit of where TARGET_CFLAGS is
>> used. Then, wherever needed, fixes to ensure both TARGET_CFLAGS and
>> TARGET_CPPFLAGS are used (or, if possible, usage of
>> TARGET_CONFIGURE_OPTS). Once those fixes are made, your patch that
>> separates TARGET_CPPFLAGS from TARGET_CFLAGS can go in.
>>
>> A quick "grep TARGET_CFLAGS" in package/ gives 110 packages using it.
>> In most cases, it's probably $(TARGET_CONFIGURE_OPTS) being passed +
>> CFLAGS="$(TARGET_CFLAGS) -bleh", which is already correct seems
>> CPPFLAGS is passed. But of course there might be packages that use a
>> custom Makefile that obeys to CFLAGS but not CPPFLAGS. Not sure what we
>> can do about these except slowly figuring out that they need fixing.
>
> Looking into generic packages which are the most likely to have
> differences because of custom Makefiles the general majority don't seem
> to understand CPPFLAGS, so other than doing
> SOMETHING="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" there doesn't seem to be
> much to do about it.
> We could define a TARGET_GENERIC_CFLAGS == TARGET_CPPFLAGS +
> TARGET_CFLAGS (like now) or something like that and make those package
> use that, after all it's the auto* packages that have issues with that.
> On the other hand it's a nice opportunity for some miscellaneous
> cleanups like using $(INSTALL) instead of install, removing redundant
> *_SOURCE definitions and stuff like that.
> Regards.

  TARGET_CPPFLAGS is _only_ used to set the largefile defines. So I think 
it's much easier to leave it out entirely, and pass those defines in 
CFLAGS. There may be one or two packages that break because they rely on 
correct CPPFLAGS, but for these we can send the largefile defines explicitly.

  So:

TARGET_LARGEFILE_CFLAGS = -D_LARGEFILE_SOURCE ...

TARGET_CFLAGS = $(TARGET_LARGEFILE_CFLAGS) ...

Remove the CPPFLAGS="$(TARGET_CPPFLAGS)" from TARGET_CONFIGURE_OPTS

Fixup the packages that use TARGET_CPPFLAGS


  HOST_CPPFLAGS is another story. It contains -I$(HOST_DIR)/usr/include. 
But that one _will_ trigger build failures if it is not passed correctly, 
so there Gustavo's patch is safe.

  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  reply	other threads:[~2013-05-13 23:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 16:40 [Buildroot] [PATCH 1/6] package infra: remove CPPFLAGS from CFLAGS Gustavo Zacarias
2013-05-13 16:40 ` [Buildroot] [PATCH 2/6] libnspr: bump to version 4.9.6 Gustavo Zacarias
2013-05-13 16:40 ` [Buildroot] [PATCH 3/6] libnss: bump to version 3.14.3 Gustavo Zacarias
2013-05-26 20:14   ` Peter Korsgaard
2013-05-13 16:40 ` [Buildroot] [PATCH 4/6] libcurl: bump to version 7.30.0 Gustavo Zacarias
2013-05-14 22:32   ` Arnout Vandecappelle
2013-05-14 22:47     ` Gustavo Zacarias
2013-05-13 16:40 ` [Buildroot] [PATCH 5/6] p11-kit: new package Gustavo Zacarias
2013-05-13 16:40 ` [Buildroot] [PATCH 6/6] gnutls: bump to version 3.2.0 Gustavo Zacarias
2013-05-14 22:36   ` Arnout Vandecappelle
2013-05-14 22:49     ` Gustavo Zacarias
2013-05-16  6:17       ` [Buildroot] Config options for optional dependencies [was: [PATCH 6/6] gnutls: bump to version 3.2.0] Arnout Vandecappelle
2013-05-16  8:50         ` Thomas Petazzoni
2013-05-13 17:10 ` [Buildroot] [PATCH 1/6] package infra: remove CPPFLAGS from CFLAGS Thomas Petazzoni
2013-05-13 17:22   ` Gustavo Zacarias
2013-05-13 18:20     ` Thomas Petazzoni
2013-05-13 22:09       ` Gustavo Zacarias
2013-05-13 23:02         ` Arnout Vandecappelle [this message]
2013-05-14  7:17           ` Thomas Petazzoni
2013-05-14  8:54             ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51917115.7090501@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox