I'm looking at all the options that can be run for the configure
script provided with Qt. (specifically qt-everywhere-opensource-src-5.2.0).
After considerable searching, I've determined this stuff is poorly documented at best so I was hoping I could get some help. When I look at the descriptions for prefix
and sysroot
configuration options:
~/qt-everywhere-opensource-src-5.2.0$ ./configure -help | grep "sysroot"
-extprefix<dir>
... When -sysroot is used, install everything to<dir>
,
-sysroot<dir>
...... Sets<dir>
as the target compiler's and qmake's sysroot and also sets pkg-config paths.
-no-gcc-sysroot ..... When using -sysroot, it disables the passing of --sysroot to the compiler
~/qt-everywhere-opensource-src-5.2.0$ ./configure -help | grep "prefix"
-prefix<dir>
...... This will install everything relative to<dir>
-extprefix<dir>
... When -sysroot is used, install everything to<dir>
,
-hostprefix [dir] .. Tools and libraries needed when developing
So I've used -prefix
before, and it did exactly as described. It placed everything at the provided <dir>
, then when I built my application using <prefix_dir>/bin/qmake
and installed that on my target platform it wanted to find all the shared object libraries at <prefix_dir>/lib
.
I'm under the impressions that if I use -sysroot
it will install everything at <sysroot_dir>
then when I install my application on the target platform it will search in /lib
. At least I hope that's true.
Now if my assumption is correct... then what's the point of -extprefix
? Are they saying that if I can redirect where things good if I use both -sysroot
and -extprefix
?
And what would be a reason why I would want to use -no-gcc-sysroot
? If I wanted my Qt libs to be installed at "sysroot" why wouldn't I want gcc
to use/know the same sysroot?
An explanation of some of these would be great, even better if I can get some practical examples of how to correctly use these options.
These are options that are used when building embedded platforms. Yes they are a royal mess. So here's only a partial answer:
To add to the confusion:
Which flags you want to use when compiling for a target not your host, depends on a boatload of hardcoded assumptions inside configure.
generally -sysroot plus -prefix should work for most use cases.
i.e. when you have:
$ ls ~/mytarget
lib bin share dev
you could just use -sysroot ~/mytarget -prefix /