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 Additional requirements
3. How to compile
3.1 How to create the DOS installer
4. DJGPP 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:

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



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.

2.1 For the DOS version:

* DJGPP v2.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 or EGCS 1.x. Currently I use gcc 2.8.1, Andris compiled my
classes using egcs but I never tried. You'll need the C++ stuff.
* RHIDE 1.4.7, 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.
* Robert's port of TVision with my last patches, they are *a lot* so get
TVision from the distribution I maintain and that's available from Simtelnet.
* Allegro 3.1 (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, if you are lucky 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.
* ZLib 1.1.2 or compatible. Again a copy should be included in support/djgpp.
* If you want to compile the documentations you'll need Texinfo 3.12 (I think
3.9 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).
* PCRE library v2.0.7. That's Perl Compatible Regular Expressions. A 
precompiled copy is included in support/djgpp just in case you can get it.

  If you don't have Allegro and LibAMP you can compile the editor without MP3
support 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 have the PCRE library you can compile the editor without Perl
regex commenting the #define SUP_PCRE line in ceditint.h.
  If you don't have ZLib library 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 to do the work. I also
used 2.2.10 for distributions.
* GCC 2.7.x/2.8.x or EGCS 1.x. Currently I use gcc 2.7.2.3, Andris compiled
my classes using egcs but I never tried. You'll need the C++ stuff. I also
compiled the editor with gcc 2.95.
* GLibc 2.x. Even when Robert uses Libc5 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.
* RHIDE 1.4.7, 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.
* Robert's port of TVision with my last patches, they are *a lot* so get
TVision from the distribution I maintain and that's available from Simtelnet
or my homepage.
* ZLib 1.1.2 or compatible. A copy should be included in support/linux.
* If you want to compile the documentations you'll need Texinfo 3.12 (I think
3.9 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.
* 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.
* PCRE library v2.0.7. That's Perl Compatible Regular Expressions. A 
precompiled copy is included just in case you can get it.

  If you don't have the PCRE library you can compile the editor without Perl
regex commenting the #define SUP_PCRE line in ceditint.h.
  If you don't have ZLib library 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 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.
* A good machine with a lot of memory or you'll need to wait a lot to compile
I use an AMD K6-2 of 300 MHz with 64 Mb of SDRAM and an UltraDMA 2 disk. In
the past I used 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).
* 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.



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.


  I hope you will be able to compile it currently the transportation of the
sources from/to Linux and the diffs I send to Robert work so you should get
all the needed files. Additionally I recompile the editor in other machines
as test.


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