diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-12-01 16:28:06 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-12-01 16:28:06 +0300 |
commit | 630ec3f1eca0543b2d10c409822ea4acb657c87c (patch) | |
tree | a5256391de48996133269e860486c28e4745824f /auto/modules/python | |
parent | 1add36a7ee543b993aeba10c04a4abfc0244c3f8 (diff) | |
download | unit-630ec3f1eca0543b2d10c409822ea4acb657c87c.tar.gz unit-630ec3f1eca0543b2d10c409822ea4acb657c87c.tar.bz2 |
Using compiler capability to generate dependencies.
This closes #58 issue on GitHub.
Diffstat (limited to '')
-rw-r--r-- | auto/modules/python | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/auto/modules/python b/auto/modules/python index f006d87b..bd6377f4 100644 --- a/auto/modules/python +++ b/auto/modules/python @@ -65,7 +65,7 @@ if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then NXT_PYTHON_LIBS=`${NXT_PYTHON_CONFIG} --ldflags` nxt_feature="Python" - nxt_feature_name=NXT_HAVE_PYTHON + nxt_feature_name="" nxt_feature_run=no nxt_feature_incs="${NXT_PYTHON_INCLUDE}" nxt_feature_libs="${NXT_PYTHON_LIBS}" @@ -92,7 +92,7 @@ fi nxt_feature="Python version" -nxt_feature_name=NXT_PYTHON_VERSION +nxt_feature_name="" nxt_feature_run=value nxt_feature_incs="${NXT_PYTHON_INCLUDE}" nxt_feature_libs="${NXT_PYTHON_LIBS}" @@ -117,6 +117,7 @@ fi $echo " + Python module: ${NXT_PYTHON_MODULE}.unit.so" +. auto/cc/deps $echo >> $NXT_MAKEFILE @@ -130,14 +131,22 @@ nxt_objs= for nxt_src in $NXT_PYTHON_MODULE_SRCS; do - nxt_obj=`$echo $nxt_src | sed -e "s/\.c$/-$NXT_PYTHON_MODULE.o/"` + nxt_obj=${nxt_src%.c}-$NXT_PYTHON_MODULE.o + nxt_dep=${nxt_src%.c}-$NXT_PYTHON_MODULE.dep + nxt_dep_flags=`nxt_gen_dep_flags` + nxt_dep_post=`nxt_gen_dep_post` nxt_objs="$nxt_objs $NXT_BUILD_DIR/$nxt_obj" cat << END >> $NXT_MAKEFILE $NXT_BUILD_DIR/$nxt_obj: $nxt_src \$(CC) -c \$(CFLAGS) \$(NXT_INCS) $NXT_PYTHON_INCLUDE \\ + $nxt_dep_flags \\ -o $NXT_BUILD_DIR/$nxt_obj $nxt_src + $nxt_dep_post + +-include $NXT_BUILD_DIR/$nxt_dep + END done |