Imported Upstream version 7.1
[platform/upstream/dos2unix.git] / INSTALL.txt
1 PREREQUISITES
2
3     Using GCC:
4         Required
5             * gcc          : GNU C compiler
6             * GNU binutils : A collection of binary tools
7             * GNU make     : make
8             * sh           : POSIX type shell
9             * GNU coreutils: Core utilities package (chmod, install, mkdir,
10                              mv, rm, uname)
11
12         Optional (depending on build targets):
13             * perl         : Practical Extraction and Report Language
14                              perl >= 5.10.1 is required for rebuilding the
15                              manual pages with perlpod.
16                              Self-tests require module perl-Test-Simple.
17             * gettext      : Framework to help GNU packages produce multi-
18                              lingual messages.
19             * po4a         : PO for anything, for rebuilding manuals.
20             * groff        : GNU troff text formatting system, for
21                              international messages and manuals.
22             * ghostscript  : An interpreter for the PostScript language and
23                              for PDF (ps2pdf)
24
25
26     Using LLVM CLANG:
27         Clang can be used as a drop-in replacement for gcc. Just add CC=clang to the make
28         command line.
29
30
31     Using Watcom C:
32         Required
33             * Open Watcom     : http://www.openwatcom.org/
34             * Open Watcom V2  : http://open-watcom.github.io/open-watcom/    (git repo)
35                                 http://sourceforge.net/projects/openwatcom/  (binaries download)
36
37
38     Using Microsoft Visual C++:
39         Required
40             * Visual C++   : You can get a free express version via this web page:
41                              http://www.visualstudio.com/products/visual-studio-express-vs
42                              Download Visual Studio for Windows Desktop. Visual C++ is part
43                              of Visual Studio. Out of the box compilation for 64-bit
44                              applications is supported since version 2012.
45
46
47
48 BASIC INSTALLATION
49
50     To build the program type:
51
52         make
53
54
55     To run the self-tests type:
56
57         make check
58
59
60     To strip the executables:
61
62         make strip
63
64
65     To install:
66
67         make install
68
69
70     Clean:
71
72         make clean
73
74
75 SELF-TESTS
76
77     To run the self-tests you need a Perl installation including
78     module perl-Test-Simple.
79
80     To check the native Windows ports you need to run the tests in
81     the MSYS2 shell.
82
83 INSTALLATION NAMES
84
85     By default the 'install' target will install the program in
86     /usr/bin, the language files in /usr/share/locale
87     and the man page in /usr/share/man. You can specify an
88     installation prefix other than /usr by modifying the
89     'prefix' variable. An Example:
90
91         make prefix=$HOME clean all
92         make prefix=$HOME install
93
94
95 DEBUG
96
97     A debug enabled build can be made by adding DEBUG=1
98     to the make command. Example:
99
100         make clean install DEBUG=1
101
102     With debug enabled dos2unix will print extra information
103     and you can debug the source code in gdb.
104
105
106 NATIVE LANGUAGE SUPPORT
107
108     Native Language Support (NLS) is by default enabled.
109     To disable NLS add ENABLE_NLS=. Example:
110
111         make clean install ENABLE_NLS=
112
113
114 INTERNATIONAL MAN PAGES
115
116     Since dos2unix 6.0.5 all man pages are encoded in UTF-8, because even
117     Western-European man pages may contain Unicode characters not supported by
118     the Latin-1 (ISO-8859-1) character set.
119
120     Originally the Unix man system supported only man pages in Latin1 format.
121     Although the world is moving to Unicode format (UTF-8) there is still a lot
122     of Latin1 legacy around.
123
124     The English man page is a pure ASCII file and is readable on all platforms.
125
126     Non-English man pages are encoded in UTF-8. These do not show properly on
127     old systems.  Man pages in UTF-8 format are shown properly on Linux. Not
128     all roff implementations support UTF-8.
129
130     In order to show UTF-8 man pages properly on Cygwin with traditional man
131     you need to do the following:
132
133     In /etc/man.conf, change the NROFF definition to use 'preconv'.
134
135         NROFF        /usr/bin/preconv | /usr/bin/nroff -c -mandoc 2>/dev/null
136
137     To view the man page set the correct locale. E.g. for Ukrainian:
138
139         export LANG=uk_UA.UTF-8
140         man dos2unix
141
142     With man-db the manpages show correctly out of the box. Cygwin changed to
143     use man-db in June 2014.
144     Man-db is the default man system on the major Linux distributions.
145
146
147 LARGE FILE SUPPORT
148
149     Large File Support (LFS) is by default enabled. This enables
150     the use of 64 bit file system interface on 32 bit systems.
151     This makes it possible to open files larger than 2GB on 32 bit
152     systems, provided the OS has LFS support builtin.
153     To disable LFS make the LFS variable empty. Example:
154
155         Disable LFS:
156         make clean install LFS=
157
158     The gcc compiler from the mingw.org project does not support LFS.
159     It is advised to use the mingw-w64 compiler tool chain for LFS on
160     32 bit Windows.
161
162
163 UNICODE SUPPORT
164
165     Unicode UTF-16 support is by default enabled for Windows and Unix.  To
166     disable make the UCS variable (Universal Character Set) empty.
167
168         Disable Unicode:
169         make clean install UCS=
170
171     Unicode UTF-16 is not supported by the DOS and OS/2 versions.
172
173
174 DOCUMENTATION
175
176     Manual pages are generated from Perl POD files.
177
178     The manual pages in text and html format are by default only
179     created in English language. To create text and html manuals
180     for other languages type:
181
182         make txt
183         make html
184
185     Once the manuals in non-English languages have been created,
186     they will also be installed under share/doc/ when you type
187     'make install'
188
189     Manuals in PDF format are by default not created.
190     To create manuals in PDF format type:
191
192         make pdf
193
194     PDF generation requires GhostScript to be installed.
195
196
197 WINDOWS 32 BIT PORT
198
199     Using Mingw compiler <http://www.mingw.org>:
200
201         make -f mingw.mak clean
202         make -f mingw.mak
203         make -f mingw.mak strip
204         make -f mingw.mak install
205
206     Using MinGW-w64 compiler <http://mingw-w64.sourceforge.net>:
207     I am using the MSYS2 project <http://sourceforge.net/projects/msys2/>
208     which includes the MinGW-w64 compiler and an updated MSYS shell based
209     on Cygwin 1.7.
210
211         make -f mingw32.mak clean
212         make -f mingw32.mak
213         make -f mingw32.mak strip
214         make -f mingw32.mak install
215
216     Or use Open Watcom and type:
217
218         wmake -f wccwin32.mak clean
219         wmake -f wccwin32.mak
220         wmake -f wccwin32.mak install
221
222     Or use Microsoft Visual C++ and type:
223
224         nmake /f vc.mak clean
225         nmake /f vc.mak
226         nmake /f vc.mak install
227
228
229     The win32 binaries built with MinGW32 are packed with a patched version of
230     MinGW's libintl-8.dll that has builtin support for relocation. See also
231     http://waterlan.home.xs4all.nl/libintl.html and
232     http://sourceforge.net/p/mingw/bugs/1808/
233     The MSYS2 project has the relocation patch already included.
234
235
236 WINDOWS 64 BIT PORT
237
238     To compile a version for 64 bit Windows, get the Mingw-w64 compiler
239     <http://mingw-w64.sourceforge.net>, and use makefile mingw64.mak:
240     I am using the MSYS2 project <http://sourceforge.net/projects/msys2/>
241     which includes the MinGW-w64 compiler and an updated MSYS shell based
242     on Cygwin 1.7.
243
244         make -f mingw64.mak clean
245         make -f mingw64.mak
246         make -f mingw64.mak strip
247         make -f mingw64.mak install
248
249     Or use Microsoft Visual C++. Visual Studio Express supports
250     out of the box C/C++ compilation for 64-bit applications since
251     version 2012. Start an "x64 Cross Tools Command Prompt" and
252     type:
253
254         nmake /f vc.mak clean
255         nmake /f vc.mak
256         nmake /f vc.mak install
257
258
259 DOS PORT, 32 BIT
260
261     To compile a version for DOS, get the DJGPP compiler
262     <http://www.delorie.com/djgpp/>, and use makefile djgpp.mak.
263     DJGPP gcc >= 4.6 seems to cause problems. Crashes of gcc itself,
264     or crashing dos2unix binaries (seen in DOSBox and DOSEMU).
265     Use DJGPP gcc <= 4.5.3.
266
267
268         make -f djgpp.mak clean
269         make -f djgpp.mak
270         make -f djgpp.mak strip
271         make -f djgpp.mak install
272
273     Or use Open Watcom
274     Cross compiling from Windows 32 bit. This works.
275
276         wmake -f wccdos32.mak clean
277         wmake -f wccdos32.mak
278         wmake -f wccdos32.mak install
279
280
281 DOS PORT, 16 BIT
282
283     To compile a version for DOS, use the Borland C compiler 3.1 or 4.0,
284     and use makefile bcc.mak:
285
286         make -f bcc.mak clean
287         make -f bcc.mak
288
289     Or use Open Watcom
290
291         wmake -f wccdos16.mak clean
292         wmake -f wccdos16.mak
293         wmake -f wccdos16.mak install
294
295
296 OS/2 PORT
297
298     Using EMX
299
300         make -f emx.mak clean
301         make -f emx.mak
302         make -f emx.mak strip
303         make -f emx.mak install
304
305     Open Watcom
306
307         wmake -f wccos2.mak clean
308         wmake -f wccos2.mak
309         wmake -f wccos2.mak install
310