1 | -*- mode: m4 -*- |
---|
2 | AC_PREREQ(2.52) |
---|
3 | AC_INIT(gal, 1.99.10, |
---|
4 | http://bugzilla.ximian.com/enter_bug.cgi?product=GAL) |
---|
5 | |
---|
6 | AM_CONFIG_HEADER(config.h) |
---|
7 | |
---|
8 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
---|
9 | |
---|
10 | AM_MAINTAINER_MODE |
---|
11 | |
---|
12 | dnl |
---|
13 | dnl Due to the sed scripts being split on 90 line |
---|
14 | dnl blocks, this macro needs to be right at the beggining. |
---|
15 | dnl |
---|
16 | AC_PROG_INTLTOOL |
---|
17 | |
---|
18 | dnl if you change this you need to change the GETTEXT_PACKAGE |
---|
19 | dnl string below as well due to a bug in intltool. |
---|
20 | GAL_API_VERSION=2.0 |
---|
21 | |
---|
22 | dnl libtool versioning |
---|
23 | |
---|
24 | dnl gal-1.99.10 = 0 |
---|
25 | dnl increment if any interfaces have been added; set to 0 |
---|
26 | dnl if any interfaces have been removed. removal has |
---|
27 | dnl precedence over adding, so set to 0 if both happened. |
---|
28 | GAL_AGE=0 |
---|
29 | |
---|
30 | dnl gal-1.99.10 = 1 |
---|
31 | dnl increment any time the source changes; set to |
---|
32 | dnl 0 if you increment CURRENT |
---|
33 | GAL_REVISION=1 |
---|
34 | |
---|
35 | dnl gal-1.99.10 = 5 |
---|
36 | dnl increment if the interface has additions, changes, removals. |
---|
37 | GAL_CURRENT=5 |
---|
38 | |
---|
39 | AC_SUBST(GAL_API_VERSION) |
---|
40 | AC_SUBST(GAL_CURRENT) |
---|
41 | AC_SUBST(GAL_REVISION) |
---|
42 | AC_SUBST(GAL_AGE) |
---|
43 | |
---|
44 | AC_ISC_POSIX |
---|
45 | AC_PROG_CC |
---|
46 | AC_PROG_YACC |
---|
47 | AC_LIBTOOL_WIN32_DLL |
---|
48 | AM_PROG_LIBTOOL |
---|
49 | AC_PROG_INTLTOOL |
---|
50 | AC_STDC_HEADERS |
---|
51 | |
---|
52 | ## this should come after `AC_PROG_CC' |
---|
53 | GNOME_COMPILE_WARNINGS |
---|
54 | |
---|
55 | dnl |
---|
56 | dnl alloca tests |
---|
57 | dnl test for both ac_cv_header_alloca_h and ac_cv_working_alloca_h so |
---|
58 | dnl we're compatible with both autoconf 2.1X and autoconf >= 2.50 |
---|
59 | dnl; |
---|
60 | AC_FUNC_ALLOCA |
---|
61 | if test X$ac_cv_working_alloca_h = Xyes || \ |
---|
62 | test X$ac_cv_header_alloca_h = Xyes ; then |
---|
63 | GAL_HAVE_ALLOCA_H=1 |
---|
64 | else |
---|
65 | GAL_HAVE_ALLOCA_H=0 |
---|
66 | fi |
---|
67 | AC_SUBST(GAL_HAVE_ALLOCA_H) |
---|
68 | |
---|
69 | AC_SUBST(CFLAGS) |
---|
70 | AC_SUBST(CPPFLAGS) |
---|
71 | AC_SUBST(LDFLAGS) |
---|
72 | |
---|
73 | ALL_LINGUAS="am az be ca cs da de el en_GB es eu fi fr gl hu it ja ko lt lv ms nl nn no pl pt pt_BR ro ru sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW" |
---|
74 | |
---|
75 | dnl we have to work around a intltool bug here so we must define GETTEXT_PACKAGE |
---|
76 | dnl as a simple string instead of trying to do variable substition. See |
---|
77 | dnl http://bugzilla.ximian.com/show_bug.cgi?id=37784 |
---|
78 | dnl GETTEXT_PACKAGE=gal-${GAL_API_VERSION} |
---|
79 | GETTEXT_PACKAGE=gal-AC_PACKAGE_VERSION |
---|
80 | AC_SUBST(GETTEXT_PACKAGE) |
---|
81 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) |
---|
82 | AM_GLIB_GNU_GETTEXT |
---|
83 | |
---|
84 | gnomelocaledir='${prefix}/${DATADIRNAME}/locale' |
---|
85 | AC_SUBST(gnomelocaledir) |
---|
86 | |
---|
87 | AC_DEFINE_UNQUOTED(GNOME_EXPLICIT_TRANSLATION_DOMAIN, "${GETTEXT_PACKAGE}", [Translation domain name for gettext]) |
---|
88 | |
---|
89 | dnl ****************************** |
---|
90 | dnl iconv checking |
---|
91 | dnl ****************************** |
---|
92 | have_iconv=no |
---|
93 | AC_ARG_WITH(libiconv, [ --with-libiconv Prefix where libiconv is installed]) |
---|
94 | case $withval in |
---|
95 | /*) |
---|
96 | ICONV_CFLAGS="-I$withval/include" |
---|
97 | ICONV_LIBS="-L$withval/lib" |
---|
98 | ;; |
---|
99 | esac |
---|
100 | |
---|
101 | save_CFLAGS="$CFLAGS" |
---|
102 | save_LIBS="$LIBS" |
---|
103 | CFLAGS="$CFLAGS $ICONV_CFLAGS" |
---|
104 | LIBS="$LIBS $ICONV_LIBS -liconv" |
---|
105 | AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([ |
---|
106 | #include <iconv.h> |
---|
107 | ], [ |
---|
108 | iconv_t cd; |
---|
109 | cd = iconv_open ("UTF-8", "ISO-8859-1"); |
---|
110 | ], ac_cv_libiconv=yes, ac_cv_libiconv=no)) |
---|
111 | if test $ac_cv_libiconv = yes; then |
---|
112 | ICONV_LIBS="$ICONV_LIBS -liconv" |
---|
113 | have_iconv=yes |
---|
114 | else |
---|
115 | CFLAGS="$save_CFLAGS" |
---|
116 | LIBS="$save_LIBS" |
---|
117 | AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no) |
---|
118 | fi |
---|
119 | |
---|
120 | if test $have_iconv = yes; then |
---|
121 | if test $ac_cv_libiconv = no; then |
---|
122 | AC_CHECK_FUNCS(gnu_get_libc_version) |
---|
123 | fi |
---|
124 | AC_CACHE_CHECK([if iconv() handles UTF-8], ac_cv_libiconv_utf8, AC_TRY_RUN([ |
---|
125 | #include <iconv.h> |
---|
126 | #include <stdlib.h> |
---|
127 | #include <string.h> |
---|
128 | #ifdef HAVE_GNU_GET_LIBC_VERSION |
---|
129 | #include <gnu/libc-version.h> |
---|
130 | #endif |
---|
131 | |
---|
132 | int main (int argc, char **argv) |
---|
133 | { |
---|
134 | const char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C"; |
---|
135 | const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"; |
---|
136 | char *transbuf = malloc (10), *trans = transbuf; |
---|
137 | iconv_t cd; |
---|
138 | size_t jp_len = strlen (jp), utf8_len = 10; |
---|
139 | size_t utf8_real_len = strlen (utf8); |
---|
140 | |
---|
141 | #ifdef HAVE_GNU_GET_LIBC_VERSION |
---|
142 | /* glibc 2.1.2's iconv is broken in hard to test ways. */ |
---|
143 | if (!strcmp (gnu_get_libc_version (), "2.1.2")) |
---|
144 | exit (1); |
---|
145 | #endif |
---|
146 | |
---|
147 | cd = iconv_open ("UTF-8", "ISO-2022-JP"); |
---|
148 | if (cd == (iconv_t) -1) |
---|
149 | exit (1); |
---|
150 | if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0) |
---|
151 | exit (1); |
---|
152 | if (memcmp (utf8, transbuf, utf8_real_len) != 0) |
---|
153 | exit (1); |
---|
154 | |
---|
155 | exit (0); |
---|
156 | }], ac_cv_libiconv_utf8=yes, [ac_cv_libiconv_utf8=no; have_iconv=no], [ac_cv_libiconv_utf8=no; have_iconv=no])) |
---|
157 | fi |
---|
158 | |
---|
159 | if test "$have_iconv" = no; then |
---|
160 | AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv]) |
---|
161 | fi |
---|
162 | AC_SUBST(ICONV_CFLAGS) |
---|
163 | AC_SUBST(ICONV_LIBS) |
---|
164 | |
---|
165 | CFLAGS="$CFLAGS -I$srcdir" |
---|
166 | |
---|
167 | AC_MSG_CHECKING(preferred charset formats for system iconv) |
---|
168 | AC_TRY_RUN([ |
---|
169 | #define CONFIGURE_IN |
---|
170 | #include "iconv-detect.c" |
---|
171 | ],[ |
---|
172 | AC_MSG_RESULT(found) |
---|
173 | ],[ |
---|
174 | AC_MSG_RESULT(not found) |
---|
175 | AC_WARN([ |
---|
176 | *** The iconv-detect program was unable to determine the |
---|
177 | *** preferred charset formats recognized by your system |
---|
178 | *** iconv library. It is suggested that you install a |
---|
179 | *** working iconv library such as the one found at |
---|
180 | *** ftp://ftp.gnu.org/pub/gnu/libiconv |
---|
181 | ]) |
---|
182 | ]) |
---|
183 | |
---|
184 | CFLAGS="$save_CFLAGS" |
---|
185 | LIBS="$save_LIBS" |
---|
186 | |
---|
187 | dnl Check to see if strftime supports the use of %l and %k |
---|
188 | |
---|
189 | AC_MSG_CHECKING(for %l and %k support in strftime) |
---|
190 | AC_TRY_RUN([ |
---|
191 | #include <string.h> |
---|
192 | #include <time.h> |
---|
193 | |
---|
194 | int main(int argc, char **argv) |
---|
195 | { |
---|
196 | char buf[10]; |
---|
197 | time_t rawtime; |
---|
198 | struct tm *timeinfo; |
---|
199 | |
---|
200 | time(&rawtime); |
---|
201 | timeinfo=localtime(&rawtime); |
---|
202 | strftime(buf, 10, "%l %k", timeinfo); |
---|
203 | |
---|
204 | if (strstr(buf, "l") || strstr(buf, "k")) |
---|
205 | exit(1); |
---|
206 | else |
---|
207 | exit(0); |
---|
208 | }],[ |
---|
209 | AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) |
---|
210 | ac_cv_lkstrftime=yes |
---|
211 | ],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no]) |
---|
212 | AC_MSG_RESULT($ac_cv_lkstrftime) |
---|
213 | |
---|
214 | dnl Check for nl_langinfo and CODESET |
---|
215 | |
---|
216 | AC_MSG_CHECKING([for nl_langinfo (CODESET)]) |
---|
217 | AC_TRY_COMPILE([#include <langinfo.h>], |
---|
218 | [char *codeset = nl_langinfo (CODESET);], |
---|
219 | AC_DEFINE(HAVE_CODESET,1,[Have nl_langinfo (CODESET)]) |
---|
220 | have_codeset=yes, |
---|
221 | have_codeset=no) |
---|
222 | AC_MSG_RESULT($have_codeset) |
---|
223 | |
---|
224 | # glib-genmarshal |
---|
225 | AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) |
---|
226 | |
---|
227 | dnl |
---|
228 | dnl Gtk-doc |
---|
229 | dnl |
---|
230 | AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) |
---|
231 | |
---|
232 | if test x$enable_gtk_doc = xauto ; then |
---|
233 | if test x$GTKDOC = xtrue ; then |
---|
234 | enable_gtk_doc=yes |
---|
235 | else |
---|
236 | enable_gtk_doc=no |
---|
237 | fi |
---|
238 | fi |
---|
239 | dnl NOTE: We need to use a separate automake conditional for this |
---|
240 | dnl to make this work with the tarballs. |
---|
241 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
242 | |
---|
243 | AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) |
---|
244 | if test "x$with_html_dir" = "x" ; then |
---|
245 | HTML_DIR='${datadir}/gal-${GAL_API_VERSION}/html' |
---|
246 | else |
---|
247 | HTML_DIR=$with_html_dir |
---|
248 | fi |
---|
249 | |
---|
250 | AC_SUBST(HTML_DIR) |
---|
251 | |
---|
252 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
---|
253 | |
---|
254 | dnl |
---|
255 | dnl For the various galConf.sh scripts generation. |
---|
256 | dnl |
---|
257 | GAL_LIBDIR='-L${libdir}' |
---|
258 | PKG_CHECK_MODULES(GAL, libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >= 2.2.1 libglade-2.0 libgnomeui-2.0 libgnomecanvas-2.0 libxml-2.0) |
---|
259 | GAL_CFLAGS="$GAL_CFLAGS $ICONV_CFLAGS" |
---|
260 | GAL_LIBS="$GAL_LIBS -lgal-2.0 $ICONV_LIBS" |
---|
261 | AC_SUBST(GAL_LIBDIR) |
---|
262 | AC_SUBST(GAL_CFLAGS) |
---|
263 | AC_SUBST(GAL_LIBS) |
---|
264 | |
---|
265 | PKG_CHECK_MODULES(EXTRA_GNOME, libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >= 2.2.1 libglade-2.0 libgnomeui-2.0 libgnomecanvas-2.0 libxml-2.0) |
---|
266 | AC_SUBST(EXTRA_GNOME_LIBS) |
---|
267 | AC_SUBST(EXTRA_GNOME_CFLAGS) |
---|
268 | |
---|
269 | AC_MSG_CHECKING(libgnomecanvas and gtk2 compatibility) |
---|
270 | if $PKG_CONFIG --atleast-version 2.2.0 gtk+-2.0 ; then |
---|
271 | if $PKG_CONFIG --atleast-version 2.2.0.2 libgnomecanvas-2.0 ; then |
---|
272 | AC_MSG_RESULT(okay) |
---|
273 | else |
---|
274 | AC_MSG_ERROR([*** libgnomecanvas-2.2.0.2 or newer is required with gtk-2.2. ]) |
---|
275 | fi |
---|
276 | else |
---|
277 | AC_MSG_RESULT(okay) |
---|
278 | fi |
---|
279 | |
---|
280 | |
---|
281 | CFLAGS="$CFLAGS -D_REENTRANT" |
---|
282 | |
---|
283 | AC_OUTPUT([ |
---|
284 | Makefile |
---|
285 | gal/Makefile |
---|
286 | gal/a11y/Makefile |
---|
287 | gal/a11y/e-text/Makefile |
---|
288 | gal/a11y/e-table/Makefile |
---|
289 | gal/util/Makefile |
---|
290 | gal/widgets/Makefile |
---|
291 | gal/e-text/Makefile |
---|
292 | gal/e-table/Makefile |
---|
293 | gal/menus/Makefile |
---|
294 | gal/shortcut-bar/Makefile |
---|
295 | tests/Makefile |
---|
296 | docs/Makefile |
---|
297 | art/Makefile |
---|
298 | po/Makefile.in |
---|
299 | gal.spec |
---|
300 | gal-2.0.pc |
---|
301 | stamp.h |
---|
302 | ]) |
---|