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 ## |
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 |
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 |