home | list info | list archive | date index | thread index

[OCLUG-Tech] final question on Makefile variables and kconfig variables

  • Subject: [OCLUG-Tech] final question on Makefile variables and kconfig variables
  • From: "Robert P. J. Day" <rpjday [ at ] crashcourse [ dot ] ca>
  • Date: Mon, 20 Apr 2015 16:00:34 -0400 (EDT)
  that last post was leading up to what i was really puzzled about,
and it's in the source for buildroot, which uses the older Config.in
files but i suspect the same issues will apply.

  the top-level buildroot Makefile defines (among others) two
variables to be used for versioning:

# Set and export the version string
export BR2_VERSION := 2015.05-git

... snip ...

export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)

... snip ...

print-version:
        @echo $(BR2_VERSION)         # added by rday
        @echo $(BR2_VERSION_FULL)

  so all that's fine, there are two version variables -- a basic one
and the full version. and you can display their values easily enough:

$ make print-version
2015.05-git
2015.05-git-01319-g9c1bde5-dirty
$

pretty much what i expected, but here's the puzzler -- this bit from
the associated Config.in file:

config BR2_VERSION
        string
        option env="BR2_VERSION_FULL"

the config variable and the option env variable are not the same --
what is this supposed to be doing? if i read the kernel doc file
Documentation/kbuild/kconfig-language.txt, i read:

"  - "env"=<value>
    This imports the environment variable into Kconfig. It behaves like
    a default, except that the value comes from the environment, this
    also means that the behaviour when mixing it with normal defaults is
    undefined at this point. The symbol is currently not exported back
    to the build environment (if this is desired, it can be done via
    another symbol)."

  it's that last sentence that looks relevant -- you can't export the
variable back into the build environment unless you use another
symbol. so ... what is this feature trying to support?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================