From 6fa012e73a04959d69307911b90f526148c8352a Mon Sep 17 00:00:00 2001 From: jaybinks Date: Mon, 4 Feb 2008 23:10:16 +0000 Subject: small changes to check linux compilation. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@808 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UPlatformLinux.pas | 11 +-- Game/Code/UltraStarDeluxe.control | 2 +- Game/Code/linux-build.sh | 8 +- Game/Code/switches.inc | 142 ++++++++++++++++++----------------- 4 files changed, 84 insertions(+), 79 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UPlatformLinux.pas b/Game/Code/Classes/UPlatformLinux.pas index 2115428f..882376a2 100644 --- a/Game/Code/Classes/UPlatformLinux.pas +++ b/Game/Code/Classes/UPlatformLinux.pas @@ -128,7 +128,7 @@ end; function TPlatformLinux.GetLogPath : WideString; begin if FindCmdLineSwitch( cUseLocalPaths ) then - result := inherited + result := ExtractFilePath(ParamStr(0)) else result := '/var/log/UltraStarDeluxe/'; end; @@ -136,7 +136,7 @@ end; function TPlatformLinux.GetGameSharedPath : WideString; begin if FindCmdLineSwitch( cUseLocalPaths ) then - result := inherited + result := ExtractFilePath(ParamStr(0)) else result := '/usr/share/UltraStarDeluxe/'; end; @@ -144,7 +144,7 @@ end; function TPlatformLinux.GetGameUserPath : WideString; begin if FindCmdLineSwitch( cUseLocalPaths ) then - result := inherited + result := ExtractFilePath(ParamStr(0)) else result := get_homedir()+'/.UltraStarDeluxe/'; end; @@ -164,7 +164,7 @@ end; // Maybe this should be TPlatformBase.Halt() procedure TPlatformLinux.Halt; begin - application.terminate; + halt(); end; function TPlatformLinux.TerminateIfAlreadyRunning(var WndTitle : String) : Boolean; @@ -182,7 +182,8 @@ var SR: TSearchRec; // for parsing song directory begin Result := ''; - if SysUtils.FindFirst(Dir + Mask, faDirectory, SR) = 0 then begin + if SysUtils.FindFirst(Dir + Mask, faDirectory, SR) = 0 then + begin Result := SR.Name; end; // if SysUtils.FindClose(SR); diff --git a/Game/Code/UltraStarDeluxe.control b/Game/Code/UltraStarDeluxe.control index cfbbfc13..f85408f1 100644 --- a/Game/Code/UltraStarDeluxe.control +++ b/Game/Code/UltraStarDeluxe.control @@ -1,7 +1,7 @@ Package: UltraStar-Deluxe Priority: optional Section: games -Installed-Size: 45 +Installed-Size: 18400 Maintainer: Jay Binks Architecture: i386 Version: 1.1.1 diff --git a/Game/Code/linux-build.sh b/Game/Code/linux-build.sh index 54938479..7a1b82a2 100755 --- a/Game/Code/linux-build.sh +++ b/Game/Code/linux-build.sh @@ -1,4 +1,6 @@ -clear -fpc -S2cgi -OG1 -gl -vewnhi -l -Filib/JEDI-SDLv1.0/SDL/Pas/ -Fu/usr/bin/lazarus/components/images/lib/i386-linux/ -Fu/usr/bin/lazarus/lcl/units/i386-linux/ -Fu/usr/bin/lazarus/lcl/units/i386-linux/gtk2/ -Fu/usr/bin/lazarus/packager/units/i386-linux/ -Fu. -oUltraStar -dLCL -dLCLgtk2 UltraStar.lpr -mv ./UltraStar /home/jay/src/ultrastardx/output/ +fpc -S2cgi -OG1 -gl -vewnhi -l -Filib/JEDI-SDLv1.0/SDL/Pas/ -Fu/usr/share/lazarus/components/images/lib/i386-linux/ -Fu/usr/share/lazarus/lcl/units/i386-linux/ -Fu/usr/share/lazarus/lcl/units/i386-linux/gtk2/ -Fu/usr/share/lazarus/packager/units/i386-linux/ -Fu. -oUltraStar -dLCL -dLCLgtk2 UltraStar.lpr + +cp ./UltraStar ../../../output/ + + diff --git a/Game/Code/switches.inc b/Game/Code/switches.inc index d89e89b3..fc21a373 100644 --- a/Game/Code/switches.inc +++ b/Game/Code/switches.inc @@ -1,70 +1,72 @@ -{$DEFINE DEBUG} // to-do : Remove b4 release - -// Comment by eddie: -// The mac port currently also uses the WIN32 define. -// Once I get the beast compiled, linked and running -// I will change this. -// There are some parts where the WIN32 define could not -// be used. I changed the WIN32 to MSWINDOWS. -// So, for Windows-only code use the MSWINDOWS define. - - -{$IFDEF FPC} - {$IFDEF DARWIN} - {$H+} - {$R-} - {$DEFINE WIN32} - {$DEFINE TRANSLATE} - {$DEFINE UTF8_FILENAMES} - {$ELSE} - {$DEFINE LAZARUS} - {$ENDIF} - -// {$MODE DELPHI} // JB - This is not allowed by the free pascal compiler for some reason ( At least on linux ) - - {$DEFINE DLL_CDECL} - {$UNDEF UseSerialPort} - {$UNDEF UseMIDIPort} -{$ELSE} - {$DEFINE Delphi} - {$DEFINE DLL_STDCALL} - {$UNDEF UseSerialPort} - {$DEFINE UseMIDIPort} -{$ENDIF} - - -{$IFDEF win32} - {$DEFINE UseBASSPlayback} - {$DEFINE UseBASSInput} - - //{$DEFINE UseFFMpegDecoder} - //{$DEFINE UsePortaudioPlayback} - //{$DEFINE UsePortaudioInput} - //{$DEFINE UsePortmixer} - - {$DEFINE UseProjectM_0_9} - //{$DEFINE UseProjectM_1_0} - - {$IFDEF DEBUG} - {$IFNDEF DARWIN} - {$APPTYPE CONSOLE} - {$ENDIF} - {$ENDIF} -{$ELSE} - {$DEFINE UseFFMpegAudio} - {$DEFINE UsePortaudio} - {$DEFINE UseProjectM_0_9} -{$ENDIF} - -{$IF Defined(UseBASSInput) or Defined(UseBASSPlayback)} - {$DEFINE UseBASS} -{$IFEND} - -{$IF Defined(UsePortaudioInput) or Defined(UsePortaudioPlayback)} - {$DEFINE UsePortaudio} -{$IFEND} - -{$IF Defined(UseProjectM_0_9) or Defined(UseProjectM_1_0)} - {$DEFINE UseProjectM} -{$IFEND} - +{$DEFINE DEBUG} // to-do : Remove b4 release + +// Comment by eddie: +// The mac port currently also uses the WIN32 define. +// Once I get the beast compiled, linked and running +// I will change this. +// There are some parts where the WIN32 define could not +// be used. I changed the WIN32 to MSWINDOWS. +// So, for Windows-only code use the MSWINDOWS define. + + +{$IFDEF FPC} + {$IFDEF DARWIN} + {$H+} + {$R-} + {$DEFINE WIN32} + {$DEFINE TRANSLATE} + {$DEFINE UTF8_FILENAMES} + {$ELSE} + {$DEFINE LAZARUS} + {$ENDIF} + + {$DEFINE DLL_CDECL} + {$UNDEF UseSerialPort} + {$UNDEF UseMIDIPort} +{$ELSE} + {$DEFINE Delphi} + {$DEFINE DLL_STDCALL} + {$UNDEF UseSerialPort} + {$DEFINE UseMIDIPort} +{$ENDIF} + + +{$IFDEF win32} + {$DEFINE UseBASSPlayback} + {$DEFINE UseBASSInput} + + //{$DEFINE UseFFMpegDecoder} + //{$DEFINE UsePortaudioPlayback} + //{$DEFINE UsePortaudioInput} + //{$DEFINE UsePortmixer} + + {$DEFINE UseProjectM_0_9} + //{$DEFINE UseProjectM_1_0} + + {$IFDEF DEBUG} + {$IFNDEF DARWIN} + {$APPTYPE CONSOLE} + {$ENDIF} + {$ENDIF} +{$ELSE} + {$DEFINE UseFFMpegAudio} + {$DEFINE UsePortaudio} + {$DEFINE UseProjectM_0_9} +{$ENDIF} + +{$IF Defined(UseBASSInput) or Defined(UseBASSPlayback)} + {$DEFINE UseBASS} +{$IFEND} + +{$IF Defined(UsePortaudioInput) or Defined(UsePortaudioPlayback)} + {$DEFINE UsePortaudio} +{$IFEND} + +{$IF Defined(UseProjectM_0_9) or Defined(UseProjectM_1_0)} + {$DEFINE UseProjectM} +{$IFEND} + +// I had to add these (jay)... but maybe henny has some way that the config script is meant to do this ? +// Ill need to check with him. +//{$DEFINE FPC_V220} +//{$DEFINE LAZARUS_V0924} -- cgit v1.2.3