3 AT_BANNER([Low level compiling/preprocessing macros.])
5 # Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # Since the macros which compile are required by most tests, check
22 # them first. But remember that looking for a compiler is even more
23 # primitive, so check those first.
26 ## ------------------------------------- ##
27 ## AC_LANG, AC_LANG_PUSH & AC_LANG_POP. ##
28 ## ------------------------------------- ##
30 AT_SETUP([AC_LANG, AC_LANG_PUSH & AC_LANG_POP])
32 AT_DATA([configure.ac],
43 AC_LANG_PUSH(Fortran 77)
45 AC_LANG_POP(Fortran 77)
56 AT_CHECK([sed -n 's/^ac_ext=//p' configure], 0,
72 ## ---------------------- ##
73 ## AC_REQUIRE & AC_LANG. ##
74 ## ---------------------- ##
76 AT_SETUP([AC_REQUIRE & AC_LANG])
78 AT_DATA([configure.ac],
79 [[AC_DEFUN([AC_F77_1],
80 [AC_LANG_PUSH([Fortran 77])
81 if test $ac_ext != f; then
82 AC_MSG_ERROR([F77_1: current shell language is $ac_ext, expected Fortran])
89 [AC_LANG_PUSH([Fortran 77])
90 AC_REQUIRE([AC_F77_1])
91 if test $ac_ext != f; then
92 AC_MSG_ERROR([F77_2: current shell language is $ac_ext, expected Fortran])
108 ## --------------- ##
110 ## --------------- ##
112 AT_SETUP([AC_RUN_IFELSE])
114 AT_DATA([configure.ac],
117 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0])],
119 [AC_MSG_ERROR([saw `return 0' as a failure])])
121 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 2])],
122 [AC_MSG_ERROR([saw `return 2' as a success])],
125 AC_MSG_ERROR([did not get as 2 exit status: $status])])
127 # The old stinky one.
128 AC_TRY_RUN([int main () { return 3; }],
129 [AC_MSG_ERROR([saw `return 3' as a success])],
132 AC_MSG_ERROR([did not get 3 as exit status: $status])])
137 AT_CHECK_CONFIGURE([-q])
141 ## ------------------ ##
142 ## AC_TRY_LINK_FUNC. ##
143 ## ------------------ ##
145 AT_CHECK_MACRO([AC_TRY_LINK_FUNC],
146 [AC_TRY_LINK_FUNC(printf,,
147 [AC_MSG_ERROR([cannot find `printf'])])
148 AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
149 [AC_MSG_ERROR([found a nonexistent function])])])