Check whether C++ compiler works. #5195

pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:i5177 changing 1 files +7 −7
  1. paveljanik commented at 10:22 PM on November 1, 2014: contributor

    The macro AC_PROG_CXX doesn't really check whether the C++ compiler works (compare with AC_PROG_CC). This change adds a new local macro AC_PROG_CXX_WORKS that is really checking whether C++ compiler works. See #5177. If there is no C++ compiler installed, configure prints

    checking whether the C++ compiler works... no configure: error: C++ compiler doesn't work.

  2. laanwj commented at 7:48 AM on November 3, 2014: member

    concept ACK

  3. theuni commented at 3:33 AM on November 5, 2014: member

    It looks like libtool is the culprit here. Going by the docs and the linked discussion from #5177, checking for c++ before c (which libtool does) is the suggested fix. Something like:

    diff --git a/configure.ac b/configure.ac
    index 17efd98..3ccec09 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -24,6 +24,13 @@ case $host in
       ;;
     esac
    
    +if test "x${CXXFLAGS+set}" = "xset"; then
    +  CXXFLAGS_overridden=yes
    +else
    +  CXXFLAGS_overridden=no
    +fi
    +
    +AC_PROG_CXX
     LT_INIT([disable-shared])
    
     AH_TOP([#ifndef BITCOIN_CONFIG_H])
    @@ -40,12 +47,6 @@ m4_include([pkg.m4])
     dnl faketime breaks configure and is only needed for make. Disable it here.
     unset FAKETIME
    
    -if test "x${CXXFLAGS+set}" = "xset"; then
    -  CXXFLAGS_overridden=yes
    -else
    -  CXXFLAGS_overridden=no
    -fi
    -
     dnl ==============================================================
     dnl Setup for automake
     dnl ==============================================================
    @@ -60,7 +61,6 @@ dnl make the compilation flags quiet unless V=1 is used
     m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
    
     dnl Checks for programs.
    -AC_PROG_CXX
     AC_PROG_CC
     AC_PROG_CPP
     AC_PROG_CXXCPP
    
  4. paveljanik commented at 6:03 AM on November 5, 2014: contributor

    Yup, this works. It is much better fix then the proposed one. Doesn't bring new autoconfisms, only moves them around!

  5. laanwj commented at 7:54 AM on November 5, 2014: member

    @paveljanik are you going to update this pull to that?

  6. paveljanik commented at 8:53 AM on November 5, 2014: contributor

    @wumpus: yes.

    Pavel Janík

  7. randy-waterhouse commented at 8:59 AM on November 5, 2014: contributor

    My #5214 should address this also. Apologies for coming in over the top but had this 'tidy up' sitting around for a while ...

  8. Check for C++ compiler before C compiler to check if it works 9fa1c43546
  9. paveljanik force-pushed on Nov 5, 2014
  10. wumpus commented at 9:33 AM on November 5, 2014: none

    Jebus, people, this Wumpus IS NOT THE WUMPUS YOU ARE TALKING TO.

  11. paveljanik commented at 9:44 AM on November 5, 2014: contributor

    @wumpus: I'd like to apologize to you. I promise I'll use github's features more carefully next time :+1:

  12. laanwj commented at 12:13 PM on November 6, 2014: member

    Closing, as overlaps with #5214

  13. laanwj closed this on Nov 6, 2014

  14. paveljanik deleted the branch on Nov 6, 2014
  15. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-28 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me