summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nettle/nettle
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/nettle/nettle')
-rw-r--r--meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch45
-rw-r--r--meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch36
-rw-r--r--meta/recipes-support/nettle/nettle/dlopen-test.patch29
-rw-r--r--meta/recipes-support/nettle/nettle/run-ptest36
4 files changed, 146 insertions, 0 deletions
diff --git a/meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch b/meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch
new file mode 100644
index 0000000000..e3f5c6de7d
--- /dev/null
+++ b/meta/recipes-support/nettle/nettle/Add-target-to-only-build-tests-not-run-them.patch
@@ -0,0 +1,45 @@
1Add target to only build tests (not run them)
2
3Not sending upstream as this is only a start of a solution to
4installable tests: It's useful for us already as is.
5
6Upstream-Status: Inappropriate [not a complete solution]
7
8Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
9Refactored for 3.4
10Signed-off-by: Armin Kuster <akuster@mvista.com>
11---
12 Makefile.in | 3 +++
13 testsuite/Makefile.in | 2 ++
14 2 files changed, 5 insertions(+)
15
16diff --git a/Makefile.in b/Makefile.in
17index e5ccfc7..15c9275 100644
18--- a/Makefile.in
19+++ b/Makefile.in
20@@ -52,6 +52,9 @@ clean distclean mostlyclean maintainer-clean tags:
21 echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done
22 $(MAKE) $@-here
23
24+buildtest:
25+ echo "Making $@ in testsuite" ; (cd testsuite && $(MAKE) $@)
26+
27 check-here:
28 true
29
30diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
31index 3f5e5f6..8fd68a3 100644
32--- a/testsuite/Makefile.in
33+++ b/testsuite/Makefile.in
34@@ -122,6 +122,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \
35 # data.
36 VALGRIND = valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes @IF_ASM@ --partial-loads-ok=yes
37
38+buildtest: $(TS_ALL)
39+
40 check: $(TS_ALL)
41 TEST_SHLIB_DIR="$(TEST_SHLIB_DIR)" \
42 srcdir="$(srcdir)" \
43--
442.17.1
45
diff --git a/meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch b/meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch
new file mode 100644
index 0000000000..d5f266681e
--- /dev/null
+++ b/meta/recipes-support/nettle/nettle/check-header-files-of-openssl-only-if-enable_.patch
@@ -0,0 +1,36 @@
1From ffee6b5f6204a0210f717968ec6ce514d70acca1 Mon Sep 17 00:00:00 2001
2From: Haiqing Bai <Haiqing.Bai@windriver.com>
3Date: Fri, 9 Dec 2016 15:23:17 +0800
4Subject: [PATCH] nettle: check header files of openssl only if
5 'enable_openssl=yes'.
6
7The original configure script checks openssl header files to generate
8config.h even if 'enable_openssl' is not set to yes, this made inconsistent
9building for nettle.
10
11Upstream-Status: Pending
12Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
13
14refactored for 3.4. pending not in as of 3.4
15
16Signed-off-by: Armin Kuster <akuster@mvista.com>
17
18Index: nettle-3.4/configure.ac
19===================================================================
20--- nettle-3.4.orig/configure.ac
21+++ nettle-3.4/configure.ac
22@@ -185,9 +185,11 @@ AC_HEADER_TIME
23 AC_CHECK_SIZEOF(long)
24 AC_CHECK_SIZEOF(size_t)
25
26-AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],,
27-[enable_openssl=no
28- break])
29+if test "x$enable_openssl" = "xyes"; then
30+ AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],,
31+ [enable_openssl=no
32+ break])
33+fi
34
35 # For use by the testsuite
36 AC_CHECK_HEADERS([valgrind/memcheck.h])
diff --git a/meta/recipes-support/nettle/nettle/dlopen-test.patch b/meta/recipes-support/nettle/nettle/dlopen-test.patch
new file mode 100644
index 0000000000..ab9b91f88b
--- /dev/null
+++ b/meta/recipes-support/nettle/nettle/dlopen-test.patch
@@ -0,0 +1,29 @@
1Remove the relative path for libnettle.so so the test
2program can find it.
3Relative paths are not suitable, as the folder strucure for ptest
4is different from the one expected by the nettle testsuite.
5
6Upstream-Status: Inappropriate [embedded specific]
7
8Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
9Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
10---
11 testsuite/dlopen-test.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
15index 4265bf7..1a25d17 100644
16--- a/testsuite/dlopen-test.c
17+++ b/testsuite/dlopen-test.c
18@@ -15,7 +15,7 @@ int
19 main (int argc UNUSED, char **argv UNUSED)
20 {
21 #if HAVE_LIBDL
22- void *handle = dlopen ("../libnettle." SO_EXT, RTLD_NOW);
23+ void *handle = dlopen ("libnettle.so", RTLD_NOW);
24 int (*get_version)(void);
25 if (!handle)
26 {
27--
282.17.1
29
diff --git a/meta/recipes-support/nettle/nettle/run-ptest b/meta/recipes-support/nettle/nettle/run-ptest
new file mode 100644
index 0000000000..b90bed66d2
--- /dev/null
+++ b/meta/recipes-support/nettle/nettle/run-ptest
@@ -0,0 +1,36 @@
1#! /bin/sh
2
3cd testsuite
4
5failed=0
6all=0
7
8for f in *-test; do
9 if [ "$f" = "sha1-huge-test" ] ; then
10 echo "SKIP: $f (skipped for ludicrous run time)"
11 continue
12 fi
13
14 "./$f"
15 case "$?" in
16 0)
17 echo "PASS: $f"
18 all=$((all + 1))
19 ;;
20 77)
21 echo "SKIP: $f"
22 ;;
23 *)
24 echo "FAIL: $f"
25 failed=$((failed + 1))
26 all=$((all + 1))
27 ;;
28 esac
29done
30
31if [ "$failed" -eq 0 ] ; then
32 echo "All $all tests passed"
33else
34 echo "$failed of $all tests failed"
35fi
36