Buildroot: Build only one package as both shared and static lib, all others shared only

只愿长相守 提交于 2019-12-24 09:55:02

问题


buildroot offers to possibility to build

  • only static,
  • only shared,
  • or both shared and static libs

of the selected packages.

The assigned configuration elements are BR2_STATIC_LIBS, BR2_STATIC_LIBS, and BR2_SHARED_STATIC_LIBS.

Question:

Is it possible to build both a shared and static lib for one package only, while building only shared libs for all the other packages?

The one project which I want a static lib of would be an autotools-based package.

My effort:

I did read the manual, but to no avail. I did come up with one idea though, but I think it won't work: I could have buildroot call the configure script with some arguments defined by me forcing the additional creation of a static lib. However, this would collide with the arguments buildroot is providing, which are forcing configure to do quite the opposite. (Create shared lib only.)

Thank you!

Unfortunately I can't even tell which version of buildroot I am using, as I did not find a way to get buildroots version number.


回答1:


Buildroot does not directly support changing options for one package only. That would simply explode the number of options.

The easiest way to do this is to edit package/foo/foo.mk and add the following line to it:

FOO_CONF_OPTS += --enable-static

These options come after the default autoconfig options (which contain --enable-shared --disable-static) and will thus override them.

If you don't want to touch the Buildroot sources, you can also do this in your local.mk or in a BR2_EXTERNAL -- see the manual for how to set these up.

The Buildroot version number is encoded at the top of the Makefile (line 90 in current master) in the variable BR2_VERSION. You can also look at the top of the generated .config file, which contains the version extended with the git commit hash.



来源:https://stackoverflow.com/questions/45958904/buildroot-build-only-one-package-as-both-shared-and-static-lib-all-others-shar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!