Language.pm 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Copyright (C) 2013-2017 Free Software Foundation, Inc.
  2. # This program is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 2, or (at your option)
  5. # any later version.
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. # GNU General Public License for more details.
  10. # You should have received a copy of the GNU General Public License
  11. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. package Automake::Language;
  13. use 5.006;
  14. use strict;
  15. use Class::Struct ();
  16. Class::Struct::struct (
  17. # Short name of the language (c, f77...).
  18. 'name' => "\$",
  19. # Nice name of the language (C, Fortran 77...).
  20. 'Name' => "\$",
  21. # List of configure variables which must be defined.
  22. 'config_vars' => '@',
  23. # 'pure' is '1' or ''. A 'pure' language is one where, if
  24. # all the files in a directory are of that language, then we
  25. # do not require the C compiler or any code to call it.
  26. 'pure' => "\$",
  27. 'autodep' => "\$",
  28. # Name of the compiling variable (COMPILE).
  29. 'compiler' => "\$",
  30. # Content of the compiling variable.
  31. 'compile' => "\$",
  32. # Flag to require compilation without linking (-c).
  33. 'compile_flag' => "\$",
  34. 'extensions' => '@',
  35. # A subroutine to compute a list of possible extensions of
  36. # the product given the input extensions.
  37. # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
  38. 'output_extensions' => "\$",
  39. # A list of flag variables used in 'compile'.
  40. # (defaults to [])
  41. 'flags' => "@",
  42. # Any tag to pass to libtool while compiling.
  43. 'libtool_tag' => "\$",
  44. # The file to use when generating rules for this language.
  45. # The default is 'depend2'.
  46. 'rule_file' => "\$",
  47. # Name of the linking variable (LINK).
  48. 'linker' => "\$",
  49. # Content of the linking variable.
  50. 'link' => "\$",
  51. # Name of the compiler variable (CC).
  52. 'ccer' => "\$",
  53. # Name of the linker variable (LD).
  54. 'lder' => "\$",
  55. # Content of the linker variable ($(CC)).
  56. 'ld' => "\$",
  57. # Flag to specify the output file (-o).
  58. 'output_flag' => "\$",
  59. '_finish' => "\$",
  60. # This is a subroutine which is called whenever we finally
  61. # determine the context in which a source file will be
  62. # compiled.
  63. '_target_hook' => "\$",
  64. # If TRUE, nodist_ sources will be compiled using specific rules
  65. # (i.e. not inference rules). The default is FALSE.
  66. 'nodist_specific' => "\$");
  67. sub finish ($)
  68. {
  69. my ($self) = @_;
  70. if (defined $self->_finish)
  71. {
  72. &{$self->_finish} (@_);
  73. }
  74. }
  75. sub target_hook ($$$$%)
  76. {
  77. my ($self) = @_;
  78. if (defined $self->_target_hook)
  79. {
  80. $self->_target_hook->(@_);
  81. }
  82. }
  83. 1;
  84. ### Setup "GNU" style for perl-mode and cperl-mode.
  85. ## Local Variables:
  86. ## perl-indent-level: 2
  87. ## perl-continued-statement-offset: 2
  88. ## perl-continued-brace-offset: 0
  89. ## perl-brace-offset: 0
  90. ## perl-brace-imaginary-offset: 0
  91. ## perl-label-offset: -2
  92. ## cperl-indent-level: 2
  93. ## cperl-brace-offset: 0
  94. ## cperl-continued-brace-offset: 0
  95. ## cperl-label-offset: -2
  96. ## cperl-extra-newline-before-brace: t
  97. ## cperl-merge-trailing-else: nil
  98. ## cperl-continued-statement-offset: 2
  99. ## End: