xref: /netbsd-src/external/bsd/am-utils/dist/m4/macros/try_compile_rpc.m4 (revision a53f50b9b44dc9467ccc9c464999b1d1c509cb0c)
1dnl ######################################################################
2dnl Compile a program with RPC headers to try and find a feature.
3dnl The headers part are fixed.  Only three arguments are allowed:
4dnl [$1] is the program to compile (2nd arg to AC_TRY_COMPILE)
5dnl [$2] action to take if the program compiled (3rd arg to AC_TRY_COMPILE)
6dnl [$3] action to take if program did not compile (4rd arg to AC_TRY_COMPILE)
7AC_DEFUN([AC_TRY_COMPILE_RPC],
8[# try to compile a program which may have a definition for a structure
9AC_TRY_COMPILE(
10[
11#ifdef HAVE_SYS_TYPES_H
12# include <sys/types.h>
13#endif /* HAVE_SYS_TYPES_H */
14#ifdef HAVE_RPC_RPC_H
15# include <rpc/rpc.h>
16#endif /* HAVE_RPC_RPC_H */
17/* Prevent multiple inclusion on Ultrix 4 */
18#if defined(HAVE_RPC_XDR_H) && !defined(__XDR_HEADER__)
19# include <rpc/xdr.h>
20#endif /* defined(HAVE_RPC_XDR_H) && !defined(__XDR_HEADER__) */
21], [$1], [$2], [$3])
22])
23dnl ======================================================================
24