Skip to content

Commit cd2fc1c

Browse files
committed
Regenerate install.sh with --help option.
1 parent 08c9f8c commit cd2fc1c

File tree

1 file changed

+81
-35
lines changed

1 file changed

+81
-35
lines changed

install.sh

Lines changed: 81 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ for OPTION in "$@"; do
225225
(--with-icu) WITH_ICU="yes";;
226226
(--with-png) WITH_PNG="yes";;
227227
(--with-qrencode) WITH_QRENCODE="yes";;
228+
229+
# Standard script options.
230+
(--help) DISPLAY_HELP="yes";;
228231
esac
229232
done
230233

@@ -274,36 +277,74 @@ if [[ $BUILD_BOOST ]]; then
274277
with_boost="--with-boost=$PREFIX"
275278
fi
276279

277-
# Echo generated values.
278-
#------------------------------------------------------------------------------
279-
display_message "Libbitcoin installer configuration."
280-
display_message "--------------------------------------------------------------------"
281-
display_message "OS : $OS"
282-
display_message "PARALLEL : $PARALLEL"
283-
display_message "CC : $CC"
284-
display_message "CXX : $CXX"
285-
display_message "CPPFLAGS : $CPPFLAGS"
286-
display_message "CFLAGS : $CFLAGS"
287-
display_message "CXXFLAGS : $CXXFLAGS"
288-
display_message "LDFLAGS : $LDFLAGS"
289-
display_message "LDLIBS : $LDLIBS"
290-
display_message "WITH_ICU : $WITH_ICU"
291-
display_message "WITH_PNG : $WITH_PNG"
292-
display_message "WITH_QRENCODE : $WITH_QRENCODE"
293-
display_message "BUILD_ICU : $BUILD_ICU"
294-
display_message "BUILD_ZLIB : $BUILD_ZLIB"
295-
display_message "BUILD_PNG : $BUILD_PNG"
296-
display_message "BUILD_QRENCODE : $BUILD_QRENCODE"
297-
display_message "BUILD_ZMQ : $BUILD_ZMQ"
298-
display_message "BUILD_BOOST : $BUILD_BOOST"
299-
display_message "PREFIX : $PREFIX"
300-
display_message "BUILD_DIR : $BUILD_DIR"
301-
display_message "DISABLE_SHARED : $DISABLE_SHARED"
302-
display_message "DISABLE_STATIC : $DISABLE_STATIC"
303-
display_message "with_boost : ${with_boost}"
304-
display_message "with_pkgconfigdir : ${with_pkgconfigdir}"
305-
display_message "--------------------------------------------------------------------"
306-
280+
display_configuration()
281+
{
282+
display_message "Libbitcoin installer configuration."
283+
display_message "--------------------------------------------------------------------"
284+
display_message "OS : $OS"
285+
display_message "PARALLEL : $PARALLEL"
286+
display_message "CC : $CC"
287+
display_message "CXX : $CXX"
288+
display_message "CPPFLAGS : $CPPFLAGS"
289+
display_message "CFLAGS : $CFLAGS"
290+
display_message "CXXFLAGS : $CXXFLAGS"
291+
display_message "LDFLAGS : $LDFLAGS"
292+
display_message "LDLIBS : $LDLIBS"
293+
display_message "WITH_ICU : $WITH_ICU"
294+
display_message "WITH_PNG : $WITH_PNG"
295+
display_message "WITH_QRENCODE : $WITH_QRENCODE"
296+
display_message "BUILD_ICU : $BUILD_ICU"
297+
display_message "BUILD_ZLIB : $BUILD_ZLIB"
298+
display_message "BUILD_PNG : $BUILD_PNG"
299+
display_message "BUILD_QRENCODE : $BUILD_QRENCODE"
300+
display_message "BUILD_ZMQ : $BUILD_ZMQ"
301+
display_message "BUILD_BOOST : $BUILD_BOOST"
302+
display_message "PREFIX : $PREFIX"
303+
display_message "BUILD_DIR : $BUILD_DIR"
304+
display_message "DISABLE_SHARED : $DISABLE_SHARED"
305+
display_message "DISABLE_STATIC : $DISABLE_STATIC"
306+
display_message "with_boost : ${with_boost}"
307+
display_message "with_pkgconfigdir : ${with_pkgconfigdir}"
308+
display_message "--------------------------------------------------------------------"
309+
}
310+
display_install_help()
311+
{
312+
display_message "Usage: ./install.sh [OPTION]..."
313+
display_message "Manage the installation of libbitcoin-protocol."
314+
display_message "Script options:"
315+
display_message " --with-icu Compile with International Components for Unicode."
316+
display_message " Since the addition of BIP-39 and later BIP-38 "
317+
display_message " support, libbitcoin conditionally incorporates ICU "
318+
display_message " to provide BIP-38 and BIP-39 passphrase "
319+
display_message " normalization features. Currently "
320+
display_message " libbitcoin-explorer is the only other library that "
321+
display_message " accesses this feature, so if you do not intend to "
322+
display_message " use passphrase normalization this dependency can "
323+
display_message " be avoided."
324+
display_message " --with-qrencode Compile with QR Code Support"
325+
display_message " Since the addition of qrcode support, libbitcoin "
326+
display_message " conditionally incorporates qrencode. Currently "
327+
display_message " libbitcoin-explorer is the only other library that "
328+
display_message " accesses this feature, so if you do not intend to "
329+
display_message " use qrcode this dependency can be avoided."
330+
display_message " --with-png Compile with QR Code PNG Output Support"
331+
display_message " Since the addition of png support, libbitcoin "
332+
display_message " conditionally incorporates libpng (which in turn "
333+
display_message " requires zlib). Currently libbitcoin-explorer is "
334+
display_message " the only other library that accesses this feature, "
335+
display_message " so if you do not intend to use png this dependency "
336+
display_message " can be avoided."
337+
display_message " --build-boost Builds Boost libraries."
338+
display_message " --build-zmq Build ZeroMQ libraries."
339+
display_message " --build-dir=<path> Location of downloaded and intermediate files."
340+
display_message " --prefix=<absolute-path> Library install location (defaults to /usr/local)."
341+
display_message " --disable-shared Disables shared library builds."
342+
display_message " --disable-static Disables static library builds."
343+
display_message " --help Display usage, overriding script execution."
344+
display_message ""
345+
display_message "All unrecognized options provided shall be passed as configuration options for "
346+
display_message "all dependencies."
347+
}
307348

308349
# Define build options.
309350
#==============================================================================
@@ -695,8 +736,13 @@ build_all()
695736

696737
# Build the primary library and all dependencies.
697738
#==============================================================================
698-
create_directory "$BUILD_DIR"
699-
push_directory "$BUILD_DIR"
700-
initialize_git
701-
pop_directory
702-
time build_all "${CONFIGURE_OPTIONS[@]}"
739+
if [[ $DISPLAY_HELP ]]; then
740+
display_install_help
741+
else
742+
display_configuration
743+
create_directory "$BUILD_DIR"
744+
push_directory "$BUILD_DIR"
745+
initialize_git
746+
pop_directory
747+
time build_all "${CONFIGURE_OPTIONS[@]}"
748+
fi

0 commit comments

Comments
 (0)