Sync with 5.4.0
[deliverable/titan.core.git] / etc / solaris / build.sh
1 ###############################################################################
2 # Copyright (c) 2000-2015 Ericsson Telecom AB
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Eclipse Public License v1.0
5 # which accompanies this distribution, and is available at
6 # http://www.eclipse.org/legal/epl-v10.html
7 ###############################################################################
8 #!/bin/sh
9
10 set -ex
11
12 [ "`uname -sr`" = "SunOS 5.10" ] || {
13 echo 'unsupported OS'
14 exit 1
15 }
16
17 P=/mnt/TTCN/Tools
18 LC_ALL=C
19 export LC_ALL
20
21 # version of packages in src/
22 V_zlib=zlib-1.2.8
23 V_tar=tar-1.26
24 V_make=make-3.82
25 V_m4=m4-1.4.16
26 V_gmp=gmp-5.1.1
27 V_mpc=mpc-1.0.1
28 V_mpfr=mpfr-3.1.2
29 V_gcc=gcc-4.7.3
30 V_binutils=binutils-2.23.2
31 V_bison=bison-2.7
32 V_flex=flex-2.5.37
33 V_libiconv=libiconv-1.14
34 V_libxml2=libxml2-2.7.8
35 V_openssl=openssl-0.9.8y
36 V_tcl=tcl8.6.0
37 V_expect=expect5.45
38
39 buildcommon() {
40 V=$1
41 C=$2
42 shift
43 shift
44 if [ -f src/$V.tar.gz ]
45 then
46 gunzip -c src/$V.tar.gz | tar -xf -
47 else
48 bunzip2 -c src/$V.tar.bz2 | tar -xf -
49 fi
50 cd $V
51 ./$C --prefix=$P/$V "$@"
52 { make || kill $$; } |tee make.log
53 { make install || kill $$; } |tee make.install.log
54 cd ..
55 rm -rf $V
56 }
57
58 build() {
59 V=$1
60 shift
61 buildcommon $V configure "$@"
62 }
63
64 buildtcl() {
65 buildcommon $V_tcl unix/configure "$@"
66 }
67
68 buildopenssl() {
69 buildcommon $V_openssl Configure shared --openssldir=$P/$V_openssl solaris-x86-gcc
70 chmod u+w $P/$V_openssl/lib/lib*.so.0.9.*
71 }
72
73 # uncomment/comment the build commands of the packages
74 # should be original gcc and binutils paths
75 GCC0=$P/$V_gcc
76 BINUTILS0=$P/$V_binutils
77 PATH=$BINUTILS0/bin:$GCC0/bin:/usr/bin
78 LD_LIBRARY_PATH=$BINUTILS0/lib:$GCC0/lib:/lib:/usr/lib
79 export PATH LD_LIBRARY_PATH
80
81 #build $V_zlib
82 LD_LIBRARY_PATH=$P/$V_zlib/lib:$LD_LIBRARY_PATH
83 export LD_LIBRARY_PATH
84
85 build $V_binutils
86 PATH=$P/$V_binutils/bin:$PATH
87 LD_LIBRARY_PATH=$P/$V_binutils/lib:$LD_LIBRARY_PATH
88 export PATH LD_LIBRARY_PATH
89
90 #build $V_libiconv
91 LD_LIBRARY_PATH=$P/$V_libiconv/lib:$LD_LIBRARY_PATH
92 export LD_LIBRARY_PATH
93
94 # solaris tar had some issues with the gcc and openssl tar.gz
95 #build $V_tar --with-libiconv-prefix=$P/$V_libiconv --with-gnu-ld
96 PATH=$P/$V_tar/bin:$PATH
97 export PATH
98
99 #build $V_make
100 PATH=$P/$V_make/bin:$PATH
101 export PATH
102
103 #build $V_m4
104 PATH=$P/$V_m4/bin:$PATH
105 export PATH
106
107 #build $V_gmp
108 LD_LIBRARY_PATH=$P/$V_gmp/lib:$LD_LIBRARY_PATH
109 export LD_LIBRARY_PATH
110
111 #build $V_mpfr --with-gmp=$P/$V_gmp
112 LD_LIBRARY_PATH=$P/$V_mpfr/lib:$LD_LIBRARY_PATH
113 export LD_LIBRARY_PATH
114
115 #build $V_mpc --with-gmp=$P/$V_gmp --with-mpfr=$P/$V_mpfr
116 LD_LIBRARY_PATH=$P/$V_mpc/lib:$LD_LIBRARY_PATH
117 export LD_LIBRARY_PATH
118
119 build $V_gcc --enable-languages=c,c++ \
120 --disable-multilib \
121 --with-gmp=$P/$V_gmp \
122 --with-mpfr=$P/$V_mpfr \
123 --with-mpc=$P/$V_mpc \
124 --with-gnu-as --with-as=$P/$V_binutils/bin/as \
125 --with-gnu-ld --with-ld=$P/$V_binutils/bin/ld
126 PATH=$P/$V_gcc/bin:$PATH
127 LD_LIBRARY_PATH=$P/$V_gcc/lib:$LD_LIBRARY_PATH
128 export PATH LD_LIBRARY_PATH
129
130 #buildopenssl
131 PATH=$P/$V_openssl/bin:$PATH
132 LD_LIBRARY_PATH=$P/$V_openssl/lib:$LD_LIBRARY_PATH
133 export PATH LD_LIBRARY_PATH
134
135 #build bison
136 #build flex
137 #buildtcl
138 #buildexpect --exec-prefix=$P
139 #build libxml2
140 #build wget --with-ssl=openssl
141
142 echo $PATH
143 echo $LD_LIBRARY_PATH
This page took 0.082014 seconds and 5 git commands to generate.