42

我正在尝试libxml2在我的 Mac 上从源代码构建。

所以我有autoconf, libtool, 并automake使用macports安装

autoconf并且automake似乎按预期工作正常。

我试着先跑autogen.sh

libtoolize --version不幸的是

-bash: libtoolize: command not found

我尝试跑步(再次)

sudo port install libtool

--->  Cleaning libtool
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

我试试

locate libtool

它似乎安装得很好

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man/man1/libtool.1
/Applications/Xcode.app/Contents/Developer/usr/bin/libtool
/Applications/Xcode.app/Contents/Developer/usr/share/man/man1/libtool.1
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/cross/mipsel-linux-binutils/files/110-uclibc-libtool-conf.patch
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool/Portfile
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool/files
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool/files/ltmain.m4sh-allow-clang-stdlib.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool-devel
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/libtool-devel/Portfile
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/openslp/files/libtool-tags.patch
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/t1lib/files/patch-libtool-tag.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/print/pdflib/files/patch-libtool.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/security/steghide/files/libtool-tag.diff
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/www/apache2/files/libtool-tag.diff
/usr/bin/libtool
/usr/lib/php/build/libtool.m4
/usr/share/apr-1/build-1/libtool
/usr/share/man/man1/libtool.1

我怎么libtoolize去上班?

4

4 回答 4

39

您通常需要使用glibtooland glibtoolize,因为libtoolOS X 上已经存在作为创建 Mach-O 动态库的二进制工具。因此,这就是 MacPorts 安装它的方式,使用程序名称转换,尽管端口本身仍被命名为“libtool”。

一些autogen.sh脚本(或它们的等价物)将尊重LIBTOOL/LIBTOOLIZE环境变量。我自己的autogen.sh脚本中有一行:

case `uname` in Darwin*) glibtoolize --copy ;;
  *) libtoolize --copy ;; esac

你可能想要也可能不想要这个--copy标志。


注意:如果您使用 MacPorts 安装了自动工具,正确编写configure.acMakefile.am文件应该只需要autoreconf -fvi. 它应该按预期调用glibtoolize等。否则,某些软件包将分发一个autogen.sh或类似的脚本。

于 2013-03-16T11:47:18.280 回答
25

希望我的回答不要太天真。我是 OSX 的菜鸟。

brew install libtool 为我解决了类似的问题。

于 2014-10-03T17:54:00.790 回答
17

当您使用brewlibtoolize安装时,安装了几个线程。这可以通过以下方式实现;安装它,然后为 libtoolize 创建一个软链接:glibtoolizelibtool

brew install libtool
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
于 2019-10-15T16:31:07.503 回答
1

Brew 的替代方法是使用macports. 例如:

$ port info libtool
libtool @2.4.6_5 (devel, sysutils)
Variants:             universal

Description:          GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface.
Homepage:             https://www.gnu.org/software/libtool

Build Dependencies:   xattr
Platforms:            darwin, freebsd
License:              libtool
Maintainers:          Email: larryv@macports.org, GitHub: larryv

然后像 Brew 一样,您可以:

$ sudo port install libtool
Password:
--->  Fetching archive for libtool
--->  Attempting to fetch libtool-2.4.6_5.darwin_15.x86_64.tbz2 from https://packages.macports.org/libtool
--->  Attempting to fetch libtool-2.4.6_5.darwin_15.x86_64.tbz2.rmd160 from https://packages.macports.org/libtool
--->  Installing libtool @2.4.6_5
--->  Activating libtool @2.4.6_5
--->  Cleaning libtool
--->  Updating database of binaries
--->  Updating database of C++ stdlib usage
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.

然后你可以检查它的位置......顺便说一句,你可以将 glibtoolize 软链接到 libtoolize。对于我的需要,两者都可以

$ which glibtoolize
/opt/local/bin/glibtoolize
于 2018-11-29T23:04:25.457 回答