add svnrev.h to linux
solves issue 93 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@780 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
407bd39d8b
commit
6336af92a1
221
SConstruct
221
SConstruct
|
@ -18,69 +18,69 @@ description="A wii/gamecube emulator"
|
||||||
license="GPL v2"
|
license="GPL v2"
|
||||||
|
|
||||||
warnings = [
|
warnings = [
|
||||||
'all',
|
'all',
|
||||||
'write-strings',
|
'write-strings',
|
||||||
'shadow',
|
'shadow',
|
||||||
'pointer-arith',
|
'pointer-arith',
|
||||||
'packed',
|
'packed',
|
||||||
'no-conversion',
|
'no-conversion',
|
||||||
]
|
]
|
||||||
compileFlags = [
|
compileFlags = [
|
||||||
'-fno-exceptions',
|
'-fno-exceptions',
|
||||||
'-fno-strict-aliasing',
|
'-fno-strict-aliasing',
|
||||||
'-msse2',
|
'-msse2',
|
||||||
'-fvisibility=hidden',
|
'-fvisibility=hidden',
|
||||||
#'-fomit-frame-pointer'
|
#'-fomit-frame-pointer'
|
||||||
]
|
]
|
||||||
|
|
||||||
cppDefines = [
|
cppDefines = [
|
||||||
( '_FILE_OFFSET_BITS', 64),
|
( '_FILE_OFFSET_BITS', 64),
|
||||||
'_LARGEFILE_SOURCE',
|
'_LARGEFILE_SOURCE',
|
||||||
'GCC_HASCLASSVISIBILITY',
|
'GCC_HASCLASSVISIBILITY',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
compileFlags += [ '-I/opt/local/include' ]
|
compileFlags += [ '-I/opt/local/include' ]
|
||||||
|
|
||||||
include_paths = [
|
include_paths = [
|
||||||
'../../../Core/Common/Src',
|
'../../../Core/Common/Src',
|
||||||
'../../../Core/DiscIO/Src',
|
'../../../Core/DiscIO/Src',
|
||||||
'../../../PluginSpecs',
|
'../../../PluginSpecs',
|
||||||
'../../../',
|
'../../../',
|
||||||
'../../../Core/Core/Src',
|
'../../../Core/Core/Src',
|
||||||
'../../../Core/DebuggerWX/Src',
|
'../../../Core/DebuggerWX/Src',
|
||||||
'../../../../Externals/Bochs_disasm',
|
'../../../../Externals/Bochs_disasm',
|
||||||
'../../../../Externals/LZO',
|
'../../../../Externals/LZO',
|
||||||
'../../../Core/VideoCommon/Src',
|
'../../../Core/VideoCommon/Src',
|
||||||
]
|
]
|
||||||
|
|
||||||
dirs = [
|
dirs = [
|
||||||
'Source/Core/Common/Src',
|
'Source/Core/Common/Src',
|
||||||
'Externals/Bochs_disasm',
|
'Externals/Bochs_disasm',
|
||||||
'Externals/LZO',
|
'Externals/LZO',
|
||||||
'Source/Core/Core/Src',
|
'Source/Core/Core/Src',
|
||||||
'Source/Core/DiscIO/Src',
|
'Source/Core/DiscIO/Src',
|
||||||
'Source/Core/VideoCommon/Src',
|
'Source/Core/VideoCommon/Src',
|
||||||
'Source/Plugins/Plugin_VideoOGL/Src',
|
'Source/Plugins/Plugin_VideoOGL/Src',
|
||||||
'Source/Plugins/Plugin_DSP_HLE/Src',
|
'Source/Plugins/Plugin_DSP_HLE/Src',
|
||||||
# 'Source/Plugins/Plugin_DSP_LLE/Src',
|
'Source/Plugins/Plugin_DSP_LLE/Src',
|
||||||
'Source/Plugins/Plugin_DSP_NULL/Src',
|
'Source/Plugins/Plugin_DSP_NULL/Src',
|
||||||
'Source/Plugins/Plugin_PadSimple/Src',
|
'Source/Plugins/Plugin_PadSimple/Src',
|
||||||
'Source/Plugins/Plugin_nJoy_SDL/Src',
|
'Source/Plugins/Plugin_nJoy_SDL/Src',
|
||||||
'Source/Plugins/Plugin_Wiimote_Test/Src',
|
'Source/Plugins/Plugin_Wiimote_Test/Src',
|
||||||
'Source/Core/DolphinWX/Src',
|
'Source/Core/DolphinWX/Src',
|
||||||
]
|
]
|
||||||
|
|
||||||
builders = {}
|
builders = {}
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
from plistlib import writePlist
|
from plistlib import writePlist
|
||||||
def createPlist(target, source, env):
|
def createPlist(target, source, env):
|
||||||
properties = {}
|
properties = {}
|
||||||
for srcNode in source:
|
for srcNode in source:
|
||||||
properties.update(srcNode.value)
|
properties.update(srcNode.value)
|
||||||
for dstNode in target:
|
for dstNode in target:
|
||||||
writePlist(properties, str(dstNode))
|
writePlist(properties, str(dstNode))
|
||||||
builders['Plist'] = Builder(action = createPlist)
|
builders['Plist'] = Builder(action = createPlist)
|
||||||
|
|
||||||
lib_paths = include_paths
|
lib_paths = include_paths
|
||||||
|
@ -88,66 +88,65 @@ lib_paths = include_paths
|
||||||
# handle command line options
|
# handle command line options
|
||||||
vars = Variables('args.cache')
|
vars = Variables('args.cache')
|
||||||
vars.AddVariables(
|
vars.AddVariables(
|
||||||
BoolVariable('verbose', 'Set for compilation line', False),
|
BoolVariable('verbose', 'Set for compilation line', False),
|
||||||
BoolVariable('debug', 'Set for debug build', False),
|
BoolVariable('debug', 'Set for debug build', False),
|
||||||
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
|
BoolVariable('lint', 'Set for lint build (extra warnings)', False),
|
||||||
BoolVariable('nowx', 'Set For Building with no WX libs (WIP)', False),
|
BoolVariable('nowx', 'Set For Building with no WX libs (WIP)', False),
|
||||||
EnumVariable('flavor', 'Choose a build flavor', 'release',
|
EnumVariable('flavor', 'Choose a build flavor', 'release',
|
||||||
allowed_values = ('release', 'devel', 'debug'),
|
allowed_values = ('release', 'devel', 'debug'),
|
||||||
ignorecase = 2
|
ignorecase = 2
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
env = Environment(
|
env = Environment(
|
||||||
CC = 'gcc',
|
CC = 'gcc',
|
||||||
CXX = 'g++',
|
CXX = 'g++',
|
||||||
CPPPATH = include_paths,
|
CPPPATH = include_paths,
|
||||||
LIBPATH = lib_paths,
|
LIBPATH = lib_paths,
|
||||||
variables = vars,
|
variables = vars,
|
||||||
ENV = {
|
ENV = {
|
||||||
'PATH' : os.environ['PATH'],
|
'PATH' : os.environ['PATH'],
|
||||||
'HOME' : os.environ['HOME']
|
'HOME' : os.environ['HOME']
|
||||||
},
|
},
|
||||||
BUILDERS = builders,
|
BUILDERS = builders,
|
||||||
DESCRIPTION = description,
|
DESCRIPTION = description,
|
||||||
SUMMARY = description,
|
SUMMARY = description,
|
||||||
LICENSE = license,
|
LICENSE = license,
|
||||||
NAME = name,
|
NAME = name,
|
||||||
VERSION = version,
|
VERSION = version,
|
||||||
)
|
)
|
||||||
|
|
||||||
# save the given command line options
|
# save the given command line options
|
||||||
vars.Save('args.cache', env)
|
vars.Save('args.cache', env)
|
||||||
|
|
||||||
# verbose compile
|
# verbose compile
|
||||||
if not env['verbose']:
|
if not env['verbose']:
|
||||||
env['CCCOMSTR'] = "Compiling $TARGET"
|
env['CCCOMSTR'] = "Compiling $TARGET"
|
||||||
env['CXXCOMSTR'] = "Compiling $TARGET"
|
env['CXXCOMSTR'] = "Compiling $TARGET"
|
||||||
env['ARCOMSTR'] = "Archiving $TARGET"
|
env['ARCOMSTR'] = "Archiving $TARGET"
|
||||||
env['LINKCOMSTR'] = "Linking $TARGET"
|
env['LINKCOMSTR'] = "Linking $TARGET"
|
||||||
env['ASCOMSTR'] = "Assembling $TARGET"
|
env['ASCOMSTR'] = "Assembling $TARGET"
|
||||||
env['ASPPCOMSTR'] = "Assembling $TARGET"
|
env['ASPPCOMSTR'] = "Assembling $TARGET"
|
||||||
env['SHCCCOMSTR'] = "Compiling shared $TARGET"
|
env['SHCCCOMSTR'] = "Compiling shared $TARGET"
|
||||||
env['SHCXXCOMSTR'] = "Compiling shared $TARGET"
|
env['SHCXXCOMSTR'] = "Compiling shared $TARGET"
|
||||||
env['SHLINKCOMSTR'] = "Linking shared $TARGET"
|
env['SHLINKCOMSTR'] = "Linking shared $TARGET"
|
||||||
env['RANLIBCOMSTR'] = "Indexing $TARGET"
|
env['RANLIBCOMSTR'] = "Indexing $TARGET"
|
||||||
|
|
||||||
# build falvuor
|
# build falvuor
|
||||||
flavour = ARGUMENTS.get('flavor')
|
flavour = ARGUMENTS.get('flavor')
|
||||||
if (flavour == 'debug'):
|
if (flavour == 'debug'):
|
||||||
compileFlags.append('-g')
|
compileFlags.append('-g')
|
||||||
cppDefines.append('LOGGING')
|
cppDefines.append('LOGGING')
|
||||||
elif (flavour == 'devel'):
|
elif (flavour == 'devel'):
|
||||||
compileFlags.append('-g')
|
compileFlags.append('-g')
|
||||||
else:
|
else:
|
||||||
compileFlags.append('-O3')
|
compileFlags.append('-O3')
|
||||||
|
|
||||||
|
|
||||||
# more warnings
|
# more warnings
|
||||||
if env['lint']:
|
if env['lint']:
|
||||||
warnings.append('error')
|
warnings.append('error')
|
||||||
warnings.append('unreachable-code')
|
warnings.append('unreachable-code')
|
||||||
warnings.append('float-equal')
|
warnings.append('float-equal')
|
||||||
|
|
||||||
# add the warnings to the compile flags
|
# add the warnings to the compile flags
|
||||||
compileFlags += [ '-W' + warning for warning in warnings ]
|
compileFlags += [ '-W' + warning for warning in warnings ]
|
||||||
|
@ -166,31 +165,31 @@ tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
|
||||||
conf = env.Configure(custom_tests = tests)
|
conf = env.Configure(custom_tests = tests)
|
||||||
|
|
||||||
if not conf.CheckPKGConfig('0.15.0'):
|
if not conf.CheckPKGConfig('0.15.0'):
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
if not conf.CheckSDL('1.0.0'):
|
if not conf.CheckSDL('1.0.0'):
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
if not conf.CheckPKG('ao'):
|
if not conf.CheckPKG('ao'):
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
# handling wx flags CCFLAGS should be created before
|
# handling wx flags CCFLAGS should be created before
|
||||||
if not env['nowx']:
|
if not env['nowx']:
|
||||||
if not conf.CheckWXConfig(
|
if not conf.CheckWXConfig(
|
||||||
'2.8', ['gl', 'adv', 'core', 'base'], env['debug']
|
'2.8', ['gl', 'adv', 'core', 'base'], env['debug']
|
||||||
):
|
):
|
||||||
print 'gui build requires wxwidgets >= 2.8'
|
print 'gui build requires wxwidgets >= 2.8'
|
||||||
Exit(1)
|
Exit(1)
|
||||||
if not env['nowx']:
|
if not env['nowx']:
|
||||||
dirs += ['Source/Core/DebuggerWX/Src',]
|
dirs += ['Source/Core/DebuggerWX/Src',]
|
||||||
|
|
||||||
# After all configuration tests are done
|
# After all configuration tests are done
|
||||||
env = conf.Finish()
|
env = conf.Finish()
|
||||||
|
|
||||||
#wx windows flags
|
#wx windows flags
|
||||||
if not env['nowx']:
|
if not env['nowx']:
|
||||||
wxconfig.ParseWXConfig(env)
|
wxconfig.ParseWXConfig(env)
|
||||||
compileFlags += ['-DUSE_WX',]
|
compileFlags += ['-DUSE_WX',]
|
||||||
|
|
||||||
#get sdl stuff
|
#get sdl stuff
|
||||||
env.ParseConfig('sdl-config --cflags --libs')
|
env.ParseConfig('sdl-config --cflags --libs')
|
||||||
|
@ -203,20 +202,22 @@ env.AddMethod(utils.filterWarnings)
|
||||||
|
|
||||||
Export('env')
|
Export('env')
|
||||||
|
|
||||||
|
utils.GenerateRevFile(env['flavor'], "Source/Core/Common/Src/svnrev_template.h",
|
||||||
|
"Source/Core/Common/Src/svnrev.h")
|
||||||
# print a nice progress indication when not compiling
|
# print a nice progress indication when not compiling
|
||||||
Progress(['-\r', '\\\r', '|\r', '/\r'], interval = 5)
|
Progress(['-\r', '\\\r', '|\r', '/\r'], interval = 5)
|
||||||
|
|
||||||
# die on unknown variables
|
# die on unknown variables
|
||||||
unknown = vars.UnknownVariables()
|
unknown = vars.UnknownVariables()
|
||||||
if unknown:
|
if unknown:
|
||||||
print "Unknown variables:", unknown.keys()
|
print "Unknown variables:", unknown.keys()
|
||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
# generate help
|
# generate help
|
||||||
Help(vars.GenerateHelpText(env))
|
Help(vars.GenerateHelpText(env))
|
||||||
|
|
||||||
for subdir in dirs:
|
for subdir in dirs:
|
||||||
SConscript(
|
SConscript(
|
||||||
subdir + os.sep + 'SConscript',
|
subdir + os.sep + 'SConscript',
|
||||||
duplicate = 0
|
duplicate = 0
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,36 +2,53 @@ import os
|
||||||
|
|
||||||
# methods that should be added to env
|
# methods that should be added to env
|
||||||
def filterWarnings(self, flags):
|
def filterWarnings(self, flags):
|
||||||
return ' '.join(
|
return ' '.join(
|
||||||
flag
|
flag
|
||||||
for flag in flags
|
for flag in flags
|
||||||
if not flag.startswith('-W')
|
if not flag.startswith('-W')
|
||||||
)
|
)
|
||||||
|
|
||||||
# taken from scons wiki
|
# taken from scons wiki
|
||||||
def CheckPKGConfig(context, version):
|
def CheckPKGConfig(context, version):
|
||||||
context.Message( 'Checking for pkg-config version > %s... ' % version)
|
context.Message( 'Checking for pkg-config version > %s... ' % version)
|
||||||
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
|
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]
|
||||||
context.Result( ret )
|
context.Result( ret )
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def CheckPKG(context, name):
|
def CheckPKG(context, name):
|
||||||
context.Message( 'Checking for %s... ' % name )
|
context.Message( 'Checking for %s... ' % name )
|
||||||
ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
|
ret = context.TryAction('pkg-config --exists \'%s\'' % name)[0]
|
||||||
context.Result( ret )
|
context.Result( ret )
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def CheckSDL(context, version):
|
def CheckSDL(context, version):
|
||||||
context.Message( 'Checking for sdl lib version > %s... ' % version)
|
context.Message( 'Checking for sdl lib version > %s... ' % version)
|
||||||
sdl_config = context.env.WhereIs('sdl-config')
|
sdl_config = context.env.WhereIs('sdl-config')
|
||||||
if sdl_config == None:
|
if sdl_config == None:
|
||||||
ret = 0
|
ret = 0
|
||||||
else:
|
else:
|
||||||
found_ver = os.popen('sdl-config --version').read().strip()
|
found_ver = os.popen('sdl-config --version').read().strip()
|
||||||
required = [int(n) for n in version.split(".")]
|
required = [int(n) for n in version.split(".")]
|
||||||
found = [int(n) for n in found_ver.split(".")]
|
found = [int(n) for n in found_ver.split(".")]
|
||||||
ret = (found >= required)
|
ret = (found >= required)
|
||||||
|
|
||||||
context.Result( ret )
|
context.Result( ret )
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
def GenerateRevFile(flavour, template, output):
|
||||||
|
|
||||||
|
try:
|
||||||
|
svnrev = os.popen('svnversion .').read().strip().split(':')[0]
|
||||||
|
except:
|
||||||
|
svnrev = ""
|
||||||
|
|
||||||
|
revstr = svnrev + "-" + flavour
|
||||||
|
tmpstr = open(template, "r").read().replace("$WCREV$",revstr)
|
||||||
|
template.close()
|
||||||
|
|
||||||
|
outfile = open(output, 'w')
|
||||||
|
outfile.write(tmpstr +"\n")
|
||||||
|
outfile.close()
|
||||||
|
|
||||||
|
return
|
||||||
|
|
|
@ -17,8 +17,9 @@
|
||||||
|
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#if defined(_WIN32)
|
|
||||||
#include "svnrev.h"
|
#include "svnrev.h"
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
#include "OS/Win32.h"
|
#include "OS/Win32.h"
|
||||||
#endif
|
#endif
|
||||||
#include "GLInit.h"
|
#include "GLInit.h"
|
||||||
|
@ -101,16 +102,13 @@ BOOL Callback_PeekMessages()
|
||||||
|
|
||||||
void UpdateFPSDisplay(const char *text)
|
void UpdateFPSDisplay(const char *text)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
|
||||||
char temp[512];
|
|
||||||
sprintf(temp, "SVN R%i: GL: %s", SVN_REV, text);
|
|
||||||
SetWindowText(EmuWindow::GetWnd(), temp);
|
|
||||||
OpenGL_SetWindowText(temp);
|
|
||||||
#else
|
|
||||||
char temp[512];
|
char temp[512];
|
||||||
sprintf(temp, "SVN %s: GL: %s", "Linux", text); //TODO: Set to svn rev //
|
sprintf(temp, "SVN R%s: GL: %s", SVN_REV_STR, text);
|
||||||
OpenGL_SetWindowText(temp);
|
#if defined(_WIN32)
|
||||||
|
SetWindowText(EmuWindow::GetWnd(), temp);
|
||||||
#endif
|
#endif
|
||||||
|
OpenGL_SetWindowText(temp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue