diff options
author | Danny Boelens <dannyb@enfocus.com> | 2013-02-20 18:11:53 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-22 11:46:56 +0100 |
commit | 0f834a07bb3feb2ff8ac74d4107a592e30b17863 (patch) | |
tree | 23c5fa0760b83c97101d3e3f3e8a55b1e7e4576e | |
parent | 9b0922e64152bd4cd06932df247a5f80e9d069cb (diff) |
Fix Mac OS X crc/dwarf2 test for non-default Xcode setup.
The crc.test and dwarf2.test scripts are now using the
SDK and arch settings passed to it. If you install Xcode
without the "UNIX Development" option, this is essential
to let the compiler find standard headers and let the test
program compile successfully.
In addition, let configure pass the SDK and arch settings
given on the command line to the scripts.
These scripts are no longer present in Qt 5.
Change-Id: I78c0b3594b91827a6618a9a152949e9201ca64c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
-rwxr-xr-x | config.tests/mac/crc.test | 14 | ||||
-rwxr-xr-x | config.tests/mac/dwarf2.test | 26 | ||||
-rwxr-xr-x | configure | 4 |
3 files changed, 38 insertions, 6 deletions
diff --git a/config.tests/mac/crc.test b/config.tests/mac/crc.test index 9cbe7bad94..527b02f7d8 100755 --- a/config.tests/mac/crc.test +++ b/config.tests/mac/crc.test @@ -14,6 +14,8 @@ shift 7 LFLAGS="" INCLUDEPATH="" CXXFLAGS="" +MAC_CXXFLAGS="" +MAC_LFLAGS="" while [ "$#" -gt 0 ]; do PARAM=$1 case $PARAM in @@ -21,6 +23,16 @@ while [ "$#" -gt 0 ]; do LFLAGS="$LFLAGS -framework \"$2\"" shift ;; + -arch) + MAC_CXXFLAGS="$MAC_CXXFLAGS -arch $2" + MAC_LFLAGS="$MAC_LFLAGS -arch $2" + shift + ;; + -sdk) + MAC_CXXFLAGS="$MAC_CXXFLAGS -isysroot $2" + MAC_LFLAGS="$MAC_LFLAGS -Wl,-syslibroot,$2" + shift + ;; -F*|-m*|-x*) LFLAGS="$LFLAGS $PARAM" CXXFLAGS="$CXXFLAGS $PARAM" @@ -53,7 +65,7 @@ test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST" cd "$OUTDIR/$TEST" $MAKE distclean >/dev/null 2>&1 -"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" +"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "LIBS+=$MAC_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" if [ "$VERBOSE" = "yes" ]; then $MAKE diff --git a/config.tests/mac/dwarf2.test b/config.tests/mac/dwarf2.test index a640b113de..b58a1a09f8 100755 --- a/config.tests/mac/dwarf2.test +++ b/config.tests/mac/dwarf2.test @@ -6,10 +6,30 @@ COMPILER=$1 VERBOSE=$2 WORKDIR=$3 +shift 3 + +LFLAGS= +CXXFLAGS= +while [ "$#" -gt 0 ]; do + case $1 in + -arch) + CXXFLAGS="$CXXFLAGS -arch $2" + shift + ;; + -sdk) + CXXFLAGS="$CXXFLAGS -isysroot $2" + LFLAGS="$LFLAGS -Wl,-syslibroot,$2" + shift + ;; + *) ;; + esac + shift +done + touch dwarf2.c -if "$COMPILER" -c dwarf2.c -Werror -gdwarf-2 2>/dev/null 1>&2; then - if "$COMPILER" -c dwarf2.c -Werror -gdwarf-2 2>&1 | grep "unsupported" >/dev/null ; then +if "$COMPILER" -c dwarf2.c $CXXFLAGS -Werror -gdwarf-2 2>/dev/null 1>&2; then + if "$COMPILER" -c dwarf2.c $CXXFLAGS -Werror -gdwarf-2 2>&1 | grep "unsupported" >/dev/null ; then true else DWARF2_SUPPORT=yes @@ -18,7 +38,7 @@ fi rm -f dwarf2.c dwarf2.o # Test for xcode 2.4.0, which has a broken implementation of DWARF -"$COMPILER" $WORKDIR/xcodeversion.cpp -o xcodeversion -framework Carbon; +"$COMPILER" $WORKDIR/xcodeversion.cpp $CXXFLAGS $LFLAGS -o xcodeversion -framework Carbon; ./xcodeversion if [ "$?" == "1" ]; then @@ -3459,7 +3459,7 @@ fi #auto-detect DWARF2 on the mac if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then - if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then + if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" $MAC_CONFIG_TEST_COMMANDLINE; then CFG_MAC_DWARF2=no else CFG_MAC_DWARF2=yes @@ -5836,7 +5836,7 @@ fi # This should mean that you really *can* load two Qt's and have our custom # Carbon events work. if [ "$PLATFORM_MAC" = "yes" -a ! -z "$QT_NAMESPACE" ]; then - QT_NAMESPACE_MAC_CRC=`"$mactests/crc.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/crc $QT_NAMESPACE $L_FLAGS $I_FLAGS $l_FLAGS` + QT_NAMESPACE_MAC_CRC=`"$mactests/crc.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/crc $QT_NAMESPACE $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE` fi # X11/QWS/Lighthouse |