@@ -48,61 +48,44 @@ usage()
48
48
echo " "
49
49
echo " Examples:"
50
50
echo " "
51
- echo " $this_script gcc "
52
- echo " $this_script gcc trunk"
53
- echo " $this_script gcc 5.2.0 /opt/gnu/5.2.0 4"
54
- echo " $this_script wget"
51
+ echo " $this_script gcc Build the default GCC release"
52
+ echo " $this_script gcc trunk Build the GCC development trunk"
53
+ echo " $this_script gcc --default /opt/gnu/5.3.0 4 Build the default release in the specified path using 4 threads"
54
+ echo " $this_script gcc 5.2.0 /opt/gnu/5.2.0 Build the GCC 5.2.0 release"
55
+ echo " $this_script wget Build the wget package"
56
+ echo " $this_script mpich --default --query-version Return the default mpich version built by $this_script "
57
+ echo " $this_script flex --default --query-path Return the default flex installation path"
58
+ echo " $this_script mpich --default --query-url Return the default mpich version built by $this_script "
55
59
echo " $this_script --help"
56
60
echo " $this_script --list"
57
61
echo " "
58
62
echo " [exit 10]"
59
63
exit 10
60
64
61
- # Private usage information
65
+ # The following argument invocation works only with gcc but could be extended to work with any svn download:
66
+ #
67
+ # ./build gcc --avail list the development branches available for checkout
68
+ # ./build gcc --a same as --avail
62
69
#
63
- # The following arguments are intentionally not documented in the above public usage information because
64
- # they are intended for use by ../install.sh only rather than for use interactively at the command line:
65
- # Argument $2 Argument $3 Description
66
- # --default install the default version for the corresponding package
67
- # --default --query-path return the default installation location for the package
68
- # --default --query-version return the default version for the package
69
- # --default --query-url return the default download location for the package
70
- #
71
- # Example: ./build gcc --default --query-path
72
- #
73
- # With the exception of gcc, all uses of "--default" refer to the package version that would be downloaded
74
- # if no version is specified, e.g., "./build mpich". By contrast, "./build gcc" downloads the latest
75
- # pre-release, development branch (the "trunk"), whereas "./build gcc --default" downloads a released
76
- # version of gcc.
77
- #
78
- # The following argument works only with gcc and is mutually exclusive with the above private arguments
79
- # (it could be extended to work with any svn download):
80
- # Argument $2 Description
81
- # --avail list the development branches available for checkout
82
- # -a same as --avail
83
- #
84
- # Example: ./build gcc --avail
70
+ # The --avail and -a options are not listed in the printed usage information because building
71
+ # non-trunk development branches (e.g., gcc-5-branch) is currently broken. A fix could be
72
+ # accomplished most elegantly by first implementing POSIX getopts argument parsing.
85
73
}
86
74
87
75
# If the package name is recognized, then set the default version.
88
76
# Otherwise, list the allowable package names and default versions and then exit.
89
77
set_default_version ()
90
78
{
91
- version_requested=$2
92
79
if [[ $package_to_build == " --list" || $package_to_build == " -l" ]]; then
93
80
printf " \n"
94
81
printf " The '$this_script ' script can build the following packages:\n"
95
- elif [[ $package_to_build == " gcc" && $version_requested == " --default" ]]; then
96
- gcc_version=" 5.3.0"
97
- else
98
- gcc_version=" trunk"
99
82
fi
100
83
# This is a bash 3 hack standing in for a bash 4 hash (bash 3 is the lowest common
101
84
# denominator because, for licensing reasons, OS X only has bash 3 by default.)
102
85
# See http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash
103
86
package_version=(
104
87
" cmake:3.4.0"
105
- " gcc:$gcc_version "
88
+ " gcc:5.3.0 "
106
89
" mpich:3.1.4"
107
90
" wget:1.16.3"
108
91
" flex:2.6.0"
@@ -129,7 +112,6 @@ set_default_version()
129
112
exit 20
130
113
elif [[ $package_to_build == " $KEY " ]]; then
131
114
# We recognize the package name so we set the default version:
132
- verbosity=$1
133
115
if [[ $2 != " --default" ]]; then
134
116
printf " Using default version $VALUE \n"
135
117
fi
@@ -146,7 +128,7 @@ set_default_version()
146
128
147
129
check_prerequisites ()
148
130
{
149
- if [[ $package_to_build == " gcc" && $version_requested == " --default " ]]; then
131
+ if [[ " $package_to_build " == " gcc" && " $version_to_build " != " trunk " ]]; then
150
132
gcc_fetch=" ftp"
151
133
else
152
134
gcc_fetch=" svn"
@@ -201,8 +183,8 @@ set_url()
201
183
{
202
184
if [[ $package_to_build == ' cmake' ]]; then
203
185
major_minor=" ${version_to_build% .* } "
204
- elif [[ " $package_to_build " == " gcc" && " $version_to_build " == " $default_version " ]]; then
205
- gcc_url_head=" http://ftpmirror.gnu.org/gcc/gcc-5.3.0 /"
186
+ elif [[ " $package_to_build " == " gcc" && " $version_to_build " != " trunk " ]]; then
187
+ gcc_url_head=" http://ftpmirror.gnu.org/gcc/gcc-$version_to_build /"
206
188
else
207
189
gcc_url_head=" svn://gcc.gnu.org/svn/gcc/"
208
190
fi
@@ -236,8 +218,8 @@ set_url()
236
218
237
219
# Set differing tails for GCC trunk versus branches
238
220
if [[ $package_to_build == ' gcc' ]]; then
239
- if [[ $version_to_build == ' trunk ' ]]; then
240
- gcc_tail=' trunk '
221
+ if [[ $fetch == ' svn ' ]]; then
222
+ gcc_tail=$version_to_build
241
223
elif [[ $version_to_build == ' --avail' || $version_to_build == ' -a' ]]; then
242
224
gcc_tail=' branches'
243
225
else
0 commit comments