为 OS X 编译 NTFS-3G

Compiling NTFS-3G for OS X

后注意到recommended installation of NTFS-3G is the five years old 2010.10.2 because it was conveniently available as .pkg, I wanted to give a try at compiling latest 2015.3.14 from official website请注意,我不想从 Brew 或 Macports 安装它,而是手动安装它

所以我尝试了:

./configure && make && sudo make install

但它告诉我 pkg-config 没有安装,所以我使用 ./configure --with-internal-glib; make; sudo make installhttp://www.freedesktop.org/wiki/Software/pkg-config/ 安装它,我得到:

[...]
Making install in .
 ./install-sh -c -d '/usr/local/bin'
  /bin/sh ./libtool   --mode=install /usr/bin/install -c pkg-config '/usr/local/bin'
libtool: install: /usr/bin/install -c pkg-config /usr/local/bin/pkg-config
/Applications/Xcode.app/Contents/Developer/usr/bin/make  install-exec-hook
cd /usr/local/bin && ln pkg-config x86_64-apple-darwin15.0.0-pkg-config
ln: x86_64-apple-darwin15.0.0-pkg-config: File exists
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

我忽略了它并再次尝试安装 NTFS-3G:

./configure && make && sudo make install

但是这次我得到了:

[...]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libntfs-3g.a(libntfs_3g_la-compat.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libntfs-3g.a(libntfs_3g_la-debug.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libntfs-3g.a(libntfs_3g_la-realpath.o) has no symbols
/Applications/Xcode.app/Contents/Developer/usr/bin/make  install-exec-hook
if [ ! "/lib" -ef "/usr/local/lib" ]; then \
        /bin/mv -f "//usr/local/lib"/libntfs-3g.so* "//lib";  \
    fi
mv: rename //usr/local/lib/libntfs-3g.so* to //lib/libntfs-3g.so*: No such file or directory
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

然后我尝试了:

./configure --exec-prefix=/ && make && sudo make install

但是我得到了:

[...]
install: //bin/ntfsfix: Operation not permitted
make[2]: *** [install-binPROGRAMS] Error 71
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

然后我尝试了:

./configure --exec-prefix=/usr/local && make && sudo make install

但是我得到了:

[...]
install: chmod 755 /sbin: Operation not permitted
ln -s -f /usr/local/sbin/mkntfs /sbin/mkfs.ntfs
ln: /sbin/mkfs.ntfs: Operation not permitted
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

我正在使用 OS X 10.11 El Capitan。

看来这是源头的问题。 Erik Larsson 于 2015 年 6 月 23 日取得 a fix for it。非常感谢。现在可以从边缘源编译 git://git.code.sf.net/p/ntfs-3g/ntfs-3g

最好从 http://brew.sh 获取 brew,然后安装:

brew install automake
brew install libtool
brew install libgcrypt
brew install pkg-config

然后你可以编译和安装 NTFS-3G(从它的文件夹):

./autogen.sh
./configure --prefix=/usr/local --mandir=/usr/local/share/man --exec_prefix=/usr/local
make
sudo make install

一个缺点:brew 和 ntfs-3g 都在争夺文件夹 /usr/local/.