85
85
86
86
check_prerequisites ()
87
87
{
88
+ unamestr=` uname`
89
+ if [[ " $unamestr " == ' Darwin' ]]; then
90
+ if [ -f /usr/bin/gcc ]; then
91
+ CC=/usr/bin/gcc
92
+ else
93
+ echo " Missing /usr/bin/gcc, which must exist and be an Apple LLVM version."
94
+ exit 1
95
+ fi
96
+ if [ -f /usr/bin/g++ ]; then
97
+ CXX=/usr/bin/g++
98
+ else
99
+ echo " Missing /usr/bin/g++, which must exist and be an Apple LLVM version."
100
+ exit 1
101
+ fi
102
+ else
103
+ # If this is not OS X, default to the user-specified compiler.
104
+ # If there is no user-specified compiler, use whatever the
105
+ # GNU compilers are in the path.
106
+ if [ -z $CC ]; then
107
+ CC=gcc
108
+ fi
109
+ if [ -z $CXX ]; then
110
+ CXX=g++
111
+ fi
112
+ fi
113
+
114
+ # Verify that 'wget' is is in the path.
88
115
if ! type wget > /dev/null; then
89
116
echo
90
- echo " $cmd requires 'wget'. Please install it. Aborting."
91
- exit 1;
92
- elif ! type make > /dev/null; then
117
+ echo " $cmd requires 'wget'. Please ensure that it is installed and in your path. Aborting."
118
+ exit 1
119
+ fi
120
+ if ! type make > /dev/null; then
93
121
echo
94
- echo " $cmd requires 'make'. Please install it . Aborting."
95
- exit 1;
122
+ echo " $cmd requires 'make'. Please ensure that it is installed and in your path . Aborting."
123
+ exit 1
96
124
fi
97
125
}
98
126
@@ -118,7 +146,7 @@ unpack()
118
146
build ()
119
147
{
120
148
cd cmake-$version &&
121
- ./bootstrap --prefix=$install_path &&
149
+ CC= $CC CXX= $CXX ./bootstrap --prefix=$install_path &&
122
150
make -j $num_threads
123
151
}
124
152
147
175
check_prerequisites &&
148
176
download &&
149
177
unpack &&
150
- build $version $install_path $num_threads
178
+ CC= $CC CXX= $CXX build $version $install_path $num_threads
151
179
} >&1 | tee build.log
152
180
echo " "
153
181
echo " Check build.log for results. If the build was successful, type"
0 commit comments