summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-01-28 19:20:46 +0300
committerMax Romanov <max.romanov@nginx.com>2020-01-28 19:20:46 +0300
commit4024b18bcc070240a5d1d79ff255b8209dd6908d (patch)
treef39f75c34cd09950fce4facf48fcefab19271209
parent4eb2d3086b4abbcbf6c81170bcf7b9ccefd05428 (diff)
downloadunit-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 '')
-rw-r--r--auto/modules/go11
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"' >> \$@