… | |
… | |
10 | # perl build variables |
10 | # perl build variables |
11 | MAKE=make |
11 | MAKE=make |
12 | PERL_VERSION=5.12.2 # 5.8.9 is also a good choice |
12 | PERL_VERSION=5.12.2 # 5.8.9 is also a good choice |
13 | PERL_CC=cc |
13 | PERL_CC=cc |
14 | PERL_CONFIGURE="" # additional Configure arguments |
14 | PERL_CONFIGURE="" # additional Configure arguments |
15 | PERL_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP" |
15 | PERL_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG" |
16 | PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" |
16 | PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" |
17 | |
17 | |
18 | ARCH="$(uname -m)" |
18 | ARCH="$(uname -m)" |
19 | |
19 | |
20 | case "$ARCH" in |
20 | case "$ARCH" in |
… | |
… | |
124 | ############################################################################# |
124 | ############################################################################# |
125 | # download/configure/compile/install perl |
125 | # download/configure/compile/install perl |
126 | |
126 | |
127 | clean() { |
127 | clean() { |
128 | rm -rf "$STATICPERL/src/perl-$PERL_VERSION" |
128 | rm -rf "$STATICPERL/src/perl-$PERL_VERSION" |
|
|
129 | } |
|
|
130 | |
|
|
131 | realclean() { |
|
|
132 | rm -f "$PERL_PREFIX/staticstamp.postinstall" |
|
|
133 | rm -f "$PERL_PREFIX/staticstamp.install" |
|
|
134 | rm -f "$STATICPERL/src/perl-"*"/staticstamp.configure" |
129 | } |
135 | } |
130 | |
136 | |
131 | fetch() { |
137 | fetch() { |
132 | rcd "$STATICPERL" |
138 | rcd "$STATICPERL" |
133 | |
139 | |
… | |
… | |
214 | |
220 | |
215 | rm -f "$PERL_PREFIX/staticstamp.install" |
221 | rm -f "$PERL_PREFIX/staticstamp.install" |
216 | |
222 | |
217 | "$MAKE" distclean >/dev/null 2>&1 |
223 | "$MAKE" distclean >/dev/null 2>&1 |
218 | |
224 | |
|
|
225 | sedreplace '/^#define SITELIB/d' config_h.SH |
|
|
226 | |
219 | # I hate them |
227 | # I hate them for this |
220 | grep -q -- -fstack-protector Configure && \ |
228 | grep -q -- -fstack-protector Configure && \ |
221 | sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure |
229 | sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure |
222 | |
230 | |
223 | preconfigure |
231 | preconfigure |
224 | |
232 | |
… | |
… | |
242 | -Dprivlib="$PERL_PREFIX/lib" \ |
250 | -Dprivlib="$PERL_PREFIX/lib" \ |
243 | -Darchlib="$PERL_PREFIX/lib" \ |
251 | -Darchlib="$PERL_PREFIX/lib" \ |
244 | -Uusevendorprefix \ |
252 | -Uusevendorprefix \ |
245 | -Dsitelib="$PERL_PREFIX/lib" \ |
253 | -Dsitelib="$PERL_PREFIX/lib" \ |
246 | -Dsitearch="$PERL_PREFIX/lib" \ |
254 | -Dsitearch="$PERL_PREFIX/lib" \ |
247 | -Usitelibexp \ |
|
|
248 | -Uman1dir \ |
255 | -Uman1dir \ |
249 | -Uman3dir \ |
256 | -Uman3dir \ |
250 | -Usiteman1dir \ |
257 | -Usiteman1dir \ |
251 | -Usiteman3dir \ |
258 | -Usiteman3dir \ |
252 | -Dpager=/usr/bin/less \ |
259 | -Dpager=/usr/bin/less \ |
… | |
… | |
452 | command="${1#--}"; shift |
459 | command="${1#--}"; shift |
453 | case "$command" in |
460 | case "$command" in |
454 | version ) |
461 | version ) |
455 | echo "staticperl version $VERSION" |
462 | echo "staticperl version $VERSION" |
456 | ;; |
463 | ;; |
457 | fetch | configure | build | install | clean | distclean) |
464 | fetch | configure | build | install | clean | realclean | distclean) |
458 | ( "$command" ) || exit |
465 | ( "$command" ) || exit |
459 | ;; |
466 | ;; |
460 | instsrc ) |
467 | instsrc ) |
461 | ( instsrc "$@" ) || exit |
468 | ( instsrc "$@" ) || exit |
462 | exit |
469 | exit |