@@ -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
229232done
230233
@@ -274,36 +277,74 @@ if [[ $BUILD_BOOST ]]; then
274277 with_boost=" --with-boost=$PREFIX "
275278fi
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-server."
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# ==============================================================================
@@ -747,8 +788,13 @@ build_all()
747788
748789# Build the primary library and all dependencies.
749790# ==============================================================================
750- create_directory " $BUILD_DIR "
751- push_directory " $BUILD_DIR "
752- initialize_git
753- pop_directory
754- time build_all " ${CONFIGURE_OPTIONS[@]} "
791+ if [[ $DISPLAY_HELP ]]; then
792+ display_install_help
793+ else
794+ display_configuration
795+ create_directory " $BUILD_DIR "
796+ push_directory " $BUILD_DIR "
797+ initialize_git
798+ pop_directory
799+ time build_all " ${CONFIGURE_OPTIONS[@]} "
800+ fi
0 commit comments