--- App-Staticperl/staticperl.sh 2010/12/13 18:08:01 1.21 +++ App-Staticperl/staticperl.sh 2010/12/28 18:03:47 1.25 @@ -12,15 +12,14 @@ PERL_VERSION=5.12.2 # 5.8.9 is also a good choice PERL_CC=cc PERL_CONFIGURE="" # additional Configure arguments -PERL_CPPFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP" +PERL_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG" PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" ARCH="$(uname -m)" case "$ARCH" in i*86 | x86_64 | amd64 ) - #PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64 - PERL_OPTIMIZE="$PERL_OPTIMIZE" # x86/amd64 + PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64 case "$ARCH" in i*86 ) PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only @@ -36,9 +35,10 @@ PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself # some configuration options for modules -export PERL_MM_USE_DEFAULT=1 -#export CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow -export EV_EXTRA_DEFS='-DEV_FEATURES=4+8+16+64 -DEV_USE_SELECT=0 -DEV_USE_POLL=1 -DEV_USE_EPOLL=1 -DEV_NO_LOOPS -DEV_COMPAT3=0' +PERL_MM_USE_DEFAULT=1 +#CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow +EV_EXTRA_DEFS='-DEV_FEATURES=4+8+16+64 -DEV_USE_SELECT=0 -DEV_USE_POLL=1 -DEV_USE_EPOLL=1 -DEV_NO_LOOPS -DEV_COMPAT3=0' +export PERL_MM_USE_DEFAULT CORO_INTERFACE EV_EXTRA_DEFS # which extra modules to install by default from CPAN that are # required by mkbundle @@ -69,11 +69,11 @@ PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG -export LC_ALL=C # just to be on the safe side +LC_ALL=C; export LC_ALL # just to be on the safe side # set version in a way that Makefile.PL can extract VERSION=VERSION; eval \ -$VERSION=0.911 +$VERSION=0.92 BZ2=bz2 BZIP2=bzip2 @@ -129,6 +129,12 @@ rm -rf "$STATICPERL/src/perl-$PERL_VERSION" } +realclean() { + rm -f "$PERL_PREFIX/staticstamp.postinstall" + rm -f "$PERL_PREFIX/staticstamp.install" + rm -f "$STATICPERL/src/perl-"*"/staticstamp.configure" +} + fetch() { rcd "$STATICPERL" @@ -148,8 +154,8 @@ EOF rm -f perl-$PERL_VERSION.tar.$BZ2~ # just to be on the safe side - wget -O perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ - || curl >perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ + curl -f >perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ + || wget -O perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ || fatal "$URL: unable to download" rm -f perl-$PERL_VERSION.tar.$BZ2 mv perl-$PERL_VERSION.tar.$BZ2~ perl-$PERL_VERSION.tar.$BZ2 @@ -176,6 +182,32 @@ mv "$2~" "$2" } +configure_failure() { + cat </dev/null 2>&1 - # I hate them + sedreplace '/^#define SITELIB/d' config_h.SH + + # I hate them for this grep -q -- -fstack-protector Configure && \ sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure @@ -207,9 +241,8 @@ -Uusemultiplicity \ -Uusesfio \ -Uuseshrplib \ + -A ccflags=" $PERL_CCFLAGS" \ -Dcc="$PERL_CC" \ - -Dcppflags="$PERL_CPPFLAGS" \ - -Dccflags="-g2 -fno-strict-aliasing" \ -Doptimize="$PERL_OPTIMIZE" \ -Dldflags="$PERL_LDFLAGS" \ -Dlibs="$PERL_LIBS" \ @@ -220,7 +253,6 @@ -Uusevendorprefix \ -Dsitelib="$PERL_PREFIX/lib" \ -Dsitearch="$PERL_PREFIX/lib" \ - -Usitelibexp \ -Uman1dir \ -Uman3dir \ -Usiteman1dir \ @@ -231,7 +263,7 @@ -Dcf_by="$EMAIL" \ $PERL_CONFIGURE \ -Duseperlio \ - -dE || fatal "Configure failed" + -dE || configure_failure sedreplace ' s/-Wl,--no-gc-sections/-Wl,--gc-sections/g @@ -430,34 +462,34 @@ version ) echo "staticperl version $VERSION" ;; - fetch | configure | build | install | clean | distclean) - ( "$command" ) + fetch | configure | build | install | clean | realclean | distclean) + ( "$command" ) || exit ;; instsrc ) - ( instsrc "$@" ) + ( instsrc "$@" ) || exit exit ;; instcpan ) - ( instcpan "$@" ) + ( instcpan "$@" ) || exit exit ;; cpan ) - ( install ) + ( install ) || exit "$PERL_PREFIX/bin/cpan" "$@" exit ;; mkbundle ) - ( install ) + ( install ) || exit bundle "$@" exit ;; mkperl ) - ( install ) + ( install ) || exit bundle --perl "$@" exit ;; mkapp ) - ( install ) + ( install ) || exit bundle --app "$@" exit ;;