1dnl Copyright (C) 1993-2002 Free Software Foundation, Inc. 2dnl This file is free software, distributed under the terms of the GNU 3dnl General Public License. As a special exception to the GNU General 4dnl Public License, this file may be distributed as part of a program 5dnl that contains a configuration script generated by Autoconf, under 6dnl the same distribution terms as the rest of that program. 7 8dnl From Bruno Haible, Marcus Daniels. 9 10AC_PREREQ(2.13) 11 12dnl CL_PROTO(IDENTIFIER, ACTION-IF-NOT-FOUND, FINAL-PROTOTYPE) 13AC_DEFUN([CL_PROTO], 14[AC_MSG_CHECKING([for $1 declaration]) 15AC_CACHE_VAL(cl_cv_proto_[$1], [$2 16cl_cv_proto_$1="$3"]) 17cl_cv_proto_$1=`echo "[$]cl_cv_proto_$1" | tr -s ' ' | sed -e 's/( /(/'` 18AC_MSG_RESULT([$]{ac_t:- 19 }[$]cl_cv_proto_$1) 20]) 21 22dnl CL_PROTO_RET(INCLUDES, DECL, CACHE-ID, TYPE-IF-OK, TYPE-IF-FAILS) 23AC_DEFUN([CL_PROTO_RET], 24[AC_TRY_COMPILE([$1] 25AC_LANG_EXTERN[$2 26], [], $3="$4", $3="$5") 27]) 28 29dnl CL_PROTO_TRY(INCLUDES, ANSI-DECL, TRAD-DECL, ACTION-IF-OK, ACTION-IF-FAILS) 30AC_DEFUN([CL_PROTO_TRY], 31[AC_TRY_COMPILE([$1] 32AC_LANG_EXTERN 33[#if defined(__STDC__) || defined(__cplusplus) 34$2 35#else 36$3 37#endif 38], [], [$4], [$5]) 39]) 40 41dnl CL_PROTO_CONST(INCLUDES, ANSI-DECL, TRAD-DECL, CACHE-ID) 42AC_DEFUN([CL_PROTO_CONST], 43[CL_PROTO_TRY([$1], [$2], [$3], $4="", $4="const")] 44) 45