--- App-Staticperl/staticperl.sh 2010/12/28 18:03:47 1.25 +++ App-Staticperl/staticperl.sh 2011/04/01 05:58:22 1.38 @@ -9,10 +9,10 @@ # perl build variables MAKE=make -PERL_VERSION=5.12.2 # 5.8.9 is also a good choice +PERL_VERSION=5.12.3 # 5.8.9 is also a good choice PERL_CC=cc PERL_CONFIGURE="" # additional Configure arguments -PERL_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG" +PERL_CCFLAGS="-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG" PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" ARCH="$(uname -m)" @@ -31,7 +31,8 @@ # -Wl,--gc-sections makes it impossible to check for undefined references # for some reason so we need to patch away the "-no" after Configure and before make :/ # --allow-multiple-definition exists to work around uclibc's pthread static linking bug -PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition" +#PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition" +PERL_LDFLAGS= PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself # some configuration options for modules @@ -49,6 +50,7 @@ # overridable functions preconfigure() { : ; } +patchconfig() { : ; } postconfigure() { : ; } postbuild() { : ; } postinstall() { : ; } @@ -68,12 +70,17 @@ MKBUNDLE="${MKBUNDLE:=$STATICPERL/mkbundle}" PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed -unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG +unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG +unset PERL_MM_OPT PERL_MB_OPT LC_ALL=C; export LC_ALL # just to be on the safe side +# prepend PATH - not required by staticperl itself, but might make +# life easier when working in e.g. "staticperl cpan / look" +PATH="$PERL_PREFIX/perl/bin:$PATH" + # set version in a way that Makefile.PL can extract VERSION=VERSION; eval \ -$VERSION=0.92 +$VERSION="1.21" BZ2=bz2 BZIP2=bzip2 @@ -167,8 +174,8 @@ mkdir -p unpack rm -rf unpack/perl-$PERL_VERSION - $BZIP2 -d "$PERL_PREFIX"/bin/cpan-make-install <"\$HCPM~" + rm -f "\$HCPM" + mv "\$HCPM~" "\$HCPM" + ;; +esac + if find blib/arch/auto -type f | grep -q -v .exists; then echo Probably an XS module, rebuilding perl if "$MAKE" perl; then @@ -336,7 +366,11 @@ # trick CPAN into avoiding ~/.cpan completely echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" - "$PERL_PREFIX"/bin/perl -MCPAN -e ' + # we call cpan with -MCPAN::MyConfig in this script, but + # every make install will patch CPAN::HandleConfig.pm to + # protect the user. + + "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e ' CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan"); CPAN::Shell->o (conf => q); @@ -348,6 +382,7 @@ CPAN::Shell->o (conf => q, "'"$PERL_PREFIX"'/bin/cpan-make-install"); CPAN::Shell->o (conf => q, q); CPAN::Shell->o (conf => q, q); + CPAN::Shell->o (conf => q, "EUMM"); CPAN::Shell->o (conf => q); ' || fatal "error while initialising CPAN" @@ -377,7 +412,7 @@ EOF for mod in "$@"; do - "$PERL_PREFIX"/bin/perl -MCPAN -e 'notest install => "'"$mod"'"' \ + "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e 'notest install => "'"$mod"'"' \ || fatal "$mod: unable to install from CPAN" done rm -rf "$STATICPERL/build"