summaryrefslogtreecommitdiff
path: root/security/PAM/patches/patch-au
blob: c8e63df8283581b912cdf4f10992e11608bfb93e (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
$NetBSD: patch-au,v 1.5 2004/11/19 14:54:55 jlam Exp $

--- modules/pam_filter/Makefile.orig	2001-11-11 02:43:54.000000000 -0500
+++ modules/pam_filter/Makefile
@@ -27,6 +27,7 @@ LIBSRC = $(TITLE).c
 LIBOBJ = $(TITLE).o
 LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
 LIBOBJS = $(addprefix static/,$(LIBOBJ))
+LIBOBJLA = $(LIBOBJ:.o=.lo)
 
 dynamic/%.o : %.c
 	$(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
@@ -34,6 +35,9 @@ dynamic/%.o : %.c
 static/%.o : %.c
 	$(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
+%.lo : %.c
+	$(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) $(LTCFLAGS) $(TARGET_ARCH) -c $<
+
 ifdef DYNAMIC
 LIBSHARED = $(TITLE).so
 endif
@@ -42,13 +46,27 @@ ifdef STATIC
 LIBSTATIC = lib$(TITLE).o
 endif
 
+ifdef LIBTOOL
+LIBLIBTOOL = $(TITLE).la
+endif
+
 ####################### don't edit below #######################
 
 #
 # this is where we compile this module
 #
 
-all: dirs $(LIBSHARED) $(LIBSTATIC) register filters
+ifdef DYNAMIC
+MODULES_TO_BUILD+=	$(LIBSHARED)
+endif
+ifdef STATIC
+MODULES_TO_BUILD+=	$(LIBSTATIC)
+endif
+ifdef LIBTOOL
+MODULES_TO_BUILD+=	$(LIBLIBTOOL)
+endif
+
+all: dirs $(MODULES_TO_BUILD) register filters
 
 dirs:
 	if [ ! -r include/security ]; then ln -sf . include/security ; fi
@@ -90,8 +108,20 @@ $(LIBSTATIC): $(LIBOBJS)
 	$(LD) -r -o $@ $(LIBOBJS)
 endif
 
+ifdef LIBTOOL
+$(LIBOBJLA): $(LIBSRC)
+endif
+
+ifdef LIBTOOL
+$(LIBLIBTOOL): $(LIBOBJLA)
+	$(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
+endif
+
 remove:
 	rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
+ifdef LIBTOOL
+	$(LIBTOOL) --mode-uninstall rm $(FAKEROOT)$(SECUREDIR)/$(TITLE).la
+endif
 	rm -f $(FAKEROOT)$(INCLUDED)/pam_filter.h
 	@for i in $(FILTERS) ; do \
 		if [ -d $$i ]; then \
@@ -109,6 +139,9 @@ install: all
 ifdef DYNAMIC
 	$(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
 endif
+ifdef LIBTOOL
+	$(LIBTOOL) --mode=install $(INSTALL) $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
+endif
 	$(MKDIR) $(FAKEROOT)$(INCLUDED)
 	$(INSTALL) -m 644 include/pam_filter.h $(FAKEROOT)$(INCLUDED)
 
@@ -118,9 +151,9 @@ clean:
 		   $(MAKE) -C $$i clean ; \
 		fi ; \
 	done
-	rm -f $(LIBSHARED) $(LIBOBJD) $(LIBOBJS) core *~
+	rm -f $(LIBSHARED) $(LIBLIBTOOL) $(LIBOBJD) $(LIBOBJS) $(LIBOBJSLA) core *~
 	rm -f include/security
-	rm -fr dynamic static
-	rm -f *.a *.o *.so *.bak
+	rm -fr dynamic static .libs
+	rm -f *.a *.la *.lo *.o *.so *.bak
 
 endif