6 * GNU binutils : A collection of binary tools
8 * sh : POSIX type shell
9 * GNU coreutils: Core utilities package (chmod, install, mkdir,
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 pod2man.
16 perl >= 5.18 is required for rebuilding the
17 international manual pages correctly in HTML with pod2html.
18 Self-tests require module perl-Test-Simple.
19 * gettext : Framework to help GNU packages produce multi-
21 * po4a : PO for anything, for rebuilding manuals.
22 * groff : GNU troff text formatting system, for
23 international messages and manuals.
24 * ghostscript : An interpreter for the PostScript language and
29 Clang can be used as a drop-in replacement for gcc. Just add CC=clang to the make
35 * Open Watcom : http://www.openwatcom.org/
36 * Open Watcom V2 : http://open-watcom.github.io/open-watcom/ (git repo)
37 http://sourceforge.net/projects/openwatcom/ (binaries download)
40 Using Microsoft Visual C++:
42 * Visual C++ : You can get a free community version via this web page:
43 https://www.visualstudio.com/vs/community/
44 Download Visual Studio for Windows Desktop. Visual C++ is part
45 of Visual Studio. Out of the box compilation for 64-bit
46 applications is supported since version 2012.
52 To build the program type:
57 To run the self-tests type:
62 To strip the executables:
79 To run the self-tests you need a Perl installation including
80 modules perl-Test-Harness and perl-Test-Simple.
82 To check the native Windows ports you need to run the tests in
85 To run the tests in a DJGPP environment you need to make sure
86 that the bash shell is available (sh.exe). And you need to be
87 in an environment that supports long file names (LFN), e.g. on
96 Via the make variable PROVE_OPT extra arguments can be given to
97 the prove command. E.g.:
99 make test PROVE_OPT=--color
104 By default the 'install' target will install the program in
105 /usr/bin, the language files in /usr/share/locale
106 and the man page in /usr/share/man. You can specify an
107 installation prefix other than /usr by modifying the
108 'prefix' variable. An Example:
110 make prefix=$HOME clean all
111 make prefix=$HOME install
116 A debug enabled build can be made by adding DEBUG=1
117 to the make command. Example:
119 make clean install DEBUG=1
121 With debug enabled you can debug the source code in gdb.
126 Extra debug messages can be enabled by adding DEBUGMSG=1
127 to the make command. Example:
129 make clean install DEBUGMSG=1
131 With debug messages enabled dos2unix will print extra information
132 about accessing the file system.
135 NATIVE LANGUAGE SUPPORT
137 Native Language Support (NLS) is by default enabled.
138 To disable NLS add ENABLE_NLS=. Example:
140 make clean install ENABLE_NLS=
143 INTERNATIONAL MAN PAGES
145 Since dos2unix 6.0.5 all man pages are encoded in UTF-8, because even
146 Western-European man pages may contain Unicode characters not supported by
147 the Latin-1 (ISO-8859-1) character set.
149 Originally the Unix man system supported only man pages in Latin1 format.
150 Although the world is moving to Unicode format (UTF-8) there is still a lot
151 of Latin1 legacy around.
153 The English man page is a pure ASCII file and is readable on all platforms.
155 Non-English man pages are encoded in UTF-8. These do not show properly on
156 old systems. Man pages in UTF-8 format are shown properly on Linux. Not
157 all roff implementations support UTF-8.
159 In order to show UTF-8 man pages properly on Cygwin with traditional man
160 you need to do the following:
162 In /etc/man.conf, change the NROFF definition to use 'preconv'.
164 NROFF /usr/bin/preconv | /usr/bin/nroff -c -mandoc 2>/dev/null
166 To view the man page set the correct locale. E.g. for Ukrainian:
168 export LANG=uk_UA.UTF-8
171 With man-db the manpages show correctly out of the box. Cygwin changed to
172 use man-db in June 2014.
173 Man-db is the default man system on the major Linux distributions.
178 Large File Support (LFS) is by default enabled. This enables
179 the use of 64 bit file system interface on 32 bit systems.
180 This makes it possible to open files larger than 2GB on 32 bit
181 systems, provided the OS has LFS support builtin.
182 To disable LFS make the LFS variable empty. Example:
185 make clean install LFS=
187 The gcc compiler from the mingw.org project does not support LFS.
188 It is advised to use the mingw-w64 compiler tool chain for LFS on
194 Unicode UTF-16 support is by default enabled for Windows and Unix. To
195 disable make the UCS variable (Universal Character Set) empty.
198 make clean install UCS=
200 Unicode UTF-16 is not supported by the DOS and OS/2 versions.
203 UNICODE FILE NAME SUPPORT ON WINDOWS
205 Since version 7.3 dos2unix can read and write on Windows file names
206 with Unicode characters. Prior to version 7.3 dos2unix could only open
207 files with characters in the system ANSI code page.
209 To see if dos2unix on Windows has unicode file name support type dos2unix -V.
211 Unicode file name support on Windows is enabled by setting UNIFILE=1 in
212 the makefile or on the make command line.
214 To disable Unicode file name support, make UNIFILE empty:
218 Unicode file name support is by default enabled.
220 Dos2unix built with Watcom C is not able to display foreign characters
221 correctly, even when option -D unicode is used. The correct file names
227 Manual pages are generated from Perl POD files.
228 To rebuild the man pages from POD type:
230 make maintainer-clean
233 Manuals in PDF format are by default not created.
234 To create manuals in PDF format type:
238 PDF generation requires GhostScript to be installed.
243 Using Mingw <http://www.mingw.org>, or MinGW-w64
244 <http://mingw-w64.sourceforge.net>.
246 I advise to use mingw-w64, because mingw-w64 has support for
247 Large File Support (LFS), and mingw doesn't. LFS is the ability to
248 read/write files larger than 2GB or 4GB on a 32 bit operation system.
249 LFS also makes processing files on network drives more reliable. I have
250 had a problem report that output files were not always written when files
251 on a network drive were concurrently processed. By switching from
252 mingw to mingw-w64 the problem was solved.
253 Earlier I got a problem report of accessing small files on a Windows
254 network drive from Debian Linux. Here also the solution was LFS.
255 Since dos2unix 6.0.4 (2013-12-30) I build the binary win32 packages
258 I am using the MSYS2 project <http://sourceforge.net/projects/msys2/>
259 which includes the MinGW-w64 compiler.
261 The MSYS(2) environment is required for building dos2unix with MinGW(-w64).
264 Type these commands to build with mingw(-w64):
273 wmake -f wccwin32.mak clean
274 wmake -f wccwin32.mak
275 wmake -f wccwin32.mak install
277 Using Microsoft Visual C++:
279 nmake /f vc.mak clean
281 nmake /f vc.mak install
284 The win32 binaries built with MinGW32 are packed with a patched version of
285 MinGW's libintl-8.dll that has builtin support for relocation. See also
286 http://waterlan.home.xs4all.nl/libintl.html and
287 http://sourceforge.net/p/mingw/bugs/1808/
288 The MSYS2 project has the relocation patch already included.
293 To compile a version for 64 bit Windows, get the Mingw-w64 compiler
294 <http://mingw-w64.sourceforge.net>.
295 I am using the MSYS2 project <http://sourceforge.net/projects/msys2/>
296 which includes the MinGW-w64 compiler.
298 The MSYS2 environment is required for building dos2unix with MinGW-w64.
305 Or use Microsoft Visual C++. Visual Studio Express supports
306 out of the box C/C++ compilation for 64-bit applications since
307 version 2012. Start an "x64 Cross Tools Command Prompt" and
310 nmake /f vc.mak clean
312 nmake /f vc.mak install
317 To compile a version for DOS, get the DJGPP compiler
318 <http://www.delorie.com/djgpp/>, and use makefile djgpp.mak.
319 DJGPP 2.03 gcc >= 4.6 seems to cause problems. Crashes of gcc itself,
320 or crashing dos2unix binaries (seen in DOSBox and DOSEMU).
321 Use DJGPP 2.03 gcc <= 4.5.3.
323 DJGPP 2.05 seems to produce correct binaries (I tried gcc 5.3.0).
326 make -f djgpp.mak clean
328 make -f djgpp.mak strip
329 make -f djgpp.mak install
331 Cross compilation with djgpp.mak works out-of-the-box in Cygwin if
332 you have djgpp-gcc-core installed. On Linux you can add CROSS_COMP=1
337 Cross compiling from Windows 32 bit. This works.
339 wmake -f wccdos32.mak clean
340 wmake -f wccdos32.mak
341 wmake -f wccdos32.mak install
346 To compile a version for DOS, use the Borland C compiler 3.1 or 4.0,
347 and use makefile bcc.mak:
349 make -f bcc.mak clean
354 wmake -f wccdos16.mak clean
355 wmake -f wccdos16.mak
356 wmake -f wccdos16.mak install
363 make -f emx.mak clean
365 make -f emx.mak strip
366 make -f emx.mak install
370 wmake -f wccos2.mak clean
372 wmake -f wccos2.mak install