git: fix build with with no threads
[buildroot-gz.git] / package / ltp-testsuite / ltp-testsuite.mk
blob29f374beda10f7a768c476d53018a7bf120d37c0
1 ################################################################################
3 # ltp-testsuite
5 ################################################################################
7 LTP_TESTSUITE_VERSION = 20170116
8 LTP_TESTSUITE_SOURCE = ltp-full-$(LTP_TESTSUITE_VERSION).tar.xz
9 LTP_TESTSUITE_SITE = https://github.com/linux-test-project/ltp/releases/download/$(LTP_TESTSUITE_VERSION)
10 LTP_TESTSUITE_LICENSE = GPLv2, GPLv2+
11 LTP_TESTSUITE_LICENSE_FILES = COPYING
13 # Do not enable Open POSIX testsuite as it doesn't cross-compile
14 # properly: t0 program is built for the host machine. Notice that due
15 # to a bug, --without-open-posix-testsuite actually enables the test
16 # suite.
17 # See https://github.com/linux-test-project/ltp/issues/143 (invalid
18 # autoconf test) and
19 # https://github.com/linux-test-project/ltp/issues/144 (Open POSIX
20 # testsuite not cross-compiling).
21 LTP_TESTSUITE_CONF_OPTS += \
22 --with-realtime-testsuite
24 ifeq ($(BR2_LINUX_KERNEL),y)
25 LTP_TESTSUITE_DEPENDENCIES += linux
26 LTP_TESTSUITE_MAKE_ENV += $(LINUX_MAKE_FLAGS)
27 LTP_TESTSUITE_CONF_OPTS += --with-linux-dir=$(LINUX_DIR)
28 else
29 LTP_TESTSUITE_CONF_OPTS += --without-modules
30 endif
32 # We change the prefix to a custom one, otherwise we get scripts and
33 # directories directly in /usr, such as /usr/runalltests.sh
34 LTP_TESTSUITE_CONF_OPTS += --prefix=/usr/lib/ltp-testsuite
36 # Needs libcap with file attrs which needs attr, so both required
37 ifeq ($(BR2_PACKAGE_LIBCAP)$(BR2_PACKAGE_ATTR),yy)
38 LTP_TESTSUITE_DEPENDENCIES += libcap
39 else
40 LTP_TESTSUITE_CONF_ENV += ac_cv_lib_cap_cap_compare=no
41 endif
43 # ltp-testsuite uses <fts.h>, which isn't compatible with largefile
44 # support.
45 LTP_TESTSUITE_CFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))
46 LTP_TESTSUITE_CPPFLAGS = $(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CPPFLAGS))
47 LTP_TESTSUITE_LIBS =
49 ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
50 LTP_TESTSUITE_DEPENDENCIES += libtirpc host-pkgconf
51 LTP_TESTSUITE_CFLAGS += "`$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`"
52 LTP_TESTSUITE_LIBS += "`$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`"
53 endif
55 LTP_TESTSUITE_CONF_ENV += \
56 CFLAGS="$(LTP_TESTSUITE_CFLAGS)" \
57 CPPFLAGS="$(LTP_TESTSUITE_CPPFLAGS)" \
58 LIBS="$(LTP_TESTSUITE_LIBS)" \
59 SYSROOT="$(STAGING_DIR)"
61 # Requires uClibc fts and bessel support, normally not enabled
62 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
63 define LTP_TESTSUITE_REMOVE_UNSUPPORTED
64 rm -rf $(@D)/testcases/kernel/controllers/cpuset/
65 rm -rf $(@D)/testcases/misc/math/float/bessel/
66 rm -f $(@D)/testcases/misc/math/float/float_bessel.c
67 endef
68 LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED
69 endif
72 $(eval $(autotools-package))