Hi! That's the readme file for the sources.

0.  Urgent! I'm in a hurry ...
1.  Introduction
2.  What do you need
2.1 For the DOS version
2.2 For the Linux version
2.3 For the Windows 95/8/Me and Windows NT,2k,XP version
2.4 Additional requirements
3.  How to compile
3.1 How to create the DOS installer
4.  DJGPP v2.02 optional patch

-----------------------------------------------------------------------------

0. Urgent! I'm in a hurry ...

  If you are running Linux or djgpp equiped with most UNIX tools (shell
utils, file utils, perl, make, etc.) you can try the following:
[Windows NT users skip it]

1) Install, configure, make and make install the Turbo Vision library (last
version available).
2) Do the same with the editor, here is how if you don't know:

A) Run the configure script (./configure or configure).

Examples:
   linux:/usr/src/tvision# ./configure
   c:\djgpp\contrib\tvision>configure

B) If all is OK run "make".
C) If all is OK just run "make install".

  With it you'll get the editor compiled and installed.
  If the configure script makes a wrong guess about something and you want to
run it again delete the configure.cache file to force a new fresh
configuration.
  If the installation prefix directory is wrongly guessed call the configure
script passing --prefix=dir as argument.
Example:
  linux:/usr/src/tvision# ./configure --prefix=/usr/local

  If you are using Windows NT just read the WinNT\README file.
  Note: This mechanism works for MingW32 (Win95/8) but you need some GNU
tools installed that are not included in the MingW32 package.



1. Introduction:

  For information about copyrights read the copyrigh file, the editor is
mostly GPL/LGPL. I made it GPL because is the less restrictive license for
developing, not for people trying to use the editor's sources. Why? if the
code is GPL I can use GPL sources in my code without problems and I want to
use good code from others instead of reinventing things.
  Note: I put a lot of effort to make the compilation smooth but you should
read all the docs and get all the needed tools.



2. What do you need:

  Don't get mad if I forgot anything in this list, just report your problems.
  I think the best way to compile is using the configure/make/make install
mechanism described in the 0 chapter. That's the best for a first
compilation, if you then need to change things I'll suggest using RHIDE.
  The requirement sections will help you to know if you need extra stuff.

2.1 For the DOS version:

* DJGPP v2.03 or 2.02; v2.01 have some bugs that affect the editor and this
release doesn't include the patches to fix it.
* GCC 2.7.x/2.8.x/2.9.x or EGCS 1.x. Currently I use gcc 2.95.2. You'll need
the C++ stuff.
* RHIDE 1.4.9, a previous version won't work and 1.4 will probably crash if
you try to load the project files included here. You can just use make
instead. Download from http://www.rhide.com/.
* The last release of Turbo Vision. As I'm the maintainer I release a version
each time I release the editor.
* Allegro 3.1/3.11/3.12 (with my 16 bits mixing routines ;-). Download it
from Simtelnet. You don't need it if you disable the MP3 support or let the
configure script detect it isn't installed.
* LibAMP, I included the sources in the mp3/libamp directory. Read more about
it in the makes/readme.txt. You don't need it if you disable the MP3 support.
  A copy of LibMpegSound is also included for MP3 support.
* ZLib 1.1.2 or compatible. I included sources of the version I'm using in
the libz directory (not zlib directory), just run make in this directory to
get it working. If you use the makefile it will compile this library.
* If you want to compile the documentations you'll need Texinfo 3.12 (3.9 and
4.0 works too), additionally if you want postscript you'll need TeX.
* If you want to run some scripts floating around you'll need Perl 5.x. The
scripts are needed to install or create the distribution. Currently they are
also needed for the configure script.
* Gettext library, if you don't have it you must tweak TVision to drop the
international support and define NO_INTL_SUP in ceditint.h. The package is
called gtxt032b.zip and is available in Simtelnet (v2gnu directory). The
configure script detects it.
 Note that now the editor supports gtxt037b.zip + licv16b.zip and 039/17 but
I *do not* recommend it, the size of the executable grows 829 Kb for the
uncompressed image and 614 Kb for the compressed one.
 Now I included a gettext library version 0.10.39 but specially configured to
avoid using libiconv. You can enable it by passing the --shipped-intl
parameter to the configuration script.
* PCRE library v2.0.7. That's Perl Compatible Regular Expressions. I also
included sources of it, look in libpcre. Also compiled by the makefile.
* GNU Recode 3.4 package to create the international translations. If you use
version 3.5 you'll get some warnings, just ignore them.

  If you don't want MP3 support you can compile the editor without it
commenting the #define SUP_MP3 line in ceditint.h. And removing the
references to alleg and amp in the makes/rhide.env and/or editor.mak. I say
it in various places in the hope you'll understand what's needed ;-)
  If you don't want the PCRE support you can compile the editor without Perl
regex commenting the #define SUP_PCRE line in ceditint.h.
  If you don't want ZLib support you can compile the editor without gzip
internal support, that's a bad idea because when editing .gz files the editor
won't save the file compressed, commenting the #define SUP_GZ line in
ceditint.h.
  You can simply use the configure script to detect what is and what isn't
installed in your system and configure the make process according to it. To
run it you'll need a lot of UNIX tools (shell utils, file utils, Perl, etc.).

2.2 For the Linux version:

  Note: I encourage using the configure script, but if it fails or you are
porting to a system similar to Linux you'll need this information:

* Linux 2.0.X, Robert uses 2.0.29 and I use 2.0.34/5/6/8. I guess other 2.0.x
versions should do the work OK. I use Debian 2.0/1/2 and 3.0 to do the work.
I also used 2.2.10 and 2.2.17/18 for distributions.
* GCC 2.7.x/2.8.x/2.9.x/3.0/3.1 or EGCS 1.x. Currently I use gcc 2.95.3, but
also 2.95.2 for Win32 and 2.8.1 for DOS. You'll need the C++ stuff.
* GLibc 2.x. The projects are for glibc 2, if you don't have it try using
libc5 and adding gettext as library. See the rhide.env file for adding
"magical" libraries without touching the projects. The configure script
doesn't detect it because I don't have any system with libc5 at hand.
* RHIDE 1.5, a previous version won't work and 1.4 will probably crash if
you try to load the project files included here. Or just use make instead.
Download from http://www.rhide.com/
* The last release of Turbo Vision. As I'm the maintainer I release a version
each time I release the editor.
* ZLib 1.1.2/3 or compatible. Sources are included in libz directory, compile
it if you don't use the configure script. If you use the makefile it will
compile this library.
* If you want to compile the documentations you'll need Texinfo 3.12 (I think
3.9 and 4.0 works too), additionally if you want postscript you'll need TeX.
Note: I found that makeinfo (the program needed to create the docs) is located
in a very strange package in Debian distributions, I think is inside the Tetex
package, as that's huge I just extracted the needed file.
* If you want to run some scripts floating around you'll need Perl 5.x. The
scripts are needed to install or create the distribution. The configure
script needs Perl.
* NCurses, I use v4.2, I used v3.4 and works too even when you lose some
small features. The 5.0 and 5.2 also works.
* GPM, I use 1.17. Compiling with 1.13 works but be careful 1.13 and 1.14+
are incompatible at binary level.
* gzip and tar are needed to create the distribution and install the package.
* The headers of the X11R6 Xlib. That's needed to compile gkeyli.cc which
uses the keysyms values. The configure script detects it.
* PCRE library v2.0.7. That's Perl Compatible Regular Expressions. I also
included sources of it, look in libpcre. Also compiled by the makefile.
* GNU Recode 3.4 package to create the international translations. If you use
version 3.5 you'll get some warnings, just ignore them.
* I included support for MP3s. You can enable/disable it.

  If you don't want PCRE support you can compile the editor without Perl
regex commenting the #define SUP_PCRE line in ceditint.h.
  If you don't want ZLib support you can compile the editor without gzip
internal support, that's a bad idea because when editing .gz files the editor
won't save the file compressed, commenting the #define SUP_GZ line in
ceditint.h.
  To create the .deb package you'll need Debian Helpers v1.2.9 or newer.
Download it from Potato distribution. Just run "debian/rules binary" from
this directory. Be sure debian/rules is executable ;-)



2.3 For the Windows 95/8/Me and Windows NT,2k,XP version:

  Currently you can use Cygwin, MinGW or BC++ 5.5. In the near future you'll
be able to use MSVC also.
  Cygwin:
  You'll need to install the base tools plus Perl. I also recommend libz,
libpcre and libbzip2. You can use the configure script located in the root
directory of the distribution.
  MinGW:
  Last test was with MinGW 1.1+MSys 1.0.7+SiePerl as described in the win32
directory of Turbo Vision distribution. Also use the configure mechanism.
Attention!!! never run the editor from the MSys prompt, at least in v1.0.7 it
doesn't support Win32 console applications (redirects stdin/stdout).
  BC++:
  Currently this port requires BC++ 5.5, it can be freely downloaded from
Borland's site. For more information read the WinNT\README file. Lamentably
you can't use the configure script for it.

