diff options
author | nia <nia@pkgsrc.org> | 2022-05-21 11:14:56 +0000 |
---|---|---|
committer | nia <nia@pkgsrc.org> | 2022-05-21 11:14:56 +0000 |
commit | e089f1048b0cdaa30ed561c59564d7ae3aa6a64d (patch) | |
tree | c29436ac1556b55687b0f54322aa5a6491aa71a9 /doc/guide | |
parent | 4e599888ac755a44a92cde6d00bd8d26da785b01 (diff) | |
download | pkgsrc-e089f1048b0cdaa30ed561c59564d7ae3aa6a64d.tar.gz |
guide: Notes on C++ standards support in pkgsrc
Diffstat (limited to 'doc/guide')
-rw-r--r-- | doc/guide/files/fixes.xml | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/doc/guide/files/fixes.xml b/doc/guide/files/fixes.xml index e6372fa03bf..9b121d0447e 100644 --- a/doc/guide/files/fixes.xml +++ b/doc/guide/files/fixes.xml @@ -1,4 +1,4 @@ -<!-- $NetBSD: fixes.xml,v 1.170 2022/05/11 22:48:43 rillig Exp $ --> +<!-- $NetBSD: fixes.xml,v 1.171 2022/05/21 11:14:56 nia Exp $ --> <chapter id="fixes"> <?dbhtml filename="fixes.html"?> <title>Making your package work</title> @@ -1399,7 +1399,7 @@ pre-configure: <sect2 id="basic-programming-languages"> <title>C, C++, and Fortran</title> - <para>Compilers for the C, C++, and Fortran languages comes with + <para>Compilers for the C and C++ languages comes with the NetBSD base system. By default, pkgsrc assumes that a package is written in C and will hide all other compilers (via the wrapper framework, see <xref linkend="buildlink" />).</para> @@ -1416,6 +1416,26 @@ pre-configure: <quote>c</quote>. Packages using GNU configure scripts, even if written in C++, usually need a C compiler for the configure phase.</para> + + <para>To express a general requirement on a specific C or C++ + version, normally only <varname>GCC_REQD</varname> needs to be set. + For example, GCC 7 includes support for C++17, so if the package uses + C++17 it should specify: + + <programlisting> + GCC_REQD+= 7 + </programlisting></para> + + <para>Language variants like <literal>c++11</literal> for + <varname>USE_LANGUAGES</varname> should only be specified + if the package does not explicitly set <literal>-std=...</literal> + when compiling (i.e. the package assumes the compiler defaults to + C++11 or some other standard). This is usually a bug in the + upstream build system.</para> + + <para>GCC version 5 includes support for C++14, while GCC 4.7 includes + more-or-less complete support for C++11. For more information, consult + <ulink url="https://gcc.gnu.org/projects/cxx-status.html">GCC's own documentation on programming language support.</ulink></para> </sect2> <sect2 id="java-programming-language"> |