summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-05-31 08:17:27 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-05-31 08:17:27 +0000
commit0462a613c1fa6785338048a99822e320564faee6 (patch)
tree364a111c2b499cfa90ebadeefe8d5c2011f14f40
parent5343bf3221c66aaef315a466931c7b2c2ac5b425 (diff)
downloadnginx-0462a613c1fa6785338048a99822e320564faee6.tar.gz
nginx-0462a613c1fa6785338048a99822e320564faee6.tar.bz2
Support POSIX semaphores on Linux.
This configure test must run before auto/make, because it adds library. auto/unix was placed after auto/make just for historical reasons. Patch by Denis F. Latypoff
-rwxr-xr-xauto/configure5
-rwxr-xr-xauto/unix13
2 files changed, 14 insertions, 4 deletions
diff --git a/auto/configure b/auto/configure
index 8ee1c80fb..8ef3a9aca 100755
--- a/auto/configure
+++ b/auto/configure
@@ -53,6 +53,7 @@ fi
if [ "$NGX_PLATFORM" != win32 ]; then
. auto/os/features
. auto/threads
+ . auto/unix
fi
. auto/modules
@@ -99,10 +100,6 @@ have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\""
. auto/lib/make
. auto/install
-if [ "$NGX_PLATFORM" != win32 ]; then
- . auto/unix
-fi
-
# STUB
. auto/stubs
diff --git a/auto/unix b/auto/unix
index 669314b42..502c27e19 100755
--- a/auto/unix
+++ b/auto/unix
@@ -246,6 +246,19 @@ ngx_feature_test="sem_t sem;
. auto/feature
+if [ $ngx_found = no ]; then
+
+ # Linux has POSIX semaphores in libpthread
+ ngx_feature="POSIX semaphores in libpthread"
+ ngx_feature_libs=-lpthread
+ . auto/feature
+
+ if [ $ngx_found = yes ]; then
+ CORE_LIBS="$CORE_LIBS -lpthread"
+ fi
+fi
+
+
ngx_feature="struct msghdr.msg_control"
ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
ngx_feature_run=no