@@ -32,9 +32,9 @@ detect_cross_target() {
3232 esac
3333
3434 if [ -n " $CROSS_TARGET " ]; then
35- echo " Detected cross target $CROSS_TARGET "
35+ log_debug " Detected cross target $CROSS_TARGET "
3636 else
37- echo " No cross target detected"
37+ log_debug " No cross target detected"
3838 fi
3939}
4040
@@ -91,7 +91,7 @@ detect_os() {
9191 OS_VERSION=$UNAME_R
9292 ;;
9393 * )
94- echo " Unable to detect operating system: $UNAME_S "
94+ log_error " Unable to detect operating system: $UNAME_S "
9595 exit 42
9696 ;;
9797 esac
@@ -101,12 +101,12 @@ detect_os() {
101101 OS=mingw
102102 ;;
103103 * )
104- echo " Unknown cross-compilation target: $CROSS_TARGET "
104+ log_error " Unknown cross-compilation target: $CROSS_TARGET "
105105 exit 42
106106 ;;
107107 esac
108108
109- echo " Detected OS $OS $OS_VERSION "
109+ log_debug " Detected OS $OS $OS_VERSION "
110110 export OS OS_VERSION
111111}
112112
@@ -129,7 +129,7 @@ detect_distribution() {
129129 OS=rhel
130130 ;;
131131 * )
132- echo " Error: Could not determine Linux distro from /etc/redhat-release: $REL "
132+ log_error " Could not determine Linux distro from /etc/redhat-release: $REL "
133133 exit 42
134134 ;;
135135 esac
@@ -141,7 +141,7 @@ detect_distribution() {
141141
142142 # Make sure we actually found a match
143143 if [ -z " $version_string " ]; then
144- echo " Error: Could not determine version number from /etc/redhat-release: $REL "
144+ log_error " Could not determine version number from /etc/redhat-release: $REL "
145145 exit 42
146146 fi
147147 OS_VERSION=$version_string
@@ -173,7 +173,7 @@ detect_distribution() {
173173 case " $REL " in
174174 [0-9][0-9].[0-9][0-9]) ;;
175175 * )
176- echo " Unknown Ubuntu release: $REL "
176+ log_error " Unknown Ubuntu release: $REL "
177177 exit 42
178178 ;;
179179 esac
@@ -188,7 +188,7 @@ detect_distribution() {
188188
189189 REL=$( cat /etc/debian_version)
190190 if ! echo " $REL " | grep -E ' ^[0-9]+\.[0-9]+(\.[0-9]+)?$' > /dev/null; then
191- echo " Unable to detect version of Debian: $REL "
191+ log_error " Unable to detect version of Debian: $REL "
192192 exit 42
193193 fi
194194
@@ -222,12 +222,12 @@ detect_distribution() {
222222 fi
223223
224224 if [ -z " $OS " ]; then
225- echo " Failed to detect Linux distribution"
225+ log_error " Failed to detect Linux distribution"
226226 exit 42
227227 fi
228228
229229 if [ -z " $OS_VERSION " ]; then
230- echo " Failed to detect Linux distribution version"
230+ log_error " Failed to detect Linux distribution version"
231231 exit 42
232232 fi
233233}
@@ -252,7 +252,7 @@ detect_packaging() {
252252 elif [ -f /usr/sbin/swinstall ]; then
253253 DEP_PACKAGING=hpux
254254 else
255- echo " Unknown packaging system"
255+ log_error " Unknown packaging system"
256256 exit 42
257257 fi
258258
@@ -268,8 +268,8 @@ detect_packaging() {
268268 ;;
269269 esac
270270
271- echo " Detected dependency packaging $DEP_PACKAGING "
272- echo " Detected packaging $PACKAGING "
271+ log_debug " Detected dependency packaging $DEP_PACKAGING "
272+ log_debug " Detected packaging $PACKAGING "
273273 export DEP_PACKAGING PACKAGING
274274}
275275
@@ -293,7 +293,8 @@ detect_arch() {
293293 ARCH=i86pc
294294 ;;
295295 * )
296- echo " Unknown Solaris architecture: $UNAME_M "
296+ log_error " Unknown Solaris architecture: $UNAME_M "
297+ exit 42
297298 ;;
298299 esac
299300 ;;
@@ -305,7 +306,7 @@ detect_arch() {
305306 ARCH=$UNAME_M
306307 ;;
307308 * )
308- echo " Unknown packaging system"
309+ log_error " Unknown packaging system"
309310 exit 42
310311 ;;
311312 esac
@@ -322,12 +323,12 @@ detect_arch() {
322323 ARCH=x64
323324 ;;
324325 * )
325- echo " Unknown cross-compilation target: $CROSS_TARGET "
326+ log_error " Unknown cross-compilation target: $CROSS_TARGET "
326327 exit 42
327328 ;;
328329 esac
329330
330- echo " Detected architecture $ARCH "
331+ log_debug " Detected architecture $ARCH "
331332 export ARCH
332333}
333334
@@ -341,9 +342,9 @@ detect_tools() {
341342
342343 if $MAKE -v | grep GNU; then
343344 export MAKE
344- echo " Detected make path $MAKE "
345+ log_debug " Detected make path $MAKE "
345346 else
346- echo " Error: GNU Make not found"
347+ log_error " GNU Make not found"
347348 exit 42
348349 fi
349350
@@ -353,12 +354,12 @@ detect_tools() {
353354 # systems. We use it to kill processes that can mess with the build process.
354355 FUSER=$( func_whereis fuser)
355356 export FUSER
356- echo " Detected fuser path $FUSER "
357+ log_debug " Detected fuser path $FUSER "
357358
358359 # We use patch to apply patches to the dependencies.
359360 PATCH=$( func_whereis gpatch patch)
360361 export PATCH
361- echo " Detected patch path $PATCH "
362+ log_debug " Detected patch path $PATCH "
362363}
363364
364365# This function appends the -j/--jobs option to the MAKEFLAGS environment
@@ -368,29 +369,29 @@ detect_tools() {
368369detect_cores () {
369370 case " $OS_FAMILY " in
370371 aix)
371- echo " Detected OS family is aix"
372+ log_debug " Detected OS family is aix"
372373 NUM_CORES=" $( lscfg | grep -c proc) "
373374 ;;
374375 solaris)
375- echo " Detected OS family is solaris"
376+ log_debug " Detected OS family is solaris"
376377 NUM_CORES=" $( psrinfo | wc -l) "
377378 ;;
378379 linux)
379- echo " Detected OS family is linux"
380+ log_debug " Detected OS family is linux"
380381 NUM_CORES=" $( grep -c ' ^processor' /proc/cpuinfo) "
381382 ;;
382383 hpux)
383- echo " Detected OS family is hpux"
384+ log_debug " Detected OS family is hpux"
384385 NUM_CORES=" $( ioscan -k -C processor | grep -c processor) "
385386 ;;
386387 * )
387- echo " Detected OS family is UNKNOWN, defaulting amount of CPU cores to 1"
388+ log_debug " Detected OS family is UNKNOWN, defaulting amount of CPU cores to 1"
388389 NUM_CORES=1
389390 ;;
390391 esac
391392
392393 # Make number of jobs one higher than core count, to account for I/O, network, etc.
393- echo " Detected amount of CPU cores is $NUM_CORES "
394+ log_debug " Detected amount of CPU cores is $NUM_CORES "
394395 MAKEFLAGS=" ${MAKEFLAGS:- -j$((NUM_CORES + 1))} "
395396 export MAKEFLAGS
396397}
0 commit comments