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
This commit is contained in:
ewt 1997-04-30 15:32:40 +00:00
parent a2bc26c4c4
commit acb0a9c928
3 changed files with 20 additions and 1 deletions

View File

@ -37,6 +37,9 @@
/* Define as 1 if <sys/stat.h> defines S_ISLNK */
#define HAVE_S_ISLNK 0
/* Define as 1 if <sys/stat.h> defines S_IFSOCK */
#define HAVE_S_IFSOCK 0
/* Define as 1 if <sys/stat.h> defines S_ISSOCK */
#define HAVE_S_ISSOCK 0

View File

@ -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 <sys/stat.h> defines S_IFSOCK...)
AC_TRY_LINK([#include <sys/stat.h>],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 <sys/stat.h> defines S_ISLNK...)
AC_TRY_LINK([#include <sys/stat.h>],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

View File

@ -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