From acb0a9c9289e0b57c735b42321ac3dbd37e576c4 Mon Sep 17 00:00:00 2001 From: ewt Date: Wed, 30 Apr 1997 15:32:40 +0000 Subject: [PATCH] Look for S_IFSOCK and define it as 0 if it doesn't exist (this is for SCO). CVS patchset: 1563 CVS date: 1997/04/30 15:32:40 --- config.h.in | 3 +++ configure.in | 14 +++++++++++++- misc/miscfn.h | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/config.h.in b/config.h.in index dc6ce8a..86576c7 100644 --- a/config.h.in +++ b/config.h.in @@ -37,6 +37,9 @@ /* Define as 1 if defines S_ISLNK */ #define HAVE_S_ISLNK 0 +/* Define as 1 if defines S_IFSOCK */ +#define HAVE_S_IFSOCK 0 + /* Define as 1 if defines S_ISSOCK */ #define HAVE_S_ISSOCK 0 diff --git a/configure.in b/configure.in index 811bfa6..4e2bf56 100644 --- a/configure.in +++ b/configure.in @@ -212,6 +212,16 @@ if test $PROVIDES_ERRNO = yes; then AC_DEFINE(HAVE_HERRNO) fi +dnl If a system doesn't have S_IFSOCK, define it as 0 which will +dnl make S_ISSOCK always return false (nice, eh?) +AC_MSG_CHECKING(checking if defines S_IFSOCK...) +AC_TRY_LINK([#include ],printf("%d", S_IFSOCK), + HAS_S_IFSOCK=yes,HAS_S_IFSOCK=no) +AC_MSG_RESULT($HAS_S_IFSOCK) +if test $HAS_S_ISLNK=yes; then + AC_DEFINE(HAVE_S_IFSOCK) +fi + dnl Some Unix's are missing S_ISLNK, S_ISSOCK AC_MSG_CHECKING(checking if defines S_ISLNK...) AC_TRY_LINK([#include ],printf("%d", S_ISLNK(0755)), @@ -254,13 +264,15 @@ if test "x$tmpdir" = "x"; then fi fi -if echo "$build" | egrep 'solaris|hpux10' >/dev/null ; then +if echo "$build" | egrep 'solaris|hpux10|sco' >/dev/null ; then # Solaris needs -ldl to use -lnsl, and it can't build static # binaries if you use -ldl RPM=rpm.shared if echo "$build" | grep solaris >/dev/null; then echo "hacking things up for solaris" LIBDL=-ldl + elif echo "$build" | grep sco > /dev/null; then + echo "hacking things up for sco" else echo "hacking things up for hpux" fi diff --git a/misc/miscfn.h b/misc/miscfn.h index 3d174ce..e543069 100644 --- a/misc/miscfn.h +++ b/misc/miscfn.h @@ -19,6 +19,10 @@ char *realpath(char *path, char resolved_path[]); #endif +#if ! HAVE_S_IFSOCK +#define S_IFSOCK (0) +#endif + #if ! HAVE_S_ISLNK #define S_ISLNK(mode) ((mode) & S_IFLNK) #endif -- 2.7.4