summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2017-09-08 12:38:31 +1000
committerDamien Miller <djm@mindrot.org>2017-09-08 12:38:31 +1000
commitde35c382894964a896a63ecd5607d3a3b93af75d (patch)
tree63076f9c277823f32d7c6033aaa46b0ddf5d8f16
parent22376d27a349f62c502fec3396dfe0fdcb2a40b7 (diff)
Give configure ability to set CFLAGS/LDFLAGS later
Some CFLAGS/LDFLAGS may disrupt the configure script's operation, in particular santization and fuzzer options that break assumptions about memory and file descriptor dispositions. This adds two flags to configure --with-cflags-after and --with-ldflags-after that allow specifying additional compiler and linker options that are added to the resultant Makefiles but not used in the configure run itself. E.g. env CC=clang-3.9 ./configure \ --with-cflags-after=-fsantize=address \ --with-ldflags-after="-g -fsanitize=address"
-rw-r--r--configure.ac22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9094cf04..522f54b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,6 +289,16 @@ AC_ARG_WITH([cflags],
fi
]
)
+
+AC_ARG_WITH([cflags-after],
+ [ --with-cflags-after Specify additional flags to pass to compiler after configure],
+ [
+ if test -n "$withval" && test "x$withval" != "xno" && \
+ test "x${withval}" != "xyes"; then
+ CFLAGS_AFTER="$withval"
+ fi
+ ]
+)
AC_ARG_WITH([cppflags],
[ --with-cppflags Specify additional flags to pass to preprocessor] ,
[
@@ -307,6 +317,15 @@ AC_ARG_WITH([ldflags],
fi
]
)
+AC_ARG_WITH([ldflags-after],
+ [ --with-ldflags-after Specify additional flags to pass to linker after configure],
+ [
+ if test -n "$withval" && test "x$withval" != "xno" && \
+ test "x${withval}" != "xyes"; then
+ LDFLAGS_AFTER="$withval"
+ fi
+ ]
+)
AC_ARG_WITH([libs],
[ --with-libs Specify additional libraries to link with],
[
@@ -5022,6 +5041,9 @@ AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8])
AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS])
AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms])
+CFLAGS="${CFLAGS} ${CFLAGS_AFTER}"
+LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}"
+
AC_EXEEXT
AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
openbsd-compat/Makefile openbsd-compat/regress/Makefile \