Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary MIME-Version: 1.0 X-Mailer: MIME-tools 5.411 (Entity 5.404) X-RT-Original-Encoding: iso-8859-1 Content-Length: 46797 From nneul@umr.edu Tue Apr 30 16:51:48 2002 Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.7.21.83]) by rt-11.mit.edu (8.9.3/8.9.3) with ESMTP id QAA19997 for ; Tue, 30 Apr 2002 16:51:48 -0400 (EDT) Received: from smtp.umr.edu (mrelay2.cc.umr.edu [131.151.1.89]) by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with ESMTP id QAA20047 for ; Tue, 30 Apr 2002 16:51:47 -0400 (EDT) Received: from pulsar.cc.umr.edu (pulsar.cc.umr.edu [131.151.1.79]) via ESMTP by mrelay2.cc.umr.edu (8.12.1/) id g3UKpjIf003882; Tue, 30 Apr 2002 15:51:45 -0500 Received: (from nneul@localhost) by pulsar.cc.umr.edu (8.12.1/8.12.0.Beta7) id g3UKpjHm025150; Tue, 30 Apr 2002 15:51:45 -0500 Message-Id: <200204302051.g3UKpjHm025150@pulsar.cc.umr.edu> Date: Tue, 30 Apr 2002 15:51:45 -0500 From: nneul@umr.edu Reply-To: nneul@umr.edu To: krb5-bugs@mit.edu Subject: build bugs on hpux10 due to missing XOPEN_SOURCE_EXTENDED X-Send-Pr-Version: 3.99 >Number: 1101 >Category: krb5-build >Synopsis: hpux10 build bugs - htons/ntohs/gethostbyname_r >Confidential: no >Severity: serious >Priority: high >Responsible: tlyu >State: open >Class: sw-bug >Submitter-Id: unknown >Arrival-Date: Tue Apr 30 16:52:01 EDT 2002 >Last-Modified: Wed May 01 15:01:01 EDT 2002 >Originator: Nathan Neulinger >Organization: -- Nathan ------------------------------------------------------------ Nathan Neulinger EMail: nneul@umr.edu University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 >Release: krb5-current-20020427 >Environment: System: HP-UX planck03 B.10.20 A 9000/782 2010493739 two-user license >Description: h_errno, ntohs, htons all need _XOPEN_SOURCE_EXTENDED to be defined gethostbyname_r is failing to determine a return type, it also needs _XOPEN_SOURCE_EXTENDED. >How-To-Repeat: build on an hpux 10 box >Fix: add configure check for whether _XOPEN_SOURCE_EXTENDED is needed >Audit-Trail: From: Sam Hartman To: nneul@umr.edu Cc: krb5-bugs@MIT.EDU Subject: Re: krb5-build/1101: build bugs on hpux10 due to missing XOPEN_SOURCE_EXTENDED Date: Tue, 30 Apr 2002 18:03:23 -0400 One problem like defining symbols like _ANSI_SOURCE or _XOPEN_SOURCE_EXTENDED is that they reduce the available symbols on some architectures. Do you have a proposal for how to set up a configure test that will only define the symbol when needed but never when problematic? From: Nathan Neulinger To: Sam Hartman Cc: krb5-bugs@MIT.EDU Subject: Re: krb5-build/1101: build bugs on hpux10 due to missingXOPEN_SOURCE_EXTENDED Date: Tue, 30 Apr 2002 19:07:34 -0500 Sam Hartman wrote: > > One problem like defining symbols like _ANSI_SOURCE or > _XOPEN_SOURCE_EXTENDED is that they reduce the available symbols on > some architectures. Do you have a proposal for how to set up a > configure test that will only define the symbol when needed but never > when problematic? Yeah, I have one in my local source for herrno. Will try and modify as needed for the rest of the symbols. -- Nathan ------------------------------------------------------------ Nathan Neulinger EMail: nneul@umr.edu University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 From: "Neulinger, Nathan" To: "Sam Hartman" Cc: Subject: RE: krb5-build/1101: build bugs on hpux10 due to missingXOPEN_SOURCE_EXTENDED Date: Wed, 1 May 2002 08:09:52 -0500 Well, I take that back... I can deal with ntohs/htons and h_errno no problem. I'm not sure on the gethostbyname_r though. I'm getting two symptoms with it - first, it can't determine a return type. (The netdb.h header has like 4 different prototypes depending on which defines are present, but this shouldn't matter.) But then later on in the compile, it doesn't have a def for it. -- Nathan ------------------------------------------------------------ Nathan Neulinger EMail: nneul@umr.edu University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 > -----Original Message----- > From: Neulinger, Nathan > Sent: Tuesday, April 30, 2002 7:08 PM > To: Sam Hartman > Cc: krb5-bugs@mit.edu > Subject: Re: krb5-build/1101: build bugs on hpux10 due to > missingXOPEN_SOURCE_EXTENDED > > > Sam Hartman wrote: > > > > One problem like defining symbols like _ANSI_SOURCE or > > _XOPEN_SOURCE_EXTENDED is that they reduce the available symbols on > > some architectures. Do you have a proposal for how to set up a > > configure test that will only define the symbol when needed > but never > > when problematic? > > Yeah, I have one in my local source for herrno. Will try and modify as > needed for the rest of the symbols. > > -- Nathan > > ------------------------------------------------------------ > Nathan Neulinger EMail: nneul@umr.edu > University of Missouri - Rolla Phone: (573) 341-4841 > Computing Services Fax: (573) 341-4216 > From: Nathan Neulinger To: Sam Hartman Cc: krb5-bugs@mit.edu Subject: Re: krb5-build/1101: build bugs on hpux10 due to missing XOPEN_SOURCE_EXTENDED Date: Wed, 1 May 2002 09:35:12 -0500 --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Here's a diff that mostly takes care of the problem. Unfortunately, it uncovered other stuff that was wrong on hpux10, namely, getservbyname_r and getservbyport_r do not take a 5th buffer-size argument. They have only 4 args. Patch is not perfect, it winds up getting _D_XOPEN_SOURCE_EXTENDED on the cmd line more than once. But this whole mess should only be needed on HPUX-10 anyway. I'll come up with a patch for the getserv* problem, but do you have a preference on naming/etc? i.e. #ifdef GETSERVBY_R_NO_BUFSIZE_ARG #endif -- Nathan On Tue, Apr 30, 2002 at 06:03:23PM -0400, Sam Hartman wrote: > > One problem like defining symbols like _ANSI_SOURCE or > _XOPEN_SOURCE_EXTENDED is that they reduce the available symbols on > some architectures. Do you have a proposal for how to set up a > configure test that will only define the symbol when needed but never > when problematic? > > -- Nathan ------------------------------------------------------------ Nathan Neulinger EMail: nneul@umr.edu University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xopen.diff" Index: src/aclocal.m4 =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/aclocal.m4,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 aclocal.m4 --- src/aclocal.m4 25 Apr 2002 23:39:51 -0000 1.1.1.2 +++ src/aclocal.m4 1 May 2002 14:19:20 -0000 @@ -1396,4 +1444,93 @@ fi done done +]) + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED is needed for h_errno use +dnl +AC_DEFUN([KRB5_CHECK_XOPEN_DEFINES], [ +AC_CACHE_CHECK([whether h_errno need _XOPEN_SOURCE_EXTENDED], +krb5_cv_h_errno_needs_xse, +[ +AC_TRY_COMPILE( + [#include ], + [h_errno;], + krb5_cv_h_errno_needs_xse=no, + krb5_cv_h_errno_needs_xse=maybe) + +if test $krb5_cv_h_errno_needs_xse = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED + #include ], + [h_errno;], + krb5_cv_h_errno_needs_xse=yes, + krb5_cv_h_errno_needs_xse=no) +fi +]) +if test $krb5_cv_h_errno_needs_xse = yes; then + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED" + AC_SUBST(CCOPTS) +fi + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED is needed for htons/ntohs use +dnl +AC_CACHE_CHECK([whether htons/ntohs need _XOPEN_SOURCE_EXTENDED], +krb5_cv_ntohs_htons_needs_xse, +[ +AC_TRY_COMPILE( + [#include ], + [htons(1);ntohs(1);], + krb5_cv_ntohs_htons_needs_xse=no, + krb5_cv_ntohs_htons_needs_xse=maybe) + +if test $krb5_cv_h_errno_needs_xse = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED + #include ], + [htons(1);ntohs(1);], + krb5_cv_ntohs_htons_needs_xse=yes, + krb5_cv_ntohs_htons_needs_xse=no) +fi +]) +if test $krb5_cv_ntohs_htons_needs_xse = yes; then + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED" + AC_SUBST(CCOPTS) +fi + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED and _REENTRANT is needed for gethostbyname_r use +dnl This test is reversed - if it works without, and fails with, then the defs are needed +dnl cause without, there is no prototype. +dnl +AC_CACHE_CHECK([whether gethostbyname_r needs xopen, reentrant, and protos], +krb5_cv_ghbn_r_needs_xsere, +[ +AC_TRY_COMPILE( + [#include +extern char gethostbyname_r ();], + [1;], + krb5_cv_ghbn_r_needs_xsere=maybe, + krb5_cv_ghbn_r_needs_xsere=no) + +if test $krb5_cv_ghbn_r_needs_xsere = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED +#define _REENTRANT +#include +extern char gethostbyname_r ();], + [1;], + krb5_cv_ghbn_r_needs_xsere=no, + krb5_cv_ghbn_r_needs_xsere=yes) +fi +]) +if test $krb5_cv_ghbn_r_needs_xsere = yes; then + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED" + CCOPTS="$CCOPTS -D_REENTRANT" + CCOPTS="$CCOPTS -D_PROTOTYPES" + AC_SUBST(CCOPTS) +fi + + ]) Index: src/appl/telnet/telnet/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/telnet/telnet/configure.in,v retrieving revision 1.1.1.2 retrieving revision 1.4 diff -u -r1.1.1.2 -r1.4 --- src/appl/telnet/telnet/configure.in 25 Apr 2002 23:40:14 -0000 1.1.1.2 +++ src/appl/telnet/telnet/configure.in 1 May 2002 13:48:19 -0000 1.4 @@ -49,5 +49,7 @@ AC_DEFINE(KRB4) fi dnl +KRB5_CHECK_XOPEN_DEFINES +dnl KRB5_BUILD_PROGRAM V5_AC_OUTPUT_MAKEFILE Index: src/appl/telnet/telnetd/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/telnet/telnetd/configure.in,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- src/appl/telnet/telnetd/configure.in 3 Apr 2002 15:22:28 -0000 1.1.1.1 +++ src/appl/telnet/telnetd/configure.in 1 May 2002 13:48:19 -0000 1.3 @@ -62,5 +66,6 @@ dnl KRB5_NEED_PROTO([#include ],unsetenv,1) KRB5_NEED_PROTO([#include ],setenv,1) +KRB5_CHECK_XOPEN_DEFINES KRB5_BUILD_PROGRAM V5_AC_OUTPUT_MAKEFILE Index: src/clients/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/clients/configure.in,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- src/clients/configure.in 3 Apr 2002 15:22:29 -0000 1.1.1.1 +++ src/clients/configure.in 1 May 2002 13:48:19 -0000 1.3 @@ -20,6 +20,7 @@ ) ;; esac +KRB5_CHECK_XOPEN_DEFINES AC_SUBST(KSU_LIBS) K5_GEN_MAKEFILE(.) K5_GEN_MAKEFILE(klist) Index: src/include/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/include/configure.in,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- src/include/configure.in 25 Apr 2002 23:40:18 -0000 1.1.1.2 +++ src/include/configure.in 1 May 2002 13:48:20 -0000 1.2 @@ -5,6 +5,7 @@ AC_PROG_AWK AC_PROG_LEX AC_C_CONST +KRB5_CHECK_XOPEN_DEFINES AC_CHECK_FUNCS(strdup labs setvbuf memmove bcopy inet_ntoa inet_aton gethostbyname_r gethostbyaddr_r getservbyname_r getservbyport_r) dnl dnl Check what the return type for gethostbyname_r is. Index: src/include/fake-addrinfo.h =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/include/fake-addrinfo.h,v retrieving revision 1.1.1.3 retrieving revision 1.2 diff -u -r1.1.1.3 -r1.2 --- src/include/fake-addrinfo.h 30 Apr 2002 19:19:53 -0000 1.1.1.3 +++ src/include/fake-addrinfo.h 1 May 2002 14:11:55 -0000 1.2 @@ -313,11 +313,8 @@ # define ADDRINFO_UNDEF_INLINE #endif -#if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(HAVE_MACSOCK_H) && !defined(_WIN32) -/* Hack for HPUX, to get h_errno. */ -# define _XOPEN_SOURCE_EXTENDED 1 -# include -# undef _XOPEN_SOURCE_EXTENDED +#if !defined(HAVE_MACSOCK_H) && !defined(_WIN32) +#include #endif #ifdef HAVE_FAKE_GETADDRINFO Index: src/lib/krb5/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/lib/krb5/configure.in,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- src/lib/krb5/configure.in 3 Apr 2002 15:23:02 -0000 1.1.1.1 +++ src/lib/krb5/configure.in 1 May 2002 13:48:20 -0000 1.3 @@ -14,6 +14,7 @@ AC_REPLACE_FUNCS(vfprintf vsprintf strdup strcasecmp strerror memmove daemon getuid sscanf syslog) KRB5_AC_REGEX_FUNCS KRB5_NEED_PROTO([#include ],strptime) +KRB5_CHECK_XOPEN_DEFINES dnl KRB5_SOCKADDR_SA_LEN KRB5_GETPEERNAME_ARGS Index: src/util/pty/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/util/pty/configure.in,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- src/util/pty/configure.in 3 Apr 2002 15:23:12 -0000 1.1.1.1 +++ src/util/pty/configure.in 1 May 2002 13:48:20 -0000 1.3 @@ -284,6 +284,7 @@ AC_DEFINE(SETPGRP_TWOARG) fi dnl +KRB5_CHECK_XOPEN_DEFINES ADD_DEF(-DKERBEROS) KRB5_AC_INET6 AC_C_CONST --ZPt4rx8FFjLCG7dd-- From: Nathan Neulinger To: Sam Hartman Cc: krb5-bugs@mit.edu Subject: Re: krb5-build/1101: build bugs on hpux10 due to missing XOPEN_SOURCE_EXTENDED Date: Wed, 1 May 2002 09:44:04 -0500 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Attached is slight improvement to aclocal.m4 diff. Rest of patch stays same though. On Wed, May 01, 2002 at 09:35:12AM -0500, Neulinger, Nathan wrote: > Here's a diff that mostly takes care of the problem. Unfortunately, it uncovered other > stuff that was wrong on hpux10, namely, getservbyname_r and getservbyport_r do not take > a 5th buffer-size argument. They have only 4 args. > > Patch is not perfect, it winds up getting _D_XOPEN_SOURCE_EXTENDED on the cmd line > more than once. But this whole mess should only be needed on HPUX-10 anyway. > > I'll come up with a patch for the getserv* problem, but do you have a preference on > naming/etc? i.e. > > #ifdef GETSERVBY_R_NO_BUFSIZE_ARG > > #endif > > -- Nathan > > On Tue, Apr 30, 2002 at 06:03:23PM -0400, Sam Hartman wrote: > > > > One problem like defining symbols like _ANSI_SOURCE or > > _XOPEN_SOURCE_EXTENDED is that they reduce the available symbols on > > some architectures. Do you have a proposal for how to set up a > > configure test that will only define the symbol when needed but never > > when problematic? > > > > > -- Nathan > > ------------------------------------------------------------ > Nathan Neulinger EMail: nneul@umr.edu > University of Missouri - Rolla Phone: (573) 341-4841 > Computing Services Fax: (573) 341-4216 > Index: src/aclocal.m4 > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/aclocal.m4,v > retrieving revision 1.1.1.2 > diff -u -r1.1.1.2 aclocal.m4 > --- src/aclocal.m4 25 Apr 2002 23:39:51 -0000 1.1.1.2 > +++ src/aclocal.m4 1 May 2002 14:19:20 -0000 > @@ -1396,4 +1444,93 @@ > fi > done > done > +]) > + > +dnl > +dnl Determine if _XOPEN_SOURCE_EXTENDED is needed for h_errno use > +dnl > +AC_DEFUN([KRB5_CHECK_XOPEN_DEFINES], [ > +AC_CACHE_CHECK([whether h_errno need _XOPEN_SOURCE_EXTENDED], > +krb5_cv_h_errno_needs_xse, > +[ > +AC_TRY_COMPILE( > + [#include ], > + [h_errno;], > + krb5_cv_h_errno_needs_xse=no, > + krb5_cv_h_errno_needs_xse=maybe) > + > +if test $krb5_cv_h_errno_needs_xse = maybe; then > + AC_TRY_COMPILE( > + [#define _XOPEN_SOURCE_EXTENDED > + #include ], > + [h_errno;], > + krb5_cv_h_errno_needs_xse=yes, > + krb5_cv_h_errno_needs_xse=no) > +fi > +]) > +if test $krb5_cv_h_errno_needs_xse = yes; then > + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED" > + AC_SUBST(CCOPTS) > +fi > + > +dnl > +dnl Determine if _XOPEN_SOURCE_EXTENDED is needed for htons/ntohs use > +dnl > +AC_CACHE_CHECK([whether htons/ntohs need _XOPEN_SOURCE_EXTENDED], > +krb5_cv_ntohs_htons_needs_xse, > +[ > +AC_TRY_COMPILE( > + [#include ], > + [htons(1);ntohs(1);], > + krb5_cv_ntohs_htons_needs_xse=no, > + krb5_cv_ntohs_htons_needs_xse=maybe) > + > +if test $krb5_cv_h_errno_needs_xse = maybe; then > + AC_TRY_COMPILE( > + [#define _XOPEN_SOURCE_EXTENDED > + #include ], > + [htons(1);ntohs(1);], > + krb5_cv_ntohs_htons_needs_xse=yes, > + krb5_cv_ntohs_htons_needs_xse=no) > +fi > +]) > +if test $krb5_cv_ntohs_htons_needs_xse = yes; then > + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED" > + AC_SUBST(CCOPTS) > +fi > + > +dnl > +dnl Determine if _XOPEN_SOURCE_EXTENDED and _REENTRANT is needed for gethostbyname_r use > +dnl This test is reversed - if it works without, and fails with, then the defs are needed > +dnl cause without, there is no prototype. > +dnl > +AC_CACHE_CHECK([whether gethostbyname_r needs xopen, reentrant, and protos], > +krb5_cv_ghbn_r_needs_xsere, > +[ > +AC_TRY_COMPILE( > + [#include > +extern char gethostbyname_r ();], > + [1;], > + krb5_cv_ghbn_r_needs_xsere=maybe, > + krb5_cv_ghbn_r_needs_xsere=no) > + > +if test $krb5_cv_ghbn_r_needs_xsere = maybe; then > + AC_TRY_COMPILE( > + [#define _XOPEN_SOURCE_EXTENDED > +#define _REENTRANT > +#include > +extern char gethostbyname_r ();], > + [1;], > + krb5_cv_ghbn_r_needs_xsere=no, > + krb5_cv_ghbn_r_needs_xsere=yes) > +fi > +]) > +if test $krb5_cv_ghbn_r_needs_xsere = yes; then > + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED" > + CCOPTS="$CCOPTS -D_REENTRANT" > + CCOPTS="$CCOPTS -D_PROTOTYPES" > + AC_SUBST(CCOPTS) > +fi > + > + > ]) > Index: src/appl/telnet/telnet/configure.in > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/telnet/telnet/configure.in,v > retrieving revision 1.1.1.2 > retrieving revision 1.4 > diff -u -r1.1.1.2 -r1.4 > --- src/appl/telnet/telnet/configure.in 25 Apr 2002 23:40:14 -0000 1.1.1.2 > +++ src/appl/telnet/telnet/configure.in 1 May 2002 13:48:19 -0000 1.4 > @@ -49,5 +49,7 @@ > AC_DEFINE(KRB4) > fi > dnl > +KRB5_CHECK_XOPEN_DEFINES > +dnl > KRB5_BUILD_PROGRAM > V5_AC_OUTPUT_MAKEFILE > Index: src/appl/telnet/telnetd/configure.in > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/telnet/telnetd/configure.in,v > retrieving revision 1.1.1.1 > retrieving revision 1.3 > diff -u -r1.1.1.1 -r1.3 > --- src/appl/telnet/telnetd/configure.in 3 Apr 2002 15:22:28 -0000 1.1.1.1 > +++ src/appl/telnet/telnetd/configure.in 1 May 2002 13:48:19 -0000 1.3 > @@ -62,5 +66,6 @@ > dnl > KRB5_NEED_PROTO([#include ],unsetenv,1) > KRB5_NEED_PROTO([#include ],setenv,1) > +KRB5_CHECK_XOPEN_DEFINES > KRB5_BUILD_PROGRAM > V5_AC_OUTPUT_MAKEFILE > Index: src/clients/configure.in > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/clients/configure.in,v > retrieving revision 1.1.1.1 > retrieving revision 1.3 > diff -u -r1.1.1.1 -r1.3 > --- src/clients/configure.in 3 Apr 2002 15:22:29 -0000 1.1.1.1 > +++ src/clients/configure.in 1 May 2002 13:48:19 -0000 1.3 > @@ -20,6 +20,7 @@ > ) > ;; > esac > +KRB5_CHECK_XOPEN_DEFINES > AC_SUBST(KSU_LIBS) > K5_GEN_MAKEFILE(.) > K5_GEN_MAKEFILE(klist) > Index: src/include/configure.in > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/include/configure.in,v > retrieving revision 1.1.1.2 > retrieving revision 1.2 > diff -u -r1.1.1.2 -r1.2 > --- src/include/configure.in 25 Apr 2002 23:40:18 -0000 1.1.1.2 > +++ src/include/configure.in 1 May 2002 13:48:20 -0000 1.2 > @@ -5,6 +5,7 @@ > AC_PROG_AWK > AC_PROG_LEX > AC_C_CONST > +KRB5_CHECK_XOPEN_DEFINES > AC_CHECK_FUNCS(strdup labs setvbuf memmove bcopy inet_ntoa inet_aton gethostbyname_r gethostbyaddr_r getservbyname_r getservbyport_r) > dnl > dnl Check what the return type for gethostbyname_r is. > Index: src/include/fake-addrinfo.h > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/include/fake-addrinfo.h,v > retrieving revision 1.1.1.3 > retrieving revision 1.2 > diff -u -r1.1.1.3 -r1.2 > --- src/include/fake-addrinfo.h 30 Apr 2002 19:19:53 -0000 1.1.1.3 > +++ src/include/fake-addrinfo.h 1 May 2002 14:11:55 -0000 1.2 > @@ -313,11 +313,8 @@ > # define ADDRINFO_UNDEF_INLINE > #endif > > -#if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(HAVE_MACSOCK_H) && !defined(_WIN32) > -/* Hack for HPUX, to get h_errno. */ > -# define _XOPEN_SOURCE_EXTENDED 1 > -# include > -# undef _XOPEN_SOURCE_EXTENDED > +#if !defined(HAVE_MACSOCK_H) && !defined(_WIN32) > +#include > #endif > > #ifdef HAVE_FAKE_GETADDRINFO > Index: src/lib/krb5/configure.in > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/lib/krb5/configure.in,v > retrieving revision 1.1.1.1 > retrieving revision 1.3 > diff -u -r1.1.1.1 -r1.3 > --- src/lib/krb5/configure.in 3 Apr 2002 15:23:02 -0000 1.1.1.1 > +++ src/lib/krb5/configure.in 1 May 2002 13:48:20 -0000 1.3 > @@ -14,6 +14,7 @@ > AC_REPLACE_FUNCS(vfprintf vsprintf strdup strcasecmp strerror memmove daemon getuid sscanf syslog) > KRB5_AC_REGEX_FUNCS > KRB5_NEED_PROTO([#include ],strptime) > +KRB5_CHECK_XOPEN_DEFINES > dnl > KRB5_SOCKADDR_SA_LEN > KRB5_GETPEERNAME_ARGS > Index: src/util/pty/configure.in > =================================================================== > RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/util/pty/configure.in,v > retrieving revision 1.1.1.1 > retrieving revision 1.3 > diff -u -r1.1.1.1 -r1.3 > --- src/util/pty/configure.in 3 Apr 2002 15:23:12 -0000 1.1.1.1 > +++ src/util/pty/configure.in 1 May 2002 13:48:20 -0000 1.3 > @@ -284,6 +284,7 @@ > AC_DEFINE(SETPGRP_TWOARG) > fi > dnl > +KRB5_CHECK_XOPEN_DEFINES > ADD_DEF(-DKERBEROS) > KRB5_AC_INET6 > AC_C_CONST -- Nathan ------------------------------------------------------------ Nathan Neulinger EMail: nneul@umr.edu University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xopen-aclocal.diff" Index: src/aclocal.m4 =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/aclocal.m4,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 aclocal.m4 --- src/aclocal.m4 25 Apr 2002 23:39:51 -0000 1.1.1.2 +++ src/aclocal.m4 1 May 2002 14:40:14 -0000 @@ -1396,4 +1444,91 @@ fi done done +]) + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED is needed for h_errno use +dnl +AC_DEFUN([KRB5_CHECK_XOPEN_DEFINES], [ +AC_CACHE_CHECK([whether h_errno need _XOPEN_SOURCE_EXTENDED], +krb5_cv_h_errno_needs_xse, +[ +AC_TRY_COMPILE( + [#include ], + [h_errno;], + krb5_cv_h_errno_needs_xse=no, + krb5_cv_h_errno_needs_xse=maybe) + +if test $krb5_cv_h_errno_needs_xse = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED + #include ], + [h_errno;], + krb5_cv_h_errno_needs_xse=yes, + krb5_cv_h_errno_needs_xse=no) +fi +]) + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED is needed for htons/ntohs use +dnl +AC_CACHE_CHECK([whether htons/ntohs need _XOPEN_SOURCE_EXTENDED], +krb5_cv_ntohs_htons_needs_xse, +[ +AC_TRY_COMPILE( + [#include ], + [htons(1);ntohs(1);], + krb5_cv_ntohs_htons_needs_xse=no, + krb5_cv_ntohs_htons_needs_xse=maybe) + +if test $krb5_cv_h_errno_needs_xse = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED + #include ], + [htons(1);ntohs(1);], + krb5_cv_ntohs_htons_needs_xse=yes, + krb5_cv_ntohs_htons_needs_xse=no) +fi +]) + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED and _REENTRANT is needed for gethostbyname_r use +dnl This test is reversed - if it works without, and fails with, then the defs are needed +dnl cause without, there is no prototype. +dnl +AC_CACHE_CHECK([whether gethostbyname_r needs xopen, reentrant, and protos], +krb5_cv_ghbn_r_needs_xsere, +[ +AC_TRY_COMPILE( + [#include +extern char gethostbyname_r ();], + [1;], + krb5_cv_ghbn_r_needs_xsere=maybe, + krb5_cv_ghbn_r_needs_xsere=no) + +if test $krb5_cv_ghbn_r_needs_xsere = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED +#define _REENTRANT +#include +extern char gethostbyname_r ();], + [1;], + krb5_cv_ghbn_r_needs_xsere=no, + krb5_cv_ghbn_r_needs_xsere=yes) +fi +]) + +if test $krb5_cv_h_errno_needs_xse = yes -o \ + $krb5_cv_ntohs_htons_needs_xse = yes -o \ + $krb5_cv_ghbn_r_needs_xsere = yes; then + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED" + AC_SUBST(CCOPTS) +fi + +if test $krb5_cv_ghbn_r_needs_xsere = yes; then + CCOPTS="$CCOPTS -D_REENTRANT" + CCOPTS="$CCOPTS -D_PROTOTYPES" + AC_SUBST(CCOPTS) +fi + ]) --5mCyUwZo2JvN/JJP-- From: Nathan Neulinger To: Sam Hartman Cc: krb5-bugs@mit.edu Subject: Re: krb5-build/1101: build bugs on hpux10 due to missing XOPEN_SOURCE_EXTENDED Date: Wed, 1 May 2002 13:59:50 -0500 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've attached a patch that appears to correct all of the problems I have seen building on HP-UX 10.20. Changes it makes: Adds a check for _XOPEN_SOURCE_EXTENDED and _INCLUDE_XOPEN_SOURCE_EXTENDED in aclocal.m4 Adds a check for if gethostbyname_r needs _REENTRANT and _PROTOTOTYPES Calls those check throughout src in several configure.in's Adds a check for the 3 argument version of gethostbyname_r provided by hpux-10 in include/configure.in Add checks for getservbyname/getservbyport missing the bufsize arg on hpux-10 and add defs for this to acconfig.h. arpa/inet.h: added checks lib/krb5/configure.in appl/configure.in arpa/inet.h: added includes lib/krb5/ccache/cc_file.c appl/various-files Removes xopen hack from fake-addrinfo.h Includes stdarg.h if present for telnet.c so curses.h on hpux doesn't flip out. -- Nathan On Tue, Apr 30, 2002 at 06:03:23PM -0400, Sam Hartman wrote: > > One problem like defining symbols like _ANSI_SOURCE or > _XOPEN_SOURCE_EXTENDED is that they reduce the available symbols on > some architectures. Do you have a proposal for how to set up a > configure test that will only define the symbol when needed but never > when problematic? > > -- Nathan ------------------------------------------------------------ Nathan Neulinger EMail: nneul@umr.edu University of Missouri - Rolla Phone: (573) 341-4841 Computing Services Fax: (573) 341-4216 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xopen.diff" Index: acconfig.h =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/acconfig.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 acconfig.h --- acconfig.h 3 Apr 2002 15:22:26 -0000 1.1.1.1 +++ acconfig.h 1 May 2002 15:26:42 -0000 @@ -9,6 +9,10 @@ /* Define if "struct sockaddr_storage" is available. */ #undef HAVE_STRUCT_SOCKADDR_STORAGE +/* Define if getservbyname_r or getservbyport_r don't have a bufsize arg */ +#undef GETSERVBYNAME_R_NO_BUFSIZE_ARG +#undef GETSERVBYPORT_R_NO_BUFSIZE_ARG + /* Define to `long' if doesn't define. */ #undef time_t Index: aclocal.m4 =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/aclocal.m4,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 aclocal.m4 --- aclocal.m4 25 Apr 2002 23:39:51 -0000 1.1.1.2 +++ aclocal.m4 1 May 2002 16:55:04 -0000 @@ -1396,4 +1444,134 @@ fi done done +]) + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED is needed for h_errno use +dnl +AC_DEFUN([KRB5_CHECK_XOPEN_DEFINES], [ +AC_CACHE_CHECK([whether h_errno need _XOPEN_SOURCE_EXTENDED], +krb5_cv_h_errno_needs_xse, +[ +AC_TRY_COMPILE( + [#include ], + [h_errno;], + krb5_cv_h_errno_needs_xse=no, + krb5_cv_h_errno_needs_xse=maybe) + +if test $krb5_cv_h_errno_needs_xse = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED +#define _INCLUDE_XOPEN_SOURCE_EXTENDED + #include ], + [h_errno;], + krb5_cv_h_errno_needs_xse=yes, + krb5_cv_h_errno_needs_xse=no) +fi +]) + +dnl +dnl Determine if _XOPEN_SOURCE_EXTENDED and _REENTRANT is needed for gethostbyname_r use +dnl This test is reversed - if it works without, and fails with, then the defs are needed +dnl cause without, there is no prototype. +dnl +AC_CACHE_CHECK([whether gethostbyname_r needs xopen, reentrant, and protos], +krb5_cv_ghbn_r_needs_xsere, +[ +AC_TRY_COMPILE( + [#include +extern char gethostbyname_r ();], + [1;], + krb5_cv_ghbn_r_needs_xsere=maybe, + krb5_cv_ghbn_r_needs_xsere=no) + +if test $krb5_cv_ghbn_r_needs_xsere = maybe; then + AC_TRY_COMPILE( + [#define _XOPEN_SOURCE_EXTENDED +#define _INCLUDE_XOPEN_SOURCE_EXTENDED +#define _REENTRANT +#define _PROTOTYPES +#include +extern char gethostbyname_r ();], + [1;], + krb5_cv_ghbn_r_needs_xsere=no, + krb5_cv_ghbn_r_needs_xsere=yes) +fi +]) + +if test $krb5_cv_h_errno_needs_xse = yes -o \ + $krb5_cv_ghbn_r_needs_xsere = yes; then + CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED -D_INCLUDE_XOPEN_SOURCE_EXTENDED" + AC_SUBST(CFLAGS) + CCOPTS="$CCOPTS -D_XOPEN_SOURCE_EXTENDED -D_INCLUDE_XOPEN_SOURCE_EXTENDED" + AC_SUBST(CCOPTS) +fi + +if test $krb5_cv_ghbn_r_needs_xsere = yes; then + CFLAGS="$CFLAGS -D_REENTRANT" + CFLAGS="$CFLAGS -D_PROTOTYPES" + AC_SUBST(CFLAGS) + CCOPTS="$CCOPTS -D_REENTRANT" + CCOPTS="$CCOPTS -D_PROTOTYPES" + AC_SUBST(CCOPTS) +fi + +]) + + +dnl +dnl Determine if getservbyname_r lacks bufsize argument +dnl +AC_DEFUN([KRB5_CHECK_GETSERVBY_R_BUFSIZE], [ + +AC_CHECK_FUNCS(getservbyname_r getservbyport_r) + +if test "$ac_cv_func_getservbyname_r" = yes; then +AC_CACHE_CHECK([whether getservbyname_r lacks bufsize argument], +krb5_cv_gsbn_r_no_bufsize_arg, +[ +AC_TRY_COMPILE( + [#include ], + [void *a,*b,*c,*d; int e; getservbyname_r(a,b,c,d,e);], + krb5_cv_gsbn_r_no_bufsize_arg=no, + krb5_cv_gsbn_r_no_bufsize_arg=maybe) + +if test $krb5_cv_gsbn_r_no_bufsize_arg = maybe; then + AC_TRY_COMPILE( + [#include ], + [void *a,*b,*c,*d; getservbyname_r(a,b,c,d);], + krb5_cv_gsbn_r_no_bufsize_arg=yes, + krb5_cv_gsbn_r_no_bufsize_arg=no) +fi +]) +fi + +if test $krb5_cv_gsbn_r_no_bufsize_arg = yes; then + AC_DEFINE(GETSERVBYNAME_R_NO_BUFSIZE_ARG) +fi + +if test "$ac_cv_func_getservbyport_r" = yes; then +AC_CACHE_CHECK([whether getservbyport_r lacks bufsize argument], +krb5_cv_gsbp_r_no_bufsize_arg, +[ +AC_TRY_COMPILE( + [#include ], + [int a; void *b,*c,*d; int e; getservbyport_r(a,b,c,d,e);], + krb5_cv_gsbp_r_no_bufsize_arg=no, + krb5_cv_gsbp_r_no_bufsize_arg=maybe) + +if test $krb5_cv_gsbp_r_no_bufsize_arg = maybe; then + AC_TRY_COMPILE( + [#include ], + [int a; void *b,*c,*d; getservbyname_r(a,b,c,d);], + krb5_cv_gsbp_r_no_bufsize_arg=yes, + krb5_cv_gsbp_r_no_bufsize_arg=no) +fi +]) +fi + +if test $krb5_cv_gsbp_r_no_bufsize_arg = yes; then + AC_DEFINE(GETSERVBYPORT_R_NO_BUFSIZE_ARG) +fi + ]) Index: appl/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/configure.in,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 configure.in --- appl/configure.in 3 Apr 2002 15:22:26 -0000 1.1.1.1 +++ appl/configure.in 1 May 2002 18:16:55 -0000 @@ -1,7 +1,7 @@ AC_INIT(configure.in) CONFIG_RULES AC_PROG_INSTALL -AC_CHECK_HEADERS(unistd.h stdlib.h string.h) +AC_CHECK_HEADERS(unistd.h stdlib.h string.h arpa/inet.h) AC_C_CONST dnl dnl Kludge for simple server --- FIXME is this the best way to do this? @@ -13,6 +13,7 @@ dnl KRB5_GETSOCKNAME_ARGS KRB5_GETPEERNAME_ARGS +KRB5_CHECK_XOPEN_DEFINES KRB5_BUILD_PROGRAM AC_CONFIG_SUBDIRS(bsd gssftp telnet) K5_GEN_MAKEFILE(.) Index: appl/gss-sample/gss-client.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/gss-sample/gss-client.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 gss-client.c --- appl/gss-sample/gss-client.c 3 Apr 2002 15:22:27 -0000 1.1.1.1 +++ appl/gss-sample/gss-client.c 1 May 2002 18:27:15 -0000 @@ -38,6 +38,10 @@ #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif + #include #include "gss-misc.h" Index: appl/gss-sample/gss-misc.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/gss-sample/gss-misc.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 gss-misc.c --- appl/gss-sample/gss-misc.c 3 Apr 2002 15:22:27 -0000 1.1.1.1 +++ appl/gss-sample/gss-misc.c 1 May 2002 18:26:47 -0000 @@ -39,6 +39,10 @@ #endif #include +#ifdef HAVE_ARPA_INET_H +#include +#endif + #include #include "gss-misc.h" Index: appl/gss-sample/gss-server.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/gss-sample/gss-server.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 gss-server.c --- appl/gss-sample/gss-server.c 3 Apr 2002 15:22:27 -0000 1.1.1.1 +++ appl/gss-sample/gss-server.c 1 May 2002 18:25:59 -0000 @@ -45,6 +45,10 @@ #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif + static void usage() { fprintf(stderr, "Usage: gss-server [-port port] [-verbose] [-once]\n"); Index: appl/sample/sserver/sserver.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/sample/sserver/sserver.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 sserver.c --- appl/sample/sserver/sserver.c 3 Apr 2002 15:22:27 -0000 1.1.1.1 +++ appl/sample/sserver/sserver.c 1 May 2002 18:17:50 -0000 @@ -53,6 +53,10 @@ #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif + #include "../sample.h" extern krb5_deltat krb5_clockskew; Index: appl/simple/client/sim_client.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/simple/client/sim_client.c,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 sim_client.c --- appl/simple/client/sim_client.c 25 Apr 2002 23:39:54 -0000 1.1.1.2 +++ appl/simple/client/sim_client.c 1 May 2002 18:16:04 -0000 @@ -47,6 +47,10 @@ #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif + /* for old Unixes and friends ... */ #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 Index: appl/simple/server/sim_server.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/simple/server/sim_server.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 sim_server.c --- appl/simple/server/sim_server.c 3 Apr 2002 15:22:27 -0000 1.1.1.1 +++ appl/simple/server/sim_server.c 1 May 2002 18:16:15 -0000 @@ -41,6 +41,10 @@ #include #include +#ifdef HAVE_ARPA_INET_H +#include +#endif + #include "com_err.h" #include "simple.h" Index: appl/telnet/telnet/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/telnet/telnet/configure.in,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 configure.in --- appl/telnet/telnet/configure.in 25 Apr 2002 23:40:14 -0000 1.1.1.2 +++ appl/telnet/telnet/configure.in 1 May 2002 15:21:52 -0000 @@ -49,5 +49,8 @@ AC_DEFINE(KRB4) fi dnl +KRB5_CHECK_XOPEN_DEFINES +KRB5_CHECK_GETSERVBY_R_BUFSIZE +dnl KRB5_BUILD_PROGRAM V5_AC_OUTPUT_MAKEFILE Index: appl/telnet/telnet/telnet.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/telnet/telnet/telnet.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 telnet.c --- appl/telnet/telnet/telnet.c 3 Apr 2002 15:22:28 -0000 1.1.1.1 +++ appl/telnet/telnet/telnet.c 1 May 2002 18:41:51 -0000 @@ -48,6 +48,10 @@ */ #endif /* defined(unix) */ +#ifdef HAVE_STDARG_H +#include +#endif + #ifdef HAVE_CURSES_H #include #endif Index: appl/telnet/telnetd/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/appl/telnet/telnetd/configure.in,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 configure.in --- appl/telnet/telnetd/configure.in 3 Apr 2002 15:22:28 -0000 1.1.1.1 +++ appl/telnet/telnetd/configure.in 1 May 2002 15:21:58 -0000 @@ -62,5 +66,7 @@ dnl KRB5_NEED_PROTO([#include ],unsetenv,1) KRB5_NEED_PROTO([#include ],setenv,1) +KRB5_CHECK_XOPEN_DEFINES +KRB5_CHECK_GETSERVBY_R_BUFSIZE KRB5_BUILD_PROGRAM V5_AC_OUTPUT_MAKEFILE Index: clients/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/clients/configure.in,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 configure.in --- clients/configure.in 3 Apr 2002 15:22:29 -0000 1.1.1.1 +++ clients/configure.in 1 May 2002 15:22:03 -0000 @@ -11,7 +11,7 @@ SETENVOBJ= fi AC_SUBST(SETENVOBJ) -AC_CHECK_HEADERS(unistd.h pwd.h arpa/inet.h) +AC_CHECK_HEADERS(unistd.h pwd.h arpa/inet.h sys/stat.h) case $krb5_cv_host in alpha*-dec-osf*) AC_CHECK_LIB(security,setluid, @@ -20,6 +20,8 @@ ) ;; esac +KRB5_CHECK_XOPEN_DEFINES +KRB5_CHECK_GETSERVBY_R_BUFSIZE AC_SUBST(KSU_LIBS) K5_GEN_MAKEFILE(.) K5_GEN_MAKEFILE(klist) Index: include/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/include/configure.in,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 configure.in --- include/configure.in 25 Apr 2002 23:40:18 -0000 1.1.1.2 +++ include/configure.in 1 May 2002 17:18:52 -0000 @@ -6,6 +6,35 @@ AC_PROG_LEX AC_C_CONST AC_CHECK_FUNCS(strdup labs setvbuf memmove bcopy inet_ntoa inet_aton gethostbyname_r gethostbyaddr_r getservbyname_r getservbyport_r) +KRB5_CHECK_XOPEN_DEFINES +KRB5_CHECK_GETSERVBY_R_BUFSIZE +dnl +dnl Check for 3-arg version of gethostbyname_r +dnl +if test "$ac_cv_func_gethostbyname_r" = yes; then + AC_MSG_CHECKING([for 3-arg version of gethostbyname_r]) + AC_CACHE_VAL(krb5_cv_gethostbyname_r_3arg, + [ + + AC_TRY_COMPILE([#include ], + [gethostbyname_r(1);], + krb5_cv_gethostbyname_r_3arg=no, + krb5_cv_gethostbyname_r_3arg=maybe) + + if test "$krb5_cv_gethostbyname_r_3arg" = maybe; then + AC_TRY_COMPILE([#include ], + [void *a,*b,*c; gethostbyname_r(a,b,c);], + krb5_cv_gethostbyname_r_3arg=yes, + krb5_cv_gethostbyname_r_3arg=no) + fi +]) + AC_MSG_RESULT($krb5_cv_gethostbyname_r_3arg) + + if test "$krb5_cv_gethostbyname_r_3arg" = yes; then + AC_DEFINE(GETHOSTBYNAME_R_HAS_3_ARGS, 1, [Define if gethostbyname_r takes 3 arguments ]) + fi +fi +dnl dnl dnl Check what the return type for gethostbyname_r is. dnl I don't think we need this for getservbyname_r at the moment, but Index: include/fake-addrinfo.h =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/include/fake-addrinfo.h,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 fake-addrinfo.h --- include/fake-addrinfo.h 30 Apr 2002 19:19:53 -0000 1.1.1.3 +++ include/fake-addrinfo.h 1 May 2002 18:09:14 -0000 @@ -111,6 +111,30 @@ #define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR) \ { (HP) = gethostbyaddr ((ADDR), (ADDRLEN), (FAMILY)); (ERR) = h_errno; } #else +#ifdef GETHOSTBYNAME_R_HAS_3_ARGS + +#define GET_HOST_BY_NAME(NAME, HP, ERR) \ + { \ + struct hostent my_h_ent; \ + char my_h_buf[8192]; \ + (HP) = (gethostbyname_r((NAME), &my_h_ent, \ + my_h_buf) \ + ? 0 \ + : &my_h_ent); \ + (ERR) = 0; \ + } +#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR) \ + { \ + struct hostent my_h_ent; \ + char my_h_buf[8192]; \ + (HP) = (gethostbyaddr_r((ADDR), (ADDRLEN), (FAMILY), &my_h_ent, \ + my_h_buf) \ + ? 0 \ + : &my_h_ent); \ + (ERR) = 0; \ + } + +#else #ifdef GETHOSTBYNAME_R_RETURNS_INT #define GET_HOST_BY_NAME(NAME, HP, ERR) \ { \ @@ -313,11 +338,8 @@ # define ADDRINFO_UNDEF_INLINE #endif -#if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(HAVE_MACSOCK_H) && !defined(_WIN32) -/* Hack for HPUX, to get h_errno. */ -# define _XOPEN_SOURCE_EXTENDED 1 -# include -# undef _XOPEN_SOURCE_EXTENDED +#if !defined(HAVE_MACSOCK_H) && !defined(_WIN32) +#include #endif #ifdef HAVE_FAKE_GETADDRINFO @@ -433,9 +455,15 @@ { char my_s_buf[1024]; struct servent my_s_ent; +#ifdef GETSERVBYNAME_R_NO_BUFSIZE_ARG + sp = getservbyname_r(serv, + socktype == SOCK_STREAM ? "tcp" : "udp", + &my_s_ent, my_s_buf); +#else sp = getservbyname_r(serv, socktype == SOCK_STREAM ? "tcp" : "udp", &my_s_ent, my_s_buf, sizeof(my_s_buf)); +#endif } #else sp = getservbyname (serv, socktype == SOCK_STREAM ? "tcp" : "udp"); @@ -560,9 +588,15 @@ #ifdef HAVE_GETSERVBYPORT_R char my_s_buf[1024]; struct servent my_s_ent; +#ifdef GETSERVBYPORT_R_NO_BUFSIZE_ARG + sp = getservbyport_r(sinp->sin_port, + (flags & NI_DGRAM) ? "udp" : "tcp", + &my_s_ent, my_s_buf); +#else sp = getservbyport_r(sinp->sin_port, (flags & NI_DGRAM) ? "udp" : "tcp", &my_s_ent, my_s_buf, sizeof(my_s_buf)); +#endif #else sp = getservbyport (sinp->sin_port, (flags & NI_DGRAM) ? "udp" : "tcp"); Index: lib/krb5/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/lib/krb5/configure.in,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 configure.in --- lib/krb5/configure.in 3 Apr 2002 15:23:02 -0000 1.1.1.1 +++ lib/krb5/configure.in 1 May 2002 18:28:12 -0000 @@ -9,11 +9,13 @@ dnl dnl AC_HEADER_STDARG -AC_CHECK_HEADERS(unistd.h paths.h regex.h regexp.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h) +AC_CHECK_HEADERS(unistd.h paths.h regex.h regexp.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h arpa/inet.h) AC_CHECK_FUNCS(flock fchmod chmod strftime strptime geteuid setenv unsetenv getenv setsid gethostbyname2 getifaddrs) AC_REPLACE_FUNCS(vfprintf vsprintf strdup strcasecmp strerror memmove daemon getuid sscanf syslog) KRB5_AC_REGEX_FUNCS KRB5_NEED_PROTO([#include ],strptime) +KRB5_CHECK_XOPEN_DEFINES +KRB5_CHECK_GETSERVBY_R_BUFSIZE dnl KRB5_SOCKADDR_SA_LEN KRB5_GETPEERNAME_ARGS Index: lib/krb5/ccache/cc_file.c =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/lib/krb5/ccache/cc_file.c,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 cc_file.c --- lib/krb5/ccache/cc_file.c 25 Apr 2002 23:40:47 -0000 1.1.1.2 +++ lib/krb5/ccache/cc_file.c 1 May 2002 17:50:58 -0000 @@ -94,6 +94,12 @@ #error find some way to use net-byte-order file version numbers. #endif +#ifdef HAVE_ARPA_INET_H +#if !defined(_WIN32) && !defined(HAVE_MACSOCK_H) +#include +#endif +#endif + krb5_error_code KRB5_CALLCONV krb5_fcc_close (krb5_context, krb5_ccache id ); Index: util/pty/configure.in =================================================================== RCS file: /afs/.umr.edu/software/krb5src/cvsroot/krb5-current/src/util/pty/configure.in,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 configure.in --- util/pty/configure.in 3 Apr 2002 15:23:12 -0000 1.1.1.1 +++ util/pty/configure.in 1 May 2002 15:22:39 -0000 @@ -284,6 +284,8 @@ AC_DEFINE(SETPGRP_TWOARG) fi dnl +KRB5_CHECK_XOPEN_DEFINES +KRB5_CHECK_GETSERVBY_R_BUFSIZE ADD_DEF(-DKERBEROS) KRB5_AC_INET6 AC_C_CONST --u3/rZRmxL6MmkK24-- >Unformatted: