On Mon, 8 Oct 2007, Gerald Pfeifer wrote:
> As others noted, MetaHTML can be made to work on a current GNU/Linux 
> system, and while this probably will not be our long term strategy, I
> am trying to brush up my scripts/patches that will allow for this more
> easily and then share this with you and this list.

Here we go.  The first attachment (metahtml-fixsrc) contains a description
of how to build the beast which I recreated on an old SUSE Linux 10.0 box
now.  I am explicitly not making any claims about prettiness, neither of
the solution let alone my Perl foo, but it works. ;-)

Gerald

PS: Real fixes for the four hacks described to make it compile welcome...
#!/usr/bin/perl
#
# How to install MetaHTML on a recent operating system.
#
#   You may need to install the packages gdbm and possibly gdbm-devel.
#
#   tar -jxf metahtml-5.091.tar.bz2 ; cd metahtml-5.091
#   patch -p0 < ../metahtml-patch
#   ../metahtml-fixsrc
#   ./configure --without-modperl
#
#   If you encounter errors during the build, the following may be needed:
#
#     Add -L/usr/lib/termcap to LIBTERMCAP in mdb/Makefile.
#     Put all of modules/modperl.c under #if 0 ... #endif.
#     Put all of modules/lisp.c under #if 0 ... #endif.
#     Put all of modules/modimage.c under #if 0 ... #endif.
#
# 2005, 2007, Gerald Pfeifer <[EMAIL PROTECTED]>

@topatch = ( "libmhtml/arrayfuncs.c",
             "libmhtml/cgi-exec.c",
             "libmhtml/cleaner.c",
             "libmhtml/dbfuncs.c",
             "libmhtml/dbmfuncs.c",
             "libmhtml/debugfuncs.c",
             "libmhtml/filefuncs.c",
             "libmhtml/flowfuncs.c",
             "libmhtml/macrofuncs.c",
             "libmhtml/mathfuncs.c",
             "libmhtml/modfuncs.c",
             "libmhtml/packfuncs.c",
             "libmhtml/pagefuncs.c",
             "libmhtml/prims.c",
             "libmhtml/relfuncs.c",
             "libmhtml/require.c",
             "libmhtml/sessionfuncs.c",
             "libmhtml/streamfuncs.c",
             "libmhtml/stringfuncs.c",
             "libmhtml/varfuncs.c",
             "modules/csv.c",
             "modules/directory.c",
             "modules/elsewhen.c",
             "modules/example.c",
             "modules/lisp.c", # This one needs hand editing or #if 0...#endif
             "modules/modimage.c", # and so does this!
             "modules/modmath.c",
             "modules/modperl.c",
             "modules/modstat.c",
             "modules/parser.c",
             "modules/profiler.c",
             "modules/serverfuncs.c",
             "modules/timer.c"
);

sub f {
  my ($fn) = @_;
  my $in = $fn.".orig";

  print "Patching $fn\n";

  system("cp -p $fn $in");

  open(IN,$in);
  open(OUT,">$fn");
  while (<IN>) {
    if( /^(DEFINE_SECTION|DEFUN|DEFUNX|DEFMACRO|DEFMACROX|DEFVAR) \(/ ) {
      if( ! /\)$/ ) {
        do {
          chomp;
          print OUT  $_ . "\\n\\"."\n";
          $_ = <IN>;
          chop
        } until /"\)$/;
      }
    }
    print OUT  $_;
  }
  close(IN);
  close(OUT);
}

foreach $x (@topatch) {
  f($x);
}
--- libutils/rx-1.5/rx/rxall.h.orig     1998-11-11 21:19:45.000000000 +0100
+++ libutils/rx-1.5/rx/rxall.h  2005-11-24 17:31:39.104941000 +0100
@@ -21,10 +21,7 @@
  */
 
 
-#if 0
 #include <stdlib.h>
-#include "malloc.h"
-#endif
 
 #ifdef __STDC__
 
--- libgd/gifq.c.orig   1999-04-08 20:40:15.000000000 +0200
+++ libgd/gifq.c        2007-10-08 10:10:48.685122000 +0200
@@ -10,11 +10,11 @@
 #include <string.h>
 #include <sys/types.h>
 #include <ctype.h>
+#include <errno.h>
 
 #include "gd.h"
 
 static void usage (char *);
-extern int errno;
 
 int
 main (int argc, char *argv[])

Reply via email to