Skip to main content

Qt 4.6-beta1 on FreeBSD

Posted in

A long-expected release of Qt 4.6 is coming out very soon. This is a great event because it brings in a lot of new features. As for me, the one I was looking for is the state machine framework.

So, lets see what it will take us to have it running on FreeBSD. Since Qt 4.6 release is in future we will try to do this with Qt 4.6-beta1. (I don't think there will be any big difference in Qt 4.6 compilation from Qt 4.6-beta1 compilation... but if there is, I'll let you know).

So, we have got Qt's sources. Unpack it.

$ tar xfz qt-everywhere-opensource-src-4.6.0-beta1.tar.gz
$ cd qt-everywhere-opensource-src-4.6.0-beta1

Just like its predecessor, Qt 4.6 didn't like freebsd-g++ as QMAKESPEC, so the compilation failed. That's why I used freebsd-g++34.

$ setenv QMAKESPEC freebsd-g++34


$ ./configure -prefix /usr/local/qt-4.6.0b1 -opensource -no-accessibility -no-qt3support -no-webkit -nomake demos -nomake examples

$ gmake

Take a deep breath... Qt is being compiled...
My compilation lasted for 1 hour and a half on my 2GHz Core 2 Duo.

Attention: I'm using gmake, not make. Webkit and script modules don't compile with make. If you use make, the compilation will fail stating that Qt cannot find Web{Kit,Core}.pro and Which is strange because they are there. Looks like their Makefiles contains some GNU make's specific stuff.

I used to disable WebKit because I don't use it, so I that was the case I could have compiled Qt with BSD's make. The thing is that I use Qt Creator and this IDE requires WebKit and script modules compiled.

During the configure stage you might see these warnings

WARNING: Failure to find: src/3rdparty/javascriptcore/JavaScriptCore/../WebKit/qt/WebKit_pch.h
WARNING: Failure to find: generated/release/chartables.c
WARNING: Failure to find: generated/release/Grammar.cpp
  for src/3rdparty/webkit/WebKit/qt/Plugins/
WARNING: src/3rdparty/webkit/WebKit/qt/Plugins/ Unable to find file for inclusion ../../WebKit.pri

Well, it seems like Nokia guys missed something and we'll hope they fix this issue by the time the release comes out.


$ sudo gmake install

Add these environment variable settings to your shell's config (.tcshrc for me)

setenv QTDIR /usr/local/qt-4.6.0b1
setenv PATH QTDIR/bin:$PATH

Qt is ready, so why not start programming. By the way it will be a good idea to use Qt Creator 1.3.

Post new comment

The content of this field is kept private and will not be shown publicly.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
 o       o         o      O  o      o      O 
O O o O o O O o
o o o O o o O
o O oO o oO
O o OoOo. O Oo O o Oo
OoO o o o o o OoO o o
o O o O O O O o O O O
O o O o o' O o O o O o

Enter the code depicted in ASCII art style.