Browse Source

* dxegen compilable for any target now

Tomas Hajny 21 years ago
parent
commit
2131196402
5 changed files with 68 additions and 28 deletions
  1. 3 2
      rtl/go32v2/Makefile
  2. 4 2
      rtl/go32v2/Makefile.fpc
  3. 7 14
      rtl/go32v2/dxeload.pp
  4. 42 0
      rtl/go32v2/dxetype.pp
  5. 12 10
      utils/dxegen/dxegen.pp

+ 3 - 2
rtl/go32v2/Makefile

@@ -231,7 +231,7 @@ endif
 ifdef NO_EXCEPTIONS_IN_SYSTEM
 override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
 endif
-override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer graph sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo msmouse charset varutils video mouse keyboard variants vesamode types sysconst rtlconst dateutil convutil strutils
 override TARGET_LOADERS+=prt0 exceptn fpu
 override TARGET_RSTS+=math varutils typinfo classes variants dateutil sysconst
 override INSTALL_FPCPACKAGE=y
@@ -1414,7 +1414,8 @@ dpmiexcp$(PPUEXT) : dpmiexcp.pp exceptn$(OEXT) system$(PPUEXT)
 	$(COMPILER) -Sg dpmiexcp.pp
 initc$(PPUEXT) : initc.pp system$(PPUEXT)
 profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT)
-dxeload$(PPUEXT) : dxeload.pp system$(PPUEXT)
+dxetype$(PPUEXT) : dxetype.pp system$(PPUEXT)
+dxeload$(PPUEXT) : dxeload.pp dxetype$(PPUEXT) system$(PPUEXT)
 emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
 		  dpmiexcp$(PPUEXT)
 ports$(PPUEXT) : ports.pp objpas$(PPUEXT) system$(PPUEXT)

+ 4 - 2
rtl/go32v2/Makefile.fpc

@@ -8,7 +8,7 @@ main=rtl
 [target]
 loaders=prt0 exceptn fpu
 units=system objpas macpas strings \
-      go32 dpmiexcp initc ports profile dxeload emu387 \
+      go32 dpmiexcp initc ports profile dxetype dxeload emu387 \
       dos crt objects printer graph \
       sysutils classes math typinfo matrix \
       cpu mmx ucomplex getopts heaptrc lineinfo \
@@ -114,7 +114,9 @@ initc$(PPUEXT) : initc.pp system$(PPUEXT)
 
 profile$(PPUEXT) : profile.pp dpmiexcp$(PPUEXT) go32$(PPUEXT)
 
-dxeload$(PPUEXT) : dxeload.pp system$(PPUEXT)
+dxetype$(PPUEXT) : dxetype.pp system$(PPUEXT)
+
+dxeload$(PPUEXT) : dxeload.pp dxetype$(PPUEXT) system$(PPUEXT)
 
 emu387$(PPUEXT) : emu387.pp fpu$(OEXT) strings$(PPUEXT) dxeload$(PPUEXT) \
                   dpmiexcp$(PPUEXT)

+ 7 - 14
rtl/go32v2/dxeload.pp

@@ -20,20 +20,13 @@
 Unit dxeload;
 interface
 
-const
-   DXE_MAGIC  = $31455844;
-type
-  dxe_header = record
-     magic,
-     symbol_offset,
-     element_size,
-     nrelocs       : cardinal;
-  end;
-
 function dxe_load(filename : string) : pointer;
 
 implementation
 
+uses
+ dxetype;
+
 function dxe_load(filename : string) : pointer;
 {
   Copyright (C) 1995 Charles Sandmann ([email protected])
@@ -43,9 +36,6 @@ type
   { to avoid range check problems }
   pointer_array = array[0..maxlongint div sizeof(pointer)] of pointer;
   tpa = ^pointer_array;
-  plongint = ^longint;
-  pcardinal = ^cardinal;
-  ppointer = ^pointer;
 var
   dh     : dxe_header;
   data   : pchar;
@@ -98,7 +88,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.6  2002-09-07 16:01:18  peter
+  Revision 1.7  2004-09-15 19:20:51  hajny
+    * dxegen compilable for any target now
+
+  Revision 1.6  2002/09/07 16:01:18  peter
     * old logs removed and tabs fixed
 
   Revision 1.5  2002/04/27 07:58:23  peter

+ 42 - 0
rtl/go32v2/dxetype.pp

@@ -0,0 +1,42 @@
+{
+    $Id$
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by Pierre Muller,
+    member of the Free Pascal development team.
+
+    Support unit for working with DXE files 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.
+
+ **********************************************************************
+}
+
+unit dxetype;
+
+interface
+
+const
+   DXE_MAGIC  = $31455844;
+
+type
+  dxe_header = record
+     magic,
+     symbol_offset,
+     element_size,
+     nrelocs       : cardinal;
+  end;
+
+implementation
+
+end.
+{
+  $Log$
+  Revision 1.1  2004-09-15 19:20:51  hajny
+    * dxegen compilable for any target now
+
+}

+ 12 - 10
utils/dxegen/dxegen.pp

@@ -12,7 +12,7 @@
 
 }
 
-Uses Strings,DxeLoad,Coff,Dos;
+Uses strings,dxetype,coff,dos;
 
 {$inline on}
 
@@ -36,15 +36,15 @@ isn't interpretive. Until generics, this is the only reusable way.
 
 }
 
-{$ifdef BigEndian}
+{$ifdef FPC_BIG_ENDIAN}
 Var data : pbyte;
     c    : byte;
     i,j  : longint;
-{$endif}
+{$endif FPC_BIG_ENDIAN}
 
 Begin
 
- {$ifdef BigEndian}
+ {$ifdef FPC_BIG_ENDIAN}
   I := 1;
   j := length(pattern);
   data := pbyte(vdata);
@@ -75,7 +75,7 @@ Begin
                End;
                inc(i);
              End;
- {$endif}
+ {$endif FPC_BIG_ENDIAN}
 End;
 
 Var blaat : pointer;
@@ -211,7 +211,7 @@ Begin
   BlockRead(input_f,sc,SCNHSZ);
   dosswap(@sc, '8llllllssl');
   dh.magic         := DXE_MAGIC;
-  dh.symbol_offset := -1;
+  dh.symbol_offset := cardinal (-1);
   dh.element_size  := sc.s_size;
   dh.nrelocs       := sc.s_nreloc;
   Getmem(Data,sc.s_size);
@@ -249,7 +249,7 @@ Begin
         End;
       If (strlcomp(name, argv[2], strlen(argv[2])) = 0) Then
         Begin
-          If (dh.symbol_offset <> -1) Then
+          If (dh.symbol_offset <> cardinal (-1)) Then
             Begin
               Writeln('Error: multiple symbols that start with ',paramstr(2),' (',name,
               ')!');
@@ -266,7 +266,7 @@ Begin
                                         (* plus increment for found value. *)
     End;
 
-  If (dh.symbol_offset = -1) Then
+  If (dh.symbol_offset = cardinal (-1)) Then
     Begin
       Writeln('Error: symbol ',argv[2],' not found!');
       Inc(Errors);
@@ -312,7 +312,10 @@ Begin
 End.
 {
  $Log$
- Revision 1.7  2004-09-15 08:35:39  michael
+ Revision 1.8  2004-09-15 19:20:51  hajny
+   * dxegen compilable for any target now
+
+ Revision 1.7  2004/09/15 08:35:39  michael
  + Fix for wrong for loop variable from Tomas Hajny
 
  Revision 1.6  2002/09/07 15:40:31  peter
@@ -325,4 +328,3 @@ End.
   * Renamefest
 
 }
-