3.2 KiB
Compilation from source code
These are generic instructions should work on almost any GNU/Linux, macOS, BSD, or similar.
If you want specific instructions for some distributions, check the wiki.
Keep in mind using the pre-built packages when available.
Compilation on Linux
Ensure your system satisfies build and runtime dependencies for:
-
fuse >= 2.8.4
-
automake
-
gcc-c++
-
make
-
libcurl
-
libxml2
-
openssl/gnutls/nss
- Please prepare the library according to the OS on which you will compile.
- It is necessary to match the library used by libcurl.
- Install the OpenSSL, GnuTLS or NSS devel package.
-
mime.types (the package providing depends on the OS)
- s3fs tries to detect
/etc/mime.typesas default regardless of the OS - Else s3fs tries to detect
/etc/apache2/mime.typesif OS is macOS - s3fs exits with an error if these files are not exist
- Alternatively, you can set mime.types file path with
mimeoption without detecting these default files
- s3fs tries to detect
-
pkg-config (or your OS equivalent)
-
NOTE
If you have any trouble about details on required packages, seeINSTALL_PACKAGESin linux-ci-helper.sh.
Then compile from master via the following commands:
- Clone the source code:
git clone https://github.com/s3fs-fuse/s3fs-fuse.git - Configuration:
Depending on the TLS library (OpenSSL/GnuTLS/NSS), add
cd s3fs-fuse ./autogen.sh ./configure--with-openssl,--with-gnutlsor--with-nsswhen executingconfigure. (If omitted, it is equivalent to--with-openssl.) - Bulding:
make - Installing:
sudo make install
NOTE - The required libraries/components required to run s3fs are:
- fuse >= 2.8.4
- libcurl
- libxml2
- openssl/gnutls/nss
- mime.types (the package providing depends on the OS)
Compilation on Windows (using MSYS2)
On Windows, use MSYS2 to compile for itself.
-
Install WinFsp to your machine.
-
Install dependencies onto MSYS2:
pacman -S git autoconf automake gcc make pkg-config libopenssl-devel libcurl-devel libxml2-devel libzstd-devel -
Clone this repository, then change directory into the cloned one.
-
Copy WinFsp files to the directory:
cp -r "/c/Program Files (x86)/WinFsp" "./WinFsp" -
Write
fuse.pcto resolve the package correctly:cat > ./fuse.pc << 'EOS' arch=x64 prefix=${pcfiledir}/WinFsp incdir=${prefix}/inc/fuse implib=${prefix}/bin/winfsp-${arch}.dll Name: fuse Description: WinFsp FUSE compatible API Version: 2.8.4 URL: http://www.secfs.net/winfsp/ Libs: "${implib}" Cflags: -I"${incdir}" EOS -
Compile using the command line:
./autogen.sh PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(pwd)" ./configure make -
Copy binary files to distribute at one place:
mkdir ./bin cp ./src/s3fs.exe ./bin/ cp ./WinFsp/bin/winfsp-x64.dll ./bin/ cp /usr/bin/msys-*.dll ./bin/ -
Distribute these files.