Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Question: := vs = in package *.mk files
Date: Wed, 5 Oct 2011 09:04:28 +0200	[thread overview]
Message-ID: <20111005090428.34c8f565@skate> (raw)
In-Reply-To: <ADE657CA350FB648AAC2C43247A983F001F39DCFE6DB@AUSP01VMBX24.collaborationhost.net>

Le Tue, 4 Oct 2011 19:55:48 -0500,
H Hartley Sweeten <hartleys@visionengravers.com> a ?crit :

> The Buildroot documentation shows using '=' when setting variables
> in the package *.mk file.  Some of the existing packages use ':='
> instead.  What's the difference?  Should the existing packages be
> updated?

The difference is explained in the make documentation:


"""

   The first flavor of variable is a "recursively expanded" variable.
Variables of this sort are defined by lines using `=' (*note Setting
Variables: Setting.) or by the `define' directive (*note Defining
Variables Verbatim: Defining.).  The value you specify is installed
verbatim; if it contains references to other variables, these
references are expanded whenever this variable is substituted (in the
course of expanding some other string).

[...]

"Simply expanded variables" are defined by lines using `:=' (*note
Setting Variables: Setting.).  The value of a simply expanded variable
is scanned once and for all, expanding any references to other
variables and functions, when the variable is defined.  The actual
value of the simply expanded variable is the result of expanding the
text that you write.  It does not contain any references to other
variables; it contains their values _as of the time this variable was
defined_. 

"""

See http://www.gnu.org/software/make/manual/make.html#Flavors

In package definition, Peter has said that he preferred the usage of
'=' except when it would create a noticeable performance problem. So
for all package definitions such as _SITE, _VERSION, _SOURCE,
_AUTORECONF, _INSTALL_STAGING, etc. the '=' sign is the one to choose.

Of course, a lot of packages do not comply with this rule, but this
will be fixed progressively over time as we update packages.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2011-10-05  7:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05  0:55 [Buildroot] Question: := vs = in package *.mk files H Hartley Sweeten
2011-10-05  7:04 ` Thomas Petazzoni [this message]
2011-10-05 20:40   ` Peter Korsgaard

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=20111005090428.34c8f565@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --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