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