Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb52d1c

Browse files
committed
Improve meson's detection of perl build flags
The current method of detecting perl build flags breaks if the path toperl contains a space. This change makes two improvements. First,instead of getting a list of ldflags and ccdlflags and then trying tofilter those out of the reported ldopts, we tell perl to suppressreporting those in the first instance. Second, it tells perl to parsethose and output them, one per line. Thus any space on the option in afile name, for example, is preserved.Issue reported off-list by Muralikrishna BandaruDiscussion:https://postgr.es/01117f88-f465-bf6c-9362-083bd72ca305@dunslane.netBackpatch to release 16.
1 parent0a0db46 commitcb52d1c

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

‎meson.build

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,20 +1074,19 @@ if not perlopt.disabled()
10741074
# Config's ccdlflags and ldflags. (Those are the choices of those who
10751075
# built the Perl installation, which are not necessarily appropriate
10761076
# for building PostgreSQL.)
1077-
ldopts=run_command(perl,'-MExtUtils::Embed','-e','ldopts',check:true).stdout().strip()
1078-
undesired=run_command(perl_conf_cmd,'ccdlflags',check:true).stdout().split()
1079-
undesired+=run_command(perl_conf_cmd,'ldflags',check:true).stdout().split()
1080-
1081-
perl_ldopts= []
1082-
foreachldopt: ldopts.split('')
1083-
if ldopt==''or ldoptinundesired
1084-
continue
1085-
endif
1086-
1087-
perl_ldopts+= ldopt.strip('"')
1088-
endforeach
1077+
perl_ldopts=run_command(perl,'-e','''
1078+
use ExtUtils::Embed;
1079+
use Text::ParseWords;
1080+
# tell perl to suppress including these in ldopts
1081+
*ExtUtils::Embed::_ldflags =*ExtUtils::Embed::_ccdlflags = sub { return ""; };
1082+
# adding an argument to ldopts makes it return a value instead of printing
1083+
# print one of these per line so splitting will preserve spaces infile names.
1084+
# shellwords eats backslashes, so we need to escape them.
1085+
(my $opts = ldopts(undef)) =~ s!\\!\\\\!g;
1086+
print "$_\n" foreach shellwords($opts);
1087+
''',
1088+
check:true).stdout().strip().split('\n')
10891089

1090-
message('LDFLAGS recommended by perl: "@0@"'.format(ldopts))
10911090
message('LDFLAGS for embedding perl: "@0@"'.format(''.join(perl_ldopts)))
10921091

10931092
perl_dep_int=declare_dependency(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp