meson.eclass: only default BUILD_FLAGS to FLAGS if not cross-compiling
authorMike Gilbert <floppym@gentoo.org>
Sun, 3 May 2020 15:18:12 +0000 (11:18 -0400)
committerMike Gilbert <floppym@gentoo.org>
Sun, 3 May 2020 15:18:12 +0000 (11:18 -0400)
Bug: https://bugs.gentoo.org/720818
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
eclass/meson.eclass

index dce5fffd894c3adf01698d43ba03ded6e5fda204..13daa961c7bdb68e409e6a46d78909749960c710 100644 (file)
@@ -288,9 +288,15 @@ meson_src_configure() {
        debug-print-function ${FUNCNAME} "$@"
 
        tc-export_build_env
-       : ${BUILD_FCFLAGS:=${FCFLAGS}}
-       : ${BUILD_OBJCFLAGS:=${OBJCFLAGS}}
-       : ${BUILD_OBJCXXFLAGS:=${OBJCXXFLAGS}}
+       if tc-is-cross-compiler; then
+               : ${BUILD_FCFLAGS:=-O1 -pipe}
+               : ${BUILD_OBJCFLAGS:=-O1 -pipe}
+               : ${BUILD_OBJCXXFLAGS:=-O1 -pipe}
+       else
+               : ${BUILD_FCFLAGS:=${FCFLAGS}}
+               : ${BUILD_OBJCFLAGS:=${OBJCFLAGS}}
+               : ${BUILD_OBJCXXFLAGS:=${OBJCXXFLAGS}}
+       fi
 
        local mesonargs=(
                meson setup