diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2009-05-25 05:46:50 (GMT) |
---|---|---|
committer | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2009-05-25 05:52:27 (GMT) |
commit | 531274c741aed51946398a30a7be691ef98999bf (patch) | |
tree | 2957d56bb25b6da2bdc8e0a91ceb1e5772318be1 | |
parent | a5104ef77f71b068228ffe6d7c64845889c18c81 (diff) | |
download | Qt-531274c741aed51946398a30a7be691ef98999bf.zip Qt-531274c741aed51946398a30a7be691ef98999bf.tar.gz Qt-531274c741aed51946398a30a7be691ef98999bf.tar.bz2 |
BT: Clean up Mac -arch handling
Instead of the multiple character-string replacements, just check for
the discrete -arch values that we want to find. This makes the code
clearer and should reduce the chance of subtle errors.
Reviewed-by: Jason McDonald
-rwxr-xr-x | configure | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -2703,23 +2703,24 @@ fi if [ "$PLATFORM_MAC" = "yes" ]; then # check -arch arguments for validity. ALLOWED="x86 ppc x86_64 ppc64 i386" - for i in $CFG_MAC_ARCHS + # Save the list so we can re-write it using only valid values + CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS" + CFG_MAC_ARCHS= + for i in $CFG_MAC_ARCHS_IN do if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64"; exit 2; fi - done - -# replace "i386" with "x86" to support configuring with -arch i386 as an alias for x86. - CFG_MAC_ARCHS="${CFG_MAC_ARCHS/i386/x86}" - -# Build commmand line arguments we can pass to the compiler during configure tests -# by prefixing each arch with "-arch". - CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS/x86/i386}" - CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS_GCC_FORMAT/i386_64/x86_64}" - for ARCH in $CFG_MAC_ARCHS_GCC_FORMAT; do - MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $ARCH" + if [ "$i" = "i386" -o "$i" = "x86" ]; then + # These are synonymous values + # CFG_MAC_ARCHS requires x86 while GCC requires i386 + CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86" + MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch i386" + else + CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i" + MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $i" + fi done fi @@ -4129,14 +4130,14 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)" EXTRA_OBJS="qsettings_mac.o qcore_mac.o" EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\"" - if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then + if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64 X86_CFLAGS="-arch i386" X86_LFLAGS="-arch i386" EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS" EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS" EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS" fi - if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then + if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64 PPC_CFLAGS="-arch ppc" PPC_LFLAGS="-arch ppc" EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS" |