cvs commit: modperl-2.0/src/modules/perl modperl_io.c

2001-09-12 Thread dougm

dougm   01/09/12 21:10:55

  Modified:src/modules/perl modperl_io.c
  Removed: lib/ModPerl XSLoader.pm
  Log:
  fix tied filehandle breakage caused by bleedperl change #11639
  
  Revision  ChangesPath
  1.4   +9 -1  modperl-2.0/src/modules/perl/modperl_io.c
  
  Index: modperl_io.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- modperl_io.c  2001/08/01 16:52:40 1.3
  +++ modperl_io.c  2001/09/13 04:10:55 1.4
  @@ -8,9 +8,15 @@
   #define TIED(handle) \
   modperl_io_handle_tied(aTHX_ handle, Apache::RequestRec)
   
  +/*
  + * XXX: bleedperl change #11639 switch tied handle magic
  + * from living in the gv to the GvIOp(gv), so we have to deal
  + * with both to support 5.6.x
  + */
   MP_INLINE void modperl_io_handle_untie(pTHX_ GV *handle)
   {
   sv_unmagic((SV*)handle, 'q');
  +sv_unmagic((SV*)GvIOp(handle), 'q');
   
   MP_TRACE_g(MP_FUNC, untie *%s(0x%lx), REFCNT=%d\n,
  GvNAME(handle), (unsigned long)handle,
  @@ -27,6 +33,7 @@
   }
   
   sv_magic((SV*)handle, obj, 'q', Nullch, 0);
  +sv_magic((SV*)GvIOp(handle), obj, 'q', Nullch, 0);
   
   MP_TRACE_g(MP_FUNC, tie *%s(0x%lx) = %s, REFCNT=%d\n,
  GvNAME(handle), (unsigned long)handle, classname,
  @@ -36,8 +43,9 @@
   MP_INLINE int modperl_io_handle_tied(pTHX_ GV *handle, char *classname)
   {
   MAGIC *mg;
  +SV *sv = SvMAGICAL(GvIOp(handle)) ? (SV*)GvIOp(handle) : (SV*)handle;
   
  -if (SvMAGICAL(handle)  (mg = mg_find((SV*)handle, 'q'))) {
  +if (SvMAGICAL(sv)  (mg = mg_find(sv, 'q'))) {
char *package = HvNAME(SvSTASH((SV*)SvRV(mg-mg_obj)));
   
if (!strEQ(package, classname)) {
  
  
  



cvs commit: modperl-2.0/lib/Apache Build.pm

2001-09-12 Thread dougm

dougm   01/09/12 19:01:31

  Modified:lib/Apache Build.pm
  Log:
  cache apxs queries
  
  Revision  ChangesPath
  1.47  +13 -1 modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- Build.pm  2001/08/26 03:38:27 1.46
  +++ Build.pm  2001/09/13 02:01:31 1.47
  @@ -38,7 +38,19 @@
   
   sub apxs {
   my $self = shift;
  +
  +my $is_query = (@_ == 2)  ($_[0] eq '-q');
  +
   $self = $self-build_config unless ref $self;
  +
  +my $query_key;
  +if ($is_query) {
  +$query_key = 'APXS_' . $_[1];
  +if ($self-{$query_key}) {
  +return $self-{$query_key};
  +}
  +}
  +
   my $apxs;
   my @trys = ($Apache::Build::APXS,
   $self-{MP_APXS},
  @@ -74,7 +86,7 @@
   }
   }
   
  -$val;
  +$self-{$query_key} = $val;
   }
   
   sub apxs_cflags {
  
  
  



cvs commit: modperl-2.0/xs/APR/APR Makefile.PL

2001-09-12 Thread dougm

dougm   01/09/12 19:02:09

  Modified:xs/APR/APR Makefile.PL
  Log:
  now that apr libs are installed, link against them
  
  Revision  ChangesPath
  1.3   +6 -26 modperl-2.0/xs/APR/APR/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Makefile.PL   2001/04/04 05:32:33 1.2
  +++ Makefile.PL   2001/09/13 02:02:09 1.3
  @@ -4,34 +4,14 @@
   use ModPerl::MM ();
   use Config;
   
  -my $root = ModPerl::MM::build_config('dir') || ;
  -my $srclib = $root/srclib;
  -my $apr = $srclib/apr;
  +my $prefix = ModPerl::MM::build_config()-apxs(-q = 'PREFIX');
   
  -my @libs;
  -if ($root) {
  -@libs = join ' ',
  -  -L$apr/.libs -lapr,
  --L$srclib/apr-util/.libs -laprutil,
  -  -L$srclib/expat-lite/.libs -lexpat,
  --L$apr/shmem/unix/mm/.libs -lmm;
  -}
  +my $libdir = $prefix/lib;
   
  +my @libs = map -l$_, qw(apr aprutil);
  +
   ModPerl::MM::WriteMakefile(
  -'NAME'   = 'APR',
  +'NAME'  = 'APR',
   'VERSION_FROM' = 'APR.pm',
  -#'LIBS' = \@libs,
  +'LIBS' = [-L$libdir @libs],
   );
  -
  -sub XXX::MY::const_loadlibs {
  -my $self = shift;
  -
  -my $string = $self-MM::const_loadlibs;
  -return $string unless $Config{gccversion}; #XXX
  -
  -my $wa = '-Wl,--whole-archive';
  -my $nwa = '-Wl,--no-whole-archive';
  -
  -$string =~ s/(LDLOADLIBS\s*=\s*)(.*)/$1$wa $2 $nwa/;
  -$string;
  -}
  
  
  



cvs commit: modperl-2.0/src/modules/perl mod_perl.c

2001-09-12 Thread dougm

dougm   01/09/12 19:10:35

  Modified:src/modules/perl mod_perl.c
  Log:
  add a bootstrap note for APR
  
  Revision  ChangesPath
  1.65  +13 -5 modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- mod_perl.c2001/09/10 04:43:03 1.64
  +++ mod_perl.c2001/09/13 02:10:35 1.65
  @@ -24,13 +24,21 @@
   }
   #endif
   
  -static void my_xs_init(pTHX)
  +static const char *MP_xs_loaders[] = {
  +ModPerl, APR, NULL,
  +};
  +
  +#define MP_xs_loader_name %s::XSLoader::BOOTSTRAP
  +
  +static void modperl_xs_init(pTHX)
   {
  +int i;
   xs_init(aTHX); /* see modperl_xsinit.c */
   
  -newCONSTSUB(PL_defstash,
  -ModPerl::XSLoader::BOOTSTRAP,
  -newSViv(1));
  +for (i=0; MP_xs_loaders[i]; i++) {
  +char *name = Perl_form(aTHX_ MP_xs_loader_name, MP_xs_loaders[i]);
  +newCONSTSUB(PL_defstash, name, newSViv(1));
  +}
   }
   
   PerlInterpreter *modperl_startup(server_rec *s, apr_pool_t *p)
  @@ -65,7 +73,7 @@
   PL_perl_destruct_level = 2;
   }
   #endif
  -status = perl_parse(perl, my_xs_init, argc, argv, NULL);
  +status = perl_parse(perl, modperl_xs_init, argc, argv, NULL);
   
   if (status) {
   perror(perl_parse);
  
  
  



cvs commit: modperl-2.0/lib/APR - New directory

2001-09-12 Thread dougm

dougm   01/09/12 19:35:21

  modperl-2.0/lib/APR - New directory