Browse Source

* makefile updates

peter 26 years ago
parent
commit
a7741dd7e7

+ 105 - 89
fcl/Makefile

@@ -1,105 +1,125 @@
-#****************************************************************************
-#                     Makefile for Free Component Library
-#            Copyright (c) 1998 by the Free Pascal Development Team
-#****************************************************************************
+#
+#   $Id$
+#   Copyright (c) 1999 by the Free Pascal Development Team
+#
+#   Makefile for Free Component Library
+#
+#   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.
+#
 
+
+#####################################################################
+# Defaults
 #####################################################################
-# Start of configurable section
+
+# Default place of the makefile.fpc
+DEFAULTFPCDIR=..
+
+
 #####################################################################
+# Common targets
+#####################################################################
+
+.PHONY: all clean install info \
+        staticlib sharedlib libsclean \
+        staticinstall sharedinstall libinstall \
+
+all: testfpcmake
+	$(MAKE) -C $(OS_TARGET) all
+        
+clean: testfpcmake
+	$(MAKE) -C go32v2 clean
+	$(MAKE) -C linux clean
+	$(MAKE) -C win32 clean
+	$(MAKE) -C os2 clean
+	$(MAKE) -C tests clean
+
+install: testfpcmake
+	$(MAKE) -C $(OS_TARGET) install
+
+info: testfpcmake fpc_info
+
+staticlib: testfpcmake
+	$(MAKE) -C $(OS_TARGET) staticlib
+
+sharedlib: testfpcmake
+	$(MAKE) -C $(OS_TARGET) sharedlib
+
+libsclean: testfpcmake
+	$(MAKE) -C $(OS_TARGET) libsclean
+
+staticinstall: testfpcmake
+	$(MAKE) -C $(OS_TARGET) staticinstall
 
-# What compiler do you want to use :
-# !! If you specify a path, specify an absolute path !!
-#PP=/pas/fpk/curver/ppc386
-PP=ppc386
-
-# What is your OS ?
-# Possible choices : linux win32 go32v2 go32v1 os2
-#OS_SRC=linux
-#OS_SRC=win32
-#OS_SRC=go32v1
-OS_SRC=go32v2
-#OS_SRC=os2
-
-# Where do you want to install the units ?
-UNITINSTALLDIR=/usr/lib/ppc/0.99.6/fcl
-# UNITINSTALLDIR=\pp\units\fcl
-
-# set target processor type
-CPU=i386
-# CPU=m68k
-
-# Where is the ppumove program ? (set only if you want to make libs)
-# Don't specify a relative path.
-PPUMOVE=ppumove
-
-# Set any options you wish to give to the compiler
-OPT=
-
-#######################################################################
-# End of configurable section.
-# Do not edit after this line.
-#######################################################################
-
-# Where are we ?
-BASEDIR=$(shell pwd)
-ifeq ($(findstring :,$(BASEDIR)),)
-inlinux=1
+sharedinstall: testfpcmake
+	$(MAKE) -C $(OS_TARGET) sharedinstall
+
+libinstall: testfpcmake
+	$(MAKE) -C $(OS_TARGET) libinstall
+
+
+#####################################################################
+# Include default makefile
+#####################################################################
+
+# test if FPCMAKE is still valid
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
 endif
-ifeq ($(strip $(BASEDIR)),'')
-inlinux=
-BASEDIR:=.
 endif
 
-# Check operating system.
-ifeq ($(OS_SRC),linux)
-DOS=NO
-else
-DOS=YES
-# also redirect the standard error to the redir file
-ifdef REDIR
-PP:=redir -eo $(PP)
-# set the verbosity to max
-OPT:=$(OPT) -va
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
 endif
 endif
 
-# Check copy delete commands.
-# You need cp from GNU to handle / as directory separator
-COPY=cp -p
-DEL=rm
-
-# To install programs
-ifndef INSTALL
-ifeq ($(DOS),YES)
-INSTALL=cp
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
 else
-INSTALL=install
+FPCMAKE=makefile.fpc
 endif
 endif
 
-# To make a directory.
-ifndef MKDIR
-ifeq ($(DOS),YES)
-MKDIR=mkdir
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifeq ($(FPCMAKE),)
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@exit 1
 else
-MKDIR=install -m 755 -d
-endif
+include $(FPCMAKE)
+testfpcmake:
 endif
 
-# add target processor define to command line options
-OPT:=$(OPT) -d$(CPU)
 
-# Variables to export
-export OS_SRC DOS SEP PP OPT REDIR COPY DEL LIBINSTALLDIR INSTALL MKDIR \
-       REFPATH CPU PPUMOVE UNITINSTALLDIR
 
-.PHONY: native all linux win32 os2 go32v2 clean install
+#####################################################################
+# Dependencies
+#####################################################################
 
-native: $(OS_SRC)
+.PHONY: tests examples go32v2 linux os win32
 
-all: linux go32v2 win32 os2
+#
+# Examples
+#
+examples: tests
 
+tests: all
+	$(MAKE) -C tests all
 
+
+#
+# Specific OS
+#
 go32v2:
 	$(MAKE) -C go32v2
 
@@ -112,13 +132,9 @@ os2:
 win32:
 	$(MAKE) -C win32
 
-clean:
-	$(MAKE) -C inc clean
-	$(MAKE) -C i386 clean
-	$(MAKE) -C go32v2 clean
-	$(MAKE) -C linux clean
-	$(MAKE) -C os2 clean
-	$(MAKE) -C win32 clean
-
-install:
-	$(MAKE) -C $(OS_SRC) install
+#
+# $Log$
+# Revision 1.3  1999-04-08 10:18:47  peter
+#   * makefile updates
+#
+#

+ 97 - 70
fcl/go32v2/Makefile

@@ -1,102 +1,129 @@
-#######################################################################
-#   Makefile for Free Pascal
-#   (C) 1998 Michael van Canneyt
-#######################################################################
 #
-#  Configurable section
+#   $Id$
+#   Copyright (c) 1999 by the Free Pascal Development Team
+#
+#   Makefile for Free Component Library 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.
 #
 
-# What Compiler should we use ?
-PP=ppc386
 
-# Where are the Free Pascal units ? (Optional)
-#UNITDIR = c:/pp/units/dos/go32v2
+#####################################################################
+# Defaults
+#####################################################################
 
-# Processor you are using
-CPU=i386
-#CPU=m68k
+# Default place of the makefile.fpc
+DEFAULTFPCDIR=../..
 
-# Any options you wish to pass to the compiler
-OPT=
+# Include files
+INC=../inc
+PROCINC=../$(CPU)
 
-# Where to install the units ?
-UNITINSTALLDIR=c:/pp/units/fcl
+# Where to place the files
+TARGETDIR=.
 
-# Where to install the programs ?
-BININSTALLDIR=/pp/bin
+# We need always -S2
+NEEDOPT=-S2
 
-# Install program ?
-INSTALL=cp
+# As default make only the units
+DEFAULTUNITS=1
 
-# Mkdir program ?
-MKDIR=mkdir
 
-#######################################################################
-# End of configurable section. Do not edit below this line.
-#######################################################################
+#####################################################################
+# Real targets
+#####################################################################
 
-.SUFFIXES: .pp .ppu .pas
-.PHONY: all install clean units progs
+UNITOBJECTS=classes
+EXEOBJECTS=
 
-INCDIR=../inc
-CPUDIR=../$(CPU)
 
-include $(INCDIR)/Makefile.inc
+#####################################################################
+# Common targets
+#####################################################################
 
-# Set inc
-INCFILENAMES=$(addprefix $(INCDIR)/,$(INCNAMES))
+.PHONY: all clean install info \
+        staticlib sharedlib libsclean \
+        staticinstall sharedinstall libinstall \
+        
+all: testfpcmake fpc_all
 
-# If nothing special needs doing, then just fill in the names here.
-# The rest should be automatic.
-UNITNAMES=classes
-#PROGNAMES=
-UNITOBJECTS=$(addsuffix .o, $(UNITNAMES))
-UNITFILES=$(addsuffix .ppu, $(UNITNAMES))
-PROGSOURCES=$(addsiffix .pp, $(PROGNAMES))
-PROGOBJECTS=$(addsuffix .o, $(PROGNAMES))
+clean: testfpcmake fpc_clean
 
-# Adapt options. Add unit path if needed.
-override OPT:=$(OPT) -S2 -I$(INCDIR) -I$(CPUDIR)
+install: testfpcmake fpc_install
 
-ifdef UNITDIR
-override OPT:=$(OPT) -Up$(UNITDIR)
-endif
+info: testfpcmake fpc_info
 
+staticlib: testfpcmake fpc_staticlib
 
-# Default rule for units
-.pp.ppu:
-	$(PP) $(OPT) $<
+sharedlib: testfpcmake fpc_sharedlib
 
-# Default target.
-all: $(UNITFILES) $(PROGNAMES)
+libsclean: testfpcmake fpc_libsclean
 
-units: $(UNITFILES)
+staticinstall: testfpcmake fpc_staticinstall
 
-progs: $(PROGNAMES)
+sharedinstall: testfpcmake fpc_sharedinstall
 
-# Default rule for programs
-$(PROGNAMES): %:%.pp
-	$(PP) $(OPT) $<
+libinstall: testfpcmake fpc_libinstall
 
-classes.ppu: classes.pp $(INCFILENAMES) $(PROCFILENAMES)
 
-classes.pp:
-	cp $(INCDIR)/classes.pp .
+#####################################################################
+# Include default makefile
+#####################################################################
 
-#
-# Generic install and clean targets
-#
+# test if FPCMAKE is still valid
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
+endif
+endif
 
-install: all
-	$(MKDIR) $(UNITINSTALLDIR)
-ifdef UNITNAMES
-	$(INSTALL) $(UNITNAMES) $(UNITINSTALLDIR)
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
 endif
-ifdef PROGNAMES
-	$(INSTALL) $(PROGNAMES) $(BININSTALLDIR)
 endif
 
-clean:
-	rm -f $(UNITOBJECTS) $(UNITFILES) $(PROGNAMES) $(PROGOBJECTS)
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+else
+FPCMAKE=makefile.fpc
+endif
+endif
 
-# End of makefile.
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifeq ($(FPCMAKE),)
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@exit
+else
+include $(FPCMAKE)
+testfpcmake:
+endif
+
+
+
+#####################################################################
+# Dependencies
+#####################################################################
+
+vpath %$(PASEXT) $(INC)
+
+include $(INC)/Makefile.inc
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+#
+# $Log$
+# Revision 1.3  1999-04-08 10:18:48  peter
+#   * makefile updates
+#
+#

+ 0 - 92
fcl/go32v2/osfile.inc

@@ -1,92 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1998 by the Free Pascal development team
-
-    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 file implements the system-dependent calls needed for the
- classes unit.
-
-}
-
-Function OSCreateFile (Const Filename : string; Mode : Longint) : longint;
-{
-  Creates a file with name FileName, using mode MODE
-  --> Filename : String giving the path to the file.
-      Mode     : Mode can be
-                 fmCreate    : Create file;
-                 fmOpenRead  : open for reading;
-                 fmOpenWrite : open for writing;
-  <-- File Handle, or -1 on error.
-}
-begin
-end;
-
-Function OSReadHandle(Handle : Longint;Var Buffer; Count : Longint): Longint;
-{
-  Read from a handle
-  --> Handle : file,pipe,etc Handle to read from.
-      Buffer : Location where to put the read bytes.
-      Count  : Number of bytes that should be read
-  <-- Number of bytes actually read, or -1 on error.
-}
-
-begin
-end;
-
-Function OSWriteHandle(Handle : Longint;var Buffer; Count : longint) : Longint;
-{
-  Write to a handle
-  --> Handle : file,pipe,etc Handle to write to.
-      Buffer : Location where to get the bytes.
-      Count  : Number of bytes that should be written.
-  <-- Number of bytes actually written, or -1 on error.
-}
-begin
-end;
-
-
-Function OSSetHandleSize (Handle,Size : Longint) : longint;
-{
-  Set size of handle (for files only)
-  --> Handle : Handle to set size for.
-      Size   : Size to be set.
-  <-- 0 on success, or -1 on error.
-}
-begin
-end;
-
-Function OSSeekHandle (FHandle,OffSet,Origin : longint) : longint;
-{
-  Seek Handle position starting from Origin
-  --> Handle : Handle of file to do seek on.
-      Offset : Position to seek.
-      Origin : Where to start seek:
-               soFromBeginning
-               soFromCurrent
-               soFromEnd
-  <-- 0 on succes, -1 on error.
-}
-
-begin
-end;
-
-
-Function OSCloseHandle (Handle : longint) : longint;
-{
-  Close file associated with HAndle.
-  --> Handle : Handle of file to do seek on.
-  <-- 0 on succes, -1 on error.
-}
-
-begin
-end;

+ 13 - 78
fcl/inc/classes.inc

@@ -170,12 +170,14 @@ end;
 function FindClass(const ClassName: string): TPersistentClass;
 
 begin
+  FindClass:=nil;
 end;
 
 
 function GetClass(const ClassName: string): TPersistentClass;
 
 begin
+  GetClass:=nil;
 end;
 
 
@@ -216,42 +218,49 @@ end;
 function IdentToInt(const Ident: string; var Int: Longint; const Map: array of TIdentMapEntry): Boolean;
 
 begin
+  IdentToInt:=false;
 end;
 
 
 function IntToIdent(Int: Longint; var Ident: string; const Map: array of TIdentMapEntry): Boolean;
 
 begin
+  IntToIdent:=false;
 end;
 
 
 function InitInheritedComponent(Instance: TComponent; RootAncestor: TClass): Boolean;
 
 begin
+  InitInheritedComponent:=false;
 end;
 
 
 function InitComponentRes(const ResName: string; Instance: TComponent): Boolean;
 
 begin
+  InitComponentRes:=false;
 end;
 
 
 function ReadComponentRes(const ResName: string; Instance: TComponent): TComponent;
 
 begin
+  ReadComponentRes:=nil;
 end;
 
 
 function ReadComponentResEx(HInstance: THandle; const ResName: string): TComponent;
 
 begin
+  ReadComponentResEx:=nil;
 end;
 
 
 function ReadComponentResFile(const FileName: string; Instance: TComponent): TComponent;
 
 begin
+  ReadComponentResFile:=nil;
 end;
 
 
@@ -323,6 +332,7 @@ end;
 function CollectionsEqual(C1, C2: TCollection): Boolean;
 
 begin
+  CollectionsEqual:=false;
 end;
 
 
@@ -359,6 +369,7 @@ end;
 function LineStart(Buffer, BufPos: PChar): PChar;
 
 begin
+  LineStart:=nil;
 end;
 
 
@@ -366,83 +377,7 @@ end;
 
 {
   $Log$
-  Revision 1.8  1999-02-10 13:45:19  michael
-  + Added spanish language
-
-  Revision 1.7  1998/10/30 14:52:48  michael
-  + Added format in interface
-  + Some errors in parser fixed, it uses exceptions now
-  + Strings now has no more syntax errors.
-
-  Revision 1.6  1998/10/29 12:47:14  michael
-  + Implementation of tpoint by WYB
-
-  Revision 1.5  1998/09/23 08:41:55  michael
-  Added switch to select language
-
-  Revision 1.4  1998/09/23 07:47:40  michael
-  + Some changes by TSE
-
-  Revision 1.3  1998/06/03 15:10:20  michael
-  + added include of util.inc
-
-  Revision 1.2  1998/05/04 14:30:11  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
-
-  Revision 1.9  1998/05/04 12:16:01  florian
-    + Initial revisions after making a new directory structure
-
-  Revision 1.8  1998/05/04 11:20:13  florian
-    + Write* and Read* methods to TStream added
-    * small problems solved
-
-  Revision 1.7  1998/05/04 09:39:51  michael
-  + Started implementation of TList
-
-  Revision 1.6  1998/05/01 22:17:19  florian
-    + TBits implemented
-    + TStream partial implemented
-
-  Revision 1.5  1998/05/01 17:53:12  florian
-    * now it compiles with FPC
-
-  Revision 1.4  1998/04/28 11:47:00  florian
-    * more adaptions to FPC
-
-  Revision 1.3  1998/04/27 12:55:57  florian
-    + uses objpas added
-
-  Revision 1.2  1998/04/27 09:09:49  michael
-  + Added log at the end
-
-}
-
-{
-  $Log$
-  Revision 1.8  1999-02-10 13:45:19  michael
-  + Added spanish language
-
-  Revision 1.7  1998/10/30 14:52:48  michael
-  + Added format in interface
-  + Some errors in parser fixed, it uses exceptions now
-  + Strings now has no more syntax errors.
-
-  Revision 1.6  1998/10/29 12:47:14  michael
-  + Implementation of tpoint by WYB
-
-  Revision 1.5  1998/09/23 08:41:55  michael
-  Added switch to select language
-
-  Revision 1.4  1998/09/23 07:47:40  michael
-  + Some changes by TSE
-
-  Revision 1.3  1998/06/03 15:10:20  michael
-  + added include of util.inc
-
-  Revision 1.2  1998/05/04 14:30:11  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
-
-  Revision 1.1  1998/05/04 12:16:01  florian
-    + Initial revisions after making a new directory structure
+  Revision 1.9  1999-04-08 10:18:50  peter
+    * makefile updates
 
 }

+ 36 - 47
fcl/inc/compon.inc

@@ -16,7 +16,7 @@
 {*                             TComponent                                   *}
 {****************************************************************************}
 
-Type 
+Type
   Longrec = Record
     Hi,lo : word;
     end;
@@ -24,7 +24,7 @@ Type
 Function  TComponent.GetComponent(AIndex: Integer): TComponent;
 
 begin
-  If not assigned(FComponents) then 
+  If not assigned(FComponents) then
     Result:=Nil
   else
     Result:=TComponent(FComponents.Items[Aindex]);
@@ -34,8 +34,8 @@ end;
 Function  TComponent.GetComponentCount: Integer;
 
 begin
-  If not assigned(FComponents) then 
-    result:=0 
+  If not assigned(FComponents) then
+    result:=0
   else
     Result:=FComponents.Count;
 end;
@@ -47,7 +47,7 @@ begin
   If Assigned(FOwner) and Assigned(FOwner.FComponents) then
     Result:=FOWner.FComponents.IndexOf(Self)
   else
-    Result:=-1;   
+    Result:=-1;
 end;
 
 
@@ -79,10 +79,10 @@ Procedure TComponent.Remove(AComponent: TComponent);
 
 begin
   AComponent.FOwner:=Nil;
-  If assigned(FCOmponents) then 
+  If assigned(FCOmponents) then
     begin
     FComponents.Remove(AComponent);
-    IF FComponents.Count=0 then 
+    IF FComponents.Count=0 then
       begin
       FComponents.Free;
       FComponents:=Nil;
@@ -138,11 +138,11 @@ begin
 end;
 
 
-Procedure TComponent.DefineProperties(Filer: TFiler); 
+Procedure TComponent.DefineProperties(Filer: TFiler);
 
 Var Ancestor : TComponent;
     Temp : longint;
-    
+
 begin
   Temp:=0;
   Ancestor:=TComponent(Filer.Ancestor);
@@ -152,7 +152,7 @@ begin
                        (longrec(FDesignInfo).Lo<>Longrec(temp).Lo));
   Filer.Defineproperty('top',readtop,writetop,
                        (longrec(FDesignInfo).Hi<>Longrec(temp).Hi));
-}                      
+}
 end;
 
 
@@ -170,28 +170,28 @@ begin
 end;
 
 
-Function  TComponent.GetChildParent: TComponent; 
+Function  TComponent.GetChildParent: TComponent;
 
 begin
   Result:=Self;
 end;
 
 
-Function  TComponent.GetNamePath: string; 
+Function  TComponent.GetNamePath: string;
 
 begin
   Result:=FName;
 end;
 
 
-Function  TComponent.GetOwner: TPersistent; 
+Function  TComponent.GetOwner: TPersistent;
 
 begin
   Result:=FOwner;
 end;
 
 
-Procedure TComponent.Loaded; 
+Procedure TComponent.Loaded;
 
 begin
   Exclude(FComponentState,csLoading);
@@ -204,7 +204,7 @@ Procedure TComponent.Notification(AComponent: TComponent;
 Var Runner : Longint;
 
 begin
-  If (Operation=opRemove) and Assigned(FFreeNotifies) then 
+  If (Operation=opRemove) and Assigned(FFreeNotifies) then
     begin
     FFreeNotifies.Remove(AComponent);
     If FFreeNotifies.Count=0 then
@@ -219,7 +219,7 @@ begin
 end;
 
 
-Procedure TComponent.ReadState(Reader: TReader); 
+Procedure TComponent.ReadState(Reader: TReader);
 
 begin
   Reader.ReadData(Self);
@@ -231,7 +231,7 @@ Procedure TComponent.SetAncestor(Value: Boolean);
 Var Runner : Longint;
 
 begin
-  If Value then 
+  If Value then
     Include(FComponentState,csAncestor)
   else
     Include(FCOmponentState,csAncestor);
@@ -256,7 +256,7 @@ begin
 end;
 
 
-Procedure TComponent.SetName(const NewName: TComponentName); 
+Procedure TComponent.SetName(const NewName: TComponentName);
 
 begin
   If FName=NewName then exit;
@@ -286,21 +286,21 @@ begin
 end;
 
 
-Procedure TComponent.Updating; 
+Procedure TComponent.Updating;
 
 begin
   Include (FComponentState,csUpdating);
 end;
 
 
-Procedure TComponent.Updated; 
+Procedure TComponent.Updated;
 
 begin
   Exclude(FComponentState,csUpdating);
 end;
 
 
-class Procedure TComponent.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); 
+class Procedure TComponent.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string);
 
 begin
   // For compatibility only.
@@ -308,11 +308,11 @@ end;
 
 
 Procedure TComponent.ValidateRename(AComponent: TComponent;
-  const CurName, NewName: string); 
+  const CurName, NewName: string);
 
 begin
 //!! This contradicts the Delphi manual.
-  If (AComponent<>Nil) and (CurName=NewName) and 
+  If (AComponent<>Nil) and (CurName=NewName) and
      (FindComponent(NewName)<>Nil) then
       raise EComponentError.Createfmt(SDuplicateName,[newname]);
   If (csDesigning in FComponentState) and (FOwner<>Nil) then
