commit:     845833bbd940f60434c682562d516c5ace24c3e0
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 10 07:27:05 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jan 10 08:19:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=845833bb

scripts/bootstrap-prefix: propagate *FLAGS to target too

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 9ce12729e3..cced408b42 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1454,10 +1454,11 @@ do_emerge_pkgs() {
                done
                myuse=( ${myuse} )
 
-               # Portage seems to ignore USE= for build dependencies.  Since
-               # that's what we're more or less doing all the time, encode the
-               # USE-flags in profiles/use.mask and profiles/use.force which
-               # normally do not exist.
+               # Portage seems to ignore USE=, *FLAGS for target dependencies.
+               # Since that's what we're more or less doing all the time,
+               # encode the USE-flags in profiles/use.mask and
+               # profiles/use.force which normally do not exist.  Get LDFLAGS
+               # set through make.conf.
                rm -f "${EPREFIX}"/usr/portage/profiles/use.{mask,force}
                for use in "${myuse[@]}" ; do
                        case "${use}" in
@@ -1469,6 +1470,12 @@ do_emerge_pkgs() {
                                        ;;
                                esac
                done
+               sed -i -e '/#stage3_temp#/d' 
"${EPREFIX}"/tmp/etc/portage/make.conf
+               {
+                       echo "CFLAGS=\"\${CFLAGS} ${OVERRIDE_CFLAGS}\" 
#stage3_temp#"
+                       echo "CXXFLAGS=\"\${CXXFLAGS} ${OVERRIDE_CXXFLAGS}\" 
#stage3_temp#"
+                       echo "LDFLAGS=\"\${LDFLAGS} ${LDFLAGS}\" #stage3_temp#"
+               } >> "${EPREFIX}"/tmp/etc/portage/make.conf
 
                # Disable the STALE warning because the snapshot frequently 
gets stale.
                #
@@ -1491,6 +1498,7 @@ do_emerge_pkgs() {
                )
                [[ $? -eq 0 ]] || return 1
                rm -f "${EPREFIX}"/usr/portage/profiles/use.{mask,force}
+               sed -i -e '/#stage3_temp#/d' 
"${EPREFIX}"/tmp/etc/portage/make.conf
 
                case ${pkg},${CHOST} in
                app-shells/bash,*-cygwin*)

Reply via email to