1 m4_define([adg_version],[0.6.2])
2 m4_define([adg_api_version],[1.0])
4 m4_define([gtkdoc_prereq],[1.9])
5 m4_define([gobject_prereq],[2.10.1])
6 m4_define([cairo_prereq],[1.7.4])
7 m4_define([gtk_prereq],[2.12.0])
8 m4_define([pangocairo_prereq],[1.18.0])
13 dnl autoconf 2.60 implements datarootdir, required by ADG
14 dnl to help overcoming the hardcoded glade catalogdir
16 AC_INIT([adg-1.0],adg_version,[http://dev.entidi.com/p/adg/],[adg],[http://adg.entidi.com/])
17 AC_CONFIG_SRCDIR([configure.ac])
18 AC_CONFIG_HEADERS([src/config.h])
19 AC_CONFIG_AUX_DIR([build])
20 AC_CONFIG_MACRO_DIR([build])
21 AM_INIT_AUTOMAKE([1.6 gnits no-dist-gzip dist-bzip2 -Wall])
22 AC_SUBST([ADG_API_PACKAGE],AC_PACKAGE_TARNAME-adg_api_version)
25 # Check for host information
60 AM_CONDITIONAL([OS_UNIX],[test "${guessed_host}" != "mingw"])
61 AM_CONDITIONAL([OS_WINDOWS],[test "${guessed_host}" == "mingw" -o "${guessed_host}" == "cygwin"])
69 AC_PATH_PROG([XSLTPROC],[xsltproc],[/usr/bin/xsltproc])
70 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums],[/usr/bin/glib-mkenums])
71 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[/usr/bin/glib-genmarshal])
72 AC_PATH_PROG([GTESTER],[gtester],[/usr/bin/gtester])
73 AC_PATH_PROG([GTESTER_REPORT],[gtester-report],[/usr/bin/gtester-report])
74 AC_PATH_PROG([GLADE3],[glade-3],[/usr/bin/glade-3])
77 # Libtool initialization
79 AC_MSG_CHECKING([which libtool initialization strategy to adopt])
80 AC_MSG_RESULT([m4_ifset([LT_INIT],[LT-INIT],[AC-PROG-LIBTOOL])])
82 [LT_INIT([disable-static win32-dll])],
90 AC_SUBST([GETTEXT_PACKAGE],[${ADG_API_PACKAGE}])
91 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["${ADG_API_PACKAGE}"],
92 [Define to the domain used by gettext.])
93 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
94 IT_PROG_INTLTOOL(0.40.1)
96 GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
97 AC_CONFIG_COMMANDS([default],
98 [case "${CONFIG_FILES}" in *po-properties/Makefile.in*)
99 ${SED} -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
104 # Check for required packages
106 GTK_DOC_CHECK(gtkdoc_prereq)
107 PKG_CHECK_MODULES([GLIB],[glib-2.0])
108 PKG_CHECK_MODULES([GOBJECT2],[gobject-2.0 >= ]gobject_prereq)
109 PKG_CHECK_MODULES([CAIRO],[cairo >= ]cairo_prereq)
112 # Check for optional pango support
114 AC_ARG_ENABLE([pango],
115 [AS_HELP_STRING([--enable-pango],
116 [use pango for rendering text @<:@default=check@:>@])],
117 [],[enable_pango=check])
118 AS_IF([test "x${enable_pango}" != "xno"],
119 [PKG_CHECK_MODULES([PANGO],[pangocairo >= ]pangocairo_prereq,
121 AC_DEFINE_UNQUOTED([PANGO_ENABLED],[1],
122 [Defined if the pango support is enabled.])],
123 [AS_IF([test "x${enable_pango}" = "xyes"],
124 [AC_MSG_ERROR([${PANGO_PKG_ERRORS} and pango support requested])],
125 [enable_pango=no])])])
126 AM_CONDITIONAL([HAVE_PANGO],[test "x${enable_pango}" = "xyes"])
129 # Check for optional GTK+2 support
131 AC_ARG_ENABLE([gtk2],
132 [AS_HELP_STRING([--enable-gtk2],
133 [include GKT+2 specific widgets @<:@default=check@:>@])],
134 [],[enable_gtk2=check])
135 AS_IF([test "x${enable_gtk2}" != "xno"],
136 [PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ]gtk_prereq,
138 [AS_IF([test "x${enable_gtk2}" = "xyes"],
139 [AC_MSG_ERROR([${GTK2_PKG_ERRORS} and GTK+2 support requested])],
140 [enable_gtk2=no])])])
141 AM_CONDITIONAL([HAVE_GTK2],[test "x${enable_gtk2}" = "xyes"])
144 # Check for optional glade support
146 AC_ARG_ENABLE([glade],
147 [AS_HELP_STRING([--enable-glade],
148 [install glade catalog file @<:@default=check@:>@])],
149 [],[enable_glade=check])
150 AS_IF([test "x${enable_glade}" != "xno"],
151 [PKG_CHECK_MODULES([GLADE],[gladeui-1.0],
153 [AS_IF([test "x${enable_glade}" = "xyes"],
154 [AC_MSG_ERROR([${GLADE_PKG_ERRORS} and glade support requested])],
155 [enable_glade=no])])])
156 AM_CONDITIONAL([HAVE_GLADE],[test "x${enable_glade}" = "xyes"])
157 AS_IF([test "x${enable_glade}" == "xyes"],
158 [AC_MSG_CHECKING([for the glade catalog path])
159 gladeroot=`${PKG_CONFIG} --variable=datarootdir gladeui-1.0`
160 AS_IF([test "x${gladeroot}" == "x"],
161 [GLADE_CATALOGDIR="\${datarootdir}/glade3/catalogs}"],
162 [gladecatalog=`${PKG_CONFIG} --variable=catalogdir gladeui-1.0`
163 GLADE_CATALOGDIR=`echo "${gladecatalog}" | ${SED} -e "s|^${gladeroot}|"'${datarootdir}|'`])
164 AC_SUBST([GLADE_CATALOGDIR])
165 AC_MSG_RESULT(${GLADE_CATALOGDIR})])
169 # Check for optional GLib test framework
171 AC_ARG_ENABLE([test_framework],
172 [AS_HELP_STRING([--enable-test-framework],
173 [enable GLib test framework @<:@default=check@:>@])],
174 [],[enable_test_framework=check])
175 AS_IF([test "x${enable_test_framework}" != "xno"],
176 [PKG_CHECK_EXISTS([glib-2.0 >= 2.16.0],
177 [enable_test_framework=yes],
178 [AS_IF([test "x${enable_test_framework}" = "xyes"],
179 [AC_MSG_ERROR([The test framework needs glib2-2.16.0 or later])],
180 [enable_test_framework=no])])])
181 AM_CONDITIONAL([HAVE_TEST_FRAMEWORK],[test "x${enable_test_framework}" = "xyes"])
184 # Check for compiler characteristics
191 AC_SUBST([CPML_REQUIRES],'cairo >= cairo_prereq')
192 AC_SUBST([ADG_REQUIRES],'gobject-2.0 >= gobject_prereq')
193 AC_SUBST([ADG_GTK_REQUIRES],'gtk+-2.0 >= gtk_prereq')
194 AC_SUBST([DLLDIR],"$(${PKG_CONFIG} --variable=prefix gobject-2.0)/bin")
196 SHAVE_INIT([build],[enable])
197 AC_CONFIG_FILES([build/shave
204 src/cpml/tests/Makefile
207 src/adg/tests/Makefile
210 src/adg-gtk/tests/Makefile
215 po-properties/Makefile.in
218 docs/cpml/bookinfo.xml
220 docs/adg/bookinfo.xml])
221 AC_CONFIG_FILES([demo/adg-glade],[chmod +x demo/adg-glade])
227 AS_IF([test "x${enable_glade}" != "xno"],
228 [report_glade_catalogdir="
229 Glade catalog dir: ${GLADE_CATALOGDIR}"],
230 [report_glade_catalogdir=''])
233 AC_MSG_NOTICE([generating report
235 AC_PACKAGE_NAME adg_version will be built with the following options:
236 ----------------------------------------------------------
237 API compatibility: adg_api_version
238 CPML library to use: internal (cpml-adg_version)
239 Build pango based entities: ${enable_pango}
240 GTK+2 additional widgets: ${enable_gtk2}
241 Install glade catalogs: ${enable_glade}${report_glade_catalogdir}
242 Build API reference: ${enable_gtk_doc}
243 Test framework support: ${enable_test_framework}