From f0bb456351ed51d8c1cf6841b04ffa2f4c3a1531 Mon Sep 17 00:00:00 2001 From: carl Date: Sun, 20 Oct 2002 12:00:52 +0000 Subject: [PATCH] - remove objinc.inc (unused file) * update makefiles accordingly --- rtl/amiga/Makefile | 22 ++- rtl/amiga/Makefile.fpc | 2 +- rtl/amiga/objinc.inc | 303 --------------------------------------- rtl/amiga/system.pas | 8 +- rtl/atari/objinc.inc | 205 -------------------------- rtl/atari/system.pas | 8 +- rtl/beos/Makefile | 22 ++- rtl/beos/Makefile.fpc | 2 +- rtl/freebsd/Makefile | 22 ++- rtl/freebsd/Makefile.fpc | 2 +- rtl/go32v2/Makefile | 22 ++- rtl/go32v2/Makefile.fpc | 2 +- rtl/go32v2/objinc.inc | 205 -------------------------- rtl/linux/Makefile | 6 +- rtl/linux/Makefile.fpc | 2 +- rtl/netware/Makefile | 25 +++- rtl/netware/Makefile.fpc | 7 +- rtl/netware/objinc.inc | 87 ----------- rtl/os2/Makefile | 22 ++- rtl/os2/Makefile.fpc | 2 +- rtl/os2/objinc.inc | 160 --------------------- rtl/posix/objinc.inc | 139 ------------------ rtl/unix/objinc.inc | 103 ------------- rtl/win32/Makefile | 6 +- rtl/win32/Makefile.fpc | 2 +- 25 files changed, 135 insertions(+), 1251 deletions(-) delete mode 100644 rtl/amiga/objinc.inc delete mode 100644 rtl/atari/objinc.inc delete mode 100644 rtl/go32v2/objinc.inc delete mode 100644 rtl/netware/objinc.inc delete mode 100644 rtl/os2/objinc.inc delete mode 100644 rtl/posix/objinc.inc delete mode 100644 rtl/unix/objinc.inc diff --git a/rtl/amiga/Makefile b/rtl/amiga/Makefile index 3a102cfded..638716cfd6 100644 --- a/rtl/amiga/Makefile +++ b/rtl/amiga/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/08/01] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx @@ -58,6 +58,9 @@ ifdef inUnix PATHSEP=/ else PATHSEP:=$(subst /,\,/) +ifneq ($(findstring sh.exe,$(SHELL)),) +PATHSEP=/ +endif endif ifdef PWD BASEDIR:=$(subst \,/,$(shell $(PWD))) @@ -87,8 +90,8 @@ endif endif export ECHO endif -OS_TARGET=amiga -CPU_TARGET=m68k +override OS_TARGET_DEFAULT=amiga +override CPU_TARGET_DEFAULT=m68k override DEFAULT_FPCDIR=../.. ifndef FPC ifdef PP @@ -142,6 +145,16 @@ ifndef OS_TARGET OS_TARGET:=$(shell $(FPC) -iTO) endif endif +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) ifneq ($(FULL_TARGET),$(FULL_SOURCE)) @@ -1098,6 +1111,7 @@ fpc_baseinfo: @$(ECHO) Rm........ $(RMPROG) @$(ECHO) GInstall.. $(GINSTALL) @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) @$(ECHO) Date...... $(DATE) @$(ECHO) FPCMake... $(FPCMAKE) @$(ECHO) PPUMove... $(PPUMOVE) @@ -1204,7 +1218,7 @@ crt$(PPUEXT) : crt.pp $(INC)/textrec.inc system$(PPUEXT) $(COMPILER) crt $(REDIR) printer$(PPUEXT) : printer.pp system$(PPUEXT) $(COMPILER) printer $(REDIR) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc system$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT) $(COMPILER) $(INC)/objects.pp $(REDIR) getopts$(PPUEXT) : $(INC)/getopts.pp strings$(PPUEXT) system$(PPUEXT) $(COMPILER) $(INC)/getopts.pp $(REDIR) diff --git a/rtl/amiga/Makefile.fpc b/rtl/amiga/Makefile.fpc index 881dcd5761..cfbedb110e 100644 --- a/rtl/amiga/Makefile.fpc +++ b/rtl/amiga/Makefile.fpc @@ -126,7 +126,7 @@ crt$(PPUEXT) : crt.pp $(INC)/textrec.inc system$(PPUEXT) printer$(PPUEXT) : printer.pp system$(PPUEXT) $(COMPILER) printer $(REDIR) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc system$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT) $(COMPILER) $(INC)/objects.pp $(REDIR) # diff --git a/rtl/amiga/objinc.inc b/rtl/amiga/objinc.inc deleted file mode 100644 index cfb59362cd..0000000000 --- a/rtl/amiga/objinc.inc +++ /dev/null @@ -1,303 +0,0 @@ -{ - $Id$ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2000 by the Free Pascal development team. - - Includefile for objects.pp implementing OS-dependent file routines - for AmigaOS - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - ********************************************************************** -} - - Const - - _LVOFindTask = -294; - _LVOWaitPort = -384; - _LVOGetMsg = -372; - _LVOOpenLibrary = -552; - _LVOCloseLibrary = -414; - _LVOClose = -36; - _LVOOpen = -30; - _LVOIoErr = -132; - _LVOSeek = -66; - _LVODeleteFile = -72; - _LVORename = -78; - _LVOWrite = -48; - _LVORead = -42; - _LVOCreateDir = -120; - _LVOSetCurrentDirName = -558; - _LVOGetCurrentDirName = -564; - _LVOInput = -54; - _LVOOutput = -60; - _LVOUnLock = -90; - _LVOLock = -84; - _LVOCurrentDir = -126; - - _LVONameFromLock = -402; - _LVONameFromFH = -408; - _LVOGetProgramName = -576; - _LVOGetProgramDir = -600; - _LVODupLock = -96; - _LVOExamine = -102; - _LVOParentDir = -210; - _LVOSetFileSize = -456; - - - - -{---------------------------------------------------------------------------} -{ FileClose -> Platforms AmigaOS - Not checked } -{---------------------------------------------------------------------------} -FUNCTION FileClose(Handle: THandle): word; -begin - asm - move.l handle,d1 - move.l a6,d6 { save a6 } - move.l _DOSBase,a6 - jsr _LVOClose(a6) - move.l d6,a6 { restore a6 } - end; - FileClose := 0; -end; - -{---------------------------------------------------------------------------} -{ FileOpen -> Platforms AmigaOS - 08Jul98 CEC } -{ Returns 0 on failure } -{---------------------------------------------------------------------------} - -FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle; -var - oflags : longint; - AHandle : THandle; -begin - AHandle:=0; - { On opening reset error code } - DosStreamError := 0; - if Mode=stCreate then - { read/write file with creation of file } - oflags := 1006 - else - { read/write access on existing file } - oflags := 1005; - asm - move.l a6,d6 { save a6 } - - move.l FileName,d1 - move.l oflags,d2 { MODE_READWRITE } - move.l _DOSBase,a6 - jsr _LVOOpen(a6) - tst.l d0 - bne @noopenerror { on zero an error occured } - jsr _LVOIoErr(a6) - move.w d0,DosStreamError - bra @openend - @noopenerror: - move.l d6,a6 { restore a6 } - move.l d0,AHandle { we need the base pointer to access this variable } - bra @end - @openend: - move.l d6,a6 { restore a6 } - @end: - end; - FileOpen := AHandle; -end; - - -{***************************************************************************} -{ DosSetFilePtr -> Platforms AmigaOS - 08Jul98 CEC } -{***************************************************************************} -FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word; -Var Actual: LongInt): Word; -Var - Move_typ : longint; -BEGIN - Move_typ := 0; - { Move from beginning of file } - if MoveType = 0 then - Move_typ := -1; - { Move from current position of file } - If MoveType = 1 then - Move_typ := 0; - { Move from end of file } - If MoveType = 2 then - Move_typ := 1; - { We have to seek TWO times, if we wish to get the actual absolute } - { file position normally. } - asm - move.l a6,d6 { Save base pointer } - - move.l handle,d1 - move.l d2,-(sp) - move.l d3,-(sp) { save registers } - - move.l pos,d2 - move.l Move_typ,d3 { Setup correct move type } - move.l _DOSBase,a6 - jsr _LVOSeek(a6) - - move.l (sp)+,d3 { restore registers } - move.l (sp)+,d2 - cmp.l #-1,d0 { is there a file access error? } - bne @noerr_one { no, then seek a second time } - jsr _LVOIoErr(a6) { yes ,get error in d0 and jmp } - bra @err - @noerr_one: { Seek a second time } - move.l d6,a6 { Restore base pointer } - - move.l handle,d1 - move.l d2,-(sp) - move.l d3,-(sp) { save registers } - - move.l pos,d2 - move.l Move_typ,d3 { Setup correct move type } - move.l _DOSBase,a6 - jsr _LVOSeek(a6) - - move.l (sp)+,d3 { restore registers } - move.l (sp)+,d2 - cmp.l #-1,d0 { is there a file access error? } - bne @noerr - jsr _LVOIoErr(a6) - @err: - move.w d0,DosStreamError - move.l d6,a6 { restore a6 } - bra @seekend - @noerr: - move.l d6,a6 { restore a6 } - move.l Actual,a0 { Get address of variable } - move.l d0,(a0) { Set value of Actual } - @seekend: - end; - SetFilePos := DosStreamError; { Return any error } -END; - - -{---------------------------------------------------------------------------} -{ FileRead -> Platforms AmigaOS - 08Jul98 CEC } -{---------------------------------------------------------------------------} -FUNCTION FileRead (Handle: THandle; Var Buf; Count: Sw_Word; -Var Actual: Sw_Word): Word; -BEGIN - if Count <= 0 then - Begin - FileRead:=1; { Return a non zero error } - exit; - end; - asm - move.l a6,d6 - - movem.l d2/d3,-(sp) - move.l handle,d1 { we must set up aparamters BEFORE } - move.l buf,d2 { setting up a6 for the OS call } - move.l count,d3 - move.l _DOSBase,a6 - jsr _LVORead(a6) - movem.l (sp)+,d2/d3 - - cmp.l #-1,d0 - bne @doswrend { if -1 = error } - jsr _LVOIoErr(a6) - move.w d0,DosStreamError - bra @doswrend2 - @doswrend: - { to store a result for the function } - { we must of course first get back the} - { base pointer! } - move.l d6,a6 - move.l Actual,a0 { Actual is a pointer! } - move.l d0,(a0) - bra @end - @doswrend2: - move.l d6,a6 - @end: - end; - FileRead:=DosStreamError; -end; - - -{---------------------------------------------------------------------------} -{ FileWrite -> Platforms AmigAOS - 08Jul98 CEC } -{---------------------------------------------------------------------------} -FUNCTION FileWrite (Handle: THandle; Var Buf; Count: Sw_Word; Var Actual: Sw_Word): Word; -BEGIN - if Count <= 0 then - Begin - FileWrite:=1; { Return a non zero error code } - exit; - end; - asm - move.l a6,d6 - - movem.l d2/d3,-(sp) - move.l handle,d1 { we must of course set up the } - move.l buf,d2 { parameters BEFORE getting } - move.l count,d3 { _DOSBase } - move.l _DOSBase,a6 - jsr _LVOWrite(a6) - movem.l (sp)+,d2/d3 - - cmp.l #-1,d0 - bne @doswrend { if -1 = error } - jsr _LVOIoErr(a6) - move.w d0,DosStreamError - bra @doswrend2 - @doswrend: - { we must restore the base pointer before setting the result } - move.l d6,a6 - move.l Actual,a0 { Actual is a pointer! } - move.l d0,(a0) - bra @end - @doswrend2: - move.l d6,a6 - @end: - end; - Actual:=Count; - FileWrite:=DosStreamError; -end; - - -{---------------------------------------------------------------------------} -{ SetFileSize -> Platforms AmigaOS - 08Jul98 CEC } -{---------------------------------------------------------------------------} -FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word; -BEGIN - { Point to the end of the file } - { with the new size } - asm - @noerr_one: { Seek a second time } - move.l a6,d6 { Save base pointer } - - move.l handle,d1 - move.l d2,-(sp) - move.l d3,-(sp) { save registers } - - move.l FileSize,d2 - move.l #-1,d3 { Setup correct move type } - move.l _DOSBase,a6 { from beginning of file } - jsr _LVOSetFileSize(a6) - - move.l (sp)+,d3 { restore registers } - move.l (sp)+,d2 - cmp.l #-1,d0 { is there a file access error? } - bne @noerr - jsr _LVOIoErr(a6) - move.w d0,DosStreamError - @noerr: - move.l d6,a6 { restore a6 } - end; - SetFileSize:=DosStreamError; -END; - -{ - $Log$ - Revision 1.3 2002-09-07 16:01:16 peter - * old logs removed and tabs fixed - -} diff --git a/rtl/amiga/system.pas b/rtl/amiga/system.pas index 7e5b9c7941..d5f65fcc1d 100644 --- a/rtl/amiga/system.pas +++ b/rtl/amiga/system.pas @@ -1792,8 +1792,6 @@ begin { Initialize ExitProc } ExitProc:=Nil; Startup; -{ to test stack depth } - loweststack:=maxlongint; { Setup heap } InitHeap; { Setup stdin, stdout and stderr } @@ -1828,7 +1826,11 @@ end. { $Log$ - Revision 1.5 2002-10-13 09:25:14 florian + Revision 1.6 2002-10-20 12:00:52 carl + - remove objinc.inc (unused file) + * update makefiles accordingly + + Revision 1.5 2002/10/13 09:25:14 florian + call to initvariantmanager inserted Revision 1.4 2002/09/07 16:01:16 peter diff --git a/rtl/atari/objinc.inc b/rtl/atari/objinc.inc deleted file mode 100644 index 012b360fc5..0000000000 --- a/rtl/atari/objinc.inc +++ /dev/null @@ -1,205 +0,0 @@ -{ - $Id$ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2000 by the Free Pascal development team. - - Includefile for objects.pp implementing OS-dependent file routines - for Atari TOS - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - ********************************************************************** -} -{--------------------------------------------------------------------} -{ LEFT TO DO: } -{--------------------------------------------------------------------} -{ o Implement SetfileSize } -{--------------------------------------------------------------------} - - - -{---------------------------------------------------------------------------} -{ FileClose -> Platforms Atari TOS - Not checked } -{---------------------------------------------------------------------------} -FUNCTION FileClose(Handle: THandle): word; -begin - asm - movem.l d2/d3/a2/a3,-(sp) - move.w Handle,d0 - move.w d0,-(sp) - move.w #$3e,-(sp) - trap #1 - add.l #4,sp { restore stack ... } - movem.l (sp)+,d2/d3/a2/a3 - end; - FileClose := 0; -end; - -{---------------------------------------------------------------------------} -{ FileOpen -> Platforms Atari TOS - 08Jul98 CEC } -{ Returns 0 on failure } -{---------------------------------------------------------------------------} - -FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle; -var - oflags : longint; - AHandle : THandle; -begin - AHandle:=0; - { On opening reset error code } - DosStreamError := 0; - if Mode=stCreate then - oflags:=4 - else - { read/write access on existing file } - oflags := Mode and 3; - - asm - movem.l d2/d3/a2/a3,-(sp) { save used registers } - - cmp.l #4,oflags { check if rewrite mode ... } - bne @opencont2 - { rewrite mode - create new file } - move.w #0,-(sp) - move.l FileName,-(sp) - move.w #$3c,-(sp) - trap #1 - add.l #8,sp { restore stack of os call } - bra @end - { reset - open existing files } - @opencont2: - move.w oflags,d0 { use flag as source ... } - @opencont1: - move.w d0,-(sp) - move.l FileName,-(sp) - move.w #$3d,-(sp) - trap #1 - add.l #8,sp { restore stack of os call } - @end: - movem.l (sp)+,d2/d3/a2/a3 - - tst.w d0 - bpl @opennoerr { if positive return values then ok } - cmp.w #-1,d0 { if handle is -1 CON: } - beq @opennoerr - cmp.w #-2,d0 { if handle is -2 AUX: } - beq @opennoerr - cmp.w #-3,d0 { if handle is -3 PRN: } - beq @opennoerr - move.w d0,dosStreamError { otherwise normal error } - @opennoerr: - move.w d0,AHandle { get handle as SIGNED VALUE... } - end; - FileOpen := AHandle; -end; - - -{***************************************************************************} -{ DosSetFilePtr -> Platforms Atari TOS - 08Jul98 CEC } -{***************************************************************************} -FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word; -Var Actual: LongInt): Word; -BEGIN - asm - move.l d2,d6 { save d2 } - movem.l d3/a2/a3,-(sp) - move.w MoveType,-(sp) { seek from start of file } - move.w Handle,-(sp) - move.l pos,-(sp) - move.w #$42,-(sp) - trap #1 - lea 10(sp),sp - move.l d6,d2 { restore d2 } - movem.l (sp)+,d3/a2/a3 - move.l Actual,a0 - move.l d0,(a0) - end; - SetFilePos := DosStreamError; { Return any error } -END; - - -{---------------------------------------------------------------------------} -{ FileRead -> Platforms Atari TOS - 08Jul98 CEC } -{---------------------------------------------------------------------------} -FUNCTION FileRead (Handle: THandle; Var Buf; Count: Sw_Word; -Var Actual: Sw_Word): Word; -BEGIN - asm - move.l d2,d6 { save d2 } - movem.l d3/a2/a3,-(sp) - move.l buf,-(sp) - move.l Count,-(sp) - move.w Handle,d0 - move.w d0,-(sp) - move.w #$3f,-(sp) - trap #1 - lea 12(sp),sp - move.l d6,d2 { restore d2 } - movem.l (sp)+,d3/a2/a3 - tst.l d0 - bpl @dosrdend - move.w d0,DosStreamError { error ... } - @dosrdend: - end; - FileRead:=DosStreamError; - Actual:=Count; -end; - - -{---------------------------------------------------------------------------} -{ FileWrite -> Platforms Atari TOS - 08Jul98 CEC } -{---------------------------------------------------------------------------} -FUNCTION FileWrite (Handle: THandle; Var Buf; Count: Sw_Word; Var Actual: Sw_Word): Word; -BEGIN - asm - move.l d2,d6 { save d2 } - movem.l d3/a2/a3,-(sp) - move.l buf,-(sp) - move.l Count,-(sp) - move.w Handle,d0 - move.w d0,-(sp) - move.w #$40,-(sp) - trap #1 - lea 12(sp),sp - move.l d6,d2 { restore d2 } - movem.l (sp)+,d3/a2/a3 - tst.l d0 - bpl @doswrend - move.w d0,DosStreamError { error ... } - @doswrend: - end; - Actual:=Count; - FileWrite:=DosStreamError; -end; - - -{---------------------------------------------------------------------------} -{ SetFileSize -> Platforms Atari TOS - 08Jul98 CEC } -{---------------------------------------------------------------------------} -FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word; -VAR Actual, Buf: LongInt; -BEGIN - SetFilePos(Handle,FileSize,0,Actual); - If (Actual = FileSize) Then - Begin - Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual); { Truncate the file } - If (Actual <> -1) Then - SetFileSize := 0 - Else - SetFileSize := 103; { File truncate error } - End - Else - SetFileSize := 103; { File truncate error } -END; - -{ - $Log$ - Revision 1.3 2002-09-07 16:01:16 peter - * old logs removed and tabs fixed - -} diff --git a/rtl/atari/system.pas b/rtl/atari/system.pas index 77ed39a53e..5915a61edd 100644 --- a/rtl/atari/system.pas +++ b/rtl/atari/system.pas @@ -739,8 +739,6 @@ end; begin { Initialize ExitProc } ExitProc:=Nil; -{ to test stack depth } - loweststack:=maxlongint; { Setup heap } InitHeap; { Setup stdin, stdout and stderr } @@ -760,7 +758,11 @@ end. { $Log$ - Revision 1.5 2002-10-13 09:25:23 florian + Revision 1.6 2002-10-20 12:00:52 carl + - remove objinc.inc (unused file) + * update makefiles accordingly + + Revision 1.5 2002/10/13 09:25:23 florian + call to initvariantmanager inserted Revision 1.4 2002/09/07 16:01:16 peter diff --git a/rtl/beos/Makefile b/rtl/beos/Makefile index 7040b4c0cd..a9e422a2ca 100644 --- a/rtl/beos/Makefile +++ b/rtl/beos/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/08/01] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx @@ -58,6 +58,9 @@ ifdef inUnix PATHSEP=/ else PATHSEP:=$(subst /,\,/) +ifneq ($(findstring sh.exe,$(SHELL)),) +PATHSEP=/ +endif endif ifdef PWD BASEDIR:=$(subst \,/,$(shell $(PWD))) @@ -87,8 +90,8 @@ endif endif export ECHO endif -OS_TARGET=beos -CPU_TARGET=i386 +override OS_TARGET_DEFAULT=beos +override CPU_TARGET_DEFAULT=i386 override DEFAULT_FPCDIR=../.. ifndef FPC ifdef PP @@ -142,6 +145,16 @@ ifndef OS_TARGET OS_TARGET:=$(shell $(FPC) -iTO) endif endif +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) ifneq ($(FULL_TARGET),$(FULL_SOURCE)) @@ -1093,6 +1106,7 @@ fpc_baseinfo: @$(ECHO) Rm........ $(RMPROG) @$(ECHO) GInstall.. $(GINSTALL) @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) @$(ECHO) Date...... $(DATE) @$(ECHO) FPCMake... $(FPCMAKE) @$(ECHO) PPUMove... $(PPUMOVE) @@ -1196,7 +1210,7 @@ strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\ beos$(PPUEXT) : beos.pp system$(PPUEXT) dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \ beos$(PPUEXT) system$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp $(UNIXINC)/objinc.inc system$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT) sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \ objpas$(PPUEXT) beos$(PPUEXT) $(COMPILER) -I$(OBJPASDIR) sysutils.pp diff --git a/rtl/beos/Makefile.fpc b/rtl/beos/Makefile.fpc index 207275c61a..5ae6814e2b 100644 --- a/rtl/beos/Makefile.fpc +++ b/rtl/beos/Makefile.fpc @@ -109,7 +109,7 @@ beos$(PPUEXT) : beos.pp system$(PPUEXT) dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \ beos$(PPUEXT) system$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp $(UNIXINC)/objinc.inc system$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT) # # Delphi Compatible Units diff --git a/rtl/freebsd/Makefile b/rtl/freebsd/Makefile index b1a1a1f03c..522bd14814 100644 --- a/rtl/freebsd/Makefile +++ b/rtl/freebsd/Makefile @@ -1,8 +1,8 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/08/01] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all -MAKEFILETARGETS=freebsd +MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx override PATH:=$(subst \,/,$(PATH)) ifeq ($(findstring ;,$(PATH)),) inUnix=1 @@ -58,6 +58,9 @@ ifdef inUnix PATHSEP=/ else PATHSEP:=$(subst /,\,/) +ifneq ($(findstring sh.exe,$(SHELL)),) +PATHSEP=/ +endif endif ifdef PWD BASEDIR:=$(subst \,/,$(shell $(PWD))) @@ -87,7 +90,7 @@ endif endif export ECHO endif -OS_TARGET=freebsd +override OS_TARGET_DEFAULT=freebsd override DEFAULT_FPCDIR=../.. ifndef FPC ifdef PP @@ -141,6 +144,16 @@ ifndef OS_TARGET OS_TARGET:=$(shell $(FPC) -iTO) endif endif +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) ifneq ($(FULL_TARGET),$(FULL_SOURCE)) @@ -1108,6 +1121,7 @@ fpc_baseinfo: @$(ECHO) Rm........ $(RMPROG) @$(ECHO) GInstall.. $(GINSTALL) @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) @$(ECHO) Date...... $(DATE) @$(ECHO) FPCMake... $(FPCMAKE) @$(ECHO) PPUMove... $(PPUMOVE) @@ -1210,7 +1224,7 @@ unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/fi dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \ unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp $(UNIXINC)/objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) : $(UNIXINC)/sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \ objpas$(PPUEXT) unix$(PPUEXT) errors$(PPUEXT) diff --git a/rtl/freebsd/Makefile.fpc b/rtl/freebsd/Makefile.fpc index 5e943c2f3d..73d0d34315 100644 --- a/rtl/freebsd/Makefile.fpc +++ b/rtl/freebsd/Makefile.fpc @@ -145,7 +145,7 @@ dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$( crt$(PPUEXT) : $(UNIXINC)/crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp $(UNIXINC)/objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) printer$(PPUEXT) : $(UNIXINC)/printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) diff --git a/rtl/go32v2/Makefile b/rtl/go32v2/Makefile index 7f85b1dfd4..65d3a69ccf 100644 --- a/rtl/go32v2/Makefile +++ b/rtl/go32v2/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/08/24] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx @@ -58,6 +58,9 @@ ifdef inUnix PATHSEP=/ else PATHSEP:=$(subst /,\,/) +ifneq ($(findstring sh.exe,$(SHELL)),) +PATHSEP=/ +endif endif ifdef PWD BASEDIR:=$(subst \,/,$(shell $(PWD))) @@ -87,8 +90,8 @@ endif endif export ECHO endif -OS_TARGET=go32v2 -CPU_TARGET=i386 +override OS_TARGET_DEFAULT=go32v2 +override CPU_TARGET_DEFAULT=i386 override DEFAULT_FPCDIR=../.. ifndef FPC ifdef PP @@ -142,6 +145,16 @@ ifndef OS_TARGET OS_TARGET:=$(shell $(FPC) -iTO) endif endif +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) ifneq ($(FULL_TARGET),$(FULL_SOURCE)) @@ -1098,6 +1111,7 @@ fpc_baseinfo: @$(ECHO) Rm........ $(RMPROG) @$(ECHO) GInstall.. $(GINSTALL) @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) @$(ECHO) Date...... $(DATE) @$(ECHO) FPCMake... $(FPCMAKE) @$(ECHO) PPUMove... $(PPUMOVE) @@ -1204,7 +1218,7 @@ ports$(PPUEXT) : ports.pp objpas$(PPUEXT) system$(PPUEXT) dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \ go32$(PPUEXT) strings$(PPUEXT) system$(PPUEXT) crt$(PPUEXT) : crt.pp $(INC)/textrec.inc go32$(PPUEXT) system$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc system$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT) printer$(PPUEXT) : printer.pp system$(PPUEXT) include $(GRAPHDIR)/makefile.inc GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES)) diff --git a/rtl/go32v2/Makefile.fpc b/rtl/go32v2/Makefile.fpc index 3c2b2bc1e5..ffe96d0832 100644 --- a/rtl/go32v2/Makefile.fpc +++ b/rtl/go32v2/Makefile.fpc @@ -129,7 +129,7 @@ dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc \ crt$(PPUEXT) : crt.pp $(INC)/textrec.inc go32$(PPUEXT) system$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc system$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT) printer$(PPUEXT) : printer.pp system$(PPUEXT) diff --git a/rtl/go32v2/objinc.inc b/rtl/go32v2/objinc.inc deleted file mode 100644 index b27cf06fdc..0000000000 --- a/rtl/go32v2/objinc.inc +++ /dev/null @@ -1,205 +0,0 @@ -{ - $Id$ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2000 by the Free Pascal development team. - - Includefile for objects.pp implementing OS-dependent file routines - for Go32V2 - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - ********************************************************************** -} - -{---------------------------------------------------------------------------} -{ FileClose -> Platforms DOS - Not checked } -{---------------------------------------------------------------------------} -FUNCTION FileClose (Handle: THandle): Word; -var - regs : trealregs; -begin - regs.realebx:=handle; - regs.realeax:=$3e00; - sysrealintr($21,regs); - FileClose := 0; -end; - - -{---------------------------------------------------------------------------} -{ FileOpen -> Platforms DOS - Checked 05May1998 CEC } -{ Returns 0 on failure } -{---------------------------------------------------------------------------} -FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle; -Var - regs : trealregs; -BEGIN - DosStreamError:=0; - syscopytodos(longint(@FileName),256); - { get linear address from system unit } - regs.realedx:=tb mod 16; - regs.realds:=tb div 16; - if LFNSupport then - begin - if (mode = stCreate) then - begin - regs.realeax := $716C; - regs.realesi:=tb mod 16; - regs.realebx:=$2002; - regs.realecx:=$20; - regs.realedi:=0; - regs.realedx:=$12; - end - else if (mode = stOpenRead) then - begin - regs.realeax := $716C; - regs.realesi:=tb mod 16; - regs.realebx:=$2000; - regs.realecx:=$20; - regs.realedi:=0; - regs.realedx:=$1; - end - else if (mode = stOpenWrite) then - begin - regs.realeax := $716C; - regs.realesi:=tb mod 16; - regs.realebx:=$2001; - regs.realecx:=$20; - regs.realedi:=0; - regs.realedx:=$11; - end - else if (mode = stOpen) then - begin - regs.realeax := $716C; - regs.realesi:=tb mod 16; - regs.realebx:=$2002; - regs.realecx:=$20; - regs.realedi:=0; - regs.realedx:=$11; - end - else - regs.realeax := Mode; - end - else - regs.realeax := Mode; - regs.realecx:=0; - sysrealintr($21,regs); - if (regs.realflags and 1) <> 0 then - begin - DosStreamError:=lo(regs.realeax); - FileOpen:=$0; - exit; - end - else - { word handle (under DOS) } - FileOpen:=regs.realeax and $ffff; -END; - - -{---------------------------------------------------------------------------} -{ SetFilePos -> Platforms DOS - Checked 05May1998 CEC } -{---------------------------------------------------------------------------} -{ - Calls the operating system to move the file denoted by the handle to - to the requested position. The move method can be: 0 = absolute offset; - 1 = offset from present location; 2 = offset from end of file; - Any error is held in DosErrorStream and returned from the call. - If the return is zero (ie no error) NewPos contains the new absolute - file position. -} -FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word;Var Actual: LongInt): Word; -Var - regs: Trealregs; -const - CarryFlag = $001; -BEGIN - regs.realeax := ($42 shl 8) + Byte(MoveType); - regs.realedx := pos and $ffff; { keep low word } - regs.realecx := pos shr 16; - regs.realebx := longint(Handle); - sysrealintr($21,regs); - if (regs.RealFlags and CarryFlag = 0) then { no error } - Actual:=(regs.realeax and $ffff) + ((regs.realedx and $ffff) shl 16) - else - DosStreamError:=word(regs.realeax); - SetFilePos := DosStreamError; { Return any error } -END; - - -{---------------------------------------------------------------------------} -{ FileRead -> Platforms DOS - Checked 05May1998 CEC } -{---------------------------------------------------------------------------} -FUNCTION FileRead (Handle: THandle; Var Buf; Count: Sw_Word; -Var Actual: Sw_Word): Word; -Var - StoreInOutRes : word; -BEGIN - StoreInOutRes:=InOutRes; - InOutRes:=0; - Actual:=system.do_read(longint(Handle),longint(@Buf),Count); - DosStreamError:=InOutRes; - InOutRes:=StoreInOutRes; - FileRead:=DosStreamError; -End; - - -{---------------------------------------------------------------------------} -{ FileWrite -> Platforms DOS - Checked 05May1998 CEC } -{---------------------------------------------------------------------------} -FUNCTION FileWrite (Handle: THandle; Var Buf; Count: Sw_Word; Var Actual: Sw_Word): Word; -Var - StoreInOutRes : word; -BEGIN - StoreInOutRes:=InOutRes; - InOutRes:=0; - system.do_write(longint(Handle),longint(@Buf),Count); - Actual:=Count; - DosStreamError:=InOutRes; - InOutRes:=StoreInOutRes; - FileWrite:=DosStreamError; -End; - - -{---------------------------------------------------------------------------} -{ SetFileSize -> Platforms DOS - Not Checked } -{---------------------------------------------------------------------------} -FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word; -VAR Actual: LongInt; - regs : trealregs; -const - CarryFlag = $001; -BEGIN - SetFilePos(Handle,FileSize,0,Actual); - If (Actual = FileSize) Then - Begin - regs.realecx:=0; - regs.realedx:=tb mod 16; - regs.realds:=tb div 16; - regs.realebx:=handle; - regs.realeax:=$4000; - sysrealintr($21,regs); - if (regs.RealFlags and CarryFlag = 0) then { no error } - SetFileSize := 0 - Else - SetFileSize := 103; { File truncate error } - End - Else - SetFileSize := 103; { File truncate error } -END; - -{ - $Log$ - Revision 1.4 2002-09-07 16:01:18 peter - * old logs removed and tabs fixed - - Revision 1.3 2002/05/09 08:42:24 carl - * Merges from Fixes branch - - Revision 1.1.2.1 2002/04/12 08:08:08 pierre - * avoid that objects unit is sensitive to or changes system.InOutRes value - -} diff --git a/rtl/linux/Makefile b/rtl/linux/Makefile index ffdd5eab7f..37fcf5b1e5 100644 --- a/rtl/linux/Makefile +++ b/rtl/linux/Makefile @@ -1,8 +1,8 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/05] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all -MAKEFILETARGETS=linux +MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx override PATH:=$(subst \,/,$(PATH)) ifeq ($(findstring ;,$(PATH)),) inUnix=1 @@ -1239,7 +1239,7 @@ dynlibs$(PPUEXT) : $(INC)/dynlibs.pp $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$( dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \ unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) crt$(PPUEXT) : crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp $(UNIXINC)/objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) printer$(PPUEXT) : printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) include $(GRAPHDIR)/makefile.inc GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES)) diff --git a/rtl/linux/Makefile.fpc b/rtl/linux/Makefile.fpc index e41b8d5c5a..840b675092 100644 --- a/rtl/linux/Makefile.fpc +++ b/rtl/linux/Makefile.fpc @@ -171,7 +171,7 @@ dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \ crt$(PPUEXT) : crt.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp $(UNIXINC)/objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) printer$(PPUEXT) : printer.pp $(INC)/textrec.inc unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) diff --git a/rtl/netware/Makefile b/rtl/netware/Makefile index 455a9cfc35..d342cbe9db 100644 --- a/rtl/netware/Makefile +++ b/rtl/netware/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/08/01] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx @@ -58,6 +58,9 @@ ifdef inUnix PATHSEP=/ else PATHSEP:=$(subst /,\,/) +ifneq ($(findstring sh.exe,$(SHELL)),) +PATHSEP=/ +endif endif ifdef PWD BASEDIR:=$(subst \,/,$(shell $(PWD))) @@ -87,7 +90,7 @@ endif endif export ECHO endif -OS_TARGET=netware +override OS_TARGET_DEFAULT=netware override DEFAULT_FPCDIR=../.. ifndef FPC ifdef PP @@ -141,6 +144,16 @@ ifndef OS_TARGET OS_TARGET:=$(shell $(FPC) -iTO) endif endif +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) ifneq ($(FULL_TARGET),$(FULL_SOURCE)) @@ -214,7 +227,7 @@ override FPCOPT+=-Ur override FPCOPT+=-dMT CREATESMART=1 OBJPASDIR=$(RTL)/objpas -override TARGET_UNITS+=$(SYSTEMUNIT) objpas strings netware os_types winsock2 dos crt objects sysutils typinfo math cpu mmx getopts heaptrc lineinfo sockets aio varutils video mouse keyboard types +override TARGET_UNITS+=$(SYSTEMUNIT) objpas strings netware winsock2 dos crt objects sysutils typinfo math cpu mmx getopts heaptrc lineinfo sockets aio varutils video mouse keyboard types override TARGET_LOADERS+=nwpre prelude override TARGET_RSTS+=math typinfo varutils override INSTALL_FPCPACKAGE=y @@ -1095,6 +1108,7 @@ fpc_baseinfo: @$(ECHO) Rm........ $(RMPROG) @$(ECHO) GInstall.. $(GINSTALL) @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) @$(ECHO) Date...... $(DATE) @$(ECHO) FPCMake... $(FPCMAKE) @$(ECHO) PPUMove... $(PPUMOVE) @@ -1194,13 +1208,12 @@ strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\ $(SYSTEMUNIT)$(PPUEXT) netware$(PPUEXT) : netware.pp $(SYSTEMUNIT)$(PPUEXT) $(COMPILER) -I$(WININC) netware.pp -os_types$(PPUEXT) : $(INC)/os_types.pp -winsock2$(PPUEXT) : winsock2.pp qos.inc netware$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) os_types$(PPUEXT) +winsock2$(PPUEXT) : winsock2.pp qos.inc netware$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) sockets$(PPUEXT) : sockets.pp netware$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \ $(INC)/sockets.inc $(INC)/socketsh.inc dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) dos$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \ objpas$(PPUEXT) dos$(PPUEXT) nwsys.inc $(COMPILER) -I$(OBJPASDIR) sysutils.pp diff --git a/rtl/netware/Makefile.fpc b/rtl/netware/Makefile.fpc index b8f32391f4..5114b30a5b 100644 --- a/rtl/netware/Makefile.fpc +++ b/rtl/netware/Makefile.fpc @@ -8,7 +8,7 @@ main=rtl [target] loaders=nwpre prelude units=$(SYSTEMUNIT) objpas strings \ - netware os_types winsock2 \ + netware winsock2 \ dos crt objects \ sysutils typinfo math \ cpu mmx getopts heaptrc lineinfo \ @@ -112,9 +112,8 @@ strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc\ netware$(PPUEXT) : netware.pp $(SYSTEMUNIT)$(PPUEXT) $(COMPILER) -I$(WININC) netware.pp -os_types$(PPUEXT) : $(INC)/os_types.pp -winsock2$(PPUEXT) : winsock2.pp qos.inc netware$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) os_types$(PPUEXT) +winsock2$(PPUEXT) : winsock2.pp qos.inc netware$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) sockets$(PPUEXT) : sockets.pp netware$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \ $(INC)/sockets.inc $(INC)/socketsh.inc @@ -129,7 +128,7 @@ dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(S crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) dos$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) # # Delphi Compatible Units diff --git a/rtl/netware/objinc.inc b/rtl/netware/objinc.inc deleted file mode 100644 index 2596b84a12..0000000000 --- a/rtl/netware/objinc.inc +++ /dev/null @@ -1,87 +0,0 @@ -{ 2001/04/16 armin: first version for netware } - -{$i errno.inc} -{$i nwsys.inc} - -FUNCTION errno : LONGINT; -BEGIN - errno := __get_errno_ptr^; -END; - -FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle; -VAR NWMode : longint; -BEGIN - NWMode:=0; - if Mode=stCreate then - Begin - NWMode:=O_Creat; - NWMode:=NWMode or O_RdWr; - end - else - Begin - Case (Mode and 3) of - 0 : NWMode:=NWMode or O_RdOnly; - 1 : NWMode:=NWMode or O_WrOnly; - 2 : NWMode:=NWMode or O_RdWr; - end; - end; - FileOpen:=_open (pchar(@FileName[0]),NWMode,0); - If FileOpen=-1 then FileOpen:=0; - DosStreamError:=Errno; -END; - -FUNCTION FileRead (Handle: THandle; Var BufferArea; BufferLength: Sw_Word; -Var BytesMoved: Sw_Word): Word; -BEGIN - BytesMoved:=_read (Handle,@BufferArea,BufferLength); - IF BytesMoved = -1 THEN - BEGIN - DosStreamError:=Errno; - FileRead:=Errno; - END ELSE - BEGIN - DosStreamError:=0; - FileRead:=0; - END; -END; - -FUNCTION FileWrite (Handle: THandle; Var BufferArea; BufferLength: Sw_Word; -Var BytesMoved: Sw_Word): Word; -BEGIN - BytesMoved:=_write (Handle,@BufferArea,BufferLength); - IF BytesMoved = -1 THEN - BEGIN - DosStreamError:=Errno; - FileWrite:=Errno; - END ELSE - BEGIN - DosStreamError:=0; - FileWrite:=0; - END; -END; - -FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word; -VAR NewPos: LongInt): Word; - -BEGIN - NewPos:=_lseek (Handle,Pos,MoveType); - IF NewPos = -1 THEN - SetFilePos:=Errno - ELSE - SetFilePos := 0; -END; - -FUNCTION FileClose (Handle: THandle): Word; -BEGIN - _Close (Handle); - DosStreamError:=Errno; - FileClose := Errno; -END; - -FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word; -BEGIN - if _chsize (Handle, FileSize) = -1 then - SetFileSize := Errno - else - SetFileSize := 0; -END; diff --git a/rtl/os2/Makefile b/rtl/os2/Makefile index c8c50937c8..65a77a2f88 100644 --- a/rtl/os2/Makefile +++ b/rtl/os2/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/08/24] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx @@ -58,6 +58,9 @@ ifdef inUnix PATHSEP=/ else PATHSEP:=$(subst /,\,/) +ifneq ($(findstring sh.exe,$(SHELL)),) +PATHSEP=/ +endif endif ifdef PWD BASEDIR:=$(subst \,/,$(shell $(PWD))) @@ -87,8 +90,8 @@ endif endif export ECHO endif -OS_TARGET=os2 -CPU_TARGET=i386 +override OS_TARGET_DEFAULT=os2 +override CPU_TARGET_DEFAULT=i386 override DEFAULT_FPCDIR=../.. ifndef FPC ifdef PP @@ -142,6 +145,16 @@ ifndef OS_TARGET OS_TARGET:=$(shell $(FPC) -iTO) endif endif +ifndef CPU_TARGET +ifdef CPU_TARGET_DEFAULT +CPU_TARGET=$(CPU_TARGET_DEFAULT) +endif +endif +ifndef OS_TARGET +ifdef OS_TARGET_DEFAULT +OS_TARGET=$(OS_TARGET_DEFAULT) +endif +endif FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET) FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE) ifneq ($(FULL_TARGET),$(FULL_SOURCE)) @@ -1097,6 +1110,7 @@ fpc_baseinfo: @$(ECHO) Rm........ $(RMPROG) @$(ECHO) GInstall.. $(GINSTALL) @$(ECHO) Echo...... $(ECHO) + @$(ECHO) Shell..... $(SHELL) @$(ECHO) Date...... $(DATE) @$(ECHO) FPCMake... $(FPCMAKE) @$(ECHO) PPUMove... $(PPUMOVE) @@ -1208,7 +1222,7 @@ dynlibs$(PPUEXT) : $(INC)/dynlibs.pp doscalls$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) dos$(PPUEXT) : dos.pas $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \ doscalls$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/*.inc) \ objpas$(PPUEXT) dos$(PPUEXT) doscalls$(PPUEXT) diff --git a/rtl/os2/Makefile.fpc b/rtl/os2/Makefile.fpc index 9d32d19544..d14cce506a 100644 --- a/rtl/os2/Makefile.fpc +++ b/rtl/os2/Makefile.fpc @@ -137,7 +137,7 @@ dos$(PPUEXT) : dos.pas $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \ crt$(PPUEXT) : crt.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) printer$(PPUEXT) : printer.pas $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) diff --git a/rtl/os2/objinc.inc b/rtl/os2/objinc.inc deleted file mode 100644 index 7d0d0e6645..0000000000 --- a/rtl/os2/objinc.inc +++ /dev/null @@ -1,160 +0,0 @@ -{ - $Id$ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2000 by the Free Pascal development team. - - Includefile for objects.pp implementing OS-dependent file routines - for EMX (OS/2 & DOS) - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - ********************************************************************** -} - -{This is the correct way to call external assembler procedures.} -procedure syscall;external name '___SYSCALL'; - -FUNCTION FileClose(Handle: THandle): word; -begin - asm - xor %bx,%bx - movw handle,%bx - movb $0x3e,%ah - call syscall - end; - FileClose := 0; -end; - -procedure AllowSlash (P: PChar); - -{Allow slash as backslash.} - -var I: longint; - -begin - for I := 0 to StrLen (P) do - if P [I] = '/' then P [I] := '\'; -end; - -function FileOpen (var FileName: AsciiZ; Mode: word): THandle; -var AMode: longint; -begin - if Mode = stCreate then - AMode := $50000 (* Create / replace *) - else - AMode := Mode and $FF; -(* DenyAll if sharing not specified. *) - if AMode and 112 = 0 then AMode := AMode or 16; - asm - xorl %eax, %eax - movw %ax, DosStreamError - movl FileName, %edx - movl $0x7f2b, %eax - movl AMode, %ecx - call syscall - cmpl $0xffffffff, %eax - jnz .Lexit1 - movw %cx, DosStreamError { Hold Error } - xorl %eax, %eax { Open Failed } - .Lexit1: - movw %ax, __RESULT - end; -end; - - -FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word; -Var Actual: LongInt): Word; -Var - val : longint; -BEGIN - asm - movw MoveType, %ax; { Load move type } - movb $0x42, %ah; - movl pos, %edx; { Load file position } - movw Handle, %bx; { Load file handle } - call syscall - jc .Lexit4 - movl %eax,val { Update new position } - xorl %eax, %eax; - .Lexit4: - movw %ax, DosStreamError { OS2 error returned } - .Lend: - END; - Actual := val; - SetFilePos := DosStreamError; { Return any error } -END; - - -FUNCTION FileRead (Handle: THandle; Var Buf; Count: Sw_Word; -Var Actual: Sw_Word): Word; -BEGIN - asm - movl count,%ecx - movl buf,%edx - xorl %ebx,%ebx - movw handle,%bx - movb $0x3f,%ah - call syscall - jnc .LDOSREAD1 - movw %ax,DosStreamError - xorl %eax,%eax - .LDOSREAD1: - end; - Actual:=Count; - FileRead:=DosStreamError; -end; - - -FUNCTION FileWrite (Handle: THandle; Var Buf; Count: Sw_Word; Var Actual: Sw_Word): Word; -BEGIN - Actual:=0; - asm - movl Count,%ecx - movl buf,%edx - xorl %ebx,%ebx - movw Handle,%bx - movb $0x40,%ah - call syscall - jnc .LDOSWRITE1 - movw %ax,DosStreamError - .LDOSWRITE1: - end; - Actual:=Count; - FileWrite:=DosStreamError; -end; - - -function SetFileSize (Handle: THandle; FileSize: longint): word; assembler; -asm - movl $0x7F18, %eax - movl Handle, %ebx - movl FileSize,%edx - call syscall - jc .LSetFSize1 - movl $0x4202, %eax - movl Handle, %ebx - movl $0, %edx - call syscall - movl $0, %eax - jnc .LSetFSize1 - decl %eax -.LSetFSize1: -end; - -{ - $Log$ - Revision 1.6 2002-09-26 18:54:55 hajny - * FileOpen fixed - - Revision 1.5 2002/09/22 16:04:19 hajny - * correction for THandle length change - - Revision 1.4 2002/09/07 16:01:24 peter - * old logs removed and tabs fixed - -} diff --git a/rtl/posix/objinc.inc b/rtl/posix/objinc.inc deleted file mode 100644 index 5550cfe71c..0000000000 --- a/rtl/posix/objinc.inc +++ /dev/null @@ -1,139 +0,0 @@ - -{ - $Id$ - Copyright (c) 2001 by the Freepascal development team - - Objects unit OS specific implementation - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - **************************************************************************** -} - -{$i errno.inc} -{$i osposixh.inc} -{$i osposix.inc} -const - { read/write permission for everyone } - MODE_OPEN = S_IWUSR OR S_IRUSR OR - S_IWGRP OR S_IRGRP OR - S_IWOTH OR S_IROTH; - - -FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle; - -Var FileMode : cint; - -BEGIN - FileMode:=0; - if Mode=stCreate then - Begin - FileMode:=O_CREAT; - FileMode:=FileMode or O_RDWR; - end - else - Begin - Case (Mode and 3) of - 0 : FileMode:=FileMode or O_RDONLY; - 1 : FileMode:=FileMode or O_WRONLY; - 2 : FileMode:=FileMode or O_RDWR; - end; - end; - FileOpen:=sys_open (pchar(@FileName[0]),FileMode,MODE_OPEN); - if (ErrNo=Sys_EROFS) and ((FileMode and O_RDWR)<>0) then - begin - FileMode:=FileMode and not(O_RDWR); - FileOpen:=sys_open(pchar(@FileName[0]),Filemode,MODE_OPEN); - end; - If FileOpen=-1 then - FileOpen:=0; - DosStreamError:=Errno; -END; - -FUNCTION FileRead (Handle: THandle; Var BufferArea; BufferLength: Sw_Word; -Var BytesMoved: Sw_Word): word; -var result : cint; -BEGIN - repeat - result:=Sys_read (Handle,pchar(@BufferArea),BufferLength); - until errno<>Sys_EINTR; - if result = -1 then - BytesMoved := 0 - else - BytesMoved := result; - DosStreamError:=Errno; - FileRead:=Errno; -END; - -FUNCTION FileWrite (Handle: THandle; Var BufferArea; BufferLength: Sw_Word; -Var BytesMoved: Sw_Word): Word; -var result: cint; -BEGIN - repeat - result:=Sys_Write (Handle,pchar(@BufferArea),BufferLength); - until errno<>Sys_EINTR; - if result = -1 then - BytesMoved := 0 - else - BytesMoved := result; - FileWrite:=Errno; - DosStreamError:=Errno; -END; - -FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word; -VAR NewPos: LongInt): Word; - -var - whence : cint; -BEGIN - whence := SEEK_SET; - case MoveType of - 1 : whence := SEEK_CUR; - 2 : whence := SEEK_END; - end; - NewPos:=Sys_LSeek (Handle,Pos,whence); - SetFilePos:=Errno; -END; - -FUNCTION FileClose (Handle: THandle): Word; -BEGIN - Sys_Close (Handle); - DosStreamError:=Errno; - FileClose := Errno; -END; - -FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word; -var - Actual : longint; -BEGIN - SetFilePos(Handle,FileSize,0,Actual); - If (Actual = FileSize) Then - Begin - if (Sys_FTruncate(Handle,Filesize)=-1) then - SetFileSize:=103 - else - SetFileSize:=0; - end; -END; - -{ - $Log$ - Revision 1.3 2002-09-07 16:01:26 peter - * old logs removed and tabs fixed - - Revision 1.2 2002/08/10 13:42:36 marco - * Fixes Posix dir copied to devel branch - -} diff --git a/rtl/unix/objinc.inc b/rtl/unix/objinc.inc deleted file mode 100644 index 5fe321b035..0000000000 --- a/rtl/unix/objinc.inc +++ /dev/null @@ -1,103 +0,0 @@ -{ For linux we 'steal' the following from system unit, this way - we don't need to change the system unit interface. } - -Var errno : Longint; - -{$i sysnr.inc} -{$i errno.inc} -{$i sysconst.inc} -{$i systypes.inc} -{$i signal.inc} -{$i syscalls.inc} - -FUNCTION FileOpen (Var FileName: AsciiZ; Mode: Word): THandle; - -Var LinuxMode : longint; - -BEGIN - LinuxMode:=0; - if Mode=stCreate then - Begin - LinuxMode:=Open_Creat; - LinuxMode:=LinuxMode or Open_RdWr; - end - else - Begin - Case (Mode and 3) of - 0 : LinuxMode:=LinuxMode or Open_RdOnly; - 1 : LinuxMode:=LinuxMode or Open_WrOnly; - 2 : LinuxMode:=LinuxMode or Open_RdWr; - end; - end; - FileOpen:=SYS_Open (pchar(@FileName[0]),LinuxMode,438 {666 octal}); - If FileOpen=-1 then FileOpen:=0; - DosStreamError:=Errno; -END; - -FUNCTION FileRead (Handle: THandle; Var BufferArea; BufferLength: Sw_Word; -Var BytesMoved: Sw_Word): Word; -BEGIN - BytesMoved:=Sys_read (Handle,Pchar(@BufferArea),BufferLength); - DosStreamError:=Errno; - FileRead:=Errno; -END; - -FUNCTION FileWrite (Handle: THandle; Var BufferArea; BufferLength: Sw_Word; -Var BytesMoved: Sw_Word): Word; -BEGIN - BytesMoved:=Sys_Write (Handle,Pchar(@BufferArea),BufferLength); - FileWrite:=Errno; - DosStreamError:=Errno; -END; - -FUNCTION SetFilePos (Handle: THandle; Pos: LongInt; MoveType: Word; -VAR NewPos: LongInt): Word; - -BEGIN - NewPos:=Sys_LSeek (Handle,Pos,MoveType); - SetFilePos:=Errno; -END; - -FUNCTION FileClose (Handle: THandle): Word; -BEGIN - Sys_Close (Handle); - DosStreamError:=Errno; - FileClose := Errno; -END; - -FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word; - -{$IFNDEF BSD} -Var sr : syscallregs; -{$ENDIF} -{$IFDEF DOSSETFILE1} - Actual, Buf: LongInt; -{$ENDIF} - -BEGIN - {$IFDEF BSD} - Do_Syscall(Syscall_Nr_ftruncate,handle,filesize,0); {0 -> offset =64 bit} - {$ELSE} - sr.reg2:=Handle; - sr.reg3:=FileSize; - Syscall(syscall_nr_fTruncate,sr); - {$ENDIF} - If Errno=0 then - SetFileSize:=0 - else - SetFileSize:=103; -{$IFDEF DOSSETFILE1} - If (Actual = FileSize) Then Begin { No position error } - Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual); { Truncate the file } - If (Actual <> -1) Then SetFileSize := 0 Else { No truncate error } - SetFileSize := 103; { File truncate error } - End Else SetFileSize := 103; { File truncate error } -{$ENDIF} -END; - -{ - $Log$ - Revision 1.3 2002-09-07 16:01:27 peter - * old logs removed and tabs fixed - -} diff --git a/rtl/win32/Makefile b/rtl/win32/Makefile index fbc614059d..f6d4f3532b 100644 --- a/rtl/win32/Makefile +++ b/rtl/win32/Makefile @@ -1,8 +1,8 @@ # -# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/05] +# Don't edit, this file is generated by FPCMake Version 1.1 [2002/10/20] # default: all -MAKEFILETARGETS=win32 +MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx override PATH:=$(subst \,/,$(PATH)) ifeq ($(findstring ;,$(PATH)),) inUnix=1 @@ -1230,7 +1230,7 @@ winmouse$(PPUEXT) : winmouse.pp $(SYSTEMUNIT)$(PPUEXT) windows$(PPUEXT) graph$(P dynlibs$(PPUEXT) : $(INC)/dynlibs.pp windows$(PPUEXT) dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) dos$(PPUEXT) windows$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) include $(GRAPHDIR)/makefile.inc GRAPHINCDEPS=$(addprefix $(GRAPHDIR)/,$(GRAPHINCNAMES)) graph$(PPUEXT) : graph.pp strings$(PPUEXT) windows$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \ diff --git a/rtl/win32/Makefile.fpc b/rtl/win32/Makefile.fpc index d00ad20aeb..eafbceecdb 100644 --- a/rtl/win32/Makefile.fpc +++ b/rtl/win32/Makefile.fpc @@ -150,7 +150,7 @@ dos$(PPUEXT) : dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) $(S crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT) dos$(PPUEXT) windows$(PPUEXT) -objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMUNIT)$(PPUEXT) +objects$(PPUEXT) : $(INC)/objects.pp $(SYSTEMUNIT)$(PPUEXT) # # Graph