qconf-cfg.sh 1020 B

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