Merge in texinfo-3.11.

From-SVN: r18767
This commit is contained in:
Jeff Law 1998-03-22 14:47:59 -07:00
parent 8491377bd1
commit f8b2ac1ece
9 changed files with 7328 additions and 3584 deletions

File diff suppressed because it is too large Load Diff

515
texinfo/aclocal.m4 vendored
View File

@ -1,17 +1,490 @@
dnl aclocal.m4 generated automatically by aclocal 1.2
# Check to see if we're running under Cygwin32, without using
# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
# Otherwise set it to "no".
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
dnl AM_CYGWIN32()
AC_DEFUN(AM_CYGWIN32,
[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
[AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }],
am_cv_cygwin32=yes, am_cv_cygwin32=no)
rm -f conftest*])
CYGWIN32=
test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
# serial 2
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS)
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_TRY_LINK([], [return (int) gettext ("")],
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)])])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS)
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
INTLDEPS="../intl/libintl.a"
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS="../intl/libintl.a"
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext programs is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h values.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
__argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY)
fi
AM_LC_MESSAGES
AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test $ac_aux_dir; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z $MKINSTALLDIRS; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl *** For now the libtool support in intl/Makefile is not for real.
l=
AC_SUBST(l)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
# serial 1
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES)
fi
fi])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AM_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
AM_SANITY_CHECK
AC_ARG_PROGRAM
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_PROG_MAKE_SET])
# serial 1
AC_DEFUN(AM_PROG_INSTALL,
[AC_REQUIRE([AC_PROG_INSTALL])
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
AC_SUBST(INSTALL_SCRIPT)dnl
])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "$@" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
# serial 1
AC_DEFUN(AM_MAINTAINER_MODE,
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT($USE_MAINTAINER_MODE)
if test $USE_MAINTAINER_MODE = yes; then
MAINT=
else
MAINT='#M#'
fi
AC_SUBST(MAINT)dnl
]
)
# Check to see if we're running under Win32, without using
# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
@ -22,9 +495,9 @@ dnl This knows we add .exe if we're building in the Cygwin32
dnl environment. But if we're not, then it compiles a test program
dnl to see if there is a suffix for executables.
AC_DEFUN(AM_EXEEXT,
dnl AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AM_CYGWIN32])
[AC_REQUIRE([AM_CYGWIN32])
AC_MSG_CHECKING([for executable suffix])
[AC_CACHE_VAL(am_cv_exeext,
AC_CACHE_VAL(am_cv_exeext,
[if test "$CYGWIN32" = yes; then
am_cv_exeext=.exe
else
@ -34,7 +507,7 @@ int main() {
}
EOF
${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
am_cv_exeext=`ls am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
rm -f am_c_test*])
test x"${am_cv_exeext}" = x && am_cv_exeext=no
fi
@ -106,3 +579,17 @@ AC_SUBST(INSTALL_PROGRAM)dnl
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
AC_SUBST(INSTALL_DATA)dnl
])
# Check to see if we're running under Cygwin32, without using
# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
# Otherwise set it to "no".
dnl AM_CYGWIN32()
AC_DEFUN(AM_CYGWIN32,
[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
[AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }],
am_cv_cygwin32=yes, am_cv_cygwin32=no)
rm -f conftest*])
CYGWIN32=
test "$am_cv_cygwin32" = yes && CYGWIN32=yes])

2720
texinfo/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,39 @@
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in,v 1.2 1997/09/16 05:01:43 law Exp $
AC_PREREQ(2.5)
AC_INIT(texinfo.texi)
dnl $Id: configure.in,v 1.5 1998/03/24 18:05:13 law Exp $
dnl
AC_INIT(makeinfo/makeinfo.c)
AC_PREREQ(2.12)dnl Minimum Autoconf version required.
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([texinfo], [3.11])
dnl Checks for programs.
dnl AC_PROG_GCC_TRADITIONAL
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
EGCS_PROG_INSTALL
AC_PROG_RANLIB
# We do this for the sake of a more helpful warning in doc/Makefile.
TEXMF='$(datadir)/texmf'
AC_CHECK_PROG(TEXCONFIG, texconfig, true, false)
$TEXCONFIG && eval `texconfig confall | grep '^TEXMF='`
AC_SUBST(TEXMF)
AC_ISC_POSIX
AC_MINIX
AM_CYGWIN32
dnl CYGNUS LOCAL: Add AM_MAINTAINER_MODE and AM_EXEEXT
AM_MAINTAINER_MODE
AM_EXEEXT
dnl Checks for libraries.
# Needed on sysV68 for sigblock, sigsetmask.
AC_CHECK_LIB(bsd, sigblock)
# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
# rather ncurses. So we check for it.
TERMLIBS=
for termlib in curses ncurses termcap terminfo termlib ; do
for termlib in ncurses curses termcap terminfo termlib ; do
AC_CHECK_LIB(${termlib}, tputs,
[TERMLIBS="${TERMLIBS} -l${termlib}"; break])
done
@ -27,22 +41,45 @@ AC_SUBST(TERMLIBS)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h termios.h termio.h strings.h string.h varargs.h \
sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/file.h)
AC_CHECK_HEADERS(fcntl.h pwd.h string.h strings.h termcap.h termio.h \
termios.h unistd.h \
sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h)
dnl Do not use <ncurses/termcap.h> unless we're linking with ncurses.
if test "x$termlib" = xncurses; then
AC_CHECK_HEADER(ncurses/termcap.h)
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_SIGNAL
AC_C_CONST
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
if test "$ac_cv_c_cross" = no; then
AC_FUNC_SETVBUF_REVERSED
fi
AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr strcasecmp \
vfprintf vsprintf strerror sigprocmask sigsetmask)
sigprocmask sigsetmask)
dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added.
AC_REPLACE_FUNCS(memcpy memmove strdup)
AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
AC_OUTPUT(Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile emacs/Makefile)
dnl Set of available languages and i18n macros.
ALL_LINGUAS="de fr"
AM_GNU_GETTEXT
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT([Makefile \
doc/Makefile \
emacs/Makefile \
info/Makefile \
intl/Makefile \
lib/Makefile \
makeinfo/Makefile \
po/Makefile.in \
util/Makefile \
],
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile])

View File

@ -1,9 +1,7 @@
/* man.c: How to read and format man files. */
/* man.c: How to read and format man files.
$Id: man.c,v 1.4 1998/03/22 21:47:54 law Exp $
/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -23,7 +21,6 @@
#include "info.h"
#include <sys/ioctl.h>
#include <sys/file.h>
#include "signals.h"
#if defined (HAVE_SYS_TIME_H)
#include <sys/time.h>
@ -31,8 +28,8 @@
#if defined (HAVE_SYS_WAIT_H)
#include <sys/wait.h>
#endif
#include "tilde.h"
#include "tilde.h"
#include "man.h"
#if !defined (SIGCHLD) && defined (SIGCLD)
@ -81,31 +78,31 @@ get_manpage_node (file_buffer, pagename)
page = get_manpage_contents (pagename);
if (page)
{
char header[1024];
long oldsize, newsize;
int hlen, plen;
{
char header[1024];
long oldsize, newsize;
int hlen, plen;
sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n",
INFO_COOKIE,
INFO_FILE_LABEL, file_buffer->filename,
INFO_NODE_LABEL, pagename,
INFO_UP_LABEL);
oldsize = file_buffer->filesize;
hlen = strlen (header);
plen = strlen (page);
newsize = (oldsize + hlen + plen);
file_buffer->contents =
(char *)xrealloc (file_buffer->contents, 1 + newsize);
memcpy (file_buffer->contents + oldsize, header, hlen);
oldsize += hlen;
memcpy (file_buffer->contents + oldsize, page, plen);
file_buffer->contents[newsize] = '\0';
file_buffer->filesize = newsize;
file_buffer->finfo.st_size = newsize;
build_tags_and_nodes (file_buffer);
free (page);
}
sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n",
INFO_COOKIE,
INFO_FILE_LABEL, file_buffer->filename,
INFO_NODE_LABEL, pagename,
INFO_UP_LABEL);
oldsize = file_buffer->filesize;
hlen = strlen (header);
plen = strlen (page);
newsize = (oldsize + hlen + plen);
file_buffer->contents =
(char *)xrealloc (file_buffer->contents, 1 + newsize);
memcpy (file_buffer->contents + oldsize, header, hlen);
oldsize += hlen;
memcpy (file_buffer->contents + oldsize, page, plen);
file_buffer->contents[newsize] = '\0';
file_buffer->filesize = newsize;
file_buffer->finfo.st_size = newsize;
build_tags_and_nodes (file_buffer);
free (page);
}
node = manpage_node_of_file_buffer (file_buffer, pagename);
}
@ -116,12 +113,9 @@ get_manpage_node (file_buffer, pagename)
FILE_BUFFER *
create_manpage_file_buffer ()
{
FILE_BUFFER *file_buffer;
struct stat *finfo;
file_buffer = make_file_buffer ();
file_buffer->filename = strdup (MANPAGE_FILE_BUFFER_NAME);
file_buffer->fullpath = strdup (MANPAGE_FILE_BUFFER_NAME);
FILE_BUFFER *file_buffer = make_file_buffer ();
file_buffer->filename = xstrdup (MANPAGE_FILE_BUFFER_NAME);
file_buffer->fullpath = xstrdup (MANPAGE_FILE_BUFFER_NAME);
file_buffer->finfo.st_size = 0;
file_buffer->filesize = 0;
file_buffer->contents = (char *)NULL;
@ -143,25 +137,24 @@ executable_file_in_path (filename, path)
dirname_index = 0;
while (temp_dirname = extract_colon_unit (path, &dirname_index))
while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
{
register int i;
char *temp;
/* Expand a leading tilde if one is present. */
if (*temp_dirname == '~')
{
char *expanded_dirname;
{
char *expanded_dirname;
expanded_dirname = tilde_expand_word (temp_dirname);
free (temp_dirname);
temp_dirname = expanded_dirname;
}
expanded_dirname = tilde_expand_word (temp_dirname);
free (temp_dirname);
temp_dirname = expanded_dirname;
}
temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
strcpy (temp, temp_dirname);
if (temp[(strlen (temp)) - 1] != '/')
strcat (temp, "/");
strcat (temp, "/");
strcat (temp, filename);
free (temp_dirname);
@ -170,10 +163,10 @@ executable_file_in_path (filename, path)
/* If we have found a regular executable file, then use it. */
if ((statable) && (S_ISREG (finfo.st_mode)) &&
(access (temp, X_OK) == 0))
return (temp);
(access (temp, X_OK) == 0))
return (temp);
else
free (temp);
free (temp);
}
return ((char *)NULL);
}
@ -227,7 +220,7 @@ static void
reap_children (sig)
int sig;
{
unsigned int status;
int status;
wait (&status);
}
@ -239,7 +232,6 @@ get_manpage_contents (pagename)
int pipes[2];
pid_t child;
char *formatted_page = (char *)NULL;
char *section = (char *)NULL;
int arg_index = 1;
if (formatter_args[0] == (char *)NULL)
@ -271,7 +263,7 @@ get_manpage_contents (pagename)
if (child != 0)
{
/* In the parent, close the writing end of the pipe, and read from
the exec'd child. */
the exec'd child. */
close (pipes[1]);
formatted_page = read_from_fd (pipes[0]);
close (pipes[0]);
@ -279,16 +271,16 @@ get_manpage_contents (pagename)
else
{
/* In the child, close the read end of the pipe, make the write end
of the pipe be stdout, and execute the man page formatter. */
of the pipe be stdout, and execute the man page formatter. */
close (pipes[0]);
close (fileno (stderr));
close (fileno (stdin)); /* Don't print errors. */
close (fileno (stdin)); /* Don't print errors. */
dup2 (pipes[1], fileno (stdout));
execv (formatter_args[0], formatter_args);
/* If we get here, we couldn't exec, so close out the pipe and
exit. */
exit. */
close (pipes[1]);
exit (0);
}
@ -310,21 +302,21 @@ clean_manpage (manpage)
newpage = (char *)xmalloc (1 + strlen (manpage));
for (i = 0, j = 0; newpage[j] = manpage[i]; i++, j++)
for (i = 0, j = 0; (newpage[j] = manpage[i]); i++, j++)
{
if (manpage[i] == '\n')
newline_count++;
newline_count++;
else
newline_count = 0;
newline_count = 0;
if (newline_count == 3)
{
j--;
newline_count--;
}
{
j--;
newline_count--;
}
if (manpage[i] == '\b' || manpage[i] == '\f')
j -= 2;
j -= 2;
}
newpage[j++] = '\0';
@ -345,11 +337,11 @@ manpage_node_of_file_buffer (file_buffer, pagename)
{
register int i;
for (i = 0; tag = file_buffer->tags[i]; i++)
{
if (strcasecmp (pagename, tag->nodename) == 0)
break;
}
for (i = 0; (tag = file_buffer->tags[i]); i++)
{
if (strcasecmp (pagename, tag->nodename) == 0)
break;
}
}
if (tag)
@ -465,7 +457,7 @@ find_reference_section (node)
{
position = search_forward (reference_section_starters[i], &frs_binding);
if (position != -1)
break;
break;
}
if (position == -1)
@ -479,11 +471,11 @@ find_reference_section (node)
for (i = frs_binding.start; i < frs_binding.end - 2; i++)
{
if ((frs_binding.buffer[i] == '\n') &&
(!whitespace (frs_binding.buffer[i + 1])))
{
frs_binding.end = i;
break;
}
(!whitespace (frs_binding.buffer[i + 1])))
{
frs_binding.end = i;
break;
}
}
return (&frs_binding);
@ -514,43 +506,43 @@ xrefs_of_manpage (node)
register int start, end;
for (start = position; start > reference_section->start; start--)
if (whitespace (reference_section->buffer[start]))
break;
if (whitespace (reference_section->buffer[start]))
break;
start++;
for (end = position; end < reference_section->end; end++)
{
if (whitespace (reference_section->buffer[end]))
{
end = start;
break;
}
{
if (whitespace (reference_section->buffer[end]))
{
end = start;
break;
}
if (reference_section->buffer[end] == ')')
{
end++;
break;
}
}
if (reference_section->buffer[end] == ')')
{
end++;
break;
}
}
if (end != start)
{
REFERENCE *entry;
int len = end - start;
{
REFERENCE *entry;
int len = end - start;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->label = (char *)xmalloc (1 + len);
strncpy (entry->label, (reference_section->buffer) + start, len);
entry->label[len] = '\0';
entry->filename = strdup (node->filename);
entry->nodename = strdup (entry->label);
entry->start = start;
entry->end = end;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->label = (char *)xmalloc (1 + len);
strncpy (entry->label, (reference_section->buffer) + start, len);
entry->label[len] = '\0';
entry->filename = xstrdup (node->filename);
entry->nodename = xstrdup (entry->label);
entry->start = start;
entry->end = end;
add_pointer_to_array
(entry, refs_index, refs, refs_slots, 10, REFERENCE *);
}
add_pointer_to_array
(entry, refs_index, refs, refs_slots, 10, REFERENCE *);
}
reference_section->start = position + 1;
}
@ -564,7 +556,6 @@ locate_manpage_xref (node, start, dir)
long start;
int dir;
{
register int i, count;
REFERENCE **refs;
long position = -1;
@ -579,27 +570,27 @@ locate_manpage_xref (node, start, dir)
count = i;
if (dir > 0)
{
for (i = 0; entry = refs[i]; i++)
if (entry->start > start)
{
position = entry->start;
break;
}
}
{
for (i = 0; (entry = refs[i]); i++)
if (entry->start > start)
{
position = entry->start;
break;
}
}
else
{
for (i = count - 1; i > -1; i--)
{
entry = refs[i];
{
for (i = count - 1; i > -1; i--)
{
entry = refs[i];
if (entry->start < start)
{
position = entry->start;
break;
}
}
}
if (entry->start < start)
{
position = entry->start;
break;
}
}
}
info_free_references (refs);
}
@ -628,20 +619,20 @@ manpage_xrefs_in_binding (node, binding)
start = binding->start + (binding->buffer - node->contents);
end = binding->end + (binding->buffer - node->contents);
for (i = 0; entry = all_refs[i]; i++)
for (i = 0; (entry = all_refs[i]); i++)
{
if ((entry->start > start) && (entry->end < end))
{
add_pointer_to_array
(entry, brefs_index, brefs, brefs_slots, 10, REFERENCE *);
}
{
add_pointer_to_array
(entry, brefs_index, brefs, brefs_slots, 10, REFERENCE *);
}
else
{
maybe_free (entry->label);
maybe_free (entry->filename);
maybe_free (entry->nodename);
free (entry);
}
{
maybe_free (entry->label);
maybe_free (entry->filename);
maybe_free (entry->nodename);
free (entry);
}
}
free (all_refs);

View File

@ -1,10 +1,10 @@
/* termdep.h -- System things that terminal.c depends on.
$Id: termdep.h,v 1.2 1997/10/30 05:55:14 law Exp $
$Id: termdep.h,v 1.4 1998/03/24 18:06:50 law Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
Copyright (C) 1993, 96 Free Software Foundation, Inc.
Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -22,33 +22,21 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_TERMDEP_H_)
# define _TERMDEP_H_
#ifndef INFO_TERMDEP_H
#define INFO_TERMDEP_H
#if defined (HAVE_SYS_FCNTL_H)
# include <sys/fcntl.h>
#else
# include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#if defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#if defined (HAVE_STRINGS_H)
# include <strings.h>
#else
# if defined (HAVE_STRING_H)
# include <string.h>
# endif
/* NeXT supplies <termios.h> but it is broken. Probably Autoconf should
have a separate test, but anyway ... */
#ifdef NeXT
#undef HAVE_TERMIOS_H
#endif
#if defined (HAVE_TERMIOS_H)
#ifdef HAVE_TERMIOS_H
# include <termios.h>
/*
* POSIX does not mandate that we have these and it may, in fact, be only
* partially implemented
*/
/*
POSIX does not mandate that we have these and it may, in fact, be only
partially implemented.
*/
# undef TIOCGETC
#else
# if defined (HAVE_TERMIO_H)
@ -67,15 +55,8 @@
# endif /* !HAVE_TERMIO_H */
#endif /* !HAVE_TERMIOS_H */
#if defined (HAVE_SYS_TTOLD_H)
#ifdef HAVE_SYS_TTOLD_H
# include <sys/ttold.h>
#endif /* HAVE_SYS_TTOLD_H */
#if !defined (HAVE_STRCHR)
# undef strchr
# undef strrchr
# define strchr index
# define strrchr rindex
#endif /* !HAVE_STRCHR */
#endif /* _TERMDEP_H_ */
#endif /* not INFO_TERMDEP_H */

View File

@ -1,12 +1,8 @@
/* terminal.c -- How to handle the physical terminal for Info. */
/* terminal.c -- How to handle the physical terminal for Info.
$Id: terminal.c,v 1.4 1998/03/24 18:06:53 law Exp $
/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
This file has appeared in prior works by the Free Software Foundation;
thus it carries copyright dates from 1988 through 1993.
Copyright (C) 1988, 89, 90, 91, 92, 93, 96 Free Software Foundation, Inc.
Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -24,19 +20,33 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h>
#include <sys/types.h>
#include "info.h"
#include "terminal.h"
#include "termdep.h"
extern void *xmalloc (), *xrealloc ();
#include <sys/types.h>
#include <signal.h>
/* The Unix termcap interface code. */
#ifdef HAVE_NCURSES_TERMCAP_H
#include <ncurses/termcap.h>
#else
#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#else
/* On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC.
Unfortunately, PC is a global variable used by the termcap library. */
#undef PC
/* Termcap requires these variables, whether we access them or not. */
char *BC, *UP;
char PC; /* Pad character */
short ospeed; /* Terminal output baud rate */
extern int tgetnum (), tgetflag (), tgetent ();
extern char *tgetstr (), *tgoto ();
extern char *getenv ();
extern void tputs ();
#endif /* not HAVE_TERMCAP_H */
#endif /* not HAVE_NCURSES_TERMCAP_H */
/* Function "hooks". If you make one of these point to a function, that
function is called when appropriate instead of its namesake. Your
@ -60,20 +70,11 @@ VFunction *terminal_write_chars_hook = (VFunction *)NULL;
VFunction *terminal_scroll_terminal_hook = (VFunction *)NULL;
/* **************************************************************** */
/* */
/* Terminal and Termcap */
/* */
/* */
/* Terminal and Termcap */
/* */
/* **************************************************************** */
/* On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC.
Unfortunately, PC is a global variable used by the termcap library. */
#undef PC
/* TERMCAP requires these variables, whether we access them or not. */
char PC;
char *BC, *UP;
short ospeed;
/* A buffer which holds onto the current terminal description, and a pointer
used to float within it. */
static char *term_buffer = (char *)NULL;
@ -84,6 +85,8 @@ static char *term_goto, *term_clreol, *term_cr, *term_clrpag;
static char *term_begin_use, *term_end_use;
static char *term_AL, *term_DL, *term_al, *term_dl;
static char *term_keypad_on, *term_keypad_off;
/* How to go up a line. */
static char *term_up;
@ -108,11 +111,15 @@ static char *term_invbeg;
/* The string to turn off inverse mode, if this term has one. */
static char *term_invend;
static void
/* Although I can't find any documentation that says this is supposed to
return its argument, all the code I've looked at (termutils, less)
does so, so fine. */
static int
output_character_function (c)
int c;
{
putc (c, stdout);
return c;
}
/* Macro to send STRING to the terminal. */
@ -122,25 +129,53 @@ output_character_function (c)
tputs (string, 1, output_character_function); \
} while (0)
/* Tell the terminal that we will be doing cursor addressable motion. */
/* Tell the terminal that we will be doing cursor addressable motion. */
static void
terminal_begin_using_terminal ()
{
RETSIGTYPE (*sigsave) ();
if (term_keypad_on)
send_to_terminal (term_keypad_on);
if (!term_begin_use || !*term_begin_use)
return;
sigsave = signal (SIGWINCH, SIG_IGN);
send_to_terminal (term_begin_use);
/* Without this fflush and sleep, running info in a shelltool or
cmdtool (TERM=sun-cmd) with scrollbars loses -- the scrollbars are
not restored properly.
From: strube@physik3.gwdg.de (Hans Werner Strube). */
fflush (stdout);
sleep (1);
signal (SIGWINCH, sigsave);
}
/* Tell the terminal that we will not be doing any more cursor addressable
motion. */
/* Tell the terminal that we will not be doing any more cursor
addressable motion. */
static void
terminal_end_using_terminal ()
{
RETSIGTYPE (*sigsave) ();
if (term_keypad_off)
send_to_terminal (term_keypad_off);
if (!term_end_use || !*term_end_use)
return;
sigsave = signal (SIGWINCH, SIG_IGN);
send_to_terminal (term_end_use);
fflush (stdout);
sleep (1);
signal (SIGWINCH, sigsave);
}
/* **************************************************************** */
/* */
/* Necessary Terminal Functions */
/* */
/* */
/* Necessary Terminal Functions */
/* */
/* **************************************************************** */
/* The functions and variables on this page implement the user visible
@ -169,6 +204,8 @@ char *term_ku = (char *)NULL;
char *term_kd = (char *)NULL;
char *term_kr = (char *)NULL;
char *term_kl = (char *)NULL;
char *term_kP = (char *)NULL; /* page-up */
char *term_kN = (char *)NULL; /* page-down */
/* Move the cursor to the terminal location of X and Y. */
void
@ -180,7 +217,7 @@ terminal_goto_xy (x, y)
else
{
if (term_goto)
tputs (tgoto (term_goto, x, y), 1, output_character_function);
tputs (tgoto (term_goto, x, y), 1, output_character_function);
}
}
@ -208,7 +245,7 @@ terminal_write_chars (string, nchars)
else
{
if (nchars)
fwrite (string, 1, nchars, stdout);
fwrite (string, 1, nchars, stdout);
}
}
@ -294,9 +331,9 @@ terminal_ring_bell ()
else
{
if (terminal_has_visible_bell_p && terminal_use_visible_bell_p)
send_to_terminal (visible_bell);
send_to_terminal (visible_bell);
else
send_to_terminal (audible_bell);
send_to_terminal (audible_bell);
}
}
@ -318,7 +355,7 @@ terminal_delete_lines (start, count)
else
{
while (count--)
tputs (term_dl, lines, output_character_function);
tputs (term_dl, lines, output_character_function);
}
fflush (stdout);
@ -343,7 +380,7 @@ terminal_insert_lines (start, count)
else
{
while (count--)
tputs (term_al, lines, output_character_function);
tputs (term_al, lines, output_character_function);
}
fflush (stdout);
@ -369,22 +406,22 @@ terminal_scroll_terminal (start, end, amount)
else
{
/* If we are scrolling down, delete AMOUNT lines at END. Then insert
AMOUNT lines at START. */
AMOUNT lines at START. */
if (amount > 0)
{
terminal_delete_lines (end, amount);
terminal_insert_lines (start, amount);
}
{
terminal_delete_lines (end, amount);
terminal_insert_lines (start, amount);
}
/* If we are scrolling up, delete AMOUNT lines before START. This
actually does the upwards scroll. Then, insert AMOUNT lines
after the already scrolled region (i.e., END - AMOUNT). */
actually does the upwards scroll. Then, insert AMOUNT lines
after the already scrolled region (i.e., END - AMOUNT). */
if (amount < 0)
{
int abs_amount = -amount;
terminal_delete_lines (start - abs_amount, abs_amount);
terminal_insert_lines (end - abs_amount, abs_amount);
}
{
int abs_amount = -amount;
terminal_delete_lines (start - abs_amount, abs_amount);
terminal_insert_lines (end - abs_amount, abs_amount);
}
}
}
@ -414,55 +451,55 @@ terminal_get_screen_size ()
#if defined (TIOCGWINSZ)
{
struct winsize window_size;
struct winsize window_size;
if (ioctl (fileno (stdout), TIOCGWINSZ, &window_size) == 0)
{
screenwidth = (int) window_size.ws_col;
screenheight = (int) window_size.ws_row;
}
if (ioctl (fileno (stdout), TIOCGWINSZ, &window_size) == 0)
{
screenwidth = (int) window_size.ws_col;
screenheight = (int) window_size.ws_row;
}
}
#endif /* TIOCGWINSZ */
#endif /* TIOCGWINSZ */
/* Environment variable COLUMNS overrides setting of "co". */
if (screenwidth <= 0)
{
char *sw = getenv ("COLUMNS");
{
char *sw = getenv ("COLUMNS");
if (sw)
screenwidth = atoi (sw);
if (sw)
screenwidth = atoi (sw);
if (screenwidth <= 0)
screenwidth = tgetnum ("co");
}
if (screenwidth <= 0)
screenwidth = tgetnum ("co");
}
/* Environment variable LINES overrides setting of "li". */
if (screenheight <= 0)
{
char *sh = getenv ("LINES");
{
char *sh = getenv ("LINES");
if (sh)
screenheight = atoi (sh);
if (sh)
screenheight = atoi (sh);
if (screenheight <= 0)
screenheight = tgetnum ("li");
}
if (screenheight <= 0)
screenheight = tgetnum ("li");
}
/* If all else fails, default to 80x24 terminal. */
if (screenwidth <= 0)
screenwidth = 80;
screenwidth = 80;
if (screenheight <= 0)
screenheight = 24;
screenheight = 24;
}
}
/* Initialize the terminal which is known as TERMINAL_NAME. If this terminal
doesn't have cursor addressability, TERMINAL_IS_DUMB_P becomes non-zero.
The variables SCREENHEIGHT and SCREENWIDTH are set to the dimensions that
this terminal actually has. The variable TERMINAL_HAS_META_P becomes non-
zero if this terminal supports a Meta key. Finally, the terminal screen is
cleared. */
/* Initialize the terminal which is known as TERMINAL_NAME. If this
terminal doesn't have cursor addressability, `terminal_is_dumb_p'
becomes nonzero. The variables SCREENHEIGHT and SCREENWIDTH are set
to the dimensions that this terminal actually has. The variable
TERMINAL_HAS_META_P becomes nonzero if this terminal supports a Meta
key. Finally, the terminal screen is cleared. */
void
terminal_initialize_terminal (terminal_name)
char *terminal_name;
@ -500,6 +537,7 @@ terminal_initialize_terminal (terminal_name)
term_cr = "\r";
term_up = term_dn = audible_bell = visible_bell = (char *)NULL;
term_ku = term_kd = term_kl = term_kr = (char *)NULL;
term_kP = term_kN = (char *)NULL;
return;
}
@ -517,7 +555,7 @@ terminal_initialize_terminal (terminal_name)
}
#else
ospeed = B9600;
#endif /* !TIOCGETP */
#endif /* !TIOCGETP */
term_cr = tgetstr ("cr", &buffer);
term_clreol = tgetstr ("ce", &buffer);
@ -553,6 +591,9 @@ terminal_initialize_terminal (terminal_name)
term_begin_use = tgetstr ("ti", &buffer);
term_end_use = tgetstr ("te", &buffer);
term_keypad_on = tgetstr ("ks", &buffer);
term_keypad_off = tgetstr ("ke", &buffer);
/* Check to see if this terminal has a meta key. */
terminal_has_meta_p = (tgetflag ("km") || tgetflag ("MT"));
if (terminal_has_meta_p)
@ -572,17 +613,18 @@ terminal_initialize_terminal (terminal_name)
term_kr = tgetstr ("kr", &buffer);
term_kl = tgetstr ("kl", &buffer);
term_kP = tgetstr ("kP", &buffer);
term_kN = tgetstr ("kN", &buffer);
/* If this terminal is not cursor addressable, then it is really dumb. */
if (!term_goto)
terminal_is_dumb_p = 1;
terminal_begin_using_terminal ();
}
/* **************************************************************** */
/* */
/* How to Read Characters From the Terminal */
/* */
/* */
/* How to Read Characters From the Terminal */
/* */
/* **************************************************************** */
#if defined (TIOCGETC)
@ -623,6 +665,8 @@ terminal_prep_terminal ()
return;
}
terminal_begin_using_terminal ();
tty = fileno (stdin);
#if defined (HAVE_TERMIOS_H)
@ -655,7 +699,12 @@ terminal_prep_terminal ()
if (ttybuff.c_cc[VQUIT] == '\177')
ttybuff.c_cc[VQUIT] = -1;
#endif
#ifdef VLNEXT
if (ttybuff.c_cc[VLNEXT] == '\026')
ttybuff.c_cc[VLNEXT] = -1;
#endif /* VLNEXT */
#endif /* TERMIOS or TERMIO */
#if defined (HAVE_TERMIOS_H)
tcsetattr (tty, TCSANOW, &ttybuff);
@ -719,9 +768,9 @@ terminal_prep_terminal ()
temp = original_ltchars;
/* Make the interrupt keys go away. Just enough to make people happy. */
temp.t_lnextc = -1; /* C-v. */
temp.t_dsuspc = -1; /* C-y. */
temp.t_flushc = -1; /* C-o. */
temp.t_lnextc = -1; /* C-v. */
temp.t_dsuspc = -1; /* C-y. */
temp.t_flushc = -1; /* C-o. */
ioctl (tty, TIOCSLTC, &temp);
}
# endif /* TIOCGLTC */

File diff suppressed because it is too large Load Diff

View File

@ -1,56 +1,30 @@
/* install-info -- create Info directory entry(ies) for an Info file.
Copyright (C) 1996 Free Software Foundation, Inc.
$Id: install-info.c,v 1.5 1998/03/24 18:08:44 law Exp $
$Id: install-info.c,v 1.3 1997/09/18 05:54:18 law Exp $
Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.*/
#define INSTALL_INFO_VERSION_STRING "GNU install-info (Texinfo 3.9) 1.2"
#include <stdio.h>
#include <errno.h>
#include "system.h"
#include <getopt.h>
#include <sys/types.h>
#if defined (HAVE_STRING_H)
#include <string.h>
#else
#include <strings.h>
#endif /* !HAVE_STRING_H */
#if !defined (HAVE_STRCHR)
char *strrchr ();
#endif /* !HAVE_STRCHR */
/* Get O_RDONLY. */
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#else
#include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
/* Name this program was invoked with. */
char *progname;
char *readfile ();
struct line_data *findlines ();
char *my_strerror ();
void fatal ();
void insert_entry_here ();
int compare_section_names ();
@ -59,9 +33,8 @@ struct spec_entry;
/* Data structures. */
/* Record info about a single line from a file
as read into core. */
/* Record info about a single line from a file as read into core. */
struct line_data
{
/* The start of the line. */
@ -78,9 +51,9 @@ struct line_data
int delete;
};
/* This is used for a list of the specified menu section names
in which entries should be added. */
struct spec_section
{
struct spec_section *next;
@ -90,16 +63,16 @@ struct spec_section
int missing;
};
/* This is used for a list of the entries specified to be added. */
/* This is used for a list of the entries specified to be added. */
struct spec_entry
{
struct spec_entry *next;
char *text;
};
/* This is used for a list of nodes found by parsing the dir file. */
/* This is used for a list of nodes found by parsing the dir file. */
struct node
{
struct node *next;
@ -120,9 +93,9 @@ struct node
struct menu_section *last_section;
};
/* This is used for a list of sections found in a node's menu.
Each struct node has such a list in the sections field. */
struct menu_section
{
struct menu_section *next;
@ -136,7 +109,6 @@ struct menu_section
/* Memory allocation and string operations. */
/* Like malloc but get fatal error if memory is exhausted. */
void *
xmalloc (size)
unsigned int size;
@ -144,12 +116,11 @@ xmalloc (size)
extern void *malloc ();
void *result = malloc (size);
if (result == NULL)
fatal ("virtual memory exhausted", 0);
fatal (_("virtual memory exhausted"), 0);
return result;
}
/* Like malloc but get fatal error if memory is exhausted. */
/* Like realloc but get fatal error if memory is exhausted. */
void *
xrealloc (obj, size)
void *obj;
@ -158,12 +129,12 @@ xrealloc (obj, size)
extern void *realloc ();
void *result = realloc (obj, size);
if (result == NULL)
fatal ("virtual memory exhausted", 0);
fatal (_("virtual memory exhausted"), 0);
return result;
}
/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */
/* Return a newly-allocated string
whose contents concatenate those of S1, S2, S3. */
char *
concat (s1, s2, s3)
char *s1, *s2, *s3;
@ -197,7 +168,7 @@ copy_string (string, size)
/* Error message functions. */
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
/* Print error message. S1 is printf control string, S2 and S3 args for it. */
/* VARARGS1 */
void
@ -206,7 +177,7 @@ error (s1, s2, s3)
{
fprintf (stderr, "%s: ", progname);
fprintf (stderr, s1, s2, s3);
fprintf (stderr, "\n");
putc ('\n', stderr);
}
/* VARARGS1 */
@ -214,9 +185,9 @@ void
warning (s1, s2, s3)
char *s1, *s2, *s3;
{
fprintf (stderr, "%s: Warning: ", progname);
fprintf (stderr, _("%s: warning: "), progname);
fprintf (stderr, s1, s2, s3);
fprintf (stderr, "\n");
putc ('\n', stderr);
}
/* Print error message and exit. */
@ -235,7 +206,7 @@ void
pfatal_with_name (name)
char *name;
{
char *s = concat ("", my_strerror (errno), " for %s");
char *s = concat ("", strerror (errno), _(" for %s"));
fatal (s, name);
}
@ -304,7 +275,7 @@ extract_menu_file_name (item_text)
void
suggest_asking_for_help ()
{
fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n",
fprintf (stderr, _("\tTry `%s --help' for a complete list of options.\n"),
progname);
exit (1);
}
@ -312,7 +283,7 @@ suggest_asking_for_help ()
void
print_help ()
{
printf ("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
printf (_("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
Install INFO-FILE in the Info directory file DIR-FILE.\n\
\n\
Options:\n\
@ -342,27 +313,54 @@ Options:\n\
--version Display version information and exit.\n\
\n\
Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\
", progname);
"), progname);
}
/* Convert an errno value into a string describing the error.
We define this function here rather than using strerror
because not all systems have strerror. */
char *
my_strerror (errnum)
int errnum;
/* If DIRFILE does not exist, create a minimal one (or abort). If it
already exists, do nothing. */
void
ensure_dirfile_exists (dirfile)
char *dirfile;
{
#ifdef HAVE_STRERROR
return strerror(errnum);
#else
extern char *sys_errlist[];
extern int sys_nerr;
if (errnum >= 0 && errnum < sys_nerr)
return sys_errlist[errnum];
return (char *) "Unknown error";
#endif
int desc = open (dirfile, O_RDONLY);
if (desc < 0 && errno == ENOENT)
{
FILE *f;
char *readerr = strerror (errno);
close (desc);
f = fopen (dirfile, "w");
if (f)
{
fputs (_("This is the file .../info/dir, which contains the\n\
topmost node of the Info hierarchy, called (dir)Top.\n\
The first time you invoke Info you start off looking at this node.\n\
\n\
File: dir Node: Top This is the top of the INFO tree\n\
\n\
This (the Directory node) gives a menu of major topics.\n\
Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
\"h\" gives a primer for first-timers,\n\
\"mEmacs<Return>\" visits the Emacs manual, etc.\n\
\n\
In Emacs, you can click mouse button 2 on a menu item or cross reference\n\
to select it.\n\
\n\
* Menu:\n\
"), f);
if (fclose (f) < 0)
pfatal_with_name (dirfile);
}
else
{
/* Didn't exist, but couldn't open for writing. */
fprintf (stderr,
_("%s: could not read (%s) and could not create (%s)\n"),
dirfile, readerr, strerror (errno));
exit (1);
}
}
else
close (desc); /* It already existed, so fine. */
}
/* This table defines all the long-named options, says whether they
@ -384,6 +382,7 @@ struct option longopts[] =
{ 0 }
};
int
main (argc, argv)
int argc;
char **argv;
@ -425,6 +424,15 @@ main (argc, argv)
progname = argv[0];
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
#endif
/* Set the text message domain. */
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
while (1)
{
int opt = getopt_long (argc, argv, "i:d:e:s:hHr", longopts, 0);
@ -445,7 +453,7 @@ main (argc, argv)
case 'd':
if (dirfile)
{
fprintf (stderr, "%s: Specify the Info directory only once.\n",
fprintf (stderr, _("%s: Specify the Info directory only once.\n"),
progname);
suggest_asking_for_help ();
}
@ -455,7 +463,7 @@ main (argc, argv)
case 'D':
if (dirfile)
{
fprintf (stderr, "%s: Specify the Info directory only once.\n",
fprintf (stderr, _("%s: Specify the Info directory only once.\n"),
progname);
suggest_asking_for_help ();
}
@ -483,7 +491,7 @@ main (argc, argv)
case 'i':
if (infile)
{
fprintf (stderr, "%s: Specify the Info file only once.\n",
fprintf (stderr, _("%s: Specify the Info file only once.\n"),
progname);
suggest_asking_for_help ();
}
@ -510,12 +518,12 @@ main (argc, argv)
break;
case 'V':
puts (INSTALL_INFO_VERSION_STRING);
puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\
printf (_("install-info (GNU %s) %s\n"), PACKAGE, VERSION);
puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.");
exit (0);
For more information about these matters, see the files named COPYING."));
exit (0);
default:
suggest_asking_for_help ();
@ -530,13 +538,13 @@ For more information about these matters, see the files named COPYING.");
else if (dirfile == 0)
dirfile = argv[optind];
else
error ("excess command line argument `%s'", argv[optind]);
error (_("excess command line argument `%s'"), argv[optind]);
}
if (!infile)
fatal ("No input file specified");
fatal (_("No input file specified; try --help for more information."));
if (!dirfile)
fatal ("No dir file specified");
fatal (_("No dir file specified; try --help for more information."));
/* Read the Info file and parse it into lines. */
@ -588,7 +596,7 @@ For more information about these matters, see the files named COPYING.");
&& sizeof ("START-INFO-DIR-ENTRY") - 1 == input_lines[i].size)
{
if (start_of_this_entry != 0)
fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY");
fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
start_of_this_entry = input_lines[i + 1].start;
}
if (!strncmp ("END-INFO-DIR-ENTRY", input_lines[i].start,
@ -607,18 +615,26 @@ For more information about these matters, see the files named COPYING.");
start_of_this_entry = 0;
}
else
fatal ("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY");
fatal (_("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"));
}
}
if (start_of_this_entry != 0)
fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY");
fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
}
if (!delete_flag)
if (entries_to_add == 0)
fatal ("no info dir entry in `%s'", infile);
{ /* No need to abort here, the original info file may not have
the requisite Texinfo commands. This is not something an
installer should have to correct (it's a problem for the
maintainer), and there's no need to cause subsequent parts of
`make install' to fail. */
warning (_("no info dir entry in `%s'"), infile);
exit (0);
}
/* Now read in the Info dir file. */
ensure_dirfile_exists (dirfile);
dir_data = readfile (dirfile, &dir_size);
dir_lines = findlines (dir_data, dir_size, &dir_nlines);
@ -747,8 +763,12 @@ For more information about these matters, see the files named COPYING.");
if ((dir_lines[i].size
> (p - dir_lines[i].start + infilelen_sans_info))
&& !strncmp (p, infile_sans_info, infilelen_sans_info)
&& p[infilelen_sans_info] == ')')
dir_lines[i].delete = 1;
&& (p[infilelen_sans_info] == ')'
|| !strncmp (p + infilelen_sans_info, ".info)", 6)))
{
dir_lines[i].delete = 1;
something_deleted = 1;
}
}
}
/* Treat lines that start with whitespace
@ -820,7 +840,7 @@ For more information about these matters, see the files named COPYING.");
dir_lines[i].start,
dir_lines[i].size)
&& !dir_lines[i].delete)
fatal ("menu item `%s' already exists, for file `%s'",
fatal (_("menu item `%s' already exists, for file `%s'"),
extract_menu_item_name (entry->text),
extract_menu_file_name (dir_lines[i].start));
if (dir_lines[i].start[0] == '*'
@ -843,7 +863,7 @@ For more information about these matters, see the files named COPYING.");
}
if (delete_flag && !something_deleted && !quiet_flag)
warning ("no entries found for `%s'; nothing deleted", infile);
warning (_("no entries found for `%s'; nothing deleted"), infile);
/* Output the old dir file, interpolating the new sections
and/or new entries where appropriate. */
@ -941,7 +961,6 @@ readfile (filename, sizep)
int nread = 0;
int desc = open (filename, O_RDONLY);
if (desc < 0)
pfatal_with_name (filename);