lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling lout 3.38 on Windows with mingw+msys


From: Remo Dentato
Subject: Compiling lout 3.38 on Windows with mingw+msys
Date: Thu, 16 Oct 2008 10:43:23 +0200

I just compiled version 3.38 using mingw  (the gcc porting on windows)
and msys.

I re-generated all the documentation that comes with the lout package,
everything seems to work fine including the graphics (e.g. the
inclusion of the Sydney University crest) and the execution of
prg2lout.

The code compiles without an itch but the makefile needs some tweak.
The reason is that mingw+msys is almost identical to a generic unix
platform with the exception that the executable files end with ".exe".

To handle this case the simplest thing would be to add a new variable
called SUFEXE in the makefile that is left blank on unix and is set to
".exe" for mingw.

Every reference to executables in the make files is than appended with
$(SUFEXE) :  "lout" becomes "lout$(SUFEXE)" and  "prg2lout" becomes
"prg2lout$(SUFEXE)".

At the bottom of this message I've added a diff between the original
makefile and the one with my suggested modifications.

I suspect that with this modifications it should also compile with
cygwin but I don't have it installed to confirm.

Summarizing. To compile on mingw+msys the steps are as follows:

  * modify the makefile as described above
  * set OSDOS = 1    (and set to 0 the other OSxxx)
  * set USELOC = 0  (mingw has no support for catopen() and company)
  * set SUFEXE = .exe
  * set PREFIX = /usr/local  (or any directory that suits your msys environment)
  * make install

The executable will honor the LOUTLIB environment variable, I'll put
together a binary-only distribution for windows that has a suitable
default (e.g. C:\lout) that can be overriden by users using that
variable. There should be no dependency on mingw dll's but I need to
check.

The best option for Windows users would be an installer and a small
gui to select the file to pass to lout and set some command line
switch but this requires some time.

So, my suggestion is to incorporate the modification to the makefile
into next lout release so that there is at least one supported method
for compiling Lout on windows (possibly two if the method could be
adapted for cygwin).

It will Jeff's call, of course, but what do you think about this?

Remo.D


----- DIFF OUTPUT -------


261,262d260
< #SUFEXE  = .exe
<
337c335
< lout$(SUFEXE):        $(OBJS)
---
> lout: $(OBJS)
339c337
<       chmod a+x lout$(SUFEXE)
---
>       chmod a+x lout
345c343
< prg2lout$(SUFEXE):    prg2lout.c
---
> prg2lout:     prg2lout.c
347c345
<       chmod a+x prg2lout$(SUFEXE)
---
>       chmod a+x prg2lout
349c347
< all:  lout$(SUFEXE) prg2lout$(SUFEXE)
---
> all:  lout prg2lout
351c349
< install: lout$(SUFEXE) prg2lout$(SUFEXE)
---
> install: lout prg2lout
354,357c352,355
<       cp lout$(SUFEXE) $(BINDIR)/lout$(SUFEXE)
<       chmod 755 $(BINDIR)/lout$(SUFEXE)
<       cp prg2lout$(SUFEXE) $(BINDIR)/prg2lout$(SUFEXE)
<       chmod 755 $(BINDIR)/prg2lout$(SUFEXE)
---
>       cp lout $(BINDIR)/lout
>       chmod 755 $(BINDIR)/lout
>       cp prg2lout $(BINDIR)/prg2lout
>       chmod 755 $(BINDIR)/prg2lout
449c447
<       -rm -f lout$(SUFEXE) prg2lout$(SUFEXE) *.o
---
>       -rm -f lout prg2lout *.o


reply via email to

[Prev in Thread] Current Thread [Next in Thread]