I have been trying to get Qt X11 cross compiled for PowerPC for a while now and kept having various problems.
From the information given my Qt support, all one needs to do is:
mkspec/
I used linux-g++ and modified it.Run the following configure command:
./configure -arch <your arch> -xplatform <your mkspec> -prefix <where you want Qt installed> <other options>
After configure is done, run make
then make install
. You'll find Qt installed in the directory you specified in the -prefix
option.
Had all kinds of problems doing this.
My solution:
mkspecs/linux-g++
to mkspecs/linux-g++-<my arch>
mkspecs/linux-g++/qmake.conf
as in the example below. Read the comments in the example file for specificsqplatformdefs.h
, though you might for your architecturemake
and make install
moc
, uic
, etc. have been compiled for your host, so they will generate code accordingly./libs
from where you install Qt to your targets lib
folder or you can put it into some other folder and set your LD_LIBRARY_PATH to include the Qt lib
folder.# # qmake configuration for linux-g++-ppc_74xx # MAKEFILE_GENERATOR = UNIX TEMPLATE = app CONFIG += qt warn_on release incremental link_prl QT += core gui QMAKE_INCREMENTAL_STYLE = sublib include(../common/g++.conf) include(../common/linux.conf) # # Modifications to g++.conf # # my_arch-g++ is the full executable path of your g++, make sure your PATH # contains the directory for your toolchain # QMAKE_CC = my_arch-g++ QMAKE_CXX = my_arch-g++ QMAKE_LINK = my_arch-g++ QMAKE_LINK_SHLIB = my_arch-g++ # # I had to provide includes and libraries for packages my toolchain does not # provide this is mostly X11 and glib stuff. You'll either have to # cross-compile it yourself or get it from your distribution # QMAKE_CFLAGS = -I/path/to/your/includes \ -L/path/to/your/libs QMAKE_CXXFLAGS = $$QMAKE_CFLAGS # # Modifications to linux.conf # # Same as g++ stuff above # QMAKE_AR = my_arch-ar cqs QMAKE_OBJCOPY = my_arch-objcopy QMAKE_STRIP = my_arch-strip # # I had all kinds of problems linking Qt source with X11 depending on how I # specified the include paths. My toolchain provided most X11 functionality # and I just had to add missing parts in the CXXFLAGS and CFLAGS, # but specifying exactly where to find X11 includes and libraries specific # to my toolchain fixed some of the issues I experienced # QMAKE_INCDIR_X11 = /path/to/your/toolchain/includes QMAKE_LIBDIR_X11 = /path/to/your/toolchain/libs load(qt_config)
UPDATE:
This solution will work for "stand-alone" compilation. If you need to build Qt X11 for Angstrom, OpenEmbedded, Android, OpenWRT, etc. you'll have to use their respective build systems for proper compilation. For example, for OpenEmbedded targets (i.e. Angstrom), you'll have to write a BitBake recipe.
This problem occurred due to a need for supporting legacy systems. Using Embedded Qt was not an option. For new projects, I would strongly recommend the use of Embedded Qt.