couple questions about proper PACKAGECONFIG usage
one or two curiosities(?) i've run across re: PACKAGECONFIG usage,
and as i'm writing a short tutorial page on that feature, i better make sure i understand the nuance.
first, AIUI, for any recipe, *any* possible flag value that can be
assigned to PACKAGECONFIG should be accompanied by the actual set of values assigned to that ... flag(?). random example: gnutls.inc:
PACKAGECONFIG ??= "libidn zlib"
PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn" PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1" PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit" PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers" PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
so while the default PACKAGECONFIG flag settings are "libidn" and "zlib", that recipe clearly(?) defines five possible flags. i'm assuming it would be an error for any possible flag value to not be accompanied by a corresponding flag setting (not sure of the correct terminology here, i better check that).
next, i've noticed a very small number of recipes that define
"empty" flag strings, like this from opkg-utils_git.bb:
PACKAGECONFIG = "python update-alternatives"
PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
PACKAGECONFIG[update-alternatives] = ",,," <----- therethat last line clearly represents a no-op in the context of PACKAGECONFIG, and i was puzzled for a minute until it occurred that the only way it would have value is if it were tested somewhere else in the recipe, and sure enough, further down:
do_install() {
oe_runmake PREFIX=${prefix} DESTDIR=${D} install
if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
rm -f "${D}${bindir}/update-alternatives"
fi
}so "no-op" PACKAGECONFIG flag settings like that:
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb:PACKAGECONFIG[update-alternatives] = ",,," meta/recipes-multimedia/pulseaudio/pulseaudio.inc:PACKAGECONFIG[autospawn-for-root] = ",,," meta/recipes-connectivity/openssl/openssl.inc:PACKAGECONFIG[perl] = ",,,"
appear to be just a kludgy way to pass a config value to a recipe that really just uses the PACKAGECONFIG mechanism to hand it over, without using actual PACKAGECONFIG processing, is that a fair way to describe that? (put another way, if any recipe defines a "no-op" like that, it better test that setting somewhere else manually; otherwise, there's no real point to it, yes?)
actually, that might be it for this post ... am i missing any other
subtleties involving PACKAGECONFIG worth mentioning? another PACAKGECONFIG-related post coming shortly, but it's more focused so i'll post it separately.
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================Quoted 6 lines · Robert P. J. Day
one or two curiosities(?) i've run across re: PACKAGECONFIG usage,
and as i'm writing a short tutorial page on that feature, i better make sure i understand the nuance.
Quoted 8 lines
first, AIUI, for any recipe, *any* possible flag value that can be
assigned to PACKAGECONFIG should be accompanied by the actual set of values assigned to that ... flag(?). random example: gnutls.inc:PACKAGECONFIG ??= "libidn zlib"
PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn" PACKAGECONFIG[libtasn1] =
"--with-included-libtasn1=no,--with-included-libtasn1,libtasn1"
Quoted 17 lines
PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit" PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers" PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
so while the default PACKAGECONFIG flag settings are "libidn" and "zlib", that recipe clearly(?) defines five possible flags. i'm assuming it would be an error for any possible flag value to not be accompanied by a corresponding flag setting (not sure of the correct terminology here, i better check that).
next, i've noticed a very small number of recipes that define
"empty" flag strings, like this from opkg-utils_git.bb:PACKAGECONFIG = "python update-alternatives" PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}" PACKAGECONFIG[update-alternatives] = ",,," <----- there
Quoted 8 lines
that last line clearly represents a no-op in the context of PACKAGECONFIG, and i was puzzled for a minute until it occurred that the only way it would have value is if it were tested somewhere else in the recipe, and sure enough, further down:
do_install() { oe_runmake PREFIX=${prefix} DESTDIR=${D} install if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives',
'true', 'false', d)}; then
Quoted 7 lines
rm -f "${D}${bindir}/update-alternatives" fi}
so "no-op" PACKAGECONFIG flag settings like that:
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb:PACKAGECONFIG[update-alternatives]
= ",,,"
Quoted 1 line
meta/recipes-multimedia/pulseaudio/pulseaudio.inc:PACKAGECONFIG[autospawn-for-root] = ",,,"
Quoted 8 lines
meta/recipes-connectivity/openssl/openssl.inc:PACKAGECONFIG[perl] = ",,,"
appear to be just a kludgy way to pass a config value to a recipe that really just uses the PACKAGECONFIG mechanism to hand it over, without using actual PACKAGECONFIG processing, is that a fair way to describe that? (put another way, if any recipe defines a "no-op" like that, it better test that setting somewhere else manually; otherwise, there's no real point to it, yes?)
PACKAGECONFIG provides a means of (en/dis)abling features on a per-recipe basis. How the recipe accomplishes that is really just an implementation detail. It would be nice if the upstream project supported the required configure flags but sometimes it does not. Without knowing the opkg-utils case in detail I'd guess the best option would have been to add a "--enable-update-alternatives" configuration flag upstream and making install work without 'kludges' but that may have been considerably more work than modifying do_install() in the recipe.
If PACKAGECONFIG sets no configure flags or dependencies and it is not used elsewhere in the recipe to modify the resulting build or packaging, it is indeed not doing anything.
Quoted 4 lines
actually, that might be it for this post ... am i missing any other
subtleties involving PACKAGECONFIG worth mentioning? another PACAKGECONFIG-related post coming shortly, but it's more focused so i'll post it separately.
No additional monkey business that I know of.
Cheers,
Jussi
Quoted 17 lines
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.caTwitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday========================================================================
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 5 lines · Robert P. J. Day
actually, that might be it for this post ... am i missing any other
subtleties involving PACKAGECONFIG worth mentioning? another PACAKGECONFIG-related post coming shortly, but it's more focused so i'll post it separately.
The only interesting thing is that the behaviour has changed recently: the PACKAGECONFIG implementation now sets PACKAGECONFIG_CONFARGS and it's up to the recipe and/or class to do what it needs with it. autotools.bbclass adds it to EXTRA_OECONF, cmake.bbclass adds it to EXTRA_OECMAKE, and so on. In the past it was added directly to EXTRA_OECONF but that made integration with non-autotools harder.
Ross
Quoted 6 lines · Ross
On 29 October 2016 at 09:08, Robert P. J. Day <[email protected]> wrote:
actually, that might be it for this post ... am i missing any other subtleties involving PACKAGECONFIG worth mentioning? another PACAKGECONFIG-related post coming shortly, but it's more focused so i'll post it separately.
Quoted 7 lines
The only interesting thing is that the behaviour has changed
recently: the PACKAGECONFIG implementation now setsPACKAGECONFIG_CONFARGSand it's up to the recipe and/or class to do what it needs with it. autotools.bbclass adds it toEXTRA_OECONF, cmake.bbclass adds it toEXTRA_OECMAKE, and so on. In the past it was added directly toEXTRA_OECONFbut that made integration with non-autotools harder.
yes, i'd noticed that, definitely going to add that to my
explanation.
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================