diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 299 |
1 files changed, 86 insertions, 213 deletions
@@ -693,8 +693,13 @@ CFG_V8SNAPSHOT=auto CFG_DECLARATIVE_DEBUG=yes CFG_JAVASCRIPTCORE_JIT=auto +# Target architecture CFG_ARCH= +# Host architecture, same as CFG_ARCH when not cross-compiling CFG_HOST_ARCH= +# Set when the -arch or -host-arch arguments are used +OPT_OBSOLETE_HOST_ARG=no + CFG_USE_GNUMAKE=no CFG_IM=yes CFG_XINPUT2=auto @@ -742,7 +747,6 @@ CFG_GETIFADDRS=auto CFG_INOTIFY=auto CFG_RPATH=yes CFG_FRAMEWORK=auto -CFG_MAC_ARCHS= MAC_CONFIG_TEST_COMMANDLINE= # used to make the configure tests run with the correct arch's and SDK settings CFG_MAC_DWARF2=auto CFG_MAC_HARFBUZZ=no @@ -1201,17 +1205,8 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; - arch) - # if this is a Mac then "windows" probably means - # we are cross-compiling for MinGW - if [ "$BUILD_ON_MAC" = "yes" ] && [ "$VAL" != "windows" ]; then - CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL" - else - CFG_ARCH=$VAL - fi - ;; - host-arch) - CFG_HOST_ARCH=$VAL + arch|host-arch) + OPT_OBSOLETE_HOST_ARG=yes ;; harfbuzz) if [ "$BUILD_ON_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then @@ -2420,13 +2415,6 @@ if [ "$UNAME_SYSTEM" = "SunOS" ]; then fi fi -#------------------------------------------------------------------------------- -# determine the system architecture -#------------------------------------------------------------------------------- -if [ "$OPT_VERBOSE" = "yes" ]; then - echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)" -fi - if [ "$CFG_RTOS_ENABLED" = "no" ]; then case `basename "$XPLATFORM"` in qnx-* | vxworks-*) @@ -2441,153 +2429,6 @@ if [ "$CFG_RTOS_ENABLED" = "no" ]; then esac fi -if [ -z "${CFG_HOST_ARCH}" ]; then - case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in - GNU:*:*) - CFG_HOST_ARCH=`echo ${UNAME_MACHINE} | sed -e 's,[-/].*$,,'` - case "$CFG_HOST_ARCH" in - i?86) - CFG_HOST_ARCH=i386 - ;; - esac - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " GNU/Hurd ($CFG_HOST_ARCH)" - fi - ;; - IRIX*:*:*) - CFG_HOST_ARCH=`uname -p` - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " SGI ($CFG_HOST_ARCH)" - fi - ;; - SunOS:5*:*) - case "$UNAME_MACHINE" in - sun4u*|sun4v*) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " Sun SPARC (sparc)" - fi - CFG_HOST_ARCH=sparc - ;; - i86pc) - case "$PLATFORM" in - *-64*) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 64-bit AMD 80x86 (x86_64)" - fi - CFG_HOST_ARCH=x86_64 - ;; - *) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 32-bit Intel 80x86 (i386)" - fi - CFG_HOST_ARCH=i386 - ;; - esac - esac - ;; - AIX:*:00????????00) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 64-bit IBM PowerPC (powerpc)" - fi - CFG_HOST_ARCH=powerpc - ;; - HP-UX:*:9000*) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " HP PA-RISC (parisc)" - fi - CFG_HOST_ARCH=parisc - ;; - *:*:i?86) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 32-bit Intel 80x86 (i386)" - fi - CFG_HOST_ARCH=i386 - ;; - *:*:x86_64|*:*:amd64) - if [ "$PLATFORM" = "linux-g++-32" -o "$PLATFORM" = "linux-icc-32" ]; then - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 32 bit on 64-bit AMD 80x86 (i386)" - fi - CFG_HOST_ARCH=i386 - else - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 64-bit AMD 80x86 (x86_64)" - fi - CFG_HOST_ARCH=x86_64 - fi - ;; - *:*:ppc) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 32-bit PowerPC (powerpc)" - fi - CFG_HOST_ARCH=powerpc - ;; - *:*:ppc64) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " 64-bit PowerPC (powerpc)" - fi - CFG_HOST_ARCH=powerpc - ;; - *:*:s390*) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " IBM S/390 (s390)" - fi - CFG_HOST_ARCH=s390 - ;; - *:*:arm*) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " ARM (arm)" - fi - CFG_HOST_ARCH=arm - ;; - Linux:*:sparc*) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " Linux on SPARC" - fi - CFG_HOST_ARCH=sparc - ;; - QNX:*:*) - case "$UNAME_MACHINE" in - x86pc) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " QNX on Intel 80x86 (i386)" - fi - CFG_HOST_ARCH=i386 - ;; - esac - ;; - *:*:*) - if [ "$OPT_VERBOSE" = "yes" ]; then - echo " Trying '$UNAME_MACHINE'..." - fi - CFG_HOST_ARCH="$UNAME_MACHINE" - ;; - esac -fi - -if [ "$XPLATFORM_MINGW" = "yes" ]; then - [ -z "$CFG_ARCH" ] && CFG_ARCH="windows" -elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then - CFG_ARCH=$CFG_HOST_ARCH -fi - -# for compatibility -COMPAT_ARCH= -case "$CFG_ARCH" in -arm*) - # previously, armv6 was a different arch - CFG_ARCH=arm - COMPAT_ARCH=armv6 - ;; -esac - -if [ "$OPT_VERBOSE" = "yes" ]; then - echo "System architecture: '$CFG_ARCH'" - if [ "$PLATFORM_QPA" = "yes" ]; then - echo "Host architecture: '$CFG_HOST_ARCH'" - fi -fi - #------------------------------------------------------------------------------- # tests that don't need qmake (must be run before displaying help) #------------------------------------------------------------------------------- @@ -3548,9 +3389,6 @@ Qt/Mac only: * -dwarf2 ............ Enable dwarf2 debugging symbols. -no-dwarf2 ......... Disable dwarf2 debugging symbols. - -arch <arch> ....... Build Qt for <arch>. Supported arch values: x86 x86_64. - Only one arch value can be specified. - -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4. To use a different SDK with gcc 3.3, set the SDKROOT environment variable. @@ -4038,6 +3876,33 @@ fi # Build qmake # tests that need qmake #------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# determine the target and host architectures +#------------------------------------------------------------------------------- + +# Use config.tests/arch/arch.pro to has the compiler tell us what the target architecture is +CFG_ARCH=`"$outpath/bin/qmake" -spec "$XQMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -e "s,^Project MESSAGE: ,," -e "s,^#.*$,,g" | grep -v "^$"` +[ -z "$CFG_ARCH" ] && CFG_ARCH="unknown" +if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; then + # Do the same test again, using the host compiler + CFG_HOST_ARCH=`"$outpath/bin/qmake" -spec "$QMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -e "s,^Project MESSAGE: ,," -e "s,^#.*$,,g" | grep -v "^$"` + [ -z "$CFG_HOST_ARCH" ] && CFG_HOST_ARCH="unknown" +else + # not cross compiling, host == target + CFG_HOST_ARCH="$CFG_ARCH" +fi + +if [ "$OPT_VERBOSE" = "yes" ]; then + echo "System architecture: '$CFG_ARCH'" + if [ "$PLATFORM_QPA" = "yes" ]; then + echo "Host architecture: '$CFG_HOST_ARCH'" + fi +fi + +#------------------------------------------------------------------------------- +# functionality tests +#------------------------------------------------------------------------------- + # detect availability of float math.h functions if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/floatmath "floatmath" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_USE_FLOATMATH=yes @@ -4143,6 +4008,8 @@ if [ "$CFG_ARCH" = "arm" ] && [ "${CFG_NEON}" = "auto" ]; then else CFG_NEON=no fi +elif [ "$CFG_ARCH" != "arm" ]; then + CFG_NEON=no fi [ "$XPLATFORM_MINGW" = "yes" ] && QMakeVar add styles "windowsxp windowsvista" @@ -5522,29 +5389,27 @@ if [ "$CFG_MAC_DWARF2" = "yes" ]; then QT_CONFIG="$QT_CONFIG dwarf2" fi -# Set the default Mac OS X arch if there are no "-arch" arguments on the configure line +# Detect the default arch (x86 or x86_64) on Mac OS X if [ "$BUILD_ON_MAC" = "yes" ]; then - DEFAULT_ARCH="$CFG_MAC_ARCHS" - if [ -z "$DEFAULT_ARCH" ]; then - case `file "${outpath}/bin/qmake"` in - *i?86) - DEFAULT_ARCH=x86 - ;; - *x86_64) - DEFAULT_ARCH=x86_64 - ;; - *ppc|*ppc64|*) - # unsupported/unknown - ;; - esac - fi + DEFAULT_ARCH= + case `file "${outpath}/bin/qmake"` in + *i?86) + DEFAULT_ARCH=x86 + ;; + *x86_64) + DEFAULT_ARCH=x86_64 + ;; + *ppc|*ppc64|*) + # unsupported/unknown + ;; + esac + if [ -n "$DEFAULT_ARCH" ]; then [ "$OPT_VERBOSE" = "yes" ] && echo "Setting default Mac OS X architechture to $DEFAULT_ARCH." QT_CONFIG="$QT_CONFIG $DEFAULT_ARCH" QMAKE_CONFIG="$QMAKE_CONFIG $DEFAULT_ARCH" - # Make the application arch follow the Qt arch for single arch builds. - # (for multiple-arch builds, set CONFIG manually in the application .pro file) - [ `echo "$DEFAULT_ARCH" | wc -w` -eq 1 ] && QTCONFIG_CONFIG="$QTCONFIG_CONFIG $DEFAULT_ARCH" + # Make the application arch follow the Qt arch + QTCONFIG_CONFIG="$QTCONFIG_CONFIG $DEFAULT_ARCH" fi fi @@ -6156,17 +6021,6 @@ cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF #endif EOF -CFG_ARCH_STR=`echo $CFG_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -CFG_HOST_ARCH_STR=`echo $CFG_HOST_ARCH | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -cat >>"$outpath/src/corelib/global/qconfig.h.new" <<EOF -/* Machine Architecture */ -#ifndef QT_BOOTSTRAPPED -# define QT_ARCH_${CFG_ARCH_STR} -#else -# define QT_ARCH_${CFG_HOST_ARCH_STR} -#endif -EOF - echo '/* Compile time features */' >>"$outpath/src/corelib/global/qconfig.h.new" [ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new" @@ -6389,6 +6243,7 @@ cat >>"$QTCONFIG.tmp" <<EOF #configuration CONFIG += $QTCONFIG_CONFIG QT_ARCH = $CFG_ARCH +QT_HOST_ARCH = $CFG_HOST_ARCH QT_EDITION = $Edition QT_CONFIG += $QT_CONFIG @@ -6583,12 +6438,7 @@ else echo "Building for: $XPLATFORM" fi -if [ ! -z "$CFG_MAC_ARCHS" ]; then - echo "Architecture: $CFG_ARCH ($CFG_MAC_ARCHS )" -else - echo "Architecture: $CFG_ARCH" -fi - +echo "Architecture: $CFG_ARCH" if [ "$PLATFORM_QPA" = "yes" ]; then echo "Host architecture: $CFG_HOST_ARCH" fi @@ -6631,10 +6481,11 @@ fi echo "Declarative debugging ...$CFG_DECLARATIVE_DEBUG" echo "STL support ............ $CFG_STL" echo "PCH support ............ $CFG_PRECOMPILE" -echo "MMX/3DNOW/SSE/SSE2/SSE3. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}/${CFG_SSE3}" -echo "SSSE3/SSE4.1/SSE4.2..... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}" -echo "AVX..................... ${CFG_AVX}" -if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then +if [ "$CFG_ARCH" = "i386" -o "$CFG_ARCH" = "x86_64" ]; then + echo "MMX/3DNOW/SSE/SSE2/SSE3. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}/${CFG_SSE3}" + echo "SSSE3/SSE4.1/SSE4.2..... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}" + echo "AVX..................... ${CFG_AVX}" +elif [ "$CFG_ARCH" = "arm" ]; then echo "iWMMXt support ......... ${CFG_IWMMXT}" echo "NEON support ........... ${CFG_NEON}" fi @@ -6997,14 +6848,21 @@ rm -f .projects .projects.3 #------------------------------------------------------------------------------- # check for platforms that we don't yet know about #------------------------------------------------------------------------------- -if [ "$CFG_ARCH" = "generic" ]; then +if [ "$CFG_ARCH" = "unknown" ]; then cat <<EOF - NOTICE: Atomic operations are not yet supported for this - architecture. + NOTICE: configure was unable to determine the architecture + for the $XQMAKESPEC target. - Qt will use the 'generic' architecture instead, which uses a - single pthread_mutex_t to protect all atomic operations. This + Qt will not use a specialized implementation for any atomic + operations. Instead a generic implemention based on either GCC + intrinsics or C++11 std::atomic<T> will be used (when + available). The generic implementations are generally as fast + as and always as safe as a specialized implementation. + + If no generic implementation is available, Qt will use a + fallback UNIX implementation which uses a single + pthread_mutex_t to protect all atomic operations. This implementation is the slow (but safe) fallback implementation for architectures Qt does not yet support. EOF @@ -7043,6 +6901,21 @@ EOF fi #------------------------------------------------------------------------------- +# check if the user passed the obsoleted -arch or -host-arch options +#------------------------------------------------------------------------------- +if [ "$OPT_OBSOLETE_HOST_ARG" = "yes" ]; then +cat <<EOF + + NOTICE: The -arch and -host-arch options are obsolete. + + Qt now detects the target and host architectures based on compiler + output. Qt will be built using $CFG_ARCH for the target architecture + and $CFG_HOST_ARCH for the host architecture (note that these two + will be the same unless you are cross-compiling). +EOF +fi + +#------------------------------------------------------------------------------- # finally save the executed command to another script #------------------------------------------------------------------------------- if [ `basename $0` != "config.status" ]; then |