summaryrefslogtreecommitdiffhomepage
path: root/sofort/ccenv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-02-18 14:47:00 -0500
committermidipix <writeonce@midipix.org>2019-02-18 14:49:13 -0500
commit1ea23134457d33f90b1db4b1d3a27f9480ba2429 (patch)
treed0d032383a21f5edc65a1e4b74103b4d06930762 /sofort/ccenv
parent72602c5bdd081970701b73c9dc3d1b8944bbbb84 (diff)
downloadpemagine-1ea23134457d33f90b1db4b1d3a27f9480ba2429.tar.bz2
pemagine-1ea23134457d33f90b1db4b1d3a27f9480ba2429.tar.xz
build system: mktemp(1): provide template, explicitly remove temporary files.
Diffstat (limited to 'sofort/ccenv')
-rw-r--r--sofort/ccenv/ccenv.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 91f613c..e56b452 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -308,7 +308,7 @@ ccenv_set_cc()
ccenv_host=$($ccenv_cc $ccenv_cflags -dumpmachine 2>/dev/null)
ccenv_cchost=$ccenv_host
else
- ccenv_tmp=$(mktemp)
+ ccenv_tmp=$(mktemp ./tmp_XXXXXXXXXXXXXXXX)
ccenv_cmd="$ccenv_cc --target=$ccenv_host -E -xc -"
if [ -z "$mb_user_cc" ]; then
@@ -323,6 +323,9 @@ ccenv_set_cc()
fi
fi
+ rm -f "$ccenv_tmp"
+ unset ccenv_tmp
+
ccenv_cchost=$($ccenv_cc $ccenv_cflags -dumpmachine 2>/dev/null)
fi
@@ -955,7 +958,7 @@ ccenv_output_defs()
if [ $ccenv_cfgtype = 'native' ]; then
- ccenv_tmp=$(mktemp)
+ ccenv_tmp=$(mktemp ./tmp_XXXXXXXXXXXXXXXX)
sed \
-e 's/^\s*$/@/g' \
@@ -967,6 +970,8 @@ ccenv_output_defs()
$ccenv_in > "$ccenv_tmp"
ccenv_in="$ccenv_tmp"
+ else
+ unset ccenv_tmp
fi
ccenv_vars=$(cut -d'=' -f1 "$mb_project_dir/sofort/ccenv/ccenv.vars" \
@@ -1006,6 +1011,11 @@ ccenv_output_defs()
mb_native_host=$ccenv_host
mb_native_cchost=$ccenv_cchost
fi
+
+ if [ -n "${ccenv_tmp:-}" ]; then
+ rm -f "$ccenv_tmp"
+ unset ccenv_tmp
+ fi
}
ccenv_dso_verify()