summaryrefslogtreecommitdiff
path: root/usr/src/lib/libmd
diff options
context:
space:
mode:
authorRod Evans <Rod.Evans@Sun.COM>2010-06-28 15:32:48 -0700
committerRod Evans <Rod.Evans@Sun.COM>2010-06-28 15:32:48 -0700
commit1e49577a7fcde812700ded04431b49d67cc57d6d (patch)
treec8f02eda62c4ca17100384b35d90e36d44d29af8 /usr/src/lib/libmd
parentd28831b861181e5df28cac8efd6a92489e6feded (diff)
downloadillumos-joyent-1e49577a7fcde812700ded04431b49d67cc57d6d.tar.gz
6924858 various OSNet components could be simplified with symbol capabilities
--HG-- rename : usr/src/lib/libc_psr/Makefile => usr/src/lib/libc/capabilities/Makefile rename : usr/src/lib/libc_psr/Makefile.targ => usr/src/lib/libc/capabilities/Makefile.targ rename : usr/src/lib/libc_psr/sun4u-opl/Makefile => usr/src/lib/libc/capabilities/sun4u-opl/Makefile rename : usr/src/lib/libc_psr/sun4u-opl/Makefile.com => usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com rename : usr/src/lib/libc_psr/sun4u-opl/common/memcpy.s => usr/src/lib/libc/capabilities/sun4u-opl/common/memcpy.s rename : usr/src/lib/libc_psr/sun4u-opl/sparc/Makefile => usr/src/lib/libc/capabilities/sun4u-opl/sparc/Makefile rename : usr/src/lib/libc_psr/sun4u-opl/sparcv9/Makefile => usr/src/lib/libc/capabilities/sun4u-opl/sparcv9/Makefile rename : usr/src/lib/libc_psr/sun4u_hwcap1/Makefile => usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile rename : usr/src/lib/libc_psr/sun4u_hwcap1/Makefile.com => usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com rename : usr/src/lib/libc_psr/sun4u_hwcap1/sparc/Makefile => usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/sparc/Makefile rename : usr/src/lib/libc_psr/sun4u_hwcap1/sparcv9/Makefile => usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/sparcv9/Makefile rename : usr/src/lib/libc_psr/sun4u_hwcap2/Makefile => usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile rename : usr/src/lib/libc_psr/sun4u_hwcap2/Makefile.com => usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com rename : usr/src/lib/libc_psr/sun4u_hwcap2/mapfile => usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/common/mapfile-cap rename : usr/src/lib/libc_psr/sun4u_hwcap2/sparc/Makefile => usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/sparc/Makefile rename : usr/src/lib/libc_psr/sun4u_hwcap2/sparcv9/Makefile => usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/sparcv9/Makefile rename : usr/src/lib/libc_psr/sun4u-us3/common/memcmp.s => usr/src/lib/libc/capabilities/sun4u-us3/common/memcmp.s rename : usr/src/lib/libc_psr/sun4u-us3/common/memcpy.s => usr/src/lib/libc/capabilities/sun4u-us3/common/memcpy.s rename : usr/src/lib/libc_psr/sun4u-us3/common/memset.s => usr/src/lib/libc/capabilities/sun4u-us3/common/memset.s rename : usr/src/lib/libc_psr/sun4u/Makefile => usr/src/lib/libc/capabilities/sun4u/Makefile rename : usr/src/lib/libc_psr/sun4u/common/memcmp.s => usr/src/lib/libc/capabilities/sun4u/common/memcmp.s rename : usr/src/lib/libc_psr/sun4u/common/memcpy.s => usr/src/lib/libc/capabilities/sun4u/common/memcpy.s rename : usr/src/lib/libc_psr/sun4u/common/memset.s => usr/src/lib/libc/capabilities/sun4u/common/memset.s rename : usr/src/lib/libc_psr/sun4u/sparc/Makefile => usr/src/lib/libc/capabilities/sun4u/sparc/Makefile rename : usr/src/lib/libc_psr/sun4u/sparcv9/Makefile => usr/src/lib/libc/capabilities/sun4u/sparcv9/Makefile rename : usr/src/lib/libc_psr/sun4v_hwcap1/Makefile => usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile rename : usr/src/lib/libc_psr/sun4v_hwcap1/Makefile.com => usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com rename : usr/src/lib/libc_psr/sun4v_hwcap1/sparc/Makefile => usr/src/lib/libc/capabilities/sun4v-hwcap1/sparc/Makefile rename : usr/src/lib/libc_psr/sun4v_hwcap1/sparcv9/Makefile => usr/src/lib/libc/capabilities/sun4v-hwcap1/sparcv9/Makefile rename : usr/src/lib/libc_psr/sun4v_hwcap2/Makefile => usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile rename : usr/src/lib/libc_psr/sun4v_hwcap2/Makefile.com => usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com rename : usr/src/lib/libc_psr/sun4v_hwcap2/sparc/Makefile => usr/src/lib/libc/capabilities/sun4v-hwcap2/sparc/Makefile rename : usr/src/lib/libc_psr/sun4v_hwcap2/sparcv9/Makefile => usr/src/lib/libc/capabilities/sun4v-hwcap2/sparcv9/Makefile rename : usr/src/lib/libc_psr/sun4v/common/memcpy.s => usr/src/lib/libc/capabilities/sun4v/common/memcpy.s rename : usr/src/lib/libc_psr/sun4v/common/memset.s => usr/src/lib/libc/capabilities/sun4v/common/memset.s rename : usr/src/lib/libmd/sun4u/Makefile => usr/src/lib/libmd/capabilities/sun4u/Makefile rename : usr/src/lib/libmd/sun4u/Makefile.com => usr/src/lib/libmd/capabilities/sun4u/Makefile.com rename : usr/src/lib/libmd/sun4u/sparc/Makefile => usr/src/lib/libmd/capabilities/sun4u/sparc/Makefile rename : usr/src/lib/libmd/sun4u/sparcv9/Makefile => usr/src/lib/libmd/capabilities/sun4u/sparcv9/Makefile rename : usr/src/lib/libmd/sun4v/Makefile => usr/src/lib/libmd/capabilities/sun4v/Makefile rename : usr/src/lib/libmd/sun4v/Makefile.com => usr/src/lib/libmd/capabilities/sun4v/Makefile.com rename : usr/src/lib/libmd/sun4v/sparc/Makefile => usr/src/lib/libmd/capabilities/sun4v/sparc/Makefile rename : usr/src/lib/libmd/sun4v/sparcv9/Makefile => usr/src/lib/libmd/capabilities/sun4v/sparcv9/Makefile rename : usr/src/lib/pkcs11/libsoftcrypto/i386_hwcap1/Makefile => usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/Makefile rename : usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile rename : usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile.com => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com rename : usr/src/lib/pkcs11/libsoftcrypto/sun4u/mapfile-vers => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/common/mapfile-cap rename : usr/src/lib/pkcs11/libsoftcrypto/sun4u/sparc/Makefile => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/sparc/Makefile rename : usr/src/lib/pkcs11/libsoftcrypto/sun4u/sparcv9/Makefile => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/sparcv9/Makefile rename : usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile rename : usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile.com => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com rename : usr/src/lib/pkcs11/libsoftcrypto/sun4v/mapfile-vers => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/common/mapfile-cap rename : usr/src/lib/pkcs11/libsoftcrypto/sun4v/sparc/Makefile => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/sparc/Makefile rename : usr/src/lib/pkcs11/libsoftcrypto/sun4v/sparcv9/Makefile => usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/sparcv9/Makefile
Diffstat (limited to 'usr/src/lib/libmd')
-rw-r--r--usr/src/lib/libmd/Makefile26
-rw-r--r--usr/src/lib/libmd/Makefile.com97
-rw-r--r--usr/src/lib/libmd/Makefile.targ49
-rw-r--r--usr/src/lib/libmd/amd64/Makefile48
-rw-r--r--usr/src/lib/libmd/capabilities/Makefile49
-rw-r--r--usr/src/lib/libmd/capabilities/Makefile.com34
-rw-r--r--usr/src/lib/libmd/capabilities/Makefile.targ71
-rw-r--r--usr/src/lib/libmd/capabilities/sun4u/Makefile (renamed from usr/src/lib/libmd/sun4u/Makefile)23
-rw-r--r--usr/src/lib/libmd/capabilities/sun4u/Makefile.com (renamed from usr/src/lib/libmd/sun4v/Makefile.com)24
-rw-r--r--usr/src/lib/libmd/capabilities/sun4u/Makefile.targ (renamed from usr/src/lib/libmd/sun4v/Makefile.links)13
-rw-r--r--usr/src/lib/libmd/capabilities/sun4u/common/mapfile-cap40
-rw-r--r--usr/src/lib/libmd/capabilities/sun4u/sparc/Makefile34
-rw-r--r--usr/src/lib/libmd/capabilities/sun4u/sparcv9/Makefile36
-rw-r--r--usr/src/lib/libmd/capabilities/sun4v/Makefile (renamed from usr/src/lib/libmd/sun4v/Makefile)23
-rw-r--r--usr/src/lib/libmd/capabilities/sun4v/Makefile.com (renamed from usr/src/lib/libmd/sun4u/Makefile.com)23
-rw-r--r--usr/src/lib/libmd/capabilities/sun4v/Makefile.targ25
-rw-r--r--usr/src/lib/libmd/capabilities/sun4v/common/mapfile-cap37
-rw-r--r--usr/src/lib/libmd/capabilities/sun4v/sparc/Makefile34
-rw-r--r--usr/src/lib/libmd/capabilities/sun4v/sparcv9/Makefile36
-rw-r--r--usr/src/lib/libmd/i386/Makefile24
-rw-r--r--usr/src/lib/libmd/sparc/Makefile28
-rw-r--r--usr/src/lib/libmd/sparcv9/Makefile30
-rw-r--r--usr/src/lib/libmd/sun4u/Makefile.links61
-rw-r--r--usr/src/lib/libmd/sun4u/sparc/Makefile55
-rw-r--r--usr/src/lib/libmd/sun4u/sparcv9/Makefile55
-rw-r--r--usr/src/lib/libmd/sun4v/sparc/Makefile53
-rw-r--r--usr/src/lib/libmd/sun4v/sparcv9/Makefile55
27 files changed, 609 insertions, 474 deletions
diff --git a/usr/src/lib/libmd/Makefile b/usr/src/lib/libmd/Makefile
index 16ca733489..ddd89d7382 100644
--- a/usr/src/lib/libmd/Makefile
+++ b/usr/src/lib/libmd/Makefile
@@ -18,19 +18,16 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
-include ../Makefile.lib
+include $(SRC)/lib/Makefile.lib
-$(SPARC_BLD)PLATFORMS= sun4u sun4v
+$(SPARC_BLD)CAPDIR = capabilities
-SUBDIRS= $(MACH) $(PLATFORMS)
-$(BUILD64)SUBDIRS += $(MACH64)
+SUBDIRS= $(MACH) $(BUILD64) $(MACH64)
HDRS = md4.h md5.h sha1.h sha2.h
HDRDIR = common
@@ -43,16 +40,19 @@ lint := TARGET= lint
.KEEP_STATE:
-.PARALLEL: $(SUBDIRS)
+.PARALLEL: $(SUBDIRS)
-all clean clobber install lint: $(SUBDIRS)
+all clean clobber install lint: \
+ $(CAPDIR) .WAIT $(SUBDIRS)
install_h: $(ROOTHDRS)
check: $(CHECKHDRS)
-$(SUBDIRS): FRC
- @cd $@; pwd; $(MAKE) $(TARGET)
+$(CAPDIR) \
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
FRC:
-include ../Makefile.targ
+include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libmd/Makefile.com b/usr/src/lib/libmd/Makefile.com
index 1b79026d0e..af8cac390b 100644
--- a/usr/src/lib/libmd/Makefile.com
+++ b/usr/src/lib/libmd/Makefile.com
@@ -18,96 +18,23 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
-# $LIBRARY is set in lower makefiles so we can have platform and
-# processor optimised versions of this library via libmd_psr and libmd_hwcapN
-
-#LIBRARY= libmd.a
-VERS= .1
-
-OBJECTS= md4.o md5.o $(MD5_PSR_OBJECTS) sha1.o $(SHA1_PSR_OBJECTS) \
- sha2.o $(SHA2_PSR_OBJECTS)
-
-# Use $(SRC) to include makefiles rather than ../../ because the
-# platform subdirs are one level deeper so it would be ../../../ for them
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/lib/Makefile.rootfs
-
LIBS = $(DYNLIB) $(LINTLIB)
-SRCS = \
- $(COMDIR)/md4/md4.c \
- $(COMDIR)/md5/md5.c \
- $(COMDIR)/sha1/sha1.c \
- $(COMDIR)/sha2/sha2.c
-
-COMDIR= $(SRC)/common/crypto
-
-$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
-LDLIBS += -lc
+SRCS = $(COMDIR)/md4/md4.c \
+ $(COMDIR)/md5/md5.c \
+ $(COMDIR)/sha1/sha1.c \
+ $(COMDIR)/sha2/sha2.c
-SRCDIR = ../common
COMDIR = $(SRC)/common/crypto
+SRCDIR = ../common
+MAPFILEDIR = $(SRCDIR)
-CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
-CFLAGS64 += $(C_BIGPICFLAGS)
-CPPFLAGS += -I$(SRCDIR)
-
-ROOTLINT= $(LINTSRC:%=$(ROOTLIBDIR)/%)
-
-.KEEP_STATE:
-
-all: $(LIBS)
-
-lint: lintcheck
-
-pics/%.o: $(COMDIR)/md4/%.c
- $(COMPILE.c) -I$(COMDIR)/md4 -o $@ $<
- $(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/md5/%.c
- $(COMPILE.c) -I$(COMDIR)/md5 $(INLINES) -o $@ $<
- $(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/sha1/%.c
- $(COMPILE.c) -I$(COMDIR)/sha1 -o $@ $<
- $(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
- $(COMPILE.s) -P -DPIC -D_ASM -o $@ $<
- $(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/sha2/%.c
- $(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
- $(POST_PROCESS_O)
-
-#
-# Used when building links in /platform/$(PLATFORM)/lib for libmd_psr.so.1
-#
-
-LIBMD_PSR_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
-LIBMD_PSR_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
-
-LIBMD_PSR64_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
-LIBMD_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
-
-INS.slink6 = $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
-
-INS.slink64 = $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
-
-$(LIBMD_PSR_DIRS):
- -$(INS.dir)
-
-$(LIBMD_PSR_LINKS): $(LIBMD_PSR_DIRS)
- -$(INS.slink6)
-
-$(LIBMD_PSR64_DIRS):
- -$(INS.dir)
-
-$(LIBMD_PSR64_LINKS): $(LIBMD_PSR64_DIRS)
- -$(INS.slink64)
+CFLAGS += $(CCVERBOSE)
+CPPFLAGS += -I$(SRCDIR)
+LDLIBS += -lc
-include $(SRC)/lib/Makefile.targ
+$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
diff --git a/usr/src/lib/libmd/Makefile.targ b/usr/src/lib/libmd/Makefile.targ
new file mode 100644
index 0000000000..58ec7b30e5
--- /dev/null
+++ b/usr/src/lib/libmd/Makefile.targ
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+COMDIR = $(SRC)/common/crypto
+
+pics/%.o: $(COMDIR)/md4/%.c
+ $(COMPILE.c) -I$(COMDIR)/md4 -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: $(COMDIR)/md5/%.c
+ $(COMPILE.c) -I$(COMDIR)/md5 $(INLINES) -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/%.o: $(COMDIR)/sha1/%.c
+ $(COMPILE.c) -I$(COMDIR)/sha1 -o $@ $<
+ $(POST_PROCESS_O)
+
+pics/sha1_asm.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
+ $(COMPILE.s) -o pics/sha1_asm.o \
+ $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
+ $(POST_PROCESS_O)
+
+pics/%.o: $(COMDIR)/sha2/%.c
+ $(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
+ $(POST_PROCESS_O)
+
+include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libmd/amd64/Makefile b/usr/src/lib/libmd/amd64/Makefile
index be5476ac90..3872749fbb 100644
--- a/usr/src/lib/libmd/amd64/Makefile
+++ b/usr/src/lib/libmd/amd64/Makefile
@@ -19,40 +19,52 @@
# CDDL HEADER END
#
#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
-LIBRARY= libmd.a
+LIBRARY = libmd.a
+VERS = .1
+
+OBJECTS = md4.o md5.o sha1.o sha2.o
-MD5_PSR_OBJECTS = md5_amd64.o
-SHA1_PSR_OBJECTS = sha1-x86_64.o
-SHA2_PSR_OBJECTS = sha512-x86_64.o sha256-x86_64.o
+include $(SRC)/lib/Makefile.lib
+include $(SRC)/lib/Makefile.rootfs
+include $(SRC)/lib/Makefile.lib.64
+include ../Makefile.com
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
+EXTPICS = pics/md5_amd64.o \
+ pics/sha1-x86_64.o \
+ pics/sha512-x86_64.o \
+ pics/sha256-x86_64.o
-CLEANFILES += md5_amd64.s sha1-x86_64.s sha512-x86_64.s sha256-x86_64.s
+CLEANFILES += $(EXTPICS) \
+ $(EXTPICS:pics/%.o=%.s)
# This prevents <sys/asm_linkage.h> from including C source:
AS_CPPFLAGS += -D_ASM
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+.KEPP_STATE:
+
+all: $(LIBS)
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+
+lint: lintcheck
pics/%.o: %.s
- $(COMPILE.s) -o $@ ${@F:.o=.s}
- $(POST_PROCESS_O)
+ $(COMPILE.s) -o $@ ${@F:.o=.s}
+ $(POST_PROCESS_O)
md5_amd64.s: $(COMDIR)/md5/amd64/md5_amd64.pl
- $(PERL) $? $@
+ $(PERL) $? $@
sha1-x86_64.s: $(COMDIR)/sha1/amd64/sha1-x86_64.pl
- $(PERL) $? $@
+ $(PERL) $? $@
sha512-x86_64.s: $(COMDIR)/sha2/amd64/sha512-x86_64.pl
- $(PERL) $? $@
+ $(PERL) $? $@
sha256-x86_64.s: $(COMDIR)/sha2/amd64/sha512-x86_64.pl
- $(PERL) $? $@
+ $(PERL) $? $@
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/capabilities/Makefile b/usr/src/lib/libmd/capabilities/Makefile
new file mode 100644
index 0000000000..51c8921240
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/Makefile
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include $(SRC)/lib/Makefile.lib
+
+# Each target directory is responsible for making a symbol capabilities object.
+$(SPARC_BLD)SUBDIRS = sun4u sun4v
+$(INTEL_BLD)SUBDIRS =
+
+all := TARGET= all
+clean := TARGET= clean
+clobber := TARGET= clobber
+install := TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL: $(SUBDIRS)
+
+all clean clobber install: \
+ $(SUBDIRS)
+
+lint:
+
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
diff --git a/usr/src/lib/libmd/capabilities/Makefile.com b/usr/src/lib/libmd/capabilities/Makefile.com
new file mode 100644
index 0000000000..7c550fb533
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/Makefile.com
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#include ../../../Makefile.com
+
+MAPFILE-CAP = ../common/mapfile-cap
+MAPOPT-CAP = $(MAPFILE-CAP:%=-M%)
+
+OBJCAP = pics/objcap.o
+SYMCAP = pics/symcap.o
+
+CLOBBERFILES += $(OBJCAP) $(SYMCAP)
diff --git a/usr/src/lib/libmd/capabilities/Makefile.targ b/usr/src/lib/libmd/capabilities/Makefile.targ
new file mode 100644
index 0000000000..86815a1987
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/Makefile.targ
@@ -0,0 +1,71 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# libmd provides two families of optimized functions for SPARC platforms,
+# one for sun4u, and one for sun4v. Previous implementations provided
+# these families as libmd_psr.so.1 libraries, triggered by tagging libmd.so.1
+# as an auxiliary filter. These psr filtees were installed under
+# /usr/platform/sun4u/lib, and numerous symlinks were established to provide
+# the necessary $PLATFORM names, ie:
+#
+# /usr/platform/SUNW,Ultra-2/lib/libmd_psr.so.1 -> ../../../sun4u
+# /usr/platform/SUNW,Ultra-4/lib/libmd_psr.so.1 -> ../../../sun4u
+# ....
+#
+# and:
+#
+# /usr/platform/SUNW,Netra-CP3060/lib/libmd_psr.so.1 -> ../../sun4v
+# /usr/platform/SUNW,Netra-CP3260/lib/libmd_psr.so.1 -> ../../sun4v/
+# ....
+#
+# The objects that made up these filtees are now combined into one relocatable
+# object, pics/objcap.o, using ../common/mapfile-cap. This mapfile identifies
+# the machine hardware name, together with establishing the global symbols that
+# should be exported to define each family.
+#
+# This object capabilities relocatable object is then translated into a symbol
+# capabilities relocatable object, pics/symcap.o.
+#
+# The sun4u and sun4v families of symbol capabilities object are eventually
+# included in the final build of libmd.so.1.
+
+$(SYMCAP): $(OBJCAP)
+$(OBJCAP): $(PICS)
+$(PICS): pics
+
+# Combine all pic objects into one relocatable object. Assign any capabilities
+# to this object, and define the interface.
+
+pics/objcap.o: $(PICS) $(MAPFILE-CAP)
+ $(LD) -r -o $@ $(MAPOPT-CAP) -Breduce $(PICS)
+
+# Convert the combined object capabilities object into a symbol capabilities
+# object.
+
+pics/symcap.o: $(OBJCAP)
+ $(LD) -r -o $@ -z symbolcap $(OBJCAP)
+
+include ../../../Makefile.targ
diff --git a/usr/src/lib/libmd/sun4u/Makefile b/usr/src/lib/libmd/capabilities/sun4u/Makefile
index b65f30de75..77aed04fa7 100644
--- a/usr/src/lib/libmd/sun4u/Makefile
+++ b/usr/src/lib/libmd/capabilities/sun4u/Makefile
@@ -18,29 +18,30 @@
#
# CDDL HEADER END
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
-include $(SRC)/Makefile.master
+include $(SRC)/lib/Makefile.lib
-SUBDIRS= $(MACH)
-$(BUILD64)SUBDIRS += $(MACH64)
+SUBDIRS = $(MACH) $(BUILD64) $(MACH64)
all := TARGET= all
clean := TARGET= clean
clobber := TARGET= clobber
-lint := TARGET= lint
install := TARGET= install
.KEEP_STATE:
-.PARALLEL: $(MACH) $(MACH64)
+.PARALLEL: $(SUBDIRS)
+
+all clean clobber install: \
+ $(SUBDIRS)
-all clean clobber lint install: $(SUBDIRS)
+lint:
-$(MACH) $(MACH64): FRC
- @cd $@; pwd; $(MAKE) $(TARGET)
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
FRC:
diff --git a/usr/src/lib/libmd/sun4v/Makefile.com b/usr/src/lib/libmd/capabilities/sun4u/Makefile.com
index 6cef14c4ed..8622e03cb4 100644
--- a/usr/src/lib/libmd/sun4v/Makefile.com
+++ b/usr/src/lib/libmd/capabilities/sun4u/Makefile.com
@@ -18,24 +18,22 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
-LIBRARY= libmd_psr.a
+PLATFORM = sun4u
-include $(SRC)/Makefile.psm
-include ../Makefile.links
-include ../../Makefile.com
+include ../../Makefile.com
-LIBS= $(DYNLIB)
+OBJECTS = md5.o sha1.o sha1_asm.o
-CFLAGS += -m32 -xarch=sparcvis
-CPPFLAGS += -D$(PLATFORM)
-ASFLAGS = -P $(ASDEFS)
+include $(SRC)/lib/Makefile.lib
-INLINES= $(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
+INLINES = $(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
-# XXX This seems wrong since we explicitly set LIBS to be DYNLIB only
-$(LINTLIB):= SRCS= ../../common/llib-lmd
+AS_CPPFLAGS += -D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
+ASFLAGS += $(AS_PICFLAGS) -P
+CFLAGS += $(CCVERBOSE) -xarch=sparcvis
+CPPFLAGS += -D$(PLATFORM) -DVIS_SHA1
diff --git a/usr/src/lib/libmd/sun4v/Makefile.links b/usr/src/lib/libmd/capabilities/sun4u/Makefile.targ
index e03b1e1b15..63e36816cc 100644
--- a/usr/src/lib/libmd/sun4v/Makefile.links
+++ b/usr/src/lib/libmd/capabilities/sun4u/Makefile.targ
@@ -19,14 +19,7 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# lib/libmd/Makefile.sun4v.links
-#
-#
-# Used when building links in /platform/sun4v/lib
-#
-LINKED_PLATFORMS = SUNW,Sun-Fire-T200
+
+include ../../Makefile.targ
diff --git a/usr/src/lib/libmd/capabilities/sun4u/common/mapfile-cap b/usr/src/lib/libmd/capabilities/sun4u/common/mapfile-cap
new file mode 100644
index 0000000000..1e7c55abca
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/sun4u/common/mapfile-cap
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u {
+ MACHINE = sun4u;
+};
+
+SYMBOL_SCOPE {
+ global:
+ MD5Init;
+ MD5Update;
+ MD5Final;
+ SHA1Init;
+ SHA1Update;
+ SHA1Final;
+ local:
+ *;
+};
diff --git a/usr/src/lib/libmd/capabilities/sun4u/sparc/Makefile b/usr/src/lib/libmd/capabilities/sun4u/sparc/Makefile
new file mode 100644
index 0000000000..99651943ca
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/sun4u/sparc/Makefile
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../Makefile.com
+
+ASFLAGS += -xarch=v8plusa -warn
+
+.KEEP_STATE:
+
+all install: $(SYMCAP)
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/capabilities/sun4u/sparcv9/Makefile b/usr/src/lib/libmd/capabilities/sun4u/sparcv9/Makefile
new file mode 100644
index 0000000000..183da1f33f
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/sun4u/sparcv9/Makefile
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../Makefile.com
+include $(SRC)/lib/Makefile.lib.64
+
+.KEEP_STATE:
+
+AS_CPPFLAGS += -D__sparcv9
+ASFLAGS += -xarch=v9a
+
+all install: $(SYMCAP)
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/sun4v/Makefile b/usr/src/lib/libmd/capabilities/sun4v/Makefile
index b65f30de75..77aed04fa7 100644
--- a/usr/src/lib/libmd/sun4v/Makefile
+++ b/usr/src/lib/libmd/capabilities/sun4v/Makefile
@@ -18,29 +18,30 @@
#
# CDDL HEADER END
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
-include $(SRC)/Makefile.master
+include $(SRC)/lib/Makefile.lib
-SUBDIRS= $(MACH)
-$(BUILD64)SUBDIRS += $(MACH64)
+SUBDIRS = $(MACH) $(BUILD64) $(MACH64)
all := TARGET= all
clean := TARGET= clean
clobber := TARGET= clobber
-lint := TARGET= lint
install := TARGET= install
.KEEP_STATE:
-.PARALLEL: $(MACH) $(MACH64)
+.PARALLEL: $(SUBDIRS)
+
+all clean clobber install: \
+ $(SUBDIRS)
-all clean clobber lint install: $(SUBDIRS)
+lint:
-$(MACH) $(MACH64): FRC
- @cd $@; pwd; $(MAKE) $(TARGET)
+$(SUBDIRS): FRC
+ @cd $@; pwd; $(MAKE) $(TARGET)
FRC:
diff --git a/usr/src/lib/libmd/sun4u/Makefile.com b/usr/src/lib/libmd/capabilities/sun4v/Makefile.com
index 9fe1ae7d35..2b1b457197 100644
--- a/usr/src/lib/libmd/sun4u/Makefile.com
+++ b/usr/src/lib/libmd/capabilities/sun4v/Makefile.com
@@ -19,23 +19,20 @@
# CDDL HEADER END
#
#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
-LIBRARY= libmd_psr.a
+PLATFORM = sun4v
-include $(SRC)/Makefile.psm
-include ../Makefile.links
-include ../../Makefile.com
+include ../../Makefile.com
-LIBS= $(DYNLIB)
+OBJECTS = md5.o
-CFLAGS += -m32 -xarch=sparcvis
-CPPFLAGS += -D$(PLATFORM) -DVIS_SHA1
-ASFLAGS = -P $(ASDEFS)
+include $(SRC)/lib/Makefile.lib
-INLINES= $(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
+INLINES = $(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
-# XXX This seems wrong since we explicitly set LIBS to be DYNLIB only
-$(LINTLIB):= SRCS= ../../common/llib-lmd
+AS_CPPFLAGS += -D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
+ASFLAGS += $(AS_PICFLAGS) -P
+CFLAGS += $(CCVERBOSE) -xarch=sparcvis
+CPPFLAGS += -D$(PLATFORM)
diff --git a/usr/src/lib/libmd/capabilities/sun4v/Makefile.targ b/usr/src/lib/libmd/capabilities/sun4v/Makefile.targ
new file mode 100644
index 0000000000..63e36816cc
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/sun4v/Makefile.targ
@@ -0,0 +1,25 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../Makefile.targ
diff --git a/usr/src/lib/libmd/capabilities/sun4v/common/mapfile-cap b/usr/src/lib/libmd/capabilities/sun4v/common/mapfile-cap
new file mode 100644
index 0000000000..72b5738c25
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/sun4v/common/mapfile-cap
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4v {
+ MACHINE = sun4v;
+};
+
+SYMBOL_SCOPE {
+ global:
+ MD5Init;
+ MD5Update;
+ MD5Final;
+ local:
+ *;
+};
diff --git a/usr/src/lib/libmd/capabilities/sun4v/sparc/Makefile b/usr/src/lib/libmd/capabilities/sun4v/sparc/Makefile
new file mode 100644
index 0000000000..99651943ca
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/sun4v/sparc/Makefile
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../Makefile.com
+
+ASFLAGS += -xarch=v8plusa -warn
+
+.KEEP_STATE:
+
+all install: $(SYMCAP)
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/capabilities/sun4v/sparcv9/Makefile b/usr/src/lib/libmd/capabilities/sun4v/sparcv9/Makefile
new file mode 100644
index 0000000000..65cdc485a4
--- /dev/null
+++ b/usr/src/lib/libmd/capabilities/sun4v/sparcv9/Makefile
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../Makefile.com
+include $(SRC)/lib/Makefile.lib.64
+
+AS_CPPFLAGS += -D__sparcv9
+ASFLAGS += -xarch=v9a
+
+.KEEP_STATE:
+
+all install: $(SYMCAP)
+
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/i386/Makefile b/usr/src/lib/libmd/i386/Makefile
index 2b05624aa1..3e6fe00e17 100644
--- a/usr/src/lib/libmd/i386/Makefile
+++ b/usr/src/lib/libmd/i386/Makefile
@@ -18,14 +18,26 @@
#
# CDDL HEADER END
#
+
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
-LIBRARY= libmd.a
+LIBRARY = libmd.a
+VERS = .1
+
+OBJECTS = md4.o md5.o sha1.o sha2.o
+
+include $(SRC)/lib/Makefile.lib
+include $(SRC)/lib/Makefile.rootfs
+include ../Makefile.com
+
+.KEEP_STATE:
+
+all: $(LIBS)
+
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
-include ../Makefile.com
+lint: lintcheck
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/sparc/Makefile b/usr/src/lib/libmd/sparc/Makefile
index ccce8c78b2..5f491cc9af 100644
--- a/usr/src/lib/libmd/sparc/Makefile
+++ b/usr/src/lib/libmd/sparc/Makefile
@@ -18,15 +18,29 @@
#
# CDDL HEADER END
#
-# ident "%Z%%M% %I% %E% SMI"
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+LIBRARY = libmd.a
+VERS = .1
+
+OBJECTS = md4.o md5.o sha1.o sha2.o
+
+include $(SRC)/lib/Makefile.lib
+include $(SRC)/lib/Makefile.rootfs
+include ../Makefile.com
+
+# Symbol capabilities objects are added for sun4u and sun4v.
+EXTPICS = ../capabilities/sun4u/sparc/pics/symcap.o \
+ ../capabilities/sun4v/sparc/pics/symcap.o
+
+.KEEP_STATE:
-LIBRARY= libmd.a
+all: $(LIBS)
-include ../Makefile.com
+install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
-DYNFLAGS += -Wl,-f/platform/\$$PLATFORM/lib/$(DYNLIBPSR)
+lint: lintcheck
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/sparcv9/Makefile b/usr/src/lib/libmd/sparcv9/Makefile
index 6b3d51b1ea..5dd3f2eac3 100644
--- a/usr/src/lib/libmd/sparcv9/Makefile
+++ b/usr/src/lib/libmd/sparcv9/Makefile
@@ -18,16 +18,30 @@
#
# CDDL HEADER END
#
-# ident "%Z%%M% %I% %E% SMI"
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+LIBRARY = libmd.a
+VERS = .1
+
+OBJECTS = md4.o md5.o sha1.o sha2.o
+
+include $(SRC)/lib/Makefile.lib
+include $(SRC)/lib/Makefile.rootfs
+include $(SRC)/lib/Makefile.lib.64
+include ../Makefile.com
+
+# Symbol capabilities objects are added for sun4u and sun4v.
+EXTPICS = ../capabilities/sun4u/sparcv9/pics/symcap.o \
+ ../capabilities/sun4v/sparcv9/pics/symcap.o
+
+.KEEP_STATE:
-LIBRARY= libmd.a
+all: $(LIBS)
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
+install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
-DYNFLAGS += -Wl,-f/platform/\$$PLATFORM/lib/$(MACH64)/$(DYNLIBPSR)
+lint: lintcheck
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+include ../Makefile.targ
diff --git a/usr/src/lib/libmd/sun4u/Makefile.links b/usr/src/lib/libmd/sun4u/Makefile.links
deleted file mode 100644
index 3c85fd6acd..0000000000
--- a/usr/src/lib/libmd/sun4u/Makefile.links
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# lib/libmd/Makefile.sun4u.links
-#
-#
-# Used when building links in /platform/sun4u/lib
-#
-LINKED_PLATFORMS = SUNW,Ultra-2
-LINKED_PLATFORMS += SUNW,Ultra-4
-LINKED_PLATFORMS += SUNW,Ultra-5_10
-LINKED_PLATFORMS += SUNW,Ultra-30
-LINKED_PLATFORMS += SUNW,Ultra-60
-LINKED_PLATFORMS += SUNW,Ultra-80
-LINKED_PLATFORMS += SUNW,Ultra-250
-LINKED_PLATFORMS += SUNW,Ultra-Enterprise
-LINKED_PLATFORMS += SUNW,Ultra-Enterprise-10000
-LINKED_PLATFORMS += SUNW,UltraAX-i2
-LINKED_PLATFORMS += SUNW,UltraSPARC-IIi-Netract
-LINKED_PLATFORMS += SUNW,UltraSPARC-IIe-NetraCT-40
-LINKED_PLATFORMS += SUNW,UltraSPARC-IIe-NetraCT-60
-LINKED_PLATFORMS += SUNW,Sun-Blade-100
-LINKED_PLATFORMS += SUNW,Sun-Blade-1000
-LINKED_PLATFORMS += SUNW,Sun-Blade-1500
-LINKED_PLATFORMS += SUNW,Sun-Blade-2500
-LINKED_PLATFORMS += SUNW,A70
-LINKED_PLATFORMS += SUNW,Sun-Fire
-LINKED_PLATFORMS += SUNW,Sun-Fire-V215
-LINKED_PLATFORMS += SUNW,Sun-Fire-V240
-LINKED_PLATFORMS += SUNW,Sun-Fire-V250
-LINKED_PLATFORMS += SUNW,Sun-Fire-V440
-LINKED_PLATFORMS += SUNW,Sun-Fire-V445
-LINKED_PLATFORMS += SUNW,Sun-Fire-280R
-LINKED_PLATFORMS += SUNW,Sun-Fire-15000
-LINKED_PLATFORMS += SUNW,Sun-Fire-880
-LINKED_PLATFORMS += SUNW,Sun-Fire-480R
-LINKED_PLATFORMS += SUNW,Serverblade1
-LINKED_PLATFORMS += SUNW,Netra-T12
-LINKED_PLATFORMS += SUNW,Netra-T4
-LINKED_PLATFORMS += SUNW,Netra-CP2300
-LINKED_PLATFORMS += SUNW,Netra-CP3010
diff --git a/usr/src/lib/libmd/sun4u/sparc/Makefile b/usr/src/lib/libmd/sun4u/sparc/Makefile
deleted file mode 100644
index 426b732d4e..0000000000
--- a/usr/src/lib/libmd/sun4u/sparc/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-CLASS = 32
-PLATFORM = sun4u
-MODULE = libmd_psr.so.1
-
-include ../Makefile.com
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS = md5.o sha1.o sha1_asm.o
-
-MAPFILES = mapfile
-
-ASFLAGS += -xarch=v8plusa -warn
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO= $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all: $(LIBS)
-
-$(ROOT_PSM_LIB_DIR)/% := FILEMODE = 755
-
-install: all $(LIBMD_PSR_LINKS) $(ROOT_PSM_LIBS)
-
-include $(SRC)/Makefile.psm.targ
diff --git a/usr/src/lib/libmd/sun4u/sparcv9/Makefile b/usr/src/lib/libmd/sun4u/sparcv9/Makefile
deleted file mode 100644
index 9f94a65cad..0000000000
--- a/usr/src/lib/libmd/sun4u/sparcv9/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-
-CLASS = 64
-PLATFORM = sun4u
-MODULE = libmd_psr.so.1
-
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS = md5.o sha1.o sha1_asm.o
-
-MAPFILES = mapfile
-
-ASDEFS += -D__sparcv9
-ASFLAGS += -xarch=v9a $(AS_BIGPICFLAGS)
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO= $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all: $(LIBS)
-
-$(ROOT_PSM_LIB64_DIR)/% := FILEMODE = 755
-
-install: all $(LIBMD_PSR64_LINKS) $(ROOT_PSM_LIB64_DIR)/$(LIBS)
-
-include $(SRC)/Makefile.psm.targ
diff --git a/usr/src/lib/libmd/sun4v/sparc/Makefile b/usr/src/lib/libmd/sun4v/sparc/Makefile
deleted file mode 100644
index e0754a7da3..0000000000
--- a/usr/src/lib/libmd/sun4v/sparc/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-
-CLASS = 32
-PLATFORM = sun4v
-MODULE = libmd_psr.so.1
-
-include ../Makefile.com
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS = md5.o
-
-MAPFILES = mapfile
-
-ASFLAGS += -xarch=v8plusa -warn
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO= $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all: $(LIBS)
-
-$(ROOT_PSM_LIB_DIR)/% := FILEMODE = 755
-
-install: all $(ROOT_PSM_LIB_DIR)/$(LIBS)
-
-include $(SRC)/Makefile.psm.targ
diff --git a/usr/src/lib/libmd/sun4v/sparcv9/Makefile b/usr/src/lib/libmd/sun4v/sparcv9/Makefile
deleted file mode 100644
index 0c535c6bfb..0000000000
--- a/usr/src/lib/libmd/sun4v/sparcv9/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-
-CLASS = 64
-PLATFORM = sun4v
-MODULE = libmd_psr.so.1
-
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS = md5.o
-
-MAPFILES = mapfile
-
-ASDEFS += -D__sparcv9
-ASFLAGS += -xarch=v9a $(AS_PICFLAGS)
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO= $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all: $(LIBS)
-
-$(ROOT_PSM_LIB64_DIR)/% := FILEMODE = 755
-
-install: all $(ROOT_PSM_LIB64_DIR)/$(LIBS)
-
-include $(SRC)/Makefile.psm.targ