diff --git a/src/perl/Makefile.am b/src/perl/Makefile.am index 3f4e631a..220397d6 100644 --- a/src/perl/Makefile.am +++ b/src/perl/Makefile.am @@ -26,8 +26,7 @@ perl_sources = \ perl-core.c \ perl-common.c \ perl-signals.c \ - perl-sources.c \ - xsinit.c + perl-sources.c perl_fe_sources = \ module-formats.c \ diff --git a/src/perl/perl-core.c b/src/perl/perl-core.c index a74e7c68..40041127 100644 --- a/src/perl/perl-core.c +++ b/src/perl/perl-core.c @@ -39,8 +39,6 @@ # define PL_perl_destruct_level perl_destruct_level #endif -extern void xs_init(void); - GSList *perl_scripts; PerlInterpreter *my_perl; @@ -85,6 +83,8 @@ static void perl_script_destroy(PERL_SCRIPT_REC *script) g_free(script); } +extern void boot_DynaLoader(CV* cv); + #if PERL_STATIC_LIBS == 1 extern void boot_Irssi(CV *cv); @@ -97,14 +97,19 @@ XS(boot_Irssi_Core) irssi_boot(UI); irssi_boot(TextUI); } - -static void static_xs_init(void) -{ - newXS("Irssi::Core::boot_Irssi_Core", boot_Irssi_Core, __FILE__); -} - #endif +static void xs_init(void) +{ +#if PERL_STATIC_LIBS == 1 + newXS("Irssi::Core::boot_Irssi_Core", boot_Irssi_Core, __FILE__); +#endif + + /* boot the dynaloader too, if we want to use some + other dynamic modules.. */ + newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__); +} + /* Initialize perl interpreter */ void perl_scripts_init(void) { @@ -118,11 +123,9 @@ 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); +#if PERL_STATIC_LIBS == 1 + perl_eval_pv("Irssi::Core::boot_Irssi_Core();", TRUE); #endif perl_common_start(); diff --git a/src/perl/xsinit.c b/src/perl/xsinit.c deleted file mode 100644 index fd8b923a..00000000 --- a/src/perl/xsinit.c +++ /dev/null @@ -1,43 +0,0 @@ -#if defined(__cplusplus) && !defined(PERL_OBJECT) -#define is_cplusplus -#endif - -#ifdef is_cplusplus -extern "C" { -#endif - -#include -#include -#ifdef PERL_OBJECT -#define NO_XSLOCKS -#include -#include "win32iop.h" -#include -#include -#endif -#ifdef is_cplusplus -} -# ifndef EXTERN_C -# define EXTERN_C extern "C" -# endif -#else -# ifndef EXTERN_C -# define EXTERN_C extern -# endif -#endif - -extern PerlInterpreter *my_perl; - -EXTERN_C void xs_init _((void)); - -EXTERN_C void boot_DynaLoader _((CV* cv)); - -EXTERN_C void -xs_init(void) -{ - char *file = __FILE__; - dXSUB_SYS; - - /* DynaLoader is a special case */ - newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); -}