@@ -47,6 +47,7 @@ usage()
47
47
echo " Options:"
48
48
echo " --help, -h Show this help message"
49
49
echo " --version, -v, -V Report version and copyright information"
50
+ echo " --avail, -a, List the available branches"
50
51
echo " "
51
52
echo " Example usage:"
52
53
echo " "
@@ -56,9 +57,6 @@ usage()
56
57
echo " $cmd -v"
57
58
echo " $cmd --help"
58
59
echo " "
59
- echo " Note: use svn ls svn://gcc.gnu.org/svn/gcc/branches"
60
- echo " to list all available branches."
61
- echo " "
62
60
exit 1
63
61
}
64
62
71
69
72
70
# Default to 2 threads if no specified thread count:
73
71
if [ -z $3 ]; then
74
- num_threads=2
72
+ num_threads=1
75
73
else
76
74
num_threads=$3
77
75
fi
@@ -87,13 +85,28 @@ build()
87
85
make -j $num_threads bootstrap
88
86
}
89
87
88
+ # Exit if subversion is not installed
89
+ if ! type svn > /dev/null; then
90
+ echo
91
+ echo " $cmd requires 'svn'. Please install it. Aborting."
92
+ exit 1;
93
+ fi
94
+
95
+ # Exit if flex is not installed
96
+ if ! type flex > /dev/null; then
97
+ echo
98
+ echo " $cmd requires 'flex'. Please install it. Aborting."
99
+ exit 1;
100
+ fi
90
101
91
102
if [ $# == 0 ]; then
92
103
# Print usage information if script is invoked without arguments
93
104
usage | less
94
105
elif [[ $1 == ' --help' || $1 == ' -h' ]]; then
95
106
# Print usage information if script is invoked with --help or -h argument
96
107
usage | less
108
+ elif [[ $1 == ' --avail' || $1 == ' -a' ]]; then
109
+ svn ls svn://gcc.gnu.org/svn/gcc/branches | less
97
110
elif [[ $1 == ' -v' || $1 == ' -V' || $1 == ' --version' ]]; then
98
111
# Print script copyright if invoked with -v, -V, or --version argument
99
112
echo " "
@@ -114,14 +127,8 @@ else
114
127
# Build gcc
115
128
time \
116
129
{
117
- if ! type svn > /dev/null; then
118
- echo
119
- echo " $cmd requires 'svn'. Please install it. Aborting."
120
- exit 1;
121
- else
122
- svn co svn://gcc.gnu.org/svn/gcc/$url_tail &&
123
- build $1 $install_path $num_threads
124
- fi
130
+ svn co svn://gcc.gnu.org/svn/gcc/$url_tail &&
131
+ build $1 $install_path $num_threads
125
132
} >&1 | tee build.log
126
133
echo " Check build.log for results. If the build was successful, type"
127
134
echo " 'cd $1 -build && make install' (or 'cd $1 -build && sudo make install')"
0 commit comments