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.23 by root, Sat Dec 18 13:58:12 2010 UTC vs.
Revision 1.52 by root, Mon Mar 5 07:14:32 2012 UTC

1#!/bin/sh 1#!/bin/sh
2 2
3############################################################################# 3#############################################################################
4# configuration to fill in 4# configuration to fill in (or to replace in your .staticperlrc)
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>"
9DLCACHE=
9 10
10# perl build variables 11# perl build variables
11MAKE=make 12MAKE=make
12PERL_VERSION=5.12.2 # 5.8.9 is also a good choice 13PERL_VERSION=5.12.4 # 5.8.9 is also a good choice
13PERL_CC=cc 14PERL_CC=cc
14PERL_CONFIGURE="" # additional Configure arguments 15PERL_CONFIGURE="" # additional Configure arguments
15PERL_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG" 16PERL_CCFLAGS="-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG"
16PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" 17PERL_OPTIMIZE="-Os" # -Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math"
17 18
18ARCH="$(uname -m)" 19ARCH="$(uname -m)"
19 20
20case "$ARCH" in 21#case "$ARCH" in
21 i*86 | x86_64 | amd64 ) 22# i*86 | x86_64 | 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 -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64
23 case "$ARCH" in 24# case "$ARCH" in
24 i*86 ) 25# i*86 )
25 PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only 26# PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only
26 ;; 27# ;;
27 esac 28# esac
28 ;; 29# ;;
29esac 30#esac
30 31
31# -Wl,--gc-sections makes it impossible to check for undefined references 32# -Wl,--gc-sections makes it impossible to check for undefined references
32# for some reason so we need to patch away the "-no" after Configure and before make :/ 33# for some reason so we need to patch away the "-no" after Configure and before make :/
33# --allow-multiple-definition exists to work around uclibc's pthread static linking bug 34# --allow-multiple-definition exists to work around uclibc's pthread static linking bug
34PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition" 35#PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition"
36PERL_LDFLAGS=
35PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself 37PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself
36 38
37# some configuration options for modules 39# some configuration options for modules
38export PERL_MM_USE_DEFAULT=1 40PERL_MM_USE_DEFAULT=1
41PERL_MM_OPT="MAN1PODS= MAN3PODS="
39#export CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow 42#CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow
40export 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' 43#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'
44export PERL_MM_USE_DEFAULT PERL_MM_OPT
41 45
42# which extra modules to install by default from CPAN that are 46# which extra modules to install by default from CPAN that are
43# required by mkbundle 47# required by mkbundle
44STATICPERL_MODULES="common::sense Pod::Strip PPI::XS Pod::Usage" 48STATICPERL_MODULES="common::sense Pod::Strip PPI::XS Pod::Usage"
45 49
46# which extra modules you might want to install 50# which extra modules you might want to install
47EXTRA_MODULES="" 51EXTRA_MODULES=""
48 52
49# overridable functions 53# overridable functions
50preconfigure() { : ; } 54preconfigure() { : ; }
55patchconfig() { : ; }
51postconfigure() { : ; } 56postconfigure() { : ; }
52postbuild() { : ; } 57postbuild() { : ; }
53postinstall() { : ; } 58postinstall() { : ; }
54 59
55# now source user config, if any 60# now source user config, if any
62fi 67fi
63 68
64############################################################################# 69#############################################################################
65# support 70# support
66 71
67MKBUNDLE="${MKBUNDLE:=$STATICPERL/mkbundle}"
68PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed 72PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed
69 73
70unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG 74unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
75unset PERL_MB_OPT
71export LC_ALL=C # just to be on the safe side 76LC_ALL=C; export LC_ALL # just to be on the safe side
77
78# prepend PATH - not required by staticperl itself, but might make
79# life easier when working in e.g. "staticperl cpan / look"
80PATH="$PERL_PREFIX/perl/bin:$PATH"
72 81
73# set version in a way that Makefile.PL can extract 82# set version in a way that Makefile.PL can extract
74VERSION=VERSION; eval \ 83VERSION=VERSION; eval \
75$VERSION=0.912 84$VERSION="1.41"
76 85
77BZ2=bz2 86BZ2=bz2
78BZIP2=bzip2 87BZIP2=bzip2
79 88
80fatal() { 89fatal() {
123 132
124############################################################################# 133#############################################################################
125# download/configure/compile/install perl 134# download/configure/compile/install perl
126 135
127clean() { 136clean() {
128 rm -rf "$STATICPERL/src/perl-$PERL_VERSION" 137 rm -rf "$STATICPERL/src"
129} 138}
130 139
131realclean() { 140realclean() {
132 rm -f "$PERL_PREFIX/staticstamp.postinstall" 141 rm -f "$PERL_PREFIX/staticstamp.postinstall"
133 rm -f "$PERL_PREFIX/staticstamp.install" 142 rm -f "$PERL_PREFIX/staticstamp.install"
139 148
140 mkdir -p src 149 mkdir -p src
141 rcd src 150 rcd src
142 151
143 if ! [ -d "perl-$PERL_VERSION" ]; then 152 if ! [ -d "perl-$PERL_VERSION" ]; then
144 if ! [ -e "perl-$PERL_VERSION.tar.$BZ2" ]; then 153 PERLTAR=perl-$PERL_VERSION.tar.$BZ2
145 154
155 if ! [ -e $PERLTAR ]; then
146 URL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.$BZ2" 156 URL="$CPAN/src/5.0/$PERLTAR"
147 157
148 verblock <<EOF 158 verblock <<EOF
149downloading perl 159downloading perl
150to manually download perl yourself, place 160to manually download perl yourself, place
151perl-$PERL_VERSION.tar.$BZ2 in $STATICPERL 161perl-$PERL_VERSION.tar.$BZ2 in $STATICPERL
152trying $URL 162trying $URL
153EOF
154 163
164either curl or wget is required for automatic download.
165curl is tried first, then wget.
166
167you can configure a download cache directory via DLCACHE
168in your .staticperlrc to avoid repeated downloads.
169EOF
170
155 rm -f perl-$PERL_VERSION.tar.$BZ2~ # just to be on the safe side 171 rm -f $PERLTAR~ # just to be on the safe side
156 wget -O perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ 172 { [ "$DLCACHE" ] && cp "$DLCACHE"/$PERLTAR $PERLTAR~ >/dev/null 2>&1; } \
157 || curl >perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ 173 || wget -O $PERLTAR~ "$URL" \
174 || curl -f >$PERLTAR~ "$URL" \
158 || fatal "$URL: unable to download" 175 || fatal "$URL: unable to download"
159 rm -f perl-$PERL_VERSION.tar.$BZ2 176 rm -f $PERLTAR
160 mv perl-$PERL_VERSION.tar.$BZ2~ perl-$PERL_VERSION.tar.$BZ2 177 mv $PERLTAR~ $PERLTAR
178 if [ "$DLCACHE" ]; then
179 mkdir -p "$DLCACHE"
180 cp $PERLTAR "$DLCACHE"/$PERLTAR~ && \
181 mv "$DLCACHE"/$PERLTAR~ "$DLCACHE"/$PERLTAR
182 fi
161 fi 183 fi
162 184
163 verblock <<EOF 185 verblock <<EOF
164unpacking perl 186unpacking perl
165EOF 187EOF
166 188
167 mkdir -p unpack 189 mkdir -p unpack
168 rm -rf unpack/perl-$PERL_VERSION 190 rm -rf unpack/perl-$PERL_VERSION
169 $BZIP2 -d <perl-$PERL_VERSION.tar.bz2 | tar xfC - unpack \ 191 $BZIP2 -d <$PERLTAR | ( cd unpack && tar xf - ) \
170 || fatal "perl-$PERL_VERSION.tar.bz2: error during unpacking" 192 || fatal "$PERLTAR: error during unpacking"
171 chmod -R u+w unpack/perl-$PERL_VERSION 193 chmod -R u+w unpack/perl-$PERL_VERSION
172 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION 194 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION
173 rmdir -p unpack 195 rmdir -p unpack
174 fi 196 fi
175} 197}
226 248
227 # I hate them for this 249 # I hate them for this
228 grep -q -- -fstack-protector Configure && \ 250 grep -q -- -fstack-protector Configure && \
229 sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure 251 sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure
230 252
231 preconfigure 253 # what did that bloke think
254 grep -q -- usedl=.define hints/darwin.sh && \
255 sedreplace '/^usedl=.define.;$/d' hints/darwin.sh
256
257 preconfigure || fatal "preconfigure hook failed"
232 258
233# trace configure \ 259# trace configure \
234 sh Configure -Duselargefiles \ 260 sh Configure -Duselargefiles \
235 -Uuse64bitint \ 261 -Uuse64bitint \
236 -Dusemymalloc=n \ 262 -Dusemymalloc=n \
238 -Uusethreads \ 264 -Uusethreads \
239 -Uuseithreads \ 265 -Uuseithreads \
240 -Uusemultiplicity \ 266 -Uusemultiplicity \
241 -Uusesfio \ 267 -Uusesfio \
242 -Uuseshrplib \ 268 -Uuseshrplib \
269 -Uinstallusrbinperl \
243 -A ccflags=" $PERL_CCFLAGS" \ 270 -A ccflags=" $PERL_CCFLAGS" \
244 -Dcc="$PERL_CC" \ 271 -Dcc="$PERL_CC" \
245 -Doptimize="$PERL_OPTIMIZE" \ 272 -Doptimize="$PERL_OPTIMIZE" \
246 -Dldflags="$PERL_LDFLAGS" \ 273 -Dldflags="$PERL_LDFLAGS" \
247 -Dlibs="$PERL_LIBS" \ 274 -Dlibs="$PERL_LIBS" \
267 sedreplace ' 294 sedreplace '
268 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g 295 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g
269 s/ *-fno-stack-protector */ /g 296 s/ *-fno-stack-protector */ /g
270 ' config.sh 297 ' config.sh
271 298
299 patchconfig || fatal "patchconfig hook failed"
300
272 sh Configure -S || fatal "Configure -S failed" 301 sh Configure -S || fatal "Configure -S failed"
273 302
274 postconfigure || fatal "postconfigure hook failed" 303 postconfigure || fatal "postconfigure hook failed"
275 304
276 touch staticstamp.configure 305 : > staticstamp.configure
306}
307
308write_shellscript() {
309 {
310 echo "#!/bin/sh"
311 echo "STATICPERL=\"$STATICPERL\""
312 echo "PERL_PREFIX=\"$PERL_PREFIX\""
313 echo "MAKE=\"$MAKE\""
314 cat
315 } >"$PERL_PREFIX/bin/$1"
316 chmod 755 "$PERL_PREFIX/bin/$1"
277} 317}
278 318
279build() { 319build() {
280 configure 320 configure
281 321
288 rm -f "$PERL_PREFIX/staticstamp.install" 328 rm -f "$PERL_PREFIX/staticstamp.install"
289 329
290 "$MAKE" || fatal "make: error while building perl" 330 "$MAKE" || fatal "make: error while building perl"
291 331
292 postbuild || fatal "postbuild hook failed" 332 postbuild || fatal "postbuild hook failed"
333}
334
335_postinstall() {
336 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then
337 NOCHECK_INSTALL=+
338 instcpan $STATICPERL_MODULES
339 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES
340
341 postinstall || fatal "postinstall hook failed"
342
343 : > "$PERL_PREFIX/staticstamp.postinstall"
344 fi
293} 345}
294 346
295install() { 347install() {
296 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then 348 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
297 build 349 build
302EOF 354EOF
303 355
304 ln -sf "perl/bin/" "$STATICPERL/bin" 356 ln -sf "perl/bin/" "$STATICPERL/bin"
305 ln -sf "perl/lib/" "$STATICPERL/lib" 357 ln -sf "perl/lib/" "$STATICPERL/lib"
306 358
359 mkdir "$STATICPERL/patched"
360
307 ln -sf "$PERL_PREFIX" "$STATICPERL/perl" # might get overwritten 361 ln -sf "$PERL_PREFIX" "$STATICPERL/perl" # might get overwritten
308 rm -rf "$PERL_PREFIX" # by this rm -rf 362 rm -rf "$PERL_PREFIX" # by this rm -rf
309 363
310 "$MAKE" install || fatal "make install: error while installing" 364 "$MAKE" install || fatal "make install: error while installing"
311 365
312 rcd "$PERL_PREFIX" 366 rcd "$PERL_PREFIX"
313 367
314 # create a "make install" replacement for CPAN 368 # create a "make install" replacement for CPAN
315 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF 369 write_shellscript SP-make-install-make <<'EOF'
316"$MAKE" || exit 370#CAT make-install-make.sh
317
318if find blib/arch/auto -type f | grep -q -v .exists; then
319 echo Probably an XS module, rebuilding perl
320 if "$MAKE" perl; then
321 mv perl "$PERL_PREFIX"/bin/perl~ \
322 && rm -f "$PERL_PREFIX"/bin/perl \
323 && mv "$PERL_PREFIX"/bin/perl~ "$PERL_PREFIX"/bin/perl
324 "$MAKE" -f Makefile.aperl map_clean
325 else
326 "$MAKE" -f Makefile.aperl map_clean
327 exit 1
328 fi
329fi
330
331"$MAKE" install UNINST=1
332EOF 371EOF
333 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install
334 372
373 # create a "patch modules" helper
374 write_shellscript SP-patch-postinstall <<'EOF'
375#CAT patch-postinstall.sh
376EOF
377
378 "$PERL_PREFIX/bin/SP-patch-postinstall"
379
335 # trick CPAN into avoiding ~/.cpan completely 380 # help to trick CPAN into avoiding ~/.cpan completely
336 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" 381 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
337 382
383 # we call cpan with -MCPAN::MyConfig in this script, which
384 # is strictly unnecssary as we have to patch CPAN anyway,
385 # so consider it "for good measure".
338 "$PERL_PREFIX"/bin/perl -MCPAN -e ' 386 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e '
339 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); 387 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
340 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 388 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
341 CPAN::Shell->o (conf => q<init>); 389 CPAN::Shell->o (conf => q<init>);
342 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 390 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
343 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); 391 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build");
344 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs"); 392 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs");
345 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile"); 393 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile");
346 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources"); 394 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources");
347 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/cpan-make-install"); 395 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/SP-make-install-make");
348 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); 396 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>);
349 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>); 397 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>);
398 CPAN::Shell->o (conf => q<prefer_installer>, "EUMM");
350 CPAN::Shell->o (conf => q<commit>); 399 CPAN::Shell->o (conf => q<commit>);
351 ' || fatal "error while initialising CPAN" 400 ' || fatal "error while initialising CPAN"
352 401
353 touch "$PERL_PREFIX/staticstamp.install" 402 : > "$PERL_PREFIX/staticstamp.install"
354 fi 403 fi
355 404
405 _postinstall
406}
407
408import() {
409 IMPORT="$1"
410
411 rcd "$STATICPERL"
412
356 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then 413 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
357 NOCHECK_INSTALL=+ 414 verblock <<EOF
358 instcpan $STATICPERL_MODULES 415import perl from $IMPORT to $STATICPERL
359 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES 416EOF
360 417
361 postinstall || fatal "postinstall hook failed" 418 rm -rf bin cpan lib patched perl src
419 mkdir -m 755 perl perl/bin
420 ln -s perl/bin/ bin
421 ln -s "$IMPORT" perl/bin/
362 422
423 echo "$IMPORT" > "$PERL_PREFIX/.import"
424
363 touch "$PERL_PREFIX/staticstamp.postinstall" 425 : > "$PERL_PREFIX/staticstamp.install"
364 fi 426 fi
427
428 _postinstall
365} 429}
366 430
367############################################################################# 431#############################################################################
368# install a module from CPAN 432# install a module from CPAN
369 433
373 verblock <<EOF 437 verblock <<EOF
374installing modules from CPAN 438installing modules from CPAN
375$@ 439$@
376EOF 440EOF
377 441
378 for mod in "$@"; do 442 MYCONFIG=
379 "$PERL_PREFIX"/bin/perl -MCPAN -e 'notest install => "'"$mod"'"' \ 443 [ -e "$PERL_PREFIX/.import" ] || MYCONFIG=-MCPAN::MyConfig
380 || fatal "$mod: unable to install from CPAN" 444
381 done 445 "$PERL_PREFIX"/bin/perl $MYCONFIG -MCPAN -e 'notest (install => $_) for @ARGV' -- "$@" | tee "$STATICPERL/instcpan.log"
446
447 if grep -q " -- NOT OK\$" "$STATICPERL/instcpan.log"; then
448 fatal "failure while installing modules from CPAN ($@)"
449 fi
382 rm -rf "$STATICPERL/build" 450 rm -f "$STATICPERL/instcpan.log"
383} 451}
384 452
385############################################################################# 453#############################################################################
386# install a module from unpacked sources 454# install a module from unpacked sources
387 455
400 rcd $mod 468 rcd $mod
401 "$MAKE" -f Makefile.aperl map_clean >/dev/null 2>&1 469 "$MAKE" -f Makefile.aperl map_clean >/dev/null 2>&1
402 "$MAKE" distclean >/dev/null 2>&1 470 "$MAKE" distclean >/dev/null 2>&1
403 "$PERL_PREFIX"/bin/perl Makefile.PL || fatal "$mod: error running Makefile.PL" 471 "$PERL_PREFIX"/bin/perl Makefile.PL || fatal "$mod: error running Makefile.PL"
404 "$MAKE" || fatal "$mod: error building module" 472 "$MAKE" || fatal "$mod: error building module"
405 "$PERL_PREFIX"/bin/cpan-make-install || fatal "$mod: error installing module" 473 "$PERL_PREFIX"/bin/SP-make-install-make install || fatal "$mod: error installing module"
406 "$MAKE" distclean >/dev/null 2>&1 474 "$MAKE" distclean >/dev/null 2>&1
407 exit 0 475 exit 0
408 ) || exit $? 476 ) || exit $?
409 done 477 done
410} 478}
442#CAT mkbundle 510#CAT mkbundle
443MKBUNDLE 511MKBUNDLE
444} 512}
445 513
446bundle() { 514bundle() {
515 MKBUNDLE="${MKBUNDLE:=$PERL_PREFIX/bin/SP-mkbundle}"
447 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create" 516 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create"
448 chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE" 517 chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE"
449 CACHE="$STATICPERL/cache" 518 CACHE="$STATICPERL/cache"
450 mkdir -p "$CACHE" 519 mkdir -p "$CACHE"
451 "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@" 520 "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@"
459 command="${1#--}"; shift 528 command="${1#--}"; shift
460 case "$command" in 529 case "$command" in
461 version ) 530 version )
462 echo "staticperl version $VERSION" 531 echo "staticperl version $VERSION"
463 ;; 532 ;;
464 fetch | configure | build | install | clean | realclean | distclean) 533 fetch | configure | build | install | clean | realclean | distclean )
465 ( "$command" ) || exit 534 ( "$command" ) || exit
535 ;;
536 import )
537 ( import "$1" ) || exit
538 shift
466 ;; 539 ;;
467 instsrc ) 540 instsrc )
468 ( instsrc "$@" ) || exit 541 ( instsrc "$@" ) || exit
469 exit 542 exit
470 ;; 543 ;;
471 instcpan ) 544 instcpan )
472 ( instcpan "$@" ) || exit 545 ( instcpan "$@" ) || exit
473 exit 546 exit
474 ;; 547 ;;
548 perl )
549 ( install ) || exit
550 exec "$PERL_PREFIX/bin/perl" "$@"
551 exit
552 ;;
475 cpan ) 553 cpan )
476 ( install ) || exit 554 ( install ) || exit
555 PERL="$PERL_PREFIX/bin/perl"
556 export PERL
477 "$PERL_PREFIX/bin/cpan" "$@" 557 exec "$PERL_PREFIX/bin/cpan" "$@"
478 exit 558 exit
479 ;; 559 ;;
480 mkbundle ) 560 mkbundle )
481 ( install ) || exit 561 ( install ) || exit
482 bundle "$@" 562 bundle "$@"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines