Sfoglia il codice sorgente

*** empty log message ***

marco 21 anni fa
parent
commit
ed32411ea4
4 ha cambiato i file con 123 aggiunte e 58 eliminazioni
  1. 50 10
      rtl/freebsd/Makefile
  2. 1 1
      rtl/freebsd/Makefile.fpc
  3. 5 1
      rtl/freebsd/ptypes.inc
  4. 67 46
      rtl/freebsd/unixsysc.inc

+ 50 - 10
rtl/freebsd/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2003/09/24]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2003/12/22]
 #
 default: all
-MAKEFILETARGETS=freebsd
+MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom
 override PATH:=$(subst \,/,$(PATH))
 ifeq ($(findstring ;,$(PATH)),)
 inUnix=1
@@ -10,6 +10,7 @@ SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
 else
 SEARCHPATH:=$(subst ;, ,$(PATH))
 endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
 PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
 ifeq ($(PWD),)
 PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
@@ -230,7 +231,7 @@ GRAPHDIR=$(INC)/graph
 ifndef USELIBGGI
 USELIBGGI=NO
 endif
-override TARGET_UNITS+=$(SYSTEMUNIT) objpas strings syscall baseunix unixutil unix initc   dos dl termio objects printer sysutils typinfo systhrds classes math varutils cpu mmx charset ucomplex crt getopts heaptrc lineinfo errors sockets gpm ipc terminfo video mouse keyboard console serial variants types sysctl dateutils sysconst cthreads
+override TARGET_UNITS+=$(SYSTEMUNIT) objpas strings syscall sysctl baseunix unixutil unix initc   dos dl termio objects printer sysutils typinfo systhrds classes math varutils cpu mmx charset ucomplex crt getopts heaptrc lineinfo errors sockets gpm ipc terminfo video mouse keyboard console serial variants types sysctl dateutils sysconst cthreads
 override TARGET_LOADERS+=prt0 cprt0 gprt0
 override TARGET_RSTS+=math varutils typinfo classes variants dateutils sysconst
 override INSTALL_FPCPACKAGE=y y
@@ -319,9 +320,17 @@ endif
 endif
 ifndef INSTALL_BINDIR
 ifdef UNIXINSTALLDIR
+ifdef CROSSCOMPILE
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
+else
 INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+endif
+else
+ifdef CROSSCOMPILE
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/cross/$(FULL_TARGET)/bin
 else
 INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+endif
 ifdef INSTALL_FPCPACKAGE
 INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(OS_TARGET)
 endif
@@ -453,6 +462,14 @@ STATICLIBPREFIX=
 FPCMADE=fpcmade.dos
 ZIPSUFFIX=go32
 endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+FPCMADE=fpcmade.wat
+ZIPSUFFIX=watc
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+endif
 ifeq ($(OS_TARGET),linux)
 EXEEXT=
 HASSHAREDLIB=1
@@ -555,6 +572,11 @@ STATICLIBPREFIX=
 FPCMADE=fpcmade.dos
 ZIPSUFFIX=go32
 endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+FPCMADE=fpcmade.dos
+ZIPSUFFIX=watcom
+endif
 ifeq ($(OS_TARGET),linux)
 EXEEXT=
 HASSHAREDLIB=1
@@ -743,7 +765,11 @@ endif
 endif
 export MVPROG
 ifndef ECHOREDIR
-ECHOREDIR:=$(subst /,$(PATHSEP),$(ECHO))
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
 endif
 ifndef COPY
 COPY:=$(CPPROG) -fp
@@ -814,14 +840,16 @@ TARPROG:=$(firstword $(TARPROG))
 endif
 endif
 export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
 ASNAME=as
 LDNAME=ld
 ARNAME=ar
-RCNAME=rc
-ifeq ($(OS_TARGET),win32)
-ASNAME=asw
-LDNAME=ldw
-ARNAME=arw
+endif
 endif
 ifndef ASPROG
 ifdef CROSSBINDIR
@@ -903,6 +931,14 @@ endif
 ifeq ($(OS_SOURCE),openbsd)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX) -Xc
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
 ifdef UNITDIR
 override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
 endif
@@ -1049,7 +1085,7 @@ fpc_debug:
 	$(MAKE) all DEBUG=1
 fpc_release:
 	$(MAKE) all RELEASE=1
-.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp .rc .res
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .dpr .pp .rc .res
 %$(PPUEXT): %.pp
 	$(COMPILER) $<
 	$(EXECPPAS)
@@ -1062,10 +1098,14 @@ fpc_release:
 %$(EXEEXT): %.pas
 	$(COMPILER) $<
 	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
 %.res: %.rc
 	windres -i $< -o $@
 vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS

+ 1 - 1
rtl/freebsd/Makefile.fpc

@@ -10,7 +10,7 @@ fpcpackage=y
 
 [target]
 loaders=prt0 cprt0 gprt0
-units=$(SYSTEMUNIT) objpas strings syscall baseunix unixutil \
+units=$(SYSTEMUNIT) objpas strings syscall sysctl baseunix unixutil \
       unix initc   \
       dos dl termio objects printer \
       sysutils typinfo systhrds classes math varutils \

+ 5 - 1
rtl/freebsd/ptypes.inc

@@ -71,6 +71,7 @@ type
     time_t   = clong;           { used for returning the time  }
     TTime    = time_t; 
     pTime    = ^time_t;
