[AdgTable] Prefixed internal symbols
[adg.git] / configure.ac
blob864a76f79489dab31d1663e5b30e65d733789441
1 m4_define([adg_version],[0.6.0])
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([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])
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=""
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}