summaryrefslogtreecommitdiff
path: root/security/PAM/patches/patch-af
blob: 367a2ebe6167f0a01f315988f6156ceb9fe50b42 (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
113
114
115
116
$NetBSD: patch-af,v 1.4 2004/11/16 07:46:57 jlam Exp $

--- libpamc/Makefile.orig	2001-02-10 02:17:53.000000000 -0500
+++ libpamc/Makefile
@@ -27,6 +27,10 @@ LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICA
 
 LIBNAMEDSTATIC = $(LIBNAME).a
 
+# libtool library name
+
+LIBNAMEDLIBTOOL = $(LIBNAME).la
+
 LIBOBJECTS = pamc_client.o pamc_converse.o pamc_load.o
 
 ifeq ($(DYNAMIC_LIBPAM),yes)
@@ -37,10 +41,24 @@ ifeq ($(STATIC_LIBPAM),yes)
 SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
 endif
 
+ifeq ($(LIBTOOL_LIBPAM),yes)
+LALIBOBJECTS = $(LIBOBJECTS:.o=.lo)
+endif
+
 # ---------------------------------------------
 ## rules
 
-all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
+ifeq ($(DYNAMIC_LIBPAM),yes)
+LIBS_TO_BUILD+=	$(LIBNAMED)
+endif
+ifeq ($(STATIC_LIBPAM),yes)
+LIBS_TO_BUILD+=	$(LIBNAMEDSTATIC)
+endif
+ifeq ($(LIBTOOL_LIBPAM),yes)
+LIBS_TO_BUILD+=	$(LIBNAMEDLIBTOOL)
+endif
+
+all: dirs $(LIBS_TO_BUILD)
 
 dirs:
 ifeq ($(DYNAMIC_LIBPAM),yes)
@@ -56,6 +74,9 @@ dynamic/%.o : %.c
 static/%.o : %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
+%.lo : %.c
+	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
+
 $(LIBNAMED): $(DLIBOBJECTS)
 ifeq ($(DYNAMIC_LIBPAM),yes)
     ifeq ($(USESONAME),yes)
@@ -77,9 +98,30 @@ ifeq ($(STATIC_LIBPAM),yes)
 	$(RANLIB) $@
 endif
 
-install: all
+$(LIBNAMEDLIBTOOL): $(LALIBOBJECTS)
+ifeq ($(LIBTOOL_LIBPAM),yes)
+	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LALIBOBJECTS) -o $@ \
+		$(MODULES) $(LINKLIBS) \
+		-rpath $(libdir) -version-info $(MAJOR_REL):$(MINOR_REL)
+endif
+
+install: all install-headers
+
+ifeq ($(DYNAMIC_LIBPAM),yes)
+install: install-dynamic
+endif
+ifeq ($(STATIC_LIBPAM),yes)
+install: install-static
+endif
+ifeq ($(LIBTOOL_LIBPAM),yes)
+install: install-libtool
+endif
+
+install-headers:
 	$(MKDIR) $(FAKEROOT)$(INCLUDED)
 	$(INSTALL) -m 644 include/security/pam_client.h $(FAKEROOT)$(INCLUDED)
+
+install-dynamic:
 ifeq ($(DYNAMIC_LIBPAM),yes)
 	$(MKDIR) $(FAKEROOT)$(libdir)
 	$(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
@@ -88,20 +130,30 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
 	( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
   endif
 endif
+
+install-static:
 ifeq ($(STATIC_LIBPAM),yes)
 	$(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir)
 endif
 
+install-libtool:
+ifeq ($(LIBTOOL_LIBPAM),yes)
+	$(LIBTOOL) --mode=install $(INSTALL) -c $(LIBNAMEDLIBTOOL) $(FAKEROOT)$(libdir)
+endif
+
 remove:
 	rm -f $(FAKEROOT)$(INCLUDED)/pam_client.h
 	rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
 	rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED)
 	$(LDCONFIG)
 	rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC)
+ifeq ($(LIBTOOL_LIBPAM),yes)
+	$(LIBTOOL) --mode=uninstall rm $(FAKEROOT)$(libdir)/$(LIBNAMEDLIBTOOL)
+endif
 
 clean:
 	rm -f a.out core *~ static/*.o dynamic/*.o
-	rm -f *.a *.out *.o *.so ./include/security/*~
+	rm -f *.a *.la *.lo *.out *.o *.so .libs/* ./include/security/*~
 	if [ -d dynamic ]; then rmdir dynamic ; fi
 	if [ -d static ]; then rmdir static ; fi
-
+	if [ -d .libs ]; then rmdir .libs ; fi