xref: /freebsd/contrib/less/README (revision 95270f73baf6fa95ae529bc2eb6a61f5c79f32c0)
16b7fdd58SDavid E. O'Brien**************************************************************************
26b7fdd58SDavid E. O'Brien**************************************************************************
36b7fdd58SDavid E. O'Brien**                                                                      **
46b7fdd58SDavid E. O'Brien** The FreeBSD Project has chosen to redistribute and modify Less under **
56b7fdd58SDavid E. O'Brien** the 'Less License' (as described in the 'LICENSE' file).             **
66b7fdd58SDavid E. O'Brien**                                                                      **
76b7fdd58SDavid E. O'Brien**************************************************************************
86b7fdd58SDavid E. O'Brien**************************************************************************
9a5f0fb15SPaul Saab
1030a1828cSXin LI    This is the source code distribution of "less".
11*95270f73SXin LI    This program is part of the GNU project (https://www.gnu.org).
12a5f0fb15SPaul Saab
13a5f0fb15SPaul Saab    This program is free software.  You may redistribute it and/or
14a5f0fb15SPaul Saab    modify it under the terms of either:
15a5f0fb15SPaul Saab
16a5f0fb15SPaul Saab    1. The GNU General Public License, as published by the Free
177374caaaSXin LI       Software Foundation; either version 3, or (at your option) any
18a5f0fb15SPaul Saab       later version.  A copy of this license is in the file COPYING.
19a5f0fb15SPaul Saab    or
20a5f0fb15SPaul Saab    2. The Less License, in the file LICENSE.
21a5f0fb15SPaul Saab
222235c7feSXin LI    Please report any problems at https://github.com/gwsw/less/issues.
232235c7feSXin LI    See https://greenwoodsoftware.com/less for the latest info.
24b2ea2440SXin LI    Source repository is at https://github.com/gwsw/less.git.
25a5f0fb15SPaul Saab
26a5f0fb15SPaul Saab=========================================================================
27a5f0fb15SPaul Saab
2830a1828cSXin LIYou should build from a clone of a git repository
2930a1828cSXin LIONLY IF you are doing development on the less source itself.
3030a1828cSXin LIIf you are merely using less as a tool, you should download a release
31*95270f73SXin LIfrom https://greenwoodsoftware.com and NOT from github.
3230a1828cSXin LI
33a5f0fb15SPaul SaabThe formatted manual page is in less.man.
34a5f0fb15SPaul SaabThe manual page nroff source is in less.nro.
35a5f0fb15SPaul SaabMajor changes made since the last posted version are in NEWS.
36a5f0fb15SPaul Saab
37a5f0fb15SPaul Saab=======================================================================
382235c7feSXin LIINSTALLATION (Unix & Linux systems only):
39a5f0fb15SPaul Saab
40a5f0fb15SPaul Saab1. Move the distributed source to its own directory and unpack it,
41a5f0fb15SPaul Saab   if you have not already done so.
42a5f0fb15SPaul Saab
432235c7feSXin LI2. If you are building from a clone of a git repository,
44*95270f73SXin LI   type "make -f Makefile.aut distfiles".
452235c7feSXin LI   If you are building from a numbered release package (a tar or
462235c7feSXin LI   zip file with a name like less-999.tar.gz or less-999.zip downloaded
472235c7feSXin LI   from greenwoodsoftware.com, not from github), you should skip this step.
482235c7feSXin LI
492235c7feSXin LI3. Type "sh configure".
50a5f0fb15SPaul Saab   This will generate a Makefile and a defines.h.
51a5f0fb15SPaul Saab   Warning: if you have a GNU sed, make sure it is version 2.05 or later.
52a5f0fb15SPaul Saab
53a5f0fb15SPaul Saab   The file INSTALL describes the usage of the configure program in
54a5f0fb15SPaul Saab   general.  In addition, these options to configure are supported:
55a5f0fb15SPaul Saab
56a5f0fb15SPaul Saab   --with-editor=program
57a5f0fb15SPaul Saab     Specifies the default editor program used by the "v" command.
58a5f0fb15SPaul Saab     The default is "vi".
597f074f9cSXin LI
60a5f0fb15SPaul Saab   --with-regex=lib
61a5f0fb15SPaul Saab     Specifies the regular expression library used by less for pattern
62a5f0fb15SPaul Saab     matching.  The default is "auto", which means the configure program
63a5f0fb15SPaul Saab     finds a regular expression library automatically.  Other values are:
64a15691bfSXin LI        gnu            Use the GNU regex library.
65a5f0fb15SPaul Saab        pcre           Use the PCRE library.
66b7780dbeSXin LI        pcre2          Use the PCRE2 library.
67a15691bfSXin LI        posix          Use the POSIX-compatible regcomp.
68a5f0fb15SPaul Saab        regcmp         Use the regcmp library.
69a5f0fb15SPaul Saab        re_comp        Use the re_comp library.
70a5f0fb15SPaul Saab        regcomp        Use the V8-compatible regcomp.
71a5f0fb15SPaul Saab        regcomp-local  Use Henry Spencer's V8-compatible regcomp
72a5f0fb15SPaul Saab                       (source is supplied with less).
7396e55cc7SXin LI        none           No regular expressions, only simple string matching.
74b7780dbeSXin LI
756dcb072bSXin LI   --with-secure
766dcb072bSXin LI     Builds a "secure" version of less, with some features disabled
776dcb072bSXin LI     to prevent users from viewing other files, accessing shell
786dcb072bSXin LI     commands, etc.
79a5f0fb15SPaul Saab
807f074f9cSXin LI
812235c7feSXin LI4. It is a good idea to look over the generated Makefile and defines.h
82a5f0fb15SPaul Saab   and make sure they look ok.  If you know of any peculiarities of
83a5f0fb15SPaul Saab   your system that configure might not have detected, you may fix the
84a5f0fb15SPaul Saab   Makefile now.  Take particular notice of the list of "terminal"
85a5f0fb15SPaul Saab   libraries in the LIBS definition in the Makefile; these may need
86a5f0fb15SPaul Saab   to be edited.  The terminal libraries will be some subset of
87a5f0fb15SPaul Saab       -lncurses  -lcurses  -ltermcap  -ltermlib
88a5f0fb15SPaul Saab
89a5f0fb15SPaul Saab   If you wish, you may edit defines.h to remove some optional features.
90a5f0fb15SPaul Saab   If you choose not to include some features in your version, you may
91a5f0fb15SPaul Saab   wish to edit the manual page "less.nro" and the help page "less.hlp"
92a5f0fb15SPaul Saab   to remove the descriptions of the features which you are removing.
93a5f0fb15SPaul Saab   If you edit less.hlp, you should run "make -f Makefile.aut help.c".
94a5f0fb15SPaul Saab
952235c7feSXin LI5. Type "make" and watch the fun.
96a5f0fb15SPaul Saab
972235c7feSXin LI6. If the make succeeds, it will generate the programs "less",
98a5f0fb15SPaul Saab   "lesskey" and "lessecho" in your current directory.  Test the
99a5f0fb15SPaul Saab   generated programs.
100a5f0fb15SPaul Saab
1012235c7feSXin LI7. When satisfied that it works, if you wish to install it
102a5f0fb15SPaul Saab   in a public place, type "make install".
103a5f0fb15SPaul Saab
104a5f0fb15SPaul Saab   The default install destinations are:
105a5f0fb15SPaul Saab        Executables (less, lesskey, lessecho) in /usr/local/bin
106a5f0fb15SPaul Saab        Documentation (less.nro, lesskey.nro) in /usr/local/man/man1
107a5f0fb15SPaul Saab   If you want to install any of these files elsewhere, define
108a5f0fb15SPaul Saab   bindir and/or mandir to the appropriate directories.
109a5f0fb15SPaul Saab
110a5f0fb15SPaul Saab
111a5f0fb15SPaul SaabNote to hackers: comments noting possible improvements are enclosed
112a5f0fb15SPaul Saabin double curly brackets {{ like this }}.
113a5f0fb15SPaul Saab
11433096f16SXin LI(Note that the above note was originally written at a time when
11533096f16SXin LI"hackers" most commonly meant "enthusiastic and dedicated computer
11633096f16SXin LIprogrammers", not "persons who attempt to circumvent computer security".)
11733096f16SXin LI
118a5f0fb15SPaul Saab
119a5f0fb15SPaul Saab
120a5f0fb15SPaul Saab=======================================================================
121a5f0fb15SPaul SaabINSTALLATION (MS-DOS systems only,
122a5f0fb15SPaul Saab              with Microsoft C, Borland C, or DJGPP)
123a5f0fb15SPaul Saab
124a5f0fb15SPaul Saab1. Move the distributed source to its own directory.
125a5f0fb15SPaul Saab   Depending on your compiler, you may need to convert the source
126a5f0fb15SPaul Saab   to have CR-LF rather than LF as line terminators.
127a5f0fb15SPaul Saab
1288ed69c6fSPaul Saab2. If you are using Microsoft C, rename MAKEFILE.DSU to MAKEFILE.
129a5f0fb15SPaul Saab   If you are using Borland C, rename MAKEFILE.DSB to MAKEFILE.
130a5f0fb15SPaul Saab   If you are using DJGPP, rename MAKEFILE.DSG to MAKEFILE.
131a5f0fb15SPaul Saab
132a5f0fb15SPaul Saab3. Look at MAKEFILE to make sure that the definitions for CC and LIBDIR
133a5f0fb15SPaul Saab   are correct.  CC should be the name of your C compiler and
134a5f0fb15SPaul Saab   LIBDIR should be the directory where the C libraries reside (for
135a5f0fb15SPaul Saab   Microsoft C only).  If these definitions need to be changed, you can
136a5f0fb15SPaul Saab   either modify the definitions directly in MAKEFILE, or set your
137a5f0fb15SPaul Saab   environment variables CC and/or LIBDIR to override the definitions
138a5f0fb15SPaul Saab   in MAKEFILE.
139a5f0fb15SPaul Saab
140a5f0fb15SPaul Saab4. If you wish, you may edit DEFINES.DS to remove some optional features.
141a5f0fb15SPaul Saab   If you choose not to include some features in your version, you may
142a5f0fb15SPaul Saab   wish to edit the manual page LESS.MAN and the help page HELP.C
143a5f0fb15SPaul Saab   to remove the descriptions of the features which you are removing.
144a5f0fb15SPaul Saab
145a5f0fb15SPaul Saab5. Run your "make" program and watch the fun.
146a5f0fb15SPaul Saab   If your "make" requires a flag to import environment variables,
147a5f0fb15SPaul Saab   you should use that flag.
148a5f0fb15SPaul Saab   If your compiler runs out of memory, try running "make -n >cmds.bat"
149a5f0fb15SPaul Saab   and then run cmds.bat.
150a5f0fb15SPaul Saab
151a5f0fb15SPaul Saab6. If the make succeeds, it will generate the programs "LESS.EXE" and
152a5f0fb15SPaul Saab   "LESSKEY.EXE" in your current directory.  Test the generated programs.
153a5f0fb15SPaul Saab
154a5f0fb15SPaul Saab7. When satisfied that it works, you may wish to install LESS.EXE and
155a5f0fb15SPaul Saab   LESSKEY.EXE in a directory which is included in your PATH.
156a5f0fb15SPaul Saab
157a5f0fb15SPaul Saab
158a5f0fb15SPaul Saab
159a5f0fb15SPaul Saab=======================================================================
160a5f0fb15SPaul SaabINSTALLATION (Windows-95, Windows-98 and Windows-NT systems only,
161a5f0fb15SPaul Saab              with Borland C or Microsoft Visual C++)
162a5f0fb15SPaul Saab
163a5f0fb15SPaul Saab1. Move the distributed source to its own directory.
164a5f0fb15SPaul Saab
165a5f0fb15SPaul Saab2. If you are using Borland C, rename Makefile.wnb to Makefile.
166a5f0fb15SPaul Saab   If you are using Microsoft Visual C++, rename Makefile.wnm to Makefile.
167a5f0fb15SPaul Saab
168a5f0fb15SPaul Saab3. Check the Makefile to make sure the definitions look ok.
169a5f0fb15SPaul Saab
170a5f0fb15SPaul Saab4. If you wish, you may edit defines.wn to remove some optional features.
171a5f0fb15SPaul Saab   If you choose not to include some features in your version, you may
172a5f0fb15SPaul Saab   wish to edit the manual page less.man and the help page help.c
173a5f0fb15SPaul Saab   to remove the descriptions of the features which you are removing.
174a5f0fb15SPaul Saab
175a5f0fb15SPaul Saab5. Type "make" and watch the fun.
176a5f0fb15SPaul Saab
177a5f0fb15SPaul Saab6. If the make succeeds, it will generate the programs "less.exe" and
178a5f0fb15SPaul Saab   "lesskey.exe" in your current directory.  Test the generated programs.
179a5f0fb15SPaul Saab
180a5f0fb15SPaul Saab7. When satisfied that it works, if you wish to install it
181a5f0fb15SPaul Saab   in a public place, type "make install".
182a5f0fb15SPaul Saab   See step 6 of the Unix installation instructions for details
183a5f0fb15SPaul Saab   on how to change the default installation directories.
184a5f0fb15SPaul Saab
185a5f0fb15SPaul Saab
186a5f0fb15SPaul Saab
187a5f0fb15SPaul Saab=======================================================================
188a5f0fb15SPaul SaabINSTALLATION (OS/2 systems only,
189a5f0fb15SPaul Saab              with EMX C)
190a5f0fb15SPaul Saab
191a5f0fb15SPaul Saab1. Move the distributed source to its own directory.
192a5f0fb15SPaul Saab
193a5f0fb15SPaul Saab2. Rename Makefile.o2e to Makefile.
194a5f0fb15SPaul Saab
195a5f0fb15SPaul Saab3. Check the Makefile to make sure the definitions look ok.
196a5f0fb15SPaul Saab
197a5f0fb15SPaul Saab4. If you wish, you may edit defines.o2 to remove some optional features.
198a5f0fb15SPaul Saab   If you choose not to include some features in your version, you may
199a5f0fb15SPaul Saab   wish to edit the manual page less.man and the help page help.c
200a5f0fb15SPaul Saab   to remove the descriptions of the features which you are removing.
201a5f0fb15SPaul Saab
202a5f0fb15SPaul Saab5. Type "make" and watch the fun.
203a5f0fb15SPaul Saab
204a5f0fb15SPaul Saab6. If the make succeeds, it will generate the programs "less.exe" and
205a5f0fb15SPaul Saab   "lesskey.exe" in your current directory.  Test the generated programs.
206a5f0fb15SPaul Saab
207a5f0fb15SPaul Saab7. Make sure you have the emx runtime installed. You need the emx DLLs
208a5f0fb15SPaul Saab   emx.dll and emxlibcs.dll and also the termcap database, termcap.dat.
209a5f0fb15SPaul Saab   Make sure you have termcap.dat either in the default location or
210a5f0fb15SPaul Saab   somewhere in a directory listed in the PATH or INIT environment
211a5f0fb15SPaul Saab   variables.
212a5f0fb15SPaul Saab
213c9346414SPaul Saab8. When satisfied that it works, you may wish to install less.exe,
214c9346414SPaul Saab   lesskey.exe and scrsize.exe in a directory which is included in
215c9346414SPaul Saab   your PATH.  scrsize.exe is required only if you use a terminal
216c9346414SPaul Saab   emulator such as xterm or rxvt.
217a5f0fb15SPaul Saab
218a5f0fb15SPaul Saab
219a5f0fb15SPaul Saab
220a5f0fb15SPaul Saab=======================================================================
221a5f0fb15SPaul SaabINSTALLATION (OS-9 systems only,
222a5f0fb15SPaul Saab              with Microware C or Ultra C)
223a5f0fb15SPaul Saab
224a5f0fb15SPaul Saab1. Move the distributed source to its own directory.
225a5f0fb15SPaul Saab
226a5f0fb15SPaul Saab2. If you are using Microware C, rename Makefile.o9c to Makefile.
227a5f0fb15SPaul Saab   If you are using Ultra C, rename Makefile.o9u to Makefile.
228a5f0fb15SPaul Saab
229a5f0fb15SPaul Saab3. Check the Makefile to make sure the definitions look ok.
230a5f0fb15SPaul Saab
231a5f0fb15SPaul Saab4. If you wish, you may edit defines.o9 to remove some optional features.
232a5f0fb15SPaul Saab   If you choose not to include some features in your version, you may
233a5f0fb15SPaul Saab   wish to edit the manual page less.man and the help page help.c
234a5f0fb15SPaul Saab   to remove the descriptions of the features which you are removing.
235a5f0fb15SPaul Saab
236a5f0fb15SPaul Saab5. Type "dmake" and watch the fun.
237a5f0fb15SPaul Saab   The standard OS-9 "make" will probably not work.  If you don't
238a5f0fb15SPaul Saab   have dmake, you can get a copy from os9archive.rtsi.com.
239a5f0fb15SPaul Saab
240a5f0fb15SPaul Saab6. If the make succeeds, it will generate the programs "less" and
241a5f0fb15SPaul Saab   "lesskey" in your current directory.  Test the generated programs.
242a5f0fb15SPaul Saab
243a5f0fb15SPaul Saab7. When satisfied that it works, if you wish to install it
244a5f0fb15SPaul Saab   in a public place, type "dmake install".
245a5f0fb15SPaul Saab   See step 6 of the Unix installation instructions for details
246a5f0fb15SPaul Saab   on how to change the default installation directories.
247a5f0fb15SPaul Saab
248c9346414SPaul Saab=======================================================================
249c9346414SPaul SaabACKNOWLEDGMENTS:
250c9346414SPaul Saab  Some versions of the less distribution are packaged using
251c9346414SPaul Saab  Info-ZIP's compression utility.
252c9346414SPaul Saab  Info-ZIP's software is free and can be obtained as source
253c9346414SPaul Saab  code or executables from various anonymous-ftp sites,
254c9346414SPaul Saab  including ftp.uu.net:/pub/archiving/zip.
255