]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Fix detection of setres*id on GNU/Hurd
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 26 Mar 2024 21:15:08 +0000 (22:15 +0100)
committerDarren Tucker <dtucker@dtucker.net>
Wed, 3 Jul 2024 09:25:07 +0000 (19:25 +1000)
Like Linux, proper _SOURCE macros need to be set to get declarations of
various standard functions, notably setres*id. Now that Debian is using
-Werror=implicit-function-declaration this is really required. While at
it, define other _SOURCE macros like on GNU/Linux, since GNU/Hurd uses
the same glibc.

configure.ac

index 5a865f8e1b073ed8367196a7aa6f239d2e512158..2eede34c3cf952bd60308b6123d2ee265ed25d90 100644 (file)
@@ -1348,6 +1348,13 @@ EOD
        AC_DEFINE([BROKEN_SETVBUF], [1],
            [LynxOS has broken setvbuf() implementation])
        ;;
+*-*-gnu*)
+       dnl GNU Hurd.  Needs to be after the linux and the other *-gnu entries.
+       dnl Target SUSv3/POSIX.1-2001 plus BSD specifics.
+       dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE
+       dnl _GNU_SOURCE is needed for setres*id prototypes.
+       CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE"
+       ;;
 esac
 
 AC_MSG_CHECKING([compiler and flags for sanity])