Skip to content
Snippets Groups Projects
Commit 50aa68ea authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Felix Paul Kühne
Browse files

configure.ac: fix NO_COLOR handling in ./compile

Quotes were interpreted by configure and $NO_COLOR was interpolated at
configure time, leading to incorrect script execution. Brackets were
also removed because of m4 expansion.

By switching to single quote string, we can better describe what needs
to be printed and what needs to be evaluated.

The m4 expansion problem is solved by escaping the whole string in a
bracket block.

The `echo` command is also changed for the more portable[^1] `printf`.

[^1]: https://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo
parent ee838b3c
No related branches found
No related tags found
1 merge request!5582configure.ac: fix NO_COLOR handling in ./compile
Pipeline #482188 passed with warnings with stage
in 12 minutes and 55 seconds
......@@ -4869,18 +4869,18 @@ if test -n $SHELL; then
fi
rm -f compile
compile_top_srcdir=`sed -ne "s/^top_srcdir *= *//p" < Makefile`
echo "#! $SHELL
rm -f .error\$\$
[printf '%s\n' '#! '"${SHELL}"'
rm -f .error$$
ERROR=0
export PATH=\"$PATH\" LANG=C
if [ "$NO_COLOR" = 1 ]; then
($MAKE V=1 \$@ 2>&1 || touch .error\$\$)
export PATH="$PATH" LANG=C
if test "$NO_COLOR" = 1 ; then
('"${MAKE}"' V=1 "$@" 2>&1 || touch .error$$)
else
($MAKE V=1 \$@ 2>&1 || touch .error\$\$)| $compile_top_srcdir/extras/buildsystem/make.pl
('"${MAKE}"' V=1 "$@" 2>&1 || touch .error$$)| '"$compile_top_srcdir"'/extras/buildsystem/make.pl
fi
test -f .error\$\$ && ERROR=1
rm -f .error\$\$
exit \$ERROR" >compile
test -f .error$$ && ERROR=1
rm -f .error$$
exit $ERROR'] >compile
chmod a+x compile
echo "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment