summaryrefslogtreecommitdiff
path: root/sys-apps/fwts/files/fwts-22.03.00-slibtool.patch
blob: bc66006bf6741cb2a7bebe25462def56264729a2 (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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Upstream-ML: https://lists.ubuntu.com/archives/fwts-devel/2022-May/013515.html

From 47bc82375865e2548edcb1607ca52ec60d632123 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Tue, 10 May 2022 20:35:01 -0700
Subject: [PATCH 1/2] build: Improve linking

This improves the linking enough to get the build to complete
with slibtool and GNU libtool.
---
 configure.ac                  |  2 ++
 src/Makefile.am               | 20 ++++++++++----------
 src/lib/src/Makefile.am       | 18 ++++++++++--------
 src/libfwtsacpica/Makefile.am |  7 ++-----
 src/libfwtsiasl/Makefile.am   |  4 ++--
 5 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/configure.ac b/configure.ac
index f40c367..7ee5604 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,6 +64,8 @@
 	  AC_CHECK_HEADERS([asm/opal-prd.h])
 	  AC_CHECK_HEADERS([mtd/mtd-abi.h])
 	  AC_CHECK_HEADERS([pci/pci.h])
+	  PKG_CHECK_MODULES([GIO], [gio-2.0])
+	  PKG_CHECK_MODULES([GLIB], [glib-2.0])
 	  AM_CONDITIONAL([HAVE_ASM_OPAL_PRD_H],
 	    [test "x$ac_cv_header_asm_opal_prd_h" = "xyes"])
 	  AM_CONDITIONAL([HAVE_MTD_ABI_H],
diff --git a/src/Makefile.am b/src/Makefile.am
index 9a26af8..e2180e7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,7 +12,7 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/acpica/source/compiler	\
 	-I$(top_srcdir)/efi_runtime			\
 	-I$(top_srcdir)/smccc_test			\
-	-pthread `pkg-config --cflags glib-2.0 gio-2.0` \
+	-pthread					\
 	-Wall -Werror -Wextra				\
 	-Wno-address-of-packed-member			\
 	-Wfloat-equal -Wmissing-declarations		\
@@ -23,7 +23,11 @@ AM_CPPFLAGS = \
 
 bin_PROGRAMS = fwts
 
-fwts_CPPFLAGS = $(AM_CPPFLAGS) -DACPI_DEBUG_OUTPUT
+fwts_CPPFLAGS = 					\
+	$(AM_CPPFLAGS)					\
+	@GIO_CFLAGS@					\
+	@GLIB_CFLAGS@					\
+	-DACPI_DEBUG_OUTPUT
 
 if HAVE_LIBFDT
 dt_tests = \
@@ -207,16 +211,12 @@ fwts_SOURCES = main.c 				\
 	$(power_mgmt_tests)			\
 	$(dt_tests)
 
-fwts_LDFLAGS = -lm -lbsd `pkg-config --libs glib-2.0 gio-2.0`
+fwts_LDFLAGS = -no-undefined
 
 fwts_LDADD = \
-	-lfwts					\
-	-L$(top_builddir)/src			\
-	-L$(top_builddir)/src/acpica		\
-	-L$(top_builddir)/src/libfwtsiasl	\
-	-L$(top_builddir)/src/libfwtsacpica	\
-	-L$(top_builddir)/src/lib/src		\
-	-lfwtsacpica
+	$(top_builddir)/src/lib/src/libfwts.la \
+	$(top_builddir)/src/libfwtsiasl/libfwtsiasl.la \
+	$(top_builddir)/src/libfwtsacpica/libfwtsacpica.la
 
 man_MANS = ../doc/fwts.1 ../doc/fwts-collect.1 ../doc/fwts-frontend-text.1
 
diff --git a/src/lib/src/Makefile.am b/src/lib/src/Makefile.am
index 0a39882..94bfcdf 100644
--- a/src/lib/src/Makefile.am
+++ b/src/lib/src/Makefile.am
@@ -21,22 +21,24 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/libfwtsiasl			\
 	-I$(top_srcdir)/src/acpica/source/include	\
 	-I$(top_srcdir)/src/acpica/source/compiler	\
-	`pkg-config --silence-errors --cflags json`	\
-	`pkg-config --silence-errors --cflags json-c`	\
-	`pkg-config --cflags glib-2.0 gio-2.0` 		\
 	-DDATAROOTDIR=\"$(datarootdir)\"		\
 	-Wall -Werror -Wextra				\
 	-Wno-address-of-packed-member
 
 pkglib_LTLIBRARIES = libfwts.la
 
-libfwts_la_LDFLAGS = 					\
+libfwts_la_LDFLAGS = -version-info 1:0:0
+
+libfwts_la_LIBADD = 					\
 	-lm -lpthread -lbsd				\
-	-version-info 1:0:0 				\
-	-L$(top_builddir)/src/libfwtsiasl		\
-	-lfwtsiasl `pkg-config --libs glib-2.0 gio-2.0`
+	@GIO_LIBS@					\
+	@GLIB_LIBS@
 
-libfwts_la_CPPFLAGS = $(AM_CPPFLAGS) -DACPI_DEBUG_OUTPUT
+libfwts_la_CPPFLAGS =					\
+	$(AM_CPPFLAGS)					\
+	@GIO_CFLAGS@					\
+	@GLIB_CFLAGS@					\
+	-DACPI_DEBUG_OUTPUT
 
 if HAVE_LIBFDT
 dt_sources = \
diff --git a/src/libfwtsacpica/Makefile.am b/src/libfwtsacpica/Makefile.am
index f37f585..62f0d8c 100644
--- a/src/libfwtsacpica/Makefile.am
+++ b/src/libfwtsacpica/Makefile.am
@@ -74,7 +74,8 @@ CLEANFILES = osunixxf_munged.c					\
 
 pkglib_LTLIBRARIES = libfwtsacpica.la
 
-libfwtsacpica_la_LDFLAGS = -lpthread -version-info 1:0:0
+libfwtsacpica_la_LDFLAGS = -version-info 1:0:0
+libfwtsacpica_la_LIBADD = -lpthread
 libfwtsacpica_la_CPPFLAGS = $(AM_CPPFLAGS)
 
 #
@@ -280,8 +281,4 @@ libfwtsacpica_la_SOURCES =						\
 	../../src/acpica/source/tools/acpiexec/aeinstall.c		\
 	../../src/acpica/source/os_specific/service_layers/osgendbg.c
 
-libfwtsacpica_la_LIBADD = \
-	-L../../src/lib/src -lfwts -lrt
-
-
 -include ../../git.mk
diff --git a/src/libfwtsiasl/Makefile.am b/src/libfwtsiasl/Makefile.am
index 328134c..2728780 100644
--- a/src/libfwtsiasl/Makefile.am
+++ b/src/libfwtsiasl/Makefile.am
@@ -104,8 +104,8 @@ BUILT_SOURCES = aslcompiler.y		\
 #
 # Just export fwts specific API so we don't clash with core ACPICA library
 #
-libfwtsiasl_la_LDFLAGS = -export-symbols-regex "fwts_.*" -lpthread -version-info 1:0:0
-
+libfwtsiasl_la_LDFLAGS = -export-symbols-regex "fwts_.*" -version-info 1:0:0
+libfwtsiasl_la_LIBADD = -lpthread
 CLEANFILES = $(BUILT_SOURCES)
 
 libfwtsiasl_la_CPPFLAGS = $(AM_CPPFLAGS)
-- 
2.35.1