package/Makefile.in: replace invocation of tempfile w/ mktemp in try-run
authorJoseph Kogut <joseph.kogut@gmail.com>
Fri, 29 Jun 2018 21:40:12 +0000 (14:40 -0700)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 30 Jun 2018 16:21:24 +0000 (18:21 +0200)
mktemp is included in GNU Coreutils, and its usage is preferred over
tempfile.

http://lists.gnu.org/archive/html/bug-coreutils/2007-10/msg00134.html

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.

Fixes:
  http://autobuild.buildroot.net/results/db50f4415d18441f94b641ef6dc5a3672678b8b9/
  http://autobuild.buildroot.net/results/76d73f767d3aab3c97d61188f5666899d72ed82d/
  http://autobuild.buildroot.net/results/6aa9031962603354086b49bc49add92fde496ec2/
  http://autobuild.buildroot.net/results/33d22f4d96fb439be8551355290896ef6d3649df/
  http://autobuild.buildroot.net/results/eeec2ed80e147c172ec2d50958b12cfa38b2cc8d/

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/Makefile.in

index a268016cdf67e01ff9947c6a8c5ed21b7fca371e..f2962767cc1b501d148bcfeb7701c3677019c4d1 100644 (file)
@@ -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)";               \