Skip to content

configure: drop duplicate AC_ARG_ENABLE([debug]) - #4765

Open
ThalesBarretto wants to merge 1 commit into
gluster:develfrom
ThalesBarretto:build-duplicate-enable-debug
Open

configure: drop duplicate AC_ARG_ENABLE([debug])#4765
ThalesBarretto wants to merge 1 commit into
gluster:develfrom
ThalesBarretto:build-duplicate-enable-debug

Conversation

@ThalesBarretto

Copy link
Copy Markdown
Contributor

Fixes: #4764

What

--enable-debug is declared twice. The first declaration carries the
logic (sets BUILD_DEBUG and the debug -g -O0 -DDEBUG CFLAGS, consulted
by the LTO gate); the second is bodyless and only re-registers the option.

Autoconf deduplicates the identical help string, so the second declaration
adds no --enable-debug line to ./configure --help. Its only footprint
is a dead enableval=$enable_debug stanza in the generated configure
(never read) and a misleading # enable debug section /
# end enable debug section banner — that block actually configures
readline, bash-completion, libaio, io_uring, gnfs, urcu and cmocka.

Change

Remove the redundant declaration and its two stale banner comments. The
real --enable-debug handling is untouched.

Verification

grep -c 'AC_ARG_ENABLE(\[debug\]' configure.ac   # 1 (was 2)

Regenerated configure before/after and diffed: the only change is the
removal of the dead enableval=$enable_debug stanza and the two comments.
./configure --help is byte-identical and still lists --enable-debug.

Verified with a real ./configure --enable-debug and full make on six
distributions (Debian 13, Ubuntu 24.04, CentOS Stream 9, Fedora 42,
openSUSE Leap 15.6, openSUSE Tumbleweed — autoconf 2.69 through 2.73),
each built twice (with and without this patch): the generated build system
(config.h + every Makefile) is byte-identical, --enable-debug sets
BUILD_DEBUG=yes and the -g -O0 -DDEBUG flags on both arms, and both
builds succeed with identical per-TU compile flags and an identical set of
shared objects. No build-behaviour change.

--enable-debug is declared twice. The first declaration carries the
actual logic (sets BUILD_DEBUG and the debug -g -O0 -DDEBUG CFLAGS,
consulted by the LTO gate); the second, under a "# enable debug section"
banner, has no body and only re-registers the option.

Autoconf deduplicates the identical help string, so the second
declaration adds no --enable-debug line to `configure --help`. Its only
footprint is a dead "enableval=$enable_debug" stanza in the generated
configure (never read), plus the misleading banner: the block it opens
configures readline, bash-completion, libaio, io_uring, gnfs, urcu and
cmocka, not the debug option.

Remove the redundant declaration and its two stale banner comments. The
real --enable-debug handling is untouched; the generated build system
(config.h and every Makefile) is unchanged.

Fixes: gluster#4764

Signed-off-by: Thales Antunes de Oliveira Barretto <thales.barretto.git@gmail.com>
@ThalesBarretto
ThalesBarretto marked this pull request as ready for review September 11, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure: --enable-debug is declared twice

2 participants