mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 20:10:49 +02:00
macos: added a fake sysutils for use by compiler, and fixed some tests
git-svn-id: trunk@4549 -
This commit is contained in:
parent
0663a997cc
commit
05d6f0e94d
@ -1 +1 @@
|
||||
# Make file for MPW make.
# To run it, use:
# Make <target> -f MPWMake > Makeout ; Makeout
# where <target> 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 ::
|
||||
# Make file for MPW make.
# To run it, use:
# Make <target> -f MPWMake > Makeout ; Makeout
# where <target> 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 ::
|
@ -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}
|
||||
|
@ -26,7 +26,11 @@ unit cclasses;
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFNDEF USE_FAKE_SYSUTILS}
|
||||
SysUtils,
|
||||
{$ELSE}
|
||||
fksysutl,
|
||||
{$ENDIF}
|
||||
CUtils,CStreams;
|
||||
|
||||
{********************************************
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -90,7 +90,7 @@
|
||||
{$endif m68k}
|
||||
|
||||
{$IFDEF MACOS}
|
||||
{$DEFINE MACOS_USE_FAKE_SYSUTILS}
|
||||
{$DEFINE USE_FAKE_SYSUTILS}
|
||||
{$ENDIF MACOS}
|
||||
|
||||
{$define SUPPORT_UNALIGNED}
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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}
|
||||
|
@ -26,8 +26,10 @@ unit verbose;
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFNDEF MACOS_USE_FAKE_SYSUTILS}
|
||||
{$IFNDEF USE_FAKE_SYSUTILS}
|
||||
sysutils,
|
||||
{$ELSE}
|
||||
fksysutl,
|
||||
{$ENDIF}
|
||||
cutils,
|
||||
globals,finput,
|
||||
|
@ -1,5 +1,6 @@
|
||||
{ %norun }
|
||||
{ %cpu=x86_64,i386,powerpc,sparc}
|
||||
{ %skiptarget = macos }
|
||||
{ execute this test only on reasonable fast cpus }
|
||||
library lib;
|
||||
const
|
||||
|
@ -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}
|
||||
|
@ -10,7 +10,6 @@
|
||||
{$mode delphi}
|
||||
|
||||
program FunctionRedirectionProblem;
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
var
|
||||
cnt : longint;
|
||||
|
Loading…
Reference in New Issue
Block a user