qt5base-mkspecs-files.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Add a Buildroot 'device' to ease cross-compilation
  2. Qt5 has a mechanism to support "device" profiles, so that people can
  3. specify the compiler, compiler flags and so on for a specific device.
  4. We leverage this mechanism in the Buildroot packaging of qt5 to
  5. simplify cross-compilation: we have our own "device" definition, which
  6. allows us to easily pass the cross-compiler paths and flags from our
  7. qt5.mk.
  8. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  9. Index: b/mkspecs/devices/linux-buildroot-g++/qmake.conf
  10. ===================================================================
  11. --- /dev/null
  12. +++ b/mkspecs/devices/linux-buildroot-g++/qmake.conf
  13. @@ -0,0 +1,38 @@
  14. +MAKEFILE_GENERATOR = UNIX
  15. +CONFIG += incremental gdb_dwarf_index
  16. +QMAKE_INCREMENTAL_STYLE = sublib
  17. +
  18. +include(../../common/linux.conf)
  19. +include(../../common/gcc-base-unix.conf)
  20. +include(../../common/g++-unix.conf)
  21. +
  22. +load(device_config)
  23. +
  24. +QT_QPA_DEFAULT_PLATFORM = eglfs
  25. +
  26. +CROSS_COMPILE =
  27. +COMPILER_CFLAGS =
  28. +COMPILER_CXXFLAGS =
  29. +
  30. +# modifications to g++.conf
  31. +QMAKE_CC = $${CROSS_COMPILE}gcc
  32. +QMAKE_CXX = $${CROSS_COMPILE}g++
  33. +QMAKE_LINK = $${QMAKE_CXX}
  34. +QMAKE_LINK_SHLIB = $${QMAKE_CXX}
  35. +
  36. +# modifications to linux.conf
  37. +QMAKE_AR = $${CROSS_COMPILE}ar cqs
  38. +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
  39. +QMAKE_STRIP = $${CROSS_COMPILE}strip
  40. +
  41. +#modifications to gcc-base.conf
  42. +QMAKE_CFLAGS += $${COMPILER_CFLAGS}
  43. +QMAKE_CXXFLAGS += $${COMPILER_CXXFLAGS}
  44. +QMAKE_CXXFLAGS_RELEASE += -O3
  45. +
  46. +QMAKE_LIBS += -lrt -lpthread -ldl
  47. +
  48. +# Sanity check
  49. +deviceSanityCheckCompiler()
  50. +
  51. +load(qt_config)
  52. Index: b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
  53. ===================================================================
  54. --- /dev/null
  55. +++ b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
  56. @@ -0,0 +1 @@
  57. +#include "../../linux-g++/qplatformdefs.h"