module 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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}_MODULES=\"$ngx_module_name\"
  14. if [ -z "$ngx_module_order" -a \
  15. \( "$ngx_module_type" = "HTTP_FILTER" \
  16. -o "$ngx_module_type" = "HTTP_AUX_FILTER" \) ]
  17. then
  18. eval ${ngx_module}_ORDER=\"$ngx_module_name \
  19. ngx_http_copy_filter_module\"
  20. else
  21. eval ${ngx_module}_ORDER=\"$ngx_module_order\"
  22. fi
  23. srcs=
  24. shrd=
  25. for src in $ngx_module_srcs
  26. do
  27. found=no
  28. for old in $DYNAMIC_MODULES_SRCS
  29. do
  30. if [ $src = $old ]; then
  31. found=yes
  32. break
  33. fi
  34. done
  35. if [ $found = no ]; then
  36. srcs="$srcs $src"
  37. else
  38. shrd="$shrd $src"
  39. fi
  40. done
  41. eval ${ngx_module}_SRCS=\"$srcs\"
  42. eval ${ngx_module}_SHRD=\"$shrd\"
  43. DYNAMIC_MODULES_SRCS="$DYNAMIC_MODULES_SRCS $srcs"
  44. if test -n "$ngx_module_incs"; then
  45. CORE_INCS="$CORE_INCS $ngx_module_incs"
  46. fi
  47. if test -n "$ngx_module_deps"; then
  48. NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_module_deps"
  49. fi
  50. libs=
  51. for lib in $ngx_module_libs
  52. do
  53. case $lib in
  54. LIBXSLT | LIBGD | GEOIP | PERL)
  55. libs="$libs \$NGX_LIB_$lib"
  56. if eval [ "\$USE_${lib}" = NO ] ; then
  57. eval USE_${lib}=DYNAMIC
  58. fi
  59. ;;
  60. PCRE | OPENSSL | ZLIB)
  61. eval USE_${lib}=YES
  62. ;;
  63. MD5 | SHA1)
  64. # obsolete
  65. ;;
  66. *)
  67. libs="$libs $lib"
  68. ;;
  69. esac
  70. done
  71. eval ${ngx_module}_LIBS=\'$libs\'
  72. elif [ "$ngx_module_link" = YES ]; then
  73. eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
  74. $ngx_module_name\"
  75. eval ${ngx_var}_SRCS=\"\$${ngx_var}_SRCS $ngx_module_srcs\"
  76. if test -n "$ngx_module_incs"; then
  77. eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
  78. fi
  79. if test -n "$ngx_module_deps"; then
  80. eval ${ngx_var}_DEPS=\"\$${ngx_var}_DEPS $ngx_module_deps\"
  81. fi
  82. for lib in $ngx_module_libs
  83. do
  84. case $lib in
  85. PCRE | OPENSSL | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
  86. eval USE_${lib}=YES
  87. ;;
  88. MD5 | SHA1)
  89. # obsolete
  90. ;;
  91. *)
  92. CORE_LIBS="$CORE_LIBS $lib"
  93. ;;
  94. esac
  95. done
  96. elif [ "$ngx_module_link" = ADDON ]; then
  97. eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
  98. $ngx_module_name\"
  99. srcs=
  100. for src in $ngx_module_srcs
  101. do
  102. found=no
  103. for old in $NGX_ADDON_SRCS
  104. do
  105. if [ $src = $old ]; then
  106. found=yes
  107. break
  108. fi
  109. done
  110. if [ $found = no ]; then
  111. srcs="$srcs $src"
  112. fi
  113. done
  114. NGX_ADDON_SRCS="$NGX_ADDON_SRCS $srcs"
  115. if test -n "$ngx_module_incs"; then
  116. eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
  117. fi
  118. if test -n "$ngx_module_deps"; then
  119. NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_module_deps"
  120. fi
  121. for lib in $ngx_module_libs
  122. do
  123. case $lib in
  124. PCRE | OPENSSL | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
  125. eval USE_${lib}=YES
  126. ;;
  127. MD5 | SHA1)
  128. # obsolete
  129. ;;
  130. *)
  131. CORE_LIBS="$CORE_LIBS $lib"
  132. ;;
  133. esac
  134. done
  135. fi