diff options
author | Damien Miller <djm@mindrot.org> | 2017-09-08 12:38:31 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-09-08 12:38:31 +1000 |
commit | de35c382894964a896a63ecd5607d3a3b93af75d (patch) | |
tree | 63076f9c277823f32d7c6033aaa46b0ddf5d8f16 /configure.ac | |
parent | 22376d27a349f62c502fec3396dfe0fdcb2a40b7 (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"
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 9094cf044..522f54b05 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -289,6 +289,16 @@ AC_ARG_WITH([cflags], | |||
289 | fi | 289 | fi |
290 | ] | 290 | ] |
291 | ) | 291 | ) |
292 | |||
293 | AC_ARG_WITH([cflags-after], | ||
294 | [ --with-cflags-after Specify additional flags to pass to compiler after configure], | ||
295 | [ | ||
296 | if test -n "$withval" && test "x$withval" != "xno" && \ | ||
297 | test "x${withval}" != "xyes"; then | ||
298 | CFLAGS_AFTER="$withval" | ||
299 | fi | ||
300 | ] | ||
301 | ) | ||
292 | AC_ARG_WITH([cppflags], | 302 | AC_ARG_WITH([cppflags], |
293 | [ --with-cppflags Specify additional flags to pass to preprocessor] , | 303 | [ --with-cppflags Specify additional flags to pass to preprocessor] , |
294 | [ | 304 | [ |
@@ -307,6 +317,15 @@ AC_ARG_WITH([ldflags], | |||
307 | fi | 317 | fi |
308 | ] | 318 | ] |
309 | ) | 319 | ) |
320 | AC_ARG_WITH([ldflags-after], | ||
321 | [ --with-ldflags-after Specify additional flags to pass to linker after configure], | ||
322 | [ | ||
323 | if test -n "$withval" && test "x$withval" != "xno" && \ | ||
324 | test "x${withval}" != "xyes"; then | ||
325 | LDFLAGS_AFTER="$withval" | ||
326 | fi | ||
327 | ] | ||
328 | ) | ||
310 | AC_ARG_WITH([libs], | 329 | AC_ARG_WITH([libs], |
311 | [ --with-libs Specify additional libraries to link with], | 330 | [ --with-libs Specify additional libraries to link with], |
312 | [ | 331 | [ |
@@ -5022,6 +5041,9 @@ AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) | |||
5022 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) | 5041 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
5023 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) | 5042 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
5024 | 5043 | ||
5044 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" | ||
5045 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" | ||
5046 | |||
5025 | AC_EXEEXT | 5047 | AC_EXEEXT |
5026 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ | 5048 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
5027 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ | 5049 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |