1 m4_define([adg_version],[0.6.1])
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])
12 dnl autoconf 2.60 implements datarootdir, required by ADG
13 dnl to help overcoming the hardcoded glade catalogdir
15 AC_INIT([adg-1.0],adg_version,[http://dev.entidi.com/p/adg/],[adg],[http://adg.entidi.com/])
16 AC_CONFIG_SRCDIR([configure.ac])
17 AC_CONFIG_HEADERS([src/config.h])
18 AC_CONFIG_AUX_DIR([build])
19 AC_CONFIG_MACRO_DIR([build])
20 AM_INIT_AUTOMAKE([1.6 gnits no-dist-gzip dist-bzip2 -Wall])
21 AC_SUBST([ADG_API_PACKAGE],AC_PACKAGE_TARNAME-adg_api_version)
24 # Check for host information
59 AM_CONDITIONAL([OS_UNIX],[test "${guessed_host}" != "mingw"])
60 AM_CONDITIONAL([OS_WINDOWS],[test "${guessed_host}" == "mingw" -o "${guessed_host}" == "cygwin"])
68 AC_PATH_PROG([XSLTPROC],[xsltproc],[/usr/bin/xsltproc])
69 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums],[/usr/bin/glib-mkenums])
70 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[/usr/bin/glib-genmarshal])
71 AC_PATH_PROG([GTESTER],[gtester],[/usr/bin/gtester])
72 AC_PATH_PROG([GTESTER_REPORT],[gtester-report],[/usr/bin/gtester-report])
73 AC_PATH_PROG([GLADE3],[glade-3],[/usr/bin/glade-3])
76 # Libtool initialization
78 AC_MSG_CHECKING([which libtool initialization strategy to adopt])
79 AC_MSG_RESULT([m4_ifset([LT_INIT],[LT-INIT],[AC-PROG-LIBTOOL])])
81 [LT_INIT([disable-static win32-dll])],
89 AC_SUBST([GETTEXT_PACKAGE],[${ADG_API_PACKAGE}])
90 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["${ADG_API_PACKAGE}"],
91 [Define to the domain used by gettext.])
92 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
93 IT_PROG_INTLTOOL(0.40.1)
95 GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
96 AC_CONFIG_COMMANDS([default],
97 [case "${CONFIG_FILES}" in *po-properties/Makefile.in*)
98 ${SED} -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
103 # Check for required packages
105 GTK_DOC_CHECK(gtkdoc_prereq)
106 PKG_CHECK_MODULES([GOBJECT2],[gobject-2.0 >= ]gobject_prereq)
107 PKG_CHECK_MODULES([CAIRO],[cairo >= ]cairo_prereq)
110 # Check for optional GTK+2 support
112 AC_ARG_ENABLE([gtk2],
113 [AS_HELP_STRING([--enable-gtk2],
114 [include GKT+2 specific widgets @<:@default=check@:>@])],
115 [],[enable_gtk2=check])
116 AS_IF([test "x${enable_gtk2}" != "xno"],
117 [PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ]gtk_prereq,
119 DLLDIR=`${PKG_CONFIG} --variable=prefix gtk+-2.0`/bin
121 [AS_IF([test "x${enable_gtk2}" = "xyes"],
122 [AC_MSG_ERROR([${GTK2_PKG_ERRORS} and GTK+2 support requested])],
123 [enable_gtk2=no])])])
124 AM_CONDITIONAL([HAVE_GTK2],[test "x${enable_gtk2}" = "xyes"])
127 # Check for optional glade support
129 AC_ARG_ENABLE([glade],
130 [AS_HELP_STRING([--enable-glade],
131 [install glade catalog file @<:@default=check@:>@])],
132 [],[enable_glade=check])
133 AS_IF([test "x${enable_glade}" != "xno"],
134 [PKG_CHECK_MODULES([GLADE],[gladeui-1.0],
136 [AS_IF([test "x${enable_glade}" = "xyes"],
137 [AC_MSG_ERROR([${GLADE_PKG_ERRORS} and glade support requested])],
138 [enable_glade=no])])])
139 AM_CONDITIONAL([HAVE_GLADE],[test "x${enable_glade}" = "xyes"])
140 AS_IF([test "x${enable_glade}" == "xyes"],
141 [AC_MSG_CHECKING([for the glade catalog path])
142 gladeroot=`${PKG_CONFIG} --variable=datarootdir gladeui-1.0`
143 AS_IF([test "x${gladeroot}" == "x"],
144 [GLADE_CATALOGDIR="\${datarootdir}/glade3/catalogs}"],
145 [gladecatalog=`${PKG_CONFIG} --variable=catalogdir gladeui-1.0`
146 GLADE_CATALOGDIR=`echo "${gladecatalog}" | ${SED} -e "s|^${gladeroot}|\$\{datarootdir\}|" -`])
147 AC_SUBST([GLADE_CATALOGDIR])
148 AC_MSG_RESULT(${GLADE_CATALOGDIR})])
152 # Check for optional GLib test framework
154 AC_ARG_ENABLE([test_framework],
155 [AS_HELP_STRING([--enable-test-framework],
156 [enable GLib test framework @<:@default=check@:>@])],
157 [],[enable_test_framework=check])
158 AS_IF([test "x${enable_test_framework}" != "xno"],
159 [PKG_CHECK_EXISTS([glib-2.0 >= 2.16.0],
160 [enable_test_framework=yes],
161 [AS_IF([test "x${enable_test_framework}" = "xyes"],
162 [AC_MSG_ERROR([The test framework needs glib2-2.16.0 or later])],
163 [enable_test_framework=no])])])
164 AM_CONDITIONAL([HAVE_TEST_FRAMEWORK],[test "x${enable_test_framework}" = "xyes"])
167 # Check for compiler characteristics
174 AC_SUBST([CPML_REQUIRES],'cairo >= cairo_prereq')
175 AC_SUBST([ADG_REQUIRES],'gobject-2.0 >= gobject_prereq')
176 AC_SUBST([ADG_GTK_REQUIRES],'gtk+-2.0 >= gtk_prereq')
178 SHAVE_INIT([build],[enable])
179 AC_CONFIG_FILES([build/shave
188 src/adg/tests/Makefile
191 src/adg-gtk/tests/Makefile
196 po-properties/Makefile.in
199 docs/cpml/bookinfo.xml
201 docs/adg/bookinfo.xml])
202 AC_CONFIG_FILES([demo/adg-glade],[chmod +x demo/adg-glade])
208 AC_MSG_NOTICE([generating report
210 AC_PACKAGE_NAME adg_version will be built with the following options:
211 ----------------------------------------------------------
212 API compatibility: adg_api_version
213 CPML library to use: internal (cpml-adg_version)
214 GTK+2 additional widgets: ${enable_gtk2}
215 Install glade catalogs: ${enable_glade}
216 Build API reference: ${enable_gtk_doc}
217 Test framework support: ${enable_test_framework}