From afbd97f9cb5eff6843143b19b72087356e8d472f Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 30 Jul 2001 21:32:48 +0000 Subject: * aclocal.m4: Add functions KRB5_GETSOCKNAME_ARGS and KRB5_GETPEERNAME_ARGS to elucidate the argument types to getsockname() and getpeername(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13653 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 6 +++++ src/aclocal.m4 | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index f9813da3c2..765e55048b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-07-30 Ezra Peisach + + * aclocal.m4: Add functions KRB5_GETSOCKNAME_ARGS and + KRB5_GETPEERNAME_ARGS to elucidate the argument types to + getsockname() and getpeername(). + 2001-07-23 Danilo Almeida * Makefile.in: Build gssftp client on Win32. diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 2998ed9c95..3506ab0b6a 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -408,6 +408,7 @@ AC_CACHE_VAL(krb5_cv_prog_cc,[dnl # -Wno-comment is for SunOS system header extra_gcc_warn_opts="-Wall -Wmissing-prototypes -Wcast-qual \ -Wcast-align -Wconversion -Wshadow -Wno-comment -pedantic" +#extra_gcc_warn_opts="-Wall -Wmissing-prototypes -Wcast-align -Wshadow -Wno-comment" if test "$GCC" = yes ; then AC_MSG_RESULT(adding extra warning flags for gcc) CCOPTS="$CCOPTS $extra_gcc_warn_opts" @@ -1286,3 +1287,85 @@ if test $krb5_cv_func_$2_noproto = yes; then fi ifelse([$3], ,[fi]) ]) +dnl +dnl ============================================================= +dnl Internal function for testing for getpeername prototype +dnl +AC_DEFUN([TRY_PEER_INT],[ +krb5_lib_var=`echo "$1 $2" | sed 'y% ./+-*%___p_p%'` +AC_MSG_CHECKING([if getpeername() takes arguments $1 and $2]) +AC_CACHE_VAL(krb5_cv_getpeername_proto$krb5_lib_var, +[ +AC_TRY_COMPILE([#include +#include +extern int getpeername(int, $1, $2); +],,eval "krb5_cv_getpeername_proto$krb5_lib_var=yes", + eval "krb5_cv_getpeername_proto$krb5_lib_var=no")]) +if eval "test \"`echo '$krb5_cv_getpeername_proto'$krb5_lib_var`\" = yes"; then + AC_MSG_RESULT(yes) + peer_set=yes + res1=`echo "$1" | tr -d ' *'` + res2=`echo "$2" | tr -d ' *'` + AC_DEFINE_UNQUOTED([GETPEERNAME_ARG2_TYPE],$res1) + AC_DEFINE_UNQUOTED([GETPEERNAME_ARG3_TYPE],$res2) +else + AC_MSG_RESULT(no) +fi +]) +dnl +dnl Determines the types of the second and third arguments to getpeername() +dnl Note: It is possible that noe of the combinations will work and the +dnl code must deal +AC_DEFUN([KRB5_GETPEERNAME_ARGS],[ +peer_set=no +for peer_arg1 in "struct sockaddr *" "void *" +do + for peer_arg2 in "size_t *" "int *" + do + if test $peer_set = no; then + TRY_PEER_INT($peer_arg1, $peer_arg2) + fi + done +done +]) +dnl +dnl ============================================================= +dnl Internal function for testing for getsockname arguments +dnl +AC_DEFUN([TRY_GETSOCK_INT],[ +krb5_lib_var=`echo "$1 $2" | sed 'y% ./+-*%___p_p%'` +AC_MSG_CHECKING([if getsockname() takes arguments $1 and $2]) +AC_CACHE_VAL(krb5_cv_getsockname_proto_$krb5_lib_var, +[ +AC_TRY_COMPILE([#include +#include +extern int getsockname(int, $1, $2); +],,eval "krb5_cv_getsockname_proto_$krb5_lib_var=yes", + eval "krb5_cv_getsockname_proto_$krb5_lib_var=no")]) +if eval "test \"`echo '$krb5_cv_getsockname_proto_'$krb5_lib_var`\" = yes"; then + AC_MSG_RESULT(yes) + sock_set=yes + res1=`echo "$1" | tr -d ' *'` + res2=`echo "$2" | tr -d ' *'` + AC_DEFINE_UNQUOTED([GETSOCKNAME_ARG2_TYPE],$res1) + AC_DEFINE_UNQUOTED([GETSOCKNAME_ARG3_TYPE],$res2) +else + AC_MSG_RESULT(no) +fi +]) +dnl +dnl Determines the types of the second and third arguments to getsockname() +dnl Note: It is possible that noe of the combinations will work and the +dnl code must deal +AC_DEFUN([KRB5_GETSOCKNAME_ARGS],[ +sock_set=no +for sock_arg1 in "struct sockaddr *" "void *" +do + for sock_arg2 in "size_t *" "int *" + do + if test $sock_set = no; then + TRY_GETSOCK_INT($sock_arg1, $sock_arg2) + fi + done +done +]) -- cgit