From: Michael Tokarev <mjt@tls.msk.ru>
Subject: hurd support v2
Date: Fri, 20 Dec 2024 23:08:37 +0300
Forwarded: no

diff --git a/makedefs b/makedefs
--- a/makedefs
+++ b/makedefs
@@ -696,7 +696,7 @@ EOF
 		esac
 		for name in nsl resolv
 		do
-		    for lib in /usr/lib64 /lib64 /usr/lib /lib
+		    for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
 		    do
 			test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
 			    SYSLIBS="$SYSLIBS -l$name"
@@ -704,12 +704,12 @@ EOF
 			}
 		    done
 		done
-		case "`uname -s`" in
-		GNU)
-			# currently no IPv6 support on Hurd
-			CCARGS="$CCARGS -DNO_IPV6"
-			;;
-		esac
+		: ${SHLIB_SUFFIX=.so}
+		: ${SHLIB_CFLAGS=-fPIC}
+		: ${SHLIB_LD="${CC-gcc} -shared"' -Wl,-soname,${LIB}'}
+		: ${SHLIB_RPATH='-Wl,-rpath,${SHLIB_DIR}'}
+		: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
+		: ${PLUGIN_LD="${CC-gcc} -shared"}
 		;;
      IRIX*.5.*)	SYSTYPE=IRIX5
 		# Use the native compiler by default
diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h
--- a/src/util/sys_defs.h
+++ b/src/util/sys_defs.h
@@ -918,22 +918,24 @@ extern int initgroups(const char *, int);
 #endif
 #define SOCKADDR_SIZE	socklen_t
 #define SOCKOPT_SIZE	socklen_t
-#ifdef __FreeBSD_kernel__
 #define HAS_DUPLEX_PIPE
-#define HAS_ISSETUGID
-#endif
 #ifndef NO_IPV6
 #define HAS_IPV6
-#ifdef __FreeBSD_kernel__
 #define HAVE_GETIFADDRS
-#else
-#define HAS_PROCNET_IFINET6
-#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
 #endif
-#endif
-#define CANT_USE_SEND_RECV_MSG
 #define DEF_SMTP_CACHE_DEMAND	0
 #define PREFERRED_RAND_SOURCE	"dev:/dev/urandom"
+#define USE_SYSV_POLL
+#ifndef NO_POSIX_GETPW_R
+#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 1) \
+	|| (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 1) \
+	|| (defined(_BSD_SOURCE) && _BSD_SOURCE >= 1) \
+	|| (defined(_SVID_SOURCE) && _SVID_SOURCE >= 1) \
+	|| (defined(_POSIX_SOURCE) && _POSIX_SOURCE >= 1)
+#define HAVE_POSIX_GETPW_R
+#endif
+#endif
+#define HAS_CLOSEFROM
 #endif
 
  /*
