summaryrefslogtreecommitdiff
path: root/INSTALL.REPO
blob: e6cf192ce056d5ddd0b09bfca0da08e74eed3551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
    Copyright 2013-2022 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 information supplements the generic installation instructions in
the file 'INSTALL'.  It is meant for people building from the
development repository or a snapshot archive produced from it, rather
than a distribution archive.  Distribution archives include a
'configure' script, among other files; snapshot archives do not.  If you
want to start building the 'groff' system using an existing 'configure'
script, you don't need the information in this file.

Dependencies
------------

The dependencies documented in the 'INSTALL.extra' file are required, as
are several others.

* You will need Autoconf version 2.68 or higher and Automake version
  1.12.2 or higher.  These requirements are asserted in the
  'bootstrap.conf' file.

  On operating systems supporting concurrent installation of multiple
  versions of the GNU Autotools, set environment variables as in the
  following example, adjusting the version numbers as required.

    $ export AUTOMAKE_VERSION=1.14
    $ export AUTOCONF_VERSION=2.69

* You will need a 'yacc' program.  We recommend Berkeley yacc ('byacc')
  or GNU Bison ('bison').

* groff's Texinfo manual is generated in several formats: GNU Info,
  HTML, plain text, TeX DVI, and PDF.  The former three require
  'makeinfo' from GNU Texinfo 5.0 or later.  The latter two additionally
  require a TeX installation, such as TeX Live.  If TeX is not
  installed, the DVI and PDF formats of the manual cannot be generated.
  This will cause a build failure only if the Texinfo source file
  "groff.texi" is updated and the make(1) "dist" or relevant file
  targets are manually specified.

* You will need the 'xpmtoppm', 'pnmdepth', and 'pnmtops' programs from
  the Netpbm distribution.


Bootstrapping from a Git checkout
---------------------------------

Invoke the bootstrap script.

    $ ./bootstrap


Bootstrapping from a snapshot archive
-------------------------------------

Obtain groff's supported revision of gnulib and instruct the bootstrap
script where to find it.

Here is the output of "git submodule" for this groff release.

 c8b8f3bbcde37a53cd226f4c9cebd0dde6aca37f gnulib (v0.1-5208-gc8b8f3bbcd)

We therefore do the following.

  $ hash=c8b8f3bbcde37a53cd226f4c9cebd0dde6aca37f
  $ wget -O gnulib.tar.gz https://git.savannah.gnu.org/cgit/gnulib.git/\
snapshot/gnulib-$hash.tar.gz
  $ tar xf gnulib.tar.gz

Before we can proceed, we need to patch a bug in gnulib's
"git-version-gen" script.

--- build-aux/git-version-gen~  2022-06-03 18:34:08.175890973 +0000
+++ build-aux/git-version-gen   2022-06-03 17:51:02.221945195 +0000
@@ -189,7 +189,7 @@
     # Remove the "g" to save a byte.
     v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
     v_from_git=1
-elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
+elif test "x$fallback" = x && ! git --version >/dev/null 2>&1; then
     v=UNKNOWN
 else
     v=$fallback

Place the foregoing in a file called "../git-version-gen.patch", apply
it, then run the bootstrap script.

  $ patch -d gnulib-$hash -p0 < ../git-version-gen.patch
  $ ./bootstrap --gnulib-srcdir=gnulib-$hash


What bootstrapping does
-----------------------

The foregoing procedure will do two things:

  - clone the gnulib repository as a Git submodule in 'gnulib', add the
    needed gnulib source files in 'lib' as well as required gnulib m4
    macros in 'gnulib_m4'; and

  - invoke 'autoreconf', which will call the GNU Autotools ('aclocal',
    'autoconf', 'automake') in the right order to create the following
    files.

    -- INSTALL (a symlink to gnulib's INSTALL file)
    -- Makefile.in
    -- aclocal.m4
    -- autom4te.cache/
    -- build-aux/ (which contains all the helper scripts)
    -- configure
    -- src/include/config.hin

'aclocal.m4' is a generated file; groff's m4 macros are included via the
'acinclude.m4' file.


Building
--------

You can now invoke the 'configure' script.  It produces the
'config.status' script, which generates the Makefile.  Then call 'make'
to build the groff project.  You can do these from the source tree.

    $ ./configure
    $ make # run with -j option if desired

You can alternatively build groff outside of its source tree, which is
cleaner, leaving fewer files to confuse 'git status' if you aim to
undertake development.

    $ mkdir build
    $ cd build
    $ ../configure
    $ make # run with -j option if desired

A separate build tree need not be a subdirectory of the source.


Evaluation
----------

Several dozen sanity checks can be performed within the build tree.

    $ make check # run with -j option if desired


Installation
------------

When the build is finished you can install the groff build artifacts.

    $ make install # run with 'sudo' if necessary


Uninstalling
------------

See "Uninstalling" in the 'INSTALL.extra' file.


Rebuilding
----------

Start over from "Building" above.


##### Editor settings
Local Variables:
fill-column: 72
mode: text
End:
# vim: set autoindent textwidth=72: