You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

94 lines
2.7 KiB

# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../perl/perl.conf
# Copyright (C) 2009 - 2010 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2004 Clifford Wolf
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
perl_cross_bootstrap()
{
# build a native miniperl
eval $MAKE miniperl
cp miniperl miniperl.native
$MAKE clean
# setup cross compiler
sed -e '/^d_futimes/d' -e '/^d_sockatmark/d' -i config.sh
cat >> config.sh <<-EOT
cc='$CC'
ccname='$CC'
ld='$CC'
libs='-ldl -lm -lcrypt -lutil -lc'
d_futimes='undef'
d_sockatmark='undef'
d_sockatmarkproto='undef'
EOT
touch config.sh
eval $MAKE $makeopt miniperl
cp -f miniperl.native miniperl
}
perl_postmake() {
cat > $root/usr/bin/cpan <<- EOT
#!/usr/bin/perl
use POSIX;
use locale;
use CPAN;
setlocale(LANGUAGE, "en_US");
setlocale(LC_ALL, "en_US");
shell;
EOT
chmod +x $root/usr/bin/cpan
if atstage native; then
eval `perl -V:archlib`
touch ${archlib}/perllocal.pod
h2ph $( grep ' usr/include/.*\.h$' \
$root/var/adm/flists/glibc* | sed 's,^.*: ,/,' )
fi
}
runconfig=0
[[ $libdir = *lib64 ]] && var_append patchfiles ' ' "$confdir/lib64.diff"
libpth="/usr/local/${libdir##*/} /${libdir##*/} /usr/${libdir##*/}"
confopt="-des -Dcc=$cc -Darchname=$arch_target -Dprefix=/$prefix \
-Dmyhostname=$SDECFG_PKG_PERL5_HOST_NAME \
-Dsiteprefix=/$SDECFG_PKG_PERL5_SITE_PREFIX \
-Dvendorprefix=/$SDECFG_PKG_PERL5_VENDOR_PREFIX"
[ "$SDECFG_PKG_PERL5_THREADS" = "1" ] && confopt="$confopt -Dusethreads"
hook_add preconf 2 "( rm -f config.sh Policy.sh; eval sh Configure \$confopt; )"
if ! atstage native; then
var_append confopt " " "-Ddynamic_ext=none"
var_append confopt " " "-Dstatic_ext=\"Data/Dumper IO Fcntl POSIX\""
hook_add premake 3 "perl_cross_bootstrap"
fi
hook_add postmake 4 "perl_postmake"
PERL_CROSS_MODULES="File/Basename.pm Errno.pm Config.pm IO/File.pm Symbol.pm \
SelectSaver.pm IO/Seekable.pm IO/Handle.pm IO.pm XSLoader.pm \
DynaLoader.pm AutoLoader.pm Carp/Heavy.pm"
perl_cross_modules()
{
moddir=${root}/${SDECFG_PKG_PERL5_SITE_PREFIX}/lib/perl5/$ver
for mod in $PERL_CROSS_MODULES; do
[ -d $moddir/`dirname $mod` ] || mkdir -p $moddir/`dirname $mod`;
cp -vdpf lib/$mod $moddir/$mod
done;
}
atstage cross && hook_add postmake 3 "perl_cross_modules"