Compiling Youre First Mod under Linux by FREDZ.
Version 1.0

You should know a little bit about linux before you can do this.
Kingpin only compiles under gcc 2.7.2.3 compiler
You mostly only get gcc 2.7.2.3 compiler under Redhat 5.2
But I'm going to use a debian linux system Ubuntu 6.06
So this should work on any debian os.

To get the gcc 2.7.23 compiler:
First we need to edit your /etc/apt/sources.list
Because we need old Synaptic Package.
Edit them with a terminal as root.
With the command line:
sudo vi /etc/apt/sources.list
Go all the way down in sources.list and add:
#Old Ubuntu Package
deb http://archive.ubuntu.com/ubuntu/ warty main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ warty main restricted universe
If you can't type in sources.list press the insert key.
Press esc and type:
:wq
To save file and quit editor.
Next type in terminale:
sudo apt-get update
Oke that should update the packages to get gcc272.

Next type in terminale:
apt-get install gcc272
and press y to install
Now you all you need are the libraries
type next:
sudo apt-get install build-essential
this install the libraries
Now we should enable to compile a Kingpin mod for Linux.
Compile youre mod with the follow line in a script executable:
gcc272 *.c *.o -s -m486 -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fPIC -shared -o gamei386.so
or under Redhat 5.2:
gcc *.c *.o -s -m486 -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fPIC -shared -o gamei386.so
Or download buildlinux.

Buildlinux need to be executable.
To make youre buildlinux executable type this:
chmod 111 buildlinux
Or change the chmod to youre own settings so long it's executable with the follow chmod generator:

Chmod:
Permission Owner Group Other
Read
Write
Execute


When you compile the sdk under Windows it always uses a liberay file: NavLib.lib
Linux also uses liberay files:
g_nav.o
g_nav_cells.o
g_nav_io.o
g_nav_misc.o
Mostly when you download a sdk these files already in it.
But somethimes there not if you need them:
kingpinSDK-v121-navlib-linux-glibc-i386.zip
Just put the *.o files where also the *.c files are.

Sometimes you get errors under linux that you din't have when you compiled under windows.
You could have diffrent errors if you get the error:

No such file or directory.
You need to run ccase.
With the line:
./casse -r *
Download ccase.
If needed make ccase also executable same way you did buildlinux.
What ccase does is make all capitals files in none capitals files.

If you get for example allot of errors like these:
stray '\' in program
parse error before string constant
warning: data definition has no type or storage class
stray '\' in program
parse error before '.'
stray '\' in program
To fix that there 2 ways for it.

Under linux use the program d2u-u2d.
Download d2u-u2d.
If needed make d2u-u2d also executable same way you did buildlinux.
With the line:
d2u-u2d -d2u *.*
and then deleted the .old files with:
rm *.old
What d2u-u2d does is make all ASCII files into UNIX ASCII files.

Under windows you need to have Ultraedit.
Open every file that starts with *.C and *.H with Ultraedit.
Go to File|Conversions|DOS to UNIX for each file.
And save the files.
Now you should to compile under linux without any problem.


If you got any question just press the Contact button.


Hosting services provided by Poisonville.NET / Kingpin Forever Headquarters