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

Commit76f2a0e

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 parentbc46104 commit76f2a0e

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

1088-
message('LDFLAGS recommended by perl: "@0@"'.format(ldopts))
10891088
message('LDFLAGS for embedding perl: "@0@"'.format(''.join(perl_ldopts)))
10901089

10911090
perl_dep_int=declare_dependency(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp