I got it down to the use of AC_DEFUN_ONCE in the definition of AC_USE_SYSTEM_EXTENSIONS. If configure.ac is AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS_TEST], [ echo here ])# AC_USE_SYSTEM_EXTENSIONS AC_PREREQ([2.63]) AC_INIT([bug], [0.01]) # XXXXX 111111111111111111111111111111111111111111111111111111111111111111111 AS_IF([test 0 = 1], [AC_USE_SYSTEM_EXTENSIONS_TEST]) # XXXXXX 22222222222222222222222222222222222222222222222222222222222222222222 AC_OUTPUT the following appears in configure: # XXXXX 111111111111111111111111111111111111111111111111111111111111111111111 echo here if test 0 = 1; then : fi # XXXXXX 22222222222222222222222222222222222222222222222222222222222222222222 If AC_DEFUN is used instead, this becomes # XXXXX 111111111111111111111111111111111111111111111111111111111111111111111 if test 0 = 1; then : echo here fi # XXXXXX 22222222222222222222222222222222222222222222222222222222222222222222 I found there was a mention of this "hoisting" in a discussion: http://lists.gnu.org/archive/html/autoconf-patches/2009-01/msg00044.html. > Am I going about this the wrong way? > > Suggestions welcome. I haven't investigated or thought about whether this is the right behaviour. _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx https://lists.gnu.org/mailman/listinfo/autoconf