Initial import of ephy (rev# 7126) from svn
[ephy-soc.git] / configure.ac
blob3341610de4ed8e23f5f394ddd60fe8cc6b8fa15c
1 # Copyright © 2000-2004 Marco Pesenti Gritti
2 # Copyright © 2003, 2004, 2005, 2006, 2007 Christian Persch
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 2 of the License, or (at your
7 # option) any later version.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License along
15 # with this program; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18 AC_INIT([GNOME Web Browser],[2.19.6],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
20 GNOME_COMMON_INIT
22 AC_PREREQ([2.59])
24 AC_CONFIG_MACRO_DIR([m4])
25 AC_CONFIG_HEADERS([config.h])
26 AC_CONFIG_SRCDIR([configure.ac])
28 EPIPHANY_MAJOR=2.19
29 EPIPHANY_API_VERSION=2.19
31 # This should stay at the major version of the latest stable releases
32 EPIPHANY_UA_VERSION=2.18
34 AC_SUBST([EPIPHANY_MAJOR])
35 AC_SUBST([EPIPHANY_API_VERSION])
36 AC_SUBST([EPIPHANY_UA_VERSION])
38 AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip])
40 AM_MAINTAINER_MODE
42 AC_ENABLE_SHARED([yes])
43 AC_ENABLE_STATIC([no])
45 AC_LIBTOOL_DLOPEN
46 AC_PROG_LIBTOOL
48 AC_ISC_POSIX
49 AC_PROG_CC
50 AC_PROG_CXX
51 AM_PROG_CC_STDC
52 AC_HEADER_STDC
53 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
54 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
56 IT_PROG_INTLTOOL([0.35.0])
58 PKG_PROG_PKG_CONFIG
60 GNOME_DEBUG_CHECK
61 GNOME_COMPILE_WARNINGS([maximum])
62 GNOME_CXX_WARNINGS
63 GNOME_MAINTAINER_MODE_DEFINES
65 MORE_WARN_FLAGS=
66 DEPRECATION_FLAGS=
67 MOZILLA_WARN_CXXFLAGS="-Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
69 if test "x$enable_maintainer_mode" = "xyes"; then
70         AC_DEFINE([MAINTAINER_MODE],[1],[Define to enable 'maintainer-only' behaviour])
71         enable_debug=yes
72 # -DGTK_DISABLE_DEPRECATED 
73         DEPRECATION_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DGNOME_VFS_DISABLE_DEPRECATED -DLIBGLADE_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED"
74         MOZILLA_WARN_CXXFLAGS="-Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth $MOZILLA_WARN_CXXFLAGS"
77 GLIB_REQUIRED=2.12.0
78 GTK_REQUIRED=2.10.0
79 LIBXML_REQUIRED=2.6.12
80 LIBXSLT_REQUIRED=1.1.7
81 LIBGLADE_REQUIRED=2.3.1
82 LIBGNOMEVFS_REQUIRED=2.9.2
83 LIBGNOME_REQUIRED=2.14.0
84 LIBGNOMEUI_REQUIRED=2.14.0
85 GNOME_DESKTOP_REQUIRED=2.9.91
86 LIBSTARTUP_NOTIFICATION_REQUIRED=0.5
87 DBUS_GLIB_REQUIRED=0.35
89 PKG_CHECK_MODULES([DEPENDENCIES], [
90                   glib-2.0 >= $GLIB_REQUIRED
91                   gmodule-2.0
92                   gtk+-2.0 >= $GTK_REQUIRED
93                   gtk+-unix-print-2.0 >= $GTK_REQUIRED
94                   libxml-2.0 >= $LIBXML_REQUIRED
95                   libxslt >= $LIBXSLT_REQUIRED
96                   libgnome-2.0 >= $LIBGNOME_REQUIRED
97                   libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
98                   libglade-2.0 >= $LIBGLADE_REQUIRED \
99                   gnome-vfs-2.0 >= $LIBGNOMEVFS_REQUIRED
100                   gnome-vfs-module-2.0
101                   gconf-2.0
102                   gnome-desktop-2.0 >= $GNOME_DESKTOP_REQUIRED
103                   libstartup-notification-1.0 >= $LIBSTARTUP_NOTIFICATION_REQUIRED
104                   ])
105 AC_SUBST([DEPENDENCIES_CFLAGS])
106 AC_SUBST([DEPENDENCIES_LIBS])
108 # ****
109 # DBUS
110 # ****
112 PKG_CHECK_MODULES([DBUS],[dbus-glib-1 >= $DBUS_GLIB_REQUIRED])
113 AC_SUBST([DBUS_CFLAGS])
114 AC_SUBST([DBUS_LIBS])
116 AC_PATH_PROG([DBUS_BINDING_TOOL],[dbus-binding-tool],[no])
118 if test "$DBUS_BINDING_TOOL" = "no"; then
119         AC_MSG_ERROR([dbus-binding-tool not found])
122 # *****
123 # GConf
124 # *****
126 AM_GCONF_SOURCE_2
128 AC_PATH_PROG([GCONFTOOL], [gconftool-2], [no])
130 if test "$GCONFTOOL" = "no"; then
131         AC_MSG_ERROR([gconftool-2 not found])
134 # ******************
135 # Portability checks
136 # ******************
138 AC_CHECK_FUNCS([mkdtemp])
140 # for backtrace()
141 AC_CHECK_HEADERS([execinfo.h])
143 # Check for -Wdeclaration-after-statement (since gcc 3.4)
145 if test "x$enable_maintainer_mode" = "xyes"; then
147         AC_LANG_PUSH([C])
148         _FLAGS="-Wdeclaration-after-statement"
149         _SAVE_CFLAGS=$CFLAGS
150         CFLAGS="$CFLAGS $_FLAGS"
152         AC_CACHE_CHECK([for compiler $FLAGS option],
153                 ac_cv_have_declaration_after_statement,
154                 [AC_COMPILE_IFELSE(
155                         [AC_LANG_SOURCE([[int main () { return 0; }]])],
156                         [ac_cv_have_declaration_after_statement="yes"],
157                         [ac_cv_have_declaration_after_statement="no"],
158                         [ac_cv_have_declaration_after_statement="maybe"])])
159         
160         if test "x$ac_cv_have_declaration_after_statement" = "xyes"; then
161                 MORE_WARN_FLAGS="$MORE_WARN_FLAGS $_FLAGS"
162         fi
163         CFLAGS="$_SAVE_CFLAGS"
164         AC_LANG_POP([C])
167 # *******
168 # Mozilla
169 # *******
171 GECKO_INIT([MOZILLA])
173 AC_SUBST([MOZILLA])
174 AC_SUBST([MOZILLA_FLAVOUR])
175 AC_SUBST([MOZILLA_INCLUDE_ROOT])
176 AC_SUBST([MOZILLA_HOME])
177 AC_SUBST([MOZILLA_PREFIX])
178 AC_SUBST([MOZILLA_EXTRA_LIBS])
179 AC_SUBST([MOZILLA_GLUE_LIBS])
181 if test "$gecko_cv_gecko_version_int" -lt "1008000"; then
182         AC_MSG_ERROR([Gecko version $gecko_cv_gecko_version is not supported!])
185 if test "$gecko_cv_gecko_flavour" != "toolkit"; then
186         AC_MSG_ERROR(["$gecko_cv_gecko_flavour" flavoured geckos aren't tasty enough!])
189 case "$gecko_cv_gecko" in
190 xulrunner) min_version=1.8 ;;
191 *firefox) min_version=1.5 ;;
192 *) AC_MSG_ERROR([Unsupported gecko "$gecko_cv_gecko"]) ;;
193 esac
195 AM_CONDITIONAL([HAVE_XULRUNNER],[test "$gecko_cv_gecko" = "xulrunner"])
197 # Added $gecko_cv_gecko-js for debian xulrunner brokenness
198 PKG_CHECK_MODULES([GECKO],[${gecko_cv_gecko}-xpcom >= $min_version ${gecko_cv_gecko}-js $gecko_cv_extra_pkg_dependencies])
199 AC_SUBST([GECKO_CFLAGS])
200 AC_SUBST([GECKO_LIBS])
202 # *****************
203 # Weasel UA version
204 # *****************
206 # FIXMEchpe: find a way to always automatically use the latest weasel minor version!
208 if test "$gecko_cv_gecko_version_int" -ge "1009000"; then
209   WEASEL_UA_VERSION="3.0"
210 elif test "$gecko_cv_gecko_version_int" -ge "1008001"; then
211   WEASEL_UA_VERSION="2.0.0.4"
212 else
213   WEASEL_UA_VERSION="1.5.0.12"
216 AC_SUBST([WEASEL_UA_VERSION])
218 # **********************************
219 # now tests for mozilla API variance
220 # **********************************
222 # First build a test program to see whether compiling and running XPCOM
223 # programs works at all, so we don't get false test failures below
225 GECKO_XPCOM_PROGRAM_CHECK
227 # Make sure we DON'T have the typeaheadfind extension
229 AC_MSG_CHECKING([whether typeaheadfind is broken])
231 GECKO_RUN_IFELSE([],
232 [GECKO_XPCOM_PROGRAM(
233 [[#include <nsIComponentRegistrar.h>]],
235 status = 99;
236 nsCOMPtr<nsIComponentRegistrar> registrar;
237 rv = NS_GetComponentRegistrar (getter_AddRefs (registrar));
238 if (NS_FAILED (rv)) break;
240 status = 98;
241 nsCID *classID = nsnull;
242 rv = registrar->ContractIDToCID ("@mozilla.org/typeaheadfind;1", &classID);
243 if (NS_FAILED (rv) || !classID) break;
245 nsCID badClassID = { 0x46590685, 0xbc00, 0x4aac,
246                      { 0xab, 0xed, 0x2c, 0x10, 0xa5, 0xb9, 0x45, 0xa4 } };
248 status = classID->Equals (badClassID) ? 97 : EXIT_SUCCESS;
251 [have_broken_typeaheadfind=no],
252 [have_broken_typeaheadfind=yes],
253 [have_broken_typeaheadfind=maybe])
255 AC_MSG_RESULT([$have_broken_typeaheadfind])
257 if test "$have_broken_typeaheadfind" = "yes"; then
258         AC_MSG_ERROR([You must not compile $gecko_cv_gecko with the "typeaheadfind" extension enabled!])
261 # Check for PSM header(s) to infer PSM presence
263 GECKO_CHECK_HEADERS([pipnss],[nsIX509Cert.h],[have_psm=yes],[have_psm=no])
265 # Make sure we don't accidentally build without PSM support
267 AC_MSG_CHECKING([whether to include PSM support])
268 AC_ARG_ENABLE([psm],
269         AS_HELP_STRING([--disable-psm],[Disable PSM support (default: enabled)]),
270         [],[enable_psm=yes])
271 AC_MSG_RESULT([$enable_psm])
273 if test "$enable_psm" = "yes" -a "$have_psm" = "no"; then
274         AC_MSG_ERROR([PSM headers not found; use --disable-psm to disable building with PSM support])
275 elif test "$have_psm" = "no"; then
276         AC_MSG_WARN([PSM headers not found; PSM support disabled])
279 if test "$enable_psm" = "yes" -a "$have_psm" = "yes"; then
280         AC_DEFINE([HAVE_MOZILLA_PSM],[1],[Define if you have the mozilla NSS headers installed]) 
283 AM_CONDITIONAL([HAVE_MOZILLA_PSM],[test "$enable_psm" = "yes" -a "$have_psm" = "yes"])
285 # Check whether to enable our filepicker component
287 AC_MSG_CHECKING([whether to enable native gtk+ filepicker])
288 AC_ARG_ENABLE([filepicker],
289         AS_HELP_STRING([--enable-filepicker],[Whether to enable the gtk+ native filepicker; not needed when the mozilla build itself has native gtk+ filepicker enabled (default:enabled)]),
290         [],[enable_filepicker=no])
291 AC_MSG_RESULT([$enable_filepicker])
293 AM_CONDITIONAL([ENABLE_FILEPICKER],[test "$enable_filepicker" = "yes"])
294 if test "$enable_filepicker" = "yes"; then
295         AC_DEFINE([ENABLE_FILEPICKER],[1],[Define to enable the native filepicker])
298 # Check for nsINonBlockingAlertService
299 # Added in 1.8.1 and 1.9
301 GECKO_CHECK_HEADERS([windowwatcher],[nsINonBlockingAlertService.h])
303 # Check for nsIGlobalHistory3
304 # Added in 1.8.1 and 1.9
306 GECKO_CHECK_HEADERS([docshell],[nsIGlobalHistory3.h])
308 # Check for nsIIOService2.h
309 # Added in 1.9
311 GECKO_CHECK_HEADERS([necko],[nsIIOService2.h])
313 # Check for nsIMutableArray.h
314 # Split out into its own header in 1.9
316 GECKO_CHECK_HEADERS([xpcom],[nsIMutableArray.h])
318 # Check for spell check extension
320 GECKO_CHECK_HEADERS([spellchecker],[mozISpellCheckingEngine.h],
321         [have_gecko_spell_checker=yes],[have_gecko_spell_checker=no])
323 # Check for some contractIDs that we need but are provided by extensions
324 # which may or may not have been built.
326 REQUIRED_CONTRACTS="@mozilla.org/permissionmanager;1 @mozilla.org/PopupWindowManager;1 @mozilla.org/cookie/permission;1 @mozilla.org/permissions/contentblocker;1"
327 REQUIRED_EXTENSIONS="cookie,permissions"
329 GECKO_CHECK_CONTRACTIDS([$REQUIRED_CONTRACTS],
330         [],[AC_MSG_ERROR([$gecko_cv_gecko needs to be compiled with at least --enable-extensions=default,$REQUIRED_EXTENSIONS])])
332 # ***************
333 # Multimedia keys
334 # ***************
336 AC_CHECK_HEADERS([X11/XF86keysym.h])
338 # ******
339 # Python
340 # ******
342 EPIPHANY_FEATURES=
344 AC_MSG_CHECKING([whether Python support is requested])
346 AC_ARG_ENABLE([python],
347         AS_HELP_STRING([--enable-python],[Enable python support]),
348         [enable_python=$enableval have_python=$enableval],
349         [enable_python=autodetect have_python=yes])
351 AC_MSG_RESULT([$enable_python])
353 if test "x$have_python" != "xno"; then
354         AM_PATH_PYTHON([2.3],[],[no])
356         if test "x$PYTHON" = "x:"; then
357                 have_python=no
358         fi
361 if test "x$have_python" != "xno"; then
362         AM_CHECK_PYTHON_HEADERS([],[have_python=no])
365 if test "x$have_python" != "xno"; then
366         PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
367         PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
368         PYTHON_LIBS="-lpython$PYTHON_VERSION"
369         PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
370         PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
371         PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
372         PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
373         PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
374         PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
375         PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
376         AC_SUBST([PYTHON_LIBS])
377         AC_SUBST([PYTHON_LIB_LOC])
378         AC_SUBST([PYTHON_CFLAGS])
379         AC_SUBST([PYTHON_EXTRA_LIBS])
381         dnl FIXME: do we really need this test?
382         AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
383         rm -rf testpython
384         mkdir testpython
385         cd testpython
386         cat > testpython.c <<EOF
387 #include <Python.h>
388 int testpython (void)
390 Py_Exit (0);
394         if /bin/sh ../libtool --mode=compile ${CC} $PYTHON_CFLAGS -c testpython.c >/dev/null 2>&1 && \
395                 /bin/sh ../libtool --mode=link ${CC} -o testpython.la -rpath `pwd` -module -avoid-version $PYTHON_LIB_LOC testpython.lo $PYTHON_LIBS $PYTHON_EXTRA_LIBS >/dev/null 2>&1 && \
396                 grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then
397                 result=yes
398         else
399                 result=no
400                 have_python=no
401         fi
402         cd ..
403         rm -rf testpython
404         AC_MSG_RESULT([$result])
407 if test "x$have_python" != "xno"; then
408         PYGTK_REQUIRED=2.7.1
409         GNOME_PYTHON_REQUIRED=2.6.0
411         PKG_CHECK_MODULES([PYGTK], [pygtk-2.0 >= $PYGTK_REQUIRED gnome-python-2.0 >= $GNOME_PYTHON_REQUIRED],
412                 [],[have_python=no])
414         AC_SUBST([PYGTK_CFLAGS])
415         AC_SUBST([PYGTK_LIBS])
418 if test "x$have_python" != "xno"; then
419         AC_MSG_CHECKING([for pygtk defs])
420         PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
421         AC_MSG_RESULT([$PYGTK_DEFSDIR])
423         AC_MSG_CHECKING([for pygtk codegen])
424         PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
425         AC_MSG_RESULT([$PYGTK_CODEGEN])
427         AC_MSG_CHECKING([for pygtk h2def])
428         PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
429         AC_MSG_RESULT([$PYGTK_H2DEF])
430         
431         AC_SUBST([PYGTK_DEFSDIR])
432         AC_SUBST([PYGTK_CODEGEN])
433         AC_SUBST([PYGTK_H2DEF])
435         dnl Check for -fno-strict-aliasing
436         FLAGS="-fno-strict-aliasing"
437         save_CFLAGS="$CFLAGS"
438         CFLAGS="$CFLAGS $FLAGS"
439         AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
440         AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
441         CFLAGS="$save_CFLAGS"
442         AC_MSG_RESULT($compiler_has_option)
443         if test $compiler_has_option = yes; then
444                 NO_STRICT_ALIASING_CFLAGS="$FLAGS"
445         fi
446         AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
449 if test "x$have_python" != "xyes"; then
450         if test "x$enable_python" = "xyes"; then
451                 AC_MSG_ERROR([Python not found])
452         elif test "x$enable_python" = "xautodetect"; then
453                 enable_python=no
454                 AC_MSG_WARN([Python not found, disabling python support])
455         fi
456 elif test "x$enable_python" != "xno"; then
457         enable_python=yes
458         AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python support])
459         EPIPHANY_FEATURES="$EPIPHANY_FEATURES python"
462 AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
464 AC_SUBST([EPIPHANY_FEATURES])
466 # *******
467 # Plugins
468 # *******
470 # Gecko 1.9 can handle .desktop files from file: URLs itself, but we
471 # also support windows .lnk files, so always enable this plugin
473 AC_MSG_CHECKING([whether to build the deskop file plugin])
474 AC_ARG_ENABLE([desktop-file-plugin],
475         AS_HELP_STRING([--disable-desktop-file-plugin],[Disable the desktop file plugin (default: enabled)]),
476         [],[enable_desktop_file_plugin=yes])
477 AC_MSG_RESULT([$enable_desktop_file_plugin])
479 AM_CONDITIONAL([ENABLE_DESKTOP_FILE_PLUGIN],[test "x$enable_desktop_file_plugin" = "xyes"])
481 if test "x$enable_desktop_file_plugin" = "xyes"; then
482         PKG_CHECK_MODULES([DESKTOP_FILE_PLUGIN_DEP],[$MOZILLA-xpcom $MOZILLA-plugin gtk+-2.0 >= 2.6.0])
483         AC_SUBST([DESKTOP_FILE_PLUGIN_DEP_CFLAGS])
484         AC_SUBST([DESKTOP_FILE_PLUGIN_DEP_LIBS])
487 if test "x$enable_desktop_file_plugin" = "xyes"; then
488         AC_DEFINE([HAVE_PRIVATE_PLUGINS],[1],[Define if any private plugins are enabled])
491 # *******************
492 # Additional features
493 # *******************
495 # Zeroconf bookmarks sites
497 AC_MSG_CHECKING([whether to enable zeroconf bookmarks support])
498 AC_ARG_ENABLE([zeroconf],
499         AS_HELP_STRING([--disable-zeroconf],[Whether to enable zeroconf bookmarks support (default: enabled)]),
500         [], [enable_zeroconf=yes])
501 AC_MSG_RESULT([$enable_zeroconf])
503 if test "x$enable_zeroconf" = "xyes"; then
504         AC_DEFINE([ENABLE_ZEROCONF],[1],[Define to enable zeroconf bookmarks support])
507 AM_CONDITIONAL([ENABLE_ZEROCONF],[test "x$enable_zeroconf" = "xyes"])
509 # Certificates manager
511 if test "$enable_psm" = "yes"; then
513 AC_MSG_CHECKING([whether to build the certificates manager])
514 AC_ARG_ENABLE([certificate-manager],
515         AS_HELP_STRING([--enable-certificate-manager],[Whether to enable the certificate manager (experimental; default:disabled)]),
516         [],[enable_certificate_manager=no])
517 AC_MSG_RESULT([$enable_certificate_manager])
521 if test "$enable_certificate_manager" = "yes"; then
522         AC_DEFINE([ENABLE_CERTIFICATE_MANAGER],[1],[Define to enable the certificate manager build])
525 AM_CONDITIONAL([ENABLE_CERTIFICATE_MANAGER],[test "$enable_certificate_manager" = "yes"])
527 # NetworkManager
529 AC_MSG_CHECKING([whether to enable NetworkManager support])
530 AC_ARG_ENABLE([network-manager],
531         AS_HELP_STRING([--enable-network-manager],[Whether to enable automatic network status with NetworkManager (default: disabled)]),
532         [],[enable_network_manager=no])
533 AC_MSG_RESULT([$enable_network_manager])
535 if test "$enable_network_manager" != "no"; then
536         AC_CHECK_HEADERS([NetworkManager/NetworkManager.h],
537                 [have_network_manager=yes],[have_network_manager=no])
539         if test "$enable_network_manager" = "yes" -a "$have_network_manager" = "no"; then
540                 AC_MSG_ERROR([NetworkManager support requested but NetworkManager headers not found])
541         elif test "$have_network_manager" = "no"; then
542                 AC_MSG_WARN([NetworkManager headers not found; disabling NetworkManager support])
543         fi
546 if test "$enable_network_manager" = "yes"; then
547         AC_DEFINE([ENABLE_NETWORK_MANAGER],[1],[Define for NetworkManager support])
550 AM_CONDITIONAL([ENABLE_NETWORK_MANAGER],[test "$enable_network_manager" = "yes"])
552 # Enchant spell checking
553 # Does not appear to work on gecko 1.8.0, so only offer for >= 1.8.1
555 if test "$gecko_cv_gecko_version_int" -ge "1008001"; then
557 # Default to 'disabled' until it's fully functional
558 AC_MSG_CHECKING([whether spell checking support is requested])
559 AC_ARG_ENABLE([spell-checker],
560         AS_HELP_STRING([--enable-spell-checker],[Whether to enable spell checking using enchant]),
561         [],[enable_spell_checker=no])
562 AC_MSG_RESULT([$enable_spell_checker])
564 else
565         enable_spell_checker=no
566 fi # gecko >= 1.8.1
568 if test "$enable_spell_checker" = "yes" -a "$have_gecko_spell_checker" != "yes"; then
569         AC_MSG_ERROR([Spell check support requested but $gecko_cv_gecko was not compiled with 'spellchecker' extension enabled.])
572 if test "$enable_spell_checker" = "yes" -a "$have_gecko_spell_checker" = "yes"; then
573         # FIXME check which version we really need
574         ENCHANT_REQUIRED=1.0
576         PKG_CHECK_MODULES([SPELLCHECKER],[enchant >= $ENCHANT_REQUIRED])
577         AC_SUBST([SPELLCHECKER_CFLAGS])
578         AC_SUBST([SPELLCHECKER_LIBS])
580         AC_DEFINE([ENABLE_SPELLCHECKER],[1],[Define to enable the spell checker])
583 AM_CONDITIONAL([ENABLE_SPELLCHECKER],[test "$enable_spell_checker" = "yes" -a "$have_gecko_spell_checker" = "yes"])
585 # ************
586 # Misc defines
587 # ************
589 # uninstalled share dir to search data
590 AC_DEFINE_UNQUOTED([SHARE_UNINSTALLED_DIR], ["`pwd`/data"], [path to source data dir])
592 # *******************************
593 # Add warning flags
594 # *******************************
596 AM_CPPFLAGS="$AM_CPPFLAGS $DEPRECATION_FLAGS"
597 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $MORE_WARN_FLAGS"
598 AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS $MOZILLA_WARN_CXXFLAGS"
599 AC_SUBST([AM_CPPFLAGS])
600 AC_SUBST([AM_CFLAGS])
601 AC_SUBST([AM_CXXFLAGS])
602 AC_SUBST([AM_LDFLAGS])
604 # *******************************
605 # Internationalization
606 # ******************************* 
608 ISO_CODES_REQUIRED=0.35
610 PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
611         [have_iso_codes=yes],[have_iso_codes=no])
613 if test "$have_iso_codes" = "yes"; then
614         AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
615         if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 && \
616            $PKG_CONFIG --variable=domains iso-codes | grep -q 3166 ; then
617                 result=yes
618         else
619                 result=no
620                 have_iso_codes=no
621         fi
622         AC_MSG_RESULT([$result])
625 if test "$have_iso_codes" = "yes"; then
626         AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
627         AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
628 else
629         AC_MSG_ERROR([iso-codes is required])
632 GETTEXT_PACKAGE=epiphany
633 AC_SUBST([GETTEXT_PACKAGE])
634 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
635 AM_GLIB_GNU_GETTEXT
637 # uninstalled share dir to search data
638 AC_DEFINE_UNQUOTED([SHARE_UNINSTALLED_DIR], ["`pwd`/data"], [path to source data dir])
640 # *****************
641 # API Documentation
642 # *****************
644 GNOME_DOC_INIT
645 GTK_DOC_CHECK([1.0])
647 # ************
648 # Output files
649 # ************
651 AC_CONFIG_FILES([
652 Makefile
653 data/Makefile
654 data/epiphany-${EPIPHANY_API_VERSION}.pc:data/epiphany.pc.in
655 data/epiphany.desktop.in
656 data/bme.desktop.in
657 data/chrome/Makefile
658 data/chrome/brand.dtd
659 data/chrome/brand.properties
660 data/glade/Makefile
661 data/icons/Makefile
662 data/icons/16x16/Makefile
663 data/icons/16x16/actions/Makefile
664 data/icons/16x16/places/Makefile
665 data/icons/16x16/status/Makefile
666 data/icons/22x22/Makefile
667 data/icons/22x22/actions/Makefile
668 data/icons/22x22/places/Makefile
669 data/icons/22x22/status/Makefile
670 data/icons/24x24/Makefile
671 data/icons/24x24/actions/Makefile
672 data/icons/24x24/places/Makefile
673 data/icons/24x24/status/Makefile
674 data/icons/32x32/Makefile
675 data/icons/32x32/actions/Makefile
676 data/icons/32x32/status/Makefile
677 data/icons/48x48/Makefile
678 data/icons/48x48/status/Makefile
679 data/icons/scalable/Makefile
680 data/icons/scalable/actions/Makefile
681 data/icons/scalable/status/Makefile
682 data/art/Makefile
683 data/ui/Makefile
684 data/weasel-ua-pref.js
685 doc/Makefile
686 doc/reference/Makefile
687 lib/Makefile
688 lib/egg/Makefile
689 lib/widgets/Makefile
690 embed/Makefile
691 embed/mozilla/Makefile
692 src/Makefile
693 src/bookmarks/Makefile
694 help/Makefile
695 plugins/Makefile
696 plugins/desktop-file/Makefile
697 po/Makefile.in
700 [EPIPHANY_API_VERSION=$EPIPHANY_API_VERSION])
702 AC_OUTPUT
704 # *************************************
705 # *************************************
707 echo "
708 Epiphany was configured with the following options:
709         
710         Source code location       : $srcdir
711         Compiler                   : $CC
712         Prefix                     : $prefix
713         Extra debugging support    : $enable_debug
715         Gecko backend              : $gecko_cv_gecko version $gecko_cv_gecko_version
716         PSM support                : $enable_psm
717         Zeroconf bookmarks support : $enable_zeroconf
718         NetworkManager support     : $enable_network_manager
719         Certificate manager        : $enable_certificate_manager (experimental)
720         Python support             : $enable_python
721         Desktop file plugin        : $enable_desktop_file_plugin
722         Spellchecker               : $enable_spell_checker (experimental)