~ubuntu-branches/ubuntu/trusty/nginx/trusty-proposed

« back to all changes in this revision

Viewing changes to auto/lib/libatomic/conf

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2013-04-25 12:51:45 UTC
  • mfrom: (1.3.28)
  • mto: (1.3.29) (15.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 64.
  • Revision ID: package-import@ubuntu.com-20130425125145-ugl0wor6bq0u5eae
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Copyright (C) Igor Sysoev
 
3
# Copyright (C) Nginx, Inc.
 
4
 
 
5
 
 
6
if [ $NGX_LIBATOMIC != YES ]; then
 
7
 
 
8
    have=NGX_HAVE_LIBATOMIC . auto/have
 
9
    CORE_INCS="$CORE_INCS $NGX_LIBATOMIC/src"
 
10
    LINK_DEPS="$LINK_DEPS $NGX_LIBATOMIC/src/libatomic_ops.a"
 
11
    CORE_LIBS="$CORE_LIBS $NGX_LIBATOMIC/src/libatomic_ops.a"
 
12
 
 
13
else
 
14
 
 
15
    ngx_feature="atomic_ops library"
 
16
    ngx_feature_name=NGX_HAVE_LIBATOMIC
 
17
    ngx_feature_run=yes
 
18
    ngx_feature_incs="#define AO_REQUIRE_CAS
 
19
                      #include <atomic_ops.h>"
 
20
    ngx_feature_path=
 
21
    ngx_feature_libs="-latomic_ops"
 
22
    ngx_feature_test="long  n = 0;
 
23
                      if (!AO_compare_and_swap(&n, 0, 1))
 
24
                          return 1;
 
25
                      if (AO_fetch_and_add(&n, 1) != 1)
 
26
                          return 1;
 
27
                      if (n != 2)
 
28
                          return 1;
 
29
                      AO_nop();"
 
30
    . auto/feature
 
31
 
 
32
    if [ $ngx_found = yes ]; then
 
33
        CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
 
34
    else
 
35
 
 
36
cat << END
 
37
 
 
38
$0: error: libatomic_ops library was not found.
 
39
 
 
40
END
 
41
        exit 1
 
42
    fi
 
43
fi