summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-04-26 01:38:05 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-04-26 01:39:57 -0400
commit9fbe238cfee84beb0e0796463f7f6b44c13cbdd3 (patch)
tree9faa155aa3d29488aa740f6b9e3d7e931bc5876e
parent1a64603645e894fd2c886a02876762bee0b208a7 (diff)
Update dependencies
This now requires go 1.10 (because x/sys/unix) The cgo that go 1.10 ships is apparently super unhappy when `CC=gcc -std=c99`, it wants GNU dialects. So add a way to override that; set `go_CC=gcc -std=gnu99`. On the bright side, the cgo CFLAGS hacks are no longer nescessary.
-rw-r--r--HACKING.md5
-rw-r--r--Makefile20
-rw-r--r--config.mk7
-rw-r--r--go/.gitignore1
m---------go/src/git.lukeshu.com/go/libnslcd0
m---------go/src/golang.org/x/sys0
m---------go/src/gopkg.in/yaml.v20
7 files changed, 17 insertions, 16 deletions
diff --git a/HACKING.md b/HACKING.md
deleted file mode 100644
index 38f6775..0000000
--- a/HACKING.md
+++ /dev/null
@@ -1,5 +0,0 @@
-The golang.org/x/sys/unix library can't be updated past commit
-ab9e364efd8b52800ff7ee48a9ffba4e0ed78dfb (where I have it right now)
-until go commit 93da0b6e66f24c4c307e0df37ceb102a33306174 (currently on
-master) makes it in to a release. It narrowly missed the cut-off to
-be in go 1.9; I expect it to be in go 1.10 around February 2018.
diff --git a/Makefile b/Makefile
index 873d745..f408ba9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2015-2017 Luke Shumaker <lukeshu@sbcglobal.net>.
+# Copyright 2015-2018 Luke Shumaker <lukeshu@sbcglobal.net>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -36,13 +36,11 @@ bins = $(bins_c) $(bins_go) $(bins_lib) $(bins_script)
#
# Go language noise
-CGO_CPPFLAGS = $(CPPFLAGS) -U_FORTIFY_SOURCE
-CGO_CFLAGS = $(CFLAGS) -O0 -Wno-unused-parameter
-CGO_ENABLED = 1
+GOPATH = $(abspath $(topoutdir)/go)
-cgo_variables = CGO_ENABLED CGO_CFLAGS CGO_CPPFLAGS CGO_CXXFLAGS CGO_LDFLAGS CC CXX
-$(foreach v,$(cgo_variables),$(eval $v ?=))
-export $(cgo_variables)
+go_variables := $(shell go env|cut -d= -f1)
+$(foreach v,$(go_variables),$(if $(filter GO% CGO%,$v),$(eval $v ?=),$(eval go_$v ?=)))
+go_env = $(foreach v,$(go_variables),$(if $(go_$v),$v='$(go_$v)',$(if $($v),$v='$($v)')))
#
# Generate (pre-tarball)
@@ -64,11 +62,11 @@ nested.subdirs += $(dir $(filter %/Makefile,$(_gitfiles.all)))
# Build (post-tarball)
files.out.all += $(addprefix bin/,$(filter-out $(bins_script),$(bins))) nshd.service nshd.sysusers
-files.out.int += go/pkg/ go/bin/ go/bin/*
+files.out.int += go/pkg/ go/bin/ go/cache/ go/bin/*
# Go
-$(addprefix %/bin/,$(bins_go)): %/src
- GOPATH=$(abspath $*) go install $(bins_go)
+$(addprefix %/bin/,$(bins_go)): %/src FORCE
+ $(go_env) go install $(bins_go)
$(outdir)/bin/%: $(outdir)/go/bin/%
cp -T $< $@
# C
@@ -94,7 +92,7 @@ go_os_arch = $(word 4,$(shell go version))
go_race_os_arch = $(shell go help build | sed -n '/^\s*-race/,/^\s*-/p'| grep -oE '[a-z0-9]+/[a-z0-9]+')
go_test_flags = $(if $(filter $(go_os_arch),$(go_race_os_arch)),-race)
$(outdir)/check:
- GOPATH=$$PWD/go go test $(go_test_flags) $$(GOPATH=$$PWD/go go list -f '{{.ImportPath}}{{"\n"}}{{join .Deps "\n"}}' $(bins_go) | sort -u | grep -e ^nshd -e '\.[^/]*/')
+ $(go_env) go test $(go_test_flags) $$($(go_env) go list -f '{{.ImportPath}}{{"\n"}}{{join .Deps "\n"}}' $(bins_go) | sort -u | grep -e ^nshd -e '\.[^/]*/')
.PHONY: $(outdir)/check
at.targets += $(outdir)/check
diff --git a/config.mk b/config.mk
index 459318c..b5a63b2 100644
--- a/config.mk
+++ b/config.mk
@@ -12,8 +12,15 @@ shadow_file = $(sysconfdir)/nshd/shadow
NET ?=
#NET ?= FORCE
user = nshd
+
+# C
CFLAGS += -Wall -Wextra -Werror -pedantic
CC = gcc -std=c99
.LIBPATTERNS = lib%.so lib%.a
+# Go
+go_CC = gcc -std=gnu99
+GOCACHE = $(topoutdir)/go/cache
+CGO_ENABLED = 1
+
endif
diff --git a/go/.gitignore b/go/.gitignore
index 4c48abf..5b5707a 100644
--- a/go/.gitignore
+++ b/go/.gitignore
@@ -1,2 +1,3 @@
/pkg/
/bin/
+/cache/
diff --git a/go/src/git.lukeshu.com/go/libnslcd b/go/src/git.lukeshu.com/go/libnslcd
-Subproject dfe22c5b083443ed00df9431cbd3cd7a7b4fd6a
+Subproject 027bcb726ea5e37d9fb3040419e9f079cdbb0ce
diff --git a/go/src/golang.org/x/sys b/go/src/golang.org/x/sys
-Subproject ab9e364efd8b52800ff7ee48a9ffba4e0ed78df
+Subproject bb9c189858d91f42db229b04d45a4c3d23a7662
diff --git a/go/src/gopkg.in/yaml.v2 b/go/src/gopkg.in/yaml.v2
-Subproject 287cf08546ab5e7e37d55a84f7ed3fd1db036de
+Subproject 5420a8b6744d3b0345ab293f6fcba19c978f118