Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freebsd build fixes #269

Merged
merged 4 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
pull_request:
branches: [ develop ]


jobs:

build:
Expand All @@ -17,15 +16,14 @@ jobs:
fail-fast: false
matrix:
otp:
- "25.1"
- "24.3"
- "22.3"
- "25"
- "24"
- "22"

container:
image: erlang:${{ matrix.otp }}

steps:
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v2
- name: Compile
run: apt-get update && apt-get install -y cmake && make
Expand Down
2 changes: 2 additions & 0 deletions c_src/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
snappy-*.tar.gz
msgpack*.tar.gz
msgpack/
10 changes: 6 additions & 4 deletions c_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ CFLAGS := $(CFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/inclu
CXXFLAGS := $(CXXFLAGS) -I $(BASEDIR)/system/include -I. -I $(BASEDIR)/leveldb/include -fPIC

get-deps:
git config --global --add safe.directory /__w/eleveldb/eleveldb
echo "ubuntu-latest image with otp-22, are you happy now?"
if [ ! -r snappy-$(SNAPPY_VSN).tar.gz ]; then \
wget -O snappy-$(SNAPPY_VSN).tar.gz https://github.com/google/snappy/archive/refs/tags/$(SNAPPY_VSN).tar.gz; \
fi
Expand All @@ -21,8 +23,8 @@ compile: get-deps snappy ldb
cp leveldb/perf_dump leveldb/sst_rewrite leveldb/sst_scan leveldb/leveldb_repair ../priv

ldb:
$(MAKE) LDFLAGS="$(LDFLAGS) -lsnappy" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" -C leveldb all
$(MAKE) LDFLAGS="$(LDFLAGS) -lsnappy" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" -C leveldb tools
$(MAKE) LDFLAGS="$(LDFLAGS) -lsnappy -lpthread" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" -C leveldb all
$(MAKE) LDFLAGS="$(LDFLAGS) -lsnappy -lpthread" LD_LIBRARY_PATH="$(LD_LIBRARY_PATH)" -C leveldb tools

snappy: system/lib/libsnappy.a

Expand All @@ -31,15 +33,15 @@ system/lib/libsnappy.a:
(cd snappy-$(SNAPPY_VSN) && \
git submodule update --init && \
if [ -r autogen.sh ]; then \
./autogen.sh && ./configure --prefix=$(BASEDIR)/system && make && make install; \
./autogen.sh && ./configure --prefix=$(BASEDIR)/system && $(MAKE) && $(MAKE) install; \
else \
mkdir build && cd build && \
mkdir -p $(BASEDIR)/system && \
cmake -D SNAPPY_BUILD_TESTS=0 -D SNAPPY_BUILD_BENCHMARKS=0 \
-D CMAKE_INSTALL_PREFIX=$(BASEDIR)/system \
..; \
fi && \
make && make install)
$(MAKE) && $(MAKE) install)
mv system/lib64 system/lib || true

clean:
Expand Down
6 changes: 6 additions & 0 deletions make
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

which gmake 1>/dev/null 2>/dev/null && MAKE=gmake
MAKE=${MAKE:-make}

$MAKE $@
6 changes: 3 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{"DRV_LDFLAGS", "$DRV_LDFLAGS c_src/leveldb/libleveldb.a c_src/system/lib/libsnappy.a -lstdc++"}
]}.

{pre_hooks, [{'get-deps', "make -C c_src get-deps"},
{compile, "make -C c_src compile"}]}.
{pre_hooks, [{'get-deps', "./make -C c_src get-deps"},
{compile, "./make -C c_src compile"}]}.

{post_hooks, [{clean, "make -C c_src clean"}]}.
{post_hooks, [{clean, "./make -C c_src clean"}]}.