This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
/
update_libgo.sh
executable file
·57 lines (43 loc) · 1.72 KB
/
update_libgo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh -e
# Fetch libgo and its dependencies.
llgodir=$(dirname "$0")
llgodir=$(cd "$llgodir" && pwd)
gofrontendrepo=https://code.google.com/p/gofrontend/
gofrontendrev=225a208260a6
gccrepo=svn://gcc.gnu.org/svn/gcc/trunk
gccrev=210256
workdir=$llgodir/workdir
gofrontenddir=$workdir/gofrontend
mkdir -p $workdir
if [ -d $gofrontenddir/.hg ] ; then
(cd $gofrontenddir && hg pull)
else
hg clone $gofrontendrepo $gofrontenddir
fi
# Revert the previous version of the noext diff (see below).
if [ -e $workdir/libgo-noext.diff ] ; then
(cd $gofrontenddir && patch -R -p1 < $workdir/libgo-noext.diff)
rm $workdir/libgo-noext.diff
fi
(cd $gofrontenddir && hg update -r $gofrontendrev)
# Apply a diff that eliminates use of the unnamed struct extension beyond what
# -fms-extensions supports. We keep a copy of the diff in the work directory so
# we know what to revert when we update. This is a temporary measure until a
# similar change can be made upstream.
(cd $gofrontenddir && patch -p1 < $llgodir/libgo-noext.diff)
cp $llgodir/libgo-noext.diff $workdir/
# Some dependencies are stored in the gcc repository.
# TODO(pcc): Ask iant about mirroring these dependencies into gofrontend.
mkdir -p $gofrontenddir/include
mkdir -p $gofrontenddir/libgcc
for f in config.guess config-ml.in config.sub depcomp \
install-sh ltmain.sh missing move-if-change \
include/dwarf2.def include/dwarf2.h libgcc/unwind-pe.h ; do
svn cat -r $gccrev $gccrepo/$f > $gofrontenddir/$f
done
# Avoid pulling in a bunch of unneeded gcc headers.
echo "#define IS_ABSOLUTE_PATH(path) ((path)[0] == '/')" > $gofrontenddir/include/filenames.h
for d in libbacktrace libffi ; do
svn co -r $gccrev $gccrepo/$d $gofrontenddir/$d
done
touch $workdir/.update-libgo-stamp