commit
fbaf6b948a
11
Makefile
11
Makefile
|
@ -4,10 +4,19 @@ CFLAGS += -O2 -Wall -Wextra -Wshadow -rdynamic -D_GNU_SOURCE\
|
|||
-D_FILE_OFFSET_BITS=64 -DVERSION=\"$(VERSION)\"\
|
||||
`pkg-config --cflags-only-I gumbo libcurl fuse uuid expat`
|
||||
LDFLAGS += `pkg-config --libs-only-L gumbo libcurl fuse uuid expat`
|
||||
LIBS = -pthread -lgumbo -lcurl -lfuse -lcrypto -luuid -lexpat
|
||||
LIBS = -pthread -lgumbo -lcurl -lfuse -lcrypto -lexpat
|
||||
COBJS = main.o network.o fuse_local.o link.o cache.o util.o sonic.o
|
||||
|
||||
OS := $(shell uname)
|
||||
ifeq ($(OS),Darwin)
|
||||
BREW_PREFIX := $(shell brew --prefix)
|
||||
CFLAGS += -I$(BREW_PREFIX)/opt/openssl/include \
|
||||
-I$(BREW_PREFIX)/opt/curl/include
|
||||
LDFLAGS += -L$(BREW_PREFIX)/opt/openssl/lib \
|
||||
-L$(BREW_PREFIX)/opt/curl/lib
|
||||
else
|
||||
LIBS += -luuid
|
||||
endif
|
||||
ifeq ($(OS),FreeBSD)
|
||||
LIBS += -lexecinfo
|
||||
endif
|
||||
|
|
13
README.md
13
README.md
|
@ -88,6 +88,19 @@ You can then build + install with:
|
|||
Alternatively, you may use the FreeBSD [ports(7)](https://man.freebsd.org/ports/7)
|
||||
infrastructure to build HTTPDirFS from source with the modifications you need.
|
||||
|
||||
### macOS
|
||||
You need to install macFUSE, cURL, gumbo, and OpenSSL from Homebrew:
|
||||
|
||||
brew install macfuse curl gumbo-parser openssl pkg-config
|
||||
|
||||
Build and install:
|
||||
|
||||
make
|
||||
sudo make install
|
||||
|
||||
Apple's command-line build tools are usually installed as part of setting up Homebrew.
|
||||
HTTPDirFS will be installed in ``/usr/local``.
|
||||
|
||||
## Usage
|
||||
|
||||
./httpdirfs -f --cache $URL $MOUNT_POINT
|
||||
|
|
|
@ -42,7 +42,11 @@ static int fs_getattr(const char *path, struct stat *stbuf)
|
|||
}
|
||||
struct timespec spec;
|
||||
spec.tv_sec = link->time;
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
stbuf->st_mtimespec = spec;
|
||||
#else
|
||||
stbuf->st_mtim = spec;
|
||||
#endif
|
||||
switch (link->type) {
|
||||
case LINK_DIR:
|
||||
stbuf->st_mode = S_IFDIR | 0755;
|
||||
|
|
Loading…
Reference in New Issue