App-Staticperl
view release on metacpan or search on metacpan
733734735736737738739740741742743744745746747748749750751752753
This will have
no
effect
unless
the library is actually linked
against, specifically,
"--staticlib"
will not
link
against the
named library
unless
it would be linked against anyway.
Example:
link
libcrypt statically into the final binary.
staticperl mkperl -MIO::AIO --staticlib
crypt
# ldopts might now contain:
# -lm -Wl,-Bstatic -lcrypt -Wl,-Bdynamic -lpthread
"--extra-cflags"
string
Specifies extra compiler flags, used
when
compiling the bundle
file. The flags are appended to all the existing flags, so can
be sued to
override
settings.
"--extra-ldflags"
string
Specifies extra linker flags, used
when
linking the bundle.
"--extra-libs"
string
856857858859860861862863864865866867868869870871872873874875876877878
for
further tweaking.
"PERL_PREFIX"
The directory where perl gets installed (
default
:
$STATICPERL
/perl),
i.e. where the bin and lib subdirectories will end up. Previous
contents will be removed on installation.
"PERL_CONFIGURE"
Additional Configure options - these are simply passed to the perl
Configure script. For example,
if
you wanted to enable dynamic
loading, you could pass
"-Dusedl"
. To enable ithreads (Why would you
want that insanity? Don't! Use forks instead!) you would pass
"-Duseithreads"
and so on.
More commonly, you would either activate 64 bit integer support
(
"-Duse64bitint"
), or disable large files support (-Uuselargefiles),
to reduce filesize further.
"PERL_CC"
,
"PERL_CCFLAGS"
,
"PERL_OPTIMIZE"
,
"PERL_LDFLAGS"
,
"PERL_LIBS"
These flags are passed to perl's Configure script, and are generally
optimised
for
small size (at the cost of performance). Since they
also contain subtle workarounds
around
various build issues,
changing these usually requires understanding their
default
values
-
918919920921922923924925926927928929930931932933934935936937commands, just define the corresponding function.
The actual order in which hooks are invoked during a full install from
scratch is
"preconfigure"
,
"patchconfig"
,
"postconfigure"
,
"postbuild"
,
"postinstall"
.
Example: install extra modules from CPAN and from some directories at
staticperl install
time
.
postinstall() {
rm -rf lib/threads*
# weg mit Schaden
instcpan IO::AIO EV
instsrc ~/src/AnyEvent
instsrc ~/src/XML-Sablotron-1.0100001
instcpan Anyevent::AIO AnyEvent::HTTPD
}
preconfigure
Called just
before
running ./Configure in the perl source directory.
Current working directory is the perl source directory.
bin/staticperl view on Meta::CPAN
24252627282930313233343536373839404142434445464748495051# case "$ARCH" in
# i*86 )
# PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only
# ;;
# esac
# ;;
#esac
# -Wl,--gc-sections makes it impossible to check for undefined references
# for some reason so we need to patch away the "-no" after Configure and before make :/
# --allow-multiple-definition exists to work around uclibc's pthread static linking bug
#PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition"
PERL_LDFLAGS=
PERL_LIBS=
"-lm -lcrypt"
# perl loves to add lotsa crap itself
# some configuration options for modules
PERL_MM_USE_DEFAULT=1
PERL_MM_OPT=
"MAN1PODS= MAN3PODS="
#CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow
#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'
export PERL_MM_USE_DEFAULT PERL_MM_OPT
# which extra modules to install by default from CPAN that are
# required by mkbundle
STATICPERL_MODULES=
"ExtUtils::MakeMaker ExtUtils::CBuilder common::sense Pod::Strip PPI PPI::XS Pod::Usage"
# which extra modules you might want to install
EXTRA_MODULES=
""
bin/staticperl view on Meta::CPAN
299300301302303304305306307308309310311312313314315316317318319320
grep
-
q --
usedl=.define hints/darwin.sh && \
sedreplace
'/^usedl=.define.;$/d'
hints/darwin.sh
preconfigure || fatal
"preconfigure hook failed"
# trace configure \
sh Configure -Duselargefiles \
-Uuse64bitint \
-Dusemymalloc=n \
-Uusedl \
-Uusethreads \
-Uuseithreads \
-Uusemultiplicity \
-Uusesfio \
-Uuseshrplib \
-Uinstallusrbinperl \
-A ccflags=
" $PERL_CCFLAGS"
\
-Dcc=
"$PERL_CC"
\
-Doptimize=
"$PERL_OPTIMIZE"
\
-Dldflags=
"$PERL_LDFLAGS"
\
-Dlibs=
"$PERL_LIBS"
\
-Dprefix=
"$PERL_PREFIX"
\
bin/staticperl view on Meta::CPAN
280628072808280928102811281228132814281528162817281828192820282128222823282428252826This will have
no
effect
unless
the library is actually linked against,
specifically, C<--staticlib> will not
link
against the named library
unless
it would be linked against anyway.
Example:
link
libcrypt statically into the final binary.
staticperl mkperl -MIO::AIO --staticlib
crypt
# ldopts might now contain:
# -lm -Wl,-Bstatic -lcrypt -Wl,-Bdynamic -lpthread
=item C<--extra-cflags> string
Specifies extra compiler flags, used when compiling the bundle file. The
flags are appended to all the existing flags, so can be sued to override
settings.
=item C<--extra-ldflags> string
Specifies extra linker flags, used when linking the bundle.
bin/staticperl view on Meta::CPAN
2962296329642965296629672968296929702971297229732974297529762977297829792980298129822983=item C<PERL_PREFIX>
The directory where perl gets installed (default: F<$STATICPERL/perl>),
i.e. where the F<bin> and F<lib> subdirectories will end up. Previous
contents will be removed on installation.
=item C<PERL_CONFIGURE>
Additional Configure options - these are simply passed to the perl
Configure script. For example, if you wanted to enable dynamic loading,
you could pass C<-Dusedl>. To enable ithreads (Why would you want that
insanity? Don't! Use L<forks> instead!) you would pass C<-Duseithreads>
and so on.
More commonly, you would either activate 64 bit integer support
(C<-Duse64bitint>), or disable large files support (-Uuselargefiles), to
reduce filesize further.
=item C<PERL_CC>, C<PERL_CCFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS>
These flags are passed to perl's F<Configure> script, and are generally
optimised for small size (at the cost of performance). Since they also
bin/staticperl view on Meta::CPAN
30363037303830393040304130423043304430453046304730483049305030513052305330543055commands, just define the corresponding function.
The actual order in which hooks are invoked during a full install
from scratch is C<preconfigure>, C<patchconfig>, C<postconfigure>,
C<postbuild>, C<postinstall>.
Example: install extra modules from CPAN and from some directories
at F<staticperl install>
time
.
postinstall() {
rm -rf lib/threads*
# weg mit Schaden
instcpan IO::AIO EV
instsrc ~/src/AnyEvent
instsrc ~/src/XML-Sablotron-1.0100001
instcpan Anyevent::AIO AnyEvent::HTTPD
}
=over 4
=item preconfigure
staticperl.pod view on Meta::CPAN
793794795796797798799800801802803804805806807808809810811812813This will have
no
effect
unless
the library is actually linked against,
specifically, C<--staticlib> will not
link
against the named library
unless
it would be linked against anyway.
Example:
link
libcrypt statically into the final binary.
staticperl mkperl -MIO::AIO --staticlib
crypt
# ldopts might now contain:
# -lm -Wl,-Bstatic -lcrypt -Wl,-Bdynamic -lpthread
=item C<--extra-cflags> string
Specifies extra compiler flags, used when compiling the bundle file. The
flags are appended to all the existing flags, so can be sued to override
settings.
=item C<--extra-ldflags> string
Specifies extra linker flags, used when linking the bundle.
staticperl.pod view on Meta::CPAN
949950951952953954955956957958959960961962963964965966967968969970=item C<PERL_PREFIX>
The directory where perl gets installed (default: F<$STATICPERL/perl>),
i.e. where the F<bin> and F<lib> subdirectories will end up. Previous
contents will be removed on installation.
=item C<PERL_CONFIGURE>
Additional Configure options - these are simply passed to the perl
Configure script. For example, if you wanted to enable dynamic loading,
you could pass C<-Dusedl>. To enable ithreads (Why would you want that
insanity? Don't! Use L<forks> instead!) you would pass C<-Duseithreads>
and so on.
More commonly, you would either activate 64 bit integer support
(C<-Duse64bitint>), or disable large files support (-Uuselargefiles), to
reduce filesize further.
=item C<PERL_CC>, C<PERL_CCFLAGS>, C<PERL_OPTIMIZE>, C<PERL_LDFLAGS>, C<PERL_LIBS>
These flags are passed to perl's F<Configure> script, and are generally
optimised for small size (at the cost of performance). Since they also
staticperl.pod view on Meta::CPAN
10231024102510261027102810291030103110321033103410351036103710381039104010411042commands, just define the corresponding function.
The actual order in which hooks are invoked during a full install
from scratch is C<preconfigure>, C<patchconfig>, C<postconfigure>,
C<postbuild>, C<postinstall>.
Example: install extra modules from CPAN and from some directories
at F<staticperl install>
time
.
postinstall() {
rm -rf lib/threads*
# weg mit Schaden
instcpan IO::AIO EV
instsrc ~/src/AnyEvent
instsrc ~/src/XML-Sablotron-1.0100001
instcpan Anyevent::AIO AnyEvent::HTTPD
}
=over 4
=item preconfigure
staticperl.sh view on Meta::CPAN
24252627282930313233343536373839404142434445464748495051# case "$ARCH" in
# i*86 )
# PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only
# ;;
# esac
# ;;
#esac
# -Wl,--gc-sections makes it impossible to check for undefined references
# for some reason so we need to patch away the "-no" after Configure and before make :/
# --allow-multiple-definition exists to work around uclibc's pthread static linking bug
#PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition"
PERL_LDFLAGS=
PERL_LIBS=
"-lm -lcrypt"
# perl loves to add lotsa crap itself
# some configuration options for modules
PERL_MM_USE_DEFAULT=1
PERL_MM_OPT=
"MAN1PODS= MAN3PODS="
#CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow
#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'
export PERL_MM_USE_DEFAULT PERL_MM_OPT
# which extra modules to install by default from CPAN that are
# required by mkbundle
STATICPERL_MODULES=
"ExtUtils::MakeMaker ExtUtils::CBuilder common::sense Pod::Strip PPI PPI::XS Pod::Usage"
# which extra modules you might want to install
EXTRA_MODULES=
""
staticperl.sh view on Meta::CPAN
299300301302303304305306307308309310311312313314315316317318319320
grep
-
q --
usedl=.define hints/darwin.sh && \
sedreplace
'/^usedl=.define.;$/d'
hints/darwin.sh
preconfigure || fatal
"preconfigure hook failed"
# trace configure \
sh Configure -Duselargefiles \
-Uuse64bitint \
-Dusemymalloc=n \
-Uusedl \
-Uusethreads \
-Uuseithreads \
-Uusemultiplicity \
-Uusesfio \
-Uuseshrplib \
-Uinstallusrbinperl \
-A ccflags=
" $PERL_CCFLAGS"
\
-Dcc=
"$PERL_CC"
\
-Doptimize=
"$PERL_OPTIMIZE"
\
-Dldflags=
"$PERL_LDFLAGS"
\
-Dlibs=
"$PERL_LIBS"
\
-Dprefix=
"$PERL_PREFIX"
\
( run in 0.292 second using v1.01-cache-2.11-cpan-0f795438458 )