pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/doc/guide/files guide: Notes on C++ standards support ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e393c64a278f
branches:  trunk
changeset: 379653:e393c64a278f
user:      nia <nia%pkgsrc.org@localhost>
date:      Sat May 21 11:14:56 2022 +0000

description:
guide: Notes on C++ standards support in pkgsrc

diffstat:

 doc/guide/files/fixes.xml |  24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r 0c5f2948c5c0 -r e393c64a278f doc/guide/files/fixes.xml
--- a/doc/guide/files/fixes.xml Sat May 21 10:38:50 2022 +0000
+++ b/doc/guide/files/fixes.xml Sat May 21 11:14:56 2022 +0000
@@ -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 @@
   <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 @@
     <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">



Home | Main Index | Thread Index | Old Index