1
0
forked from MTSR/mapserver

working x86-64 and arm v7

This commit is contained in:
NatureFreshMilk 2019-01-28 09:43:58 +01:00
parent bff1b07e3a
commit bf56aefdff

View File

@ -3,14 +3,6 @@ STATIC_VFS=vfs/static.go
OUT_DIR=output
ENV=GO111MODULE=on
XGO = sudo docker run -it --rm --entrypoint /bin/bash -v "$(shell pwd):/mnt/build"
XGO += -e "http_proxy=$(shell echo ${http_proxy})"
XGO += -e "https_proxy=$(shell echo ${https_proxy})"
XGO += karalabe/xgo-1.11.1 -c
docker-build: $(STATIC_VFS)
$(XGO) "cd /mnt/build && make build"
all: build
$(OUT_DIR):
@ -29,9 +21,6 @@ $(STATIC_VFS):
build: $(STATIC_VFS) $(OUT_DIR)
#CGO_ENABLED=1 GOOS=linux GOARCH=386 go build -o $(OUT_DIR)/mapserver-linux-x86
#CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o $(OUT_DIR)/mapserver-linux-x86_64
CC=arm-linux-gnueabi-gcc-5 CXX=arm-linux-gnueabi-g++-5 HOST=arm-linux-gnueabi PREFIX=/usr/arm-linux-gnueabi CFLAGS="-march=armv5" CXXFLAGS="-march=armv5" CGO_ENABLED=1 GOOS=linux GOARCH=arm go build -o $(OUT_DIR)/mapserver-linux-arm
CGO_ENABLED=1 GOOS=darwin GOARCH=386 go build -o $(OUT_DIR)/mapserver-darwin-x86
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o $(OUT_DIR)/mapserver-darwin-x86_64
CGO_ENABLED=1 GOOS=windows GOARCH=386 go build -o $(OUT_DIR)/mapserver-windows-x86.exe
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -o $(OUT_DIR)/mapserver-windows-x86_64.exe
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o $(OUT_DIR)/mapserver-linux-x86_64
# apt install gcc-5-arm-linux-gnueabihf, TODO: container
GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc-5 CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static" -o $(OUT_DIR)/mapserver-linux-arm