@@ -320,27 +320,27 @@ begin
 end;
 
 
-Procedure TComponent.ValidateContainer(AComponent: TComponent); 
+Procedure TComponent.ValidateContainer(AComponent: TComponent);
 
 begin
 end;
 
 
-Procedure TComponent.ValidateInsert(AComponent: TComponent); 
+Procedure TComponent.ValidateInsert(AComponent: TComponent);
 
 begin
   // Does nothing.
 end;
 
 
-Procedure TComponent.WriteState(Writer: TWriter); 
+Procedure TComponent.WriteState(Writer: TWriter);
 
 begin
   Writer.WriteData(self);
 end;
 
 
-Constructor TComponent.Create(AOwner: TComponent); 
+Constructor TComponent.Create(AOwner: TComponent);
 
 begin
   FComponentStyle:=[csInheritable];
@@ -348,7 +348,7 @@ begin
 end;
 
 
-Destructor TComponent.Destroy; 
+Destructor TComponent.Destroy;
 
 Var Runner : Longint;
 
@@ -372,7 +372,7 @@ Procedure TComponent.DestroyComponents;
 Var acomponent: TComponent;
 
 begin
-  While assigned(FComponents) do 
+  While assigned(FComponents) do
     begin
     aComponent:=TComponent(FComponents.Last);
     Remove(aComponent);
@@ -414,7 +414,7 @@ Procedure TComponent.FreeNotification(AComponent: TComponent);
 
 begin
   If (Owner<>Nil) and (AComponent=Owner) then exit;
-  If not (Assigned(FFreeNotifies)) then 
+  If not (Assigned(FFreeNotifies)) then
     FFreeNotifies:=TList.Create;
   If FFreeNotifies.IndexOf(AComponent)=-1 then
     begin
@@ -431,14 +431,14 @@ begin
 end;
 
 
-Function  TComponent.GetParentComponent: TComponent; 
+Function  TComponent.GetParentComponent: TComponent;
 
 begin
   Result:=Nil;
 end;
 
 
-Function  TComponent.HasParent: Boolean; 
+Function  TComponent.HasParent: Boolean;
 
 begin
   Result:=False;
@@ -470,26 +470,15 @@ end;
 
 
 Function  TComponent.SafeCallException(ExceptObject: TObject;
-  ExceptAddr: Pointer): Integer; 
+  ExceptAddr: Pointer): Integer;
 
 begin
+  SafeCallException:=0;
 end;
 
 {
   $Log$
-  Revision 1.5  1998-10-02 22:41:25  michael
-  + Added exceptions for error handling
-
-  Revision 1.4  1998/08/24 12:37:44  michael
-  small fixes
-
-  Revision 1.3  1998/08/23 21:11:03  michael
-  + Fixed some small errors
-
-  Revision 1.2  1998/08/22 10:41:35  michael
-  + Initial implementation
-
-  Revision 1.1  1998/05/04 14:30:11  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.6  1999-04-08 10:18:51  peter
+    * makefile updates
 
 }

+ 27 - 39
fcl/inc/lists.inc

@@ -22,14 +22,14 @@
     FCount: Integer;
     FCapacity: Integer;
 }
-Const 
+Const
   // Ratio of Pointer and Word Size.
   WordRatio = SizeOf(Pointer) Div SizeOf(Word);
 
 function TList.Get(Index: Integer): Pointer;
 
 begin
-  If (Index<0) or (Index>FCount) then 
+  If (Index<0) or (Index>FCount) then
     Error(SListIndexError,Index);
   Result:=FList^[Index];
 end;
@@ -47,7 +47,7 @@ end;
 procedure TList.Put(Index: Integer; Item: Pointer);
 
 begin
-  if (Index<0) or (Index>=FCount) then 
+  if (Index<0) or (Index>=FCount) then
     Error(SListIndexError,Index);
   Flist^[Index]:=Item;
 end;
@@ -57,10 +57,10 @@ end;
 procedure TList.SetCapacity(NewCapacity: Integer);
 
 Var NewList,ToFree : PPointerList;
-    
+
 begin
-  If (NewCapacity<0) or (NewCapacity>MaxListSize) then 
-     Error (SListCapacityError,NewCapacity); 
+  If (NewCapacity<0) or (NewCapacity>MaxListSize) then
+     Error (SListCapacityError,NewCapacity);
   If NewCapacity>FCapacity then
     begin
     GetMem (NewList,NewCapacity*SizeOf(Pointer));
@@ -95,14 +95,14 @@ begin
     Error(SListCountError,NewCount);
   If NewCount<FCount then
     FCount:=NewCount
-  else If NewCount>FCount then 
+  else If NewCount>FCount then
     begin
-    If NewCount>FCapacity then 
+    If NewCount>FCapacity then
       SetCapacity (NewCount);
-    If FCount<NewCount then 
+    If FCount<NewCount then
       FillWord (Flist^[FCount],(NewCount-FCount)* WordRatio ,0);
     FCount:=Newcount;
-    end;   
+    end;
 end;
 
 
@@ -132,7 +132,7 @@ begin
     FreeMem (Flist,FCapacity*SizeOf(Pointer));
     FList:=Nil;
     FCapacity:=0;
-    FCount:=0;    
+    FCount:=0;
     end;
 end;
 
@@ -177,7 +177,7 @@ Var IncSize : Longint;
 
 begin
   if FCount<FCapacity then exit;
-  IncSize:=4;   
+  IncSize:=4;
   if FCapacity>3 then IncSize:=IncSize+4;
   if FCapacity>8 then IncSize:=IncSize+8;
   SetCapacity(FCapacity+IncSize);
@@ -210,7 +210,7 @@ begin
   If (Index<0) or (Index>FCount )then
     Error(SlistIndexError,Index);
   IF FCount=FCapacity Then Self.Expand;
-  If Index<FCount then 
+  If Index<FCount then
     System.Move (Flist^[Index],Flist^[Index+1],(FCount-Index)*SizeOf(Pointer));
   FList^[Index]:=Item;
   FCount:=FCount+1;
@@ -220,10 +220,8 @@ end;
 
 function TList.Last: Pointer;
 
-Var I : longint;
-
 begin
-  // Wouldn't it be better to return nil if the count is zero ? 
+  // Wouldn't it be better to return nil if the count is zero ?
   Result:=Items[FCount-1];
 end;
 
@@ -235,7 +233,7 @@ Var Temp : Pointer;
 begin
   If ((CurIndex<0) or (CurIndex>Count-1)) then
     Error(SListIndexError,CurIndex);
-  If (NewINdex<0) then 
+  If (NewINdex<0) then
     Error(SlistIndexError,NewIndex);
   Temp:=FList^[CurIndex];
   Self.Delete(CurIndex);
@@ -258,10 +256,10 @@ end;
 Procedure TList.Pack;
 
 Var  {Last,I,J,}Runner : Longint;
-            
+
 begin
   // Not the fastest; but surely correct
-  For Runner:=Fcount-1 downto 0 do 
+  For Runner:=Fcount-1 downto 0 do
     if Items[Runner]=Nil then Self.Delete(Runner);
 { The following may be faster in case of large and defragmented lists
   If count=0 then exit;
@@ -285,8 +283,8 @@ begin
       // Update Runner and Last to point behind last block
       TheLast:=Runner+(J-I);
       If J=Count then
-         begin 
-         // Shortcut, when J=Count we checked all pointers 
+         begin
+         // Shortcut, when J=Count we checked all pointers
          Runner:=Count
       else
          begin
@@ -314,7 +312,7 @@ begin
    repeat
      While Compare(P,FList^[i])>0 Do I:=I+1;
      While Compare(P,FList^[J])<0 Do J:=J-1;
-     If I<=J then 
+     If I<=J then
        begin
        Q:=Flist^[I];
        Flist^[I]:=FList^[J];
@@ -325,7 +323,7 @@ begin
    Until I>J;
    If L<J then QuickSort (FList,L,J,Compare);
    L:=I;
- Until I>=R; 
+ Until I>=R;
 end;
 
 procedure TList.Sort(Compare: TListSortCompare);
@@ -346,8 +344,8 @@ begin
 end;
 
 
-    
-destructor TThreadList.Destroy; 
+
+destructor TThreadList.Destroy;
 
 begin
 end;
@@ -369,7 +367,9 @@ end;
 
 function TThreadList.LockList: TList;
 
+
 begin
+  LockList:=nil;
 end;
 
 
@@ -390,19 +390,7 @@ end;
 
 {
   $Log$
-  Revision 1.5  1998-10-02 22:41:27  michael
-  + Added exceptions for error handling
-
-  Revision 1.4  1998/05/06 07:27:22  michael
-  + Fixec index check in exchange method.
-
-  Revision 1.3  1998/05/05 15:54:31  michael
-  TList completely implemented
-
-  Revision 1.2  1998/05/04 15:54:07  michael
-  + Partial implementation of TList
-
-  Revision 1.1  1998/05/04 14:30:12  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.6  1999-04-08 10:18:52  peter
+    * makefile updates
 
 }

+ 18 - 38
fcl/inc/parser.inc

@@ -11,12 +11,11 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
  **********************************************************************}
+
 {****************************************************************************}
 {*                             TParser                                      *}
 {****************************************************************************}
 
-{!!!TSE 21.09.1998 Changed by Thomas Seban (TSE) }
-
 const
   ParseBufSize     = 4096;
 
@@ -26,6 +25,7 @@ end;
 
 function HexToBin(Text, Buffer: PChar; BufSize: Integer) : Integer;
 begin
+  HexToBin:=0;
 end;
 
 procedure TParser.ReadBuffer;
@@ -36,20 +36,20 @@ begin
 
   FSourceEnd[0] := FSaveChar;
   Count         := FBufPtr - FSourcePtr;
-  if Count <> 0 then 
+  if Count <> 0 then
   begin
     Move(FSourcePtr[0], FBuffer[0], Count);
   end;
-  
+
   FBufPtr := FBuffer + Count;
   Inc(FBufPtr, FStream.Read(FBufPtr[0], FBufEnd - FBufPtr));
-  
+
   FSourcePtr := FBuffer;
   FSourceEnd := FBufPtr;
   if (FSourceEnd = FBufEnd) then
   begin
     FSourceEnd := LineStart(FBuffer, FSourceEnd - 1);
-    if FSourceEnd = FBuffer then 
+    if FSourceEnd = FBuffer then
     begin
       Error(SLineTooLong);
     end;
@@ -83,10 +83,10 @@ end;
 constructor TParser.Create(Stream: TStream);
 begin
   inherited Create;
-  
+
   FStream := Stream;
   GetMem(FBuffer, ParseBufSize);
-  
+
   FBuffer[0]  := #0;
   FBufPtr     := FBuffer;
   FBufEnd     := FBuffer + ParseBufSize;
@@ -94,7 +94,7 @@ begin
   FSourceEnd  := FBuffer;
   FTokenPtr   := FBuffer;
   FSourceLine := 1;
-  
+
   NextToken;
 end;
 
@@ -106,13 +106,13 @@ begin
     FStream.Seek(Longint(FTokenPtr) - Longint(FBufPtr), 1);
     FreeMem(FBuffer, ParseBufSize);
   end;
