1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-10 21:38:50 +01:00

Update automake helper files.

--
This commit is contained in:
Werner Koch 2015-01-19 17:25:57 +01:00
parent 592e1aa407
commit 397987c332
10 changed files with 1557 additions and 1120 deletions

259
INSTALL
View File

@ -1,16 +1,25 @@
Installation Instructions Installation Instructions
************************* *************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Software Foundation, Inc. Inc.
This file is free documentation; the Free Software Foundation gives Copying and distribution of this file, with or without modification,
unlimited permission to copy, distribute and modify it. are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation Basic Installation
================== ==================
These are generic installation instructions. Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses various system-dependent variables used during compilation. It uses
@ -23,9 +32,9 @@ debugging `configure').
It can also use an optional file (typically called `config.cache' It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale disabled by default to prevent problems with accidental use of stale
cache files.) cache files.
If you need to do unusual things to compile the package, please try If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail to figure out how `configure' could check whether to do them, and mail
@ -35,30 +44,37 @@ some point `config.cache' contains results you don't want to keep, you
may remove or edit it. may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need `configure' by a program called `autoconf'. You need `configure.ac' if
`configure.ac' if you want to change it or regenerate `configure' using you want to change it or regenerate `configure' using a newer version
a newer version of `autoconf'. of `autoconf'.
The simplest way to compile this package is: The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type 1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're `./configure' to configure the package for your system.
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some Running `configure' might take a while. While running, it prints
messages telling which features it is checking for. some messages telling which features it is checking for.
2. Type `make' to compile the package. 2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with 3. Optionally, type `make check' to run any self-tests that come with
the package. the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and 4. Type `make install' to install the programs and any data files and
documentation. documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. You can remove the program binaries and object files from the 5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is a different kind of computer), type `make distclean'. There is
@ -67,65 +83,120 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came all sorts of other programs in order to regenerate files that came
with the distribution. with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options Compilers and Options
===================== =====================
Some systems require unusual options for compilation or linking that the Some systems require unusual options for compilation or linking that
`configure' script does not know about. Run `./configure --help' for the `configure' script does not know about. Run `./configure --help'
details on some of the pertinent environment variables. for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here by setting variables in the command line or in the environment. Here
is an example: is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details. *Note Defining Variables::, for more details.
Compiling For Multiple Architectures Compiling For Multiple Architectures
==================================== ====================================
You can compile the package for more than one kind of computer at the You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that own directory. To do this, you can use GNU `make'. `cd' to the
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
If you have to use a `make' that does not support the `VPATH' With a non-GNU `make', it is safer to compile the package for one
variable, you have to compile the package for one architecture at a architecture at a time in the source code directory. After you have
time in the source code directory. After you have installed the installed the package for one architecture, use `make distclean' before
package for one architecture, use `make distclean' before reconfiguring reconfiguring for another architecture.
for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names Installation Names
================== ==================
By default, `make install' will install the package's files in By default, `make install' installs the package's commands under
`/usr/local/bin', `/usr/local/man', etc. You can specify an `/usr/local/bin', include files under `/usr/local/include', etc. You
installation prefix other than `/usr/local' by giving `configure' the can specify an installation prefix other than `/usr/local' by giving
option `--prefix=PREFIX'. `configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PREFIX', the package will pass the option `--exec-prefix=PREFIX' to `configure', the package uses
use PREFIX as the prefix for installing programs and libraries. PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix. Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features Some packages pay attention to `--enable-FEATURE' options to
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package. `configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The is something like `gnu-as' or `x' (for the X Window System). The
@ -137,14 +208,58 @@ find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations. `--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type Specifying the System Type
========================== ==========================
There may be some features `configure' cannot figure out automatically, There may be some features `configure' cannot figure out
but needs to determine by the type of machine the package will run on. automatically, but needs to determine by the type of machine the package
Usually, assuming the package is built to be run on the _same_ will run on. Usually, assuming the package is built to be run on the
architectures, `configure' can figure that out, but if it prints a _same_ architectures, `configure' can figure that out, but if it prints
message saying it cannot guess the machine type, give it the a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system `--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form: type, such as `sun4', or a canonical name which has the form:
@ -152,14 +267,15 @@ type, such as `sun4', or a canonical name which has the form:
where SYSTEM can have one of these forms: where SYSTEM can have one of these forms:
OS KERNEL-OS OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't `config.sub' isn't included in this package, then this package doesn't
need to know the machine type. need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will use the option `--target=TYPE' to select the type of system they will
produce code for. produce code for.
If you want to _use_ a cross compiler, that generates code for a If you want to _use_ a cross compiler, that generates code for a
@ -170,9 +286,9 @@ eventually be run) with `--host=TYPE'.
Sharing Defaults Sharing Defaults
================ ================
If you want to set default values for `configure' scripts to share, you If you want to set default values for `configure' scripts to share,
can create a site shell script called `config.site' that gives default you can create a site shell script called `config.site' that gives
values for variables like `CC', `cache_file', and `prefix'. default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then `configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the `PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script. `CONFIG_SITE' environment variable to the location of the site script.
@ -181,7 +297,7 @@ A warning: not all `configure' scripts look for a site script.
Defining Variables Defining Variables
================== ==================
Variables not defined in a site shell script can be set in the Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set variables may be lost. In order to avoid this problem, you should set
@ -189,17 +305,31 @@ them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc ./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation `configure' Invocation
====================== ======================
`configure' recognizes the following options to control how it operates. `configure' recognizes the following options to control how it
operates.
`--help' `--help'
`-h' `-h'
Print a summary of the options to `configure', and exit. Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version' `--version'
`-V' `-V'
@ -226,6 +356,15 @@ overridden in the site shell script).
Look for the package's source code in directory DIR. Usually Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically. `configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run `configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details. `configure --help' for more details.

View File

@ -1,10 +1,9 @@
#! /bin/sh #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'. # Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-01-04.17; # UTC scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free # Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>. # Written by Tom Tromey <tromey@cygnus.com>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -79,6 +78,53 @@ func_file_conv ()
esac esac
} }
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg... # func_cl_wrapper cl arg...
# Adjust compile command to suit cl # Adjust compile command to suit cl
func_cl_wrapper () func_cl_wrapper ()
@ -109,43 +155,34 @@ func_cl_wrapper ()
;; ;;
esac esac
;; ;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*) -I*)
func_file_conv "${1#-I}" mingw func_file_conv "${1#-I}" mingw
set x "$@" -I"$file" set x "$@" -I"$file"
shift shift
;; ;;
-l*) -l)
lib=${1#-l} eat=1
found=no func_cl_dashl "$2"
save_IFS=$IFS set x "$@" "$lib"
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
set x "$@" "$dir/$lib.dll.lib"
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
set x "$@" "$dir/$lib.lib"
break
fi
done
IFS=$save_IFS
test "$found" != yes && set x "$@" "$lib.lib"
shift shift
;; ;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*) -L*)
func_file_conv "${1#-L}" func_cl_dashL "${1#-L}"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
;; ;;
-static) -static)
shared=false shared=false

164
scripts/config.guess vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright 1992-2013 Free Software Foundation, Inc. # Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2013-11-29' timestamp='2014-03-23'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright 1992-2013 Free Software Foundation, Inc. Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
LIBC=gnu LIBC=gnu
#endif #endif
EOF EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;; ;;
esac esac
@ -826,7 +826,7 @@ EOF
*:MINGW*:*) *:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32 echo ${UNAME_MACHINE}-pc-mingw32
exit ;; exit ;;
i*:MSYS*:*) *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys echo ${UNAME_MACHINE}-pc-msys
exit ;; exit ;;
i*:windows32*:*) i*:windows32*:*)
@ -969,10 +969,10 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;; ;;
or1k:Linux:*:*) openrisc*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo or1k-unknown-linux-${LIBC}
exit ;; exit ;;
or32:Linux:*:*) or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
padre:Linux:*:*) padre:Linux:*:*)
@ -1371,154 +1371,6 @@ EOF
exit ;; exit ;;
esac esac
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 <<EOF cat >&2 <<EOF
$0: unable to guess system type $0: unable to guess system type

26
scripts/config.sub vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc. # Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2013-10-01' timestamp='2014-09-11'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -68,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright 1992-2013 Free Software Foundation, Inc. Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -283,8 +283,10 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \ | mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \ | mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \ | mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \ | mipsr5900 | mipsr5900el \
@ -296,11 +298,11 @@ case $basic_machine in
| nds32 | nds32le | nds32be \ | nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \ | ns16k | ns32k \
| open8 \ | open8 | or1k | or1knd | or32 \
| or1k | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \ | pyramid \
| riscv32 | riscv64 \
| rl78 | rx \ | rl78 | rx \
| score \ | score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@ -402,8 +404,10 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \ | mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \ | mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \ | mipsr5900-* | mipsr5900el-* \
@ -415,6 +419,7 @@ case $basic_machine in
| nios-* | nios2-* | nios2eb-* | nios2el-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \ | open8-* \
| or1k*-* \
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@ -824,6 +829,10 @@ case $basic_machine in
basic_machine=powerpc-unknown basic_machine=powerpc-unknown
os=-morphos os=-morphos
;; ;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos) msdos)
basic_machine=i386-pc basic_machine=i386-pc
os=-msdos os=-msdos
@ -1369,14 +1378,14 @@ case $os in
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@ -1594,9 +1603,6 @@ case $basic_machine in
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
or1k-*)
os=-elf
;;
or32-*) or32-*)
os=-coff os=-coff
;; ;;

View File

@ -1,10 +1,9 @@
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
scriptversion=2011-12-04.11; # UTC scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # Copyright (C) 1999-2013 Free Software Foundation, Inc.
# 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -57,6 +56,66 @@ EOF
;; ;;
esac esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2 echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1 exit 1
@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We # Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below, # parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case # to make depend.m4 easier to write. Note that we *cannot* use a case
@ -102,6 +164,12 @@ if test "$depmode" = msvc7msys; then
depmode=msvc7 depmode=msvc7
fi fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in case "$depmode" in
gcc3) gcc3)
## gcc 3 implements dependency tracking that does exactly what ## gcc 3 implements dependency tracking that does exactly what
@ -122,8 +190,7 @@ gcc3)
done done
"$@" "$@"
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
@ -131,13 +198,17 @@ gcc3)
;; ;;
gcc) gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's ## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method: ## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end ## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly. ## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.) ## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). ## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse ## - Using -M directly means running the compiler twice (even worse
## than renaming). ## than renaming).
if test -z "$gccflag"; then if test -z "$gccflag"; then
@ -145,15 +216,14 @@ gcc)
fi fi
"$@" -Wp,"$gccflag$tmpdepfile" "$@" -Wp,"$gccflag$tmpdepfile"
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz # The second -e expression handles DOS-style file names with drive
## The second -e expression handles DOS-style file names with drive letters. # letters.
sed -e 's/^[^:]*: / /' \ sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem. ## This next piece of magic avoids the "deleted header file" problem.
@ -162,15 +232,14 @@ gcc)
## typically no way to rebuild the header). We avoid this by adding ## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do ## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly. ## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory ## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as ## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH ## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output. ## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation ## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround. ## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile" | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
@ -189,8 +258,7 @@ sgi)
"$@" -MDupdate "$tmpdepfile" "$@" -MDupdate "$tmpdepfile"
fi fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
@ -198,43 +266,41 @@ sgi)
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be # Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle # clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in # lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the # the IRIX cc adds comments like '#:fec' to the end of the
# dependency line. # dependency line.
tr ' ' ' tr ' ' "$nl" < "$tmpdepfile" \
' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ | tr "$nl" ' ' >> "$depfile"
tr '
' ' ' >> "$depfile"
echo >> "$depfile" echo >> "$depfile"
# The second pass generates a dummy entry for each header file. # The second pass generates a dummy entry for each header file.
tr ' ' ' tr ' ' "$nl" < "$tmpdepfile" \
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile" >> "$depfile"
else else
# The sourcefile does not contain any dependencies, so just make_dummy_depfile
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi fi
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix) aix)
# The C for AIX Compiler uses -M and outputs the dependencies # The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the # in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the # current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information. # start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases. # Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` set_dir_from "$object"
test "x$dir" = "x$object" && dir= set_base_from "$object"
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u tmpdepfile2=$base.u
@ -247,9 +313,7 @@ aix)
"$@" -M "$@" -M
fi fi
stat=$? stat=$?
if test $stat -ne 0; then
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat exit $stat
fi fi
@ -258,57 +322,113 @@ aix)
do do
test -f "$tmpdepfile" && break test -f "$tmpdepfile" && break
done done
if test -f "$tmpdepfile"; then aix_post_process_depfile
# Each line is of the form 'foo.o: dependent.h'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;; ;;
icc) tcc)
# Intel's C compiler understands '-MD -MF file'. However on # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # FIXME: That version still under development at the moment of writing.
# ICC 7.0 will fill foo.d with something like # Make that this statement remains true also for stable, released
# foo.o: sub/foo.c # versions.
# foo.o: sub/foo.h # It will wrap lines (doesn't matter whether long or short) with a
# which is wrong. We want: # trailing '\', as in:
# sub/foo.o: sub/foo.c #
# sub/foo.o: sub/foo.h # foo.o : \
# sub/foo.c: # foo.c \
# sub/foo.h: # foo.h \
# ICC 7.1 will output #
# foo.o: sub/foo.c sub/foo.h # It will put a trailing '\' even on the last line, and will use leading
# and will wrap long lines using \ : # spaces rather than leading tabs (at least since its commit 0394caf7
# foo.o: sub/foo.c ... \ # "Emit spaces for -MD").
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile" "$@" -MD -MF "$tmpdepfile"
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
rm -f "$depfile" rm -f "$depfile"
# Each line is of the form 'foo.o: dependent.h', # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to # Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'. # `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation # Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround. # correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
sed -e 's/$/ :/' >> "$depfile" | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
@ -319,9 +439,8 @@ hp2)
# 'foo.d', which lands next to the object file, wherever that # 'foo.d', which lands next to the object file, wherever that
# happens to be. # happens to be.
# Much of this is similar to the tru64 case; see comments there. # Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` set_dir_from "$object"
test "x$dir" = "x$object" && dir= set_base_from "$object"
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d tmpdepfile2=$dir.libs/$base.d
@ -332,8 +451,7 @@ hp2)
"$@" +Maked "$@" +Maked
fi fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile1" "$tmpdepfile2" rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat exit $stat
fi fi
@ -343,7 +461,7 @@ hp2)
test -f "$tmpdepfile" && break test -f "$tmpdepfile" && break
done done
if test -f "$tmpdepfile"; then if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines. # Add 'dependent.h:' lines.
sed -ne '2,${ sed -ne '2,${
s/^ *// s/^ *//
@ -352,7 +470,7 @@ hp2)
p p
}' "$tmpdepfile" >> "$depfile" }' "$tmpdepfile" >> "$depfile"
else else
echo "#dummy" > "$depfile" make_dummy_depfile
fi fi
rm -f "$tmpdepfile" "$tmpdepfile2" rm -f "$tmpdepfile" "$tmpdepfile2"
;; ;;
@ -363,56 +481,40 @@ tru64)
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too. # dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected. # Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` set_dir_from "$object"
test "x$dir" = "x$object" && dir= set_base_from "$object"
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a # Libtool generates 2 separate objects for the 2 libraries. These
# static library. This mechanism is used in libtool 1.4 series to # two compilations output dependencies in $dir.libs/$base.o.d and
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because # in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer # one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring # automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic. # the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD "$@" -Wc,-MD
else else
tmpdepfile1=$dir$base.o.d tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD "$@" -MD
fi fi
stat=$? stat=$?
if test $stat -eq 0; then : if test $stat -ne 0; then
else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat exit $stat
fi fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do do
test -f "$tmpdepfile" && break test -f "$tmpdepfile" && break
done done
if test -f "$tmpdepfile"; then # Same post-processing that is required for AIX mode.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" aix_post_process_depfile
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;; ;;
msvc7) msvc7)
@ -424,8 +526,7 @@ msvc7)
"$@" $showIncludes > "$tmpdepfile" "$@" $showIncludes > "$tmpdepfile"
stat=$? stat=$?
grep -v '^Note: including file: ' "$tmpdepfile" grep -v '^Note: including file: ' "$tmpdepfile"
if test "$stat" = 0; then : if test $stat -ne 0; then
else
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
exit $stat exit $stat
fi fi
@ -443,14 +544,15 @@ msvc7)
p p
}' | $cygpath_u | sort -u | sed -n ' }' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g s/ /\\ /g
s/\(.*\)/ \1 \\/p s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/ s/.\(.*\) \\/\1:/
H H
$ { $ {
s/.*/ / s/.*/'"$tab"'/
G G
p p
}' >> "$depfile" }' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
@ -502,14 +604,14 @@ dashmstdout)
# in the target name. This is to cope with DOS-style filenames: # in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag | "$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile" cat < "$tmpdepfile" > "$depfile"
tr ' ' ' # Some versions of the HPUX 10.20 sed can't process this sed invocation
' < "$tmpdepfile" | \ # correctly. Breaking it into two sed invocations is a workaround.
## Some versions of the HPUX 10.20 sed can't process this invocation tr ' ' "$nl" < "$tmpdepfile" \
## correctly. Breaking it into two sed invocations is a workaround. | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;
@ -562,11 +664,12 @@ makedepend)
# makedepend may prepend the VPATH from the source file name to the object. # makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless. # No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' ' # Some versions of the HPUX 10.20 sed can't process the last invocation
' | \ # correctly. Breaking it into two sed invocations is a workaround.
## Some versions of the HPUX 10.20 sed can't process this invocation sed '1,2d' "$tmpdepfile" \
## correctly. Breaking it into two sed invocations is a workaround. | tr ' ' "$nl" \
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak rm -f "$tmpdepfile" "$tmpdepfile".bak
;; ;;
@ -602,10 +705,10 @@ cpp)
esac esac
done done
"$@" -E | "$@" -E \
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
sed '$ s: \\$::' > "$tmpdepfile" | sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile" cat < "$tmpdepfile" >> "$depfile"
@ -652,8 +755,8 @@ msvisualcpp)
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile" rm -f "$depfile"
echo "$object : \\" > "$depfile" echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo " " >> "$depfile" echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile" rm -f "$tmpdepfile"
;; ;;

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2004-10-22.00 scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
@ -35,42 +35,72 @@ scriptversion=2004-10-22.00
# FSF changes to this file are in the public domain. # FSF changes to this file are in the public domain.
# #
# Calling this script install-sh is preferred over install.sh, to prevent # Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it # 'make' implicit rules from creating a file called install from it
# when there is no Makefile. # when there is no Makefile.
# #
# This script is compatible with the BSD install script, but was written # This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction # from scratch.
# shared with many OS's install programs.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script # set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it. # Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}" doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# put in absolute paths if you don't have them in your path; or use env. vars. # Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}" chgrpprog=${CHGRPPROG-chgrp}
cpprog="${CPPROG-cp}" chmodprog=${CHMODPROG-chmod}
chmodprog="${CHMODPROG-chmod}" chownprog=${CHOWNPROG-chown}
chownprog="${CHOWNPROG-chown}" cmpprog=${CMPPROG-cmp}
chgrpprog="${CHGRPPROG-chgrp}" cpprog=${CPPROG-cp}
stripprog="${STRIPPROG-strip}" mkdirprog=${MKDIRPROG-mkdir}
rmprog="${RMPROG-rm}" mvprog=${MVPROG-mv}
mkdirprog="${MKDIRPROG-mkdir}" rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd= chgrpcmd=
stripcmd= chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f" rmcmd="$rmprog -f"
mvcmd="$mvprog" stripcmd=
src= src=
dst= dst=
dir_arg= dir_arg=
dstarg= dst_arg=
copy_on_change=false
no_target_directory= no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES... or: $0 [OPTION]... -d DIRECTORIES...
@ -80,108 +110,148 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES. In the 4th, create DIRECTORIES.
Options: Options:
-c (ignored) --help display this help and exit.
-d create directories instead of installing files. --version display version info and exit.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE. -c (ignored)
-o USER $chownprog installed files to USER. -C install only if different (preserve the last data modification time)
-s $stripprog installed files. -d create directories instead of installing files.
-t DIRECTORY install into DIRECTORY. -g GROUP $chgrpprog installed files to GROUP.
-T report an error if DSTFILE is a directory. -m MODE $chmodprog installed files to MODE.
--help display this help and exit. -o USER $chownprog installed files to USER.
--version display version info and exit. -s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands: Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
" "
while test -n "$1"; do while test $# -ne 0; do
case $1 in case $1 in
-c) shift -c) ;;
continue;;
-d) dir_arg=true -C) copy_on_change=true;;
shift
continue;; -d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2" -g) chgrpcmd="$chgrpprog $2"
shift shift;;
shift
continue;;
--help) echo "$usage"; exit 0;; --help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2" -m) mode=$2
shift case $mode in
shift *' '* | *' '* | *'
continue;; '* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2" -o) chowncmd="$chownprog $2"
shift shift;;
shift
continue;;
-s) stripcmd=$stripprog -s) stripcmd=$stripprog;;
shift
continue;;
-t) dstarg=$2 -t) dst_arg=$2
shift # Protect names problematic for 'test' and other utilities.
shift case $dst_arg in
continue;; -* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true -T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift shift
continue;; done
--version) echo "$0 $scriptversion"; exit 0;; if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified. # When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@. # Otherwise, the last argument is the destination. Remove it from $@.
for arg for arg
do do
if test -n "$dstarg"; then if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg. # $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg" set fnord "$@" "$dst_arg"
shift # fnord shift # fnord
fi fi
shift # arg shift # arg
dstarg=$arg dst_arg=$arg
done # Protect names problematic for 'test' and other utilities.
break;; case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac esac
done done
fi
if test -z "$1"; then if test $# -eq 0; then
if test -z "$dir_arg"; then if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2 echo "$0: no input file specified." >&2
exit 1 exit 1
fi fi
# It's OK to call `install-sh -d' without argument. # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories. # This can happen when creating conditional directories.
exit 0 exit 0
fi fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src for src
do do
# Protect names starting with `-'. # Protect names problematic for 'test' and other utilities.
case $src in case $src in
-*) src=./$src ;; -* | [=\(\)!]) src=./$src;;
esac esac
if test -n "$dir_arg"; then if test -n "$dir_arg"; then
dst=$src dst=$src
src= dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad # might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'. # if $src (and thus $dsttmp) contains '*'.
@ -190,71 +260,194 @@ do
exit 1 exit 1
fi fi
if test -z "$dstarg"; then if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2 echo "$0: no destination specified." >&2
exit 1 exit 1
fi fi
dst=$dst_arg
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work # If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored. # if double slashes aren't ignored.
if test -d "$dst"; then if test -d "$dst"; then
if test -n "$no_target_directory"; then if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2 echo "$0: $dst_arg: Is a directory" >&2
exit 1 exit 1
fi fi
dst=$dst/`basename "$src"` dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi fi
fi fi
# This sed command emulates the dirname command. obsolete_mkdir_used=false
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists. if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
# Skip lots of stat calls in the usual case. *[0-7])
if test ! -d "$dstdir"; then mkdir_umask=`expr $umask + 22 \
defaultIFS=' - $umask % 100 % 40 + $umask % 20 \
' - $umask % 10 % 4 + $umask % 2
IFS="${IFS-$defaultIFS}" `;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason. IFS=/
IFS='%' $posix_glob set -f
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` set fnord $dstdir
shift shift
$posix_glob set +f
IFS=$oIFS IFS=$oIFS
pathcomp= prefixes=
while test $# -ne 0 ; do for d
pathcomp=$pathcomp$1 do
shift test X"$d" = X && continue
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp" prefix=$prefix$d
# mkdir can fail with a `File exist' error in case several if test -d "$prefix"; then
# install-sh are creating the directory concurrently. This prefixes=
# is OK. else
test -d "$pathcomp" || exit if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi fi
pathcomp=$pathcomp/ fi
prefix=$prefix/
done done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi fi
if test -n "$dir_arg"; then if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory. # Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_ dsttmp=$dstdir/_inst.$$_
@ -262,10 +455,9 @@ do
# Trap to clean up those temp files at exit. # Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name. # Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" && (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits. # and set any options; do chmod last to preserve setuid bits.
# #
@ -273,51 +465,63 @@ do
# ignore errors from any of these, just make sure not to ignore # ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command. # errors from the above "$doit $cpprog $src $dsttmp" command.
# #
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else # The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not # to itself, or perhaps because mv is so ancient that it does not
# support -f. # support -f.
{
# Now remove or move aside any old file at destination location. # Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some # We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other # systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new # reasons. In this case, the final cleanup might fail but the new
# file should still install successfully. # file should still install successfully.
{ {
if test -f "$dstdir/$dstfile"; then test ! -f "$dst" ||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ $doit $rmcmd -f "$dst" 2>/dev/null ||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|| { { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 } ||
(exit 1); exit { echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
} }
else
:
fi
} && } &&
# Now rename the file to the real destination. # Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile" $doit $mvcmd "$dsttmp" "$dst"
} }
} fi || exit 1
fi || { (exit 1); exit; }
done
# The final little trick to "correctly" pass the exit status to the exit trap. trap '' 0
{ fi
(exit 0); exit done
}
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$" # time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End: # End:

