Don't respect them if they're already set because this makes it awkward
to call go-env_set_compile_environment() more than once. It is unlikely
that users would want to set Go-specific flags for C and C++ code.
Ebuilds can simply adjust the non-Go flags instead.

Signed-off-by: James Le Cuirot <[email protected]>
---
 eclass/go-env.eclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index 5077da70ab85..42c5476e0204 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -53,10 +53,11 @@ go-env_set_compile_environment() {
                fi
        fi
 
-       export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
-       export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"
-       export CGO_CXXFLAGS="${CGO_CXXFLAGS:-$CXXFLAGS}"
-       export CGO_LDFLAGS="${CGO_LDFLAGS:-$LDFLAGS}"
+       export \
+               CGO_CFLAGS=${CFLAGS} \
+               CGO_CPPFLAGS=${CPPFLAGS} \
+               CGO_CXXFLAGS=${CXXFLAGS} \
+               CGO_LDFLAGS=${LDFLAGS}
 
        # bug #929219
        if tc-is-gcc ; then
-- 
2.53.0


Reply via email to