3 AT_BANNER([Low level compiling/preprocessing macros.])
5 # Copyright (C) 2000, 2001, 2003 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 2, or (at your option)
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, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 # Since the macros which compile are required by most tests, check
24 # them first. But remember that looking for a compiler is even more
25 # primitive, so check those first.
28 ## ------------------------------------- ##
29 ## AC_LANG, AC_LANG_PUSH & AC_LANG_POP. ##
30 ## ------------------------------------- ##
32 AT_SETUP([AC_LANG, AC_LANG_PUSH & AC_LANG_POP])
34 AT_DATA([configure.ac],
45 AC_LANG_PUSH(Fortran 77)
47 AC_LANG_POP(Fortran 77)
58 AT_CHECK([sed -n 's/^ac_ext=//p' configure], 0,
74 ## ---------------------- ##
75 ## AC_REQUIRE & AC_LANG. ##
76 ## ---------------------- ##
78 AT_SETUP([AC_REQUIRE & AC_LANG])
80 AT_DATA([configure.ac],
81 [[AC_DEFUN([AC_F77_1],
82 [AC_LANG_PUSH([Fortran 77])
83 if test $ac_ext != f; then
84 AC_MSG_ERROR([F77_1: current shell language is $ac_ext, expected Fortran])
91 [AC_LANG_PUSH([Fortran 77])
92 AC_REQUIRE([AC_F77_1])
93 if test $ac_ext != f; then
94 AC_MSG_ERROR([F77_2: current shell language is $ac_ext, expected Fortran])
110 ## --------------- ##
112 ## --------------- ##
114 AT_SETUP([AC_RUN_IFELSE])
116 AT_DATA([configure.ac],
119 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [exit (0)])],
121 [AC_MSG_ERROR([saw `exit 0' as a failure])])
123 AC_RUN_IFELSE([AC_LANG_PROGRAM([], [exit (2)])],
124 [AC_MSG_ERROR([saw `exit 2' as a success])],
127 AC_MSG_ERROR([did not get as 2 exit status: $status])])
129 # The old stinky one.
130 AC_TRY_RUN([int main () { exit (3); }],
131 [AC_MSG_ERROR([saw `exit 3' as a success])],
134 AC_MSG_ERROR([did not get 3 as exit status: $status])])
139 AT_CHECK_CONFIGURE([-q])
143 ## ------------------ ##
144 ## AC_TRY_LINK_FUNC. ##
145 ## ------------------ ##
147 AT_CHECK_MACRO([AC_TRY_LINK_FUNC],
148 [AC_TRY_LINK_FUNC(printf,,
149 [AC_MSG_ERROR([cannot find `printf'])])
150 AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
151 [AC_MSG_ERROR([found a nonexistent function])])])