/
configure.in
366 lines (297 loc) · 10.1 KB
/
configure.in
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
AC_INIT(rsvg.h)
dnl ===========================================================================
FONTCONFIG_REQUIRED=1.0.1 dnl Same as in Pango, ???
GDK_PIXBUF_REQUIRED=1.3.7
GLIB_REQUIRED=2.12.0
GIO_REQUIRED=2.15.4
LIBXML_REQUIRED=2.4.7
CAIRO_REQUIRED=1.2.0
PANGOFT2_REQUIRED=1.2.0
PANGOCAIRO_REQUIRED=1.10.0
AC_SUBST(GDK_PIXBUF_REQUIRED)
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GIO_REQUIRED)
AC_SUBST(CAIRO_REQUIRED)
AC_SUBST(LIBXML_REQUIRED)
AC_SUBST(PANGOFT2_REQUIRED)
dnl ===========================================================================
LIBRSVG_MAJOR_VERSION=2
LIBRSVG_MINOR_VERSION=22
LIBRSVG_MICRO_VERSION=3
AC_SUBST(LIBRSVG_MAJOR_VERSION)
AC_SUBST(LIBRSVG_MINOR_VERSION)
AC_SUBST(LIBRSVG_MICRO_VERSION)
LIBRSVG_VERSION=$LIBRSVG_MAJOR_VERSION.$LIBRSVG_MINOR_VERSION.$LIBRSVG_MICRO_VERSION
VERSION_INFO=`expr $LIBRSVG_MAJOR_VERSION + $LIBRSVG_MINOR_VERSION`:$LIBRSVG_MICRO_VERSION:$LIBRSVG_MINOR_VERSION
AC_SUBST(VERSION_INFO)
dnl ===========================================================================
AM_INIT_AUTOMAKE(librsvg, $LIBRSVG_VERSION)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_AWK
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_STDC_HEADERS
AM_PROG_CC_C_O
AC_C_BIGENDIAN
dnl ===========================================================================
#AC_CANONICAL_HOST
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
native_win32=yes
;;
*)
native_win32=no
;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = "yes")
dnl ===========================================================================
PKG_CHECK_MODULES(GLIB, \
glib-2.0 >= $GLIB_REQUIRED \
gthread-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_CFLAGS)
PKG_CHECK_MODULES(LIBRSVG, \
gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED \
glib-2.0 >= $GLIB_REQUIRED \
libxml-2.0 >= $LIBXML_REQUIRED \
pangoft2 >= $PANGOFT2_REQUIRED \
pangocairo >= $PANGOCAIRO_REQUIRED \
cairo >= $CAIRO_REQUIRED \
cairo-png >= $CAIRO_REQUIRED \
fontconfig >= $FONTCONFIG_REQUIRED
freetype2)
test_gio=true
PKG_CHECK_EXISTS(gio-2.0 >= $GIO_REQUIRED, [
PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED)
LIBRSVG_CFLAGS="$LIBRSVG_CFLAGS $GIO_CFLAGS"
LIBRSVG_LIBS="$LIBRSVG_LIBS $GIO_LIBS"
AC_DEFINE(HAVE_GIO, 1, [Defined if gio is avaiable])
],[
test_gio=false
])
AC_SUBST(LIBRSVG_LIBS)
AC_SUBST(LIBRSVG_CFLAGS)
dnl ===========================================================================
LIBGSF_CFLAGS=""
LIBGSF_LIBS=""
LIBGSFPKG=""
test_gsf=true
AC_ARG_WITH(svgz,[ --with-svgz Use libgsf for run-time decompression],[
if test "x$withval" = "xno"; then
test_gsf=false
fi
])
if test "x$test_gsf" = "xtrue"; then
PKG_CHECK_MODULES(LIBGSF,[libgsf-1 >= 1.6.0], test_gsf=true, test_gsf=false)
fi
if test "x$test_gsf" = "xtrue"; then
LIBGSF_CFLAGS="$LIBGSF_CFLAGS -DHAVE_SVGZ=1"
LIBGSFPKG="libgsf-1"
else
AC_MSG_WARN([SVGZ support disabled, as requested (Use --with-svgz to enable)])
gsf_warning="
You are building without libgsf support. LibRSVG will not be able to handle GZipped SVGs, as is required per the SVG specification. If you are a library vendor or distributor, you are doing the world a disservice and should strongly consider shipping libgsf."
fi
AM_CONDITIONAL(WITH_LIBGSF,[test "$LIBGSFPKG" != ""])
AC_SUBST(LIBGSFPKG)
AC_SUBST(LIBGSF_CFLAGS)
AC_SUBST(LIBGSF_LIBS)
dnl ===========================================================================
LIBCROCO_CFLAGS=""
LIBCROCO_LIBS=""
LIBCROCOPKG=""
test_croco=true
AC_ARG_WITH(croco,[ --with-croco Use libcroco for CSS parsing],[
if test "x$withval" = "xno"; then
test_croco=false
fi
])
if test "x$test_croco" = "xtrue"; then
PKG_CHECK_MODULES(LIBCROCO,[libcroco-0.6 >= 0.6.1], test_croco=true, test_croco=false)
fi
if test "x$test_croco" = "xtrue"; then
LIBCROCO_CFLAGS="$LIBCROCO_CFLAGS -DHAVE_LIBCROCO=1"
LIBCROCOPKG="libcroco-0.6"
else
AC_MSG_WARN([LibCroco support disabled, as requested (Use --with-croco to enable)])
croco_warning="
You are building without libcroco support. LibRSVG will not be able to handle embedded CSS, as is required per the SVG specification. If you are a library vendor or distributor, you are doing the world a disservice and should strongly consider shipping libcroco. Even KSVG needs libcroco now..."
fi
AC_SUBST(LIBCROCOPKG)
AC_SUBST(LIBCROCO_CFLAGS)
AC_SUBST(LIBCROCO_LIBS)
dnl ===========================================================================
AC_CHECK_FUNCS(strtok_r basename)
dnl ===========================================================================
dnl Turn on the additional warnings last, so -Werror doesn't affect other tests.
AC_ARG_ENABLE(more-warnings,
[ --enable-more-warnings Maximum compiler warnings],
set_more_warnings="$enableval",[
if test -f $srcdir/CVSVERSION; then
is_cvs_version=true
set_more_warnings=yes
else
set_more_warnings=no
fi
])
AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="\
-Wall \
-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
-Wnested-externs -Wpointer-arith \
-Wcast-align -Wsign-compare \
$CFLAGS"
else
AC_MSG_RESULT(no)
fi
have_gtk=no
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0, have_gtk=yes,
have_gtk=no)
GTK_VERSION=
if test "x$have_gtk" = "xyes"; then
GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_VERSION)
AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")
have_gdk_x11=no
PKG_CHECK_MODULES(GDK_X11, gdk-x11-2.0 >= 2.0.0, have_gdk_x11=yes, have_gdk_x11=no)
if test "x$have_gdk_x11" = "xyes"; then
AC_PATH_XTRA
if test "x$have_x" != "xyes"; then
GDK_X11_LIBS=""
GDK_X11_CFLAGS=""
else
GDK_X11_LIBS="$GDK_X11_LIBS $X_LIBS -lX11"
GDK_X11_CFLAGS="$GDK_X11_CFLAGS $X_CFLAGS"
AC_DEFINE(ENABLE_XEMBED, 1, [Is XEmbed available])
fi
fi
AC_SUBST(GDK_X11_CFLAGS)
AC_SUBST(GDK_X11_LIBS)
AC_ARG_ENABLE(gtk-theme,
[ --enable-gtk-theme Enable a RSVG based GTK+ theme engine [default=auto]],,
enable_gtk_theme=yes)
if test "x$enable_gtk_theme" = "xyes"; then
if test "x$have_gtk" = "xno"; then
enable_gtk_theme=no;
fi
fi
AM_CONDITIONAL(ENABLE_GTK_ENGINE, test "x$enable_gtk_theme" = "xyes")
AC_PATH_PROG(QUERYLOADERS, gdk-pixbuf-query-loaders, true)
AC_ARG_ENABLE(pixbuf-loader,
[ --enable-pixbuf-loader Enable a RSVG based GdkPixbuf loader [default=auto]],
enable_pixbuf_loader="$enableval", enable_pixbuf_loader=auto)
if test "x$enable_pixbuf_loader" = xauto ; then
if test x$QUERYLOADERS != x ; then
enable_pixbuf_loader=yes
else
enable_pixbuf_loader=no
fi
fi
AM_CONDITIONAL(ENABLE_PIXBUF_LOADER, test x$enable_pixbuf_loader = xyes)
##################################################
##################################################
MOZILLA_CFLAGS=
build_mozilla_plugin=no
test_mozilla_plugin=true
AC_ARG_ENABLE(mozilla-plugin, [ --enable-mozilla-plugin Build a Mozilla/Firefox SVG viewing plugin [default = auto]],
test_mozilla_plugin="$enableval")
if test "x$test_mozilla_plugin" != "xno"; then
if test -z "$MOZILLA_CONFIG"; then
AC_PATH_PROGS(MOZILLA_CONFIG, mozilla-config firefox-config xulrunner-config, no)
fi
if test "x$MOZILLA_CONFIG" != "xno"; then
MOZILLA_CFLAGS=`$MOZILLA_CONFIG --cflags plugin java`
else
PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, build_mozilla_plugin=yes,
[AC_MSG_WARN([mozilla-config not found. Mozilla/Netscape plugin will not be built])])
fi
if test "x$MOZILLA_CFLAGS" != "x"; then
build_mozilla_plugin=yes
fi
fi
AM_CONDITIONAL(WITH_MOZILLA,[test "x$build_mozilla_plugin" = "xyes"])
AC_SUBST(MOZILLA_CFLAGS)
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
gtk_doc_installed=true
#ifdef([GTK_DOC_CHECK],[GTK_DOC_CHECK([1.0])],[gtk_doc_installed=false])
# I would have liked to conditionalize this, but
# that appears to break other things http://bugzilla.gnome.org/show_bug.cgi?id=156399
GTK_DOC_CHECK([1.0])
AM_CONDITIONAL(GTK_DOC_INSTALLED, $gtk_doc_installed)
dnl ===========================================================================
m4_copy([AC_DEFUN],[glib_DEFUN])
glib_DEFUN([GLIB_LC_MESSAGES],
[AC_CHECK_HEADERS([locale.h])
if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your <locale.h> file defines LC_MESSAGES.])
fi
fi])
GLIB_LC_MESSAGES
dnl ===========================================================================
AC_CONFIG_FILES([
librsvg.spec
librsvg-features.h
Makefile
librsvg-2.0.pc
librsvg-2.0-uninstalled.pc
librsvg-zip
rsvg
data/Makefile
gtk-engine/Makefile
gtk-engine/examples/Makefile
gtk-engine/examples/bubble/Makefile
gtk-engine/examples/bubble/gtk-2.0/Makefile
gdk-pixbuf-loader/Makefile
moz-plugin/Makefile
tests/Makefile
tests/pdiff/Makefile
doc/Makefile
])
AC_OUTPUT
dnl =============================================================================================
echo "
librsvg-$LIBRSVG_VERSION
prefix: ${prefix}
compiler: ${CC}
Build GdkPixbuf loader: ${enable_pixbuf_loader}
Build theme engine: ${enable_gtk_theme}
Build Netscape plugin: ${build_mozilla_plugin}
Handle svgz files: ${test_gsf}
Use GIO: ${test_gio}
Use libcroco for css parsing: ${test_croco}
"
if test "x$croco_warning" != "x"; then
AC_MSG_RESULT([$croco_warning]);
fi
if test "x$gsf_warning" != "x"; then
AC_MSG_RESULT([$gsf_warning]);
fi