/
configure.ac
305 lines (260 loc) · 8.52 KB
/
configure.ac
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
dnl Initialization
AC_PREREQ(2.58)
AC_INIT([gtkhtml], [4.6.6], [http://bugzilla.gnome.org/enter_bug.cgi?product=GtkHtml])
AM_INIT_AUTOMAKE([gnu 1.9 dist-xz no-dist-gzip -Wno-portability])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_SRCDIR(README)
PACKAGE=gtkhtml
dnl Required Package Versions
m4_define([gtk_minimum_version], [3.0.2])
m4_define([enchant_minimum_version], [1.1.7])
m4_define([gnome_icon_theme_minimum_version], [2.22.0])
m4_define([cairo_minimum_version], [1.10.0])
GTKHTML_API_VERSION=4.0
EDITOR_API_VERSION=4.0
AC_DEFINE_UNQUOTED(GTKHTML_API_VERSION, "${GTKHTML_API_VERSION}", [GtkHTML API Version])
AC_SUBST(GTKHTML_API_VERSION)
AC_DEFINE_UNQUOTED(EDITOR_API_VERSION, "${EDITOR_API_VERSION}", [Editor API Version])
AC_SUBST(EDITOR_API_VERSION)
GTKHTML_RELEASE_STRING=${PACKAGE}-${GTKHTML_API_VERSION}
AC_DEFINE_UNQUOTED(GTKHTML_RELEASE_STRING, "${GTKHTML_RELEASE_STRING}", [GtkHTML Release String])
AC_SUBST(GTKHTML_RELEASE_STRING)
GETTEXT_PACKAGE=${GTKHTML_RELEASE_STRING}
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
I18N_LIB_CFLAGS="-DGNOME_EXPLICIT_TRANSLATION_DOMAIN=\\\"${GTKHTML_RELEASE_STRING}\\\""
AC_SUBST(I18N_LIB_CFLAGS)
dnl Automake 1.11 - Silent Build Rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE([enable])
dnl ************
dnl I18N stuff
dnl ************
IT_PROG_INTLTOOL([0.36.3])
AM_GLIB_GNU_GETTEXT
dnl **********************************
dnl Compiler Warning Flags
dnl **********************************
AS_COMPILER_FLAGS(WARNING_FLAGS,
"-Wall -Wextra
-Wno-missing-field-initializers
-Wno-sign-compare
-Wno-unused-parameter
-Wno-deprecated-declarations
-Wdeclaration-after-statement
-Werror-implicit-function-declaration
-Wformat-nonliteral -Wformat-security -Winit-self
-Wmissing-declarations -Wmissing-include-dirs
-Wmissing-noreturn -Wnested-externs -Wpointer-arith
-Wredundant-decls -Wundef -Wwrite-strings")
AC_SUBST(WARNING_FLAGS)
dnl Other useful compiler warnings for test builds only.
dnl These may produce warnings we have no control over,
dnl or false positives we don't always want to see.
dnl
dnl -Wmissing-format-attribute
dnl -Wshadow
dnl -Wstrict-aliasing=2
dnl XXX This really belongs in AM_CPPFLAGS.
CFLAGS="$CFLAGS $WARNING_FLAGS"
dnl *********************
dnl Necessary programs
dnl *********************
AC_PROG_CC
AC_PROG_CXX
AC_C_INLINE
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_TYPE_SIZE_T
AC_CHECK_FUNCS([memchr memmove memset regcomp setlocale strchr strcspn strrchr strstr strtol strtoull])
AC_CHECK_HEADERS([fcntl.h libintl.h])
dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
dnl behavior that -- according to the C99 standard -- is supposed to be
dnl undefined. We may still have aliasing abuses lying around that rely
dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
dnl optimization until we can find and fix all the abuses.
dnl (AC_PROG_CC must run first to set the GCC variable.)
dnl XXX This really belongs in AM_CFLAGS.
if test "x${GCC}" = "xyes"; then
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
dnl *****************
dnl libtool
dnl *****************
LT_PREREQ(2.2)
LT_INIT(disable-static win32-dll)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
dnl ********
dnl Win32
dnl ********
AC_MSG_CHECKING([for Win32])
case "$host" in
*-mingw*)
os_win32=yes
SOEXT='.dll'
;;
*) os_win32=no
SOEXT='.so'
;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
AC_SUBST(SOEXT)
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_CHECK_LIBM
AC_SUBST(LIBM)
dnl **********************************
dnl GAIL modules
dnl **********************************
GAIL_MODULES="gail-3.0 >= gtk_minimum_version"
PKG_CHECK_MODULES(GAIL, $GAIL_MODULES)
AC_SUBST(GAIL_CFLAGS)
AC_SUBST(GAIL_LIBS)
AC_SUBST(GAIL_MODULES)
dnl **********************************
dnl GTKHTML modules
dnl **********************************
GTKHTML_MODULES="gtk+-3.0 >= gtk_minimum_version enchant >= enchant_minimum_version gsettings-desktop-schemas iso-codes cairo >= cairo_minimum_version"
PKG_CHECK_MODULES(GTKHTML, $GTKHTML_MODULES)
AC_SUBST(GTKHTML_CFLAGS)
AC_SUBST(GTKHTML_LIBS)
AC_SUBST(GTKHTML_MODULES)
dnl **********************************
dnl Glade catalog files
dnl **********************************
AC_ARG_WITH(glade-catalog,
AC_HELP_STRING([--with-glade-catalog],
[install the catalog files for Glade 3]
[(for maintainers only) @<:@default=no@:>@]),
[glade_catalog="$withval"], [glade_catalog="no"])
if test "x$glade_catalog" = "xyes"; then
PKG_CHECK_MODULES(GLADEUI, gladeui-2.0)
fi
AM_CONDITIONAL(GLADE_CATALOG, test x$glade_catalog = xyes)
dnl These are still needed for 'dist' targets.
ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
AC_SUBST(ORBIT_IDL)
dnl **********************************
dnl soup for testgtkhtml
dnl **********************************
HAVE_NEWSOUP="no"
have_newsoup="no"
PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.26.0,
[ HAVE_NEWSOUP="yes"
have_soup="yes"
],
[ PKG_CHECK_MODULES(SOUP, libsoup-2.4,
have_soup="yes",
have_soup="no")
])
AC_SUBST(HAVE_NEWSOUP)
AM_CONDITIONAL(HAVE_SOUP, test x$have_soup != xno)
AM_CONDITIONAL(HAVE_NEWSOUP, test x$HAVE_NEWSOUP != xno)
dnl **************************************************
dnl Gnome Icon Theme
dnl **************************************************
PKG_CHECK_MODULES(GIT, gnome-icon-theme >= gnome_icon_theme_minimum_version)
dnl **************************************************
dnl iso-codes
dnl **************************************************
AC_MSG_CHECKING([for iso-codes package])
have_iso_codes=no
if $PKG_CONFIG --exists iso-codes; then
if $PKG_CONFIG iso-codes --atleast-version=0.49; then
have_iso_codes=yes
AC_MSG_RESULT([$have_iso_codes])
else
AC_MSG_WARN([iso-codes detected, but version 0.49 or later is required due to licensing])
fi
else
AC_MSG_RESULT([$have_iso_codes])
fi
if test "x$have_iso_codes" = "xyes"; then
AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null 2>&1 && \
$PKG_CONFIG --variable=domains iso-codes | grep 3166 >/dev/null 2>&1 ; then
result=yes
else
result=no
have_iso_codes=no
fi
AC_MSG_RESULT([$result])
fi
if test "x$have_iso_codes" = "xyes"; then
AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],
["`$PKG_CONFIG --variable=prefix iso-codes`"],
[ISO codes prefix])
AC_DEFINE([HAVE_ISO_CODES], [1],
[Define if you have the iso-codes package])
fi
dnl **************************************************
dnl XF86 multimedia keys support
dnl **************************************************
AC_CHECK_HEADER([X11/XF86keysym.h],
[AC_DEFINE([HAVE_XFREE], 1, [Have <X11/XF86keysym.h>])],,
[[ #if HAVE_XFREE
#include <X11/XF86keysym.h>
#endif
]])
dnl **************************************************
dnl regex library
dnl **************************************************
AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,[REGEX_LIBS=-lregex],[AC_MSG_ERROR([No regex library found])])])
AC_SUBST(REGEX_LIBS)
dnl ******************************
dnl shlib factory
dnl ******************************
AC_ARG_ENABLE([shlib-factory],
AS_HELP_STRING([--enable-shlib-factory],
[build editor factory as shared library @<:@default=yes@:>@]),
[enable_shlib_factory="$enableval"],
[enable_shlib_factory="yes"])
if test "x$enable_shlib_factory" = "xyes"; then
GNOME_GTKHTML_EDITOR_SHLIB=1
GNOME_GTKHTML_EDITOR_TYPE="shlib"
AC_DEFINE(GNOME_GTKHTML_EDITOR_SHLIB,, [Editor shlib])
else
GNOME_GTKHTML_EDITOR_TYPE="exe"
fi
AC_SUBST(GNOME_GTKHTML_EDITOR_TYPE)
AM_CONDITIONAL(EDITOR_SHLIB, test x$enable_shlib_factory = xyes)
dnl **********************************
dnl Library version information.
dnl **********************************
dnl Increment the following if the interface has additions, changes,
dnl removals.
GTKHTML_CURRENT=0
dnl Increment any time the source changes; set to 0 if you
dnl increment CURRENT.
GTKHTML_REVISION=0
dnl Increment if any interfaces have been added; set to 0
dnl if any interfaces have been removed. removal has
dnl precedence over adding, so set to 0 if both happened.
GTKHTML_AGE=0
AC_SUBST(GTKHTML_CURRENT)
AC_SUBST(GTKHTML_REVISION)
AC_SUBST(GTKHTML_AGE)
dnl **************
dnl Done.
dnl **************
AC_CONFIG_FILES([
Makefile
gtkhtml-zip
a11y/Makefile
art/Makefile
components/Makefile
components/editor/Makefile
components/editor/gtkhtml-editor.pc
gtkhtml/Makefile
gtkhtml/libgtkhtml.pc
po/Makefile.in
])
AC_OUTPUT
echo "
Configuration:
Cookies support in soup : ${HAVE_NEWSOUP}
Editor component type : ${GNOME_GTKHTML_EDITOR_TYPE}
"