Parts of my Makefile look like this:
This generates a perlxsi.c file like this:CONFIG_PM=-MConfig PRIVLIB=`$(PERL) $(CONFIG_PM) -e 'print $$Config{privlibexp}'` EXTUTILS_EMBED = $(PERL) -MExtUtils::Embed PERL_CFG_CCFLAGS = `$(PERL) $(CONFIG_PM) -e 'print "$$Config{ccflags} +$$Config{cccdlflags}"'` PERL_CFG_ARCHLIB = `$(PERL) $(CONFIG_PM) -e 'print $$Config{archlibexp +}'` PERL_CCFLAGS = -I$(PERL_CFG_ARCHLIB)/CORE $(PERL_CFG_CCFLAGS) $(PERL_H +OOKS) $(TRACE) STATIC_EXTS=Sybase::OpnSrv XS_INIT = `$(EXTUTILS_EMBED) -e xsinit -- -std $(PERL_STATIC_EXTS) $(S +TATIC_EXTS)` CC=`$(PERL) $(CONFIG_PM) -e 'print $$Config{cc}'` LD=`$(PERL) $(CONFIG_PM) -e 'print "$$Config{ld}\n"'` .... SRC=xp_perl.c perlxsi.c ... # other files OBJS=$(SRC:.c=.o) perlxsi.c: $(XS_INIT)
which bootstraps all of the static modules when the perl interpreter is started.#include <EXTERN.h> #include <perl.h> EXTERN_C void xs_init (pTHXo); EXTERN_C void boot_Sybase__OpnSrv (pTHXo_ CV* cv); EXTERN_C void boot_DynaLoader (pTHXo_ CV* cv); EXTERN_C void xs_init(pTHXo) { char *file = __FILE__; dXSUB_SYS; newXS("Sybase::OpnSrv::bootstrap", boot_Sybase__OpnSrv, file); /* DynaLoader is a special case */ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); }
Michael
In reply to Re: Embedding Perl Interpreter/DynaLoader
by mpeppler
in thread Embedding Perl Interpreter/DynaLoader
by MatthewFrancis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |