如何将额外的自定义./configure autotools选项传递给Buildroot包? [英] How to pass extra custom ./configure autotools options to a Buildroot package?

查看:297
本文介绍了如何将额外的自定义./configure autotools选项传递给Buildroot包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我想将选项--enable-foo --enable-bar添加到./configure命令中.

E.g., I want to add the options --enable-foo --enable-bar to a ./configure command.

许多./configure选项可以通过BR2_配置间接设置,但是许多软件具有很多选项,以至于不可能为每个可能的./configure选项都拥有一个BR2_配置.

Many ./configure options can be set indirectly through BR2_ configs, but many software have so many options that it would be infeasible to have one BR2_ config for every possible ./configure option.

是否有一种适用于所有自动工具包的通用机制?

Is there a general mechanism that works for all autotools packages?

推荐答案

我认为自2017.02以来,当前没有通用方法,因为package/pkg-autotools.mk包含:

I think there is no current general method as of 2017.02, since package/pkg-autotools.mk contains:

# Configure package for target
define $(2)_CONFIGURE_CMDS
    (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache && \
    $$(TARGET_CONFIGURE_OPTS) \
    $$(TARGET_CONFIGURE_ARGS) \
    $$($$(PKG)_CONF_ENV) \
    CONFIG_SITE=/dev/null \
    ./configure \
        --target=$$(GNU_TARGET_NAME) \
        --host=$$(GNU_TARGET_NAME) \
        --build=$$(GNU_HOST_NAME) \
        --prefix=/usr \
        --exec-prefix=/usr \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --program-prefix="" \
        --disable-gtk-doc \
        --disable-gtk-doc-html \
        --disable-doc \
        --disable-docs \
        --disable-documentation \
        --with-xmlto=no \
        --with-fop=no \
        --disable-dependency-tracking \
        --enable-ipv6 \
        $$(DISABLE_NLS) \
        $$(SHARED_STATIC_LIBS_OPTS) \
        $$(QUIET) $$($$(PKG)_CONF_OPTS) \
    )
endef
else

,我看不到任何方法来插入任意选项,因为$$($$(PKG)_CONF_OPTS)是从每个程序包的package.mk中设置的,其他变量似乎也具有特定的用途,不应被弄乱.

and I can't see any way to plug in arbitrary options since $$($$(PKG)_CONF_OPTS) is set from the package.mk of each package, and the other variables appear to have specific purposes as well and shouldn't be messed with.

但是我认为,如果我们添加一个:

But I think this could be easily patched if we added a:

$$($$(PKG)_CONF_OPTS_EXTRA)

,然后在CLI中可以执行以下操作:

and then from the CLI you could do:

make MYPACKAGE_CONF_OPTS_EXTRA="--enable-foo --enable-bar"

最后,对于某些软件包,您可以摆脱现有的make配置,例如对于尚未转换为自动工具的host-qemu,我设法通过以下方式获得额外的选项:

Finally, for some packages, you could get away with existing make configs, e.g. for host-qemu, which has not yet been converted to autotools, I manage to get my extra options simply with:

HOST_QEMU_OPTS="--enable-sdl --with-sdlabi=2.0"

因为幸运的是,该软件包恰巧在Makefile上使用了+=而不是=.

because luckly that package happens to use += instead of = on the Makefile.

Thomas在以下位置的回答: https://stackoverflow.com/a/49570825/895245 也表明这是不破解新的配置选项是不可能的.

Thomas' answer at: https://stackoverflow.com/a/49570825/895245 also suggests that it is not possible without hacking up new config options.

这篇关于如何将额外的自定义./configure autotools选项传递给Buildroot包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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