aboutsummaryrefslogtreecommitdiff
path: root/src/lib/rpc/configure.in
blob: c2217044f862478db47ccec3dd31b5c06c637f7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
AC_INIT(auth_gssapi.c)
CONFIG_RULES
CONFIG_DIRS(unit-test)
DO_SUBDIRS
AC_PROG_ARCHIVE
AC_PROG_ARCHIVE_ADD
AC_PROG_RANLIB
AC_PROG_INSTALL

### Check where struct rpcent is declared.
#
# This is necessary to determine:
# 1. If /usr/include/netdb.h declares struct rpcent
# 2. If /usr/include/rpc/netdb.h declares struct rpcent
#
# We have our own rpc/netdb.h, and if /usr/include/netdb.h includes
# rpc/netdb.h, then nastiness could happen.
#
# Logic: If /usr/include/netdb.h declares struct rpcent, then check
# rpc/netdb.h.  If /usr/include/rpc/netdb.h declares struct rpcent,
# then define STRUCT_RPCENT_IN_RPC_NETDB_H, otherwise do not.  If
# neither netdb.h nor rpc/netdb.h declares struct rpcent, then define
# STRUCT_RPCENT_IN_RPC_NETDB_H anyway.
#
AC_MSG_CHECKING([where struct rpcent is declared])
AC_TRY_COMPILE([#include <netdb.h>],
[struct rpcent e;
char c = e.r_name[0];
int i = e.r_number;],
[AC_TRY_COMPILE([#include <rpc/netdb.h>],
[struct rpcent e;
char c = e.r_name[0];
int i = e.r_number;],
[AC_MSG_RESULT([rpc/netdb.h])
rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'],
[AC_MSG_RESULT([netdb.h])])],
[AC_MSG_RESULT([nowhere])
rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'])
AC_SUBST(rpcent_define)

AC_CHECK_SIZEOF(int)
SIZEOF_INT=$ac_cv_sizeof_int
AC_SUBST(SIZEOF_INT)
AC_CHECK_SIZEOF(long)
SIZEOF_LONG=$ac_cv_sizeof_long
AC_SUBST(SIZEOF_LONG)

AC_MSG_CHECKING([return type of setrpcent])
AC_CACHE_VAL(k5_cv_type_setrpcent,
[AC_TRY_COMPILE([#include <netdb.h>
#ifdef __cplusplus
extern "C"
#endif
extern void setrpcent();],
[int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])dnl
AC_MSG_RESULT($k5_cv_type_setrpcent)
AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent)
dnl
AC_MSG_CHECKING([return type of endrpcent])
AC_CACHE_VAL(k5_cv_type_endrpcent,
[AC_TRY_COMPILE([#include <netdb.h>
#ifdef __cplusplus
extern "C"
#endif
extern void endrpcent();],
[int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])dnl
AC_MSG_RESULT($k5_cv_type_endrpcent)
AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent)

DECLARE_SYS_ERRLIST

V5_SHARED_LIB_OBJS
V5_MAKE_SHARED_LIB(libgssrpc,1.0,.., ./rpc)
GSSAPI_KRB5_SH_VERS=$krb5_cv_shlib_version_libgssapi_krb5
AC_SUBST(GSSAPI_KRB5_SH_VERS)
KRB5_SH_VERS=$krb5_cv_shlib_version_libkrb5
AC_SUBST(KRB5_SH_VERS)
CRYPTO_SH_VERS=$krb5_cv_shlib_version_libcrypto
AC_SUBST(CRYPTO_SH_VERS)
COMERR_SH_VERS=$krb5_cv_shlib_version_libcom_err
AC_SUBST(COMERR_SH_VERS)

CopySrcHeader(auth.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(auth_gssapi.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(auth_unix.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(clnt.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(netdb.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(pmap_clnt.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(pmap_prot.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(pmap_rmt.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(rpc.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(rpc_msg.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(svc.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(svc_auth.h,[$](BUILDTOP)/include/rpc)
CopyHeader(types.h,[$](BUILDTOP)/include/rpc)
CopySrcHeader(xdr.h,[$](BUILDTOP)/include/rpc)

dnl
dnl This is gross but necessary because of the way we build shared libs
dnl
ALL_RECURSE=
AppendRule([all-unix:: all-recurse])
V5_AC_OUTPUT_MAKEFILE( ,types.h:types.hin)