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.21 by root, Mon Dec 13 18:08:01 2010 UTC vs.
Revision 1.22 by root, Wed Dec 15 00:17:48 2010 UTC

10# perl build variables 10# perl build variables
11MAKE=make 11MAKE=make
12PERL_VERSION=5.12.2 # 5.8.9 is also a good choice 12PERL_VERSION=5.12.2 # 5.8.9 is also a good choice
13PERL_CC=cc 13PERL_CC=cc
14PERL_CONFIGURE="" # additional Configure arguments 14PERL_CONFIGURE="" # additional Configure arguments
15PERL_CPPFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP" 15PERL_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP"
16PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" 16PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math"
17 17
18ARCH="$(uname -m)" 18ARCH="$(uname -m)"
19 19
20case "$ARCH" in 20case "$ARCH" in
21 i*86 | x86_64 | amd64 ) 21 i*86 | x86_64 | amd64 )
22 #PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64 22 PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64
23 PERL_OPTIMIZE="$PERL_OPTIMIZE" # x86/amd64
24 case "$ARCH" in 23 case "$ARCH" in
25 i*86 ) 24 i*86 )
26 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
27 ;; 26 ;;
28 esac 27 esac
71unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG 70unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
72export LC_ALL=C # just to be on the safe side 71export LC_ALL=C # just to be on the safe side
73 72
74# set version in a way that Makefile.PL can extract 73# set version in a way that Makefile.PL can extract
75VERSION=VERSION; eval \ 74VERSION=VERSION; eval \
76$VERSION=0.911 75$VERSION=0.912
77 76
78BZ2=bz2 77BZ2=bz2
79BZIP2=bzip2 78BZIP2=bzip2
80 79
81fatal() { 80fatal() {
172# similar to GNU-sed -i or perl -pi 171# similar to GNU-sed -i or perl -pi
173sedreplace() { 172sedreplace() {
174 sed -e "$1" <"$2" > "$2~" || fatal "error while running sed" 173 sed -e "$1" <"$2" > "$2~" || fatal "error while running sed"
175 rm -f "$2" 174 rm -f "$2"
176 mv "$2~" "$2" 175 mv "$2~" "$2"
176}
177
178configure_failure() {
179 cat <<EOF
180
181
182***
183*** Configure failed - see above for the exact error message(s).
184***
185*** Most commonly, this is because the default PERL_CCFLAGS or PERL_OPTIMIZE
186*** flags are not supported by your compiler. Less often, this is because
187*** PERL_LIBS either contains a library not available on your system (such as
188*** -lcrypt), or because it lacks a required library (e.g. -lsocket or -lnsl).
189***
190*** You can provide your own flags by creating a ~/.staticperlrc file with
191*** variable assignments. For example (these are the actual values used):
192***
193
194PERL_CC="$PERL_CC"
195PERL_CCFLAGS="$PERL_CCFLAGS"
196PERL_OPTIMIZE="$PERL_OPTIMIZE"
197PERL_LDFLAGS="$PERL_LDFLAGS"
198PERL_LIBS="$PERL_LIBS"
199
200EOF
201 exit 1
177} 202}
178 203
179configure() { 204configure() {
180 fetch 205 fetch
181 206
205 -Uusethreads \ 230 -Uusethreads \
206 -Uuseithreads \ 231 -Uuseithreads \
207 -Uusemultiplicity \ 232 -Uusemultiplicity \
208 -Uusesfio \ 233 -Uusesfio \
209 -Uuseshrplib \ 234 -Uuseshrplib \
235 -A ccflags=" $PERL_CCFLAGS" \
210 -Dcc="$PERL_CC" \ 236 -Dcc="$PERL_CC" \
211 -Dcppflags="$PERL_CPPFLAGS" \
212 -Dccflags="-g2 -fno-strict-aliasing" \
213 -Doptimize="$PERL_OPTIMIZE" \ 237 -Doptimize="$PERL_OPTIMIZE" \
214 -Dldflags="$PERL_LDFLAGS" \ 238 -Dldflags="$PERL_LDFLAGS" \
215 -Dlibs="$PERL_LIBS" \ 239 -Dlibs="$PERL_LIBS" \
216 -Dprefix="$PERL_PREFIX" \ 240 -Dprefix="$PERL_PREFIX" \
217 -Dbin="$PERL_PREFIX/bin" \ 241 -Dbin="$PERL_PREFIX/bin" \
229 -Demail="$EMAIL" \ 253 -Demail="$EMAIL" \
230 -Dcf_email="$EMAIL" \ 254 -Dcf_email="$EMAIL" \
231 -Dcf_by="$EMAIL" \ 255 -Dcf_by="$EMAIL" \
232 $PERL_CONFIGURE \ 256 $PERL_CONFIGURE \
233 -Duseperlio \ 257 -Duseperlio \
234 -dE || fatal "Configure failed" 258 -dE || configure_failure
235 259
236 sedreplace ' 260 sedreplace '
237 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g 261 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g
238 s/ *-fno-stack-protector */ /g 262 s/ *-fno-stack-protector */ /g
239 ' config.sh 263 ' config.sh
429 case "$command" in 453 case "$command" in
430 version ) 454 version )
431 echo "staticperl version $VERSION" 455 echo "staticperl version $VERSION"
432 ;; 456 ;;
433 fetch | configure | build | install | clean | distclean) 457 fetch | configure | build | install | clean | distclean)
434 ( "$command" ) 458 ( "$command" ) || exit
435 ;; 459 ;;
436 instsrc ) 460 instsrc )
437 ( instsrc "$@" ) 461 ( instsrc "$@" ) || exit
438 exit 462 exit
439 ;; 463 ;;
440 instcpan ) 464 instcpan )
441 ( instcpan "$@" ) 465 ( instcpan "$@" ) || exit
442 exit 466 exit
443 ;; 467 ;;
444 cpan ) 468 cpan )
445 ( install ) 469 ( install ) || exit
446 "$PERL_PREFIX/bin/cpan" "$@" 470 "$PERL_PREFIX/bin/cpan" "$@"
447 exit 471 exit
448 ;; 472 ;;
449 mkbundle ) 473 mkbundle )
450 ( install ) 474 ( install ) || exit
451 bundle "$@" 475 bundle "$@"
452 exit 476 exit
453 ;; 477 ;;
454 mkperl ) 478 mkperl )
455 ( install ) 479 ( install ) || exit
456 bundle --perl "$@" 480 bundle --perl "$@"
457 exit 481 exit
458 ;; 482 ;;
459 mkapp ) 483 mkapp )
460 ( install ) 484 ( install ) || exit
461 bundle --app "$@" 485 bundle --app "$@"
462 exit 486 exit
463 ;; 487 ;;
464 help ) 488 help )
465 podusage 2 489 podusage 2

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines