2 # shdeps.sh: Generate OS dependency fixups, for 'groff' shell scripts
4 # Copyright (C) 2004-2020 Free Software Foundation, Inc.
5 # Written by Keith Marshall (keith.d.marshall@ntlworld.com)
7 # Invoked only by 'make', as:
8 # $(SHELL) shdeps.sh "$(RT_SEP)" "$(SH_SEP)" "$(bindir)" > shdeps.sed
10 # This file is part of groff.
12 # groff is free software; you can redistribute it and/or modify it under
13 # the terms of the GNU General Public License as published by the Free
14 # Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License
23 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 # shdeps.sed: Script generated automatically by 'make' -- do not modify!
29 /@GROFF_BIN_PATH_SETUP@/c\\
34 # 'PATH_SEPARATOR' is ':' both at 'groff' run time, and in 'make',
35 # implying an implementation which is completely POSIX compliant.
36 # Simply apply the 'GROFF_BIN_PATH' and 'PATH_SEPARATOR' values
37 # determined by 'configure', in all cases.
41 GROFF_RUNTIME="\${GROFF_BIN_PATH=$3}:"
42 /@PATH_SEARCH_SETUP@/d
46 # 'PATH_SEPARATOR' is NOT always ':',
47 # which suggests an implementation for a Microsoft platform.
48 # We need to choose the 'GROFF_BIN_PATH' format and 'PATH_SEPARATOR'
49 # which will suit the user's choice of shell.
51 # Note that some Windows users may specify the '--prefix' path
52 # using backslash characters, instead of '/', preferred by POSIX,
53 # so we will also fix that up.
55 POSIX_BINDIR=`echo $3 | tr '\\\\' /`
57 # (The value required is dependent on the user's choice of shell,\\
58 # and its associated POSIX emulation capabilities.)\\
62 GROFF_RUNTIME=\${GROFF_BIN_PATH="`
63 case "$POSIX_BINDIR" in
68 /*) POSIX_BINDIR="/$1$2" ;;
69 *) POSIX_BINDIR="/$1/$2" ;;
74 POSIX_BINDIR="$POSIX_BINDIR:$dir"
78 echo "$POSIX_BINDIR"`"}":" ;;\\
80 : \${GROFF_BIN_PATH="\`cygpath -w '$POSIX_BINDIR'\`"}\\
81 GROFF_RUNTIME=\`cygpath "\$GROFF_BIN_PATH"\`":" ;;\\
83 GROFF_RUNTIME=\${GROFF_BIN_PATH="$POSIX_BINDIR"}";" ;;\\
86 # On Microsoft platforms, we may also need to configure
87 # the PATH search function, used in the `pdfroff' script,
88 # to use ';', instead of ':', as the PATH_SEPARATOR.
91 /@PATH_SEARCH_SETUP@/c\\
93 # This implementation is configured for a Microsoft platform.\\
94 # Thus, the default PATH_SEPARATOR is ';', although some shells may\\
95 # use the POSIX standard ':' instead. Therefore, we need to examine\\
96 # the OSTYPE environment variable, to identify which is appropriate\\
97 # to make PATH searches work correctly.\\
103 # These emulate POSIX, and use ':'\\
105 PATH_SEPARATOR=\${PATH_SEPARATOR-':'} ;;\\
109 # For anything else, default to ';'\\
111 PATH_SEPARATOR=\${PATH_SEPARATOR-';'} ;;\\