summaryrefslogtreecommitdiffhomepage
path: root/auto/modules
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-12-01 16:28:06 +0300
committerMax Romanov <max.romanov@nginx.com>2017-12-01 16:28:06 +0300
commit630ec3f1eca0543b2d10c409822ea4acb657c87c (patch)
treea5256391de48996133269e860486c28e4745824f /auto/modules
parent1add36a7ee543b993aeba10c04a4abfc0244c3f8 (diff)
downloadunit-630ec3f1eca0543b2d10c409822ea4acb657c87c.tar.gz
unit-630ec3f1eca0543b2d10c409822ea4acb657c87c.tar.bz2
Using compiler capability to generate dependencies.
This closes #58 issue on GitHub.
Diffstat (limited to 'auto/modules')
-rw-r--r--auto/modules/php10
-rw-r--r--auto/modules/python15
2 files changed, 20 insertions, 5 deletions
diff --git a/auto/modules/php b/auto/modules/php
index daeb0b68..e5eb60f0 100644
--- a/auto/modules/php
+++ b/auto/modules/php
@@ -82,7 +82,7 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
fi
nxt_feature="PHP embed SAPI"
- nxt_feature_name=NXT_HAVE_PHP
+ nxt_feature_name=""
nxt_feature_run=no
nxt_feature_incs="${NXT_PHP_INCLUDE}"
nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
@@ -120,6 +120,7 @@ fi
$echo " + PHP module: ${NXT_PHP_MODULE}.unit.so"
+. auto/cc/deps
$echo >> $NXT_MAKEFILE
@@ -133,14 +134,19 @@ nxt_objs=
for nxt_src in $NXT_PHP_MODULE_SRCS; do
- nxt_obj=`$echo $nxt_src | sed -e "s/\.c$/-$NXT_PHP_MODULE.o/"`
+ nxt_obj=${nxt_src%.c}-$NXT_PHP_MODULE.o
+ nxt_dep=${nxt_src%.c}-$NXT_PHP_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_PHP_INCLUDE \\
+ $nxt_dep_flags \\
-o $NXT_BUILD_DIR/$nxt_obj $nxt_src
+ $nxt_dep_post
END
done
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