Skip to content

Commit 168d449

Browse files
committed
Merge branch 'po/meson-perl-fix' into next
Upgrade the minimum Perl version enforced by meson-based build to match what Makefile-based build uses. * po/meson-perl-fix: meson: fix Perl version check for Meson versions before 1.7.0 meson: bump minimum required Perl version to 5.26.0
2 parents 717d13a + 0bf8d1b commit 168d449

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

meson.build

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,22 @@ endif
778778

779779
# Note that we only set NO_PERL if the Perl features were disabled by the user.
780780
# It may not be set when we have found Perl, but only use it to run tests.
781-
perl = find_program('perl', version: '>=5.8.1', dirs: program_path, required: perl_required)
781+
#
782+
# At the time of writing, executing `perl --version` results in a string
783+
# similar to the following output:
784+
#
785+
# This is perl 5, version 40, subversion 0 (v5.40.0) built for x86_64-linux-thread-multi
786+
#
787+
# Meson picks up the "40" as version number instead of using "v5.40.0"
788+
# due to the regular expression it uses. This got fixed in Meson 1.7.0,
789+
# but meanwhile we have to either use `-V:version` instead of `--version`,
790+
# which we can do starting with Meson 1.5.0 and newer, or we have to
791+
# match against the minor version.
792+
if meson.version().version_compare('>=1.5.0')
793+
perl = find_program('perl', dirs: program_path, required: perl_required, version: '>=5.26.0', version_argument: '-V:version')
794+
else
795+
perl = find_program('perl', dirs: program_path, required: perl_required, version: '>=26')
796+
endif
782797
perl_features_enabled = perl.found() and get_option('perl').allowed()
783798
if perl_features_enabled
784799
build_options_config.set('NO_PERL', '')

0 commit comments

Comments
 (0)