3 AT_BANNER([Low level compiling/preprocessing macros.])
5 # Since the macros which compile are required by most tests, check
6 # them first. But remember that looking for a compiler is even more
7 # primitive, so check those first.
10 ## ------------------------------------- ##
11 ## AC_LANG, AC_LANG_PUSH & AC_LANG_POP. ##
12 ## ------------------------------------- ##
14 AT_SETUP([AC_LANG, AC_LANG_PUSH & AC_LANG_POP])
16 AT_DATA([configure.ac],
27 AC_LANG_PUSH(Fortran 77)
29 AC_LANG_POP(Fortran 77)
40 AT_CHECK([sed -n 's/^ac_ext=//p' configure], 0,
60 # As far as we know only `foo', `foo.exe' are possible executable,
61 # and `foo.o', `foo.obj' are possible object files. Autoconf must not
62 # know that, but it is OK for the test suite to take this into account.
63 AT_CHECK_MACRO([Extensions],
67 * ) AC_MSG_ERROR([suspicious executable suffix: $ac_exeext]);;
72 * ) AC_MSG_ERROR([suspicious object suffix: $ac_objext]);;
79 ## -------------------------- ##
80 ## Broken/missing compilers. ##
81 ## -------------------------- ##
84 # Check that Autoconf correctly diagnoses broken compilers, and in
85 # particular, if it does not exit 77, the test suite is in trouble...
86 # FIXME: Once a precise message decided, check stderr of configure.
87 AT_SETUP([Broken/missing compilers])
89 AT_DATA([configure.ac],
96 AT_CHECK_CONFIGURE([], 77, ignore, ignore)
105 # GCC supports `const', `volatile', and `inline'.
106 AT_CHECK_MACRO([C keywords],
111 case $GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile in
113 AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);;
119 ## --------------------------------- ##
120 ## AC_PROG_CPP requires AC_PROG_CC. ##
121 ## --------------------------------- ##
123 # Must invoke AC_PROG_CC.
124 AT_CHECK_MACRO([AC_PROG_CPP requires AC_PROG_CC],
127 AC_MSG_ERROR([looked for a C preprocessor without looking for a compiler])
132 ## --------------------------- ##
133 ## AC_PROG_CPP with warnings. ##
134 ## --------------------------- ##
137 # It's Ok for strict preprocessors to produce warnings.
139 AT_SETUP([AC_PROG_CPP with warnings])
151 # If the preprocessor is not strict, just ignore
152 test "x$ac_c_preproc_warn_flag" = xyes &&
153 AC_MSG_ERROR([preprocessor has no warning option], 77)
155 AC_CHECK_HEADERS(stdio.h autoconf_io.h)]])
158 [/* #undef HAVE_AUTOCONF_IO_H */
159 #define HAVE_STDIO_H 1
165 ## ------------------------------ ##
166 ## AC_PROG_CPP without warnings. ##
167 ## ------------------------------ ##
169 AT_SETUP([AC_PROG_CPP without warnings])
171 # Ignore if /lib/cpp doesn't work
172 AT_CHECK([/lib/cpp </dev/null || exit 77], [], [ignore], [ignore])
174 # A cpp which exit status is meaningless.
186 test "x$ac_c_preproc_warn_flag" != xyes &&
187 AC_MSG_ERROR([failed to detect preprocessor warning option])
188 AC_CHECK_HEADERS(stdio.h autoconf_io.h)]])
191 [/* #undef HAVE_AUTOCONF_IO_H */
192 #define HAVE_STDIO_H 1
199 ## -------------------- ##
200 ## AC_PROG_CPP via CC. ##
201 ## -------------------- ##
204 # It's Ok for strict preprocessors to produce warnings.
206 AT_SETUP([AC_PROG_CPP via CC])
208 # Ignore if /lib/cpp doesn't work
209 AT_CHECK([/lib/cpp </dev/null || exit 77], [], [ignore], [ignore])
213 echo "Annoying copyright message" >&2
219 # We go through the following contortions, in order to have the
220 # configure script go down the same codepaths as it would during a
221 # normal CPP selection check. If we explicitly set CPP, it goes down
222 # a different codepath.
227 # The test $CC compiler should have been selected.
228 test "$CPP" != "$CC -E" &&
229 AC_MSG_ERROR([error messages on stderr cause the preprocessor selection to fail])
232 AC_CHECK_HEADERS(stdio.h autoconf_io.h)]])
235 [/* #undef HAVE_AUTOCONF_IO_H */
236 #define HAVE_STDIO_H 1
242 ## ------------------ ##
243 ## AC_TRY_LINK_FUNC. ##
244 ## ------------------ ##
246 AT_CHECK_MACRO([AC_TRY_LINK_FUNC],
247 [AC_TRY_LINK_FUNC(printf,,
248 [AC_MSG_ERROR([cannot find `printf'])])
249 AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
250 [AC_MSG_ERROR([found a nonexistent function])])])
254 ## --------------------- ##
255 ## Fortran 77 Compiler. ##
256 ## --------------------- ##
259 AT_CHECK_MACRO([GNU Fortran 77],
260 [[AC_LANG(Fortran 77)
263 if AC_TRY_COMMAND([$F77 --version | grep GNU >&2]); then
264 # Be sure to remove files which might be created by compilers that
265 # don't support --version.
267 # Has GNU in --version.
268 test "$G77" != yes &&
269 AC_MSG_ERROR([failed to recognize GNU Fortran 77 compiler])
271 # Be sure to remove files which might be created by compilers that
272 # don't support --version.
276 AC_MSG_ERROR([incorrectly recognized a GNU Fortran 77 compiler])