summaryrefslogtreecommitdiff
path: root/debian/patches/0002-modify-xml2-config-and-pkgconfig-behaviour.patch
blob: 265b2e461111fea7c390a08fe13773bb5a5e773d (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
From: Aron Xu <aron@debian.org>
Date: Sun, 3 Jun 2012 17:54:56 +0800
Subject: [PATCH] modify xml2-config and pkgconfig behaviour

---
 configure.in                 |    2 +-
 libxml-2.0-uninstalled.pc.in |    3 ++-
 xml2-config.1                |    3 ++-
 xml2-config.in               |   14 +++++++++++---
 4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/configure.in b/configure.in
index 0fb4983..e0fec4c 100644
--- a/configure.in
+++ b/configure.in
@@ -1360,7 +1360,7 @@ case "$host" in
 	*) M_LIBS="-lm"
 	;;
 esac
-XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS"
+XML_LIBS="-lxml2"
 XML_LIBTOOLLIBS="libxml2.la"
 AC_SUBST(WITH_ICONV)
 
diff --git a/libxml-2.0-uninstalled.pc.in b/libxml-2.0-uninstalled.pc.in
index 0a4c833..af16ebc 100644
--- a/libxml-2.0-uninstalled.pc.in
+++ b/libxml-2.0-uninstalled.pc.in
@@ -8,5 +8,6 @@ Name: libXML
 Version: @VERSION@
 Description: libXML library version2.
 Requires:
-Libs: -L${libdir} -lxml2 @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@
+Libs: -L${libdir} -lxml2
+Libs.private: @BASE_THREAD_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@
 Cflags: -I${includedir} @XML_INCLUDEDIR@ @XML_CFLAGS@
diff --git a/xml2-config.1 b/xml2-config.1
index 8a25962..bfda630 100644
--- a/xml2-config.1
+++ b/xml2-config.1
@@ -9,11 +9,12 @@ xml-config - script to get information about the installed version of GNOME-XML
 linker flags that should be used to compile and link programs that use
 \fIGNOME-XML\fP.
 .SH OPTIONS
-.l
 \fIxml-config\fP accepts the following options:
 .TP 8
 .B  \-\-version
 Print the currently installed version of \fIGNOME-XML\fP on the standard output.
+Add the \fB\-\-static\fP option to print the linker flags that are necessary
+to \fBstatically\fP link a \fIGNOME-XML\fP program.
 .TP 8
 .B  \-\-libs
 Print the linker flags that are necessary to link a \fIGNOME-XML\fP program.
diff --git a/xml2-config.in b/xml2-config.in
index 2989325..a33c3eb 100644
--- a/xml2-config.in
+++ b/xml2-config.in
@@ -15,6 +15,8 @@ Known values for OPTION are:
   --prefix=DIR		change libxml prefix [default $prefix]
   --exec-prefix=DIR	change libxml exec prefix [default $exec_prefix]
   --libs		print library linking information
+                        add --static to print static library linking
+                        information
   --cflags		print pre-processor and compiler flags
   --modules		module support enabled
   --help		display this help and exit
@@ -86,13 +88,19 @@ while test $# -gt 0; do
 	then
 	    if [ "@XML_LIBDIR@" = "-L/usr/lib" -o "@XML_LIBDIR@" = "-L/usr/lib64" ]
 	    then
-		echo @XML_LIBS@ 
+		LIBS="@XML_LIBS@"
 	    else
-		echo @XML_LIBDIR@ @XML_LIBS@ 
+		LIBS="@XML_LIBDIR@ @XML_LIBS@"
 	    fi
 	else
-	    echo @XML_LIBDIR@ @XML_LIBS@ @WIN32_EXTRA_LIBADD@
+	    LIBS="@XML_LIBDIR@ @XML_LIBS@ @WIN32_EXTRA_LIBADD@"
 	fi
+        if [ "$2" = "--static" ]
+        then
+            shift
+            LIBS="${LIBS} @Z_LIBS@ @BASE_THREAD_LIBS@@THREAD_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@"
+        fi
+        echo ${LIBS}
        	;;
 
     *)
--