diff: configure.in: improve check for mktemp

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Nov 2 21:01:56 AEDT 1998


Estimated hours taken: 0.25

configure.in:
	Change the code which checks for `mktemp' so that it
	better handle the case where the `mktemp' command is
	not the one we expect.  In particular, redirect stdin
	from /dev/null (to avoid hanging, waiting for input)
	and check that the output from mktemp matches what we expect.

Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.138
diff -u -r1.138 configure.in
--- configure.in	1998/10/16 06:16:44	1.138
+++ configure.in	1998/10/30 16:16:48
@@ -204,10 +204,10 @@
 AC_PATH_PROG(MKTEMP,mktemp)
 if test "$MKTEMP" != ""; then
 	# check that it really works
-	TMPFILE=`mktemp /tmp/configure.XXXXXX`
+	TMPFILE="`mktemp /tmp/configure.XXXXXX < /dev/null`"
 	case "$TMPFILE" in 
-		"") MKTEMP="" ;;
-		*) rm -f $TMPFILE ;;
+		/tmp/configure.*) rm -f $TMPFILE ;;
+		*) MKTEMP="" ;;
 	esac
 fi
 if test "$MKTEMP" = ""; then

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list