From 4d117fd0af9b2dd722aafcecf7cc813a5afb8e46 Mon Sep 17 00:00:00 2001 From: Naoki Ikeguchi Date: Thu, 13 Jan 2022 00:47:13 +0900 Subject: [PATCH] Add instructions for Windows compilation --- .gitignore | 9 +++++++++ COMPILATION.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/.gitignore b/.gitignore index b12e225..a4fb20c 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,15 @@ test/junk_data test/s3proxy-* test/write_multiblock +# +# Windows ports +# +*.dll +*.exe +fuse.pc +WinFsp/ +bin/ + # # Local variables: # tab-width: 4 diff --git a/COMPILATION.md b/COMPILATION.md index 0ba6fbe..9333107 100644 --- a/COMPILATION.md +++ b/COMPILATION.md @@ -32,3 +32,58 @@ cd s3fs-fuse make sudo make install ``` + +## Compilation on Windows (using MSYS2) + +On Windows, use [MSYS2](https://www.msys2.org/) to compile for itself. + +1. Install [WinFsp](https://github.com/billziss-gh/winfsp) to your machine. +2. Install dependencies onto MSYS2: + + ```sh + pacman -S git autoconf automake gcc make pkg-config libopenssl-devel libcurl-devel libxml2-devel libzstd-devel + ``` + +3. Clone this repository, then change directory into the cloned one. +4. Copy WinFsp files to the directory: + + ```sh + cp -r "/c/Program Files (x86)/WinFsp" "./WinFsp" + ``` + +5. Write `fuse.pc` to resolve the package correctly: + + ```sh + 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 + ``` + +6. Compile using the command line: + + ```sh + ./autogen.sh + PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(pwd)" ./configure + make + ``` + +7. Copy binary files to distribute at one place: + + ```sh + mkdir ./bin + cp ./src/s3fs.exe ./bin/ + cp ./WinFsp/bin/winfsp-x64.dll ./bin/ + cp /usr/bin/msys-*.dll ./bin/ + ``` + +8. Distribute these files.