Replace \? by \{0,1\} in the sed regular expressions, as the former
does not work with Mac OS X's (= BSD's) sed.
I'm a bit confused by the situation here:
According to Mac OS X man pages, the latter syntax is part of the
POSIX 1003.2 standard for basic regular expressions, while the former
is not. According to the manpage installed with my Gentoo linux, neither
is in the POSIX standard.
However, GNU sed accepts both \? and \{0,1\}, while Mac OS X's sed accepts
only \{0,1\}.
AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])
# Split PACKAGE_VERSION into (possibly empty) parts
-VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\1'/`
-VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\3'/`
-VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\1'/`
-ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\3'/`
+VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
+VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
+VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
+ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
# Calculate project version as an integer, using 2 digits for minor version
case $VERSION_MINOR in