5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 # ident "%Z%%M% %I% %E% SMI"
29 # Generate a proto area suitable for the current architecture ($(MACH))
30 # sufficient to support the sgs build.
32 # Currently, the following releases are supported:
33 # 5.11, 5.10, and 5.9.
36 if [ "X$SRCTOP" = "X" -o "X$MACH" = "X" ] ; then
37 echo "usage: SRCTOP and MACH environment variables must be set"
43 if [ "X$RELEASE" = "X" ] ; then
44 echo "usage: proto release"
53 "5.9") IS_THIS_UNIFIED
=0; break;;
55 echo "usage: unsupported release $RELEASE specified"
59 dirs=" $SRCTOP/proto \
60 $SRCTOP/proto/root_$MACH \
61 $SRCTOP/proto/root_$MACH/lib \
62 $SRCTOP/proto/root_$MACH/usr \
63 $SRCTOP/proto/root_$MACH/usr/lib \
64 $SRCTOP/proto/root_$MACH/usr/lib/abi \
65 $SRCTOP/proto/root_$MACH/usr/lib/link_audit \
66 $SRCTOP/proto/root_$MACH/usr/lib/mdb \
67 $SRCTOP/proto/root_$MACH/usr/lib/mdb/proc \
68 $SRCTOP/proto/root_$MACH/usr/lib/pics \
69 $SRCTOP/proto/root_$MACH/usr/4lib \
70 $SRCTOP/proto/root_$MACH/usr/bin \
71 $SRCTOP/proto/root_$MACH/usr/ccs \
72 $SRCTOP/proto/root_$MACH/usr/ccs/bin \
73 $SRCTOP/proto/root_$MACH/usr/include \
74 $SRCTOP/proto/root_$MACH/usr/include/sys \
75 $SRCTOP/proto/root_$MACH/etc \
76 $SRCTOP/proto/root_$MACH/etc/lib \
77 $SRCTOP/proto/root_$MACH/opt \
78 $SRCTOP/proto/root_$MACH/opt/SUNWonld \
79 $SRCTOP/proto/root_$MACH/opt/SUNWonld/bin \
80 $SRCTOP/proto/root_$MACH/opt/SUNWonld/doc \
81 $SRCTOP/proto/root_$MACH/opt/SUNWonld/lib \
82 $SRCTOP/proto/root_$MACH/opt/SUNWonld/man \
83 $SRCTOP/proto/root_$MACH/opt/SUNWonld/man/man1 \
84 $SRCTOP/proto/root_$MACH/opt/SUNWonld/man/man1l \
85 $SRCTOP/proto/root_$MACH/opt/SUNWonld/man/man3t \
86 $SRCTOP/proto/root_$MACH/opt/SUNWonld/man/man3l \
87 $SRCTOP/proto/root_$MACH/opt/SUNWonld/man/man3x"
90 # Add 64bit directories
93 if [ $MACH = "sparc" ]; then
96 if [ $MACH = "i386" ]; then
99 if [ "${MACH64}x" != x
]; then
102 $SRCTOP/proto/root_$MACH/lib/$MACH64 \
103 $SRCTOP/proto/root_$MACH/usr/bin/$MACH64 \
104 $SRCTOP/proto/root_$MACH/usr/ccs/bin/$MACH64 \
105 $SRCTOP/proto/root_$MACH/usr/lib/$MACH64 \
106 $SRCTOP/proto/root_$MACH/usr/lib/abi/$MACH64 \
107 $SRCTOP/proto/root_$MACH/usr/lib/link_audit/$MACH64 \
108 $SRCTOP/proto/root_$MACH/usr/lib/mdb/proc/$MACH64 \
109 $SRCTOP/proto/root_$MACH/usr/lib/pics/$MACH64 \
110 $SRCTOP/proto/root_$MACH/opt/SUNWonld/bin/$MACH64 \
111 $SRCTOP/proto/root_$MACH/opt/SUNWonld/lib/$MACH64 \
115 for dir
in `echo $dirs`
117 if [ ! -d $dir ] ; then
124 # We need a local copy of libc_pic.a (we should get this from the parent
125 # workspace, but as we can't be sure how the proto area is constructed there
126 # simply take it from a stashed copy on the linkers server. If
127 # LINKERS_EXPORT is defined, we use it. Failing that, we fall over
128 # to linkers.central.
129 if [ "$LINKERS_EXPORT" = "" ]; then
130 LINKERS_EXPORT
=/net
/linkers.central
/export
133 if [ $MACH = "sparc" ]; then
134 PLATS
="sparc sparcv9"
135 elif [ $MACH = "i386" ]; then
138 echo "Unknown Mach: $MACH - no libc_pic.a provided!"
144 SRCLIBCDIR
=${SRC}/lib
/libc
/$p
145 if [ ! -d $SRCLIBCDIR ]; then
148 if [ ! -f $SRCLIBCDIR/libc_pic.a
]; then
149 cp $LINKERS_EXPORT/big
/libc_pic
/$RELEASE/$p/libc_pic.a \
154 SYSLIB
=$SRCTOP/proto
/root_
$MACH/lib
155 USRLIB
=$SRCTOP/proto
/root_
$MACH/usr
/lib
157 if [ ! -h $USRLIB/ld.so
.1 ]; then
158 rm -f $USRLIB/ld.so
.1
159 ln -s ..
/..
/lib
/ld.so
.1 $USRLIB/ld.so
.1
160 echo "$USRLIB/ld.so.1 -> ../../lib/ld.so.1"
164 # In addition create some 64 symlinks so that dependencies referenced
165 # from our test environment will map back to the appropriate libraries.
167 if [ ! -h $SYSLIB/64 ] ; then
169 ln -s $MACH64 $SYSLIB/64
170 echo "$SYSLIB/64 -> $SYSLIB/$MACH64"
172 if [ ! -h $USRLIB/64 ] ; then
174 ln -s $MACH64 $USRLIB/64
175 echo "$USRLIB/64 -> $USRLIB/$MACH64"
177 if [ ! -h $USRLIB/link_audit
/64 ] ; then
178 rm -f $USRLIB/link_audit
/64
179 ln -s $MACH64 $USRLIB/link_audit
/64
180 echo "$USRLIB/link_audit/64 -> $USRLIB/link_audit/$MACH64"
182 if [ ! -h $USRLIB/64/ld.so
.1 ]; then
183 rm -f $USRLIB/64/ld.so
.1
184 ln -s ..
/..
/..
/lib
/64/ld.so
.1 $USRLIB/64/ld.so
.1
185 echo "$USRLIB/64/ld.so.1 -> ../../../lib/64/ld.so.1"
191 if [ $IS_THIS_UNIFIED = 0 ] ; then
192 rm -fr $SRCTOP/proto
/root_
$MACH/lib
193 ln -s $SRCTOP/proto
/root_
$MACH/usr
/lib
$SRCTOP/proto
/root_
$MACH/lib