tuxera / ntfs-3g

NTFS-3G Safe Read/Write NTFS Driver
https://www.tuxera.com/company/open-source
GNU General Public License v2.0
986 stars 149 forks source link

[macOS] building errors #8

Closed Tzzird closed 3 years ago

Tzzird commented 3 years ago

OS: macOS Catalina 10.15.7 errors:

  1. configured with the default build option “--with-fuse=internal”, there are errors while executing 'make': **[ fuse.c:1463:31: error: no member named 'st_atim' in 'struct stat' tv[0] = attr->st_atim;

    
    fuse.c:1468:31: error: no member named 'st_mtim' in 'struct stat'
                tv[1] = attr->st_mtim;
                        ~~~~  ^
    2 errors generated.
    make[2]: *** [libfuse_lite_la-fuse.lo] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    ]**
  2. Installed macFuse package, then build with “--with-fuse=external”, "make" command gone well, errors occurred while executing ”make install": [ /Library/Developer/CommandLineTools/usr/bin/ranlib: file: /usr/local/lib/libntfs-3g.a(libntfs_3g_la-realpath.o) has no symbols /Library/Developer/CommandLineTools/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 ]

how can i fix this ?

unsound commented 3 years ago
  1. Internal libfuse-lite is not supported on macOS. It's also not the default when building on macOS. You have to use an external libfuse (the one provided by OSXFUSE/macFUSE is probably your best bet).
  2. This is because the executable prefix is not set and the default location /lib does not exist in macOS (and it couldn't be created anyway because of SIP restrictions). If you configure with --exec-prefix=/usr/local this problem goes away.
themightyoarfish commented 2 years ago

The same problem occurs with /usr/local prefix. I built with

./autogen.sh && LDFLAGS="-L/usr/local/lib -lintl" ./configure --prefix=/usr/local && make install

to work aroudn #24

Any advice or detailed doc on how to build on catalina? --with-fuse=external does not seem to help. With --disable-library it does not fail on libntfs-3g.so, but like this

Making install in src
 /usr/local/opt/coreutils/libexec/gnubin/mkdir -p '/usr/local/bin'
 /usr/local/opt/coreutils/libexec/gnubin/mkdir -p '/usr/local/share/man/man8'
  /bin/sh ../libtool   --mode=install /usr/local/opt/coreutils/libexec/gnubin/install -c ntfs-3g.probe '/usr/local/bin'
 /usr/local/opt/coreutils/libexec/gnubin/install -c -m 644 ntfs-3g.8 ntfs-3g.probe.8 '/usr/local/share/man/man8'
 /usr/local/opt/coreutils/libexec/gnubin/mkdir -p '/bin'
  /bin/sh ../libtool   --mode=install /usr/local/opt/coreutils/libexec/gnubin/install -c ntfs-3g lowntfs-3g '/bin'
libtool: install: /usr/local/opt/coreutils/libexec/gnubin/install -c .libs/ntfs-3g.probe /usr/local/bin/ntfs-3g.probe
/Applications/Xcode.app/Contents/Developer/usr/bin/make  install-exec-hook
/usr/local/opt/coreutils/libexec/gnubin/mkdir -p //usr/local/lib/ntfs-3g
libtool: install: /usr/local/opt/coreutils/libexec/gnubin/install -c .libs/ntfs-3g /bin/ntfs-3g
install: cannot create regular file '/bin/ntfs-3g': Operation not permitted
make[2]: *** [install-rootbinPROGRAMS] Error 1
make[1]: *** [install-am] Error 2

So the install prefix is somehow not used.