Skip to content

Commit 580d4b7

Browse files
committed
Regenerate artifacts.
1 parent f82ecf2 commit 580d4b7

File tree

1 file changed

+54
-51
lines changed

1 file changed

+54
-51
lines changed

install.sh

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ configure_options()
6666
display_message "configure options:"
6767
for OPTION in "$@"; do
6868
if [[ $OPTION ]]; then
69-
display_message $OPTION
69+
display_message "$OPTION"
7070
fi
7171
done
7272

@@ -83,19 +83,17 @@ create_directory()
8383

8484
display_heading_message()
8585
{
86-
echo
87-
echo "********************** $@ **********************"
88-
echo
86+
printf "\n********************** %s **********************\n" "$@"
8987
}
9088

9189
display_message()
9290
{
93-
echo "$@"
91+
printf "%s\n" "$@"
9492
}
9593

9694
display_error()
9795
{
98-
>&2 echo "$@"
96+
>&2 printf "%s\n" "$@"
9997
}
10098

10199
initialize_git()
@@ -115,7 +113,7 @@ make_current_directory()
115113

116114
./autogen.sh
117115
configure_options "$@"
118-
make_jobs $JOBS
116+
make_jobs "$JOBS"
119117
make install
120118
configure_links
121119
}
@@ -128,7 +126,7 @@ make_jobs()
128126

129127
# Avoid setting -j1 (causes problems on Travis).
130128
if [[ $JOBS > $SEQUENTIAL ]]; then
131-
make -j$JOBS "$@"
129+
make -j"$JOBS" "$@"
132130
else
133131
make "$@"
134132
fi
@@ -144,7 +142,7 @@ make_tests()
144142

145143
# Build and run unit tests relative to the primary directory.
146144
# VERBOSE=1 ensures test runner output sent to console (gcc).
147-
make_jobs $JOBS check "VERBOSE=1"
145+
make_jobs "$JOBS" check "VERBOSE=1"
148146
local RESULT=$?
149147

150148
# Test runners emit to the test.log file.
@@ -225,13 +223,13 @@ done
225223
# Configure build parallelism.
226224
#------------------------------------------------------------------------------
227225
SEQUENTIAL=1
228-
OS=`uname -s`
226+
OS=$(uname -s)
229227
if [[ $PARALLEL ]]; then
230228
display_message "Using shell-defined PARALLEL value."
231229
elif [[ $OS == Linux ]]; then
232-
PARALLEL=`nproc`
230+
PARALLEL=$(nproc)
233231
elif [[ ($OS == Darwin) || ($OS == OpenBSD) ]]; then
234-
PARALLEL=`sysctl -n hw.ncpu`
232+
PARALLEL=$(sysctl -n hw.ncpu)
235233
else
236234
display_error "Unsupported system: $OS"
237235
display_error " Explicit shell-definition of PARALLEL will avoid system detection."
@@ -279,7 +277,7 @@ CONFIGURE_OPTIONS=("${CONFIGURE_OPTIONS[@]/--build-*/}")
279277

280278
# Always set a prefix (required on OSX and for lib detection).
281279
#------------------------------------------------------------------------------
282-
if [[ !($PREFIX) ]]; then
280+
if [[ ! ($PREFIX) ]]; then
283281
PREFIX="/usr/local"
284282
CONFIGURE_OPTIONS=( "${CONFIGURE_OPTIONS[@]}" "--prefix=$PREFIX")
285283
else
@@ -426,23 +424,23 @@ build_from_tarball()
426424
shift 7
427425

428426
# For some platforms we need to set ICU pkg-config path.
429-
if [[ !($BUILD) ]]; then
430-
if [[ $ARCHIVE == $ICU_ARCHIVE ]]; then
427+
if [[ ! ($BUILD) ]]; then
428+
if [[ $ARCHIVE == "$ICU_ARCHIVE" ]]; then
431429
initialize_icu_packages
432430
fi
433431
return
434432
fi
435433

436434
# Because libpng doesn't actually use pkg-config to locate zlib.
437435
# Because ICU tools don't know how to locate internal dependencies.
438-
if [[ ($ARCHIVE == $ICU_ARCHIVE) || ($ARCHIVE == $PNG_ARCHIVE) ]]; then
439-
local SAVE_LDFLAGS=$LDFLAGS
436+
if [[ ($ARCHIVE == "$ICU_ARCHIVE") || ($ARCHIVE == "$PNG_ARCHIVE") ]]; then
437+
local SAVE_LDFLAGS="$LDFLAGS"
440438
export LDFLAGS="-L$PREFIX/lib $LDFLAGS"
441439
fi
442440

443441
# Because libpng doesn't actually use pkg-config to locate zlib.h.
444-
if [[ ($ARCHIVE == $PNG_ARCHIVE) ]]; then
445-
local SAVE_CPPFLAGS=$CPPFLAGS
442+
if [[ ($ARCHIVE == "$PNG_ARCHIVE") ]]; then
443+
local SAVE_CPPFLAGS="$CPPFLAGS"
446444
export CPPFLAGS="-I$PREFIX/include $CPPFLAGS"
447445
fi
448446

@@ -455,31 +453,31 @@ build_from_tarball()
455453
push_directory "$EXTRACT"
456454

457455
# Extract the source locally.
458-
wget --output-document $ARCHIVE $URL
459-
tar --extract --file $ARCHIVE --$COMPRESSION --strip-components=1
456+
wget --output-document "$ARCHIVE" "$URL"
457+
tar --extract --file "$ARCHIVE" "--$COMPRESSION" --strip-components=1
460458
push_directory "$PUSH_DIR"
461459

462460
# Enable static only zlib build.
463-
if [[ $ARCHIVE == $ZLIB_ARCHIVE ]]; then
461+
if [[ $ARCHIVE == "$ZLIB_ARCHIVE" ]]; then
464462
patch_zlib_configuration
465463
fi
466464

467465
# Join generated and command line options.
468466
local CONFIGURATION=("${OPTIONS[@]}" "$@")
469467

470-
if [[ $ARCHIVE == $MBEDTLS_ARCHIVE ]]; then
471-
make -j $JOBS lib
468+
if [[ $ARCHIVE == "$MBEDTLS_ARCHIVE" ]]; then
469+
make -j "$JOBS" lib
472470
make DESTDIR=$PREFIX install
473471
else
474472
configure_options "${CONFIGURATION[@]}"
475-
make_jobs $JOBS --silent
473+
make_jobs "$JOBS" --silent
476474
make install
477475
fi
478476

479477
configure_links
480478

481479
# Enable shared only zlib build.
482-
if [[ $ARCHIVE == $ZLIB_ARCHIVE ]]; then
480+
if [[ $ARCHIVE == "$ZLIB_ARCHIVE" ]]; then
483481
clean_zlib_build
484482
fi
485483

@@ -488,7 +486,7 @@ build_from_tarball()
488486

489487
# Restore flags to prevent side effects.
490488
export LDFLAGS=$SAVE_LDFLAGS
491-
export CPPFLAGS=$SAVE_LCPPFLAGS
489+
export CPPFLAGS=$SAVE_CPPFLAGS
492490

493491
pop_directory
494492
}
@@ -504,8 +502,8 @@ circumvent_boost_icu_detection()
504502
local REGEX_TEST="libs/regex/build/has_icu_test.cpp"
505503
local LOCALE_TEST="libs/locale/build/has_icu_test.cpp"
506504

507-
echo $SUCCESS > $REGEX_TEST
508-
echo $SUCCESS > $LOCALE_TEST
505+
printf "%s" "$SUCCESS" > $REGEX_TEST
506+
printf "%s" "$SUCCESS" > $LOCALE_TEST
509507

510508
# display_message "Hack: ICU detection modified, will always indicate found."
511509
}
@@ -546,20 +544,23 @@ initialize_boost_icu_configuration()
546544
BOOST_ICU_POSIX="off"
547545

548546
# Extract ICU libs from package config variables and augment with -ldl.
549-
ICU_LIBS="`pkg-config icu-i18n --libs` -ldl"
547+
ICU_LIBS="$(pkg-config icu-i18n --libs) -ldl"
550548

551549
# This is a hack for boost m4 scripts that fail with ICU dependency.
552550
# See custom edits in ax-boost-locale.m4 and ax_boost_regex.m4.
553-
export BOOST_ICU_LIBS="${ICU_LIBS[@]}"
551+
export BOOST_ICU_LIBS=("${ICU_LIBS[@]}")
554552

555553
# Extract ICU prefix directory from package config variable.
556-
ICU_PREFIX=`pkg-config icu-i18n --variable=prefix`
554+
ICU_PREFIX=$(pkg-config icu-i18n --variable=prefix)
557555
fi
558556
}
559557

560558
# Because boost doesn't use autoconfig.
561559
build_from_tarball_boost()
562560
{
561+
local SAVE_IFS="$IFS"
562+
IFS=' '
563+
563564
local URL=$1
564565
local ARCHIVE=$2
565566
local COMPRESSION=$3
@@ -568,7 +569,7 @@ build_from_tarball_boost()
568569
local BUILD=$6
569570
shift 6
570571

571-
if [[ !($BUILD) ]]; then
572+
if [[ ! ($BUILD) ]]; then
572573
return
573574
fi
574575

@@ -581,8 +582,8 @@ build_from_tarball_boost()
581582
push_directory "$EXTRACT"
582583

583584
# Extract the source locally.
584-
wget --output-document $ARCHIVE $URL
585-
tar --extract --file $ARCHIVE --$COMPRESSION --strip-components=1
585+
wget --output-document "$ARCHIVE" "$URL"
586+
tar --extract --file "$ARCHIVE" "--$COMPRESSION" --strip-components=1
586587

587588
initialize_boost_configuration
588589
initialize_boost_icu_configuration
@@ -599,15 +600,15 @@ build_from_tarball_boost()
599600
display_message "boost.locale.posix : $BOOST_ICU_POSIX"
600601
display_message "-sNO_BZIP2 : 1"
601602
display_message "-sICU_PATH : $ICU_PREFIX"
602-
display_message "-sICU_LINK : ${ICU_LIBS[@]}"
603+
display_message "-sICU_LINK : " "${ICU_LIBS[*]}"
603604
display_message "-sZLIB_LIBPATH : $PREFIX/lib"
604605
display_message "-sZLIB_INCLUDE : $PREFIX/include"
605606
display_message "-j : $JOBS"
606607
display_message "-d0 : [supress informational messages]"
607608
display_message "-q : [stop at the first error]"
608609
display_message "--reconfigure : [ignore cached configuration]"
609610
display_message "--prefix : $PREFIX"
610-
display_message "BOOST_OPTIONS : $@"
611+
display_message "BOOST_OPTIONS : $*"
611612
display_message "--------------------------------------------------------------------"
612613

613614
# boost_iostreams
@@ -631,7 +632,7 @@ build_from_tarball_boost()
631632
"boost.locale.posix=$BOOST_ICU_POSIX" \
632633
"-sNO_BZIP2=1" \
633634
"-sICU_PATH=$ICU_PREFIX" \
634-
"-sICU_LINK=${ICU_LIBS[@]}" \
635+
"-sICU_LINK=${ICU_LIBS[*]}" \
635636
"-sZLIB_LIBPATH=$PREFIX/lib" \
636637
"-sZLIB_INCLUDE=$PREFIX/include" \
637638
"-j $JOBS" \
@@ -643,6 +644,8 @@ build_from_tarball_boost()
643644

644645
pop_directory
645646
pop_directory
647+
648+
IFS="$SAVE_IFS"
646649
}
647650

648651
# Standard build from github.
@@ -661,14 +664,14 @@ build_from_github()
661664
display_heading_message "Download $FORK/$BRANCH"
662665

663666
# Clone the repository locally.
664-
git clone --depth 1 --branch $BRANCH --single-branch "https://github.com/$FORK"
667+
git clone --depth 1 --branch "$BRANCH" --single-branch "https://github.com/$FORK"
665668

666669
# Join generated and command line options.
667670
local CONFIGURATION=("${OPTIONS[@]}" "$@")
668671

669672
# Build the local repository clone.
670673
push_directory "$REPO"
671-
make_current_directory $JOBS "${CONFIGURATION[@]}"
674+
make_current_directory "$JOBS" "${CONFIGURATION[@]}"
672675
pop_directory
673676
pop_directory
674677
}
@@ -687,7 +690,7 @@ build_from_local()
687690
local CONFIGURATION=("${OPTIONS[@]}" "$@")
688691

689692
# Build the current directory.
690-
make_current_directory $JOBS "${CONFIGURATION[@]}"
693+
make_current_directory "$JOBS" "${CONFIGURATION[@]}"
691694
}
692695

693696
# Because Travis alread has downloaded the primary repo.
@@ -702,13 +705,13 @@ build_from_travis()
702705

703706
# The primary build is not downloaded if we are running in Travis.
704707
if [[ $TRAVIS == true ]]; then
705-
build_from_local "Local $TRAVIS_REPO_SLUG" $JOBS "${OPTIONS[@]}" "$@"
706-
make_tests $JOBS
708+
build_from_local "Local $TRAVIS_REPO_SLUG" "$JOBS" "${OPTIONS[@]}" "$@"
709+
make_tests "$JOBS"
707710
else
708-
build_from_github $ACCOUNT $REPO $BRANCH $JOBS "${OPTIONS[@]}" "$@"
711+
build_from_github "$ACCOUNT" "$REPO" "$BRANCH" "$JOBS" "${OPTIONS[@]}" "$@"
709712
push_directory "$BUILD_DIR"
710713
push_directory "$REPO"
711-
make_tests $JOBS
714+
make_tests "$JOBS"
712715
pop_directory
713716
pop_directory
714717
fi
@@ -719,12 +722,12 @@ build_from_travis()
719722
#==============================================================================
720723
build_all()
721724
{
722-
build_from_tarball_boost $BOOST_URL $BOOST_ARCHIVE bzip2 . $PARALLEL "$BUILD_BOOST" "${BOOST_OPTIONS[@]}"
723-
build_from_tarball $ZMQ_URL $ZMQ_ARCHIVE gzip . $PARALLEL "$BUILD_ZMQ" "${ZMQ_OPTIONS[@]}" "$@"
724-
build_from_tarball $MBEDTLS_URL $MBEDTLS_ARCHIVE gzip . $PARALLEL "$BUILD_MBEDTLS" "${MBEDTLS_OPTIONS[@]}" "$@"
725-
build_from_github libbitcoin secp256k1 version5 $PARALLEL ${SECP256K1_OPTIONS[@]} "$@"
726-
build_from_github libbitcoin libbitcoin-system master $PARALLEL ${BITCOIN_SYSTEM_OPTIONS[@]} "$@"
727-
build_from_travis libbitcoin libbitcoin-protocol master $PARALLEL ${BITCOIN_PROTOCOL_OPTIONS[@]} "$@"
725+
build_from_tarball_boost "$BOOST_URL" "$BOOST_ARCHIVE" bzip2 . "$PARALLEL" "$BUILD_BOOST" "${BOOST_OPTIONS[@]}"
726+
build_from_tarball "$ZMQ_URL" "$ZMQ_ARCHIVE" gzip . "$PARALLEL" "$BUILD_ZMQ" "${ZMQ_OPTIONS[@]}" "$@"
727+
build_from_tarball "$MBEDTLS_URL" "$MBEDTLS_ARCHIVE" gzip . "$PARALLEL" "$BUILD_MBEDTLS" "${MBEDTLS_OPTIONS[@]}" "$@"
728+
build_from_github libbitcoin secp256k1 version5 "$PARALLEL" "${SECP256K1_OPTIONS[@]}" "$@"
729+
build_from_github libbitcoin libbitcoin-system master "$PARALLEL" "${BITCOIN_SYSTEM_OPTIONS[@]}" "$@"
730+
build_from_travis libbitcoin libbitcoin-protocol master "$PARALLEL" "${BITCOIN_PROTOCOL_OPTIONS[@]}" "$@"
728731
}
729732

730733

0 commit comments

Comments
 (0)