1 m4_define([adg_version],[0.5.6])
2 m4_define([adg_api_version],[1.0])
4 m4_define([gtkdoc_prereq],[1.9])
5 m4_define([gobject_prereq],[2.4.0])
6 m4_define([cairo_prereq],[1.7.4])
7 m4_define([gtk_prereq],[2.12.0])
13 AC_INIT([Automatic Drawing Generation],adg_version,
14 [http://dev.entidi.com/p/adg/],[adg],[http://adg.entidi.com/])
15 AC_CONFIG_SRCDIR([configure.ac])
16 AC_CONFIG_HEADERS([config.h])
17 AC_CONFIG_MACRO_DIR([build])
18 AM_INIT_AUTOMAKE([1.6 gnits no-dist-gzip dist-bzip2 -Wall])
21 # Check for host information
56 AM_CONDITIONAL([OS_UNIX],[test "${guessed_host}" != "mingw"])
57 AM_CONDITIONAL([OS_WIN32],[test "${guessed_host}" == "mingw" -o "${guessed_host}" == "cygwin"])
64 AC_PATH_PROG([XSLTPROC],[xsltproc],[/usr/bin/xsltproc])
65 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums],[/usr/bin/glib-mkenums])
66 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[/usr/bin/glib-genmarshal])
67 AC_PATH_PROG([GTESTER],[gtester],[/usr/bin/gtester])
68 AC_PATH_PROG([GTESTER_REPORT],[gtester-report],[/usr/bin/gtester-report])
70 AC_MSG_CHECKING([which libtool initialization strategy to adopt])
71 AC_MSG_RESULT([m4_ifset([LT_INIT],[LT-INIT],[AC-PROG-LIBTOOL])])
73 [LT_INIT([disable-static])],
80 AC_SUBST([GETTEXT_PACKAGE],adg-adg_api_version)
81 AC_DEFINE([GETTEXT_PACKAGE],"AC_PACKAGE_TARNAME-adg_api_version",
82 [Define to the domain used by gettext.])
85 GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
86 AC_OUTPUT_COMMANDS([case "${CONFIG_FILES}" in *po-properties/Makefile.in*)
87 sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
91 # Check for required packages
93 GTK_DOC_CHECK(gtkdoc_prereq)
94 PKG_CHECK_MODULES([GOBJECT2],[gobject-2.0 >= ]gobject_prereq)
95 PKG_CHECK_MODULES([CAIRO],[cairo >= ]cairo_prereq)
98 # Check for optional GTK+2 support
100 AC_ARG_ENABLE([gtk2],
101 [AS_HELP_STRING([--enable-gtk2],
102 [include GKT+2 specific widgets @<:@default=check@:>@])],
103 [],[enable_gtk2=check])
104 AS_IF([test "x${enable_gtk2}" != "xno"],
105 [PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ]gtk_prereq,
107 [AS_IF([test "x${enable_gtk2}" = "xyes"],
108 [AC_MSG_ERROR([$GTK2_PKG_ERRORS and GTK+2 support requested])],
109 [enable_gtk2=no])])])
110 AM_CONDITIONAL([HAVE_GTK2],[test "x${enable_gtk2}" = "xyes"])
113 # Check for optional GLib test framework
115 AC_ARG_ENABLE([test_framework],
116 [AS_HELP_STRING([--enable-test-framework],
117 [enable GLib test framework @<:@default=check@:>@])],
118 [],[enable_test_framework=check])
119 AS_IF([test "x${enable_test_framework}" != "xno"],
120 [PKG_CHECK_EXISTS([glib-2.0 >= 2.16.0],
121 [enable_test_framework=yes],
122 [AS_IF([test "x${enable_test_framework}" = "xyes"],
123 [AC_MSG_ERROR([The test framework needs glib2-2.16.0 or later])],
124 [enable_test_framework=no])])])
125 AM_CONDITIONAL([HAVE_TEST_FRAMEWORK],[test "x${enable_test_framework}" = "xyes"])
128 # Check for compiler characteristics
135 CPML_REQUIRES='cairo >= cairo_prereq'
136 CPML_CFLAGS="${CAIRO_CFLAGS}"
137 CPML_LIBS="${CAIRO_LIBS}"
138 AS_IF([test "x${enable_gtk2}" = "xyes"],
139 [ADG_REQUIRES='gtk+-2.0 >= gtk_prereq'
140 ADG_CFLAGS="${GTK2_CFLAGS}"
141 ADG_LIBS="${GTK2_LIBS}"],
142 [ADG_REQUIRES='gobject-2.0 >= gobject_prereq'
143 ADG_CFLAGS="${GOBJECT2_CFLAGS} ${CAIRO_CFLAGS}"
144 ADG_LIBS="${GOBJECT2_LIBS} ${CAIRO_LIBS}"])
145 AC_SUBST([CPML_REQUIRES])
146 AC_SUBST([CPML_CFLAGS])
147 AC_SUBST([CPML_LIBS])
148 AC_SUBST([ADG_REQUIRES])
149 AC_SUBST([ADG_CFLAGS])
152 SHAVE_INIT([build],[enable])
153 AC_CONFIG_FILES([build/shave
163 po-properties/Makefile.in
166 docs/cpml/bookinfo.xml
168 docs/adg/bookinfo.xml])
174 AC_MSG_NOTICE([generating report
176 ADG canvas adg_version will be built with the following options:
177 ----------------------------------------------------------
178 API compatibility: adg_api_version
179 CPML library to use: internal (cpml-adg_version)
180 AdgWidget support (requires GTK+2): ${enable_gtk2}
181 Build API reference: ${enable_gtk_doc}
182 Test framework support: ${enable_test_framework}