summaryrefslogtreecommitdiffstats
path: root/patches/xmlstarlet-1.0.1/0004-xmlstarlet-link-against-shared-instead-of-static-lib.patch
blob: fb77ecd6db983e34c253e01963e8f75216154676 (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
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Fri, 1 Mar 2019 15:11:36 +0100
Subject: [PATCH] xmlstarlet: link against shared instead of static libs

xmlstarlet links against libxml2 and libexslt statically. The configure
script does not check for the dependencies. This fails if libexslt links
agains libgcrypt or if libxml2 does _not_ link against zlib (then zlib
may not be available at all).

This patch changes the configure script so that all libs are linked
dynamically. The linker can infer their respective dependencies from the
ELF header in the .so files.

For ptxdist this is ok. We install the libs already. Not for upstream.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Forwarded: not-needed
[rhi: also remove now unneeded -l flags and adapt patch description]
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configure.in | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/configure.in b/configure.in
index 856a451cac7f..e1c99ba07c81 100644
--- a/configure.in
+++ b/configure.in
@@ -31,7 +31,7 @@ AC_ARG_WITH(libxml-prefix,
         [  --with-libxml-prefix=[PFX]		Specify location of libxml],
         LIBXML_PREFIX=$withval
         LIBXML_CFLAGS="-I$withval/include/libxml2 -I$withval/include/libxml"
-        LIBXML_LIBS="$withval/lib/libxml2.a -lz -lm -lpthread -ldl"
+        LIBXML_LIBS="$withval/lib/libxml2.so"
 )
         
 AC_ARG_WITH(libxml-include-prefix,
@@ -41,13 +41,13 @@ AC_ARG_WITH(libxml-include-prefix,
 
 AC_ARG_WITH(libxml-libs-prefix,
         [  --with-libxml-libs-prefix=[PFX]	Specify location of libxml libs],
-        LIBXML_LIBS="$withval/libxml2.a -lz -lm -lpthread -ldl"
+        LIBXML_LIBS="$withval/libxml2.so"
 )
 
 AC_ARG_WITH(libxml-src,
         [  --with-libxml-src=[DIR]               For libxml thats not installed yet (sets all three above)],
         LIBXML_SRC="$withval"
-        LIBXML_LIBS="$withval/.libs/libxml2.a -lz -lm -lpthread"
+        LIBXML_LIBS="$withval/.libs/libxml2.so"
         LIBXML_CFLAGS="-I$withval/include/libxml2 -I$withval/include/libxml -I$withval/include"
 )
 
@@ -74,7 +74,7 @@ AC_ARG_WITH(libxslt-prefix,
         [  --with-libxslt-prefix=[PFX]		Specify location of libxslt],
 	LIBXSLT_PREFIX=$withval
         LIBXSLT_CFLAGS="-I$withval/include/libxslt -I$withval/include/libexslt"
-        LIBXSLT_LIBS="$withval/lib/libxslt.a $withval/lib/libexslt.a -lz -lm -lpthread"
+        LIBXSLT_LIBS="$withval/lib/libxslt.so $withval/lib/libexslt.so"
 )
         
 AC_ARG_WITH(libxslt-include-prefix,
@@ -84,13 +84,13 @@ AC_ARG_WITH(libxslt-include-prefix,
 
 AC_ARG_WITH(libxslt-libs-prefix,
         [  --with-libxslt-libs-prefix=[PFX]	Specify location of libxslt libs],
-        LIBXSLT_LIBS="$withval/libxslt.a $withval/libexslt.a -lz -lm -lpthread"
+        LIBXSLT_LIBS="$withval/libxslt.so $withval/libexslt.so"
 )
 
 AC_ARG_WITH(libxslt-src,
         [  --with-libxslt-src=[DIR]		For libxslt thats not installed yet (sets all three above)],
         LIBXSLT_SRC="$withval"
-        LIBXSLT_LIBS="$withval/libxslt/.libs/libxslt.a $withval/libexslt/.libs/libexslt.a -lz -lm -lpthread"
+        LIBXSLT_LIBS="$withval/libxslt/.libs/libxslt.so $withval/libexslt/.libs/libexslt.so"
         LIBXSLT_CFLAGS="-I$withval/libxslt -I$withval/libexslt -I$withval"
 )
 
@@ -236,7 +236,7 @@ dnl Set LIBXML libraries location
 dnl
 if test "x$LIBXML_LIBS" = "x"
 then
-	LIBXML_LIBS="${LIBXML_PREFIX}/lib/libxml2.a -lz -lm -lpthread -ldl"
+	LIBXML_LIBS="${LIBXML_PREFIX}/lib/libxml2.so"
 fi
 
 dnl
@@ -252,7 +252,7 @@ dnl Set LIBXSLT libraries location
 dnl
 if test "x$LIBXSLT_LIBS" = "x"
 then
-	LIBXSLT_LIBS="${LIBXSLT_PREFIX}/lib/libxslt.a ${LIBXSLT_PREFIX}/lib/libexslt.a -lz -lm -lpthread"
+	LIBXSLT_LIBS="${LIBXSLT_PREFIX}/lib/libxslt.so ${LIBXSLT_PREFIX}/lib/libexslt.so"
 fi
 
 dnl