qt5base-0002-mkspecs-files.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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,44 @@
  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. +BUILDROOT_CROSS_COMPILE =
  27. +BUILDROOT_COMPILER_CFLAGS =
  28. +BUILDROOT_COMPILER_CXXFLAGS =
  29. +BUILDROOT_INCLUDE_PATH =
  30. +
  31. +# modifications to g++.conf
  32. +QMAKE_CC = $${BUILDROOT_CROSS_COMPILE}gcc
  33. +QMAKE_CXX = $${BUILDROOT_CROSS_COMPILE}g++
  34. +QMAKE_LINK = $${QMAKE_CXX}
  35. +QMAKE_LINK_SHLIB = $${QMAKE_CXX}
  36. +
  37. +# modifications to linux.conf
  38. +QMAKE_AR = $${BUILDROOT_CROSS_COMPILE}ar cqs
  39. +QMAKE_OBJCOPY = $${BUILDROOT_CROSS_COMPILE}objcopy
  40. +QMAKE_NM = $${BUILDROOT_CROSS_COMPILE}nm -P
  41. +QMAKE_STRIP = $${BUILDROOT_CROSS_COMPILE}strip
  42. +
  43. +#modifications to gcc-base.conf
  44. +QMAKE_CFLAGS += $${BUILDROOT_COMPILER_CFLAGS}
  45. +QMAKE_CXXFLAGS += $${BUILDROOT_COMPILER_CXXFLAGS}
  46. +QMAKE_CXXFLAGS_RELEASE += -O3
  47. +INCLUDEPATH += $${BUILDROOT_INCLUDE_PATH}
  48. +
  49. +QMAKE_LIBS += -lrt -lpthread -ldl
  50. +
  51. +# device specific glue code
  52. +EGLFS_PLATFORM_HOOKS_SOURCES =
  53. +
  54. +# Sanity check
  55. +deviceSanityCheckCompiler()
  56. +
  57. +load(qt_config)
  58. Index: b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
  59. ===================================================================
  60. --- /dev/null
  61. +++ b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
  62. @@ -0,0 +1 @@
  63. +#include "../../linux-g++/qplatformdefs.h"