From da097b4451c38aacfca9b802ae31e4f164e4829c Mon Sep 17 00:00:00 2001 From: Kato Kazuyoshi Date: Thu, 17 Apr 2014 00:41:19 +0900 Subject: [PATCH] SQLite is also available in FreeBSD Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi (github: kzys) Upstream-commit: 92ea101bc4a498e952ede00bff53d0123f22f41c Component: engine --- components/engine/hack/make.sh | 8 ++++++++ .../engine/pkg/graphdb/{conn_linux.go => conn_sqlite3.go} | 2 +- components/engine/pkg/graphdb/conn_unsupported.go | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) rename components/engine/pkg/graphdb/{conn_linux.go => conn_sqlite3.go} (92%) diff --git a/components/engine/hack/make.sh b/components/engine/hack/make.sh index f3264c9ce3..46df398c57 100755 --- a/components/engine/hack/make.sh +++ b/components/engine/hack/make.sh @@ -117,6 +117,14 @@ if [ "$(uname -s)" = 'FreeBSD' ]; then LDFLAGS="$LDFLAGS -extld clang" fi +# If sqlite3.h doesn't exist under /usr/include, +# check /usr/local/include also just in case +# (e.g. FreeBSD Ports installs it under the directory) +if [ ! -e /usr/include/sqlite3.h ] && [ -e /usr/local/include/sqlite3.h ]; then + export CGO_CFLAGS='-I/usr/local/include' + export CGO_LDFLAGS='-L/usr/local/lib' +fi + HAVE_GO_TEST_COVER= if \ go help testflag | grep -- -cover > /dev/null \ diff --git a/components/engine/pkg/graphdb/conn_linux.go b/components/engine/pkg/graphdb/conn_sqlite3.go similarity index 92% rename from components/engine/pkg/graphdb/conn_linux.go rename to components/engine/pkg/graphdb/conn_sqlite3.go index 7a1ab8c92f..5b5f8e6bfc 100644 --- a/components/engine/pkg/graphdb/conn_linux.go +++ b/components/engine/pkg/graphdb/conn_sqlite3.go @@ -1,4 +1,4 @@ -// +build amd64 +// +build linux,amd64 freebsd,cgo package graphdb diff --git a/components/engine/pkg/graphdb/conn_unsupported.go b/components/engine/pkg/graphdb/conn_unsupported.go index c2d602569f..0a48634336 100644 --- a/components/engine/pkg/graphdb/conn_unsupported.go +++ b/components/engine/pkg/graphdb/conn_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux !amd64 +// +build !linux,!freebsd linux,!amd64 freebsd,!cgo package graphdb