Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possibly undefined macro: AC_PROG_LIBTOOL

I want to build protobuf, so I just cloned the package and cd in the directory. When I type ./autogen.sh, some error happened.

screenshot of the error 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

Someone said I should install libtool, but I have already installed autoconf, automaker, libtool and m4, but all of them are built from source, because I can't access the sudo password.

screenshot showing the cmd errors.

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 correct.

like image 641
eeach Avatar asked Dec 05 '18 15:12

eeach


3 Answers

Make sure you have libtool installed. This error message can be produced by autoconf if it can not find libtool on your system. In my case, the error looked a bit like this:

autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf
...
configure.ac:41: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.

I was able to fix the issue by installing libtool with apt.

sudo apt-get update
sudo apt-get install libtool
like image 67
Locke Avatar answered Nov 05 '22 15:11

Locke


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)

like image 16
umläute Avatar answered Nov 05 '22 15:11

umläute


I have faced similar issue and to resolve i have removed yum installed package and installed with dnf as shown below

$yum remove automake
$dnf install automake
like image 1
sachin kakatkar Avatar answered Nov 05 '22 14:11

sachin kakatkar