tofrodos Ver 1.4
Copyright (c) 1996-1999 by Christopher S L Heng. All rights reserved.
---------------------------------------------------------------------

$Id: readme.txt 1.7 1999/03/15 14:16:24 chris Exp $ /*


CONTENTS
--------

1. WHAT IS TOFRODOS?
2. WHAT'S NEW IN VERSION 1.4
3. HOW TO INSTALL TOFRODOS?
4. RECOMPILING TOFRODOS IN LINUX
5. RECOMPILING 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.4
----------------------------

Bug fix: -b on Unix systems would cause the program to crash
if the file it was operating on was not in the current directory.


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

The tofrodos package comes with sources and binaries for Linux,
MSDOS and Win32. Documentation is provided in the form of a
Unix manual page.

To install the MSDOS version, do the following:
	copy todos16.exe {destination directory}\todos.exe
	copy todos16.exe {destination directory}\fromdos.exe
where {destination directory} is a directory in your path.

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

The Win32 version supports long filenames.

You will have to read the manual page from a Unix system (like
Linux) or use a DOS program that can read Unix manual pages.
For a short summary of options, run the program with the -h
or /h option. And of course, you can always read the source code.

To install the Linux versions, simply do

	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

Note that the binaries require the shared libraries of libc5.
If you are using libc6 or later, you will probably need to
recompile.


4. RECOMPILING TOFRODOS IN LINUX
--------------------------------

Recompiling everything under Linux is simple. Simply do

	make all

You can then install as noted above.


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

To recompile 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 and MAKE.EXE (DOS
			16 bit and Win32 targets)
	makefile.dj2	DJGPP 2.0x and GNU make.exe (DOS 32 bit target)

Note that the default Makefile is for use with the GNU C compiler and
GNU make on a Linux system.

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 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\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:
	wmake -f makefile.wcc TARGET=16bit all

To create a Win32 console executable, the following command line can be
used:
	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.

There should be no warnings or errors. This compiler was used to
compile the supplied binaries for MSDOS. The end result
of the above actions is that you have two executable files: todos.exe
and fromdos.exe.

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 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.

	nmake -f makefile.vc all

There should be no warnings or errors. This compiler was used
to compile the supplied binaries for Win32.

iii. Recompiling with Borland C/C++

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
	make BCDIR=C:\BC45 -f makefile.bc all

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

To compile for Win32, define the SYSTEM macro to win32, as follows:
	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:

	make -f makefile.dj2 all

There should be no warnings or errors.


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 don't know. I never tried
it on any Unix system or Unix-clone other than Linux. Let me know how
it works out, especially if you had to hack something other than changing
the values of the macros in config.h to get it to work.


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.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-1999 by Christopher S L 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 contact me at the following email addresses:
	chrisheng@bigfoot.com
	cyfheng@singnet.com.sg

The latest version of tofrodos can usually be retrieved from my web site:
	http://chrisheng.cjb.net/		(Singapore)
	http://web.singnet.com.sg/~cslheng/	(Singapore)
	http://chrisheng.hypermart.net/		(USA)
	http://thor.prohosting.com/~cslheng/	(USA)

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 email 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/NT, 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).
