Test for C++11 compiler at configure time
Closed this issue · 4 comments
I understand that the 3.1 release requires a C++11 compiler. The build fails with a pre-C++11 compiler like g++-4.2.1 with errors such as:
../src/msg/ver_to_vernum.re:29: error: ‘constexpr’ does not name a type
The build process should have printed an error during the configure phase that clearly stated that the compiler did not support C++11 and that this was required, rather than continuing and trying to build and failing with an error that is more confusing to users.
Out of curiosity, why is the old compiler version g++-4.2.1 used?
Fixed
Thanks!
Out of curiosity, why is the old compiler version g++-4.2.1 used?
The user who reported this problem uses a PowerPC Mac. Mac OS X 10.5.8 is the newest version available for PowerPC. Xcode 3.1.4 is the newest version available for that OS. gcc 4.2.1 is the newest compiler included in that version of Xcode. MacPorts by default uses a compiler from Xcode unless told to do otherwise. When the re2c 3.1 update was committed to MacPorts we had not realized that it now required C++11 so we had not told MacPorts to select a C++11-compatible compiler (but now we have).
Oh, good! Thanks for the detailed explanation.