Forums

Full Version: FreeBSD sconscript file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
First of all i want to say that i don't know the right way to write freebsd part of sconscript file, i mean that it's a dirty hack..

So freebsd section:
Code:
if (sys.platform == 'freebsd5') or (sys.platform == 'freebsd6') or (sys.platform == 'freebsd7'):
    LOCALBASE = '/usr/local/'
    X11BASE = '/usr/X11R6/'
    env = Environment(ENV = os.environ,
        CPPPATH = ['#include',LOCALBASE + '/include', LOCALBASE + '/include/AL',X11BASE + '/include', '#bullet-2.64/src'],
        LIBPATH = ['.', '#lib', LOCALBASE + '/lib', X11BASE + '/lib', '#bullet-2.64/out/freebsd/optimize/libs'],
        LINKFLAGS = ['-pthread','-lintl'],
        options = opts)
    check_headers = ['GL/gl.h', 'GL/glu.h', 'SDL/SDL.h', 'SDL/SDL_image.h', 'SDL/SDL_net.h', 'SDL/SDL_rotozoom.h','vorbis/vorbisfile.h' ]
    CC = 'cc'
    CXX = 'gcc'
    CXXFLAGS = '-Wall -O2'

And of course you need sdl_gfx, sdl_image, sdl_net,.. installed.

p.s. sorry for my English
Huh, i mean 'SConstruct' file.
I have added these changes to the SConstruct file in SVN. Please update your checkout of the trunk and let me know how they work. I did not make the changes to the last 3 lines you posted, these should be set within the env and those compiler options are controlled by other scons options. I also removed the include/AL since OpenAL is no longer used. r1917. Thanks nomoo!
[nomoo@pcbsd /usr/home/nomoo/games/vdrift]$ scons
scons: Reading SConscript files ...
KeyError: 'LOCALBASE':
File "/usr/home/nomoo/games/vdrift/SConstruct", line 47:
LOCALBASE = os.environ['LOCALBASE']
File "/usr/local/lib/python2.5/UserDict.py", line 22:
raise KeyError(key)

mmmmm, did you say scons options?
Could you post the contents of your environment variable LOCALBASE? That's suppose to come from the FreeBSD environment variables, it should show up when you run
Code:
env
or
Code:
echo $LOCALBASE
if it is present on your system. Same for CC, CXX, X11BASE, etc. Darn it where is acardenas...
[nomoo@pcbsd ~/]$ env | grep BASE
gives nothing Sad
OK, so I don't know much about FreeBSD (I don't have any boxes running any *BSD at all, wish I did...), but what version are you running? Perhaps it's not the same one as the one the person who wrote our FreeBSD SCons code was.
These vars are set when you install something via port, i guess there is something in system's makefiles but i'm not sure. Maybe we should do something like:
if [ "$LOCALBASE" = "" ]; then ... fi ?

offtop: is this only my hard/software trouble (on the rear bumper): http://dump.ru/dumpru_images/861239.jpg ?
The shadows on the rear bumper look like that on my system too, I think that's normal.

How are you installing - do you run SCons directly or do you use the ports system? I think this FreeBSD stuff is intended to work from the ports system. I suppose we can provide default values if the environment variables are not there. I'll look into it this evening.
I updated SVN last night with a fix, try it out again and see if it works.
well, it's almost works Smile

you just have to delete the previous freebsd part between ">>>" and "===", add check for glew like this:
Code:
check_headers = ['GL/gl.h', 'GL/glu.h', 'GL/glew.h', 'SDL/SDL.h', 'SDL/SDL_image.h', 'SDL/SDL_net.h', 'SDL/SDL_rotozoom.h', 'vorbis/vorbisfile.h']

But i have new error:
Code:
src/binreloc.c: In function `char* EjgI43220352208034_br_find_exe_dir(const char*)':
src/binreloc.c:380: error: invalid conversion from `void*' to `char*'
scons: *** [build/binreloc.o] Error 1
were there any changes?[/code]
The reason for the >>> and === and <<< parts is that when you make local modifications to a file in SVN, and then changes in the same code are checked in to SVN, and you update your working copy, a conflict is generated. You should be able to see this when you svn up, instead of "U SConstruct" (the U is for "updated") you will see "C SConstruct" (the C is for "conflict"). When there is a conflict Subversion puts your code next to the new code so you can decide which to keep. Thus you can manually resolve the conflict (you should do a "svn resolved SConstruct" once you have resolved it), or you can just delete the file and "svn up" again, and Subversion will restore the version from the server.

As for the BinReloc problem, I don't think you need it on FreeBSD. Try running
Code:
scons use_binreloc=0
and see if that clears up the problem for you. Regardless, I don't get this error, this must have something to do with the version of gcc you're using (which version is it?)...or maybe you have some super restrictive default gcc flags?
well, it's pretty strange:
scons use_binreloc=0:
Code:
g++ -o build/binreloc.o -c -g3 -pthread -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -I/usr/local/include -I/usr/X11R6/include -Ibullet-2.64/src -I/usr/local/include/SDL -I/usr/local/include src/binreloc.c
src/binreloc.c: In function `char* EjgI43220352208034_br_find_exe_dir(const char*)':
src/binreloc.c:380: error: invalid conversion from `void*' to `char*'
scons: *** [build/binreloc.o] Error 1

gcc --version
gcc (GCC) 3.4.6 [FreeBSD] 20060305

and add 'GL/glew.h' to 'check_headers' part please.
Hmmm, I still don't get why your compiler is choking on that line, but I added glew.h check to SConstruct, r 1935.
so, any ideas to get it working?
Pages: 1 2