dev-util/mingw64-runtime: use $(alt_prefix) when cross-building
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 24 Mar 2018 14:34:08 +0000 (14:34 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 24 Mar 2018 14:34:08 +0000 (14:34 +0000)
It's one of the steps to be able to cross-build 'dev-util/mingw64-runtime'
("CBUILD != (CHOST = CTARGET)" case).

Noticed by Marty E. Plummer.

Package-Manager: Portage-2.3.24, Repoman-2.3.6

dev-util/mingw64-runtime/mingw64-runtime-5.0.3-r1.ebuild

index 0dcbcfe06eea7089de6c44c44ad559cb0028aea5..68655a1ed3a576b917dfdd31dc6a9fce80000365 100644 (file)
@@ -35,7 +35,10 @@ is_crosscompile() {
        [[ ${CHOST} != ${CTARGET} ]]
 }
 just_headers() {
-       use headers-only && [[ ${CHOST} != ${CTARGET} ]]
+       is_crosscompile && use headers-only
+}
+alt_prefix() {
+       is_crosscompile && echo /usr/${CTARGET}
 }
 crt_with() {
        just_headers && echo --without-$1 || echo --with-$1
@@ -74,9 +77,9 @@ src_configure() {
        fi
 
        CHOST=${CTARGET} econf \
-               --prefix="${EPREFIX}"/usr/${CTARGET} \
-               --includedir="${EPREFIX}"/usr/${CTARGET}/usr/include \
-               --libdir="${EPREFIX}"/usr/${CTARGET}/usr/lib \
+               --prefix="${EPREFIX}"$(alt_prefix) \
+               --includedir="${EPREFIX}"$(alt_prefix)/usr/include \
+               --libdir="${EPREFIX}"$(alt_prefix)/usr/lib \
                --with-headers \
                --enable-sdk \
                $(crt_with crt) \