conf 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. ngx_feature="GeoIP library"
  4. ngx_feature_name=
  5. ngx_feature_run=no
  6. ngx_feature_incs="#include <GeoIP.h>"
  7. ngx_feature_path=
  8. ngx_feature_libs="-lGeoIP"
  9. ngx_feature_test="GeoIP_open(NULL, 0)"
  10. . auto/feature
  11. if [ $ngx_found = no ]; then
  12. # FreeBSD port
  13. ngx_feature="GeoIP library in /usr/local/"
  14. ngx_feature_path="/usr/local/include"
  15. if [ $NGX_RPATH = YES ]; then
  16. ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lGeoIP"
  17. else
  18. ngx_feature_libs="-L/usr/local/lib -lGeoIP"
  19. fi
  20. . auto/feature
  21. fi
  22. if [ $ngx_found = no ]; then
  23. # NetBSD port
  24. ngx_feature="GeoIP library in /usr/pkg/"
  25. ngx_feature_path="/usr/pkg/include"
  26. if [ $NGX_RPATH = YES ]; then
  27. ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lGeoIP"
  28. else
  29. ngx_feature_libs="-L/usr/pkg/lib -lGeoIP"
  30. fi
  31. . auto/feature
  32. fi
  33. if [ $ngx_found = no ]; then
  34. # MacPorts
  35. ngx_feature="GeoIP library in /opt/local/"
  36. ngx_feature_path="/opt/local/include"
  37. if [ $NGX_RPATH = YES ]; then
  38. ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lGeoIP"
  39. else
  40. ngx_feature_libs="-L/opt/local/lib -lGeoIP"
  41. fi
  42. . auto/feature
  43. fi
  44. if [ $ngx_found = no ]; then
  45. # Homebrew on Apple Silicon
  46. ngx_feature="GeoIP library in /opt/homebrew/"
  47. ngx_feature_path="/opt/homebrew/include"
  48. if [ $NGX_RPATH = YES ]; then
  49. ngx_feature_libs="-R/opt/homebrew/lib -L/opt/homebrew/lib -lGeoIP"
  50. else
  51. ngx_feature_libs="-L/opt/homebrew/lib -lGeoIP"
  52. fi
  53. . auto/feature
  54. fi
  55. if [ $ngx_found = yes ]; then
  56. CORE_INCS="$CORE_INCS $ngx_feature_path"
  57. if [ $USE_GEOIP = YES ]; then
  58. CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
  59. fi
  60. NGX_LIB_GEOIP=$ngx_feature_libs
  61. ngx_feature="GeoIP IPv6 support"
  62. ngx_feature_name="NGX_HAVE_GEOIP_V6"
  63. ngx_feature_run=no
  64. ngx_feature_incs="#include <stdio.h>
  65. #include <GeoIP.h>"
  66. #ngx_feature_path=
  67. #ngx_feature_libs=
  68. ngx_feature_test="printf(\"%d\", GEOIP_CITY_EDITION_REV0_V6);"
  69. . auto/feature
  70. else
  71. cat << END
  72. $0: error: the GeoIP module requires the GeoIP library.
  73. You can either do not enable the module or install the library.
  74. END
  75. exit 1
  76. fi