module 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Copyright (C) Ruslan Ermilov
  2. # Copyright (C) Nginx, Inc.
  3. case $ngx_module_type in
  4. HTTP_*) ngx_var=HTTP ;;
  5. *) ngx_var=$ngx_module_type ;;
  6. esac
  7. if [ "$ngx_module_link" = DYNAMIC ]; then
  8. for ngx_module in $ngx_module_name; do
  9. # extract the first name
  10. break
  11. done
  12. DYNAMIC_MODULES="$DYNAMIC_MODULES $ngx_module"
  13. eval ${ngx_module}_SRCS=\"$ngx_module_srcs\"
  14. eval ${ngx_module}_MODULES=\"$ngx_module_name\"
  15. if [ -z "$ngx_module_order" -a \
  16. \( "$ngx_module_type" = "HTTP_FILTER" \
  17. -o "$ngx_module_type" = "HTTP_AUX_FILTER" \) ]
  18. then
  19. eval ${ngx_module}_ORDER=\"$ngx_module_name \
  20. ngx_http_copy_filter_module\"
  21. else
  22. eval ${ngx_module}_ORDER=\"$ngx_module_order\"
  23. fi
  24. if test -n "$ngx_module_incs"; then
  25. CORE_INCS="$CORE_INCS $ngx_module_incs"
  26. fi
  27. libs=
  28. for lib in $ngx_module_libs
  29. do
  30. case $lib in
  31. LIBXSLT | LIBGD | GEOIP | PERL)
  32. libs="$libs \$NGX_LIB_$lib"
  33. if eval [ "\$USE_${lib}" = NO ] ; then
  34. eval USE_${lib}=DYNAMIC
  35. fi
  36. ;;
  37. PCRE | OPENSSL | MD5 | SHA1 | ZLIB)
  38. eval USE_${lib}=YES
  39. ;;
  40. *)
  41. libs="$libs $lib"
  42. ;;
  43. esac
  44. done
  45. eval ${ngx_module}_LIBS=\'$libs\'
  46. elif [ "$ngx_module_link" = YES ]; then
  47. eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
  48. $ngx_module_name\"
  49. eval ${ngx_var}_SRCS=\"\$${ngx_var}_SRCS $ngx_module_srcs\"
  50. if test -n "$ngx_module_incs"; then
  51. eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
  52. fi
  53. if test -n "$ngx_module_deps"; then
  54. eval ${ngx_var}_DEPS=\"\$${ngx_var}_DEPS $ngx_module_deps\"
  55. fi
  56. for lib in $ngx_module_libs
  57. do
  58. case $lib in
  59. PCRE | OPENSSL | MD5 | SHA1 | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
  60. eval USE_${lib}=YES
  61. ;;
  62. *)
  63. CORE_LIBS="$CORE_LIBS $lib"
  64. ;;
  65. esac
  66. done
  67. elif [ "$ngx_module_link" = ADDON ]; then
  68. eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
  69. $ngx_module_name\"
  70. NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_module_srcs"
  71. if test -n "$ngx_module_incs"; then
  72. eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
  73. fi
  74. if test -n "$ngx_module_deps"; then
  75. NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_module_deps"
  76. fi
  77. for lib in $ngx_module_libs
  78. do
  79. case $lib in
  80. PCRE | OPENSSL | MD5 | SHA1 | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
  81. eval USE_${lib}=YES
  82. ;;
  83. *)
  84. CORE_LIBS="$CORE_LIBS $lib"
  85. ;;
  86. esac
  87. done
  88. fi