I just ran into this problem trying to build oath-toolkit on my mac. I was able to get past this error by creating a symlink for libxml.m4
after installing with brew install libxml2
.
ln -s /usr/local/opt/libxml2/share/aclocal/libxml.m4 /usr/local/share/aclocal/libxml.m4
I realize this question was asked more than 7 years old, but it took me a while to piece together this solution. I hope it helps. I was able to reproduce the problem my running aclocal
. It errored with configure.ac:38: warning: macro 'AM_PATH_XML2' not found in library
. I then ran aclocal --print-ac-dir
which returned /usr/local/Cellar/automake/1.16.1_1/share/aclocal
. That directory contained a dirlist
file.
cat /usr/local/Cellar/automake/1.16.1_1/share/aclocal/dirlist
/usr/local/share/aclocal
/usr/share/aclocal
The first directory contained all of the other symlinks.
ls -al /usr/local/share/aclocal
lrwxr-xr-x 1 cameron admin 48 Sep 20 08:39 cmake.m4 -> ../../Cellar/cmake/3.15.3/share/aclocal/cmake.m4
lrwxr-xr-x 1 cameron admin 52 Sep 20 09:01 dirlist -> ../../Cellar/automake/1.16.1_1/share/aclocal/dirlist
lrwxr-xr-x 1 cameron admin 53 Sep 20 09:02 libtool.m4 -> ../../Cellar/libtool/2.4.6_1/share/aclocal/libtool.m4
lrwxr-xr-x 1 cameron admin 52 Sep 20 09:02 ltargz.m4 -> ../../Cellar/libtool/2.4.6_1/share/aclocal/ltargz.m4
lrwxr-xr-x 1 cameron admin 50 Sep 20 09:02 ltdl.m4 -> ../../Cellar/libtool/2.4.6_1/share/aclocal/ltdl.m4
lrwxr-xr-x 1 cameron admin 55 Sep 20 09:02 ltoptions.m4 -> ../../Cellar/libtool/2.4.6_1/share/aclocal/ltoptions.m4
lrwxr-xr-x 1 cameron admin 53 Sep 20 09:02 ltsugar.m4 -> ../../Cellar/libtool/2.4.6_1/share/aclocal/ltsugar.m4
lrwxr-xr-x 1 cameron admin 55 Sep 20 09:02 ltversion.m4 -> ../../Cellar/libtool/2.4.6_1/share/aclocal/ltversion.m4
lrwxr-xr-x 1 cameron admin 57 Sep 20 09:02 lt~obsolete.m4 -> ../../Cellar/libtool/2.4.6_1/share/aclocal/lt~obsolete.m4
lrwxr-xr-x 1 cameron admin 51 Aug 27 20:15 pkg.m4 -> ../../Cellar/pkg-config/0.29.2/share/aclocal/pkg.m4
Following that pattern, I could have done:
ln -s /usr/local/Cellar/libxml2/2.9.9_2/share/aclocal/libxml.m4 /usr/local/share/aclocal/libxml.m4
But I chose to use this symlink so that this answer works with various versions.
ls -al /usr/local/opt/libxml2
lrwxr-xr-x 1 cameron admin 25 Sep 20 09:35 /usr/local/opt/libxml2 -> ../Cellar/libxml2/2.9.9_2