In 2.13, an AC_OUTPUT line that specified INIT-CMDS but no EXTRA-CMDS
was fine: the generated configure script worked.  In 2.5x, the same
AC_OUTPUT line produces a configure script that will write a malformed
config.status.

The bug is actually in AC_CONFIG_COMMANDS: it can be reproduced by
this modern script:

$ cat configure.ac
AC_INIT(test, 0)
AC_PREREQ(2.52)
AC_CONFIG_COMMANDS(default, , [echo hi there])
AC_OUTPUT

$ autoconf
$ ./configure
configure: creating ./config.status
hi there
./config.status: 233: Syntax error: "done" unexpected (expecting ")")

Here's the problem chunk of shell:

cat >>$CONFIG_STATUS <<\EOF

#
# CONFIG_COMMANDS section.
#
for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`

  case $ac_dest in
  esac
done
EOF

Note the empty case statement.

Replacing that AC_CONFIG_COMMANDS line with

AC_CONFIG_COMMANDS(default, [true], [echo hi there])

produces a correct script:

  case $ac_dest in
    default ) true ;;
  esac

This construct really did appear in Apache's configure.in; this is not
a hypothetical problem.

zw

Reply via email to