PageRenderTime 62ms CodeModel.GetById 33ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/Beta_3_8_10/aclocal.m4

#
m4 | 181 lines | 71 code | 20 blank | 90 comment | 0 complexity | 40bd0f0be7e3c903cfb118f90a8be29c MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
  1. # $Id: aclocal.m4 6029 2003-06-01 15:42:54Z $
  2. # This file extends Autoconf. -*- Autoconf -*-
  3. # Programming language support for the PASCAL language
  4. #
  5. # Copyright 2003 Claus Faerber
  6. # based on Autoconf Copyright 2001 Free Software Foundation
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2, or (at your option)
  11. # any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. # General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  21. # USA.
  22. #
  23. # As a special exception, the copyright holders give unlimited
  24. # permission to copy, distribute and modify the configure scripts that
  25. # are the output of Autoconf. You need not follow the terms of the GNU
  26. # General Public License when using or distributing such scripts, even
  27. # though portions of the text of Autoconf appear in them. The GNU
  28. # General Public License (GPL) does govern all other use of the material
  29. # that constitutes the Autoconf program.
  30. #
  31. # Certain portions of the Autoconf source text are designed to be copied
  32. # (in certain cases, depending on the input) into the output of
  33. # Autoconf. We call these the "data" portions. The rest of the
  34. # Autoconf source text consists of comments plus executable code that
  35. # decides which of the data portions to output in any given case. We
  36. # call these comments and executable code the "non-data" portions.
  37. # Autoconf never copies any of the non-data portions into its output.
  38. #
  39. # This special exception to the GPL applies to versions of Autoconf
  40. # released by the current copyright holders. When you make and
  41. # distribute a modified version of Autoconf, you may extend this special
  42. # exception to the GPL to apply to your modified version as well,
  43. # *unless* your modified version has the potential to copy into its
  44. # output some of the text that was the non-data portion of the version
  45. # that you started with. (In other words, unless your change moves or
  46. # copies text from the non-data portions to the data portions.) If your
  47. # modification has such potential, you must delete any notice of this
  48. # special exception to the GPL from your modified version.
  49. #
  50. # Written by Claus Faerber for OpenXP <http://www.openxp.de>
  51. AC_PREREQ(2.53)
  52. AC_COPYRIGHT(Autoconf for PASCAL - (PASCAL)Copyright 2003 Claus Faerber)
  53. ## ----------------------------------------------------------------- ##
  54. ## 1. The PASCAL Language ##
  55. ## ----------------------------------------------------------------- ##
  56. m4_define([AC_LANG(PASCAL)],
  57. [ac_ext=pp
  58. ac_ppc='$PPC $PPCFLAGS'
  59. ac_compile='$PPC $PPCFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
  60. ac_link='$PPC $PPCFLAGS $LDFLAGS $LIBS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
  61. ac_compiler_gnu=$ac_cv_ppc_compiler_gnu
  62. ])
  63. AU_DEFUN([AC_LANG_PASCAL], [AC_LANG(PASCAL)])
  64. m4_define([_AC_LANG_ABBREV(PASCAL)], [pas])
  65. ## ----------------------------------------------------------------- ##
  66. ## 2. Producing programs. ##
  67. ## ----------------------------------------------------------------- ##
  68. # AC_LANG_SOURCE(PASCAL)(BODY)
  69. # -----------------------
  70. m4_define([AC_LANG_SOURCE(PASCAL)],
  71. [(*@S|@include confdefs.inc *)
  72. $1])
  73. # AC_LANG_PROGRAM(PASCAL)([PROLOGUE], [BODY])
  74. # --------------------------------------
  75. m4_define([AC_LANG_PROGRAM(PASCAL)],
  76. [program conftest;
  77. $1
  78. begin
  79. $2
  80. halt(0);
  81. end.])
  82. # AC_LANG_CALL(PASCAL)(PROLOGUE, FUNCTION)
  83. # -----------------------------------
  84. # Avoid conflicting decl of main.
  85. m4_define([AC_LANG_CALL(PASCAL)],
  86. [AC_LANG_PROGRAM([$1, [$2;])])])
  87. # AC_LANG_FUNC_LINK_TRY(PASCAL)(FUNCTION)
  88. # ----------------------------------
  89. m4_define([AC_LANG_FUNC_LINK_TRY(PASCAL)],
  90. [AC_LANG_PROGRAM([var f: pointer;],[
  91. f := @$1;
  92. ])])
  93. # AC_LANG_BOOL_COMPILE_TRY(PASCAL)(PROLOGUE, EXPRESSION)
  94. # -------------------------------------------------
  95. # Be sure to use this array to avoid `unused' warnings, which are even
  96. # errors with `-W error'.
  97. m4_define([AC_LANG_BOOL_COMPILE_TRY(PASCAL)],
  98. [AC_LANG_PROGRAM([$1
  99. var test_array = array @<:@0..(1-2*ord(not($2)))@:>@;],[
  100. test_array @<:@0@:>@ := 0
  101. ])])
  102. # AC_LANG_INT_SAVE(PASCAL)(PROLOGUE, EXPRESSION)
  103. # -----------------------------------------
  104. # We need assign/close from Borland Pascal/Delphi, also supported by
  105. # Free Pascal and GPC.
  106. # It might be a good idea to alternatively use the standardised method
  107. # (bind) based on previous Autoconf tests
  108. m4_define([AC_LANG_INT_SAVE(PASCAL)],
  109. [AC_LANG_PROGRAM([$1
  110. function integer_val: integer;
  111. begin
  112. integer_val := ($2);
  113. end;
  114. var f: text;
  115. ],
  116. [
  117. assign(f,'conftest.val');
  118. rewrite(f);
  119. writeln(f,($2));
  120. close(f);
  121. ])])
  122. ## ----------------------------------------------------------------- ##
  123. ## 3. Looking for Compilers and Preprocessors. ##
  124. ## ----------------------------------------------------------------- ##
  125. # AC_LANG_COMPILER(PASCAL)
  126. # -------------------
  127. # Find the PASCAL compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able.
  128. AC_DEFUN([AC_LANG_COMPILER(PASCAL)],
  129. [AC_REQUIRE([AC_PROG_PPC])])
  130. # AC_PROG_PPC([COMPILER ...])
  131. # --------------------------
  132. # COMPILER ... is a space separated list of PASCAL compilers to search for.
  133. # This just gives the user an opportunity to specify an alternative
  134. # search list for the PASCAL compiler.
  135. AC_DEFUN([AC_PROG_PPC],
  136. [AC_LANG_PUSH(PASCAL)dnl
  137. AC_ARG_VAR([PPC], [PASCAL compiler command])dnl
  138. AC_ARG_VAR([PPCFLAGS], [PASCAL compiler flags])dnl
  139. dnl _AC_ARG_VAR_LDFLAGS()dnl
  140. dnl _AC_ARG_VAR_CPPFLAGS()dnl
  141. m4_ifval([$1],
  142. [AC_CHECK_TOOLS(PPC, [$1])],
  143. [AC_CHECK_TOOLS(PPC, gpc ppc386 dcc)
  144. ])
  145. test -z "$PPC" && AC_MSG_ERROR([no acceptable PASCAL compiler found in \$PATH])
  146. # Provide some information about the compiler.
  147. echo "$as_me:$LINENO:" \
  148. "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
  149. ac_compiler=`set X $ac_compile; echo $[2]`
  150. _AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
  151. _AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
  152. _AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
  153. m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
  154. m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
  155. _AC_LANG_COMPILER_GNU
  156. GPC=`test $ac_compiler_gnu = yes && echo yes`
  157. AC_LANG_POP(PASCAL)dnl
  158. ])# AC_PROG_PPC
  159. ## ----------------------------------------------------------------- ##
  160. ## 4. Compilers' characteristics. ##
  161. ## ----------------------------------------------------------------- ##