Proper use of prefix, extprefix, and sysroot during configure



  • I'm at a loss for the proper way to call configure and make use of prefix, extprefix, sysroot, etc. I always end up with a misconfigured system. Here is my situation (paths are shortened a bit to make this easier to read):

    • I have a sysroot in /home/steve/sysroot.
    • I want to install into /home/steve/nfs, which is the NFS root of my ARM device.

    When I run "make install", I end up with files installed into:

    • /home/steve/nfs/*
    • /home/steve/nfs/home/steve/nfs/*
    • /home/steve/sysroot/home/steve/nfs/*

    I've been able to circumvent this (I think) by making symlinks in the second two locations, pointing back to the first.

    When I add the qmake to Creator (or write a program to query the paths using "QLibraryInfo::location(QLibraryInfo::PrefixPath)", for example), the paths all begin /home/steve/nfs, when they really should begin with "/".

    Using the example paths above, my configure command line would be something like

    • ./configure -sysroot /home/steve/sysroot -prefix /home/steve/nfs -extprefix /home/steve/nfs <other stuff>

    I've tried different ways of doing this, like completely omitting extprefix or prefix. When I try to use "-prefix /", I get the following error when I try to run make:

    @/home/steve/qt-arm-5.3.0/qtbase/mkspecs/features/qt_module_pris.prf:116: Cannot write file /home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/mkspecs/modules-inst/qt_lib_bootstrap_private.pri: Cannot create parent directory.@

    It's strange that a simple "make" would try to do something with the target. I've re-run this as root (not very safe), but it will fail much later on with something else (I forget the error).

    What is the proper way to call configure in my situation?

    Note: There is already a post about this problem "here":http://qt-project.org/forums/viewthread/43676/, which I would like to delete since this post more clearly states the problem, but I can't figure out how...



  • From what I read in the configure help I think that you need to use extprefix and don't use prefix. Because prefix will be appended to sysroot and extprefix will not.
    @
    -prefix <dir> ...... This will install everything relative to <dir> (default /usr/local/Qt-5.3.0, $PWD if -developer-build is active)

    -extprefix <dir> ... When -sysroot is used, install everything to <dir>, rather than into SYSROOT/PREFIX.

    -sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot and also sets pkg-config paths.
    @

    Try this command line:
    @
    ./configure -sysroot /home/steve/sysroot -extprefix /home/steve/nfs <other stuff>
    @



  • Yeah, from what I read in the help I had that impression too. I just tried it again to be sure, no luck. Omitting -prefix results in the same paths.

    The worst part of all this? It takes quite a long time for each iteration to see if it worked or not, since Qt needs to be built.

    I should also mention that I'm starting with a freshly untarred source tree every single time, just in case.



  • So, omitting -prefix results in the paths being:

    @QLibraryInfo::PrefixPath = /usr/local/Qt-5.3.0
    QLibraryInfo::DocumentationPath = /usr/local/Qt-5.3.0/doc
    QLibraryInfo::HeadersPath = /usr/local/Qt-5.3.0/include
    QLibraryInfo::LibrariesPath = /usr/local/Qt-5.3.0/lib
    QLibraryInfo::LibraryExecutablesPath = /usr/local/Qt-5.3.0/libexec
    QLibraryInfo::BinariesPath = /usr/local/Qt-5.3.0/bin
    QLibraryInfo::PluginsPath = /usr/local/Qt-5.3.0/plugins
    QLibraryInfo::ImportsPath = /usr/local/Qt-5.3.0/imports
    QLibraryInfo::Qml2ImportsPath = /usr/local/Qt-5.3.0/qml
    QLibraryInfo::ArchDataPath = /usr/local/Qt-5.3.0
    QLibraryInfo::DataPath = /usr/local/Qt-5.3.0
    QLibraryInfo::TranslationsPath = /usr/local/Qt-5.3.0/translations
    QLibraryInfo::ExamplesPath = /usr/local/Qt-5.3.0/examples
    QLibraryInfo::TestsPath = /usr/local/Qt-5.3.0/tests
    QLibraryInfo::SettingsPath = /usr/local/Qt-5.3.0/etc/xdg@

    On my target, the files were installed to / instead of /usr/local/Qt-5.3.0. So, they're still not correct, and the files are not where it thinks they are.

    The paths reported by Creator are also wrong (unless they're supposed to be the host's view of things, in which case it might be correct...?) are:

    @QT_HOST_BINS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/bin
    QT_HOST_DATA=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS
    QT_HOST_LIBS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/lib
    QT_HOST_PREFIX=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS
    QT_INSTALL_ARCHDATA=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS
    QT_INSTALL_BINS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/bin
    QT_INSTALL_CONFIGURATION=/usr/local/Qt-5.3.0/etc/xdg
    QT_INSTALL_DATA=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS
    QT_INSTALL_DEMOS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/examples
    QT_INSTALL_DOCS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/doc
    QT_INSTALL_EXAMPLES=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/examples
    QT_INSTALL_HEADERS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/include
    QT_INSTALL_IMPORTS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/imports
    QT_INSTALL_LIBEXECS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/libexec
    QT_INSTALL_LIBS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/lib
    QT_INSTALL_PLUGINS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/plugins
    QT_INSTALL_PREFIX=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS
    QT_INSTALL_QML=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/qml
    QT_INSTALL_TESTS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/tests
    QT_INSTALL_TRANSLATIONS=/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS/translations
    QT_SYSROOT=/home/steve/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi@

    Qt be confused.



  • Has anyone done a cross-compiled Qt5 for embedded like this? Someone must have...



  • Bump... ? LOL

    Anyone have any ideas on this problem?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.