xref: /freebsd/crypto/heimdal/lib/kafs/Makefile.am (revision f7c4bd95ba735bd6a5454b4953945a99cefbb80c)
1# $Id: Makefile.am 21446 2007-07-10 12:45:36Z lha $
2
3include $(top_srcdir)/Makefile.am.common
4
5AM_CPPFLAGS += $(AFS_EXTRA_DEFS) $(ROKEN_RENAME)
6
7if KRB4
8DEPLIB_krb4 = $(LIB_krb4) $(LIB_hcrypto)
9krb4_am_workaround = $(INCLUDE_krb4)
10else
11DEPLIB_krb4  =
12krb4_am_workaround =
13endif # KRB4
14AM_CPPFLAGS += $(krb4_am_workaround)
15
16if KRB5
17DEPLIB_krb5 = ../krb5/libkrb5.la
18krb5_am_workaround = $(INCLUDE_hcrypto) -I$(top_srcdir)/lib/krb5
19else
20DEPLIB_krb5  =
21krb5_am_workaround =
22endif # KRB5
23AM_CPPFLAGS += $(krb5_am_workaround)
24
25
26if AIX
27AFSL_EXP = $(srcdir)/afsl.exp
28
29if AIX4
30AFS_EXTRA_LD = -bnoentry
31else
32AFS_EXTRA_LD = -e _nostart
33endif
34
35if AIX_DYNAMIC_AFS
36if HAVE_DLOPEN
37AIX_SRC =
38else
39AIX_SRC = dlfcn.c
40endif
41AFS_EXTRA_LIBS = afslib.so
42AFS_EXTRA_DEFS =
43else
44AIX_SRC = afslib.c
45AFS_EXTRA_LIBS =
46AFS_EXTRA_DEFS = -DSTATIC_AFS
47endif
48
49else
50AFSL_EXP =
51AIX_SRC =
52endif # AIX
53
54libkafs_la_LIBADD = $(DEPLIB_krb5) $(LIBADD_roken) $(DEPLIB_krb4)
55
56lib_LTLIBRARIES = libkafs.la
57libkafs_la_LDFLAGS = -version-info 5:1:5
58foodir = $(libdir)
59foo_DATA = $(AFS_EXTRA_LIBS)
60# EXTRA_DATA = afslib.so
61
62CLEANFILES= $(AFS_EXTRA_LIBS) $(ROKEN_SRCS)
63
64include_HEADERS = kafs.h
65
66if KRB5
67afskrb5_c = afskrb5.c
68endif
69
70if do_roken_rename
71ROKEN_SRCS = resolve.c strtok_r.c strlcpy.c strsep.c
72endif
73
74dist_libkafs_la_SOURCES =			\
75	afssys.c				\
76	afskrb.c				\
77	$(afskrb5_c)				\
78	common.c				\
79	$(AIX_SRC)				\
80	kafs_locl.h				\
81	afssysdefs.h				\
82	roken_rename.h
83
84nodist_libkafs_la_SOURCES = $(ROKEN_SRCS)
85
86EXTRA_libkafs_la_SOURCES = afskrb.c afskrb5.c dlfcn.c afslib.c dlfcn.h
87
88EXTRA_DIST = README.dlfcn afsl.exp afslib.exp $(man_MANS)
89
90man_MANS = kafs.3
91
92# AIX: this almost works with gcc, but somehow it fails to use the
93# correct ld, use ld instead
94afslib.so: afslib.o
95	ld -o $@ -bM:SRE -bI:$(srcdir)/afsl.exp -bE:$(srcdir)/afslib.exp $(AFS_EXTRA_LD) afslib.o -lc
96
97resolve.c:
98	$(LN_S) $(srcdir)/../roken/resolve.c .
99
100strtok_r.c:
101	$(LN_S) $(srcdir)/../roken/strtok_r.c .
102
103strlcpy.c:
104	$(LN_S) $(srcdir)/../roken/strlcpy.c .
105
106strsep.c:
107	$(LN_S) $(srcdir)/../roken/strsep.c .
108