#!/bin/bash ############################################################################### # Copyright (c) 2014-2015 libbitcoin-explorer developers (see COPYING). # # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # ############################################################################### # Script to build and install libbitcoin-explorer. # # Script options: # --build-icu Builds ICU libraries. # --build-boost Builds Boost libraries. # --build-dir= Location of downloaded and intermediate files. # --prefix= Library install location (defaults to /usr/local). # --disable-shared Disables shared library builds. # --disable-static Disables static library builds. # # Verified on Ubuntu 14.04, requires gcc-4.8 or newer. # Verified on OSX 10.10, using MacPorts and Homebrew repositories, requires # Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) or newer. # This script does not like spaces in the --prefix or --build-dir, sorry. # Values (e.g. yes|no) in the '--disable-' options are not supported. # All command line options are passed to 'configure' of each repo, with # the exception of the --build- options, which are for the script only. # Depending on the caller's permission to the --prefix or --build-dir # directory, the script may need to be sudo'd. # Define common constants. #============================================================================== # The default build directory. #------------------------------------------------------------------------------ BUILD_DIR="build-libbitcoin-explorer" # ICU archive. #------------------------------------------------------------------------------ ICU_URL="http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-src.tgz" ICU_ARCHIVE="icu4c-55_1-src.tgz" ICU_STANDARD=\ "CXXFLAGS=-std=c++0x" # Boost archive for gcc. #------------------------------------------------------------------------------ BOOST_URL_GCC="http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2/download" BOOST_ARCHIVE_GCC="boost_1_55_0.tar.bz2" BOOST_STANDARD_GCC=\ "threading=multi "\ "variant=release "\ "-d0 "\ "-q" # Boost archive for clang. #------------------------------------------------------------------------------ BOOST_URL_CLANG="http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.bz2/download" BOOST_ARCHIVE_CLANG="boost_1_54_0.tar.bz2" BOOST_STANDARD_CLANG=\ "threading=multi "\ "variant=release "\ "-d0 "\ "-q" # Initialize the build environment. #============================================================================== # Exit this script on the first build error. #------------------------------------------------------------------------------ set -e # Configure build parallelism. #------------------------------------------------------------------------------ SEQUENTIAL=1 OS=`uname -s` if [[ $TRAVIS == true ]]; then PARALLEL=$SEQUENTIAL elif [[ $OS == Linux ]]; then PARALLEL=`nproc` elif [[ $OS == Darwin ]]; then PARALLEL=2 #TODO else echo "Unsupported system: $OS" exit 1 fi echo "Make jobs: $PARALLEL" echo "Make for system: $OS" # Define operating system specific settings. #------------------------------------------------------------------------------ if [[ $OS == Darwin ]]; then # Always require clang, common lib linking will otherwise fail. export CC="clang" export CXX="clang++" LIBC="libc++" # Always initialize prefix on OSX so default is useful. PREFIX="/usr/local" else LIBC="libstdc++" fi echo "Make with cc: $CC" echo "Make with cxx: $CXX" # Define compiler specific settings. #------------------------------------------------------------------------------ COMPILER="GCC" if [[ $CXX == "clang++" ]]; then BOOST_TOOLS="toolset=clang cxxflags=-stdlib=$LIBC linkflags=-stdlib=$LIBC" COMPILER="CLANG" fi # Parse command line options that are handled by this script. #------------------------------------------------------------------------------ for OPTION in "$@"; do case $OPTION in # Custom build options (in the form of --build-