summaryrefslogtreecommitdiff
path: root/net-libs/libtrace/files/libtrace-4.0.18_p1-build-system.patch
blob: b536302c30b9c73921e7e603e973bd4b3b39a294 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
https://github.com/LibtraceTeam/libtrace/pull/201

From dde6c39e5808f06f1450b03e7c682edb0f1290cf Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Tue, 8 Feb 2022 05:30:32 +0000
Subject: [PATCH 1/3] build: fix bashism in configure

configures have a shebang of #!/bin/sh so need to work with a POSIX-compliant
shell; let's use = instead of == which will have the same effect on both Bash
and said shells (like dash).

Signed-off-by: Sam James <sam@gentoo.org>
---
 configure.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index 95d63fdc..dbbaabb7 100644
--- a/configure.in
+++ b/configure.in
@@ -305,7 +305,7 @@ AC_ARG_WITH(xdp, AS_HELP_STRING(--with-xdp, include XDP capture support),
 
 if test "$want_xdp" != no; then
     AC_CHECK_LIB(elf, elf_begin, elffound=1, elffound=0)
-    if test "$elffound" == 1; then
+    if test "$elffound" = 1; then
         # check for libbpf
         AC_CHECK_LIB(bpf, xsk_socket__create, bpffound=1, bpffound=0, -lelf)
 

From 1525a42b386da02bda3982cf6e8b472f57f8ac34 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Tue, 8 Feb 2022 05:32:59 +0000
Subject: [PATCH 2/3] build: make NUMA support optional

This avoids an 'automagic dependency' [0] on NUMA. This is helpful for
downstreams to ensure we don't miss dependencies or when we may not
want to enable support for a feature even though a dependency is enabled.

Gentoo has shipped this patch for quite some time.

[0] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies

Signed-off-by: Sam James <sam@gentoo.org>
---
 configure.in | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index dbbaabb7..6fbff150 100644
--- a/configure.in
+++ b/configure.in
@@ -518,7 +518,23 @@ AC_CHECK_DECL([PACKET_FANOUT],
         [[#include <linux/if_packet.h>]])
 
 # If we use DPDK we might be able to use libnuma
-AC_CHECK_LIB(numa, numa_node_to_cpus, have_numa=1, have_numa=0)
+AC_ARG_WITH(numa,
+	AS_HELP_STRING(--with-numa,include NUMA support),
+[
+	if test "$withval" = no
+	then
+		want_numa=no
+	else
+		want_numa=yes
+	fi
+],[
+	# Default to building without NUMA
+	want_numa=yes
+])
+
+if test "$want_numa" != no; then
+	AC_CHECK_LIB(numa, numa_node_to_cpus, have_numa=1, have_numa=0)
+fi
 
 # Need libwandder for ETSI live decoding
 AC_CHECK_LIB(wandder, init_wandder_decoder, have_wandder=1, have_wandder=0)

From 153254413ae3cd6a62ee7d8b5eae189e84ebc066 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Tue, 8 Feb 2022 05:34:05 +0000
Subject: [PATCH 3/3] build: use pkg-config to find ncurses

ncurses can be built in a variety of configurations, but the motivating case
for Gentoo was "split tinfo" where libtinfo is no longer included within
libncurses.

Use pkg-config to find where ncurses is installed and the required libraries
needed to link against it (which will include -ltinfo if required).

We've been shipping this patch in Gentoo for quite some time.

Signed-off-by: Sam James <sam@gentoo.org>
---
 configure.in               | 4 ++++
 tools/tracetop/Makefile.am | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index 6fbff150..cbb94d55 100644
--- a/configure.in
+++ b/configure.in
@@ -79,6 +79,8 @@ AC_PROG_INSTALL
 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc) 
 AM_PROG_LEX
 
+PKG_PROG_PKG_CONFIG
+
 # All our source files for function replacements are in lib/
 AC_CONFIG_LIBOBJ_DIR(lib)
 
@@ -916,6 +918,8 @@ if (test "$use_llvm" != "no"); then
 	fi
 fi
 
+PKG_CHECK_MODULES(ncurses,ncurses,have_ncurses=yes,have_ncurses=no)
+
 AC_ARG_WITH([ncurses],
 	AC_HELP_STRING([--with-ncurses], [build tracetop (requires ncurses)]))
 
diff --git a/tools/tracetop/Makefile.am b/tools/tracetop/Makefile.am
index 2ebbc3a7..a2eb2797 100644
--- a/tools/tracetop/Makefile.am
+++ b/tools/tracetop/Makefile.am
@@ -6,6 +6,6 @@ bin_PROGRAMS = tracetop
 include ../Makefile.tools
 
 tracetop_SOURCES = tracetop.cc
-tracetop_LDADD = -lncurses 
+tracetop_LDADD = @ncurses_LIBS@
 tracetop_CPPFLAGS = -fno-strict-aliasing $(AM_CFLAGS)
 endif