This commit is contained in:
zicodxx 2007-01-12 16:31:25 +00:00
parent eb44193d3e
commit 8d1410b406
2 changed files with 39 additions and 43 deletions

View file

@ -66,6 +66,12 @@ common_sources = [
'3d/points.c', '3d/points.c',
'3d/rod.c', '3d/rod.c',
'3d/setup.c', '3d/setup.c',
'arch/sdl/event.c',
'arch/sdl/init.c',
'arch/sdl/joy.c',
'arch/sdl/joydefs.c',
'arch/sdl/key.c',
'arch/sdl/mouse.c',
'cfile/cfile.c', 'cfile/cfile.c',
'iff/iff.c', 'iff/iff.c',
'main/ai.c', 'main/ai.c',
@ -243,13 +249,7 @@ arch_linux_sources = [
'arch/linux/serial.c', 'arch/linux/serial.c',
'arch/linux/timer.c', 'arch/linux/timer.c',
'arch/linux/ukali.c', 'arch/linux/ukali.c',
'arch/sdl/clipboard.c', 'arch/sdl/clipboard.c'
'arch/sdl/event.c',
'arch/sdl/init.c',
'arch/sdl/joy.c',
'arch/sdl/joydefs.c',
'arch/sdl/key.c',
'arch/sdl/mouse.c'
] ]
# choosing a sound implementation for Linux # choosing a sound implementation for Linux
@ -274,13 +274,7 @@ arch_win32_sources = [
'arch/win32/serial.c', 'arch/win32/serial.c',
'arch/win32/timer.c', 'arch/win32/timer.c',
'arch/win32/winnet.c', 'arch/win32/winnet.c',
'arch/sdl/digi.c', 'arch/sdl/digi.c'
'arch/sdl/event.c',
'arch/sdl/init.c',
'arch/sdl/joy.c',
'arch/sdl/joydefs.c',
'arch/sdl/key.c',
'arch/sdl/mouse.c'
] ]
# for opengl # for opengl
@ -320,14 +314,16 @@ noasm_sources = [
# flags and stuff for all platforms # flags and stuff for all platforms
env = Environment(ENV = os.environ) env = Environment(ENV = os.environ)
env.ParseConfig('sdl-config --cflags')
env.ParseConfig('sdl-config --libs')
env.Append(CPPFLAGS = '-Wall -funsigned-char') env.Append(CPPFLAGS = '-Wall -funsigned-char')
env.Append(CPPDEFINES = [('D1XMAJOR', '\\"' + str(D1XMAJOR) + '\\"'), ('D1XMINOR', '\\"' + str(D1XMINOR) + '\\"')]) env.Append(CPPDEFINES = [('D1XMAJOR', '\\"' + str(D1XMAJOR) + '\\"'), ('D1XMINOR', '\\"' + str(D1XMINOR) + '\\"')])
#env.Append(CPPDEFINES = [('D1XMICRO', '\\"' + str(D1XMICRO) + '\\"')]) #env.Append(CPPDEFINES = [('D1XMICRO', '\\"' + str(D1XMICRO) + '\\"')])
env.Append(CPPDEFINES = [('USE_SDLMIXER', sdlmixer)]) env.Append(CPPDEFINES = [('USE_SDLMIXER', sdlmixer)])
env.Append(CPPDEFINES = ['NMONO', 'NETWORK', 'HAVE_NETIPX_IPX_H', 'SUPPORTS_NET_IP', '__SDL__', 'SDL_INPUT', 'SDL_AUDIO', '_REENTRANT']) env.Append(CPPDEFINES = ['NMONO', 'NETWORK', 'HAVE_NETIPX_IPX_H', 'SUPPORTS_NET_IP', '__SDL__', 'SDL_INPUT', 'SDL_AUDIO', '_REENTRANT'])
env.Append(CPPPATH = ['include', 'main', 'arch/sdl/include']) env.Append(CPPPATH = ['include', 'main', 'arch/sdl/include'])
sdllibs = ['SDL'] generic_libs = ['SDL']
sdlmixerlib = ['SDL_mixer'] sdlmixerlib = ['SDL_mixer']
# windows or *nix? # windows or *nix?
if sys.platform == 'win32': if sys.platform == 'win32':
@ -338,10 +334,10 @@ if sys.platform == 'win32':
env.Append(CPPDEFINES = ['__WINDOWS__']) env.Append(CPPDEFINES = ['__WINDOWS__'])
env.Append(CPPPATH = ['arch/win32/include']) env.Append(CPPPATH = ['arch/win32/include'])
ogldefines = ['SDL_GL', 'OGL_RUNTIME_LOAD', 'OGL'] ogldefines = ['SDL_GL', 'OGL_RUNTIME_LOAD', 'OGL']
common_sources = arch_win32_sources + common_sources common_sources += arch_win32_sources
ogllibs = [''] ogllibs = ''
winlibs = ['glu32', 'wsock32', 'winmm', 'mingw32', 'SDLmain'] winlibs = ['glu32', 'wsock32', 'winmm', 'mingw32', 'SDLmain']
alllibs = winlibs + sdllibs alllibs = winlibs + generic_libs
lflags = '-mwindows' lflags = '-mwindows'
else: else:
print "compiling on *NIX" print "compiling on *NIX"
@ -350,10 +346,10 @@ else:
env.Append(CPPDEFINES = ['__LINUX__', 'WANT_AWE32']) env.Append(CPPDEFINES = ['__LINUX__', 'WANT_AWE32'])
env.Append(CPPPATH = ['arch/linux/include']) env.Append(CPPPATH = ['arch/linux/include'])
ogldefines = ['SDL_GL', 'OGL'] ogldefines = ['SDL_GL', 'OGL']
common_sources = arch_linux_sources + common_sources common_sources += arch_linux_sources
ogllibs = ['GL', 'GLU'] ogllibs = ['GL', 'GLU']
alllibs = sdllibs libs = generic_libs
lflags = ' ' lflags = ''
# GP2X test env # GP2X test env
if (gp2x == 1): if (gp2x == 1):
@ -365,10 +361,8 @@ if (gp2x == 1):
env.Append(CPPDEFINES = ['GP2X']) env.Append(CPPDEFINES = ['GP2X'])
env.Append(CPPPATH = ['/usr/local/gp2xdev/include']) env.Append(CPPPATH = ['/usr/local/gp2xdev/include'])
#env.Append(CPPFLAGS = ' -ffast-math -fPIC -funroll-all-loops -fomit-frame-pointer -march=armv4t') # left for further optimisation/debugging #env.Append(CPPFLAGS = ' -ffast-math -fPIC -funroll-all-loops -fomit-frame-pointer -march=armv4t') # left for further optimisation/debugging
Object(['main/clock.c'], CC = '/usr/local/gp2xdev/bin/gp2x-gcc') common_sources += ['main/clock.c']
common_sources = common_sources + ['main/clock.o'] libs += ['pthread']
gp2xlibs = ['pthread']
alllibs = alllibs + gp2xlibs
lflags = '-static' lflags = '-static'
lpath = '/usr/local/gp2xdev/lib' lpath = '/usr/local/gp2xdev/lib'
else: else:
@ -378,7 +372,7 @@ else:
if (arm == 1): if (arm == 1):
no_asm = 1 no_asm = 1
env.Append(CPPDEFINES = ['WORDS_NEED_ALIGNMENT']) env.Append(CPPDEFINES = ['WORDS_NEED_ALIGNMENT'])
env.Append(CPPFLAGS = ' -mstructure-size-boundary=8') env.Append(CPPFLAGS = ['-mstructure-size-boundary=8'])
# sdl or opengl? # sdl or opengl?
if (sdl_only == 1): if (sdl_only == 1):
@ -386,33 +380,31 @@ if (sdl_only == 1):
target = 'd1x-rebirth-sdl' target = 'd1x-rebirth-sdl'
env.Append(CPPDEFINES = ['SDL_VIDEO']) env.Append(CPPDEFINES = ['SDL_VIDEO'])
env.Append(CPPPATH = ['arch/sdl/include']) env.Append(CPPPATH = ['arch/sdl/include'])
common_sources = arch_sdl_sources + common_sources common_sources += arch_sdl_sources
else: else:
print "building with OpenGL" print "building with OpenGL"
target = 'd1x-rebirth-gl' target = 'd1x-rebirth-gl'
env.Append(CPPDEFINES = ogldefines) env.Append(CPPDEFINES = ogldefines)
env.Append(CPPPATH = ['arch/ogl/include']) env.Append(CPPPATH = ['arch/ogl/include'])
common_sources = arch_ogl_sources + common_sources common_sources += arch_ogl_sources
alllibs += ogllibs libs += ogllibs
# SDL_mixer for sound? (*NIX only) # SDL_mixer for sound? (*NIX only)
if (sdlmixer == 1): if (sdlmixer == 1):
print "including SDL_mixer" print "including SDL_mixer"
alllibs += sdlmixerlib libs += sdlmixerlib
# debug? # debug?
if (debug == 1): if (debug == 1):
print "including: DEBUG" print "including: DEBUG"
lflags = ' -g ' env.Append(CPPFLAGS = ['-g'])
env.Append(CPPFLAGS = lflags)
else: else:
env.Append(CPPDEFINES = ['NDEBUG', 'RELEASE']) env.Append(CPPDEFINES = ['NDEBUG', 'RELEASE'])
env.Append(CPPFLAGS = ' -O2 ') env.Append(CPPFLAGS = ' -O2 ')
# profiler? # profiler?
if (profiler == 1): if (profiler == 1):
lflags = ' -pg ' env.Append(CPPFLAGS = ['-pg'])
env.Append(CPPFLAGS = lflags)
# assembler code? # assembler code?
if (no_asm == 0) and (sdl_only == 1): if (no_asm == 0) and (sdl_only == 1):
@ -421,30 +413,30 @@ if (no_asm == 0) and (sdl_only == 1):
Object(['texmap/tmappent.S', 'texmap/tmapppro.S'], AS='gcc', ASFLAGS='-D' + str(osdef) + ' -c ') Object(['texmap/tmappent.S', 'texmap/tmapppro.S'], AS='gcc', ASFLAGS='-D' + str(osdef) + ' -c ')
env.Replace(AS = 'nasm') env.Replace(AS = 'nasm')
env.Append(ASCOM = ' -f ' + str(osasmdef) + ' -d' + str(osdef) + ' -Itexmap/ ') env.Append(ASCOM = ' -f ' + str(osasmdef) + ' -d' + str(osdef) + ' -Itexmap/ ')
common_sources = asm_sources + common_sources + ['texmap/tmappent.o', 'texmap/tmapppro.o'] common_sources += asm_sources + ['texmap/tmappent.o', 'texmap/tmapppro.o']
else: else:
env.Append(CPPDEFINES = ['NO_ASM']) env.Append(CPPDEFINES = ['NO_ASM'])
common_sources = noasm_sources + common_sources common_sources += noasm_sources
#editor build? #editor build?
if (editor == 1): if (editor == 1):
env.Append(CPPDEFINES = ['EDITOR']) env.Append(CPPDEFINES = ['EDITOR'])
env.Append(CPPPATH = ['include/editor']) env.Append(CPPPATH = ['include/editor'])
common_sources = editor_sources + common_sources common_sources += editor_sources
#shareware build? #shareware build?
if (shareware == 1): if (shareware == 1):
env.Append(CPPDEFINES = ['SHAREWARE']) env.Append(CPPDEFINES = ['SHAREWARE'])
common_sources = ['main/gamesave.c', 'main/gamemine.c', 'main/snddecom.c'] + common_sources common_sources += ['main/gamesave.c', 'main/gamemine.c', 'main/snddecom.c']
if (shareware == 0) and (editor == 0): if (shareware == 0) and (editor == 0):
common_sources = ['main/loadrl2.c'] + common_sources common_sources += ['main/loadrl2.c']
print '\n' print '\n'
env.Append(CPPDEFINES = [('DESCENT_DATA_PATH', '\\"' + str(sharepath) + '\\"')]) env.Append(CPPDEFINES = [('DESCENT_DATA_PATH', '\\"' + str(sharepath) + '/\\"')])
# finally building program... # finally building program...
env.Program(target=str(target), source = common_sources, LIBS = alllibs, LINKFLAGS = str(lflags), LIBPATH = str(lpath)) env.Program(target=str(target), source = common_sources, LIBS = libs, LINKFLAGS = str(lflags), LIBPATH = str(lpath))
env.Install(BIN_DIR, str(target)) env.Install(BIN_DIR, str(target))
env.Alias('install', BIN_DIR) env.Alias('install', BIN_DIR)
@ -453,7 +445,7 @@ Help(PROGRAM_NAME + ', SConstruct file help:' +
""" """
Type 'scons' to build the binary. Type 'scons' to build the binary.
Type 'scons install' to build and install. Type 'scons install' to build (if it hasn't been done) and install.
Type 'scons -c' to clean up. Type 'scons -c' to clean up.
Extra options (add them to command line, like 'scons extraoption=value'): Extra options (add them to command line, like 'scons extraoption=value'):

View file

@ -4,6 +4,10 @@ D1X-Rebirth Changelog
-------- --------
main/kconfig.c, main/newmenu.c, main/playsave.c: joystick axes can be reassigned; higher offset for axes moving detection; correction for menus that are bigger than screen; plxver correction (is actually used) main/kconfig.c, main/newmenu.c, main/playsave.c: joystick axes can be reassigned; higher offset for axes moving detection; correction for menus that are bigger than screen; plxver correction (is actually used)
20070112
--------
SConstruct: cleanup
20070109 20070109
-------- --------
dxx-changelog.txt, arch/ogl/gr.c, arch/ogl/ogl.c, arch/ogl/include/ogl_init.h, main/playsave.c, texmap/scanline.c, texmap/tmapflat.c: allocate 'pixels' and 'texbuf' according to current screen resolution, saving over a hundred megabytes of memory; divide negative light rates of change properly (fix bug #2575) (from D2X CVS); divide negative window x-coordinates properly, fixing random crashes (from D2X CVS); make sscanf look for "%i.%i" instead of "v%i.%i" because the 'v' isn't written to file; added missing changelog entries dxx-changelog.txt, arch/ogl/gr.c, arch/ogl/ogl.c, arch/ogl/include/ogl_init.h, main/playsave.c, texmap/scanline.c, texmap/tmapflat.c: allocate 'pixels' and 'texbuf' according to current screen resolution, saving over a hundred megabytes of memory; divide negative light rates of change properly (fix bug #2575) (from D2X CVS); divide negative window x-coordinates properly, fixing random crashes (from D2X CVS); make sscanf look for "%i.%i" instead of "v%i.%i" because the 'v' isn't written to file; added missing changelog entries