-  
+
   inherited Destroy;
 end;
 
 procedure TParser.CheckToken(T : Char);
 begin
-  if Token <> T then 
+  if Token <> T then
   begin
     case T of
       toSymbol:
@@ -129,7 +129,7 @@ end;
 
 procedure TParser.CheckTokenSymbol(const S: string);
 begin
-  if not TokenSymbolIs(S) then 
+  if not TokenSymbolIs(S) then
     ErrorFmt(SSymbolExpected, [S]);
 end;
 
@@ -205,7 +205,7 @@ begin
                 while True do
                 begin
                   case P^ of
-                    #0, #10, #13: 
+                    #0, #10, #13:
                       Error(SInvalidString);
                     '''':
                       begin
@@ -281,13 +281,7 @@ var
   Back             : Real;
 begin
   Result   := 0;
-
-  // doesn't work, overload function not found
-  // systemh.inc compiled without -S2 switch => SizeOf(Integer) = 2
-  // classes.pp compiled with -S2 switch => SizeOf(Integer) = 4
-  // Val(TokenString, Back, FloatError); 
-  
-  Val(TokenString, Back); // this works fine
+  Val(TokenString, Back, FloatError);
   Result := Back;
 end;
 
@@ -302,11 +296,11 @@ var
   StrBuf           : array[0..1023] of Char;
 begin
   if FToken = toString then begin
-    L := FStringPtr - FTokenPtr 
+    L := FStringPtr - FTokenPtr
   end else begin
     L := FSourcePtr - FTokenPtr;
   end;
-  
+
   StrLCopy(StrBuf, FTokenPtr, L);
   Result := StrPas(StrBuf);
 end;
@@ -317,21 +311,7 @@ begin
 end;
 {
   $Log$
-  Revision 1.5  1999-01-28 23:55:41  florian
-    * made it compilable
-
-  Revision 1.4  1998/10/30 14:52:51  michael
-  + Added format in interface
-  + Some errors in parser fixed, it uses exceptions now
-  + Strings now has no more syntax errors.
-
-  Revision 1.3  1998/10/02 22:41:28  michael
-  + Added exceptions for error handling
-
-  Revision 1.2  1998/09/23 07:48:11  michael
-  + Implemented by TSE
-
-  Revision 1.1  1998/05/04 14:30:12  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.6  1999-04-08 10:18:53  peter
+    * makefile updates
 
 }

+ 28 - 11
fcl/inc/reader.inc

@@ -39,6 +39,7 @@ end;
 Function TReader.GetPosition: Longint;
 
 begin
+  GetPosition:=0;
 end;
 
 
@@ -88,6 +89,7 @@ end;
 Function TReader.ReadSet(SetType: Pointer): Integer;
 
 begin
+  ReadSet:=0;
 end;
 
 
@@ -127,28 +129,30 @@ end;
 
 
 
-Function TReader.Error(const Message: string): Boolean; 
+Function TReader.Error(const Message: string): Boolean;
 
 begin
+  Error:=false;
 end;
 
 
 
-Function TReader.FindMethod(Root: TComponent; const MethodName: string): Pointer; 
+Function TReader.FindMethod(Root: TComponent; const MethodName: string): Pointer;
 
 begin
+  FindMethod:=nil;
 end;
 
 
 
-Procedure TReader.SetName(Component: TComponent; var Name: string); 
+Procedure TReader.SetName(Component: TComponent; var Name: string);
 
 begin
 end;
 
 
 
-Procedure TReader.ReferenceName(var Name: string); 
+Procedure TReader.ReferenceName(var Name: string);
 
 begin
 end;
@@ -156,14 +160,15 @@ end;
 
 
 Function TReader.FindAncestorComponent(const Name: string;
-  ComponentClass: TPersistentClass): TComponent; 
+  ComponentClass: TPersistentClass): TComponent;
 
 begin
+  FindAncestorComponent:=nil;
 end;
 
 
 
-destructor TReader.Destroy; 
+destructor TReader.Destroy;
 
 begin
 end;
@@ -179,7 +184,7 @@ end;
 
 Procedure TReader.DefineProperty(const Name: string;
   rd : TReaderProc; wd : TWriterProc;
-  HasData: Boolean); 
+  HasData: Boolean);
 
 begin
 end;
@@ -188,7 +193,7 @@ end;
 
 Procedure TReader.DefineBinaryProperty(const Name: string;
   rd, wd: TStreamProc;
-  HasData: Boolean); 
+  HasData: Boolean);
 
 begin
 end;
@@ -198,6 +203,7 @@ end;
 Function TReader.EndOfList: Boolean;
 
 begin
+  EndOfList:=false;
 end;
 
 
@@ -216,7 +222,7 @@ end;
 
 
 
-Procedure TReader.FlushBuffer; 
+Procedure TReader.FlushBuffer;
 
 begin
 end;
@@ -226,6 +232,7 @@ end;
 Function TReader.NextValue: TValueType;
 
 begin
+  NextValue:=vaNull;
 end;
 
 
@@ -240,6 +247,7 @@ end;
 Function TReader.ReadBoolean: Boolean;
 
 begin
+  ReadBoolean:=false;
 end;
 
 
@@ -247,6 +255,7 @@ end;
 Function TReader.ReadChar: Char;
 
 begin
+  ReadChar:=#0;
 end;
 
 
@@ -261,6 +270,7 @@ end;
 Function TReader.ReadComponent(Component: TComponent): TComponent;
 
 begin
+  ReadComponent:=nil;
 end;
 
 
@@ -276,6 +286,7 @@ end;
 Function TReader.ReadFloat: Extended;
 
 begin
+  ReadFloat:=0.0;
 end;
 
 
@@ -283,6 +294,7 @@ end;
 Function TReader.ReadIdent: string;
 
 begin
+  ReadIdent:='';
 end;
 
 
@@ -290,6 +302,7 @@ end;
 Function TReader.ReadInteger: Longint;
 
 begin
+  ReadInteger:=0;
 end;
 
 
@@ -318,6 +331,7 @@ end;
 Function TReader.ReadRootComponent(Root: TComponent): TComponent;
 
 begin
+  ReadRootComponent:=nil;
 end;
 
 
@@ -332,6 +346,7 @@ end;
 Function TReader.ReadStr: string;
 
 begin
+  ReadStr:='';
 end;
 
 
@@ -339,6 +354,7 @@ end;
 Function TReader.ReadString: string;
 
 begin
+  ReadString:='';
 end;
 
 
@@ -346,6 +362,7 @@ end;
 Function TReader.ReadValue: TValueType;
 
 begin
+  ReadValue:=vaNull;
 end;
 
 
@@ -356,7 +373,7 @@ begin
 end;
 {
   $Log$
-  Revision 1.1  1998-05-04 14:30:12  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.2  1999-04-08 10:18:54  peter
+    * makefile updates
 
 }

+ 17 - 47
fcl/inc/streams.inc

@@ -102,6 +102,7 @@
 
     begin
        {!!!!!}
+       ReadComponentRes:=nil;
     end;
 
   procedure TStream.WriteComponent(Instance: TComponent);
@@ -130,7 +131,7 @@
        { Application defined data }
        WriteWord($0a);
        { write the name as asciiz }
-      // WriteBuffer(ResName[1],length(ResName));
+//       WriteBuffer(ResName[1],length(ResName));
        WriteByte(0);
        { Movable, Pure and Discardable }
        WriteWord($1030);
@@ -223,7 +224,7 @@
 
     Var TheSize : Longint;
         P : PByte ;
-  
+
 
   begin
     ReadBuffer (TheSize,SizeOf(TheSize));
@@ -235,7 +236,7 @@
     end;
 
   Procedure TStream.WriteAnsiString (S : String);
-  
+
   Var L : Longint;
 
   begin
@@ -304,7 +305,7 @@ begin
   else
     FHAndle:=FileOpen(FileName,Mode);
   If FHandle<0 then
-    If Mode=fmcreate then    
+    If Mode=fmcreate then
       raise EFCreateError.createfmt(SFCreateError,[FileName])
     else
       raise EFOpenError.Createfmt(SFOpenError,[Filename]);
@@ -466,7 +467,7 @@ begin
   Try
     S:=TFileStream.Create (FileName,fmOpenRead);
     LoadFromStream(S);
-  finally 
+  finally
     S.free;
   end;
 end;
@@ -481,7 +482,7 @@ begin
 end;
 
 
-function TMemoryStream.Write(const Buffer; Count: Longint): Longint; 
+function TMemoryStream.Write(const Buffer; Count: Longint): Longint;
 
 Var NewPos : Longint;
 
@@ -505,7 +506,7 @@ end;
 {*                             TStringStream                                *}
 {****************************************************************************}
 
-procedure TStringStream.SetSize(NewSize: Longint); 
+procedure TStringStream.SetSize(NewSize: Longint);
 
 begin
  //!! Setlength(FDataString,NewSize);
@@ -521,7 +522,7 @@ begin
 end;
 
 
-function TStringStream.Read(var Buffer; Count: Longint): Longint; 
+function TStringStream.Read(var Buffer; Count: Longint): Longint;
 
 begin
   Result:=Length(FDataString)-FPosition;
@@ -541,10 +542,11 @@ begin
   If NewLen>Count then NewLen:=Count;
   //!! SetLength(Result,NewLen);
   //!! Read (Pointer(Result)^,NewLen);
+  ReadString:='';
 end;
 
 
-function TStringStream.Seek(Offset: Longint; Origin: Word): Longint; 
+function TStringStream.Seek(Offset: Longint; Origin: Word): Longint;
 
 begin
   Case Origin of
@@ -558,7 +560,7 @@ begin
 end;
 
 
-function TStringStream.Write(const Buffer; Count: Longint): Longint; 
+function TStringStream.Write(const Buffer; Count: Longint): Longint;
 
 begin
   Result:=Count;
@@ -599,54 +601,22 @@ begin
 end;
 
 
-destructor TResourceStream.Destroy; 
+destructor TResourceStream.Destroy;
 
 begin
 end;
 
 
-function TResourceStream.Write(const Buffer; Count: Longint): Longint; 
+function TResourceStream.Write(const Buffer; Count: Longint): Longint;
 
 begin
+  Write:=0;
 end;
 
 
 {
   $Log$
-  Revision 1.12  1999-02-10 14:12:26  michael
-  + Some strange bug in writecoponentres
-
-  Revision 1.11  1999/02/06 07:16:48  michael
-  + Fixed Stream.ReadAnsiString
-
-  Revision 1.10  1999/02/02 21:23:19  michael
-  + only sysutils is used now
-
-  Revision 1.9  1999/01/28 23:55:42  florian
-    * made it compilable
-
-  Revision 1.8  1998/10/02 22:41:30  michael
-  + Added exceptions for error handling
-
-  Revision 1.7  1998/08/24 12:38:24  michael
-  small fixes
-
-  Revision 1.6  1998/06/11 21:15:28  michael
-  + Implemented (Custom)Memory and StringStream
-
-  Revision 1.5  1998/06/11 13:46:33  michael
-  + Fixed some functions. TFileStream OK.
-
-  Revision 1.4  1998/06/10 21:53:07  michael
-  + Implemented Handle/FileStreams
-
-  Revision 1.3  1998/05/06 12:58:35  michael
-  + Added WriteAnsiString method to TStream
-
-  Revision 1.2  1998/05/05 15:25:04  michael
-  + Fix to be able to compile from florian
-
-  Revision 1.1  1998/05/04 14:30:12  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.13  1999-04-08 10:18:55  peter
+    * makefile updates
 
 }

+ 83 - 122
fcl/inc/strings.inc

@@ -32,7 +32,7 @@ begin
    begin
    I:=I+1;
    J:=J+1;
-   if S[i]=Quote then 
+   if S[i]=Quote then
      begin
      System.Insert(Result,Quote,J);
      J:=J+1;
@@ -47,7 +47,7 @@ Var I : Longint;
 
 begin
   result:='';
-  For i:=0 to count-1 do 
+  For i:=0 to count-1 do
     begin
     Result:=Result+QuoteString (Strings[I],'"');
     if I<Count-1 then Result:=Result+',';
@@ -103,14 +103,14 @@ begin
   P1:=P+1;
   While P1^<>#0 do
     begin
-    If (P1^='"') and (P1[1]<>'"') then 
+    If (P1^='"') and (P1[1]<>'"') then
       break;
     P1:=P1+1;
     If P1^='"' then P1:=P1+1;
     end;
-  // P1 points to last quote, or to #0; 
+  // P1 points to last quote, or to #0;
   P:=P+1;
-  If P1-P>0 then 
+  If P1-P>0 then
     begin
     SetLength(Result,(P1-P));
     L:=Pointer(Result);
@@ -184,7 +184,7 @@ end;
 
 
 
-Procedure TStrings.DefineProperties(Filer: TFiler); 
+Procedure TStrings.DefineProperties(Filer: TFiler);
 
 begin
 end;
@@ -200,7 +200,7 @@ end;
 
 
 
-Function TStrings.GetCapacity: Integer; 
+Function TStrings.GetCapacity: Integer;
 
 begin
   Result:=Count;
@@ -208,7 +208,7 @@ end;
 
 
 
-Function TStrings.GetObject(Index: Integer): TObject; 
+Function TStrings.GetObject(Index: Integer): TObject;
 
 begin
   Result:=Nil;
@@ -216,7 +216,7 @@ end;
 
 
 
-Function TStrings.GetTextStr: string; 
+Function TStrings.GetTextStr: string;
 
 Const
 {$ifdef linux}
@@ -226,21 +226,20 @@ Const
 {$endif}
 
 Var P : Pchar;
-    I,L : Longint; 
+    I,L : Longint;
     S : String;
-    PS : Pointer;
 
 begin
   // Determine needed place
   L:=0;
   For I:=0 to count-1 do L:=L+Length(Strings[I])+NewLineSize;
   Setlength(Result,L);
-  P:=Pointer(Result); 
+  P:=Pointer(Result);
   For i:=0 To count-1 do
     begin
     S:=Strings[I];
     L:=Length(S);
-    if L<>0 then 
+    if L<>0 then
       System.Move(Pointer(S)^,P^,L);
     P:=P+L;
 {$ifndef linux}
@@ -255,7 +254,7 @@ end;
 
 
 
-Procedure TStrings.Put(Index: Integer; const S: string); 
+Procedure TStrings.Put(Index: Integer; const S: string);
 
 Var Obj : TObject;
 
@@ -267,7 +266,7 @@ end;
 
 
 
-Procedure TStrings.PutObject(Index: Integer; AObject: TObject); 
+Procedure TStrings.PutObject(Index: Integer; AObject: TObject);
 
 begin
   // Empty.
@@ -275,14 +274,14 @@ end;
 
 
 
-Procedure TStrings.SetCapacity(NewCapacity: Integer); 
+Procedure TStrings.SetCapacity(NewCapacity: Integer);
 
 begin
   // Empty.
 end;
 
 
-Procedure TStrings.SetTextStr(const Value: string); 
+Procedure TStrings.SetTextStr(const Value: string);
 
 begin
   SetText(PChar(Value));
@@ -290,14 +289,14 @@ end;
 
 
 
-Procedure TStrings.SetUpdateState(Updating: Boolean); 
+Procedure TStrings.SetUpdateState(Updating: Boolean);
 
 begin
 end;
 
 
 
-destructor TSTrings.Destroy; 
+destructor TSTrings.Destroy;
 
 begin
   inherited destroy;
@@ -305,7 +304,7 @@ end;
 
 
 
-Function TStrings.Add(const S: string): Integer; 
+Function TStrings.Add(const S: string): Integer;
 
 begin
   Result:=Count;
@@ -314,7 +313,7 @@ end;
 
 
 
-Function TStrings.AddObject(const S: string; AObject: TObject): Integer; 
+Function TStrings.AddObject(const S: string; AObject: TObject): Integer;
 
 begin
   Result:=Add(S);
@@ -331,7 +330,7 @@ end;
 
 
 
-Procedure TStrings.AddStrings(TheStrings: TStrings); 
+Procedure TStrings.AddStrings(TheStrings: TStrings);
 
 Var Runner : longint;
 
@@ -342,7 +341,7 @@ end;
 
 
 
-Procedure TStrings.Assign(Source: TPersistent); 
+Procedure TStrings.Assign(Source: TPersistent);
 
 begin
   If Source is TStrings then
@@ -378,14 +377,14 @@ begin
   Result:=False;
   Nr:=Self.Count;
   if Nr<>TheStrings.Count then exit;
-  For Runner:=0 to Nr-1 do 
+  For Runner:=0 to Nr-1 do
     If Strings[Runner]<>TheStrings[Runner] then exit;
   Result:=True;
 end;
 
 
 
-Procedure TStrings.Exchange(Index1, Index2: Integer); 
+Procedure TStrings.Exchange(Index1, Index2: Integer);
 
 Var
   Obj : TObject;
@@ -402,7 +401,7 @@ end;
 
 
 
-Function TStrings.GetText: PChar; 
+Function TStrings.GetText: PChar;
 
 begin
   Result:=StrNew(Pchar(Self.Text));
@@ -410,7 +409,7 @@ end;
 
 
 
-Function TStrings.IndexOf(const S: string): Integer; 
+Function TStrings.IndexOf(const S: string): Integer;
 
 
 begin
@@ -433,7 +432,7 @@ begin
     if (len>0) and (Name=Copy(Strings[Result],1,Len)) then exit;
     inc(result);
     end;
-  result:=-1; 
+  result:=-1;
 end;
 
 
@@ -458,7 +457,7 @@ end;
 
 
 
-Procedure TStrings.LoadFromFile(const FileName: string); 
+Procedure TStrings.LoadFromFile(const FileName: string);
 
 Var TheStream : TFileStream;
 
@@ -470,18 +469,18 @@ end;
 
 
 
-Procedure TStrings.LoadFromStream(Stream: TStream); 
+Procedure TStrings.LoadFromStream(Stream: TStream);
 {
-   Borlands method is no goed, since a pipe for 
-   Instance doesn't have a size. 
+   Borlands method is no goed, since a pipe for
+   Instance doesn't have a size.
    So we must do it the hard way.
 }
 Const BufSize = 1024;
 
   Procedure ReallocMem (Var B : Pointer; OldSize :longint);
-  
+
   Var NewB : Pointer;
-  
+
   begin
     GetMem(NewB,OldSIze+BufSize);
     If OldSize>0 then // assume that if size=0, B also Nil
@@ -512,7 +511,7 @@ end;
 
 
 
-Procedure TStrings.Move(CurIndex, NewIndex: Integer); 
+Procedure TStrings.Move(CurIndex, NewIndex: Integer);
 
 Var Obj : TObject;
     Str : String;
@@ -521,12 +520,12 @@ begin
    Obj:=Objects[CurIndex];
    Str:=Strings[CurIndex];
    Delete(Curindex);
-   InsertObject(NewIndex,Str,Obj);  
+   InsertObject(NewIndex,Str,Obj);
 end;
 
 
 
-Procedure TStrings.SaveToFile(const FileName: string); 
+Procedure TStrings.SaveToFile(const FileName: string);
 
 Var TheStream : TFileStream;
 
@@ -538,7 +537,7 @@ end;
 
 
 
-Procedure TStrings.SaveToStream(Stream: TStream); 
+Procedure TStrings.SaveToStream(Stream: TStream);
 
 VAr S : String;
 
@@ -565,13 +564,13 @@ begin
 end;
 
 
-Procedure TStrings.SetText(TheText: PChar); 
+Procedure TStrings.SetText(TheText: PChar);
 
 Var S : String;
-    
+
 begin
   Clear;
-  While GetNextLine (TheText,S) do 
+  While GetNextLine (TheText,S) do
     Add(S);
 end;
 
@@ -604,11 +603,11 @@ Var Extra : Longint;
 begin
   If FCapacity>64 then
     Extra:=FCapacity Div 4
-  Else If FCapacity>8 Then 
+  Else If FCapacity>8 Then
     Extra:=16
-  Else 
+  Else
     Extra:=4;
-  SetCapacity(FCapacity+Extra); 
+  SetCapacity(FCapacity+Extra);
 end;
 
 
@@ -626,7 +625,7 @@ begin
     Repeat
       While AnsiCompareText(Flist^[I].Fstring,Pivot)<0 do Inc(I);
       While AnsiCompareText(Flist^[J].Fstring,Pivot)>0 do Dec(J);
-      If I<=J then 
+      If I<=J then
         begin
         ExchangeItems(I,J); // No check, indices are correct.
         Inc(I);
@@ -668,7 +667,7 @@ end;
 
 
 
-Procedure TStringList.Changed; 
+Procedure TStringList.Changed;
 
 begin
   If (FUpdateCount=0) Then
@@ -678,7 +677,7 @@ end;
 
 
 
-Procedure TStringList.Changing; 
+Procedure TStringList.Changing;
 
 begin
   If FUpdateCount=0 then
@@ -688,7 +687,7 @@ end;
 
 
 
-Function TStringList.Get(Index: Integer): string; 
+Function TStringList.Get(Index: Integer): string;
 
 begin
   If (Index<0) or (INdex>=Fcount)  then
@@ -698,7 +697,7 @@ end;
 
 
 
-Function TStringList.GetCapacity: Integer; 
+Function TStringList.GetCapacity: Integer;
 
 begin
   Result:=FCapacity;
@@ -706,7 +705,7 @@ end;
 
 
 
-Function TStringList.GetCount: Integer; 
+Function TStringList.GetCount: Integer;
 
 begin
   Result:=FCount;
@@ -714,7 +713,7 @@ end;
 
 
 
-Function TStringList.GetObject(Index: Integer): TObject; 
+Function TStringList.GetObject(Index: Integer): TObject;
 
 begin
   If (Index<0) or (INdex>=Fcount)  then
@@ -724,10 +723,10 @@ end;
 
 
 
-Procedure TStringList.Put(Index: Integer; const S: string); 
+Procedure TStringList.Put(Index: Integer; const S: string);
 
 begin
-  If Sorted then 
+  If Sorted then
     Error(SSortedListError,0);
   If (Index<0) or (INdex>=Fcount)  then
     Error (SListIndexError,Index);
@@ -738,26 +737,26 @@ end;
 
 
 
-Procedure TStringList.PutObject(Index: Integer; AObject: TObject); 
+Procedure TStringList.PutObject(Index: Integer; AObject: TObject);
 
 begin
   If (Index<0) or (INdex>=Fcount)  then
     Error (SListIndexError,Index);
   Changing;
-  Flist^[Index].FObject:=AObject; 
+  Flist^[Index].FObject:=AObject;
   Changed;
 end;
 
 
 
-Procedure TStringList.SetCapacity(NewCapacity: Integer); 
+Procedure TStringList.SetCapacity(NewCapacity: Integer);
 
 Var NewList : Pointer;
     MSize : Longint;
-    
+
 begin
-  If (NewCapacity<0) then 
-     Error (SListCapacityError,NewCapacity); 
+  If (NewCapacity<0) then
+     Error (SListCapacityError,NewCapacity);
   If NewCapacity>FCapacity then
     begin
     GetMem (NewList,NewCapacity*SizeOf(TStringItem));
@@ -783,7 +782,7 @@ end;
 
 
 
-Procedure TStringList.SetUpdateState(Updating: Boolean); 
+Procedure TStringList.SetUpdateState(Updating: Boolean);
 
 begin
   If Updating then
@@ -794,7 +793,7 @@ end;
 
 
 
-destructor TStringList.Destroy; 
+destructor TStringList.Destroy;
 
 Var I : Longint;
 
@@ -802,23 +801,23 @@ begin
   FOnChange:=Nil;
   FOnChanging:=Nil;
   // This will force a dereference. Can be done better...
-  For I:=0 to FCount-1 do 
+  For I:=0 to FCount-1 do
     FList^[I].FString:='';
   FCount:=0;
-  SetCapacity(0);  
-  Inherited destroy;  
+  SetCapacity(0);
+  Inherited destroy;
 end;
 
 
 
-Function TStringList.Add(const S: string): Integer; 
+Function TStringList.Add(const S: string): Integer;
 
 begin
   If Not Sorted then
     Result:=FCount
   else
-    If Find (S,Result) then 
-      Case DUplicates of 
+    If Find (S,Result) then
+      Case DUplicates of
         DupIgnore : Exit;
         DupError : Error(SDuplicateString,0)
       end;
@@ -827,7 +826,7 @@ end;
 
 
 
-Procedure TStringList.Clear; 
+Procedure TStringList.Clear;
 
 Var I : longint;
 
@@ -840,7 +839,7 @@ end;
 
 
 
-Procedure TStringList.Delete(Index: Integer); 
+Procedure TStringList.Delete(Index: Integer);
 
 begin
   If (Index<0) or (Index>=FCount) then
@@ -855,19 +854,19 @@ end;
 
 
 
-Procedure TStringList.Exchange(Index1, Index2: Integer); 
+Procedure TStringList.Exchange(Index1, Index2: Integer);
 
 begin
-  If (Index1<0) or (Index1>=FCount) then 
+  If (Index1<0) or (Index1>=FCount) then
     Error(SListIndexError,Index1);
-  If (Index2<0) or (Index2>=FCount) then 
+  If (Index2<0) or (Index2>=FCount) then
     Error(SListIndexError,Index1);
   Changing;
   ExchangeItems(Index1,Index2);
   changed;
 end;
 
-Function TStringList.Find(const S: string; var Index: Integer): Boolean; 
+Function TStringList.Find(const S: string; var Index: Integer): Boolean;
 
 { Searches for the first string <= S, returns True if exact match,
   sets index to the index f the found string. }
@@ -883,7 +882,7 @@ begin
     begin
     I:=(L+R) div 2;
     Temp:=AnsiCompareText(FList^ [I].FString,S);
-    If Temp<0 then 
+    If Temp<0 then
       L:=I+1
     else
       begin
@@ -895,38 +894,38 @@ begin
         end;
       end;
     end;
-  Index:=L;    
+  Index:=L;
 end;
 
 
 
-Function TStringList.IndexOf(const S: string): Integer; 
+Function TStringList.IndexOf(const S: string): Integer;
 
 begin
-  If Not Sorted then 
+  If Not Sorted then
     Result:=Inherited indexOf(S)
   else
     // faster using binary search...
-    If Not Find (S,Result) then 
+    If Not Find (S,Result) then
       Result:=-1;
 end;
 
 
 
-Procedure TStringList.Insert(Index: Integer; const S: string); 
+Procedure TStringList.Insert(Index: Integer; const S: string);
 
 begin
   If Sorted then
     Error (SSortedListError,0)
-  else 
+  else
     If (Index<0) or (Index>FCount) then
       Error (SListIndexError,Index)
-    else 
+    else
       InsertItem (Index,S);
 end;
 
 
-Procedure TStringList.Sort; 
+Procedure TStringList.Sort;
 
 begin
   If Not Sorted and (FCount>1) then
@@ -939,45 +938,7 @@ end;
 
 {
   $Log$
-  Revision 1.14  1999-02-06 08:21:00  michael
-  + Finally fixed loadfromstream
-
-  Revision 1.13  1999/02/04 21:41:12  michael
-  + Fixed loadfromstream bug
-
-  Revision 1.12  1999/02/04 17:19:14  michael
-  + fixed getvalue
-
-  Revision 1.11  1999/02/02 23:49:23  florian
-    * new lines for non linux system fixed (tstrings class)
-
-  Revision 1.10  1999/02/02 12:54:06  florian
-    * tstrings.gettextstr fixed, setlength got a wrong length (0 instead L)
-
-  Revision 1.9  1999/01/28 23:55:43  florian
-    * made it compilable
-
-  Revision 1.8  1998/11/13 09:40:16  michael
-  + Restored old version
-
-  Revision 1.6  1998/11/09 10:07:24  michael
-  + Bugfix in setcapacity, sizes were wrong
-
-  Revision 1.5  1998/10/30 14:52:52  michael
-  + Added format in interface
-  + Some errors in parser fixed, it uses exceptions now
-  + Strings now has no more syntax errors.
-
-  Revision 1.4  1998/10/24 13:45:37  michael
-  + Implemented stringlist. Untested, since classes broken.
-
-  Revision 1.3  1998/05/07 14:16:51  michael
-  + Finished TStrings implementation.
-
-  Revision 1.2  1998/05/06 12:58:53  michael
-  + Initial implementation
-
-  Revision 1.1  1998/05/04 14:30:12  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.15  1999-04-08 10:18:56  peter
+    * makefile updates
 
 }

+ 5 - 3
fcl/inc/thread.inc

@@ -25,6 +25,7 @@ end;
 function TThread.GetPriority: TThreadPriority;
 
 begin
+  GetPriority:=tpNormal;
 end;
 
 
@@ -40,7 +41,7 @@ begin
 end;
 
 
-procedure TThread.DoTerminate; 
+procedure TThread.DoTerminate;
 
 begin
 end;
@@ -85,12 +86,13 @@ end;
 function TThread.WaitFor: Integer;
 
 begin
+  WaitFor:=0;
 end;
 
 
 {
   $Log$
-  Revision 1.1  1998-05-04 14:30:12  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.2  1999-04-08 10:18:57  peter
+    * makefile updates
 
 }

+ 8 - 7
fcl/inc/writer.inc

@@ -24,6 +24,7 @@ end;
 function  TWriter.GetPosition: Longint;
 
 begin
+  GetPosition:=0;
 end;
 
 
@@ -39,7 +40,7 @@ begin
 end;
 
 
-Procedure TWriter.WriteData(Instance: TComponent); 
+Procedure TWriter.WriteData(Instance: TComponent);
 
 begin
 end;
@@ -81,7 +82,7 @@ begin
 end;
 
 
-Destructor TWriter.Destroy; 
+Destructor TWriter.Destroy;
 
 begin
 end;
@@ -89,7 +90,7 @@ end;
 
 Procedure TWriter.DefineProperty(const Name: string;
   rd : TReaderProc; wd : TWriterProc;
-  HasData: Boolean); 
+  HasData: Boolean);
 
 begin
 end;
@@ -97,13 +98,13 @@ end;
 
 Procedure TWriter.DefineBinaryProperty(const Name: string;
   rd, wd: TStreamProc;
-  HasData: Boolean); 
+  HasData: Boolean);
 
 begin
 end;
 
 
-Procedure TWriter.FlushBuffer; 
+Procedure TWriter.FlushBuffer;
 
 begin
 end;
@@ -199,7 +200,7 @@ begin
 end;
 {
   $Log$
-  Revision 1.1  1998-05-04 14:30:12  michael
-  * Split file according to Class; implemented dummys for all methods, so unit compiles.
+  Revision 1.2  1999-04-08 10:18:58  peter
+    * makefile updates
 
 }

+ 97 - 73
fcl/linux/Makefile

@@ -1,105 +1,129 @@
-#######################################################################
-#   Makefile for Free Pascal
-#   (C) 1998 Michael van Canneyt
-#######################################################################
 #
-#  Configurable section
+#   $Id$
+#   Copyright (c) 1999 by the Free Pascal Development Team
+#
+#   Makefile for Free Component Library for Linux
+#
+#   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.
 #
 
-# What Compiler should we use ?
-# PP=/home/michael/fpk/compiler/ppc386
-PP=ppc386
 
-# Where are the Free Pascal units ? (Optional)
-UNITDIR = /home/michael/fpk/rtl/linux
+#####################################################################
+# Defaults
+#####################################################################
 
+# Default place of the makefile.fpc
+DEFAULTFPCDIR=../..
 
-# Processor you are using
-CPU=i386
-#CPU=m68k
+# Include files
+INC=../inc
+PROCINC=../$(CPU)
 
-# Any options you wish to pass to the compiler
-OPT=
+# Where to place the files
+TARGETDIR=.
 
-# Where to install the units ?
-UNITINSTALLDIR=/usr/lib/fpc/0.99.11/fcl
+# We need always -S2
+NEEDOPT=-S2
 
-# Where to install the programs ?
-BININSTALLDIR=/usr/local/bin
+# As default make only the units
+DEFAULTUNITS=1
 
-# Install program ?
-INSTALL=install -m 644
 
-# Mkdir program ?
-MKDIR=install -m 755
+#####################################################################
+# Real targets
+#####################################################################
 
-#######################################################################
-# End of configurable section. Do not edit below this line.
-#######################################################################
+UNITOBJECTS=classes
+EXEOBJECTS=
 
-.SUFFIXES: .pp .ppu .pas
-.PHONY: all install clean units progs
 
-INCDIR=../inc
-CPUDIR=../$(CPU)
+#####################################################################
+# Common targets
+#####################################################################
 
-include $(INCDIR)/Makefile.inc
+.PHONY: all clean install info \
+        staticlib sharedlib libsclean \
+        staticinstall sharedinstall libinstall \
+        
+all: testfpcmake fpc_all
 
-# Set inc
-INCFILENAMES=$(addprefix $(INCDIR)/,$(INCNAMES))
+clean: testfpcmake fpc_clean
 
-# If nothing special needs doing, then just fill in the names here.
-# The rest should be automatic.
-UNITNAMES=classes
-PROGNAMES=
-UNITOBJECTS=$(addsuffix .o, $(UNITNAMES))
-UNITFILES=$(addsuffix .ppu, $(UNITNAMES))
-PROGSOURCES=$(addsiffix .pp, $(PROGNAMES))
-PROGOBJECTS=$(addsuffix .o, $(PROGNAMES))
+install: testfpcmake fpc_install
 
-# Adapt options. Add unit path if needed.
-override OPT:=$(OPT) -S2 -I$(INCDIR) -I$(CPUDIR)
+info: testfpcmake fpc_info
 
-ifdef UNITDIR
-override OPT:=$(OPT) -Up$(UNITDIR) 
-endif
+staticlib: testfpcmake fpc_staticlib
 
+sharedlib: testfpcmake fpc_sharedlib
 
-# Default rule for units
-.pp.ppu:
-	$(PP) $(OPT) $<
+libsclean: testfpcmake fpc_libsclean
 
-# Default target.
-all: $(UNITFILES) $(PROGNAMES)
+staticinstall: testfpcmake fpc_staticinstall
 
-units: $(UNITFILES)
+sharedinstall: testfpcmake fpc_sharedinstall
 
-progs: $(PROGNAMES)
+libinstall: testfpcmake fpc_libinstall
 
-# Default rule for programs
-$(PROGNAMES): %:%.pp
-	$(PP) $(OPT) $<
 
-classes.ppu: classes.pp $(INCFILENAMES) $(PROCFILENAMES)
-	$(PP) $(OPT) $<
+#####################################################################
+# Include default makefile
+#####################################################################
 
-classes.pp:
-	cp $(INCDIR)/classes.pp .
-	
-#
-# Generic install and clean targets
-#
+# test if FPCMAKE is still valid
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
+endif
+endif
 
-install: all
-	$(MKDIR) $(UNITINSTALLDIR)
-ifdef UNITNAMES
-	$(INSTALL) $(UNITNAMES) $(UNITINSTALLDIR)
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
 endif
-ifdef PROGNAMES
-	$(INSTALL) $(PROGNAMES) $(BININSTALLDIR)
 endif
 
-clean:
-	rm -f $(UNITOBJECTS) $(UNITFILES) $(PROGNAMES) $(PROGOBJECTS)
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+else
+FPCMAKE=makefile.fpc
+endif
+endif
 
-# End of makefile.
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifeq ($(FPCMAKE),)
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@exit
+else
+include $(FPCMAKE)
+testfpcmake:
+endif
+
+
+
+#####################################################################
+# Dependencies
+#####################################################################
+
+vpath %$(PASEXT) $(INC)
+
+include $(INC)/Makefile.inc
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+#
+# $Log$
+# Revision 1.7  1999-04-08 10:18:59  peter
+#   * makefile updates
+#
+#

+ 0 - 65
fcl/linux/classes.pp

@@ -1,65 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1998 by Michael Van Canneyt and Florian Klaempfl
-
-    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.
-
- **********************************************************************}
-
-{$MODE OBJFPC}
-
-{ determine the type of the resource/form file }
-{$define Win16Res}
-
-unit Classes;
-
-interface
-
-uses
-  strings,
-  sysutils;
-
-{$i classesh.inc}
-
-implementation
-
-{ OS - independent class implementations are in /inc directory. }
-{$i classes.inc}
-
-end.
-{
-  $Log$
-  Revision 1.9  1999-02-02 21:32:02  michael
-  - removed osfile.inc. All in sysutils now
-
-  Revision 1.8  1998/11/04 10:46:43  peter
-    * exceptions work
-
-  Revision 1.7  1998/11/04 10:15:13  peter
-    * fixes to compile
-
-  Revision 1.6  1998/10/02 09:17:57  michael
-  Removed objpas from uses clause
-
-  Revision 1.5  1998/09/23 07:46:57  michael
-  * patches by TSE
-
-  Revision 1.4  1998/06/10 21:53:09  michael
-  + Implemented Handle/FileStreams
-
-  Revision 1.3  1998/05/06 13:00:25  michael
-  + Added strings to uses clause, for TStrings class.
-
-  Revision 1.2  1998/05/04 14:31:51  michael
-  + Split classes file.
-
-  Revision 1.1  1998/05/04 12:16:01  florian
-    + Initial revisions after making a new directory structure
-
-}

+ 98 - 68
fcl/os2/Makefile

@@ -1,99 +1,129 @@
-#######################################################################
-#   Makefile for Free Pascal
-#   (C) 1998 Michael van Canneyt
-#######################################################################
 #
-#  Configurable section
+#   $Id$
+#   Copyright (c) 1999 by the Free Pascal Development Team
+#
+#   Makefile for Free Component Library for OS/2
+#
+#   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.
 #
 
-# What Compiler should we use ?
-PP=ppc386
 
-# Where are the Free Pascal units ? (Optional)
-#UNITDIR = c:/pp/units/os2
+#####################################################################
+# Defaults
+#####################################################################
 
-# Processor you are using
-CPU=i386
-#CPU=m68k
+# Default place of the makefile.fpc
+DEFAULTFPCDIR=../..
 
-# Any options you wish to pass to the compiler
-OPT=
+# Include files
+INC=../inc
+PROCINC=../$(CPU)
 
-# Where to install the units ?
-UNITINSTALLDIR=c:/pp/units/fcl
+# Where to place the files
+TARGETDIR=.
 
-# Where to install the programs ?
-BININSTALLDIR=/pp/bin
+# We need always -S2
+NEEDOPT=-S2
 
-# Install program ?
-INSTALL=cp
+# As default make only the units
+DEFAULTUNITS=1
 
-# Mkdir program ?
-MKDIR=mkdir
 
-#######################################################################
-# End of configurable section. Do not edit below this line.
-#######################################################################
+#####################################################################
+# Real targets
+#####################################################################
 
-.SUFFIXES: .pp .ppu .pas
-.PHONY: all install clean units progs
+UNITOBJECTS=classes
+EXEOBJECTS=
 
-INCDIR=../inc
-CPUDIR=../$(CPU)
 
-include $(INCDIR)/Makefile.inc
+#####################################################################
+# Common targets
+#####################################################################
 
-# Set inc
-INCFILENAMES=$(addprefix $(INCDIR)/,$(INCNAMES))
+.PHONY: all clean install info \
+        staticlib sharedlib libsclean \
+        staticinstall sharedinstall libinstall \
+        
+all: testfpcmake fpc_all
 
-# If nothing special needs doing, then just fill in the names here.
-# The rest should be automatic.
-UNITNAMES=classes
-#PROGNAMES=
-UNITOBJECTS=$(addsuffix .o, $(UNITNAMES))
-UNITFILES=$(addsuffix .ppu, $(UNITNAMES))
-PROGSOURCES=$(addsiffix .pp, $(PROGNAMES))
-PROGOBJECTS=$(addsuffix .o, $(PROGNAMES))
+clean: testfpcmake fpc_clean
 
-# Adapt options. Add unit path if needed.
-override OPT:=$(OPT) -S2 -I$(INCDIR) -I$(CPUDIR)
+install: testfpcmake fpc_install
 
-ifdef UNITDIR
-override OPT:=$(OPT) -Up$(UNITDIR) 
-endif
+info: testfpcmake fpc_info
 
+staticlib: testfpcmake fpc_staticlib
 
-# Default rule for units
-.pp.ppu:
-	$(PP) $(OPT) $<
+sharedlib: testfpcmake fpc_sharedlib
 
-# Default target.
-all: $(UNITFILES) $(PROGNAMES)
+libsclean: testfpcmake fpc_libsclean
 
-units: $(UNITFILES)
+staticinstall: testfpcmake fpc_staticinstall
 
-progs: $(PROGNAMES)
+sharedinstall: testfpcmake fpc_sharedinstall
 
-# Default rule for programs
-$(PROGNAMES): %:%.pp
-	$(PP) $(OPT) $<
+libinstall: testfpcmake fpc_libinstall
 
-classes.ppu: classes.pp $(INCFILENAMES) $(PROCFILENAMES)
 
-#
-# Generic install and clean targets
-#
+#####################################################################
+# Include default makefile
+#####################################################################
+
+# test if FPCMAKE is still valid
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
+endif
+endif
+
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
+endif
+endif
 
-install: all
-	$(MKDIR) $(UNITINSTALLDIR)
-ifdef UNITNAMES
-	$(INSTALL) $(UNITNAMES) $(UNITINSTALLDIR)
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+else
+FPCMAKE=makefile.fpc
+endif
 endif
-ifdef PROGNAMES
-	$(INSTALL) $(PROGNAMES) $(BININSTALLDIR)
+
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifeq ($(FPCMAKE),)
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@exit
+else
+include $(FPCMAKE)
+testfpcmake:
 endif
 
-clean:
-	rm -f $(UNITOBJECTS) $(UNITFILES) $(PROGNAMES) $(PROGOBJECTS)
 
-# End of makefile.
+
+#####################################################################
+# Dependencies
+#####################################################################
+
+vpath %$(PASEXT) $(INC)
+
+include $(INC)/Makefile.inc
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+#
+# $Log$
+# Revision 1.4  1999-04-08 10:19:01  peter
+#   * makefile updates
+#
+#

+ 0 - 45
fcl/os2/classes.pp

@@ -1,45 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1998 by Michael Van Canneyt and Florian Klaempfl
-
-    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.
-
- **********************************************************************}
-
-{ exceptions aren't implemented yet in the compiler }
-{$define NoExceptions}
-
-{ determine the type of the resource/form file }
-{$define Win16Res}
-unit Classes;
-
-interface
-
-uses
-  objpas,dos,strings;
-
-{$i classesh.inc}
-
-implementation
-
-{$i classes.inc}
-
-end.
-{
-  $Log$
-  Revision 1.3  1998-05-06 13:00:25  michael
-  + Added strings to uses clause, for TStrings class.
-
-  Revision 1.2  1998/05/04 14:31:51  michael
-  + Split classes file.
-
-  Revision 1.1  1998/05/04 12:16:01  florian
-    + Initial revisions after making a new directory structure
-
-}

+ 0 - 92
fcl/template/osfile.inc

@@ -1,92 +0,0 @@
-{
-    $Id$
-    This file is part of the Free Component Library (FCL)
-    Copyright (c) 1998 by the Free Pascal development team
-
-    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 file implements the system-dependent calls needed for the 
- classes unit.
- 
-}
-
-Function OSCreateFile (Const Filename : string; Mode : Longint) : longint;
-{
-  Creates a file with name FileName, using mode MODE
-  --> Filename : String giving the path to the file.
-      Mode     : Mode can be
-                 fmCreate    : Create file;
-                 fmOpenRead  : open for reading;
-                 fmOpenWrite : open for writing;
-  <-- File Handle, or -1 on error.
-}
-begin
-end;
-
-Function OSReadHandle(Handle : Longint;Var Buffer; Count : Longint): Longint;
-{
-  Read from a handle
-  --> Handle : file,pipe,etc Handle to read from.
-      Buffer : Location where to put the read bytes.
-      Count  : Number of bytes that should be read
-  <-- Number of bytes actually read, or -1 on error.   
-}
-
-begin
-end;
-
-Function OSWriteHandle(Handle : Longint;var Buffer; Count : longint) : Longint;
-{ 
-  Write to a handle
-  --> Handle : file,pipe,etc Handle to write to.
-      Buffer : Location where to get the bytes.
-      Count  : Number of bytes that should be written.
-  <-- Number of bytes actually written, or -1 on error.   
-}
-begin
-end;
-
-
-Function OSSetHandleSize (Handle,Size : Longint) : longint;
-{
-  Set size of handle (for files only)
-  --> Handle : Handle to set size for.
-      Size   : Size to be set.
-  <-- 0 on success, or -1 on error.
-}
-begin
-end;
-
-Function OSSeekHandle (FHandle,OffSet,Origin : longint) : longint;
-{
-  Seek Handle position starting from Origin
-  --> Handle : Handle of file to do seek on.
-      Offset : Position to seek.
-      Origin : Where to start seek: 
-               soFromBeginning 
-               soFromCurrent
-               soFromEnd 
-  <-- 0 on succes, -1 on error.
-}
-
-begin
-end;
-
-
-Function OSCloseHandle (Handle : longint) : longint;
-{
-  Close file associated with HAndle.
-  --> Handle : Handle of file to do seek on.
-  <-- 0 on succes, -1 on error.
-}
-
-begin
-end;

+ 94 - 54
fcl/tests/Makefile

@@ -1,78 +1,118 @@
-#######################################################################
-#   Makefile for Free Pascal
-#   (C) 1998 Michael van Canneyt
-#######################################################################
 #
-#  Configurable section
+#   $Id$
+#   Copyright (c) 1999 by the Free Pascal Development Team
+#
+#   Makefile for Free Component Library for Linux
+#
+#   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.
 #
 
-# What Compiler should we use ?
-PP=../../compiler/ppc386
 
-# Where are the Free Pascal units ? (Optional)
-UNITDIR = ../linux\;../../rtl/linux
+#####################################################################
+# Defaults
+#####################################################################
 
+# Default place of the makefile.fpc
+DEFAULTFPCDIR=../..
 
-# Any options you wish to pass to the compiler
-OPT=
+# Where need we to place the executables/ppu/objects
+TARGETDIR=.
 
-# Where to install the units ?
-UNITINSTALLDIR=/usr/lib/fpc/0.99.5/linuxunits
+# Needed units
+NEEDUNITDIR=../$(OS_TARGET)
 
-# Where to install the programs ?
-BININSTALLDIR=/usr/local/bin
+# We need always -S2
+NEEDOPT=-S2
 
-#######################################################################
-# End of configurable section. Do not edit below this line.
-#######################################################################
 
-.SUFFIXES: .pp .ppu .pas
-.PHONY: all install clean units progs
+#####################################################################
+# Real targets
+#####################################################################
 
-# If nothing special needs doing, then just fill in the names here.
-# The rest should be automatic.
-#UNITNAMES=
-PROGNAMES=fstream mstream list dparser stringl
-UNITOBJECTS=$(addsuffix .o, $(UNITNAMES))
-UNITFILES=$(addsuffix .ppu, $(UNITNAMES))
-PROGSOURCES=$(addsiffix .pp, $(PROGNAMES))
-PROGOBJECTS=$(addsuffix .o, $(PROGNAMES))
+UNITOBJECTS=
+EXEOBJECTS=stringl dparser fstream mstream list
 
-# Adapt options. Add unit path if needed.
-ifdef UNITDIR
-override OPT:=$(OPT) -S2 -Up$(UNITDIR)
-endif
 
+#####################################################################
+# Common targets
+#####################################################################
 
-# Default rule for units
-.pp.ppu:
-	$(PP) $(OPT) $<
+.PHONY: all clean install info \
+        staticlib sharedlib libsclean \
+        staticinstall sharedinstall libinstall \
+        
+all: testfpcmake fpc_all
 
-# Default target.
-all: $(UNITFILES) $(PROGNAMES)
+clean: testfpcmake fpc_clean
 
-units: $(UNITFILES)
+install: testfpcmake fpc_install
 
-progs: $(PROGNAMES)
+info: testfpcmake fpc_info
 
-# Default rule for programs
-$(PROGNAMES): %:%.pp
-	$(PP) $(OPT) $<
+staticlib: testfpcmake fpc_staticlib
 
-#
-# Generic install and clean targets
-#
+sharedlib: testfpcmake fpc_sharedlib
+
+libsclean: testfpcmake fpc_libsclean
 
-install: all
-	install -m 755 $(UNITINSTALLDIR)
-ifdef UNITNAMES
-	install -m 666 $(UNITNAMES) $(UNITINSTALLDIR)
+staticinstall: testfpcmake fpc_staticinstall
+
+sharedinstall: testfpcmake fpc_sharedinstall
+
+libinstall: testfpcmake fpc_libinstall
+
+
+#####################################################################
+# Include default makefile
+#####################################################################
+
+# test if FPCMAKE is still valid
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
 endif
-ifdef PROGNAMES
-	install -m 755 $(PROGNAMES) $(BININSTALLDIR)
 endif
 
-clean:
-	rm -f $(UNITOBJECTS) $(UNITFILES) $(PROGNAMES) $(PROGOBJECTS)
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
+endif
+endif
+
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+else
+FPCMAKE=makefile.fpc
+endif
+endif
+
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifeq ($(FPCMAKE),)
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@exit 1
+else
+include $(FPCMAKE)
+testfpcmake:
+endif
 
-# End of makefile.
+
+
+#####################################################################
+# Dependencies
+#####################################################################
+
+#
+# $Log$
+# Revision 1.4  1999-04-08 10:19:04  peter
+#   * makefile updates
+#
+#

+ 96 - 70
fcl/win32/Makefile

@@ -1,103 +1,129 @@
-#######################################################################
-#   Makefile for Free Pascal
-#   (C) 1998 Michael van Canneyt
-#######################################################################
 #
-#  Configurable section
+#   $Id$
+#   Copyright (c) 1999 by the Free Pascal Development Team
+#
+#   Makefile for Free Component Library for Win32
+#
+#   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.
 #
 
-# What Compiler should we use ?
-PP=ppc386
 
-# Where are the Free Pascal units ? (Optional)
-#UNITDIR = c:/pp/units/win32
+#####################################################################
+# Defaults
+#####################################################################
 
-# Processor you are using
-CPU=i386
-#CPU=m68k
+# Default place of the makefile.fpc
+DEFAULTFPCDIR=../..
 
-# Any options you wish to pass to the compiler
-OPT=
+# Include files
+INC=../inc
+PROCINC=../$(CPU)
 
-# Where to install the units ?
-UNITINSTALLDIR=c:/pp/units/fcl
+# Where to place the files
+TARGETDIR=.
 
-# Where to install the programs ?
-BININSTALLDIR=/pp/bin
+# We need always -S2
+NEEDOPT=-S2
 
-# Install program ?
-INSTALL=cp
+# As default make only the units
+DEFAULTUNITS=1
 
-# Mkdir program ?
-MKDIR=mkdir
 
-#######################################################################
-# End of configurable section. Do not edit below this line.
-#######################################################################
+#####################################################################
+# Real targets
+#####################################################################
 
-.SUFFIXES: .pp .ppu .pas
-.PHONY: all install clean units progs
+UNITOBJECTS=classes
+EXEOBJECTS=
 
-INCDIR=../inc
-CPUDIR=../$(CPU)
 
-include $(INCDIR)/Makefile.inc
+#####################################################################
+# Common targets
+#####################################################################
 
-# Set inc
-INCFILENAMES=$(addprefix $(INCDIR)/,$(INCNAMES))
+.PHONY: all clean install info \
+        staticlib sharedlib libsclean \
+        staticinstall sharedinstall libinstall \
+        
+all: testfpcmake fpc_all
 
-# If nothing special needs doing, then just fill in the names here.
-# The rest should be automatic.
-UNITNAMES=classes
-#PROGNAMES=
-UNITOBJECTS=$(addsuffix .o, $(UNITNAMES))
-UNITFILES=$(addsuffix .ppu, $(UNITNAMES))
-PROGSOURCES=$(addsiffix .pp, $(PROGNAMES))
-PROGOBJECTS=$(addsuffix .o, $(PROGNAMES))
+clean: testfpcmake fpc_clean
 
-# Adapt options. Add unit path if needed.
-override OPT:=$(OPT) -S2 -I$(INCDIR) -I$(CPUDIR)
+install: testfpcmake fpc_install
 
-ifdef UNITDIR
-override OPT:=$(OPT) -Up$(UNITDIR) 
-endif
+info: testfpcmake fpc_info
 
+staticlib: testfpcmake fpc_staticlib
 
-# Default rule for units
-.pp.ppu:
-	$(PP) $(OPT) $<
+sharedlib: testfpcmake fpc_sharedlib
 
-# Default target.
-all: $(UNITFILES) $(PROGNAMES)
+libsclean: testfpcmake fpc_libsclean
 
-units: $(UNITFILES)
+staticinstall: testfpcmake fpc_staticinstall
 
-progs: $(PROGNAMES)
+sharedinstall: testfpcmake fpc_sharedinstall
 
-# Default rule for programs
-$(PROGNAMES): %:%.pp
-	$(PP) $(OPT) $<
+libinstall: testfpcmake fpc_libinstall
 
-classes.ppu: classes.pp $(INCFILENAMES) $(PROCFILENAMES)
 
+#####################################################################
+# Include default makefile
+#####################################################################
 
-classes.pp:
-	cp $(INCDIR)/classes.pp .
+# test if FPCMAKE is still valid
+ifdef FPCMAKE
+ifeq ($(strip $(wildcard $(FPCMAKE))),)
+FPCDIR=
+FPCMAKE=
+endif
+endif
 
-#
-# Generic install and clean targets
-#
+ifndef FPCDIR
+ifdef DEFAULTFPCDIR
+FPCDIR=$(DEFAULTFPCDIR)
+endif
+endif
 
-install: all
-	$(MKDIR) $(UNITINSTALLDIR)
-ifdef UNITNAMES
-	$(INSTALL) $(UNITNAMES) $(UNITINSTALLDIR)
+ifndef FPCMAKE
+ifdef FPCDIR
+FPCMAKE=$(FPCDIR)/makefile.fpc
+else
+FPCMAKE=makefile.fpc
 endif
-ifdef PROGNAMES
-	$(INSTALL) $(PROGNAMES) $(BININSTALLDIR)
 endif
 
-clean:
-	rm -f $(UNITOBJECTS) $(UNITFILES) $(PROGNAMES) $(PROGOBJECTS)
+override FPCMAKE:=$(strip $(wildcard $(FPCMAKE)))
+ifeq ($(FPCMAKE),)
+testfpcmake:
+	@echo makefile.fpc not found!
+	@echo Check the FPCMAKE and FPCDIR environment variables.
+	@exit
+else
+include $(FPCMAKE)
+testfpcmake:
+endif
+
+
+
+#####################################################################
+# Dependencies
+#####################################################################
+
+vpath %$(PASEXT) $(INC)
 
-# End of makefile.
+include $(INC)/Makefile.inc
+INCFILES=$(addprefix $(INC)/,$(INCNAMES))
+
+classes$(PPUEXT): $(INCFILES) classes$(PASEXT)
+
+#
+# $Log$
+# Revision 1.5  1999-04-08 10:19:05  peter
+#   * makefile updates
+#
+#