編譯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;
}