diff --git a/compiler/MPWMake b/compiler/MPWMake index 4ba478f4ca..8591f382fc 100644 --- a/compiler/MPWMake +++ b/compiler/MPWMake @@ -1 +1 @@ -# Make file for MPW make. # To run it, use: # Make -f MPWMake > Makeout ; Makeout # where should be replaced with actual make target. ############################################# # TIPS (TODO move to Wiki or something # # Defined variables: No quoting # Command lines: quote paths, dont quote option strings, since # they might contain several options, which must be separated. # Recursive call to Make: # - give options as -d XXX="{XXX}" # - in same dir, remember to ensure to have different Makeout files, # e g Makeout2. # # NOTE Currently cycle is stopped after three rounds, no diff is checked. FPC = {FPCDIR}bin:ppcppc # Default language for the compiler (english): FPCLANG = e MSGFILE = :msg:error{FPCLANG}.msg msg2inc Ä :utils:msg2inc.pp {FPC} -FE: -WT :utils:msg2inc.pp # The msgtxt.inc only depends on the error?.msg file, not on msg2inc, # because that one will be new almost everytime msgtxt.inc Ä {MSGFILE} Make msg2inc -f MPWMake > Makeout3 ; Makeout3 msg2inc {MSGFILE} msg msg msg Ä msgtxt.inc compiler Ä msg Set Exit 0 NewFolder :powerpc:units: ³ Dev:Null NewFolder :powerpc:units:powerpc-macos: ³ Dev:Null Set Exit 1 "{FPC}" {OPT} "-Fu{RTLDIR}" -Fu:systems: -Fu:powerpc: -dGDB -dBROWSERLOG -dNOOPT ¶ -dpowerpc -WT -FE: -FU:powerpc:units:powerpc-macos: pp.pas Rename -y pp ppcppc clean Ä utils_clean Set Exit 0 Delete -y :powerpc:units:powerpc-macos Delete -y ppcppc oldfpc msg2inc Delete -y Å.xcoff Set Exit 1 cycleclean Ä Set Exit 0 Delete -y :powerpc:units:powerpc-macos Set Exit 1 install Ä If {FPCDIR} == '' Set -e FPCDIR `GetFileName -wd -m 'Select where to install the FreePascal folder'`FreePascal: Set -e Commands "{Commands},{FPCDIR}bin:" Echo "Set -e FPCDIR ¶'{FPCDIR}¶'" > "{MPW}Startup Items:FPC Startup" Echo 'Set -e Commands "{Commands},{FPCDIR}bin:"' >> "{MPW}Startup Items:FPC Startup" End Set Exit 0 NewFolder "{FPCDIR}" ³ Dev:Null NewFolder "{FPCDIR}bin:" ³ Dev:Null Set Exit 1 Duplicate -y :ppcppc :utils:ppudump :utils:ppufiles :utils:ppumove ¶ :utils:fpc "{FPCDIR}bin:" Echo "# Configuration file for Free Pascal for MPW" > "{FPCDIR}bin:fpc.cfg" Echo "-Fu¶'{FPCDIR}units:rtl:¶'" >> "{FPCDIR}bin:fpc.cfg" Echo "-l" >> "{FPCDIR}bin:fpc.cfg" Echo "-vi" >> "{FPCDIR}bin:fpc.cfg" cycle Ä Directory ::rtl:macos Make clean -f MPWMake > Makeout ; Makeout Make all -d FPC="{FPC}" -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout Directory :::compiler Make clean -f MPWMake > Makeout2 ; Makeout2 Make compiler -d FPC="{FPC}" -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 # Echo '******************** SECOND ROUND *********************' Rename -y ppcppc oldfpc Directory ::rtl:macos Make clean -f MPWMake > Makeout ; Makeout Make all -d FPC=:::compiler:oldfpc -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout Directory :::compiler Make cycleclean -f MPWMake > Makeout2 ; Makeout2 Make compiler -d FPC=oldfpc -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 # Echo '********************* THIRD ROUND *********************' Rename -y ppcppc oldfpc Directory ::rtl:macos Make clean -f MPWMake > Makeout ; Makeout Make all -d FPC=:::compiler:oldfpc -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout Directory :::compiler Make cycleclean -f MPWMake > Makeout2 ; Makeout2 Make compiler -d FPC=oldfpc -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 # Make utils_clean -f MPWMake > Makeout2 ; Makeout2 Make utils_all -d FPC=::oldfpc -d OPT="{OPT}" -d RTLDIR=:::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 utils_all Ä Directory :utils Set Exit 0 NewFolder :units: ³ Dev:Null NewFolder :units:powerpc-macos: ³ Dev:Null Set Exit 1 "{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppudump.pp "{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppufiles.pp "{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppumove.pp Duplicate -y fpc.mpw fpc Directory :: utils_clean Ä Directory :utils Set Exit 0 Delete -y :units:powerpc-macos Delete -y fpc ppudump ppufiles ppumove msg2inc Delete -y Å.xcoff Set Exit 1 Directory :: \ No newline at end of file +# Make file for MPW make. # To run it, use: # Make -f MPWMake > Makeout ; Makeout # where should be replaced with actual make target. ############################################# # TIPS (TODO move to Wiki or something # # Defined variables: No quoting # Command lines: quote paths, dont quote option strings, since # they might contain several options, which must be separated. # Recursive call to Make: # - give options as -d XXX="{XXX}" # - in same dir, remember to ensure to have different Makeout files, # e g Makeout2. # # NOTE Currently cycle is stopped after three rounds, no diff is checked. FPC = {FPCDIR}bin:ppcppc # Default language for the compiler (english): FPCLANG = e MSGFILE = :msg:error{FPCLANG}.msg msg2inc Ä :utils:msg2inc.pp {FPC} -FE: -WT :utils:msg2inc.pp # The msgtxt.inc only depends on the error?.msg file, not on msg2inc, # because that one will be new almost everytime msgtxt.inc Ä {MSGFILE} Make msg2inc -f MPWMake > Makeout3 ; Makeout3 msg2inc {MSGFILE} msg msg msg Ä msgtxt.inc compiler Ä msg Set Exit 0 NewFolder :powerpc:units: ³ Dev:Null NewFolder :powerpc:units:powerpc-macos: ³ Dev:Null Set Exit 1 "{FPC}" {OPT} "-Fu{RTLDIR}" -Fu:systems: -Fu:powerpc: -Fu:ppcgen -dGDB -dBROWSERLOG -dNOOPT ¶ -dpowerpc -WT -FE: -FU:powerpc:units:powerpc-macos: pp.pas Rename -y pp ppcppc clean Ä utils_clean Set Exit 0 Delete -y :powerpc:units:powerpc-macos Delete -y ppcppc oldfpc msg2inc Delete -y Å.xcoff Set Exit 1 cycleclean Ä Set Exit 0 Delete -y :powerpc:units:powerpc-macos Set Exit 1 install Ä If {FPCDIR} == '' Set -e FPCDIR `GetFileName -wd -m 'Select where to install the FreePascal folder'`FreePascal: Set -e Commands "{Commands},{FPCDIR}bin:" Echo "Set -e FPCDIR ¶'{FPCDIR}¶'" > "{MPW}Startup Items:FPC Startup" Echo 'Set -e Commands "{Commands},{FPCDIR}bin:"' >> "{MPW}Startup Items:FPC Startup" End Set Exit 0 NewFolder "{FPCDIR}" ³ Dev:Null NewFolder "{FPCDIR}bin:" ³ Dev:Null Set Exit 1 Duplicate -y :ppcppc :utils:ppudump :utils:ppufiles :utils:ppumove ¶ :utils:fpc "{FPCDIR}bin:" Echo "# Configuration file for Free Pascal for MPW" > "{FPCDIR}bin:fpc.cfg" Echo "-Fu¶'{FPCDIR}units:rtl:¶'" >> "{FPCDIR}bin:fpc.cfg" Echo "-l" >> "{FPCDIR}bin:fpc.cfg" Echo "-vi" >> "{FPCDIR}bin:fpc.cfg" cycle Ä Directory ::rtl:macos Make clean -f MPWMake > Makeout ; Makeout Make all -d FPC="{FPC}" -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout Directory :::compiler Make clean -f MPWMake > Makeout2 ; Makeout2 Make compiler -d FPC="{FPC}" -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 # Echo '******************** SECOND ROUND *********************' Rename -y ppcppc oldfpc Directory ::rtl:macos Make clean -f MPWMake > Makeout ; Makeout Make all -d FPC=:::compiler:oldfpc -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout Directory :::compiler Make cycleclean -f MPWMake > Makeout2 ; Makeout2 Make compiler -d FPC=oldfpc -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 # Echo '********************* THIRD ROUND *********************' Rename -y ppcppc oldfpc Directory ::rtl:macos Make clean -f MPWMake > Makeout ; Makeout Make all -d FPC=:::compiler:oldfpc -d OPT="{OPT}" -f MPWMake > Makeout ; Makeout Directory :::compiler Make cycleclean -f MPWMake > Makeout2 ; Makeout2 Make compiler -d FPC=oldfpc -d OPT="{OPT}" -d RTLDIR=::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 # Make utils_clean -f MPWMake > Makeout2 ; Makeout2 Make utils_all -d FPC=::oldfpc -d OPT="{OPT}" -d RTLDIR=:::rtl:units:powerpc-macos -f MPWMake > Makeout2 ; Makeout2 utils_all Ä Directory :utils Set Exit 0 NewFolder :units: ³ Dev:Null NewFolder :units:powerpc-macos: ³ Dev:Null Set Exit 1 "{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppudump.pp "{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppufiles.pp "{FPC}" {OPT} "-Fu{RTLDIR}" -FE: -FU:units:powerpc-macos -Fu:: -WT ppumove.pp Duplicate -y fpc.mpw fpc Directory :: utils_clean Ä Directory :utils Set Exit 0 Delete -y :units:powerpc-macos Delete -y fpc ppudump ppufiles ppumove msg2inc Delete -y Å.xcoff Set Exit 1 Directory :: \ No newline at end of file diff --git a/compiler/catch.pas b/compiler/catch.pas index 794680de40..94ffe0014a 100644 --- a/compiler/catch.pas +++ b/compiler/catch.pas @@ -60,10 +60,8 @@ Const in_const_evaluation : boolean = false; Implementation -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} uses comphook; -{$ENDIF MACOS_USE_FAKE_SYSUTILS} {$ifdef has_signal} {$ifdef unix} diff --git a/compiler/cclasses.pas b/compiler/cclasses.pas index 95d785f057..53e6743f77 100644 --- a/compiler/cclasses.pas +++ b/compiler/cclasses.pas @@ -26,7 +26,11 @@ unit cclasses; interface uses +{$IFNDEF USE_FAKE_SYSUTILS} SysUtils, +{$ELSE} + fksysutl, +{$ENDIF} CUtils,CStreams; {******************************************** diff --git a/compiler/comphook.pas b/compiler/comphook.pas index adfc2b0e83..5f3e8f4b70 100644 --- a/compiler/comphook.pas +++ b/compiler/comphook.pas @@ -26,10 +26,10 @@ unit comphook; interface uses -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} - SysUtils, +{$IFNDEF USE_FAKE_SYSUTILS} + sysutils, {$ELSE} - globals, + fksysutl, {$ENDIF} globtype, finput; @@ -201,31 +201,19 @@ end; constructor EControlCAbort.Create; begin -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} inherited Create('Ctrl-C Signaled!'); -{$ELSE} - inherited Create; -{$ENDIF} end; constructor ECompilerAbort.Create; begin -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} inherited Create('Compilation Aborted'); -{$ELSE} - inherited Create; -{$ENDIF} end; constructor ECompilerAbortSilent.Create; begin -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} inherited Create('Compilation Aborted'); -{$ELSE} - inherited Create; -{$ENDIF} end; diff --git a/compiler/compiler.pas b/compiler/compiler.pas index c60b4960fe..fc913008ca 100644 --- a/compiler/compiler.pas +++ b/compiler/compiler.pas @@ -144,9 +144,11 @@ uses {$ELSE USE_SYSUTILS} dos, {$ENDIF USE_SYSUTILS} -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} +{$IFNDEF USE_FAKE_SYSUTILS} sysutils, -{$ENDIF MACOS_USE_FAKE_SYSUTILS} +{$ELSE} + fksysutl, +{$ENDIF} verbose,comphook,systems, cutils,cclasses,globals,options,fmodule,parser,symtable, assemble,link,dbgbase,import,export,tokens,pass_1 diff --git a/compiler/fpcdefs.inc b/compiler/fpcdefs.inc index 2255972856..df0d9a0c02 100644 --- a/compiler/fpcdefs.inc +++ b/compiler/fpcdefs.inc @@ -90,7 +90,7 @@ {$endif m68k} {$IFDEF MACOS} -{$DEFINE MACOS_USE_FAKE_SYSUTILS} +{$DEFINE USE_FAKE_SYSUTILS} {$ENDIF MACOS} {$define SUPPORT_UNALIGNED} diff --git a/compiler/globals.pas b/compiler/globals.pas index d2bcb7fa63..f52d4d5564 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -32,8 +32,14 @@ interface {$ifdef hasunix} Baseunix,unix, {$endif} + +{$IFNDEF USE_FAKE_SYSUTILS} + sysutils, +{$ELSE} + fksysutl, +{$ENDIF} + { comphook pulls in sysutils anyways } - SysUtils, {$IFDEF USE_SYSUTILS} {$ELSE USE_SYSUTILS} strings, @@ -374,32 +380,6 @@ interface be placed in data/const segment, according to the current alignment requirements } function const_align(siz: shortint): shortint; -{$IFDEF MACOS_USE_FAKE_SYSUTILS} - -{Since SysUtils is not yet available for MacOS, fake - Exceptions classes are included here.} - -type - { exceptions } - Exception = class(TObject); - - EExternal = class(Exception); - - { integer math exceptions } - EInterror = Class(EExternal); - EDivByZero = Class(EIntError); - ERangeError = Class(EIntError); - EIntOverflow = Class(EIntError); - - { General math errors } - EMathError = Class(EExternal); - EInvalidOp = Class(EMathError); - EZeroDivide = Class(EMathError); - EOverflow = Class(EMathError); - EUnderflow = Class(EMathError); - -{$ENDIF MACOS_USE_FAKE_SYSUTILS} - implementation uses @@ -636,7 +616,11 @@ implementation Function DirectoryExists ( Const F : String) : Boolean; begin +{$IFNDEF USE_FAKE_SYSUTILS} Result:=SysUtils.DirectoryExists(f); +{$ELSE} + Result:=fksysutl.DirectoryExists(f); +{$ENDIF} end; diff --git a/compiler/nadd.pas b/compiler/nadd.pas index 28a0b72ff7..d766b091a9 100644 --- a/compiler/nadd.pas +++ b/compiler/nadd.pas @@ -80,9 +80,11 @@ interface implementation uses -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} +{$IFNDEF USE_FAKE_SYSUTILS} sysutils, -{$ENDIF MACOS_USE_FAKE_SYSUTILS} +{$ELSE} + fksysutl, +{$ENDIF} globtype,systems, cutils,verbose,globals,widestr, symconst,symdef,symsym,symtable,defutil,defcmp, diff --git a/compiler/parser.pas b/compiler/parser.pas index 318b30b0a1..8d92502b14 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -35,9 +35,11 @@ interface implementation uses -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} +{$IFNDEF USE_FAKE_SYSUTILS} sysutils, -{$ENDIF MACOS_USE_FAKE_SYSUTILS} +{$ELSE} + fksysutl, +{$ENDIF} cutils,cclasses, globtype,version,tokens,systems,globals,verbose, symbase,symtable,symsym, diff --git a/compiler/utils/ppumove.pp b/compiler/utils/ppumove.pp index 5632171898..0c25e0588e 100644 --- a/compiler/utils/ppumove.pp +++ b/compiler/utils/ppumove.pp @@ -23,7 +23,17 @@ {$endif} Program ppumove; uses + +{$IFDEF MACOS} +{$DEFINE USE_FAKE_SYSUTILS} +{$ENDIF MACOS} + +{$IFNDEF USE_FAKE_SYSUTILS} sysutils, +{$ELSE} + fksysutl, +{$ENDIF} + {$ifdef unix} Baseunix,Unix, UnixUtil, {$else unix} diff --git a/compiler/verbose.pas b/compiler/verbose.pas index 6930a0ed34..a971eba3a1 100644 --- a/compiler/verbose.pas +++ b/compiler/verbose.pas @@ -26,8 +26,10 @@ unit verbose; interface uses -{$IFNDEF MACOS_USE_FAKE_SYSUTILS} +{$IFNDEF USE_FAKE_SYSUTILS} sysutils, +{$ELSE} + fksysutl, {$ENDIF} cutils, globals,finput, diff --git a/tests/webtbs/tw3082.pp b/tests/webtbs/tw3082.pp index fb57c691df..25503539a8 100644 --- a/tests/webtbs/tw3082.pp +++ b/tests/webtbs/tw3082.pp @@ -1,5 +1,6 @@ { %norun } { %cpu=x86_64,i386,powerpc,sparc} +{ %skiptarget = macos } { execute this test only on reasonable fast cpus } library lib; const diff --git a/tests/webtbs/tw4390.pp b/tests/webtbs/tw4390.pp index c0c2b3701c..30c456d8df 100644 --- a/tests/webtbs/tw4390.pp +++ b/tests/webtbs/tw4390.pp @@ -2,7 +2,6 @@ { Submitted by "Benjamin Rosseaux" on 2005-09-28 } { e-mail: benjamin@0ok.de } PROGRAM Test; -{$APPTYPE CONSOLE} {$IFDEF FPC} {$MODE DELPHI} {$ENDIF} diff --git a/tests/webtbs/tw4950.pp b/tests/webtbs/tw4950.pp index ed65272b72..24020b0f34 100644 --- a/tests/webtbs/tw4950.pp +++ b/tests/webtbs/tw4950.pp @@ -10,7 +10,6 @@ {$mode delphi} program FunctionRedirectionProblem; -{$APPTYPE CONSOLE} var cnt : longint;