aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
blob: 812e983798eadda6c449e8b8f76d7bfcc4fa1103 (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
From 890f5bf2654b695a866262d72bfa9750af921a3b Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sat, 23 Aug 2014 12:26:37 -0700
Subject: [PATCH] Fix linking of libraries used by libreg

The math and crypto libraries are called by and need to be linked to
libreg.so, not to the executables.

Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126027.html]

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index a3ead30..da2dcc3 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ CFLAGS += -std=gnu99 -Wall -Werror -pedantic
 CFLAGS += -Wall -g
 LDLIBREG += -lreg
 LDLIBS += $(LDLIBREG)
-LDLIBS += -lm
+LIBREGLDLIBS += -lm
 LIBREG += libreg.so
 LDFLAGS += -L ./
 
@@ -40,13 +40,13 @@ all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
 
 ifeq ($(USE_OPENSSL),1)
 CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\"$(RUNTIME_PUBKEY_DIR)\" `pkg-config --cflags openssl`
-LDLIBS += `pkg-config --libs openssl`
+LIBREGLDLIBS += `pkg-config --libs openssl`
 
 $(LIBREG): keys-ssl.c
 
 else
 CFLAGS += -DUSE_GCRYPT
-LDLIBS += -lgcrypt
+LIBREGLDLIBS += -lgcrypt
 
 $(LIBREG): keys-gcrypt.c
 
@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
 
 $(LIBREG): regdb.h reglib.h reglib.c
 	$(NQ) '  CC  ' $@
-	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
+	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
 
 install-libreg-headers:
 	$(NQ) '  INSTALL  libreg-headers'
-- 
2.7.4