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

Commitdc2a660

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 parent984702d commitdc2a660

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

1084-
message('LDFLAGS recommended by perl: "@0@"'.format(ldopts))
10851084
message('LDFLAGS for embedding perl: "@0@"'.format(''.join(perl_ldopts)))
10861085

10871086
perl_dep_int=declare_dependency(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp