[AdgRDim] Added extents computation
[adg.git] / configure.ac
blobd9aaee187cfc72aa870ec0aa7e4b3fc5e6a194b4
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])
11 # Initialization
13 dnl autoconf 2.60 implements datarootdir, required by ADG
14 dnl to help overcoming the hardcoded glade catalogdir
15 AC_PREREQ([2.60])
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
27 AC_CANONICAL_HOST
28 case "${host}" in
29   *-*-linux*)
30     guessed_host=linux
31     ;;
32   *-*-freebsd*)
33     guessed_host=freebsd
34     ;;
35   *-*-mingw*)
36     guessed_host=mingw
37     ;;
38   *-*-solaris*)
39     guessed_host=solaris
40     ;;
41   *-*-darwin*)
42     guessed_host=darwin
43     ;;
44   *-*-beos*)
45     guessed_host=beos
46     ;;
47   *-*-cygwin*)
48     guessed_host=cygwin
49     ;;
50   *-*-minix)
51     guessed_host=minix
52     ;;
53   *-*-aix*)
54     guessed_host=aix
55     ;;
56   *)
57     guessed_host=unknown
58     ;;
59 esac
60 AM_CONDITIONAL([OS_UNIX],[test "${guessed_host}" != "mingw"])
61 AM_CONDITIONAL([OS_WINDOWS],[test "${guessed_host}" == "mingw" -o "${guessed_host}" == "cygwin"])
64 # Check for programs
66 AC_PROG_CC
67 AC_PROG_SED
68 PKG_PROG_PKG_CONFIG
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])])
81 m4_ifset([LT_INIT],
82          [LT_INIT([disable-static win32-dll])],
83          [AC_DISABLE_STATIC
84           AC_LIBTOOL_WIN32_DLL
85           AC_PROG_LIBTOOL])
88 # I18n
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)
95 AM_GLIB_GNU_GETTEXT
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
100     esac],
101                    [SED="${SED}"])
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,
120                          [enable_pango=yes
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,
137                          [enable_gtk2=yes],
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],
152                          [enable_glade=yes],
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
186 AC_C_CONST
189 # Final step
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
198                  build/shave-libtool
199                  build/adg.nsi
200                  Makefile
201                  src/Makefile
202                  src/cpml-1.pc
203                  src/cpml/Makefile
204                  src/cpml/tests/Makefile
205                  src/adg-1.pc
206                  src/adg/Makefile
207                  src/adg/tests/Makefile
208                  src/adg-gtk-1.pc
209                  src/adg-gtk/Makefile
210                  src/adg-gtk/tests/Makefile
211                  demo/Makefile
212                  demo/cpml-demo.ui
213                  demo/adg-demo.ui
214                  po/Makefile.in
215                  po-properties/Makefile.in
216                  docs/Makefile
217                  docs/cpml/Makefile
218                  docs/cpml/bookinfo.xml
219                  docs/adg/Makefile
220                  docs/adg/bookinfo.xml])
221 AC_CONFIG_FILES([demo/adg-glade],[chmod +x demo/adg-glade])
222 AC_OUTPUT
225 # Report
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}