diff options
author | Andrei Belov <defan@nginx.com> | 2018-02-07 17:26:30 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2018-02-07 17:26:30 +0300 |
commit | 78300263685f9e1037038a3d20ed15f41e52dd3d (patch) | |
tree | 2b5bca9fbe915465546626f5c346f713410945a4 | |
parent | fc22d1d76d7cd597225d356fe953e00b1b99a3cd (diff) | |
download | unit-78300263685f9e1037038a3d20ed15f41e52dd3d.tar.gz unit-78300263685f9e1037038a3d20ed15f41e52dd3d.tar.bz2 |
Perl: use ExtUtils::Embed in configure.
-rw-r--r-- | auto/modules/perl | 26 | ||||
-rw-r--r-- | auto/save | 2 |
2 files changed, 15 insertions, 13 deletions
diff --git a/auto/modules/perl b/auto/modules/perl index 2d1f92a9..85dc7307 100644 --- a/auto/modules/perl +++ b/auto/modules/perl @@ -15,8 +15,6 @@ for nxt_option; do case "$nxt_option" in --perl=*) NXT_PERL="$value" ;; --include=*) NXT_PERL_INCPATH="$value" ;; - --lib-path=*) NXT_PERL_LIBPATH="$value" ;; - --lib=*) NXT_PERL_LIBNAME="$value" ;; --module=*) NXT_PERL_MODULE="$value" ;; --help) @@ -24,8 +22,6 @@ for nxt_option; do --perl=FILE set perl executable, default: perl --include=DIRECTORY set directory path to perl headers - --lib-path=DIRECTORY set directory path to perl library - --lib=NAME set perl library name, default: perl --module=NAME set unit perl module name END @@ -56,9 +52,7 @@ $echo "configuring Perl module" $echo "configuring Perl module ..." >> $NXT_AUTOCONF_ERR NXT_PERL=${NXT_PERL=perl} -NXT_PERL_LIBNAME=${NXT_PERL_LIBNAME=perl} NXT_PERL_MODULE=${NXT_PERL_MODULE=${NXT_PERL##*/}} -NXT_PERL_LDLIBPATH="" nxt_found=no @@ -66,15 +60,21 @@ if /bin/sh -c "$NXT_PERL -MConfig -e 'print \"Perl version: \", \$Config{version}, \"\\n\"'" >> $NXT_AUTOCONF_ERR 2>&1; then NXT_PERL_INCPATH=${NXT_PERL_INCPATH=`$NXT_PERL -MConfig -e 'print $Config{archlib}, "/CORE"'`} - NXT_PERL_LIBPATH=${NXT_PERL_LIBPATH=`$NXT_PERL -MConfig -e 'print $Config{libspath}'`} + NXT_PERL_INCLUDE="-I ${NXT_PERL_INCPATH}" - for nxt_src in $NXT_PERL_LIBPATH - do - NXT_PERL_LDLIBPATH="${NXT_PERL_LDLIBPATH} -L ${nxt_src}" - done + NXT_PERL_LDOPTS=`$NXT_PERL -MExtUtils::Embed -e ldopts` - NXT_PERL_INCLUDE="-I ${NXT_PERL_INCPATH}" - NXT_PERL_LIBS="-L ${NXT_PERL_INCPATH} ${NXT_PERL_LDLIBPATH} -l${NXT_PERL_LIBNAME}" + if [ "$NXT_SYSTEM" = "Darwin" ]; then + # OS X system perl wants to link universal binaries + NXT_PERL_LDOPTS=`echo $NXT_PERL_LDOPTS \ + | sed -e 's/-arch i386//' -e 's/-arch x86_64//'` + + # macosx-version-min is already defined for Darwin + NXT_PERL_LDOPTS=`echo $NXT_PERL_LDOPTS \ + | $NXT_PERL -pe 's/-mmacosx-version-min=\d+\.\d+//'` + fi + + NXT_PERL_LIBS="-L ${NXT_PERL_INCPATH} ${NXT_PERL_LDOPTS}" nxt_feature="Perl" nxt_feature_name="" @@ -5,6 +5,8 @@ cat << END > $NXT_AUTOCONF_DATA +NXT_SYSTEM='$NXT_SYSTEM' + CC='$CC' CFLAGS='$CFLAGS' |