]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/tin/tin-1.7.3/m4.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / tin / tin-1.7.3 / m4.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
6 --- /dev/null
7 +++ tin-1.7.3/m4/codeset.m4
8 @@ -0,0 +1,23 @@
9 +# codeset.m4 serial AM1 (gettext-0.10.40)
10 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
11 +dnl This file is free software, distributed under the terms of the GNU
12 +dnl General Public License.  As a special exception to the GNU General
13 +dnl Public License, this file may be distributed as part of a program
14 +dnl that contains a configuration script generated by Autoconf, under
15 +dnl the same distribution terms as the rest of that program.
16 +
17 +dnl From Bruno Haible.
18 +
19 +AC_DEFUN([AM_LANGINFO_CODESET],
20 +[
21 +  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
22 +    [AC_TRY_LINK([#include <langinfo.h>],
23 +      [char* cs = nl_langinfo(CODESET);],
24 +      am_cv_langinfo_codeset=yes,
25 +      am_cv_langinfo_codeset=no)
26 +    ])
27 +  if test $am_cv_langinfo_codeset = yes; then
28 +    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
29 +      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
30 +  fi
31 +])
32 --- /dev/null
33 +++ tin-1.7.3/m4/gettext.m4
34 @@ -0,0 +1,587 @@
35 +# gettext.m4 serial 17 (gettext-0.11.5)
36 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
37 +dnl This file is free software, distributed under the terms of the GNU
38 +dnl General Public License.  As a special exception to the GNU General
39 +dnl Public License, this file may be distributed as part of a program
40 +dnl that contains a configuration script generated by Autoconf, under
41 +dnl the same distribution terms as the rest of that program.
42 +dnl
43 +dnl This file can can be used in projects which are not available under
44 +dnl the GNU General Public License or the GNU Library General Public
45 +dnl License but which still want to provide support for the GNU gettext
46 +dnl functionality.
47 +dnl Please note that the actual code of the GNU gettext library is covered
48 +dnl by the GNU Library General Public License, and the rest of the GNU
49 +dnl gettext package package is covered by the GNU General Public License.
50 +dnl They are *not* in the public domain.
51 +
52 +dnl Authors:
53 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
54 +dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
55 +
56 +dnl Macro to add for using GNU gettext.
57 +
58 +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
59 +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
60 +dnl    default (if it is not specified or empty) is 'no-libtool'.
61 +dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
62 +dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
63 +dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
64 +dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
65 +dnl    depending on --{enable,disable}-{shared,static} and on the presence of
66 +dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
67 +dnl    $(top_builddir)/intl/libintl.a will be created.
68 +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
69 +dnl    implementations (in libc or libintl) without the ngettext() function
70 +dnl    will be ignored.  If NEEDSYMBOL is specified and is
71 +dnl    'need-formatstring-macros', then GNU gettext implementations that don't
72 +dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
73 +dnl INTLDIR is used to find the intl libraries.  If empty,
74 +dnl    the value `$(top_builddir)/intl/' is used.
75 +dnl
76 +dnl The result of the configuration is one of three cases:
77 +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
78 +dnl    and used.
79 +dnl    Catalog format: GNU --> install in $(datadir)
80 +dnl    Catalog extension: .mo after installation, .gmo in source tree
81 +dnl 2) GNU gettext has been found in the system's C library.
82 +dnl    Catalog format: GNU --> install in $(datadir)
83 +dnl    Catalog extension: .mo after installation, .gmo in source tree
84 +dnl 3) No internationalization, always use English msgid.
85 +dnl    Catalog format: none
86 +dnl    Catalog extension: none
87 +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
88 +dnl The use of .gmo is historical (it was needed to avoid overwriting the
89 +dnl GNU format catalogs when building on a platform with an X/Open gettext),
90 +dnl but we keep it in order not to force irrelevant filename changes on the
91 +dnl maintainers.
92 +dnl
93 +AC_DEFUN([AM_GNU_GETTEXT],
94 +[
95 +  dnl Argument checking.
96 +  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
97 +    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
98 +])])])])])
99 +  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
100 +    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
101 +])])])])
102 +  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
103 +  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
104 +
105 +  AC_REQUIRE([AM_PO_SUBDIRS])dnl
106 +  ifelse(gt_included_intl, yes, [
107 +    AC_REQUIRE([AM_INTL_SUBDIR])dnl
108 +  ])
109 +
110 +  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
111 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
112 +  AC_REQUIRE([AC_LIB_RPATH])
113 +
114 +  dnl Sometimes libintl requires libiconv, so first search for libiconv.
115 +  dnl Ideally we would do this search only after the
116 +  dnl      if test "$USE_NLS" = "yes"; then
117 +  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
118 +  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
119 +  dnl the configure script would need to contain the same shell code
120 +  dnl again, outside any 'if'. There are two solutions:
121 +  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
122 +  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
123 +  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
124 +  dnl documented, we avoid it.
125 +  ifelse(gt_included_intl, yes, , [
126 +    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
127 +  ])
128 +
129 +  AC_MSG_CHECKING([whether NLS is requested])
130 +  dnl Default is enabled NLS
131 +  AC_ARG_ENABLE(nls,
132 +    [  --disable-nls           do not use Native Language Support],
133 +    USE_NLS=$enableval, USE_NLS=yes)
134 +  AC_MSG_RESULT($USE_NLS)
135 +  AC_SUBST(USE_NLS)
136 +
137 +  ifelse(gt_included_intl, yes, [
138 +    BUILD_INCLUDED_LIBINTL=no
139 +    USE_INCLUDED_LIBINTL=no
140 +  ])
141 +  LIBINTL=
142 +  LTLIBINTL=
143 +  POSUB=
144 +
145 +  dnl If we use NLS figure out what method
146 +  if test "$USE_NLS" = "yes"; then
147 +    gt_use_preinstalled_gnugettext=no
148 +    ifelse(gt_included_intl, yes, [
149 +      AC_MSG_CHECKING([whether included gettext is requested])
150 +      AC_ARG_WITH(included-gettext,
151 +        [  --with-included-gettext use the GNU gettext library included here],
152 +        nls_cv_force_use_gnu_gettext=$withval,
153 +        nls_cv_force_use_gnu_gettext=no)
154 +      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
155 +
156 +      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
157 +      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
158 +    ])
159 +        dnl User does not insist on using GNU NLS library.  Figure out what
160 +        dnl to use.  If GNU gettext is available we use this.  Else we have
161 +        dnl to fall back to GNU NLS library.
162 +
163 +        dnl Add a version number to the cache macros.
164 +        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
165 +        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
166 +        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
167 +
168 +        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
169 +         [AC_TRY_LINK([#include <libintl.h>
170 +]ifelse([$2], [need-formatstring-macros],
171 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
172 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
173 +#endif
174 +changequote(,)dnl
175 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
176 +changequote([,])dnl
177 +], [])[extern int _nl_msg_cat_cntr;
178 +extern int *_nl_domain_bindings;],
179 +            [bindtextdomain ("", "");
180 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
181 +            gt_cv_func_gnugettext_libc=yes,
182 +            gt_cv_func_gnugettext_libc=no)])
183 +
184 +        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
185 +          dnl Sometimes libintl requires libiconv, so first search for libiconv.
186 +          ifelse(gt_included_intl, yes, , [
187 +            AM_ICONV_LINK
188 +          ])
189 +          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
190 +          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
191 +          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
192 +          dnl even if libiconv doesn't exist.
193 +          AC_LIB_LINKFLAGS_BODY([intl])
194 +          AC_CACHE_CHECK([for GNU gettext in libintl],
195 +            gt_cv_func_gnugettext_libintl,
196 +           [gt_save_CPPFLAGS="$CPPFLAGS"
197 +            CPPFLAGS="$CPPFLAGS $INCINTL"
198 +            gt_save_LIBS="$LIBS"
199 +            LIBS="$LIBS $LIBINTL"
200 +            dnl Now see whether libintl exists and does not depend on libiconv.
201 +            AC_TRY_LINK([#include <libintl.h>
202 +]ifelse([$2], [need-formatstring-macros],
203 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
204 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
205 +#endif
206 +changequote(,)dnl
207 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
208 +changequote([,])dnl
209 +], [])[extern int _nl_msg_cat_cntr;
210 +extern
211 +#ifdef __cplusplus
212 +"C"
213 +#endif
214 +const char *_nl_expand_alias ();],
215 +              [bindtextdomain ("", "");
216 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
217 +              gt_cv_func_gnugettext_libintl=yes,
218 +              gt_cv_func_gnugettext_libintl=no)
219 +            dnl Now see whether libintl exists and depends on libiconv.
220 +            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
221 +              LIBS="$LIBS $LIBICONV"
222 +              AC_TRY_LINK([#include <libintl.h>
223 +]ifelse([$2], [need-formatstring-macros],
224 +[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
225 +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
226 +#endif
227 +changequote(,)dnl
228 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
229 +changequote([,])dnl
230 +], [])[extern int _nl_msg_cat_cntr;
231 +extern
232 +#ifdef __cplusplus
233 +"C"
234 +#endif
235 +const char *_nl_expand_alias ();],
236 +                [bindtextdomain ("", "");
237 +return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
238 +               [LIBINTL="$LIBINTL $LIBICONV"
239 +                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
240 +                gt_cv_func_gnugettext_libintl=yes
241 +               ])
242 +            fi
243 +            CPPFLAGS="$gt_save_CPPFLAGS"
244 +            LIBS="$gt_save_LIBS"])
245 +        fi
246 +
247 +        dnl If an already present or preinstalled GNU gettext() is found,
248 +        dnl use it.  But if this macro is used in GNU gettext, and GNU
249 +        dnl gettext is already preinstalled in libintl, we update this
250 +        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
251 +        if test "$gt_cv_func_gnugettext_libc" = "yes" \
252 +           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
253 +                && test "$PACKAGE" != gettext; }; then
254 +          gt_use_preinstalled_gnugettext=yes
255 +        else
256 +          dnl Reset the values set by searching for libintl.
257 +          LIBINTL=
258 +          LTLIBINTL=
259 +          INCINTL=
260 +        fi
261 +
262 +    ifelse(gt_included_intl, yes, [
263 +        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
264 +          dnl GNU gettext is not found in the C library.
265 +          dnl Fall back on included GNU gettext library.
266 +          nls_cv_use_gnu_gettext=yes
267 +        fi
268 +      fi
269 +
270 +      if test "$nls_cv_use_gnu_gettext" = "yes"; then
271 +        dnl Mark actions used to generate GNU NLS library.
272 +        INTLOBJS="\$(GETTOBJS)"
273 +        BUILD_INCLUDED_LIBINTL=yes
274 +        USE_INCLUDED_LIBINTL=yes
275 +        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
276 +        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
277 +        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
278 +      fi
279 +
280 +      if test "$gt_use_preinstalled_gnugettext" = "yes" \
281 +         || test "$nls_cv_use_gnu_gettext" = "yes"; then
282 +        dnl Mark actions to use GNU gettext tools.
283 +        CATOBJEXT=.gmo
284 +      fi
285 +    ])
286 +
287 +    if test "$gt_use_preinstalled_gnugettext" = "yes" \
288 +       || test "$nls_cv_use_gnu_gettext" = "yes"; then
289 +      AC_DEFINE(ENABLE_NLS, 1,
290 +        [Define to 1 if translation of program messages to the user's native language
291 +   is requested.])
292 +    else
293 +      USE_NLS=no
294 +    fi
295 +  fi
296 +
297 +  if test "$USE_NLS" = "yes"; then
298 +
299 +    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
300 +      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
301 +        AC_MSG_CHECKING([how to link with libintl])
302 +        AC_MSG_RESULT([$LIBINTL])
303 +        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
304 +      fi
305 +
306 +      dnl For backward compatibility. Some packages may be using this.
307 +      AC_DEFINE(HAVE_GETTEXT, 1,
308 +       [Define if the GNU gettext() function is already present or preinstalled.])
309 +      AC_DEFINE(HAVE_DCGETTEXT, 1,
310 +       [Define if the GNU dcgettext() function is already present or preinstalled.])
311 +    fi
312 +
313 +    dnl We need to process the po/ directory.
314 +    POSUB=po
315 +  fi
316 +
317 +  ifelse(gt_included_intl, yes, [
318 +    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
319 +    dnl to 'yes' because some of the testsuite requires it.
320 +    if test "$PACKAGE" = gettext; then
321 +      BUILD_INCLUDED_LIBINTL=yes
322 +    fi
323 +
324 +    dnl Make all variables we use known to autoconf.
325 +    AC_SUBST(BUILD_INCLUDED_LIBINTL)
326 +    AC_SUBST(USE_INCLUDED_LIBINTL)
327 +    AC_SUBST(CATOBJEXT)
328 +    AC_SUBST(INTLOBJS)
329 +
330 +    dnl For backward compatibility. Some configure.ins may be using this.
331 +    nls_cv_header_intl=
332 +    nls_cv_header_libgt=
333 +
334 +    dnl For backward compatibility. Some Makefiles may be using this.
335 +    DATADIRNAME=share
336 +    AC_SUBST(DATADIRNAME)
337 +
338 +    dnl For backward compatibility. Some Makefiles may be using this.
339 +    INSTOBJEXT=.mo
340 +    AC_SUBST(INSTOBJEXT)
341 +
342 +    dnl For backward compatibility. Some Makefiles may be using this.
343 +    GENCAT=gencat
344 +    AC_SUBST(GENCAT)
345 +
346 +    dnl Enable libtool support if the surrounding package wishes it.
347 +    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
348 +    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
349 +  ])
350 +
351 +  dnl For backward compatibility. Some Makefiles may be using this.
352 +  INTLLIBS="$LIBINTL"
353 +  AC_SUBST(INTLLIBS)
354 +
355 +  dnl Make all documented variables known to autoconf.
356 +  AC_SUBST(LIBINTL)
357 +  AC_SUBST(LTLIBINTL)
358 +  AC_SUBST(POSUB)
359 +])
360 +
361 +
362 +dnl Checks for all prerequisites of the po subdirectory,
363 +dnl except for USE_NLS.
364 +AC_DEFUN([AM_PO_SUBDIRS],
365 +[
366 +  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
367 +  AC_REQUIRE([AC_PROG_INSTALL])dnl
368 +  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
369 +
370 +  dnl Perform the following tests also if --disable-nls has been given,
371 +  dnl because they are needed for "make dist" to work.
372 +
373 +  dnl Search for GNU msgfmt in the PATH.
374 +  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
375 +  dnl The second test excludes FreeBSD msgfmt.
376 +  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
377 +    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
378 +     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
379 +    :)
380 +  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
381 +
382 +  dnl Search for GNU xgettext 0.11 or newer in the PATH.
383 +  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
384 +  dnl The second test excludes FreeBSD xgettext.
385 +  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
386 +    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
387 +     (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)],
388 +    :)
389 +  dnl Remove leftover from FreeBSD xgettext call.
390 +  rm -f messages.po
391 +
392 +  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
393 +  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
394 +    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
395 +
396 +  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
397 +  dnl Test whether we really found GNU msgfmt.
398 +  if test "$GMSGFMT" != ":"; then
399 +    dnl If it is no GNU msgfmt we define it as : so that the
400 +    dnl Makefiles still can work.
401 +    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
402 +       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
403 +      : ;
404 +    else
405 +      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
406 +      AC_MSG_RESULT(
407 +        [found $GMSGFMT program is not GNU msgfmt; ignore it])
408 +      GMSGFMT=":"
409 +    fi
410 +  fi
411 +
412 +  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
413 +  dnl Test whether we really found GNU xgettext.
414 +  if test "$XGETTEXT" != ":"; then
415 +    dnl If it is no GNU xgettext we define it as : so that the
416 +    dnl Makefiles still can work.
417 +    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
418 +       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
419 +      : ;
420 +    else
421 +      AC_MSG_RESULT(
422 +        [found xgettext program is not GNU xgettext; ignore it])
423 +      XGETTEXT=":"
424 +    fi
425 +    dnl Remove leftover from FreeBSD xgettext call.
426 +    rm -f messages.po
427 +  fi
428 +
429 +  AC_OUTPUT_COMMANDS([
430 +    for ac_file in $CONFIG_FILES; do
431 +      # Support "outfile[:infile[:infile...]]"
432 +      case "$ac_file" in
433 +        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
434 +      esac
435 +      # PO directories have a Makefile.in generated from Makefile.in.in.
436 +      case "$ac_file" in */Makefile.in)
437 +        # Adjust a relative srcdir.
438 +        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
439 +        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
440 +        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
441 +        # In autoconf-2.13 it is called $ac_given_srcdir.
442 +        # In autoconf-2.50 it is called $srcdir.
443 +        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
444 +        case "$ac_given_srcdir" in
445 +          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
446 +          /*) top_srcdir="$ac_given_srcdir" ;;
447 +          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
448 +        esac
449 +        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
450 +          rm -f "$ac_dir/POTFILES"
451 +          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
452 +          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
453 +          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
454 +          # on $ac_dir but don't depend on user-specified configuration
455 +          # parameters.
456 +          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
457 +            # The LINGUAS file contains the set of available languages.
458 +            if test -n "$ALL_LINGUAS"; then
459 +              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
460 +            fi
461 +            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
462 +            # Hide the ALL_LINGUAS assigment from automake.
463 +            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
464 +          fi
465 +          case "$ac_given_srcdir" in
466 +            .) srcdirpre= ;;
467 +            *) srcdirpre='$(srcdir)/' ;;
468 +          esac
469 +          POFILES=
470 +          GMOFILES=
471 +          UPDATEPOFILES=
472 +          DUMMYPOFILES=
473 +          for lang in $ALL_LINGUAS; do
474 +            POFILES="$POFILES $srcdirpre$lang.po"
475 +            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
476 +            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
477 +            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
478 +          done
479 +          # CATALOGS depends on both $ac_dir and the user's LINGUAS
480 +          # environment variable.
481 +          INST_LINGUAS=
482 +          if test -n "$ALL_LINGUAS"; then
483 +            for presentlang in $ALL_LINGUAS; do
484 +              useit=no
485 +              if test "%UNSET%" != "$LINGUAS"; then
486 +                desiredlanguages="$LINGUAS"
487 +              else
488 +                desiredlanguages="$ALL_LINGUAS"
489 +              fi
490 +              for desiredlang in $desiredlanguages; do
491 +                # Use the presentlang catalog if desiredlang is
492 +                #   a. equal to presentlang, or
493 +                #   b. a variant of presentlang (because in this case,
494 +                #      presentlang can be used as a fallback for messages
495 +                #      which are not translated in the desiredlang catalog).
496 +                case "$desiredlang" in
497 +                  "$presentlang"*) useit=yes;;
498 +                esac
499 +              done
500 +              if test $useit = yes; then
501 +                INST_LINGUAS="$INST_LINGUAS $presentlang"
502 +              fi
503 +            done
504 +          fi
505 +          CATALOGS=
506 +          if test -n "$INST_LINGUAS"; then
507 +            for lang in $INST_LINGUAS; do
508 +              CATALOGS="$CATALOGS $lang.gmo"
509 +            done
510 +          fi
511 +          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
512 +          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"
513 +          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
514 +            if test -f "$f"; then
515 +              case "$f" in
516 +                *.orig | *.bak | *~) ;;
517 +                *) cat "$f" >> "$ac_dir/Makefile" ;;
518 +              esac
519 +            fi
520 +          done
521 +        fi
522 +        ;;
523 +      esac
524 +    done],
525 +   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
526 +    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
527 +    # from automake.
528 +    eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
529 +    # Capture the value of LINGUAS because we need it to compute CATALOGS.
530 +    LINGUAS="${LINGUAS-%UNSET%}"
531 +   ])
532 +])
533 +
534 +
535 +dnl Checks for all prerequisites of the intl subdirectory,
536 +dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
537 +dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
538 +AC_DEFUN([AM_INTL_SUBDIR],
539 +[
540 +  AC_REQUIRE([AC_PROG_INSTALL])dnl
541 +  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
542 +  AC_REQUIRE([AC_PROG_CC])dnl
543 +  AC_REQUIRE([AC_CANONICAL_HOST])dnl
544 +  AC_REQUIRE([AC_PROG_RANLIB])dnl
545 +  AC_REQUIRE([AC_ISC_POSIX])dnl
546 +  AC_REQUIRE([AC_HEADER_STDC])dnl
547 +  AC_REQUIRE([AC_C_CONST])dnl
548 +  AC_REQUIRE([AC_C_INLINE])dnl
549 +  AC_REQUIRE([AC_TYPE_OFF_T])dnl
550 +  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
551 +  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
552 +  AC_REQUIRE([AC_FUNC_MMAP])dnl
553 +  AC_REQUIRE([jm_GLIBC21])dnl
554 +  AC_REQUIRE([gt_INTDIV0])dnl
555 +  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
556 +  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
557 +  AC_REQUIRE([gt_INTTYPES_PRI])dnl
558 +
559 +  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
560 +stdlib.h string.h unistd.h sys/param.h])
561 +  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
562 +geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
563 +strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
564 +
565 +  AM_ICONV
566 +  AM_LANGINFO_CODESET
567 +  if test $ac_cv_header_locale_h = yes; then
568 +    AM_LC_MESSAGES
569 +  fi
570 +
571 +  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
572 +  dnl because plural.y uses bison specific features. It requires at least
573 +  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
574 +  dnl compile.
575 +  dnl bison is only needed for the maintainer (who touches plural.y). But in
576 +  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
577 +  dnl the rule in general Makefile. Now, some people carelessly touch the
578 +  dnl files or have a broken "make" program, hence the plural.c rule will
579 +  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
580 +  dnl present or too old.
581 +  AC_CHECK_PROGS([INTLBISON], [bison])
582 +  if test -z "$INTLBISON"; then
583 +    ac_verc_fail=yes
584 +  else
585 +    dnl Found it, now check the version.
586 +    AC_MSG_CHECKING([version of bison])
587 +changequote(<<,>>)dnl
588 +    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
589 +    case $ac_prog_version in
590 +      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
591 +      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
592 +changequote([,])dnl
593 +         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
594 +      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
595 +    esac
596 +    AC_MSG_RESULT([$ac_prog_version])
597 +  fi
598 +  if test $ac_verc_fail = yes; then
599 +    INTLBISON=:
600 +  fi
601 +])
602 +
603 +
604 +AC_DEFUN([AM_MKINSTALLDIRS],
605 +[
606 +  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
607 +  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
608 +  dnl Try to locate is.
609 +  MKINSTALLDIRS=
610 +  if test -n "$ac_aux_dir"; then
611 +    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
612 +  fi
613 +  if test -z "$MKINSTALLDIRS"; then
614 +    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
615 +  fi
616 +  AC_SUBST(MKINSTALLDIRS)
617 +])
618 +
619 +
620 +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
621 +AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
622 --- /dev/null
623 +++ tin-1.7.3/m4/glibc21.m4
624 @@ -0,0 +1,32 @@
625 +# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
626 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
627 +dnl This file is free software, distributed under the terms of the GNU
628 +dnl General Public License.  As a special exception to the GNU General
629 +dnl Public License, this file may be distributed as part of a program
630 +dnl that contains a configuration script generated by Autoconf, under
631 +dnl the same distribution terms as the rest of that program.
632 +
633 +# Test for the GNU C Library, version 2.1 or newer.
634 +# From Bruno Haible.
635 +
636 +AC_DEFUN([jm_GLIBC21],
637 +  [
638 +    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
639 +      ac_cv_gnu_library_2_1,
640 +      [AC_EGREP_CPP([Lucky GNU user],
641 +       [
642 +#include <features.h>
643 +#ifdef __GNU_LIBRARY__
644 + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
645 +  Lucky GNU user
646 + #endif
647 +#endif
648 +       ],
649 +       ac_cv_gnu_library_2_1=yes,
650 +       ac_cv_gnu_library_2_1=no)
651 +      ]
652 +    )
653 +    AC_SUBST(GLIBC21)
654 +    GLIBC21="$ac_cv_gnu_library_2_1"
655 +  ]
656 +)
657 --- /dev/null
658 +++ tin-1.7.3/m4/iconv.m4
659 @@ -0,0 +1,103 @@
660 +# iconv.m4 serial AM4 (gettext-0.11.3)
661 +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
662 +dnl This file is free software, distributed under the terms of the GNU
663 +dnl General Public License.  As a special exception to the GNU General
664 +dnl Public License, this file may be distributed as part of a program
665 +dnl that contains a configuration script generated by Autoconf, under
666 +dnl the same distribution terms as the rest of that program.
667 +
668 +dnl From Bruno Haible.
669 +
670 +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
671 +[
672 +  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
673 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
674 +  AC_REQUIRE([AC_LIB_RPATH])
675 +
676 +  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
677 +  dnl accordingly.
678 +  AC_LIB_LINKFLAGS_BODY([iconv])
679 +])
680 +
681 +AC_DEFUN([AM_ICONV_LINK],
682 +[
683 +  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
684 +  dnl those with the standalone portable GNU libiconv installed).
685 +
686 +  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
687 +  dnl accordingly.
688 +  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
689 +
690 +  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
691 +  dnl because if the user has installed libiconv and not disabled its use
692 +  dnl via --without-libiconv-prefix, he wants to use it. The first
693 +  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
694 +  am_save_CPPFLAGS="$CPPFLAGS"
695 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
696 +
697 +  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
698 +    am_cv_func_iconv="no, consider installing GNU libiconv"
699 +    am_cv_lib_iconv=no
700 +    AC_TRY_LINK([#include <stdlib.h>
701 +#include <iconv.h>],
702 +      [iconv_t cd = iconv_open("","");
703 +       iconv(cd,NULL,NULL,NULL,NULL);
704 +       iconv_close(cd);],
705 +      am_cv_func_iconv=yes)
706 +    if test "$am_cv_func_iconv" != yes; then
707 +      am_save_LIBS="$LIBS"
708 +      LIBS="$LIBS $LIBICONV"
709 +      AC_TRY_LINK([#include <stdlib.h>
710 +#include <iconv.h>],
711 +        [iconv_t cd = iconv_open("","");
712 +         iconv(cd,NULL,NULL,NULL,NULL);
713 +         iconv_close(cd);],
714 +        am_cv_lib_iconv=yes
715 +        am_cv_func_iconv=yes)
716 +      LIBS="$am_save_LIBS"
717 +    fi
718 +  ])
719 +  if test "$am_cv_func_iconv" = yes; then
720 +    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
721 +  fi
722 +  if test "$am_cv_lib_iconv" = yes; then
723 +    AC_MSG_CHECKING([how to link with libiconv])
724 +    AC_MSG_RESULT([$LIBICONV])
725 +  else
726 +    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
727 +    dnl either.
728 +    CPPFLAGS="$am_save_CPPFLAGS"
729 +    LIBICONV=
730 +    LTLIBICONV=
731 +  fi
732 +  AC_SUBST(LIBICONV)
733 +  AC_SUBST(LTLIBICONV)
734 +])
735 +
736 +AC_DEFUN([AM_ICONV],
737 +[
738 +  AM_ICONV_LINK
739 +  if test "$am_cv_func_iconv" = yes; then
740 +    AC_MSG_CHECKING([for iconv declaration])
741 +    AC_CACHE_VAL(am_cv_proto_iconv, [
742 +      AC_TRY_COMPILE([
743 +#include <stdlib.h>
744 +#include <iconv.h>
745 +extern
746 +#ifdef __cplusplus
747 +"C"
748 +#endif
749 +#if defined(__STDC__) || defined(__cplusplus)
750 +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
751 +#else
752 +size_t iconv();
753 +#endif
754 +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
755 +      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);"])
756 +    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
757 +    AC_MSG_RESULT([$]{ac_t:-
758 +         }[$]am_cv_proto_iconv)
759 +    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
760 +      [Define as const if the declaration of iconv() needs const.])
761 +  fi
762 +])
763 --- /dev/null
764 +++ tin-1.7.3/m4/intdiv0.m4
765 @@ -0,0 +1,72 @@
766 +# intdiv0.m4 serial 1 (gettext-0.11.3)
767 +dnl Copyright (C) 2002 Free Software Foundation, Inc.
768 +dnl This file is free software, distributed under the terms of the GNU
769 +dnl General Public License.  As a special exception to the GNU General
770 +dnl Public License, this file may be distributed as part of a program
771 +dnl that contains a configuration script generated by Autoconf, under
772 +dnl the same distribution terms as the rest of that program.
773 +
774 +dnl From Bruno Haible.
775 +
776 +AC_DEFUN([gt_INTDIV0],
777 +[
778 +  AC_REQUIRE([AC_PROG_CC])dnl
779 +  AC_REQUIRE([AC_CANONICAL_HOST])dnl
780 +
781 +  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
782 +    gt_cv_int_divbyzero_sigfpe,
783 +    [
784 +      AC_TRY_RUN([
785 +#include <stdlib.h>
786 +#include <signal.h>
787 +
788 +static void
789 +#ifdef __cplusplus
790 +sigfpe_handler (int sig)
791 +#else
792 +sigfpe_handler (sig) int sig;
793 +#endif
794 +{
795 +  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
796 +  exit (sig != SIGFPE);
797 +}
798 +
799 +int x = 1;
800 +int y = 0;
801 +int z;
802 +int nan;
803 +
804 +int main ()
805 +{
806 +  signal (SIGFPE, sigfpe_handler);
807 +/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
808 +#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
809 +  signal (SIGTRAP, sigfpe_handler);
810 +#endif
811 +/* Linux/SPARC yields signal SIGILL.  */
812 +#if defined (__sparc__) && defined (__linux__)
813 +  signal (SIGILL, sigfpe_handler);
814 +#endif
815 +
816 +  z = x / y;
817 +  nan = y / y;
818 +  exit (1);
819 +}
820 +], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
821 +        [
822 +          # Guess based on the CPU.
823 +          case "$host_cpu" in
824 +            alpha* | i[34567]86 | m68k | s390*)
825 +              gt_cv_int_divbyzero_sigfpe="guessing yes";;
826 +            *)
827 +              gt_cv_int_divbyzero_sigfpe="guessing no";;
828 +          esac
829 +        ])
830 +    ])
831 +  case "$gt_cv_int_divbyzero_sigfpe" in
832 +    *yes) value=1;;
833 +    *) value=0;;
834 +  esac
835 +  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
836 +    [Define if integer division by zero raises signal SIGFPE.])
837 +])
838 --- /dev/null
839 +++ tin-1.7.3/m4/inttypes_h.m4
840 @@ -0,0 +1,28 @@
841 +# inttypes_h.m4 serial 4 (gettext-0.11.4)
842 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
843 +dnl This file is free software, distributed under the terms of the GNU
844 +dnl General Public License.  As a special exception to the GNU General
845 +dnl Public License, this file may be distributed as part of a program
846 +dnl that contains a configuration script generated by Autoconf, under
847 +dnl the same distribution terms as the rest of that program.
848 +
849 +dnl From Paul Eggert.
850 +
851 +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
852 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
853 +
854 +AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
855 +[
856 +  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
857 +  [AC_TRY_COMPILE(
858 +    [#include <sys/types.h>
859 +#include <inttypes.h>],
860 +    [uintmax_t i = (uintmax_t) -1;],
861 +    jm_ac_cv_header_inttypes_h=yes,
862 +    jm_ac_cv_header_inttypes_h=no)])
863 +  if test $jm_ac_cv_header_inttypes_h = yes; then
864 +    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
865 +[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
866 +   and declares uintmax_t. ])
867 +  fi
868 +])
869 --- /dev/null
870 +++ tin-1.7.3/m4/inttypes.m4
871 @@ -0,0 +1,27 @@
872 +# inttypes.m4 serial 1 (gettext-0.11.4)
873 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
874 +dnl This file is free software, distributed under the terms of the GNU
875 +dnl General Public License.  As a special exception to the GNU General
876 +dnl Public License, this file may be distributed as part of a program
877 +dnl that contains a configuration script generated by Autoconf, under
878 +dnl the same distribution terms as the rest of that program.
879 +
880 +dnl From Paul Eggert.
881 +
882 +# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
883 +# <sys/types.h>.
884 +
885 +AC_DEFUN([gt_HEADER_INTTYPES_H],
886 +[
887 +  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
888 +  [
889 +    AC_TRY_COMPILE(
890 +      [#include <sys/types.h>
891 +#include <inttypes.h>],
892 +      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
893 +  ])
894 +  if test $gt_cv_header_inttypes_h = yes; then
895 +    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
896 +      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
897 +  fi
898 +])
899 --- /dev/null
900 +++ tin-1.7.3/m4/inttypes-pri.m4
901 @@ -0,0 +1,32 @@
902 +# inttypes-pri.m4 serial 1 (gettext-0.11.4)
903 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
904 +dnl This file is free software, distributed under the terms of the GNU
905 +dnl General Public License.  As a special exception to the GNU General
906 +dnl Public License, this file may be distributed as part of a program
907 +dnl that contains a configuration script generated by Autoconf, under
908 +dnl the same distribution terms as the rest of that program.
909 +
910 +dnl From Bruno Haible.
911 +
912 +# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
913 +# macros to non-string values.  This is the case on AIX 4.3.3.
914 +
915 +AC_DEFUN([gt_INTTYPES_PRI],
916 +[
917 +  AC_REQUIRE([gt_HEADER_INTTYPES_H])
918 +  if test $gt_cv_header_inttypes_h = yes; then
919 +    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
920 +      gt_cv_inttypes_pri_broken,
921 +      [
922 +        AC_TRY_COMPILE([#include <inttypes.h>
923 +#ifdef PRId32
924 +char *p = PRId32;
925 +#endif
926 +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
927 +      ])
928 +  fi
929 +  if test "$gt_cv_inttypes_pri_broken" = yes; then
930 +    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
931 +      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
932 +  fi
933 +])
934 --- /dev/null
935 +++ tin-1.7.3/m4/isc-posix.m4
936 @@ -0,0 +1,26 @@
937 +# isc-posix.m4 serial 2 (gettext-0.11.2)
938 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
939 +dnl This file is free software, distributed under the terms of the GNU
940 +dnl General Public License.  As a special exception to the GNU General
941 +dnl Public License, this file may be distributed as part of a program
942 +dnl that contains a configuration script generated by Autoconf, under
943 +dnl the same distribution terms as the rest of that program.
944 +
945 +# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
946 +
947 +# This test replaces the one in autoconf.
948 +# Currently this macro should have the same name as the autoconf macro
949 +# because gettext's gettext.m4 (distributed in the automake package)
950 +# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
951 +# give these diagnostics:
952 +#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
953 +#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
954 +
955 +undefine([AC_ISC_POSIX])
956 +
957 +AC_DEFUN([AC_ISC_POSIX],
958 +  [
959 +    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
960 +    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
961 +  ]
962 +)
963 --- /dev/null
964 +++ tin-1.7.3/m4/lcmessage.m4
965 @@ -0,0 +1,32 @@
966 +# lcmessage.m4 serial 3 (gettext-0.11.3)
967 +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
968 +dnl This file is free software, distributed under the terms of the GNU
969 +dnl General Public License.  As a special exception to the GNU General
970 +dnl Public License, this file may be distributed as part of a program
971 +dnl that contains a configuration script generated by Autoconf, under
972 +dnl the same distribution terms as the rest of that program.
973 +dnl
974 +dnl This file can can be used in projects which are not available under
975 +dnl the GNU General Public License or the GNU Library General Public
976 +dnl License but which still want to provide support for the GNU gettext
977 +dnl functionality.
978 +dnl Please note that the actual code of the GNU gettext library is covered
979 +dnl by the GNU Library General Public License, and the rest of the GNU
980 +dnl gettext package package is covered by the GNU General Public License.
981 +dnl They are *not* in the public domain.
982 +
983 +dnl Authors:
984 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
985 +
986 +# Check whether LC_MESSAGES is available in <locale.h>.
987 +
988 +AC_DEFUN([AM_LC_MESSAGES],
989 +[
990 +  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
991 +    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
992 +       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
993 +  if test $am_cv_val_LC_MESSAGES = yes; then
994 +    AC_DEFINE(HAVE_LC_MESSAGES, 1,
995 +      [Define if your <locale.h> file defines LC_MESSAGES.])
996 +  fi
997 +])
998 --- /dev/null
999 +++ tin-1.7.3/m4/lib-ld.m4
1000 @@ -0,0 +1,97 @@
1001 +# lib-ld.m4 serial 1 (gettext-0.11)
1002 +dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
1003 +dnl This file is free software, distributed under the terms of the GNU
1004 +dnl General Public License.  As a special exception to the GNU General
1005 +dnl Public License, this file may be distributed as part of a program
1006 +dnl that contains a configuration script generated by Autoconf, under
1007 +dnl the same distribution terms as the rest of that program.
1008 +
1009 +dnl Subroutines of libtool.m4,
1010 +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1011 +dnl with libtool.m4.
1012 +
1013 +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1014 +AC_DEFUN([AC_LIB_PROG_LD_GNU],
1015 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1016 +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1017 +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1018 +  acl_cv_prog_gnu_ld=yes
1019 +else
1020 +  acl_cv_prog_gnu_ld=no
1021 +fi])
1022 +with_gnu_ld=$acl_cv_prog_gnu_ld
1023 +])
1024 +
1025 +dnl From libtool-1.4. Sets the variable LD.
1026 +AC_DEFUN([AC_LIB_PROG_LD],
1027 +[AC_ARG_WITH(gnu-ld,
1028 +[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
1029 +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1030 +AC_REQUIRE([AC_PROG_CC])dnl
1031 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
1032 +ac_prog=ld
1033 +if test "$GCC" = yes; then
1034 +  # Check if gcc -print-prog-name=ld gives a path.
1035 +  AC_MSG_CHECKING([for ld used by GCC])
1036 +  case $host in
1037 +  *-*-mingw*)
1038 +    # gcc leaves a trailing carriage return which upsets mingw
1039 +    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1040 +  *)
1041 +    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1042 +  esac
1043 +  case $ac_prog in
1044 +    # Accept absolute paths.
1045 +    [[\\/]* | [A-Za-z]:[\\/]*)]
1046 +      [re_direlt='/[^/][^/]*/\.\./']
1047 +      # Canonicalize the path of ld
1048 +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1049 +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1050 +       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1051 +      done
1052 +      test -z "$LD" && LD="$ac_prog"
1053 +      ;;
1054 +  "")
1055 +    # If it fails, then pretend we aren't using GCC.
1056 +    ac_prog=ld
1057 +    ;;
1058 +  *)
1059 +    # If it is relative, then search for the first ld in PATH.
1060 +    with_gnu_ld=unknown
1061 +    ;;
1062 +  esac
1063 +elif test "$with_gnu_ld" = yes; then
1064 +  AC_MSG_CHECKING([for GNU ld])
1065 +else
1066 +  AC_MSG_CHECKING([for non-GNU ld])
1067 +fi
1068 +AC_CACHE_VAL(acl_cv_path_LD,
1069 +[if test -z "$LD"; then
1070 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1071 +  for ac_dir in $PATH; do
1072 +    test -z "$ac_dir" && ac_dir=.
1073 +    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1074 +      acl_cv_path_LD="$ac_dir/$ac_prog"
1075 +      # Check to see if the program is GNU ld.  I'd rather use --version,
1076 +      # but apparently some GNU ld's only accept -v.
1077 +      # Break only if it was the GNU/non-GNU ld that we prefer.
1078 +      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1079 +       test "$with_gnu_ld" != no && break
1080 +      else
1081 +       test "$with_gnu_ld" != yes && break
1082 +      fi
1083 +    fi
1084 +  done
1085 +  IFS="$ac_save_ifs"
1086 +else
1087 +  acl_cv_path_LD="$LD" # Let the user override the test with a path.
1088 +fi])
1089 +LD="$acl_cv_path_LD"
1090 +if test -n "$LD"; then
1091 +  AC_MSG_RESULT($LD)
1092 +else
1093 +  AC_MSG_RESULT(no)
1094 +fi
1095 +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1096 +AC_LIB_PROG_LD_GNU
1097 +])
1098 --- /dev/null
1099 +++ tin-1.7.3/m4/lib-link.m4
1100 @@ -0,0 +1,554 @@
1101 +# lib-link.m4 serial 3 (gettext-0.11.3)
1102 +dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1103 +dnl This file is free software, distributed under the terms of the GNU
1104 +dnl General Public License.  As a special exception to the GNU General
1105 +dnl Public License, this file may be distributed as part of a program
1106 +dnl that contains a configuration script generated by Autoconf, under
1107 +dnl the same distribution terms as the rest of that program.
1108 +
1109 +dnl From Bruno Haible.
1110 +
1111 +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1112 +dnl the libraries corresponding to explicit and implicit dependencies.
1113 +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1114 +dnl augments the CPPFLAGS variable.
1115 +AC_DEFUN([AC_LIB_LINKFLAGS],
1116 +[
1117 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1118 +  AC_REQUIRE([AC_LIB_RPATH])
1119 +  define([Name],[translit([$1],[./-], [___])])
1120 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1121 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1122 +  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1123 +    AC_LIB_LINKFLAGS_BODY([$1], [$2])
1124 +    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1125 +    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1126 +    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1127 +  ])
1128 +  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1129 +  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1130 +  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1131 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1132 +  AC_SUBST([LIB]NAME)
1133 +  AC_SUBST([LTLIB]NAME)
1134 +  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1135 +  dnl results of this search when this library appears as a dependency.
1136 +  HAVE_LIB[]NAME=yes
1137 +  undefine([Name])
1138 +  undefine([NAME])
1139 +])
1140 +
1141 +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1142 +dnl searches for libname and the libraries corresponding to explicit and
1143 +dnl implicit dependencies, together with the specified include files and
1144 +dnl the ability to compile and link the specified testcode. If found, it
1145 +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1146 +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1147 +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1148 +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1149 +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1150 +[
1151 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1152 +  AC_REQUIRE([AC_LIB_RPATH])
1153 +  define([Name],[translit([$1],[./-], [___])])
1154 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1155 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1156 +
1157 +  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1158 +  dnl accordingly.
1159 +  AC_LIB_LINKFLAGS_BODY([$1], [$2])
1160 +
1161 +  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1162 +  dnl because if the user has installed lib[]Name and not disabled its use
1163 +  dnl via --without-lib[]Name-prefix, he wants to use it.
1164 +  ac_save_CPPFLAGS="$CPPFLAGS"
1165 +  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1166 +
1167 +  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1168 +    ac_save_LIBS="$LIBS"
1169 +    LIBS="$LIBS $LIB[]NAME"
1170 +    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1171 +    LIBS="$ac_save_LIBS"
1172 +  ])
1173 +  if test "$ac_cv_lib[]Name" = yes; then
1174 +    HAVE_LIB[]NAME=yes
1175 +    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1176 +    AC_MSG_CHECKING([how to link with lib[]$1])
1177 +    AC_MSG_RESULT([$LIB[]NAME])
1178 +  else
1179 +    HAVE_LIB[]NAME=no
1180 +    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1181 +    dnl $INC[]NAME either.
1182 +    CPPFLAGS="$ac_save_CPPFLAGS"
1183 +    LIB[]NAME=
1184 +    LTLIB[]NAME=
1185 +  fi
1186 +  AC_SUBST([HAVE_LIB]NAME)
1187 +  AC_SUBST([LIB]NAME)
1188 +  AC_SUBST([LTLIB]NAME)
1189 +  undefine([Name])
1190 +  undefine([NAME])
1191 +])
1192 +
1193 +dnl Determine the platform dependent parameters needed to use rpath:
1194 +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1195 +dnl hardcode_direct, hardcode_minus_L,
1196 +dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1197 +AC_DEFUN([AC_LIB_RPATH],
1198 +[
1199 +  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1200 +  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1201 +  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1202 +  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1203 +  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1204 +    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1205 +    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1206 +    . ./conftest.sh
1207 +    rm -f ./conftest.sh
1208 +    acl_cv_rpath=done
1209 +  ])
1210 +  wl="$acl_cv_wl"
1211 +  libext="$acl_cv_libext"
1212 +  shlibext="$acl_cv_shlibext"
1213 +  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1214 +  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1215 +  hardcode_direct="$acl_cv_hardcode_direct"
1216 +  hardcode_minus_L="$acl_cv_hardcode_minus_L"
1217 +  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1218 +  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1219 +  dnl Determine whether the user wants rpath handling at all.
1220 +  AC_ARG_ENABLE(rpath,
1221 +    [  --disable-rpath         do not hardcode runtime library paths],
1222 +    :, enable_rpath=yes)
1223 +])
1224 +
1225 +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1226 +dnl the libraries corresponding to explicit and implicit dependencies.
1227 +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1228 +AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1229 +[
1230 +  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1231 +                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1232 +  dnl By default, look in $includedir and $libdir.
1233 +  use_additional=yes
1234 +  AC_LIB_WITH_FINAL_PREFIX([
1235 +    eval additional_includedir=\"$includedir\"
1236 +    eval additional_libdir=\"$libdir\"
1237 +  ])
1238 +  AC_ARG_WITH([lib$1-prefix],
1239 +[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1240 +  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
1241 +[
1242 +    if test "X$withval" = "Xno"; then
1243 +      use_additional=no
1244 +    else
1245 +      if test "X$withval" = "X"; then
1246 +        AC_LIB_WITH_FINAL_PREFIX([
1247 +          eval additional_includedir=\"$includedir\"
1248 +          eval additional_libdir=\"$libdir\"
1249 +        ])
1250 +      else
1251 +        additional_includedir="$withval/include"
1252 +        additional_libdir="$withval/lib"
1253 +      fi
1254 +    fi
1255 +])
1256 +  dnl Search the library and its dependencies in $additional_libdir and
1257 +  dnl $LDFLAGS. Using breadth-first-seach.
1258 +  LIB[]NAME=
1259 +  LTLIB[]NAME=
1260 +  INC[]NAME=
1261 +  rpathdirs=
1262 +  ltrpathdirs=
1263 +  names_already_handled=
1264 +  names_next_round='$1 $2'
1265 +  while test -n "$names_next_round"; do
1266 +    names_this_round="$names_next_round"
1267 +    names_next_round=
1268 +    for name in $names_this_round; do
1269 +      already_handled=
1270 +      for n in $names_already_handled; do
1271 +        if test "$n" = "$name"; then
1272 +          already_handled=yes
1273 +          break
1274 +        fi
1275 +      done
1276 +      if test -z "$already_handled"; then
1277 +        names_already_handled="$names_already_handled $name"
1278 +        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1279 +        dnl or AC_LIB_HAVE_LINKFLAGS call.
1280 +        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1281 +        eval value=\"\$HAVE_LIB$uppername\"
1282 +        if test -n "$value"; then
1283 +          if test "$value" = yes; then
1284 +            eval value=\"\$LIB$uppername\"
1285 +            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1286 +            eval value=\"\$LTLIB$uppername\"
1287 +            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1288 +          else
1289 +            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1290 +            dnl that this library doesn't exist. So just drop it.
1291 +            :
1292 +          fi
1293 +        else
1294 +          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1295 +          dnl and the already constructed $LIBNAME/$LTLIBNAME.
1296 +          found_dir=
1297 +          found_la=
1298 +          found_so=
1299 +          found_a=
1300 +          if test $use_additional = yes; then
1301 +            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1302 +              found_dir="$additional_libdir"
1303 +              found_so="$additional_libdir/lib$name.$shlibext"
1304 +              if test -f "$additional_libdir/lib$name.la"; then
1305 +                found_la="$additional_libdir/lib$name.la"
1306 +              fi
1307 +            else
1308 +              if test -f "$additional_libdir/lib$name.$libext"; then
1309 +                found_dir="$additional_libdir"
1310 +                found_a="$additional_libdir/lib$name.$libext"
1311 +                if test -f "$additional_libdir/lib$name.la"; then
1312 +                  found_la="$additional_libdir/lib$name.la"
1313 +                fi
1314 +              fi
1315 +            fi
1316 +          fi
1317 +          if test "X$found_dir" = "X"; then
1318 +            for x in $LDFLAGS $LTLIB[]NAME; do
1319 +              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1320 +              case "$x" in
1321 +                -L*)
1322 +                  dir=`echo "X$x" | sed -e 's/^X-L//'`
1323 +                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1324 +                    found_dir="$dir"
1325 +                    found_so="$dir/lib$name.$shlibext"
1326 +                    if test -f "$dir/lib$name.la"; then
1327 +                      found_la="$dir/lib$name.la"
1328 +                    fi
1329 +                  else
1330 +                    if test -f "$dir/lib$name.$libext"; then
1331 +                      found_dir="$dir"
1332 +                      found_a="$dir/lib$name.$libext"
1333 +                      if test -f "$dir/lib$name.la"; then
1334 +                        found_la="$dir/lib$name.la"
1335 +                      fi
1336 +                    fi
1337 +                  fi
1338 +                  ;;
1339 +              esac
1340 +              if test "X$found_dir" != "X"; then
1341 +                break
1342 +              fi
1343 +            done
1344 +          fi
1345 +          if test "X$found_dir" != "X"; then
1346 +            dnl Found the library.
1347 +            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1348 +            if test "X$found_so" != "X"; then
1349 +              dnl Linking with a shared library. We attempt to hardcode its
1350 +              dnl directory into the executable's runpath, unless it's the
1351 +              dnl standard /usr/lib.
1352 +              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1353 +                dnl No hardcoding is needed.
1354 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1355 +              else
1356 +                dnl Use an explicit option to hardcode DIR into the resulting
1357 +                dnl binary.
1358 +                dnl Potentially add DIR to ltrpathdirs.
1359 +                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1360 +                haveit=
1361 +                for x in $ltrpathdirs; do
1362 +                  if test "X$x" = "X$found_dir"; then
1363 +                    haveit=yes
1364 +                    break
1365 +                  fi
1366 +                done
1367 +                if test -z "$haveit"; then
1368 +                  ltrpathdirs="$ltrpathdirs $found_dir"
1369 +                fi
1370 +                dnl The hardcoding into $LIBNAME is system dependent.
1371 +                if test "$hardcode_direct" = yes; then
1372 +                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1373 +                  dnl resulting binary.
1374 +                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1375 +                else
1376 +                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1377 +                    dnl Use an explicit option to hardcode DIR into the resulting
1378 +                    dnl binary.
1379 +                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1380 +                    dnl Potentially add DIR to rpathdirs.
1381 +                    dnl The rpathdirs will be appended to $LIBNAME at the end.
1382 +                    haveit=
1383 +                    for x in $rpathdirs; do
1384 +                      if test "X$x" = "X$found_dir"; then
1385 +                        haveit=yes
1386 +                        break
1387 +                      fi
1388 +                    done
1389 +                    if test -z "$haveit"; then
1390 +                      rpathdirs="$rpathdirs $found_dir"
1391 +                    fi
1392 +                  else
1393 +                    dnl Rely on "-L$found_dir".
1394 +                    dnl But don't add it if it's already contained in the LDFLAGS
1395 +                    dnl or the already constructed $LIBNAME
1396 +                    haveit=
1397 +                    for x in $LDFLAGS $LIB[]NAME; do
1398 +                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1399 +                      if test "X$x" = "X-L$found_dir"; then
1400 +                        haveit=yes
1401 +                        break
1402 +                      fi
1403 +                    done
1404 +                    if test -z "$haveit"; then
1405 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1406 +                    fi
1407 +                    if test "$hardcode_minus_L" != no; then
1408 +                      dnl FIXME: Not sure whether we should use
1409 +                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1410 +                      dnl here.
1411 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1412 +                    else
1413 +                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1414 +                      dnl here, because this doesn't fit in flags passed to the
1415 +                      dnl compiler. So give up. No hardcoding. This affects only
1416 +                      dnl very old systems.
1417 +                      dnl FIXME: Not sure whether we should use
1418 +                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1419 +                      dnl here.
1420 +                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1421 +                    fi
1422 +                  fi
1423 +                fi
1424 +              fi
1425 +            else
1426 +              if test "X$found_a" != "X"; then
1427 +                dnl Linking with a static library.
1428 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1429 +              else
1430 +                dnl We shouldn't come here, but anyway it's good to have a
1431 +                dnl fallback.
1432 +                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1433 +              fi
1434 +            fi
1435 +            dnl Assume the include files are nearby.
1436 +            additional_includedir=
1437 +            case "$found_dir" in
1438 +              */lib | */lib/)
1439 +                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1440 +                additional_includedir="$basedir/include"
1441 +                ;;
1442 +            esac
1443 +            if test "X$additional_includedir" != "X"; then
1444 +              dnl Potentially add $additional_includedir to $INCNAME.
1445 +              dnl But don't add it
1446 +              dnl   1. if it's the standard /usr/include,
1447 +              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1448 +              dnl   3. if it's already present in $CPPFLAGS or the already
1449 +              dnl      constructed $INCNAME,
1450 +              dnl   4. if it doesn't exist as a directory.
1451 +              if test "X$additional_includedir" != "X/usr/include"; then
1452 +                haveit=
1453 +                if test "X$additional_includedir" = "X/usr/local/include"; then
1454 +                  if test -n "$GCC"; then
1455 +                    case $host_os in
1456 +                      linux*) haveit=yes;;
1457 +                    esac
1458 +                  fi
1459 +                fi
1460 +                if test -z "$haveit"; then
1461 +                  for x in $CPPFLAGS $INC[]NAME; do
1462 +                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1463 +                    if test "X$x" = "X-I$additional_includedir"; then
1464 +                      haveit=yes
1465 +                      break
1466 +                    fi
1467 +                  done
1468 +                  if test -z "$haveit"; then
1469 +                    if test -d "$additional_includedir"; then
1470 +                      dnl Really add $additional_includedir to $INCNAME.
1471 +                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1472 +                    fi
1473 +                  fi
1474 +                fi
1475 +              fi
1476 +            fi
1477 +            dnl Look for dependencies.
1478 +            if test -n "$found_la"; then
1479 +              dnl Read the .la file. It defines the variables
1480 +              dnl dlname, library_names, old_library, dependency_libs, current,
1481 +              dnl age, revision, installed, dlopen, dlpreopen, libdir.
1482 +              save_libdir="$libdir"
1483 +              case "$found_la" in
1484 +                */* | *\\*) . "$found_la" ;;
1485 +                *) . "./$found_la" ;;
1486 +              esac
1487 +              libdir="$save_libdir"
1488 +              dnl We use only dependency_libs.
1489 +              for dep in $dependency_libs; do
1490 +                case "$dep" in
1491 +                  -L*)
1492 +                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1493 +                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1494 +                    dnl But don't add it
1495 +                    dnl   1. if it's the standard /usr/lib,
1496 +                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
1497 +                    dnl   3. if it's already present in $LDFLAGS or the already
1498 +                    dnl      constructed $LIBNAME,
1499 +                    dnl   4. if it doesn't exist as a directory.
1500 +                    if test "X$additional_libdir" != "X/usr/lib"; then
1501 +                      haveit=
1502 +                      if test "X$additional_libdir" = "X/usr/local/lib"; then
1503 +                        if test -n "$GCC"; then
1504 +                          case $host_os in
1505 +                            linux*) haveit=yes;;
1506 +                          esac
1507 +                        fi
1508 +                      fi
1509 +                      if test -z "$haveit"; then
1510 +                        haveit=
1511 +                        for x in $LDFLAGS $LIB[]NAME; do
1512 +                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1513 +                          if test "X$x" = "X-L$additional_libdir"; then
1514 +                            haveit=yes
1515 +                            break
1516 +                          fi
1517 +                        done
1518 +                        if test -z "$haveit"; then
1519 +                          if test -d "$additional_libdir"; then
1520 +                            dnl Really add $additional_libdir to $LIBNAME.
1521 +                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1522 +                          fi
1523 +                        fi
1524 +                        haveit=
1525 +                        for x in $LDFLAGS $LTLIB[]NAME; do
1526 +                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1527 +                          if test "X$x" = "X-L$additional_libdir"; then
1528 +                            haveit=yes
1529 +                            break
1530 +                          fi
1531 +                        done
1532 +                        if test -z "$haveit"; then
1533 +                          if test -d "$additional_libdir"; then
1534 +                            dnl Really add $additional_libdir to $LTLIBNAME.
1535 +                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1536 +                          fi
1537 +                        fi
1538 +                      fi
1539 +                    fi
1540 +                    ;;
1541 +                  -R*)
1542 +                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
1543 +                    if test "$enable_rpath" != no; then
1544 +                      dnl Potentially add DIR to rpathdirs.
1545 +                      dnl The rpathdirs will be appended to $LIBNAME at the end.
1546 +                      haveit=
1547 +                      for x in $rpathdirs; do
1548 +                        if test "X$x" = "X$dir"; then
1549 +                          haveit=yes
1550 +                          break
1551 +                        fi
1552 +                      done
1553 +                      if test -z "$haveit"; then
1554 +                        rpathdirs="$rpathdirs $dir"
1555 +                      fi
1556 +                      dnl Potentially add DIR to ltrpathdirs.
1557 +                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1558 +                      haveit=
1559 +                      for x in $ltrpathdirs; do
1560 +                        if test "X$x" = "X$dir"; then
1561 +                          haveit=yes
1562 +                          break
1563 +                        fi
1564 +                      done
1565 +                      if test -z "$haveit"; then
1566 +                        ltrpathdirs="$ltrpathdirs $dir"
1567 +                      fi
1568 +                    fi
1569 +                    ;;
1570 +                  -l*)
1571 +                    dnl Handle this in the next round.
1572 +                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1573 +                    ;;
1574 +                  *.la)
1575 +                    dnl Handle this in the next round. Throw away the .la's
1576 +                    dnl directory; it is already contained in a preceding -L
1577 +                    dnl option.
1578 +                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1579 +                    ;;
1580 +                  *)
1581 +                    dnl Most likely an immediate library name.
1582 +                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1583 +                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1584 +                    ;;
1585 +                esac
1586 +              done
1587 +            fi
1588 +          else
1589 +            dnl Didn't find the library; assume it is in the system directories
1590 +            dnl known to the linker and runtime loader. (All the system
1591 +            dnl directories known to the linker should also be known to the
1592 +            dnl runtime loader, otherwise the system is severely misconfigured.)
1593 +            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1594 +            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1595 +          fi
1596 +        fi
1597 +      fi
1598 +    done
1599 +  done
1600 +  if test "X$rpathdirs" != "X"; then
1601 +    if test -n "$hardcode_libdir_separator"; then
1602 +      dnl Weird platform: only the last -rpath option counts, the user must
1603 +      dnl pass all path elements in one option. We can arrange that for a
1604 +      dnl single library, but not when more than one $LIBNAMEs are used.
1605 +      alldirs=
1606 +      for found_dir in $rpathdirs; do
1607 +        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1608 +      done
1609 +      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1610 +      acl_save_libdir="$libdir"
1611 +      libdir="$alldirs"
1612 +      eval flag=\"$hardcode_libdir_flag_spec\"
1613 +      libdir="$acl_save_libdir"
1614 +      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1615 +    else
1616 +      dnl The -rpath options are cumulative.
1617 +      for found_dir in $rpathdirs; do
1618 +        acl_save_libdir="$libdir"
1619 +        libdir="$found_dir"
1620 +        eval flag=\"$hardcode_libdir_flag_spec\"
1621 +        libdir="$acl_save_libdir"
1622 +        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1623 +      done
1624 +    fi
1625 +  fi
1626 +  if test "X$ltrpathdirs" != "X"; then
1627 +    dnl When using libtool, the option that works for both libraries and
1628 +    dnl executables is -R. The -R options are cumulative.
1629 +    for found_dir in $ltrpathdirs; do
1630 +      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1631 +    done
1632 +  fi
1633 +])
1634 +
1635 +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1636 +dnl unless already present in VAR.
1637 +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1638 +dnl contains two or three consecutive elements that belong together.
1639 +AC_DEFUN([AC_LIB_APPENDTOVAR],
1640 +[
1641 +  for element in [$2]; do
1642 +    haveit=
1643 +    for x in $[$1]; do
1644 +      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1645 +      if test "X$x" = "X$element"; then
1646 +        haveit=yes
1647 +        break
1648 +      fi
1649 +    done
1650 +    if test -z "$haveit"; then
1651 +      [$1]="${[$1]}${[$1]:+ }$element"
1652 +    fi
1653 +  done
1654 +])
1655 --- /dev/null
1656 +++ tin-1.7.3/m4/lib-prefix.m4
1657 @@ -0,0 +1,148 @@
1658 +# lib-prefix.m4 serial 1 (gettext-0.11)
1659 +dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1660 +dnl This file is free software, distributed under the terms of the GNU
1661 +dnl General Public License.  As a special exception to the GNU General
1662 +dnl Public License, this file may be distributed as part of a program
1663 +dnl that contains a configuration script generated by Autoconf, under
1664 +dnl the same distribution terms as the rest of that program.
1665 +
1666 +dnl From Bruno Haible.
1667 +
1668 +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1669 +dnl to access previously installed libraries. The basic assumption is that
1670 +dnl a user will want packages to use other packages he previously installed
1671 +dnl with the same --prefix option.
1672 +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1673 +dnl libraries, but is otherwise very convenient.
1674 +AC_DEFUN([AC_LIB_PREFIX],
1675 +[
1676 +  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1677 +  AC_REQUIRE([AC_PROG_CC])
1678 +  AC_REQUIRE([AC_CANONICAL_HOST])
1679 +  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1680 +  dnl By default, look in $includedir and $libdir.
1681 +  use_additional=yes
1682 +  AC_LIB_WITH_FINAL_PREFIX([
1683 +    eval additional_includedir=\"$includedir\"
1684 +    eval additional_libdir=\"$libdir\"
1685 +  ])
1686 +  AC_ARG_WITH([lib-prefix],
1687 +[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1688 +  --without-lib-prefix    don't search for libraries in includedir and libdir],
1689 +[
1690 +    if test "X$withval" = "Xno"; then
1691 +      use_additional=no
1692 +    else
1693 +      if test "X$withval" = "X"; then
1694 +        AC_LIB_WITH_FINAL_PREFIX([
1695 +          eval additional_includedir=\"$includedir\"
1696 +          eval additional_libdir=\"$libdir\"
1697 +        ])
1698 +      else
1699 +        additional_includedir="$withval/include"
1700 +        additional_libdir="$withval/lib"
1701 +      fi
1702 +    fi
1703 +])
1704 +  if test $use_additional = yes; then
1705 +    dnl Potentially add $additional_includedir to $CPPFLAGS.
1706 +    dnl But don't add it
1707 +    dnl   1. if it's the standard /usr/include,
1708 +    dnl   2. if it's already present in $CPPFLAGS,
1709 +    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1710 +    dnl   4. if it doesn't exist as a directory.
1711 +    if test "X$additional_includedir" != "X/usr/include"; then
1712 +      haveit=
1713 +      for x in $CPPFLAGS; do
1714 +        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1715 +        if test "X$x" = "X-I$additional_includedir"; then
1716 +          haveit=yes
1717 +          break
1718 +        fi
1719 +      done
1720 +      if test -z "$haveit"; then
1721 +        if test "X$additional_includedir" = "X/usr/local/include"; then
1722 +          if test -n "$GCC"; then
1723 +            case $host_os in
1724 +              linux*) haveit=yes;;
1725 +            esac
1726 +          fi
1727 +        fi
1728 +        if test -z "$haveit"; then
1729 +          if test -d "$additional_includedir"; then
1730 +            dnl Really add $additional_includedir to $CPPFLAGS.
1731 +            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1732 +          fi
1733 +        fi
1734 +      fi
1735 +    fi
1736 +    dnl Potentially add $additional_libdir to $LDFLAGS.
1737 +    dnl But don't add it
1738 +    dnl   1. if it's the standard /usr/lib,
1739 +    dnl   2. if it's already present in $LDFLAGS,
1740 +    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1741 +    dnl   4. if it doesn't exist as a directory.
1742 +    if test "X$additional_libdir" != "X/usr/lib"; then
1743 +      haveit=
1744 +      for x in $LDFLAGS; do
1745 +        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1746 +        if test "X$x" = "X-L$additional_libdir"; then
1747 +          haveit=yes
1748 +          break
1749 +        fi
1750 +      done
1751 +      if test -z "$haveit"; then
1752 +        if test "X$additional_libdir" = "X/usr/local/lib"; then
1753 +          if test -n "$GCC"; then
1754 +            case $host_os in
1755 +              linux*) haveit=yes;;
1756 +            esac
1757 +          fi
1758 +        fi
1759 +        if test -z "$haveit"; then
1760 +          if test -d "$additional_libdir"; then
1761 +            dnl Really add $additional_libdir to $LDFLAGS.
1762 +            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1763 +          fi
1764 +        fi
1765 +      fi
1766 +    fi
1767 +  fi
1768 +])
1769 +
1770 +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1771 +dnl acl_final_exec_prefix, containing the values to which $prefix and
1772 +dnl $exec_prefix will expand at the end of the configure script.
1773 +AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1774 +[
1775 +  dnl Unfortunately, prefix and exec_prefix get only finally determined
1776 +  dnl at the end of configure.
1777 +  if test "X$prefix" = "XNONE"; then
1778 +    acl_final_prefix="$ac_default_prefix"
1779 +  else
1780 +    acl_final_prefix="$prefix"
1781 +  fi
1782 +  if test "X$exec_prefix" = "XNONE"; then
1783 +    acl_final_exec_prefix='${prefix}'
1784 +  else
1785 +    acl_final_exec_prefix="$exec_prefix"
1786 +  fi
1787 +  acl_save_prefix="$prefix"
1788 +  prefix="$acl_final_prefix"
1789 +  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1790 +  prefix="$acl_save_prefix"
1791 +])
1792 +
1793 +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1794 +dnl variables prefix and exec_prefix bound to the values they will have
1795 +dnl at the end of the configure script.
1796 +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1797 +[
1798 +  acl_save_prefix="$prefix"
1799 +  prefix="$acl_final_prefix"
1800 +  acl_save_exec_prefix="$exec_prefix"
1801 +  exec_prefix="$acl_final_exec_prefix"
1802 +  $1
1803 +  exec_prefix="$acl_save_exec_prefix"
1804 +  prefix="$acl_save_prefix"
1805 +])
1806 --- /dev/null
1807 +++ tin-1.7.3/m4/progtest.m4
1808 @@ -0,0 +1,59 @@
1809 +# progtest.m4 serial 2 (gettext-0.10.40)
1810 +dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
1811 +dnl This file is free software, distributed under the terms of the GNU
1812 +dnl General Public License.  As a special exception to the GNU General
1813 +dnl Public License, this file may be distributed as part of a program
1814 +dnl that contains a configuration script generated by Autoconf, under
1815 +dnl the same distribution terms as the rest of that program.
1816 +dnl
1817 +dnl This file can can be used in projects which are not available under
1818 +dnl the GNU General Public License or the GNU Library General Public
1819 +dnl License but which still want to provide support for the GNU gettext
1820 +dnl functionality.
1821 +dnl Please note that the actual code of the GNU gettext library is covered
1822 +dnl by the GNU Library General Public License, and the rest of the GNU
1823 +dnl gettext package package is covered by the GNU General Public License.
1824 +dnl They are *not* in the public domain.
1825 +
1826 +dnl Authors:
1827 +dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
1828 +
1829 +# Search path for a program which passes the given test.
1830 +
1831 +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1832 +dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1833 +AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1834 +[# Extract the first word of "$2", so it can be a program name with args.
1835 +set dummy $2; ac_word=[$]2
1836 +AC_MSG_CHECKING([for $ac_word])
1837 +AC_CACHE_VAL(ac_cv_path_$1,
1838 +[case "[$]$1" in
1839 +  /*)
1840 +  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1841 +  ;;
1842 +  *)
1843 +  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1844 +  for ac_dir in ifelse([$5], , $PATH, [$5]); do
1845 +    test -z "$ac_dir" && ac_dir=.
1846 +    if test -f $ac_dir/$ac_word; then
1847 +      if [$3]; then
1848 +       ac_cv_path_$1="$ac_dir/$ac_word"
1849 +       break
1850 +      fi
1851 +    fi
1852 +  done
1853 +  IFS="$ac_save_ifs"
1854 +dnl If no 4th arg is given, leave the cache variable unset,
1855 +dnl so AC_PATH_PROGS will keep looking.
1856 +ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1857 +])dnl
1858 +  ;;
1859 +esac])dnl
1860 +$1="$ac_cv_path_$1"
1861 +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1862 +  AC_MSG_RESULT([$]$1)
1863 +else
1864 +  AC_MSG_RESULT(no)
1865 +fi
1866 +AC_SUBST($1)dnl
1867 +])
1868 --- /dev/null
1869 +++ tin-1.7.3/m4/stdint_h.m4
1870 @@ -0,0 +1,28 @@
1871 +# stdint_h.m4 serial 2 (gettext-0.11.4)
1872 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1873 +dnl This file is free software, distributed under the terms of the GNU
1874 +dnl General Public License.  As a special exception to the GNU General
1875 +dnl Public License, this file may be distributed as part of a program
1876 +dnl that contains a configuration script generated by Autoconf, under
1877 +dnl the same distribution terms as the rest of that program.
1878 +
1879 +dnl From Paul Eggert.
1880 +
1881 +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
1882 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
1883 +
1884 +AC_DEFUN([jm_AC_HEADER_STDINT_H],
1885 +[
1886 +  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
1887 +  [AC_TRY_COMPILE(
1888 +    [#include <sys/types.h>
1889 +#include <stdint.h>],
1890 +    [uintmax_t i = (uintmax_t) -1;],
1891 +    jm_ac_cv_header_stdint_h=yes,
1892 +    jm_ac_cv_header_stdint_h=no)])
1893 +  if test $jm_ac_cv_header_stdint_h = yes; then
1894 +    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
1895 +[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
1896 +   and declares uintmax_t. ])
1897 +  fi
1898 +])
1899 --- /dev/null
1900 +++ tin-1.7.3/m4/uintmax_t.m4
1901 @@ -0,0 +1,29 @@
1902 +# uintmax_t.m4 serial 6 (gettext-0.11)
1903 +dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1904 +dnl This file is free software, distributed under the terms of the GNU
1905 +dnl General Public License.  As a special exception to the GNU General
1906 +dnl Public License, this file may be distributed as part of a program
1907 +dnl that contains a configuration script generated by Autoconf, under
1908 +dnl the same distribution terms as the rest of that program.
1909 +
1910 +dnl From Paul Eggert.
1911 +
1912 +AC_PREREQ(2.13)
1913 +
1914 +# Define uintmax_t to `unsigned long' or `unsigned long long'
1915 +# if <inttypes.h> does not exist.
1916 +
1917 +AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
1918 +[
1919 +  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
1920 +  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
1921 +  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
1922 +    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1923 +    test $ac_cv_type_unsigned_long_long = yes \
1924 +      && ac_type='unsigned long long' \
1925 +      || ac_type='unsigned long'
1926 +    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
1927 +  [Define to unsigned long or unsigned long long
1928 +   if <inttypes.h> and <stdint.h> don't define.])
1929 +  fi
1930 +])
1931 --- /dev/null
1932 +++ tin-1.7.3/m4/ulonglong.m4
1933 @@ -0,0 +1,23 @@
1934 +# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
1935 +dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
1936 +dnl This file is free software, distributed under the terms of the GNU
1937 +dnl General Public License.  As a special exception to the GNU General
1938 +dnl Public License, this file may be distributed as part of a program
1939 +dnl that contains a configuration script generated by Autoconf, under
1940 +dnl the same distribution terms as the rest of that program.
1941 +
1942 +dnl From Paul Eggert.
1943 +
1944 +AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
1945 +[
1946 +  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
1947 +  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
1948 +    [unsigned long long ullmax = (unsigned long long) -1;
1949 +     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
1950 +    ac_cv_type_unsigned_long_long=yes,
1951 +    ac_cv_type_unsigned_long_long=no)])
1952 +  if test $ac_cv_type_unsigned_long_long = yes; then
1953 +    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
1954 +      [Define if you have the unsigned long long type.])
1955 +  fi
1956 +])
1957 --- /dev/null
1958 +++ tin-1.7.3/acinclude.m4
1959 @@ -0,0 +1,3671 @@
1960 +dnl ---------------------------------------------------------------------------
1961 +dnl AM_MULTIBYTE_ABLE version: 5 updated: 2003/01/16 16:21:27
1962 +dnl -----------------
1963 +
1964 +dnl check for required multibyte/widechar functions
1965 +dnl Urs Janssen <urs@tin.org> 20021006
1966 +dnl Usage: AM_MULTIBYTE_ABLE
1967 +AC_DEFUN([AM_MULTIBYTE_ABLE],
1968 +[
1969 +  AC_CACHE_CHECK([for wide char and multibyte support], am_cv_multibyte_able,
1970 +   [AC_TRY_LINK([#include <stdio.h>
1971 +#ifdef HAVE_STDLIB_H
1972 +#      include <stdlib.h>
1973 +#endif /* HAVE_STDLIB_H */
1974 +#ifdef HAVE_WCHAR_H
1975 +#      include <wchar.h>
1976 +#endif /* HAVE_WCHAR_H */
1977 +#ifdef HAVE_WCTYPE_H
1978 +#      include <wctype.h>
1979 +#endif /* HAVE_WCTYPE_H */
1980 +],
1981 +     [char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
1982 +      char ocb[5];
1983 +      wchar_t wcb[5];
1984 +      wchar_t wcb2[5];
1985 +      wchar_t format[3];
1986 +
1987 +      putwc(0, 0);
1988 +      fputwc(0, 0);
1989 +      fwide(0, 0);
1990 +      mbtowc(wcb, icb, MB_CUR_MAX);
1991 +      mbstowcs(wcb, icb, 5);
1992 +      iswprint((wint_t) wcb[0]);
1993 +      wcslen(wcb);
1994 +      wcsnlen(wcb, 4);
1995 +      wcwidth((wint_t) wcb[0]);
1996 +      wcswidth(wcb, 5);
1997 +      wcstombs(ocb, wcb, 5);
1998 +      mbstowcs(format, "%s", 2);
1999 +      swprintf(wcb, 5, format, "test");
2000 +      wcsncat(wcb2, wcb, 5);],
2001 +     am_cv_multibyte_able=yes,
2002 +     [cf_save_LIBS="$LIBS"
2003 +      LIBS="-lutf8 $LIBS"
2004 +      AC_TRY_LINK([#include <libutf8.h>],
2005 +       [char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
2006 +        char ocb[5];
2007 +        wchar_t wcb[5];
2008 +        wchar_t wcb2[5];
2009 +        wchar_t format[3];
2010 +
2011 +        putwc(0, 0);
2012 +        fputwc(0, 0);
2013 +        fwide(0, 0);
2014 +        mbtowc(wcb, icb, MB_CUR_MAX);
2015 +        mbstowcs(wcb, icb, 5);
2016 +        iswprint((wint_t) wcb[0]);
2017 +        wcslen(wcb);
2018 +        wcsnlen(wcb, 4);
2019 +        wcwidth((wint_t) wcb[0]);
2020 +        wcswidth(wcb, 5);
2021 +        wcstombs(ocb, wcb, 5);
2022 +        mbstowcs(format, "%s", 2);
2023 +        swprintf(wcb, 5, format, "test");
2024 +        wcsncat(wcb2, wcb, 5);],
2025 +        [am_cv_multibyte_able=yes
2026 +        have_libutf8_h=yes],
2027 +        [am_cv_multibyte_able=no
2028 +         LIBS="$cf_save_LIBS"])
2029 +   ])
2030 +  ])
2031 +  if test $am_cv_multibyte_able = yes; then
2032 +    AC_DEFINE(MULTIBYTE_ABLE, 1,
2033 +      [Define if you have swprintf() and co.])
2034 +    if test $have_libutf8_h = yes; then
2035 +      AC_DEFINE(HAVE_LIBUTF8_H)
2036 +    fi
2037 +  fi
2038 +])
2039 +dnl ---------------------------------------------------------------------------
2040 +dnl CF_ADD_CFLAGS version: 5 updated: 2002/12/01 00:12:15
2041 +dnl -------------
2042 +dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
2043 +dnl The second parameter if given makes this macro verbose.
2044 +AC_DEFUN([CF_ADD_CFLAGS],
2045 +[
2046 +cf_new_cflags=
2047 +cf_new_cppflags=
2048 +for cf_add_cflags in $1
2049 +do
2050 +       case $cf_add_cflags in #(vi
2051 +       -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2052 +               case "$CPPFLAGS" in
2053 +               *$cf_add_cflags) #(vi
2054 +                       ;;
2055 +               *) #(vi
2056 +                       cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2057 +                       ;;
2058 +               esac
2059 +               ;;
2060 +       *)
2061 +               cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2062 +               ;;
2063 +       esac
2064 +done
2065 +
2066 +if test -n "$cf_new_cflags" ; then
2067 +       ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
2068 +       CFLAGS="$CFLAGS $cf_new_cflags"
2069 +fi
2070 +
2071 +if test -n "$cf_new_cppflags" ; then
2072 +       ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
2073 +       CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
2074 +fi
2075 +
2076 +])dnl
2077 +dnl ---------------------------------------------------------------------------
2078 +dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52
2079 +dnl -------------
2080 +dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
2081 +dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
2082 +dnl but old versions (and some misinstalled ones) need that.  To make things
2083 +dnl worse, gcc 3.x gives error messages if -I/usr/local/include is added to
2084 +dnl the include-path).
2085 +AC_DEFUN([CF_ADD_INCDIR],
2086 +[
2087 +for cf_add_incdir in $1
2088 +do
2089 +       while true
2090 +       do
2091 +               case $cf_add_incdir in
2092 +               /usr/include) # (vi
2093 +                       ;;
2094 +               /usr/local/include) # (vi
2095 +                       if test "$GCC" = yes
2096 +                       then
2097 +                               cf_save_CPPFLAGS="$CPPFLAGS"
2098 +                               CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
2099 +                               AC_TRY_COMPILE([#include <stdio.h>],
2100 +                                               [printf("Hello")],
2101 +                                               [],
2102 +                                               [CPPFLAGS="$cf_save_CPPFLAGS"])
2103 +                       fi
2104 +                       ;;
2105 +               *) # (vi
2106 +                       CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
2107 +                       ;;
2108 +               esac
2109 +               cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
2110 +               test "$cf_top_incdir" = "$cf_add_incdir" && break
2111 +               cf_add_incdir="$cf_top_incdir"
2112 +       done
2113 +done
2114 +])dnl
2115 +dnl ---------------------------------------------------------------------------
2116 +dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
2117 +dnl ----------------
2118 +dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
2119 +dnl in the sharutils 4.2 distribution.
2120 +AC_DEFUN([CF_ANSI_CC_CHECK],
2121 +[
2122 +AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
2123 +cf_cv_ansi_cc=no
2124 +cf_save_CFLAGS="$CFLAGS"
2125 +cf_save_CPPFLAGS="$CPPFLAGS"
2126 +# Don't try gcc -ansi; that turns off useful extensions and
2127 +# breaks some systems' header files.
2128 +# AIX                  -qlanglvl=ansi
2129 +# Ultrix and OSF/1     -std1
2130 +# HP-UX                        -Aa -D_HPUX_SOURCE
2131 +# SVR4                 -Xc
2132 +# UnixWare 1.2         (cannot use -Xc, since ANSI/POSIX clashes)
2133 +for cf_arg in "-DCC_HAS_PROTOS" \
2134 +       "" \
2135 +       -qlanglvl=ansi \
2136 +       -std1 \
2137 +       -Ae \
2138 +       "-Aa -D_HPUX_SOURCE" \
2139 +       -Xc
2140 +do
2141 +       CF_ADD_CFLAGS($cf_arg)
2142 +       AC_TRY_COMPILE(
2143 +[
2144 +#ifndef CC_HAS_PROTOS
2145 +#if !defined(__STDC__) || (__STDC__ != 1)
2146 +choke me
2147 +#endif
2148 +#endif
2149 +],[
2150 +       int test (int i, double x);
2151 +       struct s1 {int (*f) (int a);};
2152 +       struct s2 {int (*f) (double a);};],
2153 +       [cf_cv_ansi_cc="$cf_arg"; break])
2154 +done
2155 +CFLAGS="$cf_save_CFLAGS"
2156 +CPPFLAGS="$cf_save_CPPFLAGS"
2157 +])
2158 +
2159 +if test "$cf_cv_ansi_cc" != "no"; then
2160 +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2161 +       CF_ADD_CFLAGS($cf_cv_ansi_cc)
2162 +else
2163 +       AC_DEFINE(CC_HAS_PROTOS)
2164 +fi
2165 +fi
2166 +])dnl
2167 +dnl ---------------------------------------------------------------------------
2168 +dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
2169 +dnl ---------------
2170 +dnl For programs that must use an ANSI compiler, obtain compiler options that
2171 +dnl will make it recognize prototypes.  We'll do preprocessor checks in other
2172 +dnl macros, since tools such as unproto can fake prototypes, but only part of
2173 +dnl the preprocessor.
2174 +AC_DEFUN([CF_ANSI_CC_REQD],
2175 +[AC_REQUIRE([CF_ANSI_CC_CHECK])
2176 +if test "$cf_cv_ansi_cc" = "no"; then
2177 +       AC_ERROR(
2178 +[Your compiler does not appear to recognize prototypes.
2179 +You have the following choices:
2180 +       a. adjust your compiler options
2181 +       b. get an up-to-date compiler
2182 +       c. use a wrapper such as unproto])
2183 +fi
2184 +])dnl
2185 +dnl ---------------------------------------------------------------------------
2186 +dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
2187 +dnl --------------
2188 +dnl Allow user to disable a normally-on option.
2189 +AC_DEFUN([CF_ARG_DISABLE],
2190 +[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
2191 +dnl ---------------------------------------------------------------------------
2192 +dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
2193 +dnl -------------
2194 +dnl Allow user to enable a normally-off option.
2195 +AC_DEFUN([CF_ARG_ENABLE],
2196 +[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
2197 +dnl ---------------------------------------------------------------------------
2198 +dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41
2199 +dnl -------------
2200 +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
2201 +dnl values.
2202 +dnl
2203 +dnl Parameters:
2204 +dnl $1 = option name
2205 +dnl $2 = help-string
2206 +dnl $3 = action to perform if option is not default
2207 +dnl $4 = action if perform if option is default
2208 +dnl $5 = default option value (either 'yes' or 'no')
2209 +AC_DEFUN([CF_ARG_OPTION],
2210 +[AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
2211 +  if test "$enableval" != "$5" ; then
2212 +ifelse($3,,[    :]dnl
2213 +,[    $3]) ifelse($4,,,[
2214 +  else
2215 +    $4])
2216 +  fi],[enableval=$5 ifelse($4,,,[
2217 +  $4
2218 +])dnl
2219 +  ])])dnl
2220 +dnl ---------------------------------------------------------------------------
2221 +dnl CF_ARG_WITH version: 3 updated: 2000/07/20 00:41:18
2222 +dnl -----------
2223 +dnl Restricted form of AC_ARG_WITH that requires user to specify a value
2224 +dnl $1 = option name
2225 +dnl $2 = help message
2226 +dnl $3 = variable to set with the --with value
2227 +dnl $4 = default value, if any, must be constant.
2228 +dnl $5 = default value shown for --help if $4 is empty.
2229 +AC_DEFUN([CF_ARG_WITH],
2230 +[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,ifelse($5,,empty,$5),$4)),,
2231 +ifelse($4,,[withval="${$3}"],[withval="${$3-$4}"]))dnl
2232 +ifelse($4,,[test -n "$withval" && \
2233 +],[test -z "$withval" && withval=no
2234 +])dnl
2235 +case "$withval" in #(vi
2236 +yes)
2237 +  AC_ERROR(expected a value for --with-$1)
2238 +  ;; #(vi
2239 +no) withval=""
2240 +  ;;
2241 +esac
2242 +$3="$withval"
2243 +])dnl
2244 +dnl ---------------------------------------------------------------------------
2245 +dnl CF_BUNDLED_INTL version: 6 updated: 2003/06/06 00:48:41
2246 +dnl ---------------
2247 +dnl Top-level macro for configuring an application with a bundled copy of
2248 +dnl the intl and po directories for gettext.
2249 +dnl
2250 +dnl $1 specifies either Makefile or makefile, defaulting to the former.
2251 +dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls
2252 +dnl
2253 +dnl Sets variables which can be used to substitute in makefiles:
2254 +dnl    INTLDIR_MAKE - to make ./intl directory
2255 +dnl    MSG_DIR_MAKE - to make ./po directory
2256 +dnl    SUB_MAKEFILE - list of makefiles in ./intl, ./po directories
2257 +dnl Defines
2258 +dnl    HAVE_LIBGETTEXT_H if we're using ./intl
2259 +dnl
2260 +AC_DEFUN([CF_BUNDLED_INTL],[
2261 +cf_makefile=ifelse($1,,Makefile,$1)
2262 +
2263 +dnl Set of available languages (based on source distribution).  Note that
2264 +dnl setting $LINGUAS overrides $ALL_LINGUAS.  Some environments set $LINGUAS
2265 +dnl rather than $LC_ALL
2266 +test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
2267 +
2268 +AM_GNU_GETTEXT(,,,[$2])
2269 +
2270 +INTLDIR_MAKE=
2271 +MSG_DIR_MAKE=
2272 +SUB_MAKEFILE=
2273 +
2274 +dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE:
2275 +CF_OUR_MESSAGES($1)
2276 +
2277 +if test "$USE_INCLUDED_LIBINTL" = yes ; then
2278 +        if test "$nls_cv_force_use_gnu_gettext" = yes ; then
2279 +               SUB_MAKEFILE="$SUB_MAKEFILE intl/$cf_makefile"
2280 +       elif test "$nls_cv_use_gnu_gettext" = yes ; then
2281 +               SUB_MAKEFILE="$SUB_MAKEFILE intl/$cf_makefile"
2282 +       else
2283 +               INTLDIR_MAKE="#"
2284 +       fi
2285 +       if test -z "$INTLDIR_MAKE"; then
2286 +               AC_DEFINE(HAVE_LIBGETTEXT_H)
2287 +       fi
2288 +else
2289 +       INTLDIR_MAKE="#"
2290 +       if test "$USE_NLS" = yes ; then
2291 +               AC_CHECK_HEADERS(libintl.h)
2292 +       fi
2293 +fi
2294 +
2295 +if test -z "$INTLDIR_MAKE" ; then
2296 +       CPPFLAGS="-I../intl $CPPFLAGS"
2297 +fi
2298 +
2299 +dnl FIXME:  we use this in lynx (the alternative is a spurious dependency upon
2300 +dnl GNU make)
2301 +if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
2302 +       GT_YES="#"
2303 +       GT_NO=
2304 +else
2305 +       GT_YES=
2306 +       GT_NO="#"
2307 +fi
2308 +
2309 +AC_SUBST(INTLDIR_MAKE)
2310 +AC_SUBST(MSG_DIR_MAKE)
2311 +AC_SUBST(GT_YES)
2312 +AC_SUBST(GT_NO)
2313 +
2314 +dnl FIXME:  the underlying AM_GNU_GETTEXT macro either needs some fixes or a
2315 +dnl little documentation.  It doesn't define anything so that we can ifdef our
2316 +dnl own code, except ENABLE_NLS, which is too vague to be of any use.
2317 +
2318 +if test "$USE_INCLUDED_LIBINTL" = yes ; then
2319 +       if test "$nls_cv_force_use_gnu_gettext" = yes ; then
2320 +               AC_DEFINE(HAVE_GETTEXT)
2321 +       elif test "$nls_cv_use_gnu_gettext" = yes ; then
2322 +               AC_DEFINE(HAVE_GETTEXT)
2323 +       fi
2324 +       if test -n "$nls_cv_header_intl" ; then
2325 +               AC_DEFINE(HAVE_LIBINTL_H)
2326 +       fi
2327 +fi
2328 +])dnl
2329 +dnl ---------------------------------------------------------------------------
2330 +dnl CF_BUNDLED_PCRE version: 3 updated: 2002/04/17 21:09:56
2331 +dnl ---------------
2332 +dnl Top-level macro for configuring an application with a bundled copy of
2333 +dnl the pcre library.
2334 +dnl
2335 +dnl $1 specifies the top of the directory containing PCRE's include, lib dirs.
2336 +AC_DEFUN([CF_BUNDLED_PCRE],
2337 +[
2338 +cf_pcre_home=$1
2339 +PCREDIR_MAKE=
2340 +PCREDIR_LIBS=
2341 +PCREDIR_CPPFLAGS=
2342 +case .$cf_pcre_home in #(vi
2343 +.no) #(vi
2344 +       # setup to compile the bundled PCRE:
2345 +       . $srcdir/pcre/version.sh
2346 +       AC_SUBST(PCRE_MAJOR)
2347 +       AC_SUBST(PCRE_MINOR)
2348 +       AC_SUBST(PCRE_DATE)
2349 +       AC_SUBST(PCRE_DEFINES)
2350 +       ;;
2351 +.yes) #(vi
2352 +       PCREDIR_MAKE='#'
2353 +       PCREDIR_LIBS="-lpcre"
2354 +       ;;
2355 +.*)
2356 +       CF_PATH_SYNTAX(cf_pcre_home)
2357 +       PCREDIR_MAKE='#'
2358 +       PCREDIR_LIBS="-L${cf_pcre_home}/lib -lpcre"
2359 +       PCREDIR_CPPFLAGS="-I${cf_pcre_home}/include"
2360 +       ;;
2361 +esac
2362 +AC_SUBST(PCREDIR_MAKE)
2363 +AC_SUBST(PCREDIR_LIBS)
2364 +AC_SUBST(PCREDIR_CPPFLAGS)
2365 +])dnl
2366 +dnl ---------------------------------------------------------------------------
2367 +dnl CF_CHECK_1_DECL version: 5 updated: 2001/07/22 21:09:16
2368 +dnl ---------------
2369 +dnl Check for missing declarations in the system headers (adapted from vile).
2370 +dnl
2371 +dnl CHECK_DECL_FLAG and CHECK_DECL_HDRS must be set in configure.in
2372 +AC_DEFUN([CF_CHECK_1_DECL],
2373 +[
2374 +AC_MSG_CHECKING([for missing "$1" extern])
2375 +AC_CACHE_VAL([cf_cv_func_$1],[
2376 +CF_MSG_LOG([for missing "$1" external])
2377 +cf_save_CFLAGS="$CFLAGS"
2378 +CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
2379 +AC_TRY_LINK([
2380 +$CHECK_DECL_HDRS
2381 +
2382 +#undef $1
2383 +struct zowie { int a; double b; struct zowie *c; char d; };
2384 +extern struct zowie *$1();
2385 +],
2386 +[
2387 +],
2388 +[if test -n "$CHECK_DECL_HDRS" ; then
2389 +# try to work around system headers which are infested with non-standard syntax
2390 +CF_UPPER(cf_1_up,$1)
2391 +AC_TRY_COMPILE([
2392 +#define DECL_${cf_1_up}
2393 +$CHECK_DECL_HDRS
2394 +],[long x = 0],
2395 +[eval 'cf_cv_func_'$1'=yes'],
2396 +[eval 'cf_cv_func_'$1'=no'])
2397 +else
2398 +eval 'cf_cv_func_'$1'=yes'
2399 +fi
2400 +],
2401 +[eval 'cf_cv_func_'$1'=no'])
2402 +CFLAGS="$cf_save_CFLAGS"
2403 +])
2404 +eval 'cf_result=$cf_cv_func_'$1
2405 +AC_MSG_RESULT($cf_result)
2406 +test $cf_result = yes && AC_DEFINE_UNQUOTED(DECL_$2)
2407 +])dnl
2408 +dnl ---------------------------------------------------------------------------
2409 +dnl CF_CHECK_CACHE version: 7 updated: 2001/12/19 00:50:10
2410 +dnl --------------
2411 +dnl Check if we're accidentally using a cache from a different machine.
2412 +dnl Derive the system name, as a check for reusing the autoconf cache.
2413 +dnl
2414 +dnl If we've packaged config.guess and config.sub, run that (since it does a
2415 +dnl better job than uname).  Normally we'll use AC_CANONICAL_HOST, but allow
2416 +dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
2417 +dnl which is useful in cross-compiles.
2418 +AC_DEFUN([CF_CHECK_CACHE],
2419 +[
2420 +if test -f $srcdir/config.guess ; then
2421 +       ifelse([$1],,[AC_CANONICAL_HOST],[$1])
2422 +       system_name="$host_os"
2423 +else
2424 +       system_name="`(uname -s -r) 2>/dev/null`"
2425 +       if test -z "$system_name" ; then
2426 +               system_name="`(hostname) 2>/dev/null`"
2427 +       fi
2428 +fi
2429 +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
2430 +AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
2431 +
2432 +test -z "$system_name" && system_name="$cf_cv_system_name"
2433 +test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
2434 +
2435 +if test ".$system_name" != ".$cf_cv_system_name" ; then
2436 +       AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
2437 +       AC_ERROR("Please remove config.cache and try again.")
2438 +fi
2439 +])dnl
2440 +dnl ---------------------------------------------------------------------------
2441 +dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58
2442 +dnl ---------------
2443 +dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
2444 +dnl a build-configuration such as imake.  These have the pitfall that they
2445 +dnl often contain compiler-specific options which we cannot use, mixed with
2446 +dnl preprocessor options that we usually can.
2447 +AC_DEFUN([CF_CHECK_CFLAGS],
2448 +[
2449 +CF_VERBOSE(checking additions to CFLAGS)
2450 +cf_check_cflags="$CFLAGS"
2451 +cf_check_cppflags="$CPPFLAGS"
2452 +CF_ADD_CFLAGS($1,yes)
2453 +if test "$cf_check_cflags" != "$CFLAGS" ; then
2454 +AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
2455 +       [CF_VERBOSE(test-compile failed.  Undoing change to \$CFLAGS)
2456 +        if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
2457 +                CF_VERBOSE(but keeping change to \$CPPFLAGS)
2458 +        fi
2459 +        CFLAGS="$cf_check_flags"])
2460 +fi
2461 +])dnl
2462 +dnl ---------------------------------------------------------------------------
2463 +dnl CF_CHECK_DECL version: 2 updated: 1997/08/28 23:57:55
2464 +dnl -------------
2465 +AC_DEFUN([CF_CHECK_DECL],
2466 +[for ac_func in $1
2467 +do
2468 +CF_UPPER(ac_tr_func,$ac_func)
2469 +CF_CHECK_1_DECL(${ac_func}, ${ac_tr_func})dnl
2470 +done
2471 +])dnl
2472 +dnl ---------------------------------------------------------------------------
2473 +dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23
2474 +dnl --------------
2475 +dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
2476 +dnl the 'errno' variable.  Define a DECL_xxx symbol if we must declare it
2477 +dnl ourselves.
2478 +dnl
2479 +dnl $1 = the name to check
2480 +AC_DEFUN([CF_CHECK_ERRNO],
2481 +[
2482 +AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
2483 +    AC_TRY_COMPILE([
2484 +#ifdef HAVE_STDLIB_H
2485 +#include <stdlib.h>
2486 +#endif
2487 +#include <stdio.h>
2488 +#include <sys/types.h>
2489 +#include <errno.h> ],
2490 +    [long x = (long) $1],
2491 +    [cf_cv_dcl_$1=yes],
2492 +    [cf_cv_dcl_$1=no])
2493 +])
2494 +
2495 +if test "$cf_cv_dcl_$1" = no ; then
2496 +    CF_UPPER(cf_result,decl_$1)
2497 +    AC_DEFINE_UNQUOTED($cf_result)
2498 +fi
2499 +
2500 +# It's possible (for near-UNIX clones) that the data doesn't exist
2501 +CF_CHECK_EXTERN_DATA($1,int)
2502 +])dnl
2503 +dnl ---------------------------------------------------------------------------
2504 +dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23
2505 +dnl --------------------
2506 +dnl Check for existence of external data in the current set of libraries.  If
2507 +dnl we can modify it, it's real enough.
2508 +dnl $1 = the name to check
2509 +dnl $2 = its type
2510 +AC_DEFUN([CF_CHECK_EXTERN_DATA],
2511 +[
2512 +AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[
2513 +    AC_TRY_LINK([
2514 +#undef $1
2515 +extern $2 $1;
2516 +],
2517 +    [$1 = 2],
2518 +    [cf_cv_have_$1=yes],
2519 +    [cf_cv_have_$1=no])
2520 +])
2521 +
2522 +if test "$cf_cv_have_$1" = yes ; then
2523 +    CF_UPPER(cf_result,have_$1)
2524 +    AC_DEFINE_UNQUOTED($cf_result)
2525 +fi
2526 +
2527 +])dnl
2528 +dnl ---------------------------------------------------------------------------
2529 +dnl CF_CHECK_HEADERS version: 3 updated: 2000/11/03 11:14:19
2530 +dnl ----------------
2531 +dnl AC_CHECK_HEADERS(sys/socket.h) fails on OS/2 EMX because it demands that
2532 +dnl <sys/types.h> be included first.
2533 +dnl
2534 +dnl Also <sys/dir.h> and <sys/dirent.h> and <sys/stat.h>, but we normally do
2535 +dnl not do our own tests via AC_CHECK_HEADERS for those.
2536 +AC_DEFUN([CF_CHECK_HEADERS],[
2537 +for cf_hdr in $1
2538 +do
2539 +       AC_MSG_CHECKING(for $cf_hdr)
2540 +       AC_TRY_CPP([
2541 +#include <sys/types.h>
2542 +#include <$cf_hdr>
2543 +],[cf_found=yes],[cf_found=no])
2544 +AC_MSG_RESULT($cf_found)
2545 +if test $cf_found = yes ; then
2546 +       CF_UPPER(cf_tr_hdr,$cf_hdr)
2547 +       AC_DEFINE_UNQUOTED(HAVE_${cf_tr_hdr})
2548 +fi
2549 +done
2550 +])dnl
2551 +dnl ---------------------------------------------------------------------------
2552 +dnl CF_CHECK_IPV6 version: 2 updated: 2000/04/13 21:38:04
2553 +dnl -------------
2554 +dnl Check for IPV6 configuration.
2555 +AC_DEFUN([CF_CHECK_IPV6],[
2556 +CF_FIND_IPV6_TYPE
2557 +CF_FIND_IPV6_LIBS
2558 +
2559 +CF_FUNC_GETADDRINFO
2560 +
2561 +if test "$cf_cv_getaddrinfo" != "yes"; then
2562 +       if test "$cf_cv_ipv6type" != "linux"; then
2563 +               AC_MSG_ERROR(
2564 +[You must get working getaddrinfo() function,
2565 +or you can specify "--disable-ipv6"])
2566 +       else
2567 +               AC_MSG_WARN(
2568 +[The getaddrinfo() implementation on your system seems be buggy.
2569 +You should upgrade your system library to the newest version
2570 +of GNU C library (aka glibc).])
2571 +       fi
2572 +fi
2573 +
2574 +])dnl
2575 +dnl ---------------------------------------------------------------------------
2576 +dnl CF_CHECK_NESTED_PARAMS version: 2 updated: 1997/08/28 23:57:55
2577 +dnl ----------------------
2578 +dnl Check if the compiler allows nested parameter lists (some don't)
2579 +AC_DEFUN([CF_CHECK_NESTED_PARAMS],
2580 +[
2581 +AC_MSG_CHECKING([if nested parameters work])
2582 +AC_CACHE_VAL(cf_cv_nested_params,[
2583 +       AC_TRY_COMPILE([],
2584 +       [extern void (*sigdisp(int sig, void (*func)(int sig)))(int sig)],
2585 +       [cf_cv_nested_params=yes],
2586 +       [cf_cv_nested_params=no])
2587 +])
2588 +AC_MSG_RESULT($cf_cv_nested_params)
2589 +test $cf_cv_nested_params = yes && AC_DEFINE(HAVE_NESTED_PARAMS)
2590 +])dnl
2591 +dnl ---------------------------------------------------------------------------
2592 +dnl CF_COLOR_CURSES version: 6 updated: 2002/10/27 18:21:42
2593 +dnl ---------------
2594 +dnl Check if curses supports color.  (Note that while SVr3 curses supports
2595 +dnl color, it does this differently from SVr4 curses; more work would be needed
2596 +dnl to accommodate SVr3).
2597 +dnl
2598 +AC_DEFUN([CF_COLOR_CURSES],
2599 +[
2600 +AC_MSG_CHECKING(if curses supports color attributes)
2601 +AC_CACHE_VAL(cf_cv_color_curses,[
2602 +       AC_TRY_LINK([
2603 +#include <${cf_cv_ncurses_header-curses.h}>
2604 +],
2605 +       [chtype x = COLOR_BLUE;
2606 +        has_colors();
2607 +        start_color();
2608 +#ifndef NCURSES_BROKEN
2609 +        wbkgd(curscr, getbkgd(stdscr)); /* X/Open XPG4 aka SVr4 Curses */
2610 +#endif
2611 +       ],
2612 +       [cf_cv_color_curses=yes],
2613 +       [cf_cv_color_curses=no])
2614 +       ])
2615 +AC_MSG_RESULT($cf_cv_color_curses)
2616 +if test $cf_cv_color_curses = yes ; then
2617 +       AC_DEFINE(COLOR_CURSES)
2618 +       test ".$cf_cv_ncurses_broken" != .yes && AC_DEFINE(HAVE_GETBKGD)
2619 +fi
2620 +])dnl
2621 +dnl ---------------------------------------------------------------------------
2622 +dnl CF_COMPTYPE version: 2 updated: 1997/08/28 23:57:55
2623 +dnl -----------
2624 +dnl Check if the compiler uses 'void *' for qsort's compare function parameters
2625 +dnl (i.e., it's an ANSI prototype).
2626 +AC_DEFUN([CF_COMPTYPE],
2627 +[
2628 +AC_MSG_CHECKING([for ANSI qsort])
2629 +AC_CACHE_VAL(cf_cv_comptype,[
2630 +       AC_TRY_COMPILE([
2631 +#ifdef HAVE_STDLIB_H
2632 +#include <stdlib.h>
2633 +#endif],
2634 +       [extern int compare(const void *, const void *);
2635 +        char *foo = "string";
2636 +        qsort(foo, sizeof(foo)/sizeof(*foo), sizeof(*foo), compare)],
2637 +       [cf_cv_comptype=yes],
2638 +       [cf_cv_comptype=no])
2639 +])
2640 +AC_MSG_RESULT($cf_cv_comptype)
2641 +if test $cf_cv_comptype = yes; then
2642 +       AC_DEFINE(HAVE_COMPTYPE_VOID)
2643 +else
2644 +       AC_DEFINE(HAVE_COMPTYPE_CHAR)
2645 +fi
2646 +])dnl
2647 +dnl ---------------------------------------------------------------------------
2648 +dnl CF_COREFILE version: 2 updated: 1997/08/28 23:57:55
2649 +dnl -----------
2650 +dnl Check if the application can dump core (for debugging).
2651 +AC_DEFUN([CF_COREFILE],
2652 +[
2653 +AC_MSG_CHECKING([if application can dump core])
2654 +AC_CACHE_VAL(cf_cv_corefile,[
2655 +       AC_TRY_RUN([
2656 +#include <signal.h>
2657 +#include <sys/types.h>
2658 +#include <sys/stat.h>
2659 +int found()
2660 +{
2661 +       struct stat sb;
2662 +       return ((stat("core", &sb) == 0                 /* UNIX */
2663 +          ||    stat("conftest.core", &sb) == 0        /* FreeBSD */
2664 +               )
2665 +               && ((sb.st_mode & S_IFMT) == S_IFREG));
2666 +}
2667 +int main()
2668 +{
2669 +#ifdef __amiga__
2670 +/* Nicholas d'Alterio (nagd@ic.ac.uk) reports that the check for ability to
2671 + * core dump causes the machine to crash - reason unknown (gcc 2.7.2)
2672 + */
2673 +       exit(1);
2674 +#else
2675 +       int     pid, status;
2676 +       if (found())
2677 +               unlink("core");
2678 +       if (found())
2679 +               exit(1);
2680 +       if ((pid = fork()) != 0) {
2681 +               while (wait(&status) <= 0)
2682 +                       ;
2683 +       } else {
2684 +               abort();        /* this will dump core, if anything will */
2685 +       }
2686 +       if (found()) {
2687 +               unlink("core");
2688 +               exit(0);
2689 +       }
2690 +       exit(1);
2691 +#endif
2692 +}],
2693 +       [cf_cv_corefile=yes],
2694 +       [cf_cv_corefile=no],
2695 +       [cf_cv_corefile=unknown])])
2696 +AC_MSG_RESULT($cf_cv_corefile)
2697 +test $cf_cv_corefile = yes && AC_DEFINE(HAVE_COREFILE)
2698 +])dnl
2699 +dnl ---------------------------------------------------------------------------
2700 +dnl CF_CPP_CONCATS version: 2 updated: 1997/08/28 23:57:55
2701 +dnl --------------
2702 +dnl Test for ANSI token expansion (used in 'assert').
2703 +AC_DEFUN([CF_CPP_CONCATS],
2704 +[
2705 +AC_MSG_CHECKING([for ansi token concatenation])
2706 +AC_CACHE_VAL(cf_cv_cpp_concats,[
2707 +       AC_TRY_COMPILE([
2708 +#define concat(a,b) a ## b],
2709 +       [char *firstlast = "y", *s = concat(first,last)],
2710 +       [cf_cv_cpp_concats=yes],
2711 +       [cf_cv_cpp_concats=no])
2712 +])
2713 +AC_MSG_RESULT($cf_cv_cpp_concats)
2714 +test $cf_cv_cpp_concats = yes && AC_DEFINE(CPP_DOES_CONCAT)
2715 +])dnl
2716 +dnl ---------------------------------------------------------------------------
2717 +dnl CF_CPP_EXPANDS version: 2 updated: 1997/08/28 23:57:55
2718 +dnl --------------
2719 +dnl Test for ANSI token expansion (used in 'assert').
2720 +AC_DEFUN([CF_CPP_EXPANDS],
2721 +[
2722 +AC_MSG_CHECKING([for ansi token expansion/substitution])
2723 +AC_CACHE_VAL(cf_cv_cpp_expands,[
2724 +       AC_TRY_COMPILE([
2725 +#define string(n) #n],
2726 +       [char *s = string(token)],
2727 +       [cf_cv_cpp_expands=yes],
2728 +       [cf_cv_cpp_expands=no])
2729 +])
2730 +AC_MSG_RESULT($cf_cv_cpp_expands)
2731 +test $cf_cv_cpp_expands = yes && AC_DEFINE(CPP_DOES_EXPAND)
2732 +])dnl
2733 +dnl ---------------------------------------------------------------------------
2734 +dnl CF_CURSES_CPPFLAGS version: 7 updated: 2003/06/06 00:48:41
2735 +dnl ------------------
2736 +dnl Look for the curses headers.
2737 +AC_DEFUN([CF_CURSES_CPPFLAGS],[
2738 +
2739 +AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
2740 +cf_cv_curses_incdir=no
2741 +case $host_os in #(vi
2742 +hpux10.*|hpux11.*) #(vi
2743 +       test -d /usr/include/curses_colr && \
2744 +       cf_cv_curses_incdir="-I/usr/include/curses_colr"
2745 +       ;;
2746 +sunos3*|sunos4*)
2747 +       test -d /usr/5lib && \
2748 +       test -d /usr/5include && \
2749 +       cf_cv_curses_incdir="-I/usr/5include"
2750 +       ;;
2751 +esac
2752 +])
2753 +test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
2754 +
2755 +AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
2756 +cf_cv_ncurses_header=none
2757 +for cf_header in \
2758 +       curses.h \
2759 +       ncurses.h \
2760 +       ncurses/curses.h \
2761 +       ncurses/ncurses.h
2762 +do
2763 +AC_TRY_COMPILE([#include <${cf_header}>],
2764 +       [initscr(); tgoto("?", 0,0)],
2765 +       [cf_cv_ncurses_header=$cf_header; break],[])
2766 +done
2767 +])
2768 +
2769 +if test "$cf_cv_ncurses_header" = none ; then
2770 +       AC_MSG_ERROR(No curses header-files found)
2771 +fi
2772 +
2773 +# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2774 +AC_CHECK_HEADERS($cf_cv_ncurses_header)
2775 +
2776 +])dnl
2777 +dnl ---------------------------------------------------------------------------
2778 +dnl CF_CURSES_LIBS version: 22 updated: 2002/10/27 18:21:42
2779 +dnl --------------
2780 +dnl Look for the curses libraries.  Older curses implementations may require
2781 +dnl termcap/termlib to be linked as well.  Call CF_CURSES_CPPFLAGS first.
2782 +AC_DEFUN([CF_CURSES_LIBS],[
2783 +
2784 +AC_MSG_CHECKING(if we have identified curses libraries)
2785 +AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
2786 +       [initscr(); tgoto("?", 0,0)],
2787 +       cf_result=yes,
2788 +       cf_result=no)
2789 +AC_MSG_RESULT($cf_result)
2790 +
2791 +if test "$cf_result" = no ; then
2792 +case $host_os in #(vi
2793 +freebsd*) #(vi
2794 +       AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
2795 +       ;;
2796 +hpux10.*|hpux11.*) #(vi
2797 +       AC_CHECK_LIB(cur_colr,initscr,[
2798 +               LIBS="-lcur_colr $LIBS"
2799 +               ac_cv_func_initscr=yes
2800 +               ],[
2801 +       AC_CHECK_LIB(Hcurses,initscr,[
2802 +               # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
2803 +               LIBS="-lHcurses $LIBS"
2804 +               CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
2805 +               ac_cv_func_initscr=yes
2806 +               ])])
2807 +       ;;
2808 +linux*) # Suse Linux does not follow /usr/lib convention
2809 +       LIBS="$LIBS -L/lib"
2810 +       ;;
2811 +sunos3*|sunos4*)
2812 +       test -d /usr/5lib && \
2813 +       LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
2814 +       ac_cv_func_initscr=yes
2815 +       ;;
2816 +esac
2817 +
2818 +if test ".$ac_cv_func_initscr" != .yes ; then
2819 +       cf_save_LIBS="$LIBS"
2820 +       cf_term_lib=""
2821 +       cf_curs_lib=""
2822 +
2823 +       if test ".${cf_cv_ncurses_version-no}" != .no
2824 +       then
2825 +               cf_check_list="ncurses curses cursesX"
2826 +       else
2827 +               cf_check_list="cursesX curses ncurses"
2828 +       fi
2829 +
2830 +       # Check for library containing tgoto.  Do this before curses library
2831 +       # because it may be needed to link the test-case for initscr.
2832 +       AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
2833 +               for cf_term_lib in $cf_check_list termcap termlib unknown
2834 +               do
2835 +                       AC_CHECK_LIB($cf_term_lib,tgoto,[break])
2836 +               done
2837 +       ])
2838 +
2839 +       # Check for library containing initscr
2840 +       test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
2841 +       for cf_curs_lib in $cf_check_list xcurses jcurses unknown
2842 +       do
2843 +               AC_CHECK_LIB($cf_curs_lib,initscr,[break])
2844 +       done
2845 +       test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
2846 +
2847 +       LIBS="-l$cf_curs_lib $cf_save_LIBS"
2848 +       if test "$cf_term_lib" = unknown ; then
2849 +               AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
2850 +               AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
2851 +                       [initscr()],
2852 +                       [cf_result=yes],
2853 +                       [cf_result=no])
2854 +               AC_MSG_RESULT($cf_result)
2855 +               test $cf_result = no && AC_ERROR(Cannot link curses library)
2856 +       elif test "$cf_curs_lib" = "$cf_term_lib" ; then
2857 +               :
2858 +       elif test "$cf_term_lib" != predefined ; then
2859 +               AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
2860 +               AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
2861 +                       [initscr(); tgoto((char *)0, 0, 0);],
2862 +                       [cf_result=no],
2863 +                       [
2864 +                       LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
2865 +                       AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
2866 +                               [initscr()],
2867 +                               [cf_result=yes],
2868 +                               [cf_result=error])
2869 +                       ])
2870 +               AC_MSG_RESULT($cf_result)
2871 +       fi
2872 +fi
2873 +fi
2874 +
2875 +])dnl
2876 +dnl ---------------------------------------------------------------------------
2877 +dnl CF_CURSES_TERMCAP version: 10 updated: 2002/01/13 16:02:19
2878 +dnl -----------------
2879 +dnl Check if we should include <curses.h> to pick up prototypes for termcap
2880 +dnl functions.  On terminfo systems, these are normally declared in <curses.h>,
2881 +dnl but may be in <term.h>.  We check for termcap.h as an alternate, but it
2882 +dnl isn't standard (usually associated with GNU termcap).
2883 +dnl
2884 +dnl The 'tgoto()' function is declared in both terminfo and termcap.
2885 +dnl
2886 +dnl See CF_TYPE_OUTCHAR for more details.
2887 +AC_DEFUN([CF_CURSES_TERMCAP],
2888 +[
2889 +AC_REQUIRE([CF_CURSES_TERM_H])
2890 +AC_CACHE_CHECK(if we should include curses.h or termcap.h, cf_cv_need_curses_h,[
2891 +cf_save_CPPFLAGS="$CPPFLAGS"
2892 +cf_cv_need_curses_h=no
2893 +
2894 +for cf_t_opts in "" "NEED_TERMCAP_H"
2895 +do
2896 +for cf_c_opts in "" "NEED_CURSES_H"
2897 +do
2898 +
2899 +    CPPFLAGS="$cf_save_CPPFLAGS $CHECK_DECL_FLAG"
2900 +    test -n "$cf_c_opts" && CPPFLAGS="$CPPFLAGS -D$cf_c_opts"
2901 +    test -n "$cf_t_opts" && CPPFLAGS="$CPPFLAGS -D$cf_t_opts"
2902 +
2903 +    AC_TRY_LINK([/* $cf_c_opts $cf_t_opts */
2904 +$CHECK_DECL_HDRS],
2905 +       [char *x = (char *)tgoto("")],
2906 +       [test "$cf_cv_need_curses_h" = no && {
2907 +            cf_cv_need_curses_h=maybe
2908 +            cf_ok_c_opts=$cf_c_opts
2909 +            cf_ok_t_opts=$cf_t_opts
2910 +       }],
2911 +       [echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&AC_FD_CC
2912 +       AC_TRY_LINK([
2913 +$CHECK_DECL_HDRS],
2914 +       [char *x = (char *)tgoto("",0,0)],
2915 +       [cf_cv_need_curses_h=yes
2916 +        cf_ok_c_opts=$cf_c_opts
2917 +        cf_ok_t_opts=$cf_t_opts])])
2918 +
2919 +       CPPFLAGS="$cf_save_CPPFLAGS"
2920 +       test "$cf_cv_need_curses_h" = yes && break
2921 +done
2922 +       test "$cf_cv_need_curses_h" = yes && break
2923 +done
2924 +
2925 +if test "$cf_cv_need_curses_h" != no ; then
2926 +       echo "Curses/termcap test = $cf_cv_need_curses_h (C:$cf_ok_c_opts, T:$cf_ok_t_opts)" >&AC_FD_CC
2927 +       if test -n "$cf_ok_c_opts" ; then
2928 +               if test -n "$cf_ok_t_opts" ; then
2929 +                       cf_cv_need_curses_h=both
2930 +               else
2931 +                       cf_cv_need_curses_h=curses.h
2932 +               fi
2933 +       elif test -n "$cf_ok_t_opts" ; then
2934 +               cf_cv_need_curses_h=termcap.h
2935 +       elif test "$cf_cv_term_header" != no ; then
2936 +               cf_cv_need_curses_h=term.h
2937 +       else
2938 +               cf_cv_need_curses_h=no
2939 +       fi
2940 +fi
2941 +])
2942 +
2943 +case $cf_cv_need_curses_h in
2944 +both) #(vi
2945 +       AC_DEFINE_UNQUOTED(NEED_CURSES_H)
2946 +       AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
2947 +       ;;
2948 +curses.h) #(vi
2949 +       AC_DEFINE_UNQUOTED(NEED_CURSES_H)
2950 +       ;;
2951 +term.h) #(vi
2952 +       AC_DEFINE_UNQUOTED(NEED_TERM_H)
2953 +       ;;
2954 +termcap.h) #(vi
2955 +       AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
2956 +       ;;
2957 +esac
2958 +
2959 +])dnl
2960 +dnl ---------------------------------------------------------------------------
2961 +dnl CF_CURSES_TERM_H version: 4 updated: 2002/01/12 17:08:23
2962 +dnl ----------------
2963 +dnl SVr4 curses should have term.h as well (where it puts the definitions of
2964 +dnl the low-level interface).  This may not be true in old/broken implementations,
2965 +dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
2966 +dnl running with Solaris 2.5.1).
2967 +AC_DEFUN([CF_CURSES_TERM_H],
2968 +[
2969 +AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
2970 +for cf_header in \
2971 +       ncurses/term.h \
2972 +       term.h
2973 +do
2974 +       AC_TRY_COMPILE([
2975 +#include <${cf_cv_ncurses_header-curses.h}>
2976 +#include <${cf_header}>],
2977 +       [WINDOW *x],
2978 +       [cf_cv_term_header=$cf_header],
2979 +       [cf_cv_term_header=no])
2980 +done
2981 +])
2982 +
2983 +case $cf_cv_term_header in #(vi
2984 +term.h) #(vi
2985 +       AC_DEFINE(HAVE_TERM_H)
2986 +       ;;
2987 +ncurses/term.h)
2988 +       AC_DEFINE(HAVE_NCURSES_TERM_H)
2989 +       ;;
2990 +esac
2991 +])dnl
2992 +dnl ---------------------------------------------------------------------------
2993 +dnl CF_DEFAULT_SHELL version: 5 updated: 2002/12/04 00:06:27
2994 +dnl ----------------
2995 +dnl Look for a Bourne-shell compatible program from a list that we know about:
2996 +dnl    ash     Almquist Shell (sh based)
2997 +dnl    bash    Bourne Again Shell (sh, ksh based)
2998 +dnl    dash    Debian Almquist Shell (sh based)
2999 +dnl    jsh     Job Control Bourne Shell (sh based)
3000 +dnl    keysh   Key Shell (ksh based)
3001 +dnl    ksh     Korn Shell (sh based)
3002 +dnl    pdksh   Public-domain ksh
3003 +dnl    sh      Bourne Shell or POSIX Shell
3004 +dnl    zsh     Z Shell (sh, ksh based)
3005 +dnl On BSD systems look for a C Shell compatible program:
3006 +dnl    csh     C Shell
3007 +dnl    tcsh    TENEX C Shell (csh based)
3008 +AC_DEFUN([CF_DEFAULT_SHELL],
3009 +[
3010 +AC_MSG_CHECKING(for the default shell program)
3011 +cf_shell_progs="ifelse($1,,sh,[$1])"
3012 +if test -z "$cf_shell_progs" ; then
3013 +       cf_shell_progs="sh ksh bash zsh pdksh jsh keysh ash dash"
3014 +       # TIN preferred default shell for BSD systems is csh. Others are sh.
3015 +       AC_TRY_COMPILE([
3016 +#include <sys/params.h>],[
3017 +#if (defined(BSD) && (BSD >= 199103))
3018 +#else
3019 +make an error
3020 +#endif
3021 +],[$cf_shell_progs="csh tcsh $cf_shell_progs"])
3022 +fi
3023 +CF_MSG_LOG(paths of shell programs: $cf_shell_progs)
3024 +if test -s /etc/shells && test `egrep -c -v '^(#| |    |$)' /etc/shells` -gt 0; then
3025 +       CF_MSG_LOG(/etc/shells)
3026 +       for cf_prog in $cf_shell_progs
3027 +       do
3028 +               case $cf_prog in
3029 +                       /*)
3030 +                               cf_pattern="^"$cf_prog"$"
3031 +                               ;;
3032 +                       */*)
3033 +                               AC_MSG_ERROR(Program name must be absolute or filename: $cf_prog)
3034 +                               ;;
3035 +                       *)
3036 +                               cf_pattern="/"$cf_prog"$"
3037 +                               ;;
3038 +               esac
3039 +               cf_path=`egrep $cf_pattern /etc/shells 2>/dev/null`
3040 +               if test -n "$cf_path"
3041 +               then
3042 +                       for cf_shell in $cf_path
3043 +                       do
3044 +                               if test -f "$cf_shell"
3045 +                               then
3046 +                                       DEFAULT_SHELL="$cf_shell"
3047 +                                       break
3048 +                               fi
3049 +                       done
3050 +               fi
3051 +               if test -n "$DEFAULT_SHELL"
3052 +               then
3053 +                       break
3054 +               fi
3055 +       done
3056 +       AC_MSG_RESULT($DEFAULT_SHELL)
3057 +else
3058 +       CF_MSG_LOG($PATH)
3059 +AC_PATH_PROGS(DEFAULT_SHELL,
3060 +       $cf_shell_progs,,
3061 +       $PATH:/bin:/usr/bin:/usr/xpg4/bin:/bin/posix:/usr/bin/posix:/usr/old/bin:/usr/local/bin)
3062 +fi
3063 +if test -z "$DEFAULT_SHELL" ; then
3064 +       AC_MSG_WARN(
3065 +Cannot find the default shell you specified: $cf_shell_progs)
3066 +       if test -f /bin/false ; then
3067 +               AC_MSG_WARN(Using /bin/false instead)
3068 +               DEFAULT_SHELL=/bin/false
3069 +       else
3070 +               AC_MSG_ERROR(Cannot use /bin/false because it does not exist)
3071 +       fi
3072 +fi
3073 +AC_DEFINE_UNQUOTED(DEFAULT_SHELL,"$DEFAULT_SHELL")
3074 +])dnl
3075 +dnl ---------------------------------------------------------------------------
3076 +dnl CF_DEFINE_STRING version: 2 updated: 2001/07/22 21:09:16
3077 +dnl ----------------
3078 +dnl Define a string which may contain escaped quotes or backslashes
3079 +dnl $1 = symbol to define
3080 +dnl $2 = the information we want to quote
3081 +AC_DEFUN([CF_DEFINE_STRING],
3082 +[
3083 +cf_define=`echo $2|sed -e 's/\\\\/\\\\134/g' -e 's/^[[         ]]\\+//' -e 's/[[       ]]\\+$//' -e 's/"/\\\\042/g'`
3084 +AC_DEFINE_UNQUOTED($1, "$cf_define")
3085 +])dnl
3086 +dnl ---------------------------------------------------------------------------
3087 +dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
3088 +dnl ----------
3089 +dnl "dirname" is not portable, so we fake it with a shell script.
3090 +AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
3091 +dnl ---------------------------------------------------------------------------
3092 +dnl CF_DISABLE_ECHO version: 10 updated: 2003/04/17 22:27:11
3093 +dnl ---------------
3094 +dnl You can always use "make -n" to see the actual options, but it's hard to
3095 +dnl pick out/analyze warning messages when the compile-line is long.
3096 +dnl
3097 +dnl Sets:
3098 +dnl    ECHO_LT - symbol to control if libtool is verbose
3099 +dnl    ECHO_LD - symbol to prefix "cc -o" lines
3100 +dnl    RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
3101 +dnl    SHOW_CC - symbol to put before explicit "cc -c" lines
3102 +dnl    ECHO_CC - symbol to put before any "cc" line
3103 +dnl
3104 +AC_DEFUN([CF_DISABLE_ECHO],[
3105 +AC_MSG_CHECKING(if you want to see long compiling messages)
3106 +CF_ARG_DISABLE(echo,
3107 +       [  --disable-echo          display "compiling" commands],
3108 +       [
3109 +    ECHO_LT='--silent'
3110 +    ECHO_LD='@echo linking [$]@;'
3111 +    RULE_CC='  @echo compiling [$]<'
3112 +    SHOW_CC='  @echo compiling [$]@'
3113 +    ECHO_CC='@'
3114 +],[
3115 +    ECHO_LT=''
3116 +    ECHO_LD=''
3117 +    RULE_CC='# compiling'
3118 +    SHOW_CC='# compiling'
3119 +    ECHO_CC=''
3120 +])
3121 +AC_MSG_RESULT($enableval)
3122 +AC_SUBST(ECHO_LT)
3123 +AC_SUBST(ECHO_LD)
3124 +AC_SUBST(RULE_CC)
3125 +AC_SUBST(SHOW_CC)
3126 +AC_SUBST(ECHO_CC)
3127 +])dnl
3128 +dnl ---------------------------------------------------------------------------
3129 +dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
3130 +dnl --------
3131 +dnl Check if 'errno' is declared in <errno.h>
3132 +AC_DEFUN([CF_ERRNO],
3133 +[
3134 +CF_CHECK_ERRNO(errno)
3135 +])dnl
3136 +dnl ---------------------------------------------------------------------------
3137 +dnl CF_FIND_IPV6_LIBS version: 6 updated: 2002/11/09 09:05:18
3138 +dnl -----------------
3139 +dnl Based on the IPV6 stack type, look for the corresponding library.
3140 +AC_DEFUN([CF_FIND_IPV6_LIBS],[
3141 +AC_REQUIRE([CF_FIND_IPV6_TYPE])
3142 +
3143 +cf_ipv6lib=none
3144 +cf_ipv6dir=none
3145 +
3146 +AC_MSG_CHECKING(for IPv6 library if required)
3147 +case $cf_cv_ipv6type in #(vi
3148 +solaris) #(vi
3149 +       ;;
3150 +inria) #(vi
3151 +       ;;
3152 +kame) #(vi
3153 +       dnl http://www.kame.net/
3154 +       cf_ipv6lib=inet6
3155 +       cf_ipv6dir=v6
3156 +       ;;
3157 +linux-glibc) #(vi
3158 +       ;;
3159 +linux-libinet6) #(vi
3160 +       dnl http://www.v6.linux.or.jp/
3161 +       cf_ipv6lib=inet6
3162 +       cf_ipv6dir=inet6
3163 +       ;;
3164 +toshiba) #(vi
3165 +       cf_ipv6lib=inet6
3166 +       cf_ipv6dir=v6
3167 +       ;;
3168 +v6d) #(vi
3169 +       cf_ipv6lib=v6
3170 +       cf_ipv6dir=v6
3171 +       ;;
3172 +zeta)
3173 +       cf_ipv6lib=inet6
3174 +       cf_ipv6dir=v6
3175 +       ;;
3176 +esac
3177 +AC_MSG_RESULT($cf_ipv6lib)
3178 +
3179 +if test "$cf_ipv6lib" != "none"; then
3180 +
3181 +       AC_TRY_LINK([
3182 +#include <sys/types.h>
3183 +#include <netdb.h>
3184 +#include <netinet/in.h>
3185 +#include <netinet/ip6.h>],
3186 +       [getaddrinfo(0, 0, 0, 0)],,[
3187 +       CF_HEADER_PATH(cf_search,$cf_ipv6dir)
3188 +       for cf_incdir in $cf_search
3189 +       do
3190 +               cf_header=$cf_incdir/netinet/ip6.h
3191 +               if test -f $cf_header
3192 +               then
3193 +                       CPPFLAGS="$CPPFLAGS -I$cf_incdir"
3194 +                       test -n "$verbose" && echo "    ... found $cf_header" 1>&AC_FD_MSG
3195 +                       break
3196 +               fi
3197 +               test -n "$verbose" && echo "    ... tested $cf_header" 1>&AC_FD_MSG
3198 +       done
3199 +       ])
3200 +
3201 +       CF_FIND_LIBRARY([$cf_ipv6lib],[$cf_ipv6dir],[
3202 +#include <sys/types.h>
3203 +#include <netdb.h>
3204 +#include <netinet/in.h>
3205 +#include <netinet/ip6.h>],
3206 +       [getaddrinfo(0, 0, 0, 0)],
3207 +       [getaddrinfo],
3208 +       noexit)
3209 +       if test $cf_found_library = no ; then
3210 +               AC_MSG_ERROR(
3211 +[No $cf_ipv6lib library found, cannot continue.  You must fetch lib$cf_ipv6lib.a
3212 +from an appropriate IPv6 kit and compile beforehand.])
3213 +       fi
3214 +fi
3215 +
3216 +])dnl
3217 +dnl ---------------------------------------------------------------------------
3218 +dnl CF_FIND_IPV6_TYPE version: 5 updated: 2001/10/11 20:46:17
3219 +dnl -----------------
3220 +AC_DEFUN([CF_FIND_IPV6_TYPE],[
3221 +AC_CACHE_CHECK(ipv6 stack type, cf_cv_ipv6type, [
3222 +cf_cv_ipv6type=unknown
3223 +for i in solaris inria kame linux-glibc linux-libinet6 toshiba v6d zeta
3224 +do
3225 +       case $i in #(vi
3226 +       solaris) #(vi
3227 +               if test "SunOS" = "`uname -s`"
3228 +               then
3229 +                 if test -f /usr/include/netinet/ip6.h
3230 +                 then
3231 +                       cf_cv_ipv6type=$i
3232 +                 fi
3233 +               fi
3234 +               ;;
3235 +       inria) #(vi
3236 +               dnl http://www.kame.net/
3237 +               AC_EGREP_CPP(yes, [
3238 +#include <netinet/in.h>
3239 +#ifdef IPV6_INRIA_VERSION
3240 +yes
3241 +#endif],       [cf_cv_ipv6type=$i])
3242 +               ;;
3243 +       kame) #(vi
3244 +               dnl http://www.kame.net/
3245 +               AC_EGREP_CPP(yes, [
3246 +#include <netinet/in.h>
3247 +#ifdef __KAME__
3248 +yes
3249 +#endif],       [cf_cv_ipv6type=$i])
3250 +               ;;
3251 +       linux-glibc) #(vi
3252 +               dnl http://www.v6.linux.or.jp/
3253 +               AC_EGREP_CPP(yes, [
3254 +#include <features.h>
3255 +#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
3256 +yes
3257 +#endif],       [cf_cv_ipv6type=$i])
3258 +               ;;
3259 +       linux-libinet6) #(vi
3260 +               dnl http://www.v6.linux.or.jp/
3261 +               if test -d /usr/inet6
3262 +               then
3263 +                       cf_cv_ipv6type=$i
3264 +               elif test -f /usr/include/netinet/ip6.h
3265 +               then
3266 +                       cf_cv_ipv6type=$i
3267 +               fi
3268 +               ;;
3269 +       toshiba) #(vi
3270 +               AC_EGREP_CPP(yes, [
3271 +#include <sys/param.h>
3272 +#ifdef _TOSHIBA_INET6
3273 +yes
3274 +#endif],       [cf_cv_ipv6type=$i])
3275 +               ;;
3276 +       v6d) #(vi
3277 +               AC_EGREP_CPP(yes, [
3278 +#include </usr/local/v6/include/sys/v6config.h>
3279 +#ifdef __V6D__
3280 +yes
3281 +#endif],       [cf_cv_ipv6type=$i])
3282 +               ;;
3283 +       zeta)
3284 +               AC_EGREP_CPP(yes, [
3285 +#include <sys/param.h>
3286 +#ifdef _ZETA_MINAMI_INET6
3287 +yes
3288 +#endif],       [cf_cv_ipv6type=$i])
3289 +               ;;
3290 +       esac
3291 +       if test "$cf_cv_ipv6type" != "unknown"; then
3292 +               break
3293 +       fi
3294 +done
3295 +])
3296 +])dnl
3297 +dnl ---------------------------------------------------------------------------
3298 +dnl CF_FIND_LIBRARY version: 7 updated: 2000/04/13 21:38:04
3299 +dnl ---------------
3300 +dnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
3301 +dnl prefer a standard location, and use -L options only if we do not find the
3302 +dnl library in the standard library location(s).
3303 +dnl    $1 = library name
3304 +dnl    $2 = library class, usually the same as library name
3305 +dnl    $3 = includes
3306 +dnl    $4 = code fragment to compile/link
3307 +dnl    $5 = corresponding function-name
3308 +dnl    $6 = flag, nonnull if failure causes an error-exit
3309 +dnl
3310 +dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
3311 +dnl to use a -L option.
3312 +AC_DEFUN([CF_FIND_LIBRARY],
3313 +[
3314 +       eval 'cf_cv_have_lib_'$1'=no'
3315 +       cf_libdir=""
3316 +       AC_CHECK_FUNC($5,
3317 +               eval 'cf_cv_have_lib_'$1'=yes',[
3318 +               cf_save_LIBS="$LIBS"
3319 +               AC_MSG_CHECKING(for $5 in -l$1)
3320 +               LIBS="-l$1 $LIBS"
3321 +               AC_TRY_LINK([$3],[$4],
3322 +                       [AC_MSG_RESULT(yes)
3323 +                        eval 'cf_cv_have_lib_'$1'=yes'
3324 +                       ],
3325 +                       [AC_MSG_RESULT(no)
3326 +                       CF_LIBRARY_PATH(cf_search,$2)
3327 +                       for cf_libdir in $cf_search
3328 +                       do
3329 +                               AC_MSG_CHECKING(for -l$1 in $cf_libdir)
3330 +                               LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
3331 +                               AC_TRY_LINK([$3],[$4],
3332 +                                       [AC_MSG_RESULT(yes)
3333 +                                        eval 'cf_cv_have_lib_'$1'=yes'
3334 +                                        break],
3335 +                                       [AC_MSG_RESULT(no)
3336 +                                        LIBS="$cf_save_LIBS"])
3337 +                       done
3338 +                       ])
3339 +               ])
3340 +eval 'cf_found_library=[$]cf_cv_have_lib_'$1
3341 +ifelse($6,,[
3342 +if test $cf_found_library = no ; then
3343 +       AC_ERROR(Cannot link $1 library)
3344 +fi
3345 +])
3346 +])dnl
3347 +dnl ---------------------------------------------------------------------------
3348 +dnl CF_FIX_SLASHES version: 2 updated: 2001/05/27 21:36:02
3349 +dnl --------------
3350 +dnl OS/2 and Cygwin ports may pick up backslashes in pathnames, which are not
3351 +dnl usable in quoted strings.  Fix them.
3352 +dnl    $1=fixed($2)
3353 +AC_DEFUN([CF_FIX_SLASHES],
3354 +[
3355 +case $cf_cv_system_name in #(vi
3356 +os2*|cygwin*)
3357 +       $1=`echo "[$]$1" | sed -e 's%\\\\%/%g'`
3358 +       ;;
3359 +esac
3360 +])dnl
3361 +dnl ---------------------------------------------------------------------------
3362 +dnl CF_FUNC_FORK version: 2 updated: 1997/08/28 23:57:55
3363 +dnl ------------
3364 +dnl Check if 'fork()' is available, and working.  Amiga (and possibly other
3365 +dnl machines) have a non-working 'fork()' entrypoint.
3366 +AC_DEFUN([CF_FUNC_FORK],
3367 +[AC_MSG_CHECKING([for fork])
3368 +AC_CACHE_VAL(cf_cv_func_fork,[
3369 +AC_TRY_RUN([
3370 +int main()
3371 +{
3372 +       if (fork() < 0)
3373 +               exit(1);
3374 +       exit(0);
3375 +}],    [cf_cv_func_fork=yes],
3376 +       [cf_cv_func_fork=no],
3377 +       [cf_cv_func_fork=unknown])
3378 +])dnl
3379 +AC_MSG_RESULT($cf_cv_func_fork)
3380 +test $cf_cv_func_fork = yes && AC_DEFINE(HAVE_FORK)
3381 +])dnl
3382 +dnl ---------------------------------------------------------------------------
3383 +dnl CF_FUNC_GETADDRINFO version: 5 updated: 2000/09/28 06:18:08
3384 +dnl -------------------
3385 +dnl Look for a working version of getaddrinfo(), for IPV6 support.
3386 +AC_DEFUN([CF_FUNC_GETADDRINFO],[
3387 +AC_CACHE_CHECK(working getaddrinfo, cf_cv_getaddrinfo,[
3388 +AC_TRY_RUN([
3389 +#include <sys/types.h>
3390 +#include <netdb.h>
3391 +#include <string.h>
3392 +#include <sys/socket.h>
3393 +#include <netinet/in.h>
3394 +
3395 +#define expect(a,b) if (strcmp(a,b) != 0) goto bad
3396 +
3397 +int main()
3398 +{
3399 +   int passive, gaierr, inet4 = 0, inet6 = 0;
3400 +   struct addrinfo hints, *ai, *aitop;
3401 +   char straddr[INET6_ADDRSTRLEN], strport[16];
3402 +
3403 +   for (passive = 0; passive <= 1; passive++) {
3404 +     memset(&hints, 0, sizeof(hints));
3405 +     hints.ai_family = AF_UNSPEC;
3406 +     hints.ai_flags = passive ? AI_PASSIVE : 0;
3407 +     hints.ai_socktype = SOCK_STREAM;
3408 +     if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
3409 +       (void)gai_strerror(gaierr);
3410 +       goto bad;
3411 +     }
3412 +     for (ai = aitop; ai; ai = ai->ai_next) {
3413 +       if (ai->ai_addr == NULL ||
3414 +           ai->ai_addrlen == 0 ||
3415 +           getnameinfo(ai->ai_addr, ai->ai_addrlen,
3416 +                       straddr, sizeof(straddr), strport, sizeof(strport),
3417 +                       NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
3418 +         goto bad;
3419 +       }
3420 +       switch (ai->ai_family) {
3421 +       case AF_INET:
3422 +         expect(strport, "54321");
3423 +         if (passive) {
3424 +           expect(straddr, "0.0.0.0");
3425 +         } else {
3426 +           expect(straddr, "127.0.0.1");
3427 +         }
3428 +         inet4++;
3429 +         break;
3430 +       case AF_INET6:
3431 +         expect(strport, "54321");
3432 +         if (passive) {
3433 +           expect(straddr, "::");
3434 +         } else {
3435 +           expect(straddr, "::1");
3436 +         }
3437 +         inet6++;
3438 +         break;
3439 +       case AF_UNSPEC:
3440 +         goto bad;
3441 +         break;
3442 +       default:
3443 +         /* another family support? */
3444 +         break;
3445 +       }
3446 +     }
3447 +   }
3448 +
3449 +   if (!(inet4 == 0 || inet4 == 2))
3450 +     goto bad;
3451 +   if (!(inet6 == 0 || inet6 == 2))
3452 +     goto bad;
3453 +
3454 +   if (aitop)
3455 +     freeaddrinfo(aitop);
3456 +   exit(0);
3457 +
3458 +  bad:
3459 +   if (aitop)
3460 +     freeaddrinfo(aitop);
3461 +   exit(1);
3462 +}
3463 +],
3464 +[cf_cv_getaddrinfo=yes],
3465 +[cf_cv_getaddrinfo=no],
3466 +[cf_cv_getaddrinfo=unknown])
3467 +])
3468 +if test "$cf_cv_getaddrinfo" = yes ; then
3469 +       AC_DEFINE(HAVE_GAI_STRERROR)
3470 +       AC_DEFINE(HAVE_GETADDRINFO)
3471 +fi
3472 +])dnl
3473 +dnl ---------------------------------------------------------------------------
3474 +dnl CF_FUNC_MEMMOVE version: 5 updated: 2000/08/12 23:18:52
3475 +dnl ---------------
3476 +dnl Check for memmove, or a bcopy that can handle overlapping copy.  If neither
3477 +dnl is found, add our own version of memmove to the list of objects.
3478 +AC_DEFUN([CF_FUNC_MEMMOVE],
3479 +[
3480 +AC_CHECK_FUNC(memmove,,[
3481 +AC_CHECK_FUNC(bcopy,[
3482 +       AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[
3483 +               AC_TRY_RUN([
3484 +int main() {
3485 +       static char data[] = "abcdefghijklmnopqrstuwwxyz";
3486 +       char temp[40];
3487 +       bcopy(data, temp, sizeof(data));
3488 +       bcopy(temp+10, temp, 15);
3489 +       bcopy(temp+5, temp+15, 10);
3490 +       exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
3491 +}
3492 +               ],
3493 +               [cf_cv_good_bcopy=yes],
3494 +               [cf_cv_good_bcopy=no],
3495 +               [cf_cv_good_bcopy=unknown])
3496 +               ])
3497 +       ],[cf_cv_good_bcopy=no])
3498 +       if test "$cf_cv_good_bcopy" = yes ; then
3499 +               AC_DEFINE(USE_OK_BCOPY)
3500 +       else
3501 +               AC_DEFINE(USE_MY_MEMMOVE)
3502 +       fi
3503 +])])dnl
3504 +dnl ---------------------------------------------------------------------------
3505 +dnl CF_FUNC_SYSTEM version: 3 updated: 1997/10/22 22:02:10
3506 +dnl --------------
3507 +dnl Check if the 'system()' function returns a usable status, or if not, try
3508 +dnl to use the status returned by a SIGCHLD.
3509 +AC_DEFUN([CF_FUNC_SYSTEM],
3510 +[
3511 +AC_REQUIRE([CF_UNION_WAIT])
3512 +AC_MSG_CHECKING(if the system function returns usable child-status)
3513 +AC_CACHE_VAL(cf_cv_system_status,[
3514 +       AC_TRY_RUN([
3515 +#include <stdio.h>
3516 +#include <signal.h>
3517 +#if HAVE_SYS_WAIT_H
3518 +#include <sys/wait.h>
3519 +#endif
3520 +
3521 +RETSIGTYPE signal_handler (int sig)
3522 +{
3523 +#if HAVE_TYPE_UNIONWAIT
3524 +       union wait wait_status;
3525 +#else
3526 +       int wait_status = 1;
3527 +#endif
3528 +       int system_status;
3529 +       wait (&wait_status);
3530 +       system_status = WEXITSTATUS(wait_status); /* should be nonzero */
3531 +       exit(system_status != 23);
3532 +}
3533 +
3534 +int main()
3535 +{
3536 +       /* this looks weird, but apparently the SIGCHLD gets there first on
3537 +        * machines where 'system()' doesn't return a usable code, so ...
3538 +        */
3539 +       signal (SIGCHLD, signal_handler);
3540 +       system("exit 23");
3541 +       exit(1);
3542 +}
3543 +],
3544 +       [cf_cv_system_status=no],
3545 +       [AC_TRY_RUN(
3546 +       [int main() { exit(system("exit 23") != (23 << 8)); }],
3547 +       [cf_cv_system_status=yes],
3548 +       [cf_cv_system_status=unknown],
3549 +       [cf_cv_system_status=unknown])],
3550 +       [cf_cv_system_status=unknown])
3551 +])
3552 +AC_MSG_RESULT($cf_cv_system_status)
3553 +test $cf_cv_system_status = no && AC_DEFINE(USE_SYSTEM_STATUS)
3554 +])dnl
3555 +dnl ---------------------------------------------------------------------------
3556 +dnl CF_GCC_VERSION version: 2 updated: 2003/05/24 15:01:41
3557 +dnl --------------
3558 +dnl Find version of gcc
3559 +AC_DEFUN([CF_GCC_VERSION],[
3560 +AC_REQUIRE([AC_PROG_CC])
3561 +GCC_VERSION=none
3562 +if test "$GCC" = yes ; then
3563 +       AC_MSG_CHECKING(version of $CC)
3564 +       GCC_VERSION="`${CC} --version|head -1 | sed -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
3565 +       test -z "$GCC_VERSION" && GCC_VERSION=unknown
3566 +       AC_MSG_RESULT($GCC_VERSION)
3567 +fi
3568 +])dnl
3569 +dnl ---------------------------------------------------------------------------
3570 +dnl CF_GCC_WARNINGS version: 14 updated: 2003/05/24 15:03:15
3571 +dnl ---------------
3572 +dnl Check if the compiler supports useful warning options.  There's a few that
3573 +dnl we don't use, simply because they're too noisy:
3574 +dnl
3575 +dnl    -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
3576 +dnl    -Wredundant-decls (system headers make this too noisy)
3577 +dnl    -Wtraditional (combines too many unrelated messages, only a few useful)
3578 +dnl    -Wwrite-strings (too noisy, but should review occasionally).  This
3579 +dnl            is enabled for ncurses using "--enable-const".
3580 +dnl    -pedantic
3581 +dnl
3582 +AC_DEFUN([CF_GCC_WARNINGS],
3583 +[
3584 +AC_REQUIRE([CF_GCC_VERSION])
3585 +if ( test "$GCC" = yes || test "$GXX" = yes )
3586 +then
3587 +       cat > conftest.$ac_ext <<EOF
3588 +#line __oline__ "configure"
3589 +int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
3590 +EOF
3591 +       AC_CHECKING([for $CC warning options])
3592 +       cf_save_CFLAGS="$CFLAGS"
3593 +       EXTRA_CFLAGS="-W -Wall"
3594 +       cf_warn_CONST=""
3595 +       test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
3596 +       for cf_opt in \
3597 +               Wbad-function-cast \
3598 +               Wcast-align \
3599 +               Wcast-qual \
3600 +               Winline \
3601 +               Wmissing-declarations \
3602 +               Wmissing-prototypes \
3603 +               Wnested-externs \
3604 +               Wpointer-arith \
3605 +               Wshadow \
3606 +               Wstrict-prototypes \
3607 +               Wundef $cf_warn_CONST
3608 +       do
3609 +               CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
3610 +               if AC_TRY_EVAL(ac_compile); then
3611 +                       test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
3612 +                       case $cf_opt in #(vi
3613 +                       Wcast-qual) #(vi
3614 +                               CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
3615 +                               ;;
3616 +                       Winline) #(vi
3617 +                               case $GCC_VERSION in
3618 +                               3.3*)
3619 +                                       CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
3620 +                                       continue;;
3621 +                               esac
3622 +                               ;;
3623 +                       esac
3624 +                       EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3625 +               fi
3626 +       done
3627 +       rm -f conftest*
3628 +       CFLAGS="$cf_save_CFLAGS"
3629 +fi
3630 +AC_SUBST(EXTRA_CFLAGS)
3631 +])dnl
3632 +dnl ---------------------------------------------------------------------------
3633 +dnl CF_GNU_SOURCE version: 3 updated: 2000/10/29 23:30:53
3634 +dnl -------------
3635 +dnl Check if we must define _GNU_SOURCE to get a reasonable value for
3636 +dnl _XOPEN_SOURCE, upon which many POSIX definitions depend.  This is a defect
3637 +dnl (or misfeature) of glibc2, which breaks portability of many applications,
3638 +dnl since it is interwoven with GNU extensions.
3639 +dnl
3640 +dnl Well, yes we could work around it...
3641 +AC_DEFUN([CF_GNU_SOURCE],
3642 +[
3643 +AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
3644 +AC_TRY_COMPILE([#include <sys/types.h>],[
3645 +#ifndef _XOPEN_SOURCE
3646 +make an error
3647 +#endif],
3648 +       [cf_cv_gnu_source=no],
3649 +       [cf_save="$CPPFLAGS"
3650 +        CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3651 +        AC_TRY_COMPILE([#include <sys/types.h>],[
3652 +#ifdef _XOPEN_SOURCE
3653 +make an error
3654 +#endif],
3655 +       [cf_cv_gnu_source=no],
3656 +       [cf_cv_gnu_source=yes])
3657 +       CPPFLAGS="$cf_save"
3658 +       ])
3659 +])
3660 +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3661 +])dnl
3662 +dnl ---------------------------------------------------------------------------
3663 +dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
3664 +dnl --------------
3665 +dnl Construct a search-list for a nonstandard header-file
3666 +AC_DEFUN([CF_HEADER_PATH],
3667 +[CF_SUBDIR_PATH($1,$2,include)
3668 +test "$includedir" != NONE && \
3669 +test "$includedir" != "/usr/include" && \
3670 +test -d "$includedir" && {
3671 +       test -d $includedir &&    $1="[$]$1 $includedir"
3672 +       test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
3673 +}
3674 +
3675 +test "$oldincludedir" != NONE && \
3676 +test "$oldincludedir" != "/usr/include" && \
3677 +test -d "$oldincludedir" && {
3678 +       test -d $oldincludedir    && $1="[$]$1 $oldincludedir"
3679 +       test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
3680 +}
3681 +
3682 +])dnl
3683 +dnl ---------------------------------------------------------------------------
3684 +dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59
3685 +dnl ---------------
3686 +dnl Construct a search-list for a nonstandard library-file
3687 +AC_DEFUN([CF_LIBRARY_PATH],
3688 +[CF_SUBDIR_PATH($1,$2,lib)])dnl
3689 +dnl ---------------------------------------------------------------------------
3690 +dnl CF_LIB_PREFIX version: 7 updated: 2001/01/12 01:23:48
3691 +dnl -------------
3692 +dnl Compute the library-prefix for the given host system
3693 +dnl $1 = variable to set
3694 +AC_DEFUN([CF_LIB_PREFIX],
3695 +[
3696 +       case $cf_cv_system_name in
3697 +       OS/2*)  LIB_PREFIX=''     ;;
3698 +       os2*)   LIB_PREFIX=''     ;;
3699 +       *)      LIB_PREFIX='lib'  ;;
3700 +       esac
3701 +ifelse($1,,,[$1=$LIB_PREFIX])
3702 +       AC_SUBST(LIB_PREFIX)
3703 +])dnl
3704 +dnl ---------------------------------------------------------------------------
3705 +dnl CF_LOCKFILE version: 2 updated: 2001/05/26 12:41:02
3706 +dnl -----------
3707 +dnl Check for functions that we can use for file-locking.  Simply checking for
3708 +dnl existence is not sufficient, since fcntl, for example, uses definitions
3709 +dnl that are not in every version of the header.
3710 +AC_DEFUN([CF_LOCKFILE],
3711 +[
3712 +AC_CHECK_HEADERS(unistd.h fcntl.h sys/file.h)
3713 +AC_CHECK_FUNC(fcntl)
3714 +AC_CHECK_FUNC(lockf)
3715 +AC_CHECK_FUNC(flock,,,[
3716 +       CF_RECHECK_FUNC(flock,bsd,cf_cv_lockfile,[AC_MSG_WARN(no lock function found)])])
3717 +
3718 +AC_CACHE_CHECK(for file-locking functions,cf_cv_lockfile,[
3719 +cf_cv_lockfile=
3720 +for cf_lock in fcntl lockf flock
3721 +do
3722 +if eval 'test ${ac_cv_func_'$cf_lock'+set} = set'; then
3723 +       case $cf_lock in #(vi
3724 +       fcntl) #(vi
3725 +               AC_TRY_COMPILE([
3726 +#include <stdio.h>
3727 +#ifdef HAVE_UNISTD_H
3728 +#include <unistd.h>
3729 +#endif
3730 +#ifdef HAVE_FCNTL_H
3731 +#include <fcntl.h>
3732 +#endif
3733 +],[
3734 +       struct flock flk;
3735 +       int block = 1;
3736 +       int fd = 0;
3737 +       int rc;
3738 +
3739 +       flk.l_type = F_WRLCK;
3740 +       flk.l_whence = SEEK_SET;
3741 +       flk.l_start = 0;
3742 +       flk.l_len = 0;
3743 +       rc = fcntl(fd, block ? F_SETLKW : F_SETLK, &flk)
3744 +       && fcntl(fd, F_GETLK, &flk)
3745 +       && fcntl(fd, F_SETLK, &flk);
3746 +       ],,continue)
3747 +               ;;
3748 +       lockf) #(vi
3749 +               AC_TRY_COMPILE([
3750 +#include <stdio.h>
3751 +#ifdef HAVE_UNISTD_H
3752 +#include <unistd.h>
3753 +#endif
3754 +#ifdef HAVE_FCNTL_H
3755 +#include <fcntl.h>
3756 +#endif
3757 +],[
3758 +       int block = 1, fd = 0;
3759 +       int ret = lockf(fd, block ? F_LOCK : F_TLOCK, 0L)
3760 +        && lockf(fd, F_TEST, 0L)
3761 +        && lockf(fd, F_ULOCK, 0L);
3762 +       ],,[continue])
3763 +               ;;
3764 +       flock)
3765 +               AC_TRY_COMPILE([
3766 +#include <stdio.h>
3767 +#ifdef HAVE_UNISTD_H
3768 +#include <unistd.h>
3769 +#endif
3770 +#ifdef HAVE_FCNTL_H
3771 +#include <fcntl.h>
3772 +#endif
3773 +#ifdef HAVE_SYS_FILE_H
3774 +#include <sys/file.h>
3775 +#endif
3776 +],[
3777 +       int block = 1, fd = 0;
3778 +       int ret = flock(fd, (LOCK_EX|LOCK_NB))
3779 +        && flock(fd, LOCK_UN)
3780 +        && flock(fd, block ? LOCK_EX : (LOCK_EX | LOCK_NB));
3781 +       ],,[continue])
3782 +               ;;
3783 +       esac
3784 +       cf_cv_lockfile="$cf_cv_lockfile $cf_lock"
3785 +fi
3786 +done
3787 +])
3788 +])dnl
3789 +dnl ---------------------------------------------------------------------------
3790 +dnl CF_MAKEFLAGS version: 9 updated: 2001/12/30 18:17:27
3791 +dnl ------------
3792 +dnl Some 'make' programs support $(MAKEFLAGS), some $(MFLAGS), to pass 'make'
3793 +dnl options to lower-levels.  It's very useful for "make -n" -- if we have it.
3794 +dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
3795 +dnl $(MAKEFLAGS) variable incompatible because it adds the assignments :-)
3796 +AC_DEFUN([CF_MAKEFLAGS],
3797 +[
3798 +AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
3799 +       cf_cv_makeflags=''
3800 +       for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
3801 +       do
3802 +               cat >cf_makeflags.tmp <<CF_EOF
3803 +SHELL = /bin/sh
3804 +all :
3805 +       @ echo '.$cf_option'
3806 +CF_EOF
3807 +               cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
3808 +               case "$cf_result" in
3809 +               .*k)
3810 +                       cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3811 +                       case "$cf_result" in
3812 +                       .*CC=*) cf_cv_makeflags=
3813 +                               ;;
3814 +                       *)      cf_cv_makeflags=$cf_option
3815 +                               ;;
3816 +                       esac
3817 +                       break
3818 +                       ;;
3819 +               *)      echo no match "$cf_result"
3820 +                       ;;
3821 +               esac
3822 +       done
3823 +       rm -f cf_makeflags.tmp
3824 +])
3825 +
3826 +AC_SUBST(cf_cv_makeflags)
3827 +])dnl
3828 +dnl ---------------------------------------------------------------------------
3829 +dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52
3830 +dnl ----------
3831 +dnl Write a debug message to config.log, along with the line number in the
3832 +dnl configure script.
3833 +AC_DEFUN([CF_MSG_LOG],[
3834 +echo "(line __oline__) testing $* ..." 1>&AC_FD_CC
3835 +])dnl
3836 +dnl ---------------------------------------------------------------------------
3837 +dnl CF_NCURSES_BROKEN version: 6 updated: 1998/04/27 20:32:34
3838 +dnl -----------------
3839 +dnl Check for pre-1.9.9g ncurses (among other problems, the most obvious is
3840 +dnl that color combinations don't work).
3841 +AC_DEFUN([CF_NCURSES_BROKEN],
3842 +[
3843 +AC_REQUIRE([CF_NCURSES_VERSION])
3844 +if test "$cf_cv_ncurses_version" != no ; then
3845 +AC_MSG_CHECKING(for obsolete/broken version of ncurses)
3846 +AC_CACHE_VAL(cf_cv_ncurses_broken,[
3847 +AC_TRY_COMPILE([
3848 +#include <${cf_cv_ncurses_header-curses.h}>],[
3849 +#if defined(NCURSES_VERSION) && defined(wgetbkgd)
3850 +       make an error
3851 +#else
3852 +       int x = 1
3853 +#endif
3854 +],
3855 +       [cf_cv_ncurses_broken=no],
3856 +       [cf_cv_ncurses_broken=yes])
3857 +])
3858 +AC_MSG_RESULT($cf_cv_ncurses_broken)
3859 +if test "$cf_cv_ncurses_broken" = yes ; then
3860 +       AC_MSG_WARN(hmm... you should get an up-to-date version of ncurses)
3861 +       AC_DEFINE(NCURSES_BROKEN)
3862 +fi
3863 +fi
3864 +])dnl
3865 +dnl ---------------------------------------------------------------------------
3866 +dnl CF_NCURSES_CC_CHECK version: 3 updated: 2003/01/12 18:59:28
3867 +dnl -------------------
3868 +dnl Check if we can compile with ncurses' header file
3869 +dnl $1 is the cache variable to set
3870 +dnl $2 is the header-file to include
3871 +dnl $3 is the root name (ncurses or ncursesw)
3872 +AC_DEFUN([CF_NCURSES_CC_CHECK],[
3873 +       AC_TRY_COMPILE([
3874 +]ifelse($3,ncursesw,[
3875 +#define _XOPEN_SOURCE_EXTENDED
3876 +#undef  HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
3877 +#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
3878 +])[
3879 +#include <$2>],[
3880 +#ifdef NCURSES_VERSION
3881 +]ifelse($3,ncursesw,[
3882 +#ifndef WACS_BSSB
3883 +       make an error
3884 +#endif
3885 +])[
3886 +printf("%s\n", NCURSES_VERSION);
3887 +#else
3888 +#ifdef __NCURSES_H
3889 +printf("old\n");
3890 +#else
3891 +       make an error
3892 +#endif
3893 +#endif
3894 +       ]
3895 +       ,[$1=$cf_header]
3896 +       ,[$1=no])
3897 +])dnl
3898 +dnl ---------------------------------------------------------------------------
3899 +dnl CF_NCURSES_CPPFLAGS version: 16 updated: 2002/12/29 18:30:46
3900 +dnl -------------------
3901 +dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
3902 +dnl the CPPFLAGS variable so we can include its header.
3903 +dnl
3904 +dnl The header files may be installed as either curses.h, or ncurses.h (would
3905 +dnl be obsolete, except that some packagers prefer this name to distinguish it
3906 +dnl from a "native" curses implementation).  If not installed for overwrite,
3907 +dnl the curses.h file would be in an ncurses subdirectory (e.g.,
3908 +dnl /usr/include/ncurses), but someone may have installed overwriting the
3909 +dnl vendor's curses.  Only very old versions (pre-1.9.2d, the first autoconf'd
3910 +dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
3911 +dnl the header.
3912 +dnl
3913 +dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
3914 +dnl is already in the include-path, don't even bother with this, since we cannot
3915 +dnl easily determine which file it is.  In this case, it has to be <curses.h>.
3916 +dnl
3917 +dnl The optional parameter gives the root name of the library, in case it is
3918 +dnl not installed as the default curses library.  That is how the
3919 +dnl wide-character version of ncurses is installed.
3920 +AC_DEFUN([CF_NCURSES_CPPFLAGS],
3921 +[AC_REQUIRE([CF_WITH_CURSES_DIR])
3922 +
3923 +cf_ncuhdr_root=ifelse($1,,ncurses,$1)
3924 +
3925 +test -n "$cf_cv_curses_dir" && \
3926 +test "$cf_cv_curses_dir" != "no" && \
3927 +CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
3928 +
3929 +AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
3930 +       cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3931 +       ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3932 +       for cf_header in $cf_header_list
3933 +       do
3934 +               CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
3935 +               test "$cf_cv_ncurses_h" != no && break
3936 +       done
3937 +])
3938 +
3939 +if test "$cf_cv_ncurses_h" != no ; then
3940 +       cf_cv_ncurses_header=$cf_cv_ncurses_h
3941 +else
3942 +AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
3943 +       test -n "$verbose" && echo
3944 +       CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
3945 +       test -n "$verbose" && echo search path $cf_search
3946 +       cf_save2_CPPFLAGS="$CPPFLAGS"
3947 +       for cf_incdir in $cf_search
3948 +       do
3949 +               CF_ADD_INCDIR($cf_incdir)
3950 +               for cf_header in \
3951 +                       ncurses.h \
3952 +                       curses.h
3953 +               do
3954 +                       CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
3955 +                       if test "$cf_cv_ncurses_h2" != no ; then
3956 +                               cf_cv_ncurses_h2=$cf_incdir/$cf_header
3957 +                               test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&AC_FD_MSG
3958 +                               break
3959 +                       fi
3960 +                       test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
3961 +               done
3962 +               CPPFLAGS="$cf_save2_CPPFLAGS"
3963 +               test "$cf_cv_ncurses_h2" != no && break
3964 +       done
3965 +       test "$cf_cv_ncurses_h2" = no && AC_ERROR(not found)
3966 +       ])
3967 +
3968 +       CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
3969 +       cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
3970 +       if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
3971 +               cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
3972 +       fi
3973 +       CF_ADD_INCDIR($cf_1st_incdir)
3974 +
3975 +fi
3976 +
3977 +AC_DEFINE(NCURSES)
3978 +
3979 +case $cf_cv_ncurses_header in # (vi
3980 +*ncurses.h)
3981 +       AC_DEFINE(HAVE_NCURSES_H)
3982 +       ;;
3983 +esac
3984 +
3985 +case $cf_cv_ncurses_header in # (vi
3986 +ncurses/curses.h|ncurses/ncurses.h)
3987 +       AC_DEFINE(HAVE_NCURSES_NCURSES_H)
3988 +       ;;
3989 +ncursesw/curses.h|ncursesw/ncurses.h)
3990 +       AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
3991 +       ;;
3992 +esac
3993 +
3994 +CF_NCURSES_VERSION
3995 +])dnl
3996 +dnl ---------------------------------------------------------------------------
3997 +dnl CF_NCURSES_LIBS version: 11 updated: 2002/12/22 14:22:25
3998 +dnl ---------------
3999 +dnl Look for the ncurses library.  This is a little complicated on Linux,
4000 +dnl because it may be linked with the gpm (general purpose mouse) library.
4001 +dnl Some distributions have gpm linked with (bsd) curses, which makes it
4002 +dnl unusable with ncurses.  However, we don't want to link with gpm unless
4003 +dnl ncurses has a dependency, since gpm is normally set up as a shared library,
4004 +dnl and the linker will record a dependency.
4005 +dnl
4006 +dnl The optional parameter gives the root name of the library, in case it is
4007 +dnl not installed as the default curses library.  That is how the
4008 +dnl wide-character version of ncurses is installed.
4009 +AC_DEFUN([CF_NCURSES_LIBS],
4010 +[AC_REQUIRE([CF_NCURSES_CPPFLAGS])
4011 +
4012 +cf_nculib_root=ifelse($1,,ncurses,$1)
4013 +       # This works, except for the special case where we find gpm, but
4014 +       # ncurses is in a nonstandard location via $LIBS, and we really want
4015 +       # to link gpm.
4016 +cf_ncurses_LIBS=""
4017 +cf_ncurses_SAVE="$LIBS"
4018 +AC_CHECK_LIB(gpm,Gpm_Open,
4019 +       [AC_CHECK_LIB(gpm,initscr,
4020 +               [LIBS="$cf_ncurses_SAVE"],
4021 +               [cf_ncurses_LIBS="-lgpm"])])
4022 +
4023 +case $host_os in #(vi
4024 +freebsd*)
4025 +       # This is only necessary if you are linking against an obsolete
4026 +       # version of ncurses (but it should do no harm, since it's static).
4027 +       AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
4028 +       ;;
4029 +esac
4030 +
4031 +LIBS="$cf_ncurses_LIBS $LIBS"
4032 +
4033 +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4034 +then
4035 +       LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
4036 +else
4037 +       CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
4038 +               [#include <${cf_cv_ncurses_header-curses.h}>],
4039 +               [initscr()],
4040 +               initscr)
4041 +fi
4042 +
4043 +if test -n "$cf_ncurses_LIBS" ; then
4044 +       AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
4045 +       cf_ncurses_SAVE="$LIBS"
4046 +       for p in $cf_ncurses_LIBS ; do
4047 +               q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
4048 +               if test "$q" != "$LIBS" ; then
4049 +                       LIBS="$q"
4050 +               fi
4051 +       done
4052 +       AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
4053 +               [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
4054 +               [AC_MSG_RESULT(yes)],
4055 +               [AC_MSG_RESULT(no)
4056 +                LIBS="$cf_ncurses_SAVE"])
4057 +fi
4058 +
4059 +CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
4060 +AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
4061 +])dnl
4062 +dnl ---------------------------------------------------------------------------
4063 +dnl CF_NCURSES_VERSION version: 10 updated: 2002/10/27 18:21:42
4064 +dnl ------------------
4065 +dnl Check for the version of ncurses, to aid in reporting bugs, etc.
4066 +dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS.  We don't use
4067 +dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
4068 +AC_DEFUN([CF_NCURSES_VERSION],
4069 +[
4070 +AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
4071 +       cf_cv_ncurses_version=no
4072 +       cf_tempfile=out$$
4073 +       rm -f $cf_tempfile
4074 +       AC_TRY_RUN([
4075 +#include <${cf_cv_ncurses_header-curses.h}>
4076 +#include <stdio.h>
4077 +int main()
4078 +{
4079 +       FILE *fp = fopen("$cf_tempfile", "w");
4080 +#ifdef NCURSES_VERSION
4081 +# ifdef NCURSES_VERSION_PATCH
4082 +       fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4083 +# else
4084 +       fprintf(fp, "%s\n", NCURSES_VERSION);
4085 +# endif
4086 +#else
4087 +# ifdef __NCURSES_H
4088 +       fprintf(fp, "old\n");
4089 +# else
4090 +       make an error
4091 +# endif
4092 +#endif
4093 +       exit(0);
4094 +}],[
4095 +       cf_cv_ncurses_version=`cat $cf_tempfile`],,[
4096 +
4097 +       # This will not work if the preprocessor splits the line after the
4098 +       # Autoconf token.  The 'unproto' program does that.
4099 +       cat > conftest.$ac_ext <<EOF
4100 +#include <${cf_cv_ncurses_header-curses.h}>
4101 +#undef Autoconf
4102 +#ifdef NCURSES_VERSION
4103 +Autoconf NCURSES_VERSION
4104 +#else
4105 +#ifdef __NCURSES_H
4106 +Autoconf "old"
4107 +#endif
4108 +;
4109 +#endif
4110 +EOF
4111 +       cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
4112 +       AC_TRY_EVAL(cf_try)
4113 +       if test -f conftest.out ; then
4114 +               cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'`
4115 +               test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4116 +               rm -f conftest.out
4117 +       fi
4118 +])
4119 +       rm -f $cf_tempfile
4120 +])
4121 +test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
4122 +])dnl
4123 +dnl ---------------------------------------------------------------------------
4124 +dnl CF_NETLIBS version: 4 updated: 1999/12/23 15:20:39
4125 +dnl ----------
4126 +dnl After checking for functions in the default $LIBS, make a further check
4127 +dnl for the functions that are netlib-related (these aren't always in the
4128 +dnl libc, etc., and have to be handled specially because there are conflicting
4129 +dnl and broken implementations.
4130 +dnl Common library requirements (in order):
4131 +dnl    -lresolv -lsocket -lnsl
4132 +dnl    -lnsl -lsocket
4133 +dnl    -lsocket
4134 +dnl    -lbsd
4135 +AC_DEFUN([CF_NETLIBS],[
4136 +cf_test_netlibs=no
4137 +AC_MSG_CHECKING(for network libraries)
4138 +AC_CACHE_VAL(cf_cv_netlibs,[
4139 +AC_MSG_RESULT(working...)
4140 +cf_cv_netlibs=""
4141 +cf_test_netlibs=yes
4142 +AC_CHECK_FUNCS(gethostname,,[
4143 +       CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
4144 +               CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
4145 +#
4146 +# FIXME:  sequent needs this library (i.e., -lsocket -linet -lnsl), but
4147 +# I don't know the entrypoints - 97/7/22 TD
4148 +# AC_HAVE_LIBRARY(inet,cf_cv_netlibs="-linet $cf_cv_netlibs")
4149 +AC_CHECK_LIB(inet, main, cf_cv_netlibs="-linet $cf_cv_netlibs")
4150 +#
4151 +if test "$ac_cv_func_lsocket" != no ; then
4152 +AC_CHECK_FUNCS(socket,,[
4153 +       CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
4154 +               CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
4155 +fi
4156 +#
4157 +AC_CHECK_FUNCS(gethostbyname,,[
4158 +       CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
4159 +#
4160 +AC_CHECK_FUNCS(strcasecmp,,[
4161 +       CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
4162 +])
4163 +LIBS="$LIBS $cf_cv_netlibs"
4164 +test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
4165 +])dnl
4166 +dnl ---------------------------------------------------------------------------
4167 +dnl CF_OUR_MESSAGES version: 4 updated: 2003/06/06 00:48:41
4168 +dnl ---------------
4169 +dnl Check if we use the messages included with this program
4170 +dnl
4171 +dnl $1 specifies either Makefile or makefile, defaulting to the former.
4172 +dnl
4173 +dnl Sets variables which can be used to substitute in makefiles:
4174 +dnl    MSG_DIR_MAKE - to make ./po directory
4175 +dnl    SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL)
4176 +dnl
4177 +AC_DEFUN([CF_OUR_MESSAGES],
4178 +[
4179 +cf_makefile=ifelse($1,,Makefile,$1)
4180 +
4181 +use_our_messages=no
4182 +if test "$USE_NLS" = yes ; then
4183 +if test -d $srcdir/po ; then
4184 +AC_MSG_CHECKING(if we should use included message-library)
4185 +       AC_ARG_ENABLE(included-msgs,
4186 +       [  --enable-included-msgs  use included messages, for i18n support],
4187 +       [use_our_messages=$enableval],
4188 +       [use_our_messages=yes])
4189 +fi
4190 +AC_MSG_RESULT($use_our_messages)
4191 +fi
4192 +
4193 +MSG_DIR_MAKE="#"
4194 +if test "$use_our_messages" = yes
4195 +then
4196 +       SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:po/$cf_makefile.inn"
4197 +       MSG_DIR_MAKE=
4198 +fi
4199 +
4200 +AC_SUBST(MSG_DIR_MAKE)
4201 +AC_SUBST(SUB_MAKEFILE)
4202 +])dnl
4203 +dnl ---------------------------------------------------------------------------
4204 +dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53
4205 +dnl ----------
4206 +dnl Provide a value for the $PATH and similar separator
4207 +AC_DEFUN([CF_PATHSEP],
4208 +[
4209 +       case $cf_cv_system_name in
4210 +       os2*)   PATHSEP=';'  ;;
4211 +       *)      PATHSEP=':'  ;;
4212 +       esac
4213 +ifelse($1,,,[$1=$PATHSEP])
4214 +       AC_SUBST(PATHSEP)
4215 +])dnl
4216 +dnl ---------------------------------------------------------------------------
4217 +dnl CF_PATH_EDITOR version: 5 updated: 2000/07/20 00:41:18
4218 +dnl --------------
4219 +dnl Look for the default editor (vi)
4220 +AC_DEFUN([CF_PATH_EDITOR],
4221 +[
4222 +AC_MSG_CHECKING(for default editor)
4223 +CF_ARG_WITH(editor,
4224 +    [  --with-editor=PROG      specify editor],
4225 +    [DEFAULT_EDITOR],,vi)
4226 +if test -z "$DEFAULT_EDITOR" ; then
4227 +    if test -n "$EDITOR" ; then
4228 +       DEFAULT_EDITOR="$EDITOR"
4229 +    elif test -n "$VISUAL" ; then
4230 +       DEFAULT_EDITOR="$VISUAL"
4231 +    else
4232 +       AC_PATH_PROG(DEFAULT_EDITOR,vi,vi,$PATH:/usr/bin:/usr/ucb)
4233 +    fi
4234 +fi
4235 +AC_MSG_RESULT($DEFAULT_EDITOR)
4236 +AC_DEFINE_UNQUOTED(DEFAULT_EDITOR,"$DEFAULT_EDITOR")
4237 +])dnl
4238 +dnl ---------------------------------------------------------------------------
4239 +dnl CF_PATH_MAILBOX version: 4 updated: 1998/04/01 11:39:13
4240 +dnl ---------------
4241 +dnl Look for the directory that contains incoming mail.  I would check for an
4242 +dnl actual mail-file, to verify this, but that is not always easy to arrange.
4243 +AC_DEFUN([CF_PATH_MAILBOX],
4244 +[
4245 +AC_MSG_CHECKING(for incoming-mail directory)
4246 +CF_ARG_WITH(mailbox,
4247 +    [  --with-mailbox=DIR      directory for incoming mailboxes],
4248 +    [DEFAULT_MAILBOX])
4249 +if test -z "$DEFAULT_MAILBOX" ; then
4250 +for cf_dir in \
4251 +       /var/spool/mail \
4252 +       /usr/spool/mail \
4253 +       /var/mail \
4254 +       /usr/mail \
4255 +       /mail
4256 +    do
4257 +       if test -d $cf_dir ; then
4258 +           DEFAULT_MAILBOX=$cf_dir
4259 +           break
4260 +       fi
4261 +    done
4262 +fi
4263 +if test -n "$DEFAULT_MAILBOX" ; then
4264 +       AC_DEFINE_UNQUOTED(DEFAULT_MAILBOX,"$DEFAULT_MAILBOX")
4265 +else
4266 +       DEFAULT_MAILBOX=none
4267 +fi
4268 +AC_MSG_RESULT($DEFAULT_MAILBOX)
4269 +])dnl
4270 +dnl ---------------------------------------------------------------------------
4271 +dnl CF_PATH_MAILER version: 6 updated: 2001/05/27 21:36:02
4272 +dnl --------------
4273 +dnl Look for the program that sends outgoing mail.
4274 +AC_DEFUN([CF_PATH_MAILER],
4275 +[
4276 +AC_PATH_PROG(DEFAULT_MAILER,sendmail,,$PATH:/usr/sbin:/usr/lib)
4277 +CF_ARG_WITH(mailer,
4278 +     [  --with-mailer=PROG      specify default mailer-program],
4279 +     [DEFAULT_MAILER],,mailx)
4280 +if test -z "$DEFAULT_MAILER" ; then
4281 +AC_PATH_PROG(DEFAULT_MAILER,mailx,,$PATH:/usr/bin)
4282 +fi
4283 +if test -z "$DEFAULT_MAILER" ; then
4284 +AC_PATH_PROG(DEFAULT_MAILER,mail,,$PATH:/usr/bin)
4285 +fi
4286 +AC_MSG_CHECKING(for default mailer)
4287 +if test -n "$DEFAULT_MAILER" ; then
4288 +       CF_FIX_SLASHES(ac_cv_path_DEFAULT_MAILER)
4289 +       CF_FIX_SLASHES(DEFAULT_MAILER)
4290 +       AC_DEFINE_UNQUOTED(DEFAULT_MAILER,"$DEFAULT_MAILER")
4291 +else
4292 +       DEFAULT_MAILER=none
4293 +fi
4294 +AC_MSG_RESULT($DEFAULT_MAILER)
4295 +])dnl
4296 +dnl ---------------------------------------------------------------------------
4297 +dnl CF_PATH_SYNTAX version: 9 updated: 2002/09/17 23:03:38
4298 +dnl --------------
4299 +dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
4300 +dnl begins with one of the prefix/exec_prefix variables, and then again if the
4301 +dnl result begins with 'NONE'.  This is necessary to work around autoconf's
4302 +dnl delayed evaluation of those symbols.
4303 +AC_DEFUN([CF_PATH_SYNTAX],[
4304 +case ".[$]$1" in #(vi
4305 +.\[$]\(*\)*|.\'*\'*) #(vi
4306 +  ;;
4307 +..|./*|.\\*) #(vi
4308 +  ;;
4309 +.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
4310 +  ;;
4311 +.\[$]{*prefix}*) #(vi
4312 +  eval $1="[$]$1"
4313 +  case ".[$]$1" in #(vi
4314 +  .NONE/*)
4315 +    $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
4316 +    ;;
4317 +  esac
4318 +  ;; #(vi
4319 +.NONE/*)
4320 +  $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
4321 +  ;;
4322 +*)
4323 +  ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
4324 +  ;;
4325 +esac
4326 +])dnl
4327 +dnl ---------------------------------------------------------------------------
4328 +dnl CF_PDCURSES_X11 version: 6 updated: 2002/10/27 18:21:42
4329 +dnl ---------------
4330 +dnl Configure for PDCurses' X11 library
4331 +AC_DEFUN([CF_PDCURSES_X11],[
4332 +AC_REQUIRE([CF_X_ATHENA])
4333 +LDFLAGS="$LDFLAGS $X_LIBS"
4334 +CF_CHECK_CFLAGS($X_CFLAGS)
4335 +AC_CHECK_LIB(X11,XOpenDisplay,
4336 +       [LIBS="-lX11 $LIBS"],,
4337 +       [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
4338 +AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[
4339 +LIBS="-lXCurses $LIBS"
4340 +AC_TRY_LINK([
4341 +#include <xcurses.h>
4342 +char *XCursesProgramName = "test";
4343 +],[XCursesExit();],
4344 +[cf_cv_lib_XCurses=yes],
4345 +[cf_cv_lib_XCurses=no])
4346 +])
4347 +if test $cf_cv_lib_XCurses = yes ; then
4348 +       AC_DEFINE(UNIX)
4349 +       AC_DEFINE(XCURSES)
4350 +       AC_DEFINE(HAVE_XCURSES)
4351 +else
4352 +       AC_ERROR(Cannot link with XCurses)
4353 +fi
4354 +])dnl
4355 +dnl ---------------------------------------------------------------------------
4356 +dnl CF_POSIX_JC version: 3 updated: 2001/05/27 21:36:02
4357 +dnl -----------
4358 +dnl Check if we have POSIX-style job control (i.e., sigaction), or if we must
4359 +dnl use the signal functions.  Use AC_CHECK_FUNCS(sigaction) first.
4360 +AC_DEFUN([CF_POSIX_JC],[
4361 +
4362 +AC_REQUIRE([AC_TYPE_SIGNAL])
4363 +AC_REQUIRE([CF_SIG_ARGS])
4364 +
4365 +if test "$ac_cv_func_sigaction" = yes; then
4366 +
4367 +AC_CACHE_CHECK(whether sigaction needs _POSIX_SOURCE,cf_cv_sigact_bad,[
4368 +AC_TRY_COMPILE([
4369 +#include <sys/types.h>
4370 +#include <signal.h>],[struct sigaction act],
4371 +  [cf_cv_sigact_bad=no],[cf_cv_sigact_bad=yes])
4372 +])
4373 +
4374 +test "$cf_cv_sigact_bad" = yes && AC_DEFINE(SVR4_ACTION)
4375 +
4376 +AC_CACHE_CHECK(if we have sigaction/related functions,cf_cv_sigaction_funcs,[
4377 +AC_TRY_LINK([
4378 +#ifdef SVR4_ACTION
4379 +#define _POSIX_SOURCE
4380 +#endif
4381 +#include <sys/types.h>
4382 +#include <signal.h>],[
4383 +    RETSIGTYPE (*func)(SIG_ARGS) = SIG_IGN;
4384 +    struct sigaction sa, osa;
4385 +    sa.sa_handler = func;
4386 +    sa.sa_flags = 0;
4387 +    sigemptyset (&sa.sa_mask);
4388 +    sigaction (SIGBUS,&sa,&osa);],
4389 +    [cf_cv_sigaction_funcs=yes],
4390 +    [cf_cv_sigaction_funcs=no])])
4391 +
4392 +test "$cf_cv_sigaction_funcs" = yes && AC_DEFINE(HAVE_POSIX_JC)
4393 +
4394 +fi
4395 +])dnl
4396 +dnl ---------------------------------------------------------------------------
4397 +dnl CF_PROG_EXT version: 8 updated: 2002/12/21 19:25:52
4398 +dnl -----------
4399 +dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
4400 +AC_DEFUN([CF_PROG_EXT],
4401 +[
4402 +AC_REQUIRE([CF_CHECK_CACHE])
4403 +PROG_EXT=
4404 +case $cf_cv_system_name in
4405 +os2*)
4406 +    # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
4407 +    CFLAGS="$CFLAGS -Zmt"
4408 +    CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
4409 +    CXXFLAGS="$CXXFLAGS -Zmt"
4410 +    LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed -e "s%-Zexe%%g"`
4411 +    PROG_EXT=".exe"
4412 +    ;;
4413 +cygwin*)
4414 +    PROG_EXT=".exe"
4415 +    ;;
4416 +esac
4417 +AC_SUBST(PROG_EXT)
4418 +test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
4419 +])dnl
4420 +dnl ---------------------------------------------------------------------------
4421 +dnl CF_PROG_SUM_R version: 2 updated: 1997/08/28 23:57:55
4422 +dnl -------------
4423 +dnl See if sum can take -r
4424 +AC_DEFUN([CF_PROG_SUM_R],
4425 +[
4426 +if test $ac_cv_path_PATH_SUM
4427 +then
4428 +AC_MSG_CHECKING([if $ac_cv_path_PATH_SUM takes -r])
4429 +AC_CACHE_VAL(ac_cv_prog_sum_r,[
4430 +if AC_TRY_COMMAND($ac_cv_path_PATH_SUM -r config.log 1>&AC_FD_CC)
4431 +then
4432 +       ac_cv_prog_sum_r=yes
4433 +else
4434 +       ac_cv_prog_sum_r=no
4435 +fi
4436 +])
4437 +if test $ac_cv_prog_sum_r = yes; then
4438 +       AC_DEFINE(SUM_TAKES_DASH_R)
4439 +       AC_DEFINE_UNQUOTED(PATH_SUM_R, "$ac_cv_path_PATH_SUM -r")
4440 +else
4441 +       AC_DEFINE_UNQUOTED(PATH_SUM_R, "$ac_cv_path_PATH_SUM")
4442 +fi
4443 +AC_MSG_RESULT($ac_cv_prog_sum_r)
4444 +fi
4445 +])dnl
4446 +dnl ---------------------------------------------------------------------------
4447 +dnl CF_PROG_YACC version: 2 updated: 1997/12/16 11:20:41
4448 +dnl ------------
4449 +dnl A better version of AC_PROC_YACC, verifies that we'll only choose bison if
4450 +dnl we'll be able to compile with it.  Bison uses alloca, which isn't all that
4451 +dnl portable.
4452 +AC_DEFUN([CF_PROG_YACC],
4453 +[
4454 +AC_REQUIRE([AC_PROG_CC])
4455 +AC_CACHE_VAL(cf_cv_prog_YACC,[
4456 +if test -n "$YACC" ; then
4457 +  cf_cv_prog_YACC="$YACC" # Let the user override the test.
4458 +else
4459 +cat >conftest.y <<EOF
4460 +%{
4461 +void yyerror(s) char *s; { }
4462 +%}
4463 +%token NUMBER
4464 +%%
4465 +time   : NUMBER ':' NUMBER
4466 +       ;
4467 +%%
4468 +int yylex() { return NUMBER; }
4469 +int main() { return yyparse(); }
4470 +EOF
4471 +  for cf_prog in 'bison -y' byacc yacc
4472 +  do
4473 +    rm -f y.tab.[ch]
4474 +    AC_MSG_CHECKING(for $cf_prog)
4475 +    cf_command="$cf_prog conftest.y"
4476 +    cf_result=no
4477 +    if AC_TRY_EVAL(cf_command) && test -s y.tab.c ; then
4478 +      mv y.tab.c conftest.c
4479 +      rm -f y.tab.h
4480 +      if test "$cf_prog" = 'bison -y' ; then
4481 +        if AC_TRY_EVAL(ac_link) && test -s conftest ; then
4482 +          cf_result=yes
4483 +        fi
4484 +      else
4485 +        cf_result=yes
4486 +      fi
4487 +    fi
4488 +    AC_MSG_RESULT($cf_result)
4489 +    if test $cf_result = yes ; then
4490 +      cf_cv_prog_YACC="$cf_prog"
4491 +      break
4492 +    fi
4493 +  done
4494 +fi
4495 +])
4496 +YACC="$cf_cv_prog_YACC"
4497 +AC_SUBST(YACC)dnl
4498 +])dnl
4499 +dnl ---------------------------------------------------------------------------
4500 +dnl CF_PW_GECOS version: 2 updated: 2000/04/13 10:13:00
4501 +dnl -----------
4502 +dnl Check if the passwd-struct defines the '.pw_gecos' member (useful
4503 +dnl in decoding user names).
4504 +AC_DEFUN([CF_PW_GECOS],
4505 +[
4506 +AC_CACHE_CHECK([for passwd.pw_gecos], cf_cv_pw_gecos,[
4507 +       AC_TRY_COMPILE([
4508 +#include <pwd.h>
4509 +],[
4510 +       struct passwd foo;
4511 +       char bar = foo.pw_gecos],
4512 +       [cf_cv_pw_gecos=yes],
4513 +       [cf_cv_pw_gecos=no])])
4514 +test $cf_cv_pw_gecos = no && AC_DEFINE(DONT_HAVE_PW_GECOS)
4515 +])dnl
4516 +dnl ---------------------------------------------------------------------------
4517 +dnl CF_RECHECK_FUNC version: 3 updated: 2000/10/18 19:29:13
4518 +dnl ---------------
4519 +dnl Re-check on a function to see if we can pick it up by adding a library.
4520 +dnl    $1 = function to check
4521 +dnl    $2 = library to check in
4522 +dnl    $3 = environment to update (e.g., $LIBS)
4523 +dnl    $4 = what to do if this fails
4524 +dnl
4525 +dnl This uses 'unset' if the shell happens to support it, but leaves the
4526 +dnl configuration variable set to 'unknown' if not.  This is a little better
4527 +dnl than the normal autoconf test, which gives misleading results if a test
4528 +dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
4529 +dnl used (autoconf does not distinguish between a null token and one that is
4530 +dnl set to 'no').
4531 +AC_DEFUN([CF_RECHECK_FUNC],[
4532 +AC_CHECK_LIB($2,$1,[
4533 +       CF_UPPER(cf_tr_func,$1)
4534 +       AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func)
4535 +       ac_cv_func_$1=yes
4536 +       if test "$cf_used_lib_$2" != yes ; then cf_used_lib_$2=yes; $3="-l$2 [$]$3"; fi],[
4537 +       ac_cv_func_$1=unknown
4538 +       unset ac_cv_func_$1 2>/dev/null
4539 +       $4],
4540 +       [[$]$3])
4541 +])dnl
4542 +dnl ---------------------------------------------------------------------------
4543 +dnl CF_SET_GID_UID version: 2 updated: 1997/08/28 23:57:55
4544 +dnl --------------
4545 +dnl Check for the functions that set effective/real uid/gid.  This has to
4546 +dnl follow the AC_CHECK_FUNCS call.
4547 +AC_DEFUN([CF_SET_GID_UID],
4548 +[
4549 +AC_MSG_CHECKING([for setuid-like functions])
4550 +AC_CACHE_VAL(cf_cv_setuid_funcs,[
4551 +if test -n "${ac_cv_func_setuid}${ac_cv_func_seteuid}${ac_cv_func_setreuid}"; then
4552 +       cf_cv_setuid_funcs=yes
4553 +else
4554 +       cf_cv_setuid_funcs=no
4555 +fi
4556 +])
4557 +AC_MSG_RESULT($cf_cv_setuid_funcs)
4558 +test $cf_cv_setuid_funcs = yes && AC_DEFINE(HAVE_SET_GID_UID)
4559 +])dnl
4560 +dnl ---------------------------------------------------------------------------
4561 +dnl CF_SIG_ARGS version: 2 updated: 1997/08/28 23:57:55
4562 +dnl -----------
4563 +dnl Check for systems that have signal-handlers prototyped with one argument
4564 +dnl versus those with more than one argument, define the symbol SIG_ARGS to
4565 +dnl match.  (If it's empty, that's ok too).
4566 +AC_DEFUN([CF_SIG_ARGS],
4567 +[
4568 +AC_MSG_CHECKING([declaration of signal arguments])
4569 +AC_CACHE_VAL(cf_cv_sig_args,[
4570 +cf_cv_sig_args=
4571 +for cf_test in "int sig" "int sig, ..."
4572 +do
4573 +       AC_TRY_COMPILE([
4574 +#include <signal.h>],
4575 +       [extern RETSIGTYPE catch($cf_test); signal(SIGINT, catch)],
4576 +       [cf_cv_sig_args="$cf_test";break])
4577 +done
4578 +])
4579 +AC_MSG_RESULT($cf_cv_sig_args)
4580 +AC_DEFINE_UNQUOTED(SIG_ARGS,$cf_cv_sig_args)
4581 +])dnl
4582 +dnl ---------------------------------------------------------------------------
4583 +dnl CF_SIG_CONST version: 2 updated: 1997/08/28 23:57:55
4584 +dnl ------------
4585 +dnl Check for systems where the special signal constants aren't prototyped
4586 +dnl (there's a lot of them, and the compiler can generate a lot of warning
4587 +dnl messages that make it hard to pick out genuine errors).
4588 +AC_DEFUN([CF_SIG_CONST],
4589 +[
4590 +AC_REQUIRE([CF_SIG_ARGS])
4591 +AC_MSG_CHECKING([for redefinable signal constants])
4592 +AC_CACHE_VAL(cf_cv_sig_const,[
4593 +cf_cv_sig_const=no
4594 +if test -n "$cf_cv_sig_args"; then
4595 +       cf_test=`echo $cf_cv_sig_args|sed -e s/sig//`
4596 +       AC_TRY_RUN([
4597 +#define NEW_DFL        ((RETSIGTYPE (*)($cf_test))0)
4598 +#define NEW_IGN        ((RETSIGTYPE (*)($cf_test))1)
4599 +#define NEW_ERR        ((RETSIGTYPE (*)($cf_test))-1)
4600 +
4601 +#include <signal.h>
4602 +
4603 +int main()
4604 +{
4605 +       if (NEW_DFL != SIG_DFL
4606 +        || NEW_IGN != SIG_IGN
4607 +        || NEW_ERR != SIG_ERR
4608 +        /* at least one system won't let me redefine these! */
4609 +#undef SIG_DFL
4610 +#undef SIG_IGN
4611 +#undef SIG_ERR
4612 +#define SIG_DFL NEW_DFL
4613 +#define SIG_IGN NEW_IGN
4614 +#define SIG_ERR NEW_ERR
4615 +        || NEW_DFL != SIG_DFL)
4616 +               exit(1);
4617 +       signal(SIGINT, SIG_DFL);
4618 +       exit(0);
4619 +}],
4620 +       [cf_cv_sig_const=yes],
4621 +       [cf_cv_sig_const=no],
4622 +       [cf_cv_sig_const=unknown])
4623 +fi
4624 +])
4625 +AC_MSG_RESULT($cf_cv_sig_const)
4626 +test "$cf_cv_sig_const" = yes && AC_DEFINE(DECL_SIG_CONST)
4627 +])dnl
4628 +dnl ---------------------------------------------------------------------------
4629 +dnl CF_SIZECHANGE version: 8 updated: 2000/11/04 12:22:16
4630 +dnl -------------
4631 +dnl Check for definitions & structures needed for window size-changing
4632 +dnl FIXME: check that this works with "snake" (HP-UX 10.x)
4633 +AC_DEFUN([CF_SIZECHANGE],
4634 +[
4635 +AC_REQUIRE([CF_STRUCT_TERMIOS])
4636 +AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[
4637 +    cf_cv_sizechange=unknown
4638 +    cf_save_CPPFLAGS="$CPPFLAGS"
4639 +
4640 +for cf_opts in "" "NEED_PTEM_H"
4641 +do
4642 +
4643 +    CPPFLAGS="$cf_save_CPPFLAGS"
4644 +    test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts"
4645 +    AC_TRY_COMPILE([#include <sys/types.h>
4646 +#ifdef HAVE_TERMIOS_H
4647 +#include <termios.h>
4648 +#else
4649 +#ifdef HAVE_TERMIO_H
4650 +#include <termio.h>
4651 +#endif
4652 +#endif
4653 +#ifdef NEED_PTEM_H
4654 +/* This is a workaround for SCO:  they neglected to define struct winsize in
4655 + * termios.h -- it's only in termio.h and ptem.h
4656 + */
4657 +#include        <sys/stream.h>
4658 +#include        <sys/ptem.h>
4659 +#endif
4660 +#if !defined(sun) || !defined(HAVE_TERMIOS_H)
4661 +#include <sys/ioctl.h>
4662 +#endif
4663 +],[
4664 +#ifdef TIOCGSIZE
4665 +       struct ttysize win;     /* FIXME: what system is this? */
4666 +       int y = win.ts_lines;
4667 +       int x = win.ts_cols;
4668 +#else
4669 +#ifdef TIOCGWINSZ
4670 +       struct winsize win;
4671 +       int y = win.ws_row;
4672 +       int x = win.ws_col;
4673 +#else
4674 +       no TIOCGSIZE or TIOCGWINSZ
4675 +#endif /* TIOCGWINSZ */
4676 +#endif /* TIOCGSIZE */
4677 +       ],
4678 +       [cf_cv_sizechange=yes],
4679 +       [cf_cv_sizechange=no])
4680 +
4681 +       CPPFLAGS="$cf_save_CPPFLAGS"
4682 +       if test "$cf_cv_sizechange" = yes ; then
4683 +               echo "size-change succeeded ($cf_opts)" >&AC_FD_CC
4684 +               test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
4685 +               break
4686 +       fi
4687 +done
4688 +])
4689 +if test "$cf_cv_sizechange" != no ; then
4690 +       AC_DEFINE(HAVE_SIZECHANGE)
4691 +       case $cf_cv_sizechange in #(vi
4692 +       NEED*)
4693 +               AC_DEFINE_UNQUOTED($cf_cv_sizechange )
4694 +               ;;
4695 +       esac
4696 +fi
4697 +])dnl
4698 +dnl ---------------------------------------------------------------------------
4699 +dnl CF_SOCKS version: 3 updated: 2001/01/01 09:54:40
4700 +dnl --------
4701 +dnl Check for socks library
4702 +dnl $1 = the [optional] directory in which the library may be found
4703 +AC_DEFUN([CF_SOCKS],[
4704 +case "$1" in #(vi
4705 +no|yes) #(vi
4706 +  ;;
4707 +*)
4708 +  if test -d $1 ; then
4709 +    if test -d $1/include ; then
4710 +      CPPFLAGS="$CPPFLAGS -I$1/include"
4711 +      LIBS="$LIBS -L$1/lib"
4712 +    else
4713 +      LIBS="$LIBS -L$1"
4714 +      test -d $1/../include && CPPFLAGS="$CPPFLAGS -I$1/../include"
4715 +    fi
4716 +  else
4717 +    AC_MSG_WARN(expected a directory: $1)
4718 +  fi
4719 +  ;;
4720 +esac
4721 +LIBS="$LIBS -lsocks"
4722 +AC_DEFINE(SOCKS)
4723 +AC_DEFINE(accept,Raccept)
4724 +AC_DEFINE(bind,Rbind)
4725 +AC_DEFINE(connect,Rconnect)
4726 +AC_DEFINE(getpeername,Rgetpeername)
4727 +AC_DEFINE(getsockname,Rgetsockname)
4728 +AC_DEFINE(listen,Rlisten)
4729 +AC_DEFINE(recvfrom,Rrecvfrom)
4730 +AC_DEFINE(select,Rselect)
4731 +AC_TRY_LINK([
4732 +#include <stdio.h>],[
4733 +       accept((char *)0)],,
4734 +       [AC_ERROR(Cannot link with socks library)])
4735 +])dnl
4736 +dnl ---------------------------------------------------------------------------
4737 +dnl CF_SOCKS5 version: 7 updated: 2001/01/01 09:54:40
4738 +dnl ---------
4739 +dnl Check for socks5 configuration
4740 +dnl $1 = the [optional] directory in which the library may be found
4741 +AC_DEFUN([CF_SOCKS5],[
4742 +case "$1" in #(vi
4743 +no|yes) #(vi
4744 +  ;;
4745 +*)
4746 +  if test -d $1 ; then
4747 +    if test -d $1/include ; then
4748 +      CPPFLAGS="$CPPFLAGS -I$1/include"
4749 +      LIBS="$LIBS -L$1/lib"
4750 +    else
4751 +      LIBS="$LIBS -L$1"
4752 +      test -d $1/../include && CPPFLAGS="$CPPFLAGS -I$1/../include"
4753 +    fi
4754 +  else
4755 +    AC_MSG_WARN(expected a directory: $1)
4756 +  fi
4757 +  ;;
4758 +esac
4759 +LIBS="$LIBS -lsocks5"
4760 +AC_DEFINE(USE_SOCKS5)
4761 +AC_DEFINE(SOCKS)
4762 +AC_MSG_CHECKING(if the socks library uses socks4 prefix)
4763 +cf_use_socks4=error
4764 +AC_TRY_LINK([
4765 +#include <socks.h>],[
4766 +       Rinit((char *)0)],
4767 +       [AC_DEFINE(USE_SOCKS4_PREFIX)
4768 +        cf_use_socks4=yes],
4769 +       [AC_TRY_LINK([#include <socks.h>],
4770 +               [SOCKSinit((char *)0)],
4771 +               [cf_use_socks4=no],
4772 +               [AC_ERROR(Cannot link with socks5 library)])])
4773 +AC_MSG_RESULT($cf_use_socks4)
4774 +if test "$cf_use_socks4" = "yes" ; then
4775 +       AC_DEFINE(accept,Raccept)
4776 +       AC_DEFINE(bind,Rbind)
4777 +       AC_DEFINE(connect,Rconnect)
4778 +       AC_DEFINE(getpeername,Rgetpeername)
4779 +       AC_DEFINE(getsockname,Rgetsockname)
4780 +       AC_DEFINE(listen,Rlisten)
4781 +       AC_DEFINE(recvfrom,Rrecvfrom)
4782 +       AC_DEFINE(select,Rselect)
4783 +else
4784 +       AC_DEFINE(accept,SOCKSaccept)
4785 +       AC_DEFINE(getpeername,SOCKSgetpeername)
4786 +       AC_DEFINE(getsockname,SOCKSgetsockname)
4787 +       AC_DEFINE(recvfrom,SOCKSrecvfrom)
4788 +fi
4789 +AC_MSG_CHECKING(if socks5p.h is available)
4790 +AC_TRY_COMPILE([
4791 +#define INCLUDE_PROTOTYPES
4792 +#include <socks.h>],[
4793 +       init((char *)0)],
4794 +       [cf_use_socks5p_h=yes],
4795 +       [cf_use_socks5p_h=no])
4796 +AC_MSG_RESULT($cf_use_socks5p_h)
4797 +test "$cf_use_socks5p_h" = yes && AC_DEFINE(INCLUDE_PROTOTYPES)
4798 +])dnl
4799 +dnl ---------------------------------------------------------------------------
4800 +dnl CF_STRERROR version: 2 updated: 2001/07/11 09:34:49
4801 +dnl -----------
4802 +dnl Check for strerror(), or it is not found, for the related data.  POSIX
4803 +dnl requires strerror(), so only old systems such as SunOS lack it.
4804 +AC_DEFUN([CF_STRERROR],[
4805 +AC_CHECK_FUNCS(strerror, AC_DEFINE(HAVE_STRERROR),[CF_SYS_ERRLIST])
4806 +])dnl
4807 +dnl ---------------------------------------------------------------------------
4808 +dnl CF_STRUCT_TERMIOS version: 5 updated: 2000/11/04 12:22:46
4809 +dnl -----------------
4810 +dnl Some machines require _POSIX_SOURCE to completely define struct termios.
4811 +dnl If so, define SVR4_TERMIO
4812 +AC_DEFUN([CF_STRUCT_TERMIOS],[
4813 +AC_CHECK_HEADERS( \
4814 +termio.h \
4815 +termios.h \
4816 +unistd.h \
4817 +)
4818 +if test "$ISC" = yes ; then
4819 +       AC_CHECK_HEADERS( sys/termio.h )
4820 +fi
4821 +if test "$ac_cv_header_termios_h" = yes ; then
4822 +       case "$CFLAGS $CPPFLAGS" in
4823 +       *-D_POSIX_SOURCE*)
4824 +               termios_bad=dunno ;;
4825 +       *)      termios_bad=maybe ;;
4826 +       esac
4827 +       if test "$termios_bad" = maybe ; then
4828 +       AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE)
4829 +       AC_TRY_COMPILE([#include <termios.h>],
4830 +               [struct termios foo; int x = foo.c_iflag],
4831 +               termios_bad=no, [
4832 +               AC_TRY_COMPILE([
4833 +#define _POSIX_SOURCE
4834 +#include <termios.h>],
4835 +                       [struct termios foo; int x = foo.c_iflag],
4836 +                       termios_bad=unknown,
4837 +                       termios_bad=yes AC_DEFINE(SVR4_TERMIO))
4838 +                       ])
4839 +       AC_MSG_RESULT($termios_bad)
4840 +       fi
4841 +fi
4842 +])dnl
4843 +dnl ---------------------------------------------------------------------------
4844 +dnl CF_SUBDIR_PATH version: 3 updated: 2002/12/29 18:30:46
4845 +dnl --------------
4846 +dnl Construct a search-list for a nonstandard header/lib-file
4847 +dnl    $1 = the variable to return as result
4848 +dnl    $2 = the package name
4849 +dnl    $3 = the subdirectory, e.g., bin, include or lib
4850 +AC_DEFUN([CF_SUBDIR_PATH],
4851 +[$1=""
4852 +
4853 +test -d [$]HOME && {
4854 +       test -n "$verbose" && echo "    ... testing $3-directories under [$]HOME"
4855 +       test -d [$]HOME/$3 &&          $1="[$]$1 [$]HOME/$3"
4856 +       test -d [$]HOME/$3/$2 &&       $1="[$]$1 [$]HOME/$3/$2"
4857 +       test -d [$]HOME/$3/$2/$3 &&    $1="[$]$1 [$]HOME/$3/$2/$3"
4858 +}
4859 +
4860 +# For other stuff under the home directory, it should be sufficient to put
4861 +# a symbolic link for $HOME/$2 to the actual package location:
4862 +test -d [$]HOME/$2 && {
4863 +       test -n "$verbose" && echo "    ... testing $3-directories under [$]HOME/$2"
4864 +       test -d [$]HOME/$2/$3 &&       $1="[$]$1 [$]HOME/$2/$3"
4865 +       test -d [$]HOME/$2/$3/$2 &&    $1="[$]$1 [$]HOME/$2/$3/$2"
4866 +}
4867 +
4868 +test "$prefix" != /usr/local && \
4869 +test -d /usr/local && {
4870 +       test -n "$verbose" && echo "    ... testing $3-directories under /usr/local"
4871 +       test -d /usr/local/$3 &&       $1="[$]$1 /usr/local/$3"
4872 +       test -d /usr/local/$3/$2 &&    $1="[$]$1 /usr/local/$3/$2"
4873 +       test -d /usr/local/$3/$2/$3 && $1="[$]$1 /usr/local/$3/$2/$3"
4874 +       test -d /usr/local/$2/$3 &&    $1="[$]$1 /usr/local/$2/$3"
4875 +       test -d /usr/local/$2/$3/$2 && $1="[$]$1 /usr/local/$2/$3/$2"
4876 +}
4877 +
4878 +test "$prefix" != NONE && \
4879 +test -d $prefix && {
4880 +       test -n "$verbose" && echo "    ... testing $3-directories under $prefix"
4881 +       test -d $prefix/$3 &&          $1="[$]$1 $prefix/$3"
4882 +       test -d $prefix/$3/$2 &&       $1="[$]$1 $prefix/$3/$2"
4883 +       test -d $prefix/$3/$2/$3 &&    $1="[$]$1 $prefix/$3/$2/$3"
4884 +       test -d $prefix/$2/$3 &&       $1="[$]$1 $prefix/$2/$3"
4885 +       test -d $prefix/$2/$3/$2 &&    $1="[$]$1 $prefix/$2/$3/$2"
4886 +}
4887 +
4888 +test "$prefix" != /opt && \
4889 +test -d /opt && {
4890 +       test -n "$verbose" && echo "    ... testing $3-directories under /opt"
4891 +       test -d /opt/$3 &&             $1="[$]$1 /opt/$3"
4892 +       test -d /opt/$3/$2 &&          $1="[$]$1 /opt/$3/$2"
4893 +       test -d /opt/$3/$2/$3 &&       $1="[$]$1 /opt/$3/$2/$3"
4894 +       test -d /opt/$2/$3 &&          $1="[$]$1 /opt/$2/$3"
4895 +       test -d /opt/$2/$3/$2 &&       $1="[$]$1 /opt/$2/$3/$2"
4896 +}
4897 +
4898 +test "$prefix" != /usr && \
4899 +test -d /usr && {
4900 +       test -n "$verbose" && echo "    ... testing $3-directories under /usr"
4901 +       test -d /usr/$3 &&             $1="[$]$1 /usr/$3"
4902 +       test -d /usr/$3/$2 &&          $1="[$]$1 /usr/$3/$2"
4903 +       test -d /usr/$3/$2/$3 &&       $1="[$]$1 /usr/$3/$2/$3"
4904 +       test -d /usr/$2/$3 &&          $1="[$]$1 /usr/$2/$3"
4905 +}
4906 +])dnl
4907 +dnl ---------------------------------------------------------------------------
4908 +dnl CF_SYS_ERRLIST version: 6 updated: 2001/12/30 13:03:23
4909 +dnl --------------
4910 +dnl Check for declaration of sys_nerr and sys_errlist in one of stdio.h and
4911 +dnl errno.h.  Declaration of sys_errlist on BSD4.4 interferes with our
4912 +dnl declaration.  Reported by Keith Bostic.
4913 +AC_DEFUN([CF_SYS_ERRLIST],
4914 +[
4915 +    CF_CHECK_ERRNO(sys_nerr)
4916 +    CF_CHECK_ERRNO(sys_errlist)
4917 +])dnl
4918 +dnl ---------------------------------------------------------------------------
4919 +dnl CF_SYS_SELECT_TIMEVAL version: 4 updated: 1997/12/16 11:22:31
4920 +dnl ---------------------
4921 +dnl Check if there is a conflict between <sys/select.h> and <sys/time.h>.
4922 +dnl This is known to be a problem with SCO.
4923 +AC_DEFUN([CF_SYS_SELECT_TIMEVAL],
4924 +[
4925 +AC_MSG_CHECKING(if sys/time.h conflicts with sys/select.h)
4926 +AC_CACHE_VAL(cf_cv_sys_select_timeval,[
4927 +for cf_opts in no yes
4928 +do
4929 +AC_TRY_COMPILE([
4930 +#define yes 1
4931 +#define no 0
4932 +#if $cf_opts
4933 +#define timeval fake_timeval
4934 +#endif
4935 +#include <sys/types.h>
4936 +#ifdef TIME_WITH_SYS_TIME
4937 +#      include <sys/time.h>
4938 +#      include <time.h>
4939 +#else
4940 +#      ifdef HAVE_SYS_TIME_H
4941 +#              include <sys/time.h>
4942 +#      else
4943 +#              include <time.h>
4944 +#      endif
4945 +#endif
4946 +#undef timeval
4947 +#ifdef HAVE_SYS_SELECT_H
4948 +#      include <sys/select.h>
4949 +#endif
4950 +],[struct timeval foo],
4951 +       [cf_cv_sys_select_timeval=$cf_opts
4952 +        break],
4953 +       [cf_cv_sys_select_timeval=no])
4954 +done
4955 +])
4956 +AC_MSG_RESULT($cf_cv_sys_select_timeval)
4957 +test $cf_cv_sys_select_timeval = yes && AC_DEFINE(NEED_TIMEVAL_FIX)
4958 +])
4959 +dnl ---------------------------------------------------------------------------
4960 +dnl CF_TERMCAP_LIBS version: 10 updated: 2001/10/18 20:42:39
4961 +dnl ---------------
4962 +dnl Look for termcap libraries, or the equivalent in terminfo.
4963 +AC_DEFUN([CF_TERMCAP_LIBS],
4964 +[
4965 +AC_CACHE_VAL(cf_cv_termlib,[
4966 +cf_cv_termlib=none
4967 +AC_TRY_LINK([],[char *x=(char*)tgoto("",0,0)],
4968 +[AC_TRY_LINK([],[int x=tigetstr("")],
4969 +       [cf_cv_termlib=terminfo],
4970 +       [cf_cv_termlib=termcap])
4971 +       CF_VERBOSE(using functions in predefined $cf_cv_termlib LIBS)
4972 +],[
4973 +ifelse([$1],,,[
4974 +case "$1" in # (vi
4975 +ncurses*)
4976 +       CF_NCURSES_CPPFLAGS($1)
4977 +       CF_NCURSES_LIBS($1)
4978 +       cf_cv_termlib=terminfo
4979 +       ;;
4980 +esac
4981 +])
4982 +if test "$cf_cv_termlib" = none; then
4983 +       # FreeBSD's linker gives bogus results for AC_CHECK_LIB, saying that
4984 +       # tgetstr lives in -lcurses when it is only an unsatisfied extern.
4985 +       cf_save_LIBS="$LIBS"
4986 +       for cf_lib in curses ncurses termlib termcap
4987 +       do
4988 +       LIBS="-l$cf_lib $cf_save_LIBS"
4989 +       for cf_func in tigetstr tgetstr
4990 +       do
4991 +               AC_MSG_CHECKING(for $cf_func in -l$cf_lib)
4992 +               AC_TRY_LINK([],[int x=$cf_func("")],[cf_result=yes],[cf_result=no])
4993 +               AC_MSG_RESULT($cf_result)
4994 +               if test "$cf_result" = yes ; then
4995 +                       if test "$cf_func" = tigetstr ; then
4996 +                               cf_cv_termlib=terminfo
4997 +                       else
4998 +                               cf_cv_termlib=termcap
4999 +                       fi
5000 +                       break
5001 +               fi
5002 +       done
5003 +               test "$cf_result" = yes && break
5004 +       done
5005 +       test "$cf_result" = no && LIBS="$cf_save_LIBS"
5006 +fi
5007 +if test "$cf_cv_termlib" = none; then
5008 +       # allow curses library for broken AIX system.
5009 +       AC_CHECK_LIB(curses, initscr, [LIBS="$LIBS -lcurses" cf_cv_termlib=termcap])
5010 +       AC_CHECK_LIB(termcap, tgoto, [LIBS="$LIBS -ltermcap" cf_cv_termlib=termcap])
5011 +fi
5012 +])
5013 +if test "$cf_cv_termlib" = none; then
5014 +       AC_MSG_WARN([Cannot find -ltermlib, -lcurses, or -ltermcap])
5015 +fi
5016 +])])dnl
5017 +dnl ---------------------------------------------------------------------------
5018 +dnl CF_TERMIOS version: 2 updated: 1997/08/28 23:57:55
5019 +dnl ----------
5020 +dnl See if we can link with the termios functions tcsetattr/tcgetattr
5021 +AC_DEFUN([CF_TERMIOS],
5022 +[
5023 +AC_MSG_CHECKING([for nonconflicting termios.h])
5024 +AC_CACHE_VAL(cf_cv_use_termios_h,[
5025 +       AC_TRY_LINK([
5026 +#ifdef HAVE_IOCTL_H
5027 +#      include <ioctl.h>
5028 +#else
5029 +#      ifdef HAVE_SYS_IOCTL_H
5030 +#              include <sys/ioctl.h>
5031 +#      endif
5032 +#endif
5033 +
5034 +#if !defined(sun) || !defined(NL0)
5035 +#include <termios.h>
5036 +#endif
5037 +],[
5038 +       struct termios save_tty;
5039 +       (void) tcsetattr (0, TCSANOW, &save_tty);
5040 +       (void) tcgetattr (0, &save_tty)],
5041 +       [cf_cv_use_termios_h=yes],
5042 +       [cf_cv_use_termios_h=no])
5043 +])
5044 +AC_MSG_RESULT($cf_cv_use_termios_h)
5045 +if test $cf_cv_use_termios_h = yes; then
5046 +       AC_DEFINE(HAVE_TERMIOS_H)
5047 +       AC_DEFINE(HAVE_TCGETATTR)
5048 +       AC_DEFINE(HAVE_TCSETATTR)
5049 +fi
5050 +])dnl
5051 +dnl ---------------------------------------------------------------------------
5052 +dnl CF_TIOCGWINSZ version: 3 updated: 1997/11/29 01:04:53
5053 +dnl -------------
5054 +dnl On some systems ioctl(fd, TIOCGWINSZ, &size) will always return {0,0} until
5055 +dnl ioctl(fd, TIOCSWINSZ, &size) is called to explicitly set the size of the
5056 +dnl screen.
5057 +dnl
5058 +dnl Attempt to determine if we're on such a system by running a test-program.
5059 +dnl This won't work, of course, if the configure script is run in batch mode,
5060 +dnl since we've got to have access to the terminal.
5061 +dnl
5062 +dnl CHECK_DECL_FLAG and CHECK_DECL_HDRS must be set in configure.in
5063 +AC_DEFUN([CF_TIOCGWINSZ],
5064 +[
5065 +AC_MSG_CHECKING([for working TIOCGWINSZ])
5066 +AC_CACHE_VAL(cf_cv_use_tiocgwinsz,[
5067 +       cf_save_CFLAGS="$CFLAGS"
5068 +       CFLAGS="$CFLAGS -D__CPROTO__ $CHECK_DECL_FLAG"
5069 +       AC_TRY_RUN([
5070 +$CHECK_DECL_HDRS
5071 +int main()
5072 +{
5073 +       int fd;
5074 +       for (fd = 0; fd <= 2; fd++) {   /* try in/out/err in case redirected */
5075 +#ifdef TIOCGSIZE
5076 +               struct ttysize size;
5077 +               if (ioctl (0, TIOCGSIZE, &size) == 0
5078 +                && size.ts_lines > 0
5079 +                && size.ts_cols > 0)
5080 +                       exit(0);
5081 +#else
5082 +               struct winsize size;
5083 +               if (ioctl(0, TIOCGWINSZ, &size) == 0
5084 +                && size.ws_row > 0
5085 +                && size.ws_col > 0)
5086 +                       exit(0);
5087 +#endif
5088 +       }
5089 +       exit(0);        /* we cannot guarantee this is run interactively */
5090 +}],
5091 +               [cf_cv_use_tiocgwinsz=yes],
5092 +               [cf_cv_use_tiocgwinsz=no],
5093 +               [cf_cv_use_tiocgwinsz=unknown])
5094 +               rm -f autoconf.h
5095 +               CFLAGS="$cf_save_CFLAGS"])
5096 +AC_MSG_RESULT($cf_cv_use_tiocgwinsz)
5097 +test $cf_cv_use_tiocgwinsz != yes && AC_DEFINE(DONT_HAVE_SIGWINCH)
5098 +])dnl
5099 +dnl ---------------------------------------------------------------------------
5100 +dnl CF_TM_GMTOFF version: 2 updated: 1997/08/28 23:57:55
5101 +dnl ------------
5102 +dnl Check if the tm-struct defines the '.tm_gmtoff' member (useful in decoding
5103 +dnl dates).
5104 +AC_DEFUN([CF_TM_GMTOFF],
5105 +[
5106 +AC_MSG_CHECKING([for tm.tm_gmtoff])
5107 +AC_CACHE_VAL(cf_cv_tm_gmtoff,[
5108 +       AC_TRY_COMPILE([
5109 +#ifdef TIME_WITH_SYS_TIME
5110 +#      include <sys/time.h>
5111 +#      include <time.h>
5112 +#else
5113 +#      ifdef HAVE_SYS_TIME_H
5114 +#              include <sys/time.h>
5115 +#      else
5116 +#              include <time.h>
5117 +#      endif
5118 +#endif
5119 +],[
5120 +       struct tm foo;
5121 +       long bar = foo.tm_gmtoff],
5122 +       [cf_cv_tm_gmtoff=yes],
5123 +       [cf_cv_tm_gmtoff=no])])
5124 +AC_MSG_RESULT($cf_cv_tm_gmtoff)
5125 +test $cf_cv_tm_gmtoff = no && AC_DEFINE(DONT_HAVE_TM_GMTOFF)
5126 +])dnl
5127 +dnl ---------------------------------------------------------------------------
5128 +dnl CF_TYPE_OUTCHAR version: 13 updated: 2002/10/09 20:00:37
5129 +dnl ---------------
5130 +dnl Check for return and param type of 3rd -- OutChar() -- param of tputs().
5131 +dnl
5132 +dnl For this check, and for CF_CURSES_TERMCAP, the $CHECK_DECL_HDRS variable
5133 +dnl must point to a header file containing this (or equivalent):
5134 +dnl
5135 +dnl    #ifdef NEED_CURSES_H
5136 +dnl    # ifdef HAVE_NCURSES_NCURSES_H
5137 +dnl    #  include <ncurses/ncurses.h>
5138 +dnl    # else
5139 +dnl    #  ifdef HAVE_NCURSES_H
5140 +dnl    #   include <ncurses.h>
5141 +dnl    #  else
5142 +dnl    #   include <curses.h>
5143 +dnl    #  endif
5144 +dnl    # endif
5145 +dnl    #endif
5146 +dnl
5147 +dnl    #ifdef HAVE_NCURSES_TERM_H
5148 +dnl    #  include <ncurses/term.h>
5149 +dnl    #else
5150 +dnl    # ifdef HAVE_TERM_H
5151 +dnl    #  include <term.h>
5152 +dnl    # endif
5153 +dnl    #endif
5154 +dnl
5155 +dnl    #if NEED_TERMCAP_H
5156 +dnl    # include <termcap.h>
5157 +dnl    #endif
5158 +dnl
5159 +AC_DEFUN([CF_TYPE_OUTCHAR],
5160 +[
5161 +AC_REQUIRE([CF_CURSES_TERMCAP])
5162 +
5163 +AC_CACHE_CHECK(declaration of tputs 3rd param, cf_cv_type_outchar,[
5164 +
5165 +cf_cv_type_outchar="int OutChar(int)"
5166 +cf_cv_found=no
5167 +cf_save_CPPFLAGS="$CPPFLAGS"
5168 +CPPFLAGS="$CPPFLAGS $CHECK_DECL_FLAG"
5169 +
5170 +for P in int void; do
5171 +for Q in int void; do
5172 +for R in int char; do
5173 +for S in "" const; do
5174 +       CF_MSG_LOG(loop variables [P:[$]P, Q:[$]Q, R:[$]R, S:[$]S])
5175 +       AC_TRY_COMPILE([$CHECK_DECL_HDRS],
5176 +       [extern $Q OutChar($R);
5177 +       extern $P tputs ($S char *string, int nlines, $Q (*_f)($R));
5178 +       tputs("", 1, OutChar)],
5179 +       [cf_cv_type_outchar="$Q OutChar($R)"
5180 +        cf_cv_found=yes
5181 +        break])
5182 +done
5183 +       test $cf_cv_found = yes && break
5184 +done
5185 +       test $cf_cv_found = yes && break
5186 +done
5187 +       test $cf_cv_found = yes && break
5188 +done
5189 +])
5190 +
5191 +case $cf_cv_type_outchar in
5192 +int*)
5193 +       AC_DEFINE(OUTC_RETURN)
5194 +       ;;
5195 +esac
5196 +case $cf_cv_type_outchar in
5197 +*char*)
5198 +       AC_DEFINE(OUTC_ARGS,char c)
5199 +       ;;
5200 +esac
5201 +
5202 +CPPFLAGS="$cf_save_CPPFLAGS"
5203 +])dnl
5204 +dnl ---------------------------------------------------------------------------
5205 +dnl CF_TYPE_SIGACTION version: 3 updated: 2000/08/12 23:18:52
5206 +dnl -----------------
5207 +dnl
5208 +AC_DEFUN([CF_TYPE_SIGACTION],
5209 +[
5210 +AC_MSG_CHECKING([for type sigaction_t])
5211 +AC_CACHE_VAL(cf_cv_type_sigaction,[
5212 +       AC_TRY_COMPILE([
5213 +#include <signal.h>],
5214 +               [sigaction_t x],
5215 +               [cf_cv_type_sigaction=yes],
5216 +               [cf_cv_type_sigaction=no])])
5217 +AC_MSG_RESULT($cf_cv_type_sigaction)
5218 +test "$cf_cv_type_sigaction" = yes && AC_DEFINE(HAVE_TYPE_SIGACTION)
5219 +])dnl
5220 +dnl ---------------------------------------------------------------------------
5221 +dnl CF_UNION_WAIT version: 5 updated: 1997/11/23 14:49:44
5222 +dnl -------------
5223 +dnl Check to see if the BSD-style union wait is declared.  Some platforms may
5224 +dnl use this, though it is deprecated in favor of the 'int' type in Posix.
5225 +dnl Some vendors provide a bogus implementation that declares union wait, but
5226 +dnl uses the 'int' type instead; we try to spot these by checking for the
5227 +dnl associated macros.
5228 +dnl
5229 +dnl Ahem.  Some implementers cast the status value to an int*, as an attempt to
5230 +dnl use the macros for either union wait or int.  So we do a check compile to
5231 +dnl see if the macros are defined and apply to an int.
5232 +dnl
5233 +dnl Sets: $cf_cv_type_unionwait
5234 +dnl Defines: HAVE_TYPE_UNIONWAIT
5235 +AC_DEFUN([CF_UNION_WAIT],
5236 +[
5237 +AC_REQUIRE([CF_WAIT_HEADERS])
5238 +AC_MSG_CHECKING([for union wait])
5239 +AC_CACHE_VAL(cf_cv_type_unionwait,[
5240 +       AC_TRY_LINK($cf_wait_headers,
5241 +       [int x;
5242 +        int y = WEXITSTATUS(x);
5243 +        int z = WTERMSIG(x);
5244 +        wait(&x);
5245 +       ],
5246 +       [cf_cv_type_unionwait=no
5247 +        echo compiles ok w/o union wait 1>&AC_FD_CC
5248 +       ],[
5249 +       AC_TRY_LINK($cf_wait_headers,
5250 +       [union wait x;
5251 +#ifdef WEXITSTATUS
5252 +        int y = WEXITSTATUS(x);
5253 +#endif
5254 +#ifdef WTERMSIG
5255 +        int z = WTERMSIG(x);
5256 +#endif
5257 +        wait(&x);
5258 +       ],
5259 +       [cf_cv_type_unionwait=yes
5260 +        echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC
5261 +       ],
5262 +       [cf_cv_type_unionwait=no])])])
5263 +AC_MSG_RESULT($cf_cv_type_unionwait)
5264 +test $cf_cv_type_unionwait = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT)
5265 +])dnl
5266 +dnl ---------------------------------------------------------------------------
5267 +dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
5268 +dnl --------
5269 +dnl Make an uppercase version of a variable
5270 +dnl $1=uppercase($2)
5271 +AC_DEFUN([CF_UPPER],
5272 +[
5273 +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5274 +])dnl
5275 +dnl ---------------------------------------------------------------------------
5276 +dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
5277 +dnl ----------
5278 +dnl Use AC_VERBOSE w/o the warnings
5279 +AC_DEFUN([CF_VERBOSE],
5280 +[test -n "$verbose" && echo "  $1" 1>&AC_FD_MSG
5281 +])dnl
5282 +dnl ---------------------------------------------------------------------------
5283 +dnl CF_WAIT_HEADERS version: 2 updated: 1997/10/21 19:45:33
5284 +dnl ---------------
5285 +dnl Build up an expression $cf_wait_headers with the header files needed to
5286 +dnl compile against the prototypes for 'wait()', 'waitpid()', etc.  Assume it's
5287 +dnl Posix, which uses <sys/types.h> and <sys/wait.h>, but allow SVr4 variation
5288 +dnl with <wait.h>.
5289 +AC_DEFUN([CF_WAIT_HEADERS],
5290 +[
5291 +AC_HAVE_HEADERS(sys/wait.h)
5292 +cf_wait_headers="#include <sys/types.h>
5293 +"
5294 +if test $ac_cv_header_sys_wait_h = yes; then
5295 +cf_wait_headers="$cf_wait_headers
5296 +#include <sys/wait.h>
5297 +"
5298 +else
5299 +AC_HAVE_HEADERS(wait.h)
5300 +AC_HAVE_HEADERS(waitstatus.h)
5301 +if test $ac_cv_header_wait_h = yes; then
5302 +cf_wait_headers="$cf_wait_headers
5303 +#include <wait.h>
5304 +"
5305 +fi
5306 +if test $ac_cv_header_waitstatus_h = yes; then
5307 +cf_wait_headers="$cf_wait_headers
5308 +#include <waitstatus.h>
5309 +"
5310 +fi
5311 +fi
5312 +])dnl
5313 +dnl ---------------------------------------------------------------------------
5314 +dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59
5315 +dnl ------------------
5316 +dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
5317 +dnl libraries.
5318 +AC_DEFUN([CF_WITH_CURSES_DIR],[
5319 +AC_ARG_WITH(curses-dir,
5320 +       [  --with-curses-dir=DIR   directory in which (n)curses is installed],
5321 +       [CF_PATH_SYNTAX(withval)
5322 +        cf_cv_curses_dir=$withval],
5323 +       [cf_cv_curses_dir=no])
5324 +])dnl
5325 +dnl ---------------------------------------------------------------------------
5326 +dnl CF_WITH_DFTENV version: 3 updated: 1998/04/01 11:39:13
5327 +dnl --------------
5328 +dnl Wrapper for AC_ARG_WITH to inherit/override an environment variable's
5329 +dnl "#define" in the compile.
5330 +dnl $1 = option name
5331 +dnl $2 = help-message
5332 +dnl $3 = name of variable to inherit/override
5333 +dnl $4 = default value of variable, if any
5334 +AC_DEFUN([CF_WITH_DFTENV],
5335 +[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
5336 +ifelse($4,,[withval="${$3}"],[withval="${$3-$4}"]))dnl
5337 +case "$withval" in #(vi
5338 +yes|no)
5339 +  AC_ERROR(expected a value for --with-$1)
5340 +  ;;
5341 +esac
5342 +$3="$withval"
5343 +AC_DEFINE_UNQUOTED($3,"[$]$3")dnl
5344 +])dnl
5345 +dnl ---------------------------------------------------------------------------
5346 +dnl CF_WITH_PATH version: 6 updated: 1998/10/11 00:40:17
5347 +dnl ------------
5348 +dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
5349 +dnl defaulting to yes/no.
5350 +dnl
5351 +dnl $1 = option name
5352 +dnl $2 = help-text
5353 +dnl $3 = environment variable to set
5354 +dnl $4 = default value, shown in the help-message, must be a constant
5355 +dnl $5 = default value, if it's an expression & cannot be in the help-message
5356 +dnl
5357 +AC_DEFUN([CF_WITH_PATH],
5358 +[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
5359 +ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl
5360 +CF_PATH_SYNTAX(withval)
5361 +eval $3="$withval"
5362 +AC_SUBST($3)dnl
5363 +])dnl
5364 +dnl ---------------------------------------------------------------------------
5365 +dnl CF_WITH_PROGRAM version: 5 updated: 2001/07/22 23:07:22
5366 +dnl ---------------
5367 +dnl Wrapper for AC_PATH_PROG, with command-line option.
5368 +dnl Params:
5369 +dnl $1 = program name
5370 +dnl $2 = help-string (I'd use format, but someone's disable it in autoconf)
5371 +dnl $3 = caller-supplied default if no --with option is given.  If this is
5372 +dnl      blank, the macro uses AC_PATH_PROG.
5373 +AC_DEFUN([CF_WITH_PROGRAM],
5374 +[dnl
5375 +define([cf_path_name], PATH_[]translit($1, [a-z], [A-Z]))dnl
5376 +define([cf_have_name], HAVE_[]translit($1, [a-z], [A-Z]))dnl
5377 +AC_ARG_WITH($1,[$2],ifelse($3,,
5378 +[case "$withval" in #(vi
5379 +  yes[)]
5380 +   AC_ERROR(expected a value for --with-$1)
5381 +   ;; #(vi
5382 +  no[)]
5383 +   ;; #(vi
5384 +  *[)]
5385 +   # user supplied option-value for "--with-$1=path"
5386 +   AC_MSG_CHECKING(for $1)
5387 +   ac_cv_path_]cf_path_name[="$withval"
5388 +   AC_DEFINE_UNQUOTED(cf_path_name,"$withval")dnl
5389 +   AC_DEFINE(cf_have_name)dnl
5390 +   AC_MSG_RESULT($withval)
5391 +   ;;
5392 + esac],[$3]),[
5393 +  # user did not specify "--with-$1"; do automatic check
5394 +  AC_PATH_PROG(cf_path_name,$1)
5395 +  if test -n "$cf_path_name"; then
5396 +    AC_DEFINE_UNQUOTED(cf_path_name,"$cf_path_name")dnl
5397 +    AC_DEFINE(cf_have_name)dnl
5398 +  fi
5399 +])dnl
5400 +undefine([cf_path_name])undefine([cf_have_name])])dnl
5401 +dnl ---------------------------------------------------------------------------
5402 +dnl CF_WITH_VALUE version: 3 updated: 1998/04/01 11:39:13
5403 +dnl -------------
5404 +dnl Wrapper for AC_ARG_WITH to ensure that if the user supplies a value, it is
5405 +dnl not simply defaulting to yes/no.  Empty strings are ok if the macro is
5406 +dnl invoked without a default value
5407 +dnl $1 = option name
5408 +dnl $2 = help-message
5409 +dnl $3 = variable to inherit/override
5410 +dnl $4 = default value, if any.
5411 +AC_DEFUN([CF_WITH_VALUE],
5412 +[CF_ARG_WITH($1,[$2],[$3],[$4])
5413 + AC_DEFINE_UNQUOTED($3,"$withval")dnl
5414 +])dnl
5415 +dnl ---------------------------------------------------------------------------
5416 +dnl CF_XOPEN_CURSES version: 6 updated: 2002/11/12 06:55:30
5417 +dnl ---------------
5418 +dnl Test if we should define X/Open source for curses, needed on Digital Unix
5419 +dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
5420 +AC_DEFUN([CF_XOPEN_CURSES],
5421 +[
5422 +AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[
5423 +AC_TRY_LINK([
5424 +#include <stdlib.h>
5425 +#include <${cf_cv_ncurses_header-curses.h}>],[
5426 +       long x = winnstr(stdscr, "", 0)],
5427 +       [cf_cv_need_xopen_extension=no],
5428 +       [AC_TRY_LINK([
5429 +#define _XOPEN_SOURCE_EXTENDED
5430 +#include <stdlib.h>
5431 +#include <${cf_cv_ncurses_header-curses.h}>],[
5432 +       long x = winnstr(stdscr, "", 0)],
5433 +       [cf_cv_need_xopen_extension=yes],
5434 +       [cf_cv_need_xopen_extension=unknown])])])
5435 +test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
5436 +])dnl
5437 +dnl ---------------------------------------------------------------------------
5438 +dnl CF_X_ATHENA version: 11 updated: 2002/12/26 20:56:10
5439 +dnl -----------
5440 +dnl Check for Xaw (Athena) libraries
5441 +dnl
5442 +AC_DEFUN([CF_X_ATHENA],
5443 +[AC_REQUIRE([CF_X_TOOLKIT])
5444 +cf_x_athena=${cf_x_athena-Xaw}
5445 +
5446 +AC_ARG_WITH(Xaw3d,
5447 +       [  --with-Xaw3d            link with Xaw 3d library],
5448 +       [cf_x_athena=Xaw3d])
5449 +
5450 +AC_ARG_WITH(neXtaw,
5451 +       [  --with-neXtaw           link with neXT Athena library],
5452 +       [cf_x_athena=neXtaw])
5453 +
5454 +AC_ARG_WITH(XawPlus,
5455 +       [  --with-XawPlus          link with Athena-Plus library],
5456 +       [cf_x_athena=XawPlus])
5457 +
5458 +AC_CHECK_LIB(Xext,XextCreateExtension,
5459 +       [LIBS="-lXext $LIBS"])
5460 +
5461 +cf_x_athena_lib=""
5462 +
5463 +CF_X_ATHENA_CPPFLAGS($cf_x_athena)
5464 +CF_X_ATHENA_LIBS($cf_x_athena)
5465 +])dnl
5466 +dnl ---------------------------------------------------------------------------
5467 +dnl CF_X_ATHENA_CPPFLAGS version: 2 updated: 2002/10/09 20:00:37
5468 +dnl --------------------
5469 +dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
5470 +dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
5471 +AC_DEFUN([CF_X_ATHENA_CPPFLAGS],
5472 +[
5473 +cf_x_athena_root=ifelse($1,,Xaw,$1)
5474 +cf_x_athena_include=""
5475 +
5476 +for cf_path in default \
5477 +       /usr/contrib/X11R6 \
5478 +       /usr/contrib/X11R5 \
5479 +       /usr/lib/X11R5 \
5480 +       /usr/local
5481 +do
5482 +       if test -z "$cf_x_athena_include" ; then
5483 +               cf_save="$CPPFLAGS"
5484 +               cf_test=X11/$cf_x_athena_root/SimpleMenu.h
5485 +               if test $cf_path != default ; then
5486 +                       CPPFLAGS="-I$cf_path/include $cf_save"
5487 +                       AC_MSG_CHECKING(for $cf_test in $cf_path)
5488 +               else
5489 +                       AC_MSG_CHECKING(for $cf_test)
5490 +               fi
5491 +               AC_TRY_COMPILE([
5492 +#include <X11/Intrinsic.h>
5493 +#include <$cf_test>],[],
5494 +                       [cf_result=yes],
5495 +                       [cf_result=no])
5496 +               AC_MSG_RESULT($cf_result)
5497 +               if test "$cf_result" = yes ; then
5498 +                       cf_x_athena_include=$cf_path
5499 +                       break
5500 +               else
5501 +                       CPPFLAGS="$cf_save"
5502 +               fi
5503 +       fi
5504 +done
5505 +
5506 +if test -z "$cf_x_athena_include" ; then
5507 +       AC_MSG_WARN(
5508 +[Unable to successfully find Athena header files with test program])
5509 +elif test "$cf_x_athena_include" != default ; then
5510 +       CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
5511 +fi
5512 +])
5513 +dnl ---------------------------------------------------------------------------
5514 +dnl CF_X_ATHENA_LIBS version: 3 updated: 2003/02/16 15:24:54
5515 +dnl ----------------
5516 +dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
5517 +dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
5518 +AC_DEFUN([CF_X_ATHENA_LIBS],
5519 +[AC_REQUIRE([CF_X_TOOLKIT])
5520 +cf_x_athena_root=ifelse($1,,Xaw,$1)
5521 +cf_x_athena_lib=""
5522 +
5523 +for cf_path in default \
5524 +       /usr/contrib/X11R6 \
5525 +       /usr/contrib/X11R5 \
5526 +       /usr/lib/X11R5 \
5527 +       /usr/local
5528 +do
5529 +       for cf_lib in \
5530 +               "-l$cf_x_athena_root -lXmu" \
5531 +               "-l$cf_x_athena_root -lXpm -lXmu" \
5532 +               "-l${cf_x_athena_root}_s -lXmu_s"
5533 +       do
5534 +               if test -z "$cf_x_athena_lib" ; then
5535 +                       cf_save="$LIBS"
5536 +                       cf_test=XawSimpleMenuAddGlobalActions
5537 +                       if test $cf_path != default ; then
5538 +                               LIBS="-L$cf_path/lib $cf_lib $LIBS"
5539 +                               AC_MSG_CHECKING(for $cf_lib in $cf_path)
5540 +                       else
5541 +                               LIBS="$cf_lib $LIBS"
5542 +                               AC_MSG_CHECKING(for $cf_test in $cf_lib)
5543 +                       fi
5544 +                       cf_SAVE="$LIBS"
5545 +                       LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
5546 +                       AC_TRY_LINK([],[$cf_test()],
5547 +                               [cf_result=yes],
5548 +                               [cf_result=no])
5549 +                       AC_MSG_RESULT($cf_result)
5550 +                       if test "$cf_result" = yes ; then
5551 +                               cf_x_athena_lib="$cf_lib"
5552 +                               LIBS="$cf_SAVE"
5553 +                               break
5554 +                       else
5555 +                               LIBS="$cf_save"
5556 +                       fi
5557 +               fi
5558 +       done
5559 +done
5560 +
5561 +if test -z "$cf_x_athena_lib" ; then
5562 +       AC_ERROR(
5563 +[Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
5564 +fi
5565 +
5566 +CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
5567 +AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
5568 +])
5569 +dnl ---------------------------------------------------------------------------
5570 +dnl CF_X_TOOLKIT version: 9 updated: 2001/12/30 19:09:58
5571 +dnl ------------
5572 +dnl Check for X Toolkit libraries
5573 +dnl
5574 +AC_DEFUN([CF_X_TOOLKIT],
5575 +[
5576 +AC_REQUIRE([CF_CHECK_CACHE])
5577 +# We need to check for -lsocket and -lnsl here in order to work around an
5578 +# autoconf bug.  autoconf-2.12 is not checking for these prior to checking for
5579 +# the X11R6 -lSM and -lICE libraries.  The resultant failures cascade...
5580 +#      (tested on Solaris 2.5 w/ X11R6)
5581 +SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`
5582 +cf_have_X_LIBS=no
5583 +case $SYSTEM_NAME in
5584 +irix[[56]]*) ;;
5585 +clix*)
5586 +       # FIXME: modify the library lookup in autoconf to
5587 +       # allow _s.a suffix ahead of .a
5588 +       AC_CHECK_LIB(c_s,open,
5589 +               [LIBS="-lc_s $LIBS"
5590 +       AC_CHECK_LIB(bsd,gethostname,
5591 +               [LIBS="-lbsd $LIBS"
5592 +       AC_CHECK_LIB(nsl_s,gethostname,
5593 +               [LIBS="-lnsl_s $LIBS"
5594 +       AC_CHECK_LIB(X11_s,XOpenDisplay,
5595 +               [LIBS="-lX11_s $LIBS"
5596 +       AC_CHECK_LIB(Xt_s,XtAppInitialize,
5597 +               [LIBS="-lXt_s $LIBS"
5598 +                cf_have_X_LIBS=Xt
5599 +               ]) ]) ]) ]) ])
5600 +       ;;
5601 +*)
5602 +       AC_CHECK_LIB(socket,socket)
5603 +       AC_CHECK_LIB(nsl,gethostname)
5604 +       ;;
5605 +esac
5606 +
5607 +if test $cf_have_X_LIBS = no ; then
5608 +       AC_PATH_XTRA
5609 +       LDFLAGS="$LDFLAGS $X_LIBS"
5610 +       CF_CHECK_CFLAGS($X_CFLAGS)
5611 +       AC_CHECK_LIB(X11,XOpenDisplay,
5612 +               [LIBS="-lX11 $LIBS"],,
5613 +               [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
5614 +       AC_CHECK_LIB(Xt, XtAppInitialize,
5615 +               [AC_DEFINE(HAVE_LIBXT)
5616 +                cf_have_X_LIBS=Xt
5617 +                LIBS="-lXt $X_PRE_LIBS $LIBS"],,
5618 +               [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
5619 +else
5620 +       LDFLAGS="$LDFLAGS $X_LIBS"
5621 +       CF_CHECK_CFLAGS($X_CFLAGS)
5622 +fi
5623 +
5624 +if test $cf_have_X_LIBS = no ; then
5625 +       AC_WARN(
5626 +[Unable to successfully link X Toolkit library (-lXt) with
5627 +test program.  You will have to check and add the proper libraries by hand
5628 +to makefile.])
5629 +fi
5630 +])dnl