+    ptime_t =  ^time_t;
 
     socklen_t= cuint32;
     TSocklen = socklen_t;
@@ -99,7 +100,10 @@ CONST
 
 {
   $Log$
-  Revision 1.7  2003-09-27 13:45:58  peter
+  Revision 1.8  2003-12-30 12:32:30  marco
+  *** empty log message ***
+
+  Revision 1.7  2003/09/27 13:45:58  peter
     * fpnanosleep exported in baseunix
     * fpnanosleep has pointer arguments to be C compliant
 

+ 67 - 46
rtl/freebsd/unixsysc.inc

@@ -62,19 +62,7 @@ END;
 end;
 }
 
-{
-Procedure GetTimeOfDay(var tv:timeval);
-{
-  Get the number of seconds since 00:00, January 1 1970, GMT
-  the time NOT corrected any way
-}
-
-var  tz : timezone;
-
-begin
- do_syscall(syscall_nr_gettimeofday,longint(@tv),longint(@tz));
-end;
-}
+{$ifndef FPC_USE_LIBC}
 Function  fsync (fd : cint) : cint;
 
 begin
@@ -87,19 +75,6 @@ begin
  Flock:=do_syscall(syscall_nr_flock,fd,mode);
 end;
 
-Function StatFS(Path:Pathstr;Var Info:Tstatfs):cint;
-
-{
-  Get all information on a fileSystem, and return it in Info.
-  Path is the name of a file/directory on the fileSystem you wish to
-  investigate.
-}
-
-begin
-  path:=path+#0;
-  StatFS:=Do_Syscall(syscall_nr_statfs,longint(@path[1]),longint(@info));
-end;
-
 Function fStatFS(Fd:Longint;Var Info:tstatfs):cint;
 {
   Get all information on a fileSystem, and return it in Info.
@@ -140,24 +115,8 @@ begin
  end;
 end;
 
-// can't have oldfpccall here, linux doesn't need it.
-Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_ASSIGNPIPE'];
-{
-  Sets up a pair of file variables, which act as a pipe. The first one can
-  be read from, the second one can be written to.
-  If the operation was unsuccesful, linuxerror is set.
-}
-var
-  ret  : longint;
-  errn : cint;
-begin
- ret:=intAssignPipe(pipe_in,pipe_out,errn);
- if ret=-1 Then
-  fpseterrno(errn);
- AssignPipe:=ret;
-end;
 
-Function PClose(Var F:text) :longint;
+Function PClose(Var F:text) :cint;
 var
   pl  : ^longint;
   res : longint;
@@ -183,12 +142,69 @@ begin
   pclose:=res shr 8;
 end;
 
-function MUnMap (P : Pointer; Size : Longint) : Boolean;
+function MUnMap (P : Pointer; Size : size_t) : cint;
+
+begin
+  MUnMap:=do_syscall(syscall_nr_munmap,longint(P),Size);
+end;
+{$else}
+
+Function PClose(Var F:file) : cint;
+var
+  pl : ^cint;
+  res : cint;
+
+begin
+  fpclose(filerec(F).Handle);
+{ closed our side, Now wait for the other - this appears to be needed ?? }
+  pl:=@(filerec(f).userdata[2]);
+  fpwaitpid(pl^,@res,0);
+  pclose:=res shr 8;
+end;
+
+Function PClose(Var F:text) :cint;
+var
+  pl  : ^longint;
+  res : longint;
+
+begin
+  fpclose(Textrec(F).Handle);
+{ closed our side, Now wait for the other - this appears to be needed ?? }
+  pl:=@(textrec(f).userdata[2]);
+  fpwaitpid(pl^,@res,0);
+  pclose:=res shr 8;
+end;
 
+{$endif}
+// can't have oldfpccall here, linux doesn't need it.
+Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_ASSIGNPIPE'];
+{
+  Sets up a pair of file variables, which act as a pipe. The first one can
+  be read from, the second one can be written to.
+  If the operation was unsuccesful, linuxerror is set.
+}
+var
+  ret  : longint;
+  errn : cint;
+  {$ifdef FPC_USE_LIBC}
+   fdis : array[0..1] of cint;
+  {$endif}
 begin
-  MUnMap:=do_syscall(syscall_nr_munmap,longint(P),Size)=0;
+{$ifndef FPC_USE_LIBC}
+ ret:=intAssignPipe(pipe_in,pipe_out,errn);
+ if ret=-1 Then
+  fpseterrno(errn);
+{$ELSE}
+ fdis[0]:=pipe_in;
+ fdis[1]:=pipe_out;
+ ret:=pipe(fdis);
+ pipe_in:=fdis[0];
+ pipe_out:=fdis[1];
+{$ENDIF}
+ AssignPipe:=ret;
 end;
 
+
 {
 function  intClone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint; {$ifndef ver1_0} oldfpccall; {$endif}
  
@@ -235,6 +251,8 @@ end;
   intClone:=Res; 
 end;
 
+
+
 function  Clone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint; 
 
 begin
@@ -246,7 +264,10 @@ end;
 
 {
   $Log$
-  Revision 1.16  2003-11-19 17:11:40  marco
+  Revision 1.17  2003-12-30 12:32:30  marco
+  *** empty log message ***
+
+  Revision 1.16  2003/11/19 17:11:40  marco
    * termio unit
 
   Revision 1.15  2003/11/19 10:12:02  marco