3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
7 +++ tin-1.7.3/m4/codeset.m4
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.
17 +dnl From Bruno Haible.
19 +AC_DEFUN([AM_LANGINFO_CODESET],
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)
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).])
33 +++ tin-1.7.3/m4/gettext.m4
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.
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
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.
53 +dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
54 +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
56 +dnl Macro to add for using GNU gettext.
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.
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
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
93 +AC_DEFUN([AM_GNU_GETTEXT],
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
99 + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
100 + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
102 + define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
103 + define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
105 + AC_REQUIRE([AM_PO_SUBDIRS])dnl
106 + ifelse(gt_included_intl, yes, [
107 + AC_REQUIRE([AM_INTL_SUBDIR])dnl
110 + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
111 + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
112 + AC_REQUIRE([AC_LIB_RPATH])
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])
129 + AC_MSG_CHECKING([whether NLS is requested])
130 + dnl Default is enabled NLS
132 + [ --disable-nls do not use Native Language Support],
133 + USE_NLS=$enableval, USE_NLS=yes)
134 + AC_MSG_RESULT($USE_NLS)
137 + ifelse(gt_included_intl, yes, [
138 + BUILD_INCLUDED_LIBINTL=no
139 + USE_INCLUDED_LIBINTL=no
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)
156 + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
157 + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
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.
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])
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)
175 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
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)])
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, , [
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)
207 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
209 +], [])[extern int _nl_msg_cat_cntr;
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)
228 +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
230 +], [])[extern int _nl_msg_cat_cntr;
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
243 + CPPFLAGS="$gt_save_CPPFLAGS"
244 + LIBS="$gt_save_LIBS"])
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
256 + dnl Reset the values set by searching for libintl.
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
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/ $//'`
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.
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
297 + if test "$USE_NLS" = "yes"; then
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])
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.])
313 + dnl We need to process the po/ directory.
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
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)
330 + dnl For backward compatibility. Some configure.ins may be using this.
331 + nls_cv_header_intl=
332 + nls_cv_header_libgt=
334 + dnl For backward compatibility. Some Makefiles may be using this.
336 + AC_SUBST(DATADIRNAME)
338 + dnl For backward compatibility. Some Makefiles may be using this.
340 + AC_SUBST(INSTOBJEXT)
342 + dnl For backward compatibility. Some Makefiles may be using this.
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)
351 + dnl For backward compatibility. Some Makefiles may be using this.
352 + INTLLIBS="$LIBINTL"
355 + dnl Make all documented variables known to autoconf.
357 + AC_SUBST(LTLIBINTL)
362 +dnl Checks for all prerequisites of the po subdirectory,
363 +dnl except for USE_NLS.
364 +AC_DEFUN([AM_PO_SUBDIRS],
366 + AC_REQUIRE([AC_PROG_MAKE_SET])dnl
367 + AC_REQUIRE([AC_PROG_INSTALL])dnl
368 + AC_REQUIRE([AM_MKINSTALLDIRS])dnl
370 + dnl Perform the following tests also if --disable-nls has been given,
371 + dnl because they are needed for "make dist" to work.
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)],
380 + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
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)],
389 + dnl Remove leftover from FreeBSD xgettext call.
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], :)
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
405 + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
407 + [found $GMSGFMT program is not GNU msgfmt; ignore it])
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
422 + [found xgettext program is not GNU xgettext; ignore it])
425 + dnl Remove leftover from FreeBSD xgettext call.
429 + AC_OUTPUT_COMMANDS([
430 + for ac_file in $CONFIG_FILES; do
431 + # Support "outfile[:infile[:infile...]]"
433 + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
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" ;;
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
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"
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_'
465 + case "$ac_given_srcdir" in
467 + *) srcdirpre='$(srcdir)/' ;;
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"
479 + # CATALOGS depends on both $ac_dir and the user's LINGUAS
480 + # environment variable.
482 + if test -n "$ALL_LINGUAS"; then
483 + for presentlang in $ALL_LINGUAS; do
485 + if test "%UNSET%" != "$LINGUAS"; then
486 + desiredlanguages="$LINGUAS"
488 + desiredlanguages="$ALL_LINGUAS"
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;;
500 + if test $useit = yes; then
501 + INST_LINGUAS="$INST_LINGUAS $presentlang"
506 + if test -n "$INST_LINGUAS"; then
507 + for lang in $INST_LINGUAS; do
508 + CATALOGS="$CATALOGS $lang.gmo"
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
516 + *.orig | *.bak | *~) ;;
517 + *) cat "$f" >> "$ac_dir/Makefile" ;;
525 + [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
526 + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
528 + eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
529 + # Capture the value of LINGUAS because we need it to compute CATALOGS.
530 + LINGUAS="${LINGUAS-%UNSET%}"
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],
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
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])
566 + AM_LANGINFO_CODESET
567 + if test $ac_cv_header_locale_h = yes; then
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
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
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].*)
593 + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
594 + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
596 + AC_MSG_RESULT([$ac_prog_version])
598 + if test $ac_verc_fail = yes; then
604 +AC_DEFUN([AM_MKINSTALLDIRS],
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.
610 + if test -n "$ac_aux_dir"; then
611 + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
613 + if test -z "$MKINSTALLDIRS"; then
614 + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
616 + AC_SUBST(MKINSTALLDIRS)
620 +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
621 +AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
623 +++ tin-1.7.3/m4/glibc21.m4
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.
633 +# Test for the GNU C Library, version 2.1 or newer.
634 +# From Bruno Haible.
636 +AC_DEFUN([jm_GLIBC21],
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],
642 +#include <features.h>
643 +#ifdef __GNU_LIBRARY__
644 + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
649 + ac_cv_gnu_library_2_1=yes,
650 + ac_cv_gnu_library_2_1=no)
654 + GLIBC21="$ac_cv_gnu_library_2_1"
658 +++ tin-1.7.3/m4/iconv.m4
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.
668 +dnl From Bruno Haible.
670 +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
672 + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
673 + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
674 + AC_REQUIRE([AC_LIB_RPATH])
676 + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
678 + AC_LIB_LINKFLAGS_BODY([iconv])
681 +AC_DEFUN([AM_ICONV_LINK],
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).
686 + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
688 + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
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])
697 + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
698 + am_cv_func_iconv="no, consider installing GNU libiconv"
700 + AC_TRY_LINK([#include <stdlib.h>
701 +#include <iconv.h>],
702 + [iconv_t cd = iconv_open("","");
703 + iconv(cd,NULL,NULL,NULL,NULL);
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);
714 + am_cv_lib_iconv=yes
715 + am_cv_func_iconv=yes)
716 + LIBS="$am_save_LIBS"
719 + if test "$am_cv_func_iconv" = yes; then
720 + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
722 + if test "$am_cv_lib_iconv" = yes; then
723 + AC_MSG_CHECKING([how to link with libiconv])
724 + AC_MSG_RESULT([$LIBICONV])
726 + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
728 + CPPFLAGS="$am_save_CPPFLAGS"
733 + AC_SUBST(LTLIBICONV)
736 +AC_DEFUN([AM_ICONV],
739 + if test "$am_cv_func_iconv" = yes; then
740 + AC_MSG_CHECKING([for iconv declaration])
741 + AC_CACHE_VAL(am_cv_proto_iconv, [
749 +#if defined(__STDC__) || defined(__cplusplus)
750 +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
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.])
764 +++ tin-1.7.3/m4/intdiv0.m4
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.
774 +dnl From Bruno Haible.
776 +AC_DEFUN([gt_INTDIV0],
778 + AC_REQUIRE([AC_PROG_CC])dnl
779 + AC_REQUIRE([AC_CANONICAL_HOST])dnl
781 + AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
782 + gt_cv_int_divbyzero_sigfpe,
790 +sigfpe_handler (int sig)
792 +sigfpe_handler (sig) int sig;
795 + /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
796 + exit (sig != SIGFPE);
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);
811 +/* Linux/SPARC yields signal SIGILL. */
812 +#if defined (__sparc__) && defined (__linux__)
813 + signal (SIGILL, sigfpe_handler);
820 +], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
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";;
827 + gt_cv_int_divbyzero_sigfpe="guessing no";;
831 + case "$gt_cv_int_divbyzero_sigfpe" in
835 + AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
836 + [Define if integer division by zero raises signal SIGFPE.])
839 +++ tin-1.7.3/m4/inttypes_h.m4
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.
849 +dnl From Paul Eggert.
851 +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
852 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
854 +AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
856 + AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
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. ])
870 +++ tin-1.7.3/m4/inttypes.m4
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.
880 +dnl From Paul Eggert.
882 +# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
885 +AC_DEFUN([gt_HEADER_INTTYPES_H],
887 + AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
890 + [#include <sys/types.h>
891 +#include <inttypes.h>],
892 + [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
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>.])
900 +++ tin-1.7.3/m4/inttypes-pri.m4
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.
910 +dnl From Bruno Haible.
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.
915 +AC_DEFUN([gt_INTTYPES_PRI],
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,
922 + AC_TRY_COMPILE([#include <inttypes.h>
926 +], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
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.])
935 +++ tin-1.7.3/m4/isc-posix.m4
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.
945 +# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
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
955 +undefine([AC_ISC_POSIX])
957 +AC_DEFUN([AC_ISC_POSIX],
959 + dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
960 + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
964 +++ tin-1.7.3/m4/lcmessage.m4
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.
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
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.
984 +dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
986 +# Check whether LC_MESSAGES is available in <locale.h>.
988 +AC_DEFUN([AM_LC_MESSAGES],
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.])
999 +++ tin-1.7.3/m4/lib-ld.m4
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.
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.
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
1020 + acl_cv_prog_gnu_ld=no
1022 +with_gnu_ld=$acl_cv_prog_gnu_ld
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
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])
1038 + # gcc leaves a trailing carriage return which upsets mingw
1039 + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1041 + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
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%/%"`
1052 + test -z "$LD" && LD="$ac_prog"
1055 + # If it fails, then pretend we aren't using GCC.
1059 + # If it is relative, then search for the first ld in PATH.
1060 + with_gnu_ld=unknown
1063 +elif test "$with_gnu_ld" = yes; then
1064 + AC_MSG_CHECKING([for GNU ld])
1066 + AC_MSG_CHECKING([for non-GNU ld])
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
1081 + test "$with_gnu_ld" != yes && break
1085 + IFS="$ac_save_ifs"
1087 + acl_cv_path_LD="$LD" # Let the user override the test with a path.
1089 +LD="$acl_cv_path_LD"
1090 +if test -n "$LD"; then
1091 + AC_MSG_RESULT($LD)
1095 +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1099 +++ tin-1.7.3/m4/lib-link.m4
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.
1109 +dnl From Bruno Haible.
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],
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"
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
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],
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___])])
1157 + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1159 + AC_LIB_LINKFLAGS_BODY([$1], [$2])
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)
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"
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])
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"
1186 + AC_SUBST([HAVE_LIB]NAME)
1187 + AC_SUBST([LIB]NAME)
1188 + AC_SUBST([LTLIB]NAME)
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],
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
1207 + rm -f ./conftest.sh
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)
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],
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\"
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],
1242 + if test "X$withval" = "Xno"; then
1245 + if test "X$withval" = "X"; then
1246 + AC_LIB_WITH_FINAL_PREFIX([
1247 + eval additional_includedir=\"$includedir\"
1248 + eval additional_libdir=\"$libdir\"
1251 + additional_includedir="$withval/include"
1252 + additional_libdir="$withval/lib"
1256 + dnl Search the library and its dependencies in $additional_libdir and
1257 + dnl $LDFLAGS. Using breadth-first-seach.
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"
1268 + for name in $names_this_round; do
1270 + for n in $names_already_handled; do
1271 + if test "$n" = "$name"; then
1272 + already_handled=yes
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"
1289 + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1290 + dnl that this library doesn't exist. So just drop it.
1294 + dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1295 + dnl and the already constructed $LIBNAME/$LTLIBNAME.
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"
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"
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\"])
1322 + dir=`echo "X$x" | sed -e 's/^X-L//'`
1323 + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1325 + found_so="$dir/lib$name.$shlibext"
1326 + if test -f "$dir/lib$name.la"; then
1327 + found_la="$dir/lib$name.la"
1330 + if test -f "$dir/lib$name.$libext"; then
1332 + found_a="$dir/lib$name.$libext"
1333 + if test -f "$dir/lib$name.la"; then
1334 + found_la="$dir/lib$name.la"
1340 + if test "X$found_dir" != "X"; then
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"
1356 + dnl Use an explicit option to hardcode DIR into the resulting
1358 + dnl Potentially add DIR to ltrpathdirs.
1359 + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1361 + for x in $ltrpathdirs; do
1362 + if test "X$x" = "X$found_dir"; then
1367 + if test -z "$haveit"; then
1368 + ltrpathdirs="$ltrpathdirs $found_dir"
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"
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
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.
1383 + for x in $rpathdirs; do
1384 + if test "X$x" = "X$found_dir"; then
1389 + if test -z "$haveit"; then
1390 + rpathdirs="$rpathdirs $found_dir"
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
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
1404 + if test -z "$haveit"; then
1405 + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
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"
1411 + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
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"
1420 + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1426 + if test "X$found_a" != "X"; then
1427 + dnl Linking with a static library.
1428 + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1430 + dnl We shouldn't come here, but anyway it's good to have a
1432 + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1435 + dnl Assume the include files are nearby.
1436 + additional_includedir=
1437 + case "$found_dir" in
1439 + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1440 + additional_includedir="$basedir/include"
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
1453 + if test "X$additional_includedir" = "X/usr/local/include"; then
1454 + if test -n "$GCC"; then
1456 + linux*) haveit=yes;;
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
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"
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" ;;
1487 + libdir="$save_libdir"
1488 + dnl We use only dependency_libs.
1489 + for dep in $dependency_libs; do
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
1502 + if test "X$additional_libdir" = "X/usr/local/lib"; then
1503 + if test -n "$GCC"; then
1505 + linux*) haveit=yes;;
1509 + if test -z "$haveit"; then
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
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"
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
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"
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.
1547 + for x in $rpathdirs; do
1548 + if test "X$x" = "X$dir"; then
1553 + if test -z "$haveit"; then
1554 + rpathdirs="$rpathdirs $dir"
1556 + dnl Potentially add DIR to ltrpathdirs.
1557 + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1559 + for x in $ltrpathdirs; do
1560 + if test "X$x" = "X$dir"; then
1565 + if test -z "$haveit"; then
1566 + ltrpathdirs="$ltrpathdirs $dir"
1571 + dnl Handle this in the next round.
1572 + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1575 + dnl Handle this in the next round. Throw away the .la's
1576 + dnl directory; it is already contained in a preceding -L
1578 + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1581 + dnl Most likely an immediate library name.
1582 + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1583 + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
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"
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.
1606 + for found_dir in $rpathdirs; do
1607 + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1609 + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1610 + acl_save_libdir="$libdir"
1612 + eval flag=\"$hardcode_libdir_flag_spec\"
1613 + libdir="$acl_save_libdir"
1614 + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
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"
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"
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],
1641 + for element in [$2]; do
1643 + for x in $[$1]; do
1644 + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1645 + if test "X$x" = "X$element"; then
1650 + if test -z "$haveit"; then
1651 + [$1]="${[$1]}${[$1]:+ }$element"
1656 +++ tin-1.7.3/m4/lib-prefix.m4
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.
1666 +dnl From Bruno Haible.
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],
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\"
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],
1690 + if test "X$withval" = "Xno"; then
1693 + if test "X$withval" = "X"; then
1694 + AC_LIB_WITH_FINAL_PREFIX([
1695 + eval additional_includedir=\"$includedir\"
1696 + eval additional_libdir=\"$libdir\"
1699 + additional_includedir="$withval/include"
1700 + additional_libdir="$withval/lib"
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
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
1720 + if test -z "$haveit"; then
1721 + if test "X$additional_includedir" = "X/usr/local/include"; then
1722 + if test -n "$GCC"; then
1724 + linux*) haveit=yes;;
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"
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
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
1751 + if test -z "$haveit"; then
1752 + if test "X$additional_libdir" = "X/usr/local/lib"; then
1753 + if test -n "$GCC"; then
1755 + linux*) haveit=yes;;
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"
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],
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"
1780 + acl_final_prefix="$prefix"
1782 + if test "X$exec_prefix" = "XNONE"; then
1783 + acl_final_exec_prefix='${prefix}'
1785 + acl_final_exec_prefix="$exec_prefix"
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"
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],
1798 + acl_save_prefix="$prefix"
1799 + prefix="$acl_final_prefix"
1800 + acl_save_exec_prefix="$exec_prefix"
1801 + exec_prefix="$acl_final_exec_prefix"
1803 + exec_prefix="$acl_save_exec_prefix"
1804 + prefix="$acl_save_prefix"
1807 +++ tin-1.7.3/m4/progtest.m4
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.
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
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.
1827 +dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
1829 +# Search path for a program which passes the given test.
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,
1840 + ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
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
1848 + ac_cv_path_$1="$ac_dir/$ac_word"
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"
1860 +$1="$ac_cv_path_$1"
1861 +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1862 + AC_MSG_RESULT([$]$1)
1869 +++ tin-1.7.3/m4/stdint_h.m4
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.
1879 +dnl From Paul Eggert.
1881 +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
1882 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
1884 +AC_DEFUN([jm_AC_HEADER_STDINT_H],
1886 + AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
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. ])
1900 +++ tin-1.7.3/m4/uintmax_t.m4
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.
1910 +dnl From Paul Eggert.
1914 +# Define uintmax_t to `unsigned long' or `unsigned long long'
1915 +# if <inttypes.h> does not exist.
1917 +AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
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.])
1932 +++ tin-1.7.3/m4/ulonglong.m4
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.
1942 +dnl From Paul Eggert.
1944 +AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
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.])
1958 +++ tin-1.7.3/acinclude.m4
1960 +dnl ---------------------------------------------------------------------------
1961 +dnl AM_MULTIBYTE_ABLE version: 5 updated: 2003/01/16 16:21:27
1962 +dnl -----------------
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],
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 */
1981 + [char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
1985 + wchar_t format[3];
1990 + mbtowc(wcb, icb, MB_CUR_MAX);
1991 + mbstowcs(wcb, icb, 5);
1992 + iswprint((wint_t) wcb[0]);
1995 + wcwidth((wint_t) wcb[0]);
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};
2009 + wchar_t format[3];
2014 + mbtowc(wcb, icb, MB_CUR_MAX);
2015 + mbstowcs(wcb, icb, 5);
2016 + iswprint((wint_t) wcb[0]);
2019 + wcwidth((wint_t) wcb[0]);
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"])
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)
2039 +dnl ---------------------------------------------------------------------------
2040 +dnl CF_ADD_CFLAGS version: 5 updated: 2002/12/01 00:12:15
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],
2048 +for cf_add_cflags in $1
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
2056 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2061 + cf_new_cflags="$cf_new_cflags $cf_add_cflags"
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"
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"
2077 +dnl ---------------------------------------------------------------------------
2078 +dnl CF_ADD_INCDIR version: 4 updated: 2002/12/21 14:25:52
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],
2087 +for cf_add_incdir in $1
2091 + case $cf_add_incdir in
2092 + /usr/include) # (vi
2094 + /usr/local/include) # (vi
2095 + if test "$GCC" = yes
2097 + cf_save_CPPFLAGS="$CPPFLAGS"
2098 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
2099 + AC_TRY_COMPILE([#include <stdio.h>],
2100 + [printf("Hello")],
2102 + [CPPFLAGS="$cf_save_CPPFLAGS"])
2106 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
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"
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],
2122 +AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
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
2132 +# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes)
2133 +for cf_arg in "-DCC_HAS_PROTOS" \
2138 + "-Aa -D_HPUX_SOURCE" \
2141 + CF_ADD_CFLAGS($cf_arg)
2144 +#ifndef CC_HAS_PROTOS
2145 +#if !defined(__STDC__) || (__STDC__ != 1)
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])
2155 +CFLAGS="$cf_save_CFLAGS"
2156 +CPPFLAGS="$cf_save_CPPFLAGS"
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)
2163 + AC_DEFINE(CC_HAS_PROTOS)
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
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])
2185 +dnl ---------------------------------------------------------------------------
2186 +dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
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
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
2200 +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
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
2213 +,[ $3]) ifelse($4,,,[
2216 + fi],[enableval=$5 ifelse($4,,,[
2220 +dnl ---------------------------------------------------------------------------
2221 +dnl CF_ARG_WITH version: 3 updated: 2000/07/20 00:41:18
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
2235 +case "$withval" in #(vi
2237 + AC_ERROR(expected a value for --with-$1)
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.
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
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
2258 +dnl HAVE_LIBGETTEXT_H if we're using ./intl
2260 +AC_DEFUN([CF_BUNDLED_INTL],[
2261 +cf_makefile=ifelse($1,,Makefile,$1)
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/*//'`
2268 +AM_GNU_GETTEXT(,,,[$2])
2274 +dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE:
2275 +CF_OUR_MESSAGES($1)
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"
2285 + if test -z "$INTLDIR_MAKE"; then
2286 + AC_DEFINE(HAVE_LIBGETTEXT_H)
2290 + if test "$USE_NLS" = yes ; then
2291 + AC_CHECK_HEADERS(libintl.h)
2295 +if test -z "$INTLDIR_MAKE" ; then
2296 + CPPFLAGS="-I../intl $CPPFLAGS"
2299 +dnl FIXME: we use this in lynx (the alternative is a spurious dependency upon
2301 +if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
2309 +AC_SUBST(INTLDIR_MAKE)
2310 +AC_SUBST(MSG_DIR_MAKE)
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.
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)
2324 + if test -n "$nls_cv_header_intl" ; then
2325 + AC_DEFINE(HAVE_LIBINTL_H)
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.
2335 +dnl $1 specifies the top of the directory containing PCRE's include, lib dirs.
2336 +AC_DEFUN([CF_BUNDLED_PCRE],
2342 +case .$cf_pcre_home in #(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)
2353 + PCREDIR_LIBS="-lpcre"
2356 + CF_PATH_SYNTAX(cf_pcre_home)
2358 + PCREDIR_LIBS="-L${cf_pcre_home}/lib -lpcre"
2359 + PCREDIR_CPPFLAGS="-I${cf_pcre_home}/include"
2362 +AC_SUBST(PCREDIR_MAKE)
2363 +AC_SUBST(PCREDIR_LIBS)
2364 +AC_SUBST(PCREDIR_CPPFLAGS)
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).
2371 +dnl CHECK_DECL_FLAG and CHECK_DECL_HDRS must be set in configure.in
2372 +AC_DEFUN([CF_CHECK_1_DECL],
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"
2383 +struct zowie { int a; double b; struct zowie *c; char d; };
2384 +extern struct zowie *$1();
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)
2392 +#define DECL_${cf_1_up}
2395 +[eval 'cf_cv_func_'$1'=yes'],
2396 +[eval 'cf_cv_func_'$1'=no'])
2398 +eval 'cf_cv_func_'$1'=yes'
2401 +[eval 'cf_cv_func_'$1'=no'])
2402 +CFLAGS="$cf_save_CFLAGS"
2404 +eval 'cf_result=$cf_cv_func_'$1
2405 +AC_MSG_RESULT($cf_result)
2406 +test $cf_result = yes && AC_DEFINE_UNQUOTED(DECL_$2)
2408 +dnl ---------------------------------------------------------------------------
2409 +dnl CF_CHECK_CACHE version: 7 updated: 2001/12/19 00:50:10
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.
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],
2420 +if test -f $srcdir/config.guess ; then
2421 + ifelse([$1],,[AC_CANONICAL_HOST],[$1])
2422 + system_name="$host_os"
2424 + system_name="`(uname -s -r) 2>/dev/null`"
2425 + if test -z "$system_name" ; then
2426 + system_name="`(hostname) 2>/dev/null`"
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"])
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)
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.")
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],
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)
2459 + CFLAGS="$cf_check_flags"])
2462 +dnl ---------------------------------------------------------------------------
2463 +dnl CF_CHECK_DECL version: 2 updated: 1997/08/28 23:57:55
2465 +AC_DEFUN([CF_CHECK_DECL],
2468 +CF_UPPER(ac_tr_func,$ac_func)
2469 +CF_CHECK_1_DECL(${ac_func}, ${ac_tr_func})dnl
2472 +dnl ---------------------------------------------------------------------------
2473 +dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23
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
2479 +dnl $1 = the name to check
2480 +AC_DEFUN([CF_CHECK_ERRNO],
2482 +AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
2484 +#ifdef HAVE_STDLIB_H
2485 +#include <stdlib.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])
2495 +if test "$cf_cv_dcl_$1" = no ; then
2496 + CF_UPPER(cf_result,decl_$1)
2497 + AC_DEFINE_UNQUOTED($cf_result)
2500 +# It's possible (for near-UNIX clones) that the data doesn't exist
2501 +CF_CHECK_EXTERN_DATA($1,int)
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
2510 +AC_DEFUN([CF_CHECK_EXTERN_DATA],
2512 +AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[
2518 + [cf_cv_have_$1=yes],
2519 + [cf_cv_have_$1=no])
2522 +if test "$cf_cv_have_$1" = yes ; then
2523 + CF_UPPER(cf_result,have_$1)
2524 + AC_DEFINE_UNQUOTED($cf_result)
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.
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],[
2539 + AC_MSG_CHECKING(for $cf_hdr)
2541 +#include <sys/types.h>
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})
2551 +dnl ---------------------------------------------------------------------------
2552 +dnl CF_CHECK_IPV6 version: 2 updated: 2000/04/13 21:38:04
2554 +dnl Check for IPV6 configuration.
2555 +AC_DEFUN([CF_CHECK_IPV6],[
2559 +CF_FUNC_GETADDRINFO
2561 +if test "$cf_cv_getaddrinfo" != "yes"; then
2562 + if test "$cf_cv_ipv6type" != "linux"; then
2564 +[You must get working getaddrinfo() function,
2565 +or you can specify "--disable-ipv6"])
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).])
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],
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])
2588 +AC_MSG_RESULT($cf_cv_nested_params)
2589 +test $cf_cv_nested_params = yes && AC_DEFINE(HAVE_NESTED_PARAMS)
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).
2598 +AC_DEFUN([CF_COLOR_CURSES],
2600 +AC_MSG_CHECKING(if curses supports color attributes)
2601 +AC_CACHE_VAL(cf_cv_color_curses,[
2603 +#include <${cf_cv_ncurses_header-curses.h}>
2605 + [chtype x = COLOR_BLUE;
2608 +#ifndef NCURSES_BROKEN
2609 + wbkgd(curscr, getbkgd(stdscr)); /* X/Open XPG4 aka SVr4 Curses */
2612 + [cf_cv_color_curses=yes],
2613 + [cf_cv_color_curses=no])
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)
2621 +dnl ---------------------------------------------------------------------------
2622 +dnl CF_COMPTYPE version: 2 updated: 1997/08/28 23:57:55
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],
2628 +AC_MSG_CHECKING([for ANSI qsort])
2629 +AC_CACHE_VAL(cf_cv_comptype,[
2631 +#ifdef HAVE_STDLIB_H
2632 +#include <stdlib.h>
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])
2640 +AC_MSG_RESULT($cf_cv_comptype)
2641 +if test $cf_cv_comptype = yes; then
2642 + AC_DEFINE(HAVE_COMPTYPE_VOID)
2644 + AC_DEFINE(HAVE_COMPTYPE_CHAR)
2647 +dnl ---------------------------------------------------------------------------
2648 +dnl CF_COREFILE version: 2 updated: 1997/08/28 23:57:55
2650 +dnl Check if the application can dump core (for debugging).
2651 +AC_DEFUN([CF_COREFILE],
2653 +AC_MSG_CHECKING([if application can dump core])
2654 +AC_CACHE_VAL(cf_cv_corefile,[
2656 +#include <signal.h>
2657 +#include <sys/types.h>
2658 +#include <sys/stat.h>
2662 + return ((stat("core", &sb) == 0 /* UNIX */
2663 + || stat("conftest.core", &sb) == 0 /* FreeBSD */
2665 + && ((sb.st_mode & S_IFMT) == S_IFREG));
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)
2680 + if ((pid = fork()) != 0) {
2681 + while (wait(&status) <= 0)
2684 + abort(); /* this will dump core, if anything will */
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)
2699 +dnl ---------------------------------------------------------------------------
2700 +dnl CF_CPP_CONCATS version: 2 updated: 1997/08/28 23:57:55
2702 +dnl Test for ANSI token expansion (used in 'assert').
2703 +AC_DEFUN([CF_CPP_CONCATS],
2705 +AC_MSG_CHECKING([for ansi token concatenation])
2706 +AC_CACHE_VAL(cf_cv_cpp_concats,[
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])
2713 +AC_MSG_RESULT($cf_cv_cpp_concats)
2714 +test $cf_cv_cpp_concats = yes && AC_DEFINE(CPP_DOES_CONCAT)
2716 +dnl ---------------------------------------------------------------------------
2717 +dnl CF_CPP_EXPANDS version: 2 updated: 1997/08/28 23:57:55
2719 +dnl Test for ANSI token expansion (used in 'assert').
2720 +AC_DEFUN([CF_CPP_EXPANDS],
2722 +AC_MSG_CHECKING([for ansi token expansion/substitution])
2723 +AC_CACHE_VAL(cf_cv_cpp_expands,[
2725 +#define string(n) #n],
2726 + [char *s = string(token)],
2727 + [cf_cv_cpp_expands=yes],
2728 + [cf_cv_cpp_expands=no])
2730 +AC_MSG_RESULT($cf_cv_cpp_expands)
2731 +test $cf_cv_cpp_expands = yes && AC_DEFINE(CPP_DOES_EXPAND)
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],[
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"
2747 + test -d /usr/5lib && \
2748 + test -d /usr/5include && \
2749 + cf_cv_curses_incdir="-I/usr/5include"
2753 +test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
2755 +AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
2756 +cf_cv_ncurses_header=none
2760 + ncurses/curses.h \
2763 +AC_TRY_COMPILE([#include <${cf_header}>],
2764 + [initscr(); tgoto("?", 0,0)],
2765 + [cf_cv_ncurses_header=$cf_header; break],[])
2769 +if test "$cf_cv_ncurses_header" = none ; then
2770 + AC_MSG_ERROR(No curses header-files found)
2773 +# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
2774 +AC_CHECK_HEADERS($cf_cv_ncurses_header)
2777 +dnl ---------------------------------------------------------------------------
2778 +dnl CF_CURSES_LIBS version: 22 updated: 2002/10/27 18:21:42
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],[
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)],
2789 +AC_MSG_RESULT($cf_result)
2791 +if test "$cf_result" = no ; then
2792 +case $host_os in #(vi
2794 + AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
2796 +hpux10.*|hpux11.*) #(vi
2797 + AC_CHECK_LIB(cur_colr,initscr,[
2798 + LIBS="-lcur_colr $LIBS"
2799 + ac_cv_func_initscr=yes
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
2808 +linux*) # Suse Linux does not follow /usr/lib convention
2809 + LIBS="$LIBS -L/lib"
2812 + test -d /usr/5lib && \
2813 + LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
2814 + ac_cv_func_initscr=yes
2818 +if test ".$ac_cv_func_initscr" != .yes ; then
2819 + cf_save_LIBS="$LIBS"
2823 + if test ".${cf_cv_ncurses_version-no}" != .no
2825 + cf_check_list="ncurses curses cursesX"
2827 + cf_check_list="cursesX curses ncurses"
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
2835 + AC_CHECK_LIB($cf_term_lib,tgoto,[break])
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
2843 + AC_CHECK_LIB($cf_curs_lib,initscr,[break])
2845 + test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
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}>],
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
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);],
2864 + LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
2865 + AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
2868 + [cf_result=error])
2870 + AC_MSG_RESULT($cf_result)
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).
2884 +dnl The 'tgoto()' function is declared in both terminfo and termcap.
2886 +dnl See CF_TYPE_OUTCHAR for more details.
2887 +AC_DEFUN([CF_CURSES_TERMCAP],
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
2894 +for cf_t_opts in "" "NEED_TERMCAP_H"
2896 +for cf_c_opts in "" "NEED_CURSES_H"
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"
2903 + AC_TRY_LINK([/* $cf_c_opts $cf_t_opts */
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
2911 + [echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&AC_FD_CC
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])])
2919 + CPPFLAGS="$cf_save_CPPFLAGS"
2920 + test "$cf_cv_need_curses_h" = yes && break
2922 + test "$cf_cv_need_curses_h" = yes && break
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
2931 + cf_cv_need_curses_h=curses.h
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
2938 + cf_cv_need_curses_h=no
2943 +case $cf_cv_need_curses_h in
2945 + AC_DEFINE_UNQUOTED(NEED_CURSES_H)
2946 + AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
2949 + AC_DEFINE_UNQUOTED(NEED_CURSES_H)
2952 + AC_DEFINE_UNQUOTED(NEED_TERM_H)
2955 + AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
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],
2969 +AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
2975 +#include <${cf_cv_ncurses_header-curses.h}>
2976 +#include <${cf_header}>],
2978 + [cf_cv_term_header=$cf_header],
2979 + [cf_cv_term_header=no])
2983 +case $cf_cv_term_header in #(vi
2985 + AC_DEFINE(HAVE_TERM_H)
2988 + AC_DEFINE(HAVE_NCURSES_TERM_H)
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:
3007 +dnl tcsh TENEX C Shell (csh based)
3008 +AC_DEFUN([CF_DEFAULT_SHELL],
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.
3016 +#include <sys/params.h>],[
3017 +#if (defined(BSD) && (BSD >= 199103))
3021 +],[$cf_shell_progs="csh tcsh $cf_shell_progs"])
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
3030 + cf_pattern="^"$cf_prog"$"
3033 + AC_MSG_ERROR(Program name must be absolute or filename: $cf_prog)
3036 + cf_pattern="/"$cf_prog"$"
3039 + cf_path=`egrep $cf_pattern /etc/shells 2>/dev/null`
3040 + if test -n "$cf_path"
3042 + for cf_shell in $cf_path
3044 + if test -f "$cf_shell"
3046 + DEFAULT_SHELL="$cf_shell"
3051 + if test -n "$DEFAULT_SHELL"
3056 + AC_MSG_RESULT($DEFAULT_SHELL)
3059 +AC_PATH_PROGS(DEFAULT_SHELL,
3061 + $PATH:/bin:/usr/bin:/usr/xpg4/bin:/bin/posix:/usr/bin/posix:/usr/old/bin:/usr/local/bin)
3063 +if test -z "$DEFAULT_SHELL" ; then
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
3070 + AC_MSG_ERROR(Cannot use /bin/false because it does not exist)
3073 +AC_DEFINE_UNQUOTED(DEFAULT_SHELL,"$DEFAULT_SHELL")
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],
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")
3086 +dnl ---------------------------------------------------------------------------
3087 +dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
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.
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
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],
3109 + ECHO_LT='--silent'
3110 + ECHO_LD='@echo linking [$]@;'
3111 + RULE_CC=' @echo compiling [$]<'
3112 + SHOW_CC=' @echo compiling [$]@'
3117 + RULE_CC='# compiling'
3118 + SHOW_CC='# compiling'
3121 +AC_MSG_RESULT($enableval)
3128 +dnl ---------------------------------------------------------------------------
3129 +dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
3131 +dnl Check if 'errno' is declared in <errno.h>
3132 +AC_DEFUN([CF_ERRNO],
3134 +CF_CHECK_ERRNO(errno)
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])
3146 +AC_MSG_CHECKING(for IPv6 library if required)
3147 +case $cf_cv_ipv6type in #(vi
3153 + dnl http://www.kame.net/
3159 +linux-libinet6) #(vi
3160 + dnl http://www.v6.linux.or.jp/
3177 +AC_MSG_RESULT($cf_ipv6lib)
3179 +if test "$cf_ipv6lib" != "none"; then
3182 +#include <sys/types.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
3190 + cf_header=$cf_incdir/netinet/ip6.h
3191 + if test -f $cf_header
3193 + CPPFLAGS="$CPPFLAGS -I$cf_incdir"
3194 + test -n "$verbose" && echo " ... found $cf_header" 1>&AC_FD_MSG
3197 + test -n "$verbose" && echo " ... tested $cf_header" 1>&AC_FD_MSG
3201 + CF_FIND_LIBRARY([$cf_ipv6lib],[$cf_ipv6dir],[
3202 +#include <sys/types.h>
3204 +#include <netinet/in.h>
3205 +#include <netinet/ip6.h>],
3206 + [getaddrinfo(0, 0, 0, 0)],
3209 + if test $cf_found_library = no ; then
3211 +[No $cf_ipv6lib library found, cannot continue. You must fetch lib$cf_ipv6lib.a
3212 +from an appropriate IPv6 kit and compile beforehand.])
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
3227 + if test "SunOS" = "`uname -s`"
3229 + if test -f /usr/include/netinet/ip6.h
3236 + dnl http://www.kame.net/
3237 + AC_EGREP_CPP(yes, [
3238 +#include <netinet/in.h>
3239 +#ifdef IPV6_INRIA_VERSION
3241 +#endif], [cf_cv_ipv6type=$i])
3244 + dnl http://www.kame.net/
3245 + AC_EGREP_CPP(yes, [
3246 +#include <netinet/in.h>
3249 +#endif], [cf_cv_ipv6type=$i])
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
3257 +#endif], [cf_cv_ipv6type=$i])
3259 + linux-libinet6) #(vi
3260 + dnl http://www.v6.linux.or.jp/
3261 + if test -d /usr/inet6
3264 + elif test -f /usr/include/netinet/ip6.h
3270 + AC_EGREP_CPP(yes, [
3271 +#include <sys/param.h>
3272 +#ifdef _TOSHIBA_INET6
3274 +#endif], [cf_cv_ipv6type=$i])
3277 + AC_EGREP_CPP(yes, [
3278 +#include </usr/local/v6/include/sys/v6config.h>
3281 +#endif], [cf_cv_ipv6type=$i])
3284 + AC_EGREP_CPP(yes, [
3285 +#include <sys/param.h>
3286 +#ifdef _ZETA_MINAMI_INET6
3288 +#endif], [cf_cv_ipv6type=$i])
3291 + if test "$cf_cv_ipv6type" != "unknown"; then
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
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
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],
3314 + eval 'cf_cv_have_lib_'$1'=no'
3317 + eval 'cf_cv_have_lib_'$1'=yes',[
3318 + cf_save_LIBS="$LIBS"
3319 + AC_MSG_CHECKING(for $5 in -l$1)
3321 + AC_TRY_LINK([$3],[$4],
3322 + [AC_MSG_RESULT(yes)
3323 + eval 'cf_cv_have_lib_'$1'=yes'
3325 + [AC_MSG_RESULT(no)
3326 + CF_LIBRARY_PATH(cf_search,$2)
3327 + for cf_libdir in $cf_search
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'
3335 + [AC_MSG_RESULT(no)
3336 + LIBS="$cf_save_LIBS"])
3340 +eval 'cf_found_library=[$]cf_cv_have_lib_'$1
3342 +if test $cf_found_library = no ; then
3343 + AC_ERROR(Cannot link $1 library)
3347 +dnl ---------------------------------------------------------------------------
3348 +dnl CF_FIX_SLASHES version: 2 updated: 2001/05/27 21:36:02
3350 +dnl OS/2 and Cygwin ports may pick up backslashes in pathnames, which are not
3351 +dnl usable in quoted strings. Fix them.
3353 +AC_DEFUN([CF_FIX_SLASHES],
3355 +case $cf_cv_system_name in #(vi
3357 + $1=`echo "[$]$1" | sed -e 's%\\\\%/%g'`
3361 +dnl ---------------------------------------------------------------------------
3362 +dnl CF_FUNC_FORK version: 2 updated: 1997/08/28 23:57:55
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,[
3375 +}], [cf_cv_func_fork=yes],
3376 + [cf_cv_func_fork=no],
3377 + [cf_cv_func_fork=unknown])
3379 +AC_MSG_RESULT($cf_cv_func_fork)
3380 +test $cf_cv_func_fork = yes && AC_DEFINE(HAVE_FORK)
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,[
3389 +#include <sys/types.h>
3391 +#include <string.h>
3392 +#include <sys/socket.h>
3393 +#include <netinet/in.h>
3395 +#define expect(a,b) if (strcmp(a,b) != 0) goto bad
3399 + int passive, gaierr, inet4 = 0, inet6 = 0;
3400 + struct addrinfo hints, *ai, *aitop;
3401 + char straddr[INET6_ADDRSTRLEN], strport[16];
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);
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) {
3420 + switch (ai->ai_family) {
3422 + expect(strport, "54321");
3424 + expect(straddr, "0.0.0.0");
3426 + expect(straddr, "127.0.0.1");
3431 + expect(strport, "54321");
3433 + expect(straddr, "::");
3435 + expect(straddr, "::1");
3443 + /* another family support? */
3449 + if (!(inet4 == 0 || inet4 == 2))
3451 + if (!(inet6 == 0 || inet6 == 2))
3455 + freeaddrinfo(aitop);
3460 + freeaddrinfo(aitop);
3464 +[cf_cv_getaddrinfo=yes],
3465 +[cf_cv_getaddrinfo=no],
3466 +[cf_cv_getaddrinfo=unknown])
3468 +if test "$cf_cv_getaddrinfo" = yes ; then
3469 + AC_DEFINE(HAVE_GAI_STRERROR)
3470 + AC_DEFINE(HAVE_GETADDRINFO)
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],
3480 +AC_CHECK_FUNC(memmove,,[
3481 +AC_CHECK_FUNC(bcopy,[
3482 + AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[
3485 + static char data[] = "abcdefghijklmnopqrstuwwxyz";
3487 + bcopy(data, temp, sizeof(data));
3488 + bcopy(temp+10, temp, 15);
3489 + bcopy(temp+5, temp+15, 10);
3490 + exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
3493 + [cf_cv_good_bcopy=yes],
3494 + [cf_cv_good_bcopy=no],
3495 + [cf_cv_good_bcopy=unknown])
3497 + ],[cf_cv_good_bcopy=no])
3498 + if test "$cf_cv_good_bcopy" = yes ; then
3499 + AC_DEFINE(USE_OK_BCOPY)
3501 + AC_DEFINE(USE_MY_MEMMOVE)
3504 +dnl ---------------------------------------------------------------------------
3505 +dnl CF_FUNC_SYSTEM version: 3 updated: 1997/10/22 22:02:10
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],
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,[
3516 +#include <signal.h>
3517 +#if HAVE_SYS_WAIT_H
3518 +#include <sys/wait.h>
3521 +RETSIGTYPE signal_handler (int sig)
3523 +#if HAVE_TYPE_UNIONWAIT
3524 + union wait wait_status;
3526 + int wait_status = 1;
3528 + int system_status;
3529 + wait (&wait_status);
3530 + system_status = WEXITSTATUS(wait_status); /* should be nonzero */
3531 + exit(system_status != 23);
3536 + /* this looks weird, but apparently the SIGCHLD gets there first on
3537 + * machines where 'system()' doesn't return a usable code, so ...
3539 + signal (SIGCHLD, signal_handler);
3540 + system("exit 23");
3544 + [cf_cv_system_status=no],
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])
3552 +AC_MSG_RESULT($cf_cv_system_status)
3553 +test $cf_cv_system_status = no && AC_DEFINE(USE_SYSTEM_STATUS)
3555 +dnl ---------------------------------------------------------------------------
3556 +dnl CF_GCC_VERSION version: 2 updated: 2003/05/24 15:01:41
3558 +dnl Find version of gcc
3559 +AC_DEFUN([CF_GCC_VERSION],[
3560 +AC_REQUIRE([AC_PROG_CC])
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)
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:
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".
3582 +AC_DEFUN([CF_GCC_WARNINGS],
3584 +AC_REQUIRE([CF_GCC_VERSION])
3585 +if ( test "$GCC" = yes || test "$GXX" = yes )
3587 + cat > conftest.$ac_ext <<EOF
3588 +#line __oline__ "configure"
3589 +int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
3591 + AC_CHECKING([for $CC warning options])
3592 + cf_save_CFLAGS="$CFLAGS"
3593 + EXTRA_CFLAGS="-W -Wall"
3595 + test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
3597 + Wbad-function-cast \
3601 + Wmissing-declarations \
3602 + Wmissing-prototypes \
3606 + Wstrict-prototypes \
3607 + Wundef $cf_warn_CONST
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
3614 + CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
3617 + case $GCC_VERSION in
3619 + CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
3624 + EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
3628 + CFLAGS="$cf_save_CFLAGS"
3630 +AC_SUBST(EXTRA_CFLAGS)
3632 +dnl ---------------------------------------------------------------------------
3633 +dnl CF_GNU_SOURCE version: 3 updated: 2000/10/29 23:30:53
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.
3640 +dnl Well, yes we could work around it...
3641 +AC_DEFUN([CF_GNU_SOURCE],
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
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
3655 + [cf_cv_gnu_source=no],
3656 + [cf_cv_gnu_source=yes])
3657 + CPPFLAGS="$cf_save"
3660 +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3662 +dnl ---------------------------------------------------------------------------
3663 +dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
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"
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"
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
3692 +dnl Compute the library-prefix for the given host system
3693 +dnl $1 = variable to set
3694 +AC_DEFUN([CF_LIB_PREFIX],
3696 + case $cf_cv_system_name in
3697 + OS/2*) LIB_PREFIX='' ;;
3698 + os2*) LIB_PREFIX='' ;;
3699 + *) LIB_PREFIX='lib' ;;
3701 +ifelse($1,,,[$1=$LIB_PREFIX])
3702 + AC_SUBST(LIB_PREFIX)
3704 +dnl ---------------------------------------------------------------------------
3705 +dnl CF_LOCKFILE version: 2 updated: 2001/05/26 12:41:02
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],
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)])])
3718 +AC_CACHE_CHECK(for file-locking functions,cf_cv_lockfile,[
3720 +for cf_lock in fcntl lockf flock
3722 +if eval 'test ${ac_cv_func_'$cf_lock'+set} = set'; then
3723 + case $cf_lock in #(vi
3727 +#ifdef HAVE_UNISTD_H
3728 +#include <unistd.h>
3730 +#ifdef HAVE_FCNTL_H
3739 + flk.l_type = F_WRLCK;
3740 + flk.l_whence = SEEK_SET;
3743 + rc = fcntl(fd, block ? F_SETLKW : F_SETLK, &flk)
3744 + && fcntl(fd, F_GETLK, &flk)
3745 + && fcntl(fd, F_SETLK, &flk);
3751 +#ifdef HAVE_UNISTD_H
3752 +#include <unistd.h>
3754 +#ifdef HAVE_FCNTL_H
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);
3767 +#ifdef HAVE_UNISTD_H
3768 +#include <unistd.h>
3770 +#ifdef HAVE_FCNTL_H
3773 +#ifdef HAVE_SYS_FILE_H
3774 +#include <sys/file.h>
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));
3784 + cf_cv_lockfile="$cf_cv_lockfile $cf_lock"
3789 +dnl ---------------------------------------------------------------------------
3790 +dnl CF_MAKEFLAGS version: 9 updated: 2001/12/30 18:17:27
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],
3798 +AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
3799 + cf_cv_makeflags=''
3800 + for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
3802 + cat >cf_makeflags.tmp <<CF_EOF
3805 + @ echo '.$cf_option'
3807 + cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
3808 + case "$cf_result" in
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=
3814 + *) cf_cv_makeflags=$cf_option
3819 + *) echo no match "$cf_result"
3823 + rm -f cf_makeflags.tmp
3826 +AC_SUBST(cf_cv_makeflags)
3828 +dnl ---------------------------------------------------------------------------
3829 +dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52
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
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],
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,[
3848 +#include <${cf_cv_ncurses_header-curses.h}>],[
3849 +#if defined(NCURSES_VERSION) && defined(wgetbkgd)
3855 + [cf_cv_ncurses_broken=no],
3856 + [cf_cv_ncurses_broken=yes])
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)
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],[
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 */
3880 +#ifdef NCURSES_VERSION
3881 +]ifelse($3,ncursesw,[
3886 +printf("%s\n", NCURSES_VERSION);
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.
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
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>.
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])
3923 +cf_ncuhdr_root=ifelse($1,,ncurses,$1)
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"
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
3934 + CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
3935 + test "$cf_cv_ncurses_h" != no && break
3939 +if test "$cf_cv_ncurses_h" != no ; then
3940 + cf_cv_ncurses_header=$cf_cv_ncurses_h
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
3949 + CF_ADD_INCDIR($cf_incdir)
3950 + for cf_header in \
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
3960 + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
3962 + CPPFLAGS="$cf_save2_CPPFLAGS"
3963 + test "$cf_cv_ncurses_h2" != no && break
3965 + test "$cf_cv_ncurses_h2" = no && AC_ERROR(not found)
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
3973 + CF_ADD_INCDIR($cf_1st_incdir)
3979 +case $cf_cv_ncurses_header in # (vi
3981 + AC_DEFINE(HAVE_NCURSES_H)
3985 +case $cf_cv_ncurses_header in # (vi
3986 +ncurses/curses.h|ncurses/ncurses.h)
3987 + AC_DEFINE(HAVE_NCURSES_NCURSES_H)
3989 +ncursesw/curses.h|ncursesw/ncurses.h)
3990 + AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
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.
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])
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
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"])])
4023 +case $host_os in #(vi
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"])
4031 +LIBS="$cf_ncurses_LIBS $LIBS"
4033 +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4035 + LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
4037 + CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
4038 + [#include <${cf_cv_ncurses_header-curses.h}>],
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
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"])
4059 +CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
4060 +AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
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],
4070 +AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
4071 + cf_cv_ncurses_version=no
4073 + rm -f $cf_tempfile
4075 +#include <${cf_cv_ncurses_header-curses.h}>
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);
4084 + fprintf(fp, "%s\n", NCURSES_VERSION);
4087 +# ifdef __NCURSES_H
4088 + fprintf(fp, "old\n");
4095 + cf_cv_ncurses_version=`cat $cf_tempfile`],,[
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}>
4102 +#ifdef NCURSES_VERSION
4103 +Autoconf NCURSES_VERSION
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
4119 + rm -f $cf_tempfile
4121 +test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
4123 +dnl ---------------------------------------------------------------------------
4124 +dnl CF_NETLIBS version: 4 updated: 1999/12/23 15:20:39
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
4135 +AC_DEFUN([CF_NETLIBS],[
4137 +AC_MSG_CHECKING(for network libraries)
4138 +AC_CACHE_VAL(cf_cv_netlibs,[
4139 +AC_MSG_RESULT(working...)
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)])])
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")
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)])])
4157 +AC_CHECK_FUNCS(gethostbyname,,[
4158 + CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
4160 +AC_CHECK_FUNCS(strcasecmp,,[
4161 + CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
4163 +LIBS="$LIBS $cf_cv_netlibs"
4164 +test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
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
4171 +dnl $1 specifies either Makefile or makefile, defaulting to the former.
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)
4177 +AC_DEFUN([CF_OUR_MESSAGES],
4179 +cf_makefile=ifelse($1,,Makefile,$1)
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])
4190 +AC_MSG_RESULT($use_our_messages)
4194 +if test "$use_our_messages" = yes
4196 + SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:po/$cf_makefile.inn"
4200 +AC_SUBST(MSG_DIR_MAKE)
4201 +AC_SUBST(SUB_MAKEFILE)
4203 +dnl ---------------------------------------------------------------------------
4204 +dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53
4206 +dnl Provide a value for the $PATH and similar separator
4207 +AC_DEFUN([CF_PATHSEP],
4209 + case $cf_cv_system_name in
4210 + os2*) PATHSEP=';' ;;
4213 +ifelse($1,,,[$1=$PATHSEP])
4216 +dnl ---------------------------------------------------------------------------
4217 +dnl CF_PATH_EDITOR version: 5 updated: 2000/07/20 00:41:18
4219 +dnl Look for the default editor (vi)
4220 +AC_DEFUN([CF_PATH_EDITOR],
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"
4232 + AC_PATH_PROG(DEFAULT_EDITOR,vi,vi,$PATH:/usr/bin:/usr/ucb)
4235 +AC_MSG_RESULT($DEFAULT_EDITOR)
4236 +AC_DEFINE_UNQUOTED(DEFAULT_EDITOR,"$DEFAULT_EDITOR")
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],
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
4257 + if test -d $cf_dir ; then
4258 + DEFAULT_MAILBOX=$cf_dir
4263 +if test -n "$DEFAULT_MAILBOX" ; then
4264 + AC_DEFINE_UNQUOTED(DEFAULT_MAILBOX,"$DEFAULT_MAILBOX")
4266 + DEFAULT_MAILBOX=none
4268 +AC_MSG_RESULT($DEFAULT_MAILBOX)
4270 +dnl ---------------------------------------------------------------------------
4271 +dnl CF_PATH_MAILER version: 6 updated: 2001/05/27 21:36:02
4273 +dnl Look for the program that sends outgoing mail.
4274 +AC_DEFUN([CF_PATH_MAILER],
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)
4283 +if test -z "$DEFAULT_MAILER" ; then
4284 +AC_PATH_PROG(DEFAULT_MAILER,mail,,$PATH:/usr/bin)
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")
4292 + DEFAULT_MAILER=none
4294 +AC_MSG_RESULT($DEFAULT_MAILER)
4296 +dnl ---------------------------------------------------------------------------
4297 +dnl CF_PATH_SYNTAX version: 9 updated: 2002/09/17 23:03:38
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
4309 +.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
4311 +.\[$]{*prefix}*) #(vi
4313 + case ".[$]$1" in #(vi
4315 + $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
4320 + $1=`echo [$]$1 | sed -e s%NONE%$ac_default_prefix%`
4323 + ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
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"
4341 +#include <xcurses.h>
4342 +char *XCursesProgramName = "test";
4343 +],[XCursesExit();],
4344 +[cf_cv_lib_XCurses=yes],
4345 +[cf_cv_lib_XCurses=no])
4347 +if test $cf_cv_lib_XCurses = yes ; then
4349 + AC_DEFINE(XCURSES)
4350 + AC_DEFINE(HAVE_XCURSES)
4352 + AC_ERROR(Cannot link with XCurses)
4355 +dnl ---------------------------------------------------------------------------
4356 +dnl CF_POSIX_JC version: 3 updated: 2001/05/27 21:36:02
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],[
4362 +AC_REQUIRE([AC_TYPE_SIGNAL])
4363 +AC_REQUIRE([CF_SIG_ARGS])
4365 +if test "$ac_cv_func_sigaction" = yes; then
4367 +AC_CACHE_CHECK(whether sigaction needs _POSIX_SOURCE,cf_cv_sigact_bad,[
4369 +#include <sys/types.h>
4370 +#include <signal.h>],[struct sigaction act],
4371 + [cf_cv_sigact_bad=no],[cf_cv_sigact_bad=yes])
4374 +test "$cf_cv_sigact_bad" = yes && AC_DEFINE(SVR4_ACTION)
4376 +AC_CACHE_CHECK(if we have sigaction/related functions,cf_cv_sigaction_funcs,[
4379 +#define _POSIX_SOURCE
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;
4387 + sigemptyset (&sa.sa_mask);
4388 + sigaction (SIGBUS,&sa,&osa);],
4389 + [cf_cv_sigaction_funcs=yes],
4390 + [cf_cv_sigaction_funcs=no])])
4392 +test "$cf_cv_sigaction_funcs" = yes && AC_DEFINE(HAVE_POSIX_JC)
4396 +dnl ---------------------------------------------------------------------------
4397 +dnl CF_PROG_EXT version: 8 updated: 2002/12/21 19:25:52
4399 +dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
4400 +AC_DEFUN([CF_PROG_EXT],
4402 +AC_REQUIRE([CF_CHECK_CACHE])
4404 +case $cf_cv_system_name in
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"`
4418 +test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
4420 +dnl ---------------------------------------------------------------------------
4421 +dnl CF_PROG_SUM_R version: 2 updated: 1997/08/28 23:57:55
4423 +dnl See if sum can take -r
4424 +AC_DEFUN([CF_PROG_SUM_R],
4426 +if test $ac_cv_path_PATH_SUM
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)
4432 + ac_cv_prog_sum_r=yes
4434 + ac_cv_prog_sum_r=no
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")
4441 + AC_DEFINE_UNQUOTED(PATH_SUM_R, "$ac_cv_path_PATH_SUM")
4443 +AC_MSG_RESULT($ac_cv_prog_sum_r)
4446 +dnl ---------------------------------------------------------------------------
4447 +dnl CF_PROG_YACC version: 2 updated: 1997/12/16 11:20:41
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
4452 +AC_DEFUN([CF_PROG_YACC],
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.
4459 +cat >conftest.y <<EOF
4461 +void yyerror(s) char *s; { }
4465 +time : NUMBER ':' NUMBER
4468 +int yylex() { return NUMBER; }
4469 +int main() { return yyparse(); }
4471 + for cf_prog in 'bison -y' byacc yacc
4474 + AC_MSG_CHECKING(for $cf_prog)
4475 + cf_command="$cf_prog conftest.y"
4477 + if AC_TRY_EVAL(cf_command) && test -s y.tab.c ; then
4478 + mv y.tab.c conftest.c
4480 + if test "$cf_prog" = 'bison -y' ; then
4481 + if AC_TRY_EVAL(ac_link) && test -s conftest ; then
4488 + AC_MSG_RESULT($cf_result)
4489 + if test $cf_result = yes ; then
4490 + cf_cv_prog_YACC="$cf_prog"
4496 +YACC="$cf_cv_prog_YACC"
4499 +dnl ---------------------------------------------------------------------------
4500 +dnl CF_PW_GECOS version: 2 updated: 2000/04/13 10:13:00
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],
4506 +AC_CACHE_CHECK([for passwd.pw_gecos], cf_cv_pw_gecos,[
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)
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
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
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)
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
4542 +dnl ---------------------------------------------------------------------------
4543 +dnl CF_SET_GID_UID version: 2 updated: 1997/08/28 23:57:55
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],
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
4554 + cf_cv_setuid_funcs=no
4557 +AC_MSG_RESULT($cf_cv_setuid_funcs)
4558 +test $cf_cv_setuid_funcs = yes && AC_DEFINE(HAVE_SET_GID_UID)
4560 +dnl ---------------------------------------------------------------------------
4561 +dnl CF_SIG_ARGS version: 2 updated: 1997/08/28 23:57:55
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],
4568 +AC_MSG_CHECKING([declaration of signal arguments])
4569 +AC_CACHE_VAL(cf_cv_sig_args,[
4571 +for cf_test in "int sig" "int sig, ..."
4574 +#include <signal.h>],
4575 + [extern RETSIGTYPE catch($cf_test); signal(SIGINT, catch)],
4576 + [cf_cv_sig_args="$cf_test";break])
4579 +AC_MSG_RESULT($cf_cv_sig_args)
4580 +AC_DEFINE_UNQUOTED(SIG_ARGS,$cf_cv_sig_args)
4582 +dnl ---------------------------------------------------------------------------
4583 +dnl CF_SIG_CONST version: 2 updated: 1997/08/28 23:57:55
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],
4590 +AC_REQUIRE([CF_SIG_ARGS])
4591 +AC_MSG_CHECKING([for redefinable signal constants])
4592 +AC_CACHE_VAL(cf_cv_sig_const,[
4594 +if test -n "$cf_cv_sig_args"; then
4595 + cf_test=`echo $cf_cv_sig_args|sed -e s/sig//`
4597 +#define NEW_DFL ((RETSIGTYPE (*)($cf_test))0)
4598 +#define NEW_IGN ((RETSIGTYPE (*)($cf_test))1)
4599 +#define NEW_ERR ((RETSIGTYPE (*)($cf_test))-1)
4601 +#include <signal.h>
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! */
4612 +#define SIG_DFL NEW_DFL
4613 +#define SIG_IGN NEW_IGN
4614 +#define SIG_ERR NEW_ERR
4615 + || NEW_DFL != SIG_DFL)
4617 + signal(SIGINT, SIG_DFL);
4620 + [cf_cv_sig_const=yes],
4621 + [cf_cv_sig_const=no],
4622 + [cf_cv_sig_const=unknown])
4625 +AC_MSG_RESULT($cf_cv_sig_const)
4626 +test "$cf_cv_sig_const" = yes && AC_DEFINE(DECL_SIG_CONST)
4628 +dnl ---------------------------------------------------------------------------
4629 +dnl CF_SIZECHANGE version: 8 updated: 2000/11/04 12:22:16
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],
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"
4640 +for cf_opts in "" "NEED_PTEM_H"
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>
4649 +#ifdef HAVE_TERMIO_H
4650 +#include <termio.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
4657 +#include <sys/stream.h>
4658 +#include <sys/ptem.h>
4660 +#if !defined(sun) || !defined(HAVE_TERMIOS_H)
4661 +#include <sys/ioctl.h>
4665 + struct ttysize win; /* FIXME: what system is this? */
4666 + int y = win.ts_lines;
4667 + int x = win.ts_cols;
4670 + struct winsize win;
4671 + int y = win.ws_row;
4672 + int x = win.ws_col;
4674 + no TIOCGSIZE or TIOCGWINSZ
4675 +#endif /* TIOCGWINSZ */
4676 +#endif /* TIOCGSIZE */
4678 + [cf_cv_sizechange=yes],
4679 + [cf_cv_sizechange=no])
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"
4689 +if test "$cf_cv_sizechange" != no ; then
4690 + AC_DEFINE(HAVE_SIZECHANGE)
4691 + case $cf_cv_sizechange in #(vi
4693 + AC_DEFINE_UNQUOTED($cf_cv_sizechange )
4698 +dnl ---------------------------------------------------------------------------
4699 +dnl CF_SOCKS version: 3 updated: 2001/01/01 09:54:40
4701 +dnl Check for socks library
4702 +dnl $1 = the [optional] directory in which the library may be found
4703 +AC_DEFUN([CF_SOCKS],[
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"
4714 + test -d $1/../include && CPPFLAGS="$CPPFLAGS -I$1/../include"
4717 + AC_MSG_WARN(expected a directory: $1)
4721 +LIBS="$LIBS -lsocks"
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)
4732 +#include <stdio.h>],[
4733 + accept((char *)0)],,
4734 + [AC_ERROR(Cannot link with socks library)])
4736 +dnl ---------------------------------------------------------------------------
4737 +dnl CF_SOCKS5 version: 7 updated: 2001/01/01 09:54:40
4739 +dnl Check for socks5 configuration
4740 +dnl $1 = the [optional] directory in which the library may be found
4741 +AC_DEFUN([CF_SOCKS5],[
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"
4752 + test -d $1/../include && CPPFLAGS="$CPPFLAGS -I$1/../include"
4755 + AC_MSG_WARN(expected a directory: $1)
4759 +LIBS="$LIBS -lsocks5"
4760 +AC_DEFINE(USE_SOCKS5)
4762 +AC_MSG_CHECKING(if the socks library uses socks4 prefix)
4763 +cf_use_socks4=error
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)
4784 + AC_DEFINE(accept,SOCKSaccept)
4785 + AC_DEFINE(getpeername,SOCKSgetpeername)
4786 + AC_DEFINE(getsockname,SOCKSgetsockname)
4787 + AC_DEFINE(recvfrom,SOCKSrecvfrom)
4789 +AC_MSG_CHECKING(if socks5p.h is available)
4791 +#define INCLUDE_PROTOTYPES
4792 +#include <socks.h>],[
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)
4799 +dnl ---------------------------------------------------------------------------
4800 +dnl CF_STRERROR version: 2 updated: 2001/07/11 09:34:49
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])
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( \
4818 +if test "$ISC" = yes ; then
4819 + AC_CHECK_HEADERS( sys/termio.h )
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 ;;
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],
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))
4839 + AC_MSG_RESULT($termios_bad)
4843 +dnl ---------------------------------------------------------------------------
4844 +dnl CF_SUBDIR_PATH version: 3 updated: 2002/12/29 18:30:46
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],
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"
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"
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"
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"
4888 +test "$prefix" != /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"
4898 +test "$prefix" != /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"
4907 +dnl ---------------------------------------------------------------------------
4908 +dnl CF_SYS_ERRLIST version: 6 updated: 2001/12/30 13:03:23
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],
4915 + CF_CHECK_ERRNO(sys_nerr)
4916 + CF_CHECK_ERRNO(sys_errlist)
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],
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
4933 +#define timeval fake_timeval
4935 +#include <sys/types.h>
4936 +#ifdef TIME_WITH_SYS_TIME
4937 +# include <sys/time.h>
4940 +# ifdef HAVE_SYS_TIME_H
4941 +# include <sys/time.h>
4947 +#ifdef HAVE_SYS_SELECT_H
4948 +# include <sys/select.h>
4950 +],[struct timeval foo],
4951 + [cf_cv_sys_select_timeval=$cf_opts
4953 + [cf_cv_sys_select_timeval=no])
4956 +AC_MSG_RESULT($cf_cv_sys_select_timeval)
4957 +test $cf_cv_sys_select_timeval = yes && AC_DEFINE(NEED_TIMEVAL_FIX)
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],
4965 +AC_CACHE_VAL(cf_cv_termlib,[
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)
4976 + CF_NCURSES_CPPFLAGS($1)
4977 + CF_NCURSES_LIBS($1)
4978 + cf_cv_termlib=terminfo
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
4988 + LIBS="-l$cf_lib $cf_save_LIBS"
4989 + for cf_func in tigetstr tgetstr
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
4998 + cf_cv_termlib=termcap
5003 + test "$cf_result" = yes && break
5005 + test "$cf_result" = no && LIBS="$cf_save_LIBS"
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])
5013 +if test "$cf_cv_termlib" = none; then
5014 + AC_MSG_WARN([Cannot find -ltermlib, -lcurses, or -ltermcap])
5017 +dnl ---------------------------------------------------------------------------
5018 +dnl CF_TERMIOS version: 2 updated: 1997/08/28 23:57:55
5020 +dnl See if we can link with the termios functions tcsetattr/tcgetattr
5021 +AC_DEFUN([CF_TERMIOS],
5023 +AC_MSG_CHECKING([for nonconflicting termios.h])
5024 +AC_CACHE_VAL(cf_cv_use_termios_h,[
5026 +#ifdef HAVE_IOCTL_H
5027 +# include <ioctl.h>
5029 +# ifdef HAVE_SYS_IOCTL_H
5030 +# include <sys/ioctl.h>
5034 +#if !defined(sun) || !defined(NL0)
5035 +#include <termios.h>
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])
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)
5051 +dnl ---------------------------------------------------------------------------
5052 +dnl CF_TIOCGWINSZ version: 3 updated: 1997/11/29 01:04:53
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
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.
5062 +dnl CHECK_DECL_FLAG and CHECK_DECL_HDRS must be set in configure.in
5063 +AC_DEFUN([CF_TIOCGWINSZ],
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"
5074 + for (fd = 0; fd <= 2; fd++) { /* try in/out/err in case redirected */
5076 + struct ttysize size;
5077 + if (ioctl (0, TIOCGSIZE, &size) == 0
5078 + && size.ts_lines > 0
5079 + && size.ts_cols > 0)
5082 + struct winsize size;
5083 + if (ioctl(0, TIOCGWINSZ, &size) == 0
5084 + && size.ws_row > 0
5085 + && size.ws_col > 0)
5089 + exit(0); /* we cannot guarantee this is run interactively */
5091 + [cf_cv_use_tiocgwinsz=yes],
5092 + [cf_cv_use_tiocgwinsz=no],
5093 + [cf_cv_use_tiocgwinsz=unknown])
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)
5099 +dnl ---------------------------------------------------------------------------
5100 +dnl CF_TM_GMTOFF version: 2 updated: 1997/08/28 23:57:55
5102 +dnl Check if the tm-struct defines the '.tm_gmtoff' member (useful in decoding
5104 +AC_DEFUN([CF_TM_GMTOFF],
5106 +AC_MSG_CHECKING([for tm.tm_gmtoff])
5107 +AC_CACHE_VAL(cf_cv_tm_gmtoff,[
5109 +#ifdef TIME_WITH_SYS_TIME
5110 +# include <sys/time.h>
5113 +# ifdef HAVE_SYS_TIME_H
5114 +# include <sys/time.h>
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)
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().
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):
5135 +dnl #ifdef NEED_CURSES_H
5136 +dnl # ifdef HAVE_NCURSES_NCURSES_H
5137 +dnl # include <ncurses/ncurses.h>
5139 +dnl # ifdef HAVE_NCURSES_H
5140 +dnl # include <ncurses.h>
5142 +dnl # include <curses.h>
5147 +dnl #ifdef HAVE_NCURSES_TERM_H
5148 +dnl # include <ncurses/term.h>
5150 +dnl # ifdef HAVE_TERM_H
5151 +dnl # include <term.h>
5155 +dnl #if NEED_TERMCAP_H
5156 +dnl # include <termcap.h>
5159 +AC_DEFUN([CF_TYPE_OUTCHAR],
5161 +AC_REQUIRE([CF_CURSES_TERMCAP])
5163 +AC_CACHE_CHECK(declaration of tputs 3rd param, cf_cv_type_outchar,[
5165 +cf_cv_type_outchar="int OutChar(int)"
5167 +cf_save_CPPFLAGS="$CPPFLAGS"
5168 +CPPFLAGS="$CPPFLAGS $CHECK_DECL_FLAG"
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)"
5183 + test $cf_cv_found = yes && break
5185 + test $cf_cv_found = yes && break
5187 + test $cf_cv_found = yes && break
5191 +case $cf_cv_type_outchar in
5193 + AC_DEFINE(OUTC_RETURN)
5196 +case $cf_cv_type_outchar in
5198 + AC_DEFINE(OUTC_ARGS,char c)
5202 +CPPFLAGS="$cf_save_CPPFLAGS"
5204 +dnl ---------------------------------------------------------------------------
5205 +dnl CF_TYPE_SIGACTION version: 3 updated: 2000/08/12 23:18:52
5206 +dnl -----------------
5208 +AC_DEFUN([CF_TYPE_SIGACTION],
5210 +AC_MSG_CHECKING([for type sigaction_t])
5211 +AC_CACHE_VAL(cf_cv_type_sigaction,[
5213 +#include <signal.h>],
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)
5220 +dnl ---------------------------------------------------------------------------
5221 +dnl CF_UNION_WAIT version: 5 updated: 1997/11/23 14:49:44
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.
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.
5233 +dnl Sets: $cf_cv_type_unionwait
5234 +dnl Defines: HAVE_TYPE_UNIONWAIT
5235 +AC_DEFUN([CF_UNION_WAIT],
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,
5242 + int y = WEXITSTATUS(x);
5243 + int z = WTERMSIG(x);
5246 + [cf_cv_type_unionwait=no
5247 + echo compiles ok w/o union wait 1>&AC_FD_CC
5249 + AC_TRY_LINK($cf_wait_headers,
5252 + int y = WEXITSTATUS(x);
5255 + int z = WTERMSIG(x);
5259 + [cf_cv_type_unionwait=yes
5260 + echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC
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)
5266 +dnl ---------------------------------------------------------------------------
5267 +dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
5269 +dnl Make an uppercase version of a variable
5270 +dnl $1=uppercase($2)
5271 +AC_DEFUN([CF_UPPER],
5273 +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5275 +dnl ---------------------------------------------------------------------------
5276 +dnl CF_VERBOSE version: 2 updated: 1997/09/05 10:45:14
5278 +dnl Use AC_VERBOSE w/o the warnings
5279 +AC_DEFUN([CF_VERBOSE],
5280 +[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
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
5289 +AC_DEFUN([CF_WAIT_HEADERS],
5291 +AC_HAVE_HEADERS(sys/wait.h)
5292 +cf_wait_headers="#include <sys/types.h>
5294 +if test $ac_cv_header_sys_wait_h = yes; then
5295 +cf_wait_headers="$cf_wait_headers
5296 +#include <sys/wait.h>
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
5306 +if test $ac_cv_header_waitstatus_h = yes; then
5307 +cf_wait_headers="$cf_wait_headers
5308 +#include <waitstatus.h>
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
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])
5325 +dnl ---------------------------------------------------------------------------
5326 +dnl CF_WITH_DFTENV version: 3 updated: 1998/04/01 11:39:13
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
5339 + AC_ERROR(expected a value for --with-$1)
5343 +AC_DEFINE_UNQUOTED($3,"[$]$3")dnl
5345 +dnl ---------------------------------------------------------------------------
5346 +dnl CF_WITH_PATH version: 6 updated: 1998/10/11 00:40:17
5348 +dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
5349 +dnl defaulting to yes/no.
5351 +dnl $1 = option name
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
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)
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.
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],
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
5380 + AC_ERROR(expected a value for --with-$1)
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)
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
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
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
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],
5422 +AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[
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],
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"
5437 +dnl ---------------------------------------------------------------------------
5438 +dnl CF_X_ATHENA version: 11 updated: 2002/12/26 20:56:10
5440 +dnl Check for Xaw (Athena) libraries
5442 +AC_DEFUN([CF_X_ATHENA],
5443 +[AC_REQUIRE([CF_X_TOOLKIT])
5444 +cf_x_athena=${cf_x_athena-Xaw}
5447 + [ --with-Xaw3d link with Xaw 3d library],
5448 + [cf_x_athena=Xaw3d])
5450 +AC_ARG_WITH(neXtaw,
5451 + [ --with-neXtaw link with neXT Athena library],
5452 + [cf_x_athena=neXtaw])
5454 +AC_ARG_WITH(XawPlus,
5455 + [ --with-XawPlus link with Athena-Plus library],
5456 + [cf_x_athena=XawPlus])
5458 +AC_CHECK_LIB(Xext,XextCreateExtension,
5459 + [LIBS="-lXext $LIBS"])
5463 +CF_X_ATHENA_CPPFLAGS($cf_x_athena)
5464 +CF_X_ATHENA_LIBS($cf_x_athena)
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],
5473 +cf_x_athena_root=ifelse($1,,Xaw,$1)
5474 +cf_x_athena_include=""
5476 +for cf_path in default \
5477 + /usr/contrib/X11R6 \
5478 + /usr/contrib/X11R5 \
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)
5489 + AC_MSG_CHECKING(for $cf_test)
5492 +#include <X11/Intrinsic.h>
5493 +#include <$cf_test>],[],
5496 + AC_MSG_RESULT($cf_result)
5497 + if test "$cf_result" = yes ; then
5498 + cf_x_athena_include=$cf_path
5501 + CPPFLAGS="$cf_save"
5506 +if test -z "$cf_x_athena_include" ; then
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"
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)
5523 +for cf_path in default \
5524 + /usr/contrib/X11R6 \
5525 + /usr/contrib/X11R5 \
5530 + "-l$cf_x_athena_root -lXmu" \
5531 + "-l$cf_x_athena_root -lXpm -lXmu" \
5532 + "-l${cf_x_athena_root}_s -lXmu_s"
5534 + if test -z "$cf_x_athena_lib" ; then
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)
5541 + LIBS="$cf_lib $LIBS"
5542 + AC_MSG_CHECKING(for $cf_test in $cf_lib)
5545 + LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
5546 + AC_TRY_LINK([],[$cf_test()],
5549 + AC_MSG_RESULT($cf_result)
5550 + if test "$cf_result" = yes ; then
5551 + cf_x_athena_lib="$cf_lib"
5561 +if test -z "$cf_x_athena_lib" ; then
5563 +[Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
5566 +CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
5567 +AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
5569 +dnl ---------------------------------------------------------------------------
5570 +dnl CF_X_TOOLKIT version: 9 updated: 2001/12/30 19:09:58
5572 +dnl Check for X Toolkit libraries
5574 +AC_DEFUN([CF_X_TOOLKIT],
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 ' ' -`
5583 +case $SYSTEM_NAME in
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"
5602 + AC_CHECK_LIB(socket,socket)
5603 + AC_CHECK_LIB(nsl,gethostname)
5607 +if test $cf_have_X_LIBS = no ; then
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)
5617 + LIBS="-lXt $X_PRE_LIBS $LIBS"],,
5618 + [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
5620 + LDFLAGS="$LDFLAGS $X_LIBS"
5621 + CF_CHECK_CFLAGS($X_CFLAGS)
5624 +if test $cf_have_X_LIBS = no ; then
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