diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-05-13 21:30:20 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-05-14 00:19:33 +0200 |
commit | 3fa66d103652df217059e2629da816adb9599e7c (patch) | |
tree | 24344692850b0304d6e266ca594051e602b855c6 | |
parent | f207a6d353c895c6078f8345340228a2a790a659 (diff) | |
download | lvm2-3fa66d103652df217059e2629da816adb9599e7c.tar.gz |
configure: set optimize flags when CFLAGS is unset
If we are given CFLAGS - preserve user's request and avoid placing
just -O2 there.
-rwxr-xr-x | configure | 6 | ||||
-rw-r--r-- | configure.in | 4 |
2 files changed, 4 insertions, 6 deletions
@@ -3033,10 +3033,11 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- +if test -z "$CFLAGS"; then : + COPTIMISE_FLAG="-O2" +fi case "$host_os" in linux*) - CFLAGS="$CFLAGS" - COPTIMISE_FLAG="-O2" CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" ELDFLAGS="-Wl,--export-dynamic" # FIXME Generate list and use --dynamic-list=.dlopen.sym @@ -3056,7 +3057,6 @@ case "$host_os" in ;; darwin*) CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" - COPTIMISE_FLAG="-O2" CLDFLAGS="$CLDFLAGS" ELDFLAGS= CLDWHOLEARCHIVE="-all_load" diff --git a/configure.in b/configure.in index 59337637e..161f832e4 100644 --- a/configure.in +++ b/configure.in @@ -26,10 +26,9 @@ AC_CONFIG_AUX_DIR(autoconf) dnl -- Get system type AC_CANONICAL_TARGET([]) +AS_IF([test -z "$CFLAGS"], [COPTIMISE_FLAG="-O2"]) case "$host_os" in linux*) - CFLAGS="$CFLAGS" - COPTIMISE_FLAG="-O2" CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" ELDFLAGS="-Wl,--export-dynamic" # FIXME Generate list and use --dynamic-list=.dlopen.sym @@ -49,7 +48,6 @@ case "$host_os" in ;; darwin*) CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" - COPTIMISE_FLAG="-O2" CLDFLAGS="$CLDFLAGS" ELDFLAGS= CLDWHOLEARCHIVE="-all_load" |