configure: Fix spacing for HARDENING_*FLAGS

Currently multiple spaces are used when a single one would do,
which will still achieve the same result but is not quite as
aesthetically pleasing :)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Andrea Bolognani 2021-07-06 14:27:11 +02:00 committed by Stefan Berger
parent 502cb1129a
commit 5e73e324bd

View File

@ -384,16 +384,16 @@ AC_ARG_ENABLE([hardening],
if test "x$enable_hardening" != "xno"; then
TMP="$($CC -fstack-protector-strong $srcdir/include/swtpm/tpm_ioctl.h 2>&1)"
if echo $TMP | $GREP 'unrecognized command line option' >/dev/null; then
HARDENING_CFLAGS="-fstack-protector -Wstack-protector "
HARDENING_CFLAGS="-fstack-protector -Wstack-protector"
else
HARDENING_CFLAGS="-fstack-protector-strong -Wstack-protector "
HARDENING_CFLAGS="-fstack-protector-strong -Wstack-protector"
fi
dnl Must not have -O0 but must have a -O for -D_FORTIFY_SOURCE=2
TMP1="$(echo $CFLAGS | sed -n 's/.*\(-O0\).*/\1/p')"
TMP2="$(echo $CFLAGS | sed -n 's/.*\(-O\).*/\1/p')"
if test -z "$TMP1" && test -n "$TMP2"; then
HARDENING_CFLAGS="$HARDENING_CFLAGS -D_FORTIFY_SOURCE=2 "
HARDENING_CFLAGS="$HARDENING_CFLAGS -D_FORTIFY_SOURCE=2"
fi
dnl Check linker for 'relro' and 'now'
save_CFLAGS="$CFLAGS"