diff options
author | Ezra Peisach <epeisach@mit.edu> | 2001-07-30 21:32:48 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2001-07-30 21:32:48 +0000 |
commit | afbd97f9cb5eff6843143b19b72087356e8d472f (patch) | |
tree | 9502bb8002a67f64356c392726277e5206f5f1d8 | |
parent | 9b14df00e562889e5e5e7150106a475c6f42bc41 (diff) | |
download | krb5-afbd97f9cb5eff6843143b19b72087356e8d472f.tar.gz krb5-afbd97f9cb5eff6843143b19b72087356e8d472f.tar.xz krb5-afbd97f9cb5eff6843143b19b72087356e8d472f.zip |
* 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
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/aclocal.m4 | 83 |
2 files changed, 89 insertions, 0 deletions
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 <epeisach@mit.edu> + + * 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 <dalmeida@mit.edu> * 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 <sys/stream.h> 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 <sys/types.h> +#include <sys/socket.h> +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 <sys/types.h> +#include <sys/socket.h> +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 +]) |