Tofrodos Ver 1.6
Copyright (c) 1996-2002 by Christopher Heng. All rights reserved.
-----------------------------------------------------------------

$Id: readme.txt 1.11 2002/07/01 07:26:43 chris Exp $


CONTENTS
--------

1. WHAT IS TOFRODOS?
2. WHAT'S NEW IN VERSION 1.6
3. HOW TO INSTALL TOFRODOS?
4. COMPILING TOFRODOS IN LINUX
5. COMPILING TOFRODOS IN MSDOS AND WIN32
6. PORTING TO OTHER SYSTEMS
7. HISTORY OF CHANGES
8. COPYRIGHT AND CONTACTING THE AUTHOR


1. WHAT IS TOFRODOS?
--------------------

DOS text files traditionally have CR/LF (carriage return/line feed) pairs
as their new line delimiters while Unix text files traditionally have
LFs (line feeds) to terminate each line.

Tofrodos comprises two programs, "fromdos" and "todos", which convert
text files to and from these formats. Use "fromdos" to convert DOS
text files to the Unix format, and "todos" to convert Unix text files
to the DOS format.


2. WHAT'S NEW IN VERSION 1.6
----------------------------

- Added support for the LCC-Win32 compiler (Windows)


3. HOW TO INSTALL TOFRODOS?
---------------------------

The Tofrodos package comes with sources as well as precompiled
executables (binaries) for the Win32 console mode. You may
compile the package for other operating systems (including
Linux) using your system C compiler. Documentation is provided
in the form of a Unix manual page.

To install the Win32 console version, do the following:
	copy todos.exe {destination directory}\todos.exe
	copy fromdos.exe {destination directory}\fromdos.exe

To read a summary of the options, run the program with the -h
or /h option.


4. COMPILING TOFRODOS IN LINUX
--------------------------------

I've stopped distributing precompiled versions of Tofrodos for
Linux since it's a simple matter to compile it yourself under
Linux. The process should be painless and fast, since the source
code is small.

Compiling everything under Linux is simple. Simply do

	cd src
	make all

You can then install by typing

	make install

To install them somewhere other than /usr/local/bin, redefine
BINDIR and MANDIR for the binary and manual page destinations
respectively. For example, to install the binaries in /usr/bin
and the manual page in /usr/man/man1, do

	make BINDIR=/usr/bin MANDIR=/usr/man/man1 install

To read the manual page after installation, simply type

	man fromdos


5. COMPILING TOFRODOS IN MSDOS AND WIN32
------------------------------------------

Tofrodos comes with binaries (executables) for the Win32 console
mode. However, if you prefer to recompile tofrodos yourself,
there are a few makefiles you may use, depending on the compiler
you have on your system.

To compile Tofrodos under MSDOS or Windows 95/NT, simply use
the appropriate makefile for your compiler or roll your own.

Makefiles for use with the following compilers and their MAKE
utilities are as follows:

	makefile.wcc	Watcom C/C++ 10.x and WMAKE.EXE (DOS 16/32 bit
			and Win32 targets)
	makefile.vc	Visual C++ 6.0 and NMAKE.EXE (Win32 target)
			(uses tofrodos.mak and tofrodos.dep)
	makefile.bc	Borland C/C++ 4.5x/5.0x/5.5 and MAKE.EXE (DOS
			16 bit and Win32 targets)
	makefile.dj2	DJGPP 2.0x and GNU make.exe (DOS 32 bit target)
	makefile.dm	Digital Mars C/C++ 8.X+ and MAKE.EXE
			(Win32 target). See notes below for limitations.
	makefile.lcc	LCC-Win32 3.X+ (Win32 target). See notes below
			for limitations.

Note that the default Makefile is for use with the GNU C compiler and
GNU make on a Linux system. Do not use it under Windows or MSDOS.

You can probably adapt the makefiles for other compilers or other
versions of the above compilers.

i. Recompiling with Watcom C/C++

To recompile with Watcom C/C++, copy the file
	SRC\STARTUP\WILDARGV.C
from your WATCOM directory to the src\lib subdirectory. For example, if
you installed Watcom to C:\WATCOM, and you expanded the tofrodos
package into D:\TOFRODOS, do the following:
	copy C:\WATCOM\SRC\STARTUP\WILDARGV.C D:\TOFRODOS\src\lib

If you cannot find wildargv.c on your hard disk, copy it from your Watcom
CDROM. Don't ask me to distribute it. It's copyrighted material owned by
Watcom (or whatever).

To create the MSDOS executables, do the following:
	cd src
	wmake -f makefile.wcc TARGET=16bit all

To create a Win32 console executable, the following command line can be
used:
	cd src
	wmake -f makefile.wcc TARGET=Win32 all

Make sure you do a
	wmake -f makefile.wcc clean
before compiling again for a different target or the response files
and object files will be wrong for the new target.

Note that although I only tested the makefile with version 10.6
of the compiler, it should work with any 10.X version and probably
also with later versions.

ii. Recompiling with Visual C/C++

Visual C/C++ 6.0 can only create Win32 console executables. Use the
following procedure to create todos.exe and fromdos.exe.

	cd src
	nmake -f makefile.vc all

There should be no warnings or errors.

