Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 212 lines (187 sloc) 6.826 kb
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
1 #!/usr/bin/env bash
2 #
762a356 @joshwilsdon [OS-16] update illumos-live/configure to be more friendly to non-glob…
joshwilsdon authored
3 # Copyright (c) 2010,2011 Joyent Inc.
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
4 #
5
762a356 @joshwilsdon [OS-16] update illumos-live/configure to be more friendly to non-glob…
joshwilsdon authored
6 set -o errexit
7
8 GLOBAL_ZONE=1
9
10 if [[ $(uname -s) != "SunOS" ]]; then
11 echo "FATAL: This only works with SunOS/SmartOS"
12 exit 1
13 fi
14
15 if [[ $(zonename) != "global" ]]; then
16 echo "NOTICE: Building in a zone, workarounds enabled!"
17 GLOBAL_ZONE=0
18 fi
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
19
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
20 INSTALL_BIN_LINK_DIR=/usr/bin
21 HAVE_PKG="true"
22 ROOTCMD=pfexec
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
23
0629235 @joshwilsdon [OS-16] some help for building with different gits.
joshwilsdon authored
24 # illumos-extra is now in github but git's ssl doesn't always work in our build machines.
25 export GIT_SSL_NO_VERIFY=true
26
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
27 # Load all site-specific configure files
3aeb937 @joshwilsdon Fixes for building in zone.
joshwilsdon authored
28 for file in `ls configure.*`; do
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
29 source ${file}
30 done
31
32 if [ "${HAVE_PKG}" == "true" ]; then
33 echo "==> Installing illumos build dependencies..."
762a356 @joshwilsdon [OS-16] update illumos-live/configure to be more friendly to non-glob…
joshwilsdon authored
34 if [[ ${GLOBAL_ZONE} -eq 1 ]]; then
35 ${ROOTCMD} pkg install \
36 text/groff \
37 system/zones/internal \
38 library/libxml2 \
39 developer/gnome/gettext \
40 library/python-2/setuptools-26 \
41 library/gnome/gnome-vfs \
42 runtime/perl-510 \
43 runtime/perl-510/extra \
44 developer/build/gnu-make \
45 developer/build/onbld \
46 developer/gcc-3 \
47 developer/astdev \
48 developer/lexer/flex \
49 library/nspr/header-nspr \
50 system/library/mozilla-nss/header-nss \
51 data/docbook \
52 text/gnu-gettext \
53 developer/java/jdk \
54 || /bin/true
55 else
56 # nonglobal Zone
d85a1cf @joshwilsdon [OS-16] pkgsrc version of gcc can't build 64-bit binaries, so is usel…
joshwilsdon authored
57 for pkg in gmake binutils autoconf automake \
c5b62d0 @joshwilsdon [OS-16] more cleanups to make stuff build cleanly in a joyent zone.
joshwilsdon authored
58 bison flex libtool-base python24 p5-XML-Parser \
59 libxslt dbus-glib dbus net-snmp; do
762a356 @joshwilsdon [OS-16] update illumos-live/configure to be more friendly to non-glob…
joshwilsdon authored
60 pkg_info ${pkg} >/dev/null 2>&1 || pkgin -y install ${pkg}
61 done
62 fi
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
63 fi
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
64
73352c8 @JohnSonnenschein pointed extra at github
JohnSonnenschein authored
65 # TODO: move this to illumos-extra itself
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
66 if [ "${HAVE_PKG}" == "true" ]; then
73352c8 @JohnSonnenschein pointed extra at github
JohnSonnenschein authored
67 echo "==> Installing illumos-extra dependencies..."
762a356 @joshwilsdon [OS-16] update illumos-live/configure to be more friendly to non-glob…
joshwilsdon authored
68 if [[ ${GLOBAL_ZONE} -eq 1 ]]; then
69 ${ROOTCMD} pkg install \
70 compatibility/ucb \
71 developer/build/autoconf \
72 developer/build/automake-19 \
73 developer/build/automake-110 \
74 developer/build/cmake \
75 developer/build/libtool \
76 developer/parser/bison \
77 library/libevent \
78 || /bin/true
79 else
80 # nonglobal Zone
81 /bin/true
82 fi
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
83 fi
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
84
85 echo "==> Checking for /opt/SUNWspro/bin/cc..."
86 echo " +--> Ensuring SUNWspro (12.1-patched) installed in /opt/SUNWspro/sunstudio12.1..."
87 if [ ! -f "/opt/SUNWspro/sunstudio12.1/prod/bin/cc" ]; then
88 if [ ! -z "${SUNW_SPRO12u1_URL}" ]; then
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
89 (${ROOTCMD} mkdir -p /opt/SUNWspro \
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
90 && cd /opt/SUNWspro \
91 && curl -k ${SUNW_SPRO12u1_URL} \
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
92 | ${ROOTCMD} gtar -zxf -)
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
93 else
94 echo "FATAL: unable to download sunstudio12u1, no URL is set. Please set SUNW_SPRO12u1_URL in configure.*"
95 exit 1
96 fi
97 fi
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
98
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
99 echo " +--> Ensuring SUNWspro (12-patched) installed in /opt/SUNWspro..."
100 if [ ! -f "/opt/SUNWspro/prod/bin/cc" ]; then
101 if [ ! -z "${SUNW_SPRO12_URL}" ]; then
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
102 (${ROOTCMD} mkdir -p /opt/SUNWspro \
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
103 && cd /opt/SUNWspro \
104 && curl -k "${SUNW_SPRO12_URL}" \
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
105 | ${ROOTCMD} gtar -jxf -)
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
106 else
107 echo "FATAL: unable to download sunstudio12, no URL is set. Please set SUNW_SPRO12_URL in configure.*"
108 exit 1
109 fi
110 fi
111
762a356 @joshwilsdon [OS-16] update illumos-live/configure to be more friendly to non-glob…
joshwilsdon authored
112
113 if [[ ${GLOBAL_ZONE} -eq 1 ]]; then
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
114 echo "==> Creating the missing symlinks..."
115 test -f /usr/bin/aclocal || ${ROOTCMD} ln -s /usr/bin/aclocal-1.10 /usr/bin/aclocal
116 test -f /usr/bin/automake || ${ROOTCMD} ln -s /usr/bin/automake-1.10 /usr/bin/automake
117 # so builds can use --mode and such
118 test -f /usr/bin/install || ${ROOTCMD} ln -s /usr/bin/ginstall /usr/bin/install
119 test -f /usr/bin/pod2man || ${ROOTCMD} ln -s /usr/perl5/5.10.0/bin/pod2man /usr/bin/pod2man
762a356 @joshwilsdon [OS-16] update illumos-live/configure to be more friendly to non-glob…
joshwilsdon authored
120 else
121 # nonglobal Zone
122 /bin/true
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
123 fi
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
124
125 echo "==> Populating projects/ directories..."
de34315 @joshwilsdon Add readme and fix a couple more bugs.
joshwilsdon authored
126 [ ! -d "projects" ] && mkdir -p projects
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
127 if [ ! -d "projects" ] ; then
128 echo "FATAL: unable to create projects/ directory."
129 exit 1
3aeb937 @joshwilsdon Fixes for building in zone.
joshwilsdon authored
130 fi
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
131
132 if [ ! -f "projects/illumos/usr/src/tools/env/illumos.sh" ]; then
133 echo " +--> Getting illumos source tree..."
134 if [ -z "${GET_ILLUMOS}" ]; then
135 echo "FATAL: No GET_ILLUMOS defined in configure.*, can't get illumos!"
136 exit 1
137 fi
138 /bin/bash -c "cd projects && ${GET_ILLUMOS} && cd -"
139 if [ ! -f "projects/illumos/usr/src/tools/env/illumos.sh" ]; then
140 echo "FATAL: GET_ILLUMOS command failed to get illumos!"
141 exit 1
142 fi
143 fi
144
73352c8 @JohnSonnenschein pointed extra at github
JohnSonnenschein authored
145 if [ ! -f "projects/illumos-extra/Makefile" ]; then
146 echo " +--> Getting illumos-extra source tree..."
147 if [ -z "${GET_ILLUMOS_EXTRA}" ]; then
148 echo "FATAL: No GET_ILLUMOS_EXTRA defined in configure.*, can't get illumos-extra!"
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
149 exit 1
150 fi
73352c8 @JohnSonnenschein pointed extra at github
JohnSonnenschein authored
151 /bin/bash -c "cd projects && ${GET_ILLUMOS_EXTRA} && cd -"
152 if [ ! -f "projects/illumos-extra/Makefile" ]; then
153 echo "FATAL: GET_ILLUMOS_EXTRA command failed to get illumos-extra!"
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
154 exit 1
155 fi
156 fi
157
158 if [ ! -f "projects/opensolaris-man/README" ]; then
159 echo " +--> Getting opensolaris-man source tree..."
160 if [ -z "${GET_OPENSOLARIS_MAN}" ]; then
161 echo "FATAL: No GET_OPENSOLARIS_MAN defined in configure.*, can't get opensolaris-man!"
162 exit 1
163 fi
164 /bin/bash -c "cd projects && ${GET_OPENSOLARIS_MAN} && cd -"
165 if [ ! -f "projects/opensolaris-man/README" ]; then
166 echo "FATAL: GET_OPENSOLARIS_MAN command failed to get opensolaris-man!"
167 exit 1
168 fi
169 fi
cc41ffa @joshwilsdon [OS-109] added some more manpages, also fixed so manpages come from o…
joshwilsdon authored
170 (cd projects/opensolaris-man && [[ -L usr ]] || ln -s . usr)
171 (cd projects/opensolaris-man && [[ -L share ]] || ln -s . share)
172 (cd projects/opensolaris-man && [[ -L man ]] || ln -s . man)
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
173
174 ROOT=`pwd`
175 echo "==> Setting up illumos-gate"
176
177 cd ${ROOT}/projects/illumos
178
179 if [ ! -f on-closed-bins.i386.tar.bz2 ]; then
180 if [ -z "${ON_CLOSED_BINS_URL}" ]; then
181 curl -O http://dlc.sun.com/osol/on/downloads/20100817/on-closed-bins.i386.tar.bz2
182 else
183 curl -k -O "${ON_CLOSED_BINS_URL}"
184 fi
185 tar xvpf on-closed-bins.i386.tar.bz2
186 fi
187 if [ ! -f on-closed-bins-nd.i386.tar.bz2 ]; then
188 if [ -z "${ON_CLOSED_BINS_ND_URL}" ]; then
189 curl -O http://dlc.sun.com/osol/on/downloads/20100817/on-closed-bins-nd.i386.tar.bz2
190 else
191 curl -k -O "${ON_CLOSED_BINS_ND_URL}"
192 fi
193 tar xvpf on-closed-bins-nd.i386.tar.bz2
194 fi
195
196 cp usr/src/tools/env/illumos.sh .
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
197 [ ! -z "${RELEASE_VER}" ] && gsed -i -e "s|^GATE=.*$|GATE=\"${RELEASE_VER}\"; export GATE|" illumos.sh
198 [ ! -z "${PUBLISHER}" ] && gsed -i -e "s|^# PKGPUBLISHER_REDIST=.*$|PKGPUBLISHER_REDIST=\"${PUBLISHER}\"; export PKGPUBLISHER_REDIST|" illumos.sh
199 gsed -i -e "s|^CODEMGR_WS=.*$|CODEMGR_WS=\"${ROOT}/projects/illumos\"; export CODEMGR_WS|" illumos.sh
c784bcb @jjelinek OS-178 nightly output too verbose
jjelinek authored
200 gsed -i -e "s|^NIGHTLY_OPTIONS=.*$|NIGHTLY_OPTIONS=\"-CimNnt\"; export NIGHTLY_OPTIONS|" illumos.sh
bbef23b @joshwilsdon Make possible to override stuff we need to override with a sparse zon…
joshwilsdon authored
201 gsed -i -e "s|^ROOT=.*$|ROOT="${ROOT}/proto"; export ROOT|" illumos.sh
202 gsed -i -e "s|^PARENT_ROOT=.*$|PARENT_ROOT="${ROOT}/proto"; export PARENT_ROOT|" illumos.sh
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
203
204 # For some reason this disappeared before
205 touch ${ROOT}/projects/illumos/usr/src/tools/findunref/exception_list.unknown
206
207 echo ""
1784d58 @joshwilsdon Fix message that referred to running build_live directly.
joshwilsdon authored
208 echo "Configuration complete. You should now be able to build a live image using 'make world && make live'"
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
209 echo ""
210
211 exit 0
Something went wrong with that request. Please try again.