diff --git a/hack/make.sh b/hack/make.sh index f3264c9ce3..46df398c57 100755 --- a/hack/make.sh +++ b/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/pkg/graphdb/conn_linux.go b/pkg/graphdb/conn_sqlite3.go similarity index 92% rename from pkg/graphdb/conn_linux.go rename to pkg/graphdb/conn_sqlite3.go index 7a1ab8c92f..5b5f8e6bfc 100644 --- a/pkg/graphdb/conn_linux.go +++ b/pkg/graphdb/conn_sqlite3.go @@ -1,4 +1,4 @@ -// +build amd64 +// +build linux,amd64 freebsd,cgo package graphdb diff --git a/pkg/graphdb/conn_unsupported.go b/pkg/graphdb/conn_unsupported.go index c2d602569f..0a48634336 100644 --- a/pkg/graphdb/conn_unsupported.go +++ b/pkg/graphdb/conn_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux !amd64 +// +build !linux,!freebsd linux,!amd64 freebsd,!cgo package graphdb