尝试构建 Unix QuickFIX 引擎时,在 ./bootstrap 之后出现以下错误
warning:macro 'AM_PATH_XML2' not found in library
据我了解,libxml2 已经随 XCode OS X Mountain Lion 一起提供。我找到的答案建议下载 libxml2-dev,尽管我找不到使用 HomeBrew 的包。
我对在 OS X 和 Xcode 上编程以及移植 Unix 应用程序比较陌生,所以我不确定我到底有什么。
我做了一个
brew install libxml2
然后四处寻找,我AM_PATH_XML2
在/usr/local/Cellar/libxml2/2.8.0/share/aclocal/libxml.m4
. 这是所有开发包的内容,然后我将我的 Ubuntu/Vagrant 虚拟机与本地运行良好的虚拟机进行了比较,并记住:
brew link --force libxml2
将符号链接放入/usr/local/share/aclocal
.
现在我正在建造,但我还需要汽车制造商,所以回顾一下
brew install automake autoconf libtool libxml2
brew link libxml2
该警告来自 Autoconf,并抱怨该configure.in
文件引用了宏AM_PATH_XML2
但未定义。它应该aclocal.m4
在 quickfix 源的文件中定义,因此您的 autoconf 版本似乎没有找到它。你可以尝试修改bootstrap
运行autoconf -I .
我刚刚在我的 Mac 上构建oath-toolkit时遇到了这个问题。libxml.m4
通过在安装后创建符号链接,我能够克服此错误brew install libxml2
。
ln -s /usr/local/opt/libxml2/share/aclocal/libxml.m4 /usr/local/share/aclocal/libxml.m4
我意识到这个问题已经问了 7 年多了,但我花了一段时间才拼凑出这个解决方案。我希望它有所帮助。我能够重现我运行的问题aclocal
。它与configure.ac:38: warning: macro 'AM_PATH_XML2' not found in library
. 然后我跑aclocal --print-ac-dir
了返回/usr/local/Cellar/automake/1.16.1_1/share/aclocal
。该目录包含一个dirlist
文件。
cat /usr/local/Cellar/automake/1.16.1_1/share/aclocal/dirlist
/usr/local/share/aclocal
/usr/share/aclocal
第一个目录包含所有其他符号链接。
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
按照这种模式,我可以做到:
ln -s /usr/local/Cellar/libxml2/2.9.9_2/share/aclocal/libxml.m4 /usr/local/share/aclocal/libxml.m4
但我选择使用这个符号链接,以便这个答案适用于各种版本。
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