Hugs & Cygwin

Alastair Reid reid@cs.utah.edu
16 May 2002 12:49:22 +0100


> Hello there, I am trying to install Hugs under Cygwin, and I have
> severe problems. The last problem lead me to a hugs core dump, and I
> have no idea why.

By "install" do you really mean "compile"?  

Back when I was at Yale, I routinely used Hugs on a machine with
cygwin installed - no problems.

But I never compiler Hugs using gcc on cygwin and don't know of anyone
who has.

> There must be someone else who has tried this and succeeded?  If so,
> I could use some hints.

Here's what I remember of how to get Hugs' configure/makefile system
working on Windows (only I was using the MS Visual C compiler).
(Most of this is based on looking at src/msc/config.sh)

1) Install cygwin

2) Modify the configure script to overcome limitations of cygwin.

   Back when I was running this, /dev/null didn't exist so I had to do
   this:

     sed ../unix/configure >./config.fix            \
       -e "s#/dev/null#conf_devnull#"               \

   and MSVC's error messages look different from Unix error messages so
   I did this:

       -e "s/-v '\^ \*+'/-i \"error\\\|warning\"/g"

3) Set a whole bunch of environment variables to make sure configure
   finds the right C compiler, linker, etc.

   To use gcc/ld, this should just be a matter of setting your path
   correctly.  With MSVC it looks like this:

     set -a
     CC=${CC="cl /nologo"}
     DEBUGFLAGS=${DEBUGFLAGS="-Zi"}
     LDDEBUGFLAGS=${LDDEBUGFLAGS="-Zi"}
     OPTFLAGS=${OPTFLAGS="-O2"}
     CFLAGS=${CFLAGS="-ML"}
     LDFLAGS=$LD
     DLL_FLAGS="/LD"
     CPP=${CPP="cl /nologo /E"}
     LIBS=${LIBS="kernel32.lib advapi32.lib"}
     GUILIBS="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib winmm.lib advapi32.lib"

4) Run the patched configure script specifying the windows target
   as well as the usual configure options.

    ./config.fix --target=windows ...

5) Use the resulting Makefile, etc. to build your system

     cp ../Makefile ../config.h ../options.h .
     make -C .. hugs.exe


Obviously, there'll be a certain amount of iteration required before
you get it right.


If you manage to get something like this working, can you send us the
instructions, scripts (modelled after the scripts in hugs/src/msc if
appropriate), etc. for us to put in future releases?

-- 
Alastair Reid        Reid Consulting (UK) Ltd