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

Preliminary DragonFly BSD support #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 6 additions & 4 deletions c-deps/builddeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

. ./vars

BASE=$(pwd)
LIBS="$BASE/libs"
mkdir -p $LIBS
Expand All @@ -10,7 +12,7 @@ mkdir -p $LIBS
if [ ! -f $LIBS/libjemalloc.a ]; then
cd jemalloc
bash autogen.sh
make -j8
${MAKE_CMD} -j${MAXJOBS}
cp lib/libjemalloc.a ../libs
cd ../libs
fi
Expand All @@ -24,7 +26,7 @@ if [ ! -f $LIBS/libsnappy.a ]; then
cd build
cmake ../
# sed -i.bak s/BUILD_SHARED_LIBS:BOOL=OFF/BUILD_SHARED_LIBS:BOOL=ON/g CMakeCache.txt
make -j8
${MAKE_CMD} -j${MAXJOBS}

cp libsnappy.a ../../libs/
cp snappy-stubs-public.h ../
Expand All @@ -40,9 +42,9 @@ if [ ! -f $LIBS/librocksdb.a ]; then
cd build
cmake -DWITH_GFLAGS=OFF -DPORTABLE=ON \
-DWITH_SNAPPY=ON -DSNAPPY_LIBRARIES="$LIBS/libsnappy.a" -DSNAPPY_INCLUDE_DIR="$BASE/snappy" \
-DWITH_JEMALLOC=ON -DJEMALLOC_LIBRARIES="$LIBS/libjemalloc.a" -DJEMALLOC_INCLUDE_DIR="$BASE/jemalloc/include" \
-DWITH_JEMALLOC=${JEMALLOC_ENABLE} -DJEMALLOC_LIBRARIES="$LIBS/libjemalloc.a" -DJEMALLOC_INCLUDE_DIR="$BASE/jemalloc/include" \
-DCMAKE_BUILD_TYPE=Release -DUSE_RTTI=1 ../
make -j8 rocksdb
${MAKE_CMD} -j${MAXJOBS} rocksdb

cp librocksdb.a ../../libs
fi
6 changes: 4 additions & 2 deletions c-deps/cleandeps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

. ./vars

for i in jemalloc snappy rocksdb
do
make -C $i clean
done
${MAKE_CMD} -C $i clean
done
15 changes: 15 additions & 0 deletions c-deps/vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#! /usr/bin/env bash
# OS specific settings

Osname=$(uname)
if [ "${Osname}" == "DragonFly" ]; then
# DragonFly BSD
JEMALLOC_ENABLE="OFF"
MAKE_CMD=gmake
MAXJOBS=$(sysctl -n hw.ncpu)
else
# Linux, Darwin
MAKE_CMD=make
JEMALLOC_ENABLE="ON"
MAXJOBS=8
fi
4 changes: 2 additions & 2 deletions rocksdb/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ package rocksdb
// #cgo CXXFLAGS: -std=c++11 -O3 -I${SRCDIR}/../c-deps/rocksdb/include
// #cgo LDFLAGS: -L${SRCDIR}/../c-deps/libs
// #cgo LDFLAGS: -lrocksdb
// #cgo LDFLAGS: -ljemalloc
// #cgo !dragonfly LDFLAGS: -ljemalloc
// #cgo LDFLAGS: -lsnappy
// #cgo LDFLAGS: -lstdc++
// #cgo LDFLAGS: -ldl
// #cgo LDFLAGS: -lpthread
// #cgo LDFLAGS: -lm
// #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
// #cgo !darwin LDFLAGS: -Wl,-unresolved_symbols=ignore-all -lrt
// #cgo linux LDFLAGS: -Wl,-unresolved_symbols=ignore-all -lrt
import "C"