summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMark Brand <mabrand@mabrand.nl>2010-06-10 12:35:05 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-06-10 12:35:05 (GMT)
commitb65a1e0be447abca16f20001efe1be43a0469808 (patch)
treef60e796b135030fbb734b8251b5e2deba3f5fd38 /configure
parent0d5649713af91dcce58a623bbef7d38e2fbdf13b (diff)
downloadQt-b65a1e0be447abca16f20001efe1be43a0469808.zip
Qt-b65a1e0be447abca16f20001efe1be43a0469808.tar.gz
Qt-b65a1e0be447abca16f20001efe1be43a0469808.tar.bz2
support for cross building Qt for MinGW (win32-g++) on Unix
This changeset provides the basis for targetting win32-g++ on Unix using the configure shell script: support added to the configure script itself support added to relevant config.tests support added to mingw makefile generator in qmake new makespec: unsupported/win32-g++-cross The makespec is based on the win32-g++ makespec. Merge-request: 2407 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure70
1 files changed, 58 insertions, 12 deletions
diff --git a/configure b/configure
index 663faf9..5ba0e57 100755
--- a/configure
+++ b/configure
@@ -779,6 +779,7 @@ RPATH_FLAGS=
l_FLAGS=
QCONFIG_FLAGS=
XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++" or "symbian/linux-gcce"
+XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
PLATFORM=$QMAKESPEC
QT_CROSS_COMPILE=no
OPT_CONFIRM_LICENSE=no
@@ -1326,7 +1327,9 @@ while [ "$#" -gt 0 ]; do
fi
;;
arch)
- if [ "$PLATFORM_MAC" = "yes" ]; then
+ # if this is a Mac then "windows" probably means
+ # we are cross-compiling for MinGW
+ if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" != "windows" ]; then
CFG_MAC_ARCHS="$CFG_MAC_ARCHS $VAL"
else
CFG_ARCH=$VAL
@@ -1444,6 +1447,7 @@ while [ "$#" -gt 0 ]; do
;;
xplatform)
XPLATFORM="$VAL"
+ case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
;;
debug-and-release)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
@@ -2578,9 +2582,13 @@ if [ -z "$PLATFORM" ]; then
"
;;
SunOS:5*)
- #PLATFORM=solaris-g++
- PLATFORM=solaris-cc
- #PLATFORM=solaris-cc64
+ if [ "$XPLATFORM_MINGW" = "yes" ]; then
+ PLATFORM="solaris-g++"
+ else
+ #PLATFORM=solaris-g++
+ PLATFORM=solaris-cc
+ #PLATFORM=solaris-cc64
+ fi
PLATFORM_NOTES="
- Also available for Solaris: solaris-g++ solaris-cc-64
"
@@ -2650,6 +2658,9 @@ else
fi
[ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
+
+case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
+
if [ -d "$PLATFORM" ]; then
QMAKESPEC="$PLATFORM"
else
@@ -2922,6 +2933,8 @@ if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
CFG_ARCH="$CFG_EMBEDDED"
;;
esac
+elif [ "$XPLATFORM_MINGW" = "yes" ]; then
+ [ -z "$CFG_ARCH" ] && CFG_ARCH="windows"
elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
CFG_ARCH=$CFG_HOST_ARCH
fi
@@ -4087,6 +4100,8 @@ elif [ "$PLATFORM_MAC" = "yes" ]; then
Platform="Qt for Mac OS X"
elif echo "$XPLATFORM" | grep "symbian" > /dev/null ; then
Platform="Qt for Symbian"
+elif [ "$XPLATFORM_MINGW" = "yes" ]; then
+ Platform="Qt for Windows"
elif [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ]; then
PLATFORM_X11=yes
Platform="Qt for Linux/X11"
@@ -4698,6 +4713,8 @@ if [ "$CFG_ZLIB" = "auto" ]; then
fi
fi
+[ "$XPLATFORM_MINGW" = "yes" ] && QMakeVar add styles "windowsxp windowsvista"
+
case "$XPLATFORM" in *symbian*)
QMakeVar set styles "windows s60" #overwrite previous default
CFG_LIBFREETYPE=no
@@ -4897,7 +4914,8 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
;;
psql)
if [ "$CFG_SQL_psql" != "no" ]; then
- if "$WHICH" pg_config >/dev/null 2>&1; then
+ # Be careful not to use native pg_config when cross building.
+ if [ "$XPLATFORM_MINGW" != "yes" ] && "$WHICH" pg_config >/dev/null 2>&1; then
QT_CFLAGS_PSQL=`pg_config --includedir 2>/dev/null`
QT_LFLAGS_PSQL=`pg_config --libdir 2>/dev/null`
fi
@@ -4924,7 +4942,7 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do
;;
odbc)
if [ "$CFG_SQL_odbc" != "no" ]; then
- if [ "$PLATFORM_MAC" != "yes" ] && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/odbc "ODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
+ if ( [ "$PLATFORM_MAC" != "yes" ] || [ "$XPLATFORM_MINGW" = "yes" ] ) && "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/odbc "ODBC" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
if [ "$CFG_SQL_odbc" = "auto" ]; then
CFG_SQL_odbc=plugin
fi
@@ -5190,6 +5208,7 @@ 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`
fi
+# X11/QWS
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
# auto-detect Glib support
@@ -5375,7 +5394,10 @@ if [ "$PLATFORM_X11" = "yes" ]; then
echo " QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in ${XQMAKESPEC}."
exit 1
fi
+fi
+# X11/MINGW OpenGL
+if [ "$PLATFORM_X11" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then
# auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x)
if [ "$CFG_GUI" = "no" ]; then
if [ "$CFG_OPENGL" = "auto" ]; then
@@ -5471,7 +5493,10 @@ if [ "$PLATFORM_X11" = "yes" ]; then
echo "OpenGL Graphics System is disabled due to missing OpenGL support..."
CFG_GRAPHICS_SYSTEM=default
fi
+fi # X11/MINGW OpenGL
+# X11
+if [ "$PLATFORM_X11" = "yes" ]; then
# auto-detect Xcursor support
if [ "$CFG_XCURSOR" != "no" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xcursor "Xcursor" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then
@@ -5917,9 +5942,12 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
fi
fi
+[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_PHONON" != "no" ] && CFG_PHONON="yes"
+
# freetype support
[ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
[ "x$PLATFORM_MAC" = "xyes" ] && CFG_LIBFREETYPE=no
+[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_LIBFREETYPE" = "auto" ] && CFG_LIBFREETYPE=no
if [ "$CFG_LIBFREETYPE" = "auto" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/freetype "FreeType" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
CFG_LIBFREETYPE=system
@@ -5929,7 +5957,9 @@ if [ "$CFG_LIBFREETYPE" = "auto" ]; then
fi
if [ "$CFG_ENDIAN" = "auto" ]; then
- if [ "$PLATFORM_MAC" = "yes" ]; then
+ if [ "$XPLATFORM_MINGW" = "yes" ]; then
+ CFG_ENDIAN="Q_LITTLE_ENDIAN"
+ elif [ "$PLATFORM_MAC" = "yes" ]; then
true #leave as auto
elif [ "$XPLATFORM" = "symbian-sbsv2" ]; then
CFG_ENDIAN="Q_LITTLE_ENDIAN"
@@ -6255,6 +6285,11 @@ if [ "$CFG_AUDIO_BACKEND" = "auto" ]; then
fi
fi
+if [ "$CFG_LARGEFILE" != "yes" ] && [ "$XPLATFORM_MINGW" = "yes" ]; then
+ echo "Warning: largefile support cannot be disabled for win32."
+ CFG_LARGEFILE="yes"
+fi
+
#-------------------------------------------------------------------------------
# ask for all that hasn't been auto-detected or specified in the arguments
#-------------------------------------------------------------------------------
@@ -6357,6 +6392,9 @@ if [ "$PLATFORM_MAC" = "yes" ]; then
fi
fi
+# but disable Cocoa if cross-building for mingw
+[ "$XPLATFORM_MINGW" = "yes" ] && CFG_MAC_COCOA="no"
+
# set the global Mac deployment target. This is overridden on an arch-by-arch basis
# in some cases, see code further down
case "$PLATFORM,$CFG_MAC_COCOA" in
@@ -6495,7 +6533,7 @@ QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR"
QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR"
QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR"
QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR"
-if [ "$CFG_LARGEFILE" = "yes" ]; then
+if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
QMAKE_CONFIG="$QMAKE_CONFIG largefile"
fi
if [ "$CFG_STL" = "no" ]; then
@@ -6611,7 +6649,7 @@ else
fi
-if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM" != "win32-g++" ]; then
+if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
#On Mac we implicitly link against libz, so we
#never use the 3rdparty stuff.
[ "$CFG_ZLIB" = "yes" ] && CFG_ZLIB="system"
@@ -6750,6 +6788,12 @@ if [ "$CFG_EXCEPTIONS" != "no" ]; then
QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
fi
+if [ "$XPLATFORM_MINGW" = "yes" ]; then
+ # mkspecs/features/win32/default_pre.prf sets "no-rtti".
+ # Follow default behavior of configure.exe by overriding with "rtti".
+ QTCONFIG_CONFIG="$QTCONFIG_CONFIG rtti"
+fi
+
if [ "$CFG_ALSA" = "yes" ]; then
QT_CONFIG="$QT_CONFIG alsa"
fi
@@ -7343,7 +7387,7 @@ 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"
-if [ "$CFG_LARGEFILE" = "yes" ]; then
+if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then
echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new"
fi
@@ -7688,7 +7732,7 @@ QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
EOF
# Ensure we can link to uninistalled libraries
-if linkerSupportsFlag -rpath-link "$outpath/lib"; then
+if [ "$XPLATFORM_MINGW" != "yes" ] && linkerSupportsFlag -rpath-link "$outpath/lib"; then
echo "QMAKE_LFLAGS += -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib" >> "$CACHEFILE.tmp"
fi
@@ -8226,7 +8270,9 @@ for file in .projects .projects.3; do
[ "$IN_ROOT" = "no" ] && continue
case $a in
- *winmain/winmain.pro) continue ;;
+ *winmain/winmain.pro)
+ [ "$XPLATFORM_MINGW" = "yes" ] || continue
+ SPEC=$XQMAKESPEC ;;
*s60main/s60main.pro) continue ;;
*examples/activeqt/*) continue ;;
*/qmake/qmake.pro) continue ;;