Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtDeclarative -> how to add config opts for external submodules before buidling



  • Hello,
    well usually I'm building a qt-everywhere package which includes all submodules & I can pass some flags at configure stage like -no-feature-qml-debug but when I try to build single modules like qt-base first I can't apply -no-feature-qml-debug anymore and it fails but I need to adjust & set some flags for qtdeclarative because this package fails without -no-feature-qml-debug too.

    Normally I would run qmake in the submodule folder -> how can I add build opts for a single module as a single package when qt-base ist already built.
    Config error:

    supervisedthinking@x220l:~/development/LibreELEC-RR$ PROJECT=Generic ARCH=x86_64 BUILD_PERIODIC=RR BUILDER_NAME=TS BUILDER_VERSION=9.80 scripts/build qt5-base
    BUILD      qt5-base (target)
        TOOLCHAIN      configure (auto-detect)
    Preparing build tree...
    Creating qmake...
    .Done.
    ERROR: Unknown command line option '-no-qml-debug'.
    

    e.g. of my build environment:

    QtBase package

    PKG_NAME="qt5-base"
    PKG_VERSION="5.15.2"
    PKG_SHA256="909fad2591ee367993a75d7e2ea50ad4db332f05e1c38dd7a5a274e156a4e0f8"
    PKG_LICENSE="GPL"
    PKG_SITE="http://qt-project.org"
    PKG_URL="https://download.qt.io/archive/qt/${PKG_VERSION%.*}/${PKG_VERSION}/submodules/qtbase-everywhere-src-${PKG_VERSION}.tar.xz"
    PKG_DEPENDS_TARGET="toolchain libjpeg-turbo libpng pcre2 sqlite zlib freetype libxkbcommon"
    PKG_LONGDESC="A cross-platform application and UI framework"
    PKG_BUILD_FLAGS="-gold"
    
    configure_package() {
      # Build with OpenGL / OpenGLES support
      if [ "${OPENGL_SUPPORT}" = "yes" ]; then
        PKG_DEPENDS_TARGET+=" ${OPENGL}"
      elif [ "${OPENGLES_SUPPORT}" = "yes" ]; then
        PKG_DEPENDS_TARGET+=" ${OPENGLES}"
      fi
    
      # Build with XCB support for X11
      if [ ${DISPLAYSERVER} = "x11" ]; then
        PKG_DEPENDS_TARGET+=" xcb-util xcb-util-image xcb-util-keysyms xcb-util-renderutil xcb-util-wm"
      fi
    }
    
    pre_configure_target() {
      PKG_CONFIGURE_OPTS_TARGET="-prefix /usr
                                 -sysroot ${SYSROOT_PREFIX}
                                 -hostprefix ${TOOLCHAIN}
                                 -device linux-libreelec-g++
                                 -device-option CROSS_COMPILE=${TARGET_PREFIX}
                                 -fontconfig
                                 -opensource -confirm-license
                                 -release
                                 -shared
                                 -make libs
                                 -nomake examples -no-compile-examples
                                 -nomake tests
                                 -ccache
                                 -force-pkg-config
                                 -silent
                                 -no-use-gold-linker
                                 -no-ltcg
                                 -no-rpath
                                 -system-libjpeg
                                 -system-libpng
                                 -system-pcre
                                 -system-sqlite
                                 -system-zlib
                                 -no-accessibility
                                 -no-cups
                                 -no-evdev
                                 -no-glib
                                 -no-harfbuzz
                                 -no-iconv
                                 -no-icu
                                 -no-libproxy
                                 -no-mtdev
                                 -no-sql-mysql
                                 -no-strip
                                 -no-tslib
                                 -no-feature-linuxfb
                                 -no-feature-vulkan
                                 -no-feature-printer
                                 -no-feature-vnc"
    
      # Build with OpenGL or OpenGLES support
      if [ "${OPENGL_SUPPORT}" = "yes" ]; then
        PKG_CONFIGURE_OPTS_TARGET+=" -opengl -no-eglfs"
      elif [ "${OPENGLES_SUPPORT}" = "yes" ]; then
        PKG_CONFIGURE_OPTS_TARGET+=" -opengl es2"
      fi
    
      # Build only Generic with reduced relocations https://bugreports.qt.io/browse/QTBUG-36129
      if [ ${ARCH} = "x86_64" ]; then
        PKG_CONFIGURE_OPTS_TARGET+=" -reduce-relocations"
      fi
    }
    
    configure_target() {
      # Create working dir
      mkdir -p ${PKG_BUILD}/.${TARGET_NAME}
      cd ${PKG_BUILD}/.${TARGET_NAME}
    
      # Fix cross compiling
      sed -e "s#QMAKE_CFLAGS_ISYSTEM        = -isystem#QMAKE_CFLAGS_ISYSTEM        = -I#" -i ${PKG_BUILD}/mkspecs/common/gcc-base.conf
    
      # Create mkspecs file
      QMAKE_CONF_DIR="${PKG_BUILD}/mkspecs/devices/linux-libreelec-g++"
      QMAKE_CONF="${QMAKE_CONF_DIR}/qmake.conf"
      mkdir -p ${QMAKE_CONF_DIR}
    
      # Set QMake Platform Flags
      echo "MAKEFILE_GENERATOR       = UNIX"           > ${QMAKE_CONF}
      echo "CONFIG                  += incremental"   >> ${QMAKE_CONF}
      echo "QMAKE_INCREMENTAL_STYLE  = sublib"        >> ${QMAKE_CONF}
      echo "include(../../common/linux.conf)"         >> ${QMAKE_CONF}
      echo "include(../../common/gcc-base-unix.conf)" >> ${QMAKE_CONF}
      echo "include(../../common/g++-unix.conf)"      >> ${QMAKE_CONF}
      echo "load(device_config)"                      >> ${QMAKE_CONF}
      echo "QMAKE_CC                = ${CC}"          >> ${QMAKE_CONF}
      echo "QMAKE_CXX               = ${CXX}"         >> ${QMAKE_CONF}
      echo "QMAKE_LINK              = ${CXX}"         >> ${QMAKE_CONF}
      echo "QMAKE_LINK_SHLIB        = ${CXX}"         >> ${QMAKE_CONF}
      echo "QMAKE_AR                = ${AR} cqs"      >> ${QMAKE_CONF}
      echo "QMAKE_OBJCOPY           = ${OBJCOPY}"     >> ${QMAKE_CONF}
      echo "QMAKE_NM                = ${NM} -P"       >> ${QMAKE_CONF}
      echo "QMAKE_STRIP             = ${STRIP}"       >> ${QMAKE_CONF}
      echo "QMAKE_CFLAGS            = ${CFLAGS}"      >> ${QMAKE_CONF}
      echo "QMAKE_CXXFLAGS          = ${CXXFLAGS}"    >> ${QMAKE_CONF}
      echo "QMAKE_LFLAGS            = ${LDFLAGS}"     >> ${QMAKE_CONF}
      # Set Mesa 3D OpenGL ES based project flags
      if [ "${OPENGLES}" = "mesa" ]; then
        echo "QMAKE_LIBS_EGL += -lEGL"              >> ${QMAKE_CONF}
        echo "EGLFS_DEVICE_INTEGRATION = eglfs_kms" >> ${QMAKE_CONF}
      fi
      echo "load(qt_config)"                            >> ${QMAKE_CONF}
      echo '#include "../../linux-g++/qplatformdefs.h"' >> ${QMAKE_CONF_DIR}/qplatformdefs.h
    
      unset CC CXX LD RANLIB AR AS CPPFLAGS CFLAGS LDFLAGS CXXFLAGS
      export QT_FORCE_PKGCONFIG=yes
      ${PKG_BUILD}/configure ${PKG_CONFIGURE_OPTS_TARGET}
    }
    

    QtDeclarative package

    PKG_NAME="qt5-declarative"
    PKG_VERSION="5.15.2"
    PKG_SHA256="c600d09716940f75d684f61c5bdaced797f623a86db1627da599027f6c635651"
    PKG_LICENSE="GPL2"
    PKG_SITE="http://qt-project.org"
    PKG_URL="http://download.qt.io/archive/qt/${PKG_VERSION%.*}/${PKG_VERSION}/submodules/qtdeclarative-everywhere-src-${PKG_VERSION}.tar.xz"
    PKG_DEPENDS_TARGET="qt5-base"
    PKG_LONGDESC="Classes for QML and JavaScript languages"
    PKG_TOOLCHAIN="configure"
    
    configure_target() {
      # Create working dir
      mkdir -p ${PKG_BUILD}/.${TARGET_NAME}
      cd ${PKG_BUILD}/.${TARGET_NAME}
      qmake ${PKG_BUILD}
    }
    


  • I found this https://github.com/qt/qtdeclarative/blob/5.15.2/src/qml/configure.json#L11 but how can I disable this option in qt-declarative



  • Build log:
    https://pastebin.com/2y6AhZ8N

    All in all it probably comes down to Qt awful buildsystem which pulls in wrong header files . It builds the complete qt5 package fine but fails to build qtdeclarative separately with exakt the same build options for qtbase and with the same qmake & mkspecs config. I guess cross compiling Qt5 boils down to never touch a running system or you end up with a trainwreck and clusterf$%&


Log in to reply