Reference Tutorial Developer 1 Compile 2 Design 3 Implement 4 Modify 5 Misc 6 Licence SEARCH

1.4 Compiling FunnelWeb

The FunnelWeb source code is entirely contained within the `sources` directory. However, some simple script files and makefiles can be found in the `admin` directory.

There should be little difficulty compiling FunnelWeb for any of the currently supported platforms. If the machine on which you are compiling FunnelWeb is not one of the ones listed in the `environ.h` file, then choose the closest one you can. FunnelWeb contains some machine-dependent components, so if you are compiling for a currently-unsupported platform, you will probably need to go into the modules `environ.h`, `machin.h` and `machin.c` and make some changes.

Compile FunnelWeb by pointing your C compiler at all the "`.c`" files in the `sources` directory. The "`.txt`", and "`.tex`" files do not participate in the compilation, but appear in the `sources` directory because they were used to generate the "`.ctx`" files. The "`.ctx`" files are included by `.c` files of the same name and do not need to be compiled separately. Link the results.

       cc -c *.c
       cc -o fw *.o

The result of all this should be a binary executable called `fw`, or `fw.exe`, or `fw.xxx` where `.xxx` is whatever file extension is appropriate on the target machine. Clean up the `sources` directory by deleting all the listing and object files.

If you encounter any difficulties compiling FunnelWeb, you may wish to refer to the platform-specific notes below.

If you port FunnelWeb to a new platform, please email me any information that I can incorporate into the next release, or add here to help others porting to the same platform.

A Make File

The FunnelWeb distribution does not provide a makefile as compilers are so fast now that the risk of omitting a dependency far exceeds the benefits provided by a makefile for a program this size.

However, some people have complained about the lack of a makefile, and in fact Dougal Scott (dwagon@nella9.cc.monash.edu.au) actually sent me one which he constructed using the GNU C -MM option. Here it is:

    ------------------------SLICE and DICE here---------------------------------
    OBJS= analyse.o as.o clock.o command.o data.o dump.o help.o help_gnu.o list.o \
          lister.o machin.o mapper.o memory.o misc.o option.o parser.o scanner.o \
          section.o table.o tangle.o texhead.o weave.o writfile.o main.o
    HDRS= analyse.h as.h clock.h command.h data.h dump.h environ.h help.h \
          help_gnu.h list.h lister.h machin.h mapper.h memory.h misc.h option.h \
          parser.h scanner.h section.h style.h table.h tangle.h texhead.h weave.h \
          writfile.h
    CC=gcc
    CFLAGS=-O -Wall

    all: fw

    fw: $(OBJS)
            $(CC) -o fw $(OBJS)

    analyse.o : analyse.c style.h environ.h analyse.h as.h data.h clock.h list.h \
      table.h option.h machin.h help.h section.h writfile.h lister.h misc.h
    as.o : as.c style.h environ.h as.h machin.h
    clock.o : clock.c style.h environ.h as.h clock.h machin.h
    command.o : command.c style.h environ.h analyse.h as.h command.h machin.h data.h \
      clock.h list.h table.h option.h help.h section.h writfile.h dump.h lister.h \
      memory.h mapper.h misc.h parser.h scanner.h tangle.h weave.h
    data.o : data.c data.h style.h environ.h clock.h list.h table.h option.h machin.h \
      help.h section.h writfile.h
    dump.o : dump.c style.h environ.h as.h clock.h data.h list.h table.h option.h \
      machin.h help.h section.h writfile.h dump.h misc.h
    help.o : help.c style.h environ.h as.h help.h help_gnu.h misc.h data.h clock.h \
      list.h table.h option.h machin.h section.h writfile.h
    help_gnu.o : help_gnu.c style.h environ.h help_gnu.h help_gnu.ctx
    list.o : list.c style.h environ.h as.h machin.h memory.h list.h
    lister.o : lister.c style.h environ.h as.h data.h clock.h list.h table.h option.h \
      machin.h help.h section.h writfile.h lister.h misc.h
    machin.o : machin.c style.h environ.h as.h machin.h
    main.o : main.c style.h environ.h as.h command.h machin.h data.h clock.h list.h \
      table.h option.h help.h section.h writfile.h memory.h
    mapper.o : mapper.c style.h environ.h as.h machin.h mapper.h memory.h
    memory.o : memory.c style.h environ.h as.h machin.h memory.h
    misc.o : misc.c style.h environ.h as.h data.h clock.h list.h table.h option.h \
      machin.h help.h section.h writfile.h memory.h misc.h
    option.o : option.c style.h environ.h as.h data.h clock.h list.h table.h option.h \
      machin.h help.h section.h writfile.h misc.h
    parser.o : parser.c style.h environ.h as.h data.h clock.h list.h table.h option.h \
      machin.h help.h section.h writfile.h lister.h mapper.h memory.h misc.h parser.h
    scanner.o : scanner.c style.h environ.h as.h clock.h data.h list.h table.h option.h \
      machin.h help.h section.h writfile.h dump.h lister.h mapper.h memory.h misc.h \
      scanner.h
    section.o : section.c style.h environ.h as.h section.h
    table.o : table.c style.h environ.h as.h machin.h memory.h table.h
    tangle.o : tangle.c style.h environ.h as.h data.h clock.h list.h table.h option.h \
      machin.h help.h section.h writfile.h lister.h memory.h misc.h tangle.h
    texhead.o : texhead.c style.h environ.h texhead.h writfile.h texhead.ctx
    weave.o : weave.c style.h environ.h as.h data.h clock.h list.h table.h option.h \
      machin.h help.h section.h writfile.h lister.h misc.h texhead.h weave.h
    writfile.o : writfile.c style.h environ.h as.h machin.h writfile.h
    ------------------------SLICE and DICE here---------------------------------

