From 089a4b19d9c4c7f8b7c2ce1cc8d4210c4399c143 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 27 Feb 2004 20:47:45 +0000 Subject: [PATCH] Add fallback if mktemp utility cannot be found. --- m4/as-linux.m4 | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/m4/as-linux.m4 b/m4/as-linux.m4 index 8229baaa..85426062 100644 --- a/m4/as-linux.m4 +++ b/m4/as-linux.m4 @@ -286,10 +286,20 @@ AC_DEFUN([AS_LINUX_2_6], [ AC_MSG_CHECKING(for Linux CFLAGS) - tmpdir="`pwd`/tmp-noicrwa" - - rm -rf ${tmpdir} || : - mkdir ${tmpdir} + { + tmpdir=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmpdir" && test -d "$tmpdir" + } || + { + tmpdir=./confstat$$-$RANDOM + (umask 077 && mkdir $tmpdir) + } || + { + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } + } + + tmpdir=`pwd`/$tmpdir cat >${tmpdir}/Makefile < ${TMPFILE} - -get_cflags: + { + tmpdir=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmpdir" && test -d "$tmpdir" + } || + { + tmpdir=./confstat$$-$RANDOM + (umask 077 && mkdir $tmpdir) + } || + { + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } + } + tmpdir=`pwd`/$tmpdir + + #sed "s|\.config|${CONFIG_FILE}|g" ${LINUX_DIR}/Makefile >$tmpdir/Makefile + cat >$tmpdir/Makefile <${tmpdir}/ack + . ${tmpdir}/ack + rm -rf ${tmpdir} LINUX_MODULE_EXT=".o" -- 2.26.2