diff options
Diffstat (limited to 'auto/modules/go')
-rw-r--r-- | auto/modules/go/conf | 25 | ||||
-rw-r--r-- | auto/modules/go/make | 24 |
2 files changed, 49 insertions, 0 deletions
diff --git a/auto/modules/go/conf b/auto/modules/go/conf new file mode 100644 index 00000000..4c02fdc9 --- /dev/null +++ b/auto/modules/go/conf @@ -0,0 +1,25 @@ + +# Copyright (C) Max Romanov +# Copyright (C) NGINX, Inc. + + +NXT_GO_VERSION="`${NXT_GO} version`" + +GOPATH=`pwd` CGO_CPPFLAGS="-DNXT_CONFIGURE" "${NXT_GO}" build -o build/nxt_go_gen.a --buildmode=c-archive nginext + +if [ "$?" -ne 0 ]; then + $echo + $echo $0: error: no go found. + $echo + exit 1; +fi + +$echo " + go version: ${NXT_GO_VERSION}" + +NXT_GO_MODULE_SRCS=" \ + src/nxt_go.c \ +" + + +NXT_MODULES_INIT="$NXT_MODULES_INIT nxt_go_module_init" +NXT_MODULES_SRCS="$NXT_MODULES_SRCS $NXT_GO_MODULE_SRCS" diff --git a/auto/modules/go/make b/auto/modules/go/make new file mode 100644 index 00000000..aa93d3d6 --- /dev/null +++ b/auto/modules/go/make @@ -0,0 +1,24 @@ + +# Copyright (C) Max Romanov +# Copyright (C) NGINX, Inc. + + +$echo >> $NXT_MAKEFILE +$echo >> $NXT_MAKEFILE + + +# The go module object files. + +for nxt_src in $NXT_GO_MODULE_SRCS +do + nxt_obj=`$echo $nxt_src | sed -e "s/\.c$/\.o/"` + cat << END >> $NXT_MAKEFILE + +$NXT_BUILD_DIR/$nxt_obj: $nxt_src + \$(CC) -c \$(CFLAGS) \$(NXT_INCS) \\ + $NXT_LIB_AUX_CFLAGS \\ + -o $NXT_BUILD_DIR/$nxt_obj \\ + $nxt_src +END + +done |