summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-08-31 00:42:08 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-08-31 00:42:08 +0300
commit3f10b05de995099bf7551b17f5d8d38efe8b4fc5 (patch)
tree967bd4fae0fe8d25f059ab8ece5533560b188bd8 /auto
parente06872e2f281c157b3f7478fad9469f1ec0257ba (diff)
downloadunit-3f10b05de995099bf7551b17f5d8d38efe8b4fc5.tar.gz
unit-3f10b05de995099bf7551b17f5d8d38efe8b4fc5.tar.bz2
Moving generating CGO header file to the make stage.
Diffstat (limited to 'auto')
-rw-r--r--auto/modules/go25
1 files changed, 13 insertions, 12 deletions
diff --git a/auto/modules/go b/auto/modules/go
index 96e9e12d..748b8c8d 100644
--- a/auto/modules/go
+++ b/auto/modules/go
@@ -56,21 +56,14 @@ $echo "configuring Go package ..." >> $NXT_AUTOCONF_ERR
$echo -n "checking for Go ..."
$echo "checking for Go ..." >> $NXT_AUTOCONF_ERR
-nxt_go_test="GOPATH=`pwd` CGO_CPPFLAGS='-DNXT_CONFIGURE -I`pwd`/src'\
- \"${NXT_GO}\" build -o build/nxt_go_gen.a --buildmode=c-archive nginext"
-
-if /bin/sh -c "$nxt_go_test" >> $NXT_AUTOCONF_ERR 2>&1; then
+if /bin/sh -c "${NXT_GO} version" >> $NXT_AUTOCONF_ERR 2>&1; then
$echo " found"
NXT_GO_VERSION="`${NXT_GO} version`"
$echo " + ${NXT_GO_VERSION}"
else
- $echo "----------" >> $NXT_AUTOCONF_ERR
- $echo $nxt_go_test >> $NXT_AUTOCONF_ERR
- $echo "----------" >> $NXT_AUTOCONF_ERR
- $echo
$echo
$echo $0: error: no Go found.
$echo
@@ -78,7 +71,6 @@ else
fi
-
NXT_GO_PATH=${NXT_GO_PATH=`${NXT_GO} env GOPATH`}
NXT_GO_PATH=${NXT_GO_PATH:-`pwd`/${NXT_GO}}
@@ -103,12 +95,21 @@ GOPATH = $NXT_GO_PATH
GOOS = `${NXT_GO} env GOOS`
GOARCH = `${NXT_GO} env GOARCH`
-${NXT_GO}:
+${NXT_GO}: $NXT_BUILD_DIR/nxt_go_gen.h
+
+$NXT_BUILD_DIR/nxt_go_gen.h:
+ GOPATH=`pwd` \\
+ CGO_CPPFLAGS='-DNXT_CONFIGURE \\
+ -I`pwd`/src' \\
+ ${NXT_GO} build -o $NXT_BUILD_DIR/nxt_go_gen.a \\
+ --buildmode=c-archive nginext
+
+${NXT_GO}-install: ${NXT_GO}
install -d \$(GOPATH)/src/nginext
install -p ./src/nginext/*.c ./src/nginext/*.h \\
./src/nginext/*.go \$(GOPATH)/src/nginext/
- CGO_CFLAGS="-I\$(NXT_ROOT)/build -I\$(NXT_ROOT)/src" \\
- CGO_LDFLAGS="-L\$(NXT_ROOT)/build ${NXT_LIBRT}" \\
+ CGO_CFLAGS="-I\$(NXT_ROOT)/$NXT_BUILD_DIR -I\$(NXT_ROOT)/src" \\
+ CGO_LDFLAGS="-L\$(NXT_ROOT)/$NXT_BUILD_DIR ${NXT_LIBRT}" \\
GOPATH=$NXT_GO_PATH \\
${NXT_GO} install -v nginext