Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass extra custom ./configure autotools options to a Buildroot package?

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

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?


1 Answers

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

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)

and then from the CLI you could do:

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

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"

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

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



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!