From: David Schleef Date: Fri, 27 Feb 2004 20:47:45 +0000 (+0000) Subject: Add fallback if mktemp utility cannot be found. X-Git-Tag: r0_7_69~101 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=089a4b19d9c4c7f8b7c2ce1cc8d4210c4399c143;p=comedi.git Add fallback if mktemp utility cannot be found. --- 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"