summaryrefslogtreecommitdiff
path: root/m4/ucred.m4
blob: 08afce5c06af7d27b4b201007f9a32694e4b93ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Check if "struct ucred" is available.
#
# Author: Max Kellermann <max.kellermann@gmail.com>

AC_DEFUN([STRUCT_UCRED],[
	AC_MSG_CHECKING([for struct ucred])
	AC_CACHE_VAL(mpd_cv_have_struct_ucred, [
		AC_TRY_COMPILE([#include <sys/socket.h>],
			[struct ucred cred;],
			mpd_cv_have_struct_ucred=yes,
			mpd_cv_have_struct_ucred=no)
		])

	AC_MSG_RESULT($mpd_cv_have_struct_ucred)
	if test x$mpd_cv_have_struct_ucred = xyes; then
		AC_DEFINE(HAVE_STRUCT_UCRED, 1, [Define if struct ucred is present from sys/socket.h])
	fi
])