I tried to build static Qt library with the following command:
./configure --prefix=/usr/local/qt --static --accessibility --multimedia --audio-backend --svg --webkit --javascript-jit --script --scripttools --declarative --dbus --debug
But I got a message said:
WARNING: Using static linking will disable the WebKit module.
Is that possible to build static Qt library with all modules enabled? and how?
Thanks
Might be because parts of it are LGPL. So, it's probably possible, but the LGPL would mean that you have to provide source or compiled object code so that an end-user could relink against their own version.
If you are not deploying the result to anyone, then you could probably do it and comply.
You'll have to edit the build to actually do it though, since it looks like they comply with LGPL by default.
For Qt 4.8.3 I had to patch the .pro files to make a single QtWebKit instead of separate WebKit and JavaScriptCore libraries. The linker gets confused because there are inter-dependencies between the two libraries.
Not sure if a similar approach will work for your Qt 4.7.1.
I'm not going to mention the licensing issues.
Almost impossible. Webkit uses stand along makefiles other than the makefiles generated by configure tool. You can check
src\3rdparty\webkit\source
yourself.If you tried to compile Qt static with webkit, you'll meet a error says cannot find -lwebcore. In fact, the webcore.a is generated at
src\3rdparty\webkit\source\webcore\release
, so does -ljscore. But if you copy them to /lib yourslef, link error always popup.I've tried to edit makefiles of webcore and jscore adding
-static
, but it didn't work at all.Sadly, that's all what I got now.
Nothing to do with LGPL issues, since your app could be open source and licensed in a way that would be compatible with the LGPL.
Apparently statically linked WebKit is unsupported for technical reasons. (Some compilers seem to not be happy with it). The build script has been updated in commit 4221d629e2cf37ee8c5ba7cb595b05ab8c82f113 to explicitly prevent it:
https://www.qt.gitorious.org/qt/qt/commit/4221d629e2cf37ee8c5ba7cb595b05ab8c82f113
It may or may not work with your compiler, but I suspect the Qt team didn't want to go into the trouble of maintaining that for all the officially supported architectures.
Well, Lou Franco is right, using the LGPL and compiling statically does not really comply the LGPL. What most Qt "users" or developers do is, to compile dynamically, prividing their "own compiled" libraries in the application directory. This is okay with the LGPL as long as you did not change any code in Qt / QtWebKit / WebKit itself and did not provide the changes to upstream.