]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/user-libtirpc.m4
New upstream version 0.7.2
[mirror_zfs-debian.git] / config / user-libtirpc.m4
CommitLineData
cae5b340
AX
1dnl #
2dnl # Check for libtirpc - may be needed for xdr functionality
3dnl #
4AC_DEFUN([ZFS_AC_CONFIG_USER_LIBTIRPC], [
5 AC_ARG_WITH([tirpc],
6 [AS_HELP_STRING([--with-tirpc],
7 [use tirpc for xdr encoding @<:@default=check@:>@])],
8 [],
9 [with_tirpc=check])
10
11 LIBTIRPC=
12 LIBTIRPC_CFLAGS=
13
14 AS_IF([test "x$with_tirpc" != xno],
15 [AC_CHECK_LIB([tirpc], [xdrmem_create],
16 [AC_SUBST([LIBTIRPC], [-ltirpc])
17 AC_SUBST([LIBTIRPC_CFLAGS], [-I/usr/include/tirpc])
18 AC_DEFINE([HAVE_LIBTIRPC], [1], [Define if you have libtirpc])
19 ],
20 [if test "x$with_tirpc" != xcheck; then
21 AC_MSG_FAILURE(
22 [--with-tirpc was given, but test for tirpc failed])
23 fi
24 AC_SEARCH_LIBS([xdrmem_create], [tirpc], [], [
25 AC_MSG_FAILURE([xdrmem_create() requires tirpc or libc])])
26 ])],
27 [AC_SEARCH_LIBS([xdrmem_create], [tirpc], [], [
28 AC_MSG_FAILURE([xdrmem_create() requires libc])])
29 ])
30])