$NetBSD: patch-plugin_auth__socket_CMakeLists.txt,v 1.2 2023/03/07 10:28:02 jperkin Exp $ Add SO_PEERCRED definitions for NetBSD. https://github.com/MariaDB/server/pull/1884 --- plugin/auth_socket/CMakeLists.txt.orig 2022-11-02 12:37:20.000000000 +0000 +++ plugin/auth_socket/CMakeLists.txt @@ -57,6 +57,21 @@ IF (HAVE_XUCRED) SET(ok 1) ELSE() +# NetBSD, is that you? +CHECK_CXX_SOURCE_COMPILES( +"#include +#include +int main() { + struct unpcbid unp; + socklen_t unpl = sizeof(unp); + getsockopt(0, 0, LOCAL_PEEREID, &unp, &unpl); + }" HAVE_UNPCBID) + +IF (HAVE_UNPCBID) + ADD_DEFINITIONS(-DHAVE_UNPCBID) + SET(ok 1) +ELSE() + # illumos, is that you? CHECK_CXX_SOURCE_COMPILES( "#include @@ -102,6 +117,7 @@ ELSE() ENDIF() ENDIF() ENDIF() +ENDIF() ENDIF() ENDIF()