summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:44:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:44:05 +0000
commitd318611dd6f23fcfedd50e9b9e24620b102ba96a (patch)
tree8b9eef82ca40fdd5a8deeabf07572074c236095d /arch
parentInitial commit. (diff)
downloadgroff-d318611dd6f23fcfedd50e9b9e24620b102ba96a.tar.xz
groff-d318611dd6f23fcfedd50e9b9e24620b102ba96a.zip
Adding upstream version 1.23.0.upstream/1.23.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--arch/djgpp/README361
-rw-r--r--arch/djgpp/config.bat100
-rw-r--r--arch/djgpp/config.sed21
-rw-r--r--arch/djgpp/config.site38
-rw-r--r--arch/djgpp/t-groff.bat83
-rw-r--r--arch/mingw/afmtodit.cmd2
-rw-r--r--arch/mingw/chem.cmd2
-rw-r--r--arch/mingw/gperl.cmd2
-rw-r--r--arch/mingw/gpinyin.cmd2
-rw-r--r--arch/mingw/grap2graph.cmd86
-rw-r--r--arch/mingw/grog.cmd2
-rw-r--r--arch/mingw/gropdf.cmd2
-rw-r--r--arch/mingw/mingw.am49
-rw-r--r--arch/mingw/mmroff.cmd2
-rw-r--r--arch/mingw/neqn.cmd6
-rw-r--r--arch/mingw/pdfmom.cmd2
-rw-r--r--arch/mingw/roff2dvi.cmd2
-rw-r--r--arch/mingw/roff2html.cmd2
-rw-r--r--arch/mingw/roff2pdf.cmd2
-rw-r--r--arch/mingw/roff2ps.cmd2
-rw-r--r--arch/mingw/roff2text.cmd2
-rw-r--r--arch/mingw/roff2x.cmd2
-rw-r--r--arch/misc/misc.am35
-rw-r--r--arch/misc/shdeps.sh117
24 files changed, 924 insertions, 0 deletions
diff --git a/arch/djgpp/README b/arch/djgpp/README
new file mode 100644
index 0000000..90a5a6d
--- /dev/null
+++ b/arch/djgpp/README
@@ -0,0 +1,361 @@
+ Copyright (C) 2000-2020 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without
+ modification, are permitted in any medium without royalty provided
+ the copyright notice and this notice are preserved.
+
+This is a port of GNU Groff to DJGPP v2.03 or later.
+Groff is the GNU version of document formatting tools related to
+'troff'.
+
+This README file describes how to build and install Groff on MS-DOS or
+MS-Windows systems using the DJGPP port of GNU C/C++ compiler and
+development tools.
+
+
+I. Installing the pre-compiled binary package
+ ------------------------------------------
+
+ 1. Unzip the file groNNNb.zip (where NNN is the version number)
+ preserving the directory structure (-d switch to PKUNZIP) from
+ the main DJGPP installation directory. If you will use Groff
+ on Windows 9x, Windows 2000, or later, use an unzip program
+ which supports long filenames.
+
+ 2. Groff binaries were configured so that they will look for their
+ standard directories under the directory pointed to by the
+ DJDIR environment variable, so it should work automatically if
+ you have DJGPP installed. If you don't have a standard DJGPP
+ installation, set the variable DJDIR to point to the directory
+ where you unzip Groff. In this latter case, you will need to
+ set additional environment variables:
+
+ GROFF_TMAC_PATH=%DJDIR%/share/groff/<version>/tmac:%DJDIR%/share/groff/site-tmac
+ GROFF_TYPESETTER=ascii
+ GROFF_FONT_PATH=%DJDIR%/share/groff/<version>/font
+
+ <version> is something like '1.16.1' or '1.17'.
+
+ In addition, you can set the variable GROFF_TMPDIR to point to
+ a directory where you want Groff to create temporary files it
+ needs for running its jobs (these files are automatically
+ deleted when Groff exits).
+
+ All of those variables are automatically set in the file
+ DJGPP.ENV that is part of the standard DJGPP distribution
+ djdevNNN.zip (where NNN is the DJGPP version number), so you
+ only need to set them manually if you don't have DJGPP
+ installed.
+
+ Note that the GROFF_TYPESETTER variable sets the default Groff
+ device to be 'ascii', which is suitable for formatting man
+ pages to be viewed on the terminal. Use the -T switch to
+ generate output for other devices (e.g., -Tps for PostScript).
+
+ 3. If your TMPDIR environment variable points to a RAM drive, you
+ might consider changing GROFF_TMPDIR to point to a directory on
+ a real disk drive, especially if you intend to generate
+ PostScript output, because RAM disks are typically small (2-3
+ MBytes) which might be not enough for formatting large
+ documents.
+
+ 4. Read the docs. It comes as formatted manual pages called *.1,
+ *.5 and *.7 which unzip into your man/ subdirectory. You
+ can read them with a pager such as GNU Less (recommended, as
+ Less will use colors for bold and underlined text) or with
+ Info (which will remove the bold/underline attributes).
+ Another alternative is to use Emacs built-in man page reader;
+ the DJGPP FAQ lists other possibilities.
+
+ Beginning with version 1.15, Groff comes with an Info manual;
+ type "info -f groff" to read it. The Info manual is still
+ under construction, so some sections are empty.
+
+ If you want to add a Groff entry to the main Info menu in the
+ file DIR, chdir to the 'info' subdirectory of the main Groff
+ installation directory and run this command:
+
+ install-info --dir-file=dir groff.info
+
+ After you do that, "info groff" will also work.
+
+ 5. For those who only need Groff to format man pages and don't
+ like reading the docs, here's a minimal cookbook:
+
+ groff -man -s foo.1 > foo.man
+
+ where 'foo.1' is the troff source of the man page and 'foo.man'
+ is the formatted page. If you need to view the man page, say
+ this:
+
+ groff -man -s foo.1 | less
+
+ You can also use the DJGPP clone of the Unix 'man' command, in
+ which case 'man' runs the above command for you automatically.
+
+ Here's how you print man pages on a PostScript printer:
+
+ groff -man -s -Tps foo.1 > prn
+
+ And this is for a LaserJet4 printer:
+
+ groff -man -s -Tlj4 foo.1 > prn
+
+ Printing the documents produced by Groff is possible either by
+ redirecting Groff's standard output to the local printer
+ device, like shown above, or by using the '-l' switch to Groff.
+ The latter possibility causes Groff to pipe its output to a
+ program whose name and arguments appear in the files named
+ 'DESC' in each of the 'devFOO' subdirectories of the
+ %DJDIR%/share/groff/<version>/font directory; for example, the
+ file devps/DESC is used by "groff -Tps". The relevant line in
+ these files begins with the word "print".
+
+ As configured, when invoked with the '-l' switch, Groff will
+ call 'cat' (from GNU Textutils) to pipe its output to the
+ default printer device for -Tps, -Tlbp and -Tlj4 options, and
+ it will call 'dvilj4' (from the dvljNNNb.zip package) for -Tdvi
+ option. If you don't have these programs installed, you can
+ edit the respective 'DESC' files to replace these commands with
+ something else. The replacement program must be able to read
+ its standard input and send its output to whatever printer you
+ want. The "print" entry is assumed to be a shell command, so
+ it can use redirection, pipes, and other shell features.
+
+ Beginning with version 1.15, Groff can create HTML output, like
+ this:
+
+ groff -man -s -Thtml foo.1 > foo.html
+
+ Producing HTML files sometimes requires Ghostscript to be
+ installed, and, for gif images, ppmquant and ppmtogif as well.
+ If you do not have these programs installed, Groff will print
+ an error message, and the produced file will have links which
+ will fail to resolve when you view it with a Web browser.
+
+ 6. Some programs in the package are supplied as Unix shell
+ scripts. While it is relatively easy to write a DOS batch file
+ which will do the same, DOS doesn't allow to redirect input and
+ output of a batch file. Since Groff tools are meant to be
+ invoked in a pipe, the batch files are not very useful. The
+ batch files are included in the binary distribution
+ nonetheless.
+
+ These scripts need the following utilities to run (in addition
+ to the Groff programs they invoke):
+
+ - bash
+ - gawk
+ - egrep
+ - sed
+
+ The 'afmtodit' and 'mmroff' utilities are Perl scripts, so you
+ will need a Perl port to run them.
+
+ All of these ports should be available from the DJGPP sites.
+
+ If you need to run these scripts and batch files, you have to
+ install the port of bash (or another Unix-like shell) and the
+ above-mentioned utilities called by the script. Alternatively,
+ just look inside the shell script and invoke the programs it
+ calls manually.
+
+ To run the scripts with redirection, invoke them via the shell,
+ like this: "sh mmroff > foo".
+
+ 7. Note that Groff programs use floating point, so you will need
+ an FP emulator if your machine doesn't have an FPU. The binary
+ distribution includes the emulator, in case you don't have the
+ DJGPP development environment installed. Please refer to the
+ DJGPP FAQ list in case you have any problems with the emulator.
+
+ 8. The package does not include the directories under
+ share/groff/<version>/font whose names begin with "devX": these
+ are needed on the X Window System for running the gxditview
+ program, which is not supported by this port.
+
+ 9. Due to 8+3 limitations of DOS filesystems, several files were
+ renamed:
+
+ - groff_mdoc.samples.7 was renamed to groff-mdoc_samples.7
+ and groff_mmse.7 to groff-mmse.7. The latter was also
+ converted from Latin-1 encoding to codepage 437.
+
+
+
+II. Building Groff from sources
+ ---------------------------
+
+ 1. To build Groff, you will need the following tools (the file
+ name in parentheses is what you need to download from one of
+ the DJGPP sites):
+
+ - Standard DJGPP development environment (djdev203.zip)
+ - GNU C compiler (gcc2721b.zip)
+ - GNU C++ compiler (gpp2721b.zip)
+ - GNU Make 3.79 (mak379b.zip)
+ - Bash v2.03 (bsh203b.zip)
+ - Fileutils 3.16 (fil316b.zip)
+ - Textutils 2.0 (txt20b.zip)
+ - Sh-utils 1.12 (shl112b.zip)
+ - Sed 3.02 (sed302b.zip)
+ - Gawk 3.04 (gwk304b.zip)
+ - Grep 2.4 (grep24b.zip)
+ - Bison (only if you change one of the *.y files)
+
+ Note that you don't need to install libg++ (lgpNNNb.zip) since
+ Groff doesn't use any C++ classes except its own.
+
+ Any versions of the utilities later than what's mentioned above
+ should also do; in particular, GCC 2.95.2 was tested and Groff
+ built okay with it. Versions older than in the above list
+ might also work, but I don't guarantee that; you are on your
+ own.
+
+ Special considerations apply if you have GCC 2.8.1 installed,
+ and cannot upgrade to a later version. See paragraph 4 below.
+
+ After you install these tools, make sure you have a "symlink"
+ to bash.exe called sh.exe and a "symlink" to gawk.exe called
+ awk.exe. If not, go to the DJGPP bin/ subdirectory and type
+ the following words of wisdom from the DOS prompt:
+
+ ln -s bash.exe sh.exe
+ ln -s gawk.exe awk.exe
+
+ ('ln' is part of GNU Fileutils, see above.)
+
+ 2. Unzip the source distribution groXYZs.zip (where XYZ is the
+ version number) preserving the directory structure (-d switch
+ to PKUNZIP) from the main DJGPP installation directory. (If
+ you are building Groff on Windows 9x, Windows 2000, or later,
+ use an unzip program which supports long filenames.) This
+ creates directory gnu/groff-X.YZ and unzips the sources there.
+
+ If you are building from the official GNU distribution, unpack
+ the .tar.gz archive like this:
+
+ djtar -x groff-X.YZ.tar.gz
+
+ (DJTAR is part of the standard DJGPP development distribution.)
+
+ 3. Groff sources on DJGPP sites are already configured for the
+ current version of DJGPP. If that is the version you have,
+ then you can just chdir to gnu/groff-X.YZ and say "make" to
+ build the entire package (if you have GCC 2.8.1, see the next
+ paragraph).
+
+ If you have version of DJGPP other than the current one, or if
+ you build the official GNU distribution, or if you prefer to
+ configure the package so that it defaults to the directory
+ structure on your machine, or need to change some options
+ (e.g., compile with different optimization options), you will
+ have to reconfigure Groff. To this end, use the CONFIG.BAT
+ batch file in the DJGPP subdirectory:
+
+ arch\djgpp\config
+
+ You can configure and build Groff from outside its source
+ directory. In that case, you need to pass the full path to the
+ source directory as an argument to CONFIG.BAT, like this:
+
+ d:\gnu\groff-1.16\arch\djgpp\config d:/gnu/groff-1.16
+
+ Note that you MUST use forward slashes in the path you pass to
+ CONFIG.BAT, or else it may fail. (For versions of Groff other
+ than 1.16, change the above command accordingly.)
+
+ 4. If your version of GCC is 2.8.1, you cannot build the
+ preconfigured package without some tinkering. The DJGPP port
+ of GCC 2.8.1 had a bug in its C++ configuration, whereby the
+ file _G_config.h erroneously indicated that the header
+ <sys/socket.h> is available, and also undefined the symbol
+ NULL. This causes several files in the Groff distribution to
+ fail to compile.
+
+ The easiest way to solve this is to upgrade to a later version
+ of GCC; then you can simply say "make" to build the
+ preconfigured package. If this is not an option, you will have
+ to edit the file lang/cxx/_G_config.h and change this line:
+
+ #define _G_HAVE_SYS_SOCKET 1
+
+ to say this instead:
+
+ #define _G_HAVE_SYS_SOCKET 0
+
+ The problem with redefining NULL should not happen with DJGPP
+ v2.03 or later. But if you still see compilation errors which
+ say "'NULL' undeclared", comment out the line in _G_config.h
+ that says this:
+
+ #undef NULL
+
+ Alternatively, you can reconfigure the package as described in
+ the previous paragraph, before building it.
+
+ 5. After the configure script exits, say "make" to build Groff.
+ Groff is a large package, and it might take a few minutes to
+ build, depending on your CPU, so you might as well go for a
+ coffee while it grinds away.
+
+ 6. Test the package that you have built. A batch file T-GROFF.BAT
+ in the DJGPP subdirectory is supplied for that purpose. Most
+ of the commands there are commented out, since I cannot
+ possibly know what kind of printer do you have and which
+ additional programs, such as Less, do you have installed. The
+ only command that runs by default will format a large document
+ and print it to the screen. Read the comments in the batch
+ file, uncomment additional lines as you see fit and run the
+ batch file to see that you get the document printed as you'd
+ expect. (Btw, the document that the batch file prints is an
+ introduction to the entire Groff package, so you might as well
+ read it to make yourself familiar with the programs.)
+
+ Note that the batch file sets a lot of environment variables;
+ if you get "Out of environment space" messages, launch a
+ subsidiary COMMAND.COM with plenty of environment space, like
+ so:
+
+ command.com /e:3000
+
+ then invoke T-GROFF.BAT from that COMMAND.COM.
+
+ 7. Install the package by typing "make install". This will copy
+ all the binaries, the auxiliary files (fonts, macros, etc.) and
+ the docs into their places. If you configured the package for
+ your system, these are precisely the directories where the
+ files should remain (with the exception of the man pages, see
+ below). If you use the default configuration, the files will
+ be installed under the top DJGPP installation directory.
+
+ Alternatively, you could instruct Make explicitly where to
+ install the package by setting the 'prefix' variable. For
+ example:
+
+ make install prefix=c:/groff
+
+ "make install" doesn't format the man pages, it just copies
+ them into subdirectories of the %DJDIR%\MAN directory. If you
+ need to keep formatted pages in your man/ subdirectory, you
+ will need to format them. Use the commands shown in chapter I,
+ section 5 above to do that, and redirect its output to the
+ appropriate catN subdirectory. Alternatively, you could format
+ the pages when you need to view them (the DJGPP clone of 'man'
+ will automatically format them).
+
+ Consult the installation instructions for pre-compiled binaries
+ above, for more info about installing and using Groff.
+
+ 8. You can safely delete the directories under
+ share/groff/<version>/font whose names begin with "devX": these
+ are used by the X Window System client 'gxditview', which is
+ not supported by this port.
+
+
+##### Editor settings
+Local Variables:
+mode: text
+fill-column: 70
+End:
+vim: set autoindent textwidth=70:
diff --git a/arch/djgpp/config.bat b/arch/djgpp/config.bat
new file mode 100644
index 0000000..ba9d1c6
--- /dev/null
+++ b/arch/djgpp/config.bat
@@ -0,0 +1,100 @@
+Rem Copyright (C) 2000-2020 Free Software Foundation, Inc.
+Rem
+Rem This configure script is free software; the Free Software Foundation
+Rem gives unlimited permission to copy, distribute and modify it.
+
+@echo off
+echo Configuring GNU Groff for DJGPP v2.x...
+
+Rem The SmallEnv tests protect against fixed and too small size
+Rem of the environment in stock DOS shell.
+
+Rem Find out where the sources are
+set XSRC=.
+if not "%XSRC%" == "." goto SmallEnv
+if "%1" == "" goto InPlace
+set XSRC=%1
+if not "%XSRC%" == "%1" goto SmallEnv
+redir -e /dev/null update %XSRC%/configure.orig ./configure
+if not exist configure update %XSRC%/configure ./configure
+
+:InPlace
+Rem Update configuration files
+echo Updating configuration scripts...
+if not exist configure.orig update configure configure.orig
+sed -f %XSRC%/arch/djgpp/config.sed configure.orig > configure
+if errorlevel 1 goto SedError
+
+Rem Make sure they have a config.site file
+set CONFIG_SITE=%XSRC%/arch/djgpp/config.site
+if not "%CONFIG_SITE%" == "%XSRC%/arch/djgpp/config.site" goto SmallEnv
+
+Rem This is required because DOS/Windows are case-insensitive
+Rem to file names, and "make install" will do nothing if Make
+Rem finds a file called 'install'.
+if exist INSTALL ren INSTALL INSTALL.txt
+
+Rem Set HOSTNAME so it shows in config.status
+if not "%HOSTNAME%" == "" goto hostdone
+if "%windir%" == "" goto msdos
+set OS=MS-Windows
+if not "%OS%" == "MS-Windows" goto SmallEnv
+goto haveos
+:msdos
+set OS=MS-DOS
+if not "%OS%" == "MS-DOS" goto SmallEnv
+:haveos
+if not "%USERNAME%" == "" goto haveuname
+if not "%USER%" == "" goto haveuser
+echo No USERNAME and no USER found in the environment, using default values
+set HOSTNAME=Unknown PC
+if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
+:haveuser
+set HOSTNAME=%USER%'s PC
+if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
+goto userdone
+:haveuname
+set HOSTNAME=%USERNAME%'s PC
+if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
+:userdone
+set _HOSTNAME=%HOSTNAME%, %OS%
+if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
+set HOSTNAME=%_HOSTNAME%
+:hostdone
+set _HOSTNAME=
+set OS=
+
+Rem install-sh is required by the configure script but clashes with the
+Rem various Makefile install-foo targets, so we MUST have it before the
+Rem script runs and rename it afterwards
+test -f install-sh
+if not errorlevel 1 goto noren1
+test -f install-sh.sh
+if not errorlevel 1 mv -f install-sh.sh install-sh
+:noren1
+echo Running the ./configure script...
+sh ./configure --src=%XSRC% --disable-nls --without-x
+if errorlevel 1 goto CfgError
+test -f install-sh.sh
+if not errorlevel 1 goto noren2
+test -f install-sh
+if not errorlevel 1 mv -f install-sh install-sh.sh
+:noren2
+echo Done.
+goto End
+
+:SedError
+echo ./configure script editing failed!
+goto End
+
+:CfgError
+echo ./configure script exited abnormally!
+goto End
+
+:SmallEnv
+echo Your environment size is too small. Enlarge it and run me again.
+echo Configuration NOT done!
+:End
+set XSRC=
+set CONFIG_SITE=
+set HOSTNAME=
diff --git a/arch/djgpp/config.sed b/arch/djgpp/config.sed
new file mode 100644
index 0000000..72c5fb1
--- /dev/null
+++ b/arch/djgpp/config.sed
@@ -0,0 +1,21 @@
+# Copyright (C) 2000-2020 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Additional editing of Makefiles and atconfig
+/ac_given_INSTALL=/,/^CEOF/ {
+ /^s%@g@%/a\
+ /path=/s,:,;,g
+}
+
+# DOS-style absolute file names should be supported as well
+/\*) srcdir=/s,/\*,[\\\\/]* | [A-z]:[\\\\/]*,
+/\$]\*) INSTALL=/s,\[/\$\]\*,[\\\\/$]* | [A-z]:[\\\\/]*,
+
+# Who said each line has only \012 at its end?
+/DEFS=`sed -f/s,'\\012','\\012\\015',
+
+# Switch the order of the two Sed commands, since DOS path names
+# could include a colon
+/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1,
diff --git a/arch/djgpp/config.site b/arch/djgpp/config.site
new file mode 100644
index 0000000..a463ad9
--- /dev/null
+++ b/arch/djgpp/config.site
@@ -0,0 +1,38 @@
+#! /bin/sh
+
+# Copyright (C) 2000-2020 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# This is the config.site file for configuring GNU packages
+# which are to be built with DJGPP tools.
+
+# These two variables are required, otherwise looking for
+# programs along the PATH will not work.
+PATH_SEPARATOR=:
+PATH_EXPAND=y
+
+# This is required in for "test -f foo" to find foo.exe
+export TEST_FINDS_EXE=y
+
+# The root of the DJGPP tree serves as the default prefix
+test "x$prefix" = xNONE && prefix='/dev/env/DJDIR'
+
+# This is required for config.status script to be run, since
+# ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh}
+CONFIG_SHELL=${CONFIG_SHELL='sh'}
+
+# These are set here so the generated Makefile's will be good
+# for every DJGPP installation, not only the one where the
+# package was configured.
+# $INSTALL must be an absolute path name, otherwise config.status
+# will try to prepend ./ and ../ to it when it goes into subdirs.
+INSTALL=${INSTALL='/dev/env/DJDIR/bin/ginstall -c'}
+RANLIB=${RANLIB='ranlib'}
+LPR=${LPR='cat >>PRN'}
+DVIPRINT=${DVIPRINT='dvilj4 - >>PRN'}
+PERL=${PERL='/usr/bin/perl'}
+
+# Force "cp" to be used instead of "ln -s".
+ac_cv_prog_LN_S="cp -p"
diff --git a/arch/djgpp/t-groff.bat b/arch/djgpp/t-groff.bat
new file mode 100644
index 0000000..8960b7a
--- /dev/null
+++ b/arch/djgpp/t-groff.bat
@@ -0,0 +1,83 @@
+Rem Copyright (C) 2000-2020 Free Software Foundation, Inc.
+Rem
+Rem This file is part of groff.
+Rem
+Rem groff is free software; you can redistribute it and/or modify it under
+Rem the terms of the GNU General Public License as published by the Free
+Rem Software Foundation; either version 3 of the License, or (at your option)
+Rem any later version.
+Rem
+Rem groff is distributed in the hope that it will be useful, but WITHOUT ANY
+Rem WARRANTY; without even the implied warranty of MERCHANTABILITY or
+Rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+Rem for more details.
+Rem
+Rem You should have received a copy of the GNU General Public License along
+Rem with this program. If not, see <http://www.gnu.org/licenses/>.
+Rem
+Rem This script runs groff without requiring that it be installed.
+
+@echo off
+Rem This script runs groff without requiring that it be installed.
+Rem The current directory must be the build directory.
+
+test -d ./src/roff/groff
+if not errorlevel 1 goto dirOk
+echo this batch file must be run with the build directory as the current directory
+goto end
+:dirOk
+test -x ./src/roff/groff/groff
+if not errorlevel 1 goto groffOk
+echo this batch file must be run with the build directory as the current directory
+goto end
+:groffOk
+Rem chdir to src, to avoid overflowing the DOS limits with a long PATH.
+cd src
+set GROFF_FONT_PATH=..;../font
+set GROFF_TMAC_PATH=../tmac
+set PATH1=%PATH%
+set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grotty;%PATH1%
+Rem
+echo I will use this command to format a document and print it on the screen:
+roff\groff\groff -V -e -s -t -p -R -m ttchar -me -Tascii ../doc/meintro.me
+pause
+Rem Make the following command pipe to Less if you have Less installed:
+roff\groff\groff -e -s -t -p -R -m ttchar -me -Tascii ../doc/meintro.me
+Rem
+set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grops;%PATH1%
+echo I will use this command to format a document and print it on PS printer:
+roff\groff\groff -V -e -s -t -p -R -me -Tps ../doc/meintro.me
+pause
+Rem Uncomment the following command if you have a PostScript printer:
+REM roff\groff\groff -e -s -t -p -R -me -Tps ../doc/meintro.me >>prn
+Rem
+set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grolj4;%PATH1%
+echo I will use this command to format a document and print it on LJ4 printer:
+roff\groff\groff -V -e -s -t -p -R -me -Tlj4 ../doc/meintro.me
+pause
+Rem Uncomment the following command if you have a LaserJet4 printer:
+REM roff\groff\groff -e -s -t -p -R -me -Tlj4 ../doc/meintro.me >>prn
+Rem
+set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grodvi;%PATH1%
+echo I will use this command to format a document into a DVI format:
+roff\groff\groff -V -e -s -t -p -R -me -Tdvi ../doc/meintro.me
+pause
+roff\groff\groff -e -s -t -p -R -me -Tdvi ../doc/meintro.me > meintro.dvi
+set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grohtml;%PATH1%
+echo I will use this command to format a document into HTML format:
+roff\groff\groff -V -e -s -t -p -R -me -Thtml ../doc/meintro.me
+pause
+roff\groff\groff -e -s -t -p -R -me -Thtml ../doc/meintro.me > meintro.html
+set PATH=roff\troff;preproc\pic;preproc\eqn;preproc\tbl;preproc\grn;preproc\refer;preproc\soelim;devices\grolbp;%PATH1%
+echo I will use this command to format a document and print it on an LBP printer:
+roff\groff\groff -V -e -s -t -p -R -me -Tlbp ../doc/meintro.me
+pause
+Rem Uncomment the following if you have a Canon CaPSL LBP-4 or LBP-8 printer:
+REM roff\groff\groff -e -s -t -p -R -me -Tlbp ../doc/meintro.me >>prn
+Rem
+set PATH=%PATH1%
+set GROFF_FONT_PATH=
+set GROFF_TMAC_PATH=
+set PATH1=
+cd ..
+:exit
diff --git a/arch/mingw/afmtodit.cmd b/arch/mingw/afmtodit.cmd
new file mode 100644
index 0000000..36012ed
--- /dev/null
+++ b/arch/mingw/afmtodit.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl -w %~dpn0 %*
diff --git a/arch/mingw/chem.cmd b/arch/mingw/chem.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/chem.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/gperl.cmd b/arch/mingw/gperl.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/gperl.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/gpinyin.cmd b/arch/mingw/gpinyin.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/gpinyin.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/grap2graph.cmd b/arch/mingw/grap2graph.cmd
new file mode 100644
index 0000000..5ee9e5a
--- /dev/null
+++ b/arch/mingw/grap2graph.cmd
@@ -0,0 +1,86 @@
+@echo off
+REM grap2graph -- compile graph description descriptions to bitmap images
+REM
+REM by Eli Zaretskii <eliz@gnu.org>, translation of a Unix shell
+REM script written by Eric S. Raymond <esr@thyrsus.com>, May 2003
+REM
+REM In Unixland, the magic is in knowing what to string together...
+REM
+REM Take grap description on stdin, emit cropped bitmap on stdout.
+REM The pic markup should *not* be wrapped in .G1/.G2, this script will do that.
+REM A -U option on the command line enables gpic/groff "unsafe" mode.
+REM A -format FOO option changes the image output format to any format
+REM supported by convert(1). All other options are passed to convert(1).
+REM The default format is PNG.
+REM
+REM
+REM Requires the groff suite and the ImageMagick tools. Both are open source.
+REM This code is released to the public domain.
+REM
+REM Here are the assumptions behind the option processing:
+REM
+REM 1. None of the options of grap(1) are relevant.
+REM
+REM 2. Only the -U option of groff(1) is relevant.
+REM
+REM 3. Many options of convert(1) are potentially relevant, (especially
+REM -density, -interlace, -transparency, -border, and -comment).
+REM
+REM Thus, we pass -U to groff(1), and everything else to convert(1).
+REM
+setlocal
+set groff_opts=
+set convert_opts=
+set format=png
+
+:loop
+if "%1" == "" goto body
+if "%1" == "-v" goto version
+if "%1" == "--version" goto version
+if "%1" == "--help" goto usage
+if not "%1%" == "-unsafe" goto format
+set groff_opts=-U
+shift
+goto loop
+:format
+if not "%1" == "-format" goto convert
+set format=%2
+shift
+shift
+goto loop
+:convert
+set convert_opts=%convert_opts% %1
+shift
+goto loop
+
+:body
+REM echo %groff_opts% %convert_opts% %format%
+
+set rnd1=%RANDOM%
+set rnd2=%RANDOM%
+if "%GROFF_TMPDIR%" == "" goto deftmp
+set tdir=%GROFF_TMPDIR%\grap2graph-%rnd1%
+goto runpipe
+:deftmp
+sei tdir=%TEMP%\grap2graph-%rnd1%
+
+:runpipe
+mkdir %tdir%
+echo .G1 > %tdir%\wrap
+cat >> %tdir%\wrap
+echo .G2 >> %tdir%\wrap
+grap %tdir%\wrap | groff -p %groff_opts% -Tps -P-pletter | convert -trim -crop 0x0 %convert_opts% - %tdir%/grap2graph.%format%
+cat %tdir%/grap2graph.%format%
+rm -rf %tdir%
+goto end
+
+:version
+echo GNU grap2graph (groff) version 1.23.0
+goto end
+
+:usage
+echo usage: grap2graph ^[ option ...^] ^< in ^> out
+echo.
+
+:end
+endlocal
diff --git a/arch/mingw/grog.cmd b/arch/mingw/grog.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/grog.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/gropdf.cmd b/arch/mingw/gropdf.cmd
new file mode 100644
index 0000000..36012ed
--- /dev/null
+++ b/arch/mingw/gropdf.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl -w %~dpn0 %*
diff --git a/arch/mingw/mingw.am b/arch/mingw/mingw.am
new file mode 100644
index 0000000..4badf5a
--- /dev/null
+++ b/arch/mingw/mingw.am
@@ -0,0 +1,49 @@
+# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+#
+# 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/>.
+#
+# mingw.am
+#
+WINSCRIPTS=\
+ arch/mingw/afmtodit.cmd \
+ arch/mingw/chem.cmd \
+ arch/mingw/gperl.cmd \
+ arch/mingw/gpinyin.cmd \
+ arch/mingw/grap2graph.cmd \
+ arch/mingw/grog.cmd \
+ arch/mingw/gropdf.cmd \
+ arch/mingw/mmroff.cmd \
+ arch/mingw/neqn.cmd \
+ arch/mingw/pdfmom.cmd \
+ arch/mingw/roff2dvi.cmd \
+ arch/mingw/roff2html.cmd \
+ arch/mingw/roff2pdf.cmd \
+ arch/mingw/roff2ps.cmd \
+ arch/mingw/roff2text.cmd \
+ arch/mingw/roff2x.cmd
+
+if BUILD_WINSCRIPTS
+bin_SCRIPTS += $(WINSCRIPTS)
+else
+EXTRA_DIST += $(WINSCRIPTS)
+endif
+
+
+# Local Variables:
+# fill-column: 72
+# mode: makefile-automake
+# End:
+# vim: set autoindent filetype=automake textwidth=72:
diff --git a/arch/mingw/mmroff.cmd b/arch/mingw/mmroff.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/mmroff.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/neqn.cmd b/arch/mingw/neqn.cmd
new file mode 100644
index 0000000..d501692
--- /dev/null
+++ b/arch/mingw/neqn.cmd
@@ -0,0 +1,6 @@
+@echo off
+setlocal
+set Path=%~dp0;%Path%
+if not "%GROFF_BIN_PATH%" == "" set Path=%GROFF_BIN_PATH%;%Path%
+eqn -Tascii %*
+endlocal
diff --git a/arch/mingw/pdfmom.cmd b/arch/mingw/pdfmom.cmd
new file mode 100644
index 0000000..36012ed
--- /dev/null
+++ b/arch/mingw/pdfmom.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl -w %~dpn0 %*
diff --git a/arch/mingw/roff2dvi.cmd b/arch/mingw/roff2dvi.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/roff2dvi.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/roff2html.cmd b/arch/mingw/roff2html.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/roff2html.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/roff2pdf.cmd b/arch/mingw/roff2pdf.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/roff2pdf.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/roff2ps.cmd b/arch/mingw/roff2ps.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/roff2ps.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/roff2text.cmd b/arch/mingw/roff2text.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/roff2text.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
diff --git a/arch/mingw/roff2x.cmd b/arch/mingw/roff2x.cmd
new file mode 100644
index 0000000..3fb18d4
--- /dev/null
+++ b/arch/mingw/roff2x.cmd
@@ -0,0 +1,2 @@
+@echo off
+perl %~dpn0 %*
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