1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: epunt-cxx.eclass
6 # base-system@gentoo.org
7 # @BLURB: A function to punt C++ compiler checks from autoconf
9 # Support for punting C++ compiler checks from autoconf (based
12 if [[ -z ${_EPUNT_CXX_ECLASS} ]]; then
17 DEPEND=">=app-portage/elt-patches-20170317"
19 # @FUNCTION: epunt_cxx
20 # @USAGE: [dir to scan]
22 # Many configure scripts wrongly bail when a C++ compiler could not be
23 # detected. If dir is not specified, then it defaults to ${S}.
25 # https://bugs.gentoo.org/73450
28 [[ -z ${dir} ]] && dir=${S}
29 ebegin "Removing useless C++ checks"
31 while IFS= read -r -d '' f; do
32 for p in "${EPREFIX}/usr/share/elt-patches"/nocxx/*.patch ; do
33 if patch --no-backup-if-mismatch -p1 "${f}" "${p}" >/dev/null ; then
38 done < <(find "${dir}" -name configure -print0)
40 if [[ -z ${any_found} ]]; then
41 eqawarn "epunt_cxx called unnecessarily (no C++ checks to punt)."