summaryrefslogtreecommitdiffhomepage
path: root/auto/cc
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-02-04 20:25:29 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-02-04 20:25:29 +0300
commit97f59dda09f139fbf18d6a20097d3337a2489b3c (patch)
tree14bdb60c3fbb499c15dcd21267d847af4c8f4b5b /auto/cc
parent0805ba14e7a25bc61627d6ece2a79243fe0b640a (diff)
downloadnginx-97f59dda09f139fbf18d6a20097d3337a2489b3c.tar.gz
nginx-97f59dda09f139fbf18d6a20097d3337a2489b3c.tar.bz2
Dynamic modules.
The auto/module script is extended to understand ngx_module_link=DYNAMIC. When set, it links the module as a shared object rather than statically into nginx binary. The module can later be loaded using the "load_module" directive. New auto/module parameter ngx_module_order allows to define module loading order in complex cases. By default the order is set based on ngx_module_type. 3rd party modules can be compiled dynamically using the --add-dynamic-module configure option, which will preset ngx_module_link to "DYNAMIC" before calling the module config script. Win32 support is rudimentary, and only works when using MinGW gcc (which is able to handle exports/imports automatically). In collaboration with Ruslan Ermilov.
Diffstat (limited to 'auto/cc')
-rw-r--r--auto/cc/conf22
-rw-r--r--auto/cc/msvc6
-rw-r--r--auto/cc/sunc3
3 files changed, 31 insertions, 0 deletions
diff --git a/auto/cc/conf b/auto/cc/conf
index edc6d74dd..35fd39c5d 100644
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -5,12 +5,17 @@
LINK="\$(CC)"
+MAIN_LINK=
+MODULE_LINK="-shared"
+
ngx_include_opt="-I "
ngx_compile_opt="-c"
+ngx_pic_opt="-fPIC"
ngx_objout="-o "
ngx_binout="-o "
ngx_objext="o"
ngx_binext=
+ngx_modext=".so"
ngx_long_start=
ngx_long_end=
@@ -45,6 +50,9 @@ if test -n "$CFLAGS"; then
sunc)
+ MAIN_LINK=
+ MODULE_LINK="-G"
+
case "$NGX_MACHINE" in
i86pc)
@@ -156,6 +164,20 @@ if [ "$NGX_PLATFORM" != win32 ]; then
fi
+ ngx_feature="-Wl,-E switch"
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=-Wl,-E
+ ngx_feature_test=
+ . auto/feature
+
+ if [ $ngx_found = yes ]; then
+ MAIN_LINK="-Wl,-E"
+ fi
+
+
ngx_feature="gcc builtin atomic operations"
ngx_feature_name=NGX_HAVE_GCC_ATOMIC
ngx_feature_run=yes
diff --git a/auto/cc/msvc b/auto/cc/msvc
index 393ba3214..e588c487f 100644
--- a/auto/cc/msvc
+++ b/auto/cc/msvc
@@ -118,6 +118,12 @@ NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
CORE_LINK="$NGX_RES $CORE_LINK"
+# dynamic modules
+#MAIN_LINK="-link -def:$NGX_OBJS/nginx.def"
+#MODULE_LINK="-LD $NGX_OBJS/nginx.lib"
+
+
+ngx_pic_opt=
ngx_objout="-Fo"
ngx_binout="-Fe"
ngx_objext="obj"
diff --git a/auto/cc/sunc b/auto/cc/sunc
index 8f12d7cd7..8360c49c2 100644
--- a/auto/cc/sunc
+++ b/auto/cc/sunc
@@ -57,6 +57,9 @@ case "$NGX_MACHINE" in
esac
+MAIN_LINK=
+MODULE_LINK="-G"
+
# optimizations