Re: [Hampshire] Compiling from source

Top Page

Reply to this message
Author: Bob Dunlop via Hampshire
Date:  
To: Hampshire LUG Discussion List
CC: Bob Dunlop
Subject: Re: [Hampshire] Compiling from source
Hi,

On Fri, Feb 17 at 12:34, RM via Hampshire wrote:
> Hi all
>
> Sorry to ask a question I've kind of asked before but...
>
> I'm trying to compile Elkulator [1] from source.   I've done this before
> and (forgive me I can't find the name of the list member who very kindly
> helped) come across similar problems.   The docs tell me that certain

...


Had a quick look at this, this morning, and have what I think is a solution.
I'm using a current version of Linux Mint but should be close enough to the
Ubuntu base to work.

First I installed the -dev version of all the prerequisite libraries using
the Synaptic package manager (other package managers are available :-).
Be sure to install version 4 of the Allegro library, the newer version 5
is likely to lead to a world of pain.

I also installed the latest automake and autoconf packages. Automake is
definitely required at least.

Then I unpacked the tarball in a fresh working directory.

mkdir x
cd x
tar xzf ../ElkulatorV1.0Linux.tar.gz

Delete the symbolic links to the old automake version and replace with
links to the newer automake. I only installed the links required for the
build, you may need to adjust the version to that you have installed.

rm compile COPYING depcomp INSTALL install-sh missing
ln -s /usr/share/automake-1.16/{install-sh,missing,depcomp} .

There was a few iterations of ./configure && make here, but this is the
final result.

./configure

Edit the uef.c file and correct an over enthusiastic pointer indirection.
I guess earlier compilers where not as sharp on their type checking.
There are a lot of other compiler warnings about memory safety etc that
should also be corrected, but this is the one that is stopping compilation.

vi src/uef.c (use whichever text editor you are comfortable with)

Two lines to change as in this diff/patch.

--- z/src/uef.c    2010-07-17 09:15:23.000000000 +0100
+++ x/src/uef.c    2023-02-18 08:45:05.025148553 +0000
@@ -12,7 +12,7 @@


int tapelcount,tapellatch,pps;
int intone=0;
-gzFile *uef;
+gzFile uef;
int cswena;

 int inchunk=0,chunkid=0,chunklen=0;
@@ -256,6 +256,6 @@
         if (uef)
     {
                gzclose(uef);
-        uef=(gzFile *)NULL;
+        uef=(gzFile)NULL;
     }
 }



Then edit the Makefile and add the maths library to the link list.
This is not the autoconf way to patch this and will be overwritten if
you run ./configure again.

vi src/Makefile

Just the one line this time.

--- z/src/Makefile    2023-02-18 10:17:18.032321661 +0000
+++ x/src/Makefile    2023-02-18 08:45:04.793160499 +0000
@@ -109,7 +109,7 @@
 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
 LDFLAGS = 
 LIBOBJS = 
-LIBS = -lalut -lopenal -lz
+LIBS = -lalut -lopenal -lz -lm
 LTLIBOBJS = 
 MAKEINFO = ${SHELL} /home/rjd/tmp/z/missing --run makeinfo
 MKDIR_P = /usr/bin/mkdir -p



Finally.

make
./elkulator

HTH
-- 
        Bob Dunlop


--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------