aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorNugra <richiisei@gmail.com>2022-02-15 22:36:50 +0700
committerJens Axboe <axboe@kernel.dk>2022-02-15 14:42:40 -0700
commitcce3026ee45a86cfdd104fd1be270b759a161233 (patch)
treef486a74db008f9b821f5f05eb2c403ffcbb4ee97 /configure
parent99258660a4cdba9afce897d22ed7a6e3e2fac20c (diff)
downloadliburing-cce3026ee45a86cfdd104fd1be270b759a161233.tar.gz
configure: Support busybox mktemp
Busybox mktemp does not support `--tmpdir`, it says: mktemp: unrecognized option: tmpdir It can be fixed with: 1. Create a temporary directory. 2. Use touch to create the temporary files inside the directory. 3. Clean up by deleting the temporary directory. [ammarfaizi2: s/fio/liburing/] Signed-off-by: Nugra <richiisei@gmail.com> Link: https://t.me/GNUWeeb/530154 [ammarfaizi2: Rephrase the commit message and add touch command] Co-authored-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Link: https://lore.kernel.org/r/20220215153651.181319-2-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure13
1 files changed, 8 insertions, 5 deletions
diff --git a/configure b/configure
index 805a671..1f7f1c3 100755
--- a/configure
+++ b/configure
@@ -78,14 +78,17 @@ EOF
exit 0
fi
-TMPC="$(mktemp --tmpdir fio-conf-XXXXXXXXXX.c)"
-TMPC2="$(mktemp --tmpdir fio-conf-XXXXXXXXXX-2.c)"
-TMPO="$(mktemp --tmpdir fio-conf-XXXXXXXXXX.o)"
-TMPE="$(mktemp --tmpdir fio-conf-XXXXXXXXXX.exe)"
+TMP_DIRECTORY="$(mktemp -d)"
+TMPC="$TMP_DIRECTORY/liburing-conf.c"
+TMPC2="$TMP_DIRECTORY/liburing-conf-2.c"
+TMPO="$TMP_DIRECTORY/liburing-conf.o"
+TMPE="$TMP_DIRECTORY/liburing-conf.exe"
+
+touch $TMPC $TMPC2 $TMPO $TMPE
# NB: do not call "exit" in the trap handler; this is buggy with some shells;
# see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
-trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
+trap "rm -rf $TMP_DIRECTORY" EXIT INT QUIT TERM
rm -rf config.log