This allows users to tag a branch as readonly or not for writing regardless
of how the filesystem is mounted. Should simplify deployments and offer
more flexibility.
If available FICLONE and copy_file_range will be tried in addition to sendfile
when copying data between two files. The fallback is a tradition read/write
loop. On systems that support these it should improve performance.
When enabled if a regular file is opened which has a link count > 1 it will
copy the file to a temporary file and rename over the original. Effectively
breaking the link. This behavior is similar to cow-shell and other LD_PRELOAD
based "CoW" solutions.
Add INTERNAL_FUSE variable to control linking against
bundled libfuse vs external/system libfuse.
If external libfuse is requested,
`pkg-config` is used to obtain CFLAGS/LIBS/LDFLAGS and
to check that the provided external libfuse is >= 2.9.7.
This might hopefully get mergerfs closer to inclusion into distros.
Link: https://github.com/trapexit/mergerfs/issues/431
Link: https://bugs.gentoo.org/587956#c6
Parsing of and acting upon "-o threads" option is done in the bundled `libfuse/`,
so move the corresponding help text there too.
This make help text consistent with behavior
when building against system libfuse,
which doesn't support this option.
These are more like LIBS rather than LDFLAGS.
They are used just in one place,
so simply put them inline.
Also, use LDFLAGS provided by the user during actual link.
This helps users pass their own LDFLAGS.
For example, this is important on Gentoo,
where LDFLAGS='-Wl,-O1 -Wl,--as-needed' is passed by default.