diff options
author | Guillem Jover <guillem@debian.org> | 2016-08-25 00:36:31 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-10-29 16:02:48 +0200 |
commit | 4f8bca211cb06db748f418723af68d64e42aa54a (patch) | |
tree | 64a1af1ac98fd4f6ce1b06d167cab38ef1a1ad6a /m4/dpkg-compiler.m4 | |
parent | cb0656f31ad55cac9175a2283394ba17316f6a5c (diff) | |
download | dpkg-4f8bca211cb06db748f418723af68d64e42aa54a.tar.gz |
build: Clean up compiler and linker automatic flag usage
Detect if the flags work at configure time, instead of enabling them
unconditionally. Amend the description so that the above is clear. And
rename the options so that downstreams realize about the change.
Diffstat (limited to 'm4/dpkg-compiler.m4')
-rw-r--r-- | m4/dpkg-compiler.m4 | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4 index b9a278de6..15ff5694a 100644 --- a/m4/dpkg-compiler.m4 +++ b/m4/dpkg-compiler.m4 @@ -1,5 +1,5 @@ # Copyright © 2004 Scott James Remnant <scott@netsplit.com> -# Copyright © 2006,2009-2011,2013-2015 Guillem Jover <guillem@debian.org> +# Copyright © 2006, 2009-2011, 2013-2016 Guillem Jover <guillem@debian.org> # DPKG_CHECK_COMPILER_FLAG # ------------------------ @@ -84,7 +84,7 @@ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [ AC_DEFUN([DPKG_COMPILER_WARNINGS], [ AC_ARG_ENABLE([compiler-warnings], AS_HELP_STRING([--disable-compiler-warnings], - [Disable additional compiler warnings]), + [Disable (detected) additional compiler warnings]), [], [enable_compiler_warnings=yes] ) @@ -100,17 +100,18 @@ AC_DEFUN([DPKG_COMPILER_WARNINGS], [ fi ]) -# DPKG_COMPILER_OPTIMISATIONS -# -------------------------- -# Add configure option to disable optimisations. -AC_DEFUN([DPKG_COMPILER_OPTIMISATIONS], -[AC_ARG_ENABLE(compiler-optimisations, - AS_HELP_STRING([--disable-compiler-optimisations], - [Disable compiler optimisations]), - [], - [enable_compiler_optimisations=yes]) - - AS_IF([test "x$enable_compiler_optimisations" = "xno"], [ +# DPKG_COMPILER_OPTIMIZATIONS +# --------------------------- +# Add configure option to disable optimizations. +AC_DEFUN([DPKG_COMPILER_OPTIMIZATIONS], [ + AC_ARG_ENABLE(compiler-optimizations, + AS_HELP_STRING([--disable-compiler-optimizations], + [Disable (detected) compiler optimizations]), + [], + [enable_compiler_optimizations=yes] + ) + + AS_IF([test "x$enable_compiler_optimizations" = "xno"], [ CFLAGS=$(echo "$CFLAGS" | sed -e "s/ -O[[1-9]]*\b/ -O0/g") ]) ]) |