[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-cygwin
Subject:    Re: prelimary mingw cross compile instructions
From:       Angus Leeming <leeming () lyx ! org>
Date:       2005-04-19 17:12:35
Message-ID: d43dnh$jbs$1 () sea ! gmane ! org
[Download RAW message or body]

Ralf Habacker wrote:

> hi all,
> 
> currently I've released an initial how to for cross compiling mingw,
> which let compile qt much faster as with native mingw compiler  tool
> chain
> 
> Howto: http://sourceforge.net/project/shownotes.php?release_id=318305
> rpm's:
>
http://sourceforge.net/project/showfiles.php?group_id=49109&package_id=149157&release_id=318305
> 
> It would be nice if anyone can verify this howto before we can make an
> official howto.
> 
> Thanks
> Ralf

Hi, Ralf.

I thought I'd try out your instructions on Fedora Core 3. I got someway
down the line, but compilation of qmake is failing because I haven't told
the compiler where to find the w32api headers:

    $ cd qt3
    $ export QTDIR=$PWD
    $ export QMAKESPEC=win32-g++
    $ export PATH=$PWD/bin:$PATH
    $ make -f Makefile.cvs
    $ ./configure -no-cups -platform win32-g++ -shared

g++ -c -O2 -fno-exceptions -fno-rtti  -DUNICODE -DQT_NO_TEXTCODEC
-DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL
-DQT_NO_COMPRESS -DHAVE_QCONFIG_CPP -I"." -I"generators"
-I"generators/unix" -I"generators/win32" -I"generators/mac" -I"../include"
-I"../include/private" -I"../include/qmake"
-I"/include"-I"/home/angus/mingw-xcompile/qt3/mkspecs/win32-g++" -o
tmp/qdatetime.o ../src/tools/qdatetime.cpp
In file included from ../src/tools/qdatetime.cpp:38:
/home/angus/mingw-xcompile/qt3/mkspecs/win32-g++/qplatformdefs.h:14:19:
tchar.h: No such file or directory
/home/angus/mingw-xcompile/qt3/mkspecs/win32-g++/qplatformdefs.h:15:16:
io.h: No such file or directory
/home/angus/mingw-xcompile/qt3/mkspecs/win32-g++/qplatformdefs.h:16:20:
direct.h: No such file or directory
/home/angus/mingw-xcompile/qt3/mkspecs/win32-g++/qplatformdefs.h:22:21:
windows.h: No such file or directory
../src/tools/qdatetime.cpp: In static member function `static bool
QTime::currentTime(QTime*, Qt::TimeSpec)':
../src/tools/qdatetime.cpp:1725: error: `gettimeofday' undeclared (first
use this function)
../src/tools/qdatetime.cpp:1725: error: (Each undeclared identifier is
reportedonly once for each function it appears in.)
gmake: *** [tmp/qdatetime.o] Error 1
qmake failed to build. Aborting.

I attach a detailed log of all I have done so far, but basically the MinGW
runtime and w32api are installed as
    /usr/local/i386-mingw32/
        bin/
        include/
        lib/

where do I input this infor?

One further, dumm question: qmake is being built with g++, not
i386-mingw32-g++ . That's correct, isn't it (because qmake will be used to
build the sources).

Regards,
Angus

["HOWTO" (text/plain)]

Following the instructions here
http://sourceforge.net/project/shownotes.php?release_id=318305
on how to build the Qt/WinFree sources for Windows using a MinGW
cross-compiler on Linux.

Grab the Mingw X-Compiler rpms from http://mirzam.it.vu.nl/mingw/

Personally, I just wrote a little script to grab the binary rpms
for Fedora Core 3. However, the page also explains how to build
binary rpms from the src rpms.

    $ sh download.sh
    $ cat download.sh
    #! /bin/sh
    
    baseurl=http://mirzam.it.vu.nl/mingw/packages/fc3/
    
    for file in \
    mingw-binutils-2.15.91-7hl.i386.rpm \
    mingw-gcc-core-3.4.2-10hl.i386.rpm \
    mingw-runtime-3.7-11hl.i386.rpm \
    mingw-w32api-3.2-11hl.i386.rpm
    do
    	url=${baseurl}${file}
    	wget ${url}
    done
    
Installing them with:
    $ sh install.sh
    $ cat install.sh
    #! /bin/sh
    
    for file in \
    mingw-binutils-2.15.91-7hl.i386.rpm \
    mingw-gcc-core-3.4.2-10hl.i386.rpm \
    mingw-runtime-3.7-11hl.i386.rpm \
    mingw-w32api-3.2-11hl.i386.rpm
    do
    	rpm -Uvh $file
    done

This installs the MinGW binutils as
    /usr/local/i386-mingw32/bin/
        ar
        as
        dlltool
        ld
        ...
    
The MinGW runtime and w32api are installed as
    /usr/local/i386-mingw32/
        bin/
        include/
        lib/
    
The gcc cross compiler is installed as
    /usr/local/bin/
        i386-mingw32-cpp
        i386-mingw32-gcc
        i386-mingw32-gcc-3.4.2
        i386-mingw32-gccbug
        i386-mingw32-gcov

Bugger. No c++ compiler. I grabbed it from
    http://bitwalk.hp.infoseek.co.jp/src/gcc-mingw32-3.4.2-4.i386.rpm
    
Download the Qt/Win free sources.
Press return when prompted for the password:
    $ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/kde-cygwin \
          login
    $ cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/kde-cygwin \
          checkout -d qt3 -r QT_WIN32_3_3_BRANCH qt-3

Replace the native tools in $QTDIR/mkspecs/win32-g++/qmake.conf with
the equivalent cross compilers.

    $ sed -f xcompile_qmake.sed qt3/mkspecs/win32-g++/qmake.conf > tmp
    $ mv tmp qt3/mkspecs/win32-g++/qmake.conf
    $ cat xcompile_qmake.sed
    /QMAKE_CC/s/= *gcc/= i386-mingw32-gcc/
    /QMAKE_CXX/s/= *g++/= i386-mingw32-g++/
    /QMAKE_LIB/s/= *ar/= i386-mingw32-ar/
    /QMAKE_RC/s/= *windres/= i386-mingw32-windres/
    /QMAKE_STRIP/s/= *strip/= i386-mingw32-strip/

Create .qtwinconfig because otherwise qmake creates exe's with a
dll extension.

    $ echo '
    win32-g++:contains(TEMPLATE,lib) {
        contains(CONFIG,shared) {
        CONFIG += dll
        }
    }' > qt3/.qtwinconfig

Configure:
    $ cd qt3
    $ export QTDIR=$PWD
    $ export QMAKESPEC=win32-g++
    $ export PATH=$PWD/bin:$PATH
    $ make -f Makefile.cvs
    $ ./configure -no-cups -platform win32-g++ -shared


_______________________________________________
kde-cygwin mailing list
kde-cygwin@kde.org
https://mail.kde.org/mailman/listinfo/kde-cygwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic