7166472 expect does not work with tclsh
authorRich Burridge <rich.burridge@oracle.com>
Tue, 29 May 2012 10:27:59 -0700
changeset 835 b6a2cd5fcda6
parent 834 5a6d4a4727f6
child 836 7a4ce94a1632
7166472 expect does not work with tclsh
components/tcl/expect/Makefile
components/tcl/expect/expect.p5m
components/tcl/tcl/patches/4.init.tcl.patch
--- a/components/tcl/expect/Makefile	Fri May 25 17:10:36 2012 -0700
+++ b/components/tcl/expect/Makefile	Tue May 29 10:27:59 2012 -0700
@@ -49,18 +49,20 @@
 	(cd $(@D); $(GMAKE) all ${SCRIPTS};)
 
 CONFIGURE_OPTIONS 	+= CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS 	+= --with-tcl="$(COMPONENT_DIR)/../tcl/build/$(MACH32)"
-CONFIGURE_OPTIONS 	+= --with-tclinclude="$(COMPONENT_DIR)/../tcl/build/$(MACH32)/generic"
 CONFIGURE_OPTIONS 	+= --enable-shared
+CONFIGURE_OPTIONS 	+= --with-tcl="$(COMPONENT_DIR)/../tcl/build/$(MACH$(BITS))"
+CONFIGURE_OPTIONS 	+= --with-tclinclude="$(COMPONENT_DIR)/../tcl/build/$(MACH$(BITS))/generic"
+
+CONFIGURE_OPTIONS.64	+= LDFLAGS="$(LDFLAGS) -m64"
 
 COMPONENT_TEST_TARGETS = test
 
 # common targets
-build:		$(BUILD_32)
+build:		$(BUILD_32_and_64)
 
-install:	$(INSTALL_32) 
+install:	$(INSTALL_32_and_64) 
 	
-test: 		$(TEST_32)
+test: 		$(TEST_32_and_64)
 
 # special targets due to tcl internals dependencies
 ../tcl/build/%/.built:
@@ -68,6 +70,8 @@
 
 $(BUILD_32):    ../tcl/build/$(MACH32)/.built
 
+$(BUILD_64):    ../tcl/build/$(MACH64)/.built
+
 BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
 
 include ../../../make-rules/depend.mk
--- a/components/tcl/expect/expect.p5m	Fri May 25 17:10:36 2012 -0700
+++ b/components/tcl/expect/expect.p5m	Tue May 29 10:27:59 2012 -0700
@@ -18,9 +18,12 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
+<transform file path=usr/demo/expect/.+ ->default mode 0555>
+<transform file path=usr/demo/expect/man/.+ -> set mode 0444>
+
 set name=pkg.fmri \
     value=pkg:/shell/expect@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
 set name=pkg.description \
@@ -36,18 +39,23 @@
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
 dir path=usr
 dir path=usr/bin
+dir path=usr/bin/$(MACH32)
+dir path=usr/bin/$(MACH64)
 dir path=usr/demo
 dir path=usr/demo/expect
 dir path=usr/demo/expect/man
 dir path=usr/demo/expect/man/man1
 dir path=usr/include
 dir path=usr/lib
+dir path=usr/lib/$(MACH64)
+dir path=usr/lib/$(MACH64)/expect$(COMPONENT_VERSION)
 dir path=usr/lib/expect$(COMPONENT_VERSION)
 dir path=usr/share
 dir path=usr/share/man
 dir path=usr/share/man/man1
 dir path=usr/share/man/man3
-file path=usr/bin/expect
+file path=usr/bin/$(MACH64)/expect
+file usr/bin/expect path=usr/bin/$(MACH32)/expect
 file path=usr/demo/expect/autoexpect
 file path=usr/demo/expect/autopasswd
 file path=usr/demo/expect/cryptdir
@@ -84,9 +92,11 @@
 file path=usr/include/expect_comm.h
 file path=usr/include/expect_tcl.h
 file path=usr/include/tcldbg.h
+file path=usr/lib/$(MACH64)/expect$(COMPONENT_VERSION)/libexpect$(COMPONENT_VERSION).so
+file path=usr/lib/$(MACH64)/expect$(COMPONENT_VERSION)/pkgIndex.tcl
 file path=usr/lib/expect$(COMPONENT_VERSION)/libexpect$(COMPONENT_VERSION).so
 file path=usr/lib/expect$(COMPONENT_VERSION)/pkgIndex.tcl
 file path=usr/share/man/man1/expect.1
 file path=usr/share/man/man3/libexpect.3
+link path=usr/bin/expect target=$(MACH64)/expect
 license expect.license license="BSD-like, GPLv2"
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/tcl/tcl/patches/4.init.tcl.patch	Tue May 29 10:27:59 2012 -0700
@@ -0,0 +1,20 @@
+--- tcl8.5.9/library/init.tcl.orig	2012-05-17 05:28:16.038636462 -0700
++++ tcl8.5.9/library/init.tcl	2012-05-17 05:29:58.370740558 -0700
+@@ -43,7 +43,16 @@
+     if {[info exists env(TCLLIBPATH)]} {
+ 	set auto_path $env(TCLLIBPATH)
+     } else {
+-	set auto_path ""
++        # Add in $MACH64 library directory (if needed).
++        if {$tcl_platform(wordSize) == 8} {
++            if {$tcl_platform(machine) eq "i86pc"} {
++                set auto_path "/usr/lib/amd64"
++            } else {
++                set auto_path "/usr/lib/sparcv9"
++            }
++        } else {
++            set auto_path ""
++        }
+     }
+ }
+ namespace eval tcl {