From 388c4d996895e06ef1738dbbf37466f999de7ff5 Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Tue, 6 Dec 2016 17:21:35 +0000 Subject: [PATCH 1/9] Fixed a bug that can occur during KAT unit testing if the user decides to override CXXFLAGS. Ensured a missing image gets packaged with the documentation. --- doc/Makefile | 1 + doc/Makefile.in | 1 + tests/Makefile.am | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 5d22d49e..d6d3c7fd 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -66,6 +66,7 @@ DISTFILES = $(DPS)/index.rst \ $(DPI)/kmer_spectra1.png \ $(DPI)/kmer_spectra_breakdown.png \ $(DPI)/pe_v_asm_clean.png \ + $(DPI)/pe_v_asm_wrong.png \ $(DPI)/pe_v_mp_after_density.png \ $(DPI)/pe_v_mp_after_shared.png \ $(DPI)/pe_v_mp_before_density.png \ diff --git a/doc/Makefile.in b/doc/Makefile.in index b5321986..b1a61d5b 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -66,6 +66,7 @@ DISTFILES = $(DPS)/index.rst \ $(DPI)/kmer_spectra1.png \ $(DPI)/kmer_spectra_breakdown.png \ $(DPI)/pe_v_asm_clean.png \ + $(DPI)/pe_v_asm_wrong.png \ $(DPI)/pe_v_mp_after_density.png \ $(DPI)/pe_v_mp_after_shared.png \ $(DPI)/pe_v_mp_before_density.png \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 1e1619cf..ba1b9113 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -21,8 +21,8 @@ clean-local-check: -rm -rf temp # additional include paths necessary to compile the C++ library -CXXFLAGS=-g -O0 -fwrapv -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-sign-compare -std=c++11 @AM_CXXFLAGS@ -CPPFLAGS = -isystem $(top_srcdir)/deps/seqan-library-2.0.0/include \ +AM_CXXFLAGS=-g -O0 -fwrapv -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-missing-field-initializers -Wno-sign-compare -std=c++11 @AM_CXXFLAGS@ +AM_CPPFLAGS = -isystem $(top_srcdir)/deps/seqan-library-2.0.0/include \ -isystem $(top_srcdir)/deps/jellyfish-2.2.0/include \ -isystem $(top_srcdir)/lib/include \ -DDATADIR=\"$(srcdir)/data\" \ From 3c2a7f2e6612930479ba68700b8b4991270f7e34 Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Thu, 8 Dec 2016 08:52:06 +0000 Subject: [PATCH 2/9] If not all static boost libs are found we revert to using dynamic libs. Also updating travis config to try and fix the linking issues that are happening there. --- .travis/.gitignore | 1 + .travis/before_install.sh | 13 +++++++------ configure.ac | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 .travis/.gitignore diff --git a/.travis/.gitignore b/.travis/.gitignore new file mode 100644 index 00000000..d3957307 --- /dev/null +++ b/.travis/.gitignore @@ -0,0 +1 @@ +/.install.sh.swp diff --git a/.travis/before_install.sh b/.travis/before_install.sh index a2fdd255..a3cf19ac 100755 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -5,14 +5,15 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then else sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -qq + sudo apt-get install -qq libc6-dev if [ "$COMPILER" == "GCC5" ]; then - sudo apt-get install -qq g++-5 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100 - export CXX="g++-5" - export CC="gcc-5" + sudo apt-get install -qq gcc-5.3 g++-5.3 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5.3 100 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5.3 100 + export CXX="g++-5.3" + export CC="gcc-5.3" else - sudo apt-get install -qq g++-4.9 + sudo apt-get install -qq gcc-4.9 g++-4.9 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 100 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 100 export CXX="g++-4.9" diff --git a/configure.ac b/configure.ac index 0d1c9eb9..9278be8f 100644 --- a/configure.ac +++ b/configure.ac @@ -154,20 +154,32 @@ define([PC_FILE], lib/kat-2.2.pc) # Combine BOOST variables (apart for BOOST_TEST) -BOOST_LIBS="${BOOST_FILESYSTEM_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} ${BOOST_SYSTEM_LIB} ${BOOST_TIMER_LIB}" +BOOST_DYN_LIBS="${BOOST_TIMER_LIB} ${BOOST_CHRONO_LIB} ${RT_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} ${BOOST_SYSTEM_LIB}" +AC_SUBST([BOOST_DYN_LIBS]) + BOOST_STATIC_LIBS="${BOOST_TIMER_STATIC_LIB} ${BOOST_CHRONO_STATIC_LIB} ${RT_LIB} ${BOOST_FILESYSTEM_STATIC_LIB} ${BOOST_PROGRAM_OPTIONS_STATIC_LIB} ${BOOST_SYSTEM_STATIC_LIB} " AC_SUBST([BOOST_STATIC_LIBS]) +# Prefer static linking of boost. If one or more static libs are not present +# (this happens with some default boost installations on some environments) then +# use dynamic libs instead. +if [[ -z "${BOOST_TIMER_STATIC_LIB}" ]] || [[ -z "${BOOST_CHRONO_STATIC_LIB}" ]] || [[ -z "${BOOST_FILESYSTEM_STATIC_LIB}" ]] || [[ -z "${BOOST_PROGRAM_OPTIONS_STATIC_LIB}" ]] || [[ -z "${BOOST_SYSTEM_STATIC_LIB}" ]]; then + BOOST_LIBS="${BOOST_DYN_LIBS}" +else + BOOST_LIBS="${BOOST_STATIC_LIBS}" +fi +AC_SUBST([BOOST_LIBS]) + AM_CXXFLAGS="-DCPLUSPLUS" AC_SUBST([AM_CXXFLAGS]) if [[ "${pymod_good}" == "yes" ]]; then AM_CPPFLAGS="${BOOST_CPPFLAGS} ${PYTHON_CPPFLAGS}" - AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_STATIC_LIBS} ${PYTHON_EXTRA_LIBS} ${PYTHON_LIBS}" + AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS} ${PYTHON_EXTRA_LIBS} ${PYTHON_LIBS}" AM_LDFLAGS="${BOOST_LDFLAGS} ${PYTHON_EXTRA_LDFLAGS}" else AM_CPPFLAGS="${BOOST_CPPFLAGS}" - AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_STATIC_LIBS}" + AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS}" AM_LDFLAGS="${BOOST_LDFLAGS}" fi From 406d7fa866b4edc06bf1f611b561c49d491c43dc Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Thu, 8 Dec 2016 08:59:43 +0000 Subject: [PATCH 3/9] Moving rt dependency out of boost variable group so it's on its own now. Fixed an issue I just introduced with travis gcc5 option. --- .travis/before_install.sh | 10 +++++----- configure.ac | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis/before_install.sh b/.travis/before_install.sh index a3cf19ac..817612ef 100755 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -7,11 +7,11 @@ else sudo apt-get update -qq sudo apt-get install -qq libc6-dev if [ "$COMPILER" == "GCC5" ]; then - sudo apt-get install -qq gcc-5.3 g++-5.3 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5.3 100 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5.3 100 - export CXX="g++-5.3" - export CC="gcc-5.3" + sudo apt-get install -qq gcc-5 g++-5 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100 + export CXX="g++-5" + export CC="gcc-5" else sudo apt-get install -qq gcc-4.9 g++-4.9 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 100 diff --git a/configure.ac b/configure.ac index 9278be8f..126b06ed 100644 --- a/configure.ac +++ b/configure.ac @@ -154,10 +154,10 @@ define([PC_FILE], lib/kat-2.2.pc) # Combine BOOST variables (apart for BOOST_TEST) -BOOST_DYN_LIBS="${BOOST_TIMER_LIB} ${BOOST_CHRONO_LIB} ${RT_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} ${BOOST_SYSTEM_LIB}" +BOOST_DYN_LIBS="${BOOST_TIMER_LIB} ${BOOST_CHRONO_LIB} ${BOOST_FILESYSTEM_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} ${BOOST_SYSTEM_LIB}" AC_SUBST([BOOST_DYN_LIBS]) -BOOST_STATIC_LIBS="${BOOST_TIMER_STATIC_LIB} ${BOOST_CHRONO_STATIC_LIB} ${RT_LIB} ${BOOST_FILESYSTEM_STATIC_LIB} ${BOOST_PROGRAM_OPTIONS_STATIC_LIB} ${BOOST_SYSTEM_STATIC_LIB} " +BOOST_STATIC_LIBS="${BOOST_TIMER_STATIC_LIB} ${BOOST_CHRONO_STATIC_LIB} ${BOOST_FILESYSTEM_STATIC_LIB} ${BOOST_PROGRAM_OPTIONS_STATIC_LIB} ${BOOST_SYSTEM_STATIC_LIB} " AC_SUBST([BOOST_STATIC_LIBS]) # Prefer static linking of boost. If one or more static libs are not present @@ -175,11 +175,11 @@ AC_SUBST([AM_CXXFLAGS]) if [[ "${pymod_good}" == "yes" ]]; then AM_CPPFLAGS="${BOOST_CPPFLAGS} ${PYTHON_CPPFLAGS}" - AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS} ${PYTHON_EXTRA_LIBS} ${PYTHON_LIBS}" + AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS} ${RT_LIB} ${PYTHON_EXTRA_LIBS} ${PYTHON_LIBS}" AM_LDFLAGS="${BOOST_LDFLAGS} ${PYTHON_EXTRA_LDFLAGS}" else AM_CPPFLAGS="${BOOST_CPPFLAGS}" - AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS}" + AM_LIBS="${PTHREAD_CFLAGS} ${BOOST_LIBS} ${RT_LIB}" AM_LDFLAGS="${BOOST_LDFLAGS}" fi From a5d022b5d3a59f33d034656705359e403732b3fc Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Thu, 8 Dec 2016 09:25:32 +0000 Subject: [PATCH 4/9] Another attempt at a travis fix. --- .travis.yml | 3 ++ .travis/before_install.sh | 2 + .travis/install.sh | 83 ++++++++++++++++++++------------------- 3 files changed, 48 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 704f34c7..e9dbdd9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,10 @@ install: # Make sure python's available at runtime (if necessary) and then build KAT and run tests script: +- if [[ "$COMPILER" == "GCC5" ]]; then export CXX="g++-5" && export CC="gcc-5"; else export CXX="g++-4.9" && export CC="gcc-4.9"; fi - if [[ "$PLOT" == "python" ]] || [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$HOME/miniconda/bin:$PATH" && source activate test-environment && export LD_LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib:$LD_LIBRARY_PATH"; fi +- gcc --version +- g++ --version - ./configure --disable-silent-rules && make && make check && make distcheck diff --git a/.travis/before_install.sh b/.travis/before_install.sh index 817612ef..4f86c12c 100755 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -20,4 +20,6 @@ else export CC="gcc-4.9" fi gcc --version + g++ --version + gcc --print-search-dirs fi diff --git a/.travis/install.sh b/.travis/install.sh index 38e2934b..84202df2 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -1,51 +1,54 @@ #!/bin/bash if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + # Install boost -- looks like boost 1.55.0_2 is already installed with brew + #brew install boost - # Install boost -- looks like boost 1.55.0_2 is already installed with brew - #brew install boost - - # install anaconda - wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; - bash miniconda.sh -b -p $HOME/miniconda; - export PATH="$HOME/miniconda/bin:$PATH"; - hash -r; - conda config --set always_yes yes --set changeps1 no; - conda update -q conda; - conda info -a - conda create -q -n test-environment python=3.5 anaconda; + # install anaconda + wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; + bash miniconda.sh -b -p $HOME/miniconda; + export PATH="$HOME/miniconda/bin:$PATH"; + hash -r; + conda config --set always_yes yes --set changeps1 no; + conda update -q conda; + conda info -a + conda create -q -n test-environment python=3.5 anaconda; else - # Boost installation - wget -q http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/download - mv download boost.tar.gz - tar -xf boost.tar.gz - cd boost_1_59_0 - sudo ./bootstrap.sh --with-libraries=chrono,timer,program_options,filesystem,system - if [[ "$COMPILER" == "GCC5" ]]; then - sudo ./b2 -d0 --toolset=gcc-5 install; - else - sudo ./b2 -d0 --toolset=gcc-4.9 install; - fi - cd .. - - - # Plotting installation - if [[ "$PLOT" == "python" ]]; then - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - bash miniconda.sh -b -p $HOME/miniconda; - export PATH="$HOME/miniconda/bin:$PATH"; - hash -r; - conda config --set always_yes yes --set changeps1 no; - conda update -q conda; - conda info -a - conda create -q -n test-environment python=3.5 anaconda; - elif [ "$PLOT" == "gnuplot" ]; then - sudo apt-get install gnuplot - gnuplot --version; - fi + # Boost installation + wget -q http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz/download + mv download boost.tar.gz + tar -xf boost.tar.gz + cd boost_1_59_0 + sudo ./bootstrap.sh --with-libraries=chrono,timer,program_options,filesystem,system + if [[ "$COMPILER" == "GCC5" ]]; then + export CXX="g++-5" + export CC="gcc-5" + sudo ./b2 -d0 --toolset=gcc-5 install; + else + export CXX="g++-4.9" + export CC="gcc-4.9" + sudo ./b2 -d0 --toolset=gcc-4.9 install; + fi + cd .. + + + # Plotting installation + if [[ "$PLOT" == "python" ]]; then + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + bash miniconda.sh -b -p $HOME/miniconda; + export PATH="$HOME/miniconda/bin:$PATH"; + hash -r; + conda config --set always_yes yes --set changeps1 no; + conda update -q conda; + conda info -a + conda create -q -n test-environment python=3.5 anaconda; + elif [ "$PLOT" == "gnuplot" ]; then + sudo apt-get install gnuplot + gnuplot --version; + fi fi From 4bef1c2d7d62779d1a558a1a399656b24225bc89 Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Thu, 8 Dec 2016 17:01:11 +0000 Subject: [PATCH 5/9] Bumped version to 2.3.1 Dropped dist check from travis Force static linking of internal libraries, ensure gtest is correctly used for testing. --- .travis.yml | 17 +++++++++++++---- configure.ac | 2 +- deps/jellyfish-2.2.0/tests/.gitignore | 1 + doc/source/conf.py | 4 ++-- src/Makefile.am | 14 +++++++------- tests/Makefile.am | 6 ++++-- tests/gtest.mk | 4 ++-- 7 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9dbdd9e..5cc95014 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,13 @@ matrix: env: COMPILER=GCC5 PLOT=python - os: osx compiler: clang - + +# safelist +branches: + only: + - master + - develop + # Setup compiler before_install: - ./.travis/before_install.sh @@ -34,11 +40,14 @@ install: # Make sure python's available at runtime (if necessary) and then build KAT and run tests script: -- if [[ "$COMPILER" == "GCC5" ]]; then export CXX="g++-5" && export CC="gcc-5"; else export CXX="g++-4.9" && export CC="gcc-4.9"; fi -- if [[ "$PLOT" == "python" ]] || [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$HOME/miniconda/bin:$PATH" && source activate test-environment && export LD_LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib:$LD_LIBRARY_PATH"; fi +- if [[ "$COMPILER" == "GCC5" ]]; then export CXX="g++-5" && export CC="gcc-5"; elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX="g++-4.9" && export CC="gcc-4.9"; fi +- if [[ "$PLOT" == "python" ]] || [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$HOME/miniconda/bin:$PATH" && source activate test-environment && export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/miniconda/envs/test-environment/lib"; fi - gcc --version - g++ --version -- ./configure --disable-silent-rules && make && make check && make distcheck +- ./configure +- make V=1 +- make V=1 check +#- make V=1 distcheck diff --git a/configure.ac b/configure.ac index 126b06ed..7ccc9874 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ # Autoconf initialistion. Sets package name version and contact details AC_PREREQ([2.68]) -AC_INIT([kat],[2.3.0],[https://github.com/TGAC/KAT/issues],[kat],[https://github.com/TGAC/KAT]) +AC_INIT([kat],[2.3.1],[https://github.com/TGAC/KAT/issues],[kat],[https://github.com/TGAC/KAT]) AC_CONFIG_SRCDIR([src/kat.cc]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/deps/jellyfish-2.2.0/tests/.gitignore b/deps/jellyfish-2.2.0/tests/.gitignore index fabc599b..45c41134 100644 --- a/deps/jellyfish-2.2.0/tests/.gitignore +++ b/deps/jellyfish-2.2.0/tests/.gitignore @@ -18,3 +18,4 @@ /multi_file_fail_cmds /bloom_counter_commands *.timing +merge_m40* diff --git a/doc/source/conf.py b/doc/source/conf.py index 0d598f7e..0ec42d0f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -52,9 +52,9 @@ # built documents. # # The short X.Y version. -version = '2.3.0' +version = '2.3.1' # The full version, including alpha/beta/rc tags. -release = '2.3.0' +release = '2.3.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/src/Makefile.am b/src/Makefile.am index 1a5cacf3..3da76478 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,18 +11,18 @@ kat_CPPFLAGS = \ -isystem $(top_srcdir)/deps/seqan-library-2.0.0/include \ -isystem $(top_srcdir)/deps/jellyfish-2.2.0/include \ -isystem $(top_srcdir)/lib/include \ - @AM_CPPFLAGS@ @CPPFLAGS@ + @AM_CPPFLAGS@ kat_LDFLAGS = \ - -L../lib/.libs \ - -L../deps/jellyfish-2.2.0/.libs \ - @AM_LDFLAGS@ \ - @LDFLAGS@ + -static \ + -L../lib \ + -L../deps/jellyfish-2.2.0 \ + @AM_LDFLAGS@ kat_LDADD = \ @AM_LIBS@ \ - -l:libkat.a \ - -l:libkat_jellyfish.a + -lkat \ + -lkat_jellyfish noinst_HEADERS = \ diff --git a/tests/Makefile.am b/tests/Makefile.am index ba1b9113..c95eff2f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -49,13 +49,15 @@ check_unit_tests_SOURCES = \ check_main.cc check_unit_tests_LDFLAGS = \ + -static \ + -L. \ -L../lib \ -L../deps/jellyfish-2.2.0 \ - @AM_LDFLAGS@ \ - @LDFLAGS@ + @AM_LDFLAGS@ check_unit_tests_LDADD = \ libgtest.la \ + -lgtest \ -lkat \ -lkat_jellyfish \ @AM_LIBS@ diff --git a/tests/gtest.mk b/tests/gtest.mk index ac8583d4..4074fd62 100644 --- a/tests/gtest.mk +++ b/tests/gtest.mk @@ -7,8 +7,8 @@ check_LTLIBRARIES = libgtest.la libgtest_main.la libgtest_la_SOURCES = gtest/src/gtest-all.cc libgtest_main_la_SOURCES = gtest/src/gtest_main.cc libgtest_main_la_LIBADD = libgtest.la -libgtest_la_CXXFLAGS = -I$(srcdir) -libgtest_main_la_CXXFLAGS = -I$(srcdir) +libgtest_la_CPPFLAGS = -I$(srcdir) +libgtest_main_la_CPPFLAGS = -I$(srcdir) GTEST_SRC = gtest/src/gtest-all.cc \ gtest/src/gtest_main.cc \ From 3e983fc1a412235001bea2838ca91b4891134a11 Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Fri, 9 Dec 2016 08:55:26 +0000 Subject: [PATCH 6/9] Added option for disabling plotting to configure script. --- configure.ac | 92 +++++++++++++++++++++++++++---------------------- src/Makefile.am | 7 +++- 2 files changed, 56 insertions(+), 43 deletions(-) diff --git a/configure.ac b/configure.ac index 7ccc9874..af36358c 100644 --- a/configure.ac +++ b/configure.ac @@ -78,45 +78,49 @@ else fi # Plotting +pymod_good="no" +enable_gnuplot = "no" +AC_ARG_ENABLE([noplot], AS_HELP_STRING([--disable-plotting], [This will disable plotting even if python matplotlib or gnuplot are available])) AC_ARG_ENABLE([gnuplot], AS_HELP_STRING([--enable-gnuplot], [Enable gnuplot plotting even if python matplotlib is available]), enable_gnuplot="yes", enable_gnuplot="no") -#AM_PATH_PYTHON([], [], AC_MSG_ERROR([Python interpreter not found.])) - -AX_PYTHON_DEVEL([>= '3.1']) - -pybin=python${PYTHON_VERSION} -pymod_good="no" -if [[ -n "${PYTHON_VERSION}" ]]; then - if [[ -z "${PYTHON_EXTRA_LIBS}" ]]; then - pymod_good="no" - AC_MSG_WARN([Python3 detected but Python3 development library was not found. If you wish to use python plotting please install python3 library. e.g. "sudo apt-get install python3-dev" on debian systems.]) - fi - pymod_good="yes" - AX_PYTHON_MODULE(numpy, ,${pybin}) - if [[ "${PYMOD}" == "no" ]]; then - pymod_good="no" - fi - AX_PYTHON_MODULE(matplotlib, ,${pybin}) - if [[ "${PYMOD}" == "no" ]]; then - pymod_good="no" - fi - AX_PYTHON_MODULE(scipy, ,${pybin}) - if [[ "${PYMOD}" == "no" ]]; then - pymod_good="no" +if [[ "${enable_plotting}" == "yes" ]]; then + if [[ "${enable_gnuplot}" != "yes" ]]; then + AX_PYTHON_DEVEL([>= '3.1']) + + pybin=python${PYTHON_VERSION} + if [[ -n "${PYTHON_VERSION}" ]]; then + if [[ -z "${PYTHON_EXTRA_LIBS}" ]]; then + pymod_good="no" + AC_MSG_WARN([Python3 detected but Python3 development library was not found. If you wish to use python plotting please install python3 library. e.g. "sudo apt-get install python3-dev" on debian systems.]) + fi + pymod_good="yes" + AX_PYTHON_MODULE(numpy, ,${pybin}) + if [[ "${PYMOD}" == "no" ]]; then + pymod_good="no" + fi + AX_PYTHON_MODULE(matplotlib, ,${pybin}) + if [[ "${PYMOD}" == "no" ]]; then + pymod_good="no" + fi + AX_PYTHON_MODULE(scipy, ,${pybin}) + if [[ "${PYMOD}" == "no" ]]; then + pymod_good="no" + fi + fi fi -fi -# Check for gnuplot on path. Just emit a warning if not present -if [[ "${pymod_good}" == "no" ]] || [[ "${enable_gnuplot}" == "yes" ]]; then - AC_DEFINE([HAVE_PYTHON], [0], [Python not present]) - AC_CHECK_PROG([gnuplot_found], [gnuplot], [yes], [no]) - if [[ "${gnuplot_found}" == "no" ]] ; then - AC_DEFINE([HAVE_GNUPLOT], [0], [Gnuplot not present]) + # Check for gnuplot on path. Just emit a warning if not present + if [[ "${pymod_good}" == "no" ]] || [[ "${enable_gnuplot}" == "yes" ]]; then + AC_DEFINE([HAVE_PYTHON], [0], [Python not present]) + AC_CHECK_PROG([gnuplot_found], [gnuplot], [yes], [no]) + if [[ "${gnuplot_found}" == "no" ]] ; then + AC_DEFINE([HAVE_GNUPLOT], [0], [Gnuplot not present]) + else + AC_DEFINE([HAVE_GNUPLOT], [1], [Gnuplot present]) + fi else - AC_DEFINE([HAVE_GNUPLOT], [1], [Gnuplot present]) + AC_DEFINE([HAVE_PYTHON], [1], [Python present]) fi -else - AC_DEFINE([HAVE_PYTHON], [1], [Python present]) fi # Check for sphinx to build documentation (optional) @@ -193,19 +197,23 @@ AC_CONFIG_FILES([Makefile doc/Makefile doc/source/conf.py lib/kat.pc lib/Makefil AC_CONFIG_SUBDIRS([deps/jellyfish-2.2.0]) AC_OUTPUT -if [[ "${pymod_good}" == "yes" ]] && [[ "$enable_gnuplot" == "no" ]] ; then - AC_MSG_NOTICE([Using python plotting]) +if [[ "${enable_plotting}" == "no" ]]; then + AC_MSG_NOTICE([Plotting disabled]) else - if [[ "${gnuplot_found}" == "yes" ]]; then - if [[ "$enable_gnuplot" == "no" ]]; then - AC_MSG_WARN([Python3, or some required python modules where not found. Python via matplotlib is the preferred plotting method in KAT. If you want to use python plotting (the preferred option) then we suggest you install anaconda3 (or python3 with numpy, scipy and matplotlib separately). However, gnuplot was detected so KAT plots will be generated via gnuplot instead.]) + if [[ "${pymod_good}" == "yes" ]] && [[ "$enable_gnuplot" == "no" ]] ; then + AC_MSG_NOTICE([Using python plotting]) + else + if [[ "${gnuplot_found}" == "yes" ]]; then + if [[ "$enable_gnuplot" == "no" ]]; then + AC_MSG_WARN([Python3, or some required python modules where not found. Python via matplotlib is the preferred plotting method in KAT. If you want to use python plotting (the preferred option) then we suggest you install anaconda3 (or python3 with numpy, scipy and matplotlib separately). However, gnuplot was detected so KAT plots will be generated via gnuplot instead.]) + else + AC_MSG_NOTICE([Using gnuplot plotting]) + fi else - AC_MSG_NOTICE([Using gnuplot plotting]) + AC_MSG_WARN([Neither python (with plotting modules present) or Gnuplot not detected. KAT will still work (minus plots). Should you require plotting functionality, you must install either anaconda3 (or python3 with numpy, scipy and matplotlib) or gnuplot, and then reconfigure and compile to enable plotting in KAT.]) fi - else - AC_MSG_WARN([Neither python (with plotting modules present) or Gnuplot not detected. KAT will still work (minus plots). Should you require plotting functionality, you must install either anaconda3 (or python3 with numpy, scipy and matplotlib) or gnuplot, and then reconfigure and compile to enable plotting in KAT.]) fi -fi +fi if [[ "${sphinx}" == "no" ]]; then AC_MSG_WARN([Sphinx not detected, or version is too old. Wont create documentation. You can still find the documentation online at: https://kat.readthedocs.org/en/latest/]) diff --git a/src/Makefile.am b/src/Makefile.am index 3da76478..ba9ef55f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,12 @@ AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = kat # Executable inputs -kat_CXXFLAGS = -g -O3 -fwrapv -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-command-line-argument -ansi -pedantic -std=c++11 @AM_CXXFLAGS@ +kat_CXXFLAGS = \ + -g -O3 -fwrapv -Wall -Wextra \ + -Wno-deprecated-declarations -Wno-unused-function -Wno-unused-parameter \ + -Wno-unused-variable -Wno-unused-command-line-argument \ + -ansi -pedantic -std=c++11 \ + @AM_CXXFLAGS@ kat_CPPFLAGS = \ -isystem $(top_srcdir)/deps/seqan-library-2.0.0/include \ From 258d04a79fd0bd0742c0c3d164018004ac0237d0 Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Fri, 9 Dec 2016 12:38:42 +0000 Subject: [PATCH 7/9] Added option to dynamically link boost libraries. Forcing python detection code to looking for python3. --- configure.ac | 30 +++++++++++++++++++----------- m4/ax_boost_chrono.m4 | 10 +++++----- m4/ax_boost_filesystem.m4 | 10 +++++----- m4/ax_boost_program_options.m4 | 10 +++++----- m4/ax_boost_system.m4 | 10 +++++----- m4/ax_boost_timer.m4 | 10 +++++----- m4/ax_python_devel.m4 | 14 +++++++++----- 7 files changed, 53 insertions(+), 41 deletions(-) diff --git a/configure.ac b/configure.ac index af36358c..0ce5c047 100644 --- a/configure.ac +++ b/configure.ac @@ -79,12 +79,11 @@ fi # Plotting pymod_good="no" -enable_gnuplot = "no" -AC_ARG_ENABLE([noplot], AS_HELP_STRING([--disable-plotting], [This will disable plotting even if python matplotlib or gnuplot are available])) -AC_ARG_ENABLE([gnuplot], AS_HELP_STRING([--enable-gnuplot], [Enable gnuplot plotting even if python matplotlib is available]), enable_gnuplot="yes", enable_gnuplot="no") +AC_ARG_ENABLE([noplotting], AS_HELP_STRING([--disable-plotting], [This will disable plotting even if python matplotlib or gnuplot are available]), do_plotting="no", do_plotting="yes") +AC_ARG_ENABLE([gnuplot], AS_HELP_STRING([--enable-gnuplot], [Enable gnuplot plotting even if python matplotlib is available]), use_gnuplot="yes", use_gnuplot="no") -if [[ "${enable_plotting}" == "yes" ]]; then - if [[ "${enable_gnuplot}" != "yes" ]]; then +if [[ "${do_plotting}" == "yes" ]]; then + if [[ "${use_gnuplot}" == "no" ]]; then AX_PYTHON_DEVEL([>= '3.1']) pybin=python${PYTHON_VERSION} @@ -110,7 +109,7 @@ if [[ "${enable_plotting}" == "yes" ]]; then fi # Check for gnuplot on path. Just emit a warning if not present - if [[ "${pymod_good}" == "no" ]] || [[ "${enable_gnuplot}" == "yes" ]]; then + if [[ "${pymod_good}" == "no" ]] || [[ "${use_gnuplot}" == "yes" ]]; then AC_DEFINE([HAVE_PYTHON], [0], [Python not present]) AC_CHECK_PROG([gnuplot_found], [gnuplot], [yes], [no]) if [[ "${gnuplot_found}" == "no" ]] ; then @@ -145,7 +144,11 @@ AM_CONDITIONAL([MAKE_DOCS], [test x$sphinx = xyes]) AC_SUBST([MAKE_DOCS]) + ## Check for boost + +AC_ARG_ENABLE([dynamic-boost], AS_HELP_STRING([--enable-dynamic-boost], [Boost is statically linked by default. Use this option if you would prefer to dynamically link boost]), dynboost="yes", dynboost="no") + AX_BOOST_BASE([1.52],, [AC_MSG_ERROR([Boost not found. Please ensure that boost is properly built and the BOOST_ROOT environment variable is set. Alternatively you can override BOOST_ROOT with the --with-boost option.])]) AX_BOOST_FILESYSTEM AX_BOOST_SYSTEM @@ -167,10 +170,15 @@ AC_SUBST([BOOST_STATIC_LIBS]) # Prefer static linking of boost. If one or more static libs are not present # (this happens with some default boost installations on some environments) then # use dynamic libs instead. -if [[ -z "${BOOST_TIMER_STATIC_LIB}" ]] || [[ -z "${BOOST_CHRONO_STATIC_LIB}" ]] || [[ -z "${BOOST_FILESYSTEM_STATIC_LIB}" ]] || [[ -z "${BOOST_PROGRAM_OPTIONS_STATIC_LIB}" ]] || [[ -z "${BOOST_SYSTEM_STATIC_LIB}" ]]; then +if [[ "${dynboost}" == "yes" ]]; then BOOST_LIBS="${BOOST_DYN_LIBS}" else - BOOST_LIBS="${BOOST_STATIC_LIBS}" + if [[ -z "${BOOST_TIMER_STATIC_LIB}" ]] || [[ -z "${BOOST_CHRONO_STATIC_LIB}" ]] || [[ -z "${BOOST_FILESYSTEM_STATIC_LIB}" ]] || [[ -z "${BOOST_PROGRAM_OPTIONS_STATIC_LIB}" ]] || [[ -z "${BOOST_SYSTEM_STATIC_LIB}" ]]; then + AC_MSG_WARN([Not all static boost libraries could be found. Using dynamic libraries instead.]) + BOOST_LIBS="${BOOST_DYN_LIBS}" + else + BOOST_LIBS="${BOOST_STATIC_LIBS}" + fi fi AC_SUBST([BOOST_LIBS]) @@ -197,14 +205,14 @@ AC_CONFIG_FILES([Makefile doc/Makefile doc/source/conf.py lib/kat.pc lib/Makefil AC_CONFIG_SUBDIRS([deps/jellyfish-2.2.0]) AC_OUTPUT -if [[ "${enable_plotting}" == "no" ]]; then +if [[ "${do_plotting}" == "no" ]]; then AC_MSG_NOTICE([Plotting disabled]) else - if [[ "${pymod_good}" == "yes" ]] && [[ "$enable_gnuplot" == "no" ]] ; then + if [[ "${pymod_good}" == "yes" ]] && [[ "$use_gnuplot" == "no" ]] ; then AC_MSG_NOTICE([Using python plotting]) else if [[ "${gnuplot_found}" == "yes" ]]; then - if [[ "$enable_gnuplot" == "no" ]]; then + if [[ "${use_gnuplot}" == "no" ]]; then AC_MSG_WARN([Python3, or some required python modules where not found. Python via matplotlib is the preferred plotting method in KAT. If you want to use python plotting (the preferred option) then we suggest you install anaconda3 (or python3 with numpy, scipy and matplotlib separately). However, gnuplot was detected so KAT plots will be generated via gnuplot instead.]) else AC_MSG_NOTICE([Using gnuplot plotting]) diff --git a/m4/ax_boost_chrono.m4 b/m4/ax_boost_chrono.m4 index 51dd7d15..2b5889ee 100644 --- a/m4/ax_boost_chrono.m4 +++ b/m4/ax_boost_chrono.m4 @@ -128,21 +128,21 @@ AC_DEFUN([AX_BOOST_CHRONO], fi if test "x$ax_lib" = "x"; then - AC_MSG_WARN(Could not find a dynamic version of the library!) + AC_MSG_WARN(Could not find a dynamic version of boost_chrono) elif test "x$ax_static_lib" = "x"; then - AC_MSG_WARN(Could not find a static version of the library!) + AC_MSG_WARN(Could not find a static version of boost_chrono) fi if test "x$no_find" = "xyes"; then AC_MSG_ERROR(Could not find any version of the library to link to) fi if test "x$link_chrono" = "xno"; then - AC_MSG_WARN(Could not dynamic link against $ax_lib !) + AC_MSG_WARN(Could not dynamic link against $ax_lib) elif test "x$link_chrono_static" = "xno"; then - AC_MSG_WARN(Could not static link against $ax_static_lib!) + AC_MSG_WARN(Could not static link against $ax_static_lib) fi if test "x$no_link" = "xyes"; then - AC_MSG_ERROR(Could not link against any boost-chrono lib) + AC_MSG_ERROR(Could not link against any boost_chrono lib) fi fi diff --git a/m4/ax_boost_filesystem.m4 b/m4/ax_boost_filesystem.m4 index 8671d5cc..bcbcc969 100644 --- a/m4/ax_boost_filesystem.m4 +++ b/m4/ax_boost_filesystem.m4 @@ -130,21 +130,21 @@ AC_DEFUN([AX_BOOST_FILESYSTEM], fi if test "x$ax_lib" = "x"; then - AC_MSG_WARN(Could not find a dynamic version of the library!) + AC_MSG_WARN(Could not find a dynamic version of boost_filesystem) elif test "x$ax_static_lib" = "x"; then - AC_MSG_WARN(Could not find a static version of the library!) + AC_MSG_WARN(Could not find a static version of boost_filesystem) fi if test "x$no_find" = "xyes"; then AC_MSG_ERROR(Could not find any version of the library to link to) fi if test "x$link_filesystem" = "xno"; then - AC_MSG_WARN(Could not dynamic link against $ax_lib !) + AC_MSG_WARN(Could not dynamic link against $ax_lib) elif test "x$link_filesystem_static" = "xno"; then - AC_MSG_WARN(Could not static link against $ax_static_lib!) + AC_MSG_WARN(Could not static link against $ax_static_lib) fi if test "x$no_link" = "xyes"; then - AC_MSG_ERROR(Could not link against any boost-filesystem lib) + AC_MSG_ERROR(Could not link against any boost_filesystem lib) fi fi diff --git a/m4/ax_boost_program_options.m4 b/m4/ax_boost_program_options.m4 index 33d84302..cbbae376 100644 --- a/m4/ax_boost_program_options.m4 +++ b/m4/ax_boost_program_options.m4 @@ -122,21 +122,21 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], fi if test "x$ax_lib" = "x"; then - AC_MSG_WARN(Could not find a dynamic version of the library!) + AC_MSG_WARN(Could not find a dynamic version of boost_program_options) elif test "x$ax_static_lib" = "x"; then - AC_MSG_WARN(Could not find a static version of the library!) + AC_MSG_WARN(Could not find a static version of boost_program_options) fi if test "x$no_find" = "xyes"; then AC_MSG_ERROR(Could not find any version of the library to link to) fi if test "x$link_program_options" = "xno"; then - AC_MSG_WARN(Could not dynamic link against $ax_lib !) + AC_MSG_WARN(Could not dynamic link against $ax_lib) elif test "x$link_program_options_static" = "xno"; then - AC_MSG_WARN(Could not static link against $ax_static_lib!) + AC_MSG_WARN(Could not static link against $ax_static_lib) fi if test "x$no_link" = "xyes"; then - AC_MSG_ERROR(Could not link against any boost-program_options lib) + AC_MSG_ERROR(Could not link against any boost_program_options lib) fi fi diff --git a/m4/ax_boost_system.m4 b/m4/ax_boost_system.m4 index 2adf0950..f2c037ac 100644 --- a/m4/ax_boost_system.m4 +++ b/m4/ax_boost_system.m4 @@ -128,21 +128,21 @@ AC_DEFUN([AX_BOOST_SYSTEM], fi if test "x$ax_lib" = "x"; then - AC_MSG_WARN(Could not find a dynamic version of the library!) + AC_MSG_WARN(Could not find a dynamic version of boost_system) elif test "x$ax_static_lib" = "x"; then - AC_MSG_WARN(Could not find a static version of the library!) + AC_MSG_WARN(Could not find a static version of boost_system) fi if test "x$no_find" = "xyes"; then AC_MSG_ERROR(Could not find any version of the library to link to) fi if test "x$link_system" = "xno"; then - AC_MSG_WARN(Could not dynamic link against $ax_lib !) + AC_MSG_WARN(Could not dynamic link against $ax_lib) elif test "x$link_system_static" = "xno"; then - AC_MSG_WARN(Could not static link against $ax_static_lib!) + AC_MSG_WARN(Could not static link against $ax_static_lib) fi if test "x$no_link" = "xyes"; then - AC_MSG_ERROR(Could not link against any boost-system lib) + AC_MSG_ERROR(Could not link against any boost_system lib) fi fi diff --git a/m4/ax_boost_timer.m4 b/m4/ax_boost_timer.m4 index 5b7c7a6c..6974cf6f 100644 --- a/m4/ax_boost_timer.m4 +++ b/m4/ax_boost_timer.m4 @@ -129,21 +129,21 @@ AC_DEFUN([AX_BOOST_TIMER], fi if test "x$ax_lib" = "x"; then - AC_MSG_WARN(Could not find a dynamic version of the library!) + AC_MSG_WARN(Could not find a dynamic version of boost_timer) elif test "x$ax_static_lib" = "x"; then - AC_MSG_WARN(Could not find a static version of the library!) + AC_MSG_WARN(Could not find a static version of boost_timer) fi if test "x$no_find" = "xyes"; then AC_MSG_ERROR(Could not find any version of the library to link to) fi if test "x$link_timer" = "xno"; then - AC_MSG_WARN(Could not dynamic link against $ax_lib !) + AC_MSG_WARN(Could not dynamic link against $ax_lib) elif test "x$link_timer_static" = "xno"; then - AC_MSG_WARN(Could not static link against $ax_static_lib!) + AC_MSG_WARN(Could not static link against $ax_static_lib) fi if test "x$no_link" = "xyes"; then - AC_MSG_ERROR(Could not link against any boost-timer lib) + AC_MSG_ERROR(Could not link against any boost_timer lib) fi fi diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4 index 331947f4..1458f1f8 100644 --- a/m4/ax_python_devel.m4 +++ b/m4/ax_python_devel.m4 @@ -23,7 +23,7 @@ # version number. Don't use "PYTHON_VERSION" for this: that environment # variable is declared as precious and thus reserved for the end-user. # -# This macro should work for all versions of Python >= 2.1.0. As an end +# This macro should work for all versions of Python >= 3.1.0. As an end # user, you can disable the check for the python version by setting the # PYTHON_NOVERSIONCHECK environment variable to something else than the # empty string. @@ -75,10 +75,14 @@ AC_DEFUN([AX_PYTHON_DEVEL],[ # Allow the use of a (user set) custom python version # AC_ARG_VAR([PYTHON_VERSION],[The installed Python - version to use, for example '2.3'. This string + version to use, for example '3.4'. This string will be appended to the Python interpreter canonical name.]) + if test -z "$PYTHON_VERSION"; then + PYTHON_VERSION="3" + fi + AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) if test -z "$PYTHON"; then AC_MSG_WARN([Cannot find python$PYTHON_VERSION in your system path]) @@ -86,11 +90,11 @@ AC_DEFUN([AX_PYTHON_DEVEL],[ fi # - # Check for a version of Python >= 2.1.0 + # Check for a version of Python >= 3.1.0 # ac_supports_python_ver=`$PYTHON -c "import sys; \ ver = sys.version.split ()[[0]]; \ - print (ver >= '2.1.0')"` + print (ver >= '3.1.0')"` python_full_ver=`$PYTHON -c "import sys; \ ver=sys.version.split ()[[0]]; \ print(ver)"` @@ -102,7 +106,7 @@ AC_DEFUN([AX_PYTHON_DEVEL],[ print(maj_ver + '.' + min_ver)"` PYTHON_FULL_VERSION="$python_full_ver" AC_MSG_NOTICE([Found python version: ${PYTHON_FULL_VERSION}]) - AC_MSG_CHECKING([for a version of Python >= '2.1.0']) + AC_MSG_CHECKING([for a version of Python >= '3.1.0']) if test "$ac_supports_python_ver" != "True"; then if test -z "$PYTHON_NOVERSIONCHECK"; then AC_MSG_RESULT([no]) From b94752141d45b09ce0f1a72ead1000bf2c3f4439 Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Fri, 9 Dec 2016 16:18:57 +0000 Subject: [PATCH 8/9] Updating error messages for boost dependency detection --- m4/ax_boost_chrono.m4 | 2 +- m4/ax_boost_filesystem.m4 | 2 +- m4/ax_boost_program_options.m4 | 2 +- m4/ax_boost_system.m4 | 2 +- m4/ax_boost_thread.m4 | 181 ----------------------------- m4/ax_boost_timer.m4 | 2 +- m4/ax_boost_unit_test_framework.m4 | 147 ----------------------- 7 files changed, 5 insertions(+), 333 deletions(-) delete mode 100644 m4/ax_boost_thread.m4 delete mode 100644 m4/ax_boost_unit_test_framework.m4 diff --git a/m4/ax_boost_chrono.m4 b/m4/ax_boost_chrono.m4 index 2b5889ee..f5d72458 100644 --- a/m4/ax_boost_chrono.m4 +++ b/m4/ax_boost_chrono.m4 @@ -133,7 +133,7 @@ AC_DEFUN([AX_BOOST_CHRONO], AC_MSG_WARN(Could not find a static version of boost_chrono) fi if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of the library to link to) + AC_MSG_ERROR(Could not find any version boost_chrono to link to) fi if test "x$link_chrono" = "xno"; then diff --git a/m4/ax_boost_filesystem.m4 b/m4/ax_boost_filesystem.m4 index bcbcc969..daf510f0 100644 --- a/m4/ax_boost_filesystem.m4 +++ b/m4/ax_boost_filesystem.m4 @@ -135,7 +135,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM], AC_MSG_WARN(Could not find a static version of boost_filesystem) fi if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of the library to link to) + AC_MSG_ERROR(Could not find any version of boost_filesystem to link to) fi if test "x$link_filesystem" = "xno"; then diff --git a/m4/ax_boost_program_options.m4 b/m4/ax_boost_program_options.m4 index cbbae376..f968f6b8 100644 --- a/m4/ax_boost_program_options.m4 +++ b/m4/ax_boost_program_options.m4 @@ -127,7 +127,7 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], AC_MSG_WARN(Could not find a static version of boost_program_options) fi if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of the library to link to) + AC_MSG_ERROR(Could not find any version of boost_program_options to link to) fi if test "x$link_program_options" = "xno"; then diff --git a/m4/ax_boost_system.m4 b/m4/ax_boost_system.m4 index f2c037ac..7b545fb0 100644 --- a/m4/ax_boost_system.m4 +++ b/m4/ax_boost_system.m4 @@ -133,7 +133,7 @@ AC_DEFUN([AX_BOOST_SYSTEM], AC_MSG_WARN(Could not find a static version of boost_system) fi if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of the library to link to) + AC_MSG_ERROR(Could not find any version of boost_system to link to) fi if test "x$link_system" = "xno"; then diff --git a/m4/ax_boost_thread.m4 b/m4/ax_boost_thread.m4 deleted file mode 100644 index f9f858d2..00000000 --- a/m4/ax_boost_thread.m4 +++ /dev/null @@ -1,181 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_thread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_THREAD -# -# DESCRIPTION -# -# Test for Thread library from the Boost C++ libraries. The macro requires -# a preceding call to AX_BOOST_BASE. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_THREAD_LIB) -# AC_SUBST(BOOST_THREAD_STATIC_LIB) -# -# And sets: -# -# HAVE_BOOST_THREAD -# -# LICENSE -# -# Copyright (c) 2009 Thomas Porschberg -# Copyright (c) 2009 Michael Tindal -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 27 - -AC_DEFUN([AX_BOOST_THREAD], -[ - AC_ARG_WITH([boost-thread], - AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@], - [use the Thread library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-thread=boost_thread-gcc-mt ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_thread_lib="" - else - want_boost="yes" - ax_boost_user_thread_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_BUILD]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Thread library is available, - ax_cv_boost_thread, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - if test "x$host_os" = "xsolaris" ; then - CXXFLAGS="-pthreads $CXXFLAGS" - elif test "x$host_os" = "xmingw32" ; then - CXXFLAGS="-mthreads $CXXFLAGS" - else - CXXFLAGS="-pthread $CXXFLAGS" - fi - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[boost::thread_group thrds; - return 0;]])], - ax_cv_boost_thread=yes, ax_cv_boost_thread=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_thread" = "xyes"; then - if test "x$host_os" = "xsolaris" ; then - BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" - elif test "x$host_os" = "xmingw32" ; then - BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" - else - BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" - fi - - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - case "x$host_os" in - *bsd* ) - LDFLAGS="-pthread $LDFLAGS" - break; - ;; - esac - if test "x$ax_cv_boost_thread" = "xyes"; then - AC_SUBST(BOOST_CPPFLAGS) - - AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_thread_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* $BOOSTLIBDIR/libboost_thread*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;' -e 's;^lib\(boost_thread.*\)\.dylib.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - if test "x$link_thread" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - fi - for libextension in `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null` ; do - ax_static_lib=${libextension} - AC_CHECK_FILE($ax_static_lib, - [BOOST_THREAD_STATIC_LIB="$ax_static_lib"; AC_SUBST(BOOST_THREAD_STATIC_LIB) link_thread_static="yes"; break], - [link_thread_static="no"]) - done - - no_find="no" - if test "x$ax_lib" = "x"; then - if test "x$ax_static_lib" = "x"; then - no_find="yes" - fi - fi - - no_link="no" - if test "x$link_thread" != "xyes"; then - if test "x$link_thread_static" != "xyes"; then - no_link="yes" - fi - fi - - else - for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_WARN(Could not find a dynamic version of the library!) - elif test "x$ax_static_lib" = "x"; then - AC_MSG_WARN(Could not find a static version of the library!) - fi - if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of the library to link to) - fi - - if test "x$link_thread" = "xno"; then - AC_MSG_WARN(Could not dynamic link against $ax_lib !) - elif test "x$link_thread_static" = "xno"; then - AC_MSG_WARN(Could not static link against $ax_static_lib!) - fi - if test "x$no_link" = "xyes"; then - AC_MSG_ERROR(Could not link against any boost-thread lib) - fi - - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) \ No newline at end of file diff --git a/m4/ax_boost_timer.m4 b/m4/ax_boost_timer.m4 index 6974cf6f..543a21bc 100644 --- a/m4/ax_boost_timer.m4 +++ b/m4/ax_boost_timer.m4 @@ -134,7 +134,7 @@ AC_DEFUN([AX_BOOST_TIMER], AC_MSG_WARN(Could not find a static version of boost_timer) fi if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of the library to link to) + AC_MSG_ERROR(Could not find any version of boost_timer to link to) fi if test "x$link_timer" = "xno"; then diff --git a/m4/ax_boost_unit_test_framework.m4 b/m4/ax_boost_unit_test_framework.m4 deleted file mode 100644 index 099a0f7f..00000000 --- a/m4/ax_boost_unit_test_framework.m4 +++ /dev/null @@ -1,147 +0,0 @@ -# ================================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_boost_unit_test_framework.html -# ================================================================================ -# -# SYNOPSIS -# -# AX_BOOST_UNIT_TEST_FRAMEWORK -# -# DESCRIPTION -# -# Test for Unit_Test_Framework library from the Boost C++ libraries. The -# macro requires a preceding call to AX_BOOST_BASE. Further documentation -# is available at . -# -# This macro calls: -# -# AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) -# AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB) -# -# And sets: -# -# HAVE_BOOST_UNIT_TEST_FRAMEWORK -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 19 - -AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK], -[ - AC_ARG_WITH([boost-unit-test-framework], - AS_HELP_STRING([--with-boost-unit-test-framework@<:@=special-lib@:>@], - [use the Unit_Test_Framework library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-unit-test-framework=boost_unit_test_framework-gcc ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_unit_test_framework_lib="" - else - want_boost="yes" - ax_boost_user_unit_test_framework_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Unit_Test_Framework library is available, - ax_cv_boost_unit_test_framework, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], - [[using boost::unit_test::test_suite; - test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); return 0;]])], - ax_cv_boost_unit_test_framework=yes, ax_cv_boost_unit_test_framework=no) - AC_LANG_POP([C++]) - ] - ) - - if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then - AC_DEFINE(HAVE_BOOST_UNIT_TEST_FRAMEWORK,,[define if the Boost::Unit_Test_Framework library is available]) - BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` - LDFLAGS_SAVE=$LDFLAGS - if test "x$ax_boost_user_unit_test_framework_lib" = "x"; then - for libextension in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.so* $BOOSTLIBDIR/libboost_unit_test_framework*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.dylib.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) link_unit_test_framework="yes"; break], - [link_unit_test_framework="no"]) - done - if test "x$link_unit_test_framework" != "xyes"; then - for libextension in `ls $BOOSTLIBDIR/boost_unit_test_framework*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_unit_test_framework.*\)\.dll.*$;\1;'` ; do - ax_lib=${libextension} - AC_CHECK_LIB($ax_lib, exit, - [BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) link_unit_test_framework="yes"; break], - [link_unit_test_framework="no"]) - done - fi - for libextension in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.a* 2>/dev/null` ; do - ax_static_lib=${libextension} - AC_CHECK_FILE($ax_static_lib, - [BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB="$ax_static_lib"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB) link_unit_test_framework_static="yes"; break], - [link_unit_test_framework_static="no"]) - done - - no_find="no" - if test "x$ax_lib" = "x"; then - if test "x$ax_static_lib" = "x"; then - no_find="yes" - fi - fi - - no_link="no" - if test "x$link_unit_test_framework" != "xyes"; then - if test "x$link_unit_test_framework_static" != "xyes"; then - no_link="yes" - fi - fi - - else - for ax_lib in $ax_boost_user_unit_test_framework_lib boost_unit_test_framework-$ax_boost_user_unit_test_framework_lib; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) link_unit_test_framework="yes"; break], - [link_unit_test_framework="no"]) - done - - fi - if test "x$ax_lib" = "x"; then - AC_MSG_WARN(Could not find a dynamic version of the library!) - elif test "x$ax_static_lib" = "x"; then - AC_MSG_WARN(Could not find a static version of the library!) - fi - if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of the library to link to) - fi - - if test "x$link_unit_test_framework" = "xno"; then - AC_MSG_WARN(Could not dynamic link against $ax_lib !) - elif test "x$link_unit_test_framework_static" = "xno"; then - AC_MSG_WARN(Could not static link against $ax_static_lib!) - fi - if test "x$no_link" = "xyes"; then - AC_MSG_ERROR(Could not link against any boost-unit_test_framework lib) - fi - - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) \ No newline at end of file From 0e1b99fcc651eefc24899bca2d5de3880b76a4df Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Fri, 9 Dec 2016 17:02:44 +0000 Subject: [PATCH 9/9] Tidying up boost configuration --- configure.ac | 8 +++++++- m4/ax_boost_chrono.m4 | 26 ++++++++++++-------------- m4/ax_boost_filesystem.m4 | 28 +++++++++++++--------------- m4/ax_boost_program_options.m4 | 28 +++++++++++++--------------- m4/ax_boost_system.m4 | 28 +++++++++++++--------------- m4/ax_boost_timer.m4 | 28 +++++++++++++--------------- 6 files changed, 71 insertions(+), 75 deletions(-) diff --git a/configure.ac b/configure.ac index 0ce5c047..0c31b0db 100644 --- a/configure.ac +++ b/configure.ac @@ -174,7 +174,7 @@ if [[ "${dynboost}" == "yes" ]]; then BOOST_LIBS="${BOOST_DYN_LIBS}" else if [[ -z "${BOOST_TIMER_STATIC_LIB}" ]] || [[ -z "${BOOST_CHRONO_STATIC_LIB}" ]] || [[ -z "${BOOST_FILESYSTEM_STATIC_LIB}" ]] || [[ -z "${BOOST_PROGRAM_OPTIONS_STATIC_LIB}" ]] || [[ -z "${BOOST_SYSTEM_STATIC_LIB}" ]]; then - AC_MSG_WARN([Not all static boost libraries could be found. Using dynamic libraries instead.]) + AC_MSG_WARN([Not all static boost libraries could be found. Will use dynamic libraries instead.]) BOOST_LIBS="${BOOST_DYN_LIBS}" else BOOST_LIBS="${BOOST_STATIC_LIBS}" @@ -229,4 +229,10 @@ else AC_MSG_NOTICE([Building documentation with sphinx]) fi +if [[ "${dynboost}" == "yes" ]]; then + AC_MSG_NOTICE([Boost will be dynamically linked to your executable]) +else + AC_MSG_NOTICE([Boost will be statically linked to your executable]) +fi + diff --git a/m4/ax_boost_chrono.m4 b/m4/ax_boost_chrono.m4 index f5d72458..18cd5a76 100644 --- a/m4/ax_boost_chrono.m4 +++ b/m4/ax_boost_chrono.m4 @@ -106,17 +106,13 @@ AC_DEFUN([AX_BOOST_CHRONO], done no_find="no" - if test "x$ax_lib" = "x"; then - if test "x$ax_static_lib" = "x"; then - no_find="yes" - fi + if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then + no_find="yes" fi no_link="no" - if test "x$link_chrono" != "xyes"; then - if test "x$link_chrono_static" != "xyes"; then - no_link="yes" - fi + if [[ "$link_chrono" == "no" ]] && [[ "$link_chrono_static" == "no" ]]; then + no_link="yes" fi else @@ -127,21 +123,23 @@ AC_DEFUN([AX_BOOST_CHRONO], done fi - if test "x$ax_lib" = "x"; then + if [[ -z "$ax_lib" ]]; then AC_MSG_WARN(Could not find a dynamic version of boost_chrono) - elif test "x$ax_static_lib" = "x"; then + fi + if [[ -z "$ax_static_lib" ]]; then AC_MSG_WARN(Could not find a static version of boost_chrono) fi - if test "x$no_find" = "xyes"; then + if [[ "$no_find" == "yes" ]]; then AC_MSG_ERROR(Could not find any version boost_chrono to link to) fi - if test "x$link_chrono" = "xno"; then + if [[ "$link_chrono" = "no" ]]; then AC_MSG_WARN(Could not dynamic link against $ax_lib) - elif test "x$link_chrono_static" = "xno"; then + fi + if [[ "$link_chrono_static" == "no" ]]; then AC_MSG_WARN(Could not static link against $ax_static_lib) fi - if test "x$no_link" = "xyes"; then + if [[ "$no_link" == "yes" ]]; then AC_MSG_ERROR(Could not link against any boost_chrono lib) fi diff --git a/m4/ax_boost_filesystem.m4 b/m4/ax_boost_filesystem.m4 index daf510f0..d6db5618 100644 --- a/m4/ax_boost_filesystem.m4 +++ b/m4/ax_boost_filesystem.m4 @@ -108,17 +108,13 @@ AC_DEFUN([AX_BOOST_FILESYSTEM], done no_find="no" - if test "x$ax_lib" = "x"; then - if test "x$ax_static_lib" = "x"; then - no_find="yes" - fi + if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then + no_find="yes" fi no_link="no" - if test "x$link_filesystem" != "xyes"; then - if test "x$link_filesystem_static" != "xyes"; then - no_link="yes" - fi + if [[ "$link_filesystem" == "no" ]] && [[ "$link_filesystem_static" == "no" ]]; then + no_link="yes" fi else @@ -129,21 +125,23 @@ AC_DEFUN([AX_BOOST_FILESYSTEM], done fi - if test "x$ax_lib" = "x"; then + if [[ -z "$ax_lib" ]]; then AC_MSG_WARN(Could not find a dynamic version of boost_filesystem) - elif test "x$ax_static_lib" = "x"; then + fi + if [[ -z "$ax_static_lib" ]]; then AC_MSG_WARN(Could not find a static version of boost_filesystem) fi - if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of boost_filesystem to link to) + if [[ "$no_find" == "yes" ]]; then + AC_MSG_ERROR(Could not find any version boost_filesystem to link to) fi - if test "x$link_filesystem" = "xno"; then + if [[ "$link_filesystem" = "no" ]]; then AC_MSG_WARN(Could not dynamic link against $ax_lib) - elif test "x$link_filesystem_static" = "xno"; then + fi + if [[ "$link_filesystem_static" == "no" ]]; then AC_MSG_WARN(Could not static link against $ax_static_lib) fi - if test "x$no_link" = "xyes"; then + if [[ "$no_link" == "yes" ]]; then AC_MSG_ERROR(Could not link against any boost_filesystem lib) fi diff --git a/m4/ax_boost_program_options.m4 b/m4/ax_boost_program_options.m4 index f968f6b8..8fa99107 100644 --- a/m4/ax_boost_program_options.m4 +++ b/m4/ax_boost_program_options.m4 @@ -100,17 +100,13 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], done no_find="no" - if test "x$ax_lib" = "x"; then - if test "x$ax_static_lib" = "x"; then - no_find="yes" - fi + if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then + no_find="yes" fi no_link="no" - if test "x$link_program_options" != "xyes"; then - if test "x$link_program_options_static" != "xyes"; then - no_link="yes" - fi + if [[ "$link_program_options" == "no" ]] && [[ "$link_program_options_static" == "no" ]]; then + no_link="yes" fi else @@ -121,21 +117,23 @@ AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], done fi - if test "x$ax_lib" = "x"; then + if [[ -z "$ax_lib" ]]; then AC_MSG_WARN(Could not find a dynamic version of boost_program_options) - elif test "x$ax_static_lib" = "x"; then + fi + if [[ -z "$ax_static_lib" ]]; then AC_MSG_WARN(Could not find a static version of boost_program_options) fi - if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of boost_program_options to link to) + if [[ "$no_find" == "yes" ]]; then + AC_MSG_ERROR(Could not find any version boost_program_options to link to) fi - if test "x$link_program_options" = "xno"; then + if [[ "$link_program_options" = "no" ]]; then AC_MSG_WARN(Could not dynamic link against $ax_lib) - elif test "x$link_program_options_static" = "xno"; then + fi + if [[ "$link_program_options_static" == "no" ]]; then AC_MSG_WARN(Could not static link against $ax_static_lib) fi - if test "x$no_link" = "xyes"; then + if [[ "$no_link" == "yes" ]]; then AC_MSG_ERROR(Could not link against any boost_program_options lib) fi diff --git a/m4/ax_boost_system.m4 b/m4/ax_boost_system.m4 index 7b545fb0..77f72260 100644 --- a/m4/ax_boost_system.m4 +++ b/m4/ax_boost_system.m4 @@ -106,17 +106,13 @@ AC_DEFUN([AX_BOOST_SYSTEM], done no_find="no" - if test "x$ax_lib" = "x"; then - if test "x$ax_static_lib" = "x"; then - no_find="yes" - fi + if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then + no_find="yes" fi no_link="no" - if test "x$link_system" != "xyes"; then - if test "x$link_system_static" != "xyes"; then - no_link="yes" - fi + if [[ "$link_system" == "no" ]] && [[ "$link_system_static" == "no" ]]; then + no_link="yes" fi else @@ -127,21 +123,23 @@ AC_DEFUN([AX_BOOST_SYSTEM], done fi - if test "x$ax_lib" = "x"; then + if [[ -z "$ax_lib" ]]; then AC_MSG_WARN(Could not find a dynamic version of boost_system) - elif test "x$ax_static_lib" = "x"; then + fi + if [[ -z "$ax_static_lib" ]]; then AC_MSG_WARN(Could not find a static version of boost_system) fi - if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of boost_system to link to) + if [[ "$no_find" == "yes" ]]; then + AC_MSG_ERROR(Could not find any version boost_system to link to) fi - if test "x$link_system" = "xno"; then + if [[ "$link_system" = "no" ]]; then AC_MSG_WARN(Could not dynamic link against $ax_lib) - elif test "x$link_system_static" = "xno"; then + fi + if [[ "$link_system_static" == "no" ]]; then AC_MSG_WARN(Could not static link against $ax_static_lib) fi - if test "x$no_link" = "xyes"; then + if [[ "$no_link" == "yes" ]]; then AC_MSG_ERROR(Could not link against any boost_system lib) fi diff --git a/m4/ax_boost_timer.m4 b/m4/ax_boost_timer.m4 index 543a21bc..28477e7a 100644 --- a/m4/ax_boost_timer.m4 +++ b/m4/ax_boost_timer.m4 @@ -107,17 +107,13 @@ AC_DEFUN([AX_BOOST_TIMER], done no_find="no" - if test "x$ax_lib" = "x"; then - if test "x$ax_static_lib" = "x"; then - no_find="yes" - fi + if [[ -z "$ax_lib" ]] && [[ -z "$ax_static_lib" ]]; then + no_find="yes" fi no_link="no" - if test "x$link_timer" != "xyes"; then - if test "x$link_timer_static" != "xyes"; then - no_link="yes" - fi + if [[ "$link_timer" == "no" ]] && [[ "$link_timer_static" == "no" ]]; then + no_link="yes" fi else @@ -128,21 +124,23 @@ AC_DEFUN([AX_BOOST_TIMER], done fi - if test "x$ax_lib" = "x"; then + if [[ -z "$ax_lib" ]]; then AC_MSG_WARN(Could not find a dynamic version of boost_timer) - elif test "x$ax_static_lib" = "x"; then + fi + if [[ -z "$ax_static_lib" ]]; then AC_MSG_WARN(Could not find a static version of boost_timer) fi - if test "x$no_find" = "xyes"; then - AC_MSG_ERROR(Could not find any version of boost_timer to link to) + if [[ "$no_find" == "yes" ]]; then + AC_MSG_ERROR(Could not find any version boost_timer to link to) fi - if test "x$link_timer" = "xno"; then + if [[ "$link_timer" = "no" ]]; then AC_MSG_WARN(Could not dynamic link against $ax_lib) - elif test "x$link_timer_static" = "xno"; then + fi + if [[ "$link_timer_static" == "no" ]]; then AC_MSG_WARN(Could not static link against $ax_static_lib) fi - if test "x$no_link" = "xyes"; then + if [[ "$no_link" == "yes" ]]; then AC_MSG_ERROR(Could not link against any boost_timer lib) fi