t_wdosx.pas 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. begin
  55. Result:=inherited;
  56. if Result then
  57. DoExec(FindUtil('stubit'),current_module.exefilename^,false,false);
  58. end;
  59. {****************************************************************************
  60. TDLLScannerWdosx
  61. ****************************************************************************}
  62. procedure tDLLScannerWdosx.GetDefExt(var N:longint;var P:pStr4);
  63. begin
  64. N:=sizeof(DefaultDLLExtensions)div sizeof(DefaultDLLExtensions[1]);
  65. pointer(P):=@DefaultDLLExtensions;
  66. end;
  67. {*****************************************************************************
  68. Initialize
  69. *****************************************************************************}
  70. initialization
  71. RegisterExternalLinker(system_i386_wdosx_info,TLinkerWdosx);
  72. RegisterImport(system_i386_wdosx,TImportLibWdosx);
  73. RegisterExport(system_i386_wdosx,TExportLibWdosx);
  74. RegisterDLLScanner(system_i386_wdosx,TDLLScannerWdosx);
  75. {RegisterAr(ar_gnu_arw_info);}
  76. {RegisterRes(res_gnu_windres_info);}
  77. RegisterTarget(system_i386_wdosx_info);
  78. end.
  79. {
  80. $Log$
  81. Revision 1.1 2002-09-06 15:03:50 carl
  82. * moved files to systems directory
  83. Revision 1.10 2002/08/12 15:08:44 carl
  84. + stab register indexes for powerpc (moved from gdb to cpubase)
  85. + tprocessor enumeration moved to cpuinfo
  86. + linker in target_info is now a class
  87. * many many updates for m68k (will soon start to compile)
  88. - removed some ifdef or correct them for correct cpu
  89. Revision 1.9 2002/07/26 21:15:46 florian
  90. * rewrote the system handling
  91. Revision 1.8 2002/05/18 13:34:27 peter
  92. * readded missing revisions
  93. Revision 1.7 2002/05/16 19:46:53 carl
  94. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  95. + try to fix temp allocation (still in ifdef)
  96. + generic constructor calls
  97. + start of tassembler / tmodulebase class cleanup
  98. Revision 1.5 2002/05/12 16:53:18 peter
  99. * moved entry and exitcode to ncgutil and cgobj
  100. * foreach gets extra argument for passing local data to the
  101. iterator function
  102. * -CR checks also class typecasts at runtime by changing them
  103. into as
  104. * fixed compiler to cycle with the -CR option
  105. * fixed stabs with elf writer, finally the global variables can
  106. be watched
  107. * removed a lot of routines from cga unit and replaced them by
  108. calls to cgobj
  109. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  110. u32bit then the other is typecasted also to u32bit without giving
  111. a rangecheck warning/error.
  112. * fixed pascal calling method with reversing also the high tree in
  113. the parast, detected by tcalcst3 test
  114. Revision 1.4 2002/04/22 18:19:22 carl
  115. - remove use_bound_instruction field
  116. Revision 1.3 2002/04/20 21:43:18 carl
  117. * fix stack size for some targets
  118. + add offset to parameters from frame pointer info.
  119. - remove some unused stuff
  120. Revision 1.2 2002/04/15 19:16:57 carl
  121. - remove size_of_pointer field
  122. Revision 1.1 2002/04/04 18:09:49 carl
  123. + added wdosx patch from Pavel
  124. }