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