commit:     a1be7a24454f9e4985157de636f3fe61f29197b6
Author:     Horodniceanu Andrei <a.horodniceanu <AT> protonmail <DOT> com>
AuthorDate: Mon Aug 21 13:33:07 2023 +0000
Commit:     Marco Leise <marco.leise <AT> gmx <DOT> de>
CommitDate: Thu Aug 31 21:07:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=a1be7a24

dmd.eclass: Properly assign DC when not selfhosting

Signed-off-by: Horodniceanu Andrei <a.horodniceanu <AT> protonmail.com>

 eclass/dmd.eclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/dmd.eclass b/eclass/dmd.eclass
index 47fc51a..e5129e8 100644
--- a/eclass/dmd.eclass
+++ b/eclass/dmd.eclass
@@ -159,7 +159,7 @@ dmd_src_compile() {
        dmd_ge 2.081 && ENABLE_RELEASE="ENABLE_RELEASE" || 
ENABLE_RELEASE="RELEASE"
 
        # Special case for self-hosting (i.e. no compiler USE flag selected).
-       local kernel model
+       local kernel model actual_compiler
        if [ "${DC_VERSION}" == "selfhost" ]; then
                case "${KERNEL}" in
                        "linux")   kernel="linux";;
@@ -175,10 +175,14 @@ dmd_src_compile() {
                if ! dmd_ge 2.094; then
                        export DMD="../../${DMD}"
                fi
+               actual_compiler="${S}/${DMD}"
+       else
+               # Not selfhosting, leave the compiler variable unchanged
+               actual_compiler="${DC}"
        fi
        if dmd_ge 2.094; then
                einfo "Building dmd build script..."
-               DC="${DMD}" dlang_compile_bin dmd/generated/build 
dmd/src/build.d
+               DC="${actual_compiler}" dlang_compile_bin dmd/generated/build 
dmd/src/build.d
                einfo "Building dmd..."
                env VERBOSE=1 ${HOST_DMD}="${DMD}" CXX="$(tc-getCXX)" 
${ENABLE_RELEASE}=1 ${LTO} dmd/generated/build DFLAGS="$(dlang_dmdw_dcflags)" 
dmd
        else

Reply via email to