conf 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. echo "checking for perl"
  4. NGX_PERL_VER=`$NGX_PERL -v 2>&1 | grep '^This is perl' 2>&1 \
  5. | sed -e 's/^This is perl, \(.*\)/\1/'`
  6. if test -n "$NGX_PERL_VER"; then
  7. echo " + perl version: $NGX_PERL_VER"
  8. if [ "`$NGX_PERL -e 'use 5.006001; print "OK"'`" != "OK" ]; then
  9. echo
  10. echo "$0: error: perl 5.6.1 or higher is required"
  11. echo
  12. exit 1;
  13. fi
  14. if [ "`$NGX_PERL -MExtUtils::Embed -e 'print "OK"'`" != "OK" ]; then
  15. echo
  16. echo "$0: error: perl module ExtUtils::Embed is required"
  17. echo
  18. exit 1;
  19. fi
  20. NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
  21. NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
  22. # gcc 4.1/4.2 warn about unused values in pTHX_
  23. NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
  24. | sed -e 's/-Wunused-value/-Wno-unused-value/'`
  25. # icc8 warns 'declaration hides parameter "my_perl"' in ENTER and LEAVE
  26. NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
  27. | sed -e 's/-wd171/-wd171 -wd1599/'`
  28. ngx_perl_ldopts=`$NGX_PERL -MExtUtils::Embed -e ldopts`
  29. ngx_perl_dlext=`$NGX_PERL -MConfig -e 'print $Config{dlext}'`
  30. ngx_perl_libdir="src/http/modules/perl/blib/arch/auto"
  31. ngx_perl_module="$ngx_perl_libdir/nginx/nginx.$ngx_perl_dlext"
  32. if $NGX_PERL -V:usemultiplicity | grep define > /dev/null; then
  33. have=NGX_HAVE_PERL_MULTIPLICITY . auto/have
  34. echo " + perl interpreter multiplicity found"
  35. fi
  36. if $NGX_PERL -V:useithreads | grep undef > /dev/null; then
  37. # FreeBSD port wants to link with -pthread non-threaded perl
  38. ngx_perl_ldopts=`echo $ngx_perl_ldopts | sed 's/ -pthread//'`
  39. fi
  40. if [ "$NGX_SYSTEM" = "Darwin" ]; then
  41. # OS X system perl wants to link universal binaries
  42. ngx_perl_ldopts=`echo $ngx_perl_ldopts \
  43. | sed -e 's/-arch i386//' -e 's/-arch x86_64//'`
  44. fi
  45. if [ $USE_PERL = YES ]; then
  46. CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
  47. fi
  48. NGX_LIB_PERL="$ngx_perl_ldopts"
  49. if test -n "$NGX_PERL_MODULES"; then
  50. have=NGX_PERL_MODULES value="(u_char *) \"$NGX_PERL_MODULES\""
  51. . auto/define
  52. NGX_PERL_MODULES_MAN=$NGX_PERL_MODULES/man3
  53. fi
  54. else
  55. echo
  56. echo "$0: error: perl 5.6.1 or higher is required"
  57. echo
  58. exit 1;
  59. fi