[ODE] [fix] ode doesn't compile on 64 bit platforms

Peter Onion Peter.Onion at btinternet.com
Sat Dec 10 07:44:54 MST 2005


On Thu, 2005-12-08 at 10:45 +0100, Tanguy Fautre wrote:

> I'm not sure this modification is needed on the UNSTABLE branch. It
has 
> been compiling just fine on AMD64 for quite some time now.

The unstable branch uses the automake tools but it is doesn't seem to do
the right thing as although it calls AC_CANONICAL_HOST in configure.in
it then goes on to mess about with bits of assembler to try and guess
the architecture.

Since I just moved to a AMD_64 I had to solve this issue for some of my
own code and my solution is these two lines in configure.in

AC_CANONICAL_HOST
AM_CONDITIONAL(X86_64, test "$host_cpu" = "x86_64")


And then in the Makefile.am for the module where it needs to know the
architecture I use this construct...

if X86_64
CPU_SOURCES = CPU.c emulate.c sound.c E803ops.c
else
CPU_SOURCES = CPU.c emulate.c sound.c assembler.S
endif

The result is that on i386 machines it uses some longstanding assembler
functions in assembler.S and on X86_64 machines it uses the new versions
in E803ops.c which use C now that support for 64 bits is in hardware.

There is a good online book about the automake tools set at 
http://sources.redhat.com/autobook/autobook/autobook_toc.html

Peter











More information about the ODE mailing list