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 2, or (at your option)
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, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 # Since the macros which compile are required by most tests, check
25 # them first. But remember that looking for a compiler is even more
26 # primitive, so check those first.
29 ## ------------------------------------- ##
30 ## AC_LANG, AC_LANG_PUSH & AC_LANG_POP. ##
31 ## ------------------------------------- ##
33 AT_SETUP([[AC_LANG, AC_LANG_PUSH & AC_LANG_POP]])
35 AT_DATA([configure.ac],
46 AC_LANG_PUSH(Fortran 77)
48 AC_LANG_POP(Fortran 77)
59 AT_CHECK([sed -n 's/^ac_ext=//p' configure], 0,
75 ## ---------------------- ##
76 ## AC_REQUIRE & AC_LANG. ##
77 ## ---------------------- ##
79 AT_SETUP([AC_REQUIRE & AC_LANG])
81 AT_DATA([configure.ac],
82 [[AC_DEFUN([AC_F77_1],
83 [AC_LANG_PUSH([Fortran 77])
84 if test $ac_ext != f; then
85 AC_MSG_ERROR([F77_1: current shell language is $ac_ext, expected Fortran])
92 [AC_LANG_PUSH([Fortran 77])
93 AC_REQUIRE([AC_F77_1])
94 if test $ac_ext != f; then
95 AC_MSG_ERROR([F77_2: current shell language is $ac_ext, expected Fortran])
111 ## --------------- ##
113 ## --------------- ##
115 AT_SETUP([AC_RUN_IFELSE])
117 AT_DATA([configure.ac],
120 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0])],
122 [AC_MSG_ERROR([saw `return 0' as a failure])])
124 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 2])],
125 [AC_MSG_ERROR([saw `return 2' as a success])],
128 AC_MSG_ERROR([did not get as 2 exit status: $status])])
130 # The old stinky one.
131 AC_TRY_RUN([int main () { return 3; }],
132 [AC_MSG_ERROR([saw `return 3' as a success])],
135 AC_MSG_ERROR([did not get 3 as exit status: $status])])
140 AT_CHECK_CONFIGURE([-q])
144 ## ------------------ ##
145 ## AC_TRY_LINK_FUNC. ##
146 ## ------------------ ##
148 AT_CHECK_MACRO([AC_TRY_LINK_FUNC],
149 [AC_TRY_LINK_FUNC(printf,,
150 [AC_MSG_ERROR([cannot find `printf'])])
151 AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
152 [AC_MSG_ERROR([found a nonexistent function])])])