mirror of
https://github.com/znc/znc.git
synced 2026-07-13 21:31:27 +02:00
finished off infastructure of modperl stuff plus adjusted autoconf, makefile, etc
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@265 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+17
-4
@@ -3,6 +3,11 @@ CXX=g++
|
||||
CXXFLAGS=@CXXFLAGS@
|
||||
INCLUDES=@INCLUDES@ -I..
|
||||
LIBS=@LIBS@
|
||||
PERL=@PERL@
|
||||
ifneq "$(PERL)" ""
|
||||
PERLCC=`$(PERL) -MExtUtils::Embed -e ccopts`
|
||||
PERLLD=`$(PERL) -MExtUtils::Embed -e ccopts -e ldopts`
|
||||
endif
|
||||
VPATH=.:..
|
||||
|
||||
ifeq "@NOSSL@" "1"
|
||||
@@ -20,7 +25,7 @@ endif
|
||||
all: $(OBJS) $(TARGETS)
|
||||
|
||||
depend::
|
||||
g++ -M $(CXXFLAGS) $(SRCS) $(INCLUDES) `perl -MExtUtils::Embed -e ccopts` >.depend
|
||||
g++ -M $(CXXFLAGS) $(SRCS) $(INCLUDES) $(PERLCC) >.depend
|
||||
|
||||
install: all create_install_dir $(INSTALL_TARGS)
|
||||
@echo -n ""
|
||||
@@ -42,9 +47,17 @@ clean:
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
|
||||
|
||||
########### modperl special TODO this is just so i don't forget, need to make configureable yet
|
||||
ifneq "$(PERL)" ""
|
||||
modperl.so: modperl.o
|
||||
$(CXX) $(CXXFLAGS) -shared -o $@ $< $(INCLUDES) $(LIBS) `perl -MExtUtils::Embed -e ccopts -e ldopts`
|
||||
$(CXX) $(CXXFLAGS) -shared -o $@ $< $(INCLUDES) $(LIBS) $(PERLLD)
|
||||
|
||||
modperl.o: modperl.cpp
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ modperl.cpp `perl -MExtUtils::Embed -e ccopts`
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ modperl.cpp $(PERLCC)
|
||||
else
|
||||
modperl.so:
|
||||
@echo -n ""
|
||||
modperl.o:
|
||||
@echo -n ""
|
||||
install_modperl.so:
|
||||
@echo -n ""
|
||||
endif
|
||||
|
||||
+5
-10
@@ -121,34 +121,29 @@ XS(XS_AddZNCHook)
|
||||
{
|
||||
if ( g_ModPerl )
|
||||
g_ModPerl->AddZNCHook( (char *)SvPV(ST(0),PL_na) );
|
||||
|
||||
|
||||
PUTBACK;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EXTERN_C void
|
||||
xs_init(pTHX)
|
||||
{
|
||||
char *file = __FILE__;
|
||||
newXS( "AddZNCHook", XS_AddZNCHook, file );
|
||||
}
|
||||
|
||||
|
||||
/////////// supporting functions from within module
|
||||
bool CModPerl::OnLoad( const CString & sArgs )
|
||||
{
|
||||
const char *pArgv[] =
|
||||
{
|
||||
"ZNCPerl",
|
||||
sArgs.c_str(),
|
||||
sArgs.c_str(),
|
||||
NULL
|
||||
};
|
||||
|
||||
perl_parse( m_pPerl, xs_init, 2, (char **)pArgv, (char **)NULL );
|
||||
perl_parse( m_pPerl, NULL, 2, (char **)pArgv, (char **)NULL );
|
||||
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
|
||||
|
||||
newXS( "AddZNCHook", XS_AddZNCHook, (char *)__FILE__ );
|
||||
|
||||
ModPerlInit();
|
||||
return( true );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user