summaryrefslogtreecommitdiff
blob: d65945093c7c89967b7b2fc528ba36f7805a9e24 (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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
From d760a92ed2ab93e64aca889cd6bbc8b1ffecc63b Mon Sep 17 00:00:00 2001
From: Romain Perier <mrpouet@gentoo.org>
Date: Sun, 13 Sep 2009 16:20:10 +0200
Subject: [PATCH] Add --with-libsoup-system option in order to be able to build gnome plugin without libsoup library

---
 Makefile.am         |   13 ++++++++---
 configure.in        |   53 +++++++++++++++++++++++++++-----------------------
 libsoup/Makefile.am |   30 +++++++++++++++++++++++-----
 3 files changed, 62 insertions(+), 34 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6c7dc3c..7c95031 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,11 @@
 ## Process this file with automake to produce Makefile.in
 AUTOMAKE_OPTIONS = 1.6
 
-SUBDIRS = libsoup tests docs
+SUBDIRS = libsoup
+
+if BUILD_LIBSOUP
+SUBDIRS += tests docs
+endif
 
 EXTRA_DIST =			\
 	libsoup-2.4.pc.in	\
@@ -12,9 +16,10 @@ EXTRA_DIST =			\
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
 
 pkgconfigdir = $(libdir)/pkgconfig
-
-pkgconfig_DATA = libsoup-2.4.pc
-
+pkgconfig_DATA=
+if BUILD_LIBSOUP
+pkgconfig_DATA += libsoup-2.4.pc
+endif
 if BUILD_LIBSOUP_GNOME
 pkgconfig_DATA += libsoup-gnome-2.4.pc
 endif
diff --git a/configure.in b/configure.in
index 902eae6..04b088d 100644
--- a/configure.in
+++ b/configure.in
@@ -78,7 +78,13 @@ AC_FUNC_ALLOCA
 dnl ***********************
 dnl *** Checks for glib ***
 dnl ***********************
+PKG_PROG_PKG_CONFIG
+enable_ssl=no
+AC_ARG_WITH(libsoup-system,
+	AS_HELP_STRING([--with-libsoup-system], [Use libsoup system library to build(default=no)]),
+	[with_libsoup_system=$withval], [with_libsoup_system=no])
 
+if test "$with_libsoup_system" = "no"; then
 AM_PATH_GLIB_2_0(2.15.3,,,gobject gthread gio)
 if test "$GLIB_LIBS" = ""; then
    AC_MSG_ERROR(GLIB 2.15.3 or later is required to build libsoup)
@@ -89,29 +95,6 @@ PKG_CHECK_MODULES(XML, libxml-2.0)
 AC_SUBST(XML_CFLAGS)
 AC_SUBST(XML_LIBS)
 
-dnl ***********************
-dnl *** Check for Win32 ***
-dnl ***********************
-
-AC_MSG_CHECKING([for Win32])
-case "$host" in
-  *-*-mingw*)
-    os_win32=yes
-    # Don't do this yet, as we want to support Windows 2000 which
-    # doesn't have these.
-    # AC_CACHE_VAL(ac_cv_func_getaddrinfo, [ac_cv_func_getaddrinfo=yes])
-    # AC_CACHE_VAL(ac_cv_func_getnameinfo, [ac_cv_func_getnameinfo=yes])
-    # AC_CACHE_VAL(ac_cv_func_inet_pton, [ac_cv_func_inet_pton=yes])
-    # AC_CACHE_VAL(ac_cv_func_inet_ntop, [ac_cv_func_inet_ntop=yes])
-    # AC_CACHE_VAL(soup_cv_ipv6, [soup_cv_ipv6=yes])
-    ;;
-  *)
-    os_win32=no
-    ;;
-esac
-AC_MSG_RESULT([$os_win32])
-AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
-
 dnl *******************
 dnl *** Misc checks ***
 dnl *******************
@@ -165,10 +148,32 @@ fi
 AC_SUBST(LIBGNUTLS_CFLAGS)
 AC_SUBST(LIBGNUTLS_LIBS)
 AC_SUBST(SSL_REQUIREMENT)
-
+fi
 dnl This is not supposed to be conditional, but...
 AM_CONDITIONAL(HAVE_SSL, test $enable_ssl != no)
+AM_CONDITIONAL(BUILD_LIBSOUP, test $with_libsoup_system = no) 
+dnl ***********************
+dnl *** Check for Win32 ***
+dnl ***********************
 
