1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl w3m autoconf macros
15 # ----------------------------------------------------------------
17 # ----------------------------------------------------------------
18 AC_DEFUN([AC_W3M_VERSION],
19 [AC_SUBST(CURRENT_VERSION)
20 cvsver=`$AWK '\$[1] ~ /Id:/ { print \$[3]}' $srcdir/ChangeLog`
21 sed -e 's/define CURRENT_VERSION "\(.*\)+cvs/define CURRENT_VERSION "\1+cvs-'$cvsver'/' $srcdir/version.c.in > version.c
22 CURRENT_VERSION=`sed -n 's/.*define CURRENT_VERSION *"w3m\/\(.*\)".*$/\1/p' version.c`])
24 # ----------------------------------------------------------------
26 # ----------------------------------------------------------------
27 AC_DEFUN([AC_W3M_COLOR],
29 AC_MSG_CHECKING(if color escape sequence for kterm/pxvt is enabled)
31 [ --disable-color disable color for vt100 terminal],,
33 test x"$enable_color" = xyes && AC_DEFINE(USE_COLOR)
34 AC_MSG_RESULT($enable_color)])
36 # ----------------------------------------------------------------
38 # ----------------------------------------------------------------
39 AC_DEFUN([AC_W3M_ANSI_COLOR],
40 [AC_SUBST(USE_ANSI_COLOR)
41 AC_MSG_CHECKING(if ansi color escape sequence support is enabled)
42 AC_ARG_ENABLE(ansi_color,
43 [ --disable-ansi-color disable ansi color escape sequence],,
44 [enable_ansi_color="$enable_color"])
45 test x"$enable_ansi_color" = xyes && AC_DEFINE(USE_ANSI_COLOR)
46 AC_MSG_RESULT($enable_ansi_color)])
48 # ----------------------------------------------------------------
50 # ----------------------------------------------------------------
51 AC_DEFUN([AC_W3M_BG_COLOR],
52 [AC_SUBST(USE_BG_COLOR)
53 AC_MSG_CHECKING(if background color support is enabled)
54 AC_ARG_ENABLE(bgcolor,
55 [ --disable-bgcolor disable to set background color],,
56 [enable_bgcolor="$enable_color"])
57 test x"$enable_bgcolor" = xyes && AC_DEFINE(USE_BG_COLOR)
58 AC_MSG_RESULT($enable_bgcolor)])
60 # ----------------------------------------------------------------
62 # ----------------------------------------------------------------
63 AC_DEFUN([AC_W3M_MENU],
65 AC_MSG_CHECKING(if popup menu is enabled)
67 [ --disable-menu disable popup menu],,
69 test x"$enable_menu" = xyes && AC_DEFINE(USE_MENU)
70 AC_MSG_RESULT($enable_menu)])
72 # ----------------------------------------------------------------
74 # ----------------------------------------------------------------
75 AC_DEFUN([AC_W3M_MOUSE],
77 AC_MSG_CHECKING(if mouse operation enabled)
79 [ --disable-mouse disable mouse operation],,
81 test x"$enable_mouse" = xyes && AC_DEFINE(USE_MOUSE)
82 AC_MSG_RESULT($enable_mouse)])
84 # ----------------------------------------------------------------
86 # ----------------------------------------------------------------
87 AC_DEFUN([AC_W3M_COOKIE],
89 AC_MSG_CHECKING(if cookie is enabled)
91 [ --disable-cookie disable cookie],,
92 [enable_cookie="yes"])
93 test x"$enable_cookie" = xyes && AC_DEFINE(USE_COOKIE)
94 AC_MSG_RESULT($enable_cookie)])
96 # ----------------------------------------------------------------
98 # ----------------------------------------------------------------
99 AC_DEFUN([AC_W3M_DICT],
101 AC_MSG_CHECKING(if dictionary lookup is enabled)
103 [ --disable-dict disable dictionary lookup (see README.dict)],,
105 test x"$enable_dict" = xyes && AC_DEFINE(USE_DICT)
106 AC_MSG_RESULT($enable_dict)])
108 # ----------------------------------------------------------------
110 # ----------------------------------------------------------------
111 AC_DEFUN([AC_W3M_HISTORY],
112 [AC_SUBST(USE_HISTORY)
113 AC_MSG_CHECKING(if URL history is enabled)
114 AC_ARG_ENABLE(history,
115 [ --disable-history disable URL history],,
116 [enable_history="yes"])
117 test x"$enable_history" = xyes && AC_DEFINE(USE_HISTORY)
118 AC_MSG_RESULT($enable_history)])
120 # ----------------------------------------------------------------
122 # ----------------------------------------------------------------
123 AC_DEFUN([AC_W3M_NNTP],
125 AC_MSG_CHECKING(if nntp is enabled)
127 [ --disable-nntp disable NNTP],,
129 test x"$enable_nntp" = xyes && AC_DEFINE(USE_NNTP)
130 AC_MSG_RESULT($enable_nntp)])
132 # ----------------------------------------------------------------
134 # ----------------------------------------------------------------
135 AC_DEFUN([AC_W3M_GOPHER],
136 [AC_SUBST(USE_GOPHER)
137 AC_MSG_CHECKING(if gopher is enabled)
138 AC_ARG_ENABLE(gopher,
139 [ --enable-gopher enable GOPHER],,
140 [enable_gopher="no"])
141 test x"$enable_gopher" = xyes && AC_DEFINE(USE_GOPHER)
142 AC_MSG_RESULT($enable_gopher)])
144 # ----------------------------------------------------------------
146 # ----------------------------------------------------------------
148 AC_DEFUN([AC_W3M_M17N],
150 AC_SUBST(USE_UNICODE)
153 AC_SUBST(DISPLAY_CHARSET)
154 AC_SUBST(SYSTEM_CHARSET)
155 AC_SUBST(DOCUMENT_CHARSET)
158 WCTARGET=""; WCCFLAGS=""; wcinclude=""; wclib=""
159 AC_MSG_CHECKING(if m17n support is enabled)
161 [ --disable-m17n do not use m17n],,
163 AC_MSG_RESULT($enable_m17n)
164 if test x"$enable_m17n" = xno; then
170 display_charset='WC_CES_US_ASCII'
171 system_charset='WC_CES_US_ASCII'
172 document_charset='WC_CES_US_ASCII'
175 WCTARGET="libwc/libwc.a"
176 WCCFLAGS='-I$(srcdir) -I$(srcdir)/..'
177 wcinclude='-I$(srcdir)/libwc'
178 wclib="-L./libwc -lwc"
179 AC_MSG_CHECKING(if unicode support is enabled)
180 AC_ARG_ENABLE(unicode,
181 [ --disable-unicode do not use unicode],,
182 [enable_unicode="yes"])
183 AC_MSG_RESULT($enable_unicode)
184 if test x"$enable_m17n" = xyes; then
189 if test x"$enable_unicode" = xyes; then
190 WCCFLAGS="-DUSE_UNICODE $WCCFLAGS"
191 if test x"$charset" = xUS-ASCII; then
194 AC_DEFINE(USE_UNICODE)
196 AC_MSG_CHECKING(if message l10n)
197 AC_ARG_ENABLE(messagel10n,
198 [ --enable-messagel10n=LL message l10n instead of NLS],,
199 [enable_messagel10n="no"])
200 if test x$enable_messagel10n = xyes; then
201 enable_messagel10n="ja";
203 AC_MSG_RESULT($enable_messagel10n)
204 if test x$enable_messagel10n = xno; then
207 POSUBST="\$(top_srcdir)/posubst"
208 POLANG="$enable_messagel10n"
210 AC_MSG_CHECKING(if japanese support is enabled)
211 AC_ARG_ENABLE(japanese,
212 [ --enable-japanese=CODE support Japanese CODE=(S|E|J|U)],,
213 [enable_japanese="no"])
214 AC_MSG_RESULT($enable_japanese)
215 if test x"$enable_japanese" = xno; then
219 case "$enable_japanese" in
221 S*) charset=Shift_JIS;;
222 J*) charset=ISO-2022-JP;;
226 display_charset=$charset
227 AC_MSG_CHECKING(which charset is used for display)
229 [ --with-charset=CHARSET],
230 [test x"with_charset" = xyes || display_charset="$with_charset"])
231 AC_MSG_RESULT($display_charset)
232 display_charset=`awk '$[1] == "'$display_charset'" {print $[2]}' $srcdir/charset-list`
233 case "$display_charset" in
235 system_charset=WC_CES_EUC_JP
236 document_charset=WC_CES_EUC_JP
239 system_charset=$display_charset
241 document_charset=WC_CES_EUC_JP
243 WC_CES_ISO_2022_CN|WC_CES_HZ_GB_2312)
244 system_charset=WC_CES_EUC_CN
245 document_charset=WC_CES_EUC_CN
248 system_charset=$display_charset
250 document_charset=WC_CES_EUC_TW
253 system_charset=WC_CES_EUC_KR
254 document_charset=WC_CES_EUC_KR
257 system_charset=$display_charset
258 document_charset=$display_charset
262 W3M_LANGDEF=`echo $w3m_lang | tr 'a-z' 'A-Z'`
263 W3M_LANG=$W3M_LANGDEF
264 AC_DEFINE_UNQUOTED(W3M_LANG, $W3M_LANG)
265 AC_DEFINE_UNQUOTED(WCTARGET, "$WCTARGET")
266 AC_DEFINE_UNQUOTED(WCCFLAGS, "$WCCFLAGS")
267 CFLAGS="$CFLAGS $wcinclude"
268 W3M_LIBS="$W3M_LIBS $wclib"
269 AC_DEFINE_UNQUOTED(DISPLAY_CHARSET, $display_charset)
270 AC_DEFINE_UNQUOTED(SYSTEM_CHARSET, $system_charset)
271 AC_DEFINE_UNQUOTED(DOCUMENT_CHARSET, $document_charset)])
273 # ----------------------------------------------------------------
275 # ----------------------------------------------------------------
276 AC_DEFUN([AC_W3M_KEYMAP],
277 [AC_SUBST(KEYMAP_FILE)
278 AC_MSG_CHECKING(default keymap)
279 AC_ARG_ENABLE(keymap,
280 [ --enable-keymap[=w3m|lynx] default keybind style(w3m or lynx)],,
281 [enable_keymap="w3m"])
282 AC_MSG_RESULT($enable_keymap)
283 case x"$enable_keymap" in
285 KEYMAP_FILE="keybind";;
287 KEYMAP_FILE="keybind_lynx";;
289 AC_MSG_ERROR([keymap should be either w3m or lynx.]);;
292 HELP_FILE=w3mhelp-${enable_keymap}_$w3m_lang.html
293 AC_DEFINE_UNQUOTED(HELP_FILE, "$HELP_FILE")
295 AC_DEFINE_UNQUOTED(KEYBIND, $enable_keymap)])
297 # ----------------------------------------------------------------
299 # ----------------------------------------------------------------
300 AC_DEFUN([AC_W3M_MIGEMO],
301 [AC_SUBST(USE_MIGEMO)
302 AC_SUBST(DEF_MIGEMO_COMMAND)
303 migemo_command="migemo -t egrep /usr/local/share/migemo/migemo-dict"
304 AC_MSG_CHECKING(if migemo is supported with)
306 [ --with-migemo=MIGEMO_COMMAND migemo command],
307 [test x"$with_migemo" = xyes || migemo_command="$with_migemo"])
308 if test "${with_migemo+set}" = set -a "$with_migemo" != "no"; then
309 AC_DEFINE(USE_MIGEMO)
311 AC_MSG_RESULT($migemo_command)
312 AC_DEFINE_UNQUOTED(DEF_MIGEMO_COMMAND, "$migemo_command")])
314 # ----------------------------------------------------------------
316 # ----------------------------------------------------------------
317 AC_DEFUN([AC_W3M_EDITOR],
318 [AC_SUBST(DEF_EDITOR)
319 w3m_editor="/usr/bin/vi"
320 AC_MSG_CHECKING(which editor is used by default)
322 [ --with-editor=EDITOR default editor (/usr/bin/vi)],
323 [w3m_editor="$with_editor"])
324 AC_MSG_RESULT($w3m_editor)
325 AC_DEFINE_UNQUOTED(DEF_EDITOR, "$w3m_editor")])
327 # ----------------------------------------------------------------
329 # ----------------------------------------------------------------
330 AC_DEFUN([AC_W3M_MAILER],
331 [AC_SUBST(DEF_MAILER)
332 w3m_mailer="/usr/bin/mail"
333 AC_MSG_CHECKING(which mailer is used by default)
335 [ --with-mailer=MAILER default mailer (/usr/bin/mail)],
336 [w3m_mailer="$with_mailer"])
337 AC_MSG_RESULT($w3m_mailer)
338 AC_DEFINE_UNQUOTED(DEF_MAILER, "$w3m_mailer")])
340 # ----------------------------------------------------------------
342 # ----------------------------------------------------------------
343 AC_DEFUN([AC_W3M_EXT_BROWSER],
344 [AC_SUBST(DEF_EXT_BROWSER)
345 w3m_browser="/usr/bin/mozilla"
346 AC_MSG_CHECKING(which external browser is used by default)
348 [ --with-browser=BROWSER default browser (/usr/bin/mozilla)],
349 [w3m_browser="$with_browser"])
350 AC_MSG_RESULT($w3m_browser)
351 AC_DEFINE_UNQUOTED(DEF_EXT_BROWSER, "$w3m_browser")])
353 # ----------------------------------------------------------------
355 # ----------------------------------------------------------------
356 AC_DEFUN([AC_W3M_HELP_CGI],
357 [AC_SUBST(USE_HELP_CGI)
358 AC_MSG_CHECKING(if help cgi is enabled)
359 AC_ARG_ENABLE(help_cgi,
360 [ --disable-help-cgi disable help cgi],,
361 [enable_help_cgi="yes"])
362 test x"$enable_help_cgi" = xyes && AC_DEFINE(USE_HELP_CGI)
363 AC_MSG_RESULT($enable_help_cgi)])
365 # ----------------------------------------------------------------
366 # AC_W3M_EXTERNAL_URI_LOADER
367 # ----------------------------------------------------------------
368 AC_DEFUN([AC_W3M_EXTERNAL_URI_LOADER],
369 [AC_SUBST(USE_EXTERNAL_URI_LOADER)
370 AC_MSG_CHECKING(if external URI loader is enabled)
371 AC_ARG_ENABLE(external_uri_loader,
372 [ --disable-external-uri-loader disable external URI loader],,
373 [enable_external_uri_loader="yes"])
374 test x"$enable_external_uri_loader" = xyes && AC_DEFINE(USE_EXTERNAL_URI_LOADER)
375 AC_MSG_RESULT($enable_external_uri_loader)])
377 # ----------------------------------------------------------------
379 # ----------------------------------------------------------------
380 AC_DEFUN([AC_W3M_W3MMAILER],
381 [AC_SUBST(USE_W3MMAILER)
382 AC_MSG_CHECKING(if w3mmail is used)
383 AC_ARG_ENABLE(w3mmailer,
384 [ --disable-w3mmailer disable w3mmailer],,
385 [enable_w3mmailer="$enable_external_uri_loader"])
386 test x"$enable_external_uri_loader" = xno && enable_w3mmailer=no
387 test x"$enable_w3mmailer" = xyes && AC_DEFINE(USE_W3MMAILER)
388 AC_MSG_RESULT($enable_w3mmailer)])
390 # ----------------------------------------------------------------
391 # AC_W3M_EXTLIBS(libs)
392 # ----------------------------------------------------------------
393 AC_DEFUN([AC_W3M_EXTLIBS],
395 AC_MSG_CHECKING(for -l$lib)
397 for dir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib
399 if test -f $dir/lib$lib.a -o -f $dir/lib$lib.so ; then
401 extlib="found at $dir"
405 AC_MSG_RESULT($extlib)])
407 # ----------------------------------------------------------------
409 # ----------------------------------------------------------------
410 AC_DEFUN([AC_W3M_TERMLIB],
411 [AC_MSG_CHECKING(terminal library)
413 [ --with-termlib[=LIBS] terminal library
414 LIBS is space separated list of:
415 terminfo mytinfo termcap ncurses curses],,
416 [with_termlib="yes"])
417 AC_MSG_RESULT($with_termlib)
418 test x"$with_termlib" = xyes && with_termlib="terminfo mytinfo termlib termcap ncurses curses"
419 for lib in $with_termlib; do
420 AC_CHECK_LIB($lib, tgetent, [W3M_LIBS="$W3M_LIBS -l$lib"; break])
424 # ----------------------------------------------------------------
426 # ----------------------------------------------------------------
427 AC_DEFUN([AC_W3M_GC],
428 [AC_MSG_CHECKING(GC library exists)
431 [ --with-gc[=PREFIX] libgc PREFIX],
432 [test x"$with_gc" = xno && AC_MSG_ERROR([You can not build w3m without gc])],
434 AC_MSG_RESULT($with_gc)
435 test x"$with_gc" = xyes && with_gc="/usr /usr/local ${HOME}"
436 unset ac_cv_header_gc_h
437 AC_CHECK_HEADER(gc.h)
438 if test x"$ac_cv_header_gc_h" = xno; then
439 AC_MSG_CHECKING(GC header location)
440 AC_MSG_RESULT($with_gc)
442 for dir in $with_gc; do
443 for inc in include include/gc; do
445 CPPFLAGS="$CPPFLAGS -I$dir/$inc"
446 AC_MSG_CHECKING($dir/$inc)
447 unset ac_cv_header_gc_h
448 AC_CHECK_HEADER(gc.h, [gcincludedir="$dir/$inc"; CFLAGS="$CFLAGS -I$dir/$inc"; break])
451 if test x"$gcincludedir" != xno; then
455 if test x"$gcincludedir" = xno; then
456 AC_MSG_ERROR([gc.h not found])
459 unset ac_cv_lib_gc_GC_init
460 AC_CHECK_LIB(gc, GC_init, [LIBGC="-lgc"])
461 if test x"$ac_cv_lib_gc_GC_init" = xno; then
462 AC_MSG_CHECKING(GC library location)
463 AC_MSG_RESULT($with_gc)
465 for dir in $with_gc; do
467 LDFLAGS="$LDFLAGS -L$dir/lib"
468 AC_MSG_CHECKING($dir)
469 unset ac_cv_lib_gc_GC_init
470 AC_CHECK_LIB(gc, GC_init, [gclibdir="$dir/lib"; LIBGC="-L$dir/lib -lgc"; break])
473 if test x"$gclibdir" = xno; then
474 AC_MSG_ERROR([libgc not found])
478 # ----------------------------------------------------------------
479 # AC_W3M_SSL_DIGEST_AUTH
480 # ----------------------------------------------------------------
481 AC_DEFUN([AC_W3M_SSL_DIGEST_AUTH],
483 AC_SUBST(USE_SSL_VERIFY)
484 AC_MSG_CHECKING(if SSL is suported)
486 [ --with-ssl[=PREFIX] support https protocol],,
488 AC_MSG_RESULT($with_ssl)
489 if test x"$with_ssl" != xno; then
490 PKG_CHECK_MODULES(SSL, openssl,,[
491 AC_MSG_CHECKING(for SSL library/header)
492 test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
493 AC_MSG_RESULT($with_ssl)
496 if test -f "$dir/include/openssl/ssl.h"; then
497 SSL_CFLAGS="$SSL_CFLAGS -I$dir/include/openssl"
498 if test "$dir" != "/usr"; then
499 SSL_CFLAGS="$SSL_CFLAGS -I$dir/include"
501 elif test "$dir" != "/usr" -a -f "$dir/include/ssl.h"; then
502 SSL_CFLAGS="$SSL_CFLAGS -I$dir/include"
504 if test "$dir" != "/usr" -a -f "$dir/lib/libssl.a"; then
505 SSL_LIBS="$SSL_LIBS -L$dir/lib"
509 AC_CHECK_LIB(ssl, SSL_new,
510 [w3m_ssl="found"; CFLAGS="$CFLAGS $SSL_CFLAGS" W3M_LIBS="$W3M_LIBS $SSL_LIBS -lssl -lcrypto"],
511 [w3m_ssl="not found"],
512 [$SSL_LIBS -lcrypto])
514 if test x"$w3m_ssl" = xfound; then
516 AC_MSG_CHECKING(if SSL certificate verify is enabled)
517 AC_ARG_ENABLE(sslverify,
518 [ --disable-sslverify verify SSL certificate],,
519 [enable_sslverify="yes"])
520 test x"$enable_sslverify" = xyes && AC_DEFINE(USE_SSL_VERIFY)
521 AC_MSG_RESULT($enable_sslverify)
524 AC_SUBST(USE_DIGEST_AUTH)
525 AC_MSG_CHECKING(if digest auth is enabled)
526 AC_ARG_ENABLE(digest_auth,
527 [ --disable-digest-auth disable digest auth],,
528 [enable_digest_auth="yes"])
529 if test x"$enable_digest_auth" = xyes -a x"$w3m_ssl" = xfound; then
530 AC_DEFINE(USE_DIGEST_AUTH)
532 enable_digest_auth="no"
534 AC_MSG_RESULT($enable_digest_auth)
537 # ----------------------------------------------------------------
539 # ----------------------------------------------------------------
540 AC_DEFUN([AC_W3M_ALARM],
542 AC_MSG_CHECKING(if alarm is enabled)
544 [ --disable-alarm disable alarm],,
545 [enable_alarm="yes"])
546 AC_MSG_RESULT($enable_alarm)
547 if test x"$enable_alarm" = xyes; then
550 #include <signal.h>],
553 [AC_DEFINE(USE_ALARM)])
556 # ----------------------------------------------------------------
557 # AC_W3M_CHECK_VER(name, version, major, minor, micro,
558 # action-if-ok, message-if-badver, action-if-nover)
559 # ----------------------------------------------------------------
560 AC_DEFUN([AC_W3M_CHECK_VER],
562 if test x"$version" != x; then
563 AC_MSG_CHECKING($1 version)
564 AC_MSG_RESULT($version)
565 set -- `echo "$version" | sed 's/[[^0-9]]/ /g'`
566 if test "$[1]" -ne "$3" -o "$[2]" -lt "$4" || test "$[2]" -eq "$4" -a "$[3]" -lt "$5"; then
567 AC_MSG_WARN([$1 is too old. Install $1 (version >= $3.$4.$5)])
573 AC_MSG_WARN([$1 is not installed. Install $1 (version >= $3.$4.$5)])
577 # ----------------------------------------------------------------
579 # ----------------------------------------------------------------
580 AC_DEFUN([AC_W3M_IMAGE],
582 AC_SUBST(USE_W3MIMG_X11)
583 AC_SUBST(USE_W3MIMG_FB)
584 AC_SUBST(W3MIMGDISPLAY_SETUID)
585 AC_SUBST(INSTALL_W3MIMGDISPLAY)
586 INSTALL_W3MIMGDISPLAY='${INSTALL_PROGRAM}'
587 AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY)
588 AC_SUBST(USE_GDKPIXBUF)
594 AC_SUBST(IMGX11CFLAGS)
595 AC_SUBST(IMGX11LDFLAGS)
596 AC_SUBST(IMGFBCFLAGS)
597 AC_SUBST(IMGFBLDFLAGS)
598 AC_MSG_CHECKING(if image is enabled)
600 [ --enable-image[=DEVS] enable inline image handler for DEVS
601 DEVS may be comma separeted: x11,fb,fb+s
602 default: autodetected.
603 'no' means disable inline image],,
604 [enable_image="yes"])
605 AC_MSG_RESULT($enable_image)
606 if test x"$enable_image" != xno; then
608 if test x"$enable_image" = xyes; then
612 if test -c /dev/fb0; then
617 save_ifs="$IFS"; IFS=",";
618 for img in $enable_image; do
623 AC_DEFINE(W3MIMGDISPLAY_SETUID)
624 INSTALL_W3MIMGDISPLAY='${INSTALL} -o root -m 4755 -s'
625 AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY);;
631 AC_MSG_CHECKING(image library)
632 AC_ARG_WITH(imagelib,
633 [ --with-imagelib=IMAGELIBS image library
634 IMAGELIBS may be space separeted list of:
635 gtk2 gdk-pixbuf imlib imlib2],,
637 [with_imagelib="yes"])
638 if test x"$with_imagelib" = xyes; then
639 with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
641 AC_MSG_RESULT($with_imagelib)
646 for imagelib in $with_imagelib
651 if test x"$IMLIB_CONFIG" = x; then
652 IMLIB_CONFIG=imlib-config
656 if test x"$IMLIB2_CONFIG" = x; then
657 IMLIB2_CONFIG=imlib2-config
661 if test x"$GDKPIXBUF_CONFIG" = x; then
662 GDKPIXBUF_CONFIG=gdk-pixbuf-config
666 if test x"$PKG_CONFIG" = x; then
667 PKG_CONFIG=pkg-config
674 if test x"$with_gtk2" = xyes; then
675 AC_W3M_CHECK_VER([GdkPixbuf],
676 [`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`],
678 [have_gdkpixbuf="yes"; have_gtk2="yes"],
679 [have_gdkpixbuf="no"; have_gtk2="no"])
681 if test x"$with_gdkpixbuf" = xyes; then
682 if test x"$have_gdkpixbuf" != xyes; then
683 AC_W3M_CHECK_VER([GdkPixbuf],
684 [`$GDKPIXBUF_CONFIG --version 2>/dev/null`],
686 [have_gdkpixbuf="yes"],
687 [have_gdkpixbuf="no"])
690 if test x"$with_imlib" = xyes; then
691 AC_W3M_CHECK_VER([Imlib],
692 [`$IMLIB_CONFIG --version 2>/dev/null`],
697 if test x"$with_imlib2" = xyes; then
698 AC_W3M_CHECK_VER([Imlib2],
699 [`$IMLIB2_CONFIG --version 2>/dev/null`],
704 if test x"$x11" = xyes; then
705 if test x"$have_gtk2" = xyes; then
706 AC_DEFINE(USE_W3MIMG_X11)
707 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
709 AC_DEFINE(USE_GDKPIXBUF)
711 IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
712 IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
713 elif test x"$have_gdkpixbuf" = xyes; then
714 AC_DEFINE(USE_W3MIMG_X11)
715 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
717 AC_DEFINE(USE_GDKPIXBUF)
718 IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
719 IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
720 elif test x"$have_imlib" = xyes; then
721 AC_DEFINE(USE_W3MIMG_X11)
722 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
725 IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
726 IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
728 elif test x"$have_imlib2" = xyes; then
729 AC_DEFINE(USE_W3MIMG_X11)
730 IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
732 AC_DEFINE(USE_IMLIB2)
733 IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
734 IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
736 AC_MSG_WARN([unable to build w3mimgdisplay with X11 support])
739 if test x"$fb" = xyes; then
740 if test x"$have_gtk2" = xyes; then
741 AC_DEFINE(USE_W3MIMG_FB)
742 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
743 IMGTARGETS="${IMGTARGETS} fb"
744 AC_DEFINE(USE_GDKPIXBUF)
746 IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
747 IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
748 elif test x"$have_gdkpixbuf" = xyes; then
749 AC_DEFINE(USE_W3MIMG_FB)
750 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
751 IMGTARGETS="${IMGTARGETS} fb"
752 AC_DEFINE(USE_GDKPIXBUF)
753 IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
754 IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
755 elif test x"$have_imlib2" = xyes; then
756 AC_DEFINE(USE_W3MIMG_FB)
757 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
758 IMGTARGETS="${IMGTARGETS} fb"
759 AC_DEFINE(USE_IMLIB2)
760 IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
761 IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
762 IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
764 AC_MSG_WARN([unable to build w3mimgdisplay with FB support])
767 AC_DEFINE(IMGTARGETS, "$IMGTARGETS")
768 AC_DEFINE(IMGOBJS, "$IMGOBJS")
769 AC_DEFINE(IMGX11CFLAGS, "$IMGX11CFLAGS")
770 AC_DEFINE(IMGX11LDFLAGS, "$IMGX11LDFLAGS")
771 AC_DEFINE(IMGFBCFLAGS, "$IMGFBCFLAGS")
772 AC_DEFINE(IMGFBLDFLAGS, "$IMGLDFLAGS")
774 # ----------------------------------------------------------------
776 # ----------------------------------------------------------------
777 AC_DEFUN([AC_W3M_XFACE],
779 AC_MSG_CHECKING(if xface is enabled)
781 [ --disable-xface disable xface support],,
782 [enable_xface="$enable_image"])
783 test x"$enable_xface" = xyes && AC_DEFINE(USE_XFACE)
784 AC_MSG_RESULT($enable_xface)
785 AC_CHECK_PROG(uncompface, uncompface, "yes", "no")
786 test "$uncompface" = "no" && AC_MSG_WARN([uncompface is not installed.])
789 # ----------------------------------------------------------------
791 # ----------------------------------------------------------------
792 AC_DEFUN([AC_W3M_IPv6],
793 [AC_MSG_CHECKING(if IPv6 support is enabled)
795 [ --disable-ipv6 disable IPv6],,
797 AC_MSG_RESULT($enable_ipv6)
799 if test x"$enable_ipv6" = xyes; then
800 AC_MSG_CHECKING(if IPv6 API available)
802 AC_CHECK_FUNC(getaddrinfo,
805 if test x"$enable_ipv6" = xno; then
806 AC_MSG_CHECKING(for libinet6)
807 for dir in /usr/local/v6/lib /usr/local/lib /usr/lib
809 if test -f $dir/libinet6.a; then
810 if test $dir != "/usr/lib"; then
811 W3M_LIBS="$W3M_LIBS -L$dir"
813 AC_CHECK_LIB(inet6, getaddrinfo,
815 use_libinet6="found"; W3M_LIBS="$W3M_LIBS -linet6"; break],
816 [use_libinet6="not found"])
819 AC_MSG_RESULT($use_libinet6)
821 if test x"$enable_ipv6" = xyes; then
822 AC_SUBST(HAVE_OLD_SS_FAMILY)
823 AC_MSG_CHECKING(if struct sockaddr_storage has an ss_family member)
825 #include <sys/types.h>
826 #include <sys/socket.h>
828 struct sockaddr_storage ss;
829 int i = ss.ss_family;
831 [AC_MSG_RESULT(yes)],
833 #include <sys/types.h>
834 #include <sys/socket.h>
837 struct sockaddr_storage ss;
838 int i = ss.__ss_family;
840 [AC_MSG_RESULT(no, but __ss_family exists)
841 AC_DEFINE(HAVE_OLD_SS_FAMILY)],
843 AC_MSG_WARN(IPv6 support is disabled)
847 if test x"$enable_ipv6" = xyes; then
852 # ----------------------------------------------------------------
854 # ----------------------------------------------------------------
855 AC_DEFUN([AC_W3M_SYS_ERRLIST],
856 [AC_SUBST(HAVE_SYS_ERRLIST)
857 AC_MSG_CHECKING(for sys_errlist)
859 changequote(<<,>>)dnl
860 <<extern char *sys_errlist[];>>,
861 <<printf(sys_errlist[0]);>>,
863 [have_sys_errlist="yes"; AC_DEFINE(HAVE_SYS_ERRLIST)],
864 [have_sys_errlist="no"])
865 AC_MSG_RESULT($have_sys_errlist)])
867 # ----------------------------------------------------------------
869 # ----------------------------------------------------------------
870 AC_DEFUN([AC_W3M_SIGSETJMP],
871 [AC_SUBST(HAVE_SIGSETJMP)
872 AC_MSG_CHECKING(for sigsetjmp)
874 [#include <setjmp.h>],
876 if (sigsetjmp(env, 1) != 0) { exit(0); } siglongjmp(env, 1);],
877 [have_sigsetjmp="yes"; AC_DEFINE(HAVE_SIGSETJMP)],
878 [have_sigsetjmp="no"])
879 AC_MSG_RESULT($have_sigsetjmp)])
881 # ----------------------------------------------------------------
882 # AC_W3M_SIGNAL_RETURN
883 # ----------------------------------------------------------------
884 AC_DEFUN([AC_W3M_SIGNAL],
887 AC_SUBST(SIGNAL_RETURN)
888 if test x"$ac_cv_type_signal" = xvoid; then
889 AC_DEFINE(SIGNAL_RETURN,return)
891 AC_DEFINE(SIGNAL_RETURN,return 0)
894 # lib-prefix.m4 serial 3 (gettext-0.13)
895 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
896 dnl This file is free software, distributed under the terms of the GNU
897 dnl General Public License. As a special exception to the GNU General
898 dnl Public License, this file may be distributed as part of a program
899 dnl that contains a configuration script generated by Autoconf, under
900 dnl the same distribution terms as the rest of that program.
902 dnl From Bruno Haible.
904 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
905 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
906 dnl require excessive bracketing.
907 ifdef([AC_HELP_STRING],
908 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
909 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
911 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
912 dnl to access previously installed libraries. The basic assumption is that
913 dnl a user will want packages to use other packages he previously installed
914 dnl with the same --prefix option.
915 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
916 dnl libraries, but is otherwise very convenient.
917 AC_DEFUN([AC_LIB_PREFIX],
919 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
920 AC_REQUIRE([AC_PROG_CC])
921 AC_REQUIRE([AC_CANONICAL_HOST])
922 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
923 dnl By default, look in $includedir and $libdir.
925 AC_LIB_WITH_FINAL_PREFIX([
926 eval additional_includedir=\"$includedir\"
927 eval additional_libdir=\"$libdir\"
929 AC_LIB_ARG_WITH([lib-prefix],
930 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
931 --without-lib-prefix don't search for libraries in includedir and libdir],
933 if test "X$withval" = "Xno"; then
936 if test "X$withval" = "X"; then
937 AC_LIB_WITH_FINAL_PREFIX([
938 eval additional_includedir=\"$includedir\"
939 eval additional_libdir=\"$libdir\"
942 additional_includedir="$withval/include"
943 additional_libdir="$withval/lib"
947 if test $use_additional = yes; then
948 dnl Potentially add $additional_includedir to $CPPFLAGS.
950 dnl 1. if it's the standard /usr/include,
951 dnl 2. if it's already present in $CPPFLAGS,
952 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
953 dnl 4. if it doesn't exist as a directory.
954 if test "X$additional_includedir" != "X/usr/include"; then
956 for x in $CPPFLAGS; do
957 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
958 if test "X$x" = "X-I$additional_includedir"; then
963 if test -z "$haveit"; then
964 if test "X$additional_includedir" = "X/usr/local/include"; then
965 if test -n "$GCC"; then
971 if test -z "$haveit"; then
972 if test -d "$additional_includedir"; then
973 dnl Really add $additional_includedir to $CPPFLAGS.
974 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
979 dnl Potentially add $additional_libdir to $LDFLAGS.
981 dnl 1. if it's the standard /usr/lib,
982 dnl 2. if it's already present in $LDFLAGS,
983 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
984 dnl 4. if it doesn't exist as a directory.
985 if test "X$additional_libdir" != "X/usr/lib"; then
987 for x in $LDFLAGS; do
988 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
989 if test "X$x" = "X-L$additional_libdir"; then
994 if test -z "$haveit"; then
995 if test "X$additional_libdir" = "X/usr/local/lib"; then
996 if test -n "$GCC"; then
1002 if test -z "$haveit"; then
1003 if test -d "$additional_libdir"; then
1004 dnl Really add $additional_libdir to $LDFLAGS.
1005 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1013 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1014 dnl acl_final_exec_prefix, containing the values to which $prefix and
1015 dnl $exec_prefix will expand at the end of the configure script.
1016 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1018 dnl Unfortunately, prefix and exec_prefix get only finally determined
1019 dnl at the end of configure.
1020 if test "X$prefix" = "XNONE"; then
1021 acl_final_prefix="$ac_default_prefix"
1023 acl_final_prefix="$prefix"
1025 if test "X$exec_prefix" = "XNONE"; then
1026 acl_final_exec_prefix='${prefix}'
1028 acl_final_exec_prefix="$exec_prefix"
1030 acl_save_prefix="$prefix"
1031 prefix="$acl_final_prefix"
1032 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1033 prefix="$acl_save_prefix"
1036 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1037 dnl variables prefix and exec_prefix bound to the values they will have
1038 dnl at the end of the configure script.
1039 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1041 acl_save_prefix="$prefix"
1042 prefix="$acl_final_prefix"
1043 acl_save_exec_prefix="$exec_prefix"
1044 exec_prefix="$acl_final_exec_prefix"
1046 exec_prefix="$acl_save_exec_prefix"
1047 prefix="$acl_save_prefix"
1050 # lib-link.m4 serial 4 (gettext-0.12)
1051 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1052 dnl This file is free software, distributed under the terms of the GNU
1053 dnl General Public License. As a special exception to the GNU General
1054 dnl Public License, this file may be distributed as part of a program
1055 dnl that contains a configuration script generated by Autoconf, under
1056 dnl the same distribution terms as the rest of that program.
1058 dnl From Bruno Haible.
1060 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1061 dnl the libraries corresponding to explicit and implicit dependencies.
1062 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1063 dnl augments the CPPFLAGS variable.
1064 AC_DEFUN([AC_LIB_LINKFLAGS],
1066 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1067 AC_REQUIRE([AC_LIB_RPATH])
1068 define([Name],[translit([$1],[./-], [___])])
1069 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1070 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1071 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1072 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1073 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1074 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1075 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1077 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1078 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1079 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1080 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1082 AC_SUBST([LTLIB]NAME)
1083 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1084 dnl results of this search when this library appears as a dependency.
1090 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1091 dnl searches for libname and the libraries corresponding to explicit and
1092 dnl implicit dependencies, together with the specified include files and
1093 dnl the ability to compile and link the specified testcode. If found, it
1094 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1095 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1096 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1097 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1098 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1100 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1101 AC_REQUIRE([AC_LIB_RPATH])
1102 define([Name],[translit([$1],[./-], [___])])
1103 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1104 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1106 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1108 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1110 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1111 dnl because if the user has installed lib[]Name and not disabled its use
1112 dnl via --without-lib[]Name-prefix, he wants to use it.
1113 ac_save_CPPFLAGS="$CPPFLAGS"
1114 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1116 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1117 ac_save_LIBS="$LIBS"
1118 LIBS="$LIBS $LIB[]NAME"
1119 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1120 LIBS="$ac_save_LIBS"
1122 if test "$ac_cv_lib[]Name" = yes; then
1124 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1125 AC_MSG_CHECKING([how to link with lib[]$1])
1126 AC_MSG_RESULT([$LIB[]NAME])
1129 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1130 dnl $INC[]NAME either.
1131 CPPFLAGS="$ac_save_CPPFLAGS"
1135 AC_SUBST([HAVE_LIB]NAME)
1137 AC_SUBST([LTLIB]NAME)
1142 dnl Determine the platform dependent parameters needed to use rpath:
1143 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1144 dnl hardcode_direct, hardcode_minus_L.
1145 AC_DEFUN([AC_LIB_RPATH],
1147 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1148 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1149 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1150 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1151 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1152 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1153 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1159 libext="$acl_cv_libext"
1160 shlibext="$acl_cv_shlibext"
1161 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1162 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1163 hardcode_direct="$acl_cv_hardcode_direct"
1164 hardcode_minus_L="$acl_cv_hardcode_minus_L"
1165 dnl Determine whether the user wants rpath handling at all.
1166 AC_ARG_ENABLE(rpath,
1167 [ --disable-rpath do not hardcode runtime library paths],
1168 :, enable_rpath=yes)
1171 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1172 dnl the libraries corresponding to explicit and implicit dependencies.
1173 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1174 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1176 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1177 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1178 dnl By default, look in $includedir and $libdir.
1180 AC_LIB_WITH_FINAL_PREFIX([
1181 eval additional_includedir=\"$includedir\"
1182 eval additional_libdir=\"$libdir\"
1184 AC_LIB_ARG_WITH([lib$1-prefix],
1185 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1186 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1188 if test "X$withval" = "Xno"; then
1191 if test "X$withval" = "X"; then
1192 AC_LIB_WITH_FINAL_PREFIX([
1193 eval additional_includedir=\"$includedir\"
1194 eval additional_libdir=\"$libdir\"
1197 additional_includedir="$withval/include"
1198 additional_libdir="$withval/lib"
1202 dnl Search the library and its dependencies in $additional_libdir and
1203 dnl $LDFLAGS. Using breadth-first-seach.
1209 names_already_handled=
1210 names_next_round='$1 $2'
1211 while test -n "$names_next_round"; do
1212 names_this_round="$names_next_round"
1214 for name in $names_this_round; do
1216 for n in $names_already_handled; do
1217 if test "$n" = "$name"; then
1222 if test -z "$already_handled"; then
1223 names_already_handled="$names_already_handled $name"
1224 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1225 dnl or AC_LIB_HAVE_LINKFLAGS call.
1226 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1227 eval value=\"\$HAVE_LIB$uppername\"
1228 if test -n "$value"; then
1229 if test "$value" = yes; then
1230 eval value=\"\$LIB$uppername\"
1231 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1232 eval value=\"\$LTLIB$uppername\"
1233 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1235 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1236 dnl that this library doesn't exist. So just drop it.
1240 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1241 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1246 if test $use_additional = yes; then
1247 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1248 found_dir="$additional_libdir"
1249 found_so="$additional_libdir/lib$name.$shlibext"
1250 if test -f "$additional_libdir/lib$name.la"; then
1251 found_la="$additional_libdir/lib$name.la"
1254 if test -f "$additional_libdir/lib$name.$libext"; then
1255 found_dir="$additional_libdir"
1256 found_a="$additional_libdir/lib$name.$libext"
1257 if test -f "$additional_libdir/lib$name.la"; then
1258 found_la="$additional_libdir/lib$name.la"
1263 if test "X$found_dir" = "X"; then
1264 for x in $LDFLAGS $LTLIB[]NAME; do
1265 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1268 dir=`echo "X$x" | sed -e 's/^X-L//'`
1269 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1271 found_so="$dir/lib$name.$shlibext"
1272 if test -f "$dir/lib$name.la"; then
1273 found_la="$dir/lib$name.la"
1276 if test -f "$dir/lib$name.$libext"; then
1278 found_a="$dir/lib$name.$libext"
1279 if test -f "$dir/lib$name.la"; then
1280 found_la="$dir/lib$name.la"
1286 if test "X$found_dir" != "X"; then
1291 if test "X$found_dir" != "X"; then
1292 dnl Found the library.
1293 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1294 if test "X$found_so" != "X"; then
1295 dnl Linking with a shared library. We attempt to hardcode its
1296 dnl directory into the executable's runpath, unless it's the
1297 dnl standard /usr/lib.
1298 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1299 dnl No hardcoding is needed.
1300 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1302 dnl Use an explicit option to hardcode DIR into the resulting
1304 dnl Potentially add DIR to ltrpathdirs.
1305 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1307 for x in $ltrpathdirs; do
1308 if test "X$x" = "X$found_dir"; then
1313 if test -z "$haveit"; then
1314 ltrpathdirs="$ltrpathdirs $found_dir"
1316 dnl The hardcoding into $LIBNAME is system dependent.
1317 if test "$hardcode_direct" = yes; then
1318 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1319 dnl resulting binary.
1320 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1322 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1323 dnl Use an explicit option to hardcode DIR into the resulting
1325 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1326 dnl Potentially add DIR to rpathdirs.
1327 dnl The rpathdirs will be appended to $LIBNAME at the end.
1329 for x in $rpathdirs; do
1330 if test "X$x" = "X$found_dir"; then
1335 if test -z "$haveit"; then
1336 rpathdirs="$rpathdirs $found_dir"
1339 dnl Rely on "-L$found_dir".
1340 dnl But don't add it if it's already contained in the LDFLAGS
1341 dnl or the already constructed $LIBNAME
1343 for x in $LDFLAGS $LIB[]NAME; do
1344 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1345 if test "X$x" = "X-L$found_dir"; then
1350 if test -z "$haveit"; then
1351 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1353 if test "$hardcode_minus_L" != no; then
1354 dnl FIXME: Not sure whether we should use
1355 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1357 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1359 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1360 dnl here, because this doesn't fit in flags passed to the
1361 dnl compiler. So give up. No hardcoding. This affects only
1362 dnl very old systems.
1363 dnl FIXME: Not sure whether we should use
1364 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1366 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1372 if test "X$found_a" != "X"; then
1373 dnl Linking with a static library.
1374 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1376 dnl We shouldn't come here, but anyway it's good to have a
1378 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1381 dnl Assume the include files are nearby.
1382 additional_includedir=
1383 case "$found_dir" in
1385 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1386 additional_includedir="$basedir/include"
1389 if test "X$additional_includedir" != "X"; then
1390 dnl Potentially add $additional_includedir to $INCNAME.
1391 dnl But don't add it
1392 dnl 1. if it's the standard /usr/include,
1393 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1394 dnl 3. if it's already present in $CPPFLAGS or the already
1395 dnl constructed $INCNAME,
1396 dnl 4. if it doesn't exist as a directory.
1397 if test "X$additional_includedir" != "X/usr/include"; then
1399 if test "X$additional_includedir" = "X/usr/local/include"; then
1400 if test -n "$GCC"; then
1402 linux*) haveit=yes;;
1406 if test -z "$haveit"; then
1407 for x in $CPPFLAGS $INC[]NAME; do
1408 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1409 if test "X$x" = "X-I$additional_includedir"; then
1414 if test -z "$haveit"; then
1415 if test -d "$additional_includedir"; then
1416 dnl Really add $additional_includedir to $INCNAME.
1417 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1423 dnl Look for dependencies.
1424 if test -n "$found_la"; then
1425 dnl Read the .la file. It defines the variables
1426 dnl dlname, library_names, old_library, dependency_libs, current,
1427 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1428 save_libdir="$libdir"
1430 */* | *\\*) . "$found_la" ;;
1431 *) . "./$found_la" ;;
1433 libdir="$save_libdir"
1434 dnl We use only dependency_libs.
1435 for dep in $dependency_libs; do
1438 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1439 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1440 dnl But don't add it
1441 dnl 1. if it's the standard /usr/lib,
1442 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1443 dnl 3. if it's already present in $LDFLAGS or the already
1444 dnl constructed $LIBNAME,
1445 dnl 4. if it doesn't exist as a directory.
1446 if test "X$additional_libdir" != "X/usr/lib"; then
1448 if test "X$additional_libdir" = "X/usr/local/lib"; then
1449 if test -n "$GCC"; then
1451 linux*) haveit=yes;;
1455 if test -z "$haveit"; then
1457 for x in $LDFLAGS $LIB[]NAME; do
1458 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1459 if test "X$x" = "X-L$additional_libdir"; then
1464 if test -z "$haveit"; then
1465 if test -d "$additional_libdir"; then
1466 dnl Really add $additional_libdir to $LIBNAME.
1467 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1471 for x in $LDFLAGS $LTLIB[]NAME; do
1472 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1473 if test "X$x" = "X-L$additional_libdir"; then
1478 if test -z "$haveit"; then
1479 if test -d "$additional_libdir"; then
1480 dnl Really add $additional_libdir to $LTLIBNAME.
1481 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1488 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1489 if test "$enable_rpath" != no; then
1490 dnl Potentially add DIR to rpathdirs.
1491 dnl The rpathdirs will be appended to $LIBNAME at the end.
1493 for x in $rpathdirs; do
1494 if test "X$x" = "X$dir"; then
1499 if test -z "$haveit"; then
1500 rpathdirs="$rpathdirs $dir"
1502 dnl Potentially add DIR to ltrpathdirs.
1503 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1505 for x in $ltrpathdirs; do
1506 if test "X$x" = "X$dir"; then
1511 if test -z "$haveit"; then
1512 ltrpathdirs="$ltrpathdirs $dir"
1517 dnl Handle this in the next round.
1518 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1521 dnl Handle this in the next round. Throw away the .la's
1522 dnl directory; it is already contained in a preceding -L
1524 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1527 dnl Most likely an immediate library name.
1528 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1529 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1535 dnl Didn't find the library; assume it is in the system directories
1536 dnl known to the linker and runtime loader. (All the system
1537 dnl directories known to the linker should also be known to the
1538 dnl runtime loader, otherwise the system is severely misconfigured.)
1539 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1540 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1546 if test "X$rpathdirs" != "X"; then
1547 if test -n "$hardcode_libdir_separator"; then
1548 dnl Weird platform: only the last -rpath option counts, the user must
1549 dnl pass all path elements in one option. We can arrange that for a
1550 dnl single library, but not when more than one $LIBNAMEs are used.
1552 for found_dir in $rpathdirs; do
1553 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1555 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1556 acl_save_libdir="$libdir"
1558 eval flag=\"$hardcode_libdir_flag_spec\"
1559 libdir="$acl_save_libdir"
1560 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1562 dnl The -rpath options are cumulative.
1563 for found_dir in $rpathdirs; do
1564 acl_save_libdir="$libdir"
1566 eval flag=\"$hardcode_libdir_flag_spec\"
1567 libdir="$acl_save_libdir"
1568 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1572 if test "X$ltrpathdirs" != "X"; then
1573 dnl When using libtool, the option that works for both libraries and
1574 dnl executables is -R. The -R options are cumulative.
1575 for found_dir in $ltrpathdirs; do
1576 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1581 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1582 dnl unless already present in VAR.
1583 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1584 dnl contains two or three consecutive elements that belong together.
1585 AC_DEFUN([AC_LIB_APPENDTOVAR],
1587 for element in [$2]; do
1590 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1591 if test "X$x" = "X$element"; then
1596 if test -z "$haveit"; then
1597 [$1]="${[$1]}${[$1]:+ }$element"
1602 # lib-ld.m4 serial 3 (gettext-0.13)
1603 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1604 dnl This file is free software, distributed under the terms of the GNU
1605 dnl General Public License. As a special exception to the GNU General
1606 dnl Public License, this file may be distributed as part of a program
1607 dnl that contains a configuration script generated by Autoconf, under
1608 dnl the same distribution terms as the rest of that program.
1610 dnl Subroutines of libtool.m4,
1611 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1612 dnl with libtool.m4.
1614 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1615 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1616 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1617 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1618 case `$LD -v 2>&1 </dev/null` in
1619 *GNU* | *'with BFD'*)
1620 acl_cv_prog_gnu_ld=yes ;;
1622 acl_cv_prog_gnu_ld=no ;;
1624 with_gnu_ld=$acl_cv_prog_gnu_ld
1627 dnl From libtool-1.4. Sets the variable LD.
1628 AC_DEFUN([AC_LIB_PROG_LD],
1629 [AC_ARG_WITH(gnu-ld,
1630 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1631 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1632 AC_REQUIRE([AC_PROG_CC])dnl
1633 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1634 # Prepare PATH_SEPARATOR.
1635 # The user is always right.
1636 if test "${PATH_SEPARATOR+set}" != set; then
1637 echo "#! /bin/sh" >conf$$.sh
1638 echo "exit 0" >>conf$$.sh
1640 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1648 if test "$GCC" = yes; then
1649 # Check if gcc -print-prog-name=ld gives a path.
1650 AC_MSG_CHECKING([for ld used by GCC])
1653 # gcc leaves a trailing carriage return which upsets mingw
1654 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1656 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1659 # Accept absolute paths.
1660 [[\\/]* | [A-Za-z]:[\\/]*)]
1661 [re_direlt='/[^/][^/]*/\.\./']
1662 # Canonicalize the path of ld
1663 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1664 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1665 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1667 test -z "$LD" && LD="$ac_prog"
1670 # If it fails, then pretend we aren't using GCC.
1674 # If it is relative, then search for the first ld in PATH.
1678 elif test "$with_gnu_ld" = yes; then
1679 AC_MSG_CHECKING([for GNU ld])
1681 AC_MSG_CHECKING([for non-GNU ld])
1683 AC_CACHE_VAL(acl_cv_path_LD,
1684 [if test -z "$LD"; then
1685 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1686 for ac_dir in $PATH; do
1687 test -z "$ac_dir" && ac_dir=.
1688 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1689 acl_cv_path_LD="$ac_dir/$ac_prog"
1690 # Check to see if the program is GNU ld. I'd rather use --version,
1691 # but apparently some GNU ld's only accept -v.
1692 # Break only if it was the GNU/non-GNU ld that we prefer.
1693 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1694 *GNU* | *'with BFD'*)
1695 test "$with_gnu_ld" != no && break ;;
1697 test "$with_gnu_ld" != yes && break ;;
1703 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1705 LD="$acl_cv_path_LD"
1706 if test -n "$LD"; then
1711 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1716 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1717 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1718 dnl also defines GSTUFF_PKG_ERRORS on error
1719 AC_DEFUN(PKG_CHECK_MODULES, [
1722 if test -z "$PKG_CONFIG"; then
1723 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1726 if test "$PKG_CONFIG" = "no" ; then
1727 echo "*** The pkg-config script could not be found. Make sure it is"
1728 echo "*** in your path, or set the PKG_CONFIG environment variable"
1729 echo "*** to the full path to pkg-config."
1730 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
1732 PKG_CONFIG_MIN_VERSION=0.9.0
1733 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1734 AC_MSG_CHECKING(for $2)
1736 if $PKG_CONFIG --exists "$2" ; then
1740 AC_MSG_CHECKING($1_CFLAGS)
1741 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
1742 AC_MSG_RESULT($$1_CFLAGS)
1744 AC_MSG_CHECKING($1_LIBS)
1745 $1_LIBS=`$PKG_CONFIG --libs "$2"`
1746 AC_MSG_RESULT($$1_LIBS)
1750 ## If we have a custom action on failure, don't print errors, but
1751 ## do set a variable so people can do so.
1752 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1753 ifelse([$4], ,echo $$1_PKG_ERRORS,)
1759 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1760 echo "*** See http://www.freedesktop.org/software/pkgconfig"
1764 if test $succeeded = yes; then
1765 ifelse([$3], , :, [$3])
1767 ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
1773 # gettext.m4 serial 28 (gettext-0.13)
1774 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1775 dnl This file is free software, distributed under the terms of the GNU
1776 dnl General Public License. As a special exception to the GNU General
1777 dnl Public License, this file may be distributed as part of a program
1778 dnl that contains a configuration script generated by Autoconf, under
1779 dnl the same distribution terms as the rest of that program.
1781 dnl This file can can be used in projects which are not available under
1782 dnl the GNU General Public License or the GNU Library General Public
1783 dnl License but which still want to provide support for the GNU gettext
1785 dnl Please note that the actual code of the GNU gettext library is covered
1786 dnl by the GNU Library General Public License, and the rest of the GNU
1787 dnl gettext package package is covered by the GNU General Public License.
1788 dnl They are *not* in the public domain.
1791 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1792 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1794 dnl Macro to add for using GNU gettext.
1796 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1797 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1798 dnl default (if it is not specified or empty) is 'no-libtool'.
1799 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
1800 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1801 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
1802 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1803 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1804 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1805 dnl $(top_builddir)/intl/libintl.a will be created.
1806 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1807 dnl implementations (in libc or libintl) without the ngettext() function
1808 dnl will be ignored. If NEEDSYMBOL is specified and is
1809 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
1810 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1811 dnl INTLDIR is used to find the intl libraries. If empty,
1812 dnl the value `$(top_builddir)/intl/' is used.
1814 dnl The result of the configuration is one of three cases:
1815 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1817 dnl Catalog format: GNU --> install in $(datadir)
1818 dnl Catalog extension: .mo after installation, .gmo in source tree
1819 dnl 2) GNU gettext has been found in the system's C library.
1820 dnl Catalog format: GNU --> install in $(datadir)
1821 dnl Catalog extension: .mo after installation, .gmo in source tree
1822 dnl 3) No internationalization, always use English msgid.
1823 dnl Catalog format: none
1824 dnl Catalog extension: none
1825 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1826 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1827 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1828 dnl but we keep it in order not to force irrelevant filename changes on the
1831 AC_DEFUN([AM_GNU_GETTEXT],
1833 dnl Argument checking.
1834 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1835 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1837 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1838 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1840 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1841 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1843 AC_REQUIRE([AM_PO_SUBDIRS])dnl
1844 ifelse(gt_included_intl, yes, [
1845 AC_REQUIRE([AM_INTL_SUBDIR])dnl
1848 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1849 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1850 AC_REQUIRE([AC_LIB_RPATH])
1852 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1853 dnl Ideally we would do this search only after the
1854 dnl if test "$USE_NLS" = "yes"; then
1855 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1856 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1857 dnl the configure script would need to contain the same shell code
1858 dnl again, outside any 'if'. There are two solutions:
1859 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1860 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1861 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1862 dnl documented, we avoid it.
1863 ifelse(gt_included_intl, yes, , [
1864 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1870 ifelse(gt_included_intl, yes, [
1871 BUILD_INCLUDED_LIBINTL=no
1872 USE_INCLUDED_LIBINTL=no
1878 dnl If we use NLS figure out what method
1879 if test "$USE_NLS" = "yes"; then
1880 gt_use_preinstalled_gnugettext=no
1881 ifelse(gt_included_intl, yes, [
1882 AC_MSG_CHECKING([whether included gettext is requested])
1883 AC_ARG_WITH(included-gettext,
1884 [ --with-included-gettext use the GNU gettext library included here],
1885 nls_cv_force_use_gnu_gettext=$withval,
1886 nls_cv_force_use_gnu_gettext=no)
1887 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1889 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1890 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1892 dnl User does not insist on using GNU NLS library. Figure out what
1893 dnl to use. If GNU gettext is available we use this. Else we have
1894 dnl to fall back to GNU NLS library.
1896 dnl Add a version number to the cache macros.
1897 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1898 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1899 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1901 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1902 [AC_TRY_LINK([#include <libintl.h>
1903 ]ifelse([$2], [need-formatstring-macros],
1904 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1905 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1908 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1910 ], [])[extern int _nl_msg_cat_cntr;
1911 extern int *_nl_domain_bindings;],
1912 [bindtextdomain ("", "");
1913 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1914 gt_cv_func_gnugettext_libc=yes,
1915 gt_cv_func_gnugettext_libc=no)])
1917 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1918 dnl Sometimes libintl requires libiconv, so first search for libiconv.
1919 ifelse(gt_included_intl, yes, , [
1922 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1923 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1924 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1925 dnl even if libiconv doesn't exist.
1926 AC_LIB_LINKFLAGS_BODY([intl])
1927 AC_CACHE_CHECK([for GNU gettext in libintl],
1928 gt_cv_func_gnugettext_libintl,
1929 [gt_save_CPPFLAGS="$CPPFLAGS"
1930 CPPFLAGS="$CPPFLAGS $INCINTL"
1931 gt_save_LIBS="$LIBS"
1932 LIBS="$LIBS $LIBINTL"
1933 dnl Now see whether libintl exists and does not depend on libiconv.
1934 AC_TRY_LINK([#include <libintl.h>
1935 ]ifelse([$2], [need-formatstring-macros],
1936 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1937 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1940 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1942 ], [])[extern int _nl_msg_cat_cntr;
1947 const char *_nl_expand_alias ();],
1948 [bindtextdomain ("", "");
1949 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1950 gt_cv_func_gnugettext_libintl=yes,
1951 gt_cv_func_gnugettext_libintl=no)
1952 dnl Now see whether libintl exists and depends on libiconv.
1953 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1954 LIBS="$LIBS $LIBICONV"
1955 AC_TRY_LINK([#include <libintl.h>
1956 ]ifelse([$2], [need-formatstring-macros],
1957 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1958 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1961 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1963 ], [])[extern int _nl_msg_cat_cntr;
1968 const char *_nl_expand_alias ();],
1969 [bindtextdomain ("", "");
1970 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1971 [LIBINTL="$LIBINTL $LIBICONV"
1972 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1973 gt_cv_func_gnugettext_libintl=yes
1976 CPPFLAGS="$gt_save_CPPFLAGS"
1977 LIBS="$gt_save_LIBS"])
1980 dnl If an already present or preinstalled GNU gettext() is found,
1981 dnl use it. But if this macro is used in GNU gettext, and GNU
1982 dnl gettext is already preinstalled in libintl, we update this
1983 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1984 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1985 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1986 && test "$PACKAGE" != gettext-runtime \
1987 && test "$PACKAGE" != gettext-tools; }; then
1988 gt_use_preinstalled_gnugettext=yes
1990 dnl Reset the values set by searching for libintl.
1996 ifelse(gt_included_intl, yes, [
1997 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1998 dnl GNU gettext is not found in the C library.
1999 dnl Fall back on included GNU gettext library.
2000 nls_cv_use_gnu_gettext=yes
2004 if test "$nls_cv_use_gnu_gettext" = "yes"; then
2005 dnl Mark actions used to generate GNU NLS library.
2006 BUILD_INCLUDED_LIBINTL=yes
2007 USE_INCLUDED_LIBINTL=yes
2008 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
2009 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
2010 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
2013 if test "$gt_use_preinstalled_gnugettext" = "yes" \
2014 || test "$nls_cv_use_gnu_gettext" = "yes"; then
2015 dnl Mark actions to use GNU gettext tools.
2020 if test "$gt_use_preinstalled_gnugettext" = "yes" \
2021 || test "$nls_cv_use_gnu_gettext" = "yes"; then
2022 AC_DEFINE(ENABLE_NLS, 1,
2023 [Define to 1 if translation of program messages to the user's native language
2030 AC_MSG_CHECKING([whether to use NLS])
2031 AC_MSG_RESULT([$USE_NLS])
2032 if test "$USE_NLS" = "yes"; then
2033 AC_MSG_CHECKING([where the gettext function comes from])
2034 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
2035 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2036 gt_source="external libintl"
2041 gt_source="included intl directory"
2043 AC_MSG_RESULT([$gt_source])
2046 if test "$USE_NLS" = "yes"; then
2048 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
2049 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2050 AC_MSG_CHECKING([how to link with libintl])
2051 AC_MSG_RESULT([$LIBINTL])
2052 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
2055 dnl For backward compatibility. Some packages may be using this.
2056 AC_DEFINE(HAVE_GETTEXT, 1,
2057 [Define if the GNU gettext() function is already present or preinstalled.])
2058 AC_DEFINE(HAVE_DCGETTEXT, 1,
2059 [Define if the GNU dcgettext() function is already present or preinstalled.])
2062 dnl We need to process the po/ directory.
2066 ifelse(gt_included_intl, yes, [
2067 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
2068 dnl to 'yes' because some of the testsuite requires it.
2069 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
2070 BUILD_INCLUDED_LIBINTL=yes
2073 dnl Make all variables we use known to autoconf.
2074 AC_SUBST(BUILD_INCLUDED_LIBINTL)
2075 AC_SUBST(USE_INCLUDED_LIBINTL)
2078 dnl For backward compatibility. Some configure.ins may be using this.
2080 nls_cv_header_libgt=
2082 dnl For backward compatibility. Some Makefiles may be using this.
2084 AC_SUBST(DATADIRNAME)
2086 dnl For backward compatibility. Some Makefiles may be using this.
2088 AC_SUBST(INSTOBJEXT)
2090 dnl For backward compatibility. Some Makefiles may be using this.
2094 dnl For backward compatibility. Some Makefiles may be using this.
2095 if test "$USE_INCLUDED_LIBINTL" = yes; then
2096 INTLOBJS="\$(GETTOBJS)"
2100 dnl Enable libtool support if the surrounding package wishes it.
2101 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
2102 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
2105 dnl For backward compatibility. Some Makefiles may be using this.
2109 dnl Make all documented variables known to autoconf.
2116 dnl Checks for all prerequisites of the intl subdirectory,
2117 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
2118 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
2119 AC_DEFUN([AM_INTL_SUBDIR],
2121 AC_REQUIRE([AC_PROG_INSTALL])dnl
2122 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
2123 AC_REQUIRE([AC_PROG_CC])dnl
2124 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2125 AC_REQUIRE([AC_PROG_RANLIB])dnl
2126 AC_REQUIRE([AC_ISC_POSIX])dnl
2127 AC_REQUIRE([AC_HEADER_STDC])dnl
2128 AC_REQUIRE([AC_C_CONST])dnl
2129 AC_REQUIRE([bh_C_SIGNED])dnl
2130 AC_REQUIRE([AC_C_INLINE])dnl
2131 AC_REQUIRE([AC_TYPE_OFF_T])dnl
2132 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
2133 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
2134 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
2135 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
2136 AC_REQUIRE([gt_TYPE_WINT_T])dnl
2137 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2138 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2139 AC_REQUIRE([gt_TYPE_INTMAX_T])
2140 AC_REQUIRE([gt_PRINTF_POSIX])
2141 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2142 AC_REQUIRE([AC_FUNC_MMAP])dnl
2143 AC_REQUIRE([jm_GLIBC21])dnl
2144 AC_REQUIRE([gt_INTDIV0])dnl
2145 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
2146 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
2147 AC_REQUIRE([gt_INTTYPES_PRI])dnl
2148 AC_REQUIRE([gl_XSIZE])dnl
2150 AC_CHECK_TYPE([ptrdiff_t], ,
2151 [AC_DEFINE([ptrdiff_t], [long],
2152 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
2154 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
2155 stdlib.h string.h unistd.h sys/param.h])
2156 AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
2157 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
2158 strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
2161 dnl Use the _snprintf function only if it is declared (because on NetBSD it
2162 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
2163 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
2164 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
2166 dnl Use the *_unlocked functions only if they are declared.
2167 dnl (because some of them were defined without being declared in Solaris
2168 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
2169 dnl on Solaris 2.5.1 to run on Solaris 2.6).
2170 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
2171 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
2172 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
2173 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
2175 case $gt_cv_func_printf_posix in
2176 *yes) HAVE_POSIX_PRINTF=1 ;;
2177 *) HAVE_POSIX_PRINTF=0 ;;
2179 AC_SUBST([HAVE_POSIX_PRINTF])
2180 if test "$ac_cv_func_asprintf" = yes; then
2185 AC_SUBST([HAVE_ASPRINTF])
2186 if test "$ac_cv_func_snprintf" = yes; then
2191 AC_SUBST([HAVE_SNPRINTF])
2192 if test "$ac_cv_func_wprintf" = yes; then
2197 AC_SUBST([HAVE_WPRINTF])
2201 if test $ac_cv_header_locale_h = yes; then
2205 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
2206 dnl because plural.y uses bison specific features. It requires at least
2207 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
2209 dnl bison is only needed for the maintainer (who touches plural.y). But in
2210 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
2211 dnl the rule in general Makefile. Now, some people carelessly touch the
2212 dnl files or have a broken "make" program, hence the plural.c rule will
2213 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
2214 dnl present or too old.
2215 AC_CHECK_PROGS([INTLBISON], [bison])
2216 if test -z "$INTLBISON"; then
2219 dnl Found it, now check the version.
2220 AC_MSG_CHECKING([version of bison])
2221 changequote(<<,>>)dnl
2222 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
2223 case $ac_prog_version in
2224 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2225 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
2227 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
2228 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
2230 AC_MSG_RESULT([$ac_prog_version])
2232 if test $ac_verc_fail = yes; then
2238 dnl gt_CHECK_DECL(FUNC, INCLUDES)
2239 dnl Check whether a function is declared.
2240 AC_DEFUN([gt_CHECK_DECL],
2242 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
2243 [AC_TRY_COMPILE([$2], [
2245 char *p = (char *) $1;
2247 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
2248 if test $ac_cv_have_decl_$1 = yes; then
2253 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
2254 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
2258 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
2259 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
2261 # po.m4 serial 3 (gettext-0.14)
2262 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
2263 dnl This file is free software, distributed under the terms of the GNU
2264 dnl General Public License. As a special exception to the GNU General
2265 dnl Public License, this file may be distributed as part of a program
2266 dnl that contains a configuration script generated by Autoconf, under
2267 dnl the same distribution terms as the rest of that program.
2269 dnl This file can can be used in projects which are not available under
2270 dnl the GNU General Public License or the GNU Library General Public
2271 dnl License but which still want to provide support for the GNU gettext
2273 dnl Please note that the actual code of the GNU gettext library is covered
2274 dnl by the GNU Library General Public License, and the rest of the GNU
2275 dnl gettext package package is covered by the GNU General Public License.
2276 dnl They are *not* in the public domain.
2279 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2280 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2282 dnl Checks for all prerequisites of the po subdirectory.
2283 AC_DEFUN([AM_PO_SUBDIRS],
2285 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2286 AC_REQUIRE([AC_PROG_INSTALL])dnl
2287 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
2288 AC_REQUIRE([AM_NLS])dnl
2290 dnl Perform the following tests also if --disable-nls has been given,
2291 dnl because they are needed for "make dist" to work.
2293 dnl Search for GNU msgfmt in the PATH.
2294 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2295 dnl The second test excludes FreeBSD msgfmt.
2296 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2297 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
2298 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2300 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2302 dnl Search for GNU xgettext 0.12 or newer in the PATH.
2303 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2304 dnl The second test excludes FreeBSD xgettext.
2305 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2306 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
2307 (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2309 dnl Remove leftover from FreeBSD xgettext call.
2312 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2313 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2314 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
2316 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
2317 dnl Test whether we really found GNU msgfmt.
2318 if test "$GMSGFMT" != ":"; then
2319 dnl If it is no GNU msgfmt we define it as : so that the
2320 dnl Makefiles still can work.
2321 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
2322 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
2325 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
2327 [found $GMSGFMT program is not GNU msgfmt; ignore it])
2332 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
2333 dnl Test whether we really found GNU xgettext.
2334 if test "$XGETTEXT" != ":"; then
2335 dnl If it is no GNU xgettext we define it as : so that the
2336 dnl Makefiles still can work.
2337 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
2338 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
2342 [found xgettext program is not GNU xgettext; ignore it])
2345 dnl Remove leftover from FreeBSD xgettext call.
2349 AC_OUTPUT_COMMANDS([
2350 for ac_file in $CONFIG_FILES; do
2351 # Support "outfile[:infile[:infile...]]"
2353 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2355 # PO directories have a Makefile.in generated from Makefile.in.in.
2356 case "$ac_file" in */Makefile.in)
2357 # Adjust a relative srcdir.
2358 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2359 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2360 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2361 # In autoconf-2.13 it is called $ac_given_srcdir.
2362 # In autoconf-2.50 it is called $srcdir.
2363 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2364 case "$ac_given_srcdir" in
2365 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2366 /*) top_srcdir="$ac_given_srcdir" ;;
2367 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2369 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2370 rm -f "$ac_dir/POTFILES"
2371 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2372 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2373 POMAKEFILEDEPS="POTFILES.in"
2374 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2375 # on $ac_dir but don't depend on user-specified configuration
2377 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2378 # The LINGUAS file contains the set of available languages.
2379 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2380 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2382 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2383 # Hide the ALL_LINGUAS assigment from automake.
2384 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2385 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2387 # The set of available languages was given in configure.in.
2388 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2391 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2392 # Compute UPDATEPOFILES
2393 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2394 # Compute DUMMYPOFILES
2395 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2397 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2398 case "$ac_given_srcdir" in
2400 *) srcdirpre='$(srcdir)/' ;;
2406 for lang in $ALL_LINGUAS; do
2407 POFILES="$POFILES $srcdirpre$lang.po"
2408 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2409 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2410 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2412 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2413 # environment variable.
2415 if test -n "$ALL_LINGUAS"; then
2416 for presentlang in $ALL_LINGUAS; do
2418 if test "%UNSET%" != "$LINGUAS"; then
2419 desiredlanguages="$LINGUAS"
2421 desiredlanguages="$ALL_LINGUAS"
2423 for desiredlang in $desiredlanguages; do
2424 # Use the presentlang catalog if desiredlang is
2425 # a. equal to presentlang, or
2426 # b. a variant of presentlang (because in this case,
2427 # presentlang can be used as a fallback for messages
2428 # which are not translated in the desiredlang catalog).
2429 case "$desiredlang" in
2430 "$presentlang"*) useit=yes;;
2433 if test $useit = yes; then
2434 INST_LINGUAS="$INST_LINGUAS $presentlang"
2439 if test -n "$INST_LINGUAS"; then
2440 for lang in $INST_LINGUAS; do
2441 CATALOGS="$CATALOGS $lang.gmo"
2444 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2445 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
2446 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2447 if test -f "$f"; then
2449 *.orig | *.bak | *~) ;;
2450 *) cat "$f" >> "$ac_dir/Makefile" ;;
2458 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2459 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2461 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2462 # Capture the value of LINGUAS because we need it to compute CATALOGS.
2463 LINGUAS="${LINGUAS-%UNSET%}"
2467 dnl Postprocesses a Makefile in a directory containing PO files.
2468 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2470 # When this code is run, in config.status, two variables have already been
2472 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2473 # - LINGUAS is the value of the environment variable LINGUAS at configure
2477 # Adjust a relative srcdir.
2478 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2479 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2480 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2481 # In autoconf-2.13 it is called $ac_given_srcdir.
2482 # In autoconf-2.50 it is called $srcdir.
2483 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2484 case "$ac_given_srcdir" in
2485 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2486 /*) top_srcdir="$ac_given_srcdir" ;;
2487 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2490 # Find a way to echo strings without interpreting backslash.
2491 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2494 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2495 gt_echo='printf %s\n'
2506 # A sed script that extracts the value of VARIABLE from a Makefile.
2508 # Test if the hold space is empty.
2513 # Yes it was empty. Look if we have the expected variable definition.
2514 /^[ ]*VARIABLE[ ]*=/{
2515 # Seen the first line of the variable definition.
2516 s/^[ ]*VARIABLE[ ]*=//
2521 # Here we are processing a line from the variable definition.
2522 # Remove comment, more precisely replace it with a space.
2524 # See if the line ends in a backslash.
2528 # Print the line, without the trailing backslash.
2531 # There was no trailing backslash. The end of the variable definition is
2532 # reached. Clear the hold space.
2537 # A trailing backslash means that the variable definition continues in the
2538 # next line. Put a nonempty string into the hold space to indicate this.
2545 # Set POTFILES to the value of the Makefile variable POTFILES.
2546 sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
2547 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2548 # Compute POTFILES_DEPS as
2549 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2551 for file in $POTFILES; do
2552 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2556 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2557 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2559 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2560 # The LINGUAS file contains the set of available languages.
2561 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2562 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2564 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2565 sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
2566 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2568 # Hide the ALL_LINGUAS assigment from automake.
2569 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2571 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2572 # Compute UPDATEPOFILES
2573 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2574 # Compute DUMMYPOFILES
2575 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2577 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2578 # Compute PROPERTIESFILES
2579 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2580 # Compute CLASSFILES
2581 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2583 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2585 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2586 # Compute RESOURCESDLLFILES
2587 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2588 case "$ac_given_srcdir" in
2590 *) srcdirpre='$(srcdir)/' ;;
2601 for lang in $ALL_LINGUAS; do
2602 POFILES="$POFILES $srcdirpre$lang.po"
2603 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2604 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2605 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2606 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2607 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2608 QMFILES="$QMFILES $srcdirpre$lang.qm"
2609 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2610 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2611 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2612 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2614 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2615 # environment variable.
2617 if test -n "$ALL_LINGUAS"; then
2618 for presentlang in $ALL_LINGUAS; do
2620 if test "%UNSET%" != "$LINGUAS"; then
2621 desiredlanguages="$LINGUAS"
2623 desiredlanguages="$ALL_LINGUAS"
2625 for desiredlang in $desiredlanguages; do
2626 # Use the presentlang catalog if desiredlang is
2627 # a. equal to presentlang, or
2628 # b. a variant of presentlang (because in this case,
2629 # presentlang can be used as a fallback for messages
2630 # which are not translated in the desiredlang catalog).
2631 case "$desiredlang" in
2632 "$presentlang"*) useit=yes;;
2635 if test $useit = yes; then
2636 INST_LINGUAS="$INST_LINGUAS $presentlang"
2645 if test -n "$INST_LINGUAS"; then
2646 for lang in $INST_LINGUAS; do
2647 CATALOGS="$CATALOGS $lang.gmo"
2648 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2649 QTCATALOGS="$QTCATALOGS $lang.qm"
2650 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2651 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2652 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2653 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2657 sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
2658 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2659 # Add dependencies that cannot be formulated as a simple suffix rule.
2660 for lang in $ALL_LINGUAS; do
2661 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2662 cat >> "$ac_file.tmp" <<EOF
2663 $frobbedlang.msg: $lang.po
2664 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2665 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2669 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2670 # Add dependencies that cannot be formulated as a simple suffix rule.
2671 for lang in $ALL_LINGUAS; do
2672 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2673 cat >> "$ac_file.tmp" <<EOF
2674 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2675 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2676 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2680 if test -n "$POMAKEFILEDEPS"; then
2681 cat >> "$ac_file.tmp" <<EOF
2682 Makefile: $POMAKEFILEDEPS
2685 mv "$ac_file.tmp" "$ac_file"
2688 # nls.m4 serial 1 (gettext-0.12)
2689 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
2690 dnl This file is free software, distributed under the terms of the GNU
2691 dnl General Public License. As a special exception to the GNU General
2692 dnl Public License, this file may be distributed as part of a program
2693 dnl that contains a configuration script generated by Autoconf, under
2694 dnl the same distribution terms as the rest of that program.
2696 dnl This file can can be used in projects which are not available under
2697 dnl the GNU General Public License or the GNU Library General Public
2698 dnl License but which still want to provide support for the GNU gettext
2700 dnl Please note that the actual code of the GNU gettext library is covered
2701 dnl by the GNU Library General Public License, and the rest of the GNU
2702 dnl gettext package package is covered by the GNU General Public License.
2703 dnl They are *not* in the public domain.
2706 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2707 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2711 AC_MSG_CHECKING([whether NLS is requested])
2712 dnl Default is enabled NLS
2714 [ --disable-nls do not use Native Language Support],
2715 USE_NLS=$enableval, USE_NLS=yes)
2716 AC_MSG_RESULT($USE_NLS)
2720 AC_DEFUN([AM_MKINSTALLDIRS],
2722 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2723 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
2724 dnl Try to locate it.
2726 if test -n "$ac_aux_dir"; then
2727 case "$ac_aux_dir" in
2728 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
2729 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
2732 if test -z "$MKINSTALLDIRS"; then
2733 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
2735 AC_SUBST(MKINSTALLDIRS)
2738 # progtest.m4 serial 3 (gettext-0.12)
2739 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2740 dnl This file is free software, distributed under the terms of the GNU
2741 dnl General Public License. As a special exception to the GNU General
2742 dnl Public License, this file may be distributed as part of a program
2743 dnl that contains a configuration script generated by Autoconf, under
2744 dnl the same distribution terms as the rest of that program.
2746 dnl This file can can be used in projects which are not available under
2747 dnl the GNU General Public License or the GNU Library General Public
2748 dnl License but which still want to provide support for the GNU gettext
2750 dnl Please note that the actual code of the GNU gettext library is covered
2751 dnl by the GNU Library General Public License, and the rest of the GNU
2752 dnl gettext package package is covered by the GNU General Public License.
2753 dnl They are *not* in the public domain.
2756 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2758 # Search path for a program which passes the given test.
2760 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2761 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2762 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2764 # Prepare PATH_SEPARATOR.
2765 # The user is always right.
2766 if test "${PATH_SEPARATOR+set}" != set; then
2767 echo "#! /bin/sh" >conf$$.sh
2768 echo "exit 0" >>conf$$.sh
2770 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2778 # Find out how to test for executable files. Don't use a zero-byte file,
2779 # as systems may use methods other than mode bits to determine executability.
2780 cat >conf$$.file <<_ASEOF
2784 chmod +x conf$$.file
2785 if test -x conf$$.file >/dev/null 2>&1; then
2786 ac_executable_p="test -x"
2788 ac_executable_p="test -f"
2792 # Extract the first word of "$2", so it can be a program name with args.
2793 set dummy $2; ac_word=[$]2
2794 AC_MSG_CHECKING([for $ac_word])
2795 AC_CACHE_VAL(ac_cv_path_$1,
2797 [[\\/]]* | ?:[[\\/]]*)
2798 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2801 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2802 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2804 test -z "$ac_dir" && ac_dir=.
2805 for ac_exec_ext in '' $ac_executable_extensions; do
2806 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2808 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2815 dnl If no 4th arg is given, leave the cache variable unset,
2816 dnl so AC_PATH_PROGS will keep looking.
2817 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2822 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2823 AC_MSG_RESULT([$]$1)
2830 # iconv.m4 serial AM4 (gettext-0.11.3)
2831 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2832 dnl This file is free software, distributed under the terms of the GNU
2833 dnl General Public License. As a special exception to the GNU General
2834 dnl Public License, this file may be distributed as part of a program
2835 dnl that contains a configuration script generated by Autoconf, under
2836 dnl the same distribution terms as the rest of that program.
2838 dnl From Bruno Haible.
2840 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2842 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2843 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2844 AC_REQUIRE([AC_LIB_RPATH])
2846 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2848 AC_LIB_LINKFLAGS_BODY([iconv])
2851 AC_DEFUN([AM_ICONV_LINK],
2853 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2854 dnl those with the standalone portable GNU libiconv installed).
2856 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2858 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2860 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2861 dnl because if the user has installed libiconv and not disabled its use
2862 dnl via --without-libiconv-prefix, he wants to use it. The first
2863 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2864 am_save_CPPFLAGS="$CPPFLAGS"
2865 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2867 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2868 am_cv_func_iconv="no, consider installing GNU libiconv"
2870 AC_TRY_LINK([#include <stdlib.h>
2871 #include <iconv.h>],
2872 [iconv_t cd = iconv_open("","");
2873 iconv(cd,NULL,NULL,NULL,NULL);
2875 am_cv_func_iconv=yes)
2876 if test "$am_cv_func_iconv" != yes; then
2877 am_save_LIBS="$LIBS"
2878 LIBS="$LIBS $LIBICONV"
2879 AC_TRY_LINK([#include <stdlib.h>
2880 #include <iconv.h>],
2881 [iconv_t cd = iconv_open("","");
2882 iconv(cd,NULL,NULL,NULL,NULL);
2885 am_cv_func_iconv=yes)
2886 LIBS="$am_save_LIBS"
2889 if test "$am_cv_func_iconv" = yes; then
2890 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2892 if test "$am_cv_lib_iconv" = yes; then
2893 AC_MSG_CHECKING([how to link with libiconv])
2894 AC_MSG_RESULT([$LIBICONV])
2896 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2898 CPPFLAGS="$am_save_CPPFLAGS"
2903 AC_SUBST(LTLIBICONV)
2906 AC_DEFUN([AM_ICONV],
2909 if test "$am_cv_func_iconv" = yes; then
2910 AC_MSG_CHECKING([for iconv declaration])
2911 AC_CACHE_VAL(am_cv_proto_iconv, [
2919 #if defined(__STDC__) || defined(__cplusplus)
2920 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2924 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2925 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
2926 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2927 AC_MSG_RESULT([$]{ac_t:-
2928 }[$]am_cv_proto_iconv)
2929 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2930 [Define as const if the declaration of iconv() needs const.])
2934 # isc-posix.m4 serial 2 (gettext-0.11.2)
2935 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2936 dnl This file is free software, distributed under the terms of the GNU
2937 dnl General Public License. As a special exception to the GNU General
2938 dnl Public License, this file may be distributed as part of a program
2939 dnl that contains a configuration script generated by Autoconf, under
2940 dnl the same distribution terms as the rest of that program.
2942 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
2944 # This test replaces the one in autoconf.
2945 # Currently this macro should have the same name as the autoconf macro
2946 # because gettext's gettext.m4 (distributed in the automake package)
2947 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
2948 # give these diagnostics:
2949 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2950 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2952 undefine([AC_ISC_POSIX])
2954 AC_DEFUN([AC_ISC_POSIX],
2956 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2957 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2961 # signed.m4 serial 1 (gettext-0.10.40)
2962 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2963 dnl This file is free software, distributed under the terms of the GNU
2964 dnl General Public License. As a special exception to the GNU General
2965 dnl Public License, this file may be distributed as part of a program
2966 dnl that contains a configuration script generated by Autoconf, under
2967 dnl the same distribution terms as the rest of that program.
2969 dnl From Bruno Haible.
2971 AC_DEFUN([bh_C_SIGNED],
2973 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
2974 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
2975 if test $bh_cv_c_signed = no; then
2977 [Define to empty if the C compiler doesn't support this keyword.])
2981 # longlong.m4 serial 4
2982 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2983 dnl This file is free software, distributed under the terms of the GNU
2984 dnl General Public License. As a special exception to the GNU General
2985 dnl Public License, this file may be distributed as part of a program
2986 dnl that contains a configuration script generated by Autoconf, under
2987 dnl the same distribution terms as the rest of that program.
2989 dnl From Paul Eggert.
2991 # Define HAVE_LONG_LONG if 'long long' works.
2993 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2995 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2996 [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
2997 [long long llmax = (long long) -1;
2998 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2999 ac_cv_type_long_long=yes,
3000 ac_cv_type_long_long=no)])
3001 if test $ac_cv_type_long_long = yes; then
3002 AC_DEFINE(HAVE_LONG_LONG, 1,
3003 [Define if you have the 'long long' type.])
3007 # longdouble.m4 serial 1 (gettext-0.12)
3008 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3009 dnl This file is free software, distributed under the terms of the GNU
3010 dnl General Public License. As a special exception to the GNU General
3011 dnl Public License, this file may be distributed as part of a program
3012 dnl that contains a configuration script generated by Autoconf, under
3013 dnl the same distribution terms as the rest of that program.
3015 dnl From Bruno Haible.
3016 dnl Test whether the compiler supports the 'long double' type.
3017 dnl Prerequisite: AC_PROG_CC
3019 AC_DEFUN([gt_TYPE_LONGDOUBLE],
3021 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
3022 [if test "$GCC" = yes; then
3023 gt_cv_c_long_double=yes
3026 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
3027 long double foo = 0.0;
3028 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
3029 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
3031 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
3033 if test $gt_cv_c_long_double = yes; then
3034 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
3038 # wchar_t.m4 serial 1 (gettext-0.12)
3039 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3040 dnl This file is free software, distributed under the terms of the GNU
3041 dnl General Public License. As a special exception to the GNU General
3042 dnl Public License, this file may be distributed as part of a program
3043 dnl that contains a configuration script generated by Autoconf, under
3044 dnl the same distribution terms as the rest of that program.
3046 dnl From Bruno Haible.
3047 dnl Test whether <stddef.h> has the 'wchar_t' type.
3048 dnl Prerequisite: AC_PROG_CC
3050 AC_DEFUN([gt_TYPE_WCHAR_T],
3052 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
3053 [AC_TRY_COMPILE([#include <stddef.h>
3054 wchar_t foo = (wchar_t)'\0';], ,
3055 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
3056 if test $gt_cv_c_wchar_t = yes; then
3057 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
3061 # wint_t.m4 serial 1 (gettext-0.12)
3062 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3063 dnl This file is free software, distributed under the terms of the GNU
3064 dnl General Public License. As a special exception to the GNU General
3065 dnl Public License, this file may be distributed as part of a program
3066 dnl that contains a configuration script generated by Autoconf, under
3067 dnl the same distribution terms as the rest of that program.
3069 dnl From Bruno Haible.
3070 dnl Test whether <wchar.h> has the 'wint_t' type.
3071 dnl Prerequisite: AC_PROG_CC
3073 AC_DEFUN([gt_TYPE_WINT_T],
3075 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
3076 [AC_TRY_COMPILE([#include <wchar.h>
3077 wint_t foo = (wchar_t)'\0';], ,
3078 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
3079 if test $gt_cv_c_wint_t = yes; then
3080 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
3084 # inttypes_h.m4 serial 5 (gettext-0.12)
3085 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3086 dnl This file is free software, distributed under the terms of the GNU
3087 dnl General Public License. As a special exception to the GNU General
3088 dnl Public License, this file may be distributed as part of a program
3089 dnl that contains a configuration script generated by Autoconf, under
3090 dnl the same distribution terms as the rest of that program.
3092 dnl From Paul Eggert.
3094 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
3095 # doesn't clash with <sys/types.h>, and declares uintmax_t.
3097 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
3099 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
3101 [#include <sys/types.h>
3102 #include <inttypes.h>],
3103 [uintmax_t i = (uintmax_t) -1;],
3104 jm_ac_cv_header_inttypes_h=yes,
3105 jm_ac_cv_header_inttypes_h=no)])
3106 if test $jm_ac_cv_header_inttypes_h = yes; then
3107 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
3108 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
3109 and declares uintmax_t. ])
3113 # stdint_h.m4 serial 3 (gettext-0.12)
3114 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3115 dnl This file is free software, distributed under the terms of the GNU
3116 dnl General Public License. As a special exception to the GNU General
3117 dnl Public License, this file may be distributed as part of a program
3118 dnl that contains a configuration script generated by Autoconf, under
3119 dnl the same distribution terms as the rest of that program.
3121 dnl From Paul Eggert.
3123 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3124 # doesn't clash with <sys/types.h>, and declares uintmax_t.
3126 AC_DEFUN([jm_AC_HEADER_STDINT_H],
3128 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
3130 [#include <sys/types.h>
3131 #include <stdint.h>],
3132 [uintmax_t i = (uintmax_t) -1;],
3133 jm_ac_cv_header_stdint_h=yes,
3134 jm_ac_cv_header_stdint_h=no)])
3135 if test $jm_ac_cv_header_stdint_h = yes; then
3136 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3137 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3138 and declares uintmax_t. ])
3142 # intmax.m4 serial 1 (gettext-0.12)
3143 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3144 dnl This file is free software, distributed under the terms of the GNU
3145 dnl General Public License. As a special exception to the GNU General
3146 dnl Public License, this file may be distributed as part of a program
3147 dnl that contains a configuration script generated by Autoconf, under
3148 dnl the same distribution terms as the rest of that program.
3150 dnl From Bruno Haible.
3151 dnl Test whether the system has the 'intmax_t' type, but don't attempt to
3152 dnl find a replacement if it is lacking.
3154 AC_DEFUN([gt_TYPE_INTMAX_T],
3156 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3157 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3158 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
3162 #if HAVE_STDINT_H_WITH_UINTMAX
3165 #if HAVE_INTTYPES_H_WITH_UINTMAX
3166 #include <inttypes.h>
3168 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
3169 if test $gt_cv_c_intmax_t = yes; then
3170 AC_DEFINE(HAVE_INTMAX_T, 1,
3171 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3175 # printf-posix.m4 serial 2 (gettext-0.13.1)
3176 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3177 dnl This file is free software, distributed under the terms of the GNU
3178 dnl General Public License. As a special exception to the GNU General
3179 dnl Public License, this file may be distributed as part of a program
3180 dnl that contains a configuration script generated by Autoconf, under
3181 dnl the same distribution terms as the rest of that program.
3183 dnl From Bruno Haible.
3184 dnl Test whether the printf() function supports POSIX/XSI format strings with
3187 AC_DEFUN([gt_PRINTF_POSIX],
3189 AC_REQUIRE([AC_PROG_CC])
3190 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
3191 gt_cv_func_printf_posix,
3196 /* The string "%2$d %1$d", with dollar characters protected from the shell's
3197 dollar expansion (possibly an autoconf bug). */
3198 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3199 static char buf[100];
3202 sprintf (buf, format, 33, 55);
3203 return (strcmp (buf, "55 33") != 0);
3204 }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
3206 AC_EGREP_CPP(notposix, [
3207 #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
3210 ], gt_cv_func_printf_posix="guessing no",
3211 gt_cv_func_printf_posix="guessing yes")
3214 case $gt_cv_func_printf_posix in
3216 AC_DEFINE(HAVE_POSIX_PRINTF, 1,
3217 [Define if your printf() function supports format strings with positions.])
3222 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
3223 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3224 dnl This file is free software, distributed under the terms of the GNU
3225 dnl General Public License. As a special exception to the GNU General
3226 dnl Public License, this file may be distributed as part of a program
3227 dnl that contains a configuration script generated by Autoconf, under
3228 dnl the same distribution terms as the rest of that program.
3230 # Test for the GNU C Library, version 2.1 or newer.
3231 # From Bruno Haible.
3233 AC_DEFUN([jm_GLIBC21],
3235 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
3236 ac_cv_gnu_library_2_1,
3237 [AC_EGREP_CPP([Lucky GNU user],
3239 #include <features.h>
3240 #ifdef __GNU_LIBRARY__
3241 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
3246 ac_cv_gnu_library_2_1=yes,
3247 ac_cv_gnu_library_2_1=no)
3251 GLIBC21="$ac_cv_gnu_library_2_1"
3255 # intdiv0.m4 serial 1 (gettext-0.11.3)
3256 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3257 dnl This file is free software, distributed under the terms of the GNU
3258 dnl General Public License. As a special exception to the GNU General
3259 dnl Public License, this file may be distributed as part of a program
3260 dnl that contains a configuration script generated by Autoconf, under
3261 dnl the same distribution terms as the rest of that program.
3263 dnl From Bruno Haible.
3265 AC_DEFUN([gt_INTDIV0],
3267 AC_REQUIRE([AC_PROG_CC])dnl
3268 AC_REQUIRE([AC_CANONICAL_HOST])dnl
3270 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
3271 gt_cv_int_divbyzero_sigfpe,
3279 sigfpe_handler (int sig)
3281 sigfpe_handler (sig) int sig;
3284 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
3285 exit (sig != SIGFPE);
3295 signal (SIGFPE, sigfpe_handler);
3296 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
3297 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
3298 signal (SIGTRAP, sigfpe_handler);
3300 /* Linux/SPARC yields signal SIGILL. */
3301 #if defined (__sparc__) && defined (__linux__)
3302 signal (SIGILL, sigfpe_handler);
3309 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
3311 # Guess based on the CPU.
3313 alpha* | i[34567]86 | m68k | s390*)
3314 gt_cv_int_divbyzero_sigfpe="guessing yes";;
3316 gt_cv_int_divbyzero_sigfpe="guessing no";;
3320 case "$gt_cv_int_divbyzero_sigfpe" in
3324 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
3325 [Define if integer division by zero raises signal SIGFPE.])
3328 # uintmax_t.m4 serial 7 (gettext-0.12)
3329 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3330 dnl This file is free software, distributed under the terms of the GNU
3331 dnl General Public License. As a special exception to the GNU General
3332 dnl Public License, this file may be distributed as part of a program
3333 dnl that contains a configuration script generated by Autoconf, under
3334 dnl the same distribution terms as the rest of that program.
3336 dnl From Paul Eggert.
3340 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
3341 # if it is not already defined in <stdint.h> or <inttypes.h>.
3343 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
3345 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3346 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3347 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3348 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3349 test $ac_cv_type_unsigned_long_long = yes \
3350 && ac_type='unsigned long long' \
3351 || ac_type='unsigned long'
3352 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
3353 [Define to unsigned long or unsigned long long
3354 if <stdint.h> and <inttypes.h> don't define.])
3356 AC_DEFINE(HAVE_UINTMAX_T, 1,
3357 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
3361 # ulonglong.m4 serial 3
3362 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
3363 dnl This file is free software, distributed under the terms of the GNU
3364 dnl General Public License. As a special exception to the GNU General
3365 dnl Public License, this file may be distributed as part of a program
3366 dnl that contains a configuration script generated by Autoconf, under
3367 dnl the same distribution terms as the rest of that program.
3369 dnl From Paul Eggert.
3371 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
3373 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
3375 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
3376 [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
3377 [unsigned long long ullmax = (unsigned long long) -1;
3378 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
3379 ac_cv_type_unsigned_long_long=yes,
3380 ac_cv_type_unsigned_long_long=no)])
3381 if test $ac_cv_type_unsigned_long_long = yes; then
3382 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
3383 [Define if you have the 'unsigned long long' type.])
3387 # inttypes.m4 serial 1 (gettext-0.11.4)
3388 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3389 dnl This file is free software, distributed under the terms of the GNU
3390 dnl General Public License. As a special exception to the GNU General
3391 dnl Public License, this file may be distributed as part of a program
3392 dnl that contains a configuration script generated by Autoconf, under
3393 dnl the same distribution terms as the rest of that program.
3395 dnl From Paul Eggert.
3397 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
3400 AC_DEFUN([gt_HEADER_INTTYPES_H],
3402 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
3405 [#include <sys/types.h>
3406 #include <inttypes.h>],
3407 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
3409 if test $gt_cv_header_inttypes_h = yes; then
3410 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
3411 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
3415 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
3416 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3417 dnl This file is free software, distributed under the terms of the GNU
3418 dnl General Public License. As a special exception to the GNU General
3419 dnl Public License, this file may be distributed as part of a program
3420 dnl that contains a configuration script generated by Autoconf, under
3421 dnl the same distribution terms as the rest of that program.
3423 dnl From Bruno Haible.
3425 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3426 # macros to non-string values. This is the case on AIX 4.3.3.
3428 AC_DEFUN([gt_INTTYPES_PRI],
3430 AC_REQUIRE([gt_HEADER_INTTYPES_H])
3431 if test $gt_cv_header_inttypes_h = yes; then
3432 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3433 gt_cv_inttypes_pri_broken,
3435 AC_TRY_COMPILE([#include <inttypes.h>
3439 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3442 if test "$gt_cv_inttypes_pri_broken" = yes; then
3443 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3444 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3449 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3450 dnl This file is free software, distributed under the terms of the GNU
3451 dnl General Public License. As a special exception to the GNU General
3452 dnl Public License, this file may be distributed as part of a program
3453 dnl that contains a configuration script generated by Autoconf, under
3454 dnl the same distribution terms as the rest of that program.
3456 AC_DEFUN([gl_XSIZE],
3458 dnl Prerequisites of lib/xsize.h.
3459 AC_REQUIRE([gl_SIZE_MAX])
3460 AC_CHECK_HEADERS(stdint.h)
3463 # size_max.m4 serial 2
3464 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3465 dnl This file is free software, distributed under the terms of the GNU
3466 dnl General Public License. As a special exception to the GNU General
3467 dnl Public License, this file may be distributed as part of a program
3468 dnl that contains a configuration script generated by Autoconf, under
3469 dnl the same distribution terms as the rest of that program.
3471 dnl From Bruno Haible.
3473 AC_DEFUN([gl_SIZE_MAX],
3475 AC_CHECK_HEADERS(stdint.h)
3476 dnl First test whether the system already has SIZE_MAX.
3477 AC_MSG_CHECKING([for SIZE_MAX])
3479 AC_EGREP_CPP([Found it], [
3488 if test -z "$result"; then
3489 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
3490 dnl than the type 'unsigned long'.
3491 dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
3492 dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
3493 _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
3494 [#include <stddef.h>], result=?)
3495 _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
3496 [#include <stddef.h>], result=?)
3497 _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
3498 [#include <stddef.h>], result=?)
3499 if test "$fits_in_uint" = 1; then
3500 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
3501 dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
3502 AC_TRY_COMPILE([#include <stddef.h>
3504 extern unsigned long foo;
3505 ], [], fits_in_uint=0)
3507 if test -z "$result"; then
3508 if test "$fits_in_uint" = 1; then
3509 result="$res_hi$res_lo"U
3511 result="$res_hi$res_lo"UL
3514 dnl Shouldn't happen, but who knows...
3518 AC_MSG_RESULT([$result])
3519 if test "$result" != yes; then
3520 AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
3521 [Define as the maximum value of type 'size_t', if the system doesn't define it.])
3525 # codeset.m4 serial AM1 (gettext-0.10.40)
3526 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3527 dnl This file is free software, distributed under the terms of the GNU
3528 dnl General Public License. As a special exception to the GNU General
3529 dnl Public License, this file may be distributed as part of a program
3530 dnl that contains a configuration script generated by Autoconf, under
3531 dnl the same distribution terms as the rest of that program.
3533 dnl From Bruno Haible.
3535 AC_DEFUN([AM_LANGINFO_CODESET],
3537 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
3538 [AC_TRY_LINK([#include <langinfo.h>],
3539 [char* cs = nl_langinfo(CODESET);],
3540 am_cv_langinfo_codeset=yes,
3541 am_cv_langinfo_codeset=no)
3543 if test $am_cv_langinfo_codeset = yes; then
3544 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
3545 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
3549 # lcmessage.m4 serial 3 (gettext-0.11.3)
3550 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
3551 dnl This file is free software, distributed under the terms of the GNU
3552 dnl General Public License. As a special exception to the GNU General
3553 dnl Public License, this file may be distributed as part of a program
3554 dnl that contains a configuration script generated by Autoconf, under
3555 dnl the same distribution terms as the rest of that program.
3557 dnl This file can can be used in projects which are not available under
3558 dnl the GNU General Public License or the GNU Library General Public
3559 dnl License but which still want to provide support for the GNU gettext
3561 dnl Please note that the actual code of the GNU gettext library is covered
3562 dnl by the GNU Library General Public License, and the rest of the GNU
3563 dnl gettext package package is covered by the GNU General Public License.
3564 dnl They are *not* in the public domain.
3567 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
3569 # Check whether LC_MESSAGES is available in <locale.h>.
3571 AC_DEFUN([AM_LC_MESSAGES],
3573 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
3574 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
3575 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
3576 if test $am_cv_val_LC_MESSAGES = yes; then
3577 AC_DEFINE(HAVE_LC_MESSAGES, 1,
3578 [Define if your <locale.h> file defines LC_MESSAGES.])