Add instructions for Windows compilation

This commit is contained in:
Naoki Ikeguchi 2022-01-13 00:47:13 +09:00 committed by Andrew Gaul
parent 2bf84fc705
commit 4d117fd0af
2 changed files with 64 additions and 0 deletions

9
.gitignore vendored
View File

@ -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

View File

@ -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.