conf 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.008006; print "OK"'`" != "OK" ]; then
  9. echo
  10. echo "$0: error: perl 5.8.6 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_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
  21. NGX_PM_LDFLAGS=`$NGX_PERL -MConfig -e 'print $Config{lddlflags}'`
  22. NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
  23. # gcc 4.1/4.2 warn about unused values in pTHX_
  24. NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
  25. | sed -e 's/-Wunused-value/-Wno-unused-value/'`
  26. # icc8 warns 'declaration hides parameter "my_perl"' in ENTER and LEAVE
  27. NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
  28. | sed -e 's/-wd171/-wd171 -wd1599/'`
  29. ngx_perl_ldopts=`$NGX_PERL -MExtUtils::Embed -e ldopts`
  30. ngx_perl_dlext=`$NGX_PERL -MConfig -e 'print $Config{dlext}'`
  31. ngx_perl_libdir="src/http/modules/perl/blib/arch/auto"
  32. ngx_perl_module="$ngx_perl_libdir/nginx/nginx.$ngx_perl_dlext"
  33. if $NGX_PERL -V:usemultiplicity | grep define > /dev/null; then
  34. have=NGX_HAVE_PERL_MULTIPLICITY . auto/have
  35. echo " + perl interpreter multiplicity found"
  36. fi
  37. if $NGX_PERL -V:useithreads | grep undef > /dev/null; then
  38. # FreeBSD port wants to link with -pthread non-threaded perl
  39. ngx_perl_ldopts=`echo $ngx_perl_ldopts | sed 's/ -pthread//'`
  40. fi
  41. if [ "$NGX_SYSTEM" = "Darwin" ]; then
  42. # OS X system perl wants to link universal binaries
  43. ngx_perl_ldopts=`echo $ngx_perl_ldopts \
  44. | sed -e 's/-arch i386//' -e 's/-arch x86_64//'`
  45. fi
  46. if [ $USE_PERL = YES ]; then
  47. CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
  48. fi
  49. NGX_LIB_PERL="$ngx_perl_ldopts"
  50. if test -n "$NGX_PERL_MODULES"; then
  51. have=NGX_PERL_MODULES value="(u_char *) \"$NGX_PERL_MODULES\""
  52. . auto/define
  53. NGX_PERL_MODULES_MAN=$NGX_PERL_MODULES/man3
  54. fi
  55. else
  56. echo
  57. echo "$0: error: perl 5.8.6 or higher is required"
  58. echo
  59. exit 1;
  60. fi