httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject [mod_perl] new modules/perl/Makefile.tmpl
Date Thu, 19 Mar 1998 16:03:22 GMT

Just for those who are interested and of course for Doug:

I've currently added support into APACI for on-the-fly building Apache 1.3
with mod_perl and had to fight hardly with the supplied Makefile from
mod_perl-1.09. I think it is one which runs also for Apache 1.2 hence the
missing cleanup in this file. I've now created a modules/proxy/Makefile.tmpl
which can be used with the current Apache 1.3b6-dev. 

What's the advantage? You can build mod_perl both via AddModule and
SharedModule out-of-the-box this way. Just copy the stuff from
mod_perl-1.09/src/modules/perl/ and add the appended Makefile.tmpl.

Yes, I know: loading mod_perl as a shared object is not really what everyone
wants for a production machine because linking statically could require less
memory (copy-on-demand!), but for webserver where you have enough memory and
where you don't know if you really need mod_perl, the SharedModule approach
can be useful. APACI installs a libperl.so with 700 KB under FreeBSD, btw.

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

#   the library to build
LIB=libperl.$(LIBEXT)

#   version numbers
MOD_PERL_VERSION=1.09
PERL_VERSION=5.00404

#   on/off switches for Perl API hooks
#   comment out to enable callbacks at a certain stage in the request
#PERL_DISPATCH          = -DNO_PERL_DISPATCH
#PERL_CHILD_INIT        = -DNO_PERL_CHILD_INIT
#PERL_CHILD_EXIT        = -DNO_PERL_CHILD_EXIT
#PERL_RESTART           = -DNO_PERL_RESTART
#PERL_POST_READ_REQUEST = -DNO_PERL_POST_READ_REQUEST
#PERL_TRANS             = -DNO_PERL_TRANS
#PERL_HEADER_PARSER     = -DNO_PERL_HEADER_PARSER
#PERL_ACCESS            = -DNO_PERL_ACCESS
#PERL_AUTHEN            = -DNO_PERL_AUTHEN
#PERL_AUTHZ             = -DNO_PERL_AUTHZ
#PERL_TYPE              = -DNO_PERL_TYPE 
#PERL_FIXUP             = -DNO_PERL_FIXUP 
#PERL_LOG               = -DNO_PERL_LOG 
#PERL_INIT              = -DNO_PERL_INIT
#PERL_CLEANUP           = -DNO_PERL_CLEANUP
#PERL_STACKED_HANDLERS  = -DNO_PERL_STACKED_HANDLERS
#PERL_SECTIONS          = -DNO_PERL_SECTIONS
#PERL_METHOD_HANDLERS   = -DNO_PERL_METHOD_HANDLERS
#PERL_SSI               = -DNO_PERL_SSI
PERL_HOOKS = $(PERL_DISPATCH) $(PERL_CHILD_INIT) $(PERL_CHILD_EXIT)\
 $(PERL_POST_READ_REQUEST) $(PERL_TRANS) $(PERL_HEADER_PARSER)\
 $(PERL_ACCESS) $(PERL_AUTHEN) $(PERL_AUTHZ)\
 $(PERL_TYPE) $(PERL_FIXUP) $(PERL_LOG)\
 $(PERL_INIT) $(PERL_CLEANUP) $(PERL_RESTART)\
 $(PERL_STACKED_HANDLERS) $(PERL_SECTIONS) $(PERL_METHOD_HANDLERS) $(PERL_SSI)

#   support for static extensions
#STATIC_SRC = Apache.c Constants.c
#STATIC_OBJ = Apache.o Constants.o
#STATIC_SHLIB_OBJ = Apache.so-o Constants.so-o
#STATIC_EXTS = Apache Apache::Constants
#PERL_STATIC_EXTS =

#   the Perl interpreter to use
PERL=/sw/bin/perl
PERL5LIB=`$(PERL) -MConfig -e 'print $$Config{privlibexp}'`
EXTUTILS_EMBED = $(PERL) -MExtUtils::Embed
#TRACE = -DPERL_TRACE
PERL_CCFLAGS = `$(EXTUTILS_EMBED) -e ccopts` $(PERL_HOOKS) $(TRACE)
XS_INIT = `$(EXTUTILS_EMBED) -e xsinit -- -std $(PERL_STATIC_EXTS) $(STATIC_EXTS)`

#   the compiler to use
CC=`$(PERL) -MConfig -e 'print $$Config{cc}'`
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) $(PERL_CCFLAGS) \
       -DMOD_PERL_VERSION=\"$(MOD_PERL_VERSION)\" -DPERL_VERSION=\"$(PERL_VERSION)\"

SRCS=mod_perl.c perlxsi.c perl_config.c perl_util.c perlio.c $(STATIC_SRC)
OBJS=mod_perl.o perlxsi.o perl_config.o perl_util.o perlio.o $(STATIC_OBJ)
SHLIB_OBJS=mod_perl.so-o perlxsi.so-o perl_config.so-o perl_util.so-o perlio.so-o $(STATIC_SHLIB_OBJ)

all: lib

lib: $(LIB)

libperl.a: $(OBJS)
    rm -f $@
    ar crv $@ $(OBJS)
    $(RANLIB) $@

libperl.so: $(SHLIB_OBJS)
    rm -f $@
    $(LD) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) `$(PERL) ldopts` 2>/dev/null

# 1. extension .o for shared objects cannot be used here because
#    first these files aren't still shared objects and second we
#    have to use a different name to trigger the different
#    implicit Make rule
# 2. extension -so.o (as used elsewhere) cannot be used because
#    the suffix feature of Make really wants just .x, so we use
#    extension .so-o

.SUFFIXES: .xs .c .o .so-o

.xs.c:
    $(PERL) $(PERL5LIB)/ExtUtils/xsubpp -typemap $(PERL5LIB)/ExtUtils/typemap $*.xs >$@

.c.o:
    $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<

.c.so-o:
    $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(SPACER) -o $*.so-o $<

perlxsi.c:
    $(XS_INIT) 

clean:
    rm -f $(OBJS) $(SHLIB_OBJS) $(LIB)

# dependencies
$(OBJS): mod_perl.h $(INCDIR)/httpd.h $(INCDIR)/http_config.h 
mod_perl.o: $(SRCS)


Mime
View raw message