httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (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 with 700 KB under FreeBSD, btw.

                                       Ralf S. Engelschall

#   the library to build

#   version numbers

#   on/off switches for Perl API hooks
#   comment out to enable callbacks at a certain stage in the request
#PERL_TYPE              = -DNO_PERL_TYPE 
#PERL_FIXUP             = -DNO_PERL_FIXUP 
#PERL_LOG               = -DNO_PERL_LOG 
#PERL_INIT              = -DNO_PERL_INIT
#PERL_SSI               = -DNO_PERL_SSI

#   support for static extensions
#STATIC_SRC = Apache.c Constants.c
#STATIC_OBJ = Apache.o Constants.o
#STATIC_EXTS = Apache Apache::Constants

#   the Perl interpreter to use
PERL5LIB=`$(PERL) -MConfig -e 'print $$Config{privlibexp}'`
EXTUTILS_EMBED = $(PERL) -MExtUtils::Embed

#   the compiler to use
CC=`$(PERL) -MConfig -e 'print $$Config{cc}'`

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) $(STATIC_SHLIB_OBJ)

all: lib

lib: $(LIB)

libperl.a: $(OBJS)
    rm -f $@
    ar crv $@ $(OBJS)
    $(RANLIB) $@ $(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

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

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


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

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

View raw message