meson.eclass: avoid leaking BUILD vars outside meson_src_configure
authorMike Gilbert <floppym@gentoo.org>
Sun, 3 May 2020 17:46:50 +0000 (13:46 -0400)
committerMike Gilbert <floppym@gentoo.org>
Sun, 3 May 2020 17:54:46 +0000 (13:54 -0400)
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
eclass/meson.eclass

index 17875d97c47bf1aea8bf02b83a7197bcbc3aa3ef..773413bb6020f4f5b0f37faef0d9fad18bcf8c5e 100644 (file)
@@ -287,13 +287,26 @@ meson_feature() {
 meson_src_configure() {
        debug-print-function ${FUNCNAME} "$@"
 
-       tc-export_build_env
+       local BUILD_CFLAGS=${BUILD_CFLAGS}
+       local BUILD_CPPFLAGS=${BUILD_CPPFLAGS}
+       local BUILD_CXXFLAGS=${BUILD_CXXFLAGS}
+       local BUILD_FCFLAGS=${BUILD_FCFLAGS}
+       local BUILD_OBJCFLAGS=${BUILD_OBJCFLAGS}
+       local BUILD_OBJCXXFLAGS=${BUILD_OBJCXXFLAGS}
+       local BUILD_LDFLAGS=${BUILD_LDFLAGS}
+
        if tc-is-cross-compiler; then
+               : ${BUILD_CFLAGS:=-O1 -pipe}
+               : ${BUILD_CXXFLAGS:=-O1 -pipe}
                : ${BUILD_FCFLAGS:=-O1 -pipe}
                : ${BUILD_OBJCFLAGS:=-O1 -pipe}
                : ${BUILD_OBJCXXFLAGS:=-O1 -pipe}
        else
+               : ${BUILD_CFLAGS:=${CFLAGS}}
+               : ${BUILD_CPPFLAGS:=${CPPFLAGS}}
+               : ${BUILD_CXXFLAGS:=${CXXFLAGS}}
                : ${BUILD_FCFLAGS:=${FCFLAGS}}
+               : ${BUILD_LDFLAGS:=${LDFLAGS}}
                : ${BUILD_OBJCFLAGS:=${OBJCFLAGS}}
                : ${BUILD_OBJCXXFLAGS:=${OBJCXXFLAGS}}
        fi