[AdgLDim] Corrected base line extension
[adg.git] / configure.ac
blobbfdd1085285035a1bbb9540b864d8ad16bb260e1
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])
34 AC_PATH_PROG([GLADE3],[glade-3],[/usr/bin/glade-3])
36 AC_MSG_CHECKING([which libtool initialization strategy to adopt])
37 AC_MSG_RESULT([m4_ifset([LT_INIT],[LT-INIT],[AC-PROG-LIBTOOL])])
38 m4_ifset([LT_INIT],
39          [LT_INIT([disable-static])],
40          [AC_DISABLE_STATIC
41           AC_PROG_LIBTOOL])
44 # I18n
46 AC_SUBST([GETTEXT_PACKAGE],adg-adg_api_version)
47 AC_DEFINE([GETTEXT_PACKAGE],"AC_PACKAGE_TARNAME-adg_api_version",
48           [Define to the domain used by gettext.])
49 ALL_LINGUAS=""
50 AM_GLIB_GNU_GETTEXT
51 GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
52 AC_OUTPUT_COMMANDS([case "${CONFIG_FILES}" in *po-properties/Makefile.in*)
53         ${SED} -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
54       esac])
57 # Check for required packages
59 GTK_DOC_CHECK(gtkdoc_prereq)
60 PKG_CHECK_MODULES([GOBJECT2],[gobject-2.0 >= ]gobject_prereq)
61 PKG_CHECK_MODULES([CAIRO],[cairo >= ]cairo_prereq)
64 # Check for optional GTK+2 support
66 AC_ARG_ENABLE([gtk2],
67               [AS_HELP_STRING([--enable-gtk2],
68                               [include GKT+2 specific widgets @<:@default=check@:>@])],
69               [],[enable_gtk2=check])
70 AS_IF([test "x${enable_gtk2}" != "xno"],
71       [PKG_CHECK_MODULES([GTK2],[gtk+-2.0 >= ]gtk_prereq,
72                          [enable_gtk2=yes],
73                          [AS_IF([test "x${enable_gtk2}" = "xyes"],
74                                 [AC_MSG_ERROR([${GTK2_PKG_ERRORS} and GTK+2 support requested])],
75                                 [enable_gtk2=no])])])
76 AM_CONDITIONAL([HAVE_GTK2],[test "x${enable_gtk2}" = "xyes"])
79 # Check for optional glade support
81 AC_ARG_ENABLE([glade],
82               [AS_HELP_STRING([--enable-glade],
83                               [install glade catalog file @<:@default=check@:>@])],
84               [],[enable_glade=check])
85 AS_IF([test "x${enable_glade}" != "xno"],
86       [PKG_CHECK_MODULES([GLADE],[gladeui-1.0],
87                          [enable_glade=yes],
88                          [AS_IF([test "x${enable_glade}" = "xyes"],
89                                 [AC_MSG_ERROR([${GLADE_PKG_ERRORS} and glade support requested])],
90                                 [enable_glade=no])])])
91 AM_CONDITIONAL([HAVE_GLADE],[test "x${enable_glade}" = "xyes"])
92 AS_IF([test "x${enable_glade}" == "xyes"],
93       [AC_MSG_CHECKING([for the glade catalog path])
94        gladeroot=`${PKG_CONFIG} --variable=datarootdir gladeui-1.0`
95        AS_IF([test "x${gladeroot}" == "x"],
96              [GLADE_CATALOGDIR="\${datarootdir}/glade3/catalogs}"],
97              [gladecatalog=`${PKG_CONFIG} --variable=catalogdir gladeui-1.0`
98               GLADE_CATALOGDIR=`echo "${gladecatalog}" | ${SED} -e "s|^${gladeroot}|\$\{datarootdir\}|" -`])
99        AC_SUBST([GLADE_CATALOGDIR])
100        AC_MSG_RESULT(${GLADE_CATALOGDIR})])
104 # Check for optional GLib test framework
106 AC_ARG_ENABLE([test_framework],
107               [AS_HELP_STRING([--enable-test-framework],
108                               [enable GLib test framework @<:@default=check@:>@])],
109               [],[enable_test_framework=check])
110 AS_IF([test "x${enable_test_framework}" != "xno"],
111       [PKG_CHECK_EXISTS([glib-2.0 >= 2.16.0],
112                         [enable_test_framework=yes],
113                         [AS_IF([test "x${enable_test_framework}" = "xyes"],
114                                [AC_MSG_ERROR([The test framework needs glib2-2.16.0 or later])],
115                                [enable_test_framework=no])])])
116 AM_CONDITIONAL([HAVE_TEST_FRAMEWORK],[test "x${enable_test_framework}" = "xyes"])
119 # Check for compiler characteristics
121 AC_C_CONST
124 # Final step
126 CPML_REQUIRES='cairo >= cairo_prereq'
127 CPML_CFLAGS="${CAIRO_CFLAGS}"
128 CPML_LIBS="${CAIRO_LIBS}"
129 ADG_REQUIRES='gobject-2.0 >= gobject_prereq'
130 ADG_CFLAGS="${GOBJECT2_CFLAGS} ${CPML_CFLAGS}"
131 ADG_LIBS="${GOBJECT2_LIBS} ${CPML_LIBS}"
132 AS_IF([test "x${enable_gtk2}" = "xyes"],
133       [ADG_GTK_REQUIRES='gtk+-2.0 >= gtk_prereq'
134        ADG_GTK_CFLAGS="${GTK2_CFLAGS} ${CPML_CFLAGS}"
135        ADG_GTK_LIBS="${GTK2_LIBS} ${CPML_LIBS}"
136        AC_SUBST([ADG_GTK_REQUIRES])
137        AC_SUBST([ADG_GTK_CFLAGS])
138        AC_SUBST([ADG_GTK_LIBS])])
139 AC_SUBST([CPML_REQUIRES])
140 AC_SUBST([CPML_CFLAGS])
141 AC_SUBST([CPML_LIBS])
142 AC_SUBST([ADG_REQUIRES])
143 AC_SUBST([ADG_CFLAGS])
144 AC_SUBST([ADG_LIBS])
146 SHAVE_INIT([build],[enable])
147 AC_CONFIG_FILES([build/shave
148                  build/shave-libtool
149                  Makefile
150                  src/Makefile
151                  src/cpml-1.pc
152                  src/cpml/Makefile
153                  src/adg-1.pc
154                  src/adg/Makefile
155                  src/adg/tests/Makefile
156                  src/adg-gtk-1.pc
157                  src/adg-gtk/Makefile
158                  src/adg-gtk/tests/Makefile
159                  demo/Makefile
160                  demo/adg-demo.ui
161                  po/Makefile.in
162                  po-properties/Makefile.in
163                  docs/Makefile
164                  docs/cpml/Makefile
165                  docs/cpml/bookinfo.xml
166                  docs/adg/Makefile
167                  docs/adg/bookinfo.xml])
168 AC_CONFIG_FILES([demo/adg-glade],[chmod +x demo/adg-glade])
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            GTK+2 additional widgets: ${enable_gtk2}
181              Install glade catalogs: ${enable_glade}
182                 Build API reference: ${enable_gtk_doc}
183              Test framework support: ${enable_test_framework}