summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 8970211..0af4123 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ AM_CONDITIONAL([IN_GIT],
AC_PROG_CC()
AM_PROG_CC_C_O()
-CFLAGS=''
+test -d "${srcdir}/.git" || CFLAGS=''
AX_CFLAGS_WARN_ALL() dnl Adds -Wall or equivalent
AX_CHECK_COMPILE_FLAG([-Wpedantic], [AX_APPEND_FLAG([-Wpedantic])])
@@ -87,7 +87,10 @@ fi
AX_APPEND_FLAG([-DTFM_TIMING_RESISTANT])
AX_APPEND_FLAG([-DECC_TIMING_RESISTANT])
-for flag in -Os -s -fno-unwind-tables -fno-asynchronous-unwind-tables \
+if ! test -d "${srcdir}/.git"; then
+ AX_CHECK_COMPILE_FLAG([-s], [AX_APPEND_FLAG([-s])])
+fi
+for flag in -Os -fno-unwind-tables -fno-asynchronous-unwind-tables \
-ffunction-sections -fdata-sections -Wl,--gc-sections \
-fstack-protector-strong -flto \
-Wl,-z,now -Wl,--hash-style=sysv -Wl,--build-id=none; do