configure_symbian
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
     1 #!/bin/sh
     1 #!/bin/sh
     2 #############################################################################
     2 #############################################################################
     3 ##
     3 ##
     4 ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     4 ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     5 ## All rights reserved.
     5 ## All rights reserved.
     6 ## Contact: Nokia Corporation (qt-info@nokia.com)
     6 ## Contact: Nokia Corporation (qt-info@nokia.com)
     7 ##
     7 ##
     8 ## This file is the build configuration utility of the Qt Toolkit.
     8 ## This file is the build configuration utility of the Qt Toolkit.
     9 ##
     9 ##
   165 #-------------------------------------------------------------------------------
   165 #-------------------------------------------------------------------------------
   166 
   166 
   167 PLATFORM_X11=no
   167 PLATFORM_X11=no
   168 PLATFORM_MAC=no
   168 PLATFORM_MAC=no
   169 PLATFORM_QWS=no
   169 PLATFORM_QWS=no
       
   170 PLATFORM_SYMBIAN=no
   170 
   171 
   171 if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then
   172 if [ -f "$relpath"/src/gui/kernel/qapplication_mac.mm ] && [ -d /System/Library/Frameworks/Carbon.framework ]; then
   172     # Qt/Mac
   173     # Qt/Mac
   173     # ~ the Carbon SDK exists
   174     # ~ the Carbon SDK exists
   174     # ~ src/gui/base/qapplication_mac.cpp is present
   175     # ~ src/gui/base/qapplication_mac.cpp is present
   666 CFG_FONTCONFIG=auto
   667 CFG_FONTCONFIG=auto
   667 CFG_QWS_FREETYPE=no
   668 CFG_QWS_FREETYPE=no
   668 CFG_LIBFREETYPE=no
   669 CFG_LIBFREETYPE=no
   669 CFG_SQL_AVAILABLE=
   670 CFG_SQL_AVAILABLE=
   670 QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
   671 QT_DEFAULT_BUILD_PARTS="libs tools examples demos docs translations"
   671 CFG_BUILD_PARTS=""
   672 #QTP change for lRelease app. Need for Symbian
       
   673 CFG_BUILD_PARTS="translations"
   672 CFG_NOBUILD_PARTS=""
   674 CFG_NOBUILD_PARTS=""
   673 CFG_RELEASE_QMAKE=no
   675 CFG_RELEASE_QMAKE=no
   674 CFG_PHONON=yes
   676 CFG_PHONON=yes
   675 CFG_PHONON_BACKEND=yes
   677 CFG_PHONON_BACKEND=yes
   676 CFG_MULTIMEDIA=yes
   678 CFG_MULTIMEDIA=yes
   724 #For Symbian it should be enabled by default
   726 #For Symbian it should be enabled by default
   725 CFG_STL=yes
   727 CFG_STL=yes
   726 CFG_S60=yes
   728 CFG_S60=yes
   727 CFG_RTTI=yes
   729 CFG_RTTI=yes
   728 CFG_NATIVE_GESTURES=yes
   730 CFG_NATIVE_GESTURES=yes
       
   731 CFG_DEFFILES=yes
   729 #end symbian flags
   732 #end symbian flags
   730 
   733 
   731 CFG_PRECOMPILE=auto
   734 CFG_PRECOMPILE=auto
   732 CFG_SEPARATE_DEBUG_INFO=auto
   735 CFG_SEPARATE_DEBUG_INFO=auto
   733 CFG_REDUCE_EXPORTS=no
   736 CFG_REDUCE_EXPORTS=no
   781 OPT_VERBOSE=no
   784 OPT_VERBOSE=no
   782 OPT_HELP=
   785 OPT_HELP=
   783 CFG_SILENT=no
   786 CFG_SILENT=no
   784 CFG_GRAPHICS_SYSTEM=default
   787 CFG_GRAPHICS_SYSTEM=default
   785 CFG_ALSA=auto
   788 CFG_ALSA=auto
       
   789 #flags for qmake running
       
   790 CFG_NOPROCESS=no
   786 
   791 
   787 # initalize variables used for installation
   792 # initalize variables used for installation
   788 QT_INSTALL_PREFIX= "$outpath"
   793 QT_INSTALL_PREFIX="$outpath"
   789 QT_INSTALL_DOCS=
   794 QT_INSTALL_DOCS=
   790 QT_INSTALL_HEADERS=
   795 QT_INSTALL_HEADERS=
   791 QT_INSTALL_LIBS=
   796 QT_INSTALL_LIBS=
   792 QT_INSTALL_BINS=
   797 QT_INSTALL_BINS=
   793 QT_INSTALL_PLUGINS=
   798 QT_INSTALL_PLUGINS=
  1001         else
  1006         else
  1002             shift;
  1007             shift;
  1003             VAL=$1
  1008             VAL=$1
  1004         fi
  1009         fi
  1005 	;;
  1010 	;;
       
  1011      -usedeffiles)
       
  1012         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
       
  1013         VAL=yes
       
  1014         ;;
  1006     -hostprefix)
  1015     -hostprefix)
  1007         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
  1016         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
  1008         # this option may or may not be followed by an argument
  1017         # this option may or may not be followed by an argument
  1009         if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
  1018         if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
  1010             VAL=$outpath
  1019             VAL=$outpath
  1227         else
  1236         else
  1228             UNKNOWN_OPT=yes
  1237             UNKNOWN_OPT=yes
  1229         fi
  1238         fi
  1230         ;;
  1239         ;;
  1231 #QTP: QTPPROD-7
  1240 #QTP: QTPPROD-7
       
  1241     usedeffiles)
       
  1242         CFG_DEFFILES="$VAL"
       
  1243         ;;
       
  1244     
  1232     style-s60)
  1245     style-s60)
  1233         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
  1246         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
  1234             QT_SYMBIAN_STYLE_FLAGS="$VAL"
  1247             QT_SYMBIAN_STYLE_FLAGS="$VAL"
  1235         else
  1248         else
  1236             UNKNOWN_OPT=yes
  1249             UNKNOWN_OPT=yes
  1483     debug)
  1496     debug)
  1484         CFG_DEBUG="$VAL"
  1497         CFG_DEBUG="$VAL"
  1485         ;;
  1498         ;;
  1486     developer-build|commercial|opensource|nokia-developer)
  1499     developer-build|commercial|opensource|nokia-developer)
  1487         # These switches have been dealt with already
  1500         # These switches have been dealt with already
       
  1501         CFG_DEFFILES=no
  1488         ;;
  1502         ;;
  1489     static)
  1503     static)
  1490         if [ "$VAL" = "yes" ]; then
  1504         if [ "$VAL" = "yes" ]; then
  1491             CFG_SHARED=no
  1505             CFG_SHARED=no
  1492         elif [ "$VAL" = "no" ]; then
  1506         elif [ "$VAL" = "no" ]; then
  2114             CFG_MULTIMEDIA="$VAL"
  2128             CFG_MULTIMEDIA="$VAL"
  2115         else
  2129         else
  2116             UNKNOWN_OPT=yes
  2130             UNKNOWN_OPT=yes
  2117         fi
  2131         fi
  2118         ;;
  2132         ;;
       
  2133     dont-process)
       
  2134         CFG_NOPROCESS=yes
       
  2135         ;;
       
  2136     process)
       
  2137         CFG_NOPROCESS=no
       
  2138         ;;
       
  2139 
  2119     *)
  2140     *)
  2120         UNKNOWN_OPT=yes
  2141         UNKNOWN_OPT=yes
  2121         ;;
  2142         ;;
  2122     esac
  2143     esac
  2123     if [ "$UNKNOWN_OPT" = "yes" ]; then
  2144     if [ "$UNKNOWN_OPT" = "yes" ]; then
  2124         echo "${CURRENT_OPT}: invalid command-line switch"
  2145         echo "${CURRENT_OPT}: invalid command-line switch"
  2125         OPT_HELP=yes
  2146         OPT_HELP=yes
  2126         ERROR=yes
  2147         ERROR=yes
  2127     fi
  2148     fi
  2128 done
  2149 done
       
  2150 
       
  2151 #QTP Symbian release on the Linux platform
       
  2152 if [ "$XPLATFORM"="symbian-sbsv2" ]; then
       
  2153    PLATFORM_SYMBIAN=yes
       
  2154 fi
  2129 
  2155 
  2130 if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
  2156 if [ "$CFG_QCONFIG" != "full" ] && [ "$CFG_QT3SUPPORT" = "yes" ]; then
  2131     echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
  2157     echo "Warning: '-qconfig $CFG_QCONFIG' will disable the qt3support library."
  2132     CFG_QT3SUPPORT="no"
  2158     CFG_QT3SUPPORT="no"
  2133 fi
  2159 fi
  2873     if [ "$PLATFORM_QWS" = "yes" ]; then
  2899     if [ "$PLATFORM_QWS" = "yes" ]; then
  2874 	echo "Host architecture: '$CFG_HOST_ARCH'"
  2900 	echo "Host architecture: '$CFG_HOST_ARCH'"
  2875     fi
  2901     fi
  2876 fi
  2902 fi
  2877 
  2903 
       
  2904 #QTP configuration for the Symbian compilation on Linux platform 
       
  2905 if [ "$CFG_S60" = "yes" ]; then
       
  2906    QMakeVar add styles "s60"
       
  2907 fi
       
  2908 
  2878 #-------------------------------------------------------------------------------
  2909 #-------------------------------------------------------------------------------
  2879 # tests that don't need qmake (must be run before displaying help)
  2910 # tests that don't need qmake (must be run before displaying help)
  2880 #-------------------------------------------------------------------------------
  2911 #-------------------------------------------------------------------------------
  2881 
  2912 
  2882 if [ -z "$PKG_CONFIG" ]; then
  2913 if [ -z "$PKG_CONFIG" ]; then
  3869                          (available on some XScale CPUs).
  3900                          (available on some XScale CPUs).
  3870 
  3901 
  3871 EOF
  3902 EOF
  3872 fi
  3903 fi
  3873 
  3904 
       
  3905 if [ "$XPLATFORM"="symbian-sbsv2" ]; then
       
  3906     -no-s60..............Do not compile in S60 support.
       
  3907     -s60.................Compile with support for the S60 UI Framework
       
  3908     -no-usedeffiles......Disable the usage of DEF files.
       
  3909     -usedeffiles.........Enable the usage of DEF files.
       
  3910     cat << EOF
       
  3911 EOF
       
  3912 fi
  3874 
  3913 
  3875 if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
  3914 if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
  3876     if [ "$CFG_GLIB" = "no" ]; then
  3915     if [ "$CFG_GLIB" = "no" ]; then
  3877         GBY=" "
  3916         GBY=" "
  3878         GBN="+"
  3917         GBN="+"
  4299         echo "/* All features enabled while building qmake */" >"$QMAKE_QCONFIG_H"
  4338         echo "/* All features enabled while building qmake */" >"$QMAKE_QCONFIG_H"
  4300     fi
  4339     fi
  4301 
  4340 
  4302     mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
  4341     mv -f "$QMAKE_QCONFIG_H" "$QCONFIG_H"
  4303     for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
  4342     for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
  4304         if [ '!' -f "$conf" ]; then
  4343        [ -e "$conf" ] && rm -rf "$conf"
  4305             ln -s "$QCONFIG_H" "$conf"
  4344        cp -a "$QCONFIG_H" "$conf"
  4306         fi
       
  4307     done
  4345     done
  4308 
  4346 
  4309     #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
  4347     #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
  4310     rm -f mkspecs/default
  4348     rm -rf mkspecs/default
  4311     ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
  4349     cp -a `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
       
  4350 
  4312     # fix makefiles
  4351     # fix makefiles
  4313     for mkfile in GNUmakefile Makefile; do
  4352     for mkfile in GNUmakefile Makefile; do
  4314         EXTRA_LFLAGS=
  4353         EXTRA_LFLAGS=
  4315         EXTRA_CFLAGS=
  4354         EXTRA_CFLAGS=
  4316         in_mkfile="${mkfile}.in"
  4355         in_mkfile="${mkfile}.in"
  4845 
  4884 
  4846 #for the symbian we need add sql_lite support
  4885 #for the symbian we need add sql_lite support
  4847 QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
  4886 QMAKE_CONFIG="$QMAKE_CONFIG system-sqlite"
  4848 QMAKE_CONFIG="$QMAKE_CONFIG minimal-config small-config medium-config large-config full-config"
  4887 QMAKE_CONFIG="$QMAKE_CONFIG minimal-config small-config medium-config large-config full-config"
  4849 
  4888 
       
  4889 if [ "$PLATFORM_SYMBIAN" = "yes" ]; then
       
  4890    if [ "$CFG_DEFFILES" = "yes" ]; then
       
  4891       QMakeVar add CONFIG def_files
       
  4892    else
       
  4893       QMakeVar add CONFIG def_files_disabled
       
  4894    fi
       
  4895 fi
       
  4896 
  4850 # auto-detect NIS support
  4897 # auto-detect NIS support
  4851 if [ "$CFG_NIS" != "no" ]; then
  4898 if [ "$CFG_NIS" != "no" ]; then
  4852     if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/nis "NIS" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
  4899     if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/nis "NIS" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
  4853         CFG_NIS=yes
  4900         CFG_NIS=yes
  4854     else
  4901     else
  6887 else
  6934 else
  6888     [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
  6935     [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
  6889     mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
  6936     mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
  6890     chmod -w "$outpath/src/corelib/global/qconfig.h"
  6937     chmod -w "$outpath/src/corelib/global/qconfig.h"
  6891     for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
  6938     for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
  6892         if [ '!' -f "$conf" ]; then
  6939         cp -f "$outpath/src/corelib/global/qconfig.h" "$conf"
  6893             ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
       
  6894         fi
       
  6895     done
  6940     done
  6896 fi
  6941 fi
  6897 
  6942 
  6898 #-------------------------------------------------------------------------------
  6943 #-------------------------------------------------------------------------------
  6899 # save configuration into qconfig.pri
  6944 # save configuration into qconfig.pri
  7372 
  7417 
  7373 #-------------------------------------------------------------------------------
  7418 #-------------------------------------------------------------------------------
  7374 # build makefiles based on the configuration
  7419 # build makefiles based on the configuration
  7375 #-------------------------------------------------------------------------------
  7420 #-------------------------------------------------------------------------------
  7376 
  7421 
       
  7422 #: QTPRO for Symbian compilation it is necessary to replace qmake with standard qmake handling
  7377 echo "Finding project files. Please wait..."
  7423 echo "Finding project files. Please wait..."
  7378 #: QTPRO for Symbian compilation it is necessary to replace qmake with standard qmake handling
  7424 if [ "$CFG_NOPROCESS" != "yes" ]; then
  7379 if [ "$XPLATFORM" != "symbian-sbsv2" ]; then
  7425     if [ "$XPLATFORM" != "symbian-sbsv2" ]; then
  7380   "$outpath/bin/qmake" -prl -r "${relpath}/projects.pro"
  7426     "$outpath/bin/qmake" -prl -r "${relpath}/projects.pro"
  7381 fi
  7427     fi
  7382 
  7428 
  7383 if [ -f "${relpath}/projects.pro" ]; then
  7429     if [ -f "${relpath}/projects.pro" ]; then
  7384     echo "parsing projects.pro file and generate make files"
  7430         echo "parsing projects.pro file and generate make files"
  7385     mkfile="${outpath}/Makefile"
  7431         mkfile="${outpath}/Makefile"
  7386     [ -f "$mkfile" ] && chmod +w "$mkfile"
  7432         [ -f "$mkfile" ] && chmod +w "$mkfile"
  7387     QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/projects.pro"
  7433         QTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" "${relpath}/projects.pro"
  7388 fi
  7434     fi
  7389 
  7435 fi
  7390 # .projects      -> projects to process
  7436     # .projects      -> projects to process
  7391 # .projects.1    -> qt and moc
  7437     # .projects.1    -> qt and moc
  7392 # .projects.2    -> subdirs and libs
  7438     # .projects.2    -> subdirs and libs
  7393 # .projects.3    -> the rest
  7439     # .projects.3    -> the rest
  7394 rm -f .projects .projects.1 .projects.2 .projects.3
  7440     rm -f .projects .projects.1 .projects.2 .projects.3
  7395 
  7441 
  7396 QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'`
  7442 QMAKE_PROJECTS=`find "$relpath/." -name '*.pro' -print | sed 's-/\./-/-'`
  7397 if [ -z "$AWK" ]; then
  7443 if [ -z "$AWK" ]; then
  7398     for p in `echo $QMAKE_PROJECTS`; do
  7444     for p in `echo $QMAKE_PROJECTS`; do
  7399         echo "$p" >> .projects
  7445         echo "$p" >> .projects
  7512 PART_ROOTS=
  7558 PART_ROOTS=
  7513 for part in $CFG_BUILD_PARTS; do
  7559 for part in $CFG_BUILD_PARTS; do
  7514     case "$part" in
  7560     case "$part" in
  7515     tools) PART_ROOTS="$PART_ROOTS tools" ;;
  7561     tools) PART_ROOTS="$PART_ROOTS tools" ;;
  7516     libs) PART_ROOTS="$PART_ROOTS src" ;;
  7562     libs) PART_ROOTS="$PART_ROOTS src" ;;
  7517     translations) PART_ROOTS="$PART_ROOTS tools/linguist/lrelease translations" ;;
  7563     translations) PART_ROOTS="$PART_ROOTS tools/linguist/lrelease" ;;
  7518     examples) PART_ROOTS="$PART_ROOTS examples demos" ;;
  7564     examples) PART_ROOTS="$PART_ROOTS examples demos" ;;
  7519     *) ;;
  7565     *) ;;
  7520     esac
  7566     esac
  7521 done
  7567 done
  7522 
  7568 
  7537 	done
  7583 	done
  7538         [ "$IN_ROOT" = "no" ] && continue
  7584         [ "$IN_ROOT" = "no" ] && continue
  7539 
  7585 
  7540         case $a in
  7586         case $a in
  7541         *winmain/winmain.pro) continue ;;
  7587         *winmain/winmain.pro) continue ;;
  7542         *s60main/s60main.pro)  if [ "$XPLATFORM" != "symbian-sbsv2" ]; then 
  7588         *s60main/s60main.pro)  if [ "$PLATFORM_SYMBIAN" != "yes" -o  "$CFG_NOPROCESS" = "yes" ]; then 
  7543             continue
  7589             continue
  7544            fi;;
  7590            fi;;
  7545         *examples/activeqt/*) continue ;;
  7591         *examples/activeqt/*) continue ;;
  7546         */qmake/qmake.pro) continue ;;
  7592         */qmake/qmake.pro) continue ;;
  7547         *tools*|*tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*linguist/lrelease*) SPEC=$QMAKESPEC ;;
  7593         *tools*|*tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*linguist/lrelease*) SPEC=$QMAKESPEC ;;
  7548         *) SPEC=$XQMAKESPEC ;;
  7594         *) if [ "$CFG_NOPROCESS" = "yes" ]; then
       
  7595            continue
       
  7596            else
       
  7597            SPEC=$XQMAKESPEC
       
  7598            fi;;
  7549         esac
  7599         esac
  7550         dir=`dirname "$a" | sed -e "s;$sepath;.;g"`
  7600         dir=`dirname "$a" | sed -e "s;$sepath;.;g"`
  7551         test -d "$dir" || mkdir -p "$dir"
  7601         test -d "$dir" || mkdir -p "$dir"
  7552         OUTDIR="$outpath/$dir"
  7602         OUTDIR="$outpath/$dir"
  7553         if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then
  7603         if [ -f "${OUTDIR}/Makefile" ] && [ "$OPT_FAST" = "yes" ]; then