diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2008-07-30 21:14:24 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-07-29 08:50:20 (GMT) |
commit | d7b688870aead912690188b324d370b920a7a600 (patch) | |
tree | aac6c19d222ca3bad65cfbb850483a647013c67a /mkspecs/features | |
parent | e5262a0c29c743f2afd4ba249e8adff984c1ca83 (diff) | |
download | Qt-d7b688870aead912690188b324d370b920a7a600.zip Qt-d7b688870aead912690188b324d370b920a7a600.tar.gz Qt-d7b688870aead912690188b324d370b920a7a600.tar.bz2 |
Port of Qt to VxWorks
This makes Qt work on VxWorks 6.6+ in native (kernel) mode.
* compiles with the WindRiver GNU toolchain (Linux only)
* works with QWS (tested with the VNC driver only)
* tested on PPC hardware and the x86 VxWorks simulator
* no q3support, no phonon, no webkit
* no QSharedMemory, no QSystemSemaphore, no QProcess
* only one QApplication instance (flat address space)
* filesystem support depends heavily on the quality of the native driver
* QLibrary is just a dummy to make plugins work at all
* qmake transparently creates VxWorks munching rules for static ctors
* made auto-test cope with missing OS features
A special note regarding the Q_FOREACH patch for dcc:
when calling foreach(a,c) with c being a function returning a container,
the compiler would generate 5 references to some labels (.LXXXX), which
are not there (so the linker complains in the end).
Seems like dcc doesn't really like the 'true ? 0 : <function call to get type>'
statement
Reviewed-By: Harald Fernengel
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/vxworks.prf | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/mkspecs/features/vxworks.prf b/mkspecs/features/vxworks.prf new file mode 100644 index 0000000..a910c69 --- /dev/null +++ b/mkspecs/features/vxworks.prf @@ -0,0 +1,63 @@ +# VxWorks Munching Feature +# When compiling C++ sources on VxWorks in kernel mode, all .o files have to +# be processed by the so-called 'munch' script which will generate +# additional code for static c'tors and d'tors. The resulting .c file has to +# be compiled in turn and linked to the executable. +# This can only been done when linking applications, since the munch script +# generates a .c file containing static symbols: linking a lib that was +# already munched to a munched application would lead to duplicate symbols! + +isEmpty(VXWORKS_MUNCH_EXT):VXWORKS_MUNCH_EXT = vxm +isEmpty(VXWORKS_MUNCH_TOOL):VXWORKS_MUNCH_TOOL = $(WIND_BASE)/host/resource/hutils/tcl/munch.tcl + + +!exists($$VXWORKS_MUNCH_TOOL) { + error("Could not find VxWorks Munch tool: '$${VXWORKS_MUNCH_TOOL}'. Please set the environment variable WIND_BASE correctly.") +} + +# The following scope is entered for any project that specifies 'shared' as well +# as for any project specifying neither 'shared', nor 'lib', nor 'staticlib'. +# This means that for a static build only the executable is munched, while for +# a shared build, every lib, plugin and executable is munched separately. + +shared|!staticlib:!lib { + *-dcc { + VXWORKS_MUNCH_CMD = (targ=`basename $(TARGET)`; \ + ddump -Ng \"$(TARGET)\" | tclsh $$VXWORKS_MUNCH_TOOL -c $$VXWORKS_ARCH_MUNCH >\"$(OBJECTS_DIR)/\$\${targ}_ctdt.c\" && \ + $$QMAKE_CC -c $$QMAKE_CFLAGS \"$(OBJECTS_DIR)/\$\${targ}_ctdt.c\" -o \"$(OBJECTS_DIR)/\$\${targ}_ctdt.o\" && \ + $$QMAKE_LINK $$QMAKE_LFLAGS -X -r5 -r4 \"$(OBJECTS_DIR)/\$\${targ}_ctdt.o\" \"$(TARGET)\" -o \"$(TARGET).munched\" && \ + mv \"$(TARGET).munched\" \"$(TARGET)\" && \ + chmod +x \"$(TARGET)\") + } + *-g++ { + VXWORKS_MUNCH_CMD = (targ=`basename $(TARGET)`; \ + nm \"$(DESTDIR)$(TARGET)\" | tclsh $$VXWORKS_MUNCH_TOOL -c $$VXWORKS_ARCH_MUNCH >\"$(OBJECTS_DIR)/\$\${targ}_ctdt.c\" && \ + $$QMAKE_CC -c $$QMAKE_CFLAGS -fdollars-in-identifiers \"$(OBJECTS_DIR)/\$\${targ}_ctdt.c\" -o \"$(OBJECTS_DIR)/\$\${targ}_ctdt.o\" && \ + $$QMAKE_LINK $$QMAKE_LFLAGS -nostdlib -Wl,-X -T $(WIND_BASE)/target/h/tool/gnu/ldscripts/link.OUT \"$(OBJECTS_DIR)/\$\${targ}_ctdt.o\" \"$(DESTDIR)$(TARGET)\" -o \"$(DESTDIR)$(TARGET).munched\" && \ + mv \"$(DESTDIR)$(TARGET).munched\" \"$(DESTDIR)$(TARGET)\" && \ + chmod +x \"$(DESTDIR)$(TARGET)\") + } + + # We need to create a dummy lib.a in case someone links against this lib. + # In VxWorks it's the responsibility of the run-time linker ld to resolve + # symbols, since there are no real shared libraries for the toolchain linker + # to link against. + + shared:contains(TEMPLATE, lib) { + VXWORKS_MUNCH_CMD += "&&" + VXWORKS_MUNCH_CMD += (atarg=`basename $(TARGET) .so.$${VERSION}`.a ; touch \"$(DESTDIR)\$\${atarg}\") + } + + QMAKE_POST_LINK = $$VXWORKS_MUNCH_CMD $$QMAKE_POST_LINK + silent:QMAKE_POST_LINK = @echo creating $@.$$VXWORKS_MUNCH_EXT && $$QMAKE_POST_LINK + + isEmpty(DESTDIR) { + target.targets += "`basename $(TARGET)`.$$VXWORKS_MUNCH_EXT" + QMAKE_DISTCLEAN += "`basename $(TARGET)`.$$VXWORKS_MUNCH_EXT" + } else { + target.targets += "$(DESTDIR)/`basename $(TARGET)`.$$VXWORKS_MUNCH_EXT" + QMAKE_DISTCLEAN += "$(DESTDIR)/`basename $(TARGET)`.$$VXWORKS_MUNCH_EXT" + } + *-g++:LIBS += -lgcc +} + |