@@ -219,6 +219,9 @@ for OPTION in "$@"; do
219219 (--with-icu) WITH_ICU=" yes" ;;
220220 (--with-png) WITH_PNG=" yes" ;;
221221 (--with-qrencode) WITH_QRENCODE=" yes" ;;
222+
223+ # Standard script options.
224+ (--help) DISPLAY_HELP=" yes" ;;
222225 esac
223226done
224227
@@ -268,36 +271,73 @@ if [[ $BUILD_BOOST ]]; then
268271 with_boost=" --with-boost=$PREFIX "
269272fi
270273
271- # Echo generated values.
272- # ------------------------------------------------------------------------------
273- display_message " Libbitcoin installer configuration."
274- display_message " --------------------------------------------------------------------"
275- display_message " OS : $OS "
276- display_message " PARALLEL : $PARALLEL "
277- display_message " CC : $CC "
278- display_message " CXX : $CXX "
279- display_message " CPPFLAGS : $CPPFLAGS "
280- display_message " CFLAGS : $CFLAGS "
281- display_message " CXXFLAGS : $CXXFLAGS "
282- display_message " LDFLAGS : $LDFLAGS "
283- display_message " LDLIBS : $LDLIBS "
284- display_message " WITH_ICU : $WITH_ICU "
285- display_message " WITH_PNG : $WITH_PNG "
286- display_message " WITH_QRENCODE : $WITH_QRENCODE "
287- display_message " BUILD_ICU : $BUILD_ICU "
288- display_message " BUILD_ZLIB : $BUILD_ZLIB "
289- display_message " BUILD_PNG : $BUILD_PNG "
290- display_message " BUILD_QRENCODE : $BUILD_QRENCODE "
291- display_message " BUILD_ZMQ : $BUILD_ZMQ "
292- display_message " BUILD_BOOST : $BUILD_BOOST "
293- display_message " PREFIX : $PREFIX "
294- display_message " BUILD_DIR : $BUILD_DIR "
295- display_message " DISABLE_SHARED : $DISABLE_SHARED "
296- display_message " DISABLE_STATIC : $DISABLE_STATIC "
297- display_message " with_boost : ${with_boost} "
298- display_message " with_pkgconfigdir : ${with_pkgconfigdir} "
299- display_message " --------------------------------------------------------------------"
300-
274+ display_configuration ()
275+ {
276+ display_message " Libbitcoin installer configuration."
277+ display_message " --------------------------------------------------------------------"
278+ display_message " OS : $OS "
279+ display_message " PARALLEL : $PARALLEL "
280+ display_message " CC : $CC "
281+ display_message " CXX : $CXX "
282+ display_message " CPPFLAGS : $CPPFLAGS "
283+ display_message " CFLAGS : $CFLAGS "
284+ display_message " CXXFLAGS : $CXXFLAGS "
285+ display_message " LDFLAGS : $LDFLAGS "
286+ display_message " LDLIBS : $LDLIBS "
287+ display_message " WITH_ICU : $WITH_ICU "
288+ display_message " WITH_PNG : $WITH_PNG "
289+ display_message " WITH_QRENCODE : $WITH_QRENCODE "
290+ display_message " BUILD_ICU : $BUILD_ICU "
291+ display_message " BUILD_ZLIB : $BUILD_ZLIB "
292+ display_message " BUILD_PNG : $BUILD_PNG "
293+ display_message " BUILD_QRENCODE : $BUILD_QRENCODE "
294+ display_message " BUILD_ZMQ : $BUILD_ZMQ "
295+ display_message " BUILD_BOOST : $BUILD_BOOST "
296+ display_message " PREFIX : $PREFIX "
297+ display_message " BUILD_DIR : $BUILD_DIR "
298+ display_message " DISABLE_SHARED : $DISABLE_SHARED "
299+ display_message " DISABLE_STATIC : $DISABLE_STATIC "
300+ display_message " with_boost : ${with_boost} "
301+ display_message " with_pkgconfigdir : ${with_pkgconfigdir} "
302+ display_message " --------------------------------------------------------------------"
303+ }
304+ display_install_help ()
305+ {
306+ display_message " Usage: ./install.sh [OPTION]..."
307+ display_message " Manage the installation of libbitcoin-node."
308+ display_message " Script options:"
309+ display_message " --with-icu Compile with International Components for Unicode."
310+ display_message " Since the addition of BIP-39 and later BIP-38 "
311+ display_message " support, libbitcoin conditionally incorporates ICU "
312+ display_message " to provide BIP-38 and BIP-39 passphrase "
313+ display_message " normalization features. Currently "
314+ display_message " libbitcoin-explorer is the only other library that "
315+ display_message " accesses this feature, so if you do not intend to "
316+ display_message " use passphrase normalization this dependency can "
317+ display_message " be avoided."
318+ display_message " --with-qrencode Compile with QR Code Support"
319+ display_message " Since the addition of qrcode support, libbitcoin "
320+ display_message " conditionally incorporates qrencode. Currently "
321+ display_message " libbitcoin-explorer is the only other library that "
322+ display_message " accesses this feature, so if you do not intend to "
323+ display_message " use qrcode this dependency can be avoided."
324+ display_message " --with-png Compile with QR Code PNG Output Support"
325+ display_message " Since the addition of png support, libbitcoin "
326+ display_message " conditionally incorporates libpng (which in turn "
327+ display_message " requires zlib). Currently libbitcoin-explorer is "
328+ display_message " the only other library that accesses this feature, "
329+ display_message " so if you do not intend to use png this dependency "
330+ display_message " can be avoided."
331+ display_message " --build-boost Builds Boost libraries."
332+ display_message " --build-dir=<path> Location of downloaded and intermediate files."
333+ display_message " --prefix=<absolute-path> Library install location (defaults to /usr/local)."
334+ display_message " --disable-shared Disables shared library builds."
335+ display_message " --disable-static Disables static library builds."
336+ display_message " --help Display usage, overriding script execution."
337+ display_message " "
338+ display_message " All unrecognized options provided shall be passed as configuration options for "
339+ display_message " all dependencies."
340+ }
301341
302342# Define build options.
303343# ==============================================================================
@@ -722,8 +762,13 @@ build_all()
722762
723763# Build the primary library and all dependencies.
724764# ==============================================================================
725- create_directory " $BUILD_DIR "
726- push_directory " $BUILD_DIR "
727- initialize_git
728- pop_directory
729- time build_all " ${CONFIGURE_OPTIONS[@]} "
765+ if [[ $DISPLAY_HELP ]]; then
766+ display_install_help
767+ else
768+ display_configuration
769+ create_directory " $BUILD_DIR "
770+ push_directory " $BUILD_DIR "
771+ initialize_git
772+ pop_directory
773+ time build_all " ${CONFIGURE_OPTIONS[@]} "
774+ fi
0 commit comments