t_macos.pas 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. {
  2. $Id$
  3. Copyright (c) 2001-2002 by Peter Vreman
  4. This unit implements support import,export,link routines for MacOS.
  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_macos;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. import,symsym,symdef;
  23. type
  24. timportlibmacos=class(timportlib)
  25. procedure preparelib(const s:string);override;
  26. procedure importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);override;
  27. procedure importvariable(vs:tvarsym;const name,module:string);override;
  28. procedure generatelib;override;
  29. end;
  30. implementation
  31. uses
  32. link,
  33. cutils,cclasses,
  34. globtype,globals,systems,verbose,script,fmodule,i_macos,
  35. symconst;
  36. {*****************************************************************************
  37. TIMPORTLIBMACOS
  38. *****************************************************************************}
  39. procedure timportlibmacos.preparelib(const s : string);
  40. begin
  41. end;
  42. procedure timportlibmacos.importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);
  43. begin
  44. { insert sharedlibrary }
  45. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  46. { do nothing with the procedure, only set the mangledname }
  47. if name<>'' then
  48. begin
  49. aprocdef.setmangledname(name);
  50. end
  51. else
  52. message(parser_e_empty_import_name);
  53. end;
  54. procedure timportlibmacos.importvariable(vs:tvarsym;const name,module:string);
  55. begin
  56. { insert sharedlibrary }
  57. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  58. { reset the mangledname and turn off the dll_var option }
  59. vs.set_mangledname(name);
  60. exclude(vs.varoptions,vo_is_dll_var);
  61. end;
  62. procedure timportlibmacos.generatelib;
  63. begin
  64. end;
  65. {*****************************************************************************
  66. Initialize
  67. *****************************************************************************}
  68. initialization
  69. {$ifdef m68k}
  70. RegisterTarget(system_m68k_macos_info);
  71. RegisterImport(system_m68k_macos,timportlibmacos);
  72. {$endif m68k}
  73. {$ifdef powerpc}
  74. RegisterTarget(system_powerpc_macos_info);
  75. RegisterImport(system_powerpc_macos,timportlibmacos);
  76. {$endif powerpc}
  77. end.
  78. {
  79. $Log$
  80. Revision 1.6 2003-04-27 08:52:00 florian
  81. * another compile fix
  82. Revision 1.5 2003/04/27 08:50:45 peter
  83. * compile fix
  84. Revision 1.4 2002/11/17 16:32:04 carl
  85. * memory optimization (3-4%) : cleanup of tai fields,
  86. cleanup of tdef and tsym fields.
  87. * make it work for m68k
  88. Revision 1.3 2002/10/16 20:18:33 olle
  89. * header comment updated
  90. Revision 1.2 2002/10/02 21:50:19 florian
  91. * importing via external is now possible for macos
  92. Revision 1.1 2002/09/06 15:03:50 carl
  93. * moved files to systems directory
  94. Revision 1.13 2002/08/20 21:40:44 florian
  95. + target macos for ppc added
  96. + frame work for mpw assembler output
  97. Revision 1.12 2002/07/26 21:15:46 florian
  98. * rewrote the system handling
  99. }