Apollo

16-Oct-1992: David Barton (dlb@hudson.wash.inmet.com) reports that he has managed to compile FunnelWeb on an Apollo running Domain/OS SR10.2.

HP-UX

15-Oct-1992: On an HP 9000/s300 running HP-UX 8.0, some users got FunnelWeb to compile, but found that they were running up against buffer size limitations. The problem is the definition of FILENAME_MAX in machin.h. When I wrote FunnelWeb, I assumed that FILENAME_MAX was the maximum length of an entire file specification including the path. However, on many machines, it is defined the be the maximum length of a filename without the path. The problem can be fixed by forcing the definition

       #define FILENAME_MAX 300

in machin.h. This is the only known problem encountered by those who have performed HP ports.

Macintosh MPW C

09-Aug-1992: Tor Olaussen (olaussen@cc.uib.no) of the Nansen Remote Sensing Center, University of Bergen, Norway reports that he has managed to get FunnelWeb to compile and run under the Macintosh MPW environment. He writes:

    "If you are interested in my changes, I should be able to generate
    diff files, and send them to you together with a makefile. Otherwise
    you can use me a reference if you receive questions about FunnelWeb
    and MPW."

Next

16-Oct-1992: John Dawson (avsoft!john@cs.utexas.edu) has installed FunnelWeb on a NeXT machine and has got it to pass the regression tests. He writes:

       "I had to play with the machin.{h,m} and environ.h files to get
       FunnelWeb to compile correctly.  The problem area was in machin.h
       where you put all those prototypes for the Sun.  They didn't jive
       well with my system.  However, every other default for the Sun was
       ok.  (A NeXT only needs to be aligned on 2^1-byte boundaries, and
       I think 2^0-byte boundaries might even work, but aligning things on
       2^2-byte boundaries doesn't hurt much.)."

The modified header files are available in the file:

ftp://ftp.ross.net/clients/ross/funnelweb/funnelweb300/funnelweb300_next_patch.c

MS-DOS

09-Oct-1992: In the lead up to the release of FunnelWeb 3.0, the PC that had been available for me to use to test the port of FW to the PC became unavailable. Because of this, I took the shortcut of not compiling and testing the final released version of the code (V3.0) on a PC!!! Worse still, I did not provide any notes on what compiler flags should be used.

As a result, those who have attempted to compile FunnelWeb on PCs ran into a few difficulties.

If you still want to compile FunnelWeb on the PC, here are some notes that I have collected:

Most people who compile FunnelWeb on a PC seem to be using Borland C++. If you are using this compiler, you need to do the following:

- Insert "#define STDC 1" in environ.h.
- Compile with the HUGE memory model.
- Turn on the ANSI option.
- Turn on the BorlandC++ option.
- Increase the run time stack size from 4K (default) to 32K by inserting the line: `extern unsigned _stklen = 32768;` just above the minimain() declaration. Refer to page 608 of the borland library reference manual (V3.00).

You may run into troubles with MSDOS with the regression test input file "sc13a" which is a zero length file. It is just a zero length file so if you run into difficulties, create it any way you like.

Webmaster Copyright © Ross N. Williams 1992,1999. All rights reserved.