Unable to compile on 64-bit Linux

Skip to first unread message


Apr 28, 2016, 4:50:07 AM4/28/16
to Syndicate Wars Port

I decided to take the port for a spin and compile it, but configure fails because I don't have i386 processor ...

configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking for python... python
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking if we are compiling for an i386 processor... no
configure: error: Sorry, this Syndicate Wars port will only run on i386 processors

Is there something I can fix/workaround or a known limitation?




Aug 10, 2016, 11:35:24 AM8/10/16
to Syndicate Wars Port, robert....@gmail.com
Same problem for me too on an i7 Mint box.
Unfortunately I don't have the skills to toggle the switch from 32 to 64 bit. Its probably simple, as is everything when you know how.



Sep 4, 2016, 9:16:54 AM9/4/16
to Syndicate Wars Port, robert....@gmail.com, gregdav...@gmail.com
I just had exactly the same issues, but I worked around them as follows.
A caveat - this is a Debian 8 x64 box, but it ought to work for Ubuntu as well:

Firstly - install prerequisite tools + libs
sudo apt-get install build-essential cdparanoia vorbis-tools automake

This is a 32-bit install on x64, so you'll need a ton of 32-bit libs. Thankfully, this is quite painless:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libpng12-0:i386 libsdl2-dev:i386 zlib1g-dev:i386 libfreetype6-dev:i386 libglib2.0-dev:i386 libavahi-client-dev:i386 libdirectfb-dev:i386 libpulse-dev:i386 libsdl1.2-dev:i386 libopenal-dev:i386 libvorbis-dev:i386

If at any point you get stuck missing a prerequisite file, my solution is:
sudo apt-get install apt-file
sudo apt-file update
apt-file search <thefile>

Then apt-get install the lib it indicates with :i386 on the end.
Download, extract, patch
wget http://swars.vexillium.org/files/swars-0.3.tar.bz2
tar -xf swars-0.3.tar.bz2
cd swars-0.3

For some reason automake complains about missing the file ./compile . automake --add-missing fixes this.

automake --add-missing

Now you need to go patch the configure and resultant makefiles. I don't know automake so well, so I don't know how to patch this properly, but you can fix the resulting Makefiles OK.
Firstly, open the file configure and comment out (prepend with #) the line that begins:

    as_fn_error $? "Sorry, this Syndicate Wars port will only run on i386 processors

Then run ./configure, indicating your install directory (default is /usr/share):
./configure --enable-debug --prefix=$TARGET_DIR
This spits out all the requisite Makefiles. The key one is in src/, so go edit that one.
The key variables here are CFLAGS and CCASFLAGS, the two flag sets used to pass to gcc for C and ASM code.
You'll also need to alter the LIBS as configure fails to pick up on the i386 libs properly (at least for me)
Edit src/Makefile and:
    prepend '-m32' to CCASFLAGS and CFLAGS (e.g. the line should read CCASFLAGS='-m32 -g')
    add '-L/usr/lib32 -L /lib32' to LIBS
Now that's done, you can make properly. Warnings are OK, but watch out for errors. It ought to compile correctly, so you can go ahead and install afterwards:

make install

All that's left is getting the data into the right place. The trick there is to install relative to your TARGET_DIR (if you're using a non-standard location) like so:


on the util/install script.


Feb 23, 2017, 11:55:52 PM2/23/17
to Syndicate Wars Port, robert....@gmail.com, gregdav...@gmail.com, tall...@gmail.com
For Ubuntu 16.04 x64 I installed the Syndicate Wars port via the following;

sudo apt-get install libpng12-0:i386 zlib1g-dev:i386 libfreetype6-dev:i386 libglib2.0-dev:i386 libavahi-client-dev:i386 libdirectfb-dev:i386 libpulse-dev:i386 libsdl1.2-dev:i386 libopenal-dev:i386 libvorbis-dev:i386
sudo apt-get install automake
sudo apt-get install gcc-multilib
cd /home/user/games/syndicatewars
tar xvfj swars-0.3.tar.bz2
cd swars-0.3

automake --add-missing
gedit configure
    prepend # to 'as_fn_error $? "Sorry, this Syndicate Wars port will only run on i386 processors'
CFLAGS=-m32 LDFLAGS=-L/usr/lib/i386-linux-gnu ./configure --enable-debug --prefix=/home/user/games/syndicatewars/swarslinux
gedit src/Makefile
    prepend to CCASFLAGS and CFLAGS; '-m32' (ie 'CCASFLAGS='-m32 -g', 'CFLAGS = -m32 -g ...')
    remove from CFLAGS; '/usr/include/vorbis/vorbisfile.h'
    add to LIBS; '-L' before '/usr/lib/i386-linux-gnu' (ie 'LIBS = -L/usr/lib/i386-linux-gnu -lSDL -lopenal -L/usr/lib/i386-linux-gnu -lpng12')
    add to LIBS; '-lvorbisfile' (ie 'LIBS = -L/usr/lib/i386-linux-gnu -lSDL -lopenal -L/usr/lib/i386-linux-gnu -lpng12 -lvorbisfile')
make install
ensure that syndicate wars game files are all lower case;
    cd /home/user/games/syndicatewars
    mkdir renamed
    cp -rf SWARS renamed/
    cd /home/user/games/syndicatewars/renamed
    find SWARS -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;
gedit util/install    
    ensure that all files referenced in copy_data() are present in /home/user/games/syndicatewars/renamed/SWARS/language/eng
    ensure that all folders referenced in check_source() are present in /home/user/games/syndicatewars/renamed/SWARS
cd /home/user/games/syndicatewars/swars-0.3/util
./install -f /home/user/games/syndicatewars/renamed/SWARS -t /home/user/games/syndicatewars/swarslinux/swars/share
Reply all
Reply to author
0 new messages