Changes between Initial Version and Version 1 of Ticket #50128, comment 5


Ignore:
Timestamp:
Nov 23, 2017, 9:31:06 PM (6 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #50128, comment 5

    initial v1  
    22> then this software now requires C++11
    33
    4 No that doesn't appear to be correct, since the port still builds fine on Leopard and Snow Leopard, which has no built-in C++11 support.
     4No that doesn't appear to be correct, since the port still builds fine on Leopard and Snow Leopard, which have no built-in C++11 support.
    55
    66The configure script checks whether the compiler supports C++11. On Leopard and Snow Leopard, the g++-4.2 compiler is used, and the configure script correctly determines that the compiler does not support C++11 and then apparently uses fallback pre-C++-11 implementations.
     
    1010When the configure script detects that the compiler supports C++11 on macOS with clang, it adds `-stdlib=libc++` to `LDFLAGS`, but we still see a build failure because the author of the configure script forgot that `-stdlib=libc++` would also have to be added to `CXXFLAGS`. We are using tesseract 3.04.01 in MacPorts, which is not the latest version, but the latest code upstream has not fixed this problem. I don't know if this problem has been reported to the developers yet; if not, it should be.
    1111
    12 If we wanted to have tesseract use libc++ on Lion and Mountain Lion, we would want to set `configure.cxx_stdlib libc++` on those systems. That will make MacPorts add `-stdlib=libc++` to `CXXFLAGS`. The potential problem with this, and the reason why we don't go setting this flag on arbitrary ports on a whim, is that tesseract's dependencies would still have been built with libstdc++. If tesseract tries to exchange C++ objects with any of its dependencies' libraries that were built with libstdc++, that will fail.
     12If we wanted to have tesseract use libc++ on Lion and Mountain Lion, we would want to set `configure.cxx_stdlib libc++` on those systems. That will make MacPorts add `-stdlib=libc++` to `CXXFLAGS`. The potential problem with this, and the reason why we don't go setting this flag on arbitrary ports on a whim, is that tesseract's dependencies would still have been built with libstdc++. If a libc++-using tesseract tries to exchange C++ objects with any of its dependencies' libraries that were built with libstdc++, that will fail.
    1313
    14 So it might be better if we base our decision on the value of `configure.cxx_stdlib`. If its `libc++`, use C++11; if not, don't. I'm not sure if there's a flag we can use to convince the configure script to behave that way, or if we have to modify the configure script.
     14So it might be better if we base our decision on the value of `configure.cxx_stdlib`. If it's `libc++`, use C++11; if not, don't. I'm not sure if there's a flag we can use to convince the configure script to behave that way, or if we have to modify the configure script.