diff --git a/SConstruct b/SConstruct index 50682c0e..d6f01a65 100644 --- a/SConstruct +++ b/SConstruct @@ -1,7 +1,6 @@ -CCFLAGS= '' -LINKFLAGS = '' +#fetch environment +env = Environment() -env = Environment(CCFLAGS=CCFLAGS, LINKFLAGS=LINKFLAGS) conf = Configure(env) if not conf.CheckLib('SDL'): print 'Did not find libSDL.a or SDL.lib, exiting!' @@ -9,6 +8,8 @@ if not conf.CheckLib('SDL'): if not conf.CheckLib('z'): print 'Did not find libz.a or z.lib, exiting!' Exit(1) +if not conf.CheckFunc('asprintf'): + env['CCFLAGS'] += " -DHAVE_ASPRINTF" env = conf.Finish() Export('env') diff --git a/TODO-PROJECT b/TODO-PROJECT index ecde229a..7a13a0a3 100644 --- a/TODO-PROJECT +++ b/TODO-PROJECT @@ -1,5 +1,10 @@ Items to be completed before 2.0 release +FASTAPASS / FP_FASTAPASS / Are these archaic? They suck - ?? + +Doxygen integration - ?? + * website integration + Linux build - soules * clean-up scons files to manage SDL variables properly * go through #def variables and figure out which we need and which we don't diff --git a/src/SConscript b/src/SConscript index 977f5788..7889684d 100644 --- a/src/SConscript +++ b/src/SConscript @@ -65,12 +65,26 @@ sdl_libflags = sdl_libflags_pipe.read(); for flag in sdl_libflags.split(' '): if flag.find("-L") == 0: sdl_libpath.append(flag.strip("-L")); - else: + elif flag.find("-l") == 0: sdl_libs.append(flag.strip("-l")); + else: + env['LINKFLAGS'] += " " + flag; sdl_libflags_pipe.close(); # add zlib libs = sdl_libs; libs.append('z'); -env.Program('fceu', file_list, CCFLAGS=sdl_cflags, LIBS=libs, LIBPATH=sdl_libpath) +# include sdl cflags +env['CCFLAGS'] += sdl_cflags; + +#special flags for cygwin +print "platform: " + env['PLATFORM'] +if env['PLATFORM'] == 'cygwin': + env['CCFLAGS'] += " -mno-cygwin" + #env['LINKFLAGS'] += " -mno-cygwin" + libs.extend(['ddraw','dinput','dsound','gdi32','dxguid','winmm','shell32','wsock32','comdlg32','ole32']); + +print env['CCFLAGS'] + +env.Program('fceu', file_list, LIBS=libs, LIBPATH=sdl_libpath) diff --git a/src/drivers/pc/sdl.cpp b/src/drivers/pc/sdl.cpp index a1d18b3c..630dd4cb 100644 --- a/src/drivers/pc/sdl.cpp +++ b/src/drivers/pc/sdl.cpp @@ -202,9 +202,9 @@ char *GetKeyboard(void) #include /* Stupid SDL */ - #ifdef main - #undef main - #endif + //#ifdef main + //#undef main + //#endif #endif #ifndef EXTGUI diff --git a/src/general.cpp b/src/general.cpp index 1a8c9dc3..c8343429 100644 --- a/src/general.cpp +++ b/src/general.cpp @@ -67,21 +67,20 @@ if(which < FCEUIOD__COUNT) } } -// XXX commented out for now... Linux has asprintf() -// #ifndef HAVE_ASPRINTF -// static int asprintf(char **strp, const char *fmt, ...) -// { -// va_list ap; -// int ret; + #ifndef HAVE_ASPRINTF + static int asprintf(char **strp, const char *fmt, ...) + { + va_list ap; + int ret; -// va_start(ap,fmt); -// if(!(*strp=(char*)malloc(2048))) //mbg merge 7/17/06 cast to char* -// return(0); -// ret=vsnprintf(*strp,2048,fmt,ap); -// va_end(ap); -// return(ret); -// } -// #endif + va_start(ap,fmt); + if(!(*strp=(char*)malloc(2048))) //mbg merge 7/17/06 cast to char* + return(0); + ret=vsnprintf(*strp,2048,fmt,ap); + va_end(ap); + return(ret); + } + #endif char* FCEU_GetPath(int type) { diff --git a/src/movie.cpp b/src/movie.cpp index 97b1409f..e365bdfd 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -2,7 +2,7 @@ #include #include //#include //mbgm erge 7/17/06 removed -#ifdef WIN32 +#ifdef MSVC #include #endif @@ -235,7 +235,7 @@ void FCEUI_StopMovie(void) if(current > 0) StopRecording(); } -#ifdef WIN32 +#ifdef MSVC #include "process.h" void executeCommand(const char* cmd) { @@ -255,7 +255,7 @@ void executeCommand(const char* cmd) int justAutoConverted=0; static const char* convertToFCM(const char *fname, char *buffer) { -#ifdef WIN32 +#ifdef MSVC justAutoConverted=0; // convert to fcm if not already @@ -350,7 +350,7 @@ void ParseGIInput(FCEUGI *GI); //mbg merge 7/17/06 - had to add. gross. void InitOtherInput(void); //mbg merge 7/17/06 - had to add. gross. static void ResetInputTypes() { -#ifdef WIN32 +#ifdef MSVC extern int UsrInputType[3]; UsrInputType[0] = SI_GAMEPAD; UsrInputType[1] = SI_GAMEPAD; @@ -867,7 +867,7 @@ void FCEU_DrawMovies(uint8 *XBuf) { int frameDisplayOn = current != 0 && frame_display; extern int howlong; -#if WIN32 +#if MSVC extern int32 fps_scale; #else int32 fps_scale=256; diff --git a/src/state.cpp b/src/state.cpp index 48e1ca72..1a703977 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -259,7 +259,7 @@ static int ReadStateChunks(FILE *st, int32 totalsize) extern uint8 *XBackBuf; if(size != fread(XBackBuf,1,size,st)) ret = 0; -#ifdef WIN32 +#ifdef MSVC else { FCEUD_BlitScreen(XBuf); diff --git a/src/wave.cpp b/src/wave.cpp index 0428c75c..411d045d 100644 --- a/src/wave.cpp +++ b/src/wave.cpp @@ -23,7 +23,7 @@ void FCEU_WriteWaveData(int32 *Buffer, int Count) int16 *dest; int x; -#ifndef WIN32 +#ifndef MSVC if(!soundlog) return; #else if(!soundlog && !FCEUI_AviIsRecording()) return; @@ -45,7 +45,7 @@ void FCEU_WriteWaveData(int32 *Buffer, int Count) if(soundlog) wsize+=fwrite(temp,1,Count*sizeof(int16),soundlog); -#ifdef WIN32 +#ifdef MSVC if(FCEUI_AviIsRecording()) { extern int bittage;