summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch')
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
new file mode 100644
index 0000000000..aefa9548e1
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
@@ -0,0 +1,98 @@
1Prevent running check tests on host if cross compiling
2
3This patch enables running the 'make check' tests on the target
4in a cross-compiled environment. If not cross-compiling, then 'make
5 check' builds and executes the tests; no change from this patch.
6In a cross-compiling environment, the make variable CROSS_COMPILE is
7set which bypasses assiging tests to the makekfile variable TESTS.
8Since TESTS is empty, the 'make check' process never tries to run the
9tests on the hosts. On the target, the tests must be run manually.
10
11Also, in the libutil++ tests, a makefile variable SRCDIR is passed into
12the compilation phase, pointing to the runtime location of the test
13'file-manip-tests'. The mechanism used for a host test, based on
14'topdir' doesn't work. Instead, if CROSS_COMPILE is set, the
15makefile takes the path of SRCDIR from the build environment and not
16from an expression based on the host path 'topdir'.
17
18Upstream-Status: Pending
19
20Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
21
22diff --git a/configure.ac b/configure.ac
23index 41ece64..ce5a16f 100644
24--- a/configure.ac
25+++ b/configure.ac
26@@ -392,6 +392,7 @@ AC_ARG_ENABLE(account-check,
27 enable_account_check=$enableval, enable_account_check=yes)
28
29 AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes")
30+AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes")
31
32 AC_SUBST(OP_CFLAGS)
33 AC_SUBST(OP_CXXFLAGS)
34diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am
35index 8a69003..d820090 100644
36--- a/libdb/tests/Makefile.am
37+++ b/libdb/tests/Makefile.am
38@@ -13,4 +13,6 @@ check_PROGRAMS = db_test
39 db_test_SOURCES = db_test.c
40 db_test_LDADD = ../libodb.a ../../libutil/libutil.a
41
42+if ! CROSS_COMPILE
43 TESTS = ${check_PROGRAMS}
44+endif
45diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am
46index 8a79eb5..6d417c4 100644
47--- a/libop/tests/Makefile.am
48+++ b/libop/tests/Makefile.am
49@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS}
50 mangle_tests_SOURCES = mangle_tests.c
51 mangle_tests_LDADD = ${COMMON_LIBS}
52
53+if ! CROSS_COMPILE
54 TESTS = ${check_PROGRAMS} utf8_checker.sh
55+endif
56diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am
57index 6f19838..1d176f9 100644
58--- a/libregex/tests/Makefile.am
59+++ b/libregex/tests/Makefile.am
60@@ -18,4 +18,6 @@ java_test_LDADD = \
61
62 EXTRA_DIST = mangled-name.in
63
64+if ! CROSS_COMPILE
65 TESTS = ${check_PROGRAMS}
66+endif
67diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am
68index 51af031..a01ea2d 100644
69--- a/libutil++/tests/Makefile.am
70+++ b/libutil++/tests/Makefile.am
71@@ -1,7 +1,9 @@
72
73 REALPATH= readlink -f
74
75+if ! CROSS_COMPILE
76 SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
77+endif
78
79 AM_CPPFLAGS = \
80 -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@
81@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS}
82 utility_tests_SOURCES = utility_tests.cpp
83 utility_tests_LDADD = ${COMMON_LIBS}
84
85+if ! CROSS_COMPILE
86 TESTS = ${check_PROGRAMS}
87+endif
88diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am
89index dfcd6ec..e8831b5 100644
90--- a/libutil/tests/Makefile.am
91+++ b/libutil/tests/Makefile.am
92@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a
93 string_tests_SOURCES = string_tests.c
94 string_tests_LDADD = ../libutil.a
95
96+if ! CROSS_COMPILE
97 TESTS = ${check_PROGRAMS}
98+endif