解決perl高版本編譯automake出錯問題

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

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章