diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-01-28 19:20:46 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-01-28 19:20:46 +0300 |
commit | 4024b18bcc070240a5d1d79ff255b8209dd6908d (patch) | |
tree | f39f75c34cd09950fce4facf48fcefab19271209 /auto | |
parent | 4eb2d3086b4abbcbf6c81170bcf7b9ccefd05428 (diff) | |
download | unit-4024b18bcc070240a5d1d79ff255b8209dd6908d.tar.gz unit-4024b18bcc070240a5d1d79ff255b8209dd6908d.tar.bz2 |
Go: adding main configure CFLAGS and LDFLAGS to module build flags.
This makes ASAN buildbot workers to work out-of-the-box.
Diffstat (limited to 'auto')
-rw-r--r-- | auto/modules/go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/auto/modules/go b/auto/modules/go index 2d53dd65..8bb9216e 100644 --- a/auto/modules/go +++ b/auto/modules/go @@ -85,6 +85,14 @@ if grep ^$NXT_GO: $NXT_MAKEFILE 2>&1 > /dev/null; then exit 1; fi +NXT_GO_LDFLAGS= + +for o in ${CFLAGS} ${NXT_CC_OPT}; do + case "$o" in + -fsanitize* | -L* | -l*) NXT_GO_LDFLAGS="${NXT_GO_LDFLAGS} $o" ;; + esac +done + cat << END >> $NXT_MAKEFILE .PHONY: ${NXT_GO} @@ -116,8 +124,9 @@ ${NXT_GO}-install-env: \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG}/env.go \ install -d \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG} $echo "package unit" > \$@ $echo "/*" >> \$@ + $echo "#cgo CFLAGS: ${CFLAGS} ${NXT_CC_OPT}" >> \$@ $echo "#cgo CPPFLAGS: -I${PWD}/src -I${PWD}/${NXT_BUILD_DIR}" >> \$@ - $echo "#cgo LDFLAGS: -L${PWD}/${NXT_BUILD_DIR}" >> \$@ + $echo "#cgo LDFLAGS: -L${PWD}/${NXT_BUILD_DIR} ${NXT_GO_LDFLAGS} ${NXT_LD_OPT}" >> \$@ $echo "*/" >> \$@ $echo 'import "C"' >> \$@ |