perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2] including a Win32 apxs?
Date Thu, 06 Nov 2003 19:41:20 GMT
Randy Kobes wrote:
very neat! A few more comments:

> =========================================================
> Index: Makefile.PL
> ===================================================================
[...]
> +sub fetch_apxs {
> +    my $prefix = $build->{MP_AP_PREFIX} || '';
> +    my $script = catfile($build->{cwd}, 'build', 'fetch_win32_apxs.pl');
> +    my @args = ($^X, $script, "--with-apache2=$prefix");
> +    system(@args) == 0 or die "system @args failed: $?";
>  }

can you please call it win32_fetch_apxs, or fetch_apxs_win32, or similar and 
probably add a short comment before it explaining why is it needed.

> +my $dir = 'apxs';
> +my $arc = Archive::Tar->new($file, 1);
> +$arc->extract($arc->list_files());
> +die "Unpacking $file failed" unless (-d $dir);
> +
> +print "chdir $dir\n";
> +chdir $dir or die "chdir to $dir failed: $!";
> +
> +my @args = ($^X, 'Configure.pl', "--with-apache2=$prefix");
> +print "@args\n";
> +system(@args) == 0 or die "system @args failed: $?";
> +
> +chdir '..';

just to avoid problems in the future it's the best to store cwd before chdir 
and at the end to chdir back to that stored $cwd, instead of hardcoding '..', 
so if later you decide to change 'apxs' with 'whatever/apxs' it'll still work 
just fine.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message