]> git.kaiwu.me - nginx.git/commitdiff
Support POSIX semaphores on Linux.
authorIgor Sysoev <igor@sysoev.ru>
Tue, 31 May 2011 08:17:27 +0000 (08:17 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 31 May 2011 08:17:27 +0000 (08:17 +0000)
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

auto/configure
auto/unix

index 8ee1c80fb65183d6c8c410b537780767bcf4553d..8ef3a9acadfcf479b3251c52eb95a540dcf3d71a 100755 (executable)
@@ -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
 
index 669314b4265518e5c10dbcce1ae5ff6ed249a335..502c27e19a1b17da114f7d88fb7761089ded6676 100755 (executable)
--- 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