possibly undefined macro: AC_PROG_LIBTOOL

eeach picture eeach · Dec 5, 2018 · Viewed 8.6k times · Source

I want to build protobuf,so I just clone the package and cd in the directory. When I type ./autogen.sh,some error happened. when I type ./autogen.sh I receive callback:

configure.ac:104: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /home/zhangxl/my/autoconf/bin/autoconf failed with exit status: 1

Some one said I should install libtool,but I have already install autoconf,automake,libtool and m4, but all of them are build from source,because I can't get sudo password. enter image description here This is my .bashrc file:

export PATH=$PATH:/home/zhangxl/my/libtool/bin
export CPLUS_INCLUDE_PATH=/hpme/zhangxl/my/libtool/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=/home/zhangxl/my/libtool/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=/home/zhangxl/my/libtool/lib:$LD_LIBRARY_PATH

I think maybe the .bashrc file is not right,so I want ask for help,very thank you for your answers.

Answer

umläute picture umläute · Dec 18, 2018

libtool is more than just a (set of) binaries. it also includes a couple of m4-macros (to be used by autotools), among them the AC_PROG_LIBTOOL macro.

Since you didn't do a "proper" installation of libtool, autoconf is not finding these additional macros.

Look out for files like libtool.m4, ltoptions.m4 ... (probably somewhere in /home/zhangxl/my/libtool/share/aclocal/ and add the path to the autoreconf invocation. Something like:

autoreconf  -f -i -Wall,no-obsolete -I/home/zhangxl/my/libtool/share/aclocal/

(in case you wondered: autoreconf is being called by autogen.sh, near the end of that script; so when you've called autogen.sh, most things already succeeded, only the invocation of autoreconf failed, and that's what the above line fixes. if you want to be able to call autogen.sh again, you must change the line with autoreconf as seen above)