t_wdosx.pas 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {
  2. $Id$
  3. Copyright (c) 2001-2002 Pavel ??????
  4. This unit implements support import,export,link routines
  5. for the (i386) WDOSX target
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit t_wdosx;
  20. {$i fpcdefs.inc}
  21. interface
  22. implementation
  23. uses
  24. cutils,
  25. fmodule,globals,systems,
  26. import,export,link,t_win32,i_wdosx;
  27. type
  28. timportlibwdosx=class(timportlibwin32)
  29. procedure GetDefExt(var N:longint;var P:pStr4);override;
  30. end;
  31. texportlibwdosx=texportlibwin32;
  32. tlinkerwdosx=class(tlinkerwin32)
  33. public
  34. function MakeExecutable:boolean;override;
  35. end;
  36. tDLLScannerWdosx=class(tDLLScannerWin32)
  37. public
  38. procedure GetDefExt(var N:longint;var P:pStr4);override;
  39. end;
  40. const
  41. DefaultDLLExtensions:array[1..2]of string[4]=('.WDL','.DLL');
  42. {*****************************************************************************
  43. TIMPORTLIBWDOSX
  44. *****************************************************************************}
  45. procedure timportlibwdosx.GetDefExt(var N:longint;var P:pStr4);
  46. begin
  47. N:=sizeof(DefaultDLLExtensions)div sizeof(DefaultDLLExtensions[1]);
  48. pointer(P):=@DefaultDLLExtensions;
  49. end;
  50. {*****************************************************************************
  51. TLINKERWDOSX
  52. *****************************************************************************}
  53. function TLinkerWdosx.MakeExecutable:boolean;
  54. var
  55. b: boolean;
  56. begin
  57. b := Inherited MakeExecutable;
  58. if b then
  59. DoExec(FindUtil('stubit'),current_module.exefilename^,false,false);
  60. Result := b;
  61. end;
  62. {****************************************************************************
  63. TDLLScannerWdosx
  64. ****************************************************************************}
  65. procedure tDLLScannerWdosx.GetDefExt(var N:longint;var P:pStr4);
  66. begin
  67. N:=sizeof(DefaultDLLExtensions)div sizeof(DefaultDLLExtensions[1]);
  68. pointer(P):=@DefaultDLLExtensions;
  69. end;
  70. {*****************************************************************************
  71. Initialize
  72. *****************************************************************************}
  73. initialization
  74. RegisterExternalLinker(system_i386_wdosx_info,TLinkerWdosx);
  75. RegisterImport(system_i386_wdosx,TImportLibWdosx);
  76. RegisterExport(system_i386_wdosx,TExportLibWdosx);
  77. RegisterDLLScanner(system_i386_wdosx,TDLLScannerWdosx);
  78. {RegisterAr(ar_gnu_arw_info);}
  79. {RegisterRes(res_gnu_windres_info);}
  80. RegisterTarget(system_i386_wdosx_info);
  81. end.
  82. {
  83. $Log$
  84. Revision 1.3 2003-04-27 07:29:52 peter
  85. * aktprocdef cleanup, aktprocdef is now always nil when parsing
  86. a new procdef declaration
  87. * aktprocsym removed
  88. * lexlevel removed, use symtable.symtablelevel instead
  89. * implicit init/final code uses the normal genentry/genexit
  90. * funcret state checking updated for new funcret handling
  91. Revision 1.2 2002/10/05 12:43:29 carl
  92. * fixes for Delphi 6 compilation
  93. (warning : Some features do not work under Delphi)
  94. Revision 1.1 2002/09/06 15:03:50 carl
  95. * moved files to systems directory
  96. Revision 1.10 2002/08/12 15:08:44 carl
  97. + stab register indexes for powerpc (moved from gdb to cpubase)
  98. + tprocessor enumeration moved to cpuinfo
  99. + linker in target_info is now a class
  100. * many many updates for m68k (will soon start to compile)
  101. - removed some ifdef or correct them for correct cpu
  102. Revision 1.9 2002/07/26 21:15:46 florian
  103. * rewrote the system handling
  104. Revision 1.8 2002/05/18 13:34:27 peter
  105. * readded missing revisions
  106. Revision 1.7 2002/05/16 19:46:53 carl
  107. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  108. + try to fix temp allocation (still in ifdef)
  109. + generic constructor calls
  110. + start of tassembler / tmodulebase class cleanup
  111. Revision 1.5 2002/05/12 16:53:18 peter
  112. * moved entry and exitcode to ncgutil and cgobj
  113. * foreach gets extra argument for passing local data to the
  114. iterator function
  115. * -CR checks also class typecasts at runtime by changing them
  116. into as
  117. * fixed compiler to cycle with the -CR option
  118. * fixed stabs with elf writer, finally the global variables can
  119. be watched
  120. * removed a lot of routines from cga unit and replaced them by
  121. calls to cgobj
  122. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  123. u32bit then the other is typecasted also to u32bit without giving
  124. a rangecheck warning/error.
  125. * fixed pascal calling method with reversing also the high tree in
  126. the parast, detected by tcalcst3 test
  127. Revision 1.4 2002/04/22 18:19:22 carl
  128. - remove use_bound_instruction field
  129. Revision 1.3 2002/04/20 21:43:18 carl
  130. * fix stack size for some targets
  131. + add offset to parameters from frame pointer info.
  132. - remove some unused stuff
  133. Revision 1.2 2002/04/15 19:16:57 carl
  134. - remove size_of_pointer field
  135. Revision 1.1 2002/04/04 18:09:49 carl
  136. + added wdosx patch from Pavel
  137. }