Use PKGCONFIG to locate gssapi and rpcsecgss header files
[nfs-utils.git] / utils / gssd / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 man8_MANS       = gssd.man svcgssd.man
4
5 RPCPREFIX       = rpc.
6 KPREFIX         = @kprefix@
7 sbin_PREFIXED   = gssd svcgssd
8 sbin_PROGRAMS   = $(sbin_PREFIXED) gss_clnt_send_err
9 sbin_SCRIPTS    = gss_destroy_creds
10
11 EXTRA_DIST = \
12         gss_destroy_creds \
13         $(man8_MANS)
14
15 COMMON_SRCS = \
16         context.c \
17         context_mit.c \
18         context_heimdal.c \
19         context_spkm3.c \
20         gss_util.c \
21         gss_oids.c \
22         err_util.c \
23         \
24         context.h \
25         err_util.h \
26         gss_oids.h \
27         gss_util.h
28
29 gssd_SOURCES = \
30         $(COMMON_SRCS) \
31         gssd.c \
32         gssd_main_loop.c \
33         gssd_proc.c \
34         krb5_util.c \
35         \
36         gssd.h \
37         krb5_util.h \
38         write_bytes.h
39
40 gssd_LDADD = $(RPCSECGSS_LIBS) $(KRBLIBS)
41 gssd_LDFLAGS = -Wl,-rpath=$(KRBDIR)/lib
42
43 gssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
44               $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
45
46 svcgssd_SOURCES = \
47         $(COMMON_SRCS) \
48         cacheio.c \
49         svcgssd.c \
50         svcgssd_main_loop.c \
51         svcgssd_mech2file.c \
52         svcgssd_proc.c \
53         \
54         cacheio.h \
55         svcgssd.h
56
57 svcgssd_LDADD = \
58         ../../support/nfs/libnfs.a \
59         $(RPCSECGSS_LIBS) -lnfsidmap \
60         $(KRBLIBS)
61
62 svcgssd_LDFLAGS = -Wl,-rpath=$(KRBDIR)/lib
63
64 svcgssd_CFLAGS = $(AM_CFLAGS) $(CFLAGS) \
65                  $(RPCSECGSS_CFLAGS) $(KRBCFLAGS)
66
67 gss_clnt_send_err_SOURCES = gss_clnt_send_err.c
68
69 MAINTAINERCLEANFILES = Makefile.in
70
71 #######################################################################
72 # The following allows the current practice of having
73 # daemons renamed during the install to include RPCPREFIX
74 # and the KPREFIX
75 # This could all be done much easier with program_transform_name
76 # ( program_transform_name = s/^/$(RPCPREFIX)$(KPREFIX)/ )
77 # but that also renames the man pages, which the current
78 # practice does not do.
79 install-exec-hook:
80         (cd $(DESTDIR)$(sbindir) && \
81           for p in $(sbin_PREFIXED); do \
82             mv -f $$p$(EXEEXT) $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
83           done)
84 uninstall-hook:
85         (cd $(DESTDIR)$(sbindir) && \
86           for p in $(sbin_PREFIXED); do \
87             rm -f $(RPCPREFIX)$(KPREFIX)$$p$(EXEEXT) ;\
88           done)
89
90
91 # XXX This makes some assumptions about what automake does.
92 # XXX But there is no install-man-hook or install-man-local.
93 install-man: install-man8 install-man-links
94 uninstall-man: uninstall-man8 uninstall-man-links
95
96 install-man-links:
97         (cd $(DESTDIR)$(man8dir) && \
98           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
99             inst=`echo $$m | sed -e 's/man$$/8/'`; \
100             rm -f $(RPCPREFIX)$$inst ; \
101             $(LN_S) $$inst $(RPCPREFIX)$$inst ; \
102           done)
103
104 uninstall-man-links:
105         (cd $(DESTDIR)$(man8dir) && \
106           for m in $(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS); do \
107             inst=`echo $$m | sed -e 's/man$$/8/'`; \
108             rm -f $(RPCPREFIX)$$inst ; \
109           done)
110