1 #!/usr/bin/bash
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
8 # with the License.
9 #
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
14 #
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 #
21 # CDDL HEADER END
22 #
23 #
24 # Copyright 2011-2012 OmniTI Computer Consulting, Inc. All rights reserved.
25 # Use is subject to license terms.
26 #
27 # Load support functions
28 . ../../lib/functions.sh
29
30 PROG=libstdc++
31 VER=4.8.1
32 VERHUMAN=$VER
33 PKG=system/library/g++-4-runtime
34 SUMMARY="g++ runtime dependencis libstc++/libssp"
35 DESC="$SUMMARY"
36
37 PATH=/opt/gcc-${VER}/bin:$PATH
38 export LD_LIBRARY_PATH=/opt/gcc-${VER}/lib
39
40 BUILD_DEPENDS_IPS="gcc48 gcc44"
41 if [ -f /usr/lib/libstdc++.so.6.0.16 ]; then
42 GCC46_LOC=/usr/lib
43 else
44 GCC46_LOC=/opt/gcc-4.6.3/lib
45 BUILD_DEPENDS_IPS="$BUILD_DEPENDS_IPS gcc46"
46 fi
47
48 if [ -f /usr/lib/libstdc++.so.6.0.17 ]; then
49 GCC47_LOC=/usr/lib
50 else
51 GCC47_LOC=/opt/gcc-4.7.2/lib
52 BUILD_DEPENDS_IPS="$BUILD_DEPENDS_IPS gcc47"
53 fi
54
55 DEPENDS_IPS="system/library/gcc-4-runtime"
56 NO_PARALLEL_MAKE=1
57
58 # This stuff is in its own domain
59 PKGPREFIX=""
60
61 PREFIX=/opt/gcc-${VER}
62
63 init
64 prep_build
65 mkdir -p $TMPDIR/$BUILDDIR
66 for license in COPYING.RUNTIME COPYING.LIB COPYING3.LIB
67 do
68 logcmd cp $SRCDIR/files/$license $TMPDIR/$BUILDDIR/$license || \
69 logerr "Cannot copy licnese: $license"
70 done
71
72 mkdir -p $DESTDIR/usr/lib
73 mkdir -p $DESTDIR/usr/lib/amd64
74
75 LIB=libstdc++.so
76 cp /opt/gcc-4.4.4/lib/$LIB.6.0.13 $DESTDIR/usr/lib/$LIB.6.0.13
77 cp ${GCC46_LOC}/$LIB.6.0.16 $DESTDIR/usr/lib/$LIB.6.0.16
78 cp ${GCC47_LOC}/$LIB.6.0.17 $DESTDIR/usr/lib/$LIB.6.0.17
79 cp /opt/gcc-${VER}/lib/$LIB.6.0.18 $DESTDIR/usr/lib/$LIB.6.0.18 || logerr "Failed to copy 6.0.18"
80 ln -s /usr/lib/$LIB.6.0.18 $DESTDIR/usr/lib/$LIB.6
81 ln -s /usr/lib/$LIB.6.0.18 $DESTDIR/usr/lib/$LIB
82 cp /opt/gcc-4.4.4/lib/amd64/$LIB.6.0.13 $DESTDIR/usr/lib/amd64/$LIB.6.0.13
83 cp ${GCC46_LOC}/amd64/$LIB.6.0.16 $DESTDIR/usr/lib/amd64/$LIB.6.0.16
84 cp ${GCC47_LOC}/amd64/$LIB.6.0.17 $DESTDIR/usr/lib/amd64/$LIB.6.0.17
85 cp /opt/gcc-${VER}/lib/amd64/$LIB.6.0.18 $DESTDIR/usr/lib/amd64/$LIB.6.0.18 || logerr "Failed to copy 6.0.18 (amd64)"
86 ln -s /usr/lib/amd64/$LIB.6.0.18 $DESTDIR/usr/lib/amd64/$LIB.6
87 ln -s /usr/lib/amd64/$LIB.6.0.18 $DESTDIR/usr/lib/amd64/$LIB
88
89 LIB=libssp.so
90 cp /opt/gcc-${VER}/lib/$LIB.0.0.0 $DESTDIR/usr/lib/$LIB.0.0.0
91 ln -s /usr/lib/$LIB.0.0.0 $DESTDIR/usr/lib/$LIB.0
92 ln -s /usr/lib/$LIB.0.0.0 $DESTDIR/usr/lib/$LIB
93 cp /opt/gcc-${VER}/lib/amd64/$LIB.0.0.0 $DESTDIR/usr/lib/amd64/$LIB.0.0.0
94 ln -s /usr/lib/amd64/$LIB.0.0.0 $DESTDIR/usr/lib/amd64/$LIB.0
95 ln -s /usr/lib/amd64/$LIB.0.0.0 $DESTDIR/usr/lib/amd64/$LIB
96
97 make_package runtime.mog
98 clean_up