More consistency in SConstruct command-line variables; Added automatic Endianess-checker; Set target to 'd2x-rebirth' no matter if OpenGL or not
This commit is contained in:
parent
281c9668bb
commit
8e23a0b452
|
@ -4,6 +4,7 @@ D2X-Rebirth Changelog
|
||||||
--------
|
--------
|
||||||
arch/sdl/joy.c, arch/sdl/key.c, arch/sdl/mouse.c, include/args.h, main/kconfig.c, main/kconfig.h, main/playsave.c, misc/args.c: Saving weapon keys in PLX like in D1X-Rebirth; Added Cycle Primary/Secondary for Mouse which makes wheel axis cycling unnecessary and also let Weapon Keys be assigned to a Mouse button; If GameArg.NoStickyKeys do flush these keys so they can be used as normal game keys - otherwise ban them; Fixed crash when reassigning mouse button greater than 3; Joystick/Mouse function taking button as argument now check for sanity of this value so they can safely be used in kconfig code and deal with unassigned key values
|
arch/sdl/joy.c, arch/sdl/key.c, arch/sdl/mouse.c, include/args.h, main/kconfig.c, main/kconfig.h, main/playsave.c, misc/args.c: Saving weapon keys in PLX like in D1X-Rebirth; Added Cycle Primary/Secondary for Mouse which makes wheel axis cycling unnecessary and also let Weapon Keys be assigned to a Mouse button; If GameArg.NoStickyKeys do flush these keys so they can be used as normal game keys - otherwise ban them; Fixed crash when reassigning mouse button greater than 3; Joystick/Mouse function taking button as argument now check for sanity of this value so they can safely be used in kconfig code and deal with unassigned key values
|
||||||
d2x.ini, include/args.h, main/gamerend.c, main/hud.c, main/inferno.c, main/menu.c, main/multi.c, main/net_ipx.c, main/net_udp.c, main/playsave.c, main/playsave.h, misc/args.c: Moved NoRedundancy, MultiMessages and NoRankings toggles from GameArg to PlayerCfg to be set via Misc Options
|
d2x.ini, include/args.h, main/gamerend.c, main/hud.c, main/inferno.c, main/menu.c, main/multi.c, main/net_ipx.c, main/net_udp.c, main/playsave.c, main/playsave.h, misc/args.c: Moved NoRedundancy, MultiMessages and NoRankings toggles from GameArg to PlayerCfg to be set via Misc Options
|
||||||
|
SConstruct, INSTALL.txt: More consistency in SConstruct command-line variables; Added automatic Endianess-checker; Set target to 'd2x-rebirth' no matter if OpenGL or not
|
||||||
|
|
||||||
20110102
|
20110102
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -21,11 +21,11 @@ Compiling:
|
||||||
*NIX:
|
*NIX:
|
||||||
-----
|
-----
|
||||||
Type 'scons' to compile the source.
|
Type 'scons' to compile the source.
|
||||||
You can also give additional options like 'scons sdl_only=1 asm=1'. See 'scons -h' for available options.
|
You can also give additional options like 'scons use_ipx=0'. See 'scons -h' for available options.
|
||||||
To install, use 'scons install' but remember to use all your options as well or SCons will re-compile and
|
To install, use 'scons install' but remember to use all your options as well or SCons will re-compile and
|
||||||
install without any options given to prior compiling. However it's STRONGLY recommended NOT to use the
|
install without any options given to prior compiling. However it's STRONGLY recommended NOT to use the
|
||||||
'install' argument but to create a package for your Linux distribution or operating system. 'install' will
|
'install' argument but to create a package for your Linux distribution or operating system. 'install' will
|
||||||
compile the resulting binary (d2x-rebirth-gl/sdl) to /usr/local/bin/ by default so to uninstall, just
|
compile the resulting binary (d2x-rebirth) to /usr/local/bin/ by default so to uninstall, just
|
||||||
delete the binary.
|
delete the binary.
|
||||||
|
|
||||||
MacOS:
|
MacOS:
|
||||||
|
|
87
SConstruct
87
SConstruct
|
@ -6,6 +6,7 @@ import os
|
||||||
import SCons.Util
|
import SCons.Util
|
||||||
|
|
||||||
PROGRAM_NAME = 'D2X-Rebirth'
|
PROGRAM_NAME = 'D2X-Rebirth'
|
||||||
|
target = 'd2x-rebirth'
|
||||||
|
|
||||||
# version number
|
# version number
|
||||||
D2XMAJOR = 0
|
D2XMAJOR = 0
|
||||||
|
@ -24,16 +25,27 @@ DATA_DIR = PREFIX + DATA_SUBDIR
|
||||||
sharepath = str(ARGUMENTS.get('sharepath', DATA_DIR))
|
sharepath = str(ARGUMENTS.get('sharepath', DATA_DIR))
|
||||||
debug = int(ARGUMENTS.get('debug', 0))
|
debug = int(ARGUMENTS.get('debug', 0))
|
||||||
profiler = int(ARGUMENTS.get('profiler', 0))
|
profiler = int(ARGUMENTS.get('profiler', 0))
|
||||||
sdl_only = int(ARGUMENTS.get('sdl_only', 0))
|
opengl = int(ARGUMENTS.get('opengl', 1))
|
||||||
asm = int(ARGUMENTS.get('asm', 0))
|
asm = int(ARGUMENTS.get('asm', 0))
|
||||||
editor = int(ARGUMENTS.get('editor', 0))
|
editor = int(ARGUMENTS.get('editor', 0))
|
||||||
sdlmixer = int(ARGUMENTS.get('sdlmixer', 0))
|
sdlmixer = int(ARGUMENTS.get('sdlmixer', 1))
|
||||||
arm = int(ARGUMENTS.get('arm', 0))
|
|
||||||
ipv6 = int(ARGUMENTS.get('ipv6', 0))
|
ipv6 = int(ARGUMENTS.get('ipv6', 0))
|
||||||
use_udp = int(ARGUMENTS.get('use_udp', 1))
|
use_udp = int(ARGUMENTS.get('use_udp', 1))
|
||||||
use_ipx = int(ARGUMENTS.get('use_ipx', 1))
|
use_ipx = int(ARGUMENTS.get('use_ipx', 1))
|
||||||
verbosebuild = int(ARGUMENTS.get('verbosebuild', 0))
|
verbosebuild = int(ARGUMENTS.get('verbosebuild', 0))
|
||||||
|
|
||||||
|
# endianess-checker
|
||||||
|
def checkEndian():
|
||||||
|
import struct
|
||||||
|
array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04')
|
||||||
|
i = struct.unpack('i', array)
|
||||||
|
if i == struct.unpack('<i', array):
|
||||||
|
return "little"
|
||||||
|
elif i == struct.unpack('>i', array):
|
||||||
|
return "big"
|
||||||
|
return "unknown"
|
||||||
|
|
||||||
|
|
||||||
print '\n===== ' + PROGRAM_NAME + VERSION_STRING + ' =====\n'
|
print '\n===== ' + PROGRAM_NAME + VERSION_STRING + ' =====\n'
|
||||||
|
|
||||||
# general source files
|
# general source files
|
||||||
|
@ -239,7 +251,7 @@ arch_ogl_sources = [
|
||||||
'arch/ogl/ogl.c',
|
'arch/ogl/ogl.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
# for sdl
|
# for non-ogl
|
||||||
arch_sdl_sources = [
|
arch_sdl_sources = [
|
||||||
'arch/sdl/gr.c',
|
'arch/sdl/gr.c',
|
||||||
'texmap/tmapflat.c'
|
'texmap/tmapflat.c'
|
||||||
|
@ -354,23 +366,34 @@ else:
|
||||||
ogllibs = ['GL', 'GLU']
|
ogllibs = ['GL', 'GLU']
|
||||||
lflags = '-L/usr/X11R6/lib'
|
lflags = '-L/usr/X11R6/lib'
|
||||||
|
|
||||||
# arm architecture?
|
# set endianess
|
||||||
if (arm == 1):
|
if (checkEndian() == "big"):
|
||||||
|
print "BigEndian machine detected"
|
||||||
asm = 0
|
asm = 0
|
||||||
env.Append(CPPDEFINES = ['WORDS_NEED_ALIGNMENT'])
|
env.Append(CPPDEFINES = ['WORDS_BIGENDIAN'])
|
||||||
env.Append(CPPFLAGS = ['-mstructure-size-boundary=8'])
|
elif (checkEndian() == "little"):
|
||||||
|
print "LittleEndian machine detected"
|
||||||
|
|
||||||
# sdl or opengl?
|
# opengl or software renderer?
|
||||||
if (sdl_only == 1):
|
if (opengl == 1):
|
||||||
print "building with SDL"
|
|
||||||
target = 'd2x-rebirth-sdl'
|
|
||||||
common_sources += arch_sdl_sources
|
|
||||||
else:
|
|
||||||
print "building with OpenGL"
|
print "building with OpenGL"
|
||||||
target = 'd2x-rebirth-gl'
|
|
||||||
env.Append(CPPDEFINES = ogldefines)
|
env.Append(CPPDEFINES = ogldefines)
|
||||||
common_sources += arch_ogl_sources
|
common_sources += arch_ogl_sources
|
||||||
libs += ogllibs
|
libs += ogllibs
|
||||||
|
else:
|
||||||
|
print "building with Software Renderer"
|
||||||
|
common_sources += arch_sdl_sources
|
||||||
|
|
||||||
|
# assembler code?
|
||||||
|
if (asm == 1) and (opengl == 0):
|
||||||
|
print "including: ASSEMBLER"
|
||||||
|
Object(['texmap/tmappent.S', 'texmap/tmapppro.S'], AS='gcc', ASFLAGS='-D' + str(osdef) + ' -c ')
|
||||||
|
env.Replace(AS = 'nasm')
|
||||||
|
env.Append(ASCOM = ' -f ' + str(osasmdef) + ' -d' + str(osdef) + ' -Itexmap/ ')
|
||||||
|
common_sources += asm_sources + ['texmap/tmappent.o', 'texmap/tmapppro.o']
|
||||||
|
else:
|
||||||
|
env.Append(CPPDEFINES = ['NO_ASM'])
|
||||||
|
common_sources += noasm_sources
|
||||||
|
|
||||||
# SDL_mixer support?
|
# SDL_mixer support?
|
||||||
if (sdlmixer == 1):
|
if (sdlmixer == 1):
|
||||||
|
@ -393,17 +416,6 @@ if (profiler == 1):
|
||||||
env.Append(CPPFLAGS = ['-pg'])
|
env.Append(CPPFLAGS = ['-pg'])
|
||||||
lflags += ' -pg'
|
lflags += ' -pg'
|
||||||
|
|
||||||
# assembler code?
|
|
||||||
if (asm == 1) and (sdl_only == 1):
|
|
||||||
print "including: ASSEMBLER"
|
|
||||||
Object(['texmap/tmappent.S', 'texmap/tmapppro.S'], AS='gcc', ASFLAGS='-D' + str(osdef) + ' -c ')
|
|
||||||
env.Replace(AS = 'nasm')
|
|
||||||
env.Append(ASCOM = ' -f ' + str(osasmdef) + ' -d' + str(osdef) + ' -Itexmap/ ')
|
|
||||||
common_sources += asm_sources + ['texmap/tmappent.o', 'texmap/tmapppro.o']
|
|
||||||
else:
|
|
||||||
env.Append(CPPDEFINES = ['NO_ASM'])
|
|
||||||
common_sources += noasm_sources
|
|
||||||
|
|
||||||
#editor build?
|
#editor build?
|
||||||
if (editor == 1):
|
if (editor == 1):
|
||||||
env.Append(CPPDEFINES = ['EDITOR'])
|
env.Append(CPPDEFINES = ['EDITOR'])
|
||||||
|
@ -451,18 +463,17 @@ Help(PROGRAM_NAME + ', SConstruct file help:' +
|
||||||
|
|
||||||
Extra options (add them to command line, like 'scons extraoption=value'):
|
Extra options (add them to command line, like 'scons extraoption=value'):
|
||||||
|
|
||||||
'sharepath=DIR' (non-Mac OS *NIX only) use DIR for shared game data. (default: /usr/local/share/games/d2x-rebirth)
|
'sharepath=[DIR]' (non-Mac OS *NIX only) use [DIR] for shared game data. [default: /usr/local/share/games/d2x-rebirth]
|
||||||
'sdl_only=1' don't include OpenGL, use SDL-only instead
|
'opengl=[0/1]' build with OpenGL support [default: 1]
|
||||||
'sdlmixer=1' use SDL_Mixer for sound (includes external music support)
|
'sdlmixer=[0/1]' build with SDL_Mixer support for sound and music (includes external music support) [default: 1]
|
||||||
'asm=1' use ASSEMBLER code (only with sdl_only=1, requires NASM and x86)
|
'asm=[0/1]' build with ASSEMBLER code (only with opengl=0, requires NASM and x86) [default: 0]
|
||||||
'debug=1' build DEBUG binary which includes asserts, debugging output, cheats and more output
|
'debug=[0/1]' build DEBUG binary which includes asserts, debugging output, cheats and more output [default: 0]
|
||||||
'profiler=1' do profiler build
|
'profiler=[0/1]' profiler build [default: 0]
|
||||||
'editor=1' build editor !EXPERIMENTAL!
|
'editor=[0/1]' include editor into build (!EXPERIMENTAL!) [default: 0]
|
||||||
'arm=1' compile for ARM architecture
|
'ipv6=[0/1]' enable IPv6 compability [default: 0]
|
||||||
'ipv6=1' enables IPv6 copability
|
'use_udp=[0/1]' enable UDP support [default: 1]
|
||||||
'use_udp=0' disable UDP support
|
'use_ipx=[0/1]' enable IPX support (IPX available on Linux and Windows, only) [default: 1]
|
||||||
'use_ipx=0' disable IPX support (IPX available on Linux and Windows, only)
|
'verbosebuild=[0/1]' print out all compiler/linker messages during building [default: 0]
|
||||||
'verbosebuild=1' print out all compiler/linker messages during building
|
|
||||||
|
|
||||||
Default values:
|
Default values:
|
||||||
""" + ' sharepath = ' + DATA_DIR + """
|
""" + ' sharepath = ' + DATA_DIR + """
|
||||||
|
|
Loading…
Reference in a new issue