summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/auth/sia/Makefile.am
blob: 30bf011cd96d4d996f3a11f9eee936fbf847f4d1 (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
104
105
106
107
108
109
110
111
112
# $Id: Makefile.am,v 1.15.2.1 2003/05/08 10:31:48 lha Exp $

include $(top_srcdir)/Makefile.am.common

INCLUDES += $(INCLUDE_krb4)

WFLAGS += $(WFLAGS_NOIMPLICITINT)

DEFS = @DEFS@

## this is horribly ugly, but automake/libtool doesn't allow us to
## unconditionally build shared libraries, and it does not allow us to
## link with non-installed libraries

KAFS=$(top_builddir)/lib/kafs/.libs/libkafs.a
KAFS_S=$(top_builddir)/lib/kafs/.libs/libkafs.so

if KRB5
L = \
	$(KAFS)						\
	$(top_builddir)/lib/krb5/.libs/libkrb5.a	\
	$(top_builddir)/lib/asn1/.libs/libasn1.a	\
	$(LIB_krb4)					\
	$(LIB_des_a)					\
	$(LIB_com_err_a)				\
	$(top_builddir)/lib/roken/.libs/libroken.a	\
	$(LIB_getpwnam_r)				\
	-lc

L_shared = \
	$(KAFS_S)					\
	$(top_builddir)/lib/krb5/.libs/libkrb5.so	\
	$(top_builddir)/lib/asn1/.libs/libasn1.so	\
	$(LIB_krb4)					\
	$(LIB_des_so)					\
	$(LIB_com_err_so)				\
	$(top_builddir)/lib/roken/.libs/libroken.so	\
	$(LIB_getpwnam_r)				\
	-lc

MOD = libsia_krb5.so

else

L = \
	$(KAFS)						\
	$(top_builddir)/lib/kadm/.libs/libkadm.a	\
	$(top_builddir)/lib/krb/.libs/libkrb.a		\
	$(LIB_des_a)		\
	$(top_builddir)/lib/com_err/.libs/libcom_err.a	\
	$(top_builddir)/lib/roken/.libs/libroken.a	\
	$(LIB_getpwnam_r)				\
	-lc

L_shared = \
	$(KAFS_S)					\
	$(top_builddir)/lib/kadm/.libs/libkadm.so	\
	$(top_builddir)/lib/krb/.libs/libkrb.so		\
	$(LIB_des_so)		\
	$(top_builddir)/lib/com_err/.libs/libcom_err.so	\
	$(top_builddir)/lib/roken/.libs/libroken.so	\
	$(LIB_getpwnam_r)				\
	-lc

MOD = libsia_krb4.so

endif

EXTRA_DIST = sia.c krb4_matrix.conf krb4+c2_matrix.conf \
	krb5_matrix.conf krb5+c2_matrix.conf security.patch

foodir = $(libdir)
foo_DATA = $(MOD)

LDFLAGS = @LDFLAGS@ -rpath $(libdir) -Wl,-hidden -Wl,-exported_symbol -Wl,siad_\* 

OBJS = sia.o posix_getpw.o

libsia_krb5.so: $(OBJS)
	@if test -f $(top_builddir)/lib/krb5/.libs/libkrb5.a; then \
		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`"; \
		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`; \
	elif test -f $(top_builddir)/lib/krb5/.libs/libkrb5.so; then \
		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`"; \
		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`; \
	else \
		echo "missing libraries"; exit 1; \
	fi
	ostrip -x $@

libsia_krb4.so: $(OBJS)
	@if test -f $(top_builddir)/lib/krb/.libs/libkrb.a; then \
		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`"; \
		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L)`; \
	elif test -f $(top_builddir)/lib/krb/.libs/libkrb.so; then \
		echo "$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`"; \
		$(CC) -shared -o $@ `$(SHELL) $(srcdir)/make-rpath $(LDFLAGS) $(OBJS) $(L_shared)`; \
	else \
		echo "missing libraries"; exit 1; \
	fi
	ostrip -x $@

CLEANFILES = $(MOD) $(OBJS) so_locations

SUFFIXES += .c .o

# XXX inline COMPILE since automake wont add it

.c.o:
	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \
	-c `test -f '$<' || echo '$(srcdir)/'`$<
OpenPOWER on IntegriCloud