qconf-cfg.sh 1016 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0-only
  3. cflags=$1
  4. libs=$2
  5. bin=$3
  6. PKG5="Qt5Core Qt5Gui Qt5Widgets"
  7. PKG6="Qt6Core Qt6Gui Qt6Widgets"
  8. if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then
  9. echo >&2 "*"
  10. echo >&2 "* 'make xconfig' requires '${HOSTPKG_CONFIG}'. Please install it."
  11. echo >&2 "*"
  12. exit 1
  13. fi
  14. if ${HOSTPKG_CONFIG} --exists $PKG6; then
  15. ${HOSTPKG_CONFIG} --cflags ${PKG6} > ${cflags}
  16. # Qt6 requires C++17.
  17. echo -std=c++17 >> ${cflags}
  18. ${HOSTPKG_CONFIG} --libs ${PKG6} > ${libs}
  19. ${HOSTPKG_CONFIG} --variable=libexecdir Qt6Core > ${bin}
  20. exit 0
  21. fi
  22. if ${HOSTPKG_CONFIG} --exists $PKG5; then
  23. ${HOSTPKG_CONFIG} --cflags ${PKG5} > ${cflags}
  24. ${HOSTPKG_CONFIG} --libs ${PKG5} > ${libs}
  25. ${HOSTPKG_CONFIG} --variable=host_bins Qt5Core > ${bin}
  26. exit 0
  27. fi
  28. echo >&2 "*"
  29. echo >&2 "* Could not find Qt6 or Qt5 via ${HOSTPKG_CONFIG}."
  30. echo >&2 "* Please install Qt6 or Qt5 and make sure it's in PKG_CONFIG_PATH"
  31. echo >&2 "* You need $PKG6 for Qt6"
  32. echo >&2 "* You need $PKG5 for Qt5"
  33. echo >&2 "*"
  34. exit 1