Author Topic: Building Planeshift on FreeBSD  (Read 487 times)

Kasperle

  • Wayfarer
  • *
  • Posts: 1
    • View Profile
Building Planeshift on FreeBSD
« on: January 11, 2004, 10:56:05 pm »
Hi,
as I am a FreeBSD user and the Planeshift Linux binaries did not quite work with the FreeBSD Linux compatibility stuff, i tried compiling PS on FreeBSD ... with some success.

After making PS compile successfully, I had some trouble with undefined symbols, searched the forums and it seemed like i needed to use some gcc 3.x so that\'s what I did. After recompiling everything, things worked quite well, albeit PS was a bit slow and crashed from time to time.

I did use FreeBSD 4.9 BTW, I think the 5.x Releases already come with a 3.x gcc by default, so you probably don\'t need to mess with the gcc settings then.

You need some gcc 3.x and jam, both are in the Ports.

0. grab the source tarball, unpack it. you should have some planeshift or my_planeshift directory then.

1. cd to that directory and edit build.sh:
add the lines

CC=gcc32
CXX=g++32

2. edit CS/Jamconfig, change some of the first lines to
CMD.CC = \"gcc32\" ;
CMD.C++ = \"g++32\" ;

If you use some other version of gcc, you of course need to correct those commands to the corresponding binary.

3. \"sh build.sh\"
I had some trouble with the C compiler not knowing some -Wno-unused... flags, but that was when i was still using gcc2. These might not appear at all when using gcc3. If they do, edit CS/plugins/aws/Jamfile and remove those to flags from the line they appear in.

3.a Forgot some stuff while posting this the first time:
there\'s some error in CS/plugins/aws/skinpars.yy, \"window_item\" appears twice on the same line, just remove one of those appearances.

3.b Forgot some more:
i needed to add \"-I/usr/X11R6/include\" to the CXXFLAGS and C++FLAGS in CS/mk/jam/unix.jam

4. return to the build. after a while it will abort with some errors in 3 nasm commands. The trouble is that nasm wants include paths with a slash \"/\" appended, which for some reason did not happen.

So you will need to cd to the \"CS\" directory, copy those commands from build.sh output and run them manually, edited.
Just append a \"/\" to each \"-I...\"-parameter. There\'s probably a smarter way editing the Jam config files, but i didn\'t find it.

On my system the commands looked like that, you can probably just paste them from this post

nasm  -f elf  -Iplugins/video/renderer/software -Iplugins/video/renderer/software/i386/ -I./include/ -I./ -I./plugins/ -I./apps/ -I./libs/  -o ./out/freebsd/optimize/plugins/video/renderer/software/cpuid.o  plugins/video/renderer/software/i386/cpuid.asm

nasm  -f elf  -Iplugins/video/renderer/software -Iplugins/video/renderer/software/i386/ -I./include/ -I./ -I./plugins/ -I./apps/ -I./libs/ -o ./out/freebsd/optimize/plugins/video/renderer/software/scan16a.o  plugins/video/renderer/software/i386/scan16a.asm

nasm  -f elf  -Iplugins/video/renderer/software -Iplugins/video/renderer/software/i386/ -I./include/ -I./ -I./plugins/ -I./apps/ -I./libs/ -o ./out/freebsd/optimize/plugins/video/renderer/software/scan32a.o  plugins/video/renderer/software/i386/scan32a.asm

5. go back to the main directory and run build.sh again. The next error coming up will be with the CEL build needing autoconf > 2.54. I had autoconf 2.57 installed as well as other versions, but the 2.57 was called autoconf257. Just edit cel/autogen.sh and change \"autoconf\" in the last line to the correct name.

6. Then some error about cel not finding Crystal Space came up, after looking at the config.log i found that it just couldn\'t find either libstdc++.so.5 or some libgcc_s.so, i can\'t remember.
I located the correct library in
/usr/local/lib/gcc-lib/i386-portbld-freebsd4.8/3.2.3/
and added that directory to my LD_LIBRARY_PATH with

\"export LD_LIBRARY_PATH=/usr/local/lib/gcc-lib/i386-portbld-freebsd4.8/3.2.3/\"

I then continued with the build (changed to the main directory, \"sh build.sh\")

7. Planeshift build, in planeshift/autogen.sh i replaced \"make\" with \"gmake\" which is probably not necessary ;) it\'s just that most software Projects use GNU make and BSD make always complains about broken Makefiles. It didn\'t in this case, though, and i don\'t have a clue why that might be ... I still changed it just to be safe ;)

8. I edited planeshift/mk/unix/Makefile.autoconf because of the same autoconf errors I had earlier:

I replaced all instances of \"autoheader\" with \"autoheader257\"
and all instances of \"autoconf\" with \"autoconf257\"

9. I then continued with the build and had some unresolved pthread_foo symbols, fixed that by adding \"-pthread\" to the LINKLIBS variable in planeshift/Jamrules

10. The build should run fine now. Just sh make_distro.sh and you should have all you need in distro/planeshift.

When you try running psclient or pssetup, make sure you set LD_LIBRARY_PATH to the path mentioned above, otherwise the dynamic linker will not find some needed shared libraries. You can do that by using the command above or just running the binaries like that:

\"LD_LIBRARY_PATH=/correct/path ./pssetup\"
\"LD_LIBRARY_PATH=/correct/path ./psclient\"
« Last Edit: January 11, 2004, 11:04:55 pm by Kasperle »