App-Staticperl

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
    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

README  view on Meta::CPAN

856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
    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 -

README  view on Meta::CPAN

918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
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

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#      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

299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
   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

2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
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

2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
=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

3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
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

793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
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

949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
=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

1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
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

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#      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

299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
   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 )