Skip to content
Snippets Groups Projects
  • Niklas Hambüchen's avatar
    57daa860
    autoconf: Fix C++17 detection not working on Ubuntu 16.04. · 57daa860
    Niklas Hambüchen authored
    And probably many other distributions.
    
    Until now, ./configure would fail silently printing a warning
    
        ./configure: line 4621: AX_CXX_COMPILE_STDCXX_17: command not found
    
    and then continuing, later failing with a C++ #error saying that some C++11
    feature isn't supported (it didn't even get to the C++17 features).
    
    This is because older distributions don't come with the
    `AX_CXX_COMPILE_STDCXX_17` m4 macro.
    
    This commit vendors that macro accordingly.
    
    Now ./configure complains correctly:
    
        configure: error: *** A compiler with support for C++17 language features is required.
    
    On Ubuntu 16.04, ./configure completes if a newer compiler is used, e.g. with
    gcc-7 from https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
    using:
    
        ./bootstrap.sh
        ./configure CXX=g++-7 --disable-doc-gen --with-boost=$(nix-build --no-link '<nixpkgs>' -A boost.dev)
    57daa860
    History
    autoconf: Fix C++17 detection not working on Ubuntu 16.04.
    Niklas Hambüchen authored
    And probably many other distributions.
    
    Until now, ./configure would fail silently printing a warning
    
        ./configure: line 4621: AX_CXX_COMPILE_STDCXX_17: command not found
    
    and then continuing, later failing with a C++ #error saying that some C++11
    feature isn't supported (it didn't even get to the C++17 features).
    
    This is because older distributions don't come with the
    `AX_CXX_COMPILE_STDCXX_17` m4 macro.
    
    This commit vendors that macro accordingly.
    
    Now ./configure complains correctly:
    
        configure: error: *** A compiler with support for C++17 language features is required.
    
    On Ubuntu 16.04, ./configure completes if a newer compiler is used, e.g. with
    gcc-7 from https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
    using:
    
        ./bootstrap.sh
        ./configure CXX=g++-7 --disable-doc-gen --with-boost=$(nix-build --no-link '<nixpkgs>' -A boost.dev)