Non-interactively enabling menuselect debug options

I’m experiencing a segfault in Asterisk 20.6.0 and I’m trying to enable DONT_OPTIMIZE per Getting a Backtrace - Asterisk Documentation. I’m building asterisk non-interactively so the interactive nature of make menuselect is very painful. I’d like to be able to apply these flags so that they can be applied non-interactively to future builds, without needing to interact with a menu system. I found Configuring an Asterisk build from the command line ⋆ Asterisk but this doesn’t seem to work, if I do:

# Build menuselect/menuselect
echo q | make menuselect
menuselect/menuselect --enable DONT_OPTIMIZE

the commands succeed but when I manually check by running make menuselect the option is still default disabled. Is there another way to enable the debug flags at the command line that can be run from a script?


menuselect/menuselect --enable DONT_OPTIMIZE menuselect.makeopts

Perfect, that worked great. Is there a better way to force compilation of menuselect/menuselect than echo q | make menuselect? This method works but launching menuselect just to quit it seems like I’m overlooking a better target. Without running that menuselect/menuselect isn’t present after running configure.

“make menuselect.makeopts” may do it.

That works great. I did notice that after that I’ll get a ncurses error if I run menuselect/menuselect without any args, but I don’t intend to do that in my pipeline so that’s fine. Just documenting for the future.

To document where I ended up here is what I’ve added to my Docker build, between configure and make:

# Enable debugging / error reporting options
# DONT_OPTIMIZE: Enabled per
# BETTER_BACKTRACES: Enabled as it looks like a useful option
# COMPILE_DOUBLE: Disabled as it "recompile[s] with DONT_OPTIMIZE", which we need off per
RUN make menuselect.makeopts && \
    menuselect/menuselect --enable DONT_OPTIMIZE menuselect.makeopts && \
    menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts && \
    menuselect/menuselect --disable COMPILE_DOUBLE menuselect.makeopts

Stopping the build and manually running make menuselect after this step shows the options I expect. Thanks @jcolp for the help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.