forked from GNOME/librsvg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
343 lines (272 loc) · 11 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
m4_define([rsvg_major_version],[2])
m4_define([rsvg_minor_version],[36])
m4_define([rsvg_micro_version],[2])
m4_define([rsvg_extra_version],[])
m4_define([rsvg_version],[rsvg_major_version.rsvg_minor_version.rsvg_micro_version()rsvg_extra_version])
m4_define([rsvg_lt_version_info],m4_eval(rsvg_major_version + rsvg_minor_version):rsvg_micro_version:rsvg_minor_version)
AC_INIT([RSVG],[rsvg_version],[https://bugzilla.gnome.org/enter_bug.cgi?product=librsvg],[librsvg])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([rsvg.h])
AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE([enable])
dnl ===========================================================================
dnl API versioning
dnl ===========================================================================
RSVG_API_VERSION=2.0
RSVG_API_MAJOR_VERSION=2
RSVG_API_MINOR_VERSION=0
AC_SUBST([RSVG_API_VERSION])
AC_SUBST([RSVG_API_MAJOR_VERSION])
AC_SUBST([RSVG_API_MINOR_VERSION])
AC_SUBST([RSVG_API_VERSION_U],[AS_TR_SH([$RSVG_API_VERSION])])
dnl ===========================================================================
GLIB_REQUIRED=2.12.0
GIO_REQUIRED=2.24.0
LIBXML_REQUIRED=2.7.0
CAIRO_REQUIRED=1.2.0
PANGOCAIRO_REQUIRED=1.16.0
GDK_PIXBUF_REQUIRED=1.3.7
GTK2_REQUIRED=2.16.0
GTK3_REQUIRED=3.0.0
CROCO_REQUIRED=0.6.1
# ===========================================================================
AC_SUBST([RSVG_LT_VERSION_INFO],[rsvg_lt_version_info])
AC_SUBST([LIBRSVG_MAJOR_VERSION],[rsvg_major_version])
AC_SUBST([LIBRSVG_MINOR_VERSION],[rsvg_minor_version])
AC_SUBST([LIBRSVG_MICRO_VERSION],[rsvg_micro_version])
dnl ===========================================================================
AC_PROG_LN_S
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_AWK
AC_STDC_HEADERS
AM_PROG_CC_C_O
AC_C_BIGENDIAN
PKG_PROG_PKG_CONFIG
LT_INIT([win32-dll])
LT_LIB_M
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 ===========================================================================
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
AC_SUBST(GLIB_MKENUMS)
PKG_CHECK_MODULES(LIBRSVG, \
gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED \
glib-2.0 >= $GLIB_REQUIRED \
gio-2.0 >= $GIO_REQUIRED \
libxml-2.0 >= $LIBXML_REQUIRED \
pangocairo >= $PANGOCAIRO_REQUIRED \
cairo >= $CAIRO_REQUIRED \
cairo-png >= $CAIRO_REQUIRED
libcroco-0.6 >= $CROCO_REQUIRED)
PKG_CHECK_MODULES([GTHREAD],[gthread-2.0 >= $GLIB_REQUIRED])
PKG_CHECK_MODULES([GMODULE],[gmodule-2.0])
dnl ===========================================================================
AC_CHECK_FUNCS(strtok_r)
# ===========================================================================
# GTK
# ===========================================================================
PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= $GTK2_REQUIRED],[have_gtk_2=yes],[have_gtk_2=no])
PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= $GTK3_REQUIRED],[have_gtk_3=yes],[have_gtk_3=no])
GTK2_BINARY_VERSION=
GTK3_BINARY_VERSION=
if test "$have_gtk_2" = "yes"; then
GTK2_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`"
fi
if test "$have_gtk_3" = "yes"; then
GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
fi
AC_SUBST([GTK2_BINARY_VERSION])
AC_SUBST([GTK3_BINARY_VERSION])
AM_CONDITIONAL([HAVE_GTK_2],[test "$have_gtk_2" = "yes"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$have_gtk_3" = "yes"])
# ===========================================================================
# GTK theme engine
# ===========================================================================
if test "$have_gtk_2"; then
AC_MSG_CHECKING([whether to build the GTK+ theme engine])
AC_ARG_ENABLE([gtk-theme],
[AS_HELP_STRING([--disable-gtk-theme],[Disable a RSVG based GTK+ theme engine (default=yes)])],
[],[enable_gtk_theme=yes])
AC_MSG_RESULT([$enable_gtk_theme])
else
enable_gtk_theme=no
fi
AM_CONDITIONAL([ENABLE_GTK2_ENGINE],[test "$enable_gtk_theme" = "yes"])
dnl ===========================================================================
dnl GDK-Pixbuf SVG loader
dnl ===========================================================================
AC_MSG_CHECKING([whether to build the GDK-Pixbuf SVG loader])
AC_ARG_ENABLE([pixbuf-loader],
[AS_HELP_STRING([--disable-pixbuf-loader],[Disable a RSVG based GdkPixbuf loader (default=yes)])],
[],[enable_pixbuf_loader=yes])
AC_MSG_RESULT([$enable_pixbuf_loader])
gdk_pixbuf_moduledir=
if test "$enable_pixbuf_loader" = "yes"; then
PKG_CHECK_MODULES([GDK_PIXBUF],[gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED])
AC_PATH_PROGS([GDK_PIXBUF_QUERYLOADERS],[gdk-pixbuf-query-loaders-64 gdk-pixbuf-query-loaders],[none])
if test "x$GDK_PIXBUF_QUERYLOADERS" = "xnone"; then
AC_MSG_ERROR([gdk-pixbuf-query-loaders not found in path])
fi
# First try the standalone gdk-pixbuf
gdk_pixbuf_binary_version="`$PKG_CONFIG --variable=gdk_pixbuf_binary_version gdk-pixbuf-2.0`"
gdk_pixbuf_binarydir="`$PKG_CONFIG --variable=gdk_pixbuf_binarydir gdk-pixbuf-2.0`"
gdk_pixbuf_moduledir=`$PKG_CONFIG --variable gdk_pixbuf_moduledir gdk-pixbuf-2.0`
gdk_pixbuf_cache_file=`$PKG_CONFIG --variable gdk_pixbuf_cache_file gdk-pixbuf-2.0`
# If that didn't work, fall back to the gtk+-2.0 one
if test "x$gdk_pixbuf_moduledir" = "x"; then
gtk_binary_version="`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`"
gdk_pixbuf_binarydir='${sysconfdir}/gtk-2.0'
gdk_pixbuf_moduledir='${libdir}/gtk-2.0/'
gdk_pixbuf_moduledir="$gdk_pixbuf_moduledir/$gtk_binary_version/loaders"
gdk_pixbuf_cache_file='${gdk_pixbuf_binarydir}/gdk-pixbuf.loaders'
fi
fi
AC_SUBST([gdk_pixbuf_binary_version])
AC_SUBST([gdk_pixbuf_binarydir])
AC_SUBST([gdk_pixbuf_moduledir])
AC_SUBST([gdk_pixbuf_cache_file])
AM_CONDITIONAL([ENABLE_PIXBUF_LOADER],[test "$enable_pixbuf_loader" = "yes"])
##########################################################
# Check for -Bsymbolic-functions linker flag used to avoid
# intra-library PLT jumps, if available.
##########################################################
AC_ARG_ENABLE([Bsymbolic],
[AS_HELP_STRING([--disable-Bsymbolic],
[disable linking with -Bsymbolic])],
[],[enable_Bsymbolic=yes])
BSYMBOLIC_LDFLAG=
if test "$enable_Bsymbolic" != "no"; then
CC_CHECK_LDFLAGS(["-Wl,-Bsymbolic-functions"],
[BSYMBOLIC_LDFLAG="-Wl,-Bsymbolic-functions"],
[if test "$enable_Bsymbolic" = "auto"; then
AC_MSG_WARN([-Bsymbolic not supported by ld; disabling])
enable_Bsymbolic=no
else
AC_MSG_ERROR([-Bsymbolic requested but not supported by ld. Use --disable-Bsymbolic to disable])
fi])
fi
AC_SUBST([BSYMBOLIC_LDFLAG])
##################################################
# Compiler warnings
##################################################
save_CFLAGS="$CFLAGS"
CFLAGS=
CC_CHECK_CFLAGS_APPEND([ \
-Wall -Wextra \
-Wunused -Wreturn-type -Wswitch -Wcomment -Wtrigraphs \
-Wchar-subscripts -Wparentheses -Winline -Wredundant-decls \
-Wformat-nonliteral -Werror=format-security \
-Wsign-compare -Werror=implicit-function-declaration \
-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
-Waggregate-return -Wcast-align -Wimplicit -Wuninitialized \
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
-Wpacked -Wmissing-format-attribute -Wshadow \
-Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
-Wdeclaration-after-statement -Wold-style-definition \
-Wno-missing-field-initializers -Wno-unused-parameter \
-Wunused-variable -Wunused-function \
-Wempty-body -Wno-switch-enum \
-fno-common])
AM_CFLAGS="$AM_CFLAGS $CFLAGS"
CFLAGS="$save_CFLAGS"
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
GTK_DOC_CHECK([1.13],[--flavour no-tmpl])
AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)])
AC_SUBST([GDK_PIXBUF_PREFIX],[$($PKG_CONFIG --variable=prefix gdk-pixbuf-2.0)])
AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gdk-pixbuf-2.0)])
AC_SUBST([CAIRO_PREFIX],[$($PKG_CONFIG --variable=prefix cairo)])
dnl ===========================================================================
dnl Do we build the miscellaenous tools provided with librsvg ?
AC_ARG_ENABLE(tools,
AC_HELP_STRING([--disable-tools],
[do not build miscellaenous tools [default=no]]),
[build_misc_tools=$enableval],
[build_misc_tools=yes])
AC_MSG_CHECKING(whether to build miscellaenous tools)
if test "x$build_misc_tools" = "xyes" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL([BUILD_MISC_TOOLS], [test "x$build_misc_tools" = "xyes"])
dnl ===========================================================================
dnl Build introspectable bindings
# No automagic please!
if test -z "$enable_introspection"; then
enable_introspection=yes
fi
GOBJECT_INTROSPECTION_CHECK([0.10.8])
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_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([
librsvg-features.h
Makefile
librsvg-zip
gtk-engine/Makefile
gtk-engine/examples/Makefile
gtk-engine/examples/bubble/Makefile
gdk-pixbuf-loader/Makefile
tests/Makefile
tests/pdiff/Makefile
tools/Makefile
doc/Makefile
doc/version.xml
])
AC_CONFIG_FILES([librsvg-${RSVG_API_VERSION}.pc:librsvg.pc.in],[],[RSVG_API_VERSION=$RSVG_API_VERSION])
AC_CONFIG_FILES([librsvg-${RSVG_API_VERSION}-uninstalled.pc:librsvg-uninstalled.pc.in],[],[RSVG_API_VERSION=$RSVG_API_VERSION])
AC_OUTPUT
dnl =============================================================================================
echo "
librsvg-$VERSION
prefix: ${prefix}
compiler: ${CC}
Build introspectable bindings: ${found_introspection}
Build GdkPixbuf loader: ${enable_pixbuf_loader}
GTK 2.0: ${have_gtk_2}
GTK 3.0: ${have_gtk_3}
Build GTK 2.0 theme engine: ${enable_gtk_theme}
Build miscellaenous tools: ${build_misc_tools}
"