On Thu, Jul 17, 2025 at 02:28:20AM +0100, Gavin Smith wrote:
> The responsible code is in tta/configure.ac:
>
>
> -------------------------------------------------------------------------
> # SWIG interfaces
>
> # FIXME if enable_xs=yes and embedded_perl=no, the interface will need
> # to build against libperl explicitely, it was verified for Python.
> # libperl may not be available even if enable_xs=yes.
> # Therefore it would be nice to check a link against libperl here.
> # It is not the case for the Perl SWIG interface.
>
> with_swig=check
> AC_ARG_WITH([swig],
> AS_HELP_STRING([--with-swig], [build SWIG interfaces (default: check)]),
> [ with_swig='yes' ],
> [ with_swig='no' ])
>
> if test $with_swig != 'no' ; then
> # Find swig executable
> # http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html
> AX_PKG_SWIG([], [ with_swig='yes' ],
> [if test $with_swig = 'yes' ; then
> AC_MSG_ERROR([SWIG not found'])
> # should never go there, but in case, set
> with_swig=no
> fi
> ])
> fi
>
> AM_CONDITIONAL([SWIG_INTERFACES], [test "x$with_swig" = "xyes"])
> -------------------------------------------------------------------------
>
> Despite appearances, './configure --without-swig' ends in the
> same error message.
The problem with the code above, I believe, was that first with_swig
was set to 'check'. This is equivalent to --with_swig=check being
given on the command line.
-- Macro: AC_ARG_WITH (PACKAGE, HELP-STRING, [ACTION-IF-GIVEN],
[ACTION-IF-NOT-GIVEN])
The option now looks like it was given, so the third argument to
AC_ARG_WITH, [ with_swig='yes' ], runs, leading to AX_PKG_SWIG running
and failing.
The third argument should be blank, as in the examples in the autoconf
manual.