config.sub is used to determine, among other things, the architecture of the machine. This is used in the configure script for an autotools based make file.
Older config.sub files don’t know how to handle aarch64, the generic name used for ARM64 servers in the build process. We have a recipe that pulls in code using an older config.sub file and I need to update.
My first approach was to build a patch. This works fine, and it was my fallback, but it is tedious to do for every recipe that needs this update, every time it needs it. It turns out we have a better approach that follows the guide of “don’t repeat yourself.”
In a RPM based distribution, the files we require are shipped in the files we require are shipped in the gnu-config-native RPM. We can pull the files we need in at the configuration step, prior to running the configure script. The code is appended to the recipe. In my case, it is placed in a file called
meta-rpm/recipes-core/centos8/cross-localedef-native_2.32.bbappend
and looks like this:
DEPENDS += "gnu-config-native" do_configure() { cp ${STAGING_DATADIR}/gnu-config/config.sub ${WORKDIR}/git/localedef cp ${STAGING_DATADIR}/gnu-config/config.guess ${WORKDIR}/git/localedef oe_runconf } |