Remove duplicated flags from {C,CPP,CXX,LD}FLAGS in configure
This results in much shorter compilation lines and hence much shorter build logs, which makes examining them simpler. There should be no real changes, as we should never use duplicated options intentionally.
This commit is contained in:
parent
b9df145b79
commit
273e2e7343
12
configure
vendored
12
configure
vendored
@ -40373,10 +40373,14 @@ case "${host}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
WX_CPPFLAGS=$CPPFLAGS
|
||||
WX_CFLAGS=$CFLAGS
|
||||
WX_CXXFLAGS=$CXXFLAGS
|
||||
WX_LDFLAGS=$LDFLAGS
|
||||
dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '!seen[$0]++'; }
|
||||
|
||||
WX_CPPFLAGS=`dedup_flags "$CPPFLAGS"`
|
||||
WX_CFLAGS=`dedup_flags "$CFLAGS"`
|
||||
WX_CXXFLAGS=`dedup_flags "$CXXFLAGS"`
|
||||
|
||||
LDFLAGS=`printf %s "$LDFLAGS" | sed 's/-framework */-framework_/g'`
|
||||
WX_LDFLAGS=`dedup_flags "$LDFLAGS" | sed 's/-framework_/-framework /g'`
|
||||
|
||||
CPPFLAGS=$USER_CPPFLAGS
|
||||
CFLAGS=$USER_CFLAGS
|
||||
|
17
configure.in
17
configure.in
@ -8269,10 +8269,19 @@ esac
|
||||
|
||||
dnl Set the flags to be used for the library build itself using the flag names
|
||||
dnl used everywhere above.
|
||||
WX_CPPFLAGS=$CPPFLAGS
|
||||
WX_CFLAGS=$CFLAGS
|
||||
WX_CXXFLAGS=$CXXFLAGS
|
||||
WX_LDFLAGS=$LDFLAGS
|
||||
dnl
|
||||
dnl Also get rid of duplicates in the flags, which results in dramatically
|
||||
dnl shorter build logs and so is well worth it.
|
||||
dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '!seen[[$0]]++'; }
|
||||
|
||||
WX_CPPFLAGS=`dedup_flags "$CPPFLAGS"`
|
||||
WX_CFLAGS=`dedup_flags "$CFLAGS"`
|
||||
WX_CXXFLAGS=`dedup_flags "$CXXFLAGS"`
|
||||
|
||||
dnl For link flags we can use "-framework" multiple times and all of their
|
||||
dnl occurrences need to be preserved, so add extra pre/post-processing.
|
||||
LDFLAGS=`printf %s "$LDFLAGS" | sed 's/-framework */-framework_/g'`
|
||||
WX_LDFLAGS=`dedup_flags "$LDFLAGS" | sed 's/-framework_/-framework /g'`
|
||||
|
||||
dnl Restore the original user-specified flags values, we won't run any tests
|
||||
dnl using them any more.
|
||||
|
Loading…
Reference in New Issue
Block a user