ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.sh
(Generate patch)

Comparing App-Staticperl/staticperl.sh (file contents):
Revision 1.14 by root, Fri Dec 10 20:29:17 2010 UTC vs.
Revision 1.19 by root, Mon Dec 13 17:25:17 2010 UTC

5 5
6STATICPERL=~/.staticperl 6STATICPERL=~/.staticperl
7CPAN=http://mirror.netcologne.de/cpan # which mirror to use 7CPAN=http://mirror.netcologne.de/cpan # which mirror to use
8EMAIL="read the documentation <rtfm@example.org>" 8EMAIL="read the documentation <rtfm@example.org>"
9 9
10
11# perl build variables 10# perl build variables
12PERL_VERSION=5.12.2 # 5.8.9 is also a good choice 11PERL_VERSION=5.12.2 # 5.8.9 is also a good choice
12PERL_CC=cc
13PERL_CONFIGURE="" # additional Configure arguments 13PERL_CONFIGURE="" # additional Configure arguments
14PERL_CPPFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP" 14PERL_CPPFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP"
15PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" 15PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math"
16 16
17ARCH="$(uname -m)" 17ARCH="$(uname -m)"
18 18
19case "$ARCH" in 19case "$ARCH" in
20 i*86 | x86_64 | amd64 ) 20 i*86 | x86_64 | amd64 )
21 PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64 21 #PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64
22 PERL_OPTIMIZE="$PERL_OPTIMIZE" # x86/amd64
22 case "$ARCH" in 23 case "$ARCH" in
23 i*86 ) 24 i*86 )
24 PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only 25 PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only
25 ;; 26 ;;
26 esac 27 esac
27 ;; 28 ;;
28esac 29esac
29 30
30# -Wl,--gc-sections makes it impossible to check for undefined references 31# -Wl,--gc-sections makes it impossible to check for undefined references
31# for some reason so we need to patch away the "-no" after Configure and before make :/ 32# for some reason so we need to patch away the "-no" after Configure and before make :/
32# -z muldefs is to work around uclibc's pthread static linking bug 33# --allow-multiple-definition exists to work around uclibc's pthread static linking bug
33PERL_LDFLAGS="-Wl,--no-gc-sections -z muldefs" 34PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition"
34PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself 35PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself
35 36
36# some configuration options for modules 37# some configuration options for modules
37export PERL_MM_USE_DEFAULT=1 38export PERL_MM_USE_DEFAULT=1
38#export CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow 39#export CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow
69unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG 70unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
70export LC_ALL=C # just to be on the safe side 71export LC_ALL=C # just to be on the safe side
71 72
72# set version in a way that Makefile.PL can extract 73# set version in a way that Makefile.PL can extract
73VERSION=VERSION; eval \ 74VERSION=VERSION; eval \
74$VERSION=0.9 75$VERSION=0.911
75 76
76BZ2=bz2 77BZ2=bz2
77BZIP2=bzip2 78BZIP2=bzip2
78 79
79fatal() { 80fatal() {
198 -Dusemymalloc=n \ 199 -Dusemymalloc=n \
199 -Uusedl \ 200 -Uusedl \
200 -Uusethreads \ 201 -Uusethreads \
201 -Uuseithreads \ 202 -Uuseithreads \
202 -Uusemultiplicity \ 203 -Uusemultiplicity \
203 -Duseperlio \
204 -Uusesfio \ 204 -Uusesfio \
205 -Uuseshrplib \ 205 -Uuseshrplib \
206 -Dcc="$PERL_CC" \
206 -Dcppflags="$PERL_CPPFLAGS" \ 207 -Dcppflags="$PERL_CPPFLAGS" \
207 -Dccflags="-g2 -fno-strict-aliasing" \ 208 -Dccflags="-g2 -fno-strict-aliasing" \
208 -Doptimize="$PERL_OPTIMIZE" \ 209 -Doptimize="$PERL_OPTIMIZE" \
209 -Dldflags="$PERL_LDFLAGS" \ 210 -Dldflags="$PERL_LDFLAGS" \
210 -Dlibs="$PERL_LIBS" \ 211 -Dlibs="$PERL_LIBS" \
223 -Dpager=/usr/bin/less \ 224 -Dpager=/usr/bin/less \
224 -Demail="$EMAIL" \ 225 -Demail="$EMAIL" \
225 -Dcf_email="$EMAIL" \ 226 -Dcf_email="$EMAIL" \
226 -Dcf_by="$EMAIL" \ 227 -Dcf_by="$EMAIL" \
227 $PERL_CONFIGURE \ 228 $PERL_CONFIGURE \
229 -Duseperlio \
228 -dE || fatal "Configure failed" 230 -dE || fatal "Configure failed"
229 231
230 sedreplace ' 232 sedreplace '
231 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g 233 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g
232 s/ *-fno-stack-protector */ /g 234 s/ *-fno-stack-protector */ /g
373############################################################################# 375#############################################################################
374# main 376# main
375 377
376podusage() { 378podusage() {
377 echo 379 echo
380
378 if [ -e "$PERL_PREFIX/bin/perl" ]; then 381 if [ -e "$PERL_PREFIX/bin/perl" ]; then
379 "$PERL_PREFIX/bin/perl" -MPod::Usage -e \ 382 "$PERL_PREFIX/bin/perl" -MPod::Usage -e \
380 'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \ 383 'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \
381 2>/dev/null && exit 384 2>/dev/null && exit
382 fi 385 fi
386
383 # try whatever perl we can find 387 # try whatever perl we can find
384 perl -MPod::Usage -e \ 388 perl -MPod::Usage -e \
385 'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \ 389 'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \
386 2>/dev/null && exit 390 2>/dev/null && exit
387 391
388 fatal "displaying documentation requires a working perl - try '$0 install' first" 392 fatal "displaying documentation requires a working perl - try '$0 install' to build one in a safe location"
389} 393}
390 394
391usage() { 395usage() {
392 podusage 0 396 podusage 0
393} 397}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines