编译openwrt时发现如下错误,编译到automake工具时出现如下错误:
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at ./bin/automake.tmp line 3938.
原因是主机上使用的perl版本v5.26.1,已经不支持以前的写法,解决方案是在tools/automake/patches里增加一个patch
210-fix-bug-because-of-high-perl-version.patch
如下:
diff --git a/bin/automake.in b/bin/automake.in
index 0ee37149dd..8ce621d1af 100644
--- a/bin/automake.in
+++ b/automake.in
@@ -3880,7 +3880,8 @@ sub substitute_ac_subst_variables_worker
sub substitute_ac_subst_variables
{
my ($text) = @_;
- $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
+# $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
+ $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
return $text;
}