conf 1.1 KB

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