On Jul 18 2025, Gavin Smith wrote:

> 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.

And the assignment with_swig=check should be moved to the fourth
argument.  Otherwise any use of --with-swig or --without-swig is
effectively ignored.

-- 
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

Reply via email to