+AC_MSG_CHECKING([for Win32])
+case "$host" in
+  *-*-mingw*)
+    os_win32=yes
+    # Don't do this yet, as we want to support Windows 2000 which
+    # doesn't have these.
+    # AC_CACHE_VAL(ac_cv_func_getaddrinfo, [ac_cv_func_getaddrinfo=yes])
+    # AC_CACHE_VAL(ac_cv_func_getnameinfo, [ac_cv_func_getnameinfo=yes])
+    # AC_CACHE_VAL(ac_cv_func_inet_pton, [ac_cv_func_inet_pton=yes])
+    # AC_CACHE_VAL(ac_cv_func_inet_ntop, [ac_cv_func_inet_ntop=yes])
+    # AC_CACHE_VAL(soup_cv_ipv6, [soup_cv_ipv6=yes])
+    ;;
+  *)
+    os_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$os_win32])
+AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
 
 dnl *********************
 dnl *** GNOME support ***
diff --git a/libsoup/Makefile.am b/libsoup/Makefile.am
index 949f243..a599c40 100644
--- a/libsoup/Makefile.am
+++ b/libsoup/Makefile.am
@@ -4,16 +4,18 @@ if OS_WIN32
 LIBWS2_32 = -lws2_32
 endif
 
-INCLUDES = 				\
+INCLUDES = 
+lib_LTLIBRARIES = 
+
+if BUILD_LIBSOUP
+
+INCLUDES += 				\
 	-DG_LOG_DOMAIN=\"libsoup\" 	\
 	-I$(top_srcdir)			\
 	$(SOUP_DEBUG_FLAGS)		\
 	$(SOUP_MAINTAINER_FLAGS)	\
 	$(GLIB_CFLAGS)			\
 	$(XML_CFLAGS)			\
-	$(GCONF_CFLAGS)			\
-	$(LIBPROXY_CFLAGS)		\
-	$(SQLITE_CFLAGS)		\
 	$(LIBGCRYPT_CFLAGS)		\
 	$(LIBGNUTLS_CFLAGS)
 
@@ -87,7 +89,7 @@ libsoupinclude_HEADERS =	\
 	$(soup_headers)		\
 	soup-enum-types.h
 
-lib_LTLIBRARIES = libsoup-2.4.la
+lib_LTLIBRARIES += libsoup-2.4.la
 
 libsoup_2_4_la_LDFLAGS =	\
 	-version-info $(SOUP_CURRENT):$(SOUP_REVISION):$(SOUP_AGE) -no-undefined
@@ -160,9 +162,15 @@ libsoup_2_4_la_SOURCES =		\
 	soup-uri.c			\
 	soup-value-utils.c		\
 	soup-xmlrpc.c
+endif
 
 if BUILD_LIBSOUP_GNOME
 
+INCLUDES += $(LIBSOUP_CFLAGS)	\
+	$(GCONF_CFLAGS)		\
+	$(LIBPROXY_CFLAGS)	\
+	$(SQLITE_CFLAGS)
+
 libsoupgnomeincludedir = $(includedir)/libsoup-gnome-2.4/libsoup
 
 libsoupgnomeinclude_HEADERS =	\
@@ -172,15 +180,25 @@ libsoupgnomeinclude_HEADERS =	\
 
 lib_LTLIBRARIES += libsoup-gnome-2.4.la
 
+if BUILD_LIBSOUP
 libsoup_gnome_2_4_la_LDFLAGS = $(libsoup_2_4_la_LDFLAGS)
+else
+libsoup_gnome_2_4_la_LDFLAGS =		\
+	-version-info $(SOUP_CURRENT):$(SOUP_REVISION):$(SOUP_AGE) -no-undefined
+endif
 
 libsoup_gnome_2_4_la_LIBADD =		\
-	libsoup-2.4.la			\
 	$(GLIB_LIBS)			\
 	$(GCONF_LIBS)			\
 	$(LIBPROXY_LIBS)		\
 	$(SQLITE_LIBS)
 
+if BUILD_LIBSOUP
+libsoup_gnome_2_4_la_LIBADD += libsoup-2.4.la
+else
+libsoup_gnome_2_4_la_LIBADD += $(LIBSOUP_LIBS)
+endif
+
 libsoup_gnome_2_4_la_SOURCES =		\
 	soup-cookie-jar-sqlite.c	\
 	soup-gnome-features.c		\
-- 
1.6.4.2