make 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. case "$NGX_CC_NAME" in
  4. msvc)
  5. ngx_makefile=makefile.msvc
  6. ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
  7. ngx_zlib="ZLIB=\"$ZLIB\""
  8. ;;
  9. owc)
  10. ngx_makefile=makefile.owc
  11. ngx_opt="CPU_OPT=\"$CPU_OPT\""
  12. ngx_zlib=`echo ZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"`
  13. ;;
  14. bcc)
  15. ngx_makefile=makefile.bcc
  16. ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
  17. ngx_zlib=`echo \-DZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"`
  18. ;;
  19. *)
  20. ngx_makefile=
  21. ;;
  22. esac
  23. done=NO
  24. case "$NGX_PLATFORM" in
  25. win32)
  26. if [ -n "$ngx_makefile" ]; then
  27. cat << END >> $NGX_MAKEFILE
  28. `echo "$ZLIB/zlib.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
  29. \$(MAKE) -f auto/lib/zlib/$ngx_makefile $ngx_opt $ngx_zlib
  30. END
  31. else
  32. cat << END >> $NGX_MAKEFILE
  33. $ZLIB/libz.a: $NGX_MAKEFILE
  34. cd $ZLIB \\
  35. && \$(MAKE) distclean \\
  36. && \$(MAKE) -f win32/Makefile.gcc \\
  37. CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
  38. libz.a
  39. END
  40. fi
  41. done=YES
  42. ;;
  43. # FreeBSD: i386
  44. # Linux: i686
  45. *:i386 | *:i686)
  46. case $ZLIB_ASM in
  47. pentium)
  48. cat << END >> $NGX_MAKEFILE
  49. $ZLIB/libz.a: $NGX_MAKEFILE
  50. cd $ZLIB \\
  51. && \$(MAKE) distclean \\
  52. && cp contrib/asm586/match.S . \\
  53. && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
  54. ./configure \\
  55. && \$(MAKE) OBJA=match.o libz.a
  56. END
  57. done=YES
  58. ;;
  59. pentiumpro)
  60. cat << END >> $NGX_MAKEFILE
  61. $ZLIB/libz.a: $NGX_MAKEFILE
  62. cd $ZLIB \\
  63. && \$(MAKE) distclean \\
  64. && cp contrib/asm686/match.S . \\
  65. && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
  66. ./configure \\
  67. && \$(MAKE) OBJA=match.o libz.a
  68. END
  69. done=YES
  70. ;;
  71. NO)
  72. ;;
  73. *)
  74. echo "$0: error: invalid --with-zlib-asm=$ZLIB_ASM option."
  75. echo "The valid values are \"pentium\" and \"pentiumpro\" only".
  76. echo
  77. exit 1;
  78. ;;
  79. esac
  80. ;;
  81. esac
  82. if [ $done = NO ]; then
  83. cat << END >> $NGX_MAKEFILE
  84. $ZLIB/libz.a: $NGX_MAKEFILE
  85. cd $ZLIB \\
  86. && \$(MAKE) distclean \\
  87. && CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
  88. ./configure \\
  89. && \$(MAKE) libz.a
  90. END
  91. fi