Skip to content

Commit

Permalink
qt5-build.eclass: qt5_base_configure(): Copy generated qconfig_p.h to…
Browse files Browse the repository at this point in the history
… appropriate directory.

configure (in all qtbase packages) generates:
  ${QT5_BUILD_DIR}/src/corelib/global/qconfig.h
  ${QT5_BUILD_DIR}/src/corelib/global/qconfig_p.h
  ${QT5_BUILD_DIR}/src/corelib/global/qconfig.cpp

qt5_qmake in src/corelib directory (run only in dev-qt/qtcore) generates:
  ${QT5_BUILD_DIR}/include/QtCore/qconfig.h with content:
    #include "../../src/corelib/global/qconfig.h"
  ${QT5_BUILD_DIR}/include/QtCore/${Qt_Version}/QtCore/private/qconfig_p.h with content:
    #include "../../../../../src/corelib/global/qconfig_p.h"

qconfig.h and qconfig_p.h define various macros with values possibly dependent on flags passed to configure.
Many of these macros are QT_FEATURE_*, which are usually used through QT_CONFIG macro.

/usr/include/qt5/QtCore/${Qt_Version}/QtCore/private/qconfig_p.h installed by dev-qt/qtcore contains e.g.:
  #define QT_FEATURE_dbus -1
  #define QT_FEATURE_dbus_linked -1
  #define QT_FEATURE_gui -1
  #define QT_FEATURE_widgets -1

${QT5_BUILD_DIR}/src/corelib/global/qconfig_p.h generated by configure for dev-qt/qtgui[dbus]
contains desired values such as:
  #define QT_FEATURE_dbus 1
  #define QT_FEATURE_dbus_linked 1
  #define QT_FEATURE_gui 1
  #define QT_FEATURE_widgets -1

However this header is not used and '#include <QtCore/private/qconfig_p.h>' could not include it from this location.
Previously qtbase packages other than dev-qt/qtcore were using /usr/include/qt5/QtCore/${Qt_Version}/QtCore/private/qconfig_p.h
installed by dev-qt/qtcore.

qt5_base_configure() already copies ${QT5_BUILD_DIR}/src/corelib/global/qconfig.h to include/QtCore directory
to prevent using of /usr/include/qt5/QtCore/qconfig.h at build time.
qt5_base_configure() is hereby fixed to also copy ${QT5_BUILD_DIR}/src/corelib/global/qconfig_p.h to include/QtCore/private directory
to prevent using of /usr/include/qt5/QtCore/${Qt_Version}/QtCore/private/qconfig_p.h at build time.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <[email protected]>
  • Loading branch information
Arfrever Frehtes Taifersar Arahesis authored and Arfrever Frehtes Taifersar Arahesis committed Sep 16, 2022
1 parent 4b780da commit eb759b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eclass/qt5-build.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ qt5_base_configure() {
basedir=""
fi
cp src/corelib/global/qconfig.h "${basedir}"include/QtCore/ || die
if [[ ${PN} != qtcore ]]; then
mkdir "${basedir}"include/QtCore/private || die
cp src/corelib/global/qconfig_p.h "${basedir}"include/QtCore/private/ || die
fi

popd >/dev/null || die

Expand Down

0 comments on commit eb759b4

Please sign in to comment.