summaryrefslogtreecommitdiff
path: root/sys-apps/rng-tools/files/rng-tools-6.13-various-autotools-fixups.patch
blob: 8cb68ae9b02a901cf83a5f0e1c31f3e2a8b2bee6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
https://github.com/nhorman/rng-tools/pull/132
https://github.com/nhorman/rng-tools/pull/143

From 16b728f9a5bb138386fa770de817ec244a158be5 Mon Sep 17 00:00:00 2001
From: David Seifert <soap@gentoo.org>
Date: Sat, 12 Jun 2021 22:15:06 +0200
Subject: [PATCH 1/3] Use `AM_PROG_AR` over `AC_CHECK_TOOLS`

* `AM_PROG_AR` is the canonical way to detect the archiver
  and includes workarounds for Cygwin.
--- a/configure.ac
+++ b/configure.ac
@@ -62,10 +62,9 @@ AM_PROG_AS
 dnl Checks for programs
 AC_PROG_CC
 AC_PROG_RANLIB
+AM_PROG_AR
 AC_PROG_GCC_TRADITIONAL
 
-AC_CHECK_TOOLS([AR], [ar gar], :)
-
 AX_PTHREAD
 
 AM_CONDITIONAL([RDRAND], [test $target_cpu = x86_64 -o $target_cpu = i686])

From 2ce93190cb0111fcab2f622a539689d70960643a Mon Sep 17 00:00:00 2001
From: David Seifert <soap@gentoo.org>
Date: Sat, 12 Jun 2021 22:15:09 +0200
Subject: [PATCH 2/3] Build `randstat` binary
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,3 +1,2 @@
-
-EXTRA_DIST = randstat.c
-
+bin_PROGRAMS = randstat
+randstat_SOURCES = randstat.c

From 3adf2613e262efbda0a3455e59c8cb3390271563 Mon Sep 17 00:00:00 2001
From: David Seifert <soap@gentoo.org>
Date: Sat, 12 Jun 2021 22:15:12 +0200
Subject: [PATCH 3/3] `AC_CANONICAL_TARGET` -> `AC_CANONICAL_HOST`

* `AC_CANONICAL_TARGET` is the type of system for which code
  will be produced, not on which it will run. This is a common
  confusion with Autoconf's target triplet.
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,8 @@ dnl Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA
 AC_INIT(rng-tools, 6.13, [Neil Horman <nhorman@tuxdriver.com>])
 AC_PREREQ(2.52)
 AC_CONFIG_SRCDIR([rngd.c])
-AC_CANONICAL_TARGET
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET dnl required for broken AX_PTHREAD
 AM_INIT_AUTOMAKE([foreign])
 AC_CONFIG_HEADERS([rng-tools-config.h])
 AC_CONFIG_MACRO_DIRS([m4])
@@ -67,14 +68,14 @@ AC_PROG_GCC_TRADITIONAL
 
 AX_PTHREAD
 
-AM_CONDITIONAL([RDRAND], [test $target_cpu = x86_64 -o $target_cpu = i686])
-AS_IF([test $target_cpu = x86_64 -o $target_cpu = i686], [AC_DEFINE([HAVE_RDRAND],1,[Enable RDRAND])],[])
+AM_CONDITIONAL([RDRAND], [test $host_cpu = x86_64 || $host_cpu = i686])
+AS_IF([test $host_cpu = x86_64 || $host_cpu = i686], [AC_DEFINE([HAVE_RDRAND],1,[Enable RDRAND])],[])
 
-AM_CONDITIONAL([DARN], [test $target_cpu = powerpc64le])
-AS_IF([test $target_cpu = powerpc64le], [AC_DEFINE([HAVE_DARN],1,[Enable DARN])],[])
+AM_CONDITIONAL([DARN], [test $host_cpu = powerpc64le])
+AS_IF([test $host_cpu = powerpc64le], [AC_DEFINE([HAVE_DARN],1,[Enable DARN])],[])
 
-AM_CONDITIONAL([RNDR], [test $target_cpu = aarch64])
-AS_IF([test $target_cpu = aarch64], [AC_DEFINE([HAVE_RNDR],1,[Enable RNDR])],[])
+AM_CONDITIONAL([RNDR], [test $host_cpu = aarch64])
+AS_IF([test $host_cpu = aarch64], [AC_DEFINE([HAVE_RNDR],1,[Enable RNDR])],[])
 AM_CONDITIONAL([JITTER], [false])
 
 AC_ARG_ENABLE(jitterentropy,
From 800d7c6e23f0a04bd893ee748a74b622657017a9 Mon Sep 17 00:00:00 2001
From: David Seifert <soap@gentoo.org>
Date: Sun, 1 Aug 2021 13:16:16 +0200
Subject: [PATCH] configure.ac: Add missing `test`

---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0fe06fc..7c8e327 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,8 +68,8 @@ AC_PROG_GCC_TRADITIONAL
 
 AX_PTHREAD
 
-AM_CONDITIONAL([RDRAND], [test $host_cpu = x86_64 || $host_cpu = i686])
-AS_IF([test $host_cpu = x86_64 || $host_cpu = i686], [AC_DEFINE([HAVE_RDRAND],1,[Enable RDRAND])],[])
+AM_CONDITIONAL([RDRAND], [test $host_cpu = x86_64 || test $host_cpu = i686])
+AS_IF([test $host_cpu = x86_64 || test $host_cpu = i686], [AC_DEFINE([HAVE_RDRAND],1,[Enable RDRAND])],[])
 
 AM_CONDITIONAL([DARN], [test $host_cpu = powerpc64le])
 AS_IF([test $host_cpu = powerpc64le], [AC_DEFINE([HAVE_DARN],1,[Enable DARN])],[])