View File

@ -1,6 +1,9 @@
#!/bin/sh #!/bin/sh
# Get modification time of a file or directory and pretty-print it. # Get modification time of a file or directory and pretty-print it.
# Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
scriptversion=2010-08-21.06; # UTC
# Copyright (C) 1995-2013 Free Software Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -14,14 +17,55 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation, # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
fi
case $1 in
'')
echo "$0: No file. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: mdate-sh [--help] [--version] FILE
Pretty-print the modification day of FILE, in the format:
1 January 1970
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "mdate-sh $scriptversion"
exit $?
;;
esac
error ()
{
echo "$0: $1" >&2
exit 1
}
# Prevent date giving response in another language. # Prevent date giving response in another language.
LANG=C LANG=C
export LANG export LANG
@ -30,7 +74,15 @@ export LC_ALL
LC_TIME=C LC_TIME=C
export LC_TIME export LC_TIME
save_arg1="$1" # GNU ls changes its time format in response to the TIME_STYLE
# variable. Since we cannot assume 'unset' works, revert this
# variable to its documented default.
if test "${TIME_STYLE+set}" = set; then
TIME_STYLE=posix-long-iso
export TIME_STYLE
fi
save_arg1=$1
# Find out how to get the extended ls output of a file or directory. # Find out how to get the extended ls output of a file or directory.
if ls -L /dev/null 1>/dev/null 2>&1; then if ls -L /dev/null 1>/dev/null 2>&1; then
@ -38,27 +90,32 @@ if ls -L /dev/null 1>/dev/null 2>&1; then
else else
ls_command='ls -l -d' ls_command='ls -l -d'
fi fi
# Avoid user/group names that might have spaces, when possible.
if ls -n /dev/null 1>/dev/null 2>&1; then
ls_command="$ls_command -n"
fi
# A `ls -l' line looks as follows on OS/2. # A 'ls -l' line looks as follows on OS/2.
# drwxrwx--- 0 Aug 11 2001 foo # drwxrwx--- 0 Aug 11 2001 foo
# This differs from Unix, which adds ownership information. # This differs from Unix, which adds ownership information.
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo # drwxrwx--- 2 root root 4096 Aug 11 2001 foo
# #
# To find the date, we split the line on spaces and iterate on words # To find the date, we split the line on spaces and iterate on words
# until we find a month. This cannot work with files whose owner is a # until we find a month. This cannot work with files whose owner is a
# user named `Jan', or `Feb', etc. However, it's unlikely that `/' # user named "Jan", or "Feb", etc. However, it's unlikely that '/'
# will be owned by a user whose name is a month. So we first look at # will be owned by a user whose name is a month. So we first look at
# the extended ls output of the root directory to decide how many # the extended ls output of the root directory to decide how many
# words should be skipped to get the date. # words should be skipped to get the date.
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
set - x`$ls_command /` set x`$ls_command /`
# Find which argument is the month. # Find which argument is the month.
month= month=
command= command=
until test $month until test $month
do do
test $# -gt 0 || error "failed parsing '$ls_command /' output"
shift shift
# Add another shift to the command. # Add another shift to the command.
command="$command shift;" command="$command shift;"
@ -78,14 +135,35 @@ do
esac esac
done done
test -n "$month" || error "failed parsing '$ls_command /' output"
# Get the extended ls output of the file or directory. # Get the extended ls output of the file or directory.
set - x`eval "$ls_command \"\$save_arg1\""` set dummy x`eval "$ls_command \"\\\$save_arg1\""`
# Remove all preceding arguments # Remove all preceding arguments
eval $command eval $command
# Get the month. Next argument is day, followed by the year or time. # Because of the dummy argument above, month is in $2.
case $1 in #
# On a POSIX system, we should have
#
# $# = 5
# $1 = file size
# $2 = month
# $3 = day
# $4 = year or time
# $5 = filename
#
# On Darwin 7.7.0 and 7.6.0, we have
#
# $# = 4
# $1 = day
# $2 = month
# $3 = year or time
# $4 = filename
# Get the month.
case $2 in
Jan) month=January; nummonth=1;; Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;; Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;; Mar) month=March; nummonth=3;;
@ -100,7 +178,10 @@ case $1 in
Dec) month=December; nummonth=12;; Dec) month=December; nummonth=12;;
esac esac
day=$2 case $3 in
???*) day=$1;;
*) day=$3; shift;;
esac
# Here we have to deal with the problem that the ls output gives either # Here we have to deal with the problem that the ls output gives either
# the time of day or the year. # the time of day or the year.
@ -131,3 +212,13 @@ esac
# The result. # The result.
echo $day $month $year echo $day $month $year
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -1,11 +1,10 @@
#! /bin/sh #! /bin/sh
# Common stub for a few missing GNU programs while installing. # Common wrapper for a few potentially missing GNU programs.
scriptversion=2004-09-07.08 scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -18,9 +17,7 @@ scriptversion=2004-09-07.08
# GNU General Public License for more details. # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
@ -28,326 +25,191 @@ scriptversion=2004-09-07.08
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information" echo 1>&2 "Try '$0 --help' for more information"
exit 1 exit 1
fi fi
run=: case $1 in
# In the cases where this matters, `missing' is being run in the --is-lightweight)
# srcdir already. # Used by our autoconf macros to check whether the available missing
if test -f configure.ac; then # script is modern enough.
configure_ac=configure.ac exit 0
else ;;
configure_ac=configure.in
fi
msg="missing on your system" --run)
# Back-compat with the calling convention used by older automake.
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;; ;;
-h|--h|--he|--hel|--help) -h|--h|--he|--hel|--help)
echo "\ echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]... $0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
error status if there is no known handling for PROGRAM. to PROGRAM being missing or too old.
Options: Options:
-h, --help display this help and exit -h, --help display this help and exit
-v, --version output version information and exit -v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values: Supported PROGRAM values:
aclocal touch file \`aclocal.m4' aclocal autoconf autoheader autom4te automake makeinfo
autoconf touch file \`configure' bison yacc flex lex help2man
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
bison create \`y.tab.[ch]', if possible, from existing .[ch] 'g' are ignored when checking the name.
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>." Send bug reports to <bug-automake@gnu.org>."
exit 0 exit $?
;; ;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version) -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)" echo "missing $scriptversion (GNU Automake)"
exit 0 exit $?
;; ;;
-*) -*)
echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try \`$0 --help' for more information" echo 1>&2 "Try '$0 --help' for more information"
exit 1 exit 1
;; ;;
esac esac
# Now exit if we have it, but it failed. Also exit now if we # Run the given program, remember its exit status.
# don't have it and --version was passed (most likely to detect "$@"; st=$?
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar) # If it succeeded, we are done.
if test -n "$run"; then test $st -eq 0 && exit 0
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*) # Also exit now if we it failed (or wasn't found), and '--version' was
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # passed; such an option is passed most likely to detect whether the
# We have it, but it failed. # program is present and works.
exit 1 case $2 in --version|--help) exit $st;; esac
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version), # Exit code 63 means version mismatch. This often happens when the user
# try to emulate it. # tries to use an ancient version of a tool on a file that requires a
case "$1" in # minimum version.
aclocal*) if test $st -eq 63; then
echo 1>&2 "\ msg="probably too old"
WARNING: \`$1' is $msg. You should only need it if elif test $st -eq 127; then
you modified \`acinclude.m4' or \`${configure_ac}'. You might want # Program was missing.
to install the \`Automake' and \`Perl' packages. Grab them from msg="missing on your system"
any GNU archive site." else
touch aclocal.m4 # Program was found and executed, but failed. Give up.
;; exit $st
fi
autoconf) perl_URL=http://www.perl.org/
echo 1>&2 "\ flex_URL=http://flex.sourceforge.net/
WARNING: \`$1' is $msg. You should only need it if gnu_software_URL=http://www.gnu.org/software
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader) program_details ()
echo 1>&2 "\ {
WARNING: \`$1' is $msg. You should only need it if case $1 in
you modified \`acconfig.h' or \`${configure_ac}'. You might want aclocal|automake)
to install the \`Autoconf' and \`GNU m4' packages. Grab them echo "The '$1' program is part of the GNU Automake package:"
from any GNU archive site." echo "<$gnu_software_URL/automake>"
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
test -z "$files" && files="config.h" echo "<$gnu_software_URL/autoconf>"
touch_files= echo "<$gnu_software_URL/m4/>"
for f in $files; do echo "<$perl_URL>"
case "$f" in ;;
*:*) touch_files="$touch_files "`echo "$f" | autoconf|autom4te|autoheader)
sed -e 's/^[^:]*://' -e 's/:.*//'`;; echo "The '$1' program is part of the GNU Autoconf package:"
*) touch_files="$touch_files $f.in";; echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac esac
done }
touch $touch_files
;;
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*) automake*)
echo 1>&2 "\ echo "You should only need it if you modified 'Makefile.am' or"
WARNING: \`$1' is $msg. You should only need it if echo "$configure_deps."
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. program_details 'automake'
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;; ;;
aclocal*)
autom4te) echo "You should only need it if you modified 'acinclude.m4' or"
echo 1>&2 "\ echo "$configure_deps."
WARNING: \`$1' is needed, but is $msg. program_details 'aclocal'
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;; ;;
autom4te*)
bison|yacc) echo "You might have modified some maintainer files that require"
echo 1>&2 "\ echo "the 'autom4te' program to be rebuilt."
WARNING: \`$1' $msg. You should only need it if program_details 'autom4te'
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;; ;;
esac bison*|yacc*)
fi echo "You should only need it if you modified a '.y' file."
if [ ! -f y.tab.h ]; then echo "You may want to install the GNU Bison package:"
echo >y.tab.h echo "<$gnu_software_URL/bison/>"
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;; ;;
lex*|flex*)
lex|flex) echo "You should only need it if you modified a '.l' file."
echo 1>&2 "\ echo "You may want to install the Fast Lexical Analyzer package:"
WARNING: \`$1' is $msg. You should only need it if echo "<$flex_URL>"
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;; ;;
esac help2man*)
fi echo "You should only need it if you modified a dependency" \
if [ ! -f lex.yy.c ]; then "of a man page."
echo 'main() { return 0; }' >lex.yy.c echo "You may want to install the GNU Help2man package:"
fi echo "<$gnu_software_URL/help2man/>"
;; ;;
makeinfo*)
help2man) echo "You should only need it if you modified a '.texi' file, or"
echo 1>&2 "\ echo "any other file indirectly affecting the aspect of the manual."
WARNING: \`$1' is $msg. You should only need it if echo "You might want to install the Texinfo package:"
you modified a dependency of a manual page. You may need the echo "<$gnu_software_URL/texinfo/>"
\`Help2man' package in order for those modifications to take echo "The spurious makeinfo call might also be the consequence of"
effect. You can get \`Help2man' from any GNU archive site." echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` echo "<$gnu_software_URL/make/>"
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;; ;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*) *)
echo 1>&2 "\ echo "You might have modified some files without having the proper"
WARNING: \`$1' is needed, and is $msg. echo "tools for further handling them. Check the 'README' file, it"
You might have modified some files without having the echo "often tells you about the needed prerequisites for installing"
proper tools for further handling them. Check the \`README' file, echo "this package. You may also peek at any GNU archive site, in"
it often tells you about the needed prerequisites for installing echo "case some other package contains this missing '$1' program."
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;; ;;
esac esac
}
exit 0 give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$" # time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End: # End:

View File

@ -1,7 +1,7 @@
#! /bin/sh #! /bin/sh
# mkinstalldirs --- make directory hierarchy # mkinstalldirs --- make directory hierarchy
scriptversion=2004-02-15.20 scriptversion=2009-04-28.21; # UTC
# Original author: Noah Friedman <friedman@prep.ai.mit.edu> # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16 # Created: 1993-05-16
@ -11,8 +11,11 @@ scriptversion=2004-02-15.20
# bugs to <bug-automake@gnu.org> or send patches to # bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>. # <automake-patches@gnu.org>.
nl='
'
IFS=" "" $nl"
errstatus=0 errstatus=0
dirmode="" dirmode=
usage="\ usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
@ -27,7 +30,7 @@ while test $# -gt 0 ; do
case $1 in case $1 in
-h | --help | --h*) # -h for help -h | --help | --h*) # -h for help
echo "$usage" echo "$usage"
exit 0 exit $?
;; ;;
-m) # -m PERM arg -m) # -m PERM arg
shift shift
@ -37,7 +40,7 @@ while test $# -gt 0 ; do
;; ;;
--version) --version)
echo "$0 $scriptversion" echo "$0 $scriptversion"
exit 0 exit $?
;; ;;
--) # stop option processing --) # stop option processing
shift shift
@ -78,9 +81,9 @@ case $dirmode in
echo "mkdir -p -- $*" echo "mkdir -p -- $*"
exec mkdir -p -- "$@" exec mkdir -p -- "$@"
else else
# On NextStep and OpenStep, the `mkdir' command does not # On NextStep and OpenStep, the 'mkdir' command does not
# recognize any option. It will interpret all options as # recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already # directories to create, and then abort because '.' already
# exists. # exists.
test -d ./-p && rmdir ./-p test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version test -d ./--version && rmdir ./--version
@ -103,13 +106,21 @@ esac
for file for file
do do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift shift
IFS=$oIFS
pathcomp=
for d for d
do do
pathcomp="$pathcomp$d" test "x$d" = x && continue
pathcomp=$pathcomp$d
case $pathcomp in case $pathcomp in
-*) pathcomp=./$pathcomp ;; -*) pathcomp=./$pathcomp ;;
esac esac
@ -124,7 +135,7 @@ do
else else
if test ! -z "$dirmode"; then if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp" echo "chmod $dirmode $pathcomp"
lasterr="" lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$? chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then if test ! -z "$lasterr"; then
@ -134,7 +145,7 @@ do
fi fi
fi fi
pathcomp="$pathcomp/" pathcomp=$pathcomp/
done done
done done
@ -146,5 +157,6 @@ exit $errstatus
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$" # time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End: # End:

View File

@ -3,11 +3,11 @@
% Load plain if necessary, i.e., if running under initex. % Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
% %
\def\texinfoversion{2012-01-19.16} \def\texinfoversion{2013-02-01.11}
% %
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
% 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
% %
% This texinfo.tex file is free software: you can redistribute it and/or % This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as % modify it under the terms of the GNU General Public License as
@ -24,13 +24,14 @@
% %
% As a special exception, when this file is read by TeX when processing % As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without % a Texinfo source document, you may use the result without
% restriction. (This has been our intent since Texinfo was invented.) % restriction. This Exception is an additional permission under section 7
% of the GNU General Public License, version 3 ("GPLv3").
% %
% Please try the latest version of texinfo.tex before submitting bug % Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from: % reports; you can get the latest version from:
% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
% ftp://tug.org/tex/texinfo.tex % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
% (and all CTAN mirrors, see http://www.ctan.org). % http://www.gnu.org/software/texinfo/ (the Texinfo home page)
% The texinfo.tex in any given distribution could well be out % The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check. % of date, so if that's what you're using, please check.
% %
@ -594,7 +595,7 @@
\def\:{\spacefactor=1000 } \def\:{\spacefactor=1000 }
% @* forces a line break. % @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces} \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
% @/ allows a line break. % @/ allows a line break.
\let\/=\allowbreak \let\/=\allowbreak
@ -887,7 +888,7 @@ where each line of input produces a line of output.}
\def\popthisfilestack{\errthisfilestackempty} \def\popthisfilestack{\errthisfilestackempty}
\def\errthisfilestackempty{\errmessage{Internal error: \def\errthisfilestackempty{\errmessage{Internal error:
the stack of filenames is empty.}} the stack of filenames is empty.}}
%
\def\thisfile{} \def\thisfile{}
% @center line % @center line
@ -895,36 +896,46 @@ where each line of input produces a line of output.}
% %
\parseargdef\center{% \parseargdef\center{%
\ifhmode \ifhmode
\let\next\centerH \let\centersub\centerH
\else \else
\let\next\centerV \let\centersub\centerV
\fi \fi
\next{\hfil \ignorespaces#1\unskip \hfil}% \centersub{\hfil \ignorespaces#1\unskip \hfil}%
\let\centersub\relax % don't let the definition persist, just in case
} }
\def\centerH#1{% \def\centerH#1{{%
{%
\hfil\break \hfil\break
\advance\hsize by -\leftskip \advance\hsize by -\leftskip
\advance\hsize by -\rightskip \advance\hsize by -\rightskip
\line{#1}% \line{#1}%
\break \break
}% }}
%
\newcount\centerpenalty
\def\centerV#1{%
% The idea here is the same as in \startdefun, \cartouche, etc.: if
% @center is the first thing after a section heading, we need to wipe
% out the negative parskip inserted by \sectionheading, but still
% prevent a page break here.
\centerpenalty = \lastpenalty
\ifnum\centerpenalty>10000 \vskip\parskip \fi
\ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
\line{\kern\leftskip #1\kern\rightskip}%
} }
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
% @sp n outputs n lines of vertical space % @sp n outputs n lines of vertical space
%
\parseargdef\sp{\vskip #1\baselineskip} \parseargdef\sp{\vskip #1\baselineskip}
% @comment ...line which is ignored... % @comment ...line which is ignored...
% @c is the same as @comment % @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment % @ignore ... @end ignore is another way to write a comment
%
\def\comment{\begingroup \catcode`\^^M=\other% \def\comment{\begingroup \catcode`\^^M=\other%
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
\commentxxx} \commentxxx}
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
%
\let\c=\comment \let\c=\comment
% @paragraphindent NCHARS % @paragraphindent NCHARS
@ -1107,7 +1118,7 @@ where each line of input produces a line of output.}
% #1 is a control sequence in which to do the replacements, % #1 is a control sequence in which to do the replacements,
% which we \xdef. % which we \xdef.
\def\txiescapepdf#1{% \def\txiescapepdf#1{%
\ifx\pdfescapestring\relax \ifx\pdfescapestring\thisisundefined
% No primitive available; should we give a warning or log? % No primitive available; should we give a warning or log?
% Many times it won't matter. % Many times it won't matter.
\else \else
@ -1173,8 +1184,8 @@ output) for that.)}
% %
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
\def\dopdfimage#1#2#3{% \def\dopdfimage#1#2#3{%
\def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
\def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
% %
% pdftex (and the PDF format) support .pdf, .png, .jpg (among % pdftex (and the PDF format) support .pdf, .png, .jpg (among
% others). Let's try in that order, PDF first since if % others). Let's try in that order, PDF first since if
@ -1212,8 +1223,8 @@ output) for that.)}
\else \else
\immediate\pdfximage \immediate\pdfximage
\fi \fi
\ifdim \wd0 >0pt width \imagewidth \fi \ifdim \wd0 >0pt width \pdfimagewidth \fi
\ifdim \wd2 >0pt height \imageheight \fi \ifdim \wd2 >0pt height \pdfimageheight \fi
\ifnum\pdftexversion<13 \ifnum\pdftexversion<13
#1.\pdfimgext #1.\pdfimgext
\else \else
@ -1357,12 +1368,17 @@ output) for that.)}
\def\skipspaces#1{\def\PP{#1}\def\D{|}% \def\skipspaces#1{\def\PP{#1}\def\D{|}%
\ifx\PP\D\let\nextsp\relax \ifx\PP\D\let\nextsp\relax
\else\let\nextsp\skipspaces \else\let\nextsp\skipspaces
\ifx\p\space\else\addtokens{\filename}{\PP}% \addtokens{\filename}{\PP}%
\advance\filenamelength by 1 \advance\filenamelength by 1
\fi \fi
\fi
\nextsp} \nextsp}
\def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} \def\getfilename#1{%
\filenamelength=0
% If we don't expand the argument now, \skipspaces will get
% snagged on things like "@value{foo}".
\edef\temp{#1}%
\expandafter\skipspaces\temp|\relax
}
\ifnum\pdftexversion < 14 \ifnum\pdftexversion < 14
\let \startlink \pdfannotlink \let \startlink \pdfannotlink
\else \else
@ -1459,9 +1475,6 @@ output) for that.)}
\def\ttsl{\setfontstyle{ttsl}} \def\ttsl{\setfontstyle{ttsl}}
% Default leading.
\newdimen\textleading \textleading = 13.2pt
% Set the baselineskip to #1, and the lineskip and strut size % Set the baselineskip to #1, and the lineskip and strut size
% correspondingly. There is no deep meaning behind these magic numbers % correspondingly. There is no deep meaning behind these magic numbers
% used as factors; they just match (closely enough) what Knuth defined. % used as factors; they just match (closely enough) what Knuth defined.
@ -1473,6 +1486,7 @@ output) for that.)}
% can get a sort of poor man's double spacing by redefining this. % can get a sort of poor man's double spacing by redefining this.
\def\baselinefactor{1} \def\baselinefactor{1}
% %
\newdimen\textleading
\def\setleading#1{% \def\setleading#1{%
\dimen0 = #1\relax \dimen0 = #1\relax
\normalbaselineskip = \baselinefactor\dimen0 \normalbaselineskip = \baselinefactor\dimen0
@ -1745,18 +1759,24 @@ end
\fi\fi \fi\fi
% Set the font macro #1 to the font named #2, adding on the % Set the font macro #1 to the font named \fontprefix#2.
% specified font prefix (normally `cm').
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
% empty to omit). % Example:
% #1 = \textrm
% #2 = \rmshape
% #3 = 10
% #4 = \mainmagstep
% #5 = OT1
%
\def\setfont#1#2#3#4#5{% \def\setfont#1#2#3#4#5{%
\font#1=\fontprefix#2#3 scaled #4 \font#1=\fontprefix#2#3 scaled #4
\csname cmap#5\endcsname#1% \csname cmap#5\endcsname#1%
} }
% This is what gets called when #5 of \setfont is empty. % This is what gets called when #5 of \setfont is empty.
\let\cmap\gobble \let\cmap\gobble
% emacs-page end of cmaps %
% (end of cmaps)
% Use cm as the default font prefix. % Use cm as the default font prefix.
% To specify the font prefix, you must define \fontprefix % To specify the font prefix, you must define \fontprefix
@ -1766,7 +1786,7 @@ end
\fi \fi
% Support font families that don't use the same naming scheme as CM. % Support font families that don't use the same naming scheme as CM.
\def\rmshape{r} \def\rmshape{r}
\def\rmbshape{bx} %where the normal face is bold \def\rmbshape{bx} % where the normal face is bold
\def\bfshape{b} \def\bfshape{b}
\def\bxshape{bx} \def\bxshape{bx}
\def\ttshape{tt} \def\ttshape{tt}
@ -1781,8 +1801,7 @@ end
\def\scshape{csc} \def\scshape{csc}
\def\scbshape{csc} \def\scbshape{csc}
% Definitions for a main text size of 11pt. This is the default in % Definitions for a main text size of 11pt. (The default in Texinfo.)
% Texinfo.
% %
\def\definetextfontsizexi{% \def\definetextfontsizexi{%
% Text fonts (11.2pt, magstep1). % Text fonts (11.2pt, magstep1).
@ -1907,7 +1926,7 @@ end
\textleading = 13.2pt % line spacing for 11pt CM \textleading = 13.2pt % line spacing for 11pt CM
\textfonts % reset the current fonts \textfonts % reset the current fonts
\rm \rm
} % end of 11pt text font size definitions } % end of 11pt text font size definitions, \definetextfontsizexi
% Definitions to make the main text be 10pt Computer Modern, with % Definitions to make the main text be 10pt Computer Modern, with
@ -2039,7 +2058,7 @@ end
\textleading = 12pt % line spacing for 10pt CM \textleading = 12pt % line spacing for 10pt CM
\textfonts % reset the current fonts \textfonts % reset the current fonts
\rm \rm
} % end of 10pt text font size definitions } % end of 10pt text font size definitions, \definetextfontsizex
% We provide the user-level command % We provide the user-level command
@ -2254,8 +2273,6 @@ end
\gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteleft{\let`\codequoteleft}
\gdef\markupsetcodequoteright{\let'\codequoteright} \gdef\markupsetcodequoteright{\let'\codequoteright}
\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
} }
\let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuplqcode \markupsetcodequoteleft
@ -2264,6 +2281,9 @@ end
\let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuplqexample \markupsetcodequoteleft
\let\markupsetuprqexample \markupsetcodequoteright \let\markupsetuprqexample \markupsetcodequoteright
% %
\let\markupsetuplqkbd \markupsetcodequoteleft
\let\markupsetuprqkbd \markupsetcodequoteright
%
\let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuplqsamp \markupsetcodequoteleft
\let\markupsetuprqsamp \markupsetcodequoteright \let\markupsetuprqsamp \markupsetcodequoteright
% %
@ -2273,8 +2293,6 @@ end
\let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuplqverbatim \markupsetcodequoteleft
\let\markupsetuprqverbatim \markupsetcodequoteright \let\markupsetuprqverbatim \markupsetcodequoteright
\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
% Allow an option to not use regular directed right quote/apostrophe % Allow an option to not use regular directed right quote/apostrophe
% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
% The undirected quote is ugly, so don't make it the default, but it % The undirected quote is ugly, so don't make it the default, but it
@ -2364,8 +2382,7 @@ end
\aftersmartic \aftersmartic
} }
% like \smartslanted except unconditionally uses \ttsl, and no ic. % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
% @var is set to this for defun arguments.
\def\ttslanted#1{{\ttsl #1}} \def\ttslanted#1{{\ttsl #1}}
% @cite is like \smartslanted except unconditionally use \sl. We never want % @cite is like \smartslanted except unconditionally use \sl. We never want
@ -2430,34 +2447,12 @@ end
% @samp. % @samp.
\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
% definition of @key that produces a lozenge. Doesn't adjust to text size. % @indicateurl is \samp, that is, with quotes.
%\setfont\keyrm\rmshape{8}{1000}{OT1} \let\indicateurl=\samp
%\font\keysy=cmsy9
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
% \vbox{\hrule\kern-0.4pt
% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
% \kern-0.4pt\hrule}%
% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
% definition of @key with no lozenge. If the current font is already % @code (and similar) prints in typewriter, but with spaces the same
% monospace, don't change it; that way, we respect @kbdinputstyle. But % size as normal in the surrounding text, without hyphenation, etc.
% if it isn't monospace, then use \tt. % This is a subroutine for that.
%
\def\key#1{{\setupmarkupstyle{key}%
\nohyphenation
\ifmonospace\else\tt\fi
#1}\null}
% ctrl is no longer a Texinfo command.
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
% @file, @option are the same as @samp.
\let\file=\samp
\let\option=\samp
% @code is a modification of @t,
% which makes spaces the same size as normal in the surrounding text.
\def\tclose#1{% \def\tclose#1{%
{% {%
% Change normal interword space to be same as for the current font. % Change normal interword space to be same as for the current font.
@ -2482,7 +2477,7 @@ end
% We *must* turn on hyphenation at `-' and `_' in @code. % We *must* turn on hyphenation at `-' and `_' in @code.
% Otherwise, it is too hard to avoid overfull hboxes % Otherwise, it is too hard to avoid overfull hboxes
% in the Emacs manual, the Library manual, etc. % in the Emacs manual, the Library manual, etc.
%
% Unfortunately, TeX uses one parameter (\hyphenchar) to control % Unfortunately, TeX uses one parameter (\hyphenchar) to control
% both hyphenation at - and hyphenation within words. % both hyphenation at - and hyphenation within words.
% We must therefore turn them both off (\tclose does that) % We must therefore turn them both off (\tclose does that)
@ -2501,7 +2496,7 @@ end
\let-\codedash \let-\codedash
\let_\codeunder \let_\codeunder
\else \else
\let-\realdash \let-\normaldash
\let_\realunder \let_\realunder
\fi \fi
\codex \codex
@ -2510,7 +2505,7 @@ end
\def\codex #1{\tclose{#1}\endgroup} \def\codex #1{\tclose{#1}\endgroup}
\def\realdash{-} \def\normaldash{-}
\def\codedash{-\discretionary{}{}{}} \def\codedash{-\discretionary{}{}{}}
\def\codeunder{% \def\codeunder{%
% this is all so @math{@code{var_name}+1} can work. In math mode, _ % this is all so @math{@code{var_name}+1} can work. In math mode, _
@ -2525,9 +2520,9 @@ end
} }
% An additional complication: the above will allow breaks after, e.g., % An additional complication: the above will allow breaks after, e.g.,
% each of the four underscores in __typeof__. This is undesirable in % each of the four underscores in __typeof__. This is bad.
% some manuals, especially if they don't have long identifiers in % @allowcodebreaks provides a document-level way to turn breaking at -
% general. @allowcodebreaks provides a way to control this. % and _ on and off.
% %
\newif\ifallowcodebreaks \allowcodebreakstrue \newif\ifallowcodebreaks \allowcodebreakstrue
@ -2546,6 +2541,13 @@ end
\fi\fi \fi\fi
} }
% For @command, @env, @file, @option quotes seem unnecessary,
% so use \code rather than \samp.
\let\command=\code
\let\env=\code
\let\file=\code
\let\option=\code
% @uref (abbreviation for `urlref') takes an optional (comma-separated) % @uref (abbreviation for `urlref') takes an optional (comma-separated)
% second argument specifying the text to display and an optional third % second argument specifying the text to display and an optional third
% arg as text to display instead of (rather than in addition to) the url % arg as text to display instead of (rather than in addition to) the url
@ -2692,10 +2694,6 @@ end
\let\email=\uref \let\email=\uref
\fi \fi
% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.
\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
% `example' (@kbd uses ttsl only inside of @example and friends), % `example' (@kbd uses ttsl only inside of @example and friends),
% or `code' (@kbd uses normal tty font always). % or `code' (@kbd uses normal tty font always).
@ -2719,16 +2717,36 @@ end
% Default is `distinct'. % Default is `distinct'.
\kbdinputstyle distinct \kbdinputstyle distinct
\def\xkey{\key} % @kbd is like @code, except that if the argument is just one @key command,
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% % then @kbd has no effect.
\ifx\one\xkey\ifx\threex\three \key{#2}% \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. \def\xkey{\key}
\let\indicateurl=\code \def\kbdsub#1#2#3\par{%
\let\env=\code \def\one{#1}\def\three{#3}\def\threex{??}%
\let\command=\code \ifx\one\xkey\ifx\threex\three \key{#2}%
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
}
% definition of @key that produces a lozenge. Doesn't adjust to text size.
%\setfont\keyrm\rmshape{8}{1000}{OT1}
%\font\keysy=cmsy9
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
% \vbox{\hrule\kern-0.4pt
% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
% \kern-0.4pt\hrule}%
% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
% definition of @key with no lozenge. If the current font is already
% monospace, don't change it; that way, we respect @kbdinputstyle. But
% if it isn't monospace, then use \tt.
%
\def\key#1{{\setupmarkupstyle{key}%
\nohyphenation
\ifmonospace\else\tt\fi
#1}\null}
% @clicksequence{File @click{} Open ...} % @clicksequence{File @click{} Open ...}
\def\clicksequence#1{\begingroup #1\endgroup} \def\clicksequence#1{\begingroup #1\endgroup}
@ -2836,6 +2854,9 @@ end
} }
} }
% ctrl is no longer a Texinfo command, but leave this definition for fun.
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
% except specified as a normal braced arg, so no newlines to worry about. % except specified as a normal braced arg, so no newlines to worry about.
@ -3126,6 +3147,10 @@ end
% hopefully nobody will notice/care. % hopefully nobody will notice/care.
\edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
\edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
\ifmonospace
% typewriter:
\font\thisecfont = ectt\ecsize \space at \nominalsize
\else
\ifx\curfontstyle\bfstylename \ifx\curfontstyle\bfstylename
% bold: % bold:
\font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
@ -3133,6 +3158,7 @@ end
% regular: % regular:
\font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
\fi \fi
\fi
\thisecfont \thisecfont
} }
@ -3244,6 +3270,20 @@ end
\finishedtitlepagetrue \finishedtitlepagetrue
} }
% Settings used for typesetting titles: no hyphenation, no indentation,
% don't worry much about spacing, ragged right. This should be used
% inside a \vbox, and fonts need to be set appropriately first. Because
% it is always used for titles, nothing else, we call \rmisbold. \par
% should be specified before the end of the \vbox, since a vbox is a group.
%
\def\raggedtitlesettings{%
\rmisbold
\hyphenpenalty=10000
\parindent=0pt
\tolerance=5000
\ptexraggedright
}
% Macros to be used within @titlepage: % Macros to be used within @titlepage:
\let\subtitlerm=\tenrm \let\subtitlerm=\tenrm
@ -3251,7 +3291,7 @@ end
\parseargdef\title{% \parseargdef\title{%
\checkenv\titlepage \checkenv\titlepage
\leftline{\titlefonts\rmisbold #1} \vbox{\titlefonts \raggedtitlesettings #1\par}%
% print a rule at the page bottom also. % print a rule at the page bottom also.
\finishedtitlepagefalse \finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt \vskip4pt \hrule height 4pt width \hsize \vskip4pt
@ -4148,7 +4188,7 @@ end
% ..., but we might end up with active ones in the argument if % ..., but we might end up with active ones in the argument if
% we're called from @code, as @code{@value{foo-bar_}}, though. % we're called from @code, as @code{@value{foo-bar_}}, though.
% So \let them to their normal equivalents. % So \let them to their normal equivalents.
\let-\realdash \let_\normalunderscore \let-\normaldash \let_\normalunderscore
} }
} }
@ -4188,7 +4228,7 @@ end
} }
\def\ifsetfail{\doignore{ifset}} \def\ifsetfail{\doignore{ifset}}
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % @ifclear VAR ... @end executes the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear. % defined with @set, or has been undefined with @clear.
% %
% The `\else' inside the `\doifset' parameter is a trick to reuse the % The `\else' inside the `\doifset' parameter is a trick to reuse the
@ -4199,6 +4239,35 @@ end
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
\def\ifclearfail{\doignore{ifclear}} \def\ifclearfail{\doignore{ifclear}}
% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
% without the @) is in fact defined. We can only feasibly check at the
% TeX level, so something like `mathcode' is going to considered
% defined even though it is not a Texinfo command.
%
\makecond{ifcommanddefined}
\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
%
\def\doifcmddefined#1#2{{%
\makevalueexpandable
\let\next=\empty
\expandafter\ifx\csname #2\endcsname\relax
#1% If not defined, \let\next as above.
\fi
\expandafter
}\next
}
\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
\makecond{ifcommandnotdefined}
\def\ifcommandnotdefined{%
\parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
% Set the `txicommandconditionals' variable, so documents have a way to
% test if the @ifcommand...defined conditionals are available.
\set txicommandconditionals
% @dircategory CATEGORY -- specify a category of the dir file % @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX. % which this file should belong to. Ignore this in TeX.
\let\dircategory=\comment \let\dircategory=\comment
@ -4435,6 +4504,7 @@ end
\definedummyword\guillemetright \definedummyword\guillemetright
\definedummyword\guilsinglleft \definedummyword\guilsinglleft
\definedummyword\guilsinglright \definedummyword\guilsinglright
\definedummyword\lbracechar
\definedummyword\leq \definedummyword\leq
\definedummyword\minus \definedummyword\minus
\definedummyword\ogonek \definedummyword\ogonek
@ -4447,6 +4517,7 @@ end
\definedummyword\quoteleft \definedummyword\quoteleft
\definedummyword\quoteright \definedummyword\quoteright
\definedummyword\quotesinglbase \definedummyword\quotesinglbase
\definedummyword\rbracechar
\definedummyword\result \definedummyword\result
\definedummyword\textdegree \definedummyword\textdegree
% %
@ -4498,6 +4569,7 @@ end
\definedummyword\t \definedummyword\t
% %
% Commands that take arguments. % Commands that take arguments.
\definedummyword\abbr
\definedummyword\acronym \definedummyword\acronym
\definedummyword\anchor \definedummyword\anchor
\definedummyword\cite \definedummyword\cite
@ -4509,7 +4581,9 @@ end
\definedummyword\emph \definedummyword\emph
\definedummyword\env \definedummyword\env
\definedummyword\file \definedummyword\file
\definedummyword\image
\definedummyword\indicateurl \definedummyword\indicateurl
\definedummyword\inforef
\definedummyword\kbd \definedummyword\kbd
\definedummyword\key \definedummyword\key
\definedummyword\math \definedummyword\math
@ -4556,7 +4630,10 @@ end
% content at all. So for index sorting, we map @{ and @} to strings % content at all. So for index sorting, we map @{ and @} to strings
% starting with |, since that ASCII character is between ASCII { and }. % starting with |, since that ASCII character is between ASCII { and }.
\def\{{|a}% \def\{{|a}%
\def\lbracechar{|a}%
%
\def\}{|b}% \def\}{|b}%
\def\rbracechar{|b}%
% %
% Non-English letters. % Non-English letters.
\def\AA{AA}% \def\AA{AA}%
@ -4732,10 +4809,9 @@ end
% %
% ..., ready, GO: % ..., ready, GO:
% %
\def\safewhatsit#1{% \def\safewhatsit#1{\ifhmode
\ifhmode
#1% #1%
\else \else
% \lastskip and \lastpenalty cannot both be nonzero simultaneously. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
\whatsitskip = \lastskip \whatsitskip = \lastskip
\edef\lastskipmacro{\the\lastskip}% \edef\lastskipmacro{\the\lastskip}%
@ -4759,7 +4835,6 @@ end
% to re-insert the same penalty (values >10000 are used for various % to re-insert the same penalty (values >10000 are used for various
% signals); since we just inserted a non-discardable item, any % signals); since we just inserted a non-discardable item, any
% following glue (such as a \parskip) would be a breakpoint. For example: % following glue (such as a \parskip) would be a breakpoint. For example:
%
% @deffn deffn-whatever % @deffn deffn-whatever
% @vindex index-whatever % @vindex index-whatever
% Description. % Description.
@ -4772,8 +4847,7 @@ end
% (the whatsit from the \write), so we must insert a \nobreak. % (the whatsit from the \write), so we must insert a \nobreak.
\nobreak\vskip\whatsitskip \nobreak\vskip\whatsitskip
\fi \fi
\fi \fi}
}
% The index entry written in the file actually looks like % The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic} % \entry {sortstring}{page}{topic}
@ -5520,14 +5594,6 @@ end
% Define @majorheading, @heading and @subheading % Define @majorheading, @heading and @subheading
% NOTE on use of \vbox for chapter headings, section headings, and such:
% 1) We use \vbox rather than the earlier \line to permit
% overlong headings to fold.
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
% heading is obnoxious; this forbids it.
% 3) Likewise, headings look best if no \parindent is used, and
% if justification is not attempted. Hence \raggedright.
\def\majorheading{% \def\majorheading{%
{\advance\chapheadingskip by 10pt \chapbreak }% {\advance\chapheadingskip by 10pt \chapbreak }%
\parsearg\chapheadingzzz \parsearg\chapheadingzzz
@ -5535,10 +5601,8 @@ end
\def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
\def\chapheadingzzz#1{% \def\chapheadingzzz#1{%
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \vbox{\chapfonts \raggedtitlesettings #1\par}%
\parindent=0pt\ptexraggedright \nobreak\bigskip \nobreak
\rmisbold #1\hfill}}%
\bigskip \par\penalty 200\relax
\suppressfirstparagraphindent \suppressfirstparagraphindent
} }
@ -5697,8 +5761,7 @@ end
% %
% Typeset the actual heading. % Typeset the actual heading.
\nobreak % Avoid page breaks at the interline glue. \nobreak % Avoid page breaks at the interline glue.
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
\hangindent=\wd0 \centerparametersmaybe
\unhbox0 #1\par}% \unhbox0 #1\par}%
}% }%
\nobreak\bigskip % no page break after a chapter title \nobreak\bigskip % no page break after a chapter title
@ -5720,18 +5783,18 @@ end
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
% %
\def\unnchfopen #1{% \def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \chapoddpage
\parindent=0pt\ptexraggedright \vbox{\chapfonts \raggedtitlesettings #1\par}%
\rmisbold #1\hfill}}\bigskip \par\nobreak \nobreak\bigskip\nobreak
} }
\def\chfopen #1#2{\chapoddpage {\chapfonts \def\chfopen #1#2{\chapoddpage {\chapfonts
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
\par\penalty 5000 % \par\penalty 5000 %
} }
\def\centerchfopen #1{% \def\centerchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \chapoddpage
\parindent=0pt \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
\hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak \nobreak\bigskip \nobreak
} }
\def\CHAPFopen{% \def\CHAPFopen{%
\global\let\chapmacro=\chfopen \global\let\chapmacro=\chfopen
@ -5876,14 +5939,15 @@ end
% %
% We'll almost certainly start a paragraph next, so don't let that % We'll almost certainly start a paragraph next, so don't let that
% glue accumulate. (Not a breakpoint because it's preceded by a % glue accumulate. (Not a breakpoint because it's preceded by a
% discardable item.) % discardable item.) However, when a paragraph is not started next
% (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
% or the negative glue will cause weirdly wrong output, typically
% obscuring the section heading with something else.
\vskip-\parskip \vskip-\parskip
% %
% This is purely so the last item on the list is a known \penalty > % This is so the last item on the main vertical list is a known
% 10000. This is so \startdefun can avoid allowing breakpoints after % \penalty > 10000, so \startdefun, etc., can recognize the situation
% section headings. Otherwise, it would insert a valid breakpoint between: % and do the needful.
% @section sec-whatever
% @deffn def-whatever
\penalty 10001 \penalty 10001
} }
@ -6303,7 +6367,7 @@ end
% If this cartouche directly follows a sectioning command, we need the % If this cartouche directly follows a sectioning command, we need the
% \parskip glue (backspaced over by default) or the cartouche can % \parskip glue (backspaced over by default) or the cartouche can
% collide with the section heading. % collide with the section heading.
\ifnum\lastpenalty>10000 \vskip\parskip \fi \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
% %
\vbox\bgroup \vbox\bgroup
\baselineskip=0pt\parskip=0pt\lineskip=0pt \baselineskip=0pt\parskip=0pt\lineskip=0pt
@ -6496,16 +6560,9 @@ end
\makedispenvdef{quotation}{\quotationstart} \makedispenvdef{quotation}{\quotationstart}
% %
\def\quotationstart{% \def\quotationstart{%
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \indentedblockstart % same as \indentedblock, but increase right margin too.
\parindent=0pt
%
% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
\ifx\nonarrowing\relax \ifx\nonarrowing\relax
\advance\leftskip by \lispnarrowing
\advance\rightskip by \lispnarrowing \advance\rightskip by \lispnarrowing
\exdentamount = \lispnarrowing
\else
\let\nonarrowing = \relax
\fi \fi
\parsearg\quotationlabel \parsearg\quotationlabel
} }
@ -6531,6 +6588,32 @@ end
\fi \fi
} }
% @indentedblock is like @quotation, but indents only on the left and
% has no optional argument.
%
\makedispenvdef{indentedblock}{\indentedblockstart}
%
\def\indentedblockstart{%
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
\parindent=0pt
%
% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
\ifx\nonarrowing\relax
\advance\leftskip by \lispnarrowing
\exdentamount = \lispnarrowing
\else
\let\nonarrowing = \relax
\fi
}
% Keep a nonzero parskip for the environment, since we're doing normal filling.
%
\def\Eindentedblock{%
\par
{\parskip=0pt \afterenvbreak}%
}
\def\Esmallindentedblock{\Eindentedblock}
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
% If we want to allow any <char> as delimiter, % If we want to allow any <char> as delimiter,
@ -7009,7 +7092,10 @@ end
\df \sl \hyphenchar\font=0 \df \sl \hyphenchar\font=0
% %
% On the other hand, if an argument has two dashes (for instance), we % On the other hand, if an argument has two dashes (for instance), we
% want a way to get ttsl. Let's try @var for that. % want a way to get ttsl. We used to recommend @var for that, so
% leave the code in, but it's strange for @var to lead to typewriter.
% Nowadays we recommend @code, since the difference between a ttsl hyphen
% and a tt hyphen is pretty tiny. @code also disables ?` !`.
\def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
#1% #1%
\sl\hyphenchar\font=45 \sl\hyphenchar\font=45
@ -7793,7 +7879,7 @@ end
\fi\fi \fi\fi
} }
%
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed % the node name, #2 the name of the Info cross-reference, #3 the printed
% node name, #4 the name of the Info file, #5 the name of the printed % node name, #4 the name of the Info file, #5 the name of the printed
@ -7803,16 +7889,21 @@ end
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]}
% %
\newbox\topbox \newbox\toprefbox
\newbox\printedrefnamebox \newbox\printedrefnamebox
\newbox\infofilenamebox
\newbox\printedmanualbox \newbox\printedmanualbox
% %
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
\unsepspaces \unsepspaces
% %
% Get args without leading/trailing spaces.
\def\printedrefname{\ignorespaces #3}% \def\printedrefname{\ignorespaces #3}%
\setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
% %
\def\infofilename{\ignorespaces #4}%
\setbox\infofilenamebox = \hbox{\infofilename\unskip}%
%
\def\printedmanual{\ignorespaces #5}% \def\printedmanual{\ignorespaces #5}%
\setbox\printedmanualbox = \hbox{\printedmanual\unskip}% \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
% %
@ -7845,12 +7936,20 @@ end
\ifpdf \ifpdf
{\indexnofonts {\indexnofonts
\turnoffactive \turnoffactive
\makevalueexpandable
% This expands tokens, so do it after making catcode changes, so _ % This expands tokens, so do it after making catcode changes, so _
% etc. don't get their TeX definitions. % etc. don't get their TeX definitions. This ignores all spaces in
% #4, including (wrongly) those in the middle of the filename.
\getfilename{#4}% \getfilename{#4}%
% %
% This (wrongly) does not take account of leading or trailing
% spaces in #1, which should be ignored.
\edef\pdfxrefdest{#1}% \edef\pdfxrefdest{#1}%
\txiescapepdf\pdfxrefdest \ifx\pdfxrefdest\empty
\def\pdfxrefdest{Top}% no empty targets
\else
\txiescapepdf\pdfxrefdest % escape PDF special chars
\fi
% %
\leavevmode \leavevmode
\startlink attr{/Border [0 0 0]}% \startlink attr{/Border [0 0 0]}%
@ -7883,7 +7982,7 @@ end
\printedrefname \printedrefname
\fi \fi
% %
% if the user also gave the printed manual name (fifth arg), append % If the user also gave the printed manual name (fifth arg), append
% "in MANUALNAME". % "in MANUALNAME".
\ifdim \wd\printedmanualbox > 0pt \ifdim \wd\printedmanualbox > 0pt
\space \putwordin{} \cite{\printedmanual}% \space \putwordin{} \cite{\printedmanual}%
@ -7898,32 +7997,20 @@ end
% this is a loss. Therefore, we give the text of the node name % this is a loss. Therefore, we give the text of the node name
% again, so it is as if TeX is seeing it for the first time. % again, so it is as if TeX is seeing it for the first time.
% %
% Cross-manual reference. Only include the "Section ``foo'' in" if
% the foo is neither missing or Top. Thus, @xref{,,,foo,The Foo Manual}
% outputs simply "see The Foo Manual".
\ifdim \wd\printedmanualbox > 0pt \ifdim \wd\printedmanualbox > 0pt
% What is the 7sp about? The idea is that we also want to omit % Cross-manual reference with a printed manual name.
% the Section part if we would be printing "Top", since they are
% clearly trying to refer to the whole manual. But, this being
% TeX, we can't easily compare strings while ignoring the possible
% spaces before and after in the input. By adding the arbitrary
% 7sp, we make it much less likely that a real node name would
% happen to have the same width as "Top" (e.g., in a monospaced font).
% I hope it will never happen in practice.
% %
% For the same basic reason, we retypeset the "Top" at every \crossmanualxref{\cite{\printedmanual\unskip}}%
% reference, since the current font is indeterminate. %
\else\ifdim \wd\infofilenamebox > 0pt
% Cross-manual reference with only an info filename (arg 4), no
% printed manual name (arg 5). This is essentially the same as
% the case above; we output the filename, since we have nothing else.
%
\crossmanualxref{\code{\infofilename\unskip}}%
% %
\setbox\topbox = \hbox{Top\kern7sp}%
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
\ifdim \wd2 > 7sp
\ifdim \wd2 = \wd\topbox \else
\putwordSection{} ``\printedrefname'' \putwordin{}\space
\fi
\fi
\cite{\printedmanual}%
\else \else
% Reference in this manual. % Reference within this manual.
% %
% _ (for example) has to be the character _ for the purposes of the % _ (for example) has to be the character _ for the purposes of the
% control sequence corresponding to the node, but it has to expand % control sequence corresponding to the node, but it has to expand
@ -7944,11 +8031,37 @@ end
% %
% output the `page 3'. % output the `page 3'.
\turnoffactive \putwordpage\tie\refx{#1-pg}{}% \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
\fi \fi\fi
\fi \fi
\endlink \endlink
\endgroup} \endgroup}
% Output a cross-manual xref to #1. Used just above (twice).
%
% Only include the text "Section ``foo'' in" if the foo is neither
% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
% "see The Foo Manual", the idea being to refer to the whole manual.
%
% But, this being TeX, we can't easily compare our node name against the
% string "Top" while ignoring the possible spaces before and after in
% the input. By adding the arbitrary 7sp below, we make it much less
% likely that a real node name would have the same width as "Top" (e.g.,
% in a monospaced font). Hopefully it will never happen in practice.
%
% For the same basic reason, we retypeset the "Top" at every
% reference, since the current font is indeterminate.
%
\def\crossmanualxref#1{%
\setbox\toprefbox = \hbox{Top\kern7sp}%
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
\ifdim \wd2 > 7sp % nonempty?
\ifdim \wd2 = \wd\toprefbox \else % same as Top?
\putwordSection{} ``\printedrefname'' \putwordin{}\space
\fi
\fi
#1%
}
% This macro is called from \xrefX for the `[nodename]' part of xref % This macro is called from \xrefX for the `[nodename]' part of xref
% output. It's a separate macro only so it can be changed more easily, % output. It's a separate macro only so it can be changed more easily,
% since square brackets don't work well in some documents. Particularly % since square brackets don't work well in some documents. Particularly
@ -8316,7 +8429,7 @@ end
it from ftp://tug.org/tex/epsf.tex.} it from ftp://tug.org/tex/epsf.tex.}
% %
\def\image#1{% \def\image#1{%
\ifx\epsfbox\thisiundefined \ifx\epsfbox\thisisundefined
\ifwarnednoepsf \else \ifwarnednoepsf \else
\errhelp = \noepsfhelp \errhelp = \noepsfhelp
\errmessage{epsf.tex not found, images will be ignored}% \errmessage{epsf.tex not found, images will be ignored}%
@ -8340,6 +8453,13 @@ end
% If the image is by itself, center it. % If the image is by itself, center it.
\ifvmode \ifvmode
\imagevmodetrue \imagevmodetrue
\else \ifx\centersub\centerV
% for @center @image, we need a vbox so we can have our vertical space
\imagevmodetrue
\vbox\bgroup % vbox has better behavior than vtop herev
\fi\fi
%
\ifimagevmode
\nobreak\medskip \nobreak\medskip
% Usually we'll have text after the image which will insert % Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space % \parskip glue, so insert it here too to equalize the space
@ -8349,9 +8469,13 @@ end
\fi \fi
% %
% Leave vertical mode so that indentation from an enclosing % Leave vertical mode so that indentation from an enclosing
% environment such as @quotation is respected. On the other hand, if % environment such as @quotation is respected.
% it's at the top level, we don't want the normal paragraph indentation. % However, if we're at the top level, we don't want the
\noindent % normal paragraph indentation.
% On the other hand, if we are in the case of @center @image, we don't
% want to start a paragraph, which will create a hsize-width box and
% eradicate the centering.
\ifx\centersub\centerV\else \noindent \fi
% %
% Output the image. % Output the image.
\ifpdf \ifpdf
@ -8363,7 +8487,10 @@ end
\epsfbox{#1.eps}% \epsfbox{#1.eps}%
\fi \fi
% %
\ifimagevmode \medskip \fi % space after the standalone image \ifimagevmode
\medskip % space after a standalone image
\fi
\ifx\centersub\centerV \egroup \fi
\endgroup} \endgroup}
@ -9866,9 +9993,12 @@ directory should work if nowhere else does.}
@gdef@otherbackslash{@let\=@realbackslash} @gdef@otherbackslash{@let\=@realbackslash}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% the literal character `\'. % the literal character `\'. Also revert - to its normal character, in
% case the active - from code has slipped in.
% %
@def@normalturnoffactive{% {@catcode`- = @active
@gdef@normalturnoffactive{%
@let-=@normaldash
@let"=@normaldoublequote @let"=@normaldoublequote
@let$=@normaldollar %$ font-lock fix @let$=@normaldollar %$ font-lock fix
@let+=@normalplus @let+=@normalplus
@ -9882,6 +10012,7 @@ directory should work if nowhere else does.}
@markupsetuplqdefault @markupsetuplqdefault
@markupsetuprqdefault @markupsetuprqdefault
@unsepspaces @unsepspaces
}
} }
% Make _ and + \other characters, temporarily. % Make _ and + \other characters, temporarily.