2.5 Additional requirements:

* A huge pair of balls ... crystal ones ;-))). Really: you'll need to be
patient not all will work in the first try and perhaps you'll need to write
me an e-mail to get help. The configure script helps a lot so try to get it
running.
* A good machine with a lot of memory or you'll need to wait a lot to compile
I used an AMD K6-2 of 300 MHz with 64 Mb of SDRAM and an UltraDMA 2 disk and
even a Cyrix 5x86 of 120 MHz with 32 Mb of DRAM and an ATA-2 disk and the
difference of time is huge (2.5 or 3 times). Currently I use an AMD K7 XP
running at 1533 MHz (XP 1800+) with 256 Mb of SDRAM and ATA100 HDs, I also
avoid using gcc 3.x, this makes compilation really fast.
* In DOS I work in a directory called e:/dj/contrib/setedit, I think any
directory will work but TVision should be at the same level than setedit
directory in the tree because I use relative paths for it. Under Linux I use
/usr/src/setedit. You can also use the configure/install mechanism to avoid
it. When using BC++ 5.5 you can't use the configure script so you must
install the sources as the WinNT\README file explains.



3. How to compile:

  Try what I explain in the "0. Urgent! I'm in a hurry ..." chapter or keep
reading.
  Read the makes/readme.txt for it.

3.1 How to create the DOS installer:

  Run "make installer" from the makes directory or if you want to debug and
edit the sources use "rhide install" (in the makes directory) and to create
the full installer run the Perl script found in install directory.



4. DJGPP v2.02 optional patch

  DJGPP v2.02 have a bug in the system/spawn family of functions. They leak a
file handle and, which is worst, they left the file you execute open if
that's a regular .exe (not another djgpp program). It could be very annoying
for people using the editor as some kind of IDE for a compiler that generates
executables and you run them from the editor. I discovered this bug when a
user ("Andreas Leidner" <leidner@gmx.net>) used the editor as IDE for Turbo
Pascal 7.
  Here is a patch to fix this problem, you must patch the libc:

--------------------- start of patch
--- chkv2prg.c~	Thu Oct  9 22:40:02 1997
+++ chkv2prg.c	Sat Sep 25 14:34:38 1999
@@ -30,7 +30,10 @@
 
   lseek(pf, 0, SEEK_SET);
   if (read(pf, header, sizeof(header)) != sizeof(header))
+  {
+    close(pf);
     return &type;
+  }
   if (header[0] == 0x010b || header[0] == 0x014c)
   {
     unsigned char firstbytes[1];
@@ -64,9 +67,15 @@
       coff_start += (long)header[1] - 512L;
     exe_start = (unsigned long)header[4]*16L;
     if (lseek(pf, exe_start, SEEK_SET) != exe_start)
+    {
+      close(pf);
       return &type;
+    }
     if (read(pf, go32stub, 8) != 8)
+    {
+      close(pf);
       return &type;
+    }
     go32stub[8] = 0;
     if (strcmp(go32stub, "go32stub") == 0)
     {
@@ -82,30 +91,51 @@
       unsigned short coff_id;
       type.version.v.major = 1;
       if (lseek(pf, coff_start - 4, SEEK_SET) != coff_start-4)
+      {
+        close(pf);
         return &type;
+      }
       if (read(pf, &stub_offset, 4) != 4)
+      {
+        close(pf);
         return &type;
+      }
       if (read(pf, &coff_id, 2) != 2)
+      {
+        close(pf);
         return &type;
+      }
       if (coff_id == 0x010b || coff_id == 0x014c)
       {
         type.object_format = _V2_OBJECT_FORMAT_COFF;
         type.exec_format = _V2_EXEC_FORMAT_STUBCOFF;
       }
       if (lseek(pf, stub_offset, 0) != stub_offset)
+      {
+        close(pf);
         return &type;
+      }
       if (read(pf, magic, 16) != 16)
+      {
+        close(pf);
         return &type;
+      }
       if (memcmp(STUB_INFO_MAGIC, magic, 16) == 0)
       {
         if (read(pf, &struct_length, 4) != 4)
+        {
+          close(pf);
           return &type;
+        }
         type.stubinfo = (_v1_stubinfo *)malloc(struct_length);
         memcpy(type.stubinfo->magic, magic, 16);
         type.stubinfo->struct_length = struct_length;
         if (read(pf, type.stubinfo->go32, struct_length - 20)
             != struct_length - 20)
+        {
+          close(pf);
           return &type;
+        }
         type.has_stubinfo = 1;
       }
     }
--------------------- end of patch

Happy hacking.
