> (... revisiting old thread about my problems with compiling 
> apache/mod_perl as DSO on Tru64 unix)

My problem is still not solved but I get it up to the point where it
probably lies in some customary modules (which does not behave
correctly when unloaded/reloaded) and is not directly related to
apache/mod_perl.

As I got the minimal success (some simple mod_perl application
worked), I report here the way I compiled perl/apache/mod_perl in
that case. Maybe it will help someone in similar situation.

Below I cite the main parts of the script I used (with unnecessary
details omitted):



WORK_DIR=$HOME/tools_src
DIST_DIR=$HOME/DOWNLOAD
INST_DIR=$HOME/tools

PERL_INST_DIR=$INST_DIR/perl
APACHE_INST_DIR=$INST_DIR/apache

############################################################

PERL_VERSION=perl-5.6.1
APACHE_VERSION=apache_1.3.27
MOD_PERL_VERSION=mod_perl-1.27
LIBAPREQ_VERSION=libapreq-1.0
DIGEST_MD5_VERSION=Digest-MD5-2.20
MIME_BASE64_VERSION=MIME-Base64-2.12
# ... cut a lot of other modules which are out-of-topic here

#################################################################

unpack() {
  if [ -d $1 ]; then
     rm -rf $1
  fi
  echo -n "Unpacking $1..."
  gunzip -c $DIST_DIR/$1.tar.gz | tar xf -
  echo "done"
}

#################################################################

if [ ! -d $WORK_DIR ]; then
    mkdir -p $WORK_DIR
fi

if [ ! -d $INST_DIR ]; then
    mkdir -p $INST_DIR
fi

#################################################################

cd $WORK_DIR
unpack $PERL_VERSION
cd $PERL_VERSION
  # Some commments:
  # -Uinstallusrbinperl in my case I use customary install directory
  # -Uuseshrplib there is a makefile problem and compilation error
  #  when we define it (which we try to patch below, so please 
  #  experiment if you like)
  # -Uusemymalloc on 64bit platforms it is recommended according to some docs
  # -Ubincompat5005 we don't want coredumps caused by name conflicts
  #  of malloc/free
  # -Dusemultiplicity it helps a bit with DSO reloading
sh Configure -des -Dprefix=$PERL_INST_DIR -Uinstallusrbinperl \
      -Uuseshrplib -Uusemymalloc -Ubincompat5005 \
      -Dusemultiplicity
make
make test
make install


#---- don't forget it when installing outside defaults 
PATH=$PERL_INST_DIR/bin:$PATH; export PATH

#################################################################

build_module() {
  MOD=$1
  cd $WORK_DIR
  unpack $MOD
  cd $WORK_DIR/$MOD
  perl Makefile.PL $2 $3 $4 $5 $6 $7 $8 $9
  make
  make test
  make install
}

build_module $DIGEST_MD5_VERSION
build_module $MIME_BASE64_VERSION
# ... cut others ...

#################################################################

unpack $APACHE_VERSION
unpack $MOD_PERL_VERSION

cd $WORK_DIR/$MOD_PERL_VERSION

perl Makefile.PL $PERL_MOD_DBG $PLTRACE \
     APACHE_SRC=../$APACHE_VERSION/src \
     APACHE_PREFIX=$APACHE_INST_DIR \
     USE_APACI=1 \
     USE_DSO=1 \
     DO_HTTPD=1 \
     ALL_HOOKS=1 \
     EVERYTHING=1 \
     APACI_ARGS="--enable-module=so,\
        --prefix=$APACHE_INST_DIR,\
        --enable-module=access,--enable-shared=access,\
        --enable-module=actions,--enable-shared=actions,\
        --enable-module=alias,--enable-shared=alias,\
        --enable-module=asis,--enable-shared=asis,\
        --enable-module=auth,--enable-shared=auth,\
        --enable-module=auth_anon,--enable-shared=auth_anon,\
        --enable-module=auth_db,--enable-shared=auth_db,\
        --enable-module=auth_dbm,--enable-shared=auth_dbm,\
        --enable-module=autoindex,--enable-shared=autoindex,\
        --enable-module=cern_meta,--enable-shared=cern_meta,\
        --enable-module=cgi,--enable-shared=cgi,\
        --enable-module=digest,--enable-shared=digest,\
        --enable-module=dir,--enable-shared=dir,\
        --enable-module=env,--enable-shared=env,\
        --enable-module=example,--enable-shared=example,\
        --enable-module=expires,--enable-shared=expires,\
        --enable-module=headers,--enable-shared=headers,\
        --enable-module=imap,--enable-shared=imap,\
        --enable-module=include,--enable-shared=include,\
        --enable-module=info,--enable-shared=info,\
        --enable-module=log_agent,--enable-shared=log_agent,\
        --enable-module=log_config,--enable-shared=log_config,\
        --enable-module=log_referer,--enable-shared=log_referer,\
        --enable-module=mime,--enable-shared=mime,\
        --enable-module=mime_magic,--enable-shared=mime_magic,\
        --enable-module=mmap_static,--enable-shared=mmap_static,\
        --enable-module=negotiation,--enable-shared=negotiation,\
        --enable-module=proxy,--enable-shared=proxy,\
        --enable-module=rewrite,--enable-shared=rewrite,\
        --enable-module=setenvif,--enable-shared=setenvif,\
        --enable-module=speling,--enable-shared=speling,\
        --enable-module=status,--enable-shared=status,\
        --enable-module=unique_id,--enable-shared=unique_id,\
        --enable-module=userdir,--enable-shared=userdir,\
        --enable-module=usertrack,--enable-shared=usertrack,\
        --enable-module=vhost_alias,--enable-shared=vhost_alias,\
"

# Correcting the makefile error resulting in compilation error when
# perl is compiled with shared library
perl -i.orig -pe 's/-Wl,-rpath,/-rpath /' \
    ../$APACHE_VERSION/src/modules/perl/Makefile

make
make test 
make install



# libperl.so name for mod_perl is plain stupid, let's follow the Debian way
echo -n "Renaming libperl.so to mod_perl.so, use this name in httpd.conf"
mv $APACHE_INST_DIR/libexec/libperl.so $APACHE_INST_DIR/libexec/mod_perl.so
echo "Done"

#######################################################################

# Modules dependent from modperl....

cd $WORK_DIR
build_module $LIBAPREQ_VERSION

Reply via email to