1 dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
2 dnl This file is free software, distributed under the terms of the GNU
3 dnl General Public License. As a special exception to the GNU General
4 dnl Public License, this file may be distributed as part of a program
5 dnl that contains a configuration script generated by Autoconf, under
6 dnl the same distribution terms as the rest of that program.
8 dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
12 dnl without AC_MSG_...: with AC_MSG_... and caching:
13 dnl AC_TRY_CPP CL_CPP_CHECK
14 dnl AC_TRY_COMPILE CL_COMPILE_CHECK
15 dnl AC_TRY_LINK CL_LINK_CHECK
16 dnl AC_TRY_RUN CL_RUN_CHECK - would require cross-compiling support
18 dnl AC_TRY_CPP(INCLUDES,
19 dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
20 dnl CL_CPP_CHECK(ECHO-TEXT, CACHE-ID,
22 dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
23 dnl AC_TRY_xxx(INCLUDES, FUNCTION-BODY,
24 dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
25 dnl CL_xxx_CHECK(ECHO-TEXT, CACHE-ID,
26 dnl INCLUDES, FUNCTION-BODY,
27 dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
29 AC_DEFUN([CL_CPP_CHECK],
30 [AC_MSG_CHECKING(for $1)
32 AC_TRY_CPP([$3], $2=yes, $2=no)
35 if test [$]$2 = yes; then
36 ifelse([$4], , :, [$4])
37 ifelse([$5], , , [else
43 AC_DEFUN([CL_COMPILE_CHECK],
44 [AC_MSG_CHECKING(for $1)
46 AC_TRY_COMPILE([$3],[$4], $2=yes, $2=no)
49 if test [$]$2 = yes; then
50 ifelse([$5], , :, [$5])
51 ifelse([$6], , , [else
57 AC_DEFUN([CL_LINK_CHECK],
58 [AC_MSG_CHECKING(for $1)
60 AC_TRY_LINK([$3],[$4], $2=yes, $2=no)
63 if test [$]$2 = yes; then
64 ifelse([$5], , :, [$5])
65 ifelse([$6], , , [else
72 dnl performs ACTION, with AC_MSG_CHECKING and AC_MSG_RESULT being defined away.
74 [pushdef([AC_MSG_CHECKING],[:])dnl
75 pushdef([AC_CHECKING],[:])dnl
76 pushdef([AC_MSG_RESULT],[:])dnl
78 popdef([AC_MSG_RESULT])dnl
79 popdef([AC_CHECKING])dnl
80 popdef([AC_MSG_CHECKING])dnl
83 dnl Expands to the "extern ..." prefix used for system declarations.
85 AC_DEFUN([AC_LANG_EXTERN],
92 AC_DEFUN([CL_CC_WORKS],
93 [AC_CACHE_CHECK(whether CC works at all, cl_cv_prog_cc_works, [
96 AC_TRY_RUN([int main() { exit(0); }],
97 cl_cv_prog_cc_works=yes, cl_cv_prog_cc_works=no,
98 AC_TRY_LINK([], [], cl_cv_prog_cc_works=yes, cl_cv_prog_cc_works=no))
101 case "$cl_cv_prog_cc_works" in
102 *no) echo "Installation or configuration problem: C compiler cannot create executables."; exit 1;;