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=5.1.0
32 VERHUMAN=$VER
33 PKG=system/library/g++-5-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="gcc51 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 if [ -f /usr/lib/libstdc++.so.6.0.18 ]; then
56 GCC48_LOC=/usr/lib
57 else
58 GCC48_LOC=/opt/gcc-4.8.1/lib
59 BUILD_DEPENDS_IPS="$BUILD_DEPENDS_IPS gcc48"
60 fi
61
62 DEPENDS_IPS="system/library/gcc-5-runtime"
63 NO_PARALLEL_MAKE=1
64
65 # This stuff is in its own domain
66 PKGPREFIX=""
67
68 PREFIX=/opt/gcc-${VER}
69
70 init
71 prep_build
72 mkdir -p $TMPDIR/$BUILDDIR
73 for license in COPYING.RUNTIME COPYING.LIB COPYING3.LIB
74 do
75 logcmd cp $SRCDIR/files/$license $TMPDIR/$BUILDDIR/$license || \
76 logerr "Cannot copy licnese: $license"
77 done
78
79 mkdir -p $DESTDIR/usr/lib
80 mkdir -p $DESTDIR/usr/lib/amd64
81
82 LIB=libstdc++.so
83 cp /opt/gcc-4.4.4/lib/$LIB.6.0.13 $DESTDIR/usr/lib/$LIB.6.0.13
84 cp ${GCC46_LOC}/$LIB.6.0.16 $DESTDIR/usr/lib/$LIB.6.0.16
85 cp ${GCC47_LOC}/$LIB.6.0.17 $DESTDIR/usr/lib/$LIB.6.0.17
86 cp ${GCC48_LOC}/$LIB.6.0.18 $DESTDIR/usr/lib/$LIB.6.0.18
87 cp /opt/gcc-${VER}/lib/$LIB.6.0.21 $DESTDIR/usr/lib/$LIB.6.0.21 || logerr "Failed to copy 6.0.21"
88 ln -s /usr/lib/$LIB.6.0.21 $DESTDIR/usr/lib/$LIB.6
89 ln -s /usr/lib/$LIB.6.0.21 $DESTDIR/usr/lib/$LIB
90 cp /opt/gcc-4.4.4/lib/amd64/$LIB.6.0.13 $DESTDIR/usr/lib/amd64/$LIB.6.0.13
91 cp ${GCC46_LOC}/amd64/$LIB.6.0.16 $DESTDIR/usr/lib/amd64/$LIB.6.0.16
92 cp ${GCC47_LOC}/amd64/$LIB.6.0.17 $DESTDIR/usr/lib/amd64/$LIB.6.0.17
93 cp ${GCC48_LOC}/amd64/$LIB.6.0.18 $DESTDIR/usr/lib/amd64/$LIB.6.0.18
94 cp /opt/gcc-${VER}/lib/amd64/$LIB.6.0.21 $DESTDIR/usr/lib/amd64/$LIB.6.0.21 || logerr "Failed to copy 6.0.21 (amd64)"
95 ln -s /usr/lib/amd64/$LIB.6.0.21 $DESTDIR/usr/lib/amd64/$LIB.6
96 ln -s /usr/lib/amd64/$LIB.6.0.21 $DESTDIR/usr/lib/amd64/$LIB
97
98 LIB=libssp.so
99 cp /opt/gcc-${VER}/lib/$LIB.0.0.0 $DESTDIR/usr/lib/$LIB.0.0.0
100 ln -s /usr/lib/$LIB.0.0.0 $DESTDIR/usr/lib/$LIB.0
101 ln -s /usr/lib/$LIB.0.0.0 $DESTDIR/usr/lib/$LIB
102 cp /opt/gcc-${VER}/lib/amd64/$LIB.0.0.0 $DESTDIR/usr/lib/amd64/$LIB.0.0.0
103 ln -s /usr/lib/amd64/$LIB.0.0.0 $DESTDIR/usr/lib/amd64/$LIB.0
104 ln -s /usr/lib/amd64/$LIB.0.0.0 $DESTDIR/usr/lib/amd64/$LIB
105
106 make_package runtime.mog
107 clean_up