[build] Updated build system and i18n
[adg.git] / configure.ac
blobb4fc196ee4eac4eca17e6257475401ac79525f86
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT([ADG],[0.5.5],[http://dev.entidi.com/p/adg/],
4         [adg],[http://adg.entidi.com/])
5 AC_CONFIG_SRCDIR([configure.ac])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_MACRO_DIR([m4])
8 AM_INIT_AUTOMAKE([1.6])
11 # Check for programs
13 AC_PROG_CC
14 AC_DISABLE_STATIC
15 LT_INIT
16 PKG_PROG_PKG_CONFIG
17 AC_PATH_PROG([XSLTPROC],[xsltproc],[/usr/bin/xsltproc])
18 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums],[/usr/bin/glib-mkenums])
19 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[/usr/bin/glib-genmarshal])
22 # Check for functions
24 dnl Alloca is required by cpml, so it should be removed
25 dnl in case the adg and cpml libraries will be splitted
26 AC_FUNC_ALLOCA
29 # I18n
31 GETTEXT_PACKAGE="adg-$PACKAGE_VERSION"
32 AC_SUBST([GETTEXT_PACKAGE])
33 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],
34                    [Define to the domain used by gettext.])
35 ALL_LINGUAS=""
36 AM_GLIB_GNU_GETTEXT
37 GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
40 # Check required packages
42 GTK_DOC_CHECK([1.9])
43 PKG_CHECK_MODULES([GOBJECT2],[gobject-2.0 >= 2.4.0])
44 PKG_CHECK_MODULES([CAIRO],[cairo >= 1.7.4])
47 # Check for optional GTK+2 support
49 AC_ARG_ENABLE([gtk2],
50               [AS_HELP_STRING([--enable-gtk2],
51                               [include GKT+2 specific widgets @<:@default=check@:>@])],
52               [],[enable_gtk2=check])
53 ADG_REQUIRES=''
54 AS_IF([test "x$enable_gtk2" != "xno"],
55       [PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= 2.12.0],
56                          [enable_gtk2=yes
57                           ADG_OPTIONAL_REQUIRES=',gtk+-2.0 >= 2.12.0'],
58                          [AS_IF([test "x$enable_gtk2" = "xyes"],
59                                 [AC_MSG_ERROR([$GTK2_PKG_ERRORS but GTK+2 support requested])],
60                                 [enable_gtk2=no])])])
61 AM_CONDITIONAL([HAVE_GTK2],[test "x$enable_gtk2" = "xyes"])
62 AC_SUBST([ADG_OPTIONAL_REQUIRES])
65 # Final step
67 SHAVE_INIT([],[enable])
68 AC_CONFIG_FILES([shave
69                  shave-libtool
70                  cpml.pc
71                  adg.pc
72                  Makefile
73                  cpml/Makefile
74                  adg/Makefile
75                  demo/Makefile
76                  docs/Makefile
77                  docs/adg/Makefile
78                  docs/adg/bookinfo.xml
79                  docs/cpml/Makefile
80                  docs/cpml/bookinfo.xml
81                  po/Makefile.in])
82 AC_OUTPUT