Michael Haubenwallner writes: ... So, here comes $USERLAND into account: When USERLAND != GNU, mktemp is assumed being BSD-mktemp, and is called "mktemp -t tmp". Now look the difference (I've access to some FreeBSD machine): FreeBSD $ mktemp -t tmp /tmp/tmp.WHZmcERq Linux $ mktemp -t tmp mktemp: cannot create temp file /tmp/tmp: Invalid argument AIX $ mktemp -t tmp /tmp/tmp AIX $ mktemp -t tmp mktemp: cannot create temp file : Error 0 I've seen this "Error 0" message during gcc-install a few times... So when there is no file /tmp/tmp on AIX, mktemp creates it. If it already exists, no tempfile is created, and the error goes to stderr, while to stdout goes nothing. So emktemp() does not give any tempfile, and has_m32() ends up with $temp being empty, passing an empty string as outputfile to gcc, and using ".c" as input file. [snip GCC compilation related stuff] As a possible consequence, there is one way to call both BSD and GNU mktemp the same way, always creating temporary files: FreeBSD$ mktemp -t tmp.XXXXXXXXXX /tmp/tmp.XXXXXXXX.1vllylRd Linux$ mktemp -t tmp.XXXXXXXXXX /tmp/tmp.XXXXoJdGIL AIX$ mktemp -t tmp.XXXXXXXXXX /tmp/tmp.XXXXlnhdUa /haubi/ I can add that Solaris also does this same behaviour. Darwin's doesn't, but we're in Prefix anyway. So basically only GNU and FreeBSD are of relevance here. The result of the attached patch is that the conditional USERLAND code disappears, which I think is groovy.
Created attachment 115918 [details, diff] emktemp.patch the patch.
looks good, merged