configure: Add option to build with extended compiler warnings and -Werror

Setting -Werror in CFLAGS passed to configure is not ideal as that affects
all the checks performed by the script.

This caused an issue with newer versions of Autoconf and the AC_PROG_LEX
macro that insisted on finding a lexer library.  But due to warnings from
the generated test lexer (misleading indentation) that got turned into
errors no library was found (none would have been necessary), so LEX was
not set and no lexers were built.

With this option enabled, we add -Werror to CFLAGS after all tests ran.
It also enables additional warnings via -Wextra.

The option is auto-enabled when building from the repository.
This commit is contained in:
Tobias Brunner
2022-07-18 12:42:24 +02:00
parent 9c86787de5
commit 1f242e772b
3 changed files with 36 additions and 5 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ TARBALL=$SRCDIR/.tarball-git-version
if test -f $TARBALL; then
V=$(cat $TARBALL)
elif test -d $SRCDIR/.git; then
elif test -e $SRCDIR/.git; then
V=$(git -C $SRCDIR describe --exclude 'android-*' --tags HEAD 2>/dev/null)
fi