Buildroot:仅构建一个包作为共享库和静态库,所有其他包仅共享 [英] Buildroot: Build only one package as both shared and static lib, all others shared only

查看:133
本文介绍了Buildroot:仅构建一个包作为共享库和静态库,所有其他包仅共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

buildroot 提供构建的可能性

buildroot offers to possibility to build

  • 仅静态,
  • 仅共享,
  • 或共享库和静态库

选定的软件包.

分配的配置元素是BR2_STATIC_LIBSBR2_STATIC_LIBSBR2_SHARED_STATIC_LIBS.

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

是否可以只为一个包构建共享库和静态库,而只为所有其他包构建共享库?

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?

我想要一个静态库的项目是一个基于 autotools 的包.

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

我确实阅读了手册,但无济于事.不过,我确实提出了一个想法,但我认为它行不通:我可以让 buildroot 调用 configure 脚本,并使用我定义的一些参数来强制额外创建一个静态库.但是,这会与 buildroot 提供的参数发生冲突,这会迫使 configure 做相反的事情.(仅创建共享库.)

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.)

谢谢!

不幸的是,我什至不知道我使用的是哪个版本的 buildroot,因为我没有找到获取 buildroots 版本号的方法.

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.

推荐答案

Buildroot 不直接支持仅更改一个包的选项.那只会使选项的数量激增.

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

最简单的方法是编辑 package/foo/foo.mk 并向其添加以下行:

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

这些选项位于默认自动配置选项(包含 --enable-shared --disable-static)之后,因此将覆盖它们.

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

如果您不想接触 Buildroot 源代码,您也可以在 local.mkBR2_EXTERNAL 中执行此操作——请参阅手册了解如何操作设置这些.

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.

Buildroot 版本号编码在 Makefile 顶部的变量 BR2_VERSION 中(当前主文件中的第 90 行).您还可以查看生成的 .config 文件的顶部,其中包含使用 git commit hash 扩展的版本.

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.

这篇关于Buildroot:仅构建一个包作为共享库和静态库,所有其他包仅共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