1 | AC_INIT(README) |
---|
2 | AM_CONFIG_HEADER(config.h) |
---|
3 | AM_INIT_AUTOMAKE(gal,0.24) |
---|
4 | |
---|
5 | AM_MAINTAINER_MODE |
---|
6 | AM_ACLOCAL_INCLUDE(macros) |
---|
7 | |
---|
8 | dnl version to mangle into lib names and header installation dir |
---|
9 | GAL_API_VERSION=1.0 |
---|
10 | AC_SUBST(GAL_API_VERSION) |
---|
11 | |
---|
12 | dnl libtool versioning |
---|
13 | |
---|
14 | dnl gal-0.24 = 0 |
---|
15 | dnl increment if any interfaces have been added; set to 0 |
---|
16 | dnl if any interfaces have been removed. removal has |
---|
17 | dnl precedence over adding, so set to 0 if both happened. |
---|
18 | GAL_AGE=0 |
---|
19 | |
---|
20 | dnl gal-0.24 = 0 |
---|
21 | dnl increment any time the source changes; set to |
---|
22 | dnl 0 if you increment CURRENT |
---|
23 | GAL_REVISION=0 |
---|
24 | |
---|
25 | dnl gal-0.24 = 23 |
---|
26 | dnl increment if the interface has additions, changes, removals. |
---|
27 | GAL_CURRENT=23 |
---|
28 | |
---|
29 | AC_SUBST(GAL_CURRENT) |
---|
30 | AC_SUBST(GAL_REVISION) |
---|
31 | AC_SUBST(GAL_AGE) |
---|
32 | |
---|
33 | AC_ISC_POSIX |
---|
34 | AC_PROG_CC |
---|
35 | AC_PROG_YACC |
---|
36 | AM_PROG_LEX |
---|
37 | AC_STDC_HEADERS |
---|
38 | AC_ARG_PROGRAM |
---|
39 | AM_PROG_LIBTOOL |
---|
40 | |
---|
41 | AM_PROG_XML_I18N_TOOLS |
---|
42 | |
---|
43 | GNOME_INIT |
---|
44 | |
---|
45 | if test -f $srcdir/po/Makefile.in.in ; then |
---|
46 | cp $srcdir/po/Makefile.in.in $srcdir/po/Makefile.in.in.bak |
---|
47 | sed -e "s/\$(PACKAGE).mo/\$(PACKAGE)-\$(VERSION).mo/" $srcdir/po/Makefile.in.in.bak > $srcdir/po/Makefile.in.in |
---|
48 | else |
---|
49 | AC_MSG_ERROR([ |
---|
50 | "" |
---|
51 | "Can not find Makefile: $srcdir/po/Makefile.in.in"]) |
---|
52 | fi |
---|
53 | |
---|
54 | ## this should come after `AC_PROG_CC' |
---|
55 | GNOME_COMPILE_WARNINGS |
---|
56 | GNOME_X_CHECKS |
---|
57 | GNOME_XML_CHECK |
---|
58 | |
---|
59 | AC_DEFINE_UNQUOTED(GNOME_EXPLICIT_TRANSLATION_DOMAIN, "${PACKAGE}-${VERSION}") |
---|
60 | |
---|
61 | dnl |
---|
62 | dnl alloca tests |
---|
63 | dnl test for both ac_cv_header_alloca_h and ac_cv_working_alloca_h so |
---|
64 | dnl we're compatible with both autoconf 2.1X and autoconf >= 2.50 |
---|
65 | dnl; |
---|
66 | AC_FUNC_ALLOCA |
---|
67 | if test X$ac_cv_working_alloca_h = Xyes || \ |
---|
68 | test X$ac_cv_header_alloca_h = Xyes ; then |
---|
69 | GAL_HAVE_ALLOCA_H=1 |
---|
70 | else |
---|
71 | GAL_HAVE_ALLOCA_H=0 |
---|
72 | fi |
---|
73 | AC_SUBST(GAL_HAVE_ALLOCA_H) |
---|
74 | |
---|
75 | AC_SUBST(CFLAGS) |
---|
76 | AC_SUBST(CPPFLAGS) |
---|
77 | AC_SUBST(LDFLAGS) |
---|
78 | |
---|
79 | ALL_LINGUAS="az ca cs da de el en_GB es eu fi fr gl hu it ja ko lt ms nn no pl pt pt_BR ro ru sk sv ta tr uk zh_CN zh_TW" |
---|
80 | AM_GNOME_GETTEXT |
---|
81 | |
---|
82 | gnomelocaledir='${prefix}/${DATADIRNAME}/locale' |
---|
83 | AC_SUBST(gnomelocaledir) |
---|
84 | |
---|
85 | dnl ****************************** |
---|
86 | dnl gnome-xml checking |
---|
87 | dnl ****************************** |
---|
88 | AC_MSG_CHECKING(for libxml (aka gnome-xml) libraries 1.8.8 <= version < 2.0.0) |
---|
89 | if xml-config --libs > /dev/null 2>&1; then |
---|
90 | vers=`xml-config --version | sed -e "s/libxml //" | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` |
---|
91 | if test "$vers" -ge 1008008; then |
---|
92 | if test "$vers" -lt 2000000; then |
---|
93 | AC_MSG_RESULT(found) |
---|
94 | else |
---|
95 | AC_MSG_ERROR(This version of GAL does not support libxml (aka gnome-xml) 2.x.x yet.) |
---|
96 | fi |
---|
97 | else |
---|
98 | AC_MSG_ERROR(You need at least libxml (aka gnome-xml) 1.8.8 for this version of GAL.) |
---|
99 | fi |
---|
100 | else |
---|
101 | AC_MSG_ERROR(Did not find libxml (aka gnome-xml) installed) |
---|
102 | fi |
---|
103 | |
---|
104 | dnl ****************************** |
---|
105 | dnl iconv checking |
---|
106 | dnl ****************************** |
---|
107 | have_iconv=no |
---|
108 | AC_ARG_WITH(libiconv, [ --with-libiconv Prefix where libiconv is installed]) |
---|
109 | case $withval in |
---|
110 | /*) |
---|
111 | ICONV_CFLAGS="-I$withval/include" |
---|
112 | ICONV_LIBS="-L$withval/lib" |
---|
113 | ;; |
---|
114 | esac |
---|
115 | |
---|
116 | save_CFLAGS="$CFLAGS" |
---|
117 | save_LIBS="$LIBS" |
---|
118 | CFLAGS="$CFLAGS $ICONV_CFLAGS" |
---|
119 | LIBS="$LIBS $ICONV_LIBS -liconv" |
---|
120 | AC_CACHE_CHECK(for iconv in -liconv, ac_cv_libiconv, AC_TRY_LINK([ |
---|
121 | #include <iconv.h> |
---|
122 | ], [ |
---|
123 | iconv_t cd; |
---|
124 | cd = iconv_open ("UTF-8", "ISO-8859-1"); |
---|
125 | ], ac_cv_libiconv=yes, ac_cv_libiconv=no)) |
---|
126 | if test $ac_cv_libiconv = yes; then |
---|
127 | ICONV_LIBS="$ICONV_LIBS -liconv" |
---|
128 | have_iconv=yes |
---|
129 | else |
---|
130 | CFLAGS="$save_CFLAGS" |
---|
131 | LIBS="$save_LIBS" |
---|
132 | AC_CHECK_FUNC(iconv, have_iconv=yes, have_iconv=no) |
---|
133 | fi |
---|
134 | |
---|
135 | if test $have_iconv = yes; then |
---|
136 | if test $ac_cv_libiconv = no; then |
---|
137 | AC_CHECK_FUNCS(gnu_get_libc_version) |
---|
138 | fi |
---|
139 | AC_CACHE_CHECK([if iconv() handles UTF-8], ac_cv_libiconv_utf8, AC_TRY_RUN([ |
---|
140 | #include <iconv.h> |
---|
141 | #include <stdlib.h> |
---|
142 | #include <string.h> |
---|
143 | #ifdef HAVE_GNU_GET_LIBC_VERSION |
---|
144 | #include <gnu/libc-version.h> |
---|
145 | #endif |
---|
146 | |
---|
147 | int main (int argc, char **argv) |
---|
148 | { |
---|
149 | const char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C"; |
---|
150 | const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"; |
---|
151 | char *transbuf = malloc (10), *trans = transbuf; |
---|
152 | iconv_t cd; |
---|
153 | size_t jp_len = strlen (jp), utf8_len = 10; |
---|
154 | size_t utf8_real_len = strlen (utf8); |
---|
155 | |
---|
156 | #ifdef HAVE_GNU_GET_LIBC_VERSION |
---|
157 | /* glibc 2.1.2's iconv is broken in hard to test ways. */ |
---|
158 | if (!strcmp (gnu_get_libc_version (), "2.1.2")) |
---|
159 | exit (1); |
---|
160 | #endif |
---|
161 | |
---|
162 | cd = iconv_open ("UTF-8", "ISO-2022-JP"); |
---|
163 | if (cd == (iconv_t) -1) |
---|
164 | exit (1); |
---|
165 | if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0) |
---|
166 | exit (1); |
---|
167 | if (memcmp (utf8, transbuf, utf8_real_len) != 0) |
---|
168 | exit (1); |
---|
169 | |
---|
170 | exit (0); |
---|
171 | }], ac_cv_libiconv_utf8=yes, [ac_cv_libiconv_utf8=no; have_iconv=no], [ac_cv_libiconv_utf8=no; have_iconv=no])) |
---|
172 | fi |
---|
173 | |
---|
174 | if test "$have_iconv" = no; then |
---|
175 | AC_MSG_ERROR([You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv]) |
---|
176 | fi |
---|
177 | AC_SUBST(ICONV_CFLAGS) |
---|
178 | AC_SUBST(ICONV_LIBS) |
---|
179 | |
---|
180 | CFLAGS="$CFLAGS -I$srcdir" |
---|
181 | |
---|
182 | AC_MSG_CHECKING(preferred charset formats for system iconv) |
---|
183 | AC_TRY_RUN([ |
---|
184 | #define CONFIGURE_IN |
---|
185 | #include "iconv-detect.c" |
---|
186 | ],[ |
---|
187 | AC_MSG_RESULT(found) |
---|
188 | ],[ |
---|
189 | AC_MSG_RESULT(not found) |
---|
190 | AC_WARN([ |
---|
191 | *** The iconv-detect program was unable to determine the |
---|
192 | *** preferred charset formats recognized by your system |
---|
193 | *** iconv library. It is suggested that you install a |
---|
194 | *** working iconv library such as the one found at |
---|
195 | *** ftp://ftp.gnu.org/pub/gnu/libiconv |
---|
196 | ]) |
---|
197 | ]) |
---|
198 | |
---|
199 | CFLAGS="$save_CFLAGS" |
---|
200 | LIBS="$save_LIBS" |
---|
201 | |
---|
202 | dnl Check to see if strftime supports the use of %l and %k |
---|
203 | |
---|
204 | AC_MSG_CHECKING(for %l and %k support in strftime) |
---|
205 | AC_TRY_RUN([ |
---|
206 | #include <string.h> |
---|
207 | #include <time.h> |
---|
208 | |
---|
209 | int main(int argc, char **argv) |
---|
210 | { |
---|
211 | char buf[10]; |
---|
212 | time_t rawtime; |
---|
213 | struct tm *timeinfo; |
---|
214 | |
---|
215 | time(&rawtime); |
---|
216 | timeinfo=localtime(&rawtime); |
---|
217 | strftime(buf, 10, "%l %k", timeinfo); |
---|
218 | |
---|
219 | if (strstr(buf, "l") || strstr(buf, "k")) |
---|
220 | exit(1); |
---|
221 | else |
---|
222 | exit(0); |
---|
223 | }],[ |
---|
224 | AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k]) |
---|
225 | ac_cv_lkstrftime=yes |
---|
226 | ],ac_cv_lkstrftime=no,ac_cv_lkstrftime=no]) |
---|
227 | AC_MSG_RESULT($ac_cv_lkstrftime) |
---|
228 | |
---|
229 | dnl Check for nl_langinfo and CODESET |
---|
230 | |
---|
231 | AC_MSG_CHECKING([for nl_langinfo (CODESET)]) |
---|
232 | AC_TRY_COMPILE([#include <langinfo.h>], |
---|
233 | [char *codeset = nl_langinfo (CODESET);], |
---|
234 | AC_DEFINE(HAVE_CODESET,1,[Have nl_langinfo (CODESET)]) |
---|
235 | have_codeset=yes, |
---|
236 | have_codeset=no) |
---|
237 | AC_MSG_RESULT($have_codeset) |
---|
238 | |
---|
239 | dnl ****************************** |
---|
240 | dnl GnomePrint checking |
---|
241 | dnl ****************************** |
---|
242 | AC_MSG_CHECKING(for GnomePrint libraries >= 0.25) |
---|
243 | if gnome-config --libs print > /dev/null 2>&1; then |
---|
244 | vers=`gnome-config --modversion print | sed -e "s/gnome-print-//" -e 's/cvs$//' -e 's/pre$//' | \ |
---|
245 | awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'` |
---|
246 | if test "$vers" -ge 25; then |
---|
247 | AC_MSG_RESULT(found) |
---|
248 | else |
---|
249 | AC_MSG_ERROR(You need at least GNOME print 0.25 for this version of GAL) |
---|
250 | fi |
---|
251 | else |
---|
252 | AC_MSG_ERROR(Did not find GnomePrint installed) |
---|
253 | fi |
---|
254 | |
---|
255 | dnl ****************************** |
---|
256 | dnl LibGlade checking |
---|
257 | dnl ****************************** |
---|
258 | AC_MSG_CHECKING(for Glade libraries >= 0.13) |
---|
259 | if gnome-config --libs libglade > /dev/null 2>&1; then |
---|
260 | vers=`gnome-config --modversion libglade | awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'` |
---|
261 | if test "$vers" -ge 13; then |
---|
262 | AC_MSG_RESULT(found) |
---|
263 | else |
---|
264 | AC_MSG_ERROR(You need at least libglade 0.13 for this version of GAL) |
---|
265 | fi |
---|
266 | else |
---|
267 | AC_MSG_ERROR(Did not find libGlade installed) |
---|
268 | fi |
---|
269 | |
---|
270 | dnl ****************************** |
---|
271 | dnl gtk+ checking |
---|
272 | dnl ****************************** |
---|
273 | AC_MSG_CHECKING(for GTK >= 1.2.7) |
---|
274 | if $GTK_CONFIG --version > /dev/null 2>&1; then |
---|
275 | dnl We need the "%d" in order not to get e-notation on hpux. |
---|
276 | vers=`"$GTK_CONFIG" --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` |
---|
277 | if test "$vers" -ge 1002007; then |
---|
278 | AC_MSG_RESULT(found) |
---|
279 | else |
---|
280 | AC_MSG_ERROR(You need at least GTK+ 1.2.7 for this version of GAL) |
---|
281 | fi |
---|
282 | else |
---|
283 | AC_MSG_ERROR(Did not find GTK+ installed) |
---|
284 | fi |
---|
285 | |
---|
286 | dnl *************************************** |
---|
287 | |
---|
288 | dnl ****************************** |
---|
289 | dnl Gnome-VFS checking |
---|
290 | dnl ****************************** |
---|
291 | AC_MSG_CHECKING(for GNOME-VFS) |
---|
292 | if gnome-config --libs vfs > /dev/null 2>&1; then |
---|
293 | vers=`gnome-config --modversion vfs` |
---|
294 | case $vers |
---|
295 | in |
---|
296 | gnome-vfs-0.[012]) vfs_ok=false ;; |
---|
297 | *) vfs_ok=true ;; |
---|
298 | esac |
---|
299 | else |
---|
300 | vfs_ok=false |
---|
301 | fi |
---|
302 | |
---|
303 | if $vfs_ok; then |
---|
304 | AC_MSG_RESULT($vers) |
---|
305 | |
---|
306 | GNOME_VFS_LIBS="`gnome-config --libs vfs`" |
---|
307 | GNOME_VFS_CFLAGS="`gnome-config --cflags vfs`" |
---|
308 | AC_SUBST(GNOME_VFS_LIBS) |
---|
309 | AC_SUBST(GNOME_VFS_CFLAGS) |
---|
310 | |
---|
311 | have_vfs=true |
---|
312 | else |
---|
313 | AC_MSG_RESULT(Gnome-VFS not found. Not compiling test-tree-2.) |
---|
314 | have_vfs=false |
---|
315 | fi |
---|
316 | AM_CONDITIONAL(GAL_HAVE_VFS,$have_vfs) |
---|
317 | |
---|
318 | dnl |
---|
319 | dnl Gtk-doc |
---|
320 | dnl |
---|
321 | AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) |
---|
322 | |
---|
323 | if test x$enable_gtk_doc = xauto ; then |
---|
324 | if test x$GTKDOC = xtrue ; then |
---|
325 | enable_gtk_doc=yes |
---|
326 | else |
---|
327 | enable_gtk_doc=no |
---|
328 | fi |
---|
329 | fi |
---|
330 | dnl NOTE: We need to use a separate automake conditional for this |
---|
331 | dnl to make this work with the tarballs. |
---|
332 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
333 | |
---|
334 | AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) |
---|
335 | if test "x$with_html_dir" = "x" ; then |
---|
336 | HTML_DIR='${datadir}/gal/html' |
---|
337 | else |
---|
338 | HTML_DIR=$with_html_dir |
---|
339 | fi |
---|
340 | |
---|
341 | AC_SUBST(HTML_DIR) |
---|
342 | |
---|
343 | dnl |
---|
344 | dnl For the various galConf.sh scripts generation. |
---|
345 | dnl |
---|
346 | GAL_LIBDIR='-L${libdir}' |
---|
347 | GAL_INCLUDEDIR=" -I${includedir}/gal-1.0 `$GNOME_CONFIG --cflags gnomeui gdk_pixbuf print libglade gnomecanvaspixbuf` $ICONV_CFLAGS" |
---|
348 | GAL_LIBS="-lgal `$GNOME_CONFIG --libs gnomeui gdk_pixbuf print libglade gnomecanvaspixbuf` $ICONV_LIBS" |
---|
349 | AC_SUBST(GAL_LIBDIR) |
---|
350 | AC_SUBST(GAL_INCLUDEDIR) |
---|
351 | AC_SUBST(GAL_LIBS) |
---|
352 | |
---|
353 | EXTRA_GNOME_LIBS=`gnome-config --libs gnomeui print libart libglade gdk_pixbuf gnomecanvaspixbuf` |
---|
354 | EXTRA_GNOME_CFLAGS=`gnome-config --cflags gnomeui print libart libglade gdk_pixbuf gnomecanvaspixbuf` |
---|
355 | AC_SUBST(EXTRA_GNOME_LIBS) |
---|
356 | AC_SUBST(EXTRA_GNOME_CFLAGS) |
---|
357 | |
---|
358 | CFLAGS="$CFLAGS -D_REENTRANT" |
---|
359 | |
---|
360 | AC_OUTPUT([ |
---|
361 | Makefile |
---|
362 | intl/Makefile |
---|
363 | po/Makefile.in |
---|
364 | macros/Makefile |
---|
365 | gal/Makefile |
---|
366 | gal/util/Makefile |
---|
367 | gal/unicode/Makefile |
---|
368 | gal/widgets/Makefile |
---|
369 | gal/e-text/Makefile |
---|
370 | gal/e-paned/Makefile |
---|
371 | gal/e-table/Makefile |
---|
372 | gal/menus/Makefile |
---|
373 | gal/shortcut-bar/Makefile |
---|
374 | tests/Makefile |
---|
375 | docs/Makefile |
---|
376 | art/Makefile |
---|
377 | gal.spec |
---|
378 | gal.pc |
---|
379 | stamp.h |
---|
380 | ],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) |
---|