From 98f89fa0b26ed1dba66a76d4213c2c38b844b795 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 11 Jun 2001 15:14:32 +0000 Subject: [PATCH] * aclocal.m4 (KRB5_NEED_PROTO): Determines if the OS provides a prototype for a function - and if not, allows us to define it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13324 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 5 +++++ src/aclocal.m4 | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 14cd7f7eb..0325cd679 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-06-11 Ezra Peisach + + * aclocal.m4 (KRB5_NEED_PROTO): Determines if the OS provides a + prototype for a function - and if not, allows us to define it. + 2001-06-08 Ezra Peisach * krb5-config.in (CC_LINK): Use ' vs " to prevent bash expansion of diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 585e58d31..95a08a5d2 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1244,3 +1244,26 @@ dnl AC_MSG_RESULT($enable_dns_for_kdc) dnl AC_MSG_CHECKING(if DNS should be used to find realm name by default) dnl AC_MSG_RESULT($enable_dns_for_realm) ]) +dnl +dnl +dnl Check if we need the prototype for a function - we give it a bogus +dnl prototype and if it complains - then a valid prototype exists on the +dnl system. +dnl +dnl KRB5_NEED_PROTO(includes, function) +dnl +AC_DEFUN([KRB5_NEED_PROTO], [ +if test "x$ac_cv_func_$2" = xyes; then +AC_CACHE_CHECK([if $2 needs a prototype provided], krb5_cv_func_$2_noproto, +AC_TRY_COMPILE([$1], +[struct k5foo {int foo; } xx; +extern int $2 (struct k5foo*); +$2(&xx); +], +krb5_cv_func_$2_noproto=yes,krb5_cv_func_$2_noproto=no)) +if test $krb5_cv_func_$2_noproto = yes; then + AC_DEFINE([NEED_]translit($2, [a-z], [A-Z])[_PROTO], 1, dnl +[define if the system header files are missing prototype for $2()]) +fi +fi +]) -- 2.26.2