Cure some bit rot and allow building the standaline memcard manager on OS X.

The app appears broken though.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5650 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang 2010-06-11 15:18:36 +00:00
parent e7f7eff2b6
commit d937b73d9c
4 changed files with 295 additions and 294 deletions

View File

@ -22,6 +22,10 @@ if wxenv['HAVE_WX']:
LIBS = libs LIBS = libs
wxenv.Append(
LIBS = libs
)
exeGUI = env['binary_dir'] + 'MemcardManager' exeGUI = env['binary_dir'] + 'MemcardManager'
wxenv.Program(exeGUI, files) wxenv.Program(exeGUI, files)

View File

@ -24,7 +24,6 @@ compileFlags = [
'-fno-exceptions', '-fno-exceptions',
'-fno-strict-aliasing', '-fno-strict-aliasing',
'-msse2', '-msse2',
#'-fomit-frame-pointer'
] ]
if sys.platform != 'win32': if sys.platform != 'win32':
compileFlags += [ '-fvisibility=hidden' ] compileFlags += [ '-fvisibility=hidden' ]
@ -46,7 +45,7 @@ include_paths = [
dirs = [ dirs = [
basedir + 'Source/Core/Common/Src', basedir + 'Source/Core/Common/Src',
basedir + '.', basedir + '.'
] ]
builders = {} builders = {}
@ -60,14 +59,14 @@ if sys.platform == 'darwin':
writePlist(properties, str(dstNode)) writePlist(properties, str(dstNode))
builders['Plist'] = Builder(action = createPlist) builders['Plist'] = Builder(action = createPlist)
# 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('lint', 'Set for lint build (extra warnings)', False), BoolVariable('lint', 'Set for lint build (extra warnings)', False),
EnumVariable('flavor', 'Choose a build flavor', 'release', EnumVariable('flavor', 'Choose a build flavor', 'release',
allowed_values = ('release', 'devel', 'debug', 'fastlog', 'prof'), allowed_values = ('release','devel','debug','fastlog','prof'),
ignorecase = 2 ignorecase = 2
), ),
PathVariable('wxconfig', 'Path to the wxconfig', None), PathVariable('wxconfig', 'Path to the wxconfig', None),
@ -100,10 +99,10 @@ else:
BUILDERS = builders, BUILDERS = builders,
) )
# 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"
@ -116,31 +115,36 @@ if not env['verbose']:
env['SHLINKCOMSTR'] = "Linking shared $TARGET" env['SHLINKCOMSTR'] = "Linking shared $TARGET"
env['RANLIBCOMSTR'] = "Indexing $TARGET" env['RANLIBCOMSTR'] = "Indexing $TARGET"
# build flavour # Build flavour
flavour = ARGUMENTS.get('flavor') flavour = env['flavor']
if (flavour == 'debug'): if (flavour == 'debug'):
compileFlags.append('-g') compileFlags.append('-ggdb')
cppDefines.append('_DEBUG') #enables LOGGING cppDefines.append('_DEBUG') #enables LOGGING
# FIXME: this disable wx debugging how do we make it work? # FIXME: this disable wx debugging how do we make it work?
cppDefines.append('NDEBUG') cppDefines.append('NDEBUG')
elif (flavour == 'devel'): elif (flavour == 'devel'):
compileFlags.append('-g') compileFlags.append('-ggdb')
elif (flavour == 'fastlog'): elif (flavour == 'fastlog'):
compileFlags.append('-O3') compileFlags.append('-O3')
cppDefines.append('DEBUGFAST') cppDefines.append('DEBUGFAST')
elif (flavour == 'prof'): elif (flavour == 'prof'):
compileFlags.append('-O3') compileFlags.append('-O3')
compileFlags.append('-g') compileFlags.append('-ggdb')
elif (flavour == 'release'): elif (flavour == 'release'):
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') # Should check for the availability of these (in GCC 4.3 or newer)
warnings.append('float-equal') if sys.platform != 'darwin':
warnings.append('no-array-bounds')
warnings.append('no-unused-result')
# wxWidgets causes too many warnings with these
#warnings.append('unreachable-code')
#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 ]
env['CCFLAGS'] = compileFlags env['CCFLAGS'] = compileFlags
@ -156,11 +160,9 @@ tests = {'CheckWXConfig' : wxconfig.CheckWXConfig,
'CheckPKG' : utils.CheckPKG, 'CheckPKG' : utils.CheckPKG,
} }
#object files # Object files
env['build_dir'] = os.path.join(basedir, 'Build', platform.system() + '-' + 'MemCardManager' + os.sep) env['build_dir'] = os.path.join(basedir, 'Build',
platform.system() + '-' + 'MemCardManager' + os.sep)
VariantDir(env['build_dir'], '.', duplicate=0)
conf = env.Configure(custom_tests = tests, conf = env.Configure(custom_tests = tests,
config_h="Source/Core/Common/Src/Config.h") config_h="Source/Core/Common/Src/Config.h")
@ -168,25 +170,25 @@ conf = env.Configure(custom_tests = tests,
if not conf.CheckPKGConfig('0.15.0'): if not conf.CheckPKGConfig('0.15.0'):
print "Can't find pkg-config, some tests will fail" print "Can't find pkg-config, some tests will fail"
# OS X specifics
if sys.platform == 'darwin':
env['HAVE_X11'] = 0
compileFlags.append('-mmacosx-version-min=10.5')
conf.Define('MAP_32BIT', 0)
else:
env['HAVE_X11'] = conf.CheckPKG('x11')
# Handling wx flags CCFLAGS should be created before
env['HAVE_X11'] = conf.CheckPKG('x11')
# handling wx flags CCFLAGS should be created before
wxmods = ['adv', 'core', 'base'] wxmods = ['adv', 'core', 'base']
env['USE_WX'] = 0 env['USE_WX'] = 0
env['HAVE_WX'] = conf.CheckWXConfig('2.8', wxmods, 0) env['HAVE_WX'] = conf.CheckWXConfig('2.8', wxmods, 0)
conf.Define('HAVE_WX', env['HAVE_WX']) conf.Define('HAVE_WX', env['HAVE_WX'])
conf.Define('USE_WX', env['USE_WX']) conf.Define('USE_WX', env['USE_WX'])
conf.Define('HAVE_X11', env['HAVE_X11']) conf.Define('HAVE_X11', env['HAVE_X11'])
# Profile
# profile
env['USE_OPROFILE'] = 0 env['USE_OPROFILE'] = 0
if (flavour == 'prof'): if (flavour == 'prof'):
proflibs = [ '/usr/lib/oprofile', '/usr/local/lib/oprofile' ] proflibs = [ '/usr/lib/oprofile', '/usr/local/lib/oprofile' ]
@ -201,19 +203,12 @@ conf.Define('USE_OPROFILE', env['USE_OPROFILE'])
# After all configuration tests are done # After all configuration tests are done
conf.Finish() conf.Finish()
#wx windows flags
if env['HAVE_WX']: if env['HAVE_WX']:
wxconfig.ParseWXConfig(env) wxconfig.ParseWXConfig(env)
else: else:
print "WX not found or disabled, not building GUI" print "WX not found or disabled, not building GUI"
# add methods from utils to env # Install paths
env.AddMethod(utils.filterWarnings)
# Where do we run from
env['base_dir'] = os.getcwd()+ '/'
# install paths
extra='' extra=''
if flavour == 'debug': if flavour == 'debug':
extra = '-debug' extra = '-debug'
@ -221,25 +216,26 @@ elif flavour == 'prof':
extra = '-prof' extra = '-prof'
# TODO: support global install # TODO: support global install
env['prefix'] = os.path.join(env['base_dir'] + 'Binary', 'MemCardManager' + extra +os.sep) env['prefix'] = os.path.join(env['base_dir'] + 'Binary',
#TODO add bin 'MemCardManager' + extra + os.sep)
# TODO: add bin
env['binary_dir'] = env['prefix'] env['binary_dir'] = env['prefix']
# static libs goes here # Static libs goes here
env['local_libs'] = env['build_dir'] + os.sep + 'libs' + os.sep env['local_libs'] = env['build_dir'] + os.sep + 'libs' + os.sep
env['LIBPATH'].append(env['local_libs']) env['LIBPATH'].append(env['local_libs'])
# 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))
Export('env') Export('env')
@ -250,4 +246,3 @@ for subdir in dirs:
variant_dir = env[ 'build_dir' ] + subdir + os.sep, variant_dir = env[ 'build_dir' ] + subdir + os.sep,
duplicate=0 duplicate=0
) )

