[tests] Added test-adim
[adg.git] / configure.ac
blob284ebedf16b683d2ddd10291e74283c548ec26b7
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])
10 # Initialization
12 AC_PREREQ([2.59])
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
23 AC_CANONICAL_HOST
24 case "${host}" in
25   *-*-linux*)
26     guessed_host=linux
27     ;;
28   *-*-freebsd*)
29     guessed_host=freebsd
30     ;;
31   *-*-mingw*)
32     guessed_host=mingw
33     ;;
34   *-*-solaris*)
35     guessed_host=solaris
36     ;;
37   *-*-darwin*)
38     guessed_host=darwin
39     ;;
40   *-*-beos*)
41     guessed_host=beos
42     ;;
43   *-*-cygwin*)
44     guessed_host=cygwin
45     ;;
46   *-*-minix)
47     guessed_host=minix
48     ;;
49   *-*-aix*)
50     guessed_host=aix
51     ;;
52   *)
53     guessed_host=unknown
54     ;;
55 esac
56 AM_CONDITIONAL([OS_UNIX],[test "${guessed_host}" != "mingw"])
57 AM_CONDITIONAL([OS_WIN32],[test "${guessed_host}" == "mingw" -o "${guessed_host}" == "cygwin"])
60 # Check for programs
62 AC_PROG_CC
63 PKG_PROG_PKG_CONFIG
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])])
72 m4_ifset([LT_INIT],
73          [LT_INIT([disable-static])],
74          [AC_DISABLE_STATIC
75           AC_PROG_LIBTOOL])
78 # I18n
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.])
83 ALL_LINGUAS=""
84 AM_GLIB_GNU_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
88       esac])
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,
106                          [enable_gtk2=yes],
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
130 AC_C_CONST
133 # Final step
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])
150 AC_SUBST([ADG_LIBS])
152 SHAVE_INIT([build],[enable])
153 AC_CONFIG_FILES([build/shave
154                  build/shave-libtool
155                  Makefile
156                  cpml/cpml.pc
157                  cpml/Makefile
158                  adg/adg.pc
159                  adg/Makefile
160                  adg/tests/Makefile
161                  demo/Makefile
162                  po/Makefile.in
163                  po-properties/Makefile.in
164                  docs/Makefile
165                  docs/cpml/Makefile
166                  docs/cpml/bookinfo.xml
167                  docs/adg/Makefile
168                  docs/adg/bookinfo.xml])
169 AC_OUTPUT
172 # Report
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}