openbsd-ports/devel/hs-network/patches/patch-configure_ac
2012-12-02 20:27:19 +00:00

51 lines
1.8 KiB
Plaintext

$OpenBSD: patch-configure_ac,v 1.2 2012/12/02 20:27:19 kili Exp $
ucred is sockpeercred on OpenBSD
--- configure.ac.orig Thu Aug 16 18:06:46 2012
+++ configure.ac Wed Nov 21 21:18:41 2012
@@ -70,16 +70,16 @@ AC_EGREP_HEADER(in_addr_t, netinet/in.h,
AC_MSG_RESULT(no))
dnl --------------------------------------------------
-dnl * test for SO_PEERCRED and struct ucred
+dnl * test for SO_PEERCRED and struct sockpeercred
dnl --------------------------------------------------
-AC_MSG_CHECKING(for SO_PEERCRED and struct ucred in sys/socket.h)
+AC_MSG_CHECKING(for SO_PEERCRED and struct sockpeercred in sys/socket.h)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#ifndef SO_PEERCRED
# error no SO_PEERCRED
#endif
-struct ucred u;]])],ac_cv_ucred=yes,ac_cv_ucred=no)
-if test "x$ac_cv_ucred" = xno; then
+struct sockpeercred u;]])],ac_cv_sockpeercred=yes,ac_cv_sockpeercred=no)
+if test "x$ac_cv_sockpeercred" = xno; then
old_CFLAGS="$CFLAGS"
CFLAGS="-D_GNU_SOURCE $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
@@ -87,18 +87,18 @@ if test "x$ac_cv_ucred" = xno; then
#ifndef SO_PEERCRED
# error no SO_PEERCRED
#endif
-struct ucred u;]])],ac_cv_ucred=yes,ac_cv_ucred=no)
- if test "x$ac_cv_ucred" = xyes; then
+struct sockpeercred u;]])],ac_cv_sockpeercred=yes,ac_cv_sockpeercred=no)
+ if test "x$ac_cv_sockpeercred" = xyes; then
EXTRA_CPPFLAGS=-D_GNU_SOURCE
fi
else
old_CFLAGS="$CFLAGS"
fi
-if test "x$ac_cv_ucred" = xno; then
+if test "x$ac_cv_sockpeercred" = xno; then
CFLAGS="$old_CFLAGS"
AC_MSG_RESULT(no)
else
- AC_DEFINE([HAVE_STRUCT_UCRED], [1], [Define to 1 if you have both SO_PEERCRED and struct ucred.])
+ AC_DEFINE([HAVE_STRUCT_SOCKPEERCRED], [1], [Define to 1 if you have both SO_PEERCRED and struct sockpeercred.])
AC_MSG_RESULT(yes)
fi