t_macos.pas 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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;
  23. type
  24. timportlibmacos=class(timportlib)
  25. procedure preparelib(const s:string);override;
  26. procedure importprocedure(const func,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(const func,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. aktprocdef.setmangledname(name);
  50. aktprocdef.has_mangledname:=true;
  51. end
  52. else
  53. message(parser_e_empty_import_name);
  54. end;
  55. procedure timportlibmacos.importvariable(vs:tvarsym;const name,module:string);
  56. begin
  57. { insert sharedlibrary }
  58. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  59. { reset the mangledname and turn off the dll_var option }
  60. vs.set_mangledname(name);
  61. exclude(vs.varoptions,vo_is_dll_var);
  62. end;
  63. procedure timportlibmacos.generatelib;
  64. begin
  65. end;
  66. {*****************************************************************************
  67. Initialize
  68. *****************************************************************************}
  69. initialization
  70. {$ifdef m68k}
  71. RegisterTarget(system_m68k_macos_info);
  72. RegisterImport(system_m68k_macos,timportlibmacos);
  73. {$endif m68k}
  74. {$ifdef powerpc}
  75. RegisterTarget(system_powerpc_macos_info);
  76. RegisterImport(system_powerpc_macos,timportlibmacos);
  77. {$endif powerpc}
  78. end.
  79. {
  80. $Log$
  81. Revision 1.3 2002-10-16 20:18:33 olle
  82. * header comment updated
  83. Revision 1.2 2002/10/02 21:50:19 florian
  84. * importing via external is now possible for macos
  85. Revision 1.1 2002/09/06 15:03:50 carl
  86. * moved files to systems directory
  87. Revision 1.13 2002/08/20 21:40:44 florian
  88. + target macos for ppc added
  89. + frame work for mpw assembler output
  90. Revision 1.12 2002/07/26 21:15:46 florian
  91. * rewrote the system handling
  92. }