Note: the following files are part of the set of makefiles used by the
Visual C++ compiler:
	makefile.vc
	tofrodos.mak
	tofrodos.dep
	tofrodos.dsp
	tofrodos.dsw

iii. Recompiling with Borland C/C++

To compile with the free command line version of Borland C++ 5.5,
installed with the directory structure used by default by the
Borland installer (ie into C:\Borland\BCC55), change into the
Tofrodos source directory, ie,

	cd src

Then type in the following command line. The command line is to be
typed in as one line even though it appears as two lines below (the
command is too long to fit into one line for the purpose of this
Readme file).

make BCDIR=C:\Borland\BCC55 WILDOBJ=C:\Borland\BCC55\Lib\wildargs.obj
-f makefile.bc all

This will make the Win32 console version of todos and fromdos.

To compile with BC++ 4.5x or 5.0x, you need to define the macro BCDIR
to point to the root directory where you installed your compiler
files. For example, if you installed your Borland files in C:\BC45,
you might use the following command line
	cd src
	make BCDIR=C:\BC45 -f makefile.bc all

To compile for MSDOS, define the SYSTEM macro to dos, for eg,
	cd src
	make SYSTEM=dos -f makefile.bc all

To compile for Win32, define the SYSTEM macro to win32, as follows:
	cd src
	make SYSTEM=win32 -f makefile.bc all

Don't forget to define the BCDIR macro when you do the above. Also,
make sure you do a
	make -f makefile.bc clean
before you compile again for a different target or the configuration
files and object files will be wrong for the new target.

The default is to compile for Win32. There should be no warnings or
errors.

iv. Recompiling with DJGPP 2.0x

To compile with DJGPP 2.0x, use makefile.dj2 provided in the package
and run it as follows:

	cd src
	make -f makefile.dj2 all

There should be no warnings or errors.

v. Recompiling with Digital Mars C/C++

To compile with the Digital Mars compiler, use the makefile.dm
provided in the package and run it with the Digital Mars MAKE.EXE
utility as follows:

	cd src
	make -fmakefile.dm all

There should be no warnings or errors. Note that if you compile
with this compiler, the resulting executable will not be able
to process wildcard arguments. If you want tofrodos to handle
arguments like *.html or *.c, use the precompiled executable that
came with the package.

v. Recompiling with LCC-Win32

To compile with LCC-Win32, use the makefile.lcc provided in the
package and run it with the LCC-Win32 MAKE.EXE utility as follows:

	cd src
	make -f makefile.lcc all

There should be no warnings or errors. Note that if you compile
with this compiler, the resulting executable will not be able
to process wildcard arguments. If you want tofrodos to handle
arguments like *.html or *.c, use the precompiled executable that
came with the package.


6. PORTING TO OTHER SYSTEMS
---------------------------

If you want to compile Tofrodos for a system other than Linux, MSDOS
or Win32 you may or may not have some work in store for you. The
program is actually VERY trivial, so the work you need to do is
probably (hopefully) minimal.

The first place to look into is probably the config.h file, where I
tried to place as much system and compiler macros as I could bother.

If you are compiling on other Unix systems, tweaking the config.h file
macros may well be all that you need to do. I have reports of success
with people using it on HP-UX and others.


7. HISTORY OF CHANGES
---------------------

Dates given are the dates where the code base was finalised and do not
necessarily refer to the date of public release.

Version 1.6	1 July 2002		Added support for LCC-Win32 and BCC 5.5
Version 1.5	19 June 2002		Minor fixes to documentation.
					Added support for the Digital Mars C/C++
					compiler (Win32 console mode)
Version 1.4	16 March 1999		Fixed bug when using -b on
					a file not in the current directory.
					Added RPM support.
Version 1.3	8 October 1997		Added new option (-p) to preserve
					file ownership and time.
					Added support for Win32 compilation
					and some compilers under DOS and
					Windows.
Version 1.2	5 April 1997		(Internal version - not publicly
					released.)
Version 1.1	16 December 1996	Fixed bug in creation of temporary
					filename on Linux.
					Fixed bug in creation of backup
					filename on Linux.
Version 1.0	22 June 1996		Initial version.


8. COPYRIGHT AND CONTACTING THE AUTHOR
--------------------------------------

The program and its accompanying files and documentation are
Copyright (c) 1996-2002 by Christopher Heng. All rights reserved.
They are distributed under the terms of the GNU General Public License
Version 2, a copy of which is enclosed in this package in the file COPYING.

You can retrieve the latest version of tofrodos from the following
website:
	http://www.thefreecountry.com/

If you need to contact me, you can use the feedback form at the
following URL:
	http://www.thefreecountry.com/feedback.php

While I generally like to hear from you if you are using this program,
especially if you find any bugs in it, I make no promises about fixing
anything or even replying. If you do contact me, please also let me have
the following information:

	1. The version of tofrodos that you are using;
	2. The operating system (and its version) on which you are
	running the program (eg, Linux 2.0.30, or MSDOS 6.22,
	Windows 95/98/ME/NT/2k/XP, OS/2 or all of the above).
	If the bug only surfaces in one of the operating systems and not
	the other, please also note this.
	3. Any other information which you think might be relevant.

This will help me give you a more relevant reply (and also to trace
whatever bugs that may be present).
