The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Makefile problem compiling on Linux + ARM (e.g. Raspberry Pi)

Started by Simon Small, February 09, 2014, 10:42:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon Small

The configuration options in Makefile and config files offer selection of OS, but not of Architecture. This may not have been a problem in the past, but might become so in the future. I also note a few posts regarding 32 / 64 bit systems.

When I set the OS to Linux, the Makefile includes "-minline-all-stringops" which is X86 specific. I have 'fixed' my Makefile to be able to compile on ARM by commenting out that line, but I don't have the skills to offer a more long term solution. The lines affected are:

ifneq ($(OPTIMISE),)
    CFLAGS += -O3
    ifneq ($(OSTYPE),mac)
        ifneq ($(OSTYPE),haiku)
            ifneq ($(OSTYPE),amiga)
                CFLAGS += -minline-all-stringops
    CFLAGS += -O


A selection of non-x86 platform should also force USE_C. Things will become more difficult if we need to port the assembly code to ARM as well. (x64 builds don't seem to miss the handoptimized assembly code, so that might not be an issue.)


x64 would miss it, but then those builds are anyway not provided. Same as ARM, btw ...


Quote from: prissi on February 10, 2014, 12:09:36 PM
x64 would miss it, but then those builds are anyway not provided. Same as ARM, btw ...

I guess the issue here is providing those, even if not as official releases. x64 builds of Simutrans seems to have become more widespread since I first got it to run, although possibly limited to Linux.

Simon Small

I raised this issue because I tried to compile and hit a problem that I thought has a simple solution for others (i.e. change your own Makefile). I have a running version of the game that I got from the Linux repositories as a package, that I assume does not have to come from the Simutrans community. What I think we need to do is to provide the compile instructions so others can compile, rather than providing compiled binaries. Improving the Makefile would be a way to make the compile process a little simpler. I only wish that I knew more about compiling and Makefiles so I could do it myself

I also hit a problem with USE_C now you mention it. It seems to get set and unset in the code (, so it is not as simple as setting something in the Makefile (again, a bit beyond me)


I'm not sure why USE_C is unset then immediately defined again. It might be to avoid redefinition warnings/errors. In any case, if it is set, it ends up set. If it isn't set, it might end up set anyway, such as for x64 as well as non-GCC.


USE_C can be set by Makefile, no need to worry about Compiling will issue a more or less senseless warning.
Parsley, sage, rosemary, and maggikraut.