summaryrefslogtreecommitdiffhomepage
path: root/auto/otel
blob: 4d059a285252eb5dbc74ee1934a9dce7c7cdac7d (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

# Copyright (C) NGINX, Inc.

if [ $NXT_OTEL = YES ]; then

    $echo "checking for OTEL requirements:"

    $echo -n "  - checking for rust compiler ... "
    if [ -z $(which rustc 2>/dev/null) ]; then
        $echo "not found"
        exit 1;
    fi
    $echo "found"

    $echo -n "  - checking for cargo ... "
    if [ -z $(which cargo 2>/dev/null) ]; then
        $echo "not found."
        exit 1;
    fi
    $echo "found"

    case "$NXT_SYSTEM" in
        Darwin)
            NXT_OTEL_LIBS="-framework CoreFoundation -framework Security -framework SystemConfiguration"

            cat << END >> $NXT_AUTO_CONFIG_H

#ifndef NXT_HAVE_OTEL
#define NXT_HAVE_OTEL 1
#endif

END
            ;;
        *)

            $echo -n "  - "

            nxt_feature="OpenSSL library"
            nxt_feature_name=NXT_HAVE_OTEL
            nxt_feature_run=yes
            nxt_feature_incs=
            nxt_feature_libs="-lssl -lcrypto"
            nxt_feature_test="#include <openssl/ssl.h>

                              int main(void) {
                                  SSL_library_init();
                                  return 0;
                              }"
            . auto/feature

            if [ ! $nxt_found = yes ]; then
                $echo
                $echo $0: error: OpenTelemetry support requires OpenSSL.
                $echo
                exit 1;
            fi

            NXT_OTEL_LIBS="-lssl -lcrypto"
            ;;
    esac

fi