--- old/usr/src/Makefile.master	Tue Dec 13 00:13:14 2016
+++ new/usr/src/Makefile.master	Tue Dec 13 00:13:14 2016
@@ -28,6 +28,7 @@
 # Copyright 2015 Gary Mills
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright 2016 Toomas Soome <tsoome@me.com>
+# Copyright 2016 RackTop Systems.
 #
 
 #
@@ -106,6 +107,7 @@
 # uncomment things in the lower Makefiles to enable the feature.
 ENABLE_IPP_PRINTING=	$(POUND_SIGN)
 ENABLE_SMB_PRINTING=	$(POUND_SIGN)
+ENABLE_64BIT_PERL=	$(POUND_SIGN)
 
 # CLOSED is the root of the tree that contains source which isn't released
 # as open source
@@ -176,10 +178,10 @@
 PERL=		/usr/bin/perl
 PERL_VERSION=	5.16.1
 PERL_PKGVERS=	-5161
-PERL_ARCH=	i86pc-solaris-thread-multi-64int
-PERL_ARCH64=	i86pc-solaris-thread-multi-64
-$(SPARC_BLD)PERL_ARCH= sun4-solaris-thread-multi-64int
-$(SPARC_BLD)PERL_ARCH64= sun4-solaris-thread-multi-64int
+PERL_MACH=	i86pc
+$(SPARC_BLD)PERL_MACH=	sun4
+PERL_ARCH=	$(PERL_MACH)-solaris$(PERL_VARIANT)-64int
+PERL_ARCH64=	$(PERL_MACH)-solaris$(PERL_VARIANT)-64
 PYTHON_VERSION=	2.7
 PYTHON_PKGVERS=	-27
 PYTHON=		/usr/bin/python$(PYTHON_VERSION)
@@ -712,6 +714,11 @@
 $(__GNUC)CCNEEDED	= -L$(GCCLIBDIR) -lstdc++ -lgcc_s
 $(__GNUC)CCEXTNEEDED	= $(CCNEEDED)
 
+CCNEEDED64		= -lCrun
+CCEXTNEEDED64		= -lCrun -lCstd
+$(__GNUC64)CCNEEDED64	= -L$(GCCLIBDIR) -lstdc++ -lgcc_s
+$(__GNUC64)CCEXTNEEDED	= $(CCNEEDED64)
+
 LINK.c=		$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
 LINK64.c=	$(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
 NORUNPATH=	-norunpath -nolib
@@ -718,7 +725,7 @@
 LINK.cc=	$(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
 		$(LDFLAGS) $(CCNEEDED)
 LINK64.cc=	$(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
-		$(LDFLAGS) $(CCNEEDED)
+		$(LDFLAGS) $(CCNEEDED64)
 
 #
 # lint macros
@@ -761,6 +768,7 @@
 #
 # For now at least, we cross-compile amd64 on i386 machines.
 NATIVE_MACH=	$(MACH:amd64=i386)
+NATIVE_MACH64=	$(MACH64)
 
 # Define native compilation macros
 #
@@ -826,6 +834,13 @@
 NATIVELD=		$($(NATIVE_MACH)_LD)
 NATIVELINT=		$($(NATIVE_MACH)_LINT)
 
+NATIVECC64=		$($(NATIVE_MACH64)_CC)
+NATIVECCC64=		$($(NATIVE_MACH64)_CCC)
+NATIVECPP64=		$($(NATIVE_MACH64)_CPP)
+NATIVEAS64=		$($(NATIVE_MACH64)_AS)
+NATIVELD64=		$($(NATIVE_MACH64)_LD)
+NATIVELINT64=		$($(NATIVE_MACH64)_LINT)
+
 #
 # Makefile.master.64 overrides these settings
 #
@@ -836,6 +851,13 @@
 LD=			$(NATIVELD)
 LINT=			$(NATIVELINT)
 
+CC64=			$(NATIVECC64)
+CCC64=			$(NATIVECCC64)
+CPP64=			$(NATIVECPP64)
+AS64=			$(NATIVEAS64)
+LD64=			$(NATIVELD64)
+LINT64=			$(NATIVELINT64)
+
 # The real compilers used for this build
 CW_CC_CMD=		$(CC) -_compiler
 CW_CCC_CMD=		$(CCC) -_compiler
--- old/usr/src/Makefile.master.64	Tue Dec 13 00:13:14 2016
+++ new/usr/src/Makefile.master.64	Tue Dec 13 00:13:14 2016
@@ -22,6 +22,7 @@
 # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
 # Copyright (c) 2014 Joyent, Inc.  All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 # rebind basic build macros to 64-bit versions
@@ -57,18 +58,18 @@
 #
 # Override Makefile.master's settings of CC, CCC, AS and LINT
 #
-CC=		$($(MACH64)_CC)
-CCC=		$($(MACH64)_CCC)
-CPP=		$($(MACH64)_CPP)
-AS=		$($(MACH64)_AS)
-LD=		$($(MACH64)_LD)
-LINT=		$($(MACH64)_LINT)
+CC=		$(CC64)
+CCC=		$(CCC64)
+CPP=		$(CPP64)
+AS=		$(AS64)
+LD=		$(LD64)
+LINT=		$(LINT64)
 
 REAL_CC=	$(CW_CC_CMD:sh)
 REAL_CCC=	$(CW_CCC_CMD:sh)
 
-BUILD.SO=	$(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
-		$(PICS) $(EXTPICS) $(USDT_PICS) -L $(ROOTLIBDIR64) $(LDLIBS)
+BUILD.SO=	$(BUILD.SO)
+BUILDCCC.SO=	$(BUILDCCC.SO)
 
 #
 # ld(1) requires the -64 option to create a 64-bit filter solely from a mapfile
@@ -75,10 +76,4 @@
 #
 MAPFILECLASS=	-64
 
-CCNEEDED =		-lCrun
-$(__GNUC64)CCNEEDED =	-L$(GCCLIBDIR) -lstdc++
-$(__GNUC64)CCNEEDED +=	-lgcc_s
-
-BUILDCCC.SO=    $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
-		$(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED)
 MAPFILE.NGB =	$(MAPFILE.NGB_$(MACH64))
--- old/usr/src/cmd/perl/Makefile.perl	Tue Dec 13 00:13:15 2016
+++ new/usr/src/cmd/perl/Makefile.perl	Tue Dec 13 00:13:15 2016
@@ -9,20 +9,20 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
-# Copyright 2014, OmniTI Computer Consulting, Inc. All right reserved.
+# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 include $(SRC)/lib/Makefile.lib
 
 # PERL_VERSION and PERL_ARCH used to be set here,
-# but as it is also needed in usr/src/pkg/Makefile, 
+# but as they were also needed in usr/src/pkg/Makefile,
 # the definition was moved to usr/src/Makefile.master
 
 PERLDIR = $(ADJUNCT_PROTO)/usr/perl5/$(PERL_VERSION)
 PERLLIBDIR = $(PERLDIR)/lib/$(PERL_ARCH)
-PERLLIBDIR64 = $(PERLDIR)/lib/$(PERL_ARCH64)
 PERLINCDIR = $(PERLLIBDIR)/CORE
+PERLLIBDIR64 = $(PERLDIR)/lib/$(PERL_ARCH64)
 PERLINCDIR64 = $(PERLLIBDIR64)/CORE
 
 PERLMOD = $(MODULE).pm
@@ -49,3 +49,5 @@
 	-typemap $(PERLDIR)/lib/ExtUtils/typemap
 
 C99MODE = $(C99_ENABLE)
+
+64BIT_PERL = $(ENABLE_64BIT_PERL)
--- old/usr/src/cmd/perl/Makefile.targ	Tue Dec 13 00:13:15 2016
+++ new/usr/src/cmd/perl/Makefile.targ	Tue Dec 13 00:13:15 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 # Link against libc as perl solaris specs
@@ -29,18 +29,12 @@
 # CFLAGS for perl, specifically.
 PCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
 	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
-PCFLAGS64= -m64 -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE64_SOURCE \
+PCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE64_SOURCE \
 	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
 
 $(MACH) $(MACH64):
 	$(INS.dir)
 
-# Sorry about this...
-# BUILD.SO doesn't have distinct versions like COMPILE.c/COMPILE64.c does.
-# To that end - we're defining BUILD64.SO here.
-BUILD64.SO=       $(CC) $(CFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
-                $(PICS) $(EXTPICS) -L $(ROOTLIBDIR64) $(LDLIBS)
-
 $(PERLEXT): $(MACH)/$(MODULE).o
 	$(BUILD.SO) $(MACH)/$(MODULE).o
 
@@ -58,7 +52,7 @@
 $(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs 
 	$(XSUBPP) $(XSUBPPFLAGS) $(MODULE).xs >$@
 
-$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs 
+$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs
 	$(XSUBPP64) $(XSUBPPFLAGS) $(MODULE).xs >$@
 
 $(ROOTPERLMODDIR) $(ROOTPERLMODDIR64):
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile	Tue Dec 13 00:13:15 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile	Tue Dec 13 00:13:15 2016
@@ -29,4 +29,4 @@
 install: $(ROOTPERLMOD)
 
 clean clobber:
-	$(RM) -r $(MACH) $(MACH64)
+	$(RM) -r $(MACH)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile	Tue Dec 13 00:13:15 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile	Tue Dec 13 00:13:15 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Intrs
@@ -25,9 +25,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD) $(PERLEXT64)
+all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD) $(ROOTPERLEXT64) $(ROOTPERLMOD64)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
 	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile	Tue Dec 13 00:13:15 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile	Tue Dec 13 00:13:15 2016
@@ -10,8 +10,8 @@
 #
 # Copyright 2014 Gary Mills
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Kstat
@@ -34,9 +34,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD) $(PERLEXT64)
+all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD) $(ROOTPERLEXT64) $(ROOTPERLMOD64)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
 	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile	Tue Dec 13 00:13:16 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile	Tue Dec 13 00:13:16 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2014, OmniTI Computer Consulting. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Lgrp
@@ -29,9 +29,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD) $(PERLEXT64)
+all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD) $(ROOTPERLEXT64) $(ROOTPERLMOD64)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
 	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile	Tue Dec 13 00:13:16 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile	Tue Dec 13 00:13:16 2016
@@ -29,4 +29,4 @@
 install: $(ROOTPERLMOD)
 
 clean clobber:
-	$(RM) -r $(MACH) $(MACH64)
+	$(RM) -r $(MACH)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile	Tue Dec 13 00:13:16 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile	Tue Dec 13 00:13:16 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Project
@@ -29,9 +29,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD) $(PERLEXT64)
+all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD) $(ROOTPERLEXT64) $(ROOTPERLMOD64)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
 	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile	Tue Dec 13 00:13:16 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile	Tue Dec 13 00:13:16 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Task
@@ -25,9 +25,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD) $(PERLEXT64)
+all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD) $(ROOTPERLEXT64) $(ROOTPERLMOD64)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
 	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile	Tue Dec 13 00:13:16 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile	Tue Dec 13 00:13:16 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Utils
@@ -25,9 +25,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD) $(PERLEXT64)
+all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD) $(ROOTPERLEXT64) $(ROOTPERLMOD64)
+install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
 	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/lib/Makefile.lib	Tue Dec 13 00:13:16 2016
+++ new/usr/src/lib/Makefile.lib	Tue Dec 13 00:13:16 2016
@@ -22,6 +22,7 @@
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2014, Joyent, Inc.
+# Copyright 2016 RackTop Systems.
 #
 #
 # Definitions common to libraries.
@@ -176,8 +177,12 @@
 BUILD.AR=	$(AR) $(ARFLAGS) $@ $(AROBJS)
 BUILD.SO=	$(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 		$(PICS) $(EXTPICS) $(USDT_PICS) $(LDLIBS)
+BUILD64.SO=	$(CC64) $(CFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
+		$(PICS) $(EXTPICS) $(USDT_PICS) -L $(ROOTLIBDIR64) $(LDLIBS)
 BUILDCCC.SO=	$(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 		$(PICS) $(EXTPICS) $(LDLIBS)
+BUILDCCC64.SO=	$(CCC64) $(CCFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
+		$(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED64)
 
 # default dynamic library symlink
 INS.liblink=	-$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
--- old/usr/src/pkg/Makefile	Tue Dec 13 00:13:16 2016
+++ new/usr/src/pkg/Makefile	Tue Dec 13 00:13:16 2016
@@ -23,6 +23,7 @@
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
+# Copyright 2016 RackTop Systems.
 #
 
 include $(SRC)/Makefile.master
@@ -182,6 +183,7 @@
 	PERL_ARCH64=$(PERL_ARCH64) \
 	PERL_VERSION=$(PERL_VERSION) \
 	PERL_PKGVERS=$(PERL_PKGVERS) \
+	64BIT_PERL=$(ENABLE_64BIT_PERL) \
 	PYTHON_VERSION=$(PYTHON_VERSION) \
 	PYTHON_PKGVERS=$(PYTHON_PKGVERS)
 
--- old/usr/src/pkg/manifests/SUNWcs.mf	Tue Dec 13 00:13:17 2016
+++ new/usr/src/pkg/manifests/SUNWcs.mf	Tue Dec 13 00:13:17 2016
@@ -1839,11 +1839,11 @@
 #
 # intrd and others use the illumos-defaulted perl interpreter
 #
-depend fmri=runtime/perl type=require
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
 #
 # intrd uses sun-solaris Perl modules
 #
-depend fmri=runtime/perl/module/sun-solaris type=require
+depend fmri=runtime/perl$(PERL_PKGVERS)/module/sun-solaris type=require
 #
 # The boot loader package
 #
--- old/usr/src/pkg/manifests/developer-appcert.mf	Tue Dec 13 00:13:17 2016
+++ new/usr/src/pkg/manifests/developer-appcert.mf	Tue Dec 13 00:13:17 2016
@@ -54,4 +54,4 @@
     name="ABI Application Certification Tools"
 license cr_Sun license=cr_Sun
 license lic_CDDL license=lic_CDDL
-depend fmri=runtime/perl type=require
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
--- old/usr/src/pkg/manifests/developer-object-file.mf	Tue Dec 13 00:13:17 2016
+++ new/usr/src/pkg/manifests/developer-object-file.mf	Tue Dec 13 00:13:17 2016
@@ -160,4 +160,4 @@
 link path=usr/lib/elfedit/32 target=.
 link path=usr/lib/elfedit/64 target=$(ARCH64)
 depend fmri=developer/macro/cpp type=require
-depend fmri=runtime/perl type=require
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
--- old/usr/src/pkg/manifests/developer-opensolaris-osnet.mf	Tue Dec 13 00:13:17 2016
+++ new/usr/src/pkg/manifests/developer-opensolaris-osnet.mf	Tue Dec 13 00:13:17 2016
@@ -21,6 +21,7 @@
 
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 OmniTI Computer Consulting, Inc.  All rights reserved.
+# Copyright 2016 RackTop Systems.
 
 set name=pkg.fmri value=pkg:/developer/opensolaris/osnet@$(PKGVERS)
 set name=pkg.description \
@@ -48,8 +49,10 @@
 depend fmri=library/security/trousers@0.3.2-0.133 type=require
 depend fmri=print/cups@1.4.2-0.133 type=require
 depend fmri=print/filter/ghostscript@8.64-0.133 type=require
-depend fmri=runtime/perl/manual@5.10.0-0.133 type=require
-depend fmri=runtime/perl@5.10.0-0.133 type=require
+depend fmri=runtime/perl$(PERL_PKGVERS)/manual@5.10.0-0.133 type=require
+depend fmri=runtime/perl$(PERL_PKGVERS)@5.10.0-0.133 type=require
+$(64BIT_PERL)depend fmri=runtime/perl-64$(PERL_PKGVERS)@5.10.0-0.133 \
+    type=require
 depend fmri=system/header@0.5.11-0.133 type=require
 depend fmri=system/library/dbus@0.5.11-0.133 type=require
 depend fmri=system/library/install@0.5.11-0.133 type=require
--- old/usr/src/pkg/manifests/print-lp-print-client-commands.mf	Tue Dec 13 00:13:17 2016
+++ new/usr/src/pkg/manifests/print-lp-print-client-commands.mf	Tue Dec 13 00:13:17 2016
@@ -81,4 +81,4 @@
 link path=usr/sbin/reject target=./print-service
 link path=usr/share/man/man1/disable.1 target=enable.1
 link path=usr/share/man/man1m/reject.1m target=accept.1m
-depend fmri=runtime/perl type=require
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
--- old/usr/src/pkg/manifests/runtime-perl-module-sun-solaris.mf	Tue Dec 13 00:13:18 2016
+++ new/usr/src/pkg/manifests/runtime-perl-module-sun-solaris.mf	Tue Dec 13 00:13:18 2016
@@ -21,13 +21,14 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
-<transform file path=.*\.(pm|bs) -> default mode 0444>
+<transform file path=.*\.pm -> default mode 0444>
 <transform file path=.*\.so -> default mode 0555>
 set name=pkg.fmri \
-    value=pkg:/runtime/perl/module/sun-solaris@0.5.11,$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
+    value=pkg:/runtime/perl$(PERL_PKGVERS)/module/sun-solaris@0.5.11,$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
 set name=pkg.summary value="Perl $(PERL_VERSION) Sun::Solaris Modules"
 set name=info.classification \
     value=org.opensolaris.category.2008:Development/Perl
@@ -48,18 +49,25 @@
 dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Project
 dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Task
 dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Utils
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Intrs
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Kstat
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Lgrp
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Project
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Task
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Utils
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Intrs
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Kstat
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Lgrp
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Project
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Task
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Utils
 dir path=usr/perl5/$(PERL_VERSION)/lib/Sun
 dir path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris
 dir path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris/BSM
@@ -83,23 +91,29 @@
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Task/Task.so
 file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Utils/Utils.so
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Intrs.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Kstat.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Lgrp.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Project.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Task.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Utils.pm
-file \
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Intrs.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Kstat.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Lgrp.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Project.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Task.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Utils.pm
+$(64BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Intrs/Intrs.so
-file \
+$(64BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Kstat/Kstat.so
-file \
+$(64BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Lgrp/Lgrp.so
-file \
+$(64BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Project/Project.so
-file \
+$(64BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Task/Task.so
-file \
+$(64BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Utils/Utils.so
 file path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris/BSM/_BSMparse.pm
 file path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris/Pg.pm
@@ -110,5 +124,6 @@
 license cr_Sun license=cr_Sun
 license usr/src/cmd/perl/THIRDPARTYLICENSE \
     license=usr/src/cmd/perl/THIRDPARTYLICENSE
-depend fmri=runtime/perl type=require
-depend fmri=runtime/perl/manual type=require
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
+depend fmri=runtime/perl$(PERL_PKGVERS)/manual type=require
+$(64BIT_PERL)depend fmri=runtime/perl-64$(PERL_PKGVERS) type=require
--- old/usr/src/pkg/manifests/service-network-smtp-sendmail.mf	Tue Dec 13 00:13:18 2016
+++ new/usr/src/pkg/manifests/service-network-smtp-sendmail.mf	Tue Dec 13 00:13:18 2016
@@ -242,4 +242,4 @@
 link path=usr/share/man/man4/forward.4 target=aliases.4
 link path=usr/share/man/man4/sendmail.cf.4 target=sendmail.4
 link path=usr/share/man/man4/submit.cf.4 target=sendmail.4
-depend fmri=runtime/perl type=require
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
--- old/usr/src/pkg/manifests/system-extended-system-utilities.mf	Tue Dec 13 00:13:18 2016
+++ new/usr/src/pkg/manifests/system-extended-system-utilities.mf	Tue Dec 13 00:13:18 2016
@@ -22,6 +22,7 @@
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 set name=pkg.fmri value=pkg:/system/extended-system-utilities@$(PKGVERS)
@@ -280,4 +281,5 @@
 link path=usr/share/man/man1/unexpand.1 target=expand.1
 link path=usr/share/man/man1/unpack.1 target=pack.1
 link path=usr/share/man/man1/zcat.1 target=compress.1
-depend fmri=runtime/perl type=require
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
+depend fmri=runtime/perl$(PERL_PKGVERS)/module/sun-solaris type=require
--- old/usr/src/tools/env/illumos.sh	Tue Dec 13 00:13:18 2016
+++ new/usr/src/tools/env/illumos.sh	Tue Dec 13 00:13:18 2016
@@ -22,6 +22,7 @@
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 # Configuration variables for the runtime environment of the nightly
@@ -222,9 +223,13 @@
 # don't want to bother providing the CUPS headers this needs.
 #export ENABLE_SMB_PRINTING=
 
+# Comment this out to disable building of 64bit perl modules.
+# Don't disable this unless instructed to do so by your distributor.
+export ENABLE_64BIT_PERL=
+
 # If your distro uses certain versions of Perl, make sure either Makefile.master
 # contains your new defaults OR your .env file sets them.
 # These are how you would override for building on OmniOS r151012, for example.
 #export PERL_VERSION=5.16.1
-#export PERL_ARCH=i86pc-solaris-thread-multi-64int
+#export PERL_VARIANT=-thread-multi
 #export PERL_PKGVERS=-5161
--- old/usr/src/tools/env/omnios-illumos-gate.sh	Tue Dec 13 00:13:18 2016
+++ new/usr/src/tools/env/omnios-illumos-gate.sh	Tue Dec 13 00:13:18 2016
@@ -22,6 +22,7 @@
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
 # Copyright 2016, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 # Configuration variables for the runtime environment of the nightly
@@ -246,11 +247,15 @@
 # don't want to bother providing the CUPS headers this needs.
 #export ENABLE_SMB_PRINTING=
 
+# Comment this out to disable building of 64bit perl modules.
+# Don't disable this unless instructed to do so by your distributor.
+export ENABLE_64BIT_PERL=
+
 # If your distro uses certain versions of Perl, make sure either
 # Makefile.master contains your new defaults OR your .env file sets them.
 # Stock illumos-gate does not have these set already.
 export PERL_VERSION=5.16.1
-export PERL_ARCH=i86pc-solaris-thread-multi-64int
+export PERL_VARIANT=-thread-multi
 export PERL_PKGVERS=
 
 # To build IPS packages for the version you wish to update, ONNV_BUILDNUM must
--- old/usr/src/tools/env/omnios-illumos-omnios.sh	Tue Dec 13 00:13:18 2016
+++ new/usr/src/tools/env/omnios-illumos-omnios.sh	Tue Dec 13 00:13:18 2016
@@ -22,6 +22,7 @@
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
 # Copyright 2016, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 # Configuration variables for the runtime environment of the nightly
@@ -241,11 +242,15 @@
 # don't want to bother providing the CUPS headers this needs.
 #export ENABLE_SMB_PRINTING=
 
+# Comment this out to disable building of 64bit perl modules.
+# Don't disable this unless instructed to do so by your distributor.
+export ENABLE_64BIT_PERL=
+
 # If your distro uses certain versions of Perl, make sure either
 # Makefile.master contains your new defaults OR your .env file sets them.
 # The OmniOS illumos version has these set already.
 #export PERL_VERSION=5.16.1
-#export PERL_ARCH=i86pc-solaris-thread-multi-64int
+#export PERL_VARIANT=-thread-multi
 #export PERL_PKGVERS=
 
 # To build IPS packages for the version you wish to update, ONNV_BUILDNUM must
