Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 164 lines (144 sloc) 5.501 kb
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
1 #!/usr/bin/env bash
2 #
3 # Copyright (c) 2010 Joyent Inc.
4 #
5
6 set -e
7
8 # Load all site-specific configure files
9 source configure.*
10
11 echo "==> Installing illumos build dependencies..."
12 pfexec pkg install \
13 text/groff \
14 system/zones/internal \
15 library/libxml2 \
16 developer/gnome/gettext \
17 library/python-2/setuptools-26 \
18 library/gnome/gnome-vfs \
19 runtime/perl-510 \
20 runtime/perl-510/extra \
21 developer/build/gnu-make \
22 developer/build/onbld \
23 developer/gcc-3 \
24 developer/astdev \
25 developer/lexer/flex \
26 library/nspr/header-nspr \
27 system/library/mozilla-nss/header-nss \
28 data/docbook \
29 text/gnu-gettext \
30 || /bin/true
31
32
33 # TODO: move this to illumos-extras itself
34 echo "==> Installing illumos-extras dependencies..."
35 pfexec pkg install \
36 compatibility/ucb \
37 developer/build/autoconf \
38 developer/build/automake-19 \
39 developer/build/automake-110 \
40 developer/build/cmake \
41 developer/build/libtool \
42 developer/parser/bison \
43 library/libevent \
44 || /bin/true
45
46
47 echo "==> Checking for /opt/SUNWspro/bin/cc..."
48 echo " +--> Ensuring SUNWspro (12.1-patched) installed in /opt/SUNWspro/sunstudio12.1..."
49 if [ ! -f "/opt/SUNWspro/sunstudio12.1/prod/bin/cc" ]; then
50 if [ ! -z "${SUNW_SPRO12u1_URL}" ]; then
51 (pfexec mkdir -p /opt/SUNWspro \
52 && cd /opt/SUNWspro \
53 && curl -k ${SUNW_SPRO12u1_URL} \
54 | pfexec gtar -zxf -)
55 else
56 echo "FATAL: unable to download sunstudio12u1, no URL is set. Please set SUNW_SPRO12u1_URL in configure.*"
57 exit 1
58 fi
59 fi
60 echo " +--> Ensuring SUNWspro (12-patched) installed in /opt/SUNWspro..."
61 if [ ! -f "/opt/SUNWspro/prod/bin/cc" ]; then
62 if [ ! -z "${SUNW_SPRO12_URL}" ]; then
63 (pfexec mkdir -p /opt/SUNWspro \
64 && cd /opt/SUNWspro \
65 && curl -k "${SUNW_SPRO12_URL}" \
66 | pfexec gtar -jxf -)
67 else
68 echo "FATAL: unable to download sunstudio12, no URL is set. Please set SUNW_SPRO12_URL in configure.*"
69 exit 1
70 fi
71 fi
72
73 echo "==> Creating the missing symlinks..."
74 test -f /usr/bin/aclocal || pfexec ln -s /usr/bin/aclocal-1.10 /usr/bin/aclocal
75 test -f /usr/bin/automake || pfexec ln -s /usr/bin/automake-1.10 /usr/bin/automake
76 # so builds can use --mode and such
77 test -f /usr/bin/install || pfexec ln -s /usr/bin/ginstall /usr/bin/install
78 test -f /usr/bin/pod2man || pfexec ln -s /usr/perl5/5.10.0/bin/pod2man /usr/bin/pod2man
79
80 echo "==> Populating projects/ directories..."
de34315 @joshwilsdon Add readme and fix a couple more bugs.
joshwilsdon authored
81 [ ! -d "projects" ] && mkdir -p projects
43be32e @joshwilsdon Massive update to build process including:
joshwilsdon authored
82 if [ ! -d "projects" ] ; then
83 echo "FATAL: unable to create projects/ directory."
84 exit 1
85 fi
86
87 if [ ! -f "projects/illumos/usr/src/tools/env/illumos.sh" ]; then
88 echo " +--> Getting illumos source tree..."
89 if [ -z "${GET_ILLUMOS}" ]; then
90 echo "FATAL: No GET_ILLUMOS defined in configure.*, can't get illumos!"
91 exit 1
92 fi
93 /bin/bash -c "cd projects && ${GET_ILLUMOS} && cd -"
94 if [ ! -f "projects/illumos/usr/src/tools/env/illumos.sh" ]; then
95 echo "FATAL: GET_ILLUMOS command failed to get illumos!"
96 exit 1
97 fi
98 fi
99
100 if [ ! -f "projects/illumos-extras/Makefile" ]; then
101 echo " +--> Getting illumos-extras source tree..."
102 if [ -z "${GET_ILLUMOS_EXTRAS}" ]; then
103 echo "FATAL: No GET_ILLUMOS_EXTRAS defined in configure.*, can't get illumos-extras!"
104 exit 1
105 fi
106 /bin/bash -c "cd projects && ${GET_ILLUMOS_EXTRAS} && cd -"
107 if [ ! -f "projects/illumos-extras/Makefile" ]; then
108 echo "FATAL: GET_ILLUMOS_EXTRAS command failed to get illumos-extras!"
109 exit 1
110 fi
111 fi
112
113 if [ ! -f "projects/opensolaris-man/README" ]; then
114 echo " +--> Getting opensolaris-man source tree..."
115 if [ -z "${GET_OPENSOLARIS_MAN}" ]; then
116 echo "FATAL: No GET_OPENSOLARIS_MAN defined in configure.*, can't get opensolaris-man!"
117 exit 1
118 fi
119 /bin/bash -c "cd projects && ${GET_OPENSOLARIS_MAN} && cd -"
120 if [ ! -f "projects/opensolaris-man/README" ]; then
121 echo "FATAL: GET_OPENSOLARIS_MAN command failed to get opensolaris-man!"
122 exit 1
123 fi
124 fi
125
126 ROOT=`pwd`
127 echo "==> Setting up illumos-gate"
128
129 cd ${ROOT}/projects/illumos
130
131 if [ ! -f on-closed-bins.i386.tar.bz2 ]; then
132 if [ -z "${ON_CLOSED_BINS_URL}" ]; then
133 curl -O http://dlc.sun.com/osol/on/downloads/20100817/on-closed-bins.i386.tar.bz2
134 else
135 curl -k -O "${ON_CLOSED_BINS_URL}"
136 fi
137 tar xvpf on-closed-bins.i386.tar.bz2
138 fi
139 if [ ! -f on-closed-bins-nd.i386.tar.bz2 ]; then
140 if [ -z "${ON_CLOSED_BINS_ND_URL}" ]; then
141 curl -O http://dlc.sun.com/osol/on/downloads/20100817/on-closed-bins-nd.i386.tar.bz2
142 else
143 curl -k -O "${ON_CLOSED_BINS_ND_URL}"
144 fi
145 tar xvpf on-closed-bins-nd.i386.tar.bz2
146 fi
147
148 cp usr/src/tools/env/illumos.sh .
149 [ ! -z "${RELEASE_VER}" ] && /usr/gnu/bin/sed -i -e "s|^GATE=.*$|GATE=\"${RELEASE_VER}\"; export GATE|" illumos.sh
150 [ ! -z "${PUBLISHER}" ] && /usr/gnu/bin/sed -i -e "s|^# PKGPUBLISHER_REDIST=.*$|PKGPUBLISHER_REDIST=\"${PUBLISHER}\"; export PKGPUBLISHER_REDIST|" illumos.sh
151 /usr/gnu/bin/sed -i -e "s|^CODEMGR_WS=.*$|CODEMGR_WS=\"${ROOT}/projects/illumos\"; export CODEMGR_WS|" illumos.sh
152 /usr/gnu/bin/sed -i -e "s|^NIGHTLY_OPTIONS=.*$|NIGHTLY_OPTIONS=\"-nCmprt\"; export NIGHTLY_OPTIONS|" illumos.sh
153 /usr/gnu/bin/sed -i -e "s|^ROOT=.*$|ROOT="${ROOT}/proto"; export ROOT|" illumos.sh
154 /usr/gnu/bin/sed -i -e "s|^PARENT_ROOT=.*$|PARENT_ROOT="${ROOT}/proto"; export PARENT_ROOT|" illumos.sh
155
156 # For some reason this disappeared before
157 touch ${ROOT}/projects/illumos/usr/src/tools/findunref/exception_list.unknown
158
159 echo ""
160 echo "Configuration complete. You should now be able to build a live image using ./build_live"
161 echo ""
162
163 exit 0
Something went wrong with that request. Please try again.