summaryrefslogtreecommitdiffhomepage
path: root/auto/os/test
blob: b7e7329915b2af9e6eb419245d58c338e1bb19b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

# 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}
        AR=${AR:-ar}
        ;;

    FreeBSD | NetBSD | OpenBSD | DragonFly)
        NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
        NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
        echo=echo
        CC=${CC:-cc}
        AR=${AR:-ar}
        ;;

    SunOS)
        NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
        NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
        echo=echo
        CC=${CC:-gcc}
        AR=${AR:-ar}

        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}
        AR=${AR:-ar}
        ;;

    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}
        AR=${AR:-ar}
        ;;

    HP-UX)
        NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
        NXT_SYSTEM_PLATFORM=`uname -m 2>/dev/null`
        echo=echo
        CC=${CC:-gcc}
        AR=${AR:-ar}

        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}
        AR=${AR:-ar}
        ;;

    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}
        AR=${AR:-ar}
        NXT_WINDOWS=YES
        ;;

    *)
        NXT_SYSTEM_VERSION=`uname -r 2>/dev/null`
        NXT_SYSTEM_PLATFORM=`uname -p 2>/dev/null`
        echo=echo
        CC=${CC:-gcc}
        AR=${AR:-ar}
        ;;

esac

$echo "configuring Unit $NXT_VERSION"                                         \
      "for $NXT_SYSTEM $NXT_SYSTEM_VERSION $NXT_SYSTEM_PLATFORM"