]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/dialog/dialog-1.0-20050306/m4.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / dialog / dialog-1.0-20050306 / m4.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
6 Index: dialog-1.0-20050306/acinclude.m4
7 ===================================================================
8 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
9 +++ dialog-1.0-20050306/acinclude.m4    2005-05-16 01:32:07.000000000 +0200
10 @@ -0,0 +1,1953 @@
11 +dnl ---------------------------------------------------------------------------
12 +dnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56
13 +dnl ------------
14 +dnl Conditionally generate script according to whether we're using the release
15 +dnl version of autoconf, or a patched version (using the ternary component as
16 +dnl the patch-version).
17 +define(CF_AC_PREREQ,
18 +[CF_PREREQ_COMPARE(
19 +AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
20 +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnl
21 +dnl ---------------------------------------------------------------------------
22 +dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52
23 +dnl -------------
24 +dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
25 +dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
26 +dnl but old versions (and some misinstalled ones) need that.  To make things
27 +dnl worse, gcc 3.x gives error messages if -I/usr/local/include is added to
28 +dnl the include-path).
29 +AC_DEFUN([CF_ADD_INCDIR],
30 +[
31 +for cf_add_incdir in $1
32 +do
33 +       while true
34 +       do
35 +               case $cf_add_incdir in
36 +               /usr/include) # (vi
37 +                       ;;
38 +               /usr/local/include) # (vi
39 +                       if test "$GCC" = yes
40 +                       then
41 +                               cf_save_CPPFLAGS="$CPPFLAGS"
42 +                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
43 +                               AC_TRY_COMPILE([#include <stdio.h>],
44 +                                               [printf("Hello")],
45 +                                               [],
46 +                                               [CPPFLAGS="$cf_save_CPPFLAGS"])
47 +                       fi
48 +                       ;;
49 +               *) # (vi
50 +                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
51 +                       ;;
52 +               esac
53 +               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
54 +               test "$cf_top_incdir" = "$cf_add_incdir" && break
55 +               cf_add_incdir="$cf_top_incdir"
56 +       done
57 +done
58 +])dnl
59 +dnl ---------------------------------------------------------------------------
60 +dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
61 +dnl --------------
62 +dnl Allow user to disable a normally-on option.
63 +AC_DEFUN([CF_ARG_DISABLE],
64 +[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
65 +dnl ---------------------------------------------------------------------------
66 +dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
67 +dnl -------------
68 +dnl Allow user to enable a normally-off option.
69 +AC_DEFUN([CF_ARG_ENABLE],
70 +[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
71 +dnl ---------------------------------------------------------------------------
72 +dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03
73 +dnl -----------------
74 +dnl Verbose form of AC_ARG_ENABLE:
75 +dnl
76 +dnl Parameters:
77 +dnl $1 = message
78 +dnl $2 = option name
79 +dnl $3 = help-string
80 +dnl $4 = action to perform if option is enabled
81 +dnl $5 = action if perform if option is disabled
82 +dnl $6 = default option value (either 'yes' or 'no')
83 +AC_DEFUN([CF_ARG_MSG_ENABLE],[
84 +AC_MSG_CHECKING($1)
85 +AC_ARG_ENABLE($2,[$3],,enableval=ifelse($6,,no,$6))
86 +AC_MSG_RESULT($enableval)
87 +if test "$enableval" != no ; then
88 +ifelse($4,,[   :],$4)
89 +else
90 +ifelse($5,,[   :],$5)
91 +fi
92 +])dnl
93 +dnl ---------------------------------------------------------------------------
94 +dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41
95 +dnl -------------
96 +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
97 +dnl values.
98 +dnl
99 +dnl Parameters:
100 +dnl $1 = option name
101 +dnl $2 = help-string
102 +dnl $3 = action to perform if option is not default
103 +dnl $4 = action if perform if option is default
104 +dnl $5 = default option value (either 'yes' or 'no')
105 +AC_DEFUN([CF_ARG_OPTION],
106 +[AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
107 +  if test "$enableval" != "$5" ; then
108 +ifelse($3,,[    :]dnl
109 +,[    $3]) ifelse($4,,,[
110 +  else
111 +    $4])
112 +  fi],[enableval=$5 ifelse($4,,,[
113 +  $4
114 +])dnl
115 +  ])])dnl
116 +dnl ---------------------------------------------------------------------------
117 +dnl CF_BUNDLED_INTL version: 10 updated: 2003/09/14 18:49:13
118 +dnl ---------------
119 +dnl Top-level macro for configuring an application with a bundled copy of
120 +dnl the intl and po directories for gettext.
121 +dnl
122 +dnl $1 specifies either Makefile or makefile, defaulting to the former.
123 +dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls
124 +dnl
125 +dnl Sets variables which can be used to substitute in makefiles:
126 +dnl    INTLDIR_MAKE - to make ./intl directory
127 +dnl    MSG_DIR_MAKE - to make ./po directory
128 +dnl    SUB_MAKEFILE - list of makefiles in ./intl, ./po directories
129 +dnl Defines
130 +dnl    HAVE_LIBGETTEXT_H if we're using ./intl
131 +dnl
132 +dnl Environment:
133 +dnl    ALL_LINGUAS if set, lists the root names of the ".po" files.
134 +dnl    CONFIG_H assumed to be "config.h"
135 +dnl    VERSION may be set, otherwise extract from "VERSION" file.
136 +dnl
137 +AH_TEMPLATE([HAVE_LIBGETTEXT_H], [Define if we're using ./intl.])
138 +AC_DEFUN([CF_BUNDLED_INTL],[
139 +cf_makefile=ifelse($1,,Makefile,$1)
140 +
141 +dnl Set of available languages (based on source distribution).  Note that
142 +dnl setting $LINGUAS overrides $ALL_LINGUAS.  Some environments set $LINGUAS
143 +dnl rather than $LC_ALL
144 +test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
145 +
146 +# Allow override of "config.h" definition:
147 +: ${CONFIG_H=config.h}
148 +AC_SUBST(CONFIG_H)
149 +
150 +if test -z "$VERSION" ; then
151 +if test -f $srcdir/VERSION ; then
152 +       VERSION=`sed -e '2,$d' $srcdir/VERSION|cut -f1`
153 +else
154 +       VERSION=unknown
155 +fi
156 +fi
157 +AC_SUBST(VERSION)
158 +
159 +AM_GNU_GETTEXT(,,,[$2])
160 +
161 +INTLDIR_MAKE=
162 +MSG_DIR_MAKE=
163 +SUB_MAKEFILE=
164 +
165 +dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE:
166 +CF_OUR_MESSAGES($1)
167 +
168 +if test "$USE_INCLUDED_LIBINTL" = yes ; then
169 +        if test "$nls_cv_force_use_gnu_gettext" = yes ; then
170 +               :
171 +       elif test "$nls_cv_use_gnu_gettext" = yes ; then
172 +               :
173 +       else
174 +               INTLDIR_MAKE="#"
175 +       fi
176 +       if test -z "$INTLDIR_MAKE"; then
177 +               AC_DEFINE(HAVE_LIBGETTEXT_H)
178 +               for cf_makefile in \
179 +                       $srcdir/intl/Makefile.in \
180 +                       $srcdir/intl/makefile.in
181 +               do
182 +                       if test -f "$cf_makefile" ; then
183 +                               SUB_MAKEFILE="$SUB_MAKEFILE `echo ${cf_makefile}|sed -e 's/\.in$//'`:${cf_makefile}"
184 +                               break
185 +                       fi
186 +               done
187 +       fi
188 +else
189 +       INTLDIR_MAKE="#"
190 +       if test "$USE_NLS" = yes ; then
191 +               AC_CHECK_HEADERS(libintl.h)
192 +       fi
193 +fi
194 +
195 +if test -z "$INTLDIR_MAKE" ; then
196 +       CPPFLAGS="-I../intl $CPPFLAGS"
197 +fi
198 +
199 +dnl FIXME:  we use this in lynx (the alternative is a spurious dependency upon
200 +dnl GNU make)
201 +if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
202 +       GT_YES="#"
203 +       GT_NO=
204 +else
205 +       GT_YES=
206 +       GT_NO="#"
207 +fi
208 +
209 +AC_SUBST(INTLDIR_MAKE)
210 +AC_SUBST(MSG_DIR_MAKE)
211 +AC_SUBST(GT_YES)
212 +AC_SUBST(GT_NO)
213 +
214 +dnl FIXME:  the underlying AM_GNU_GETTEXT macro either needs some fixes or a
215 +dnl little documentation.  It doesn't define anything so that we can ifdef our
216 +dnl own code, except ENABLE_NLS, which is too vague to be of any use.
217 +
218 +if test "$USE_INCLUDED_LIBINTL" = yes ; then
219 +       if test "$nls_cv_force_use_gnu_gettext" = yes ; then
220 +               AC_DEFINE(HAVE_GETTEXT)
221 +       elif test "$nls_cv_use_gnu_gettext" = yes ; then
222 +               AC_DEFINE(HAVE_GETTEXT)
223 +       fi
224 +       if test -n "$nls_cv_header_intl" ; then
225 +               AC_DEFINE(HAVE_LIBINTL_H)
226 +       fi
227 +fi
228 +])dnl
229 +dnl ---------------------------------------------------------------------------
230 +dnl CF_CHECK_CACHE version: 7 updated: 2001/12/19 00:50:10
231 +dnl --------------
232 +dnl Check if we're accidentally using a cache from a different machine.
233 +dnl Derive the system name, as a check for reusing the autoconf cache.
234 +dnl
235 +dnl If we've packaged config.guess and config.sub, run that (since it does a
236 +dnl better job than uname).  Normally we'll use AC_CANONICAL_HOST, but allow
237 +dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
238 +dnl which is useful in cross-compiles.
239 +AC_DEFUN([CF_CHECK_CACHE],
240 +[
241 +if test -f $srcdir/config.guess ; then
242 +       ifelse([$1],,[AC_CANONICAL_HOST],[$1])
243 +       system_name="$host_os"
244 +else
245 +       system_name="`(uname -s -r) 2>/dev/null`"
246 +       if test -z "$system_name" ; then
247 +               system_name="`(hostname) 2>/dev/null`"
248 +       fi
249 +fi
250 +AH_TEMPLATE([SYSTEM_NAME], [Set to the system name])
251 +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
252 +AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
253 +
254 +test -z "$system_name" && system_name="$cf_cv_system_name"
255 +test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
256 +
257 +if test ".$system_name" != ".$cf_cv_system_name" ; then
258 +       AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
259 +       AC_ERROR("Please remove config.cache and try again.")
260 +fi
261 +])dnl
262 +dnl ---------------------------------------------------------------------------
263 +dnl CF_CURSES_CHTYPE version: 6 updated: 2003/11/06 19:59:57
264 +dnl ----------------
265 +dnl Test if curses defines 'chtype' (usually a 'long' type for SysV curses).
266 +AH_TEMPLATE([HAVE_TYPE_CHTYPE], [Define if curses defines 'chtype'.])
267 +AH_TEMPLATE([TYPE_CHTYPE_IS_SCALAR], [Define if chtype is scalar rather than a struct.])
268 +AC_DEFUN([CF_CURSES_CHTYPE],
269 +[
270 +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
271 +AC_CACHE_CHECK(for chtype typedef,cf_cv_chtype_decl,[
272 +       AC_TRY_COMPILE([#include <${cf_cv_ncurses_header-curses.h}>],
273 +               [chtype foo],
274 +               [cf_cv_chtype_decl=yes],
275 +               [cf_cv_chtype_decl=no])])
276 +if test $cf_cv_chtype_decl = yes ; then
277 +       AC_DEFINE(HAVE_TYPE_CHTYPE)
278 +       AC_CACHE_CHECK(if chtype is scalar or struct,cf_cv_chtype_type,[
279 +               AC_TRY_COMPILE([#include <${cf_cv_ncurses_header-curses.h}>],
280 +                       [chtype foo; long x = foo],
281 +                       [cf_cv_chtype_type=scalar],
282 +                       [cf_cv_chtype_type=struct])])
283 +       if test $cf_cv_chtype_type = scalar ; then
284 +               AC_DEFINE(TYPE_CHTYPE_IS_SCALAR)
285 +       fi
286 +fi
287 +])dnl
288 +dnl ---------------------------------------------------------------------------
289 +dnl CF_CURSES_CPPFLAGS version: 7 updated: 2003/06/06 00:48:41
290 +dnl ------------------
291 +dnl Look for the curses headers.
292 +AC_DEFUN([CF_CURSES_CPPFLAGS],[
293 +
294 +AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
295 +cf_cv_curses_incdir=no
296 +case $host_os in #(vi
297 +hpux10.*|hpux11.*) #(vi
298 +       test -d /usr/include/curses_colr && \
299 +       cf_cv_curses_incdir="-I/usr/include/curses_colr"
300 +       ;;
301 +sunos3*|sunos4*)
302 +       test -d /usr/5lib && \
303 +       test -d /usr/5include && \
304 +       cf_cv_curses_incdir="-I/usr/5include"
305 +       ;;
306 +esac
307 +])
308 +test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
309 +
310 +AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
311 +cf_cv_ncurses_header=none
312 +for cf_header in \
313 +       curses.h \
314 +       ncurses.h \
315 +       ncurses/curses.h \
316 +       ncurses/ncurses.h
317 +do
318 +AC_TRY_COMPILE([#include <${cf_header}>],
319 +       [initscr(); tgoto("?", 0,0)],
320 +       [cf_cv_ncurses_header=$cf_header; break],[])
321 +done
322 +])
323 +
324 +if test "$cf_cv_ncurses_header" = none ; then
325 +       AC_MSG_ERROR(No curses header-files found)
326 +fi
327 +
328 +# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
329 +AC_CHECK_HEADERS($cf_cv_ncurses_header)
330 +
331 +])dnl
332 +dnl ---------------------------------------------------------------------------
333 +dnl CF_CURSES_FUNCS version: 12 updated: 2003/11/06 19:59:57
334 +dnl ---------------
335 +dnl Curses-functions are a little complicated, since a lot of them are macros.
336 +AC_DEFUN([CF_CURSES_FUNCS],
337 +[
338 +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
339 +AC_REQUIRE([CF_XOPEN_CURSES])
340 +AC_REQUIRE([CF_CURSES_TERM_H])
341 +for cf_func in $1
342 +do
343 +       CF_UPPER(cf_tr_func,$cf_func)
344 +       AC_MSG_CHECKING(for ${cf_func})
345 +       CF_MSG_LOG(${cf_func})
346 +       AC_CACHE_VAL(cf_cv_func_$cf_func,[
347 +               eval cf_result='$ac_cv_func_'$cf_func
348 +               if test ".$cf_result" != ".no"; then
349 +                       AC_TRY_LINK([
350 +#ifdef HAVE_XCURSES
351 +#include <xcurses.h>
352 +char * XCursesProgramName = "test";
353 +#else
354 +#include <${cf_cv_ncurses_header-curses.h}>
355 +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
356 +#include <ncursesw/term.h>
357 +#else
358 +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
359 +#include <ncurses/term.h>
360 +#else
361 +#ifdef HAVE_TERM_H
362 +#include <term.h>
363 +#endif
364 +#endif
365 +#endif
366 +#endif],
367 +                       [
368 +#ifndef ${cf_func}
369 +long foo = (long)(&${cf_func});
370 +exit(foo == 0);
371 +#endif
372 +                       ],
373 +                       [cf_result=yes],
374 +                       [cf_result=no])
375 +               fi
376 +               eval 'cf_cv_func_'$cf_func'=$cf_result'
377 +       ])
378 +       # use the computed/retrieved cache-value:
379 +       eval 'cf_result=$cf_cv_func_'$cf_func
380 +       AC_MSG_RESULT($cf_result)
381 +       if test $cf_result != no; then
382 +               AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func})
383 +       fi
384 +done
385 +])dnl
386 +dnl ---------------------------------------------------------------------------
387 +dnl CF_CURSES_LIBS version: 23 updated: 2003/11/06 19:59:57
388 +dnl --------------
389 +dnl Look for the curses libraries.  Older curses implementations may require
390 +dnl termcap/termlib to be linked as well.  Call CF_CURSES_CPPFLAGS first.
391 +AC_DEFUN([CF_CURSES_LIBS],[
392 +
393 +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
394 +AC_MSG_CHECKING(if we have identified curses libraries)
395 +AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
396 +       [initscr(); tgoto("?", 0,0)],
397 +       cf_result=yes,
398 +       cf_result=no)
399 +AC_MSG_RESULT($cf_result)
400 +
401 +if test "$cf_result" = no ; then
402 +case $host_os in #(vi
403 +freebsd*) #(vi
404 +       AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
405 +       ;;
406 +hpux10.*|hpux11.*) #(vi
407 +       AC_CHECK_LIB(cur_colr,initscr,[
408 +               LIBS="-lcur_colr $LIBS"
409 +               ac_cv_func_initscr=yes
410 +               ],[
411 +       AC_CHECK_LIB(Hcurses,initscr,[
412 +               # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
413 +               LIBS="-lHcurses $LIBS"
414 +               CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
415 +               ac_cv_func_initscr=yes
416 +               ])])
417 +       ;;
418 +linux*) # Suse Linux does not follow /usr/lib convention
419 +       LIBS="$LIBS -L/lib"
420 +       ;;
421 +sunos3*|sunos4*)
422 +       test -d /usr/5lib && \
423 +       LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
424 +       ac_cv_func_initscr=yes
425 +       ;;
426 +esac
427 +
428 +if test ".$ac_cv_func_initscr" != .yes ; then
429 +       cf_save_LIBS="$LIBS"
430 +       cf_term_lib=""
431 +       cf_curs_lib=""
432 +
433 +       if test ".${cf_cv_ncurses_version-no}" != .no
434 +       then
435 +               cf_check_list="ncurses curses cursesX"
436 +       else
437 +               cf_check_list="cursesX curses ncurses"
438 +       fi
439 +
440 +       # Check for library containing tgoto.  Do this before curses library
441 +       # because it may be needed to link the test-case for initscr.
442 +       AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
443 +               for cf_term_lib in $cf_check_list termcap termlib unknown
444 +               do
445 +                       AC_CHECK_LIB($cf_term_lib,tgoto,[break])
446 +               done
447 +       ])
448 +
449 +       # Check for library containing initscr
450 +       test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
451 +       for cf_curs_lib in $cf_check_list xcurses jcurses unknown
452 +       do
453 +               AC_CHECK_LIB($cf_curs_lib,initscr,[break])
454 +       done
455 +       test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
456 +
457 +       LIBS="-l$cf_curs_lib $cf_save_LIBS"
458 +       if test "$cf_term_lib" = unknown ; then
459 +               AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
460 +               AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
461 +                       [initscr()],
462 +                       [cf_result=yes],
463 +                       [cf_result=no])
464 +               AC_MSG_RESULT($cf_result)
465 +               test $cf_result = no && AC_ERROR(Cannot link curses library)
466 +       elif test "$cf_curs_lib" = "$cf_term_lib" ; then
467 +               :
468 +       elif test "$cf_term_lib" != predefined ; then
469 +               AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
470 +               AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
471 +                       [initscr(); tgoto((char *)0, 0, 0);],
472 +                       [cf_result=no],
473 +                       [
474 +                       LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
475 +                       AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
476 +                               [initscr()],
477 +                               [cf_result=yes],
478 +                               [cf_result=error])
479 +                       ])
480 +               AC_MSG_RESULT($cf_result)
481 +       fi
482 +fi
483 +fi
484 +
485 +])dnl
486 +dnl ---------------------------------------------------------------------------
487 +dnl CF_CURSES_TERM_H version: 6 updated: 2003/11/06 19:59:57
488 +dnl ----------------
489 +dnl SVr4 curses should have term.h as well (where it puts the definitions of
490 +dnl the low-level interface).  This may not be true in old/broken implementations,
491 +dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
492 +dnl running with Solaris 2.5.1).
493 +AC_DEFUN([CF_CURSES_TERM_H],
494 +[
495 +AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
496 +
497 +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
498 +# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
499 +# for <term.h> if we do not find the variant.
500 +for cf_header in \
501 +       `echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \
502 +       term.h
503 +do
504 +       AC_TRY_COMPILE([
505 +#include <${cf_cv_ncurses_header-curses.h}>
506 +#include <${cf_header}>],
507 +       [WINDOW *x],
508 +       [cf_cv_term_header=$cf_header
509 +        break],
510 +       [cf_cv_term_header=no])
511 +done
512 +])
513 +
514 +AH_TEMPLATE([HAVE_TERM_H], [define if you have term.h])
515 +AH_TEMPLATE([HAVE_NCURSES_TERM_H], [define if you have ncurses/term.h])
516 +AH_TEMPLATE([HAVE_NCURSESW_TERM_H], [define if you have ncursesw/term.h])
517 +case $cf_cv_term_header in #(vi
518 +term.h) #(vi
519 +       AC_DEFINE(HAVE_TERM_H)
520 +       ;;
521 +ncurses/term.h)
522 +       AC_DEFINE(HAVE_NCURSES_TERM_H)
523 +       ;;
524 +ncursesw/term.h)
525 +       AC_DEFINE(HAVE_NCURSESW_TERM_H)
526 +       ;;
527 +esac
528 +])dnl
529 +dnl ---------------------------------------------------------------------------
530 +dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
531 +dnl ----------
532 +dnl "dirname" is not portable, so we fake it with a shell script.
533 +AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
534 +dnl ---------------------------------------------------------------------------
535 +dnl CF_DISABLE_ECHO version: 10 updated: 2003/04/17 22:27:11
536 +dnl ---------------
537 +dnl You can always use "make -n" to see the actual options, but it's hard to
538 +dnl pick out/analyze warning messages when the compile-line is long.
539 +dnl
540 +dnl Sets:
541 +dnl    ECHO_LT - symbol to control if libtool is verbose
542 +dnl    ECHO_LD - symbol to prefix "cc -o" lines
543 +dnl    RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
544 +dnl    SHOW_CC - symbol to put before explicit "cc -c" lines
545 +dnl    ECHO_CC - symbol to put before any "cc" line
546 +dnl
547 +AC_DEFUN([CF_DISABLE_ECHO],[
548 +AC_MSG_CHECKING(if you want to see long compiling messages)
549 +CF_ARG_DISABLE(echo,
550 +       [  --disable-echo          display "compiling" commands],
551 +       [
552 +    ECHO_LT='--silent'
553 +    ECHO_LD='@echo linking [$]@;'
554 +    RULE_CC='  @echo compiling [$]<'
555 +    SHOW_CC='  @echo compiling [$]@'
556 +    ECHO_CC='@'
557 +],[
558 +    ECHO_LT=''
559 +    ECHO_LD=''
560 +    RULE_CC='# compiling'
561 +    SHOW_CC='# compiling'
562 +    ECHO_CC=''
563 +])
564 +AC_MSG_RESULT($enableval)
565 +AC_SUBST(ECHO_LT)
566 +AC_SUBST(ECHO_LD)
567 +AC_SUBST(RULE_CC)
568 +AC_SUBST(SHOW_CC)
569 +AC_SUBST(ECHO_CC)
570 +])dnl
571 +dnl ---------------------------------------------------------------------------
572 +dnl CF_FIND_LIBRARY version: 7 updated: 2000/04/13 21:38:04
573 +dnl ---------------
574 +dnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
575 +dnl prefer a standard location, and use -L options only if we do not find the
576 +dnl library in the standard library location(s).
577 +dnl    $1 = library name
578 +dnl    $2 = library class, usually the same as library name
579 +dnl    $3 = includes
580 +dnl    $4 = code fragment to compile/link
581 +dnl    $5 = corresponding function-name
582 +dnl    $6 = flag, nonnull if failure causes an error-exit
583 +dnl
584 +dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
585 +dnl to use a -L option.
586 +AC_DEFUN([CF_FIND_LIBRARY],
587 +[
588 +       eval 'cf_cv_have_lib_'$1'=no'
589 +       cf_libdir=""
590 +       AC_CHECK_FUNC($5,
591 +               eval 'cf_cv_have_lib_'$1'=yes',[
592 +               cf_save_LIBS="$LIBS"
593 +               AC_MSG_CHECKING(for $5 in -l$1)
594 +               LIBS="-l$1 $LIBS"
595 +               AC_TRY_LINK([$3],[$4],
596 +                       [AC_MSG_RESULT(yes)
597 +                        eval 'cf_cv_have_lib_'$1'=yes'
598 +                       ],
599 +                       [AC_MSG_RESULT(no)
600 +                       CF_LIBRARY_PATH(cf_search,$2)
601 +                       for cf_libdir in $cf_search
602 +                       do
603 +                               AC_MSG_CHECKING(for -l$1 in $cf_libdir)
604 +                               LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
605 +                               AC_TRY_LINK([$3],[$4],
606 +                                       [AC_MSG_RESULT(yes)
607 +                                        eval 'cf_cv_have_lib_'$1'=yes'
608 +                                        break],
609 +                                       [AC_MSG_RESULT(no)
610 +                                        LIBS="$cf_save_LIBS"])
611 +                       done
612 +                       ])
613 +               ])
614 +eval 'cf_found_library=[$]cf_cv_have_lib_'$1
615 +ifelse($6,,[
616 +if test $cf_found_library = no ; then
617 +       AC_ERROR(Cannot link $1 library)
618 +fi
619 +])
620 +])dnl
621 +dnl ---------------------------------------------------------------------------
622 +dnl CF_FUNC_WAIT version: 2 updated: 1997/10/21 19:45:33
623 +dnl ------------
624 +dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'
625 +dnl and/or 'waitpid()'.
626 +dnl
627 +dnl Note that we cannot simply grep for 'union wait' in the wait.h file,
628 +dnl because some Posix systems turn this on only when a BSD variable is
629 +dnl defined.
630 +dnl
631 +dnl I don't use AC_HEADER_SYS_WAIT, because it defines HAVE_SYS_WAIT_H, which
632 +dnl would conflict with an attempt to test that header directly.
633 +dnl
634 +AH_TEMPLATE([WAIT_USES_UNION], [Define if wait uses union])
635 +AH_TEMPLATE([WAITPID_USES_UNION], [Define if waitpid uses union])
636 +AC_DEFUN([CF_FUNC_WAIT],
637 +[
638 +AC_REQUIRE([CF_UNION_WAIT])
639 +if test $cf_cv_type_unionwait = yes; then
640 +
641 +       AC_MSG_CHECKING(if union wait can be used as wait-arg)
642 +       AC_CACHE_VAL(cf_cv_arg_union_wait,[
643 +               AC_TRY_COMPILE($cf_wait_headers,
644 +                       [union wait x; wait(&x)],
645 +                       [cf_cv_arg_union_wait=yes],
646 +                       [cf_cv_arg_union_wait=no])
647 +               ])
648 +       AC_MSG_RESULT($cf_cv_arg_union_wait)
649 +       test $cf_cv_arg_union_wait = yes && AC_DEFINE(WAIT_USES_UNION)
650 +
651 +       AC_MSG_CHECKING(if union wait can be used as waitpid-arg)
652 +       AC_CACHE_VAL(cf_cv_arg_union_waitpid,[
653 +               AC_TRY_COMPILE($cf_wait_headers,
654 +                       [union wait x; waitpid(0, &x, 0)],
655 +                       [cf_cv_arg_union_waitpid=yes],
656 +                       [cf_cv_arg_union_waitpid=no])
657 +               ])
658 +       AC_MSG_RESULT($cf_cv_arg_union_waitpid)
659 +       test $cf_cv_arg_union_waitpid = yes && AC_DEFINE(WAITPID_USES_UNION)
660 +
661 +fi
662 +])dnl
663 +dnl ---------------------------------------------------------------------------
664 +dnl CF_GCC_ATTRIBUTES version: 9 updated: 2002/12/21 19:25:52
665 +dnl -----------------
666 +dnl Test for availability of useful gcc __attribute__ directives to quiet
667 +dnl compiler warnings.  Though useful, not all are supported -- and contrary
668 +dnl to documentation, unrecognized directives cause older compilers to barf.
669 +AC_DEFUN([CF_GCC_ATTRIBUTES],
670 +[
671 +if test "$GCC" = yes
672 +then
673 +cat > conftest.i <<EOF
674 +#ifndef GCC_PRINTF
675 +#define GCC_PRINTF 0
676 +#endif
677 +#ifndef GCC_SCANF
678 +#define GCC_SCANF 0
679 +#endif
680 +#ifndef GCC_NORETURN
681 +#define GCC_NORETURN /* nothing */
682 +#endif
683 +#ifndef GCC_UNUSED
684 +#define GCC_UNUSED /* nothing */
685 +#endif
686 +EOF
687 +if test "$GCC" = yes
688 +then
689 +       AC_CHECKING([for $CC __attribute__ directives])
690 +cat > conftest.$ac_ext <<EOF
691 +#line __oline__ "configure"
692 +#include "confdefs.h"
693 +#include "conftest.h"
694 +#include "conftest.i"
695 +#if    GCC_PRINTF
696 +#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
697 +#else
698 +#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
699 +#endif
700 +#if    GCC_SCANF
701 +#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
702 +#else
703 +#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
704 +#endif
705 +extern void wow(char *,...) GCC_SCANFLIKE(1,2);
706 +extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
707 +extern void foo(void) GCC_NORETURN;
708 +int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
709 +EOF
710 +       for cf_attribute in scanf printf unused noreturn
711 +       do
712 +               CF_UPPER(CF_ATTRIBUTE,$cf_attribute)
713 +               cf_directive="__attribute__(($cf_attribute))"
714 +               echo "checking for $CC $cf_directive" 1>&AC_FD_CC
715 +               case $cf_attribute in
716 +               scanf|printf)
717 +               cat >conftest.h <<EOF
718 +#define GCC_$CF_ATTRIBUTE 1
719 +EOF
720 +                       ;;
721 +               *)
722 +               cat >conftest.h <<EOF
723 +#define GCC_$CF_ATTRIBUTE $cf_directive
724 +EOF
725 +                       ;;
726 +               esac
727 +               if AC_TRY_EVAL(ac_compile); then
728 +                       test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
729 +                       cat conftest.h >>confdefs.h
730 +               fi
731 +       done
732 +else
733 +       fgrep define conftest.i >>confdefs.h
734 +fi
735 +rm -rf conftest*
736 +fi
737 +])dnl
738 +dnl ---------------------------------------------------------------------------
739 +dnl CF_GCC_VERSION version: 3 updated: 2003/09/06 19:16:57
740 +dnl --------------
741 +dnl Find version of gcc
742 +AC_DEFUN([CF_GCC_VERSION],[
743 +AC_REQUIRE([AC_PROG_CC])
744 +GCC_VERSION=none
745 +if test "$GCC" = yes ; then
746 +       AC_MSG_CHECKING(version of $CC)
747 +       GCC_VERSION="`${CC} --version|sed -e '2,$d' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
748 +       test -z "$GCC_VERSION" && GCC_VERSION=unknown
749 +       AC_MSG_RESULT($GCC_VERSION)
750 +fi
751 +])dnl
752 +dnl ---------------------------------------------------------------------------
753 +dnl CF_GCC_WARNINGS version: 15 updated: 2003/07/05 18:42:30
754 +dnl ---------------
755 +dnl Check if the compiler supports useful warning options.  There's a few that
756 +dnl we don't use, simply because they're too noisy:
757 +dnl
758 +dnl    -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
759 +dnl    -Wredundant-decls (system headers make this too noisy)
760 +dnl    -Wtraditional (combines too many unrelated messages, only a few useful)
761 +dnl    -Wwrite-strings (too noisy, but should review occasionally).  This
762 +dnl            is enabled for ncurses using "--enable-const".
763 +dnl    -pedantic
764 +dnl
765 +AC_DEFUN([CF_GCC_WARNINGS],
766 +[
767 +AC_REQUIRE([CF_GCC_VERSION])
768 +if test "$GCC" = yes
769 +then
770 +       cat > conftest.$ac_ext <<EOF
771 +#line __oline__ "configure"
772 +int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
773 +EOF
774 +       AC_CHECKING([for $CC warning options])
775 +       cf_save_CFLAGS="$CFLAGS"
776 +       EXTRA_CFLAGS="-W -Wall"
777 +       cf_warn_CONST=""
778 +       test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
779 +       for cf_opt in \
780 +               Wbad-function-cast \
781 +               Wcast-align \
782 +               Wcast-qual \
783 +               Winline \
784 +               Wmissing-declarations \
785 +               Wmissing-prototypes \
786 +               Wnested-externs \
787 +               Wpointer-arith \
788 +               Wshadow \
789 +               Wstrict-prototypes \
790 +               Wundef $cf_warn_CONST
791 +       do
792 +               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
793 +               if AC_TRY_EVAL(ac_compile); then
794 +                       test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
795 +                       case $cf_opt in #(vi
796 +                       Wcast-qual) #(vi
797 +                               CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
798 +                               ;;
799 +                       Winline) #(vi
800 +                               case $GCC_VERSION in
801 +                               3.3*)
802 +                                       CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
803 +                                       continue;;
804 +                               esac
805 +                               ;;
806 +                       esac
807 +                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
808 +               fi
809 +       done
810 +       rm -f conftest*
811 +       CFLAGS="$cf_save_CFLAGS"
812 +fi
813 +AC_SUBST(EXTRA_CFLAGS)
814 +])dnl
815 +dnl ---------------------------------------------------------------------------
816 +dnl CF_GNU_SOURCE version: 3 updated: 2000/10/29 23:30:53
817 +dnl -------------
818 +dnl Check if we must define _GNU_SOURCE to get a reasonable value for
819 +dnl _XOPEN_SOURCE, upon which many POSIX definitions depend.  This is a defect
820 +dnl (or misfeature) of glibc2, which breaks portability of many applications,
821 +dnl since it is interwoven with GNU extensions.
822 +dnl
823 +dnl Well, yes we could work around it...
824 +AC_DEFUN([CF_GNU_SOURCE],
825 +[
826 +AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
827 +AC_TRY_COMPILE([#include <sys/types.h>],[
828 +#ifndef _XOPEN_SOURCE
829 +make an error
830 +#endif],
831 +       [cf_cv_gnu_source=no],
832 +       [cf_save="$CPPFLAGS"
833 +        CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
834 +        AC_TRY_COMPILE([#include <sys/types.h>],[
835 +#ifdef _XOPEN_SOURCE
836 +make an error
837 +#endif],
838 +       [cf_cv_gnu_source=no],
839 +       [cf_cv_gnu_source=yes])
840 +       CPPFLAGS="$cf_save"
841 +       ])
842 +])
843 +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
844 +])dnl
845 +dnl ---------------------------------------------------------------------------
846 +dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
847 +dnl --------------
848 +dnl Construct a search-list for a nonstandard header-file
849 +AC_DEFUN([CF_HEADER_PATH],
850 +[CF_SUBDIR_PATH($1,$2,include)
851 +test "$includedir" != NONE && \
852 +test "$includedir" != "/usr/include" && \
853 +test -d "$includedir" && {
854 +       test -d $includedir &&    $1="[$]$1 $includedir"
855 +       test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
856 +}
857 +
858 +test "$oldincludedir" != NONE && \
859 +test "$oldincludedir" != "/usr/include" && \
860 +test -d "$oldincludedir" && {
861 +       test -d $oldincludedir    && $1="[$]$1 $oldincludedir"
862 +       test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
863 +}
864 +
865 +])dnl
866 +dnl ---------------------------------------------------------------------------
867 +dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
868 +dnl ---------------
869 +dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
870 +AC_DEFUN([CF_HELP_MESSAGE],
871 +[AC_DIVERT_HELP([$1])dnl
872 +])dnl
873 +dnl ---------------------------------------------------------------------------
874 +dnl CF_INCLUDE_DIRS version: 4 updated: 2002/12/01 00:12:15
875 +dnl ---------------
876 +dnl Construct the list of include-options according to whether we're building
877 +dnl in the source directory or using '--srcdir=DIR' option.  If we're building
878 +dnl with gcc, don't append the includedir if it happens to be /usr/include,
879 +dnl since that usually breaks gcc's shadow-includes.
880 +AC_DEFUN([CF_INCLUDE_DIRS],
881 +[
882 +CPPFLAGS="-I. -I../include $CPPFLAGS"
883 +if test "$srcdir" != "."; then
884 +       CPPFLAGS="-I\$(srcdir)/../include $CPPFLAGS"
885 +fi
886 +if test "$GCC" != yes; then
887 +       CPPFLAGS="$CPPFLAGS -I\$(includedir)"
888 +elif test "$includedir" != "/usr/include"; then
889 +       if test "$includedir" = '${prefix}/include' ; then
890 +               if test $prefix != /usr ; then
891 +                       CPPFLAGS="$CPPFLAGS -I\$(includedir)"
892 +               fi
893 +       else
894 +               CPPFLAGS="$CPPFLAGS -I\$(includedir)"
895 +       fi
896 +fi
897 +AC_SUBST(CPPFLAGS)
898 +])dnl
899 +dnl ---------------------------------------------------------------------------
900 +dnl CF_INCLUDE_PATH version: 4 updated: 2001/04/15 21:21:45
901 +dnl ---------------
902 +dnl    Adds to the include-path
903 +dnl
904 +dnl    Autoconf 1.11 should have provided a way to add include path options to
905 +dnl    the cpp-tests.
906 +dnl
907 +AC_DEFUN([CF_INCLUDE_PATH],
908 +[
909 +for cf_path in $1
910 +do
911 +       cf_result="no"
912 +       AC_MSG_CHECKING(for directory $cf_path)
913 +       if test -d $cf_path
914 +       then
915 +               INCLUDES="$INCLUDES -I$cf_path"
916 +               ac_cpp="${ac_cpp} -I$cf_path"
917 +               CFLAGS="$CFLAGS -I$cf_path"
918 +               cf_result="yes"
919 +               case $cf_path in
920 +               /usr/include|/usr/include/*)
921 +                       ;;
922 +               *)
923 +                       CF_DIRNAME(cf_temp,$cf_path)
924 +                       case $cf_temp in
925 +                       */include)
926 +                               INCLUDES="$INCLUDES -I$cf_temp"
927 +                               ac_cpp="${ac_cpp} -I$cf_temp"
928 +                               CFLAGS="$CFLAGS -I$cf_temp"
929 +                               ;;
930 +                       esac
931 +               esac
932 +       fi
933 +       AC_MSG_RESULT($cf_result)
934 +done
935 +])dnl
936 +dnl ---------------------------------------------------------------------------
937 +dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59
938 +dnl ---------------
939 +dnl Construct a search-list for a nonstandard library-file
940 +AC_DEFUN([CF_LIBRARY_PATH],
941 +[CF_SUBDIR_PATH($1,$2,lib)])dnl
942 +dnl ---------------------------------------------------------------------------
943 +dnl CF_LIB_PREFIX version: 7 updated: 2001/01/12 01:23:48
944 +dnl -------------
945 +dnl Compute the library-prefix for the given host system
946 +dnl $1 = variable to set
947 +AC_DEFUN([CF_LIB_PREFIX],
948 +[
949 +       case $cf_cv_system_name in
950 +       OS/2*)  LIB_PREFIX=''     ;;
951 +       os2*)   LIB_PREFIX=''     ;;
952 +       *)      LIB_PREFIX='lib'  ;;
953 +       esac
954 +ifelse($1,,,[$1=$LIB_PREFIX])
955 +       AC_SUBST(LIB_PREFIX)
956 +])dnl
957 +dnl ---------------------------------------------------------------------------
958 +dnl CF_MAKEFLAGS version: 9 updated: 2001/12/30 18:17:27
959 +dnl ------------
960 +dnl Some 'make' programs support $(MAKEFLAGS), some $(MFLAGS), to pass 'make'
961 +dnl options to lower-levels.  It's very useful for "make -n" -- if we have it.
962 +dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
963 +dnl $(MAKEFLAGS) variable incompatible because it adds the assignments :-)
964 +AC_DEFUN([CF_MAKEFLAGS],
965 +[
966 +AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
967 +       cf_cv_makeflags=''
968 +       for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
969 +       do
970 +               cat >cf_makeflags.tmp <<CF_EOF
971 +SHELL = /bin/sh
972 +all :
973 +       @ echo '.$cf_option'
974 +CF_EOF
975 +               cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
976 +               case "$cf_result" in
977 +               .*k)
978 +                       cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
979 +                       case "$cf_result" in
980 +                       .*CC=*) cf_cv_makeflags=
981 +                               ;;
982 +                       *)      cf_cv_makeflags=$cf_option
983 +                               ;;
984 +                       esac
985 +                       break
986 +                       ;;
987 +               *)      echo no match "$cf_result"
988 +                       ;;
989 +               esac
990 +       done
991 +       rm -f cf_makeflags.tmp
992 +])
993 +
994 +AC_SUBST(cf_cv_makeflags)
995 +])dnl
996 +dnl ---------------------------------------------------------------------------
997 +dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40
998 +dnl ------------
999 +dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we have
1000 +dnl a monocase filesystem.
1001 +AC_DEFUN([CF_MAKE_TAGS],[
1002 +AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
1003 +AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no)
1004 +
1005 +if test "$cf_cv_mixedcase" = yes ; then
1006 +       AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no)
1007 +else
1008 +       MAKE_UPPER_TAGS=no
1009 +fi
1010 +
1011 +if test "$MAKE_UPPER_TAGS" = yes ; then
1012 +       MAKE_UPPER_TAGS=
1013 +else
1014 +       MAKE_UPPER_TAGS="#"
1015 +fi
1016 +AC_SUBST(MAKE_UPPER_TAGS)
1017 +
1018 +if test "$MAKE_LOWER_TAGS" = yes ; then
1019 +       MAKE_LOWER_TAGS=
1020 +else
1021 +       MAKE_LOWER_TAGS="#"
1022 +fi
1023 +AC_SUBST(MAKE_LOWER_TAGS)
1024 +])dnl
1025 +dnl ---------------------------------------------------------------------------
1026 +dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10
1027 +dnl -----------
1028 +dnl Checks for libraries.  At least one UNIX system, Apple Macintosh
1029 +dnl Rhapsody 5.5, does not have -lm.  We cannot use the simpler
1030 +dnl AC_CHECK_LIB(m,sin), because that fails for C++.
1031 +AC_DEFUN([CF_MATH_LIB],
1032 +[
1033 +AC_CACHE_CHECK(if -lm needed for math functions,
1034 +       cf_cv_need_libm,[
1035 +       AC_TRY_LINK([
1036 +       #include <stdio.h>
1037 +       #include <math.h>
1038 +       ],
1039 +       [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)],
1040 +       [cf_cv_need_libm=no],
1041 +       [cf_cv_need_libm=yes])])
1042 +if test "$cf_cv_need_libm" = yes
1043 +then
1044 +ifelse($1,,[
1045 +       LIBS="$LIBS -lm"
1046 +],[$1=-lm])
1047 +fi
1048 +])
1049 +dnl ---------------------------------------------------------------------------
1050 +dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
1051 +dnl ----------------------
1052 +dnl Check if the file-system supports mixed-case filenames.  If we're able to
1053 +dnl create a lowercase name and see it as uppercase, it doesn't support that.
1054 +AH_TEMPLATE([MIXEDCASE_FILENAMES],[Define if the file-system supports mixed-case filenames.])
1055 +AC_DEFUN([CF_MIXEDCASE_FILENAMES],
1056 +[
1057 +AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
1058 +if test "$cross_compiling" = yes ; then
1059 +       case $target_alias in #(vi
1060 +       *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
1061 +               cf_cv_mixedcase=no
1062 +               ;;
1063 +       *)
1064 +               cf_cv_mixedcase=yes
1065 +               ;;
1066 +       esac
1067 +else
1068 +       rm -f conftest CONFTEST
1069 +       echo test >conftest
1070 +       if test -f CONFTEST ; then
1071 +               cf_cv_mixedcase=no
1072 +       else
1073 +               cf_cv_mixedcase=yes
1074 +       fi
1075 +       rm -f conftest CONFTEST
1076 +fi
1077 +])
1078 +test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
1079 +])dnl
1080 +dnl ---------------------------------------------------------------------------
1081 +dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52
1082 +dnl ----------
1083 +dnl Write a debug message to config.log, along with the line number in the
1084 +dnl configure script.
1085 +AC_DEFUN([CF_MSG_LOG],[
1086 +echo "(line __oline__) testing $* ..." 1>&AC_FD_CC
1087 +])dnl
1088 +dnl ---------------------------------------------------------------------------
1089 +dnl CF_NCURSES_CC_CHECK version: 3 updated: 2003/01/12 18:59:28
1090 +dnl -------------------
1091 +dnl Check if we can compile with ncurses' header file
1092 +dnl $1 is the cache variable to set
1093 +dnl $2 is the header-file to include
1094 +dnl $3 is the root name (ncurses or ncursesw)
1095 +AC_DEFUN([CF_NCURSES_CC_CHECK],[
1096 +       AC_TRY_COMPILE([
1097 +]ifelse($3,ncursesw,[
1098 +#define _XOPEN_SOURCE_EXTENDED
1099 +#undef  HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
1100 +#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
1101 +])[
1102 +#include <$2>],[
1103 +#ifdef NCURSES_VERSION
1104 +]ifelse($3,ncursesw,[
1105 +#ifndef WACS_BSSB
1106 +       make an error
1107 +#endif
1108 +])[
1109 +printf("%s\n", NCURSES_VERSION);
1110 +#else
1111 +#ifdef __NCURSES_H
1112 +printf("old\n");
1113 +#else
1114 +       make an error
1115 +#endif
1116 +#endif
1117 +       ]
1118 +       ,[$1=$cf_header]
1119 +       ,[$1=no])
1120 +])dnl
1121 +dnl ---------------------------------------------------------------------------
1122 +dnl CF_NCURSES_CPPFLAGS version: 17 updated: 2003/11/06 19:59:57
1123 +dnl -------------------
1124 +dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
1125 +dnl the CPPFLAGS variable so we can include its header.
1126 +dnl
1127 +dnl The header files may be installed as either curses.h, or ncurses.h (would
1128 +dnl be obsolete, except that some packagers prefer this name to distinguish it
1129 +dnl from a "native" curses implementation).  If not installed for overwrite,
1130 +dnl the curses.h file would be in an ncurses subdirectory (e.g.,
1131 +dnl /usr/include/ncurses), but someone may have installed overwriting the
1132 +dnl vendor's curses.  Only very old versions (pre-1.9.2d, the first autoconf'd
1133 +dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
1134 +dnl the header.
1135 +dnl
1136 +dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
1137 +dnl is already in the include-path, don't even bother with this, since we cannot
1138 +dnl easily determine which file it is.  In this case, it has to be <curses.h>.
1139 +dnl
1140 +dnl The optional parameter gives the root name of the library, in case it is
1141 +dnl not installed as the default curses library.  That is how the
1142 +dnl wide-character version of ncurses is installed.
1143 +AC_DEFUN([CF_NCURSES_CPPFLAGS],
1144 +[AC_REQUIRE([CF_WITH_CURSES_DIR])
1145 +
1146 +AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl
1147 +cf_ncuhdr_root=ifelse($1,,ncurses,$1)
1148 +
1149 +test -n "$cf_cv_curses_dir" && \
1150 +test "$cf_cv_curses_dir" != "no" && \
1151 +CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
1152 +
1153 +AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
1154 +       cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
1155 +       ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
1156 +       for cf_header in $cf_header_list
1157 +       do
1158 +               CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
1159 +               test "$cf_cv_ncurses_h" != no && break
1160 +       done
1161 +])
1162 +
1163 +if test "$cf_cv_ncurses_h" != no ; then
1164 +       cf_cv_ncurses_header=$cf_cv_ncurses_h
1165 +else
1166 +AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
1167 +       test -n "$verbose" && echo
1168 +       CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
1169 +       test -n "$verbose" && echo search path $cf_search
1170 +       cf_save2_CPPFLAGS="$CPPFLAGS"
1171 +       for cf_incdir in $cf_search
1172 +       do
1173 +               CF_ADD_INCDIR($cf_incdir)
1174 +               for cf_header in \
1175 +                       ncurses.h \
1176 +                       curses.h
1177 +               do
1178 +                       CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
1179 +                       if test "$cf_cv_ncurses_h2" != no ; then
1180 +                               cf_cv_ncurses_h2=$cf_incdir/$cf_header
1181 +                               test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&AC_FD_MSG
1182 +                               break
1183 +                       fi
1184 +                       test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
1185 +               done
1186 +               CPPFLAGS="$cf_save2_CPPFLAGS"
1187 +               test "$cf_cv_ncurses_h2" != no && break
1188 +       done
1189 +       test "$cf_cv_ncurses_h2" = no && AC_ERROR(not found)
1190 +       ])
1191 +
1192 +       CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
1193 +       cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
1194 +       if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
1195 +               cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
1196 +       fi
1197 +       CF_ADD_INCDIR($cf_1st_incdir)
1198 +
1199 +fi
1200 +
1201 +
1202 +AH_TEMPLATE([NCURSES],[Define if you have ncurses])
1203 +AH_TEMPLATE([HAVE_NCURSES_H],[Define if you have ncurses.h])
1204 +AH_TEMPLATE([HAVE_NCURSES_NCURSES_H],[Define if you have ncurses/ncurses.h])
1205 +AH_TEMPLATE([HAVE_NCURSESW_NCURSES_H],[Define if you have ncursesw/ncurses.h])
1206 +
1207 +AC_DEFINE(NCURSES)
1208 +case $cf_cv_ncurses_header in # (vi
1209 +*ncurses.h)
1210 +       AC_DEFINE(HAVE_NCURSES_H)
1211 +       ;;
1212 +esac
1213 +
1214 +case $cf_cv_ncurses_header in # (vi
1215 +ncurses/curses.h|ncurses/ncurses.h)
1216 +       AC_DEFINE(HAVE_NCURSES_NCURSES_H)
1217 +       ;;
1218 +ncursesw/curses.h|ncursesw/ncurses.h)
1219 +       AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
1220 +       ;;
1221 +esac
1222 +
1223 +CF_NCURSES_VERSION
1224 +])dnl
1225 +dnl ---------------------------------------------------------------------------
1226 +dnl CF_NCURSES_LIBS version: 11 updated: 2002/12/22 14:22:25
1227 +dnl ---------------
1228 +dnl Look for the ncurses library.  This is a little complicated on Linux,
1229 +dnl because it may be linked with the gpm (general purpose mouse) library.
1230 +dnl Some distributions have gpm linked with (bsd) curses, which makes it
1231 +dnl unusable with ncurses.  However, we don't want to link with gpm unless
1232 +dnl ncurses has a dependency, since gpm is normally set up as a shared library,
1233 +dnl and the linker will record a dependency.
1234 +dnl
1235 +dnl The optional parameter gives the root name of the library, in case it is
1236 +dnl not installed as the default curses library.  That is how the
1237 +dnl wide-character version of ncurses is installed.
1238 +AC_DEFUN([CF_NCURSES_LIBS],
1239 +[AC_REQUIRE([CF_NCURSES_CPPFLAGS])
1240 +
1241 +cf_nculib_root=ifelse($1,,ncurses,$1)
1242 +       # This works, except for the special case where we find gpm, but
1243 +       # ncurses is in a nonstandard location via $LIBS, and we really want
1244 +       # to link gpm.
1245 +cf_ncurses_LIBS=""
1246 +cf_ncurses_SAVE="$LIBS"
1247 +AC_CHECK_LIB(gpm,Gpm_Open,
1248 +       [AC_CHECK_LIB(gpm,initscr,
1249 +               [LIBS="$cf_ncurses_SAVE"],
1250 +               [cf_ncurses_LIBS="-lgpm"])])
1251 +
1252 +case $host_os in #(vi
1253 +freebsd*)
1254 +       # This is only necessary if you are linking against an obsolete
1255 +       # version of ncurses (but it should do no harm, since it's static).
1256 +       AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
1257 +       ;;
1258 +esac
1259 +
1260 +LIBS="$cf_ncurses_LIBS $LIBS"
1261 +
1262 +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
1263 +then
1264 +       LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
1265 +else
1266 +       CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
1267 +               [#include <${cf_cv_ncurses_header-curses.h}>],
1268 +               [initscr()],
1269 +               initscr)
1270 +fi
1271 +
1272 +if test -n "$cf_ncurses_LIBS" ; then
1273 +       AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
1274 +       cf_ncurses_SAVE="$LIBS"
1275 +       for p in $cf_ncurses_LIBS ; do
1276 +               q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
1277 +               if test "$q" != "$LIBS" ; then
1278 +                       LIBS="$q"
1279 +               fi
1280 +       done
1281 +       AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1282 +               [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
1283 +               [AC_MSG_RESULT(yes)],
1284 +               [AC_MSG_RESULT(no)
1285 +                LIBS="$cf_ncurses_SAVE"])
1286 +fi
1287 +
1288 +CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
1289 +AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
1290 +])dnl
1291 +dnl ---------------------------------------------------------------------------
1292 +dnl CF_NCURSES_VERSION version: 11 updated: 2003/11/06 19:59:57
1293 +dnl ------------------
1294 +dnl Check for the version of ncurses, to aid in reporting bugs, etc.
1295 +dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS.  We don't use
1296 +dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
1297 +AC_DEFUN([CF_NCURSES_VERSION],
1298 +[
1299 +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1300 +AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
1301 +       cf_cv_ncurses_version=no
1302 +       cf_tempfile=out$$
1303 +       rm -f $cf_tempfile
1304 +       AC_TRY_RUN([
1305 +#include <${cf_cv_ncurses_header-curses.h}>
1306 +#include <stdio.h>
1307 +int main()
1308 +{
1309 +       FILE *fp = fopen("$cf_tempfile", "w");
1310 +#ifdef NCURSES_VERSION
1311 +# ifdef NCURSES_VERSION_PATCH
1312 +       fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
1313 +# else
1314 +       fprintf(fp, "%s\n", NCURSES_VERSION);
1315 +# endif
1316 +#else
1317 +# ifdef __NCURSES_H
1318 +       fprintf(fp, "old\n");
1319 +# else
1320 +       make an error
1321 +# endif
1322 +#endif
1323 +       exit(0);
1324 +}],[
1325 +       cf_cv_ncurses_version=`cat $cf_tempfile`],,[
1326 +
1327 +       # This will not work if the preprocessor splits the line after the
1328 +       # Autoconf token.  The 'unproto' program does that.
1329 +       cat > conftest.$ac_ext <<EOF
1330 +#include <${cf_cv_ncurses_header-curses.h}>
1331 +#undef Autoconf
1332 +#ifdef NCURSES_VERSION
1333 +Autoconf NCURSES_VERSION
1334 +#else
1335 +#ifdef __NCURSES_H
1336 +Autoconf "old"
1337 +#endif
1338 +;
1339 +#endif
1340 +EOF
1341 +       cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
1342 +       AC_TRY_EVAL(cf_try)
1343 +       if test -f conftest.out ; then
1344 +               cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'`
1345 +               test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
1346 +               rm -f conftest.out
1347 +       fi
1348 +])
1349 +       rm -f $cf_tempfile
1350 +])
1351 +test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
1352 +])dnl
1353 +dnl ---------------------------------------------------------------------------
1354 +dnl CF_OUR_MESSAGES version: 5 updated: 2003/06/16 20:33:11
1355 +dnl ---------------
1356 +dnl Check if we use the messages included with this program
1357 +dnl
1358 +dnl $1 specifies either Makefile or makefile, defaulting to the former.
1359 +dnl
1360 +dnl Sets variables which can be used to substitute in makefiles:
1361 +dnl    MSG_DIR_MAKE - to make ./po directory
1362 +dnl    SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL)
1363 +dnl
1364 +AC_DEFUN([CF_OUR_MESSAGES],
1365 +[
1366 +cf_makefile=ifelse($1,,Makefile,$1)
1367 +
1368 +use_our_messages=no
1369 +if test "$USE_NLS" = yes ; then
1370 +if test -d $srcdir/po ; then
1371 +AC_MSG_CHECKING(if we should use included message-library)
1372 +       AC_ARG_ENABLE(included-msgs,
1373 +       [  --enable-included-msgs  use included messages, for i18n support],
1374 +       [use_our_messages=$enableval],
1375 +       [use_our_messages=yes])
1376 +fi
1377 +AC_MSG_RESULT($use_our_messages)
1378 +fi
1379 +
1380 +MSG_DIR_MAKE="#"
1381 +if test "$use_our_messages" = yes
1382 +then
1383 +       SUB_MAKEFILE="$SUB_MAKEFILE $srcdir/po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn"
1384 +       MSG_DIR_MAKE=
1385 +fi
1386 +
1387 +AC_SUBST(MSG_DIR_MAKE)
1388 +AC_SUBST(SUB_MAKEFILE)
1389 +])dnl
1390 +dnl ---------------------------------------------------------------------------
1391 +dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53
1392 +dnl ----------
1393 +dnl Provide a value for the $PATH and similar separator
1394 +AC_DEFUN([CF_PATHSEP],
1395 +[
1396 +       case $cf_cv_system_name in
1397 +       os2*)   PATHSEP=';'  ;;
1398 +       *)      PATHSEP=':'  ;;
1399 +       esac
1400 +ifelse($1,,,[$1=$PATHSEP])
1401 +       AC_SUBST(PATHSEP)
1402 +])dnl
1403 +dnl ---------------------------------------------------------------------------
1404 +dnl CF_PATH_SYNTAX version: 9 updated: 2002/09/17 23:03:38
1405 +dnl --------------
1406 +dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
1407 +dnl begins with one of the prefix/exec_prefix variables, and then again if the
1408 +dnl result begins with 'NONE'.  This is necessary to work around autoconf's
1409 +dnl delayed evaluation of those symbols.
1410 +AC_DEFUN([CF_PATH_SYNTAX],[
1411 +case ".[$]$1" in #(vi
1412 +.\[$]\(*\)*|.\'*\'*) #(vi
1413 +  ;;
1414 +..|./*|.\\*) #(vi
1415 +  ;;
1416 +.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
1417 +  ;;
1418 +.\[$]{*prefix}*) #(vi
1419 +  eval $1="[$]$1"
1420 +  case ".[$]$1" in #(vi
1421 +  .NONE/*)
1422 +    $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
1423 +    ;;
1424 +  esac
1425 +  ;; #(vi
1426 +.NONE/*)
1427 +  $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
1428 +  ;;
1429 +*)
1430 +  ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
1431 +  ;;
1432 +esac
1433 +])dnl
1434 +dnl ---------------------------------------------------------------------------
1435 +dnl CF_PROG_EXT version: 9 updated: 2003/10/18 16:36:22
1436 +dnl -----------
1437 +dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
1438 +AH_TEMPLATE([PROG_EXT],[Set to prog extension])
1439 +AC_DEFUN([CF_PROG_EXT],
1440 +[
1441 +AC_REQUIRE([CF_CHECK_CACHE])
1442 +case $cf_cv_system_name in
1443 +os2*)
1444 +    # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
1445 +    CFLAGS="$CFLAGS -Zmt"
1446 +    CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
1447 +    CXXFLAGS="$CXXFLAGS -Zmt"
1448 +    LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed -e "s%-Zexe%%g"`
1449 +    ;;
1450 +esac
1451 +
1452 +AC_EXEEXT
1453 +AC_OBJEXT
1454 +
1455 +PROG_EXT="$EXEEXT"
1456 +AC_SUBST(PROG_EXT)
1457 +test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
1458 +])dnl
1459 +dnl ---------------------------------------------------------------------------
1460 +dnl CF_SUBDIR_PATH version: 3 updated: 2002/12/29 18:30:46
1461 +dnl --------------
1462 +dnl Construct a search-list for a nonstandard header/lib-file
1463 +dnl    $1 = the variable to return as result
1464 +dnl    $2 = the package name
1465 +dnl    $3 = the subdirectory, e.g., bin, include or lib
1466 +AC_DEFUN([CF_SUBDIR_PATH],
1467 +[$1=""
1468 +
1469 +test -d [$]HOME && {
1470 +       test -n "$verbose" && echo "    ... testing $3-directories under [$]HOME"
1471 +       test -d [$]HOME/$3 &&          $1="[$]$1 [$]HOME/$3"
1472 +       test -d [$]HOME/$3/$2 &&       $1="[$]$1 [$]HOME/$3/$2"
1473 +       test -d [$]HOME/$3/$2/$3 &&    $1="[$]$1 [$]HOME/$3/$2/$3"
1474 +}
1475 +
1476 +# For other stuff under the home directory, it should be sufficient to put
1477 +# a symbolic link for $HOME/$2 to the actual package location:
1478 +test -d [$]HOME/$2 && {
1479 +       test -n "$verbose" && echo "    ... testing $3-directories under [$]HOME/$2"
1480 +       test -d [$]HOME/$2/$3 &&       $1="[$]$1 [$]HOME/$2/$3"
1481 +       test -d [$]HOME/$2/$3/$2 &&    $1="[$]$1 [$]HOME/$2/$3/$2"
1482 +}
1483 +
1484 +test "$prefix" != /usr/local && \
1485 +test -d /usr/local && {
1486 +       test -n "$verbose" && echo "    ... testing $3-directories under /usr/local"
1487 +       test -d /usr/local/$3 &&       $1="[$]$1 /usr/local/$3"
1488 +       test -d /usr/local/$3/$2 &&    $1="[$]$1 /usr/local/$3/$2"
1489 +       test -d /usr/local/$3/$2/$3 && $1="[$]$1 /usr/local/$3/$2/$3"
1490 +       test -d /usr/local/$2/$3 &&    $1="[$]$1 /usr/local/$2/$3"
1491 +       test -d /usr/local/$2/$3/$2 && $1="[$]$1 /usr/local/$2/$3/$2"
1492 +}
1493 +
1494 +test "$prefix" != NONE && \
1495 +test -d $prefix && {
1496 +       test -n "$verbose" && echo "    ... testing $3-directories under $prefix"
1497 +       test -d $prefix/$3 &&          $1="[$]$1 $prefix/$3"
1498 +       test -d $prefix/$3/$2 &&       $1="[$]$1 $prefix/$3/$2"
1499 +       test -d $prefix/$3/$2/$3 &&    $1="[$]$1 $prefix/$3/$2/$3"
1500 +       test -d $prefix/$2/$3 &&       $1="[$]$1 $prefix/$2/$3"
1501 +       test -d $prefix/$2/$3/$2 &&    $1="[$]$1 $prefix/$2/$3/$2"
1502 +}
1503 +
1504 +test "$prefix" != /opt && \
1505 +test -d /opt && {
1506 +       test -n "$verbose" && echo "    ... testing $3-directories under /opt"
1507 +       test -d /opt/$3 &&             $1="[$]$1 /opt/$3"
1508 +       test -d /opt/$3/$2 &&          $1="[$]$1 /opt/$3/$2"
1509 +       test -d /opt/$3/$2/$3 &&       $1="[$]$1 /opt/$3/$2/$3"
1510 +       test -d /opt/$2/$3 &&          $1="[$]$1 /opt/$2/$3"
1511 +       test -d /opt/$2/$3/$2 &&       $1="[$]$1 /opt/$2/$3/$2"
1512 +}
1513 +
1514 +test "$prefix" != /usr && \
1515 +test -d /usr && {
1516 +       test -n "$verbose" && echo "    ... testing $3-directories under /usr"
1517 +       test -d /usr/$3 &&             $1="[$]$1 /usr/$3"
1518 +       test -d /usr/$3/$2 &&          $1="[$]$1 /usr/$3/$2"
1519 +       test -d /usr/$3/$2/$3 &&       $1="[$]$1 /usr/$3/$2/$3"
1520 +       test -d /usr/$2/$3 &&          $1="[$]$1 /usr/$2/$3"
1521 +}
1522 +])dnl
1523 +dnl ---------------------------------------------------------------------------
1524 +dnl CF_SUBST version: 2 updated: 1997/09/06 23:41:28
1525 +dnl --------
1526 +dnl    Shorthand macro for substituting things that the user may override
1527 +dnl    with an environment variable.
1528 +dnl
1529 +dnl    $1 = long/descriptive name
1530 +dnl    $2 = environment variable
1531 +dnl    $3 = default value
1532 +AC_DEFUN([CF_SUBST],
1533 +[AC_CACHE_VAL(cf_cv_subst_$2,[
1534 +AC_MSG_CHECKING(for $1 (symbol $2))
1535 +test -z "[$]$2" && $2=$3
1536 +AC_MSG_RESULT([$]$2)
1537 +AC_SUBST($2)
1538 +cf_cv_subst_$2=[$]$2])
1539 +$2=${cf_cv_subst_$2}
1540 +])dnl
1541 +dnl ---------------------------------------------------------------------------
1542 +dnl CF_SYSTYPE version: 3 updated: 2001/02/03 00:14:59
1543 +dnl ----------
1544 +dnl Derive the system-type (our main clue to the method of building shared
1545 +dnl libraries).
1546 +AC_DEFUN([CF_SYSTYPE],
1547 +[
1548 +AC_MSG_CHECKING(for system type)
1549 +AC_CACHE_VAL(cf_cv_systype,[
1550 +AC_ARG_WITH(system-type,
1551 +[  --with-system-type=XXX  test: override derived host system-type],
1552 +[cf_cv_systype=$withval],
1553 +[
1554 +cf_cv_systype="`(uname -s || hostname || echo unknown) 2>/dev/null |sed -e s'/[[:\/.-]]/_/'g  | sed 1q`"
1555 +if test -z "$cf_cv_systype"; then cf_cv_systype=unknown;fi
1556 +])])
1557 +AC_MSG_RESULT($cf_cv_systype)
1558 +])dnl
1559 +dnl ---------------------------------------------------------------------------
1560 +dnl CF_SYS_NAME version: 2 updated: 1997/08/28 23:57:55
1561 +dnl -----------
1562 +dnl Derive the system name, as a check for reusing the autoconf cache
1563 +AC_DEFUN([CF_SYS_NAME],
1564 +[
1565 +SYS_NAME=`(uname -s -r || uname -a || hostname) 2>/dev/null | sed 1q`
1566 +test -z "$SYS_NAME" && SYS_NAME=unknown
1567 +AC_DEFINE_UNQUOTED(SYS_NAME,"$SYS_NAME")
1568 +
1569 +AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$SYS_NAME"])
1570 +
1571 +if test ".$SYS_NAME" != ".$cf_cv_system_name" ; then
1572 +       AC_MSG_RESULT("Cached system name does not agree with actual")
1573 +       AC_ERROR("Please remove config.cache and try again.")
1574 +fi])
1575 +dnl ---------------------------------------------------------------------------
1576 +dnl CF_UNION_WAIT version: 5 updated: 1997/11/23 14:49:44
1577 +dnl -------------
1578 +dnl Check to see if the BSD-style union wait is declared.  Some platforms may
1579 +dnl use this, though it is deprecated in favor of the 'int' type in Posix.
1580 +dnl Some vendors provide a bogus implementation that declares union wait, but
1581 +dnl uses the 'int' type instead; we try to spot these by checking for the
1582 +dnl associated macros.
1583 +dnl
1584 +dnl Ahem.  Some implementers cast the status value to an int*, as an attempt to
1585 +dnl use the macros for either union wait or int.  So we do a check compile to
1586 +dnl see if the macros are defined and apply to an int.
1587 +dnl
1588 +dnl Sets: $cf_cv_type_unionwait
1589 +dnl Defines: HAVE_TYPE_UNIONWAIT
1590 +AH_TEMPLATE([HAVE_TYPE_UNIONWAIT], [Define if BSD-style union wait is declared.])
1591 +AC_DEFUN([CF_UNION_WAIT],
1592 +[
1593 +AC_REQUIRE([CF_WAIT_HEADERS])
1594 +AC_MSG_CHECKING([for union wait])
1595 +AC_CACHE_VAL(cf_cv_type_unionwait,[
1596 +       AC_TRY_LINK($cf_wait_headers,
1597 +       [int x;
1598 +        int y = WEXITSTATUS(x);
1599 +        int z = WTERMSIG(x);
1600 +        wait(&x);
1601 +       ],
1602 +       [cf_cv_type_unionwait=no
1603 +        echo compiles ok w/o union wait 1>&AC_FD_CC
1604 +       ],[
1605 +       AC_TRY_LINK($cf_wait_headers,
1606 +       [union wait x;
1607 +#ifdef WEXITSTATUS
1608 +        int y = WEXITSTATUS(x);
1609 +#endif
1610 +#ifdef WTERMSIG
1611 +        int z = WTERMSIG(x);
1612 +#endif
1613 +        wait(&x);
1614 +       ],
1615 +       [cf_cv_type_unionwait=yes
1616 +        echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC
1617 +       ],
1618 +       [cf_cv_type_unionwait=no])])])
1619 +AC_MSG_RESULT($cf_cv_type_unionwait)
1620 +test $cf_cv_type_unionwait = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT)
1621 +])dnl
1622 +dnl ---------------------------------------------------------------------------
1623 +dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
1624 +dnl --------
1625 +dnl Make an uppercase version of a variable
1626 +dnl $1=uppercase($2)
1627 +AC_DEFUN([CF_UPPER],
1628 +[
1629 +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1630 +])dnl
1631 +dnl ---------------------------------------------------------------------------
1632 +dnl CF_UTF8_LIB version: 4 updated: 2003/03/01 18:36:42
1633 +dnl -----------
1634 +dnl Check for multibyte support, and if not found, utf8 compatibility library
1635 +AH_TEMPLATE([HAVE_LIBUTF8_H],[Define if we have libutf8.h])
1636 +AC_DEFUN([CF_UTF8_LIB],
1637 +[
1638 +AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
1639 +       cf_save_LIBS="$LIBS"
1640 +       AC_TRY_LINK([
1641 +#include <stdlib.h>],[putwc(0,0);],
1642 +       [cf_cv_utf8_lib=yes],
1643 +       [LIBS="-lutf8 $LIBS"
1644 +        AC_TRY_LINK([
1645 +#include <libutf8.h>],[putwc(0,0);],
1646 +               [cf_cv_utf8_lib=add-on],
1647 +               [cf_cv_utf8_lib=no])
1648 +       LIBS="$cf_save_LIBS"
1649 +])])
1650 +
1651 +# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
1652 +# ncurses/ncursesw:
1653 +if test "$cf_cv_utf8_lib" = "add-on" ; then
1654 +       AC_DEFINE(HAVE_LIBUTF8_H)
1655 +       LIBS="-lutf8 $LIBS"
1656 +fi
1657 +])dnl
1658 +dnl ---------------------------------------------------------------------------
1659 +dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
1660 +dnl ----------
1661 +dnl Use AC_VERBOSE w/o the warnings
1662 +AC_DEFUN([CF_VERBOSE],
1663 +[test -n "$verbose" && echo "  $1" 1>&AC_FD_MSG
1664 +])dnl
1665 +dnl ---------------------------------------------------------------------------
1666 +dnl CF_VERSION_INFO version: 3 updated: 2003/11/22 12:22:45
1667 +dnl ---------------
1668 +dnl Define several useful symbols derived from the VERSION file.  A separate
1669 +dnl file is preferred to embedding the version numbers in various scripts.
1670 +dnl (automake is a textbook-example of why the latter is a bad idea, but there
1671 +dnl are others).
1672 +dnl
1673 +dnl The file contents are:
1674 +dnl    libtool-version release-version patch-version
1675 +dnl or
1676 +dnl    release-version
1677 +dnl where
1678 +dnl    libtool-version (see ?) consists of 3 integers separated by '.'
1679 +dnl    release-version consists of a major version and minor version
1680 +dnl            separated by '.', optionally followed by a patch-version
1681 +dnl            separated by '-'.  The minor version need not be an
1682 +dnl            integer (but it is preferred).
1683 +dnl    patch-version is an integer in the form yyyymmdd, so ifdef's and
1684 +dnl            scripts can easily compare versions.
1685 +dnl
1686 +dnl If libtool is used, the first form is required, since CF_WITH_LIBTOOL
1687 +dnl simply extracts the first field using 'cut -f1'.
1688 +AC_DEFUN([CF_VERSION_INFO],
1689 +[
1690 +if test -f $srcdir/VERSION ; then
1691 +       AC_MSG_CHECKING(for package version)
1692 +
1693 +       # if there are not enough fields, cut returns the last one...
1694 +       cf_field1=`sed -e '2,$d' $srcdir/VERSION|cut -f1`
1695 +       cf_field2=`sed -e '2,$d' $srcdir/VERSION|cut -f2`
1696 +       cf_field3=`sed -e '2,$d' $srcdir/VERSION|cut -f3`
1697 +
1698 +       # this is how CF_BUNDLED_INTL uses $VERSION:
1699 +       VERSION="$cf_field1"
1700 +
1701 +       VERSION_MAJOR=`echo "$cf_field2" | sed -e 's/\..*//'`
1702 +       test -z "$VERSION_MAJOR" && AC_MSG_ERROR(missing major-version)
1703 +
1704 +       VERSION_MINOR=`echo "$cf_field2" | sed -e 's/^[[^.]]*\.//' -e 's/-.*//'`
1705 +       test -z "$VERSION_MINOR" && AC_MSG_ERROR(missing minor-version)
1706 +
1707 +       AC_MSG_RESULT(${VERSION_MAJOR}.${VERSION_MINOR})
1708 +
1709 +       AC_MSG_CHECKING(for package patch date)
1710 +       VERSION_PATCH=`echo "$cf_field3" | sed -e 's/^[[^-]]*-//'`
1711 +       case .$VERSION_PATCH in
1712 +       .)
1713 +               AC_MSG_ERROR(missing patch-date $VERSION_PATCH)
1714 +               ;;
1715 +       .[[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]])
1716 +               ;;
1717 +       *)
1718 +               AC_MSG_ERROR(illegal patch-date $VERSION_PATCH)
1719 +               ;;
1720 +       esac
1721 +       AC_MSG_RESULT($VERSION_PATCH)
1722 +else
1723 +       AC_MSG_ERROR(did not find $srcdir/VERSION)
1724 +fi
1725 +
1726 +# show the actual data that we have for versions:
1727 +CF_VERBOSE(VERSION $VERSION)
1728 +CF_VERBOSE(VERSION_MAJOR $VERSION_MAJOR)
1729 +CF_VERBOSE(VERSION_MINOR $VERSION_MINOR)
1730 +CF_VERBOSE(VERSION_PATCH $VERSION_PATCH)
1731 +
1732 +AC_SUBST(VERSION)
1733 +AC_SUBST(VERSION_MAJOR)
1734 +AC_SUBST(VERSION_MINOR)
1735 +AC_SUBST(VERSION_PATCH)
1736 +
1737 +dnl if a package name is given, define its corresponding version info.  We
1738 +dnl need the package name to ensure that the defined symbols are unique.
1739 +ifelse($1,,,[
1740 +       PACKAGE=$1
1741 +       AH_TEMPLATE([PACKAGE],[Define to package name])
1742 +       AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
1743 +       AC_SUBST(PACKAGE)
1744 +       CF_UPPER(cf_PACKAGE,$PACKAGE)
1745 +       AC_DEFINE_UNQUOTED(${cf_PACKAGE}_VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}")
1746 +       AC_DEFINE_UNQUOTED(${cf_PACKAGE}_PATCHDATE,${VERSION_PATCH})
1747 +])
1748 +])dnl
1749 +dnl ---------------------------------------------------------------------------
1750 +dnl CF_WAIT_HEADERS version: 2 updated: 1997/10/21 19:45:33
1751 +dnl ---------------
1752 +dnl Build up an expression $cf_wait_headers with the header files needed to
1753 +dnl compile against the prototypes for 'wait()', 'waitpid()', etc.  Assume it's
1754 +dnl Posix, which uses <sys/types.h> and <sys/wait.h>, but allow SVr4 variation
1755 +dnl with <wait.h>.
1756 +AC_DEFUN([CF_WAIT_HEADERS],
1757 +[
1758 +AC_HAVE_HEADERS(sys/wait.h)
1759 +cf_wait_headers="#include <sys/types.h>
1760 +"
1761 +if test $ac_cv_header_sys_wait_h = yes; then
1762 +cf_wait_headers="$cf_wait_headers
1763 +#include <sys/wait.h>
1764 +"
1765 +else
1766 +AC_HAVE_HEADERS(wait.h)
1767 +AC_HAVE_HEADERS(waitstatus.h)
1768 +if test $ac_cv_header_wait_h = yes; then
1769 +cf_wait_headers="$cf_wait_headers
1770 +#include <wait.h>
1771 +"
1772 +fi
1773 +if test $ac_cv_header_waitstatus_h = yes; then
1774 +cf_wait_headers="$cf_wait_headers
1775 +#include <waitstatus.h>
1776 +"
1777 +fi
1778 +fi
1779 +])dnl
1780 +dnl ---------------------------------------------------------------------------
1781 +dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59
1782 +dnl ------------------
1783 +dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
1784 +dnl libraries.
1785 +AC_DEFUN([CF_WITH_CURSES_DIR],[
1786 +AC_ARG_WITH(curses-dir,
1787 +       [  --with-curses-dir=DIR   directory in which (n)curses is installed],
1788 +       [CF_PATH_SYNTAX(withval)
1789 +        cf_cv_curses_dir=$withval],
1790 +       [cf_cv_curses_dir=no])
1791 +])dnl
1792 +dnl ---------------------------------------------------------------------------
1793 +dnl CF_WITH_DBMALLOC version: 2 updated: 2002/12/29 21:11:45
1794 +dnl ----------------
1795 +dnl Configure-option for dbmalloc
1796 +AC_DEFUN([CF_WITH_DBMALLOC],[
1797 +AC_MSG_CHECKING(if you want to link with dbmalloc for testing)
1798 +AC_ARG_WITH(dbmalloc,
1799 +       [  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
1800 +       [with_dbmalloc=$withval],
1801 +       [with_dbmalloc=no])
1802 +AC_MSG_RESULT($with_dbmalloc)
1803 +if test $with_dbmalloc = yes ; then
1804 +       AC_CHECK_LIB(dbmalloc,debug_malloc)
1805 +fi
1806 +])dnl
1807 +dnl ---------------------------------------------------------------------------
1808 +dnl CF_WITH_DMALLOC version: 2 updated: 2002/12/29 21:11:45
1809 +dnl ---------------
1810 +dnl Configure-option for dmalloc
1811 +AC_DEFUN([CF_WITH_DMALLOC],[
1812 +AC_MSG_CHECKING(if you want to link with dmalloc for testing)
1813 +AC_ARG_WITH(dmalloc,
1814 +       [  --with-dmalloc          test: use Gray Watson's dmalloc library],
1815 +       [with_dmalloc=$withval],
1816 +       [with_dmalloc=no])
1817 +AC_MSG_RESULT($with_dmalloc)
1818 +if test $with_dmalloc = yes ; then
1819 +       AC_CHECK_LIB(dmalloc,dmalloc_debug)
1820 +fi
1821 +])dnl
1822 +dnl ---------------------------------------------------------------------------
1823 +dnl CF_WITH_LIBTOOL version: 8 updated: 2003/09/06 19:15:56
1824 +dnl ---------------
1825 +dnl Provide a configure option to incorporate libtool.  Define several useful
1826 +dnl symbols for the makefile rules.
1827 +AC_DEFUN([CF_WITH_LIBTOOL],
1828 +[
1829 +LIBTOOL=
1830 +
1831 +# common library maintenance symbols that are convenient for libtool scripts:
1832 +LIB_CREATE='$(AR) -cr'
1833 +LIB_OBJECT='$(OBJECTS)'
1834 +LIB_SUFFIX=.a
1835 +LIB_PREP="$RANLIB"
1836 +
1837 +# symbols used to prop libtool up to enable it to determine what it should be
1838 +# doing:
1839 +LIB_CLEAN=
1840 +LIB_COMPILE=
1841 +LIB_LINK=
1842 +LIB_INSTALL=
1843 +LIB_UNINSTALL=
1844 +
1845 +AC_MSG_CHECKING(if you want to build libraries with libtool)
1846 +AC_ARG_WITH(libtool,
1847 +       [  --with-libtool          generate libraries with libtool],
1848 +       [with_libtool=$withval],
1849 +       [with_libtool=no])
1850 +AC_MSG_RESULT($with_libtool)
1851 +if test "$with_libtool" != "no"; then
1852 +       if test "$with_libtool" != "yes" ; then
1853 +               CF_PATH_SYNTAX(with_libtool)
1854 +               LIBTOOL=$with_libtool
1855 +       else
1856 +               AC_PATH_PROG(LIBTOOL,libtool)
1857 +       fi
1858 +       if test -z "$LIBTOOL" ; then
1859 +               AC_MSG_ERROR(Cannot find libtool)
1860 +       fi
1861 +
1862 +       LIB_CREATE='$(LIBTOOL) --mode=link $(CC) -rpath $(DESTDIR)$(libdir) -version-info `cut -f1 $(srcdir)/VERSION` -o'
1863 +       LIB_OBJECT='$(OBJECTS:.o=.lo)'
1864 +       LIB_SUFFIX=.la
1865 +       LIB_CLEAN='$(LIBTOOL) --mode=clean'
1866 +       LIB_COMPILE='$(LIBTOOL) --mode=compile'
1867 +       LIB_LINK='$(LIBTOOL) --mode=link'
1868 +       LIB_INSTALL='$(LIBTOOL) --mode=install'
1869 +       LIB_UNINSTALL='$(LIBTOOL) --mode=uninstall'
1870 +       LIB_PREP=:
1871 +
1872 +       # Show the version of libtool
1873 +       AC_MSG_CHECKING(version of libtool)
1874 +
1875 +       # Save the version in a cache variable - this is not entirely a good
1876 +       # thing, but the version string from libtool is very ugly, and for
1877 +       # bug reports it might be useful to have the original string.
1878 +       cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '2,$d' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
1879 +       AC_MSG_RESULT($cf_cv_libtool_version)
1880 +       if test -z "$cf_cv_libtool_version" ; then
1881 +               AC_MSG_ERROR(This is not libtool)
1882 +       fi
1883 +
1884 +       # special hack to add --tag option for C++ compiler
1885 +       case $cf_cv_libtool_version in
1886 +       1.[[5-9]]*|[[2-9]]*)
1887 +               LIBTOOL_CXX="$LIBTOOL --tag=CXX"
1888 +               ;;
1889 +       *)
1890 +               LIBTOOL_CXX="$LIBTOOL"
1891 +               ;;
1892 +       esac
1893 +else
1894 +       LIBTOOL=""
1895 +       LIBTOOL_CXX=""
1896 +fi
1897 +
1898 +test -z "$LIBTOOL" && ECHO_LT=
1899 +
1900 +AC_SUBST(LIBTOOL)
1901 +AC_SUBST(LIBTOOL_CXX)
1902 +
1903 +AC_SUBST(LIB_CREATE)
1904 +AC_SUBST(LIB_OBJECT)
1905 +AC_SUBST(LIB_SUFFIX)
1906 +AC_SUBST(LIB_PREP)
1907 +
1908 +AC_SUBST(LIB_CLEAN)
1909 +AC_SUBST(LIB_COMPILE)
1910 +AC_SUBST(LIB_LINK)
1911 +AC_SUBST(LIB_INSTALL)
1912 +AC_SUBST(LIB_UNINSTALL)
1913 +
1914 +])dnl
1915 +dnl ---------------------------------------------------------------------------
1916 +dnl CF_XOPEN_CURSES version: 8 updated: 2003/11/07 19:47:46
1917 +dnl ---------------
1918 +dnl Test if we should define X/Open source for curses, needed on Digital Unix
1919 +dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
1920 +dnl
1921 +dnl The getbegyx() check is needed for HPUX, which omits legacy macros such
1922 +dnl as getbegy().  The latter is better design, but the former is standard.
1923 +AC_DEFUN([CF_XOPEN_CURSES],
1924 +[
1925 +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1926 +AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[
1927 +AC_TRY_LINK([
1928 +#include <stdlib.h>
1929 +#include <${cf_cv_ncurses_header-curses.h}>],[
1930 +       long x = winnstr(stdscr, "", 0);
1931 +       int x1, y1;
1932 +       getbegyx(stdscr, y1, x1)],
1933 +       [cf_cv_need_xopen_extension=no],
1934 +       [AC_TRY_LINK([
1935 +#define _XOPEN_SOURCE_EXTENDED
1936 +#include <stdlib.h>
1937 +#include <${cf_cv_ncurses_header-curses.h}>],[
1938 +       long x = winnstr(stdscr, "", 0);
1939 +       int x1, y1;
1940 +       getbegyx(stdscr, y1, x1)],
1941 +       [cf_cv_need_xopen_extension=yes],
1942 +       [cf_cv_need_xopen_extension=unknown])])])
1943 +test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
1944 +])dnl
1945 +dnl ---------------------------------------------------------------------------
1946 +dnl CF_XOPEN_SOURCE version: 2 updated: 2003/11/26 19:29:42
1947 +dnl ---------------
1948 +dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions.
1949 +AC_DEFUN([CF_XOPEN_SOURCE],[
1950 +case $host_os in #(vi
1951 +hpux*) #(vi
1952 +       CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
1953 +       ;;
1954 +linux*) #(vi
1955 +       CF_GNU_SOURCE
1956 +       ;;
1957 +osf[[45]]*) #(vi
1958 +       CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
1959 +       ;;
1960 +*)
1961 +       ;;
1962 +esac
1963 +])
1964 Index: dialog-1.0-20050306/aclocal.m4
1965 ===================================================================
1966 --- dialog-1.0-20050306.orig/aclocal.m4 2005-02-07 00:03:26.000000000 +0100
1967 +++ dialog-1.0-20050306/aclocal.m4      2005-05-16 01:35:48.000000000 +0200
1968 @@ -1,720 +1,143 @@
1969 -dnl macros used for DIALOG configure script
1970 -dnl -- Thomas E. Dickey
1971 -dnl $Id: aclocal.m4,v 1.47 2005/02/06 23:03:26 tom Exp $
1972 -dnl ---------------------------------------------------------------------------
1973 -dnl ---------------------------------------------------------------------------
1974 -dnl AM_GNU_GETTEXT version: 11 updated: 2004/01/26 20:58:40
1975 -dnl --------------
1976 -dnl Usage: Just like AM_WITH_NLS, which see.
1977 -AC_DEFUN([AM_GNU_GETTEXT],
1978 -  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1979 -   AC_REQUIRE([AC_PROG_CC])dnl
1980 -   AC_REQUIRE([AC_CANONICAL_HOST])dnl
1981 -   AC_REQUIRE([AC_PROG_RANLIB])dnl
1982 -   AC_REQUIRE([AC_ISC_POSIX])dnl
1983 -   AC_REQUIRE([AC_HEADER_STDC])dnl
1984 -   AC_REQUIRE([AC_C_CONST])dnl
1985 -   AC_REQUIRE([AC_C_INLINE])dnl
1986 -   AC_REQUIRE([AC_TYPE_OFF_T])dnl
1987 -   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1988 -   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1989 -   AC_REQUIRE([AC_FUNC_MMAP])dnl
1990 -   AC_REQUIRE([jm_GLIBC21])dnl
1991 -
1992 -   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1993 -stdlib.h string.h unistd.h sys/param.h])
1994 -   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1995 -getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1996 -strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1997 -
1998 -   AM_ICONV
1999 -   AM_LANGINFO_CODESET
2000 -   AM_LC_MESSAGES
2001 -   AM_WITH_NLS([$1],[$2],[$3],[$4])
2002 -
2003 -   if test "x$CATOBJEXT" != "x"; then
2004 -     if test "x$ALL_LINGUAS" = "x"; then
2005 -       LINGUAS=
2006 -     else
2007 -       AC_MSG_CHECKING(for catalogs to be installed)
2008 -       NEW_LINGUAS=
2009 -       for presentlang in $ALL_LINGUAS; do
2010 -         useit=no
2011 -         for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
2012 -           # Use the presentlang catalog if desiredlang is
2013 -           #   a. equal to presentlang, or
2014 -           #   b. a variant of presentlang (because in this case,
2015 -           #      presentlang can be used as a fallback for messages
2016 -           #      which are not translated in the desiredlang catalog).
2017 -           case "$desiredlang" in
2018 -             "$presentlang"*) useit=yes;;
2019 -           esac
2020 -         done
2021 -         if test $useit = yes; then
2022 -           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
2023 -         fi
2024 -       done
2025 -       LINGUAS=$NEW_LINGUAS
2026 -       AC_MSG_RESULT($LINGUAS)
2027 -     fi
2028 -
2029 -     dnl Construct list of names of catalog files to be constructed.
2030 -     if test -n "$LINGUAS"; then
2031 -       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2032 -     fi
2033 -   fi
2034 -
2035 -   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2036 -   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
2037 -   dnl Try to locate it.
2038 -   dnl changed mkinstalldirs to mkdirs.sh for Lynx /je spath 1998-Aug-21
2039 -   dnl added check for separate locations of scripts -mirabile 2004-Jan-18
2040 -   MKINSTALLDIRS=
2041 -   if test -n "$ac_aux_dir"; then
2042 -     MKINSTALLDIRS="$ac_aux_dir/mkdirs.sh"
2043 -   fi
2044 -   if test -z "$MKINSTALLDIRS"; then
2045 -     MKINSTALLDIRS="\$(top_srcdir)/mkdirs.sh"
2046 -   fi
2047 -   if test -n "$GNUSYSTEM_AUX_DIR" ; then
2048 -     if test -e "${GNUSYSTEM_AUX_DIR}/mkinstalldirs"; then
2049 -       MKINSTALLDIRS="${GNUSYSTEM_AUX_DIR}/mkinstalldirs"
2050 -     fi
2051 -   fi
2052 -   AC_SUBST(MKINSTALLDIRS)
2053 -
2054 -   dnl Enable libtool support if the surrounding package wishes it.
2055 -   INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
2056 -   AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
2057 -])dnl
2058 -dnl ---------------------------------------------------------------------------
2059 -dnl AM_ICONV version: 3 updated: 2002/10/27 23:21:42
2060 -dnl --------
2061 -dnl Inserted as requested by gettext 0.10.40
2062 -dnl File from /usr/share/aclocal
2063 -dnl iconv.m4
2064 -dnl ====================
2065 -dnl serial AM2
2066 -dnl
2067 -dnl From Bruno Haible.
2068 -AC_DEFUN([AM_ICONV],
2069 -[
2070 -  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2071 -  dnl those with the standalone portable GNU libiconv installed).
2072 + # generated automatically by aclocal 1.7.7 -*- Autoconf -*-
2073  
2074 -  AC_ARG_WITH([libiconv-prefix],
2075 -[  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
2076 -    for dir in `echo "$withval" | tr : ' '`; do
2077 -      if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
2078 -      if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
2079 -    done
2080 -   ])
2081 + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
2082 + # Free Software Foundation, Inc.
2083 + # This file is free software; the Free Software Foundation
2084 + # gives unlimited permission to copy and/or distribute it,
2085 + # with or without modifications, as long as this notice is preserved.
2086 +
2087 + # This program is distributed in the hope that it will be useful,
2088 + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
2089 + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
2090 + # PARTICULAR PURPOSE.
2091  
2092 -  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2093 -    am_cv_func_iconv="no, consider installing GNU libiconv"
2094 -    am_cv_lib_iconv=no
2095 -    AC_TRY_LINK([#include <stdlib.h>
2096 -#include <iconv.h>],
2097 -      [iconv_t cd = iconv_open("","");
2098 -       iconv(cd,NULL,NULL,NULL,NULL);
2099 -       iconv_close(cd);],
2100 -      am_cv_func_iconv=yes)
2101 -    if test "$am_cv_func_iconv" != yes; then
2102 -      am_save_LIBS="$LIBS"
2103 -      LIBS="$LIBS -liconv"
2104 -      AC_TRY_LINK([#include <stdlib.h>
2105 -#include <iconv.h>],
2106 -        [iconv_t cd = iconv_open("","");
2107 -         iconv(cd,NULL,NULL,NULL,NULL);
2108 -         iconv_close(cd);],
2109 -        am_cv_lib_iconv=yes
2110 -        am_cv_func_iconv=yes)
2111 -      LIBS="$am_save_LIBS"
2112 -    fi
2113 -  ])
2114 -  if test "$am_cv_func_iconv" = yes; then
2115 -    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2116 -    AC_MSG_CHECKING([for iconv declaration])
2117 -    AC_CACHE_VAL(am_cv_proto_iconv, [
2118 -      AC_TRY_COMPILE([
2119 -#include <stdlib.h>
2120 -#include <iconv.h>
2121 -extern
2122 -#ifdef __cplusplus
2123 -"C"
2124 -#endif
2125 -#if defined(__STDC__) || defined(__cplusplus)
2126 -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2127 -#else
2128 -size_t iconv();
2129 -#endif
2130 -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2131 -      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);"])
2132 -    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2133 -    AC_MSG_RESULT([$]{ac_t:-
2134 -         }[$]am_cv_proto_iconv)
2135 -    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2136 -      [Define as const if the declaration of iconv() needs const.])
2137 -  fi
2138 -  LIBICONV=
2139 -  if test "$am_cv_lib_iconv" = yes; then
2140 -    LIBICONV="-liconv"
2141 -  fi
2142 -  AC_SUBST(LIBICONV)
2143 -])dnl
2144  dnl ---------------------------------------------------------------------------
2145 -dnl AM_LANGINFO_CODESET version: 3 updated: 2002/10/27 23:21:42
2146 -dnl -------------------
2147 -dnl Inserted as requested by gettext 0.10.40
2148 -dnl File from /usr/share/aclocal
2149 -dnl codeset.m4
2150 -dnl ====================
2151 -dnl serial AM1
2152 -dnl
2153 -dnl From Bruno Haible.
2154 -AC_DEFUN([AM_LANGINFO_CODESET],
2155 +dnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56
2156 +dnl ------------
2157 +dnl Conditionally generate script according to whether we're using the release
2158 +dnl version of autoconf, or a patched version (using the ternary component as
2159 +dnl the patch-version).
2160 +define(CF_AC_PREREQ,
2161 +[CF_PREREQ_COMPARE(
2162 +AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
2163 +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnl
2164 +dnl ---------------------------------------------------------------------------
2165 +dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52
2166 +dnl -------------
2167 +dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
2168 +dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
2169 +dnl but old versions (and some misinstalled ones) need that.  To make things
2170 +dnl worse, gcc 3.x gives error messages if -I/usr/local/include is added to
2171 +dnl the include-path).
2172 +AC_DEFUN([CF_ADD_INCDIR],
2173  [
2174 -  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2175 -    [AC_TRY_LINK([#include <langinfo.h>],
2176 -      [char* cs = nl_langinfo(CODESET);],
2177 -      am_cv_langinfo_codeset=yes,
2178 -      am_cv_langinfo_codeset=no)
2179 -    ])
2180 -  if test $am_cv_langinfo_codeset = yes; then
2181 -    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2182 -      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2183 -  fi
2184 +for cf_add_incdir in $1
2185 +do
2186 +       while true
2187 +       do
2188 +               case $cf_add_incdir in
2189 +               /usr/include) # (vi
2190 +                       ;;
2191 +               /usr/local/include) # (vi
2192 +                       if test "$GCC" = yes
2193 +                       then
2194 +                               cf_save_CPPFLAGS="$CPPFLAGS"
2195 +                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
2196 +                               AC_TRY_COMPILE([#include <stdio.h>],
2197 +                                               [printf("Hello")],
2198 +                                               [],
2199 +                                               [CPPFLAGS="$cf_save_CPPFLAGS"])
2200 +                       fi
2201 +                       ;;
2202 +               *) # (vi
2203 +                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
2204 +                       ;;
2205 +               esac
2206 +               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
2207 +               test "$cf_top_incdir" = "$cf_add_incdir" && break
2208 +               cf_add_incdir="$cf_top_incdir"
2209 +       done
2210 +done
2211  ])dnl
2212  dnl ---------------------------------------------------------------------------
2213 -dnl AM_LC_MESSAGES version: 4 updated: 2002/10/27 23:21:42
2214 +dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
2215  dnl --------------
2216 -dnl Inserted as requested by gettext 0.10.40
2217 -dnl File from /usr/share/aclocal
2218 -dnl lcmessage.m4
2219 -dnl ====================
2220 -dnl Check whether LC_MESSAGES is available in <locale.h>.
2221 -dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2222 -dnl
2223 -dnl This file can be copied and used freely without restrictions.  It can
2224 -dnl be used in projects which are not available under the GNU General Public
2225 -dnl License or the GNU Library General Public License but which still want
2226 -dnl to provide support for the GNU gettext functionality.
2227 -dnl Please note that the actual code of the GNU gettext library is covered
2228 -dnl by the GNU Library General Public License, and the rest of the GNU
2229 -dnl gettext package package is covered by the GNU General Public License.
2230 -dnl They are *not* in the public domain.
2231 -dnl
2232 -dnl serial 2
2233 -dnl
2234 -AC_DEFUN([AM_LC_MESSAGES],
2235 -  [if test $ac_cv_header_locale_h = yes; then
2236 -    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2237 -      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2238 -       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2239 -    if test $am_cv_val_LC_MESSAGES = yes; then
2240 -      AC_DEFINE(HAVE_LC_MESSAGES, 1,
2241 -        [Define if your <locale.h> file defines LC_MESSAGES.])
2242 -    fi
2243 -  fi])dnl
2244 +dnl Allow user to disable a normally-on option.
2245 +AC_DEFUN([CF_ARG_DISABLE],
2246 +[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
2247  dnl ---------------------------------------------------------------------------
2248 -dnl AM_PATH_PROG_WITH_TEST version: 5 updated: 2002/10/27 23:21:42
2249 -dnl ----------------------
2250 -dnl Inserted as requested by gettext 0.10.40
2251 -dnl File from /usr/share/aclocal
2252 -dnl progtest.m4
2253 -dnl ====================
2254 -dnl Search path for a program which passes the given test.
2255 -dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2256 -dnl
2257 -dnl This file can be copied and used freely without restrictions.  It can
2258 -dnl be used in projects which are not available under the GNU General Public
2259 -dnl License or the GNU Library General Public License but which still want
2260 -dnl to provide support for the GNU gettext functionality.
2261 -dnl Please note that the actual code of the GNU gettext library is covered
2262 -dnl by the GNU Library General Public License, and the rest of the GNU
2263 -dnl gettext package package is covered by the GNU General Public License.
2264 -dnl They are *not* in the public domain.
2265 -dnl
2266 -dnl serial 2
2267 +dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
2268 +dnl -------------
2269 +dnl Allow user to enable a normally-off option.
2270 +AC_DEFUN([CF_ARG_ENABLE],
2271 +[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
2272 +dnl ---------------------------------------------------------------------------
2273 +dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03
2274 +dnl -----------------
2275 +dnl Verbose form of AC_ARG_ENABLE:
2276  dnl
2277 -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2278 -dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2279 -AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2280 -[# Extract the first word of "$2", so it can be a program name with args.
2281 -AC_REQUIRE([CF_PATHSEP])
2282 -set dummy $2; ac_word=[$]2
2283 -AC_MSG_CHECKING([for $ac_word])
2284 -AC_CACHE_VAL(ac_cv_path_$1,
2285 -[case "[$]$1" in
2286 -  /*)
2287 -  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2288 -  ;;
2289 -  *)
2290 -  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
2291 -  for ac_dir in ifelse([$5], , $PATH, [$5]); do
2292 -    test -z "$ac_dir" && ac_dir=.
2293 -    if test -f $ac_dir/$ac_word; then
2294 -      if [$3]; then
2295 -       ac_cv_path_$1="$ac_dir/$ac_word"
2296 -       break
2297 -      fi
2298 -    fi
2299 -  done
2300 -  IFS="$ac_save_ifs"
2301 -dnl If no 4th arg is given, leave the cache variable unset,
2302 -dnl so AC_PATH_PROGS will keep looking.
2303 -ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2304 -])dnl
2305 -  ;;
2306 -esac])dnl
2307 -$1="$ac_cv_path_$1"
2308 -if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2309 -  AC_MSG_RESULT([$]$1)
2310 +dnl Parameters:
2311 +dnl $1 = message
2312 +dnl $2 = option name
2313 +dnl $3 = help-string
2314 +dnl $4 = action to perform if option is enabled
2315 +dnl $5 = action if perform if option is disabled
2316 +dnl $6 = default option value (either 'yes' or 'no')
2317 +AC_DEFUN([CF_ARG_MSG_ENABLE],[
2318 +AC_MSG_CHECKING($1)
2319 +AC_ARG_ENABLE($2,[$3],,enableval=ifelse($6,,no,$6))
2320 +AC_MSG_RESULT($enableval)
2321 +if test "$enableval" != no ; then
2322 +ifelse($4,,[   :],$4)
2323  else
2324 -  AC_MSG_RESULT(no)
2325 +ifelse($5,,[   :],$5)
2326  fi
2327 -AC_SUBST($1)dnl
2328  ])dnl
2329  dnl ---------------------------------------------------------------------------
2330 -dnl AM_WITH_NLS version: 17 updated: 2004/01/23 19:52:21
2331 -dnl -----------
2332 -dnl Inserted as requested by gettext 0.10.40
2333 -dnl File from /usr/share/aclocal
2334 -dnl gettext.m4
2335 -dnl ====================
2336 -dnl Macro to add for using GNU gettext.
2337 -dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2338 +dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41
2339 +dnl -------------
2340 +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
2341 +dnl values.
2342  dnl
2343 -dnl This file can be copied and used freely without restrictions.  It can
2344 -dnl be used in projects which are not available under the GNU General Public
2345 -dnl License or the GNU Library General Public License but which still want
2346 -dnl to provide support for the GNU gettext functionality.
2347 -dnl Please note that the actual code of the GNU gettext library is covered
2348 -dnl by the GNU Library General Public License, and the rest of the GNU
2349 -dnl gettext package package is covered by the GNU General Public License.
2350 -dnl They are *not* in the public domain.
2351 +dnl Parameters:
2352 +dnl $1 = option name
2353 +dnl $2 = help-string
2354 +dnl $3 = action to perform if option is not default
2355 +dnl $4 = action if perform if option is default
2356 +dnl $5 = default option value (either 'yes' or 'no')
2357 +AC_DEFUN([CF_ARG_OPTION],
2358 +[AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
2359 +  if test "$enableval" != "$5" ; then
2360 +ifelse($3,,[    :]dnl
2361 +,[    $3]) ifelse($4,,,[
2362 +  else
2363 +    $4])
2364 +  fi],[enableval=$5 ifelse($4,,,[
2365 +  $4
2366 +])dnl
2367 +  ])])dnl
2368 +dnl ---------------------------------------------------------------------------
2369 +dnl CF_BUNDLED_INTL version: 11 updated: 2004/09/12 19:45:55
2370 +dnl ---------------
2371 +dnl Top-level macro for configuring an application with a bundled copy of
2372 +dnl the intl and po directories for gettext.
2373  dnl
2374 -dnl serial 10
2375 +dnl $1 specifies either Makefile or makefile, defaulting to the former.
2376 +dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls
2377  dnl
2378 -dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR], [ENABLED]).
2379 -dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
2380 -dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
2381 -dnl    depending on --{enable,disable}-{shared,static} and on the presence of
2382 -dnl    AM-DISABLE-SHARED). Otherwise, a static library
2383 -dnl    $(top_builddir)/intl/libintl.a will be created.
2384 -dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
2385 -dnl    implementations (in libc or libintl) without the ngettext() function
2386 -dnl    will be ignored.
2387 -dnl LIBDIR is used to find the intl libraries.  If empty,
2388 -dnl    the value `$(top_builddir)/intl/' is used.
2389 -dnl ENABLED is used to control the default for the related --enable-nls, since
2390 -dnl    not all application developers want this feature by default, e.g., lynx.
2391 -dnl
2392 -dnl The result of the configuration is one of three cases:
2393 -dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
2394 -dnl    and used.
2395 -dnl    Catalog format: GNU --> install in $(datadir)
2396 -dnl    Catalog extension: .mo after installation, .gmo in source tree
2397 -dnl 2) GNU gettext has been found in the system's C library.
2398 -dnl    Catalog format: GNU --> install in $(datadir)
2399 -dnl    Catalog extension: .mo after installation, .gmo in source tree
2400 -dnl 3) No internationalization, always use English msgid.
2401 -dnl    Catalog format: none
2402 -dnl    Catalog extension: none
2403 -dnl The use of .gmo is historical (it was needed to avoid overwriting the
2404 -dnl GNU format catalogs when building on a platform with an X/Open gettext),
2405 -dnl but we keep it in order not to force irrelevant filename changes on the
2406 -dnl maintainers.
2407 -dnl
2408 -AC_DEFUN([AM_WITH_NLS],
2409 -  [AC_MSG_CHECKING([whether NLS is requested])
2410 -    dnl Default is enabled NLS
2411 -    ifelse([$4],,[
2412 -    AC_ARG_ENABLE(nls,
2413 -      [  --disable-nls           do not use Native Language Support],
2414 -      USE_NLS=$enableval, USE_NLS=yes)],[
2415 -    AC_ARG_ENABLE(nls,
2416 -      [  --enable-nls            use Native Language Support],
2417 -      USE_NLS=$enableval, USE_NLS=no)])
2418 -    AC_MSG_RESULT($USE_NLS)
2419 -    AC_SUBST(USE_NLS)
2420 -
2421 -    BUILD_INCLUDED_LIBINTL=no
2422 -    USE_INCLUDED_LIBINTL=no
2423 -    INTLLIBS=
2424 -
2425 -    dnl If we use NLS figure out what method
2426 -    if test "$USE_NLS" = "yes"; then
2427 -      AC_DEFINE(ENABLE_NLS, 1,
2428 -        [Define to 1 if translation of program messages to the user's native language
2429 -   is requested.])
2430 -      AC_MSG_CHECKING([whether included gettext is requested])
2431 -      AC_ARG_WITH(included-gettext,
2432 -        [  --with-included-gettext use the GNU gettext library included here],
2433 -        nls_cv_force_use_gnu_gettext=$withval,
2434 -        nls_cv_force_use_gnu_gettext=no)
2435 -      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
2436 -
2437 -      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2438 -      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2439 -        dnl User does not insist on using GNU NLS library.  Figure out what
2440 -        dnl to use.  If GNU gettext is available we use this.  Else we have
2441 -        dnl to fall back to GNU NLS library.
2442 -       CATOBJEXT=NONE
2443 -
2444 -        dnl Add a version number to the cache macros.
2445 -        define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
2446 -        define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
2447 -
2448 -       AC_CHECK_HEADER(libintl.h,
2449 -         [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
2450 -           [AC_TRY_LINK([#include <libintl.h>
2451 -extern int _nl_msg_cat_cntr;],
2452 -              [bindtextdomain ("", "");
2453 -return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
2454 -              gt_cv_func_gnugettext_libc=yes,
2455 -              gt_cv_func_gnugettext_libc=no)])
2456 -
2457 -          if test "$gt_cv_func_gnugettext_libc" != "yes"; then
2458 -            AC_CACHE_CHECK([for GNU gettext in libintl],
2459 -              gt_cv_func_gnugettext_libintl,
2460 -              [gt_save_LIBS="$LIBS"
2461 -               LIBS="$LIBS -lintl $LIBICONV"
2462 -               AC_TRY_LINK([#include <libintl.h>
2463 -extern int _nl_msg_cat_cntr;],
2464 -                 [bindtextdomain ("", "");
2465 -return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
2466 -                 gt_cv_func_gnugettext_libintl=yes,
2467 -                 gt_cv_func_gnugettext_libintl=no)
2468 -               LIBS="$gt_save_LIBS"])
2469 -          fi
2470 -
2471 -          dnl If an already present or preinstalled GNU gettext() is found,
2472 -          dnl use it.  But if this macro is used in GNU gettext, and GNU
2473 -          dnl gettext is already preinstalled in libintl, we update this
2474 -          dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
2475 -          if test "$gt_cv_func_gnugettext_libc" = "yes" \
2476 -             || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
2477 -                  && test "$PACKAGE" != gettext; }; then
2478 -            AC_DEFINE(HAVE_GETTEXT, 1,
2479 -               [Define if the GNU gettext() function is already present or preinstalled.])
2480 -
2481 -            if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
2482 -              dnl If iconv() is in a separate libiconv library, then anyone
2483 -              dnl linking with libintl{.a,.so} also needs to link with
2484 -              dnl libiconv.
2485 -              INTLLIBS="-lintl $LIBICONV"
2486 -            fi
2487 -
2488 -            gt_save_LIBS="$LIBS"
2489 -            LIBS="$LIBS $INTLLIBS"
2490 -            AC_CHECK_FUNCS(dcgettext)
2491 -            LIBS="$gt_save_LIBS"
2492 -
2493 -            dnl Search for GNU msgfmt in the PATH.
2494 -            AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2495 -              [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
2496 -            AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2497 -
2498 -            dnl Search for GNU xgettext in the PATH.
2499 -            AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2500 -              [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
2501 -
2502 -            CATOBJEXT=.gmo
2503 -          fi
2504 -       ])
2505 -
2506 -        if test "$CATOBJEXT" = "NONE"; then
2507 -         dnl GNU gettext is not found in the C library.
2508 -         dnl Fall back on GNU gettext library.
2509 -         nls_cv_use_gnu_gettext=yes
2510 -        fi
2511 -      fi
2512 -
2513 -      if test "$nls_cv_use_gnu_gettext" = "yes"; then
2514 -        if test ! -d $srcdir/intl ; then
2515 -         AC_MSG_ERROR(no NLS library is packaged with this application)
2516 -       fi
2517 -        dnl Mark actions used to generate GNU NLS library.
2518 -        INTLOBJS="\$(GETTOBJS)"
2519 -        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2520 -         [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
2521 -        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2522 -        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2523 -         [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
2524 -        AC_SUBST(MSGFMT)
2525 -       BUILD_INCLUDED_LIBINTL=yes
2526 -       USE_INCLUDED_LIBINTL=yes
2527 -        CATOBJEXT=.gmo
2528 -       INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
2529 -       LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
2530 -      fi
2531 -
2532 -      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
2533 -      dnl Test whether we really found GNU msgfmt.
2534 -      if test "$GMSGFMT" != ":"; then
2535 -       dnl If it is no GNU msgfmt we define it as : so that the
2536 -       dnl Makefiles still can work.
2537 -       if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
2538 -         : ;
2539 -       else
2540 -         AC_MSG_RESULT(
2541 -           [found msgfmt program is not GNU msgfmt; ignore it])
2542 -         GMSGFMT=":"
2543 -       fi
2544 -      fi
2545 -
2546 -      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
2547 -      dnl Test whether we really found GNU xgettext.
2548 -      if test "$XGETTEXT" != ":"; then
2549 -       dnl If it is no GNU xgettext we define it as : so that the
2550 -       dnl Makefiles still can work.
2551 -       if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
2552 -         : ;
2553 -       else
2554 -         AC_MSG_RESULT(
2555 -           [found xgettext program is not GNU xgettext; ignore it])
2556 -         XGETTEXT=":"
2557 -       fi
2558 -      fi
2559 -
2560 -      dnl We need to process the po/ directory.
2561 -      POSUB=po
2562 -    fi
2563 -
2564 -    AC_OUTPUT_COMMANDS(
2565 -     [for ac_file in $CONFIG_FILES; do
2566 -        # Support "outfile[:infile[:infile...]]"
2567 -        case "$ac_file" in
2568 -          *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2569 -        esac
2570 -        # PO directories have a Makefile.in generated from Makefile.inn.
2571 -        case "$ac_file" in */[Mm]akefile.in)
2572 -          # Adjust a relative srcdir.
2573 -          ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2574 -          ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2575 -          ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2576 -         ac_base=`basename $ac_file .in`
2577 -          # In autoconf-2.13 it is called $ac_given_srcdir.
2578 -          # In autoconf-2.50 it is called $srcdir.
2579 -          test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2580 -          case "$ac_given_srcdir" in
2581 -            .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2582 -            /*) top_srcdir="$ac_given_srcdir" ;;
2583 -            *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2584 -          esac
2585 -          if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2586 -            rm -f "$ac_dir/POTFILES"
2587 -            test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2588 -            sed -e "/^#/d" -e "/^[     ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
2589 -            test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base"
2590 -            sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base"
2591 -          fi
2592 -          ;;
2593 -        esac
2594 -      done])
2595 -
2596 -
2597 -    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
2598 -    dnl to 'yes' because some of the testsuite requires it.
2599 -    if test "$PACKAGE" = gettext; then
2600 -      BUILD_INCLUDED_LIBINTL=yes
2601 -    fi
2602 -
2603 -    dnl intl/plural.c is generated from intl/plural.y. It requires bison,
2604 -    dnl because plural.y uses bison specific features. It requires at least
2605 -    dnl bison-1.26 because earlier versions generate a plural.c that doesn't
2606 -    dnl compile.
2607 -    dnl bison is only needed for the maintainer (who touches plural.y). But in
2608 -    dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
2609 -    dnl the rule in general Makefile. Now, some people carelessly touch the
2610 -    dnl files or have a broken "make" program, hence the plural.c rule will
2611 -    dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
2612 -    dnl present or too old.
2613 -    if test "$nls_cv_use_gnu_gettext" = "yes"; then
2614 -    AC_CHECK_PROGS([INTLBISON], [bison])
2615 -    if test -z "$INTLBISON"; then
2616 -      ac_verc_fail=yes
2617 -    else
2618 -      dnl Found it, now check the version.
2619 -      AC_MSG_CHECKING([version of bison])
2620 -changequote(<<,>>)dnl
2621 -      ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
2622 -      case $ac_prog_version in
2623 -        '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
2624 -        1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
2625 -changequote([,])dnl
2626 -           ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
2627 -        *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
2628 -      esac
2629 -      AC_MSG_RESULT([$ac_prog_version])
2630 -    fi
2631 -    if test $ac_verc_fail = yes; then
2632 -      INTLBISON=:
2633 -    fi
2634 -    fi
2635 -
2636 -    dnl These rules are solely for the distribution goal.  While doing this
2637 -    dnl we only have to keep exactly one list of the available catalogs
2638 -    dnl in configure.in.
2639 -    for lang in $ALL_LINGUAS; do
2640 -      GMOFILES="$GMOFILES $lang.gmo"
2641 -      POFILES="$POFILES $lang.po"
2642 -    done
2643 -
2644 -    dnl Make all variables we use known to autoconf.
2645 -    AC_SUBST(BUILD_INCLUDED_LIBINTL)
2646 -    AC_SUBST(USE_INCLUDED_LIBINTL)
2647 -    AC_SUBST(CATALOGS)
2648 -    AC_SUBST(CATOBJEXT)
2649 -    AC_SUBST(GMOFILES)
2650 -    AC_SUBST(INTLLIBS)
2651 -    AC_SUBST(INTLOBJS)
2652 -    AC_SUBST(POFILES)
2653 -    AC_SUBST(POSUB)
2654 -
2655 -    dnl For backward compatibility. Some configure.ins may be using this.
2656 -    nls_cv_header_intl=
2657 -    nls_cv_header_libgt=
2658 -
2659 -    dnl For backward compatibility. Some Makefiles may be using this.
2660 -    DATADIRNAME=share
2661 -    AC_SUBST(DATADIRNAME)
2662 -
2663 -    dnl For backward compatibility. Some Makefiles may be using this.
2664 -    INSTOBJEXT=.mo
2665 -    AC_SUBST(INSTOBJEXT)
2666 -
2667 -    dnl For backward compatibility. Some Makefiles may be using this.
2668 -    GENCAT=gencat
2669 -    AC_SUBST(GENCAT)
2670 -  ])dnl
2671 -dnl ---------------------------------------------------------------------------
2672 -dnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56
2673 -dnl ------------
2674 -dnl Conditionally generate script according to whether we're using the release
2675 -dnl version of autoconf, or a patched version (using the ternary component as
2676 -dnl the patch-version).
2677 -define(CF_AC_PREREQ,
2678 -[CF_PREREQ_COMPARE(
2679 -AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
2680 -AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnl
2681 -dnl ---------------------------------------------------------------------------
2682 -dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52
2683 -dnl -------------
2684 -dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
2685 -dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
2686 -dnl but old versions (and some misinstalled ones) need that.  To make things
2687 -dnl worse, gcc 3.x gives error messages if -I/usr/local/include is added to
2688 -dnl the include-path).
2689 -AC_DEFUN([CF_ADD_INCDIR],
2690 -[
2691 -for cf_add_incdir in $1
2692 -do
2693 -       while true
2694 -       do
2695 -               case $cf_add_incdir in
2696 -               /usr/include) # (vi
2697 -                       ;;
2698 -               /usr/local/include) # (vi
2699 -                       if test "$GCC" = yes
2700 -                       then
2701 -                               cf_save_CPPFLAGS="$CPPFLAGS"
2702 -                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
2703 -                               AC_TRY_COMPILE([#include <stdio.h>],
2704 -                                               [printf("Hello")],
2705 -                                               [],
2706 -                                               [CPPFLAGS="$cf_save_CPPFLAGS"])
2707 -                       fi
2708 -                       ;;
2709 -               *) # (vi
2710 -                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
2711 -                       ;;
2712 -               esac
2713 -               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
2714 -               test "$cf_top_incdir" = "$cf_add_incdir" && break
2715 -               cf_add_incdir="$cf_top_incdir"
2716 -       done
2717 -done
2718 -])dnl
2719 -dnl ---------------------------------------------------------------------------
2720 -dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
2721 -dnl --------------
2722 -dnl Allow user to disable a normally-on option.
2723 -AC_DEFUN([CF_ARG_DISABLE],
2724 -[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
2725 -dnl ---------------------------------------------------------------------------
2726 -dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
2727 -dnl -------------
2728 -dnl Allow user to enable a normally-off option.
2729 -AC_DEFUN([CF_ARG_ENABLE],
2730 -[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
2731 -dnl ---------------------------------------------------------------------------
2732 -dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03
2733 -dnl -----------------
2734 -dnl Verbose form of AC_ARG_ENABLE:
2735 -dnl
2736 -dnl Parameters:
2737 -dnl $1 = message
2738 -dnl $2 = option name
2739 -dnl $3 = help-string
2740 -dnl $4 = action to perform if option is enabled
2741 -dnl $5 = action if perform if option is disabled
2742 -dnl $6 = default option value (either 'yes' or 'no')
2743 -AC_DEFUN([CF_ARG_MSG_ENABLE],[
2744 -AC_MSG_CHECKING($1)
2745 -AC_ARG_ENABLE($2,[$3],,enableval=ifelse($6,,no,$6))
2746 -AC_MSG_RESULT($enableval)
2747 -if test "$enableval" != no ; then
2748 -ifelse($4,,[   :],$4)
2749 -else
2750 -ifelse($5,,[   :],$5)
2751 -fi
2752 -])dnl
2753 -dnl ---------------------------------------------------------------------------
2754 -dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41
2755 -dnl -------------
2756 -dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
2757 -dnl values.
2758 -dnl
2759 -dnl Parameters:
2760 -dnl $1 = option name
2761 -dnl $2 = help-string
2762 -dnl $3 = action to perform if option is not default
2763 -dnl $4 = action if perform if option is default
2764 -dnl $5 = default option value (either 'yes' or 'no')
2765 -AC_DEFUN([CF_ARG_OPTION],
2766 -[AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
2767 -  if test "$enableval" != "$5" ; then
2768 -ifelse($3,,[    :]dnl
2769 -,[    $3]) ifelse($4,,,[
2770 -  else
2771 -    $4])
2772 -  fi],[enableval=$5 ifelse($4,,,[
2773 -  $4
2774 -])dnl
2775 -  ])])dnl
2776 -dnl ---------------------------------------------------------------------------
2777 -dnl CF_BUNDLED_INTL version: 11 updated: 2004/09/12 19:45:55
2778 -dnl ---------------
2779 -dnl Top-level macro for configuring an application with a bundled copy of
2780 -dnl the intl and po directories for gettext.
2781 -dnl
2782 -dnl $1 specifies either Makefile or makefile, defaulting to the former.
2783 -dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls
2784 -dnl
2785 -dnl Sets variables which can be used to substitute in makefiles:
2786 -dnl    INTLDIR_MAKE - to make ./intl directory
2787 -dnl    MSG_DIR_MAKE - to make ./po directory
2788 -dnl    SUB_MAKEFILE - list of makefiles in ./intl, ./po directories
2789 -dnl Defines
2790 -dnl    HAVE_LIBGETTEXT_H if we're using ./intl
2791 +dnl Sets variables which can be used to substitute in makefiles:
2792 +dnl    INTLDIR_MAKE - to make ./intl directory
2793 +dnl    MSG_DIR_MAKE - to make ./po directory
2794 +dnl    SUB_MAKEFILE - list of makefiles in ./intl, ./po directories
2795 +dnl Defines
2796 +dnl    HAVE_LIBGETTEXT_H if we're using ./intl
2797  dnl
2798  dnl Environment:
2799  dnl    ALL_LINGUAS if set, lists the root names of the ".po" files.
2800  dnl    CONFIG_H assumed to be "config.h"
2801  dnl    VERSION may be set, otherwise extract from "VERSION" file.
2802  dnl
2803 +AH_TEMPLATE([HAVE_LIBGETTEXT_H], [Define if we're using ./intl.])
2804  AC_DEFUN([CF_BUNDLED_INTL],[
2805  cf_makefile=ifelse($1,,Makefile,$1)
2806  
2807 @@ -830,6 +253,7 @@
2808                 system_name="`(hostname) 2>/dev/null`"
2809         fi
2810  fi
2811 +AH_TEMPLATE([SYSTEM_NAME], [Set to the system name])
2812  test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
2813  AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
2814  
2815 @@ -845,6 +269,8 @@
2816  dnl CF_CURSES_CHTYPE version: 6 updated: 2003/11/06 19:59:57
2817  dnl ----------------
2818  dnl Test if curses defines 'chtype' (usually a 'long' type for SysV curses).
2819 +AH_TEMPLATE([HAVE_TYPE_CHTYPE], [Define if curses defines 'chtype'.])
2820 +AH_TEMPLATE([TYPE_CHTYPE_IS_SCALAR], [Define if chtype is scalar rather than a struct.])
2821  AC_DEFUN([CF_CURSES_CHTYPE],
2822  [
2823  AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
2824 @@ -1091,6 +517,9 @@
2825  done
2826  ])
2827  
2828 +AH_TEMPLATE([HAVE_TERM_H], [define if you have term.h])
2829 +AH_TEMPLATE([HAVE_NCURSES_TERM_H], [define if you have ncurses/term.h])
2830 +AH_TEMPLATE([HAVE_NCURSESW_TERM_H], [define if you have ncursesw/term.h])
2831  case $cf_cv_term_header in #(vi
2832  term.h) #(vi
2833         AC_DEFINE(HAVE_TERM_H)
2834 @@ -1208,6 +637,8 @@
2835  dnl I don't use AC_HEADER_SYS_WAIT, because it defines HAVE_SYS_WAIT_H, which
2836  dnl would conflict with an attempt to test that header directly.
2837  dnl
2838 +AH_TEMPLATE([WAIT_USES_UNION], [Define if wait uses union])
2839 +AH_TEMPLATE([WAITPID_USES_UNION], [Define if waitpid uses union])
2840  AC_DEFUN([CF_FUNC_WAIT],
2841  [
2842  AC_REQUIRE([CF_UNION_WAIT])
2843 @@ -1690,6 +1121,7 @@
2844  dnl ----------------------
2845  dnl Check if the file-system supports mixed-case filenames.  If we're able to
2846  dnl create a lowercase name and see it as uppercase, it doesn't support that.
2847 +AH_TEMPLATE([MIXEDCASE_FILENAMES],[Define if the file-system supports mixed-case filenames.])
2848  AC_DEFUN([CF_MIXEDCASE_FILENAMES],
2849  [
2850  AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
2851 @@ -1836,8 +1268,13 @@
2852  
2853  fi
2854  
2855 -AC_DEFINE(NCURSES)
2856  
2857 +AH_TEMPLATE([NCURSES],[Define if you have ncurses])
2858 +AH_TEMPLATE([HAVE_NCURSES_H],[Define if you have ncurses.h])
2859 +AH_TEMPLATE([HAVE_NCURSES_NCURSES_H],[Define if you have ncurses/ncurses.h])
2860 +AH_TEMPLATE([HAVE_NCURSESW_NCURSES_H],[Define if you have ncursesw/ncurses.h])
2861 +
2862 +AC_DEFINE(NCURSES)
2863  case $cf_cv_ncurses_header in # (vi
2864  *ncurses.h)
2865         AC_DEFINE(HAVE_NCURSES_H)
2866 @@ -2129,6 +1566,7 @@
2867  dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
2868  dnl -----------
2869  dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
2870 +AH_TEMPLATE([PROG_EXT],[Set to prog extension])
2871  AC_DEFUN([CF_PROG_EXT],
2872  [
2873  AC_REQUIRE([CF_CHECK_CACHE])
2874 @@ -2281,6 +1719,7 @@
2875  dnl
2876  dnl Sets: $cf_cv_type_unionwait
2877  dnl Defines: HAVE_TYPE_UNIONWAIT
2878 +AH_TEMPLATE([HAVE_TYPE_UNIONWAIT], [Define if BSD-style union wait is declared.])
2879  AC_DEFUN([CF_UNION_WAIT],
2880  [
2881  AC_REQUIRE([CF_WAIT_HEADERS])
2882 @@ -2325,6 +1764,7 @@
2883  dnl CF_UTF8_LIB version: 4 updated: 2003/03/01 18:36:42
2884  dnl -----------
2885  dnl Check for multibyte support, and if not found, utf8 compatibility library
2886 +AH_TEMPLATE([HAVE_LIBUTF8_H],[Define if we have libutf8.h])
2887  AC_DEFUN([CF_UTF8_LIB],
2888  [
2889  AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
2890 @@ -2430,6 +1870,7 @@
2891  dnl need the package name to ensure that the defined symbols are unique.
2892  ifelse($1,,,[
2893         PACKAGE=$1
2894 +       AH_TEMPLATE([PACKAGE],[Define to package name])
2895         AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
2896         AC_SUBST(PACKAGE)
2897         CF_UPPER(cf_PACKAGE,$PACKAGE)
2898 @@ -2628,138 +2069,1693 @@
2899  
2900  test -z "$LIBTOOL" && ECHO_LT=
2901  
2902 -AC_SUBST(LIBTOOL)
2903 -AC_SUBST(LIBTOOL_CXX)
2904 +AC_SUBST(LIBTOOL)
2905 +AC_SUBST(LIBTOOL_CXX)
2906 +
2907 +AC_SUBST(LIB_CREATE)
2908 +AC_SUBST(LIB_OBJECT)
2909 +AC_SUBST(LIB_SUFFIX)
2910 +AC_SUBST(LIB_PREP)
2911 +
2912 +AC_SUBST(LIB_CLEAN)
2913 +AC_SUBST(LIB_COMPILE)
2914 +AC_SUBST(LIB_LINK)
2915 +AC_SUBST(LIB_INSTALL)
2916 +AC_SUBST(LIB_UNINSTALL)
2917 +
2918 +])dnl
2919 +dnl ---------------------------------------------------------------------------
2920 +dnl CF_XOPEN_CURSES version: 8 updated: 2003/11/07 19:47:46
2921 +dnl ---------------
2922 +dnl Test if we should define X/Open source for curses, needed on Digital Unix
2923 +dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
2924 +dnl
2925 +dnl The getbegyx() check is needed for HPUX, which omits legacy macros such
2926 +dnl as getbegy().  The latter is better design, but the former is standard.
2927 +AC_DEFUN([CF_XOPEN_CURSES],
2928 +[
2929 +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
2930 +AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[
2931 +AC_TRY_LINK([
2932 +#include <stdlib.h>
2933 +#include <${cf_cv_ncurses_header-curses.h}>],[
2934 +       long x = winnstr(stdscr, "", 0);
2935 +       int x1, y1;
2936 +       getbegyx(stdscr, y1, x1)],
2937 +       [cf_cv_need_xopen_extension=no],
2938 +       [AC_TRY_LINK([
2939 +#define _XOPEN_SOURCE_EXTENDED
2940 +#include <stdlib.h>
2941 +#include <${cf_cv_ncurses_header-curses.h}>],[
2942 +       long x = winnstr(stdscr, "", 0);
2943 +       int x1, y1;
2944 +       getbegyx(stdscr, y1, x1)],
2945 +       [cf_cv_need_xopen_extension=yes],
2946 +       [cf_cv_need_xopen_extension=unknown])])])
2947 +test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
2948 +])dnl
2949 +dnl ---------------------------------------------------------------------------
2950 +dnl CF_XOPEN_SOURCE version: 17 updated: 2005/02/06 12:07:45
2951 +dnl ---------------
2952 +dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
2953 +dnl or adapt to the vendor's definitions to get equivalent functionality.
2954 +dnl
2955 +dnl Parameters:
2956 +dnl    $1 is the nominal value for _XOPEN_SOURCE
2957 +dnl    $2 is the nominal value for _POSIX_C_SOURCE
2958 +AC_DEFUN([CF_XOPEN_SOURCE],[
2959 +
2960 +cf_XOPEN_SOURCE=ifelse($1,,500,$1)
2961 +cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)
2962 +
2963 +case $host_os in #(vi
2964 +aix[[45]]*) #(vi
2965 +       CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
2966 +       ;;
2967 +freebsd*) #(vi
2968 +       # 5.x headers associate
2969 +       #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2970 +       #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2971 +       cf_POSIX_C_SOURCE=200112L
2972 +       cf_XOPEN_SOURCE=600
2973 +       CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2974 +       ;;
2975 +hpux*) #(vi
2976 +       CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
2977 +       ;;
2978 +irix[[56]].*) #(vi
2979 +       CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
2980 +       ;;
2981 +linux*|gnu*) #(vi
2982 +       CF_GNU_SOURCE
2983 +       ;;
2984 +mirbsd*) #(vi
2985 +       # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
2986 +       ;;
2987 +netbsd*) #(vi
2988 +       # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
2989 +       ;;
2990 +openbsd*) #(vi
2991 +       # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
2992 +       ;;
2993 +osf[[45]]*) #(vi
2994 +       CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
2995 +       ;;
2996 +sco*) #(vi
2997 +       # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
2998 +       ;;
2999 +solaris*) #(vi
3000 +       CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
3001 +       ;;
3002 +*)
3003 +       AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
3004 +       AC_TRY_COMPILE([#include <sys/types.h>],[
3005 +#ifndef _XOPEN_SOURCE
3006 +make an error
3007 +#endif],
3008 +       [cf_cv_xopen_source=no],
3009 +       [cf_save="$CPPFLAGS"
3010 +        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3011 +        AC_TRY_COMPILE([#include <sys/types.h>],[
3012 +#ifdef _XOPEN_SOURCE
3013 +make an error
3014 +#endif],
3015 +       [cf_cv_xopen_source=no],
3016 +       [cf_cv_xopen_source=$cf_XOPEN_SOURCE])
3017 +       CPPFLAGS="$cf_save"
3018 +       ])
3019 +])
3020 +test "$cf_cv_xopen_source" != no && CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE -D_XOPEN_SOURCE=$cf_cv_xopen_source"
3021 +       CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
3022 +       ;;
3023 +esac
3024 +])
3025 +
3026 +# gettext.m4 serial 17 (gettext-0.11.5)
3027 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
3028 +dnl This file is free software, distributed under the terms of the GNU
3029 +dnl General Public License.  As a special exception to the GNU General
3030 +dnl Public License, this file may be distributed as part of a program
3031 +dnl that contains a configuration script generated by Autoconf, under
3032 +dnl the same distribution terms as the rest of that program.
3033 +dnl
3034 +dnl This file can can be used in projects which are not available under
3035 +dnl the GNU General Public License or the GNU Library General Public
3036 +dnl License but which still want to provide support for the GNU gettext
3037 +dnl functionality.
3038 +dnl Please note that the actual code of the GNU gettext library is covered
3039 +dnl by the GNU Library General Public License, and the rest of the GNU
3040 +dnl gettext package package is covered by the GNU General Public License.
3041 +dnl They are *not* in the public domain.
3042 +
3043 +dnl Authors:
3044 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3045 +dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
3046 +
3047 +dnl Macro to add for using GNU gettext.
3048 +
3049 +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
3050 +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
3051 +dnl    default (if it is not specified or empty) is 'no-libtool'.
3052 +dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
3053 +dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
3054 +dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
3055 +dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
3056 +dnl    depending on --{enable,disable}-{shared,static} and on the presence of
3057 +dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
3058 +dnl    $(top_builddir)/intl/libintl.a will be created.
3059 +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
3060 +dnl    implementations (in libc or libintl) without the ngettext() function
3061 +dnl    will be ignored.  If NEEDSYMBOL is specified and is
3062 +dnl    'need-formatstring-macros', then GNU gettext implementations that don't
3063 +dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
3064 +dnl INTLDIR is used to find the intl libraries.  If empty,
3065 +dnl    the value `$(top_builddir)/intl/' is used.
3066 +dnl
3067 +dnl The result of the configuration is one of three cases:
3068 +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
3069 +dnl    and used.
3070 +dnl    Catalog format: GNU --> install in $(datadir)
3071 +dnl    Catalog extension: .mo after installation, .gmo in source tree
3072 +dnl 2) GNU gettext has been found in the system's C library.
3073 +dnl    Catalog format: GNU --> install in $(datadir)
3074 +dnl    Catalog extension: .mo after installation, .gmo in source tree
3075 +dnl 3) No internationalization, always use English msgid.
3076 +dnl    Catalog format: none
3077 +dnl    Catalog extension: none
3078 +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
3079 +dnl The use of .gmo is historical (it was needed to avoid overwriting the
3080 +dnl GNU format catalogs when building on a platform with an X/Open gettext),
3081 +dnl but we keep it in order not to force irrelevant filename changes on the
3082 +dnl maintainers.
3083 +dnl
3084 +AC_DEFUN([AM_GNU_GETTEXT],
3085 +[
3086 +  dnl Argument checking.
3087 +  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
3088 +    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
3089 +])])])])])
3090 +  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
3091 +    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
3092 +])])])])
3093 +  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
3094 +  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
3095 +
3096 +  AC_REQUIRE([AM_PO_SUBDIRS])dnl
3097 +  ifelse(gt_included_intl, yes, [
3098 +    AC_REQUIRE([AM_INTL_SUBDIR])dnl
3099 +  ])
3100 +
3101 +  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
3102 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3103 +  AC_REQUIRE([AC_LIB_RPATH])
3104 +
3105 +  dnl Sometimes libintl requires libiconv, so first search for libiconv.
3106 +  dnl Ideally we would do this search only after the
3107 +  dnl      if test "$USE_NLS" = "yes"; then
3108 +  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
3109 +  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
3110 +  dnl the configure script would need to contain the same shell code
3111 +  dnl again, outside any 'if'. There are two solutions:
3112 +  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
3113 +  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
3114 +  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
3115 +  dnl documented, we avoid it.
3116 +  ifelse(gt_included_intl, yes, , [
3117 +    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
3118 +  ])
3119 +
3120 +  AC_MSG_CHECKING([whether NLS is requested])
3121 +  dnl Default is enabled NLS
3122 +  AC_ARG_ENABLE(nls,
3123 +    [  --disable-nls           do not use Native Language Support],
3124 +    USE_NLS=$enableval, USE_NLS=yes)
3125 +  AC_MSG_RESULT($USE_NLS)
3126 +  AC_SUBST(USE_NLS)
3127 +
3128 +  ifelse(gt_included_intl, yes, [
3129 +    BUILD_INCLUDED_LIBINTL=no
3130 +    USE_INCLUDED_LIBINTL=no
3131 +  ])
3132 +  LIBINTL=
3133 +  LTLIBINTL=
3134 +  POSUB=
3135 +
3136 +  dnl If we use NLS figure out what method
3137 +  if test "$USE_NLS" = "yes"; then
3138 +    gt_use_preinstalled_gnugettext=no
3139 +    ifelse(gt_included_intl, yes, [
3140 +      AC_MSG_CHECKING([whether included gettext is requested])
3141 +      AC_ARG_WITH(included-gettext,
3142 +        [  --with-included-gettext use the GNU gettext library included here],
3143 +        nls_cv_force_use_gnu_gettext=$withval,
3144 +        nls_cv_force_use_gnu_gettext=no)
3145 +      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
3146 +
3147 +      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
3148 +      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
3149 +    ])
3150 +        dnl User does not insist on using GNU NLS library.  Figure out what
3151 +        dnl to use.  If GNU gettext is available we use this.  Else we have
3152 +        dnl to fall back to GNU NLS library.
3153 +
3154 +        dnl Add a version number to the cache macros.
3155 +        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
3156 +        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
3157 +        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
3158 +
3159 +        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
3160 +         [AC_TRY_LINK([#include <libintl.h>
3161 +]ifelse([$2], [need-formatstring-macros],
3162 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
3163 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
3164 +#endif
3165 +changequote(,)dnl
3166 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
3167 +changequote([,])dnl
3168 +], [])[extern int _nl_msg_cat_cntr;
3169 +extern int *_nl_domain_bindings;],
3170 +            [bindtextdomain ("", "");
3171 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
3172 +            gt_cv_func_gnugettext_libc=yes,
3173 +            gt_cv_func_gnugettext_libc=no)])
3174 +
3175 +        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
3176 +          dnl Sometimes libintl requires libiconv, so first search for libiconv.
3177 +          ifelse(gt_included_intl, yes, , [
3178 +            AM_ICONV_LINK
3179 +          ])
3180 +          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
3181 +          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
3182 +          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
3183 +          dnl even if libiconv doesn't exist.
3184 +          AC_LIB_LINKFLAGS_BODY([intl])
3185 +          AC_CACHE_CHECK([for GNU gettext in libintl],
3186 +            gt_cv_func_gnugettext_libintl,
3187 +           [gt_save_CPPFLAGS="$CPPFLAGS"
3188 +            CPPFLAGS="$CPPFLAGS $INCINTL"
3189 +            gt_save_LIBS="$LIBS"
3190 +            LIBS="$LIBS $LIBINTL"
3191 +            dnl Now see whether libintl exists and does not depend on libiconv.
3192 +            AC_TRY_LINK([#include <libintl.h>
3193 +]ifelse([$2], [need-formatstring-macros],
3194 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
3195 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
3196 +#endif
3197 +changequote(,)dnl
3198 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
3199 +changequote([,])dnl
3200 +], [])[extern int _nl_msg_cat_cntr;
3201 +extern
3202 +#ifdef __cplusplus
3203 +"C"
3204 +#endif
3205 +const char *_nl_expand_alias ();],
3206 +              [bindtextdomain ("", "");
3207 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
3208 +              gt_cv_func_gnugettext_libintl=yes,
3209 +              gt_cv_func_gnugettext_libintl=no)
3210 +            dnl Now see whether libintl exists and depends on libiconv.
3211 +            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
3212 +              LIBS="$LIBS $LIBICONV"
3213 +              AC_TRY_LINK([#include <libintl.h>
3214 +]ifelse([$2], [need-formatstring-macros],
3215 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
3216 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
3217 +#endif
3218 +changequote(,)dnl
3219 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
3220 +changequote([,])dnl
3221 +], [])[extern int _nl_msg_cat_cntr;
3222 +extern
3223 +#ifdef __cplusplus
3224 +"C"
3225 +#endif
3226 +const char *_nl_expand_alias ();],
3227 +                [bindtextdomain ("", "");
3228 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
3229 +               [LIBINTL="$LIBINTL $LIBICONV"
3230 +                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
3231 +                gt_cv_func_gnugettext_libintl=yes
3232 +               ])
3233 +            fi
3234 +            CPPFLAGS="$gt_save_CPPFLAGS"
3235 +            LIBS="$gt_save_LIBS"])
3236 +        fi
3237 +
3238 +        dnl If an already present or preinstalled GNU gettext() is found,
3239 +        dnl use it.  But if this macro is used in GNU gettext, and GNU
3240 +        dnl gettext is already preinstalled in libintl, we update this
3241 +        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
3242 +        if test "$gt_cv_func_gnugettext_libc" = "yes" \
3243 +           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
3244 +                && test "$PACKAGE" != gettext; }; then
3245 +          gt_use_preinstalled_gnugettext=yes
3246 +        else
3247 +          dnl Reset the values set by searching for libintl.
3248 +          LIBINTL=
3249 +          LTLIBINTL=
3250 +          INCINTL=
3251 +        fi
3252 +
3253 +    ifelse(gt_included_intl, yes, [
3254 +        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
3255 +          dnl GNU gettext is not found in the C library.
3256 +          dnl Fall back on included GNU gettext library.
3257 +          nls_cv_use_gnu_gettext=yes
3258 +        fi
3259 +      fi
3260 +
3261 +      if test "$nls_cv_use_gnu_gettext" = "yes"; then
3262 +        dnl Mark actions used to generate GNU NLS library.
3263 +        INTLOBJS="\$(GETTOBJS)"
3264 +        BUILD_INCLUDED_LIBINTL=yes
3265 +        USE_INCLUDED_LIBINTL=yes
3266 +        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
3267 +        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
3268 +        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
3269 +      fi
3270 +
3271 +      if test "$gt_use_preinstalled_gnugettext" = "yes" \
3272 +         || test "$nls_cv_use_gnu_gettext" = "yes"; then
3273 +        dnl Mark actions to use GNU gettext tools.
3274 +        CATOBJEXT=.gmo
3275 +      fi
3276 +    ])
3277 +
3278 +    if test "$gt_use_preinstalled_gnugettext" = "yes" \
3279 +       || test "$nls_cv_use_gnu_gettext" = "yes"; then
3280 +      AC_DEFINE(ENABLE_NLS, 1,
3281 +        [Define to 1 if translation of program messages to the user's native language
3282 +   is requested.])
3283 +    else
3284 +      USE_NLS=no
3285 +    fi
3286 +  fi
3287 +
3288 +  if test "$USE_NLS" = "yes"; then
3289 +
3290 +    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
3291 +      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
3292 +        AC_MSG_CHECKING([how to link with libintl])
3293 +        AC_MSG_RESULT([$LIBINTL])
3294 +        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
3295 +      fi
3296 +
3297 +      dnl For backward compatibility. Some packages may be using this.
3298 +      AC_DEFINE(HAVE_GETTEXT, 1,
3299 +       [Define if the GNU gettext() function is already present or preinstalled.])
3300 +      AC_DEFINE(HAVE_DCGETTEXT, 1,
3301 +       [Define if the GNU dcgettext() function is already present or preinstalled.])
3302 +    fi
3303 +
3304 +    dnl We need to process the po/ directory.
3305 +    POSUB=po
3306 +  fi
3307 +
3308 +  ifelse(gt_included_intl, yes, [
3309 +    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
3310 +    dnl to 'yes' because some of the testsuite requires it.
3311 +    if test "$PACKAGE" = gettext; then
3312 +      BUILD_INCLUDED_LIBINTL=yes
3313 +    fi
3314 +
3315 +    dnl Make all variables we use known to autoconf.
3316 +    AC_SUBST(BUILD_INCLUDED_LIBINTL)
3317 +    AC_SUBST(USE_INCLUDED_LIBINTL)
3318 +    AC_SUBST(CATOBJEXT)
3319 +    AC_SUBST(INTLOBJS)
3320 +
3321 +    dnl For backward compatibility. Some configure.ins may be using this.
3322 +    nls_cv_header_intl=
3323 +    nls_cv_header_libgt=
3324 +
3325 +    dnl For backward compatibility. Some Makefiles may be using this.
3326 +    DATADIRNAME=share
3327 +    AC_SUBST(DATADIRNAME)
3328 +
3329 +    dnl For backward compatibility. Some Makefiles may be using this.
3330 +    INSTOBJEXT=.mo
3331 +    AC_SUBST(INSTOBJEXT)
3332 +
3333 +    dnl For backward compatibility. Some Makefiles may be using this.
3334 +    GENCAT=gencat
3335 +    AC_SUBST(GENCAT)
3336 +
3337 +    dnl Enable libtool support if the surrounding package wishes it.
3338 +    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
3339 +    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
3340 +  ])
3341 +
3342 +  dnl For backward compatibility. Some Makefiles may be using this.
3343 +  INTLLIBS="$LIBINTL"
3344 +  AC_SUBST(INTLLIBS)
3345 +
3346 +  dnl Make all documented variables known to autoconf.
3347 +  AC_SUBST(LIBINTL)
3348 +  AC_SUBST(LTLIBINTL)
3349 +  AC_SUBST(POSUB)
3350 +])
3351 +
3352 +
3353 +dnl Checks for all prerequisites of the po subdirectory,
3354 +dnl except for USE_NLS.
3355 +AC_DEFUN([AM_PO_SUBDIRS],
3356 +[
3357 +  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3358 +  AC_REQUIRE([AC_PROG_INSTALL])dnl
3359 +  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
3360 +
3361 +  dnl Perform the following tests also if --disable-nls has been given,
3362 +  dnl because they are needed for "make dist" to work.
3363 +
3364 +  dnl Search for GNU msgfmt in the PATH.
3365 +  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3366 +  dnl The second test excludes FreeBSD msgfmt.
3367 +  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3368 +    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
3369 +     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3370 +    :)
3371 +  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3372 +
3373 +  dnl Search for GNU xgettext 0.11 or newer in the PATH.
3374 +  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3375 +  dnl The second test excludes FreeBSD xgettext.
3376 +  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3377 +    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
3378 +     (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3379 +    :)
3380 +  dnl Remove leftover from FreeBSD xgettext call.
3381 +  rm -f messages.po
3382 +
3383 +  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3384 +  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3385 +    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
3386 +
3387 +  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
3388 +  dnl Test whether we really found GNU msgfmt.
3389 +  if test "$GMSGFMT" != ":"; then
3390 +    dnl If it is no GNU msgfmt we define it as : so that the
3391 +    dnl Makefiles still can work.
3392 +    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
3393 +       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
3394 +      : ;
3395 +    else
3396 +      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
3397 +      AC_MSG_RESULT(
3398 +        [found $GMSGFMT program is not GNU msgfmt; ignore it])
3399 +      GMSGFMT=":"
3400 +    fi
3401 +  fi
3402 +
3403 +  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
3404 +  dnl Test whether we really found GNU xgettext.
3405 +  if test "$XGETTEXT" != ":"; then
3406 +    dnl If it is no GNU xgettext we define it as : so that the
3407 +    dnl Makefiles still can work.
3408 +    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
3409 +       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
3410 +      : ;
3411 +    else
3412 +      AC_MSG_RESULT(
3413 +        [found xgettext program is not GNU xgettext; ignore it])
3414 +      XGETTEXT=":"
3415 +    fi
3416 +    dnl Remove leftover from FreeBSD xgettext call.
3417 +    rm -f messages.po
3418 +  fi
3419 +
3420 +  AC_OUTPUT_COMMANDS([
3421 +    for ac_file in $CONFIG_FILES; do
3422 +      # Support "outfile[:infile[:infile...]]"
3423 +      case "$ac_file" in
3424 +        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3425 +      esac
3426 +      # PO directories have a Makefile.in generated from Makefile.in.in.
3427 +      case "$ac_file" in */Makefile.in)
3428 +        # Adjust a relative srcdir.
3429 +        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3430 +        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
3431 +        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3432 +        # In autoconf-2.13 it is called $ac_given_srcdir.
3433 +        # In autoconf-2.50 it is called $srcdir.
3434 +        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3435 +        case "$ac_given_srcdir" in
3436 +          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3437 +          /*) top_srcdir="$ac_given_srcdir" ;;
3438 +          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
3439 +        esac
3440 +        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3441 +          rm -f "$ac_dir/POTFILES"
3442 +          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3443 +          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
3444 +          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
3445 +          # on $ac_dir but don't depend on user-specified configuration
3446 +          # parameters.
3447 +          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3448 +            # The LINGUAS file contains the set of available languages.
3449 +            if test -n "$ALL_LINGUAS"; then
3450 +              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3451 +            fi
3452 +            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3453 +            # Hide the ALL_LINGUAS assigment from automake.
3454 +            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3455 +          fi
3456 +          case "$ac_given_srcdir" in
3457 +            .) srcdirpre= ;;
3458 +            *) srcdirpre='$(srcdir)/' ;;
3459 +          esac
3460 +          POFILES=
3461 +          GMOFILES=
3462 +          UPDATEPOFILES=
3463 +          DUMMYPOFILES=
3464 +          for lang in $ALL_LINGUAS; do
3465 +            POFILES="$POFILES $srcdirpre$lang.po"
3466 +            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3467 +            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3468 +            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3469 +          done
3470 +          # CATALOGS depends on both $ac_dir and the user's LINGUAS
3471 +          # environment variable.
3472 +          INST_LINGUAS=
3473 +          if test -n "$ALL_LINGUAS"; then
3474 +            for presentlang in $ALL_LINGUAS; do
3475 +              useit=no
3476 +              if test "%UNSET%" != "$LINGUAS"; then
3477 +                desiredlanguages="$LINGUAS"
3478 +              else
3479 +                desiredlanguages="$ALL_LINGUAS"
3480 +              fi
3481 +              for desiredlang in $desiredlanguages; do
3482 +                # Use the presentlang catalog if desiredlang is
3483 +                #   a. equal to presentlang, or
3484 +                #   b. a variant of presentlang (because in this case,
3485 +                #      presentlang can be used as a fallback for messages
3486 +                #      which are not translated in the desiredlang catalog).
3487 +                case "$desiredlang" in
3488 +                  "$presentlang"*) useit=yes;;
3489 +                esac
3490 +              done
3491 +              if test $useit = yes; then
3492 +                INST_LINGUAS="$INST_LINGUAS $presentlang"
3493 +              fi
3494 +            done
3495 +          fi
3496 +          CATALOGS=
3497 +          if test -n "$INST_LINGUAS"; then
3498 +            for lang in $INST_LINGUAS; do
3499 +              CATALOGS="$CATALOGS $lang.gmo"
3500 +            done
3501 +          fi
3502 +          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3503 +          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
3504 +          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3505 +            if test -f "$f"; then
3506 +              case "$f" in
3507 +                *.orig | *.bak | *~) ;;
3508 +                *) cat "$f" >> "$ac_dir/Makefile" ;;
3509 +              esac
3510 +            fi
3511 +          done
3512 +        fi
3513 +        ;;
3514 +      esac
3515 +    done],
3516 +   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3517 +    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
3518 +    # from automake.
3519 +    eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
3520 +    # Capture the value of LINGUAS because we need it to compute CATALOGS.
3521 +    LINGUAS="${LINGUAS-%UNSET%}"
3522 +   ])
3523 +])
3524 +
3525 +
3526 +dnl Checks for all prerequisites of the intl subdirectory,
3527 +dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
3528 +dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
3529 +AC_DEFUN([AM_INTL_SUBDIR],
3530 +[
3531 +  AC_REQUIRE([AC_PROG_INSTALL])dnl
3532 +  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
3533 +  AC_REQUIRE([AC_PROG_CC])dnl
3534 +  AC_REQUIRE([AC_CANONICAL_HOST])dnl
3535 +  AC_REQUIRE([AC_PROG_RANLIB])dnl
3536 +  AC_REQUIRE([AC_ISC_POSIX])dnl
3537 +  AC_REQUIRE([AC_HEADER_STDC])dnl
3538 +  AC_REQUIRE([AC_C_CONST])dnl
3539 +  AC_REQUIRE([AC_C_INLINE])dnl
3540 +  AC_REQUIRE([AC_TYPE_OFF_T])dnl
3541 +  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3542 +  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3543 +  AC_REQUIRE([AC_FUNC_MMAP])dnl
3544 +  AC_REQUIRE([jm_GLIBC21])dnl
3545 +  AC_REQUIRE([gt_INTDIV0])dnl
3546 +  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
3547 +  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
3548 +  AC_REQUIRE([gt_INTTYPES_PRI])dnl
3549 +
3550 +  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
3551 +stdlib.h string.h unistd.h sys/param.h])
3552 +  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
3553 +geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
3554 +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
3555 +
3556 +  AM_ICONV
3557 +  AM_LANGINFO_CODESET
3558 +  if test $ac_cv_header_locale_h = yes; then
3559 +    AM_LC_MESSAGES
3560 +  fi
3561 +
3562 +  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
3563 +  dnl because plural.y uses bison specific features. It requires at least
3564 +  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
3565 +  dnl compile.
3566 +  dnl bison is only needed for the maintainer (who touches plural.y). But in
3567 +  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
3568 +  dnl the rule in general Makefile. Now, some people carelessly touch the
3569 +  dnl files or have a broken "make" program, hence the plural.c rule will
3570 +  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
3571 +  dnl present or too old.
3572 +  AC_CHECK_PROGS([INTLBISON], [bison])
3573 +  if test -z "$INTLBISON"; then
3574 +    ac_verc_fail=yes
3575 +  else
3576 +    dnl Found it, now check the version.
3577 +    AC_MSG_CHECKING([version of bison])
3578 +changequote(<<,>>)dnl
3579 +    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
3580 +    case $ac_prog_version in
3581 +      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
3582 +      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
3583 +changequote([,])dnl
3584 +         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
3585 +      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
3586 +    esac
3587 +    AC_MSG_RESULT([$ac_prog_version])
3588 +  fi
3589 +  if test $ac_verc_fail = yes; then
3590 +    INTLBISON=:
3591 +  fi
3592 +])
3593 +
3594 +
3595 +AC_DEFUN([AM_MKINSTALLDIRS],
3596 +[
3597 +  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
3598 +  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
3599 +  dnl Try to locate is.
3600 +  MKINSTALLDIRS=
3601 +  if test -n "$ac_aux_dir"; then
3602 +    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
3603 +  fi
3604 +  if test -z "$MKINSTALLDIRS"; then
3605 +    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
3606 +  fi
3607 +  AC_SUBST(MKINSTALLDIRS)
3608 +])
3609 +
3610 +
3611 +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
3612 +AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
3613 +
3614 +# lib-prefix.m4 serial 1 (gettext-0.11)
3615 +dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3616 +dnl This file is free software, distributed under the terms of the GNU
3617 +dnl General Public License.  As a special exception to the GNU General
3618 +dnl Public License, this file may be distributed as part of a program
3619 +dnl that contains a configuration script generated by Autoconf, under
3620 +dnl the same distribution terms as the rest of that program.
3621 +
3622 +dnl From Bruno Haible.
3623 +
3624 +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
3625 +dnl to access previously installed libraries. The basic assumption is that
3626 +dnl a user will want packages to use other packages he previously installed
3627 +dnl with the same --prefix option.
3628 +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
3629 +dnl libraries, but is otherwise very convenient.
3630 +AC_DEFUN([AC_LIB_PREFIX],
3631 +[
3632 +  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
3633 +  AC_REQUIRE([AC_PROG_CC])
3634 +  AC_REQUIRE([AC_CANONICAL_HOST])
3635 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3636 +  dnl By default, look in $includedir and $libdir.
3637 +  use_additional=yes
3638 +  AC_LIB_WITH_FINAL_PREFIX([
3639 +    eval additional_includedir=\"$includedir\"
3640 +    eval additional_libdir=\"$libdir\"
3641 +  ])
3642 +  AC_ARG_WITH([lib-prefix],
3643 +[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
3644 +  --without-lib-prefix    don't search for libraries in includedir and libdir],
3645 +[
3646 +    if test "X$withval" = "Xno"; then
3647 +      use_additional=no
3648 +    else
3649 +      if test "X$withval" = "X"; then
3650 +        AC_LIB_WITH_FINAL_PREFIX([
3651 +          eval additional_includedir=\"$includedir\"
3652 +          eval additional_libdir=\"$libdir\"
3653 +        ])
3654 +      else
3655 +        additional_includedir="$withval/include"
3656 +        additional_libdir="$withval/lib"
3657 +      fi
3658 +    fi
3659 +])
3660 +  if test $use_additional = yes; then
3661 +    dnl Potentially add $additional_includedir to $CPPFLAGS.
3662 +    dnl But don't add it
3663 +    dnl   1. if it's the standard /usr/include,
3664 +    dnl   2. if it's already present in $CPPFLAGS,
3665 +    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
3666 +    dnl   4. if it doesn't exist as a directory.
3667 +    if test "X$additional_includedir" != "X/usr/include"; then
3668 +      haveit=
3669 +      for x in $CPPFLAGS; do
3670 +        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3671 +        if test "X$x" = "X-I$additional_includedir"; then
3672 +          haveit=yes
3673 +          break
3674 +        fi
3675 +      done
3676 +      if test -z "$haveit"; then
3677 +        if test "X$additional_includedir" = "X/usr/local/include"; then
3678 +          if test -n "$GCC"; then
3679 +            case $host_os in
3680 +              linux*) haveit=yes;;
3681 +            esac
3682 +          fi
3683 +        fi
3684 +        if test -z "$haveit"; then
3685 +          if test -d "$additional_includedir"; then
3686 +            dnl Really add $additional_includedir to $CPPFLAGS.
3687 +            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
3688 +          fi
3689 +        fi
3690 +      fi
3691 +    fi
3692 +    dnl Potentially add $additional_libdir to $LDFLAGS.
3693 +    dnl But don't add it
3694 +    dnl   1. if it's the standard /usr/lib,
3695 +    dnl   2. if it's already present in $LDFLAGS,
3696 +    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
3697 +    dnl   4. if it doesn't exist as a directory.
3698 +    if test "X$additional_libdir" != "X/usr/lib"; then
3699 +      haveit=
3700 +      for x in $LDFLAGS; do
3701 +        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3702 +        if test "X$x" = "X-L$additional_libdir"; then
3703 +          haveit=yes
3704 +          break
3705 +        fi
3706 +      done
3707 +      if test -z "$haveit"; then
3708 +        if test "X$additional_libdir" = "X/usr/local/lib"; then
3709 +          if test -n "$GCC"; then
3710 +            case $host_os in
3711 +              linux*) haveit=yes;;
3712 +            esac
3713 +          fi
3714 +        fi
3715 +        if test -z "$haveit"; then
3716 +          if test -d "$additional_libdir"; then
3717 +            dnl Really add $additional_libdir to $LDFLAGS.
3718 +            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
3719 +          fi
3720 +        fi
3721 +      fi
3722 +    fi
3723 +  fi
3724 +])
3725 +
3726 +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
3727 +dnl acl_final_exec_prefix, containing the values to which $prefix and
3728 +dnl $exec_prefix will expand at the end of the configure script.
3729 +AC_DEFUN([AC_LIB_PREPARE_PREFIX],
3730 +[
3731 +  dnl Unfortunately, prefix and exec_prefix get only finally determined
3732 +  dnl at the end of configure.
3733 +  if test "X$prefix" = "XNONE"; then
3734 +    acl_final_prefix="$ac_default_prefix"
3735 +  else
3736 +    acl_final_prefix="$prefix"
3737 +  fi
3738 +  if test "X$exec_prefix" = "XNONE"; then
3739 +    acl_final_exec_prefix='${prefix}'
3740 +  else
3741 +    acl_final_exec_prefix="$exec_prefix"
3742 +  fi
3743 +  acl_save_prefix="$prefix"
3744 +  prefix="$acl_final_prefix"
3745 +  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
3746 +  prefix="$acl_save_prefix"
3747 +])
3748 +
3749 +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
3750 +dnl variables prefix and exec_prefix bound to the values they will have
3751 +dnl at the end of the configure script.
3752 +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
3753 +[
3754 +  acl_save_prefix="$prefix"
3755 +  prefix="$acl_final_prefix"
3756 +  acl_save_exec_prefix="$exec_prefix"
3757 +  exec_prefix="$acl_final_exec_prefix"
3758 +  $1
3759 +  exec_prefix="$acl_save_exec_prefix"
3760 +  prefix="$acl_save_prefix"
3761 +])
3762 +
3763 +# lib-link.m4 serial 3 (gettext-0.11.3)
3764 +dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3765 +dnl This file is free software, distributed under the terms of the GNU
3766 +dnl General Public License.  As a special exception to the GNU General
3767 +dnl Public License, this file may be distributed as part of a program
3768 +dnl that contains a configuration script generated by Autoconf, under
3769 +dnl the same distribution terms as the rest of that program.
3770 +
3771 +dnl From Bruno Haible.
3772 +
3773 +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
3774 +dnl the libraries corresponding to explicit and implicit dependencies.
3775 +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
3776 +dnl augments the CPPFLAGS variable.
3777 +AC_DEFUN([AC_LIB_LINKFLAGS],
3778 +[
3779 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3780 +  AC_REQUIRE([AC_LIB_RPATH])
3781 +  define([Name],[translit([$1],[./-], [___])])
3782 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
3783 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
3784 +  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
3785 +    AC_LIB_LINKFLAGS_BODY([$1], [$2])
3786 +    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
3787 +    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
3788 +    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
3789 +  ])
3790 +  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
3791 +  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
3792 +  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
3793 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
3794 +  AC_SUBST([LIB]NAME)
3795 +  AC_SUBST([LTLIB]NAME)
3796 +  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
3797 +  dnl results of this search when this library appears as a dependency.
3798 +  HAVE_LIB[]NAME=yes
3799 +  undefine([Name])
3800 +  undefine([NAME])
3801 +])
3802 +
3803 +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
3804 +dnl searches for libname and the libraries corresponding to explicit and
3805 +dnl implicit dependencies, together with the specified include files and
3806 +dnl the ability to compile and link the specified testcode. If found, it
3807 +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
3808 +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
3809 +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
3810 +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
3811 +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
3812 +[
3813 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3814 +  AC_REQUIRE([AC_LIB_RPATH])
3815 +  define([Name],[translit([$1],[./-], [___])])
3816 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
3817 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
3818 +
3819 +  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
3820 +  dnl accordingly.
3821 +  AC_LIB_LINKFLAGS_BODY([$1], [$2])
3822 +
3823 +  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
3824 +  dnl because if the user has installed lib[]Name and not disabled its use
3825 +  dnl via --without-lib[]Name-prefix, he wants to use it.
3826 +  ac_save_CPPFLAGS="$CPPFLAGS"
3827 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
3828 +
3829 +  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
3830 +    ac_save_LIBS="$LIBS"
3831 +    LIBS="$LIBS $LIB[]NAME"
3832 +    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
3833 +    LIBS="$ac_save_LIBS"
3834 +  ])
3835 +  if test "$ac_cv_lib[]Name" = yes; then
3836 +    HAVE_LIB[]NAME=yes
3837 +    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
3838 +    AC_MSG_CHECKING([how to link with lib[]$1])
3839 +    AC_MSG_RESULT([$LIB[]NAME])
3840 +  else
3841 +    HAVE_LIB[]NAME=no
3842 +    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
3843 +    dnl $INC[]NAME either.
3844 +    CPPFLAGS="$ac_save_CPPFLAGS"
3845 +    LIB[]NAME=
3846 +    LTLIB[]NAME=
3847 +  fi
3848 +  AC_SUBST([HAVE_LIB]NAME)
3849 +  AC_SUBST([LIB]NAME)
3850 +  AC_SUBST([LTLIB]NAME)
3851 +  undefine([Name])
3852 +  undefine([NAME])
3853 +])
3854 +
3855 +dnl Determine the platform dependent parameters needed to use rpath:
3856 +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
3857 +dnl hardcode_direct, hardcode_minus_L,
3858 +dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
3859 +AC_DEFUN([AC_LIB_RPATH],
3860 +[
3861 +  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
3862 +  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
3863 +  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
3864 +  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
3865 +  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
3866 +    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
3867 +    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
3868 +    . ./conftest.sh
3869 +    rm -f ./conftest.sh
3870 +    acl_cv_rpath=done
3871 +  ])
3872 +  wl="$acl_cv_wl"
3873 +  libext="$acl_cv_libext"
3874 +  shlibext="$acl_cv_shlibext"
3875 +  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
3876 +  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
3877 +  hardcode_direct="$acl_cv_hardcode_direct"
3878 +  hardcode_minus_L="$acl_cv_hardcode_minus_L"
3879 +  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
3880 +  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
3881 +  dnl Determine whether the user wants rpath handling at all.
3882 +  AC_ARG_ENABLE(rpath,
3883 +    [  --disable-rpath         do not hardcode runtime library paths],
3884 +    :, enable_rpath=yes)
3885 +])
3886 +
3887 +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
3888 +dnl the libraries corresponding to explicit and implicit dependencies.
3889 +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
3890 +AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
3891 +[
3892 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
3893 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
3894 +  dnl By default, look in $includedir and $libdir.
3895 +  use_additional=yes
3896 +  AC_LIB_WITH_FINAL_PREFIX([
3897 +    eval additional_includedir=\"$includedir\"
3898 +    eval additional_libdir=\"$libdir\"
3899 +  ])
3900 +  AC_ARG_WITH([lib$1-prefix],
3901 +[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
3902 +  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
3903 +[
3904 +    if test "X$withval" = "Xno"; then
3905 +      use_additional=no
3906 +    else
3907 +      if test "X$withval" = "X"; then
3908 +        AC_LIB_WITH_FINAL_PREFIX([
3909 +          eval additional_includedir=\"$includedir\"
3910 +          eval additional_libdir=\"$libdir\"
3911 +        ])
3912 +      else
3913 +        additional_includedir="$withval/include"
3914 +        additional_libdir="$withval/lib"
3915 +      fi
3916 +    fi
3917 +])
3918 +  dnl Search the library and its dependencies in $additional_libdir and
3919 +  dnl $LDFLAGS. Using breadth-first-seach.
3920 +  LIB[]NAME=
3921 +  LTLIB[]NAME=
3922 +  INC[]NAME=
3923 +  rpathdirs=
3924 +  ltrpathdirs=
3925 +  names_already_handled=
3926 +  names_next_round='$1 $2'
3927 +  while test -n "$names_next_round"; do
3928 +    names_this_round="$names_next_round"
3929 +    names_next_round=
3930 +    for name in $names_this_round; do
3931 +      already_handled=
3932 +      for n in $names_already_handled; do
3933 +        if test "$n" = "$name"; then
3934 +          already_handled=yes
3935 +          break
3936 +        fi
3937 +      done
3938 +      if test -z "$already_handled"; then
3939 +        names_already_handled="$names_already_handled $name"
3940 +        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
3941 +        dnl or AC_LIB_HAVE_LINKFLAGS call.
3942 +        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
3943 +        eval value=\"\$HAVE_LIB$uppername\"
3944 +        if test -n "$value"; then
3945 +          if test "$value" = yes; then
3946 +            eval value=\"\$LIB$uppername\"
3947 +            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
3948 +            eval value=\"\$LTLIB$uppername\"
3949 +            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
3950 +          else
3951 +            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
3952 +            dnl that this library doesn't exist. So just drop it.
3953 +            :
3954 +          fi
3955 +        else
3956 +          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
3957 +          dnl and the already constructed $LIBNAME/$LTLIBNAME.
3958 +          found_dir=
3959 +          found_la=
3960 +          found_so=
3961 +          found_a=
3962 +          if test $use_additional = yes; then
3963 +            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
3964 +              found_dir="$additional_libdir"
3965 +              found_so="$additional_libdir/lib$name.$shlibext"
3966 +              if test -f "$additional_libdir/lib$name.la"; then
3967 +                found_la="$additional_libdir/lib$name.la"
3968 +              fi
3969 +            else
3970 +              if test -f "$additional_libdir/lib$name.$libext"; then
3971 +                found_dir="$additional_libdir"
3972 +                found_a="$additional_libdir/lib$name.$libext"
3973 +                if test -f "$additional_libdir/lib$name.la"; then
3974 +                  found_la="$additional_libdir/lib$name.la"
3975 +                fi
3976 +              fi
3977 +            fi
3978 +          fi
3979 +          if test "X$found_dir" = "X"; then
3980 +            for x in $LDFLAGS $LTLIB[]NAME; do
3981 +              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3982 +              case "$x" in
3983 +                -L*)
3984 +                  dir=`echo "X$x" | sed -e 's/^X-L//'`
3985 +                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
3986 +                    found_dir="$dir"
3987 +                    found_so="$dir/lib$name.$shlibext"
3988 +                    if test -f "$dir/lib$name.la"; then
3989 +                      found_la="$dir/lib$name.la"
3990 +                    fi
3991 +                  else
3992 +                    if test -f "$dir/lib$name.$libext"; then
3993 +                      found_dir="$dir"
3994 +                      found_a="$dir/lib$name.$libext"
3995 +                      if test -f "$dir/lib$name.la"; then
3996 +                        found_la="$dir/lib$name.la"
3997 +                      fi
3998 +                    fi
3999 +                  fi
4000 +                  ;;
4001 +              esac
4002 +              if test "X$found_dir" != "X"; then
4003 +                break
4004 +              fi
4005 +            done
4006 +          fi
4007 +          if test "X$found_dir" != "X"; then
4008 +            dnl Found the library.
4009 +            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
4010 +            if test "X$found_so" != "X"; then
4011 +              dnl Linking with a shared library. We attempt to hardcode its
4012 +              dnl directory into the executable's runpath, unless it's the
4013 +              dnl standard /usr/lib.
4014 +              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
4015 +                dnl No hardcoding is needed.
4016 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4017 +              else
4018 +                dnl Use an explicit option to hardcode DIR into the resulting
4019 +                dnl binary.
4020 +                dnl Potentially add DIR to ltrpathdirs.
4021 +                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4022 +                haveit=
4023 +                for x in $ltrpathdirs; do
4024 +                  if test "X$x" = "X$found_dir"; then
4025 +                    haveit=yes
4026 +                    break
4027 +                  fi
4028 +                done
4029 +                if test -z "$haveit"; then
4030 +                  ltrpathdirs="$ltrpathdirs $found_dir"
4031 +                fi
4032 +                dnl The hardcoding into $LIBNAME is system dependent.
4033 +                if test "$hardcode_direct" = yes; then
4034 +                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
4035 +                  dnl resulting binary.
4036 +                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4037 +                else
4038 +                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
4039 +                    dnl Use an explicit option to hardcode DIR into the resulting
4040 +                    dnl binary.
4041 +                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4042 +                    dnl Potentially add DIR to rpathdirs.
4043 +                    dnl The rpathdirs will be appended to $LIBNAME at the end.
4044 +                    haveit=
4045 +                    for x in $rpathdirs; do
4046 +                      if test "X$x" = "X$found_dir"; then
4047 +                        haveit=yes
4048 +                        break
4049 +                      fi
4050 +                    done
4051 +                    if test -z "$haveit"; then
4052 +                      rpathdirs="$rpathdirs $found_dir"
4053 +                    fi
4054 +                  else
4055 +                    dnl Rely on "-L$found_dir".
4056 +                    dnl But don't add it if it's already contained in the LDFLAGS
4057 +                    dnl or the already constructed $LIBNAME
4058 +                    haveit=
4059 +                    for x in $LDFLAGS $LIB[]NAME; do
4060 +                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4061 +                      if test "X$x" = "X-L$found_dir"; then
4062 +                        haveit=yes
4063 +                        break
4064 +                      fi
4065 +                    done
4066 +                    if test -z "$haveit"; then
4067 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
4068 +                    fi
4069 +                    if test "$hardcode_minus_L" != no; then
4070 +                      dnl FIXME: Not sure whether we should use
4071 +                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4072 +                      dnl here.
4073 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4074 +                    else
4075 +                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
4076 +                      dnl here, because this doesn't fit in flags passed to the
4077 +                      dnl compiler. So give up. No hardcoding. This affects only
4078 +                      dnl very old systems.
4079 +                      dnl FIXME: Not sure whether we should use
4080 +                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4081 +                      dnl here.
4082 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4083 +                    fi
4084 +                  fi
4085 +                fi
4086 +              fi
4087 +            else
4088 +              if test "X$found_a" != "X"; then
4089 +                dnl Linking with a static library.
4090 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
4091 +              else
4092 +                dnl We shouldn't come here, but anyway it's good to have a
4093 +                dnl fallback.
4094 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
4095 +              fi
4096 +            fi
4097 +            dnl Assume the include files are nearby.
4098 +            additional_includedir=
4099 +            case "$found_dir" in
4100 +              */lib | */lib/)
4101 +                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
4102 +                additional_includedir="$basedir/include"
4103 +                ;;
4104 +            esac
4105 +            if test "X$additional_includedir" != "X"; then
4106 +              dnl Potentially add $additional_includedir to $INCNAME.
4107 +              dnl But don't add it
4108 +              dnl   1. if it's the standard /usr/include,
4109 +              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
4110 +              dnl   3. if it's already present in $CPPFLAGS or the already
4111 +              dnl      constructed $INCNAME,
4112 +              dnl   4. if it doesn't exist as a directory.
4113 +              if test "X$additional_includedir" != "X/usr/include"; then
4114 +                haveit=
4115 +                if test "X$additional_includedir" = "X/usr/local/include"; then
4116 +                  if test -n "$GCC"; then
4117 +                    case $host_os in
4118 +                      linux*) haveit=yes;;
4119 +                    esac
4120 +                  fi
4121 +                fi
4122 +                if test -z "$haveit"; then
4123 +                  for x in $CPPFLAGS $INC[]NAME; do
4124 +                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4125 +                    if test "X$x" = "X-I$additional_includedir"; then
4126 +                      haveit=yes
4127 +                      break
4128 +                    fi
4129 +                  done
4130 +                  if test -z "$haveit"; then
4131 +                    if test -d "$additional_includedir"; then
4132 +                      dnl Really add $additional_includedir to $INCNAME.
4133 +                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
4134 +                    fi
4135 +                  fi
4136 +                fi
4137 +              fi
4138 +            fi
4139 +            dnl Look for dependencies.
4140 +            if test -n "$found_la"; then
4141 +              dnl Read the .la file. It defines the variables
4142 +              dnl dlname, library_names, old_library, dependency_libs, current,
4143 +              dnl age, revision, installed, dlopen, dlpreopen, libdir.
4144 +              save_libdir="$libdir"
4145 +              case "$found_la" in
4146 +                */* | *\\*) . "$found_la" ;;
4147 +                *) . "./$found_la" ;;
4148 +              esac
4149 +              libdir="$save_libdir"
4150 +              dnl We use only dependency_libs.
4151 +              for dep in $dependency_libs; do
4152 +                case "$dep" in
4153 +                  -L*)
4154 +                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
4155 +                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
4156 +                    dnl But don't add it
4157 +                    dnl   1. if it's the standard /usr/lib,
4158 +                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
4159 +                    dnl   3. if it's already present in $LDFLAGS or the already
4160 +                    dnl      constructed $LIBNAME,
4161 +                    dnl   4. if it doesn't exist as a directory.
4162 +                    if test "X$additional_libdir" != "X/usr/lib"; then
4163 +                      haveit=
4164 +                      if test "X$additional_libdir" = "X/usr/local/lib"; then
4165 +                        if test -n "$GCC"; then
4166 +                          case $host_os in
4167 +                            linux*) haveit=yes;;
4168 +                          esac
4169 +                        fi
4170 +                      fi
4171 +                      if test -z "$haveit"; then
4172 +                        haveit=
4173 +                        for x in $LDFLAGS $LIB[]NAME; do
4174 +                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4175 +                          if test "X$x" = "X-L$additional_libdir"; then
4176 +                            haveit=yes
4177 +                            break
4178 +                          fi
4179 +                        done
4180 +                        if test -z "$haveit"; then
4181 +                          if test -d "$additional_libdir"; then
4182 +                            dnl Really add $additional_libdir to $LIBNAME.
4183 +                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
4184 +                          fi
4185 +                        fi
4186 +                        haveit=
4187 +                        for x in $LDFLAGS $LTLIB[]NAME; do
4188 +                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4189 +                          if test "X$x" = "X-L$additional_libdir"; then
4190 +                            haveit=yes
4191 +                            break
4192 +                          fi
4193 +                        done
4194 +                        if test -z "$haveit"; then
4195 +                          if test -d "$additional_libdir"; then
4196 +                            dnl Really add $additional_libdir to $LTLIBNAME.
4197 +                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
4198 +                          fi
4199 +                        fi
4200 +                      fi
4201 +                    fi
4202 +                    ;;
4203 +                  -R*)
4204 +                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
4205 +                    if test "$enable_rpath" != no; then
4206 +                      dnl Potentially add DIR to rpathdirs.
4207 +                      dnl The rpathdirs will be appended to $LIBNAME at the end.
4208 +                      haveit=
4209 +                      for x in $rpathdirs; do
4210 +                        if test "X$x" = "X$dir"; then
4211 +                          haveit=yes
4212 +                          break
4213 +                        fi
4214 +                      done
4215 +                      if test -z "$haveit"; then
4216 +                        rpathdirs="$rpathdirs $dir"
4217 +                      fi
4218 +                      dnl Potentially add DIR to ltrpathdirs.
4219 +                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4220 +                      haveit=
4221 +                      for x in $ltrpathdirs; do
4222 +                        if test "X$x" = "X$dir"; then
4223 +                          haveit=yes
4224 +                          break
4225 +                        fi
4226 +                      done
4227 +                      if test -z "$haveit"; then
4228 +                        ltrpathdirs="$ltrpathdirs $dir"
4229 +                      fi
4230 +                    fi
4231 +                    ;;
4232 +                  -l*)
4233 +                    dnl Handle this in the next round.
4234 +                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
4235 +                    ;;
4236 +                  *.la)
4237 +                    dnl Handle this in the next round. Throw away the .la's
4238 +                    dnl directory; it is already contained in a preceding -L
4239 +                    dnl option.
4240 +                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
4241 +                    ;;
4242 +                  *)
4243 +                    dnl Most likely an immediate library name.
4244 +                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
4245 +                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
4246 +                    ;;
4247 +                esac
4248 +              done
4249 +            fi
4250 +          else
4251 +            dnl Didn't find the library; assume it is in the system directories
4252 +            dnl known to the linker and runtime loader. (All the system
4253 +            dnl directories known to the linker should also be known to the
4254 +            dnl runtime loader, otherwise the system is severely misconfigured.)
4255 +            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4256 +            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
4257 +          fi
4258 +        fi
4259 +      fi
4260 +    done
4261 +  done
4262 +  if test "X$rpathdirs" != "X"; then
4263 +    if test -n "$hardcode_libdir_separator"; then
4264 +      dnl Weird platform: only the last -rpath option counts, the user must
4265 +      dnl pass all path elements in one option. We can arrange that for a
4266 +      dnl single library, but not when more than one $LIBNAMEs are used.
4267 +      alldirs=
4268 +      for found_dir in $rpathdirs; do
4269 +        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
4270 +      done
4271 +      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
4272 +      acl_save_libdir="$libdir"
4273 +      libdir="$alldirs"
4274 +      eval flag=\"$hardcode_libdir_flag_spec\"
4275 +      libdir="$acl_save_libdir"
4276 +      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4277 +    else
4278 +      dnl The -rpath options are cumulative.
4279 +      for found_dir in $rpathdirs; do
4280 +        acl_save_libdir="$libdir"
4281 +        libdir="$found_dir"
4282 +        eval flag=\"$hardcode_libdir_flag_spec\"
4283 +        libdir="$acl_save_libdir"
4284 +        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4285 +      done
4286 +    fi
4287 +  fi
4288 +  if test "X$ltrpathdirs" != "X"; then
4289 +    dnl When using libtool, the option that works for both libraries and
4290 +    dnl executables is -R. The -R options are cumulative.
4291 +    for found_dir in $ltrpathdirs; do
4292 +      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
4293 +    done
4294 +  fi
4295 +])
4296 +
4297 +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
4298 +dnl unless already present in VAR.
4299 +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
4300 +dnl contains two or three consecutive elements that belong together.
4301 +AC_DEFUN([AC_LIB_APPENDTOVAR],
4302 +[
4303 +  for element in [$2]; do
4304 +    haveit=
4305 +    for x in $[$1]; do
4306 +      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4307 +      if test "X$x" = "X$element"; then
4308 +        haveit=yes
4309 +        break
4310 +      fi
4311 +    done
4312 +    if test -z "$haveit"; then
4313 +      [$1]="${[$1]}${[$1]:+ }$element"
4314 +    fi
4315 +  done
4316 +])
4317 +
4318 +# lib-ld.m4 serial 1 (gettext-0.11)
4319 +dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
4320 +dnl This file is free software, distributed under the terms of the GNU
4321 +dnl General Public License.  As a special exception to the GNU General
4322 +dnl Public License, this file may be distributed as part of a program
4323 +dnl that contains a configuration script generated by Autoconf, under
4324 +dnl the same distribution terms as the rest of that program.
4325 +
4326 +dnl Subroutines of libtool.m4,
4327 +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
4328 +dnl with libtool.m4.
4329 +
4330 +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
4331 +AC_DEFUN([AC_LIB_PROG_LD_GNU],
4332 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
4333 +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4334 +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4335 +  acl_cv_prog_gnu_ld=yes
4336 +else
4337 +  acl_cv_prog_gnu_ld=no
4338 +fi])
4339 +with_gnu_ld=$acl_cv_prog_gnu_ld
4340 +])
4341 +
4342 +dnl From libtool-1.4. Sets the variable LD.
4343 +AC_DEFUN([AC_LIB_PROG_LD],
4344 +[AC_ARG_WITH(gnu-ld,
4345 +[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
4346 +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4347 +AC_REQUIRE([AC_PROG_CC])dnl
4348 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
4349 +ac_prog=ld
4350 +if test "$GCC" = yes; then
4351 +  # Check if gcc -print-prog-name=ld gives a path.
4352 +  AC_MSG_CHECKING([for ld used by GCC])
4353 +  case $host in
4354 +  *-*-mingw*)
4355 +    # gcc leaves a trailing carriage return which upsets mingw
4356 +    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4357 +  *)
4358 +    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4359 +  esac
4360 +  case $ac_prog in
4361 +    # Accept absolute paths.
4362 +    [[\\/]* | [A-Za-z]:[\\/]*)]
4363 +      [re_direlt='/[^/][^/]*/\.\./']
4364 +      # Canonicalize the path of ld
4365 +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4366 +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4367 +       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4368 +      done
4369 +      test -z "$LD" && LD="$ac_prog"
4370 +      ;;
4371 +  "")
4372 +    # If it fails, then pretend we aren't using GCC.
4373 +    ac_prog=ld
4374 +    ;;
4375 +  *)
4376 +    # If it is relative, then search for the first ld in PATH.
4377 +    with_gnu_ld=unknown
4378 +    ;;
4379 +  esac
4380 +elif test "$with_gnu_ld" = yes; then
4381 +  AC_MSG_CHECKING([for GNU ld])
4382 +else
4383 +  AC_MSG_CHECKING([for non-GNU ld])
4384 +fi
4385 +AC_CACHE_VAL(acl_cv_path_LD,
4386 +[if test -z "$LD"; then
4387 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4388 +  for ac_dir in $PATH; do
4389 +    test -z "$ac_dir" && ac_dir=.
4390 +    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4391 +      acl_cv_path_LD="$ac_dir/$ac_prog"
4392 +      # Check to see if the program is GNU ld.  I'd rather use --version,
4393 +      # but apparently some GNU ld's only accept -v.
4394 +      # Break only if it was the GNU/non-GNU ld that we prefer.
4395 +      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4396 +       test "$with_gnu_ld" != no && break
4397 +      else
4398 +       test "$with_gnu_ld" != yes && break
4399 +      fi
4400 +    fi
4401 +  done
4402 +  IFS="$ac_save_ifs"
4403 +else
4404 +  acl_cv_path_LD="$LD" # Let the user override the test with a path.
4405 +fi])
4406 +LD="$acl_cv_path_LD"
4407 +if test -n "$LD"; then
4408 +  AC_MSG_RESULT($LD)
4409 +else
4410 +  AC_MSG_RESULT(no)
4411 +fi
4412 +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4413 +AC_LIB_PROG_LD_GNU
4414 +])
4415 +
4416 +# iconv.m4 serial AM4 (gettext-0.11.3)
4417 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4418 +dnl This file is free software, distributed under the terms of the GNU
4419 +dnl General Public License.  As a special exception to the GNU General
4420 +dnl Public License, this file may be distributed as part of a program
4421 +dnl that contains a configuration script generated by Autoconf, under
4422 +dnl the same distribution terms as the rest of that program.
4423 +
4424 +dnl From Bruno Haible.
4425 +
4426 +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
4427 +[
4428 +  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4429 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4430 +  AC_REQUIRE([AC_LIB_RPATH])
4431 +
4432 +  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4433 +  dnl accordingly.
4434 +  AC_LIB_LINKFLAGS_BODY([iconv])
4435 +])
4436 +
4437 +AC_DEFUN([AM_ICONV_LINK],
4438 +[
4439 +  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
4440 +  dnl those with the standalone portable GNU libiconv installed).
4441 +
4442 +  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4443 +  dnl accordingly.
4444 +  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
4445 +
4446 +  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
4447 +  dnl because if the user has installed libiconv and not disabled its use
4448 +  dnl via --without-libiconv-prefix, he wants to use it. The first
4449 +  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
4450 +  am_save_CPPFLAGS="$CPPFLAGS"
4451 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
4452 +
4453 +  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
4454 +    am_cv_func_iconv="no, consider installing GNU libiconv"
4455 +    am_cv_lib_iconv=no
4456 +    AC_TRY_LINK([#include <stdlib.h>
4457 +#include <iconv.h>],
4458 +      [iconv_t cd = iconv_open("","");
4459 +       iconv(cd,NULL,NULL,NULL,NULL);
4460 +       iconv_close(cd);],
4461 +      am_cv_func_iconv=yes)
4462 +    if test "$am_cv_func_iconv" != yes; then
4463 +      am_save_LIBS="$LIBS"
4464 +      LIBS="$LIBS $LIBICONV"
4465 +      AC_TRY_LINK([#include <stdlib.h>
4466 +#include <iconv.h>],
4467 +        [iconv_t cd = iconv_open("","");
4468 +         iconv(cd,NULL,NULL,NULL,NULL);
4469 +         iconv_close(cd);],
4470 +        am_cv_lib_iconv=yes
4471 +        am_cv_func_iconv=yes)
4472 +      LIBS="$am_save_LIBS"
4473 +    fi
4474 +  ])
4475 +  if test "$am_cv_func_iconv" = yes; then
4476 +    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
4477 +  fi
4478 +  if test "$am_cv_lib_iconv" = yes; then
4479 +    AC_MSG_CHECKING([how to link with libiconv])
4480 +    AC_MSG_RESULT([$LIBICONV])
4481 +  else
4482 +    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
4483 +    dnl either.
4484 +    CPPFLAGS="$am_save_CPPFLAGS"
4485 +    LIBICONV=
4486 +    LTLIBICONV=
4487 +  fi
4488 +  AC_SUBST(LIBICONV)
4489 +  AC_SUBST(LTLIBICONV)
4490 +])
4491 +
4492 +AC_DEFUN([AM_ICONV],
4493 +[
4494 +  AM_ICONV_LINK
4495 +  if test "$am_cv_func_iconv" = yes; then
4496 +    AC_MSG_CHECKING([for iconv declaration])
4497 +    AC_CACHE_VAL(am_cv_proto_iconv, [
4498 +      AC_TRY_COMPILE([
4499 +#include <stdlib.h>
4500 +#include <iconv.h>
4501 +extern
4502 +#ifdef __cplusplus
4503 +"C"
4504 +#endif
4505 +#if defined(__STDC__) || defined(__cplusplus)
4506 +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4507 +#else
4508 +size_t iconv();
4509 +#endif
4510 +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
4511 +      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);"])
4512 +    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4513 +    AC_MSG_RESULT([$]{ac_t:-
4514 +         }[$]am_cv_proto_iconv)
4515 +    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
4516 +      [Define as const if the declaration of iconv() needs const.])
4517 +  fi
4518 +])
4519 +
4520 +# progtest.m4 serial 2 (gettext-0.10.40)
4521 +dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
4522 +dnl This file is free software, distributed under the terms of the GNU
4523 +dnl General Public License.  As a special exception to the GNU General
4524 +dnl Public License, this file may be distributed as part of a program
4525 +dnl that contains a configuration script generated by Autoconf, under
4526 +dnl the same distribution terms as the rest of that program.
4527 +dnl
4528 +dnl This file can can be used in projects which are not available under
4529 +dnl the GNU General Public License or the GNU Library General Public
4530 +dnl License but which still want to provide support for the GNU gettext
4531 +dnl functionality.
4532 +dnl Please note that the actual code of the GNU gettext library is covered
4533 +dnl by the GNU Library General Public License, and the rest of the GNU
4534 +dnl gettext package package is covered by the GNU General Public License.
4535 +dnl They are *not* in the public domain.
4536  
4537 -AC_SUBST(LIB_CREATE)
4538 -AC_SUBST(LIB_OBJECT)
4539 -AC_SUBST(LIB_SUFFIX)
4540 -AC_SUBST(LIB_PREP)
4541 +dnl Authors:
4542 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
4543  
4544 -AC_SUBST(LIB_CLEAN)
4545 -AC_SUBST(LIB_COMPILE)
4546 -AC_SUBST(LIB_LINK)
4547 -AC_SUBST(LIB_INSTALL)
4548 -AC_SUBST(LIB_UNINSTALL)
4549 +# Search path for a program which passes the given test.
4550  
4551 +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
4552 +dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
4553 +AC_DEFUN([AM_PATH_PROG_WITH_TEST],
4554 +[# Extract the first word of "$2", so it can be a program name with args.
4555 +set dummy $2; ac_word=[$]2
4556 +AC_MSG_CHECKING([for $ac_word])
4557 +AC_CACHE_VAL(ac_cv_path_$1,
4558 +[case "[$]$1" in
4559 +  /*)
4560 +  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
4561 +  ;;
4562 +  *)
4563 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4564 +  for ac_dir in ifelse([$5], , $PATH, [$5]); do
4565 +    test -z "$ac_dir" && ac_dir=.
4566 +    if test -f $ac_dir/$ac_word; then
4567 +      if [$3]; then
4568 +       ac_cv_path_$1="$ac_dir/$ac_word"
4569 +       break
4570 +      fi
4571 +    fi
4572 +  done
4573 +  IFS="$ac_save_ifs"
4574 +dnl If no 4th arg is given, leave the cache variable unset,
4575 +dnl so AC_PATH_PROGS will keep looking.
4576 +ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
4577  ])dnl
4578 -dnl ---------------------------------------------------------------------------
4579 -dnl CF_XOPEN_CURSES version: 8 updated: 2003/11/07 19:47:46
4580 -dnl ---------------
4581 -dnl Test if we should define X/Open source for curses, needed on Digital Unix
4582 -dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
4583 -dnl
4584 -dnl The getbegyx() check is needed for HPUX, which omits legacy macros such
4585 -dnl as getbegy().  The latter is better design, but the former is standard.
4586 -AC_DEFUN([CF_XOPEN_CURSES],
4587 -[
4588 -AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
4589 -AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[
4590 -AC_TRY_LINK([
4591 -#include <stdlib.h>
4592 -#include <${cf_cv_ncurses_header-curses.h}>],[
4593 -       long x = winnstr(stdscr, "", 0);
4594 -       int x1, y1;
4595 -       getbegyx(stdscr, y1, x1)],
4596 -       [cf_cv_need_xopen_extension=no],
4597 -       [AC_TRY_LINK([
4598 -#define _XOPEN_SOURCE_EXTENDED
4599 -#include <stdlib.h>
4600 -#include <${cf_cv_ncurses_header-curses.h}>],[
4601 -       long x = winnstr(stdscr, "", 0);
4602 -       int x1, y1;
4603 -       getbegyx(stdscr, y1, x1)],
4604 -       [cf_cv_need_xopen_extension=yes],
4605 -       [cf_cv_need_xopen_extension=unknown])])])
4606 -test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
4607 -])dnl
4608 -dnl ---------------------------------------------------------------------------
4609 -dnl CF_XOPEN_SOURCE version: 17 updated: 2005/02/06 12:07:45
4610 -dnl ---------------
4611 -dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
4612 -dnl or adapt to the vendor's definitions to get equivalent functionality.
4613 -dnl
4614 -dnl Parameters:
4615 -dnl    $1 is the nominal value for _XOPEN_SOURCE
4616 -dnl    $2 is the nominal value for _POSIX_C_SOURCE
4617 -AC_DEFUN([CF_XOPEN_SOURCE],[
4618 +  ;;
4619 +esac])dnl
4620 +$1="$ac_cv_path_$1"
4621 +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
4622 +  AC_MSG_RESULT([$]$1)
4623 +else
4624 +  AC_MSG_RESULT(no)
4625 +fi
4626 +AC_SUBST($1)dnl
4627 +])
4628  
4629 -cf_XOPEN_SOURCE=ifelse($1,,500,$1)
4630 -cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)
4631 +# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
4632 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4633 +dnl This file is free software, distributed under the terms of the GNU
4634 +dnl General Public License.  As a special exception to the GNU General
4635 +dnl Public License, this file may be distributed as part of a program
4636 +dnl that contains a configuration script generated by Autoconf, under
4637 +dnl the same distribution terms as the rest of that program.
4638 +
4639 +# Test for the GNU C Library, version 2.1 or newer.
4640 +# From Bruno Haible.
4641  
4642 -case $host_os in #(vi
4643 -aix[[45]]*) #(vi
4644 -       CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
4645 -       ;;
4646 -freebsd*) #(vi
4647 -       # 5.x headers associate
4648 -       #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
4649 -       #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
4650 -       cf_POSIX_C_SOURCE=200112L
4651 -       cf_XOPEN_SOURCE=600
4652 -       CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4653 -       ;;
4654 -hpux*) #(vi
4655 -       CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
4656 -       ;;
4657 -irix[[56]].*) #(vi
4658 -       CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
4659 -       ;;
4660 -linux*|gnu*) #(vi
4661 -       CF_GNU_SOURCE
4662 -       ;;
4663 -mirbsd*) #(vi
4664 -       # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
4665 -       ;;
4666 -netbsd*) #(vi
4667 -       # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4668 -       ;;
4669 -openbsd*) #(vi
4670 -       # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4671 -       ;;
4672 -osf[[45]]*) #(vi
4673 -       CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
4674 -       ;;
4675 -sco*) #(vi
4676 -       # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4677 -       ;;
4678 -solaris*) #(vi
4679 -       CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
4680 -       ;;
4681 -*)
4682 -       AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
4683 -       AC_TRY_COMPILE([#include <sys/types.h>],[
4684 -#ifndef _XOPEN_SOURCE
4685 -make an error
4686 -#endif],
4687 -       [cf_cv_xopen_source=no],
4688 -       [cf_save="$CPPFLAGS"
4689 -        CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4690 -        AC_TRY_COMPILE([#include <sys/types.h>],[
4691 -#ifdef _XOPEN_SOURCE
4692 -make an error
4693 -#endif],
4694 -       [cf_cv_xopen_source=no],
4695 -       [cf_cv_xopen_source=$cf_XOPEN_SOURCE])
4696 -       CPPFLAGS="$cf_save"
4697 -       ])
4698 -])
4699 -test "$cf_cv_xopen_source" != no && CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE -D_XOPEN_SOURCE=$cf_cv_xopen_source"
4700 -       CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
4701 -       ;;
4702 -esac
4703 -])
4704 -dnl ---------------------------------------------------------------------------
4705 -dnl jm_GLIBC21 version: 3 updated: 2002/10/27 23:21:42
4706 -dnl ----------
4707 -dnl Inserted as requested by gettext 0.10.40
4708 -dnl File from /usr/share/aclocal
4709 -dnl glibc21.m4
4710 -dnl ====================
4711 -dnl serial 2
4712 -dnl
4713 -dnl Test for the GNU C Library, version 2.1 or newer.
4714 -dnl From Bruno Haible.
4715  AC_DEFUN([jm_GLIBC21],
4716    [
4717      AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
4718 @@ -2781,3 +3777,307 @@
4719      GLIBC21="$ac_cv_gnu_library_2_1"
4720    ]
4721  )
4722 +
4723 +# intdiv0.m4 serial 1 (gettext-0.11.3)
4724 +dnl Copyright (C) 2002 Free Software Foundation, Inc.
4725 +dnl This file is free software, distributed under the terms of the GNU
4726 +dnl General Public License.  As a special exception to the GNU General
4727 +dnl Public License, this file may be distributed as part of a program
4728 +dnl that contains a configuration script generated by Autoconf, under
4729 +dnl the same distribution terms as the rest of that program.
4730 +
4731 +dnl From Bruno Haible.
4732 +
4733 +AC_DEFUN([gt_INTDIV0],
4734 +[
4735 +  AC_REQUIRE([AC_PROG_CC])dnl
4736 +  AC_REQUIRE([AC_CANONICAL_HOST])dnl
4737 +
4738 +  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
4739 +    gt_cv_int_divbyzero_sigfpe,
4740 +    [
4741 +      AC_TRY_RUN([
4742 +#include <stdlib.h>
4743 +#include <signal.h>
4744 +
4745 +static void
4746 +#ifdef __cplusplus
4747 +sigfpe_handler (int sig)
4748 +#else
4749 +sigfpe_handler (sig) int sig;
4750 +#endif
4751 +{
4752 +  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
4753 +  exit (sig != SIGFPE);
4754 +}
4755 +
4756 +int x = 1;
4757 +int y = 0;
4758 +int z;
4759 +int nan;
4760 +
4761 +int main ()
4762 +{
4763 +  signal (SIGFPE, sigfpe_handler);
4764 +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
4765 +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
4766 +  signal (SIGTRAP, sigfpe_handler);
4767 +#endif
4768 +/* Linux/SPARC yields signal SIGILL.  */
4769 +#if defined (__sparc__) && defined (__linux__)
4770 +  signal (SIGILL, sigfpe_handler);
4771 +#endif
4772 +
4773 +  z = x / y;
4774 +  nan = y / y;
4775 +  exit (1);
4776 +}
4777 +], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
4778 +        [
4779 +          # Guess based on the CPU.
4780 +          case "$host_cpu" in
4781 +            alpha* | i[34567]86 | m68k | s390*)
4782 +              gt_cv_int_divbyzero_sigfpe="guessing yes";;
4783 +            *)
4784 +              gt_cv_int_divbyzero_sigfpe="guessing no";;
4785 +          esac
4786 +        ])
4787 +    ])
4788 +  case "$gt_cv_int_divbyzero_sigfpe" in
4789 +    *yes) value=1;;
4790 +    *) value=0;;
4791 +  esac
4792 +  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
4793 +    [Define if integer division by zero raises signal SIGFPE.])
4794 +])
4795 +
4796 +# uintmax_t.m4 serial 6 (gettext-0.11)
4797 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
4798 +dnl This file is free software, distributed under the terms of the GNU
4799 +dnl General Public License.  As a special exception to the GNU General
4800 +dnl Public License, this file may be distributed as part of a program
4801 +dnl that contains a configuration script generated by Autoconf, under
4802 +dnl the same distribution terms as the rest of that program.
4803 +
4804 +dnl From Paul Eggert.
4805 +
4806 +AC_PREREQ(2.13)
4807 +
4808 +# Define uintmax_t to `unsigned long' or `unsigned long long'
4809 +# if <inttypes.h> does not exist.
4810 +
4811 +AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
4812 +[
4813 +  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
4814 +  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
4815 +  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
4816 +    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
4817 +    test $ac_cv_type_unsigned_long_long = yes \
4818 +      && ac_type='unsigned long long' \
4819 +      || ac_type='unsigned long'
4820 +    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
4821 +  [Define to unsigned long or unsigned long long
4822 +   if <inttypes.h> and <stdint.h> don't define.])
4823 +  fi
4824 +])
4825 +
4826 +# inttypes_h.m4 serial 4 (gettext-0.11.4)
4827 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
4828 +dnl This file is free software, distributed under the terms of the GNU
4829 +dnl General Public License.  As a special exception to the GNU General
4830 +dnl Public License, this file may be distributed as part of a program
4831 +dnl that contains a configuration script generated by Autoconf, under
4832 +dnl the same distribution terms as the rest of that program.
4833 +
4834 +dnl From Paul Eggert.
4835 +
4836 +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
4837 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
4838 +
4839 +AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
4840 +[
4841 +  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
4842 +  [AC_TRY_COMPILE(
4843 +    [#include <sys/types.h>
4844 +#include <inttypes.h>],
4845 +    [uintmax_t i = (uintmax_t) -1;],
4846 +    jm_ac_cv_header_inttypes_h=yes,
4847 +    jm_ac_cv_header_inttypes_h=no)])
4848 +  if test $jm_ac_cv_header_inttypes_h = yes; then
4849 +    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
4850 +[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
4851 +   and declares uintmax_t. ])
4852 +  fi
4853 +])
4854 +
4855 +# stdint_h.m4 serial 2 (gettext-0.11.4)
4856 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
4857 +dnl This file is free software, distributed under the terms of the GNU
4858 +dnl General Public License.  As a special exception to the GNU General
4859 +dnl Public License, this file may be distributed as part of a program
4860 +dnl that contains a configuration script generated by Autoconf, under
4861 +dnl the same distribution terms as the rest of that program.
4862 +
4863 +dnl From Paul Eggert.
4864 +
4865 +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
4866 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
4867 +
4868 +AC_DEFUN([jm_AC_HEADER_STDINT_H],
4869 +[
4870 +  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
4871 +  [AC_TRY_COMPILE(
4872 +    [#include <sys/types.h>
4873 +#include <stdint.h>],
4874 +    [uintmax_t i = (uintmax_t) -1;],
4875 +    jm_ac_cv_header_stdint_h=yes,
4876 +    jm_ac_cv_header_stdint_h=no)])
4877 +  if test $jm_ac_cv_header_stdint_h = yes; then
4878 +    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
4879 +[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
4880 +   and declares uintmax_t. ])
4881 +  fi
4882 +])
4883 +
4884 +# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
4885 +dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
4886 +dnl This file is free software, distributed under the terms of the GNU
4887 +dnl General Public License.  As a special exception to the GNU General
4888 +dnl Public License, this file may be distributed as part of a program
4889 +dnl that contains a configuration script generated by Autoconf, under
4890 +dnl the same distribution terms as the rest of that program.
4891 +
4892 +dnl From Paul Eggert.
4893 +
4894 +AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
4895 +[
4896 +  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
4897 +  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
4898 +    [unsigned long long ullmax = (unsigned long long) -1;
4899 +     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
4900 +    ac_cv_type_unsigned_long_long=yes,
4901 +    ac_cv_type_unsigned_long_long=no)])
4902 +  if test $ac_cv_type_unsigned_long_long = yes; then
4903 +    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
4904 +      [Define if you have the unsigned long long type.])
4905 +  fi
4906 +])
4907 +
4908 +# inttypes.m4 serial 1 (gettext-0.11.4)
4909 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
4910 +dnl This file is free software, distributed under the terms of the GNU
4911 +dnl General Public License.  As a special exception to the GNU General
4912 +dnl Public License, this file may be distributed as part of a program
4913 +dnl that contains a configuration script generated by Autoconf, under
4914 +dnl the same distribution terms as the rest of that program.
4915 +
4916 +dnl From Paul Eggert.
4917 +
4918 +# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
4919 +# <sys/types.h>.
4920 +
4921 +AC_DEFUN([gt_HEADER_INTTYPES_H],
4922 +[
4923 +  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
4924 +  [
4925 +    AC_TRY_COMPILE(
4926 +      [#include <sys/types.h>
4927 +#include <inttypes.h>],
4928 +      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
4929 +  ])
4930 +  if test $gt_cv_header_inttypes_h = yes; then
4931 +    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
4932 +      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
4933 +  fi
4934 +])
4935 +
4936 +# inttypes-pri.m4 serial 1 (gettext-0.11.4)
4937 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
4938 +dnl This file is free software, distributed under the terms of the GNU
4939 +dnl General Public License.  As a special exception to the GNU General
4940 +dnl Public License, this file may be distributed as part of a program
4941 +dnl that contains a configuration script generated by Autoconf, under
4942 +dnl the same distribution terms as the rest of that program.
4943 +
4944 +dnl From Bruno Haible.
4945 +
4946 +# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
4947 +# macros to non-string values.  This is the case on AIX 4.3.3.
4948 +
4949 +AC_DEFUN([gt_INTTYPES_PRI],
4950 +[
4951 +  AC_REQUIRE([gt_HEADER_INTTYPES_H])
4952 +  if test $gt_cv_header_inttypes_h = yes; then
4953 +    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
4954 +      gt_cv_inttypes_pri_broken,
4955 +      [
4956 +        AC_TRY_COMPILE([#include <inttypes.h>
4957 +#ifdef PRId32
4958 +char *p = PRId32;
4959 +#endif
4960 +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
4961 +      ])
4962 +  fi
4963 +  if test "$gt_cv_inttypes_pri_broken" = yes; then
4964 +    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
4965 +      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
4966 +  fi
4967 +])
4968 +
4969 +# codeset.m4 serial AM1 (gettext-0.10.40)
4970 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4971 +dnl This file is free software, distributed under the terms of the GNU
4972 +dnl General Public License.  As a special exception to the GNU General
4973 +dnl Public License, this file may be distributed as part of a program
4974 +dnl that contains a configuration script generated by Autoconf, under
4975 +dnl the same distribution terms as the rest of that program.
4976 +
4977 +dnl From Bruno Haible.
4978 +
4979 +AC_DEFUN([AM_LANGINFO_CODESET],
4980 +[
4981 +  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
4982 +    [AC_TRY_LINK([#include <langinfo.h>],
4983 +      [char* cs = nl_langinfo(CODESET);],
4984 +      am_cv_langinfo_codeset=yes,
4985 +      am_cv_langinfo_codeset=no)
4986 +    ])
4987 +  if test $am_cv_langinfo_codeset = yes; then
4988 +    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
4989 +      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
4990 +  fi
4991 +])
4992 +
4993 +# lcmessage.m4 serial 3 (gettext-0.11.3)
4994 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
4995 +dnl This file is free software, distributed under the terms of the GNU
4996 +dnl General Public License.  As a special exception to the GNU General
4997 +dnl Public License, this file may be distributed as part of a program
4998 +dnl that contains a configuration script generated by Autoconf, under
4999 +dnl the same distribution terms as the rest of that program.
5000 +dnl
5001 +dnl This file can can be used in projects which are not available under
5002 +dnl the GNU General Public License or the GNU Library General Public
5003 +dnl License but which still want to provide support for the GNU gettext
5004 +dnl functionality.
5005 +dnl Please note that the actual code of the GNU gettext library is covered
5006 +dnl by the GNU Library General Public License, and the rest of the GNU
5007 +dnl gettext package package is covered by the GNU General Public License.
5008 +dnl They are *not* in the public domain.
5009 +
5010 +dnl Authors:
5011 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
5012 +
5013 +# Check whether LC_MESSAGES is available in <locale.h>.
5014 +
5015 +AC_DEFUN([AM_LC_MESSAGES],
5016 +[
5017 +  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
5018 +    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
5019 +       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
5020 +  if test $am_cv_val_LC_MESSAGES = yes; then
5021 +    AC_DEFINE(HAVE_LC_MESSAGES, 1,
5022 +      [Define if your <locale.h> file defines LC_MESSAGES.])
5023 +  fi
5024 +])
5025 +
5026 Index: dialog-1.0-20050306/m4/codeset.m4
5027 ===================================================================
5028 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5029 +++ dialog-1.0-20050306/m4/codeset.m4   2005-05-16 01:32:07.000000000 +0200
5030 @@ -0,0 +1,23 @@
5031 +# codeset.m4 serial AM1 (gettext-0.10.40)
5032 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5033 +dnl This file is free software, distributed under the terms of the GNU
5034 +dnl General Public License.  As a special exception to the GNU General
5035 +dnl Public License, this file may be distributed as part of a program
5036 +dnl that contains a configuration script generated by Autoconf, under
5037 +dnl the same distribution terms as the rest of that program.
5038 +
5039 +dnl From Bruno Haible.
5040 +
5041 +AC_DEFUN([AM_LANGINFO_CODESET],
5042 +[
5043 +  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
5044 +    [AC_TRY_LINK([#include <langinfo.h>],
5045 +      [char* cs = nl_langinfo(CODESET);],
5046 +      am_cv_langinfo_codeset=yes,
5047 +      am_cv_langinfo_codeset=no)
5048 +    ])
5049 +  if test $am_cv_langinfo_codeset = yes; then
5050 +    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
5051 +      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
5052 +  fi
5053 +])
5054 Index: dialog-1.0-20050306/m4/gettext.m4
5055 ===================================================================
5056 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5057 +++ dialog-1.0-20050306/m4/gettext.m4   2005-05-16 01:32:07.000000000 +0200
5058 @@ -0,0 +1,587 @@
5059 +# gettext.m4 serial 17 (gettext-0.11.5)
5060 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5061 +dnl This file is free software, distributed under the terms of the GNU
5062 +dnl General Public License.  As a special exception to the GNU General
5063 +dnl Public License, this file may be distributed as part of a program
5064 +dnl that contains a configuration script generated by Autoconf, under
5065 +dnl the same distribution terms as the rest of that program.
5066 +dnl
5067 +dnl This file can can be used in projects which are not available under
5068 +dnl the GNU General Public License or the GNU Library General Public
5069 +dnl License but which still want to provide support for the GNU gettext
5070 +dnl functionality.
5071 +dnl Please note that the actual code of the GNU gettext library is covered
5072 +dnl by the GNU Library General Public License, and the rest of the GNU
5073 +dnl gettext package package is covered by the GNU General Public License.
5074 +dnl They are *not* in the public domain.
5075 +
5076 +dnl Authors:
5077 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
5078 +dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
5079 +
5080 +dnl Macro to add for using GNU gettext.
5081 +
5082 +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
5083 +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
5084 +dnl    default (if it is not specified or empty) is 'no-libtool'.
5085 +dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
5086 +dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
5087 +dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
5088 +dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
5089 +dnl    depending on --{enable,disable}-{shared,static} and on the presence of
5090 +dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
5091 +dnl    $(top_builddir)/intl/libintl.a will be created.
5092 +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
5093 +dnl    implementations (in libc or libintl) without the ngettext() function
5094 +dnl    will be ignored.  If NEEDSYMBOL is specified and is
5095 +dnl    'need-formatstring-macros', then GNU gettext implementations that don't
5096 +dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
5097 +dnl INTLDIR is used to find the intl libraries.  If empty,
5098 +dnl    the value `$(top_builddir)/intl/' is used.
5099 +dnl
5100 +dnl The result of the configuration is one of three cases:
5101 +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
5102 +dnl    and used.
5103 +dnl    Catalog format: GNU --> install in $(datadir)
5104 +dnl    Catalog extension: .mo after installation, .gmo in source tree
5105 +dnl 2) GNU gettext has been found in the system's C library.
5106 +dnl    Catalog format: GNU --> install in $(datadir)
5107 +dnl    Catalog extension: .mo after installation, .gmo in source tree
5108 +dnl 3) No internationalization, always use English msgid.
5109 +dnl    Catalog format: none
5110 +dnl    Catalog extension: none
5111 +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
5112 +dnl The use of .gmo is historical (it was needed to avoid overwriting the
5113 +dnl GNU format catalogs when building on a platform with an X/Open gettext),
5114 +dnl but we keep it in order not to force irrelevant filename changes on the
5115 +dnl maintainers.
5116 +dnl
5117 +AC_DEFUN([AM_GNU_GETTEXT],
5118 +[
5119 +  dnl Argument checking.
5120 +  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
5121 +    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
5122 +])])])])])
5123 +  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
5124 +    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
5125 +])])])])
5126 +  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
5127 +  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
5128 +
5129 +  AC_REQUIRE([AM_PO_SUBDIRS])dnl
5130 +  ifelse(gt_included_intl, yes, [
5131 +    AC_REQUIRE([AM_INTL_SUBDIR])dnl
5132 +  ])
5133 +
5134 +  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5135 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5136 +  AC_REQUIRE([AC_LIB_RPATH])
5137 +
5138 +  dnl Sometimes libintl requires libiconv, so first search for libiconv.
5139 +  dnl Ideally we would do this search only after the
5140 +  dnl      if test "$USE_NLS" = "yes"; then
5141 +  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5142 +  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
5143 +  dnl the configure script would need to contain the same shell code
5144 +  dnl again, outside any 'if'. There are two solutions:
5145 +  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
5146 +  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
5147 +  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
5148 +  dnl documented, we avoid it.
5149 +  ifelse(gt_included_intl, yes, , [
5150 +    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5151 +  ])
5152 +
5153 +  AC_MSG_CHECKING([whether NLS is requested])
5154 +  dnl Default is enabled NLS
5155 +  AC_ARG_ENABLE(nls,
5156 +    [  --disable-nls           do not use Native Language Support],
5157 +    USE_NLS=$enableval, USE_NLS=yes)
5158 +  AC_MSG_RESULT($USE_NLS)
5159 +  AC_SUBST(USE_NLS)
5160 +
5161 +  ifelse(gt_included_intl, yes, [
5162 +    BUILD_INCLUDED_LIBINTL=no
5163 +    USE_INCLUDED_LIBINTL=no
5164 +  ])
5165 +  LIBINTL=
5166 +  LTLIBINTL=
5167 +  POSUB=
5168 +
5169 +  dnl If we use NLS figure out what method
5170 +  if test "$USE_NLS" = "yes"; then
5171 +    gt_use_preinstalled_gnugettext=no
5172 +    ifelse(gt_included_intl, yes, [
5173 +      AC_MSG_CHECKING([whether included gettext is requested])
5174 +      AC_ARG_WITH(included-gettext,
5175 +        [  --with-included-gettext use the GNU gettext library included here],
5176 +        nls_cv_force_use_gnu_gettext=$withval,
5177 +        nls_cv_force_use_gnu_gettext=no)
5178 +      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
5179 +
5180 +      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
5181 +      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
5182 +    ])
5183 +        dnl User does not insist on using GNU NLS library.  Figure out what
5184 +        dnl to use.  If GNU gettext is available we use this.  Else we have
5185 +        dnl to fall back to GNU NLS library.
5186 +
5187 +        dnl Add a version number to the cache macros.
5188 +        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
5189 +        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
5190 +        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
5191 +
5192 +        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
5193 +         [AC_TRY_LINK([#include <libintl.h>
5194 +]ifelse([$2], [need-formatstring-macros],
5195 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5196 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5197 +#endif
5198 +changequote(,)dnl
5199 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5200 +changequote([,])dnl
5201 +], [])[extern int _nl_msg_cat_cntr;
5202 +extern int *_nl_domain_bindings;],
5203 +            [bindtextdomain ("", "");
5204 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
5205 +            gt_cv_func_gnugettext_libc=yes,
5206 +            gt_cv_func_gnugettext_libc=no)])
5207 +
5208 +        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5209 +          dnl Sometimes libintl requires libiconv, so first search for libiconv.
5210 +          ifelse(gt_included_intl, yes, , [
5211 +            AM_ICONV_LINK
5212 +          ])
5213 +          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
5214 +          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
5215 +          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
5216 +          dnl even if libiconv doesn't exist.
5217 +          AC_LIB_LINKFLAGS_BODY([intl])
5218 +          AC_CACHE_CHECK([for GNU gettext in libintl],
5219 +            gt_cv_func_gnugettext_libintl,
5220 +           [gt_save_CPPFLAGS="$CPPFLAGS"
5221 +            CPPFLAGS="$CPPFLAGS $INCINTL"
5222 +            gt_save_LIBS="$LIBS"
5223 +            LIBS="$LIBS $LIBINTL"
5224 +            dnl Now see whether libintl exists and does not depend on libiconv.
5225 +            AC_TRY_LINK([#include <libintl.h>
5226 +]ifelse([$2], [need-formatstring-macros],
5227 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5228 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5229 +#endif
5230 +changequote(,)dnl
5231 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5232 +changequote([,])dnl
5233 +], [])[extern int _nl_msg_cat_cntr;
5234 +extern
5235 +#ifdef __cplusplus
5236 +"C"
5237 +#endif
5238 +const char *_nl_expand_alias ();],
5239 +              [bindtextdomain ("", "");
5240 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5241 +              gt_cv_func_gnugettext_libintl=yes,
5242 +              gt_cv_func_gnugettext_libintl=no)
5243 +            dnl Now see whether libintl exists and depends on libiconv.
5244 +            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
5245 +              LIBS="$LIBS $LIBICONV"
5246 +              AC_TRY_LINK([#include <libintl.h>
5247 +]ifelse([$2], [need-formatstring-macros],
5248 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5249 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5250 +#endif
5251 +changequote(,)dnl
5252 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5253 +changequote([,])dnl
5254 +], [])[extern int _nl_msg_cat_cntr;
5255 +extern
5256 +#ifdef __cplusplus
5257 +"C"
5258 +#endif
5259 +const char *_nl_expand_alias ();],
5260 +                [bindtextdomain ("", "");
5261 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5262 +               [LIBINTL="$LIBINTL $LIBICONV"
5263 +                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
5264 +                gt_cv_func_gnugettext_libintl=yes
5265 +               ])
5266 +            fi
5267 +            CPPFLAGS="$gt_save_CPPFLAGS"
5268 +            LIBS="$gt_save_LIBS"])
5269 +        fi
5270 +
5271 +        dnl If an already present or preinstalled GNU gettext() is found,
5272 +        dnl use it.  But if this macro is used in GNU gettext, and GNU
5273 +        dnl gettext is already preinstalled in libintl, we update this
5274 +        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
5275 +        if test "$gt_cv_func_gnugettext_libc" = "yes" \
5276 +           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
5277 +                && test "$PACKAGE" != gettext; }; then
5278 +          gt_use_preinstalled_gnugettext=yes
5279 +        else
5280 +          dnl Reset the values set by searching for libintl.
5281 +          LIBINTL=
5282 +          LTLIBINTL=
5283 +          INCINTL=
5284 +        fi
5285 +
5286 +    ifelse(gt_included_intl, yes, [
5287 +        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
5288 +          dnl GNU gettext is not found in the C library.
5289 +          dnl Fall back on included GNU gettext library.
5290 +          nls_cv_use_gnu_gettext=yes
5291 +        fi
5292 +      fi
5293 +
5294 +      if test "$nls_cv_use_gnu_gettext" = "yes"; then
5295 +        dnl Mark actions used to generate GNU NLS library.
5296 +        INTLOBJS="\$(GETTOBJS)"
5297 +        BUILD_INCLUDED_LIBINTL=yes
5298 +        USE_INCLUDED_LIBINTL=yes
5299 +        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
5300 +        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
5301 +        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
5302 +      fi
5303 +
5304 +      if test "$gt_use_preinstalled_gnugettext" = "yes" \
5305 +         || test "$nls_cv_use_gnu_gettext" = "yes"; then
5306 +        dnl Mark actions to use GNU gettext tools.
5307 +        CATOBJEXT=.gmo
5308 +      fi
5309 +    ])
5310 +
5311 +    if test "$gt_use_preinstalled_gnugettext" = "yes" \
5312 +       || test "$nls_cv_use_gnu_gettext" = "yes"; then
5313 +      AC_DEFINE(ENABLE_NLS, 1,
5314 +        [Define to 1 if translation of program messages to the user's native language
5315 +   is requested.])
5316 +    else
5317 +      USE_NLS=no
5318 +    fi
5319 +  fi
5320 +
5321 +  if test "$USE_NLS" = "yes"; then
5322 +
5323 +    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
5324 +      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
5325 +        AC_MSG_CHECKING([how to link with libintl])
5326 +        AC_MSG_RESULT([$LIBINTL])
5327 +        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
5328 +      fi
5329 +
5330 +      dnl For backward compatibility. Some packages may be using this.
5331 +      AC_DEFINE(HAVE_GETTEXT, 1,
5332 +       [Define if the GNU gettext() function is already present or preinstalled.])
5333 +      AC_DEFINE(HAVE_DCGETTEXT, 1,
5334 +       [Define if the GNU dcgettext() function is already present or preinstalled.])
5335 +    fi
5336 +
5337 +    dnl We need to process the po/ directory.
5338 +    POSUB=po
5339 +  fi
5340 +
5341 +  ifelse(gt_included_intl, yes, [
5342 +    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
5343 +    dnl to 'yes' because some of the testsuite requires it.
5344 +    if test "$PACKAGE" = gettext; then
5345 +      BUILD_INCLUDED_LIBINTL=yes
5346 +    fi
5347 +
5348 +    dnl Make all variables we use known to autoconf.
5349 +    AC_SUBST(BUILD_INCLUDED_LIBINTL)
5350 +    AC_SUBST(USE_INCLUDED_LIBINTL)
5351 +    AC_SUBST(CATOBJEXT)
5352 +    AC_SUBST(INTLOBJS)
5353 +
5354 +    dnl For backward compatibility. Some configure.ins may be using this.
5355 +    nls_cv_header_intl=
5356 +    nls_cv_header_libgt=
5357 +
5358 +    dnl For backward compatibility. Some Makefiles may be using this.
5359 +    DATADIRNAME=share
5360 +    AC_SUBST(DATADIRNAME)
5361 +
5362 +    dnl For backward compatibility. Some Makefiles may be using this.
5363 +    INSTOBJEXT=.mo
5364 +    AC_SUBST(INSTOBJEXT)
5365 +
5366 +    dnl For backward compatibility. Some Makefiles may be using this.
5367 +    GENCAT=gencat
5368 +    AC_SUBST(GENCAT)
5369 +
5370 +    dnl Enable libtool support if the surrounding package wishes it.
5371 +    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
5372 +    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
5373 +  ])
5374 +
5375 +  dnl For backward compatibility. Some Makefiles may be using this.
5376 +  INTLLIBS="$LIBINTL"
5377 +  AC_SUBST(INTLLIBS)
5378 +
5379 +  dnl Make all documented variables known to autoconf.
5380 +  AC_SUBST(LIBINTL)
5381 +  AC_SUBST(LTLIBINTL)
5382 +  AC_SUBST(POSUB)
5383 +])
5384 +
5385 +
5386 +dnl Checks for all prerequisites of the po subdirectory,
5387 +dnl except for USE_NLS.
5388 +AC_DEFUN([AM_PO_SUBDIRS],
5389 +[
5390 +  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
5391 +  AC_REQUIRE([AC_PROG_INSTALL])dnl
5392 +  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5393 +
5394 +  dnl Perform the following tests also if --disable-nls has been given,
5395 +  dnl because they are needed for "make dist" to work.
5396 +
5397 +  dnl Search for GNU msgfmt in the PATH.
5398 +  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
5399 +  dnl The second test excludes FreeBSD msgfmt.
5400 +  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
5401 +    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
5402 +     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5403 +    :)
5404 +  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
5405 +
5406 +  dnl Search for GNU xgettext 0.11 or newer in the PATH.
5407 +  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
5408 +  dnl The second test excludes FreeBSD xgettext.
5409 +  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
5410 +    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5411 +     (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5412 +    :)
5413 +  dnl Remove leftover from FreeBSD xgettext call.
5414 +  rm -f messages.po
5415 +
5416 +  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
5417 +  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
5418 +    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
5419 +
5420 +  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5421 +  dnl Test whether we really found GNU msgfmt.
5422 +  if test "$GMSGFMT" != ":"; then
5423 +    dnl If it is no GNU msgfmt we define it as : so that the
5424 +    dnl Makefiles still can work.
5425 +    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
5426 +       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5427 +      : ;
5428 +    else
5429 +      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
5430 +      AC_MSG_RESULT(
5431 +        [found $GMSGFMT program is not GNU msgfmt; ignore it])
5432 +      GMSGFMT=":"
5433 +    fi
5434 +  fi
5435 +
5436 +  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5437 +  dnl Test whether we really found GNU xgettext.
5438 +  if test "$XGETTEXT" != ":"; then
5439 +    dnl If it is no GNU xgettext we define it as : so that the
5440 +    dnl Makefiles still can work.
5441 +    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5442 +       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5443 +      : ;
5444 +    else
5445 +      AC_MSG_RESULT(
5446 +        [found xgettext program is not GNU xgettext; ignore it])
5447 +      XGETTEXT=":"
5448 +    fi
5449 +    dnl Remove leftover from FreeBSD xgettext call.
5450 +    rm -f messages.po
5451 +  fi
5452 +
5453 +  AC_OUTPUT_COMMANDS([
5454 +    for ac_file in $CONFIG_FILES; do
5455 +      # Support "outfile[:infile[:infile...]]"
5456 +      case "$ac_file" in
5457 +        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5458 +      esac
5459 +      # PO directories have a Makefile.in generated from Makefile.in.in.
5460 +      case "$ac_file" in */Makefile.in)
5461 +        # Adjust a relative srcdir.
5462 +        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
5463 +        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
5464 +        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
5465 +        # In autoconf-2.13 it is called $ac_given_srcdir.
5466 +        # In autoconf-2.50 it is called $srcdir.
5467 +        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
5468 +        case "$ac_given_srcdir" in
5469 +          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
5470 +          /*) top_srcdir="$ac_given_srcdir" ;;
5471 +          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
5472 +        esac
5473 +        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
5474 +          rm -f "$ac_dir/POTFILES"
5475 +          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
5476 +          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
5477 +          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
5478 +          # on $ac_dir but don't depend on user-specified configuration
5479 +          # parameters.
5480 +          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
5481 +            # The LINGUAS file contains the set of available languages.
5482 +            if test -n "$ALL_LINGUAS"; then
5483 +              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
5484 +            fi
5485 +            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
5486 +            # Hide the ALL_LINGUAS assigment from automake.
5487 +            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
5488 +          fi
5489 +          case "$ac_given_srcdir" in
5490 +            .) srcdirpre= ;;
5491 +            *) srcdirpre='$(srcdir)/' ;;
5492 +          esac
5493 +          POFILES=
5494 +          GMOFILES=
5495 +          UPDATEPOFILES=
5496 +          DUMMYPOFILES=
5497 +          for lang in $ALL_LINGUAS; do
5498 +            POFILES="$POFILES $srcdirpre$lang.po"
5499 +            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
5500 +            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
5501 +            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
5502 +          done
5503 +          # CATALOGS depends on both $ac_dir and the user's LINGUAS
5504 +          # environment variable.
5505 +          INST_LINGUAS=
5506 +          if test -n "$ALL_LINGUAS"; then
5507 +            for presentlang in $ALL_LINGUAS; do
5508 +              useit=no
5509 +              if test "%UNSET%" != "$LINGUAS"; then
5510 +                desiredlanguages="$LINGUAS"
5511 +              else
5512 +                desiredlanguages="$ALL_LINGUAS"
5513 +              fi
5514 +              for desiredlang in $desiredlanguages; do
5515 +                # Use the presentlang catalog if desiredlang is
5516 +                #   a. equal to presentlang, or
5517 +                #   b. a variant of presentlang (because in this case,
5518 +                #      presentlang can be used as a fallback for messages
5519 +                #      which are not translated in the desiredlang catalog).
5520 +                case "$desiredlang" in
5521 +                  "$presentlang"*) useit=yes;;
5522 +                esac
5523 +              done
5524 +              if test $useit = yes; then
5525 +                INST_LINGUAS="$INST_LINGUAS $presentlang"
5526 +              fi
5527 +            done
5528 +          fi
5529 +          CATALOGS=
5530 +          if test -n "$INST_LINGUAS"; then
5531 +            for lang in $INST_LINGUAS; do
5532 +              CATALOGS="$CATALOGS $lang.gmo"
5533 +            done
5534 +          fi
5535 +          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
5536 +          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
5537 +          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
5538 +            if test -f "$f"; then
5539 +              case "$f" in
5540 +                *.orig | *.bak | *~) ;;
5541 +                *) cat "$f" >> "$ac_dir/Makefile" ;;
5542 +              esac
5543 +            fi
5544 +          done
5545 +        fi
5546 +        ;;
5547 +      esac
5548 +    done],
5549 +   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
5550 +    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
5551 +    # from automake.
5552 +    eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
5553 +    # Capture the value of LINGUAS because we need it to compute CATALOGS.
5554 +    LINGUAS="${LINGUAS-%UNSET%}"
5555 +   ])
5556 +])
5557 +
5558 +
5559 +dnl Checks for all prerequisites of the intl subdirectory,
5560 +dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
5561 +dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
5562 +AC_DEFUN([AM_INTL_SUBDIR],
5563 +[
5564 +  AC_REQUIRE([AC_PROG_INSTALL])dnl
5565 +  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5566 +  AC_REQUIRE([AC_PROG_CC])dnl
5567 +  AC_REQUIRE([AC_CANONICAL_HOST])dnl
5568 +  AC_REQUIRE([AC_PROG_RANLIB])dnl
5569 +  AC_REQUIRE([AC_ISC_POSIX])dnl
5570 +  AC_REQUIRE([AC_HEADER_STDC])dnl
5571 +  AC_REQUIRE([AC_C_CONST])dnl
5572 +  AC_REQUIRE([AC_C_INLINE])dnl
5573 +  AC_REQUIRE([AC_TYPE_OFF_T])dnl
5574 +  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
5575 +  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
5576 +  AC_REQUIRE([AC_FUNC_MMAP])dnl
5577 +  AC_REQUIRE([jm_GLIBC21])dnl
5578 +  AC_REQUIRE([gt_INTDIV0])dnl
5579 +  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
5580 +  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
5581 +  AC_REQUIRE([gt_INTTYPES_PRI])dnl
5582 +
5583 +  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
5584 +stdlib.h string.h unistd.h sys/param.h])
5585 +  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
5586 +geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
5587 +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
5588 +
5589 +  AM_ICONV
5590 +  AM_LANGINFO_CODESET
5591 +  if test $ac_cv_header_locale_h = yes; then
5592 +    AM_LC_MESSAGES
5593 +  fi
5594 +
5595 +  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
5596 +  dnl because plural.y uses bison specific features. It requires at least
5597 +  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
5598 +  dnl compile.
5599 +  dnl bison is only needed for the maintainer (who touches plural.y). But in
5600 +  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
5601 +  dnl the rule in general Makefile. Now, some people carelessly touch the
5602 +  dnl files or have a broken "make" program, hence the plural.c rule will
5603 +  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
5604 +  dnl present or too old.
5605 +  AC_CHECK_PROGS([INTLBISON], [bison])
5606 +  if test -z "$INTLBISON"; then
5607 +    ac_verc_fail=yes
5608 +  else
5609 +    dnl Found it, now check the version.
5610 +    AC_MSG_CHECKING([version of bison])
5611 +changequote(<<,>>)dnl
5612 +    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
5613 +    case $ac_prog_version in
5614 +      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
5615 +      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
5616 +changequote([,])dnl
5617 +         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
5618 +      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
5619 +    esac
5620 +    AC_MSG_RESULT([$ac_prog_version])
5621 +  fi
5622 +  if test $ac_verc_fail = yes; then
5623 +    INTLBISON=:
5624 +  fi
5625 +])
5626 +
5627 +
5628 +AC_DEFUN([AM_MKINSTALLDIRS],
5629 +[
5630 +  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
5631 +  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
5632 +  dnl Try to locate is.
5633 +  MKINSTALLDIRS=
5634 +  if test -n "$ac_aux_dir"; then
5635 +    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
5636 +  fi
5637 +  if test -z "$MKINSTALLDIRS"; then
5638 +    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
5639 +  fi
5640 +  AC_SUBST(MKINSTALLDIRS)
5641 +])
5642 +
5643 +
5644 +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
5645 +AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
5646 Index: dialog-1.0-20050306/m4/glibc21.m4
5647 ===================================================================
5648 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5649 +++ dialog-1.0-20050306/m4/glibc21.m4   2005-05-16 01:32:07.000000000 +0200
5650 @@ -0,0 +1,32 @@
5651 +# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
5652 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5653 +dnl This file is free software, distributed under the terms of the GNU
5654 +dnl General Public License.  As a special exception to the GNU General
5655 +dnl Public License, this file may be distributed as part of a program
5656 +dnl that contains a configuration script generated by Autoconf, under
5657 +dnl the same distribution terms as the rest of that program.
5658 +
5659 +# Test for the GNU C Library, version 2.1 or newer.
5660 +# From Bruno Haible.
5661 +
5662 +AC_DEFUN([jm_GLIBC21],
5663 +  [
5664 +    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
5665 +      ac_cv_gnu_library_2_1,
5666 +      [AC_EGREP_CPP([Lucky GNU user],
5667 +       [
5668 +#include <features.h>
5669 +#ifdef __GNU_LIBRARY__
5670 + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
5671 +  Lucky GNU user
5672 + #endif
5673 +#endif
5674 +       ],
5675 +       ac_cv_gnu_library_2_1=yes,
5676 +       ac_cv_gnu_library_2_1=no)
5677 +      ]
5678 +    )
5679 +    AC_SUBST(GLIBC21)
5680 +    GLIBC21="$ac_cv_gnu_library_2_1"
5681 +  ]
5682 +)
5683 Index: dialog-1.0-20050306/m4/iconv.m4
5684 ===================================================================
5685 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5686 +++ dialog-1.0-20050306/m4/iconv.m4     2005-05-16 01:32:07.000000000 +0200
5687 @@ -0,0 +1,103 @@
5688 +# iconv.m4 serial AM4 (gettext-0.11.3)
5689 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5690 +dnl This file is free software, distributed under the terms of the GNU
5691 +dnl General Public License.  As a special exception to the GNU General
5692 +dnl Public License, this file may be distributed as part of a program
5693 +dnl that contains a configuration script generated by Autoconf, under
5694 +dnl the same distribution terms as the rest of that program.
5695 +
5696 +dnl From Bruno Haible.
5697 +
5698 +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
5699 +[
5700 +  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5701 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5702 +  AC_REQUIRE([AC_LIB_RPATH])
5703 +
5704 +  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
5705 +  dnl accordingly.
5706 +  AC_LIB_LINKFLAGS_BODY([iconv])
5707 +])
5708 +
5709 +AC_DEFUN([AM_ICONV_LINK],
5710 +[
5711 +  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
5712 +  dnl those with the standalone portable GNU libiconv installed).
5713 +
5714 +  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
5715 +  dnl accordingly.
5716 +  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5717 +
5718 +  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
5719 +  dnl because if the user has installed libiconv and not disabled its use
5720 +  dnl via --without-libiconv-prefix, he wants to use it. The first
5721 +  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
5722 +  am_save_CPPFLAGS="$CPPFLAGS"
5723 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
5724 +
5725 +  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
5726 +    am_cv_func_iconv="no, consider installing GNU libiconv"
5727 +    am_cv_lib_iconv=no
5728 +    AC_TRY_LINK([#include <stdlib.h>
5729 +#include <iconv.h>],
5730 +      [iconv_t cd = iconv_open("","");
5731 +       iconv(cd,NULL,NULL,NULL,NULL);
5732 +       iconv_close(cd);],
5733 +      am_cv_func_iconv=yes)
5734 +    if test "$am_cv_func_iconv" != yes; then
5735 +      am_save_LIBS="$LIBS"
5736 +      LIBS="$LIBS $LIBICONV"
5737 +      AC_TRY_LINK([#include <stdlib.h>
5738 +#include <iconv.h>],
5739 +        [iconv_t cd = iconv_open("","");
5740 +         iconv(cd,NULL,NULL,NULL,NULL);
5741 +         iconv_close(cd);],
5742 +        am_cv_lib_iconv=yes
5743 +        am_cv_func_iconv=yes)
5744 +      LIBS="$am_save_LIBS"
5745 +    fi
5746 +  ])
5747 +  if test "$am_cv_func_iconv" = yes; then
5748 +    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
5749 +  fi
5750 +  if test "$am_cv_lib_iconv" = yes; then
5751 +    AC_MSG_CHECKING([how to link with libiconv])
5752 +    AC_MSG_RESULT([$LIBICONV])
5753 +  else
5754 +    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
5755 +    dnl either.
5756 +    CPPFLAGS="$am_save_CPPFLAGS"
5757 +    LIBICONV=
5758 +    LTLIBICONV=
5759 +  fi
5760 +  AC_SUBST(LIBICONV)
5761 +  AC_SUBST(LTLIBICONV)
5762 +])
5763 +
5764 +AC_DEFUN([AM_ICONV],
5765 +[
5766 +  AM_ICONV_LINK
5767 +  if test "$am_cv_func_iconv" = yes; then
5768 +    AC_MSG_CHECKING([for iconv declaration])
5769 +    AC_CACHE_VAL(am_cv_proto_iconv, [
5770 +      AC_TRY_COMPILE([
5771 +#include <stdlib.h>
5772 +#include <iconv.h>
5773 +extern
5774 +#ifdef __cplusplus
5775 +"C"
5776 +#endif
5777 +#if defined(__STDC__) || defined(__cplusplus)
5778 +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
5779 +#else
5780 +size_t iconv();
5781 +#endif
5782 +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
5783 +      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);"])
5784 +    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
5785 +    AC_MSG_RESULT([$]{ac_t:-
5786 +         }[$]am_cv_proto_iconv)
5787 +    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
5788 +      [Define as const if the declaration of iconv() needs const.])
5789 +  fi
5790 +])
5791 Index: dialog-1.0-20050306/m4/intdiv0.m4
5792 ===================================================================
5793 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5794 +++ dialog-1.0-20050306/m4/intdiv0.m4   2005-05-16 01:32:07.000000000 +0200
5795 @@ -0,0 +1,72 @@
5796 +# intdiv0.m4 serial 1 (gettext-0.11.3)
5797 +dnl Copyright (C) 2002 Free Software Foundation, Inc.
5798 +dnl This file is free software, distributed under the terms of the GNU
5799 +dnl General Public License.  As a special exception to the GNU General
5800 +dnl Public License, this file may be distributed as part of a program
5801 +dnl that contains a configuration script generated by Autoconf, under
5802 +dnl the same distribution terms as the rest of that program.
5803 +
5804 +dnl From Bruno Haible.
5805 +
5806 +AC_DEFUN([gt_INTDIV0],
5807 +[
5808 +  AC_REQUIRE([AC_PROG_CC])dnl
5809 +  AC_REQUIRE([AC_CANONICAL_HOST])dnl
5810 +
5811 +  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
5812 +    gt_cv_int_divbyzero_sigfpe,
5813 +    [
5814 +      AC_TRY_RUN([
5815 +#include <stdlib.h>
5816 +#include <signal.h>
5817 +
5818 +static void
5819 +#ifdef __cplusplus
5820 +sigfpe_handler (int sig)
5821 +#else
5822 +sigfpe_handler (sig) int sig;
5823 +#endif
5824 +{
5825 +  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
5826 +  exit (sig != SIGFPE);
5827 +}
5828 +
5829 +int x = 1;
5830 +int y = 0;
5831 +int z;
5832 +int nan;
5833 +
5834 +int main ()
5835 +{
5836 +  signal (SIGFPE, sigfpe_handler);
5837 +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
5838 +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
5839 +  signal (SIGTRAP, sigfpe_handler);
5840 +#endif
5841 +/* Linux/SPARC yields signal SIGILL.  */
5842 +#if defined (__sparc__) && defined (__linux__)
5843 +  signal (SIGILL, sigfpe_handler);
5844 +#endif
5845 +
5846 +  z = x / y;
5847 +  nan = y / y;
5848 +  exit (1);
5849 +}
5850 +], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
5851 +        [
5852 +          # Guess based on the CPU.
5853 +          case "$host_cpu" in
5854 +            alpha* | i[34567]86 | m68k | s390*)
5855 +              gt_cv_int_divbyzero_sigfpe="guessing yes";;
5856 +            *)
5857 +              gt_cv_int_divbyzero_sigfpe="guessing no";;
5858 +          esac
5859 +        ])
5860 +    ])
5861 +  case "$gt_cv_int_divbyzero_sigfpe" in
5862 +    *yes) value=1;;
5863 +    *) value=0;;
5864 +  esac
5865 +  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
5866 +    [Define if integer division by zero raises signal SIGFPE.])
5867 +])
5868 Index: dialog-1.0-20050306/m4/inttypes-pri.m4
5869 ===================================================================
5870 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5871 +++ dialog-1.0-20050306/m4/inttypes-pri.m4      2005-05-16 01:32:07.000000000 +0200
5872 @@ -0,0 +1,32 @@
5873 +# inttypes-pri.m4 serial 1 (gettext-0.11.4)
5874 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5875 +dnl This file is free software, distributed under the terms of the GNU
5876 +dnl General Public License.  As a special exception to the GNU General
5877 +dnl Public License, this file may be distributed as part of a program
5878 +dnl that contains a configuration script generated by Autoconf, under
5879 +dnl the same distribution terms as the rest of that program.
5880 +
5881 +dnl From Bruno Haible.
5882 +
5883 +# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
5884 +# macros to non-string values.  This is the case on AIX 4.3.3.
5885 +
5886 +AC_DEFUN([gt_INTTYPES_PRI],
5887 +[
5888 +  AC_REQUIRE([gt_HEADER_INTTYPES_H])
5889 +  if test $gt_cv_header_inttypes_h = yes; then
5890 +    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
5891 +      gt_cv_inttypes_pri_broken,
5892 +      [
5893 +        AC_TRY_COMPILE([#include <inttypes.h>
5894 +#ifdef PRId32
5895 +char *p = PRId32;
5896 +#endif
5897 +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
5898 +      ])
5899 +  fi
5900 +  if test "$gt_cv_inttypes_pri_broken" = yes; then
5901 +    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
5902 +      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
5903 +  fi
5904 +])
5905 Index: dialog-1.0-20050306/m4/inttypes.m4
5906 ===================================================================
5907 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5908 +++ dialog-1.0-20050306/m4/inttypes.m4  2005-05-16 01:32:07.000000000 +0200
5909 @@ -0,0 +1,27 @@
5910 +# inttypes.m4 serial 1 (gettext-0.11.4)
5911 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5912 +dnl This file is free software, distributed under the terms of the GNU
5913 +dnl General Public License.  As a special exception to the GNU General
5914 +dnl Public License, this file may be distributed as part of a program
5915 +dnl that contains a configuration script generated by Autoconf, under
5916 +dnl the same distribution terms as the rest of that program.
5917 +
5918 +dnl From Paul Eggert.
5919 +
5920 +# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
5921 +# <sys/types.h>.
5922 +
5923 +AC_DEFUN([gt_HEADER_INTTYPES_H],
5924 +[
5925 +  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
5926 +  [
5927 +    AC_TRY_COMPILE(
5928 +      [#include <sys/types.h>
5929 +#include <inttypes.h>],
5930 +      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
5931 +  ])
5932 +  if test $gt_cv_header_inttypes_h = yes; then
5933 +    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
5934 +      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
5935 +  fi
5936 +])
5937 Index: dialog-1.0-20050306/m4/inttypes_h.m4
5938 ===================================================================
5939 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5940 +++ dialog-1.0-20050306/m4/inttypes_h.m4        2005-05-16 01:32:07.000000000 +0200
5941 @@ -0,0 +1,28 @@
5942 +# inttypes_h.m4 serial 4 (gettext-0.11.4)
5943 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
5944 +dnl This file is free software, distributed under the terms of the GNU
5945 +dnl General Public License.  As a special exception to the GNU General
5946 +dnl Public License, this file may be distributed as part of a program
5947 +dnl that contains a configuration script generated by Autoconf, under
5948 +dnl the same distribution terms as the rest of that program.
5949 +
5950 +dnl From Paul Eggert.
5951 +
5952 +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
5953 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
5954 +
5955 +AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
5956 +[
5957 +  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
5958 +  [AC_TRY_COMPILE(
5959 +    [#include <sys/types.h>
5960 +#include <inttypes.h>],
5961 +    [uintmax_t i = (uintmax_t) -1;],
5962 +    jm_ac_cv_header_inttypes_h=yes,
5963 +    jm_ac_cv_header_inttypes_h=no)])
5964 +  if test $jm_ac_cv_header_inttypes_h = yes; then
5965 +    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
5966 +[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
5967 +   and declares uintmax_t. ])
5968 +  fi
5969 +])
5970 Index: dialog-1.0-20050306/m4/lcmessage.m4
5971 ===================================================================
5972 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
5973 +++ dialog-1.0-20050306/m4/lcmessage.m4 2005-05-16 01:32:07.000000000 +0200
5974 @@ -0,0 +1,32 @@
5975 +# lcmessage.m4 serial 3 (gettext-0.11.3)
5976 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5977 +dnl This file is free software, distributed under the terms of the GNU
5978 +dnl General Public License.  As a special exception to the GNU General
5979 +dnl Public License, this file may be distributed as part of a program
5980 +dnl that contains a configuration script generated by Autoconf, under
5981 +dnl the same distribution terms as the rest of that program.
5982 +dnl
5983 +dnl This file can can be used in projects which are not available under
5984 +dnl the GNU General Public License or the GNU Library General Public
5985 +dnl License but which still want to provide support for the GNU gettext
5986 +dnl functionality.
5987 +dnl Please note that the actual code of the GNU gettext library is covered
5988 +dnl by the GNU Library General Public License, and the rest of the GNU
5989 +dnl gettext package package is covered by the GNU General Public License.
5990 +dnl They are *not* in the public domain.
5991 +
5992 +dnl Authors:
5993 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
5994 +
5995 +# Check whether LC_MESSAGES is available in <locale.h>.
5996 +
5997 +AC_DEFUN([AM_LC_MESSAGES],
5998 +[
5999 +  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
6000 +    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
6001 +       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
6002 +  if test $am_cv_val_LC_MESSAGES = yes; then
6003 +    AC_DEFINE(HAVE_LC_MESSAGES, 1,
6004 +      [Define if your <locale.h> file defines LC_MESSAGES.])
6005 +  fi
6006 +])
6007 Index: dialog-1.0-20050306/m4/lib-ld.m4
6008 ===================================================================
6009 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6010 +++ dialog-1.0-20050306/m4/lib-ld.m4    2005-05-16 01:32:07.000000000 +0200
6011 @@ -0,0 +1,97 @@
6012 +# lib-ld.m4 serial 1 (gettext-0.11)
6013 +dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
6014 +dnl This file is free software, distributed under the terms of the GNU
6015 +dnl General Public License.  As a special exception to the GNU General
6016 +dnl Public License, this file may be distributed as part of a program
6017 +dnl that contains a configuration script generated by Autoconf, under
6018 +dnl the same distribution terms as the rest of that program.
6019 +
6020 +dnl Subroutines of libtool.m4,
6021 +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
6022 +dnl with libtool.m4.
6023 +
6024 +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
6025 +AC_DEFUN([AC_LIB_PROG_LD_GNU],
6026 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
6027 +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
6028 +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
6029 +  acl_cv_prog_gnu_ld=yes
6030 +else
6031 +  acl_cv_prog_gnu_ld=no
6032 +fi])
6033 +with_gnu_ld=$acl_cv_prog_gnu_ld
6034 +])
6035 +
6036 +dnl From libtool-1.4. Sets the variable LD.
6037 +AC_DEFUN([AC_LIB_PROG_LD],
6038 +[AC_ARG_WITH(gnu-ld,
6039 +[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
6040 +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
6041 +AC_REQUIRE([AC_PROG_CC])dnl
6042 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
6043 +ac_prog=ld
6044 +if test "$GCC" = yes; then
6045 +  # Check if gcc -print-prog-name=ld gives a path.
6046 +  AC_MSG_CHECKING([for ld used by GCC])
6047 +  case $host in
6048 +  *-*-mingw*)
6049 +    # gcc leaves a trailing carriage return which upsets mingw
6050 +    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
6051 +  *)
6052 +    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
6053 +  esac
6054 +  case $ac_prog in
6055 +    # Accept absolute paths.
6056 +    [[\\/]* | [A-Za-z]:[\\/]*)]
6057 +      [re_direlt='/[^/][^/]*/\.\./']
6058 +      # Canonicalize the path of ld
6059 +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
6060 +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
6061 +       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
6062 +      done
6063 +      test -z "$LD" && LD="$ac_prog"
6064 +      ;;
6065 +  "")
6066 +    # If it fails, then pretend we aren't using GCC.
6067 +    ac_prog=ld
6068 +    ;;
6069 +  *)
6070 +    # If it is relative, then search for the first ld in PATH.
6071 +    with_gnu_ld=unknown
6072 +    ;;
6073 +  esac
6074 +elif test "$with_gnu_ld" = yes; then
6075 +  AC_MSG_CHECKING([for GNU ld])
6076 +else
6077 +  AC_MSG_CHECKING([for non-GNU ld])
6078 +fi
6079 +AC_CACHE_VAL(acl_cv_path_LD,
6080 +[if test -z "$LD"; then
6081 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
6082 +  for ac_dir in $PATH; do
6083 +    test -z "$ac_dir" && ac_dir=.
6084 +    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
6085 +      acl_cv_path_LD="$ac_dir/$ac_prog"
6086 +      # Check to see if the program is GNU ld.  I'd rather use --version,
6087 +      # but apparently some GNU ld's only accept -v.
6088 +      # Break only if it was the GNU/non-GNU ld that we prefer.
6089 +      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
6090 +       test "$with_gnu_ld" != no && break
6091 +      else
6092 +       test "$with_gnu_ld" != yes && break
6093 +      fi
6094 +    fi
6095 +  done
6096 +  IFS="$ac_save_ifs"
6097 +else
6098 +  acl_cv_path_LD="$LD" # Let the user override the test with a path.
6099 +fi])
6100 +LD="$acl_cv_path_LD"
6101 +if test -n "$LD"; then
6102 +  AC_MSG_RESULT($LD)
6103 +else
6104 +  AC_MSG_RESULT(no)
6105 +fi
6106 +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
6107 +AC_LIB_PROG_LD_GNU
6108 +])
6109 Index: dialog-1.0-20050306/m4/lib-link.m4
6110 ===================================================================
6111 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6112 +++ dialog-1.0-20050306/m4/lib-link.m4  2005-05-16 01:32:07.000000000 +0200
6113 @@ -0,0 +1,554 @@
6114 +# lib-link.m4 serial 3 (gettext-0.11.3)
6115 +dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
6116 +dnl This file is free software, distributed under the terms of the GNU
6117 +dnl General Public License.  As a special exception to the GNU General
6118 +dnl Public License, this file may be distributed as part of a program
6119 +dnl that contains a configuration script generated by Autoconf, under
6120 +dnl the same distribution terms as the rest of that program.
6121 +
6122 +dnl From Bruno Haible.
6123 +
6124 +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
6125 +dnl the libraries corresponding to explicit and implicit dependencies.
6126 +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
6127 +dnl augments the CPPFLAGS variable.
6128 +AC_DEFUN([AC_LIB_LINKFLAGS],
6129 +[
6130 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
6131 +  AC_REQUIRE([AC_LIB_RPATH])
6132 +  define([Name],[translit([$1],[./-], [___])])
6133 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
6134 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
6135 +  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
6136 +    AC_LIB_LINKFLAGS_BODY([$1], [$2])
6137 +    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
6138 +    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
6139 +    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
6140 +  ])
6141 +  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
6142 +  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
6143 +  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
6144 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
6145 +  AC_SUBST([LIB]NAME)
6146 +  AC_SUBST([LTLIB]NAME)
6147 +  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
6148 +  dnl results of this search when this library appears as a dependency.
6149 +  HAVE_LIB[]NAME=yes
6150 +  undefine([Name])
6151 +  undefine([NAME])
6152 +])
6153 +
6154 +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
6155 +dnl searches for libname and the libraries corresponding to explicit and
6156 +dnl implicit dependencies, together with the specified include files and
6157 +dnl the ability to compile and link the specified testcode. If found, it
6158 +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
6159 +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
6160 +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
6161 +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
6162 +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
6163 +[
6164 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
6165 +  AC_REQUIRE([AC_LIB_RPATH])
6166 +  define([Name],[translit([$1],[./-], [___])])
6167 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
6168 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
6169 +
6170 +  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
6171 +  dnl accordingly.
6172 +  AC_LIB_LINKFLAGS_BODY([$1], [$2])
6173 +
6174 +  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
6175 +  dnl because if the user has installed lib[]Name and not disabled its use
6176 +  dnl via --without-lib[]Name-prefix, he wants to use it.
6177 +  ac_save_CPPFLAGS="$CPPFLAGS"
6178 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
6179 +
6180 +  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
6181 +    ac_save_LIBS="$LIBS"
6182 +    LIBS="$LIBS $LIB[]NAME"
6183 +    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
6184 +    LIBS="$ac_save_LIBS"
6185 +  ])
6186 +  if test "$ac_cv_lib[]Name" = yes; then
6187 +    HAVE_LIB[]NAME=yes
6188 +    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
6189 +    AC_MSG_CHECKING([how to link with lib[]$1])
6190 +    AC_MSG_RESULT([$LIB[]NAME])
6191 +  else
6192 +    HAVE_LIB[]NAME=no
6193 +    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
6194 +    dnl $INC[]NAME either.
6195 +    CPPFLAGS="$ac_save_CPPFLAGS"
6196 +    LIB[]NAME=
6197 +    LTLIB[]NAME=
6198 +  fi
6199 +  AC_SUBST([HAVE_LIB]NAME)
6200 +  AC_SUBST([LIB]NAME)
6201 +  AC_SUBST([LTLIB]NAME)
6202 +  undefine([Name])
6203 +  undefine([NAME])
6204 +])
6205 +
6206 +dnl Determine the platform dependent parameters needed to use rpath:
6207 +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
6208 +dnl hardcode_direct, hardcode_minus_L,
6209 +dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
6210 +AC_DEFUN([AC_LIB_RPATH],
6211 +[
6212 +  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
6213 +  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
6214 +  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
6215 +  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
6216 +  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
6217 +    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
6218 +    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
6219 +    . ./conftest.sh
6220 +    rm -f ./conftest.sh
6221 +    acl_cv_rpath=done
6222 +  ])
6223 +  wl="$acl_cv_wl"
6224 +  libext="$acl_cv_libext"
6225 +  shlibext="$acl_cv_shlibext"
6226 +  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
6227 +  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
6228 +  hardcode_direct="$acl_cv_hardcode_direct"
6229 +  hardcode_minus_L="$acl_cv_hardcode_minus_L"
6230 +  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
6231 +  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
6232 +  dnl Determine whether the user wants rpath handling at all.
6233 +  AC_ARG_ENABLE(rpath,
6234 +    [  --disable-rpath         do not hardcode runtime library paths],
6235 +    :, enable_rpath=yes)
6236 +])
6237 +
6238 +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
6239 +dnl the libraries corresponding to explicit and implicit dependencies.
6240 +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
6241 +AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
6242 +[
6243 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
6244 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
6245 +  dnl By default, look in $includedir and $libdir.
6246 +  use_additional=yes
6247 +  AC_LIB_WITH_FINAL_PREFIX([
6248 +    eval additional_includedir=\"$includedir\"
6249 +    eval additional_libdir=\"$libdir\"
6250 +  ])
6251 +  AC_ARG_WITH([lib$1-prefix],
6252 +[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
6253 +  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
6254 +[
6255 +    if test "X$withval" = "Xno"; then
6256 +      use_additional=no
6257 +    else
6258 +      if test "X$withval" = "X"; then
6259 +        AC_LIB_WITH_FINAL_PREFIX([
6260 +          eval additional_includedir=\"$includedir\"
6261 +          eval additional_libdir=\"$libdir\"
6262 +        ])
6263 +      else
6264 +        additional_includedir="$withval/include"
6265 +        additional_libdir="$withval/lib"
6266 +      fi
6267 +    fi
6268 +])
6269 +  dnl Search the library and its dependencies in $additional_libdir and
6270 +  dnl $LDFLAGS. Using breadth-first-seach.
6271 +  LIB[]NAME=
6272 +  LTLIB[]NAME=
6273 +  INC[]NAME=
6274 +  rpathdirs=
6275 +  ltrpathdirs=
6276 +  names_already_handled=
6277 +  names_next_round='$1 $2'
6278 +  while test -n "$names_next_round"; do
6279 +    names_this_round="$names_next_round"
6280 +    names_next_round=
6281 +    for name in $names_this_round; do
6282 +      already_handled=
6283 +      for n in $names_already_handled; do
6284 +        if test "$n" = "$name"; then
6285 +          already_handled=yes
6286 +          break
6287 +        fi
6288 +      done
6289 +      if test -z "$already_handled"; then
6290 +        names_already_handled="$names_already_handled $name"
6291 +        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
6292 +        dnl or AC_LIB_HAVE_LINKFLAGS call.
6293 +        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
6294 +        eval value=\"\$HAVE_LIB$uppername\"
6295 +        if test -n "$value"; then
6296 +          if test "$value" = yes; then
6297 +            eval value=\"\$LIB$uppername\"
6298 +            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
6299 +            eval value=\"\$LTLIB$uppername\"
6300 +            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
6301 +          else
6302 +            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
6303 +            dnl that this library doesn't exist. So just drop it.
6304 +            :
6305 +          fi
6306 +        else
6307 +          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
6308 +          dnl and the already constructed $LIBNAME/$LTLIBNAME.
6309 +          found_dir=
6310 +          found_la=
6311 +          found_so=
6312 +          found_a=
6313 +          if test $use_additional = yes; then
6314 +            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
6315 +              found_dir="$additional_libdir"
6316 +              found_so="$additional_libdir/lib$name.$shlibext"
6317 +              if test -f "$additional_libdir/lib$name.la"; then
6318 +                found_la="$additional_libdir/lib$name.la"
6319 +              fi
6320 +            else
6321 +              if test -f "$additional_libdir/lib$name.$libext"; then
6322 +                found_dir="$additional_libdir"
6323 +                found_a="$additional_libdir/lib$name.$libext"
6324 +                if test -f "$additional_libdir/lib$name.la"; then
6325 +                  found_la="$additional_libdir/lib$name.la"
6326 +                fi
6327 +              fi
6328 +            fi
6329 +          fi
6330 +          if test "X$found_dir" = "X"; then
6331 +            for x in $LDFLAGS $LTLIB[]NAME; do
6332 +              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6333 +              case "$x" in
6334 +                -L*)
6335 +                  dir=`echo "X$x" | sed -e 's/^X-L//'`
6336 +                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
6337 +                    found_dir="$dir"
6338 +                    found_so="$dir/lib$name.$shlibext"
6339 +                    if test -f "$dir/lib$name.la"; then
6340 +                      found_la="$dir/lib$name.la"
6341 +                    fi
6342 +                  else
6343 +                    if test -f "$dir/lib$name.$libext"; then
6344 +                      found_dir="$dir"
6345 +                      found_a="$dir/lib$name.$libext"
6346 +                      if test -f "$dir/lib$name.la"; then
6347 +                        found_la="$dir/lib$name.la"
6348 +                      fi
6349 +                    fi
6350 +                  fi
6351 +                  ;;
6352 +              esac
6353 +              if test "X$found_dir" != "X"; then
6354 +                break
6355 +              fi
6356 +            done
6357 +          fi
6358 +          if test "X$found_dir" != "X"; then
6359 +            dnl Found the library.
6360 +            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
6361 +            if test "X$found_so" != "X"; then
6362 +              dnl Linking with a shared library. We attempt to hardcode its
6363 +              dnl directory into the executable's runpath, unless it's the
6364 +              dnl standard /usr/lib.
6365 +              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
6366 +                dnl No hardcoding is needed.
6367 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
6368 +              else
6369 +                dnl Use an explicit option to hardcode DIR into the resulting
6370 +                dnl binary.
6371 +                dnl Potentially add DIR to ltrpathdirs.
6372 +                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
6373 +                haveit=
6374 +                for x in $ltrpathdirs; do
6375 +                  if test "X$x" = "X$found_dir"; then
6376 +                    haveit=yes
6377 +                    break
6378 +                  fi
6379 +                done
6380 +                if test -z "$haveit"; then
6381 +                  ltrpathdirs="$ltrpathdirs $found_dir"
6382 +                fi
6383 +                dnl The hardcoding into $LIBNAME is system dependent.
6384 +                if test "$hardcode_direct" = yes; then
6385 +                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
6386 +                  dnl resulting binary.
6387 +                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
6388 +                else
6389 +                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
6390 +                    dnl Use an explicit option to hardcode DIR into the resulting
6391 +                    dnl binary.
6392 +                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
6393 +                    dnl Potentially add DIR to rpathdirs.
6394 +                    dnl The rpathdirs will be appended to $LIBNAME at the end.
6395 +                    haveit=
6396 +                    for x in $rpathdirs; do
6397 +                      if test "X$x" = "X$found_dir"; then
6398 +                        haveit=yes
6399 +                        break
6400 +                      fi
6401 +                    done
6402 +                    if test -z "$haveit"; then
6403 +                      rpathdirs="$rpathdirs $found_dir"
6404 +                    fi
6405 +                  else
6406 +                    dnl Rely on "-L$found_dir".
6407 +                    dnl But don't add it if it's already contained in the LDFLAGS
6408 +                    dnl or the already constructed $LIBNAME
6409 +                    haveit=
6410 +                    for x in $LDFLAGS $LIB[]NAME; do
6411 +                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6412 +                      if test "X$x" = "X-L$found_dir"; then
6413 +                        haveit=yes
6414 +                        break
6415 +                      fi
6416 +                    done
6417 +                    if test -z "$haveit"; then
6418 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
6419 +                    fi
6420 +                    if test "$hardcode_minus_L" != no; then
6421 +                      dnl FIXME: Not sure whether we should use
6422 +                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
6423 +                      dnl here.
6424 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
6425 +                    else
6426 +                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
6427 +                      dnl here, because this doesn't fit in flags passed to the
6428 +                      dnl compiler. So give up. No hardcoding. This affects only
6429 +                      dnl very old systems.
6430 +                      dnl FIXME: Not sure whether we should use
6431 +                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
6432 +                      dnl here.
6433 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
6434 +                    fi
6435 +                  fi
6436 +                fi
6437 +              fi
6438 +            else
6439 +              if test "X$found_a" != "X"; then
6440 +                dnl Linking with a static library.
6441 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
6442 +              else
6443 +                dnl We shouldn't come here, but anyway it's good to have a
6444 +                dnl fallback.
6445 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
6446 +              fi
6447 +            fi
6448 +            dnl Assume the include files are nearby.
6449 +            additional_includedir=
6450 +            case "$found_dir" in
6451 +              */lib | */lib/)
6452 +                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
6453 +                additional_includedir="$basedir/include"
6454 +                ;;
6455 +            esac
6456 +            if test "X$additional_includedir" != "X"; then
6457 +              dnl Potentially add $additional_includedir to $INCNAME.
6458 +              dnl But don't add it
6459 +              dnl   1. if it's the standard /usr/include,
6460 +              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
6461 +              dnl   3. if it's already present in $CPPFLAGS or the already
6462 +              dnl      constructed $INCNAME,
6463 +              dnl   4. if it doesn't exist as a directory.
6464 +              if test "X$additional_includedir" != "X/usr/include"; then
6465 +                haveit=
6466 +                if test "X$additional_includedir" = "X/usr/local/include"; then
6467 +                  if test -n "$GCC"; then
6468 +                    case $host_os in
6469 +                      linux*) haveit=yes;;
6470 +                    esac
6471 +                  fi
6472 +                fi
6473 +                if test -z "$haveit"; then
6474 +                  for x in $CPPFLAGS $INC[]NAME; do
6475 +                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6476 +                    if test "X$x" = "X-I$additional_includedir"; then
6477 +                      haveit=yes
6478 +                      break
6479 +                    fi
6480 +                  done
6481 +                  if test -z "$haveit"; then
6482 +                    if test -d "$additional_includedir"; then
6483 +                      dnl Really add $additional_includedir to $INCNAME.
6484 +                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
6485 +                    fi
6486 +                  fi
6487 +                fi
6488 +              fi
6489 +            fi
6490 +            dnl Look for dependencies.
6491 +            if test -n "$found_la"; then
6492 +              dnl Read the .la file. It defines the variables
6493 +              dnl dlname, library_names, old_library, dependency_libs, current,
6494 +              dnl age, revision, installed, dlopen, dlpreopen, libdir.
6495 +              save_libdir="$libdir"
6496 +              case "$found_la" in
6497 +                */* | *\\*) . "$found_la" ;;
6498 +                *) . "./$found_la" ;;
6499 +              esac
6500 +              libdir="$save_libdir"
6501 +              dnl We use only dependency_libs.
6502 +              for dep in $dependency_libs; do
6503 +                case "$dep" in
6504 +                  -L*)
6505 +                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
6506 +                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
6507 +                    dnl But don't add it
6508 +                    dnl   1. if it's the standard /usr/lib,
6509 +                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
6510 +                    dnl   3. if it's already present in $LDFLAGS or the already
6511 +                    dnl      constructed $LIBNAME,
6512 +                    dnl   4. if it doesn't exist as a directory.
6513 +                    if test "X$additional_libdir" != "X/usr/lib"; then
6514 +                      haveit=
6515 +                      if test "X$additional_libdir" = "X/usr/local/lib"; then
6516 +                        if test -n "$GCC"; then
6517 +                          case $host_os in
6518 +                            linux*) haveit=yes;;
6519 +                          esac
6520 +                        fi
6521 +                      fi
6522 +                      if test -z "$haveit"; then
6523 +                        haveit=
6524 +                        for x in $LDFLAGS $LIB[]NAME; do
6525 +                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6526 +                          if test "X$x" = "X-L$additional_libdir"; then
6527 +                            haveit=yes
6528 +                            break
6529 +                          fi
6530 +                        done
6531 +                        if test -z "$haveit"; then
6532 +                          if test -d "$additional_libdir"; then
6533 +                            dnl Really add $additional_libdir to $LIBNAME.
6534 +                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
6535 +                          fi
6536 +                        fi
6537 +                        haveit=
6538 +                        for x in $LDFLAGS $LTLIB[]NAME; do
6539 +                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6540 +                          if test "X$x" = "X-L$additional_libdir"; then
6541 +                            haveit=yes
6542 +                            break
6543 +                          fi
6544 +                        done
6545 +                        if test -z "$haveit"; then
6546 +                          if test -d "$additional_libdir"; then
6547 +                            dnl Really add $additional_libdir to $LTLIBNAME.
6548 +                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
6549 +                          fi
6550 +                        fi
6551 +                      fi
6552 +                    fi
6553 +                    ;;
6554 +                  -R*)
6555 +                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
6556 +                    if test "$enable_rpath" != no; then
6557 +                      dnl Potentially add DIR to rpathdirs.
6558 +                      dnl The rpathdirs will be appended to $LIBNAME at the end.
6559 +                      haveit=
6560 +                      for x in $rpathdirs; do
6561 +                        if test "X$x" = "X$dir"; then
6562 +                          haveit=yes
6563 +                          break
6564 +                        fi
6565 +                      done
6566 +                      if test -z "$haveit"; then
6567 +                        rpathdirs="$rpathdirs $dir"
6568 +                      fi
6569 +                      dnl Potentially add DIR to ltrpathdirs.
6570 +                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
6571 +                      haveit=
6572 +                      for x in $ltrpathdirs; do
6573 +                        if test "X$x" = "X$dir"; then
6574 +                          haveit=yes
6575 +                          break
6576 +                        fi
6577 +                      done
6578 +                      if test -z "$haveit"; then
6579 +                        ltrpathdirs="$ltrpathdirs $dir"
6580 +                      fi
6581 +                    fi
6582 +                    ;;
6583 +                  -l*)
6584 +                    dnl Handle this in the next round.
6585 +                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
6586 +                    ;;
6587 +                  *.la)
6588 +                    dnl Handle this in the next round. Throw away the .la's
6589 +                    dnl directory; it is already contained in a preceding -L
6590 +                    dnl option.
6591 +                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
6592 +                    ;;
6593 +                  *)
6594 +                    dnl Most likely an immediate library name.
6595 +                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
6596 +                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
6597 +                    ;;
6598 +                esac
6599 +              done
6600 +            fi
6601 +          else
6602 +            dnl Didn't find the library; assume it is in the system directories
6603 +            dnl known to the linker and runtime loader. (All the system
6604 +            dnl directories known to the linker should also be known to the
6605 +            dnl runtime loader, otherwise the system is severely misconfigured.)
6606 +            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
6607 +            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
6608 +          fi
6609 +        fi
6610 +      fi
6611 +    done
6612 +  done
6613 +  if test "X$rpathdirs" != "X"; then
6614 +    if test -n "$hardcode_libdir_separator"; then
6615 +      dnl Weird platform: only the last -rpath option counts, the user must
6616 +      dnl pass all path elements in one option. We can arrange that for a
6617 +      dnl single library, but not when more than one $LIBNAMEs are used.
6618 +      alldirs=
6619 +      for found_dir in $rpathdirs; do
6620 +        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
6621 +      done
6622 +      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
6623 +      acl_save_libdir="$libdir"
6624 +      libdir="$alldirs"
6625 +      eval flag=\"$hardcode_libdir_flag_spec\"
6626 +      libdir="$acl_save_libdir"
6627 +      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
6628 +    else
6629 +      dnl The -rpath options are cumulative.
6630 +      for found_dir in $rpathdirs; do
6631 +        acl_save_libdir="$libdir"
6632 +        libdir="$found_dir"
6633 +        eval flag=\"$hardcode_libdir_flag_spec\"
6634 +        libdir="$acl_save_libdir"
6635 +        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
6636 +      done
6637 +    fi
6638 +  fi
6639 +  if test "X$ltrpathdirs" != "X"; then
6640 +    dnl When using libtool, the option that works for both libraries and
6641 +    dnl executables is -R. The -R options are cumulative.
6642 +    for found_dir in $ltrpathdirs; do
6643 +      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
6644 +    done
6645 +  fi
6646 +])
6647 +
6648 +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
6649 +dnl unless already present in VAR.
6650 +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
6651 +dnl contains two or three consecutive elements that belong together.
6652 +AC_DEFUN([AC_LIB_APPENDTOVAR],
6653 +[
6654 +  for element in [$2]; do
6655 +    haveit=
6656 +    for x in $[$1]; do
6657 +      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6658 +      if test "X$x" = "X$element"; then
6659 +        haveit=yes
6660 +        break
6661 +      fi
6662 +    done
6663 +    if test -z "$haveit"; then
6664 +      [$1]="${[$1]}${[$1]:+ }$element"
6665 +    fi
6666 +  done
6667 +])
6668 Index: dialog-1.0-20050306/m4/lib-prefix.m4
6669 ===================================================================
6670 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6671 +++ dialog-1.0-20050306/m4/lib-prefix.m4        2005-05-16 01:32:07.000000000 +0200
6672 @@ -0,0 +1,148 @@
6673 +# lib-prefix.m4 serial 1 (gettext-0.11)
6674 +dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
6675 +dnl This file is free software, distributed under the terms of the GNU
6676 +dnl General Public License.  As a special exception to the GNU General
6677 +dnl Public License, this file may be distributed as part of a program
6678 +dnl that contains a configuration script generated by Autoconf, under
6679 +dnl the same distribution terms as the rest of that program.
6680 +
6681 +dnl From Bruno Haible.
6682 +
6683 +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
6684 +dnl to access previously installed libraries. The basic assumption is that
6685 +dnl a user will want packages to use other packages he previously installed
6686 +dnl with the same --prefix option.
6687 +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
6688 +dnl libraries, but is otherwise very convenient.
6689 +AC_DEFUN([AC_LIB_PREFIX],
6690 +[
6691 +  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
6692 +  AC_REQUIRE([AC_PROG_CC])
6693 +  AC_REQUIRE([AC_CANONICAL_HOST])
6694 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
6695 +  dnl By default, look in $includedir and $libdir.
6696 +  use_additional=yes
6697 +  AC_LIB_WITH_FINAL_PREFIX([
6698 +    eval additional_includedir=\"$includedir\"
6699 +    eval additional_libdir=\"$libdir\"
6700 +  ])
6701 +  AC_ARG_WITH([lib-prefix],
6702 +[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
6703 +  --without-lib-prefix    don't search for libraries in includedir and libdir],
6704 +[
6705 +    if test "X$withval" = "Xno"; then
6706 +      use_additional=no
6707 +    else
6708 +      if test "X$withval" = "X"; then
6709 +        AC_LIB_WITH_FINAL_PREFIX([
6710 +          eval additional_includedir=\"$includedir\"
6711 +          eval additional_libdir=\"$libdir\"
6712 +        ])
6713 +      else
6714 +        additional_includedir="$withval/include"
6715 +        additional_libdir="$withval/lib"
6716 +      fi
6717 +    fi
6718 +])
6719 +  if test $use_additional = yes; then
6720 +    dnl Potentially add $additional_includedir to $CPPFLAGS.
6721 +    dnl But don't add it
6722 +    dnl   1. if it's the standard /usr/include,
6723 +    dnl   2. if it's already present in $CPPFLAGS,
6724 +    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
6725 +    dnl   4. if it doesn't exist as a directory.
6726 +    if test "X$additional_includedir" != "X/usr/include"; then
6727 +      haveit=
6728 +      for x in $CPPFLAGS; do
6729 +        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6730 +        if test "X$x" = "X-I$additional_includedir"; then
6731 +          haveit=yes
6732 +          break
6733 +        fi
6734 +      done
6735 +      if test -z "$haveit"; then
6736 +        if test "X$additional_includedir" = "X/usr/local/include"; then
6737 +          if test -n "$GCC"; then
6738 +            case $host_os in
6739 +              linux*) haveit=yes;;
6740 +            esac
6741 +          fi
6742 +        fi
6743 +        if test -z "$haveit"; then
6744 +          if test -d "$additional_includedir"; then
6745 +            dnl Really add $additional_includedir to $CPPFLAGS.
6746 +            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
6747 +          fi
6748 +        fi
6749 +      fi
6750 +    fi
6751 +    dnl Potentially add $additional_libdir to $LDFLAGS.
6752 +    dnl But don't add it
6753 +    dnl   1. if it's the standard /usr/lib,
6754 +    dnl   2. if it's already present in $LDFLAGS,
6755 +    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
6756 +    dnl   4. if it doesn't exist as a directory.
6757 +    if test "X$additional_libdir" != "X/usr/lib"; then
6758 +      haveit=
6759 +      for x in $LDFLAGS; do
6760 +        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
6761 +        if test "X$x" = "X-L$additional_libdir"; then
6762 +          haveit=yes
6763 +          break
6764 +        fi
6765 +      done
6766 +      if test -z "$haveit"; then
6767 +        if test "X$additional_libdir" = "X/usr/local/lib"; then
6768 +          if test -n "$GCC"; then
6769 +            case $host_os in
6770 +              linux*) haveit=yes;;
6771 +            esac
6772 +          fi
6773 +        fi
6774 +        if test -z "$haveit"; then
6775 +          if test -d "$additional_libdir"; then
6776 +            dnl Really add $additional_libdir to $LDFLAGS.
6777 +            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
6778 +          fi
6779 +        fi
6780 +      fi
6781 +    fi
6782 +  fi
6783 +])
6784 +
6785 +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
6786 +dnl acl_final_exec_prefix, containing the values to which $prefix and
6787 +dnl $exec_prefix will expand at the end of the configure script.
6788 +AC_DEFUN([AC_LIB_PREPARE_PREFIX],
6789 +[
6790 +  dnl Unfortunately, prefix and exec_prefix get only finally determined
6791 +  dnl at the end of configure.
6792 +  if test "X$prefix" = "XNONE"; then
6793 +    acl_final_prefix="$ac_default_prefix"
6794 +  else
6795 +    acl_final_prefix="$prefix"
6796 +  fi
6797 +  if test "X$exec_prefix" = "XNONE"; then
6798 +    acl_final_exec_prefix='${prefix}'
6799 +  else
6800 +    acl_final_exec_prefix="$exec_prefix"
6801 +  fi
6802 +  acl_save_prefix="$prefix"
6803 +  prefix="$acl_final_prefix"
6804 +  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
6805 +  prefix="$acl_save_prefix"
6806 +])
6807 +
6808 +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
6809 +dnl variables prefix and exec_prefix bound to the values they will have
6810 +dnl at the end of the configure script.
6811 +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
6812 +[
6813 +  acl_save_prefix="$prefix"
6814 +  prefix="$acl_final_prefix"
6815 +  acl_save_exec_prefix="$exec_prefix"
6816 +  exec_prefix="$acl_final_exec_prefix"
6817 +  $1
6818 +  exec_prefix="$acl_save_exec_prefix"
6819 +  prefix="$acl_save_prefix"
6820 +])
6821 Index: dialog-1.0-20050306/m4/progtest.m4
6822 ===================================================================
6823 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6824 +++ dialog-1.0-20050306/m4/progtest.m4  2005-05-16 01:32:07.000000000 +0200
6825 @@ -0,0 +1,59 @@
6826 +# progtest.m4 serial 2 (gettext-0.10.40)
6827 +dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
6828 +dnl This file is free software, distributed under the terms of the GNU
6829 +dnl General Public License.  As a special exception to the GNU General
6830 +dnl Public License, this file may be distributed as part of a program
6831 +dnl that contains a configuration script generated by Autoconf, under
6832 +dnl the same distribution terms as the rest of that program.
6833 +dnl
6834 +dnl This file can can be used in projects which are not available under
6835 +dnl the GNU General Public License or the GNU Library General Public
6836 +dnl License but which still want to provide support for the GNU gettext
6837 +dnl functionality.
6838 +dnl Please note that the actual code of the GNU gettext library is covered
6839 +dnl by the GNU Library General Public License, and the rest of the GNU
6840 +dnl gettext package package is covered by the GNU General Public License.
6841 +dnl They are *not* in the public domain.
6842 +
6843 +dnl Authors:
6844 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
6845 +
6846 +# Search path for a program which passes the given test.
6847 +
6848 +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
6849 +dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
6850 +AC_DEFUN([AM_PATH_PROG_WITH_TEST],
6851 +[# Extract the first word of "$2", so it can be a program name with args.
6852 +set dummy $2; ac_word=[$]2
6853 +AC_MSG_CHECKING([for $ac_word])
6854 +AC_CACHE_VAL(ac_cv_path_$1,
6855 +[case "[$]$1" in
6856 +  /*)
6857 +  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
6858 +  ;;
6859 +  *)
6860 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6861 +  for ac_dir in ifelse([$5], , $PATH, [$5]); do
6862 +    test -z "$ac_dir" && ac_dir=.
6863 +    if test -f $ac_dir/$ac_word; then
6864 +      if [$3]; then
6865 +       ac_cv_path_$1="$ac_dir/$ac_word"
6866 +       break
6867 +      fi
6868 +    fi
6869 +  done
6870 +  IFS="$ac_save_ifs"
6871 +dnl If no 4th arg is given, leave the cache variable unset,
6872 +dnl so AC_PATH_PROGS will keep looking.
6873 +ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
6874 +])dnl
6875 +  ;;
6876 +esac])dnl
6877 +$1="$ac_cv_path_$1"
6878 +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
6879 +  AC_MSG_RESULT([$]$1)
6880 +else
6881 +  AC_MSG_RESULT(no)
6882 +fi
6883 +AC_SUBST($1)dnl
6884 +])
6885 Index: dialog-1.0-20050306/m4/stdint_h.m4
6886 ===================================================================
6887 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6888 +++ dialog-1.0-20050306/m4/stdint_h.m4  2005-05-16 01:32:07.000000000 +0200
6889 @@ -0,0 +1,28 @@
6890 +# stdint_h.m4 serial 2 (gettext-0.11.4)
6891 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
6892 +dnl This file is free software, distributed under the terms of the GNU
6893 +dnl General Public License.  As a special exception to the GNU General
6894 +dnl Public License, this file may be distributed as part of a program
6895 +dnl that contains a configuration script generated by Autoconf, under
6896 +dnl the same distribution terms as the rest of that program.
6897 +
6898 +dnl From Paul Eggert.
6899 +
6900 +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
6901 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
6902 +
6903 +AC_DEFUN([jm_AC_HEADER_STDINT_H],
6904 +[
6905 +  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
6906 +  [AC_TRY_COMPILE(
6907 +    [#include <sys/types.h>
6908 +#include <stdint.h>],
6909 +    [uintmax_t i = (uintmax_t) -1;],
6910 +    jm_ac_cv_header_stdint_h=yes,
6911 +    jm_ac_cv_header_stdint_h=no)])
6912 +  if test $jm_ac_cv_header_stdint_h = yes; then
6913 +    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
6914 +[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
6915 +   and declares uintmax_t. ])
6916 +  fi
6917 +])
6918 Index: dialog-1.0-20050306/m4/uintmax_t.m4
6919 ===================================================================
6920 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6921 +++ dialog-1.0-20050306/m4/uintmax_t.m4 2005-05-16 01:32:07.000000000 +0200
6922 @@ -0,0 +1,29 @@
6923 +# uintmax_t.m4 serial 6 (gettext-0.11)
6924 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
6925 +dnl This file is free software, distributed under the terms of the GNU
6926 +dnl General Public License.  As a special exception to the GNU General
6927 +dnl Public License, this file may be distributed as part of a program
6928 +dnl that contains a configuration script generated by Autoconf, under
6929 +dnl the same distribution terms as the rest of that program.
6930 +
6931 +dnl From Paul Eggert.
6932 +
6933 +AC_PREREQ(2.13)
6934 +
6935 +# Define uintmax_t to `unsigned long' or `unsigned long long'
6936 +# if <inttypes.h> does not exist.
6937 +
6938 +AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
6939 +[
6940 +  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
6941 +  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
6942 +  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
6943 +    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
6944 +    test $ac_cv_type_unsigned_long_long = yes \
6945 +      && ac_type='unsigned long long' \
6946 +      || ac_type='unsigned long'
6947 +    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
6948 +  [Define to unsigned long or unsigned long long
6949 +   if <inttypes.h> and <stdint.h> don't define.])
6950 +  fi
6951 +])
6952 Index: dialog-1.0-20050306/m4/ulonglong.m4
6953 ===================================================================
6954 --- /dev/null   1970-01-01 00:00:00.000000000 +0000
6955 +++ dialog-1.0-20050306/m4/ulonglong.m4 2005-05-16 01:32:07.000000000 +0200
6956 @@ -0,0 +1,23 @@
6957 +# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
6958 +dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
6959 +dnl This file is free software, distributed under the terms of the GNU
6960 +dnl General Public License.  As a special exception to the GNU General
6961 +dnl Public License, this file may be distributed as part of a program
6962 +dnl that contains a configuration script generated by Autoconf, under
6963 +dnl the same distribution terms as the rest of that program.
6964 +
6965 +dnl From Paul Eggert.
6966 +
6967 +AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
6968 +[
6969 +  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
6970 +  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
6971 +    [unsigned long long ullmax = (unsigned long long) -1;
6972 +     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
6973 +    ac_cv_type_unsigned_long_long=yes,
6974 +    ac_cv_type_unsigned_long_long=no)])
6975 +  if test $ac_cv_type_unsigned_long_long = yes; then
6976 +    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
6977 +      [Define if you have the unsigned long long type.])
6978 +  fi
6979 +])