[AdgDimStyle] Rely on automatic dress validation
[adg.git] / configure.ac
blobcd45b37b10ac80bbf668274b7b4415ed7690860e
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 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([Automatic Drawing Generation],adg_version,
16         [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])
24 # Check for programs
26 AC_PROG_CC
27 AC_PROG_SED
28 PKG_PROG_PKG_CONFIG
29 AC_PATH_PROG([XSLTPROC],[xsltproc],[/usr/bin/xsltproc])
30 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums],[/usr/bin/glib-mkenums])
31 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[/usr/bin/glib-genmarshal])
32 AC_PATH_PROG([GTESTER],[gtester],[/usr/bin/gtester])
33 AC_PATH_PROG([GTESTER_REPORT],[gtester-report],[/usr/bin/gtester-report])
35 AC_MSG_CHECKING([which libtool initialization strategy to adopt])
36 AC_MSG_RESULT([m4_ifset([LT_INIT],[LT-INIT],[AC-PROG-LIBTOOL])])
37 m4_ifset([LT_INIT],
38          [LT_INIT([disable-static])],
39          [AC_DISABLE_STATIC
40           AC_PROG_LIBTOOL])
43 # I18n
45 AC_SUBST([GETTEXT_PACKAGE],adg-adg_api_version)
46 AC_DEFINE([GETTEXT_PACKAGE],"AC_PACKAGE_TARNAME-adg_api_version",
47           [Define to the domain used by gettext.])
48 ALL_LINGUAS=""
49 AM_GLIB_GNU_GETTEXT
50 GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
51 AC_OUTPUT_COMMANDS([case "${CONFIG_FILES}" in *po-properties/Makefile.in*)
52         ${SED} -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
53       esac])
56 # Check for required packages
58 GTK_DOC_CHECK(gtkdoc_prereq)
59 PKG_CHECK_MODULES([GOBJECT2],[gobject-2.0 >= ]gobject_prereq)
60 PKG_CHECK_MODULES([CAIRO],[cairo >= ]cairo_prereq)
63 # Check for optional GTK+2 support
65 AC_ARG_ENABLE([gtk2],
66               [AS_HELP_STRING([--enable-gtk2],
67                               [include GKT+2 specific widgets @<:@default=check@:>@])],
68               [],[enable_gtk2=check])
69 AS_IF([test "x${enable_gtk2}" != "xno"],
70       [PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ]gtk_prereq,
71                          [enable_gtk2=yes],
72                          [AS_IF([test "x${enable_gtk2}" = "xyes"],
73                                 [AC_MSG_ERROR([${GTK2_PKG_ERRORS} and GTK+2 support requested])],
74                                 [enable_gtk2=no])])])
75 AM_CONDITIONAL([HAVE_GTK2],[test "x${enable_gtk2}" = "xyes"])
78 # Check for optional glade support
80 AC_ARG_ENABLE([glade],
81               [AS_HELP_STRING([--enable-glade],
82                               [install glade catalog file @<:@default=check@:>@])],
83               [],[enable_glade=check])
84 AS_IF([test "x${enable_glade}" != "xno"],
85       [PKG_CHECK_MODULES([GLADE],[gladeui-1.0],
86                          [enable_glade=yes],
87                          [AS_IF([test "x${enable_glade}" = "xyes"],
88                                 [AC_MSG_ERROR([${GLADE_PKG_ERRORS} and glade support requested])],
89                                 [enable_glade=no])])])
90 AM_CONDITIONAL([HAVE_GLADE],[test "x${enable_glade}" = "xyes"])
91 AS_IF([test "x${enable_glade}" == "xyes"],
92       [AC_MSG_CHECKING([for the glade catalog path])
93        gladeroot=`${PKG_CONFIG} --variable=datarootdir gladeui-1.0`
94        AS_IF([test "x${gladeroot}" == "x"],
95              [GLADE_CATALOGDIR="\${datarootdir}/glade3/catalogs}"],
96              [gladecatalog=`${PKG_CONFIG} --variable=catalogdir gladeui-1.0`
97               GLADE_CATALOGDIR=`echo "${gladecatalog}" | ${SED} -e "s|^${gladeroot}|\$\{datarootdir\}|" -`])
98        AC_SUBST([GLADE_CATALOGDIR])
99        AC_MSG_RESULT(${GLADE_CATALOGDIR})])
103 # Check for optional GLib test framework
105 AC_ARG_ENABLE([test_framework],
106               [AS_HELP_STRING([--enable-test-framework],
107                               [enable GLib test framework @<:@default=check@:>@])],
108               [],[enable_test_framework=check])
109 AS_IF([test "x${enable_test_framework}" != "xno"],
110       [PKG_CHECK_EXISTS([glib-2.0 >= 2.16.0],
111                         [enable_test_framework=yes],
112                         [AS_IF([test "x${enable_test_framework}" = "xyes"],
113                                [AC_MSG_ERROR([The test framework needs glib2-2.16.0 or later])],
114                                [enable_test_framework=no])])])
115 AM_CONDITIONAL([HAVE_TEST_FRAMEWORK],[test "x${enable_test_framework}" = "xyes"])
118 # Check for compiler characteristics
120 AC_C_CONST
123 # Final step
125 CPML_REQUIRES='cairo >= cairo_prereq'
126 CPML_CFLAGS="${CAIRO_CFLAGS}"
127 CPML_LIBS="${CAIRO_LIBS}"
128 ADG_REQUIRES='gobject-2.0 >= gobject_prereq'
129 ADG_CFLAGS="${GOBJECT2_CFLAGS} ${CPML_CFLAGS}"
130 ADG_LIBS="${GOBJECT2_LIBS} ${CPML_LIBS}"
131 AS_IF([test "x${enable_gtk2}" = "xyes"],
132       [ADG_GTK_REQUIRES='gtk+-2.0 >= gtk_prereq'
133        ADG_GTK_CFLAGS="${GTK2_CFLAGS} ${CPML_CFLAGS}"
134        ADG_GTK_LIBS="${GTK2_LIBS} ${CPML_LIBS}"
135        AC_SUBST([ADG_GTK_REQUIRES])
136        AC_SUBST([ADG_GTK_CFLAGS])
137        AC_SUBST([ADG_GTK_LIBS])])
138 AC_SUBST([CPML_REQUIRES])
139 AC_SUBST([CPML_CFLAGS])
140 AC_SUBST([CPML_LIBS])
141 AC_SUBST([ADG_REQUIRES])
142 AC_SUBST([ADG_CFLAGS])
143 AC_SUBST([ADG_LIBS])
145 SHAVE_INIT([build],[enable])
146 AC_CONFIG_FILES([build/shave
147                  build/shave-libtool
148                  Makefile
149                  src/Makefile
150                  src/cpml-1.pc
151                  src/cpml/Makefile
152                  src/adg-1.pc
153                  src/adg/Makefile
154                  src/adg/tests/Makefile
155                  src/adg-gtk-1.pc
156                  src/adg-gtk/Makefile
157                  src/adg-gtk/tests/Makefile
158                  demo/Makefile
159                  demo/adg-demo.ui
160                  po/Makefile.in
161                  po-properties/Makefile.in
162                  docs/Makefile
163                  docs/cpml/Makefile
164                  docs/cpml/bookinfo.xml
165                  docs/adg/Makefile
166                  docs/adg/bookinfo.xml])
167 AC_OUTPUT
170 # Report
172 AC_MSG_NOTICE([generating report
174 ADG canvas adg_version will be built with the following options:
175 ----------------------------------------------------------
176                   API compatibility: adg_api_version
177                 CPML library to use: internal (cpml-adg_version)
178            GTK+2 additional widgets: ${enable_gtk2}
179              Install glade catalogs: ${enable_glade}
180                 Build API reference: ${enable_gtk_doc}
181              Test framework support: ${enable_test_framework}