From b29fd59ffa3c9376c64471bd521122185fca454e Mon Sep 17 00:00:00 2001 From: dtucker Date: Tue, 2 Nov 2004 09:30:54 +0000 Subject: [PATCH] - (dtucker) [configure.ac includes.h] Bug #947: Fix compile error on HP-UX 10.x by testing for conflicts in shadow.h and undef'ing _INCLUDE__STDC__ only if a conflict is detected. --- ChangeLog | 5 +++++ configure.ac | 19 +++++++++++++++++++ includes.h | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9fc25db2..d79a653f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20041102 + - (dtucker) [configure.ac includes.h] Bug #947: Fix compile error on HP-UX + 10.x by testing for conflicts in shadow.h and undef'ing _INCLUDE__STDC__ + only if a conflict is detected. + 20041019 - (dtucker) [uidswap.c] Don't test dropping of gids for the root user or on Cygwin. Cygwin parts from vinschen at redhat com; ok djm@ diff --git a/configure.ac b/configure.ac index 39a38dc7..91cf8f7e 100644 --- a/configure.ac +++ b/configure.ac @@ -220,6 +220,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) AC_DEFINE(LOCKED_PASSWD_STRING, "*") AC_DEFINE(SPT_TYPE,SPT_PSTAT) check_for_hpux_broken_getaddrinfo=1 + check_for_conflicting_getspnam=1 LIBS="$LIBS -lsec" AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) ;; @@ -1123,6 +1124,24 @@ main(void) ) fi +if test "x$check_for_conflicting_getspnam" = "x1"; then + AC_MSG_CHECKING(for conflicting getspnam in shadow.h) + AC_COMPILE_IFELSE( + [ +#include +int main(void) {exit(0);} + ], + [ + AC_MSG_RESULT(no) + ], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1, + [Conflicting defs for getspnam]) + ] + ) +fi + AC_FUNC_GETPGRP # Check for PAM libs diff --git a/includes.h b/includes.h index 3a6b4c32..3d3aa3b2 100644 --- a/includes.h +++ b/includes.h @@ -185,7 +185,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } * On HP-UX 11.11, shadow.h and prot.h provide conflicting declarations * of getspnam when _INCLUDE__STDC__ is defined, so we unset it here. */ -#ifdef __hpux +#ifdef GETSPNAM_CONFLICTING_DEFS # ifdef _INCLUDE__STDC__ # undef _INCLUDE__STDC__ # endif -- 2.45.2