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.22 by root, Wed Dec 15 00:17:48 2010 UTC vs.
Revision 1.33 by root, Thu Feb 24 07:10:03 2011 UTC

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# 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.3 # 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_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP" 15PERL_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" 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
33# --allow-multiple-definition exists to work around uclibc's pthread static linking bug 33# --allow-multiple-definition exists to work around uclibc's pthread static linking bug
34PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition" 34PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition"
35PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself 35PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself
36 36
37# some configuration options for modules 37# some configuration options for modules
38export PERL_MM_USE_DEFAULT=1 38PERL_MM_USE_DEFAULT=1
39#export CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow 39#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' 40EV_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'
41export PERL_MM_USE_DEFAULT CORO_INTERFACE EV_EXTRA_DEFS
41 42
42# which extra modules to install by default from CPAN that are 43# which extra modules to install by default from CPAN that are
43# required by mkbundle 44# required by mkbundle
44STATICPERL_MODULES="common::sense Pod::Strip PPI::XS Pod::Usage" 45STATICPERL_MODULES="common::sense Pod::Strip PPI::XS Pod::Usage"
45 46
66 67
67MKBUNDLE="${MKBUNDLE:=$STATICPERL/mkbundle}" 68MKBUNDLE="${MKBUNDLE:=$STATICPERL/mkbundle}"
68PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed 69PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed
69 70
70unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG 71unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
71export LC_ALL=C # just to be on the safe side 72LC_ALL=C; export LC_ALL # just to be on the safe side
72 73
73# set version in a way that Makefile.PL can extract 74# set version in a way that Makefile.PL can extract
74VERSION=VERSION; eval \ 75VERSION=VERSION; eval \
75$VERSION=0.912 76$VERSION="1.1"
76 77
77BZ2=bz2 78BZ2=bz2
78BZIP2=bzip2 79BZIP2=bzip2
79 80
80fatal() { 81fatal() {
126 127
127clean() { 128clean() {
128 rm -rf "$STATICPERL/src/perl-$PERL_VERSION" 129 rm -rf "$STATICPERL/src/perl-$PERL_VERSION"
129} 130}
130 131
132realclean() {
133 rm -f "$PERL_PREFIX/staticstamp.postinstall"
134 rm -f "$PERL_PREFIX/staticstamp.install"
135 rm -f "$STATICPERL/src/perl-"*"/staticstamp.configure"
136}
137
131fetch() { 138fetch() {
132 rcd "$STATICPERL" 139 rcd "$STATICPERL"
133 140
134 mkdir -p src 141 mkdir -p src
135 rcd src 142 rcd src
145perl-$PERL_VERSION.tar.$BZ2 in $STATICPERL 152perl-$PERL_VERSION.tar.$BZ2 in $STATICPERL
146trying $URL 153trying $URL
147EOF 154EOF
148 155
149 rm -f perl-$PERL_VERSION.tar.$BZ2~ # just to be on the safe side 156 rm -f perl-$PERL_VERSION.tar.$BZ2~ # just to be on the safe side
157 curl -f >perl-$PERL_VERSION.tar.$BZ2~ "$URL" \
150 wget -O perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ 158 || wget -O perl-$PERL_VERSION.tar.$BZ2~ "$URL" \
151 || curl >perl-$PERL_VERSION.tar.$BZ2~ "$URL" \
152 || fatal "$URL: unable to download" 159 || fatal "$URL: unable to download"
153 rm -f perl-$PERL_VERSION.tar.$BZ2 160 rm -f perl-$PERL_VERSION.tar.$BZ2
154 mv perl-$PERL_VERSION.tar.$BZ2~ perl-$PERL_VERSION.tar.$BZ2 161 mv perl-$PERL_VERSION.tar.$BZ2~ perl-$PERL_VERSION.tar.$BZ2
155 fi 162 fi
156 163
158unpacking perl 165unpacking perl
159EOF 166EOF
160 167
161 mkdir -p unpack 168 mkdir -p unpack
162 rm -rf unpack/perl-$PERL_VERSION 169 rm -rf unpack/perl-$PERL_VERSION
163 $BZIP2 -d <perl-$PERL_VERSION.tar.bz2 | tar xfC - unpack \ 170 $BZIP2 -d <perl-$PERL_VERSION.tar.$BZ2 | tar xfC - unpack \
164 || fatal "perl-$PERL_VERSION.tar.bz2: error during unpacking" 171 || fatal "perl-$PERL_VERSION.tar.$BZ2: error during unpacking"
165 chmod -R u+w unpack/perl-$PERL_VERSION 172 chmod -R u+w unpack/perl-$PERL_VERSION
166 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION 173 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION
167 rmdir -p unpack 174 rmdir -p unpack
168 fi 175 fi
169} 176}
214 221
215 rm -f "$PERL_PREFIX/staticstamp.install" 222 rm -f "$PERL_PREFIX/staticstamp.install"
216 223
217 "$MAKE" distclean >/dev/null 2>&1 224 "$MAKE" distclean >/dev/null 2>&1
218 225
226 sedreplace '/^#define SITELIB/d' config_h.SH
227
219 # I hate them 228 # I hate them for this
220 grep -q -- -fstack-protector Configure && \ 229 grep -q -- -fstack-protector Configure && \
221 sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure 230 sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure
222 231
223 preconfigure 232 preconfigure
224 233
230 -Uusethreads \ 239 -Uusethreads \
231 -Uuseithreads \ 240 -Uuseithreads \
232 -Uusemultiplicity \ 241 -Uusemultiplicity \
233 -Uusesfio \ 242 -Uusesfio \
234 -Uuseshrplib \ 243 -Uuseshrplib \
244 -Uinstallusrbinperl \
235 -A ccflags=" $PERL_CCFLAGS" \ 245 -A ccflags=" $PERL_CCFLAGS" \
236 -Dcc="$PERL_CC" \ 246 -Dcc="$PERL_CC" \
237 -Doptimize="$PERL_OPTIMIZE" \ 247 -Doptimize="$PERL_OPTIMIZE" \
238 -Dldflags="$PERL_LDFLAGS" \ 248 -Dldflags="$PERL_LDFLAGS" \
239 -Dlibs="$PERL_LIBS" \ 249 -Dlibs="$PERL_LIBS" \
242 -Dprivlib="$PERL_PREFIX/lib" \ 252 -Dprivlib="$PERL_PREFIX/lib" \
243 -Darchlib="$PERL_PREFIX/lib" \ 253 -Darchlib="$PERL_PREFIX/lib" \
244 -Uusevendorprefix \ 254 -Uusevendorprefix \
245 -Dsitelib="$PERL_PREFIX/lib" \ 255 -Dsitelib="$PERL_PREFIX/lib" \
246 -Dsitearch="$PERL_PREFIX/lib" \ 256 -Dsitearch="$PERL_PREFIX/lib" \
247 -Usitelibexp \
248 -Uman1dir \ 257 -Uman1dir \
249 -Uman3dir \ 258 -Uman3dir \
250 -Usiteman1dir \ 259 -Usiteman1dir \
251 -Usiteman3dir \ 260 -Usiteman3dir \
252 -Dpager=/usr/bin/less \ 261 -Dpager=/usr/bin/less \
452 command="${1#--}"; shift 461 command="${1#--}"; shift
453 case "$command" in 462 case "$command" in
454 version ) 463 version )
455 echo "staticperl version $VERSION" 464 echo "staticperl version $VERSION"
456 ;; 465 ;;
457 fetch | configure | build | install | clean | distclean) 466 fetch | configure | build | install | clean | realclean | distclean)
458 ( "$command" ) || exit 467 ( "$command" ) || exit
459 ;; 468 ;;
460 instsrc ) 469 instsrc )
461 ( instsrc "$@" ) || exit 470 ( instsrc "$@" ) || exit
462 exit 471 exit

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines