Jarmund
Jarmund

Reputation: 3205

How to set "BR2_PACKAGE_HOST_ENVIRONMENT_SETUP" in buildroot

I want to various projects for various platforms, and as such I've concluded that the easiest way to to this is probably going to just have buildroot create the toolchain and then alter the environment to use said toolchain.

From section 8.14.1 of the buildroot manual:

For your convenience, by selecting the option BR2_PACKAGE_HOST_ENVIRONMENT_SETUP, you can get setup-environment script installed in output/host/and therefore in your SDK. This script can be sourced with . your/sdk/path/environment-setup to export a number of environment variables that will help cross-compile your projects using the Buildroot SDK: the PATH will contain the SDK binaries, standard autotools variables will be defined with the appropriate values, and CONFIGURE_FLAGS will contain basic ./configure options to cross-compile autotools projects. It also provides some useful commands. Note however that once this script is sourced, the environment is setup only for cross-compilation, and no longer for native compilation.

Alright, that sounds pretty much like exactly what I want. However, I have not figured out how to set BR2_PACKAGE_HOST_ENVIRONMENT_SETUP. I found no mention of anything similar when looking through make menuconfig, I tried to grep the entire buildroot source tree for that string with no luck, and simply exporting it as an environment variabl did not produce a different result either. So, how do I set BR2_PACKAGE_HOST_ENVIRONMENT_SETUP, exactly?

Upvotes: 2

Views: 1346

Answers (2)

Bernhard Piller
Bernhard Piller

Reputation: 11

In menu-config, you do a search ("/") of HOST_ENVIRONMENT and then you find your answer: screenshot

Upvotes: 1

user1254127
user1254127

Reputation: 137

I just stumbled across the same problem. The option was submitted in April 2020, so buildroot-2020.02.8 (the long term support version as of writing) doesn't support it, whereas the PDF available online is newer -- I suspect you are using the same version; the buildroot download page presents the longer term support version first.

Upvotes: 2

Related Questions