diff --git a/configure b/configure index 9485c2b5d..c4d714bda 100755 --- a/configure +++ b/configure @@ -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"