On Tue, Nov 18, 2025 at 12:39:57AM +0100, Patrice Dumas wrote:
> On Mon, Nov 17, 2025 at 10:56:58AM +0100, Patrice Dumas wrote:
> > One possibility could be to use $Config{ccflags} for all the
> > compilations, including the "Pure C" ones (which could be what you were
> > advocating in your mail). It could bring in more consistency between
> > compilation and linking. There would also be a risk that the flags
> > in $Config{ccflags} bring in something incompatible with gnulib/autoconf
> > config.h and other headers, but we can try and see.
It doesn't appear that CFLAGS was touched much by any gnulib modules, as
far as I can tell, if that helps.
> > Another drawback is
> > that it is harder for the user to override the Perl cflags for "Pure C".
> >
> > I'll try that unless there is another proposal.
>
> I tried it and it looks superficially right, as the compilation passes
> for the OpenCSW solaris 11. However, looking at the logs, the libraries
> and XS modules are not compiled in (except for XSParagraph). That's
> because iconv is not found (nor libintl). I recall that it was what
> happened in the past.
>
> My feeling is that this happens because there is now -I/opt/csw/include
> through Perl config ccflags, but no -L/opt/csw/lib. There is
> LDFLAGS=-L/opt/csw/lib
> but it is not used since PERL_EXT_LDFLAGS is used. And we cannot use
> Perl config ldflags in all the link commands, as there is -lperl in it,
There is -L/opt/csw/lib in Perl ldflags:
unstable11x$ which perl
/opt/csw/bin/perl
unstable11x$ perl -V:ccflags
ccflags='-D_REENTRANT -xO3 -m32 -xarch=pentium_pro -xchip=pentium_pro
-I/opt/csw/bdb48/include -I/opt/csw/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV';
unstable11x$ perl -V:ldflags
ldflags='-m32 -xarch=pentium_pro -xchip=pentium_pro -L/opt/csw/lib -lperl
-L/opt/csw/bdb48/lib -L/opt/csw/lib -L/usr/lib -L/usr/ccs/lib -L/lib';
I don't see the problem with having -lperl in all link commands. I imagine
the ldflags value from perl -V would be used in addition to any user-provided
PERL_EXT_LDFLAGS.
So the problem is not with the values from perl -V, the problem is, apparently,
that we don't use them consistently.
I understand you wanted part of the C code to be "Perl free" but texi2any
is still a Perl program and will be for the foreseeable future. It's possible
that building objects, programs or dynamic libraries without any Perl settings
being used would require a separate configure.ac and source directory just
for those build targets.
> Note that there is also
> CFLAGS=-I/opt/csw/include
>
Yes, if I understand correctly CFLAGS and LDFLAGS are not used for this
directory.
> It does not mean that the current approach is wrong, though, rather it
> seems to me that PERL_EXT_LDFLAGS and PERL_EXT_CFLAGS should be used, set
> to -L/opt/csw/lib and -I/opt/csw/include as it is probably what is
> expected in OpenCSW to find the libraries in this environment.
>
> It is still somewhat unclear to me what would be the best choice of
> flags, there does not seems to be one that is clearly better than
> another. We either get too much or too little of Perl flags but never
> the exactly right amount as it depends on the platform and the use of
> PERL_EXT_*.