ltp-testsuite.mk 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ################################################################################
  2. #
  3. # ltp-testsuite
  4. #
  5. ################################################################################
  6. LTP_TESTSUITE_VERSION = 20200515
  7. LTP_TESTSUITE_SOURCE = ltp-full-$(LTP_TESTSUITE_VERSION).tar.xz
  8. LTP_TESTSUITE_SITE = https://github.com/linux-test-project/ltp/releases/download/$(LTP_TESTSUITE_VERSION)
  9. LTP_TESTSUITE_LICENSE = GPL-2.0, GPL-2.0+
  10. LTP_TESTSUITE_LICENSE_FILES = COPYING
  11. LTP_TESTSUITE_CONF_OPTS += \
  12. --with-realtime-testsuite --with-open-posix-testsuite
  13. ifeq ($(BR2_LINUX_KERNEL),y)
  14. LTP_TESTSUITE_DEPENDENCIES += linux
  15. LTP_TESTSUITE_MAKE_ENV += $(LINUX_MAKE_FLAGS)
  16. LTP_TESTSUITE_CONF_OPTS += --with-linux-dir=$(LINUX_DIR)
  17. else
  18. LTP_TESTSUITE_CONF_OPTS += --without-modules
  19. endif
  20. # We change the prefix to a custom one, otherwise we get scripts and
  21. # directories directly in /usr, such as /usr/runalltests.sh
  22. LTP_TESTSUITE_CONF_OPTS += --prefix=/usr/lib/ltp-testsuite
  23. # Needs libcap with file attrs which needs attr, so both required
  24. ifeq ($(BR2_PACKAGE_LIBCAP)$(BR2_PACKAGE_ATTR),yy)
  25. LTP_TESTSUITE_DEPENDENCIES += libcap
  26. else
  27. LTP_TESTSUITE_CONF_ENV += ac_cv_lib_cap_cap_compare=no
  28. endif
  29. # No explicit enable/disable options
  30. ifeq ($(BR2_PACKAGE_NUMACTL),y)
  31. LTP_TESTSUITE_DEPENDENCIES += numactl
  32. else
  33. LTP_TESTSUITE_CONF_ENV += have_numa_headers=no
  34. endif
  35. # ltp-testsuite uses <fts.h>, which isn't compatible with largefile
  36. # support.
  37. LTP_TESTSUITE_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))
  38. LTP_TESTSUITE_CPPFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))
  39. LTP_TESTSUITE_LIBS =
  40. ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
  41. LTP_TESTSUITE_DEPENDENCIES += libtirpc host-pkgconf
  42. LTP_TESTSUITE_CFLAGS += "`$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`"
  43. LTP_TESTSUITE_LIBS += "`$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`"
  44. endif
  45. ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
  46. LTP_TESTSUITE_DEPENDENCIES += musl-fts
  47. LTP_TESTSUITE_LIBS += -lfts
  48. endif
  49. LTP_TESTSUITE_CONF_ENV += \
  50. CFLAGS="$(LTP_TESTSUITE_CFLAGS)" \
  51. CPPFLAGS="$(LTP_TESTSUITE_CPPFLAGS)" \
  52. LIBS="$(LTP_TESTSUITE_LIBS)" \
  53. SYSROOT="$(STAGING_DIR)"
  54. # uclibc: bessel support normally not enabled
  55. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  56. LTP_TESTSUITE_UNSUPPORTED_TEST_CASES = \
  57. testcases/misc/math/float/bessel/ \
  58. testcases/misc/math/float/float_bessel.c
  59. else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
  60. LTP_TESTSUITE_UNSUPPORTED_TEST_CASES = \
  61. testcases/kernel/sched/process_stress/process.c \
  62. testcases/kernel/syscalls/confstr/confstr01.c \
  63. testcases/kernel/syscalls/fmtmsg/fmtmsg01.c \
  64. testcases/kernel/syscalls/getcontext/getcontext01.c \
  65. testcases/kernel/syscalls/getdents/getdents01.c \
  66. testcases/kernel/syscalls/getdents/getdents02.c \
  67. testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c \
  68. testcases/kernel/syscalls/timer_create/timer_create01.c \
  69. testcases/kernel/syscalls/timer_create/timer_create03.c \
  70. utils/benchmark/ebizzy-0.3
  71. endif
  72. define LTP_TESTSUITE_REMOVE_UNSUPPORTED_TESTCASES
  73. $(foreach f,$(LTP_TESTSUITE_UNSUPPORTED_TEST_CASES),
  74. rm -rf $(@D)/$(f)
  75. )
  76. endef
  77. LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED_TESTCASES
  78. # ldd command build system tries to build a shared library unconditionally.
  79. ifeq ($(BR2_STATIC_LIBS),y)
  80. define LTP_TESTSUITE_REMOVE_LDD
  81. rm -rf $(@D)/testcases/commands/ldd
  82. endef
  83. LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_LDD
  84. endif
  85. $(eval $(autotools-package))