Sphinx/Coreseek 4.1 執行 buildconf.sh 報錯,無法產生configure檔案,
之前在安裝 coorseek 的時候,遇到了一些錯誤,在官網根本看不到解決方案,最後 google 在一個大牛部落格的評論區找到瞭解決方法,頓時把膝蓋獻上去了~~
整理到這裡是為了方便一些人找到,長城防火牆畢竟讓 google 不是那麼友好了 %>_<% 不過大牛的部落格還是上得了的:傳送門
錯誤現象:執行 buildconf.sh 報錯,無法產生configure檔案
提示的主要錯誤為:
libstemmer_c/mkinc.mak:10: warning: source file 'runtime/utilities.c' is in a subdirectory,libstemmer_c/mkinc.mak:10: but option 'subdir-objects' is disabledlibstemmer_c/Makefile.am:3: 'libstemmer_c/mkinc.mak' included from herelibstemmer_c/mkinc.mak:10: warning: source file 'libstemmer/libstemmer.c' is in a subdirectory,libstemmer_c/mkinc.mak:10: but option 'subdir-objects' is disabledlibstemmer_c/Makefile.am:3: 'libstemmer_c/mkinc.mak' included from here/usr/local/share/automake-1.14/am/library.am: warning: 'libstemmer.a': linking libraries using a non-POSIX/usr/local/share/automake-1.14/am/library.am: archiver requires 'AM_PROG_AR' in 'configure.ac'libstemmer_c/Makefile.am:2: while processing library 'libstemmer.a'/usr/local/share/automake-1.14/am/library.am: warning: 'libsphinx.a': linking libraries using a non-POSIX/usr/local/share/automake-1.14/am/library.am: archiver requires 'AM_PROG_AR' in 'configure.ac'src/Makefile.am:14: while processing library 'libsphinx.a'
看起來非常多其實就是兩個:1.but option 'subdir-objects' is disabled 2. archiver requires 'AM_PROG_AR' in 'configure.ac'
解決方案:
1. 在 csft-4.1/buildconf.sh 檔案中,尋找
&& aclocal \
後加上
&& automake --add-missing \
2. 在 csft-4.1/configure.ac 檔案中,尋找:
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
改為:
AM_INIT_AUTOMAKE([-Wall foreign])
尋找:
AC_PROG_RANLIB
後面加上
AM_PROG_AR
3. 最後,在 csft-4.1/src/sphinxexpr.cpp 檔案中, 替換所有:
T val = ExprEval ( this->m_pArg, tMatch );
成為:
T val = this->ExprEval ( this->m_pArg, tMatch );
最後的最後,再次獻上我的膝蓋......