Hi!
Let's raise this question again, I'm really puzzled, and I'd like to
be explained what is going on.
Below is the current AC_TRY_CPP, but other AC_TRY have more or less
the same code. In particular, pay attention to the various `rm
conftest'.
| # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
| # ---------------------------------------------------------
| # INCLUDES are not defaulted.
| AC_DEFUN(AC_TRY_CPP,
| [AC_REQUIRE_CPP()dnl
| cat >conftest.$ac_ext <<EOF
| @%:@line __oline__ "configure"
| #include "confdefs.h"
| [$1]
| EOF
| dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
| dnl We used to copy stderr to stdout and capture it in a variable, but
| dnl that breaks under sh -x, which writes compile commands starting
| dnl with ` +' to stderr in eval and subshells.
| ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
| AC_TRY_EVAL(ac_try)
| ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
| if test -z "$ac_err"; then
| ifelse([$2], , :, [rm -rf conftest*
| $2])
| else
| echo "$ac_err" >&AC_FD_CC
| echo "configure: failed program was:" >&AC_FD_CC
| cat conftest.$ac_ext >&AC_FD_CC
| ifelse([$3], , , [ rm -rf conftest*
| $3
| ])dnl
| fi
| rm -f conftest*])
I would like to understand why there are three `rm' while one seems
way enough. It seems like the author took a special care to remove
the conftest files before the user can touch them.
So why do we want to forbid the access to the conftest files?
And then, why should AC_TRY_RUN_NATIVE (hence AC_TRY_COMPILE too) have
a special permission? It is used for AC_CHECK_SIZEOF.
| if AC_TRY_EVAL(ac_link) &&
| test -s conftest${ac_exeext} &&
| (./conftest; exit) 2>/dev/null
| then
| dnl Don't remove the temporary files here, so they can be examined.
| ifelse([$2], , :, [$2])
| else
| echo "configure: failed program was:" >&AC_FD_CC
| cat conftest.$ac_ext >&AC_FD_CC
| ifelse([$3], , , [ rm -fr conftest*
| $3
| ])dnl
| fi
| rm -fr conftest*
| ])# AC_TRY_RUN_NATIVE
Akim