1 # Check if "struct ucred" is available. If not, try harder with
4 # heavily inspired by: http://git.musicpd.org/cgit/master/mpd.git/tree/m4/ucred.m4
5 # Author: Max Kellermann <max@duempel.org>
7 AC_DEFUN([STRUCT_UCRED],[
8 AC_MSG_CHECKING([for struct ucred])
9 AC_CACHE_VAL(mpd_cv_have_struct_ucred, [
10 AC_TRY_COMPILE([#include <sys/socket.h>],
12 mpd_cv_have_struct_ucred=yes,
13 mpd_cv_have_struct_ucred=no)
14 if test x$mpd_cv_have_struct_ucred = xno; then
15 # glibc 2.8 forces _GNU_SOURCE on us
18 #include <sys/socket.h>],
20 mpd_cv_have_struct_ucred=yes,
21 mpd_cv_have_struct_ucred=no)
22 if test x$mpd_cv_have_struct_ucred = xyes; then
24 MPD_CFLAGS="$MPD_CFLAGS -D_GNU_SOURCE"
29 AC_MSG_RESULT($mpd_cv_have_struct_ucred)
30 if test x$mpd_cv_have_struct_ucred = xyes; then
31 AC_DEFINE(HAVE_STRUCT_UCRED, 1, [Define if struct ucred is present from sys/socket.h])