t_macos.pas 3.4 KB

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