VirtualBox

Changeset 57936 in vbox


Ignore:
Timestamp:
Sep 29, 2015 11:00:14 AM (9 years ago)
Author:
vboxsync
Message:

configure: more tweaks for detecting Qt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure

    r57932 r57936  
    153153PYTHONDIR="/usr /usr/local"
    154154QT4DIR="/usr/lib/qt4 /usr/share/qt4 /usr/lib64/qt4 /usr /usr/local"
     155QT4DIR_PKGCONFIG=1
    155156KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
    156157DEVDIR="`cd \`dirname $0\`; pwd`/tools"
     
    14791480    QT_INTERNAL=`/bin/ls -rd1 $PWD/tools/$BUILD_TARGET.$BUILD_PLATFORM_ARCH/qt/* 2> /dev/null`
    14801481    for t in $QT_INTERNAL; do
    1481         if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
    1482           cnf_append "VBOX_WITH_QT4_SUN" "1"
    1483           log_success "use internal version"
    1484           return
    1485         fi
     1482      if [ -f "$t/Frameworks/QtCoreVBox.framework/QtCoreVBox" ]; then
     1483        cnf_append "VBOX_WITH_QT4_SUN" "1"
     1484        log_success "use internal version"
     1485        return
     1486      fi
    14861487    done
    14871488    # Now try the user provided directory and some of the standard directories.
    14881489    QT_TRIES="$QT4DIR /System/Library /Library"
    14891490    for t in $QT_TRIES; do
    1490         if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
    1491           PATH_SDK_QT4="$t"
    1492           break
    1493         fi
     1491      if [ -f "$t/Frameworks/QtCore.framework/QtCore" ]; then
     1492        PATH_SDK_QT4="$t"
     1493        break
     1494      fi
    14941495    done
    14951496    # Add the necessary params for building the test application
     
    15031504      fail
    15041505    fi
    1505   else
    1506     if test -z "${foundqt4}"; then
     1506  else # !darwin
     1507    if [ $QT4DIR_PKGCONFIG -eq 1 ]; then
     1508      # default is to use pkg-config
     1509      if which_wrapper pkg-config > /dev/null; then
     1510        qt4_ver=`pkg-config QtCore --modversion 2>> $LOG`
     1511        if [ $? -ne 0 ]; then
     1512          log_failure "QtCore not found"
     1513          fail
     1514        else
     1515          FLGQT4=`pkg-config QtCore --cflags`
     1516          INCQT4=`strip_I "$FLGQT4"`
     1517          LIBQT4=`PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config QtCore --libs`
     1518          foundqt4=3 # pkg-config
     1519          TOOLQT4=`pkg-config QtCore --variable=prefix`
     1520          TOOLQT4MOC="`pkg-config QtCore --variable=moc_location`"
     1521          TOOLQT4BIN="`dirname $TOOLQT4MOC`"
     1522        fi
     1523      else
     1524        log_failure "pkg-config not found"
     1525        fail
     1526      fi
     1527    fi
     1528    if [ -z "$foundqt4" ]; then
    15071529      # do it the old way (e.g. user has specified QT4DIR)
    15081530      for q in $QT4DIR "$PWD/tools/linux.$TARGET_MACHINE"/qt/v4.8.*; do
     
    15141536        if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal &&
    15151537            test_execute_path "`strip_L "$LIBQT4"`" nofatal; then
    1516           foundqt4=2
     1538          foundqt4=2 # internal
    15171539          break;
    15181540        fi
     
    15201542        if test_compile "$LIBQT4 $LIBPTHREAD $I_INCQT4 $FLGQT4" qt4 qt4 nofatal &&
    15211543            test_execute_path "`strip_L "$LIBQT4"`" nofatal; then
    1522           foundqt4=1
     1544          foundqt4=1 # no pkg-config, Qt directory
    15231545          break;
    15241546        fi
     
    15271549  fi
    15281550  if [ -n "$foundqt4" ]; then
     1551    # we decided which version of Qt to use. Now enforce the version requirement
    15291552    cat > $ODIR.tmp_src.cc << EOF
    15301553#include <cstdio>
     
    15551578          for q in $PATH_SDK_QT4 /usr /Developer/Tools/Qt; do
    15561579            if which_wrapper "$q/bin/moc" > /dev/null; then
    1557               cnf_append "PATH_TOOL_QT4" "$q"
    15581580              cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
    15591581            fi
     
    15661588          INCQT4=`echo "$INCQT4"|$KBUILD_SED 's|\([^ ]*\) .*|\1|'`
    15671589          cnf_append "VBOX_PATH_QT4_LIB" "`strip_L "$LIBQT4"`"
    1568           cnf_append "SDK_QT4_LIBPATH" "`strip_L "$LIBQT4"`"
    15691590          cnf_append "PATH_SDK_QT4_INC" "$INCQT4"
    15701591          # this is not quite right since the qt libpath does not have to be first...
     
    15721593          if [ "$foundqt4" = "2" ]; then
    15731594            cnf_append "VBOX_WITH_QT4_SUN" "1"
     1595          elif [ "$foundqt4" = "3" ]; then
     1596            cnf_append "VBOX_PATH_QT4" "$TOOLQT4"
     1597            cnf_append "PATH_SDK_QT4" "$TOOLQT4"
     1598            cnf_append "PATH_TOOL_QT4_BIN" "$TOOLQT4BIN"
     1599            return
    15741600          fi
    15751601          test_header "Qt4 devtools"
    1576           for q in $TOOLQT4; do
    1577             # first try it with a suffix, some platforms use that
    1578             if which_wrapper "$q/bin/moc-qt4" > /dev/null; then
    1579               moc_ver=`$q/bin/moc-qt4 -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
    1580               if [ $? -ne 0 ]; then
    1581                 log_failure "moc-qt4 not working"
    1582                 fail
    1583               else
    1584                 log_success "found version $moc_ver"
    1585                 cnf_append "VBOX_PATH_QT4" "$q"
    1586                 cnf_append "PATH_SDK_QT4" "$q"
    1587                 cnf_append "PATH_TOOL_QT4" "$q"
    1588                 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
    1589                 cnf_append "TOOL_QT4_BIN_SUFF" "-qt4"
    1590                 return
    1591               fi
    1592             elif which_wrapper "$q/bin/moc" > /dev/null; then
    1593               moc_ver=`$q/bin/moc -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
    1594               if [ $? -ne 0 ]; then
    1595                 log_failure "moc not working"
    1596                 fail
    1597               else
    1598                 log_success "found version $moc_ver"
    1599                 cnf_append "VBOX_PATH_QT4" "$q"
    1600                 cnf_append "PATH_SDK_QT4" "$q"
    1601                 cnf_append "PATH_TOOL_QT4" "$q"
    1602                 cnf_append "PATH_TOOL_QT4_BIN" "$q/bin"
    1603                 return
    1604               fi
    1605             fi
    1606           done
     1602          # try it with a suffix, some platforms use that
     1603          if which_wrapper "$TOOLQT4/bin/moc-qt4" > /dev/null; then
     1604            QT4BINSUFF="-qt4"
     1605          else
     1606            QT4BINSUFF=""
     1607          fi
     1608          moc_ver=`$TOOLQT4/bin/moc-$QT4BINSUFF -v 2>&1|sed 's+^.*(Qt \(.*\))+\1+'`
     1609          if [ $? -ne 0 ]; then
     1610            log_failure "moc-$QT4BINSUFF not working"
     1611            fail
     1612          else
     1613            log_success "found version $moc_ver"
     1614            cnf_append "VBOX_PATH_QT4" "$TOOLQT4"
     1615            cnf_append "PATH_SDK_QT4" "$TOOLQT4"
     1616            cnf_append "PATH_TOOL_QT4_BIN" "$TOOLQT4/bin"
     1617            [ -n "$QT4BINSUFF" ] && cnf_append "TOOL_QT4_BIN_SUFF" "$QT4BINSUFF"
     1618          fi
    16071619        fi
    16081620      fi
     
    16161628  fi
    16171629}
     1630
    16181631
    16191632#
     
    23932406    --with-qt-dir=*|--with-qt4-dir=*)
    23942407      QT4DIR=`echo $option | cut -d'=' -f2`
     2408      QT4DIR_PKGCONFIG=0
    23952409      ;;
    23962410    --with-openssl-dir=*)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette