From 1b17dde9d17e4ba9a3bfa529f3237af50d8f7606 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Fri, 1 Apr 2016 19:29:07 -0700 Subject: [PATCH 1/3] Installer fixes and updates. --- .travis.yml | 9 +- configure.ac | 6 +- install.sh | 678 +++++++++++++++++------------- libbitcoin_network_test_runner.sh | 2 +- 4 files changed, 387 insertions(+), 308 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8aa0167e9..e44e1d32b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,17 +58,14 @@ install: - if [[ $LINUX && $CLANG ]]; then sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.4 50; fi - if [[ $LINUX && $CLANG ]]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.4 50; fi - # Download and install packages for linux/clang/dynamic. - - if [[ $LINUX && $CLANG && $DYNAMIC ]]; then sudo apt-get -qq install boost1.54; fi - script: # Download and build libbitcoin-network and all dependencies. - if [[ $OSX && $CLANG && $STATIC ]]; then ./install.sh --disable-shared --build-boost --prefix=$TRAVIS_BUILD_DIR/my-prefix; fi - - if [[ $LINUX && $CLANG && $STATIC ]]; then ./install.sh --disable-shared --build-boost --prefix=$TRAVIS_BUILD_DIR/my-prefix CFLAGS='-Os' LDLIBS='-lstdc++' CXXFLAGS='-Os -stdlib=libstdc++'; fi - - if [[ $LINUX && $GCC && $STATIC ]]; then ./install.sh --build-boost --disable-shared --build-dir=my-build --prefix=$TRAVIS_BUILD_DIR/my-prefix CFLAGS='-O0 -g -static --coverage' CXXFLAGS='-O0 -g -static --coverage'; fi + - if [[ $LINUX && $CLANG && $STATIC ]]; then ./install.sh --disable-shared --build-boost --prefix=$TRAVIS_BUILD_DIR/my-prefix CFLAGS='-Os' CXXFLAGS='-Os'; fi + - if [[ $LINUX && $GCC && $STATIC ]]; then ./install.sh --build-boost --disable-shared --build-dir=my-build --prefix=$TRAVIS_BUILD_DIR/my-prefix CFLAGS='-O0 -g --coverage' CXXFLAGS='-O0 -g --coverage'; fi - if [[ $OSX && $CLANG && $DYNAMIC ]]; then ./install.sh ; fi - - if [[ $LINUX && $CLANG && $DYNAMIC ]]; then sudo CXX=$CXX CC=$CC ./install.sh --disable-ndebug --disable-static CFLAGS='-Os' LDLIBS='-lstdc++' CXXFLAGS='-Os -stdlib=libstdc++'; fi + - if [[ $LINUX && $CLANG && $DYNAMIC ]]; then sudo CXX=$CXX CC=$CC ./install.sh --disable-ndebug --disable-static CFLAGS='-Os' CXXFLAGS='-Os'; fi - if [[ $LINUX && $GCC && $DYNAMIC ]]; then sudo CXX=$CXX CC=$CC ./install.sh --disable-static --build-boost CFLAGS='-Os -s' CXXFLAGS='-Os -s'; fi after_success: diff --git a/configure.ac b/configure.ac index bc5b4bac2..fc58163f6 100644 --- a/configure.ac +++ b/configure.ac @@ -116,15 +116,15 @@ AS_CASE([${CC}], [*gcc*], AC_MSG_NOTICE([boost_LDFLAGS : ${boost_LDFLAGS}])], [AC_MSG_ERROR([Boost 1.55.0 or later is required but was not found.])])]) -# Require Boost of at least version 1.54.0 if in clang and output ${boost_CPPFLAGS/LDFLAGS}. +# Require Boost of at least version 1.56.0 if in clang and output ${boost_CPPFLAGS/LDFLAGS}. #------------------------------------------------------------------------------ AS_CASE([${CC}], [*clang*], - [AX_BOOST_BASE([1.54.0], + [AX_BOOST_BASE([1.56.0], [AC_SUBST([boost_CPPFLAGS], [${BOOST_CPPFLAGS}]) AC_SUBST([boost_LDFLAGS], [${BOOST_LDFLAGS}]) AC_MSG_NOTICE([boost_CPPFLAGS : ${boost_CPPFLAGS}]) AC_MSG_NOTICE([boost_LDFLAGS : ${boost_LDFLAGS}])], - [AC_MSG_ERROR([Boost 1.54.0 or later is required but was not found.])])]) + [AC_MSG_ERROR([Boost 1.56.0 or later is required but was not found.])])]) AS_CASE([${with_tests}], [yes], [AX_BOOST_UNIT_TEST_FRAMEWORK diff --git a/install.sh b/install.sh index 26fe73aae..d0c619176 100755 --- a/install.sh +++ b/install.sh @@ -24,31 +24,16 @@ # Depending on the caller's permission to the --prefix or --build-dir # directory, the script may need to be sudo'd. -# Define common constants. +# Define constants. #============================================================================== # The default build directory. #------------------------------------------------------------------------------ BUILD_DIR="build-libbitcoin-network" -# Boost archive for gcc. +# Boost archive. #------------------------------------------------------------------------------ -BOOST_URL_GCC="http://github.com/libbitcoin/libbitcoin-build/blob/master/mirror/boost_1_55_0.tar.bz2?raw=true" -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://github.com/libbitcoin/libbitcoin-build/blob/master/mirror/boost_1_54_0.tar.bz2?raw=true" -BOOST_ARCHIVE_CLANG="boost_1_54_0.tar.bz2" -BOOST_STANDARD_CLANG=\ -"threading=multi "\ -"variant=release "\ -"-d0 "\ -"-q" +BOOST_URL="http://downloads.sourceforge.net/project/boost/boost/1.56.0/boost_1_56_0.tar.bz2" +BOOST_ARCHIVE="boost_1_56_0.tar.bz2" # Initialize the build environment. @@ -73,37 +58,27 @@ 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" + STDLIB="c++" elif [[ $OS == OpenBSD ]]; then make() { gmake "$@"; } export CC="egcc" export CXX="eg++" - LIBC="libestdc++" -else - LIBC="libstdc++" + STDLIB="estdc++" +else # Linux + STDLIB="stdc++" fi -echo "Make with cc: $CC" -echo "Make with cxx: $CXX" -echo "Make with stdlib: $LIBC" -# Define compiler specific settings. +# Link to appropriate standard library in non-default scnearios. #------------------------------------------------------------------------------ -COMPILER="GCC" -if [[ $CXX == "clang++" ]]; then - BOOST_TOOLS="toolset=clang cxxflags=-stdlib=$LIBC linkflags=-stdlib=$LIBC" - COMPILER="CLANG" +if [[ ($OS == Linux && $CC == "clang") || ($OS == OpenBSD) ]]; then + export LDLIBS="-l$STDLIB $LDLIBS" + export CXXFLAGS="-stdlib=lib$STDLIB $CXXFLAGS" fi # Parse command line options that are handled by this script. @@ -112,11 +87,12 @@ for OPTION in "$@"; do case $OPTION in # Custom build options (in the form of --build-