ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.pod
(Generate patch)

Comparing App-Staticperl/staticperl.pod (file contents):
Revision 1.39 by root, Sat Apr 2 11:00:34 2011 UTC vs.
Revision 1.66 by root, Fri Aug 4 03:14:33 2023 UTC

1=head1 NAME 1=head1 NAME
2 2
3staticperl - perl, libc, 100 modules, all in one 500kb file 3staticperl - perl, libc, 100 modules, all in one standalone 500kb file
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 staticperl help # print the embedded documentation 7 staticperl help # print the embedded documentation
8 staticperl fetch # fetch and unpack perl sources 8 staticperl fetch # fetch and unpack perl sources
11 staticperl install # build and then install perl 11 staticperl install # build and then install perl
12 staticperl clean # clean most intermediate files (restart at configure) 12 staticperl clean # clean most intermediate files (restart at configure)
13 staticperl distclean # delete everything installed by this script 13 staticperl distclean # delete everything installed by this script
14 staticperl perl ... # invoke the perlinterpreter 14 staticperl perl ... # invoke the perlinterpreter
15 staticperl cpan # invoke CPAN shell 15 staticperl cpan # invoke CPAN shell
16 staticperl instmod path... # install unpacked modules 16 staticperl instsrc path... # install unpacked modules
17 staticperl instcpan modulename... # install modules from CPAN 17 staticperl instcpan modulename... # install modules from CPAN
18 staticperl mkbundle <bundle-args...> # see documentation 18 staticperl mkbundle <bundle-args...> # see documentation
19 staticperl mkperl <bundle-args...> # see documentation 19 staticperl mkperl <bundle-args...> # see documentation
20 staticperl mkapp appname <bundle-args...> # see documentation 20 staticperl mkapp appname <bundle-args...> # see documentation
21 21
39file that contains perl interpreter, libc, all the modules you need, all 39file that contains perl interpreter, libc, all the modules you need, all
40the libraries you need and of course your actual program. 40the libraries you need and of course your actual program.
41 41
42With F<uClibc> and F<upx> on x86, you can create a single 500kb binary 42With F<uClibc> and F<upx> on x86, you can create a single 500kb binary
43that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO, 43that contains perl and 100 modules such as POSIX, AnyEvent, EV, IO::AIO,
44Coro and so on. Or any other choice of modules. 44Coro and so on. Or any other choice of modules (and some other size :).
45 45
46To see how this turns out, you can try out smallperl and bigperl, two 46To see how this turns out, you can try out smallperl and bigperl, two
47pre-built static and compressed perl binaries with many and even more 47pre-built static and compressed perl binaries with many and even more
48modules: just follow the links at L<http://staticperl.schmorp.de/>. 48modules: just follow the links at L<http://staticperl.schmorp.de/>.
49 49
84With F<staticperl>, the burden is mostly with the developer - only direct 84With F<staticperl>, the burden is mostly with the developer - only direct
85compile-time dependencies and L<AutoLoader> are handled automatically. 85compile-time dependencies and L<AutoLoader> are handled automatically.
86This means the modules to include often need to be tweaked manually. 86This means the modules to include often need to be tweaked manually.
87 87
88All this does not preclude more permissive modes to be implemented in 88All this does not preclude more permissive modes to be implemented in
89the future, but right now, you have to resolve state hidden dependencies 89the future, but right now, you have to resolve hidden dependencies
90manually. 90manually.
91 91
92=item * PAR works out of the box, F<staticperl> does not. 92=item * PAR works out of the box, F<staticperl> does not.
93 93
94Maintaining your own custom perl build can be a pain in the ass, and while 94Maintaining your own custom perl build can be a pain in the ass, and while
202=item F<staticperl cpan> [args...] 202=item F<staticperl cpan> [args...]
203 203
204Starts an interactive CPAN shell that you can use to install further 204Starts an interactive CPAN shell that you can use to install further
205modules. Installs the perl first if necessary, but apart from that, 205modules. Installs the perl first if necessary, but apart from that,
206no magic is involved: you could just as well run it manually via 206no magic is involved: you could just as well run it manually via
207F<~/.staticperl/perl/bin/cpan>. 207F<~/.staticperl/perl/bin/cpan>, except that F<staticperl> additionally
208sets the environment variable C<$PERL> to the path of the perl
209interpreter, which is handy in subshells.
208 210
209Any additional arguments are simply passed to the F<cpan> command. 211Any additional arguments are simply passed to the F<cpan> command.
210 212
211=item F<staticperl instcpan> module... 213=item F<staticperl instcpan> module...
212 214
346 add eg/httpd httpd.pm 348 add eg/httpd httpd.pm
347 349
348All options that specify modules or files to be added are processed in the 350All options that specify modules or files to be added are processed in the
349order given on the command line. 351order given on the command line.
350 352
351=head3 BUNDLE CREATION WORKFLOW / STATICPELR MKBUNDLE OPTIONS 353=head3 BUNDLE CREATION WORKFLOW / STATICPERL MKBUNDLE OPTIONS
352 354
353F<staticperl mkbundle> works by first assembling a list of candidate 355F<staticperl mkbundle> works by first assembling a list of candidate
354files and modules to include, then filtering them by include/exclude 356files and modules to include, then filtering them by include/exclude
355patterns. The remaining modules (together with their direct dependencies, 357patterns. The remaining modules (together with their direct dependencies,
356such as link libraries and L<AutoLoader> files) are then converted into 358such as link libraries and L<AutoLoader> files) are then converted into
541 # then later, in perl, use 543 # then later, in perl, use
542 use myfiles::file1; 544 use myfiles::file1;
543 require myfiles::file2; 545 require myfiles::file2;
544 my $res = do "myfiles/file3.pl"; 546 my $res = do "myfiles/file3.pl";
545 547
546=item C<--binadd> F<file> | C<--add> "F<file> alias" 548=item C<--addbin> F<file> | C<--addbin> "F<file> alias"
547 549
548Just like C<--add>, except that it treats the file as binary and adds it 550Just like C<--add>, except that it treats the file as binary and adds it
549without any postprocessing (perl files might get stripped to reduce their 551without any postprocessing (perl files might get stripped to reduce their
550size). 552size).
551 553
552If you specify an alias you should probably add a C<&> prefix to avoid 554If you specify an alias you should probably add a C</> prefix to avoid
553clashing with embedded perl files (whose paths never start with C<&>), 555clashing with embedded perl files (whose paths never start with C</>),
554and/or use a special directory prefix, such as C<&res/name>. 556and/or use a special directory prefix, such as C</res/name>.
555 557
556You can later get a copy of these files by calling C<staticperl::find 558You can later get a copy of these files by calling C<static::find
557"alias">. 559"alias">.
558 560
559An alternative way to embed binary files is to convert them to perl and 561An alternative way to embed binary files is to convert them to perl and
560use C<do> to get the contents - this method is a bit cumbersome, but works 562use C<do> to get the contents - this method is a bit cumbersome, but works
561both inside and outside of a staticperl bundle: 563both inside and outside of a staticperl bundle, without extra ado:
562 564
563 # a "binary" file, call it "bindata.pl" 565 # a "binary" file, call it "bindata.pl"
564 <<'SOME_MARKER' 566 <<'SOME_MARKER'
565 binary data NOT containing SOME_MARKER 567 binary data NOT containing SOME_MARKER
566 SOME_MARKER 568 SOME_MARKER
567 569
568 # load the binary 570 # load the binary
569 chomp (my $data = do "bindata.pl"); 571 chomp (my $data = do "bindata.pl");
572
573=item C<--allow-dynamic>
574
575By default, when F<mkbundle> hits a dynamic perl extension (e.g. a F<.so>
576or F<.dll> file), it will stop with a fatal error.
577
578When this option is enabled, F<mkbundle> packages the shared
579object into the bundle instead, with a prefix of F<!>
580(e.g. F<!auto/List/Util/Util.so>). What you do with that is currently up
581to you, F<staticperl> has no special support for this at the moment, apart
582from working around the lack of availability of F<PerlIO::scalar> while
583bootstrapping, at a speed cost.
584
585One way to deal with this is to write all files starting with F<!> into
586some directory and then C<unshift> that path onto C<@INC>.
587
588#TODO: example
570 589
571=back 590=back
572 591
573=item Step 2: filter all files using C<--include> and C<--exclude> options. 592=item Step 2: filter all files using C<--include> and C<--exclude> options.
574 593
685Last not least, if you need accurate line numbers in error messages, 704Last not least, if you need accurate line numbers in error messages,
686or in the unlikely case where C<pod> is too slow, or some module gets 705or in the unlikely case where C<pod> is too slow, or some module gets
687mistreated, you can specify C<none> to not mangle included perl sources in 706mistreated, you can specify C<none> to not mangle included perl sources in
688any way. 707any way.
689 708
709=item C<--compress> C<none>|C<lzf>
710
711Compress each included library file with C<lzf> (default), or do not
712compress (C<none>). LZF compression typically halves the size of the
713included library data at almost no overhead, but is counterproductive if
714you are using another compression solution such as C<UPX>, so it cna be
715disabled.
716
690=item C<--perl> 717=item C<--perl>
691 718
692After writing out the bundle files, try to link a new perl interpreter. It 719After writing out the bundle files, try to link a new perl interpreter. It
693will be called F<perl> and will be left in the current working 720will be called F<perl> and will be left in the current working
694directory. The bundle files will be removed. 721directory. The bundle files will be removed.
733standalone applications, and this option removes those known to cause 760standalone applications, and this option removes those known to cause
734trouble. 761trouble.
735 762
736Specifically, these are removed: 763Specifically, these are removed:
737 764
738C<PERL_HASH_SEED_DEBUG> and C<PERL_DEBUG_MSTATS> can cause underaible 765C<PERL_HASH_SEED_DEBUG> and C<PERL_DEBUG_MSTATS> can cause undesirable
739output, C<PERL5OPT>, C<PERL_DESTRUCT_LEVEL>, C<PERL_HASH_SEED> and 766output, C<PERL5OPT>, C<PERL_DESTRUCT_LEVEL>, C<PERL_HASH_SEED> and
740C<PERL_SIGNALS> can alter execution significantly, and C<PERL_UNICODE>, 767C<PERL_SIGNALS> can alter execution significantly, and C<PERL_UNICODE>,
741C<PERLIO_DEBUG> and C<PERLIO> can affect input and output. 768C<PERLIO_DEBUG> and C<PERLIO> can affect input and output.
742 769
743The variables C<PERL_LIB> and C<PERL5_LIB> are always ignored because the 770The variables C<PERL_LIB> and C<PERL5_LIB> are always ignored because the
781 staticperl mkperl -MIO::AIO --staticlib crypt 808 staticperl mkperl -MIO::AIO --staticlib crypt
782 809
783 # ldopts might now contain: 810 # ldopts might now contain:
784 # -lm -Wl,-Bstatic -lcrypt -Wl,-Bdynamic -lpthread 811 # -lm -Wl,-Bstatic -lcrypt -Wl,-Bdynamic -lpthread
785 812
813=item C<--extra-cflags> string
814
815Specifies extra compiler flags, used when compiling the bundle file. The
816flags are appended to all the existing flags, so can be sued to override
817settings.
818
819=item C<--extra-ldflags> string
820
821Specifies extra linker flags, used when linking the bundle.
822
823=item C<--extra-libs> string
824
825Extra linker flags, appended at the end when linking. The difference to
826C<--extra-ldflags> is that the ldflags are appended to the flags, before
827the objects and libraries, and the extra libs are added at the end.
828
786=back 829=back
787 830
788=back 831=back
789 832
790=head3 EXTENDED GLOB PATTERNS 833=head3 EXTENDED GLOB PATTERNS
882=item C<STATICPERL> 925=item C<STATICPERL>
883 926
884The directory where staticperl stores all its files 927The directory where staticperl stores all its files
885(default: F<~/.staticperl>). 928(default: F<~/.staticperl>).
886 929
930=item C<DLCACHE>
931
932The path to a directory (will be created if it doesn't exist) where
933downloaded perl sources are being cached, to avoid downloading them
934again. The default is empty, which means there is no cache.
935
936=item C<PERL_VERSION>
937
938The perl version to install - C<5.12.5> is a good choice for small builds,
939but C<5.8.9> is also a good choice (5.8.9 is much smaller than 5.12.5), if
940it builds on your system.
941
942You can also set this variable to the absolute URL of a tarball (F<.tar>,
943F<.tar.gz>, F<.tar.bz2>, F<.tar.lzma> or F<.tar.xz>), or to the absolute
944path of an unpacked perl source tree, which will be copied.
945
946The default is currently
947F<http://stableperl.schmorp.de/dist/latest.tar.gz>, i.e. the latest
948stableperl release.
949
887=item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ... 950=item C<PERL_MM_USE_DEFAULT>, C<EV_EXTRA_DEFS>, ...
888 951
889Usually set to C<1> to make modules "less inquisitive" during their 952Usually set to C<1> to make modules "less inquisitive" during their
890installation, you can set any environment variable you want - some modules 953installation. You can set (and export!) any environment variable you want
891(such as L<Coro> or L<EV>) use environment variables for further tweaking. 954- some modules (such as L<Coro> or L<EV>) use environment variables for
892 955further tweaking.
893=item C<PERL_VERSION>
894
895The perl version to install - default is currently C<5.12.3>, but C<5.8.9>
896is also a good choice (5.8.9 is much smaller than 5.12.3, while 5.10.1 is
897about as big as 5.12.3).
898 956
899=item C<PERL_PREFIX> 957=item C<PERL_PREFIX>
900 958
901The prefix where perl gets installed (default: F<$STATICPERL/perl>), 959The directory where perl gets installed (default: F<$STATICPERL/perl>),
902i.e. where the F<bin> and F<lib> subdirectories will end up. 960i.e. where the F<bin> and F<lib> subdirectories will end up. Previous
961contents will be removed on installation.
903 962
904=item C<PERL_CONFIGURE> 963=item C<PERL_CONFIGURE>
905 964
906Additional Configure options - these are simply passed to the perl 965Additional Configure options - these are simply passed to the perl
907Configure script. For example, if you wanted to enable dynamic loading, 966Configure script. For example, if you wanted to enable dynamic loading,
922the top of the F<staticperl> script for more info on these, and use a 981the top of the F<staticperl> script for more info on these, and use a
923F<~/.staticperlrc> to override them. 982F<~/.staticperlrc> to override them.
924 983
925Most of the variables override (or modify) the corresponding F<Configure> 984Most of the variables override (or modify) the corresponding F<Configure>
926variable, except C<PERL_CCFLAGS>, which gets appended. 985variable, except C<PERL_CCFLAGS>, which gets appended.
986
987The default for C<PERL_OPTIMIZE> is C<-Os> (assuming gcc), and for
988C<PERL_LIBS> is C<-lm -lcrypt>, which should be good for most (but not
989all) systems.
990
991For other compilers or more customised optimisation settings, you need to
992adjust these, e.g. in your F<~/.staticperlrc>.
993
994With gcc on x86 and amd64, you can get more space-savings by using:
995
996 -Os -ffunction-sections -fdata-sections -finline-limit=8 -mpush-args
997 -mno-inline-stringops-dynamically -mno-align-stringops
998
999And on x86 and pentium3 and newer (basically everything you might ever
1000want to run on), adding these is even better for space-savings (use
1001-mtune=core2 or something newer for much faster code, too):
1002
1003 -fomit-frame-pointer -march=pentium3 -mtune=i386
927 1004
928=back 1005=back
929 1006
930=head4 Variables you probably I<do not want> to override 1007=head4 Variables you probably I<do not want> to override
931 1008
996Called after building, but before installing perl. Current working 1073Called after building, but before installing perl. Current working
997directory is the perl source directory. 1074directory is the perl source directory.
998 1075
999I have no clue what this could be used for - tell me. 1076I have no clue what this could be used for - tell me.
1000 1077
1078=item postcpanconfig
1079
1080Called just after CPAN has been configured, but before it has been used to
1081install anything. You can further change the configuration like this:
1082
1083 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e '
1084 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
1085 ' || fatal "error while initialising CPAN in postcpanconfig"
1086
1001=item postinstall 1087=item postinstall
1002 1088
1003Called after perl and any extra modules have been installed in C<$PREFIX>, 1089Called after perl and any extra modules have been installed in C<$PREFIX>,
1004but before setting the "installation O.K." flag. 1090but before setting the "installation O.K." flag.
1005 1091
1110 1196
1111=back 1197=back
1112 1198
1113=head1 RUNTIME FUNCTIONALITY 1199=head1 RUNTIME FUNCTIONALITY
1114 1200
1115Binaries created with C<mkbundle>/C<mkperl> contain extra functions, which 1201Binaries created with C<mkbundle>/C<mkperl> contain extra functionality,
1116are required to access the bundled perl sources, but might be useful for 1202mostly related to the extra files bundled in the binary (the virtual
1117other purposes. 1203filesystem). All of this data is statically compiled into the binary, and
1204accessing means copying it from a read-only section of your binary. Data
1205pages in this way are usually freed by the operating system, as they aren't
1206used more then once.
1207
1208=head2 VIRTUAL FILESYSTEM
1209
1210Every bundle has a virtual filesystem. The only information stored in it
1211is the path and contents of each file that was bundled.
1212
1213=head3 LAYOUT
1214
1215Any paths starting with an ampersand (F<&>) or exclamation mark (F<!>) are
1216reserved by F<staticperl>. They must only be used as described in this
1217section.
1218
1219=over 4
1220
1221=item !
1222
1223All files that typically cannot be loaded from memory (such as dynamic
1224objects or shared libraries), but have to reside in the filesystem, are
1225prefixed with F<!>. Typically these files get written out to some
1226(semi-)temporary directory shortly after program startup, or before being
1227used.
1228
1229=item !boot
1230
1231The bootstrap file, if specified during bundling.
1232
1233=item !auto/
1234
1235Shared objects or dlls corresponding to dynamically-linked perl extensions
1236are stored with an F<!auto/> prefix.
1237
1238=item !lib/
1239
1240External shared libraries are stored in this directory.
1241
1242=item any letter
1243
1244Any path starting with a letter is a perl library file. For example,
1245F<Coro/AIO.pm> corresponds to the file loaded by C<use Coro::AIO>, and
1246F<Coro/jit.pl> corresponds to C<require "Coro/jit.pl">.
1247
1248Obviously, module names shouldn't start with any other characters than
1249letters :)
1250
1251=back
1252
1253=head3 FUNCTIONS
1254
1255=over 4
1256
1257=item $file = static::find $path
1258
1259Returns the data associated with the given C<$path>
1260(e.g. C<Digest/MD5.pm>, C<auto/POSIX/autosplit.ix>).
1261
1262Returns C<undef> if the file isn't embedded.
1263
1264=item @paths = static::list
1265
1266Returns the list of all paths embedded in this binary.
1267
1268=back
1269
1270=head2 EXTRA FEATURES
1118 1271
1119In addition, for the embedded loading of perl files to work, F<staticperl> 1272In addition, for the embedded loading of perl files to work, F<staticperl>
1120overrides the C<@INC> array. 1273overrides the C<@INC> array.
1121 1274
1122=over 4 1275=head1 FULLY STATIC BINARIES - ALPINE LINUX
1123 1276
1124=item $file = staticperl::find $path 1277This section once contained a way to build fully static (including
1278uClibc) binaries with buildroot. Unfortunately, buildroot no longer
1279supports a compiler, so I recommend using alpine linux instead
1280(L<http://alpinelinux.org/>). Get yourself a VM (e.g. with qemu), run an
1281older alpine linux verison in it (e.g. 2.4), copy staticperl inside and
1282use it.
1125 1283
1126Returns the data associated with the given C<$path> 1284The reason you might want an older alpine linux is that uClibc can be
1127(e.g. C<Digest/MD5.pm>, C<auto/POSIX/autosplit.ix>), which is basically 1285quite dependent on kernel versions, so the newest version of alpine linux
1128the UNIX path relative to the perl library directory. 1286might need a newer kernel then you might want for, if you plan to run your
1129 1287binaries on on other kernels.
1130Returns C<undef> if the file isn't embedded.
1131
1132=item @paths = staticperl::list
1133
1134Returns the list of all paths embedded in this binary.
1135
1136=back
1137
1138=head1 FULLY STATIC BINARIES - UCLIBC AND BUILDROOT
1139
1140To make truly static (Linux-) libraries, you might want to have a look at
1141buildroot (L<http://buildroot.uclibc.org/>).
1142
1143Buildroot is primarily meant to set up a cross-compile environment (which
1144is not so useful as perl doesn't quite like cross compiles), but it can also compile
1145a chroot environment where you can use F<staticperl>.
1146
1147To do so, download buildroot, and enable "Build options => development
1148files in target filesystem" and optionally "Build options => gcc
1149optimization level (optimize for size)". At the time of writing, I had
1150good experiences with GCC 4.4.x but not GCC 4.5.
1151
1152To minimise code size, I used C<-pipe -ffunction-sections -fdata-sections
1153-finline-limit=8 -fno-builtin-strlen -mtune=i386>. The C<-mtune=i386>
1154doesn't decrease codesize much, but it makes the file much more
1155compressible.
1156
1157If you don't need Coro or threads, you can go with "linuxthreads.old" (or
1158no thread support). For Coro, it is highly recommended to switch to a
1159uClibc newer than 0.9.31 (at the time of this writing, I used the 20101201
1160snapshot) and enable NPTL, otherwise Coro needs to be configured with the
1161ultra-slow pthreads backend to work around linuxthreads bugs (it also uses
1162twice the address space needed for stacks).
1163
1164If you use C<linuxthreads.old>, then you should also be aware that
1165uClibc shares C<errno> between all threads when statically linking. See
1166L<http://lists.uclibc.org/pipermail/uclibc/2010-June/044157.html> for a
1167workaround (And L<https://bugs.uclibc.org/2089> for discussion).
1168
1169C<ccache> support is also recommended, especially if you want
1170to play around with buildroot options. Enabling the C<miniperl>
1171package will probably enable all options required for a successful
1172perl build. F<staticperl> itself additionally needs either C<wget>
1173(recommended, for CPAN) or C<curl>.
1174
1175As for shells, busybox should provide all that is needed, but the default
1176busybox configuration doesn't include F<comm> which is needed by perl -
1177either make a custom busybox config, or compile coreutils.
1178
1179For the latter route, you might find that bash has some bugs that keep
1180it from working properly in a chroot - either use dash (and link it to
1181F</bin/sh> inside the chroot) or link busybox to F</bin/sh>, using it's
1182built-in ash shell.
1183
1184Finally, you need F</dev/null> inside the chroot for many scripts to work
1185- F<cp /dev/null output/target/dev> or bind-mounting your F</dev> will
1186both provide this.
1187
1188After you have compiled and set up your buildroot target, you can copy
1189F<staticperl> from the C<App::Staticperl> distribution or from your
1190perl f<bin> directory (if you installed it) into the F<output/target>
1191filesystem, chroot inside and run it.
1192 1288
1193=head1 RECIPES / SPECIFIC MODULES 1289=head1 RECIPES / SPECIFIC MODULES
1194 1290
1195This section contains some common(?) recipes and information about 1291This section contains some common(?) recipes and information about
1196problems with some common modules or perl constructs that require extra 1292problems with some common modules or perl constructs that require extra
1210 1306
1211Many Unicode properties in turn are defined in separate modules, 1307Many Unicode properties in turn are defined in separate modules,
1212such as C<"unicore/Heavy.pl"> and more specific data tables such as 1308such as C<"unicore/Heavy.pl"> and more specific data tables such as
1213C<"unicore/To/Digit.pl"> or C<"unicore/lib/Perl/Word.pl">. These tables 1309C<"unicore/To/Digit.pl"> or C<"unicore/lib/Perl/Word.pl">. These tables
1214are big (7MB uncompressed, although F<staticperl> contains special 1310are big (7MB uncompressed, although F<staticperl> contains special
1215handling for those files), so including them on demand by your application 1311handling for those files), so including them only on demand in your
1216only might pay off. 1312application might pay off.
1217 1313
1218To simply include the whole unicode database, use: 1314To simply include the whole unicode database, use:
1219 1315
1220 --incglob '/unicore/**.pl' 1316 --incglob '/unicore/**.pl'
1221 1317
1258C<MAN3PODS> to be empty via the C<PERL_MM_OPT> environment variable. 1354C<MAN3PODS> to be empty via the C<PERL_MM_OPT> environment variable.
1259 1355
1260=item Gtk2 1356=item Gtk2
1261 1357
1262See Pango, same problems, same solution. 1358See Pango, same problems, same solution.
1359
1360=item Net::SSLeay
1361
1362This module hasn't been significantly updated since OpenSSL is called
1363OpenSSL, and fails to properly link against dependent libraries, most
1364commonly, it forgets to specify -ldl when linking.
1365
1366On GNU/Linux systems this usually goes undetected, as perl usually links
1367against -ldl itself and OpenSSL just happens to pick it up that way, by
1368chance.
1369
1370For static builds, you either have to configure -ldl manually, or you
1371cna use the following snippet in your C<postinstall> hook which patches
1372Net::SSLeay after installation, which happens to work most of the time:
1373
1374 postinstall() {
1375 # first install it
1376 instcpan Net::SSLeay
1377 # then add -ldl for future linking
1378 chmod u+w "$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
1379 echo " -ldl" >>"$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
1380 }
1263 1381
1264=item Pango 1382=item Pango
1265 1383
1266In addition to the C<MAN3PODS> problem in Glib, Pango also routes around 1384In addition to the C<MAN3PODS> problem in Glib, Pango also routes around
1267L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl> 1385L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl>
1335gains little. Why Socket exposes a C function that is in the core already 1453gains little. Why Socket exposes a C function that is in the core already
1336is anybody's guess. 1454is anybody's guess.
1337 1455
1338=back 1456=back
1339 1457
1458=head1 ADDITIONAL RESOURCES
1459
1460Some guy has made a repository on github
1461(L<https://github.com/gh0stwizard/staticperl-modules>) with some modules
1462patched to build with staticperl.
1463
1340=head1 AUTHOR 1464=head1 AUTHOR
1341 1465
1342 Marc Lehmann <schmorp@schmorp.de> 1466 Marc Lehmann <schmorp@schmorp.de>
1343 http://software.schmorp.de/pkg/staticperl.html 1467 http://software.schmorp.de/pkg/staticperl.html
1468

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines