2006-01-16 22:56:53 +08:00
|
|
|
|
|
|
|
# Copyright (C) Igor Sysoev
|
2012-01-18 23:07:43 +08:00
|
|
|
# Copyright (C) Nginx, Inc.
|
2006-01-16 22:56:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
echo "checking for perl"
|
|
|
|
|
|
|
|
|
|
|
|
NGX_PERL_VER=`$NGX_PERL -v 2>&1 | grep '^This is perl' 2>&1 \
|
|
|
|
| sed -e 's/^This is perl, \(.*\)/\1/'`
|
|
|
|
|
|
|
|
if test -n "$NGX_PERL_VER"; then
|
|
|
|
echo " + perl version: $NGX_PERL_VER"
|
|
|
|
|
2016-12-08 00:03:26 +08:00
|
|
|
if [ "`$NGX_PERL -e 'use 5.008006; print "OK"'`" != "OK" ]; then
|
2006-01-16 22:56:53 +08:00
|
|
|
echo
|
2016-12-08 00:03:26 +08:00
|
|
|
echo "$0: error: perl 5.8.6 or higher is required"
|
2006-01-16 22:56:53 +08:00
|
|
|
echo
|
|
|
|
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2012-09-27 23:01:57 +08:00
|
|
|
if [ "`$NGX_PERL -MExtUtils::Embed -e 'print "OK"'`" != "OK" ]; then
|
|
|
|
echo
|
|
|
|
echo "$0: error: perl module ExtUtils::Embed is required"
|
|
|
|
echo
|
|
|
|
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2006-08-30 18:39:17 +08:00
|
|
|
NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
|
2016-09-21 03:11:23 +08:00
|
|
|
NGX_PM_LDFLAGS=`$NGX_PERL -MConfig -e 'print $Config{lddlflags}'`
|
|
|
|
|
|
|
|
NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
|
2006-08-30 18:39:17 +08:00
|
|
|
|
|
|
|
# gcc 4.1/4.2 warn about unused values in pTHX_
|
|
|
|
NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
|
|
|
|
| sed -e 's/-Wunused-value/-Wno-unused-value/'`
|
|
|
|
# icc8 warns 'declaration hides parameter "my_perl"' in ENTER and LEAVE
|
|
|
|
NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
|
|
|
|
| sed -e 's/-wd171/-wd171 -wd1599/'`
|
|
|
|
|
2006-01-16 22:56:53 +08:00
|
|
|
ngx_perl_ldopts=`$NGX_PERL -MExtUtils::Embed -e ldopts`
|
|
|
|
|
2013-03-28 16:46:42 +08:00
|
|
|
ngx_perl_dlext=`$NGX_PERL -MConfig -e 'print $Config{dlext}'`
|
2014-06-26 09:08:59 +08:00
|
|
|
ngx_perl_libdir="src/http/modules/perl/blib/arch/auto"
|
|
|
|
ngx_perl_module="$ngx_perl_libdir/nginx/nginx.$ngx_perl_dlext"
|
2013-03-28 16:46:42 +08:00
|
|
|
|
2006-01-16 22:56:53 +08:00
|
|
|
if $NGX_PERL -V:usemultiplicity | grep define > /dev/null; then
|
|
|
|
have=NGX_HAVE_PERL_MULTIPLICITY . auto/have
|
|
|
|
echo " + perl interpreter multiplicity found"
|
|
|
|
fi
|
|
|
|
|
2006-11-26 22:35:27 +08:00
|
|
|
if $NGX_PERL -V:useithreads | grep undef > /dev/null; then
|
2006-01-16 22:56:53 +08:00
|
|
|
# FreeBSD port wants to link with -pthread non-threaded perl
|
|
|
|
ngx_perl_ldopts=`echo $ngx_perl_ldopts | sed 's/ -pthread//'`
|
|
|
|
fi
|
|
|
|
|
2014-06-17 16:07:06 +08:00
|
|
|
if [ "$NGX_SYSTEM" = "Darwin" ]; then
|
|
|
|
# OS X system perl wants to link universal binaries
|
2014-06-26 07:34:02 +08:00
|
|
|
ngx_perl_ldopts=`echo $ngx_perl_ldopts \
|
2015-11-30 17:04:29 +08:00
|
|
|
| sed -e 's/-arch i386//' -e 's/-arch x86_64//'`
|
2014-06-17 16:07:06 +08:00
|
|
|
fi
|
|
|
|
|
2016-02-26 19:27:04 +08:00
|
|
|
if [ $USE_PERL = YES ]; then
|
|
|
|
CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
|
|
|
|
fi
|
|
|
|
|
|
|
|
NGX_LIB_PERL="$ngx_perl_ldopts"
|
2006-01-16 22:56:53 +08:00
|
|
|
|
|
|
|
if test -n "$NGX_PERL_MODULES"; then
|
|
|
|
have=NGX_PERL_MODULES value="(u_char *) \"$NGX_PERL_MODULES\""
|
|
|
|
. auto/define
|
2006-12-25 02:23:11 +08:00
|
|
|
NGX_PERL_MODULES_MAN=$NGX_PERL_MODULES/man3
|
2006-01-16 22:56:53 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
else
|
|
|
|
echo
|
2016-12-08 00:03:26 +08:00
|
|
|
echo "$0: error: perl 5.8.6 or higher is required"
|
2006-01-16 22:56:53 +08:00
|
|
|
echo
|
|
|
|
|
|
|
|
exit 1;
|
|
|
|
fi
|