error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version 0.18 but the autoconf macros are from gettext version 0.19 时间: 2018-12-15 13:50 分类: JAVA ####前言 今天在修改`aria2`最大线程数后编译的时候报了这个错误: ``` root@fuck:/opt/aria2-master# make make all-recursive make[1]: Entering directory '/opt/aria2-master' Making all in po make[2]: Entering directory '/opt/aria2-master/po' *** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version 0.18 but the autoconf macros are from gettext version 0.19 Makefile:168: recipe for target 'check-macro-version' failed make[2]: *** [check-macro-version] Error 1 make[2]: Leaving directory '/opt/aria2-master/po' Makefile:556: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/opt/aria2-master' Makefile:467: recipe for target 'all' failed make: *** [all] Error 2 ``` 最终在 Google 大佬的帮助下找到解决办法。 ####过程 简单记录下`aria2`修改最大线程数的方法吧: 首先下载源码: ``` git clone https://github.com/aria2/aria2.git ``` 然后修改`aria2/src/OptionHandlerFactory.cc`文件。 将 ``` OptionHandler* op(new NumberOptionHandler(PREF_MAX_CONNECTION_PER_SERVER, TEXT_MAX_CONNECTION_PER_SERVER, '1', 1, 16, 'x')); ``` 修改为 ``` OptionHandler* op(new NumberOptionHandler(PREF_MAX_CONNECTION_PER_SERVER, TEXT_MAX_CONNECTION_PER_SERVER, '128', 1, -1, 'x')); ``` 将 ``` PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, '20M', 1_m, 1_g, 'k')); ``` 修改为 ``` PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, '4K', 1_k, 1_g, 'k')); ``` 将 ``` PREF_CONNECT_TIMEOUT, TEXT_CONNECT_TIMEOUT, '60', 1, 600)); ``` 修改为 ``` PREF_CONNECT_TIMEOUT, TEXT_CONNECT_TIMEOUT, '30', 1, 600)); ``` 将 ``` PREF_PIECE_LENGTH, TEXT_PIECE_LENGTH, '1M', 1_m, 1_g)); ``` 修改为 ``` PREF_PIECE_LENGTH, TEXT_PIECE_LENGTH, '4k', 1_k, 1_g)); ``` 将 ``` new NumberOptionHandler(PREF_RETRY_WAIT, TEXT_RETRY_WAIT, '0', 0, 600)); ``` 修改为 ``` new NumberOptionHandler(PREF_RETRY_WAIT, TEXT_RETRY_WAIT, '2', 0, 600)); ``` 将 ``` new NumberOptionHandler(PREF_SPLIT, TEXT_SPLIT, '5', 1, -1, 's')); ``` 修改为 ``` new NumberOptionHandler(PREF_SPLIT, TEXT_SPLIT, '8', 1, -1, 's')); ``` 紧接着执行: > $ autoreconf -i > $ ./configure > $ make && make install 执行到`make`时报最上面的错误。 解决方法: 将`/opt/aria2-master/po/Makefile.in.in`文件用你本地安装的`gettext`目录中的覆盖: > $ cp /usr/share/gettext/po/Makefile.in.in /opt/aria2-master/po/Makefile.in.in 问题得以解决。 标签: 无