[Buildroot] [git commit] package/Makefile.in: replace invocation of tempfile w/ mktemp in try-run

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sat Jun 30 16:21:24 UTC 2018

commit: https://git.buildroot.net/buildroot/commit/?id=5d08d34b3dd44b7d4d9421ae020b80d9a5065015
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

mktemp is included in GNU Coreutils, and its usage is preferred over


Additionally, some distributions no longer package tempfile, causing
the try-run macro to not work as expected. For example, due to try-run
not behaving as expected, testing for the -no-pie option in the
aespipe package doesn't work, and we build without -no-pie, causing a
build failure.

See also commit 91a08ecc998 (package/Makefile.in: add host-cc-option
macro) which introduced that initial code, explicitly to add -no-pie
when needed.


Signed-off-by: Joseph Kogut <joseph.kogut at gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
 package/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index a268016cdf..f2962767cc 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -239,7 +239,7 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
 # Exit code chooses option. "$$TMP" is can be used as temporary file and
 # is automatically cleaned up.
 try-run = $(shell set -e;               \
-	TMP="$$(tempfile)";             \
+	TMP="$$(mktemp)";               \
 	if ($(1)) >/dev/null 2>&1;      \
 	then echo "$(2)";               \
 	else echo "$(3)";               \

More information about the buildroot mailing list