pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Wed May  3 08:34:23 UTC 2017

Modified Files:
        pkgsrc/mk: compiler.mk

Log Message:
Add support to USE_LANGUAGES for C++ standards from c++0x to gnu++14.

This allows packages to specify the version of the standard that they
require, and the infrastructure then distils that down in a similar way
to GCC_REQD to the newest standard, avoiding clashes with different -std
requirements based on CXXFLAGS.

Broad concensus on tech-pkg and tested in bulk builds.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 pkgsrc/mk/compiler.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/compiler.mk
diff -u pkgsrc/mk/compiler.mk:1.83 pkgsrc/mk/compiler.mk:1.84
--- pkgsrc/mk/compiler.mk:1.83  Thu Nov 10 20:59:43 2016
+++ pkgsrc/mk/compiler.mk       Wed May  3 08:34:23 2017
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.83 2016/11/10 20:59:43 joerg Exp $
+# $NetBSD: compiler.mk,v 1.84 2017/05/03 08:34:23 jperkin Exp $
 #
 # This Makefile fragment implements handling for supported C/C++/Fortran
 # compilers.
@@ -42,8 +42,9 @@
 # USE_LANGUAGES
 #      Lists the languages used in the source code of the package,
 #      and is used to determine the correct compilers to install.
-#      Valid values are: c, c99, c++, fortran, fortran77, java, objc,
-#      obj-c++, and ada.  The default is "c".
+#      Valid values are: c, c99, c++, c++0x, gnu++0x, c++11, gnu++11,
+#      c++14, gnu++14, fortran, fortran77, java, objc, obj-c++, and
+#      ada.  The default is "c".
 #
 # The following variables are defined, and available for testing in
 # package Makefiles:
@@ -157,6 +158,23 @@ ${_var_}:= ${${_var_}:C/^/_asdf_/1:M_asd
 .  endif
 .endfor
 
+# Pass the compiler flag based on the most recent version of the C++ standard
+# required.  We currently assume that each standard is a superset of all that
+# come after it.
+#
+# If and when the flags differ between compilers we can push this down into
+# the respective mk/compiler/*.mk files.
+#
+_CXX_VERSION_REQD=
+.for _version_ in gnu++14 c++14 gnu++11 c++11 gnu++0x c++0x
+.  if empty(_CXX_VERSION_REQD) && !empty(USE_LANGUAGES:M${_version_})
+USE_LANGUAGES+=                c++
+_CXX_VERSION_REQD=     ${_version_}
+_WRAP_EXTRA_ARGS.CXX+= -std=${_CXX_VERSION_REQD}
+CWRAPPERS_PREPEND.cxx+=        -std=${_CXX_VERSION_REQD}
+.  endif
+.endfor
+
 .if defined(ABI) && !empty(ABI)
 _WRAP_EXTRA_ARGS.CC+=  ${_COMPILER_ABI_FLAG.${ABI}}
 _WRAP_EXTRA_ARGS.CXX+= ${_COMPILER_ABI_FLAG.${ABI}}



Home | Main Index | Thread Index | Old Index