5

When trying to build the Unix QuickFIX engine, I get the following error after ./bootstrap

warning:macro 'AM_PATH_XML2' not found in library

As I understand, libxml2 already comes with XCode OS X Mountain Lion. An answer I found suggested to download libxml2-dev, although I could not find the package using HomeBrew.
I'm relatively new to programming on OS X and Xcode and porting Unix applications, so I'm not sure exactly what I have yet.

zzzzzzzzzzz
  • 250
  • 2
  • 5
  • 13
  • XML definitely isn't a requirement for FIX messages. Unless your counter-party isn't using FIX 4.2, you should be able to ignore this warning. – chrisaycock Jul 29 '12 at 01:55

3 Answers3

11

I did a

brew install libxml2

Then poking around I found the macro AM_PATH_XML2 in /usr/local/Cellar/libxml2/2.8.0/share/aclocal/libxml.m4. Which is all the dev package contents, then I compared to my Ubuntu/Vagrant virtual I have locally that was working fine and remembered to:

brew link --force libxml2

which put the symlink in /usr/local/share/aclocal.

And now I'm building, but I also needed automaker, so to recap

brew install automake autoconf libtool libxml2                                                            
brew link libxml2       
sorin
  • 161,544
  • 178
  • 535
  • 806
Will Ballard
  • 111
  • 2
3

That warning comes from Autoconf and is complaining that the configure.in file refers to the macro AM_PATH_XML2 but it isn't defined. It should be defined in the file aclocal.m4 in the quickfix source, so it seems your version of autoconf isn't finding it. You could try modifying bootstrap to run autoconf -I .

Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521
2

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
Cameron Taggart
  • 5,771
  • 4
  • 45
  • 70