Merge pull request #220 from crosbymichael/build-tags

Add seccomp build tag
diff --git a/Makefile b/Makefile
index 09d28f2..520b012 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,11 @@
 RUNC_TEST_IMAGE=runc_test
 PROJECT=github.com/opencontainers/runc
 TEST_DOCKERFILE=script/test_Dockerfile
+BUILDTAGS=seccomp
 export GOPATH:=$(CURDIR)/Godeps/_workspace:$(GOPATH)
 
 all:
-	go build -o runc .
+	go build -tags "$(BUILDTAGS)" -o runc .
 
 vet:
 	go get golang.org/x/tools/cmd/vet
@@ -20,7 +21,8 @@
 	docker run -e TESTFLAGS --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_TEST_IMAGE) make localtest
 
 localtest:
-	go test ${TESTFLAGS} -v ./...
+	go test -tags "$(BUILDTAGS)" ${TESTFLAGS} -v ./...
+
 
 install:
 	cp runc /usr/local/bin/runc
diff --git a/README.md b/README.md
index fce0246..d8a38fe 100644
--- a/README.md
+++ b/README.md
@@ -29,6 +29,9 @@
 sudo make install
 ```
 
+In order to enable seccomp support you will need to install libseccomp on your platform.
+If you do not with to build `runc` with seccomp support you can add `BUILDTAGS=""` when running make.
+
 ### Using:
 
 To run a container, execute `runc start` in the bundle's root directory:
diff --git a/libcontainer/seccomp/seccomp_linux.go b/libcontainer/seccomp/seccomp_linux.go
index 4d12c4a..58bdbf6 100644
--- a/libcontainer/seccomp/seccomp_linux.go
+++ b/libcontainer/seccomp/seccomp_linux.go
@@ -1,4 +1,4 @@
-// +build linux,cgo
+// +build linux,cgo,seccomp
 
 package seccomp
 
diff --git a/libcontainer/seccomp/seccomp_unsupported.go b/libcontainer/seccomp/seccomp_unsupported.go
index 712ad25..87d3abb 100644
--- a/libcontainer/seccomp/seccomp_unsupported.go
+++ b/libcontainer/seccomp/seccomp_unsupported.go
@@ -1,12 +1,19 @@
-// +build !linux !cgo
+// +build !linux !cgo !seccomp
 
 package seccomp
 
 import (
+	"errors"
+
 	"github.com/opencontainers/runc/libcontainer/configs"
 )
 
+var ErrSeccompNotEnabled = errors.New("seccomp: config provided but seccomp not supported")
+
 // Seccomp not supported, do nothing
 func InitSeccomp(config *configs.Seccomp) error {
+	if config != nil {
+		return ErrSeccompNotEnabled
+	}
 	return nil
 }