Subject: bsd.lib.mk and static libraries
To: None <tech-toolchain@NetBSD.ORG>
From: Todd Vierling <tv@NetBSD.ORG>
List: tech-toolchain
Date: 04/07/1998 10:30:51
Attached below is a diff that implements two more knobs in <bsd.lib.mk>
similar to the existing ones NOPIC, NOPROFILE, and NOLINT:

- NOSTATICLIB: Prevents build and install of a static version of the given
  library (libNAME.a).  Intended for initial use with libamu and libcc1
  (part of egcs).  Not named NOSTATIC as this could be confused with
  "static program linkage."

- NOPICINSTALL: Prevents install of libNAME_pic.a even if there is a shared
  object (libNAME.so.X.X) library to be installed.  Also for the above two
  libraries, but could be used on a system-wide basis just like NOLINT and
  NOPROFILE.

I'll commit (with changes to libamu and egcs) on Friday if there are no
objections.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)

Index: bsd.lib.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.lib.mk,v
retrieving revision 1.128
diff -u -r1.128 bsd.lib.mk
--- bsd.lib.mk	1998/04/01 16:58:33	1.128
+++ bsd.lib.mk	1998/04/07 14:23:02
@@ -177,10 +177,14 @@
 	@rm -f ${.TARGET}.o
 
 
-.if !defined(NOPROFILE)
-_LIBS=lib${LIB}.a lib${LIB}_p.a
-.else
+.if !defined(NOSTATICLIB)
 _LIBS=lib${LIB}.a
+.else
+_LIBS=
+.endif
+
+.if !defined(NOPROFILE)
+_LIBS+=lib${LIB}_p.a
 .endif
 
 .if !defined(NOPIC)
@@ -254,6 +258,7 @@
 .endif
 
 .if !target(libinstall)
+.if !defined(NOSTATICLIB)
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
 .if !defined(UPDATE)
 .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
@@ -264,6 +269,7 @@
 
 .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
 ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
+.endif
 
 .if !defined(NOPROFILE)
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
@@ -278,7 +284,7 @@
 ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
 .endif
 
-.if !defined(NOPIC)
+.if !defined(NOPIC) && !defined(NOPICINSTALL)
 libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
 .if !defined(UPDATE)
 .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a