summaryrefslogtreecommitdiffhomepage
path: root/auto/os/test
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
commit16cbf3c076a0aca6d47adaf3f719493674cf2363 (patch)
treee6530480020f62a2bdbf249988ec3e2a751d3927 /auto/os/test
downloadunit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.gz
unit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.bz2
Initial version.
Diffstat (limited to 'auto/os/test')
-rw-r--r--auto/os/test93
1 files changed, 93 insertions, 0 deletions
diff --git a/auto/os/test b/auto/os/test
new file mode 100644
index 00000000..36ce50ae
--- /dev/null
+++ b/auto/os/test
@@ -0,0 +1,93 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+
+NXT_SYSTEM=`uname -s 2>/dev/null`
+
+
+case "$NXT_SYSTEM" in
+
+ Linux)
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ # Linux uname -p can return "unknown".
+ NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
+ echo=echo
+ CC=${CC:-cc}
+ ;;
+
+ FreeBSD | NetBSD | OpenBSD)
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
+ echo=echo
+ CC=${CC:-cc}
+ ;;
+
+ SunOS)
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
+ echo=echo
+ CC=${CC:-gcc}
+
+ NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE"
+ NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
+ NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D__EXTENSIONS__"
+ NXT_TEST_LIBS="-lsocket"
+ ;;
+
+ Darwin)
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
+ echo=echo
+ CC=${CC:-cc}
+
+ NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -mmacosx-version-min=10.4"
+ ;;
+
+ AIX)
+ NXT_SYSTEM_VERSION="`uname -v 2>/dev/null`.`uname -r 2>/dev/null`"
+ NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
+ echo=echo
+ CC=${CC:-gcc}
+ ;;
+
+ HP-UX)
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
+ echo=echo
+ CC=${CC:-gcc}
+
+ NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE"
+ NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_XOPEN_SOURCE_EXTENDED"
+ NXT_TEST_CFLAGS="$NXT_TEST_CFLAGS -D_HPUX_ALT_XOPEN_SOCKET_API"
+ ;;
+
+ QNX)
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
+ echo=echo
+ CC=${CC:-gcc}
+ ;;
+
+ MINGW*)
+ # MinGW /bin/sh builtin "echo" omits newline under Wine
+ # for some reason, so use a portable echo.c program built
+ # using MinGW GCC with only msvcrt.dll dependence.
+
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
+ echo=auto/echo/echo.exe
+ CC=${CC:-cl}
+ NXT_WINDOWS=YES
+ ;;
+
+ *)
+ NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
+ NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
+ echo=echo
+ CC=${CC:-gcc}
+ ;;
+
+esac
+
+$echo configuring for $NXT_SYSTEM $NXT_SYSTEM_VERSION $NXT_SYSTEM_PLATFORM