[AdgGtkArea] Corrected zoom in size_allocate()
[adg.git] / configure.ac
blob3467f8edf07253162f4754c34b689cff97490a16
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])
10 # Initialization
12 dnl autoconf 2.60 implements datarootdir, required by ADG
13 dnl to help overcoming the hardcoded glade catalogdir
14 AC_PREREQ([2.60])
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
26 AC_CANONICAL_HOST
27 case "${host}" in
28   *-*-linux*)
29     guessed_host=linux
30     ;;
31   *-*-freebsd*)
32     guessed_host=freebsd
33     ;;
34   *-*-mingw*)
35     guessed_host=mingw
36     ;;
37   *-*-solaris*)
38     guessed_host=solaris
39     ;;
40   *-*-darwin*)
41     guessed_host=darwin
42     ;;
43   *-*-beos*)
44     guessed_host=beos
45     ;;
46   *-*-cygwin*)
47     guessed_host=cygwin
48     ;;
49   *-*-minix)
50     guessed_host=minix
51     ;;
52   *-*-aix*)
53     guessed_host=aix
54     ;;
55   *)
56     guessed_host=unknown
57     ;;
58 esac
59 AM_CONDITIONAL([OS_UNIX],[test "${guessed_host}" != "mingw"])
60 AM_CONDITIONAL([OS_WINDOWS],[test "${guessed_host}" == "mingw" -o "${guessed_host}" == "cygwin"])
63 # Check for programs
65 AC_PROG_CC
66 AC_PROG_SED
67 PKG_PROG_PKG_CONFIG
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])])
80 m4_ifset([LT_INIT],
81          [LT_INIT([disable-static win32-dll])],
82          [AC_DISABLE_STATIC
83           AC_LIBTOOL_WIN32_DLL
84           AC_PROG_LIBTOOL])
87 # I18n
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)
94 AM_GLIB_GNU_GETTEXT
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
99     esac],
100                    [SED="${SED}"])
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,
118                          [enable_gtk2=yes
119                           DLLDIR=`${PKG_CONFIG} --variable=prefix gtk+-2.0`/bin
120                           AC_SUBST([DLLDIR])],
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],
135                          [enable_glade=yes],
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
169 AC_C_CONST
172 # Final step
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
180                  build/shave-libtool
181                  build/adg.nsi
182                  Makefile
183                  src/Makefile
184                  src/cpml-1.pc
185                  src/cpml/Makefile
186                  src/adg-1.pc
187                  src/adg/Makefile
188                  src/adg/tests/Makefile
189                  src/adg-gtk-1.pc
190                  src/adg-gtk/Makefile
191                  src/adg-gtk/tests/Makefile
192                  demo/Makefile
193                  demo/cpml-demo.ui
194                  demo/adg-demo.ui
195                  po/Makefile.in
196                  po-properties/Makefile.in
197                  docs/Makefile
198                  docs/cpml/Makefile
199                  docs/cpml/bookinfo.xml
200                  docs/adg/Makefile
201                  docs/adg/bookinfo.xml])
202 AC_CONFIG_FILES([demo/adg-glade],[chmod +x demo/adg-glade])
203 AC_OUTPUT
206 # Report
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}