summaryrefslogtreecommitdiff
path: root/src/perl/perl-core.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-24 23:17:27 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-24 23:17:27 +0000
commitddf1b27c048d6cfa6e3733d3256634b66d6d4c25 (patch)
tree01a3e176ef436f109611fe8ed17f2851ef01bae4 /src/perl/perl-core.c
parentbbd4b47306a58c65e63a898b291efd797758f034 (diff)
downloadirssi-ddf1b27c048d6cfa6e3733d3256634b66d6d4c25.zip
Added --with-perl-staticlib option to configure. If used, irssi's perl
libraries are compiled statically into irssi binary. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1914 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/perl-core.c')
-rw-r--r--src/perl/perl-core.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/perl/perl-core.c b/src/perl/perl-core.c
index 87d5be19..1940041d 100644
--- a/src/perl/perl-core.c
+++ b/src/perl/perl-core.c
@@ -31,6 +31,7 @@
#include "perl-signals.h"
#include "perl-sources.h"
+#include "XSUB.h"
#include "irssi-core.pl.h"
/* For compatibility with perl 5.004 and older */
@@ -84,6 +85,26 @@ static void perl_script_destroy(PERL_SCRIPT_REC *script)
g_free(script);
}
+#if PERL_STATIC_LIBS == 1
+extern void boot_Irssi(CV *cv);
+
+XS(boot_Irssi_Core)
+{
+ dXSARGS;
+
+ irssi_callXS(boot_Irssi, cv, mark);
+ irssi_boot(Irc);
+ irssi_boot(UI);
+ irssi_boot(TextUI);
+}
+
+static void static_xs_init(void)
+{
+ newXS("Irssi::Core::boot_Irssi_Core", boot_Irssi_Core, __FILE__);
+}
+
+#endif
+
/* Initialize perl interpreter */
void perl_scripts_init(void)
{
@@ -97,7 +118,12 @@ void perl_scripts_init(void)
my_perl = perl_alloc();
perl_construct(my_perl);
+#if PERL_STATIC_LIBS == 1
+ perl_parse(my_perl, static_xs_init, 3, args, NULL);
+ perl_eval_pv("Irssi::Core::boot_Irssi_Core();", TRUE);
+#else
perl_parse(my_perl, xs_init, 3, args, NULL);
+#endif
perl_common_start();