I have an autotools-based BitBake recipe which I would like to have binaries installed in /usr/local/bin
and libraries installed in /usr/local/lib
(instead of /usr/bin
and /usr/lib
, which are the default target directories).
Here's a part of the autotools.bbclass
file which I found important.
CONFIGUREOPTS = " --build=${BUILD_SYS} \
--host=${HOST_SYS} \
--target=${TARGET_SYS} \
--prefix=${prefix} \
--exec_prefix=${exec_prefix} \
--bindir=${bindir} \
--sbindir=${sbindir} \
--libexecdir=${libexecdir} \
--datadir=${datadir} \
--sysconfdir=${sysconfdir} \
--sharedstatedir=${sharedstatedir} \
--localstatedir=${localstatedir} \
--libdir=${libdir} \
...
I thought that the easiest way to accomplish what I wanted to do would be to simply change ${bindir}
and ${libdir}
, or perhaps change ${prefix}
to /usr/local
, but I haven't had any success in this area. Is there a way to change these installation variables, or am I thinking about this in the wrong way?
As per Ross Burton's suggestion, I've tried adding the following to my recipe:
prefix="/usr/local"
exec_prefix="/usr/local"
but this causes the build to fail during that recipe's do_configure()
task, and returns the following:
| checking for GLIB... no
| configure: error: Package requirements (glib-2.0 >= 2.12.3) were not met:
|
| No package 'glib-2.0' found
This package can be found during a normal build without these modified variables. I thought that adding the following line might allow the system to find the package metadata for glib:
PKG_CONFIG_PATH = " ${STAGING_DIR_HOST}/usr/lib/pkgconfig "
but this seems to have made no difference.
I've also tried Ross Burton's other suggestion to add these variable assignments into my distribution's configuration file, but this causes it to fail during meta/recipes-extended/tzdata
's do_install()
task. It returns that DEFAULT_TIMEZONE is set to an invalid value.
Here's the source of the error from tzdata_2015g.bb
# Install default timezone
if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
install -d ${D}${sysconfdir}
echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
else
bberror "DEFAULT_TIMEZONE is set to an invalid value."
exit 1
fi
I'm assuming that I've got a problem with ${datadir}
, which references ${prefix}
.
BitBake recipes specify how a particular package is built. Recipes consist of the source URL (http, https, ftp, cvs, svn, git, local file system) of the package, dependencies and compile or install options. They also store the metadata for the package in standard variables.
1.3. BitBake Recipes, which are denoted by the file extension . bb , are the most basic metadata files. These recipe files provide BitBake with the following: Descriptive information about the package. The version of the recipe.
Do you want to change paths for everything or just one recipe? Not sure why you'd want to change just one recipe to /usr/local
, but whatever.
If you want to change all of them, then the simple way is to set prefix
in your local.conf
or distro configuration (prefix = "/usr/local"
).
If you want to do it in a particular recipe, then just assigning prefix="/usr/local"
and exec_prefix="/usr/local"
in the recipe will work.
These variables are defined in meta/conf/bitbake.conf
, where you can see that bindir
is $exec_prefix/bin
, which is probably why assigning prefix
didn't work for you.
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