forked from PsychoticNinja/irssi
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
This commit is contained in:
parent
bbd4b47306
commit
ddf1b27c04
24
configure.in
24
configure.in
@ -106,6 +106,21 @@ if test "x$prefix" != "xNONE"; then
|
|||||||
perl_prefix_note=yes
|
perl_prefix_note=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_ARG_WITH(perl-staticlib,
|
||||||
|
[ --with-perl-staticlib Specify that we want to link perl libraries
|
||||||
|
statically in irssi, default is no],
|
||||||
|
if test x$withval = xyes; then
|
||||||
|
want_staticperllib=yes
|
||||||
|
else
|
||||||
|
if test "x$withval" = xno; then
|
||||||
|
want_staticperllib=no
|
||||||
|
else
|
||||||
|
want_staticperllib=yes
|
||||||
|
fi
|
||||||
|
fi,
|
||||||
|
want_staticperllib=no)
|
||||||
|
|
||||||
|
|
||||||
AC_ARG_WITH(perl-lib,
|
AC_ARG_WITH(perl-lib,
|
||||||
[ --with-perl-lib=[site|vendor|DIR] Specify where to install the
|
[ --with-perl-lib=[site|vendor|DIR] Specify where to install the
|
||||||
Perl libraries for irssi, default is site],
|
Perl libraries for irssi, default is site],
|
||||||
@ -583,6 +598,14 @@ if test "$want_perl" != "no"; then
|
|||||||
PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
PERL_LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "x$want_staticperllib" = "xyes"; then
|
||||||
|
PERL_MM_PARAMS="$PERL_MM_PARAMS LINKTYPE=static"
|
||||||
|
PERL_LINK_LIBS="$PERL_LINK_LIBS ../perl/common/blib/arch/auto/Irssi/Irssi.a ../perl/irc/blib/arch/auto/Irssi/Irc/Irc.a ../perl/ui/blib/arch/auto/Irssi/UI/UI.a ../perl/textui/blib/arch/auto/Irssi/TextUI/TextUI.a"
|
||||||
|
PERL_STATIC_LIBS=1
|
||||||
|
else
|
||||||
|
PERL_STATIC_LIBS=0
|
||||||
|
fi
|
||||||
|
|
||||||
# figure out the correct @INC path - we'll need to do this
|
# figure out the correct @INC path - we'll need to do this
|
||||||
# through MakeMaker since it's difficult to get it right
|
# through MakeMaker since it's difficult to get it right
|
||||||
# otherwise.
|
# otherwise.
|
||||||
@ -607,6 +630,7 @@ if test "$want_perl" != "no"; then
|
|||||||
|
|
||||||
AC_SUBST(PERL_USE_LIB)
|
AC_SUBST(PERL_USE_LIB)
|
||||||
AC_SUBST(PERL_MM_PARAMS)
|
AC_SUBST(PERL_MM_PARAMS)
|
||||||
|
AC_SUBST(PERL_STATIC_LIBS)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ perl-core.c: perl-signals-list.h irssi-core.pl.h
|
|||||||
INCLUDES = $(GLIB_CFLAGS) \
|
INCLUDES = $(GLIB_CFLAGS) \
|
||||||
-DSCRIPTDIR=\""$(libdir)/irssi/scripts"\" \
|
-DSCRIPTDIR=\""$(libdir)/irssi/scripts"\" \
|
||||||
-DPERL_USE_LIB=\""$(PERL_USE_LIB)"\" \
|
-DPERL_USE_LIB=\""$(PERL_USE_LIB)"\" \
|
||||||
|
-DPERL_STATIC_LIBS=$(PERL_STATIC_LIBS) \
|
||||||
$(PERL_CFLAGS) \
|
$(PERL_CFLAGS) \
|
||||||
-I$(top_srcdir)/src \
|
-I$(top_srcdir)/src \
|
||||||
-I$(top_srcdir)/src/core \
|
-I$(top_srcdir)/src/core \
|
||||||
|
@ -24,7 +24,7 @@ require DynaLoader;
|
|||||||
);
|
);
|
||||||
@EXPORT_OK = qw();
|
@EXPORT_OK = qw();
|
||||||
|
|
||||||
bootstrap Irssi $VERSION;
|
bootstrap Irssi $VERSION if (!Irssi::Core::is_static());
|
||||||
|
|
||||||
@Irssi::Channel::ISA = qw(Irssi::Windowitem);
|
@Irssi::Channel::ISA = qw(Irssi::Windowitem);
|
||||||
@Irssi::Query::ISA = qw(Irssi::Windowitem);
|
@Irssi::Query::ISA = qw(Irssi::Windowitem);
|
||||||
|
@ -16,7 +16,7 @@ require DynaLoader;
|
|||||||
@EXPORT = qw();
|
@EXPORT = qw();
|
||||||
@EXPORT_OK = qw();
|
@EXPORT_OK = qw();
|
||||||
|
|
||||||
bootstrap Irssi::Irc $VERSION;
|
bootstrap Irssi::Irc $VERSION if (!Irssi::Core::is_static());
|
||||||
|
|
||||||
Irssi::Irc::init();
|
Irssi::Irc::init();
|
||||||
|
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
# NOTE: this is printed through printf()-like function,
|
# NOTE: this is printed through printf()-like function,
|
||||||
# so no extra percent characters.
|
# so no extra percent characters.
|
||||||
|
|
||||||
# %%s can be used once, it contains the
|
# %%d : must be first - 1 if perl libraries are to be linked
|
||||||
# use Irssi; use Irssi::Irc; etc..
|
# statically with irssi binary, 0 if not
|
||||||
|
# %%s : must be second - use Irssi; use Irssi::Irc; etc..
|
||||||
package Irssi::Core;
|
package Irssi::Core;
|
||||||
|
|
||||||
use Symbol qw(delete_package);
|
use Symbol qw(delete_package);
|
||||||
|
|
||||||
|
sub is_static {
|
||||||
|
return %d;
|
||||||
|
}
|
||||||
|
|
||||||
sub destroy {
|
sub destroy {
|
||||||
my $package = "Irssi::Script::".$_[0];
|
my $package = "Irssi::Script::".$_[0];
|
||||||
delete_package($package);
|
delete_package($package);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "perl-signals.h"
|
#include "perl-signals.h"
|
||||||
#include "perl-sources.h"
|
#include "perl-sources.h"
|
||||||
|
|
||||||
|
#include "XSUB.h"
|
||||||
#include "irssi-core.pl.h"
|
#include "irssi-core.pl.h"
|
||||||
|
|
||||||
/* For compatibility with perl 5.004 and older */
|
/* For compatibility with perl 5.004 and older */
|
||||||
@ -84,6 +85,26 @@ static void perl_script_destroy(PERL_SCRIPT_REC *script)
|
|||||||
g_free(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 */
|
/* Initialize perl interpreter */
|
||||||
void perl_scripts_init(void)
|
void perl_scripts_init(void)
|
||||||
{
|
{
|
||||||
@ -97,7 +118,12 @@ void perl_scripts_init(void)
|
|||||||
my_perl = perl_alloc();
|
my_perl = perl_alloc();
|
||||||
perl_construct(my_perl);
|
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);
|
perl_parse(my_perl, xs_init, 3, args, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
perl_common_start();
|
perl_common_start();
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ require DynaLoader;
|
|||||||
@EXPORT = qw();
|
@EXPORT = qw();
|
||||||
@EXPORT_OK = qw();
|
@EXPORT_OK = qw();
|
||||||
|
|
||||||
bootstrap Irssi::TextUI $VERSION;
|
bootstrap Irssi::TextUI $VERSION if (!Irssi::Core::is_static());
|
||||||
|
|
||||||
Irssi::TextUI::init();
|
Irssi::TextUI::init();
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ require DynaLoader;
|
|||||||
@EXPORT = qw();
|
@EXPORT = qw();
|
||||||
@EXPORT_OK = qw();
|
@EXPORT_OK = qw();
|
||||||
|
|
||||||
bootstrap Irssi::UI $VERSION;
|
bootstrap Irssi::UI $VERSION if (!Irssi::Core::is_static());
|
||||||
|
|
||||||
Irssi::UI::init();
|
Irssi::UI::init();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user