summaryrefslogtreecommitdiff
path: root/security/PAM/patches
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-11-16 07:46:57 +0000
committerjlam <jlam@pkgsrc.org>2004-11-16 07:46:57 +0000
commit96912dd94f138b77bc7b60d105fa28b06a3fc232 (patch)
treea66fff95b854bc51b090d95257e7cf782b651ae3 /security/PAM/patches
parent22584525a00c6a021a615046c5235f9ac487373c (diff)
downloadpkgsrc-96912dd94f138b77bc7b60d105fa28b06a3fc232.tar.gz
Libtoolize security/PAM so that the appropriate options are passed to
the compiler to build shared modules, and so that it builds correctly across different platforms. Bump the PKGREVISION. In particular, this should fix problems building this package on NetBSD/amd64.
Diffstat (limited to 'security/PAM/patches')
-rw-r--r--security/PAM/patches/patch-ab21
-rw-r--r--security/PAM/patches/patch-ac21
-rw-r--r--security/PAM/patches/patch-ad138
-rw-r--r--security/PAM/patches/patch-ae126
-rw-r--r--security/PAM/patches/patch-af117
-rw-r--r--security/PAM/patches/patch-ag69
-rw-r--r--security/PAM/patches/patch-ah96
-rw-r--r--security/PAM/patches/patch-at40
-rw-r--r--security/PAM/patches/patch-au95
-rw-r--r--security/PAM/patches/patch-av101
-rw-r--r--security/PAM/patches/patch-aw137
-rw-r--r--security/PAM/patches/patch-ax13
12 files changed, 867 insertions, 107 deletions
diff --git a/security/PAM/patches/patch-ab b/security/PAM/patches/patch-ab
index c622a83c854..3dca9947344 100644
--- a/security/PAM/patches/patch-ab
+++ b/security/PAM/patches/patch-ab
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-ab,v 1.4 2004/11/16 07:46:57 jlam Exp $
--- configure.in.orig Tue Jul 9 02:17:13 2002
+++ configure.in
@@ -34,22 +34,3 @@ $NetBSD: patch-ab,v 1.3 2002/12/23 21:23:58 jlam Exp $
/usr/local/lib /usr/local/share/lib"
DICT_FILE_CANDIDATES="pw_dict cracklib_dict"
CRACKLIB_DICTPATH=""
-@@ -305,6 +312,18 @@ if test "$GCC" = yes; then
- case $OS in
- linux)
- OS_CFLAGS="-ansi -D_POSIX_SOURCE -pedantic"
-+ LD_D="gcc -shared -Xlinker -x"
-+ WARNINGS="$GCC_WARNINGS"
-+ PIC="-fPIC"
-+ DYNTYPE=so
-+ LD=ld
-+ LD_L="$LD -x -shared"
-+ RANLIB=ranlib
-+ STRIP=strip
-+ CC_STATIC="-Xlinker -export-dynamic"
-+ ;;
-+ netbsd)
-+ OS_CFLAGS=""
- LD_D="gcc -shared -Xlinker -x"
- WARNINGS="$GCC_WARNINGS"
- PIC="-fPIC"
diff --git a/security/PAM/patches/patch-ac b/security/PAM/patches/patch-ac
index ec194130fc6..881e5d4df87 100644
--- a/security/PAM/patches/patch-ac
+++ b/security/PAM/patches/patch-ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-ac,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-ac,v 1.4 2004/11/16 07:46:57 jlam Exp $
--- configure.orig Tue Jul 9 02:17:13 2002
+++ configure
@@ -201,22 +201,3 @@ $NetBSD: patch-ac,v 1.3 2002/12/23 21:23:58 jlam Exp $
/usr/local/lib /usr/local/share/lib"
DICT_FILE_CANDIDATES="pw_dict cracklib_dict"
CRACKLIB_DICTPATH=""
-@@ -2475,6 +2612,18 @@ if test "$GCC" = yes; then
- case $OS in
- linux)
- OS_CFLAGS="-ansi -D_POSIX_SOURCE -pedantic"
-+ LD_D="gcc -shared -Xlinker -x"
-+ WARNINGS="$GCC_WARNINGS"
-+ PIC="-fPIC"
-+ DYNTYPE=so
-+ LD=ld
-+ LD_L="$LD -x -shared"
-+ RANLIB=ranlib
-+ STRIP=strip
-+ CC_STATIC="-Xlinker -export-dynamic"
-+ ;;
-+ netbsd)
-+ OS_CFLAGS=""
- LD_D="gcc -shared -Xlinker -x"
- WARNINGS="$GCC_WARNINGS"
- PIC="-fPIC"
diff --git a/security/PAM/patches/patch-ad b/security/PAM/patches/patch-ad
index 77377e93698..215a838e2a0 100644
--- a/security/PAM/patches/patch-ad
+++ b/security/PAM/patches/patch-ad
@@ -1,7 +1,7 @@
-$NetBSD: patch-ad,v 1.4 2004/01/08 00:07:26 jlam Exp $
+$NetBSD: patch-ad,v 1.5 2004/11/16 07:46:57 jlam Exp $
---- libpam/Makefile.orig Sun Dec 9 16:44:58 2001
-+++ libpam/Makefile Thu Sep 11 19:50:44 2003
+--- libpam/Makefile.orig 2001-12-09 16:44:58.000000000 -0500
++++ libpam/Makefile
@@ -6,7 +6,7 @@
include ../Make.Rules
@@ -11,15 +11,133 @@ $NetBSD: patch-ad,v 1.4 2004/01/08 00:07:26 jlam Exp $
ifeq ($(WITH_LIBDEBUG),yes)
LIBNAME=libpamd
-@@ -125,8 +125,9 @@
+@@ -36,6 +36,10 @@ LIBPAMFULL = $(LIBPAMNAME)$(MODIFICATION
+
+ LIBPAMSTATIC = $(LIBNAME).a
+
++# libtool library name
++
++LIBPAMLIBTOOL = $(LIBNAME).la
++
+ ifdef STATIC
+ @echo Did you mean to set STATIC\?
+ MODULES = $(shell cat ../modules/_static_module_objects)
+@@ -56,7 +60,7 @@ LIBOBJECTS = pam_item.o pam_strerror.o p
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ # libpam.so needs -ldl, too.
+ DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS) $(STATICOBJ))
+-ifeq ($(STATICOBJ),yes)
++ifdef STATICOBJ
+ dynamic/pam_static.o: pam_static.c ../modules/_static_module_objects
+ $(CC) $(CFLAGS) -c pam_static.c -o $@
+ endif
+@@ -70,10 +74,28 @@ static/pam_static.o: pam_static.c ../mod
+ endif
+ endif
+
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LALIBOBJECTS = $(LIBOBJECTS:.o=.lo) $(STATICOBJ:.o=.lo)
++ifdef STATICOBJ
++pam_static.lo: pam_static.c ../modules/_static_module_objects
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c pam_static.c
++endif
++endif
++
+ # ---------------------------------------------
+ ## rules
+
+-all: dirs $(LIBPAM) $(LIBPAMSTATIC) ../Make.Rules
++ifeq ($(DYNAMIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBPAM)
++endif
++ifeq ($(STATIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBPAMSTATIC)
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBPAMLIBTOOL)
++endif
++
++all: dirs $(LIBS_TO_BUILD) ../Make.Rules
+
+ dirs:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -89,6 +111,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 $<
++
+ $(LIBPAM): $(DLIBOBJECTS)
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ifeq ($(USESONAME),yes)
+@@ -111,7 +136,26 @@ ifeq ($(STATIC_LIBPAM),yes)
+ $(RANLIB) $@
+ endif
+
+-install: all
++$(LIBPAMLIBTOOL): $(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) $(FAKEROOT)$(libdir)
+ $(INSTALL) -m 644 include/security/pam_appl.h $(FAKEROOT)$(INCLUDED)
+ $(INSTALL) -m 644 include/security/pam_modules.h $(FAKEROOT)$(INCLUDED)
+@@ -121,6 +165,8 @@ install: all
+ ifdef MEMORY_DEBUG
+ $(INSTALL) -m 644 include/security/pam_malloc.h $(FAKEROOT)$(INCLUDED)
+ endif
++
++install-dynamic:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
$(INSTALL) -m $(SHLIBMODE) $(LIBPAM) $(FAKEROOT)$(libdir)/$(LIBPAMFULL)
$(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
-- ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBPAM) ; \
-- ln -sf $(LIBPAMNAME) $(LIBPAM) )
-+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBPAM) $(LIBPAMNAME); \
-+ ln -sf $(LIBPAMFULL) $(LIBPAMNAME); \
-+ ln -sf $(LIBPAMFULL) $(LIBPAM) )
+@@ -129,10 +175,17 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ln -sf $(LIBPAMNAME) $(LIBPAM) )
endif
endif
++
++install-static:
ifeq ($(STATIC_LIBPAM),yes)
+ $(INSTALL) -m 644 $(LIBPAMSTATIC) $(FAKEROOT)$(libdir)
+ endif
+
++install-libtool:
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=install $(INSTALL) -c $(LIBPAMLIBTOOL) $(FAKEROOT)$(libdir)
++endif
++
+ remove:
+ rm -f $(FAKEROOT)$(INCLUDED)/_pam_types.h
+ rm -f $(FAKEROOT)$(INCLUDED)/_pam_macros.h
+@@ -143,9 +196,13 @@ remove:
+ rm -f $(FAKEROOT)$(libdir)/$(LIBPAM)
+ $(LDCONFIG)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBPAMSTATIC)
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=uninstall rm $(FAKEROOT)$(libdir)$(LIBPAMLIBTOOL)
++endif
+
+ clean:
+ rm -f a.out core *~ static/*.o dynamic/*.o
+- rm -f *.a *.o *.so ./include/security/*~
++ rm -f *.a *.la *.lo *.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
diff --git a/security/PAM/patches/patch-ae b/security/PAM/patches/patch-ae
index 34af2839d09..bce44d12cb9 100644
--- a/security/PAM/patches/patch-ae
+++ b/security/PAM/patches/patch-ae
@@ -1,22 +1,128 @@
-$NetBSD: patch-ae,v 1.4 2003/01/13 14:18:08 grant Exp $
+$NetBSD: patch-ae,v 1.5 2004/11/16 07:46:57 jlam Exp $
---- libpam_misc/Makefile.orig Thu Jun 27 14:04:54 2002
+--- libpam_misc/Makefile.orig 2002-06-27 00:04:54.000000000 -0400
+++ libpam_misc/Makefile
-@@ -16,7 +16,7 @@ VERSION=.$(MAJOR_REL)
+@@ -16,7 +16,12 @@ VERSION=.$(MAJOR_REL)
MODIFICATION=.$(MINOR_REL)
CFLAGS += $(MOREFLAGS) $(DYNAMIC) $(STATIC)
--LINKLIBS += -L$(absolute_objdir)/libpam -lpam
-+LINKLIBS += -L$(absolute_objdir)/libpam -lpam $(LDFLAGS)
++ifeq ($(DYNAMIC_LIBPAM),yes)
+ LINKLIBS += -L$(absolute_objdir)/libpam -lpam
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LINKLIBS += $(absolute_objdir)/libpam/libpam.la
++endif
# dynamic library names
-@@ -86,7 +86,7 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -28,6 +33,10 @@ LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICA
+
+ LIBNAMEDSTATIC = $(LIBNAME).a
+
++# libtool library name
++
++LIBNAMEDLIBTOOL = $(LIBNAME).la
++
+ LIBOBJECTS = help_env.o misc_conv.o
+
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -38,10 +47,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)
+@@ -57,6 +80,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)
+@@ -78,9 +104,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_misc.h $(FAKEROOT)$(INCLUDED)
++
++install-dynamic:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ $(MKDIR) $(FAKEROOT)$(libdir)
$(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
- $(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
-- ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
-+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) $(LIBNAMEDNAME); ln -s $(LIBNAMEDFULL) $(LIBNAMED); ln -s $(LIBNAMEDFULL) $(LIBNAMEDNAME) )
+@@ -89,19 +136,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_misc.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
diff --git a/security/PAM/patches/patch-af b/security/PAM/patches/patch-af
index 2a61cae0783..367a2ebe616 100644
--- a/security/PAM/patches/patch-af
+++ b/security/PAM/patches/patch-af
@@ -1,13 +1,116 @@
-$NetBSD: patch-af,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-af,v 1.4 2004/11/16 07:46:57 jlam Exp $
---- libpamc/Makefile.orig Sat Feb 10 02:17:53 2001
+--- libpamc/Makefile.orig 2001-02-10 02:17:53.000000000 -0500
+++ libpamc/Makefile
-@@ -85,7 +85,7 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -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)
- $(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
-- ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
-+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) $(LIBNAMEDNAME); ln -s $(LIBNAMEDFULL) $(LIBNAMED); ln -s $(LIBNAMEDFULL) $(LIBNAMEDNAME) )
+@@ -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
diff --git a/security/PAM/patches/patch-ag b/security/PAM/patches/patch-ag
index 4de2339b78f..a6c80f3703b 100644
--- a/security/PAM/patches/patch-ag
+++ b/security/PAM/patches/patch-ag
@@ -1,19 +1,52 @@
-$NetBSD: patch-ag,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-ag,v 1.4 2004/11/16 07:46:57 jlam Exp $
---- modules/Makefile.orig Sun Dec 9 17:15:11 2001
-+++ modules/Makefile
-@@ -12,7 +12,7 @@ MODDIRS=$(shell /bin/ls -d pam_*)
-
- all:
- @echo building the static modutil library
-- make -C pammodutil all
-+ $(MAKE) -C pammodutil all
- @echo modules sources available are:
- @ls -d $(MODDIRS) 2>/dev/null ; echo :--------
- @echo
-@@ -55,4 +55,4 @@ clean: lclean
- $(MAKE) -C $$i clean ; \
- } fi ; \
- done
-- make -C pammodutil clean
-+ $(MAKE) -C pammodutil clean
+--- modules/pammodutil/Makefile.orig 2001-12-09 17:15:12.000000000 -0500
++++ modules/pammodutil/Makefile
+@@ -25,10 +25,15 @@ LIBSTATIC = $(LIBNAME).a
+
+ SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS) $(STATICOBJ))
+
++# libtool library name
++LIBLIBTOOL = $(LIBNAME).la
++
++LALIBOBJECTS = $(LIBOBJECTS:.o=.lo)
++
+ # ---------------------------------------------
+ ## rules
+
+-all: dirs $(LIBSTATIC) ../../Make.Rules
++all: dirs $(LIBLIBTOOL) ../../Make.Rules
+
+ dirs:
+ $(MKDIR) static
+@@ -36,10 +41,19 @@ dirs:
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo: %.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
++
+ $(LIBSTATIC): $(SLIBOBJECTS)
+ ar cr $@ $(SLIBOBJECTS)
+ $(RANLIB) $@
+
++# This is a libtool convenience library that may be linked into shared
++# libraries and modules.
++#
++$(LIBLIBTOOL): $(LALIBOBJECTS)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LALIBOBJECTS) -o $@
++
+ install:
+ @echo "at this time, we're not installing $(LIBSTATIC)"
+
+@@ -47,7 +61,8 @@ remove:
+ @echo "at this time, there is nothing to remove"
+
+ clean:
+- rm -f a.out core *~ static/*.o
+- rm -f *.a *.o
++ rm -f a.out core *~ static/*.o .libs/*
++ rm -f *.a *.la *.la *.o
+ if [ -d dynamic ]; then rmdir dynamic ; fi
+ if [ -d static ]; then rmdir static ; fi
++ if [ -d libs ]; then rmdir .libs; fi
diff --git a/security/PAM/patches/patch-ah b/security/PAM/patches/patch-ah
index de584276bd5..c985965900e 100644
--- a/security/PAM/patches/patch-ah
+++ b/security/PAM/patches/patch-ah
@@ -1,22 +1,94 @@
-$NetBSD: patch-ah,v 1.4 2002/12/23 21:23:59 jlam Exp $
+$NetBSD: patch-ah,v 1.5 2004/11/16 07:46:57 jlam Exp $
---- modules/Simple.Rules.orig Sun Dec 9 17:15:11 2001
+--- modules/Simple.Rules.orig 2001-12-09 17:15:11.000000000 -0500
+++ modules/Simple.Rules
-@@ -59,7 +59,7 @@ endif
+@@ -18,8 +18,13 @@ LIBSRC = $(addsuffix .c,$(LIBFILES))
+ LIBOBJ = $(addsuffix .o,$(LIBFILES))
+ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+ LIBOBJS = $(addprefix static/,$(LIBOBJ))
++LIBOBJLA = $(LIBOBJ:.o=.lo)
- ifdef DYNAMIC
- $(LIBSHARED): $(LIBOBJD)
-- $(LD_D) -o $@ $(LIBOBJD) $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C) $(LINK_PAMMODUTILS)
-+ $(LD_D) $(LDFLAGS) -o $@ $(LIBOBJD) $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C) $(LINK_PAMMODUTILS)
++ifdef LIBTOOL
++LINK_PAMMODUTILS = ../pammodutil/libpammodutil.la
++else
+ LINK_PAMMODUTILS = -L../pammodutil -lpammodutil
++endif
+ INCLUDE_PAMMODUTILS = -I../pammodutil/include
+ ifdef DYNAMIC
+@@ -30,9 +35,23 @@ ifdef STATIC
+ LIBSTATIC = lib$(TITLE).o
endif
-@@ -69,7 +69,7 @@ endif
++ifdef LIBTOOL
++LIBLIBTOOL = $(TITLE).la
++endif
++
+ ####################### don't edit below #######################
+
+-all: dirs $(LIBSHARED) $(LIBSTATIC) register
++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
- ifdef STATIC
- $(LIBSTATIC): $(LIBOBJS)
-- $(LD) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS) $(LINK_PAMMODUTILS)
-+ $(LD) $(LDFLAGS) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS) $(LINK_PAMMODUTILS)
+ dynamic/%.o : %.c
+ $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@
+@@ -40,6 +59,9 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) $(STATIC) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) -DPAM_DYNAMIC $(TARGET_ARCH) -c $<
++
+ dirs:
+ ifdef DYNAMIC
+ $(MKDIR) ./dynamic
+@@ -72,22 +94,37 @@ $(LIBSTATIC): $(LIBOBJS)
+ $(LD) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS) $(LINK_PAMMODUTILS)
endif
++ifdef LIBTOOL
++$(LIBOBJLA): $(LIBSRC)
++endif
++
++ifdef LIBTOOL
++$(LIBLIBTOOL): $(LIBOBJLA)
++ $(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C) $(LINK_PAMMODUTILS) -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
++endif
++
install: all
+ $(MKDIR) $(FAKEROOT)$(SECUREDIR)
+ ifdef DYNAMIC
+ $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
+ endif
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=install $(INSTALL) -c $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
++endif
+ $(MODULE_SIMPLE_INSTALL)
+
+ remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=uninstall rm $(FAKEROOT)$(SECUREDIR)/$(TITLE).la
++endif
+ $(MODULE_SIMPLE_REMOVE)
+
+ clean:
+- rm -f $(LIBOBJD) $(LIBOBJS) core *~
++ rm -f $(LIBOBJD) $(LIBOBJS) $(LIBOBJLA) core *~
+ $(MODULE_SIMPLE_CLEAN)
+- rm -f *.a *.o *.so *.bak
+- rm -rf dynamic static
++ rm -f *.a *.la *.lo *.o *.so *.bak
++ rm -rf dynamic static .libs
+ $(MODULE_SIMPLE_EXTRACLEAN)
+
+ .c.o:
diff --git a/security/PAM/patches/patch-at b/security/PAM/patches/patch-at
index 21758e6c0f0..4582abcda5a 100644
--- a/security/PAM/patches/patch-at
+++ b/security/PAM/patches/patch-at
@@ -1,11 +1,31 @@
-$NetBSD: patch-at,v 1.3 2003/02/09 16:16:57 dmcmahill Exp $
+$NetBSD: patch-at,v 1.4 2004/11/16 07:46:57 jlam Exp $
---- Make.Rules.in.orig Thu Jun 27 00:04:54 2002
-+++ Make.Rules.in Sun Feb 9 11:02:40 2003
-@@ -96,5 +96,5 @@
- LD_D=@LD_D@
- LD_L=@LD_L@
--LDCONFIG=@LDCONFIG@
-+LDCONFIG=${PKG_LDCONFIG}
- DYNTYPE=@DYNTYPE@
- USESONAME=@USESONAME@
+--- Make.Rules.in.orig 2002-06-27 00:04:54.000000000 -0400
++++ Make.Rules.in
+@@ -75,10 +75,13 @@ WITH_MEMORY_DEBUG=@WITH_MEMORY_DEBUG@
+ WITH_LIBDEBUG=@WITH_LIBDEBUG@
+ WITH_PAMLOCKING=@WITH_PAMLOCKING@
+ WITH_LCKPWDF=@WITH_LCKPWDF@
+-STATIC_LIBPAM=@STATIC_LIBPAM@
+-DYNAMIC_LIBPAM=@DYNAMIC_LIBPAM@
+-STATIC=@STATIC@
+-DYNAMIC=@DYNAMIC@
++STATIC_LIBPAM=no
++DYNAMIC_LIBPAM=no
++LIBTOOL_LIBPAM=yes
++STATIC=
++DYNAMIC=
++LIBTOOL=@LIBTOOL@
++SHLIBTOOL=@SHLIBTOOL@
+
+ # Location of libraries when installed on the system
+ FAKEROOT=@FAKEROOT@
+@@ -104,7 +107,7 @@ LIBDL=@LIBDL@
+ MKDIR=@MKDIR@
+ INSTALL=@INSTALL@
+ RANLIB=@RANLIB@
+-STRIP=@STRIP@
++STRIP=:
+ CC_STATIC=@CC_STATIC@
+
+ LINKLIBS = $(NEED_LINK_LIB_C) $(LIBDL)
diff --git a/security/PAM/patches/patch-au b/security/PAM/patches/patch-au
new file mode 100644
index 00000000000..b57338d7339
--- /dev/null
+++ b/security/PAM/patches/patch-au
@@ -0,0 +1,95 @@
+$NetBSD: patch-au,v 1.4 2004/11/16 07:46:57 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) -DPAM_DYNAMIC $(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
diff --git a/security/PAM/patches/patch-av b/security/PAM/patches/patch-av
new file mode 100644
index 00000000000..76afc559bcc
--- /dev/null
+++ b/security/PAM/patches/patch-av
@@ -0,0 +1,101 @@
+$NetBSD: patch-av,v 1.4 2004/11/16 07:46:58 jlam Exp $
+
+--- modules/pam_tally/Makefile.orig 2001-06-27 02:20:43.000000000 -0400
++++ modules/pam_tally/Makefile
+@@ -20,6 +20,7 @@ LIBSRC = $(TITLE).c
+ LIBOBJ = $(TITLE).o
+ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+ LIBOBJS = $(addprefix static/,$(LIBOBJ))
++LIBOBJLA = $(LIBOBJ:.o=.lo)
+
+ APPSRC = $(TITLE)_app.c
+ APPOBJ = $(TITLE)_app.o
+@@ -32,6 +33,8 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -DPAM_DYNAMIC $(TARGET_ARCH) -c $<
+
+ ifdef DYNAMIC
+ LIBSHARED = $(TITLE).so
+@@ -41,12 +44,26 @@ ifdef STATIC
+ LIBSTATIC = lib$(TITLE).o
+ endif
+
++ifdef LIBTOOL
++LIBLIBTOOL = $(TITLE).la
++endif
++
+ APPLICATION = $(TITLE)
+ APPMODE = 755
+
+ ####################### don't edit below #######################
+
+-all: dirs $(LIBSHARED) $(LIBSTATIC) register $(APPLICATION)
++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 $(APPLICATION)
+
+ dirs:
+ ifdef DYNAMIC
+@@ -55,6 +72,9 @@ endif
+ ifdef STATIC
+ $(MKDIR) ./static
+ endif
++ifdef LIBTOOL
++ $(MKDIR) ./static
++endif
+
+ register:
+ ifdef STATIC
+@@ -82,22 +102,38 @@ $(APPLICATION): $(APPOBJS) $(TITLE).c
+ $(CC) $(CFLAGS) -o $@ $(APPOBJS) $(LOADLIBES)
+ endif
+
++ifdef LIBTOOL
++$(LIBOBJLA): $(LIBSRC)
++
++$(LIBLIBTOOL): $(LIBOBJLA)
++ $(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
++
++$(APPLICATION): $(APPOBJS) $(TITLE).c
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS) -o $@ $(APPOBJS) $(LOADLIBES)
++endif
++
+ install: all
+ $(MKDIR) $(FAKEROOT)$(SECUREDIR)
+ ifdef DYNAMIC
+ $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
+ endif
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=install $(INSTALL) $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
++endif
+ $(MKDIR) $(FAKEROOT)$(SUPLEMENTED)
+ $(INSTALL) -m $(APPMODE) $(APPLICATION) $(FAKEROOT)$(SUPLEMENTED)
+
+ remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=uninstall rm $(FAKEROOT)$(SECUREDIR)/$(TITLE).la
++endif
+ rm -f $(FAKEROOT)$(SUPLEMENTED)/$(TITLE)
+
+ clean:
+- rm -f $(LIBOBJD) $(LIBOBJS) $(APPOBJD) $(APPOBJS) core *~
+- rm -f *.a *.o *.so *.bak dynamic/* static/* $(APPLICATION)
+- rm -rf dynamic static
++ rm -f $(LIBOBJD) $(LIBOBJS) $(LIBOBJLA) $(APPOBJD) $(APPOBJS) core *~
++ rm -f *.a *.la *.lo *.o *.so *.bak dynamic/* static/* $(APPLICATION)
++ rm -rf dynamic static .libs
+
+ .c.o:
+ $(CC) $(CFLAGS) -c $<
diff --git a/security/PAM/patches/patch-aw b/security/PAM/patches/patch-aw
new file mode 100644
index 00000000000..eed6738364b
--- /dev/null
+++ b/security/PAM/patches/patch-aw
@@ -0,0 +1,137 @@
+$NetBSD: patch-aw,v 1.4 2004/11/16 07:46:58 jlam Exp $
+
+--- modules/pam_unix/Makefile.orig 2001-02-11 01:33:53.000000000 -0500
++++ modules/pam_unix/Makefile
+@@ -55,6 +55,7 @@ LIBSRC = pam_unix_auth.c pam_unix_acct.c
+ support.c
+ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+ LIBOBJS = $(addprefix static/,$(LIBOBJ))
++LIBOBJLA = $(LIBOBJ:.o=.lo)
+
+ PLUS = md5_good.o md5_broken.o md5_crypt_good.o md5_crypt_broken.o \
+ yppasswd_xdr.o bigcrypt.o
+@@ -65,11 +66,24 @@ endif
+ ifdef STATIC
+ LIBSTATIC = libpam_unix.o
+ endif
++ifdef LIBTOOL
++LIBLIBTOOL = pam_unix.la
++endif
+
+
+ ########################### don't edit below #######################
+
+-all: dirs info $(PLUS) $(LIBSHARED) $(LIBSTATIC) $(CHKPWD) register
++ifdef DYNAMIC
++MODULES_TO_BUILD+= $(LIBSHARED)
++endif
++ifdef STATIC
++MODULES_TO_BUILD+= $(LIBSTATIC)
++endif
++ifdef LIBTOOL
++MODULES_TO_BUILD+= $(LIBLIBTOOL)
++endif
++
++all: dirs info $(MODULES_TO_BUILD) $(CHKPWD) register
+
+ dynamic/%.o : %.c
+ $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+@@ -77,6 +91,9 @@ dynamic/%.o : %.c
+ static/%.o: %.c
+ $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -DPAM_DYNAMIC $(TARGET_ARCH) -c $<
++
+ dummy:
+ @echo "**** This is not a top-level Makefile "
+ exit
+@@ -117,10 +134,17 @@ $(LIBSTATIC): $(LIBOBJS)
+ $(LD) -r -o $@ $(LIBOBJS) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT)
+ endif
+
++ifdef LIBTOOL
++$(LIBOBJLA): $(LIBSRC)
++
++$(LIBLIBTOOL): $(LIBOBJLA) $(PLUS:.o=.lo)
++ $(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ $(PLUS:.o=.lo) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT) -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
++endif
++
+ $(CHKPWD): unix_chkpwd.o md5_good.o md5_broken.o \
+ md5_crypt_good.o md5_crypt_broken.o \
+ bigcrypt.o
+- $(CC) -o $(CHKPWD) $^ $(LDLIBS) $(LIBCRYPT)
++ $(CC) $(LDFLAGS) -o $(CHKPWD) $^ $(LDLIBS) $(LIBCRYPT)
+
+ unix_chkpwd.o: unix_chkpwd.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+@@ -129,18 +153,38 @@ md5_good.o: md5.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DHIGHFIRST -D'MD5Name(x)=Good##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_good.lo: md5.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -DHIGHFIRST -D'MD5Name(x)=Good##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ md5_broken.o: md5.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_broken.lo: md5.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -D'MD5Name(x)=Broken##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ md5_crypt_good.o: md5_crypt.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Good##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_crypt_good.lo: md5_crypt.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -D'MD5Name(x)=Good##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ md5_crypt_broken.o: md5_crypt.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_crypt_broken.lo: md5_crypt.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -D'MD5Name(x)=Broken##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ install: all
+ mkdir -p $(FAKEROOT)$(SECUREDIR)
+ ifdef DYNAMIC
+@@ -148,19 +192,28 @@ ifdef DYNAMIC
+ for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
+ do ln -sf $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
+ endif
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=install install $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
++ . $(FAKEROOT)$(SECUREDIR)/$(LIBLIBTOOL); \
++ for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
++ do ln -sf $$dlname $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
++endif
+ $(MKDIR) $(FAKEROOT)$(SUPLEMENTED)
+ install -m 4555 $(CHKPWD) $(FAKEROOT)$(SUPLEMENTED)
+
+ remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(LIBSHARED)
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=uninstall rm $(FAKEROOT)$(SECUREDIR)/$(LIBLIBTOOL)
++endif
+ for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
+ do rm -f $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
+ rm -f $(FAKEROOT)$(SUPLEMENTED)/$(CHKPWD)
+
+ clean:
+- rm -f $(LIBOBJD) $(LIBOBJS) $(CHKPWD) *.o *.so core
++ rm -f $(LIBOBJD) $(LIBOBJS) $(LIBOBJLA) $(CHKPWD) *.la *.lo *.o *.so core
+ rm -f *~ *.a *.out *.bak
+- rm -rf dynamic static
++ rm -rf dynamic static .libs
+
+ .c.o:
+ $(CC) -c $(CFLAGS) $<
diff --git a/security/PAM/patches/patch-ax b/security/PAM/patches/patch-ax
new file mode 100644
index 00000000000..0f74493a216
--- /dev/null
+++ b/security/PAM/patches/patch-ax
@@ -0,0 +1,13 @@
+$NetBSD: patch-ax,v 1.3 2004/11/16 07:46:58 jlam Exp $
+
+--- Makefile.orig 2001-05-08 00:14:20.000000000 -0400
++++ Makefile
+@@ -15,7 +15,7 @@ ifeq ($(shell test \! -f Make.Rules || e
+ include Make.Rules
+ endif
+
+-THINGSTOMAKE = modules libpam libpamc libpam_misc doc examples
++THINGSTOMAKE = modules libpam libpamc libpam_misc doc
+
+ all: $(THINGSTOMAKE)
+