@@ -112,7 +112,7 @@ download_file() {
112
112
local URL=" $1 "
113
113
if [ " ${DOWNLOADER} " = " wget" ]; then
114
114
wget " ${URL} "
115
- elif [" ${DOWNLOADER} " = " curl" ]; then
115
+ elif [ " ${DOWNLOADER} " = " curl" ]; then
116
116
curl -O " ${URL} "
117
117
fi
118
118
if [ $? -ne 0 ]; then
@@ -205,7 +205,7 @@ check_compiler_tools() {
205
205
CC=" "
206
206
COMPILERS=$( find " ${NDK} /toolchains/${toolchain_dir} /prebuilt" -type f -name " *-gcc" )
207
207
for compiler in $COMPILERS ; do
208
- echo -n " Testing ${compiler} ... "
208
+ printf " Testing ${compiler} ... "
209
209
$compiler --version > /dev/null 2>&1
210
210
if [ $? -eq 0 ]; then
211
211
echo " OK"
@@ -218,12 +218,30 @@ check_compiler_tools() {
218
218
if [ -z " ${CC} " ]; then
219
219
echo " ERROR: Can't find a valid compiler"
220
220
fi
221
+
222
+ RANLIB_TOOL=" "
223
+ RANLIBS=$( find " ${NDK} /toolchains/${toolchain_dir} /prebuilt" -type f -name " *-ranlib" )
224
+ for ranlib in $RANLIBS ; do
225
+ printf " Testing ${ranlib} ... "
226
+ $ranlib --version > /dev/null 2>&1
227
+ if [ $? -eq 0 ]; then
228
+ echo " OK"
229
+ RANLIB_TOOL=" ${ranlib} "
230
+ break
231
+ fi
232
+ echo " NOT VALID"
233
+ done
234
+
235
+ if [ -z " ${RANLIB_TOOL} " ]; then
236
+ echo " ERROR: Can't find a valid ranlib tool"
237
+ fi
238
+
221
239
222
240
if [ " ${SHOULD_STRIP} " = " yes" ]; then
223
241
STRIP_TOOL=" "
224
242
local STRIP_TOOLS=$( find " ${NDK} /toolchains/${toolchain_dir} /prebuilt" -type f -name " *-strip" )
225
243
for strip_tool in $STRIP_TOOLS ; do
226
- echo -n " Testing ${strip_tool} ... "
244
+ printf " Testing ${strip_tool} ... "
227
245
$strip_tool --version > /dev/null 2>&1
228
246
if [ $? -eq 0 ]; then
229
247
echo " OK"
@@ -367,6 +385,17 @@ for ARCH in ${ARCHS}; do
367
385
exit 4
368
386
fi
369
387
388
+ if [ ! -f libpcap.a ]; then
389
+ echo " ERROR: lipcap.a not generated"
390
+ exit 4
391
+ fi
392
+
393
+ ${RANLIB_TOOL} libpcap.a
394
+ if [ $? -ne 0 ]; then
395
+ echo " ERROR: Failed executing ${RANLIB_TOOL} on libpcap.a"
396
+ exit 4
397
+ fi
398
+
370
399
echo " Compiling tcpdump for ${ARCH} ..."
371
400
cd " ${DIR_TCPDUMP} "
372
401
0 commit comments