View File

@ -55,9 +55,9 @@ void CMemcardManagerDebug::Init_ChildControls()
m_Notebook_MCMD->AddPage(m_Tab_BAT, _T("Bat")); m_Notebook_MCMD->AddPage(m_Tab_BAT, _T("Bat"));
m_Notebook_MCMD->AddPage(m_Tab_BAT_b, _T("Bat_b")); m_Notebook_MCMD->AddPage(m_Tab_BAT_b, _T("Bat_b"));
wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL); wxBoxSizer* wMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(m_Notebook_MCMD, 1, wxEXPAND|wxALL, 5); wMain->Add(m_Notebook_MCMD, 1, wxEXPAND|wxALL, 5);
SetSizer(sMain); SetSizer(wMain);
Layout(); Layout();
Fit(); Fit();
} }
@ -68,10 +68,10 @@ void CMemcardManagerDebug::OnClose(wxCloseEvent& WXUNUSED (event))
void CMemcardManagerDebug::Init_HDR() void CMemcardManagerDebug::Init_HDR()
{ {
wxBoxSizer *sMain; wxBoxSizer *wMain;
wxStaticBoxSizer *sHDR[2]; wxStaticBoxSizer *sHDR[2];
sMain = new wxBoxSizer(wxHORIZONTAL); wMain = new wxBoxSizer(wxHORIZONTAL);
sHDR[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_HDR, wxT("MEMCARD:A")); sHDR[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_HDR, wxT("MEMCARD:A"));
sHDR[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_HDR, wxT("MEMCARD:B")); sHDR[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_HDR, wxT("MEMCARD:B"));
@ -142,9 +142,9 @@ void CMemcardManagerDebug::Init_HDR()
sOtPaths[i]->Add(t_HDR_CheckSum2[i], wxGBPosition(10, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5); sOtPaths[i]->Add(t_HDR_CheckSum2[i], wxGBPosition(10, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sHDR[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5); sHDR[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5);
sMain->Add(sHDR[i], 0, wxEXPAND|wxALL, 1); wMain->Add(sHDR[i], 0, wxEXPAND|wxALL, 1);
} }
m_Tab_HDR->SetSizer(sMain); m_Tab_HDR->SetSizer(wMain);
m_Tab_HDR->Layout(); m_Tab_HDR->Layout();
} }
@ -221,9 +221,9 @@ void CMemcardManagerDebug::updateHDRtab(int card)
void CMemcardManagerDebug::Init_DIR() void CMemcardManagerDebug::Init_DIR()
{ {
wxBoxSizer *sMain; wxBoxSizer *wMain;
wxStaticBoxSizer *sDIR[2]; wxStaticBoxSizer *sDIR[2];
sMain = new wxBoxSizer(wxHORIZONTAL); wMain = new wxBoxSizer(wxHORIZONTAL);
sDIR[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR, wxT("MEMCARD:A")); sDIR[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR, wxT("MEMCARD:A"));
sDIR[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR, wxT("MEMCARD:B")); sDIR[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR, wxT("MEMCARD:B"));
@ -253,10 +253,10 @@ void CMemcardManagerDebug::Init_DIR()
sDIR[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5); sDIR[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5);
sMain->Add(sDIR[i], 0, wxEXPAND|wxALL, 1); wMain->Add(sDIR[i], 0, wxEXPAND|wxALL, 1);
} }
m_Tab_DIR->SetSizer(sMain); m_Tab_DIR->SetSizer(wMain);
m_Tab_DIR->Layout(); m_Tab_DIR->Layout();
} }
@ -284,9 +284,9 @@ void CMemcardManagerDebug::updateDIRtab(int card)
void CMemcardManagerDebug::Init_DIR_b() void CMemcardManagerDebug::Init_DIR_b()
{ {
wxBoxSizer *sMain; wxBoxSizer *wMain;
wxStaticBoxSizer *sDIR_b[2]; wxStaticBoxSizer *sDIR_b[2];
sMain = new wxBoxSizer(wxHORIZONTAL); wMain = new wxBoxSizer(wxHORIZONTAL);
sDIR_b[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR_b, wxT("MEMCARD:A")); sDIR_b[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR_b, wxT("MEMCARD:A"));
sDIR_b[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR_b, wxT("MEMCARD:B")); sDIR_b[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_DIR_b, wxT("MEMCARD:B"));
@ -315,9 +315,9 @@ void CMemcardManagerDebug::Init_DIR_b()
sOtPaths[i]->Add(t_DIR_b_CheckSum2[i], wxGBPosition(2, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5); sOtPaths[i]->Add(t_DIR_b_CheckSum2[i], wxGBPosition(2, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sDIR_b[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5); sDIR_b[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5);
sMain->Add(sDIR_b[i], 0, wxEXPAND|wxALL, 1); wMain->Add(sDIR_b[i], 0, wxEXPAND|wxALL, 1);
} }
m_Tab_DIR_b->SetSizer(sMain); m_Tab_DIR_b->SetSizer(wMain);
m_Tab_DIR_b->Layout(); m_Tab_DIR_b->Layout();
} }
@ -341,9 +341,9 @@ void CMemcardManagerDebug::updateDIRBtab(int card)
void CMemcardManagerDebug::Init_BAT() void CMemcardManagerDebug::Init_BAT()
{ {
wxBoxSizer *sMain; wxBoxSizer *wMain;
wxStaticBoxSizer *sBAT[4]; wxStaticBoxSizer *sBAT[4];
sMain = new wxBoxSizer(wxHORIZONTAL); wMain = new wxBoxSizer(wxHORIZONTAL);
sBAT[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT, wxT("MEMCARD:A")); sBAT[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT, wxT("MEMCARD:A"));
sBAT[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT, wxT("MEMCARD:B")); sBAT[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT, wxT("MEMCARD:B"));
sBAT[2] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT, wxT("MEMCARD:A MAP")); sBAT[2] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT, wxT("MEMCARD:A MAP"));
@ -386,7 +386,7 @@ void CMemcardManagerDebug::Init_BAT()
sBAT[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5); sBAT[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5);
sMain->Add(sBAT[i], 0, wxEXPAND|wxALL, 1); wMain->Add(sBAT[i], 0, wxEXPAND|wxALL, 1);
} }
for (int k=2;k<=3;k++) //256 for (int k=2;k<=3;k++) //256
@ -402,10 +402,10 @@ void CMemcardManagerDebug::Init_BAT()
} }
sBAT[k]->Add(sOtPaths[k], 0, wxEXPAND|wxALL, 5); sBAT[k]->Add(sOtPaths[k], 0, wxEXPAND|wxALL, 5);
sMain->Add(sBAT[k], 0, wxEXPAND|wxALL, 1); wMain->Add(sBAT[k], 0, wxEXPAND|wxALL, 1);
} }
m_Tab_BAT->SetSizer(sMain); m_Tab_BAT->SetSizer(wMain);
m_Tab_BAT->Layout(); m_Tab_BAT->Layout();
} }
@ -449,9 +449,9 @@ void CMemcardManagerDebug::updateBATtab(int card)
void CMemcardManagerDebug::Init_BAT_b() void CMemcardManagerDebug::Init_BAT_b()
{ {
wxBoxSizer *sMain; wxBoxSizer *wMain;
wxStaticBoxSizer *sBAT_b[2]; wxStaticBoxSizer *sBAT_b[2];
sMain = new wxBoxSizer(wxHORIZONTAL); wMain = new wxBoxSizer(wxHORIZONTAL);
sBAT_b[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT_b, wxT("MEMCARD:A")); sBAT_b[0] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT_b, wxT("MEMCARD:A"));
sBAT_b[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT_b, wxT("MEMCARD:B")); sBAT_b[1] = new wxStaticBoxSizer(wxVERTICAL, m_Tab_BAT_b, wxT("MEMCARD:B"));
@ -490,10 +490,10 @@ void CMemcardManagerDebug::Init_BAT_b()
sOtPaths[i]->Add(t_BAT_b_LastAllocated[i], wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5); sOtPaths[i]->Add(t_BAT_b_LastAllocated[i], wxGBPosition(4, 1), wxGBSpan(1, 1), wxEXPAND|wxALL, 5);
sBAT_b[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5); sBAT_b[i]->Add(sOtPaths[i], 0, wxEXPAND|wxALL, 5);
sMain->Add(sBAT_b[i], 0, wxEXPAND|wxALL, 1); wMain->Add(sBAT_b[i], 0, wxEXPAND|wxALL, 1);
} }
m_Tab_BAT_b->SetSizer(sMain); m_Tab_BAT_b->SetSizer(wMain);
m_Tab_BAT_b->Layout(); m_Tab_BAT_b->Layout();
} }

View File

@ -1,8 +1,10 @@
#ifndef _MCM__ #ifndef _MCM__
#define _MCM__ #define _MCM__
void __Log(int logNumber, const char* text, ...){logNumber; text;} void __Log(int logNumber, const char* text, ...)
void __Logv(int log, int v, const char *format, ...){log; v; format;} {(void)logNumber; (void)text;}
void __Logv(int log, int v, const char *format, ...)
{(void)log; (void)v; (void)format;}
#include "MemcardManager.h" #include "MemcardManager.h"
#include "Timer.h" #include "Timer.h"