qt 3.1 port planing

Ralf Habacker kde-cygwin@mail.kde.org
Mon, 25 Nov 2002 07:44:30 +0100

> On Saturday 23 November 2002 07:37 pm, Bob Tanner wrote:
> >
> > I've gotten qmake to compile, but it fails on linking. Guess I didn't do a
> > very good job on the merge of unixmake2, since all my linking errors are
> > there.
> >
> > Link errors attached.
> Ok, got past the link errors. I've gotten qmake and moc to compile and link.
> Should I commit the changes or wait until I get everything to compile?

Please wait.
I've played around a little with the qmake you have checked in and found that in
qt 3.1 trolltech has already implemented some of the cygwin related stuff with
qmake options, so the patches from the cygwin qt-3.0.4 release are not

So it seems to me to use the original qt3.1.0rc1 qt sources (without the #ifdef
__CYGWIN__ patches) and build only the left things.

If you build the src/Makefile with the original qmake

$ qmake qt.pro

you will find the following part in the makefile

DESTDIR  = ../lib/
TARGET   = libqt-mt.dll.3.1.0
TARGETA	= ../lib/libqt-mt.a
TARGETD	= libqt-mt.dll.3.1.0
TARGET0	= libqt-mt.dll
TARGET1	= libqt-mt.dll.3
TARGET2	= libqt-mt.dll.3.1


all: Makefile ../lib/libqt-mt.prl ../lib/$(TARGET)

	test -d ../lib/ || mkdir -p ../lib/
	-ln -s $(TARGET) $(TARGET0)
	-ln -s $(TARGET) $(TARGET1)
	-ln -s $(TARGET) $(TARGET2)
	-$(DEL_FILE) ../lib/$(TARGET)
	-$(DEL_FILE) ../lib/$(TARGET0)
	-$(DEL_FILE) ../lib/$(TARGET1)
	-$(DEL_FILE) ../lib/$(TARGET2)
	-$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) ../lib/

The main task is to build the dll into the bin dir and to create an import
library in the lib dir.

Makefile should contain

DESTDIR  = ../lib/
DLLDESTDIR  = ../bin/
TARGET   	= ../bin/libqt-mt-3.dll
TARGETA	= ../lib/libqt-mt.a
TARGET0	= ../lib/libqt-mt.dll.a

all: Makefile ../lib/libqt-mt.prl $(TARGET)

	test -d ../lib/ || mkdir -p ../lib/
	test -d ../bin/ || mkdir -p ../bin/

Additional qt-3/mkspecs/qmake.conf should contain a line

QMAKE_LFLAGS_SHLIB	= -shared -Wl,--out-implib=$(TARGET0)

Hope this helps. If you do not feel comfortable adding the necessary patches let
me know.