Cannot Generate configure script on CentOS 6
Environment Info
- OS: CentOS 6.10
- AutoConf: v2.68 via EPEL autoconf268 package
Expected Behavior
Clone the repository and build libxml from source tag v2.9.9 using:
./autogen.sh
make
- obtain a build of libxml2
Actual Behavior
.autogen.sh
Error:
./configure: line 13241: syntax error near unexpected token `else'
./configure: line 13241: `else'
Description of Problem
When attempting to build from the cloned repository from tag v2.9.9 autogen.sh
fails to create the proper configure
script on CentOS 6.
The problem happens when configure.ac
is transformed into configure
. Note the missing clause after elif test $pkg_failed = untried; then
in the CentOS 6 version that is present in the CentOS 7 version.
Note: I did also try modifying
autogen.sh
to useautoreconf268
to attempt using a much more recent version of autoconf than is shipped in CentOS 6.10 proper. This also did not allow the build to complete.
CentOS 6
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
Z_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "zlib" 2>&1`
else
Z_PKG_ERRORS=`$PKG_CONFIG --print-errors "zlib" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$Z_PKG_ERRORS" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
elif test $pkg_failed = untried; then
else
Z_CFLAGS=$pkg_cv_Z_CFLAGS
Z_LIBS=$pkg_cv_Z_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
WITH_ZLIB=1
fi
CentOS 7
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
Z_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib" 2>&1`
else
Z_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$Z_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
else
Z_CFLAGS=$pkg_cv_Z_CFLAGS
Z_LIBS=$pkg_cv_Z_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
WITH_ZLIB=1
fi
This is the culprit causing the error noted above. Building this across multiple distributions it seems the root cause is the local version of autoconf.
Viewing the configure
script in the tarball of v2.9.9 available on the xmlsoft ftp server shows that it was generated by autoconf 2.69.
# Generated by GNU Autoconf 2.69.
Confirmed that I can build on CentOS 6.10 if using the tarball.