Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/auto
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-06-17 21:18:53 +0400
committerIgor Sysoev <igor@sysoev.ru>2004-06-17 21:18:53 +0400
commit415b1ce1b93a3b74efe8a3ee5a35ee55e0a11caa (patch)
tree077bf24b4f310a87ab8bff140c730cb679069988 /auto
parentf924e6b694db7fd1d99473b3d7db7eb2b49c9e62 (diff)
nginx-0.0.7-2004-06-17-21:18:53 import
Diffstat (limited to 'auto')
-rw-r--r--auto/feature53
-rw-r--r--auto/func11
-rw-r--r--auto/sources5
-rwxr-xr-xauto/unix101
4 files changed, 144 insertions, 26 deletions
diff --git a/auto/feature b/auto/feature
new file mode 100644
index 000000000..32a103d15
--- /dev/null
+++ b/auto/feature
@@ -0,0 +1,53 @@
+
+echo $ngx_n "checking for $ngx_feature ..." $ngx_c
+echo >> $NGX_ERR
+echo "checking for $ngx_feature" >> $NGX_ERR
+
+ngx_found=no
+
+feature=`echo $ngx_feature_name | tr '[a-z]' '[A-Z]'`
+
+cat << END > $NGX_AUTOTEST.c
+
+#include <sys/types.h>
+$NGX_UNISTD_H
+$ngx_feature_inc
+
+int main() {
+ $ngx_feature_test;
+ return 0;
+}
+
+END
+
+test="$CC_WARN $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c \
+ $ngx_feature_libs"
+eval "$test >> $NGX_ERR 2>&1"
+
+if [ -x $NGX_AUTOTEST ]; then
+
+ if [ $ngx_feature_run = yes ]; then
+ if $NGX_AUTOTEST 2>&1 > /dev/null; then
+ echo " found"
+ have=HAVE_$feature . auto/have
+ ngx_found=yes
+ else
+ echo " found but is not working"
+ fi
+
+ else
+ echo " found"
+ have=HAVE_$feature . auto/have
+ ngx_found=yes
+ fi
+
+else
+ echo " not found"
+ echo "---------" >> $NGX_ERR
+ cat $NGX_AUTOTEST.c >> $NGX_ERR
+ echo "---------" >> $NGX_ERR
+ echo $test >> $NGX_ERR
+ echo "---------" >> $NGX_ERR
+fi
+
+rm $NGX_AUTOTEST*
diff --git a/auto/func b/auto/func
index 3f12b7890..af74331ac 100644
--- a/auto/func
+++ b/auto/func
@@ -5,7 +5,7 @@ echo "checking for $ngx_func" >> $NGX_ERR
ngx_found=no
-func=`echo $ngx_func | sed -e 's/()$//' | tr '[a-z.]' '[A-Z_]'`
+func=`echo $ngx_func | sed -e 's/()$//' | tr '[a-z]' '[A-Z]'`
cat << END > $NGX_AUTOTEST.c
@@ -20,8 +20,8 @@ int main() {
END
-eval "$CC_WARN $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c $ngx_func_libs \
- >> $NGX_ERR 2>&1"
+test="$CC_WARN $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c $ngx_func_libs"
+eval "$test >> $NGX_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
echo " found"
@@ -30,6 +30,11 @@ if [ -x $NGX_AUTOTEST ]; then
else
echo " not found"
+ echo "---------" >> $NGX_ERR
+ cat $NGX_AUTOTEST.c >> $NGX_ERR
+ echo "---------" >> $NGX_ERR
+ echo $test >> $NGX_ERR
+ echo "---------" >> $NGX_ERR
fi
rm $NGX_AUTOTEST*
diff --git a/auto/sources b/auto/sources
index a49cca0b3..ba2934a44 100644
--- a/auto/sources
+++ b/auto/sources
@@ -105,6 +105,7 @@ UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/unix/ngx_errno.h \
src/os/unix/ngx_alloc.h \
src/os/unix/ngx_files.h \
+ src/os/unix/ngx_shared.h \
src/os/unix/ngx_process.h \
src/os/unix/ngx_thread.h \
src/os/unix/ngx_socket.h \
@@ -120,8 +121,9 @@ UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \
src/os/unix/ngx_recv.c \
src/os/unix/ngx_readv_chain.c \
src/os/unix/ngx_writev_chain.c \
- src/os/unix/ngx_daemon.c \
+ src/os/unix/ngx_shared.c \
src/os/unix/ngx_process.c \
+ src/os/unix/ngx_daemon.c \
src/os/unix/ngx_posix_init.c \
src/os/unix/ngx_process_cycle.c"
@@ -152,6 +154,7 @@ WIN32_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/win32/ngx_errno.h \
src/os/win32/ngx_alloc.h \
src/os/win32/ngx_files.h \
+ src/os/win32/ngx_shared.h \
src/os/win32/ngx_process.h \
src/os/win32/ngx_socket.h \
src/os/win32/ngx_os.h \
diff --git a/auto/unix b/auto/unix
index 183a5039e..5cd940eb6 100755
--- a/auto/unix
+++ b/auto/unix
@@ -40,14 +40,6 @@ ngx_types="int"; . auto/types/typedef
. auto/types/uintptr_t
-ngx_func="sin_len"
-ngx_func_inc="#include <sys/socket.h>
-#include <netinet/in.h>"
-
-ngx_func_test="struct sockaddr_in sa; sa.sin_len = 5"
-. auto/func
-
-
# printf() formats
CC_WARN=$CC_STRONG
@@ -71,19 +63,21 @@ ngx_fmt_name=RLIM_T_FMT; ngx_type="rlim_t"; . auto/types/sizeof
eval ngx_formats=\${ngx_${ngx_bytes}_fmt}; . auto/fmt/fmt
-# syscalls and libc calls
+# syscalls, libc calls and some features
+
+ngx_feature_libs=
+ngx_func_libs=
+
ngx_func="pread()"
ngx_func_inc=
-ngx_func_test="char buf[1]; ssize_t n;
- n = pread(0, buf, 1, 0)"
+ngx_func_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)"
. auto/func
ngx_func="pwrite()"
ngx_func_inc=
-ngx_func_test="char buf[1]; ssize_t n;
- n = pwrite(1, buf, 1, 0)"
+ngx_func_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
. auto/func
@@ -113,7 +107,7 @@ ngx_func_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
ngx_func="posix_memalign()"
ngx_func_inc="#include <stdlib.h>"
-ngx_func_test="void *p, int n; n = posix_memalign(&p, 4096, 4096)"
+ngx_func_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
. auto/func
@@ -123,13 +117,76 @@ ngx_func_test="void *p; p = memalign(4096, 4096)"
. auto/func
-ngx_func="msghdr.msg_control"
-ngx_func_inc="#include <sys/socket.h>"
-ngx_func_test="struct msghdr msg; msg.msg_control = NULL"
-. auto/func
+ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
+ngx_feature_name="MAP_ANON"
+ngx_feature_inc="#include <sys/mman.h>"
+ngx_feature_test="void *p;
+ p = mmap(NULL, 4096, PROT_READ|PROT_WRITE,
+ MAP_ANON|MAP_SHARED, -1, 0);
+ if (p == MAP_FAILED) return 1;"
+ngx_feature_run=yes
+. auto/feature
-ngx_func="FIONBIO"
-ngx_func_inc="#include <sys/filio.h>"
-ngx_func_test="int i; i = FIONBIO"
-. auto/func
+
+ngx_feature='mmap("/dev/zero", MAP_SHARED)'
+ngx_feature_name="MAP_DEVZERO"
+ngx_feature_inc="#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>"
+ngx_feature_test='void *p; int fd;
+ fd = open("/dev/zero", O_RDWR);
+ p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+ if (p == MAP_FAILED) return 1;'
+. auto/feature
+
+
+ngx_feature="System V shared memory"
+ngx_feature_name="SYSVSHM"
+ngx_feature_inc="#include <sys/ipc.h>
+#include <sys/shm.h>"
+ngx_feature_test="int id;
+ id = shmget(IPC_PRIVATE, 4096, (SHM_R|SHM_W|IPC_CREAT));
+ if (id == -1) return 1;
+ shmctl(id, IPC_RMID, NULL);"
+. auto/feature
+
+
+
+ngx_feature="struct sockaddr_in.sin_len"
+ngx_feature_name="sin_len"
+ngx_feature_inc="#include <sys/socket.h>
+#include <netinet/in.h>"
+ngx_feature_test="struct sockaddr_in sa; sa.sin_len = 5"
+ngx_feature_run=no
+. auto/feature
+
+
+ngx_feature="struct msghdr.msg_control"
+ngx_feature_name="msghdr_msg_control"
+ngx_feature_inc="#include <sys/socket.h>"
+ngx_feature_test="struct msghdr msg; msg.msg_control = NULL"
+. auto/feature
+
+
+case $PLATFORM in
+ Linux:*)
+ ngx_feature_inc="#include <sys/ioctl.h>"
+ ;;
+
+ *)
+ ngx_feature_inc="#include <sys/filio.h>"
+ ;;
+esac
+
+ngx_feature="ioctl(FIONBIO)"
+ngx_feature_name="FIONBIO"
+ngx_feature_test="int i; i = FIONBIO"
+. auto/feature
+
+
+ngx_feature="struct tm.tm_gmtoff"
+ngx_feature_name="gmtoff"
+ngx_feature_inc="#include <time.h>"
+ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0"
+. auto/feature