t_symobi.pas 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {
  2. Copyright (c) 2011 by Sven Barth
  3. This unit implements support import,export,link routines
  4. for the Symobi Target
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit t_symobi;
  19. {$i fpcdefs.inc}
  20. interface
  21. implementation
  22. uses
  23. SysUtils,
  24. cutils,
  25. ogbase,ogcoff,
  26. globtype,globals,systems,verbose,
  27. import,export,link,t_win,i_symobi,rescmn,comprsrc;
  28. type
  29. TImportLibSymobi=class(TImportLibWin)
  30. end;
  31. TExportLibSymobi=class(TExportLibWin)
  32. end;
  33. TInternalLinkerSymobi = class(TInternalLinkerWin)
  34. constructor create;override;
  35. procedure ConcatEntryName; override;
  36. function MakeExecutable:boolean;override;
  37. end;
  38. {****************************************************************************
  39. TInternalLinkerSymobi
  40. ****************************************************************************}
  41. constructor TInternalLinkerSymobi.create;
  42. begin
  43. inherited create;
  44. CExeoutput:=TPECoffexeoutput;
  45. CObjInput:=TPECoffObjInput;
  46. end;
  47. procedure TInternalLinkerSymobi.ConcatEntryName;
  48. begin
  49. with LinkScript do
  50. begin
  51. if IsSharedLibrary then
  52. { TODO : verify this }
  53. Concat('ENTRYNAME _DLLMainCRTStartup')
  54. else
  55. { we need to use the startupname defined in the helper }
  56. Concat('ENTRYNAME FPC_SYSTEMMAIN');
  57. end;
  58. end;
  59. function TInternalLinkerSymobi.MakeExecutable:boolean;
  60. begin
  61. result:=inherited MakeExecutable;
  62. end;
  63. {*****************************************************************************
  64. Initialize
  65. *****************************************************************************}
  66. initialization
  67. {$ifdef i386}
  68. { Symobi }
  69. RegisterInternalLinker(system_i386_symobi_info,TInternalLinkerSymobi);
  70. RegisterImport(system_i386_symobi,TImportLibSymobi);
  71. RegisterExport(system_i386_symobi,TExportLibSymobi);
  72. RegisterRes(res_ext_info,TWinLikeResourceFile);
  73. RegisterTarget(system_i386_symobi_info);
  74. {$endif i386}
  75. end.