diff options
author | Ken Raeburn <raeburn@mit.edu> | 2008-08-14 22:59:54 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2008-08-14 22:59:54 +0000 |
commit | 7b2fd388c28d4c8a3a7a2a4bf2b70a251bf037e8 (patch) | |
tree | 07e39632d80c179eb6aea3433a4f2ba42959650f | |
parent | 3f6a4615b9b2c145e8ca16dd034e44eaac42b600 (diff) | |
download | krb5-7b2fd388c28d4c8a3a7a2a4bf2b70a251bf037e8.tar.gz krb5-7b2fd388c28d4c8a3a7a2a4bf2b70a251bf037e8.tar.xz krb5-7b2fd388c28d4c8a3a7a2a4bf2b70a251bf037e8.zip |
Only add -Os for size optimizations if CFLAGS wasn't specified already. If
the configure-generated CFLAGS string is one of the usual ones with -O2,
replace -O2 rather than appending, since -Os will override previously
specified optimization levels anyways.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20660 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/aclocal.m4 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 859529e5be..51d034d2b8 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -624,9 +624,13 @@ extra_gcc_warn_opts="-Wall -Wcast-qual -Wcast-align -Wconversion -Wshadow" # -Wmissing-prototypes if test "$GCC" = yes ; then # Putting this here means we get -Os after -O2, which works. - if test "$with_size_optimizations" = yes; then + if test "$with_size_optimizations" = yes && test "x$krb5_ac_cflags_set" != xset; then AC_MSG_NOTICE(adding -Os optimization option) - CFLAGS="$CFLAGS -Os" + case "$CFLAGS" in + "-g -O2") CFLAGS="-g -Os" ;; + "-O2") CFLAGS="-Os" ;; + *) CFLAGS="$CFLAGS -Os" ;; + esac fi if test "x$krb5_ac_cflags_set" = xset ; then AC_MSG_NOTICE(not adding extra gcc warning flags because CFLAGS was set) |