Howto add Qt support for geordi revised
It’s time to write revised instructions for how to add Qt support for Geordi. The following versions were used:
- GHC 6.10.2
- Geordi 2009-04-18 (from darcs repo, num patches: 425)
- Qt 4.5.0
Start with installing Qt inside Geordi rt:
./configure -prefix /path/to/geordi/rt/usr/local/Trolltech/Qt-4.5.0
make
make install
Add to prelude/prelude.hpp:
#include
Recompile prelude:
scripts/compile-prelude
Remove from compile-config/COMPILE_FLAGS:
-pedantic-errors
Add to compile-config/COMPILE_FLAGS:
-D_REENTRANT -DQT_SHARED -DQT_CORE_LIB -I/usr/local/Trolltech/Qt-4.5.0/include -I/usr/local/Trolltech/Qt-4.5.0/include/QtCore -I/usr/local/Trolltech/Qt-4.5.0/mkspecs/linux-g++
Add to compile-config/LINK_FLAGS:
-Wl,-rpath,/usr/local/Trolltech/Qt-4.5.0/lib -L/usr/local/Trolltech/Qt-4.5.0/lib -lQtCore -lz -lm -pthread -lrt -ldl -lpthread
Copy libz, libm, libpthread, librt and libdl to geordi rt.
Modify src/EvalCxx.hsc and add the following to the list of ignored syscalls:
SYS_set_tid_address, SYS_set_robust_list, SYS_futex
In src/Cxx/Operations.hs, replace
expand (Print c c') = expand $ Block ([Plain "cout << "] ++ c ++ [Plain ";"]) c'
with
expand (Print c c') = expand $ Block ([Plain "qDebug() << "] ++ c ++ [Plain ";"]) c'
Rebuild and install the bot:
runhaskell Setup.hs build
sudo runhaskell Setup.hs install
That's it! Enjoy Geordi with Qt support! Thanks to Eelis for the tip about ignored syscalls!
July 3rd, 2009 at 22:19
Side note: While updating the bot of mine and following these instructions I noticed that the prelude needs to be naturally compiled after modifying the compile-config. 😉