今天新裝了個linux系統。因為版本比較低,所以對libtool, automake, autoconf, m4, pkg-config進行了升級。
結果沒有想到出了一個很是奇怪的錯誤。是在編譯一個程式時,configure已經過了,在make的時候報的錯誤。
libtool: unrecognized option `--tag=CC'
Try `libtool --help' for more information.
它說不認識--tag這個參數,查看了,可是是有的:
[zhaowei@localhost src]$ libtool --help
Usage: libtool [OPTION]... [MODE-ARG]...
Provide generalized library-building support services.
--config show all configuration variables
--debug enable verbose shell tracing
-n, --dry-run display commands without modifying any files
--features display basic configuration information and exit
--finish same as `--mode=finish'
--help display this help message and exit
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
--quiet same as `--silent'
--silent don't print informational messages
--tag=TAG use configuration variables from tag TAG
--version print version information
MODE must be one of the following:
clean remove files from the build directory
compile compile a source file into a libtool object
execute automatically set library path, then run a program
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
uninstall remove libraries from an installed directory
MODE-ARGS vary depending on the MODE. Try `libtool --help --mode=MODE' for
a more detailed description of MODE.
Report bugs to <bug-libtool@gnu.org>.
後來發現,在我編譯的這個程式目錄下的libtool沒有這個--tag參數,這個東西是autogen.sh這個指令碼產生configure檔案時產生的。
現在問題明朗了,libtool會使用ltmain.sh這個指令碼,每次產生的時候,libtool會拷貝一個ltmain.sh到當前的程式目錄中。那就是這個ltmain.sh的版本不對了。我升級了libtool,但還保留了原來的,於是新的libtool居然使用了舊的ltmain.sh。新的libtool我安裝到/usr/local/下了,所以ltmain.sh在/usr/local/share/libtool下,老的在/usr/share/libtool下,我把老的libtool徹底刪除就ok了。