While trying to build a fresh copy of Apache 2.0 from Apache's anonymous CVS
repository on FreeBSD 4.2-R (after building and installing GNU m4, libtool,
and autoconf), I ran into the following error,
% ./buildconf
% ./configure
...
./config.status: 715: Syntax error: "done" unexpected (expecting ")")
A syntax check confirms this,
% sh -n config.status
config.status: 715: Syntax error: "done" unexpected (expecting ")")
The offending section of config.status looks like,
709 # CONFIG_COMMANDS section.
710 #
711 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: &&
continue
712 ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
713 ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
714
715 case $ac_dest in
716 esac
717 done
FreeBSD 4.2-R's sh manual page says,
The syntax of the case command is
case word in
pattern) list ;;
...
esac
The pattern can actually be one or more patterns (see Shell
^^^^^^^^^^^^^^^^^^^^
Patterns described later), separated by ``|'' characters.
So, this is failing because there are no patterns between the case and esac
in lines 715 and 716.
To confirm this, I changed config.status manually as shown here
--- config.status Tue May 22 15:16:37 2001
+++ backup/config.status Tue May 22 15:15:40 2001
@@ -713,8 +713,6 @@
ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
case $ac_dest in
- *)
- ;;
esac
done
and config.status runs to completion (when run by hand, of course).
This makes me ask a few questions,
1) Is FreeBSD 4.2-R's sh implementation conformant? At first glance, it
doesn't appear that the Single Unix Spec V2 covers this detail but I'm sure
that I could have missed it.
Search for the second occurrence of "esac" in this document,
http://www.opengroup.org/onlinepubs/007908799/xcu/chap2.html
2) Is configure emitting conformant sh code for this example?
3) Is there a workaround?
Charles