meson.eclass: use a subshell to unexport variables temporarily
authorMike Gilbert <floppym@gentoo.org>
Sun, 3 May 2020 22:11:54 +0000 (18:11 -0400)
committerMike Gilbert <floppym@gentoo.org>
Sun, 3 May 2020 22:17:09 +0000 (18:17 -0400)
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
eclass/meson.eclass

index 393286cbe5ea5427c8402b97e3358c301f941efc..5e50dd75705d312afe3ff3af65774c51d4805295 100644 (file)
@@ -366,22 +366,24 @@ meson_src_configure() {
        # https://bugs.gentoo.org/625396
        python_export_utf8_locale
 
-       # https://bugs.gentoo.org/720818
-       export -n {C,CPP,CXX,F,FC,OBJC,OBJCXX,LD}FLAGS PKG_CONFIG_{LIBDIR,PATH}
-
-       # https://bugs.gentoo.org/720860
-       if ver_test "$(meson --version)" -lt "0.54"; then
-               local -x CFLAGS=${BUILD_CFLAGS}
-               local -x CPPFLAGS=${BUILD_CPPFLAGS}
-               local -x CXXFLAGS=${BUILD_CXXFLAGS}
-               local -x FFLAGS=${BUILD_FCFLAGS}
-               local -x OBJCFLAGS=${BUILD_OBJCFLAGS}
-               local -x OBJCXXFLAGS=${BUILD_OBJCXXFLAGS}
-               local -x LDFLAGS=${BUILD_LDFLAGS}
-       fi
-
-       echo "${mesonargs[@]}" >&2
-       "${mesonargs[@]}" || die
+       (
+               # https://bugs.gentoo.org/720860
+               if ver_test "$(meson --version)" -lt "0.54"; then
+                       local -x CFLAGS=${BUILD_CFLAGS}
+                       local -x CPPFLAGS=${BUILD_CPPFLAGS}
+                       local -x CXXFLAGS=${BUILD_CXXFLAGS}
+                       local -x FFLAGS=${BUILD_FCFLAGS}
+                       local -x OBJCFLAGS=${BUILD_OBJCFLAGS}
+                       local -x OBJCXXFLAGS=${BUILD_OBJCXXFLAGS}
+                       local -x LDFLAGS=${BUILD_LDFLAGS}
+               else
+                       # https://bugs.gentoo.org/720818
+                       export -n {C,CPP,CXX,F,OBJC,OBJCXX,LD}FLAGS PKG_CONFIG_{LIBDIR,PATH}
+               fi
+
+               echo "${mesonargs[@]}" >&2
+               "${mesonargs[@]}"
+       ) || die
 }
 
 # @FUNCTION: meson_src_compile