cvs commit: ponie Configure.pl

[email protected] (Nicholas Clark) 19 Mar 2004 12:34:26 -0000
Newsgroups perl.ponie.changes
Message-ID <[email protected]>
cvsuser     04/03/19 04:34:26

  Modified:    .        Configure.pl
  Log:
  Change ponie's configure system to only run perl's Configure.pl once, and
  edit the config.sh to add the paths into parrot.
  
  Revision  Changes    Path
  1.14      +26 -6     ponie/Configure.pl
  
  Index: Configure.pl
  ===================================================================
  RCS file: /cvs/public/ponie/Configure.pl,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- Configure.pl	12 Mar 2004 11:50:15 -0000	1.13
  +++ Configure.pl	19 Mar 2004 12:34:26 -0000	1.14
  @@ -50,13 +50,34 @@
       chdir('..') || die;
   }
   
  -push @config_args,'-Dlocincpth=' . $FindBin::Bin . '/parrot/include';
  -push @config_args,'-Dloclibpth=' . $FindBin::Bin . '/parrot/blib/lib';
  -push @config_args,qq{-Dotherlibdirs=lib/};
  -push @config_args,qq{-A},qq{append:libswanted= parrot};
  +# redo config.sh
   
  +my $inc_path = "$FindBin::Bin/parrot/include";
  +my $lib_path = "$FindBin::Bin/parrot/blib/lib";
   
  -do_perl_configure();
  +chdir('perl') || die $!;
  +
  +open (FH, "config.sh") or die $!;
  +undef $/; $_ = <FH>;
  +close FH or die $!;
  +
  +my %munge;
  +$munge{cppflags} = $munge{ccflags} = " -I${inc_path}";
  +$munge{ldflags} = $munge{lddlflags} = " -L${lib_path}";
  +$munge{libs} = $munge{perllibs} = " -lparrot";
  +$munge{libpth} = $lib_path;
  +
  +while (my ($key, $value) = each %munge) {
  +  s/($key='[^']*)'$/$1 $value'/m or die "Can't find config.sh line for $key";
  +}
  +
  +rename "config.sh", "config.sh.before";
  +
  +open (FH, ">config.sh") or die $!;
  +print FH or die $!;
  +close FH or die $!;
  +
  +system ('sh','Configure','-S') && die "error";
   
   sub do_perl_configure {
   
  @@ -65,7 +86,6 @@
       $cmd .= join(' ',@config_args);
       print "Executing '$cmd'\n";
       
  -
       system('rm -f Policy.sh');
       system('rm -f Policy.h');
       system('rm -f config.sh');