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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
From 3abe0e9a7370324ffb7a4cf70dd068c492f0d502 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Date: Thu, 13 Oct 2011 12:03:04 +0200
Subject: [PATCH] gentoo shit
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
Makefile.am | 12 ++++++++++--
configure.ac | 42 +++++++++++++++++++++++++++---------------
libsoup/Makefile.am | 50 +++++++++++++++++++++++++++++++++++++++-----------
3 files changed, 76 insertions(+), 28 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index bb94238..0562574 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,11 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-SUBDIRS = libsoup tests docs
+SUBDIRS = libsoup
+
+if BUILD_LIBSOUP
+SUBDIRS += tests docs
+endif
EXTRA_DIST = \
libsoup-2.4.pc.in \
@@ -14,7 +18,11 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
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
diff --git a/configure.ac b/configure.ac
index 899f7af..2a3e12c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,15 +72,30 @@ dnl ***********************
dnl *** Checks for glib ***
dnl ***********************
-AM_PATH_GLIB_2_0(2.31.0,,,gobject gio)
-if test "$GLIB_LIBS" = ""; then
- AC_MSG_ERROR(GLIB 2.31.0 or later is required to build libsoup)
+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.31.0,,,gobject gio)
+ if test "$GLIB_LIBS" = ""; then
+ AC_MSG_ERROR(GLIB 2.31.0 or later is required to build libsoup)
+ fi
+ GLIB_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
+
+ PKG_CHECK_MODULES(XML, libxml-2.0)
+ AC_SUBST(XML_CFLAGS)
+ AC_SUBST(XML_LIBS)
+
+ dnl *******************
+ dnl *** Misc checks ***
+ dnl *******************
+ AC_CHECK_FUNCS(gmtime_r)
+ AC_CHECK_FUNCS(mmap)
+ AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
fi
-GLIB_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
-
-PKG_CHECK_MODULES(XML, libxml-2.0)
-AC_SUBST(XML_CFLAGS)
-AC_SUBST(XML_LIBS)
+AM_CONDITIONAL(BUILD_LIBSOUP, test $with_libsoup_system = no)
dnl ***********************
dnl *** Check for Win32 ***
@@ -99,13 +114,6 @@ esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
-dnl *******************
-dnl *** Misc checks ***
-dnl *******************
-AC_CHECK_FUNCS(gmtime_r)
-AC_CHECK_FUNCS(mmap)
-AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
-
dnl *********************
dnl *** GNOME support ***
dnl *********************
@@ -130,6 +138,10 @@ AM_CONDITIONAL(BUILD_LIBSOUP_GNOME, test $with_gnome != no)
if test $with_gnome != no; then
AC_DEFINE(HAVE_GNOME, 1, [Defined if GNOME support is enabled])
+ if test $with_libsoup_system != no; then
+ PKG_CHECK_MODULES(LIBSOUP, libsoup-$SOUP_API_VERSION = $VERSION)
+ fi
+
PKG_CHECK_MODULES(SQLITE, sqlite3, :, [AC_MSG_ERROR(dnl
[Could not find sqlite3 devel files:
diff --git a/libsoup/Makefile.am b/libsoup/Makefile.am
index 096f0fb..416e523 100644
--- a/libsoup/Makefile.am
+++ b/libsoup/Makefile.am
@@ -4,15 +4,18 @@ if OS_WIN32
LIBWS2_32 = -lws2_32
endif
-INCLUDES = \
+INCLUDES =
+lib_LTLIBRARIES =
+CLEANFILES =
+
+if BUILD_LIBSOUP
+INCLUDES += \
-DG_LOG_DOMAIN=\"libsoup\" \
-I$(top_srcdir) \
$(SOUP_DEBUG_FLAGS) \
$(SOUP_MAINTAINER_FLAGS) \
$(GLIB_CFLAGS) \
- $(XML_CFLAGS) \
- $(SQLITE_CFLAGS) \
- $(GNOME_KEYRING_CFLAGS)
+ $(XML_CFLAGS)
MARSHAL_GENERATED = soup-marshal.c soup-marshal.h
MKENUMS_GENERATED = soup-enum-types.c soup-enum-types.h
@@ -41,7 +44,7 @@ soup-enum-types.c: $(libsoupinclude_HEADERS)
BUILT_SOURCES = $(MARSHAL_GENERATED) $(MKENUMS_GENERATED)
-CLEANFILES = $(MARSHAL_GENERATED) $(MKENUMS_GENERATED)
+CLEANFILES += $(MARSHAL_GENERATED) $(MKENUMS_GENERATED)
libsoupincludedir = $(includedir)/libsoup-2.4/libsoup
@@ -94,7 +97,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
@@ -176,6 +179,7 @@ libsoup_2_4_la_SOURCES = \
soup-uri.c \
soup-value-utils.c \
soup-xmlrpc.c
+endif
if BUILD_LIBSOUP_GNOME
@@ -189,6 +193,10 @@ endif
libsoupgnomeincludedir = $(includedir)/libsoup-gnome-2.4/libsoup
+INCLUDES += $(LIBSOUP_CFLAGS) \
+ $(SQLITE_CFLAGS) \
+ $(GNOME_KEYRING_CFLAGS)
+
libsoupgnomeinclude_HEADERS = \
soup-cookie-jar-sqlite.h\
soup-gnome.h \
@@ -196,14 +204,24 @@ 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) \
$(SQLITE_LIBS) \
$(GNOME_KEYRING_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 \
@@ -223,6 +241,8 @@ INTROSPECTION_COMPILER_ARGS = --includedir=.
if HAVE_INTROSPECTION
+if BUILD_LIBSOUP
+
# Core library
gi_soup_files = \
$(filter-out soup.h soup-enum-types.% soup-marshal.% soup-proxy-resolver.h,\
@@ -244,20 +264,28 @@ Soup_2_4_gir_FILES = \
INTROSPECTION_GIRS += Soup-2.4.gir
+endif
+
if BUILD_LIBSOUP_GNOME
+if BUILD_LIBSOUP
+SOUP_GIR = Soup-2.4.gir
+else
+SOUP_GIR =
+endif
+
# GNOME extensions
gi_soup_gnome_files = $(filter-out soup-gnome.h,\
$(libsoupgnomeinclude_HEADERS) \
$(filter-out %.h, $(libsoup_gnome_2_4_la_SOURCES)))
-SoupGNOME-2.4.gir: libsoup-gnome-2.4.la Soup-2.4.gir
+SoupGNOME-2.4.gir: libsoup-gnome-2.4.la $(SOUP_GIR)
+SoupGNOME_2_4_gir_INCLUDES = Soup-2.4
SoupGNOME_2_4_gir_SCANNERFLAGS = \
--identifier-prefix=Soup \
--symbol-prefix=soup \
- --c-include "libsoup/soup-gnome.h" \
- --include-uninstalled=$(builddir)/Soup-2.4.gir
+ --c-include "libsoup/soup-gnome.h"
SoupGNOME_2_4_gir_CFLAGS = $(INCLUDES)
-SoupGNOME_2_4_gir_LIBS = libsoup-gnome-2.4.la libsoup-2.4.la
+SoupGNOME_2_4_gir_LIBS = libsoup-gnome-2.4.la
SoupGNOME_2_4_gir_FILES = $(addprefix $(srcdir)/,$(gi_soup_gnome_files))
SoupGNOME_2_4_gir_EXPORT_PACKAGES = libsoup-gnome-2.4
--
1.7.8.163.g9859a.dirty
|