天天看點

LIBTOOL is undefined 問題的解決方法

[plain] ​​view plain​​ ​​copy​​

 ​​print​​​​?​​

configure.ac:10: error: possibly undefined macro: AC_PROG_LIBTOOL  

If this token and others are legitimate, please use m4_pattern_allow.  

See the Autoconf documentation.  

+ automake --foreign --copy --add-missing -Woverride  

src/common/compress/Makefile.am:9: Libtool library used but `LIBTOOL' is undefined  

src/common/compress/Makefile.am:9: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'  

src/common/compress/Makefile.am:9: to `configure.ac' and run `aclocal' and `autoconf' again.  

src/common/compress/Makefile.am:9: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure  

src/common/compress/Makefile.am:9: its definition is in aclocal's search path.  

這個問題我也找了好久,最後看到兩篇文章,記錄下來:

觀點一:

原因分析

aclocal是個掃描程式, 負責掃描configure.ac中所有的宏定義并展開,

上面産生的原因就是找不到LIBTOOL宏的定義之處造成的.

原因就是aclocal與libtool沒有安裝在一個相同目錄下面

aclocal是去預設 安裝目錄 /usr/share/aclocal下面搜尋所有的.m4檔案找所定義的宏,

但是由于安裝了多個aclocal,可能aclocal目錄不存在,實際目錄為/usr/share/aclocal1.10等,

這就造成了aclocal找不到m4檔案的情況, 解決辦法就是将檔案夾aclocal1.10重命名為aclocal.

或者顯示指定路徑 aclocal -I /usr/share/aclocal1.10 -I /usr/share/libtool/m4 --install

或者把/usr/share/libtool/m4下面的檔案都copy至/usr/share/aclocal1.10中.

​​http://welcomemht.blog.sohu.com/143343960.html​​

觀點二:

出現這個問題的原因主要有兩個:

1.沒有安裝aclocal

解決方法:安裝libtool

2.沒有配置正确aclocal的庫LIBTOOL.m4的路徑

解決方法:

—-檢視aclocal的路徑aclocal --print-ac-dir

—-如果相應的*.m4檔案不在這個目錄下,則重新配置路徑,或是将相應的*.m4檔案複制到這個路徑下 (aclocal -I DIR)