commit:     8238f31c5c8f4122ba30a0e425e55cef5bc366fe
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 11 13:19:23 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 11 13:23:04 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8238f31c

toolchain.eclass: wire up COBOL

COBOL is dead, long live COBOL! Merged today, so will be available
in next 15 snapshot, or use 15.0.9999 if you really can't wait ;)

Be aware that it's a bit bumpy integration-wise still upstream and
lots of patches are flowing.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain.eclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 5cffbd7428ca..e9f56450a33e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -340,6 +340,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
        tc_version_is_at_least 14.0.0_pre20230423 ${PV} && IUSE+=" rust" 
TC_FEATURES+=( rust )
        tc_version_is_at_least 14.2.1_p20241026 ${PV} && IUSE+=" time64"
        tc_version_is_at_least 15.0.0_pre20241124 ${PV} && IUSE+=" 
libgdiagnostics"
+       tc_version_is_at_least 15.0.0_pre20250316 ${PV} && IUSE+=" cobol"
 fi
 
 if tc_version_is_at_least 10; then
@@ -1255,6 +1256,7 @@ toolchain_src_configure() {
        is_f77 && GCC_LANG+=",f77"
        is_f95 && GCC_LANG+=",f95"
        is_ada && GCC_LANG+=",ada"
+       is_cobol && GCC_LANG+=",cobol"
        is_modula2 && GCC_LANG+=",m2"
        is_rust && GCC_LANG+=",rust"
 
@@ -2600,7 +2602,7 @@ toolchain_src_install() {
        cd "${D}"${BINPATH} || die
        # Ugh: we really need to auto-detect this list.
        #      It's constantly out of date.
-       for x in cpp gcc gccrs g++ c++ gcov gdc g77 gfortran gccgo gnat* ; do
+       for x in cpp gcc gccrs g++ c++ gcobol gcov gdc g77 gfortran gccgo gnat* 
; do
                # For some reason, g77 gets made instead of ${CTARGET}-g77...
                # this should take care of that
                if [[ -f ${x} ]] ; then
@@ -3142,6 +3144,11 @@ is_objcxx() {
        _tc_use_if_iuse cxx && _tc_use_if_iuse objc++
 }
 
+is_cobol() {
+       gcc-lang-supported cobol || return 1
+       _tc_use_if_iuse cobol
+}
+
 is_modula2() {
        gcc-lang-supported m2 || return 1
        _tc_use_if_iuse cxx && _tc_use_if_iuse modula2

Reply via email to