nfs-utils: Include legacy or TI-RPC headers, not both
[nfs-utils.git] / aclocal / libtirpc.m4
1 dnl Checks for TI-RPC library and headers
2 dnl
3 AC_DEFUN([AC_LIBTIRPC], [
4
5   AC_ARG_WITH([tirpcinclude],
6               [AC_HELP_STRING([--with-tirpcinclude=DIR],
7                               [use TI-RPC headers in DIR])],
8               [tirpc_header_dir=$withval],
9               [tirpc_header_dir=/usr/include/tirpc])
10
11   dnl if --enable-tirpc was specifed, the following components
12   dnl must be present, and we set up HAVE_ macros for them.
13
14   if test "$enable_tirpc" = yes; then
15
16     dnl look for the library; add to LIBS if found
17     AC_CHECK_LIB([tirpc], [clnt_tli_create], ,
18                  [AC_MSG_ERROR([libtirpc not found.])])
19
20     dnl also must have the headers installed where we expect
21     dnl look for headers; add -I compiler option if found
22     AC_CHECK_HEADERS([${tirpc_header_dir}/netconfig.h], ,
23                      [AC_MSG_ERROR([libtirpc headers not found.])])
24     AC_SUBST([AM_CPPFLAGS], ["-I${tirpc_header_dir}"])
25
26   fi
27
28 ])dnl