toolchain.eclass: pass CONFIG_SHELL to emake, bug #664486
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 30 Sep 2018 12:08:22 +0000 (13:08 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 30 Sep 2018 12:13:46 +0000 (13:13 +0100)
Christian reports 'make install' failure caused by limitation
of ancient autotools in detecting CONFIG_SHELL:

```
    /bin/bash .../gcc-3.3.6/libstdc++-v3/../mkinstalldirs \
              .../gcc-3.3.6-r2/image//usr/lib/../lib32
    /bin/bash ../libtool  --mode=install /bin/bash .../gcc-3.3.6/install-sh \
        -c libsupc++.la .../gcc-3.3.6-r2/image//usr/lib/../lib32/libsupc++.la
    libtool: install: `.../gcc-3.3.6-r2/image//usr/lib/../lib32/libsupc++.la' \
        is not a directory
```

We already pass CONFIG_SHELL to top-level ./configure.
The workaround is to pass CONFIG_SHELL variable to 'make' as well.

Reported-by: Christian Schmidt
Fixed-by: Christian Schmidt
Bug: https://bugs.gentoo.org/664486
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain.eclass

index ef0d7ab1f99925f401ebfd5f66122dc75103a10d..e2629d40393d555092865350902cbe23feded271 100644 (file)
@@ -1350,7 +1350,7 @@ toolchain_src_configure() {
        addwrite /dev/zero
        echo "${S}"/configure "${confgcc[@]}"
        # Older gcc versions did not detect bash and re-exec itself, so force the
-       # use of bash.  Newer ones will auto-detect, but this is not harmeful.
+       # use of bash.  Newer ones will auto-detect, but this is not harmful.
        CONFIG_SHELL="${EPREFIX}/bin/bash" \
        bash "${S}"/configure "${confgcc[@]}" || die "failed to run configure"
 
@@ -1625,6 +1625,11 @@ toolchain_src_compile() {
        [[ ! -x /usr/bin/perl ]] \
                && find "${WORKDIR}"/build -name '*.[17]' -exec touch {} +
 
+       # Older gcc versions did not detect bash and re-exec itself, so force the
+       # use of bash.  Newer ones will auto-detect, but this is not harmful.
+       # This needs to be set for compile as well, as it's used in libtool
+       # generation, which will break install otherwise (at least in 3.3.6): #664486
+       CONFIG_SHELL="${EPREFIX}/bin/bash" \
        gcc_do_make ${GCC_MAKE_TARGET}
 }