Gconf-less
[gtkhtml/pkgcrosswire.git] / configure.ac
blob9334c3ccf7104e0939971bd0169a7d417c3ecd71
1 dnl Initialization
2 AC_PREREQ(2.58)
3 AC_INIT([gtkhtml], [3.31.1], [http://bugzilla.gnome.org/enter_bug.cgi?product=GtkHtml])
4 AM_INIT_AUTOMAKE([gnu 1.9])
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], [2.20.0])
13 m4_define([gail_minimum_version], [1.1.0])
14 m4_define([enchant_minimum_version], [1.1.7])
15 m4_define([gnome_icon_theme_minimum_version], [2.22.0])
17 GTKHTML_API_VERSION=3.14
18 AC_DEFINE_UNQUOTED(GTKHTML_API_VERSION, "${GTKHTML_API_VERSION}", [GtkHTML API Version])
19 AC_SUBST(GTKHTML_API_VERSION)
21 EDITOR_API_VERSION=3.14
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
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         "-DG_DISABLE_DEPRECATED
52         -DPANGO_DISABLE_DEPRECATED
53         -DGDK_DISABLE_DEPRECATED
54         -DGDK_PIXBUF_DISABLE_DEPRECATED
55         -DGTK_DISABLE_DEPRECATED
56         -DGNOME_DISABLE_DEPRECATED
57         -DG_DISABLE_SINGLE_INCLUDES
58         -DGTK_DISABLE_SINGLE_INCLUDES
59         -Wall -Wextra
60         -Wno-missing-field-initializers
61         -Wno-sign-compare
62         -Wno-unused-parameter
63         -Wdeclaration-after-statement
64         -Werror-implicit-function-declaration
65         -Wformat-nonliteral -Wformat-security -Winit-self
66         -Wmissing-declarations -Wmissing-include-dirs
67         -Wmissing-noreturn -Wnested-externs -Wpointer-arith
68         -Wredundant-decls -Wundef -Wwrite-strings")
69 AC_SUBST(WARNING_FLAGS)
71 dnl Other useful compiler warnings for test builds only.
72 dnl These may produce warnings we have no control over,
73 dnl or false positives we don't always want to see.
74 dnl
75 dnl     -Wmissing-format-attribute
76 dnl     -Wshadow
77 dnl     -Wstrict-aliasing=2
79 dnl GCC 4.4 got more aggressive in its aliasing optimizations, changing
80 dnl behavior that -- according to the C99 standard -- is supposed to be
81 dnl undefined.  We may still have aliasing abuses lying around that rely
82 dnl on GCC's previous "undefined" behavior, so disable strict-aliasing
83 dnl optimization until we can find and fix all the abuses.
84 dnl XXX This really belongs in AM_CFLAGS.
85 CFLAGS="$CFLAGS $WARNING_FLAGS -fno-strict-aliasing"
87 dnl *********************
88 dnl Necessary programs
89 dnl *********************
90 AC_PROG_CC
91 AC_PROG_CXX
92 AC_C_INLINE
93 AC_FUNC_ALLOCA
94 AC_FUNC_MALLOC
95 AC_TYPE_SIZE_T
97 AC_CHECK_FUNCS([memchr memmove memset regcomp setlocale strchr strcspn strrchr strstr strtol strtoull])
98 AC_CHECK_HEADERS([fcntl.h libintl.h])
100 dnl *****************
101 dnl libtool
102 dnl *****************
103 LT_PREREQ(2.2)
104 LT_INIT(disable-static win32-dll)
106 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
108 dnl ********
109 dnl Win32
110 dnl ********
111 AC_MSG_CHECKING([for Win32])
112 case "$host" in
113 *-mingw*)
114     os_win32=yes
115     SOEXT='.dll'
116     ;;
117 *)  os_win32=no
118     SOEXT='.so'
119     ;;
120 esac
121 AC_MSG_RESULT([$os_win32])
122 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
123 AC_SUBST(SOEXT)
125 AC_SUBST(CFLAGS)
126 AC_SUBST(CPPFLAGS)
127 AC_SUBST(LDFLAGS)
129 dnl **********************************
130 dnl GAIL modules
131 dnl **********************************
132 GAIL_MODULES="gail >= gail_minimum_version"
133 PKG_CHECK_MODULES(GAIL, $GAIL_MODULES)
134 AC_SUBST(GAIL_CFLAGS)
135 AC_SUBST(GAIL_LIBS)
136 AC_SUBST(GAIL_MODULES)
138 dnl **********************************
139 dnl GTHREAD modules
140 dnl **********************************
141 GTHREAD_MODULES="gthread-2.0"
142 PKG_CHECK_MODULES(GTHREAD, $GTHREAD_MODULES)
143 AC_SUBST(GTHREAD_CFLAGS)
144 AC_SUBST(GTHREAD_LIBS)
146 dnl **********************************
147 dnl GTKHTML modules
148 dnl **********************************
149 GTKHTML_MODULES="gtk+-2.0 >= gtk_minimum_version enchant >= enchant_minimum_version iso-codes"
150 PKG_CHECK_MODULES(GTKHTML, $GTKHTML_MODULES)
151 AC_SUBST(GTKHTML_CFLAGS)
152 AC_SUBST(GTKHTML_LIBS)
153 AC_SUBST(GTKHTML_MODULES)
155 dnl **********************************
156 dnl Glade catalog files
157 dnl **********************************
158 AC_ARG_WITH(glade-catalog,
159         AC_HELP_STRING([--with-glade-catalog],
160         [install the catalog files for Glade 3]
161         [(for maintainers only) @<:@default=no@:>@]),
162         [glade_catalog="$withval"], [glade_catalog="no"])
163 if test "x$glade_catalog" = "xyes"; then
164         PKG_CHECK_MODULES(GLADEUI, gladeui-1.0)
166 AM_CONDITIONAL(GLADE_CATALOG, test x$glade_catalog = xyes)
168 dnl These are still needed for 'dist' targets.
169 ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
170 AC_SUBST(ORBIT_IDL)
172 dnl **********************************
173 dnl soup for testgtkhtml
174 dnl **********************************
175 HAVE_NEWSOUP="no"
176 have_newsoup="no"
177 PKG_CHECK_MODULES(SOUP, libsoup-2.4  >= 2.26.0,
178         [       HAVE_NEWSOUP="yes"
179                 have_soup="yes"
180         ],
181         [       PKG_CHECK_MODULES(SOUP, libsoup-2.4,
182                 have_soup="yes",
183                 have_soup="no")
184         ])
185 AC_SUBST(HAVE_NEWSOUP)
186 AM_CONDITIONAL(HAVE_SOUP, test x$have_soup != xno)
187 AM_CONDITIONAL(HAVE_NEWSOUP, test x$HAVE_NEWSOUP != xno)
189 dnl **************************************************
190 dnl Gnome Icon Theme
191 dnl **************************************************
192 PKG_CHECK_MODULES(GIT, gnome-icon-theme >= gnome_icon_theme_minimum_version)
194 dnl **************************************************
195 dnl iso-codes
196 dnl **************************************************
197 AC_MSG_CHECKING([for iso-codes package])
198 have_iso_codes=no
199 if $PKG_CONFIG --exists iso-codes; then
200         if $PKG_CONFIG iso-codes --atleast-version=0.49; then
201                 have_iso_codes=yes
202                 AC_MSG_RESULT([$have_iso_codes])
203         else
204                 AC_MSG_WARN([iso-codes detected, but version 0.49 or later is required due to licensing])
205         fi
206 else
207         AC_MSG_RESULT([$have_iso_codes])
210 if test "x$have_iso_codes" = "xyes"; then
211         AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
212         if $PKG_CONFIG --variable=domains iso-codes | grep 639 >/dev/null 2>&1 && \
213                 $PKG_CONFIG --variable=domains iso-codes | grep 3166 >/dev/null 2>&1 ; then
214                         result=yes
215         else
216                 result=no
217                 have_iso_codes=no
218         fi
219         AC_MSG_RESULT([$result])
222 if test "x$have_iso_codes" = "xyes"; then
223         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],
224                 ["`$PKG_CONFIG --variable=prefix iso-codes`"],
225                 [ISO codes prefix])
226         AC_DEFINE([HAVE_ISO_CODES], [1],
227                 [Define if you have the iso-codes package])
230 dnl **************************************************
231 dnl regex library
232 dnl **************************************************
233 AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,[REGEX_LIBS=-lregex],[AC_MSG_ERROR([No regex library found])])])
234 AC_SUBST(REGEX_LIBS)
236 dnl ******************************
237 dnl shlib factory
238 dnl ******************************
239 AC_ARG_ENABLE([shlib-factory],
240                 AS_HELP_STRING([--enable-shlib-factory],
241                 [build editor factory as shared library @<:@default=yes@:>@]),
242                 [enable_shlib_factory="$enableval"],
243                 [enable_shlib_factory="yes"])
245 if test "x$enable_shlib_factory" = "xyes"; then
246         GNOME_GTKHTML_EDITOR_SHLIB=1
247         GNOME_GTKHTML_EDITOR_TYPE="shlib"
248         AC_DEFINE(GNOME_GTKHTML_EDITOR_SHLIB,, [Editor shlib])
249 else
250         GNOME_GTKHTML_EDITOR_TYPE="exe"
253 AC_SUBST(GNOME_GTKHTML_EDITOR_TYPE)
254 AM_CONDITIONAL(EDITOR_SHLIB, test x$enable_shlib_factory = xyes)
256 dnl **********************************
257 dnl Library version information.
258 dnl **********************************
260 dnl Increment the following if the interface has additions, changes,
261 dnl removals.
262 GTKHTML_CURRENT=20
264 dnl Increment any time the source changes; set to 0 if you
265 dnl increment CURRENT.
266 GTKHTML_REVISION=1
268 dnl Increment if any interfaces have been added; set to 0
269 dnl if any interfaces have been removed. removal has 
270 dnl precedence over adding, so set to 0 if both happened.
271 GTKHTML_AGE=1
273 AC_SUBST(GTKHTML_CURRENT)
274 AC_SUBST(GTKHTML_REVISION)
275 AC_SUBST(GTKHTML_AGE)
277 dnl **************
278 dnl Done.
279 dnl **************
281 AC_CONFIG_FILES([
282 Makefile
283 gtkhtml-zip
284 a11y/Makefile
285 art/Makefile
286 components/Makefile
287 components/editor/Makefile
288 components/editor/gtkhtml-editor.pc
289 gtkhtml/Makefile
290 gtkhtml/libgtkhtml.pc
291 po/Makefile.in
293 AC_OUTPUT
295 echo "
296 Configuration:
298         Cookies support in soup :               ${HAVE_NEWSOUP}
299         Editor component type   :               ${GNOME_GTKHTML_EDITOR_TYPE}