App-Staticperl
view release on metacpan or search on metacpan
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
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 -
commands, 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
# 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
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
This 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
=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
commands, 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
This 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
=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
commands, 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
# 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
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.658 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )