Updated Esperanto translation
[gtkhtml.git] / configure.ac
blobaf6ae4685dffb2277c52b4fb3aa1170b3729df3d
1 dnl Initialization
2 AC_PREREQ(2.58)
3 AC_INIT([gtkhtml], [4.11.1], [http://bugzilla.gnome.org/enter_bug.cgi?product=GtkHtml])
4 AM_INIT_AUTOMAKE([gnu 1.9 dist-xz no-dist-gzip -Wno-portability])
5 AC_CONFIG_MACRO_DIR([m4])
6 AC_CONFIG_HEADERS(config.h)
7 AC_CONFIG_SRCDIR(README)
9 PACKAGE=gtkhtml
11 dnl Required Package Versions
12 m4_define([gtk_minimum_version], [3.2.0])
13 m4_define([enchant_minimum_version], [1.1.7])
14 m4_define([cairo_minimum_version], [1.10.0])
16 GTKHTML_API_VERSION=4.0
17 EDITOR_API_VERSION=4.0
19 AC_DEFINE_UNQUOTED(GTKHTML_API_VERSION, "${GTKHTML_API_VERSION}", [GtkHTML API Version])
20 AC_SUBST(GTKHTML_API_VERSION)
22 AC_DEFINE_UNQUOTED(EDITOR_API_VERSION, "${EDITOR_API_VERSION}", [Editor API Version])
23 AC_SUBST(EDITOR_API_VERSION)
25 GTKHTML_RELEASE_STRING=${PACKAGE}-${GTKHTML_API_VERSION}
26 AC_DEFINE_UNQUOTED(GTKHTML_RELEASE_STRING, "${GTKHTML_RELEASE_STRING}", [GtkHTML Release String])
27 AC_SUBST(GTKHTML_RELEASE_STRING)
29 GETTEXT_PACKAGE=${GTKHTML_RELEASE_STRING}
30 AC_SUBST(GETTEXT_PACKAGE)
31 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
33 I18N_LIB_CFLAGS="-DGNOME_EXPLICIT_TRANSLATION_DOMAIN=\\\"${GTKHTML_RELEASE_STRING}\\\""
34 AC_SUBST(I18N_LIB_CFLAGS)
36 dnl Automake 1.11 - Silent Build Rules
37 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39 AM_MAINTAINER_MODE([enable])
41 dnl ************
42 dnl I18N stuff
43 dnl ************
44 IT_PROG_INTLTOOL([0.36.3])
45 AM_GLIB_GNU_GETTEXT
47 dnl **********************************
48 dnl Compiler Warning Flags
49 dnl **********************************
50 AS_COMPILER_FLAGS(WARNING_FLAGS,
51         "-Wall -Wextra
52         -Wno-missing-field-initializers
53         -Wno-sign-compare
54         -Wno-unused-parameter
55         -Wno-deprecated-declarations
56         -Wdeclaration-after-statement
57         -Werror-implicit-function-declaration
58         -Wformat-nonliteral -Wformat-security -Winit-self
59         -Wmissing-declarations -Wmissing-include-dirs
60         -Wmissing-noreturn -Wnested-externs -Wpointer-arith
61         -Wredundant-decls -Wundef -Wwrite-strings")
62 AC_SUBST(WARNING_FLAGS)
64 dnl Other useful compiler warnings for test builds only.
65 dnl These may produce warnings we have no control over,
66 dnl or false positives we don't always want to see.
67 dnl
68 dnl     -Wmissing-format-attribute
69 dnl     -Wshadow
70 dnl     -Wstrict-aliasing=2
72 dnl XXX This really belongs in AM_CPPFLAGS.
73 CFLAGS="$CFLAGS $WARNING_FLAGS"
75 dnl *********************
76 dnl Necessary programs
77 dnl *********************
78 AC_PROG_CC
79 AC_PROG_CXX
80 AC_C_INLINE
81 AC_FUNC_ALLOCA
82 AC_FUNC_MALLOC
83 AC_TYPE_SIZE_T
85 AC_CHECK_FUNCS([memchr memmove memset regcomp setlocale strchr strcspn strrchr strstr strtol strtoull])
86 AC_CHECK_HEADERS([fcntl.h libintl.h])
88 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
89 dnl behavior that -- according to the C99 standard -- is supposed to be
90 dnl undefined.  We may still have aliasing abuses lying around that rely
91 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
92 dnl optimization until we can find and fix all the abuses.
93 dnl (AC_PROG_CC must run first to set the GCC variable.)
94 dnl XXX This really belongs in AM_CFLAGS.
95 if test "x${GCC}" = "xyes"; then
96         CFLAGS="$CFLAGS -fno-strict-aliasing"
99 dnl *****************
100 dnl libtool
101 dnl *****************
102 LT_PREREQ(2.2)
103 LT_INIT(disable-static win32-dll)
105 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
107 dnl ********
108 dnl Win32
109 dnl ********
110 AC_MSG_CHECKING([for Win32])
111 case "$host" in
112 *-mingw*)
113     os_win32=yes
114     SOEXT='.dll'
115     ;;
116 *)  os_win32=no
117     SOEXT='.so'
118     ;;
119 esac
120 AC_MSG_RESULT([$os_win32])
121 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
122 AC_SUBST(SOEXT)
124 AC_SUBST(CFLAGS)
125 AC_SUBST(CPPFLAGS)
126 AC_SUBST(LDFLAGS)
128 AC_CHECK_LIBM
129 AC_SUBST(LIBM)
131 dnl **********************************
132 dnl GAIL modules
133 dnl **********************************
134 GAIL_MODULES="gail-3.0 >= gtk_minimum_version"
135 PKG_CHECK_MODULES(GAIL, $GAIL_MODULES)
136 AC_SUBST(GAIL_CFLAGS)
137 AC_SUBST(GAIL_LIBS)
138 AC_SUBST(GAIL_MODULES)
140 dnl **********************************
141 dnl GTKHTML modules
142 dnl **********************************
143 GTKHTML_MODULES="gtk+-3.0 >= gtk_minimum_version enchant >= enchant_minimum_version gsettings-desktop-schemas iso-codes cairo >= cairo_minimum_version"
144 PKG_CHECK_MODULES(GTKHTML, $GTKHTML_MODULES)
145 AC_SUBST(GTKHTML_CFLAGS)
146 AC_SUBST(GTKHTML_LIBS)
147 AC_SUBST(GTKHTML_MODULES)
149 dnl **********************************
150 dnl Glade catalog files
151 dnl **********************************
152 AC_ARG_WITH(glade-catalog,
153         AC_HELP_STRING([--with-glade-catalog],
154         [install the catalog files for Glade 3]
155         [(for maintainers only) @<:@default=no@:>@]),
156         [glade_catalog="$withval"], [glade_catalog="no"])
157 if test "x$glade_catalog" = "xyes"; then
158         PKG_CHECK_MODULES(GLADEUI, gladeui-2.0)
160 AM_CONDITIONAL(GLADE_CATALOG, test x$glade_catalog = xyes)
162 dnl These are still needed for 'dist' targets.
163 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
164 AC_SUBST(ORBIT_IDL)
166 dnl **********************************
167 dnl soup for testgtkhtml
168 dnl **********************************
169 HAVE_NEWSOUP="no"
170 have_newsoup="no"
171 PKG_CHECK_MODULES(SOUP, libsoup-2.4  >= 2.26.0,
172         [       HAVE_NEWSOUP="yes"
173                 have_soup="yes"
174         ],
175         [       PKG_CHECK_MODULES(SOUP, libsoup-2.4,
176                 have_soup="yes",
177                 have_soup="no")
178         ])
179 AC_SUBST(HAVE_NEWSOUP)
180 AM_CONDITIONAL(HAVE_SOUP, test x$have_soup != xno)
181 AM_CONDITIONAL(HAVE_NEWSOUP, test x$HAVE_NEWSOUP != xno)
183 dnl **************************************************
184 dnl iso-codes
185 dnl **************************************************
186 AC_MSG_CHECKING([for iso-codes package])
187 have_iso_codes=no
188 if $PKG_CONFIG --exists iso-codes; then
189         if $PKG_CONFIG iso-codes --atleast-version=0.49; then
190                 have_iso_codes=yes
191                 AC_MSG_RESULT([$have_iso_codes])
192         else
193                 AC_MSG_WARN([iso-codes detected, but version 0.49 or later is required due to licensing])
194         fi
195 else
196         AC_MSG_RESULT([$have_iso_codes])
199 if test "x$have_iso_codes" = "xyes"; then
200         AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
201         if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null 2>&1 && \
202                 $PKG_CONFIG --variable=domains iso-codes | grep 3166 >/dev/null 2>&1 ; then
203                         result=yes
204         else
205                 result=no
206                 have_iso_codes=no
207         fi
208         AC_MSG_RESULT([$result])
211 if test "x$have_iso_codes" = "xyes"; then
212         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],
213                 ["`$PKG_CONFIG --variable=prefix iso-codes`"],
214                 [ISO codes prefix])
215         AC_DEFINE([HAVE_ISO_CODES], [1],
216                 [Define if you have the iso-codes package])
219 dnl **************************************************
220 dnl XF86 multimedia keys support
221 dnl **************************************************
222 AC_CHECK_HEADER([X11/XF86keysym.h],
223         [AC_DEFINE([HAVE_XFREE], 1, [Have <X11/XF86keysym.h>])],,
224         [[      #if HAVE_XFREE
225                 #include <X11/XF86keysym.h>
226                 #endif
227         ]])
229 dnl **************************************************
230 dnl regex library
231 dnl **************************************************
232 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,[REGEX_LIBS=-lregex],[AC_MSG_ERROR([No regex library found])])])
233 AC_SUBST(REGEX_LIBS)
235 dnl ******************************
236 dnl shlib factory
237 dnl ******************************
238 AC_ARG_ENABLE([shlib-factory],
239                 AS_HELP_STRING([--enable-shlib-factory],
240                 [build editor factory as shared library @<:@default=yes@:>@]),
241                 [enable_shlib_factory="$enableval"],
242                 [enable_shlib_factory="yes"])
244 if test "x$enable_shlib_factory" = "xyes"; then
245         GNOME_GTKHTML_EDITOR_SHLIB=1
246         GNOME_GTKHTML_EDITOR_TYPE="shlib"
247         AC_DEFINE(GNOME_GTKHTML_EDITOR_SHLIB,, [Editor shlib])
248 else
249         GNOME_GTKHTML_EDITOR_TYPE="exe"
252 AC_SUBST(GNOME_GTKHTML_EDITOR_TYPE)
253 AM_CONDITIONAL(EDITOR_SHLIB, test x$enable_shlib_factory = xyes)
255 dnl **********************************
256 dnl Library version information.
257 dnl **********************************
259 dnl Increment the following if the interface has additions, changes,
260 dnl removals.
261 GTKHTML_CURRENT=0
263 dnl Increment any time the source changes; set to 0 if you
264 dnl increment CURRENT.
265 GTKHTML_REVISION=0
267 dnl Increment if any interfaces have been added; set to 0
268 dnl if any interfaces have been removed. removal has 
269 dnl precedence over adding, so set to 0 if both happened.
270 GTKHTML_AGE=0
272 AC_SUBST(GTKHTML_CURRENT)
273 AC_SUBST(GTKHTML_REVISION)
274 AC_SUBST(GTKHTML_AGE)
276 dnl **************
277 dnl Done.
278 dnl **************
280 AC_CONFIG_FILES([
281 Makefile
282 a11y/Makefile
283 art/Makefile
284 components/Makefile
285 components/editor/Makefile
286 components/editor/gtkhtml-editor.pc
287 gtkhtml/Makefile
288 gtkhtml/libgtkhtml.pc
289 po/Makefile.in
291 AC_OUTPUT
293 echo "
294 Configuration:
296         Cookies support in soup :               ${HAVE_NEWSOUP}
297         Editor component type   :               ${GNOME_GTKHTML_EDITOR_TYPE}