3 AT_BANNER([Low level compiling/preprocessing macros.])
5 # Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007 Free Software
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 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 # Since the macros which compile are required by most tests, check
23 # them first. But remember that looking for a compiler is even more
24 # primitive, so check those first.
27 ## ------------------------------------- ##
28 ## AC_LANG, AC_LANG_PUSH & AC_LANG_POP. ##
29 ## ------------------------------------- ##
31 AT_SETUP([[AC_LANG, AC_LANG_PUSH & AC_LANG_POP]])
33 AT_DATA([configure.ac],
44 AC_LANG_PUSH(Fortran 77)
46 AC_LANG_POP(Fortran 77)
57 AT_CHECK([sed -n 's/^ac_ext=//p' configure], 0,
73 ## ---------------------- ##
74 ## AC_REQUIRE & AC_LANG. ##
75 ## ---------------------- ##
77 AT_SETUP([AC_REQUIRE & AC_LANG])
79 AT_DATA([configure.ac],
80 [[AC_DEFUN([AC_F77_1],
81 [AC_LANG_PUSH([Fortran 77])
82 if test $ac_ext != f; then
83 AC_MSG_ERROR([F77_1: current shell language is $ac_ext, expected Fortran])
90 [AC_LANG_PUSH([Fortran 77])
91 AC_REQUIRE([AC_F77_1])
92 if test $ac_ext != f; then
93 AC_MSG_ERROR([F77_2: current shell language is $ac_ext, expected Fortran])
109 ## --------------- ##
111 ## --------------- ##
113 AT_SETUP([AC_RUN_IFELSE])
115 AT_DATA([configure.ac],
118 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0])],
120 [AC_MSG_ERROR([saw `return 0' as a failure])])
122 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 2])],
123 [AC_MSG_ERROR([saw `return 2' as a success])],
126 AC_MSG_ERROR([did not get as 2 exit status: $status])])
128 # The old stinky one.
129 AC_TRY_RUN([int main () { return 3; }],
130 [AC_MSG_ERROR([saw `return 3' as a success])],
133 AC_MSG_ERROR([did not get 3 as exit status: $status])])
138 AT_CHECK_CONFIGURE([-q])
142 ## ------------------ ##
143 ## AC_TRY_LINK_FUNC. ##
144 ## ------------------ ##
146 AT_CHECK_MACRO([AC_TRY_LINK_FUNC],
147 [AC_TRY_LINK_FUNC(printf,,
148 [AC_MSG_ERROR([cannot find `printf'])])
149 AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
150 [AC_MSG_ERROR([found a nonexistent function])])])