1dnl Process this file with autoconf to produce a configure script.
2
3m4_define(gtkspell_version_minor, 0)
4m4_define(gtkspell_version_micro, 10)
5
6AC_INIT(gtkspell3, 3.gtkspell_version_minor.gtkspell_version_micro)
7AC_CONFIG_AUX_DIR([build])
8AC_CONFIG_MACRO_DIR([build])
9AC_CONFIG_HEADERS([config.h])
10AC_CONFIG_SRCDIR(gtkspell/gtkspell.c)
11AC_CANONICAL_HOST
12
13AM_INIT_AUTOMAKE([-Wall])
14
15AM_SILENT_RULES([yes])
16
17m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
18
19AC_SUBST(GTK_SPELL_VERSION_MINOR, gtkspell_version_minor)
20AC_SUBST(GTK_SPELL_VERSION_MICRO, gtkspell_version_micro)
21
22dnl See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
23AC_SUBST([GTK_SPELL_SO_VERSION], [2:0:2])
24
25AC_PROG_CC
26AM_PROG_CC_C_O
27
28dnl ************************ Enable Gtk2 GtkSpell build ***********************
29AC_ARG_ENABLE([gtk2],
30     AS_HELP_STRING([--enable-gtk2], [enable gtk2 build (default is no)]),
31     [case "${enableval}" in
32       yes) gtk2=yes ;;
33       no)  gtk2=no ;;
34       *) AC_MSG_ERROR([bad value ${enableval} for --enable-gtk2]) ;;
35     esac],[gtk2=no])
36AM_CONDITIONAL([ENABLE_GTK2], [test x$gtk2 = xyes])
37
38dnl ************************ Enable Gtk3 GtkSpell build ***********************
39AC_ARG_ENABLE([gtk3],
40     AS_HELP_STRING([--enable-gtk3], [enable gtk3 build (default is yes)]),
41     [case "${enableval}" in
42       yes) gtk3=yes ;;
43       no)  gtk3=no ;;
44       *) AC_MSG_ERROR([bad value ${enableval} for --enable-gtk3]) ;;
45     esac],[gtk3=yes])
46AM_CONDITIONAL([ENABLE_GTK3], [test x$gtk3 = xyes])
47
48dnl ************************** Gobject Introspection **************************
49dnl See https://live.gnome.org/GObjectIntrospection/AutotoolsIntegration
50GOBJECT_INTROSPECTION_CHECK([1.30.0])
51
52
53dnl ****************************** Vala bindings ******************************
54dnl See https://live.gnome.org/Vala/UpstreamGuide
55AM_PROG_VALAC
56
57VAPIGEN_CHECK([0.18])
58
59if test "$enable_vala" != "no"; then
60	AC_PATH_PROG([VALAC], [valac], [])
61	AC_SUBST(SPEC_ENABLE_VALA, 1)
62fi
63AM_CONDITIONAL(HAVE_VALAC, test "x$VALAC" != "x")
64
65dnl *************************** Internationalization **************************
66IT_PROG_INTLTOOL([0.35.0])
67GETTEXT_PACKAGE=$PACKAGE_NAME
68AC_SUBST(GETTEXT_PACKAGE)
69AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [GETTEXT package name])
70AM_GLIB_GNU_GETTEXT
71
72dnl ************************** Libtool initialization *************************
73LT_INIT
74
75dnl ********************************* Modules *********************************
76if test x$gtk3 = xyes; then
77	AC_SUBST([GTKSPELL3_MODULES], ['glib-2.0 gtk+-3.0 enchant-2'])
78	PKG_CHECK_MODULES(GTK_SPELL3, [$GTKSPELL3_MODULES])
79	AC_SUBST(SPEC_ENABLE_GTK3, 1)
80fi
81
82if test x$gtk2 = xyes; then
83	AC_SUBST([GTKSPELL2_MODULES], ['glib-2.0 gtk+-2.0 enchant-2'])
84	PKG_CHECK_MODULES(GTK_SPELL2, [$GTKSPELL2_MODULES])
85	AC_SUBST(SPEC_ENABLE_GTK2, 1)
86fi
87
88dnl ********************************* GTK-Doc *********************************
89dnl See http://developer.gnome.org/gtk-doc-manual/unstable/settingup_autoconf.html.en
90m4_ifdef([GTK_DOC_CHECK], [
91GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
92AC_SUBST(SPEC_ENABLE_GTK_DOC, 1)
93],[
94AM_CONDITIONAL([ENABLE_GTK_DOC], false)
95])
96
97dnl ****************************** Detect Win32 *******************************
98AC_MSG_CHECKING([for some Win32 platform])
99case "$host" in
100  *-*-mingw*|*-*-cygwin*)
101    platform_win32=yes
102    ;;
103  *)
104    platform_win32=no
105    ;;
106esac
107AC_MSG_RESULT([$platform_win32])
108AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
109
110dnl ******************************** iso-codes ********************************
111AC_ARG_ENABLE([iso-codes],
112     AS_HELP_STRING([--enable-iso-codes], [enable iso-codes support (default is yes)]),
113     [case "${enableval}" in
114       yes) iso_codes=yes ;;
115       no)  iso_codes=no ;;
116       *) AC_MSG_ERROR([bad value ${enableval} for --enable-iso_codes]) ;;
117     esac],[iso_codes=yes])
118AM_CONDITIONAL([HAVE_ISO_CODES], [test x$iso_codes = xyes])
119
120if test x$iso_codes = xyes; then
121    iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes 2>/dev/null || echo /usr`
122    AC_MSG_NOTICE([iso-codes prefix: $iso_codes_prefix])
123    AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX], ["$iso_codes_prefix"], [ISO codes prefix])
124    AC_DEFINE_UNQUOTED([ISO_CODES_LOCALEDIR], ["$iso_codes_prefix/share/locale"], [ISO codes locale dir])
125    AC_DEFINE([HAVE_ISO_CODES], [1], [iso-codes available])
126fi
127
128dnl ********************************* Summary *********************************
129echo
130echo "Configuration summary for $PACKAGE $VERSION:"
131echo "  - Host:                  ${host}"
132echo "  - GTK+2 support:         $gtk2"
133echo "  - GTK+3 support:         $gtk3"
134echo "  - GObject introspection: $enable_introspection"
135echo "  - Vala bindings:         $enable_vala"
136echo "  - iso-codes support:     $iso_codes"
137echo "  - Documentation:         $enable_gtk_doc"
138echo
139
140AC_CONFIG_FILES([
141Makefile
142gtkspell3.spec
143gtkspell/gtkspell3-2.0.pc
144gtkspell/gtkspell3-3.0.pc
145gtkspell/Makefile
146examples/Makefile
147docs/Makefile
148docs/version.xml
149po/Makefile.in])
150
151AC_OUTPUT
152