On Tue, Nov 18, 2025 at 08:30:52PM +0000, Gavin Smith wrote:
> On Mon, Nov 17, 2025 at 12:24:01AM +0100, Patrice Dumas wrote:
> > > Broadly speaking: I don't have a good understanding of all of this.
> > 
> > You have some, as you actually reimplemented what ExtUtils::Embed does, with
> > more granularity with tta/m4/txi_perl_conf.m4.  And you can do relevant
> > proposals...
> 
> I'm concerned that the build system under tta/ is quite convoluted.  There
> are a lot of variables.  Each built object (library or program) has its
> own flags.  The build system may not have always been particularly
> well-organised but it has grown with the increase in C/XS code (which is
> quite to be expected).

The reason for that convolution is not really the increase of the C/XS
code.  It is part of it, but the main reason is that we have to cope
with three constraints:
* we need to call Perl from C for some specific issues (index sorting,
  locales specific Perl functions, releasing Perl objects when
  destroying some "pure C" data...)
* code built against Perl headers and code built against C headers
  cannot be mixed and need different CPPFLAGS to make sure that Gnulib
  header files are not used when compiling C Perl.
* there need to be a strict ordering of libraries dependencies because
  of the platforms that need to be built with no-undefined.

These constraints are somewhat related to the code size, but not that
much.

> One example: every library built in tta/perl/XSTexinfo/Makefile.am has
> *_CFLAGS specified separately (all 12 of them).  Could we not set it
> once in AM_CFLAGS for the entire Makefile.am?   (Same for *_LDFLAGS.)

Probably something that we could improve, especially if we use Perl
flags everywhere.

> There are *_LIBADD flags for most of these libraries, but they are all
> different, and there doesn't seem to be a way in Automake to set LIBADD
> once for all libraries.  Nearly all of these have $(platform_PERL_LIBADD),
> and it would be easy to miss this out somewhere by mistake (I don't have
> an answer for this).
> 
> (I guess the library interdependencies are like C header files which
> we have to manually maintain inclusions of.)

That's it, and because of the constraints I mentionned above, we need to
do things precisely and there is no place for anything generic here.
Same for CPPFLAGS.

> Maybe the incompatibilities are limited to clashing header file definitions
> and using Perl compiler and/or linker flags with source files compiled with
> Gnulib wouldn't be a problem.

Yes, that's possible, I'll try that.

-- 
Pat

Reply via email to