
This file has two sections:

1. How to compile the Tkhtml widget.
2. How to run Hv3, the Tkhtml web browser.

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

1. HOW TO COMPILE THE TKHTML WIDGET

  There are two ways to build the Tkhtml widget:
  
    * Using the configure script. This is quick and easy if it works,
      virtually impossible to debug if it doesn't.
    * Modifying the Makefile template. This takes a few minutes to set up, 
      but it's easier to understand what's going on.
  
  Both systems have been tested on Suse linux 9.2 and Mingw/Msys on 
  Windows XP.
  
  Using the configure script
  --------------------------
  
  1. If you're reading this you have already obtained the sources and they
     are likely in a directory called "htmlwidget".
  2. Create a new empty directory to build in.
  3. Cd into the new directory.
  4. Run the "configure" script located in the htmlwidget directory. The
     configure script will probably need the --with-tcl and --with-tk options
     passed to it. 
  5. Run "make".
  6. If everything worked, run "make install".
  
  The sequence of commands might look like this:
  
    $ tar -xzf tkhtml-3.alpha1.tar.gz
    $ ls -o htmlwidget/configure
    -rwxr-xr-x  1 user 233035 2005-07-06 17:37 htmlwidget/configure
    $ mkdir bld
    $ cd bld
    $ ../htmlwidget/configure --with-tcl=/usr/local/ActiveTcl/lib --with-tk=/usr/local/ActiveTcl/lib 
    <much output>
    $ make
    $ make install
  
  Modifying a Makefile template
  -----------------------------
  
  There are two similar makefiles in the root directory of the source tree.
  "main.mk" is for linux, and "mingw.mk" is for Mingw/Msys on windows. Both
  require a handful of variables to be modified before they can be used.
  Instructions are in comments in either file.
  
  1. If you're reading this you have already obtained the sources and they
     are likely in a directory called "htmlwidget".
  2. Edit the appropriate makefile ("linux-gcc.mk" or "mingw.mk").
  2. Create a new empty directory to build in.
  3. Cd into the new directory.
  5. Run "make".
  6. If everything worked, run "make install" (linux only).
  
  The sequence of commands might look like this:
  
    $ tar -xzf tkhtml-3.alpha1.tar.gz
    $ ls -o htmlwidget/main.mk
    -rw-r--r--  1 dan 4143 2005-07-10 19:45 htmlwidget/main.mk
    $ vi htmlwidget/main.mk
    $ mkdir bld
    $ cd bld
    $ make -f ../htmlwidget/main.mk
    <much output>
    $ make install

2. HOW TO RUN HV3, THE TKHTML WEB BROWSER

  Hv3 uses the following compiled components:

  * Tkhtml3
  * Tls
  * Img
  * Sqlite3
  * tclsee (requires: SEE and optionally GC)

  Compiling Tclsee (javascript support)
  -------------------------------------

    When Hv3 is run, it tries to load package "Tclsee". If successful,
    javascript support will be enabled. Tclsee is an extension developed
    as part of Hv3 to provide access to the "Simple ECMAScript Engine" 
    (SEE) library from Tcl scripts.

    The SEE library depends on the Boehm garbage-collector libary. To build
    "Tclsee", the following third-party components are required:
  
      SEE:      http://www.adaptive-enterprises.com.au/~d/software/see/
      Boehm GC: http://www.hpl.hp.com/personal/Hans_Boehm/gc/
  
    Libraries need to be built from these two packages (files libsee.a 
    and libgc.a). Refer to the respective package documentation for 
    details on how to do that. The SEE library should be configured
    to use Boehm GC routines by default.
  
    Then, file "hv/hv3see.c" from the source distribution should be compiled
    into a shared object linked with the two libraries above. The shared
    object will contain the binary extension "Tclsee" (C init function
    Tclsee_Init). 
  
    The template makefiles (linux-gcc.mk and mingw.mk) include a target
    "tclsee" to build this package, complete with pkgIndex.tcl file. This
    target requires configuration of makefile variables JSLIB, JSFLAGS and
    JS_SHARED_LIB.

  Hints for compiling SEE:

    If Boehm GC is not in the various paths, need to set CFLAGS, LDFLAGS and
    LD_LIBRARY_PATH before running configure:

      INSTALL_PATH=/home/dan/work/tkhtml/js/
      export CFLAGS="-I${INSTALL_PATH}/include/ -O2 -DNDEBUG"
      export LDFLAGS=-L${INSTALL_PATH}/lib/
      export LD_LIBRARY_PATH=${INSTALL_PATH}/lib/

    Then supply an installation path to configure:

      ../see-2.1.1206_snapshot/configure --prefix=${INSTALL_PATH}/

    This worked on a stock Suse 10.1.

    Part of the target - "ssp" fails on linux. Run [make -k install] and
    you get both the shell and libary, so no problem... UPDATE: As of 
    SEE version 2.1.1206, it looks like ssp is not built by default.

  
  
  Compiling hv3_polipo
  --------------------

    TODO


3. NOTES FOR CROSS COMPILING

    One way to build Tkhtml3 and/or Hv3 for windows is to use a cross
    compiler from Linux using mingw. Binaries for the mingw gcc are 
    available here:

        http://mirzam.it.vu.nl/mingw/

    Note: If anyone reading this knows how to cross-compile from linux
    for mac, please tell me! (danielk1977@gmail.com)

    Both SEE and GC can be cross-compiled with a command like:

      ../<path>/configure --host=i386-mingw32 --prefix=<install-path>
      make
      make install

    Details:

    1. In version 2.1.1206 of SEE, do the following to the configure script
       (pattern occurs twice):

           s/ac_cv_func_memcmp_working=no/ac_cv_func_memcmp_working=yes/

    2. I can't compile a working libgc for mingw. Same problem is reported
       by these folk (kaya scripting language):

           http://kayalang.org/download/compiling/windows

       For the starkits, I took their advice and downloaded a binary 
       package.


