diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:44:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:44:05 +0000 |
commit | d318611dd6f23fcfedd50e9b9e24620b102ba96a (patch) | |
tree | 8b9eef82ca40fdd5a8deeabf07572074c236095d /arch/misc | |
parent | Initial commit. (diff) | |
download | groff-f22bf21391d2b916c7303c565592ae6e99efbb58.tar.xz groff-f22bf21391d2b916c7303c565592ae6e99efbb58.zip |
Adding upstream version 1.23.0.upstream/1.23.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'arch/misc')
-rw-r--r-- | arch/misc/misc.am | 35 | ||||
-rw-r--r-- | arch/misc/shdeps.sh | 117 |
2 files changed, 152 insertions, 0 deletions
diff --git a/arch/misc/misc.am b/arch/misc/misc.am new file mode 100644 index 0000000..f8237cc --- /dev/null +++ b/arch/misc/misc.am @@ -0,0 +1,35 @@ +# Copyright (C) 2004-2023 Free Software Foundation, Inc. +# Original Makefile.sub written by Keith Marshall +# <keith.d.marshall@ntlworld.com>. +# Adapted to Automake by Bertrand Garrigues +# <bertrand.garrigues@laposte.net>. +# +# This file is part of groff. +# +# groff is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# groff is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +arch_shdeps_sh = arch/misc/shdeps.sh +EXTRA_DIST += $(arch_shdeps_sh) +MOSTLYCLEANFILES += shdeps.sed + +$(SH_DEPS_SED_SCRIPT): $(top_srcdir)/$(arch_shdeps_sh) + $(AM_V_GEN)$(SHELL) $(top_srcdir)/$(arch_shdeps_sh) \ + "$(RT_SEP)" "$(SH_SEP)" "$(bindir)" > $@ + + +# Local Variables: +# fill-column: 72 +# mode: makefile-automake +# End: +# vim: set autoindent filetype=automake textwidth=72: diff --git a/arch/misc/shdeps.sh b/arch/misc/shdeps.sh new file mode 100644 index 0000000..844b368 --- /dev/null +++ b/arch/misc/shdeps.sh @@ -0,0 +1,117 @@ +#! /bin/sh +# shdeps.sh: Generate OS dependency fixups, for 'groff' shell scripts +# +# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Written by Keith Marshall (keith.d.marshall@ntlworld.com) +# +# Invoked only by 'make', as: +# $(SHELL) shdeps.sh "$(RT_SEP)" "$(SH_SEP)" "$(bindir)" > shdeps.sed +# +# This file is part of groff. +# +# groff is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# groff is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +cat << ETX +# shdeps.sed: Script generated automatically by 'make' -- do not modify! + +/^$/N +/@GROFF_BIN_PATH_SETUP@/c\\ +ETX + +if [ "$1$2" = "::" ] +then + # 'PATH_SEPARATOR' is ':' both at 'groff' run time, and in 'make', + # implying an implementation which is completely POSIX compliant. + # Simply apply the 'GROFF_BIN_PATH' and 'PATH_SEPARATOR' values + # determined by 'configure', in all cases. + + cat << ETX +\\ +GROFF_RUNTIME="\${GROFF_BIN_PATH=$3}:" +/@PATH_SEARCH_SETUP@/d +ETX + +else + # 'PATH_SEPARATOR' is NOT always ':', + # which suggests an implementation for a Microsoft platform. + # We need to choose the 'GROFF_BIN_PATH' format and 'PATH_SEPARATOR' + # which will suit the user's choice of shell. + # + # Note that some Windows users may specify the '--prefix' path + # using backslash characters, instead of '/', preferred by POSIX, + # so we will also fix that up. + + POSIX_BINDIR=`echo $3 | tr '\\\\' /` + cat << ETX +# (The value required is dependent on the user's choice of shell,\\ +# and its associated POSIX emulation capabilities.)\\ +\\ +case "\$OSTYPE" in\\ + msys)\\ + GROFF_RUNTIME=\${GROFF_BIN_PATH="` + case "$POSIX_BINDIR" in + [a-zA-Z]:*) + IFS=':' + set -- $POSIX_BINDIR + case "$2" in + /*) POSIX_BINDIR="/$1$2" ;; + *) POSIX_BINDIR="/$1/$2" ;; + esac + shift 2 + for dir + do + POSIX_BINDIR="$POSIX_BINDIR:$dir" + done + ;; + esac + echo "$POSIX_BINDIR"`"}":" ;;\\ + cygwin)\\ + : \${GROFF_BIN_PATH="\`cygpath -w '$POSIX_BINDIR'\`"}\\ + GROFF_RUNTIME=\`cygpath "\$GROFF_BIN_PATH"\`":" ;;\\ + *)\\ + GROFF_RUNTIME=\${GROFF_BIN_PATH="$POSIX_BINDIR"}";" ;;\\ +esac +ETX + # On Microsoft platforms, we may also need to configure + # the PATH search function, used in the `pdfroff' script, + # to use ';', instead of ':', as the PATH_SEPARATOR. + + cat << ETX +/@PATH_SEARCH_SETUP@/c\\ +#\\ +# This implementation is configured for a Microsoft platform.\\ +# Thus, the default PATH_SEPARATOR is ';', although some shells may\\ +# use the POSIX standard ':' instead. Therefore, we need to examine\\ +# the OSTYPE environment variable, to identify which is appropriate\\ +# to make PATH searches work correctly.\\ +#\\ + case "\$OSTYPE" in\\ +#\\ + msys | cygwin)\\ + #\\ + # These emulate POSIX, and use ':'\\ + #\\ + PATH_SEPARATOR=\${PATH_SEPARATOR-':'} ;;\\ +#\\ + *)\\ + #\\ + # For anything else, default to ';'\\ + #\\ + PATH_SEPARATOR=\${PATH_SEPARATOR-';'} ;;\\ + esac +ETX + +fi + +# eof |