I want to change the <PKG>_CONF_OPTS config options for a package included in Buildroot without altering the baseline <pkg>.mk file.  Based on what I'm reading, it shouldn't be necessary to completely override the package using the BR2_PACKAGE_OVERRIDE_FILE as I don't want to change the source or anything else significant.
It has been suggested that this can be done using BR2_EXTERNAL and external.mk, but I cannot find any examples and my attempts have failed.  The Buildroot documentation is quite silent on this topic, as near as I can tell, and instead only explains the creation of new packages rather than the build customization of included packages.   
I have tried adding lines to external.mk directly as in <PKG>_CONF_OPTS += --new-option but this has no effect.  I have also tried creating a supplementary makefile in package/<pkg>/<pkg>.mk and filling in the needed information in the Config.in files for a "new" package but this has also failed.
I have referenced a couple of related questions that do not have complete answers given, so I am hoping to discover the general method and document it here.
How to pass extra custom ./configure autotools options to a Buildroot package?
Buildroot: Build only one package as both shared and static lib, all others shared only
Hopefully with a couple hints we can get this figured out and then documented for others.
EDIT: Done quite a bit of testing with this, and it's interesting to note that even the "sanity check" case of making the changes to _CONF_OPTS directly in the existing package is not having the desired effect. In my case (trying to do a static linkage build of one particular package while leaving everything else dynamic) I find that the presence or absence of BR2_STATIC_LIBS in the _defconfig controls everything when it comes down to the final build command, despite acknowledgement to the contrary all throughout the build logs.
BR2_EXTERNAL is not meant to adjust the configuration options of an existing package that is part of Buildroot itself. BR2_EXTERNAL is only meant to add new packages.
You should instead add a Config.in option to the package you're interested in, and use that to tweak its configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With