summaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash73
1 files changed, 53 insertions, 20 deletions
diff --git a/src/make.bash b/src/make.bash
index 84b9908f4..34708b506 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -10,7 +10,7 @@ if [ ! -f env.bash ]; then
fi
. ./env.bash
-if ld --version 2>&1 | grep 'gold.*2\.20' >/dev/null; then
+if ld --version 2>&1 | grep 'gold.* 2\.20' >/dev/null; then
echo 'ERROR: Your system has gold 2.20 installed.'
echo 'This version is shipped by Ubuntu even though'
echo 'it is known not to work on Ubuntu.'
@@ -47,38 +47,71 @@ rm -f "$GOBIN"/gomake
) >"$GOBIN"/gomake
chmod +x "$GOBIN"/gomake
-# TODO(brainman): delete this after 01/01/2012.
-rm -f "$GOBIN"/gotest # remove old bash version of gotest on Windows
-
-if [ -d /selinux -a -f /selinux/booleans/allow_execstack -a -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
- if ! cat /selinux/booleans/allow_execstack | grep -c '^1 1$' >> /dev/null ; then
- echo "WARNING: the default SELinux policy on, at least, Fedora 12 breaks "
- echo "Go. You can enable the features that Go needs via the following "
- echo "command (as root):"
- echo " # setsebool -P allow_execstack 1"
- echo
- echo "Note that this affects your system globally! "
- echo
- echo "The build will continue in five seconds in case we "
- echo "misdiagnosed the issue..."
+# on Fedora 16 the selinux filesystem is mounted at /sys/fs/selinux,
+# so loop through the possible selinux mount points
+for se_mount in /selinux /sys/fs/selinux
+do
+ if [ -d $se_mount -a -f $se_mount/booleans/allow_execstack -a -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
+ if ! cat $se_mount/booleans/allow_execstack | grep -c '^1 1$' >> /dev/null ; then
+ echo "WARNING: the default SELinux policy on, at least, Fedora 12 breaks "
+ echo "Go. You can enable the features that Go needs via the following "
+ echo "command (as root):"
+ echo " # setsebool -P allow_execstack 1"
+ echo
+ echo "Note that this affects your system globally! "
+ echo
+ echo "The build will continue in five seconds in case we "
+ echo "misdiagnosed the issue..."
- sleep 5
+ sleep 5
+ fi
fi
-fi
+done
+$USE_GO_TOOL ||
(
cd "$GOROOT"/src/pkg;
bash deps.bash # do this here so clean.bash will work in the pkg directory
-)
+) || exit 1
bash "$GOROOT"/src/clean.bash
-# pkg builds libcgo and the Go programs in cmd.
-for i in lib9 libbio libmach cmd pkg
+# pkg builds runtime/cgo and the Go programs in cmd.
+for i in lib9 libbio libmach cmd
do
echo; echo; echo %%%% making $i %%%%; echo
gomake -C $i install
done
+echo; echo; echo %%%% making runtime generated files %%%%; echo
+
+(
+ cd "$GOROOT"/src/pkg/runtime
+ ./autogen.sh
+ gomake install; gomake clean # copy runtime.h to pkg directory
+) || exit 1
+
+if $USE_GO_TOOL; then
+ echo
+ echo '# Building go_bootstrap command from bootstrap script.'
+ if ! ./buildscript/${GOOS}_$GOARCH.sh; then
+ echo '# Bootstrap script failed.'
+ if [ ! -x "$GOBIN/go" ]; then
+ exit 1
+ fi
+ echo '# Regenerating bootstrap script using pre-existing go binary.'
+ ./buildscript.sh
+ ./buildscript/${GOOS}_$GOARCH.sh
+ fi
+
+ echo '# Building Go code.'
+ go_bootstrap install -a -v std
+ rm -f "$GOBIN/go_bootstrap"
+
+else
+ echo; echo; echo %%%% making pkg %%%%; echo
+ gomake -C pkg install
+fi
+
# Print post-install messages.
# Implemented as a function so that all.bash can repeat the output
# after run.bash finishes running all the tests.