cvsuser     04/09/29 08:02:20

  Modified:    .        Configure.pl
               config/gen icu.pl
  Log:
  autodetect and use system icu installations
  if no system icu was found, or if you configure with --icu-config=none, parrot's own 
icu is used
  
  Revision  Changes    Path
  1.146     +9 -2      parrot/Configure.pl
  
  Index: Configure.pl
  ===================================================================
  RCS file: /cvs/public/parrot/Configure.pl,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -w -r1.145 -r1.146
  --- Configure.pl      19 Jun 2004 09:11:34 -0000      1.145
  +++ Configure.pl      29 Sep 2004 15:02:17 -0000      1.146
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: Configure.pl,v 1.145 2004/06/19 09:11:34 leo Exp $
  +# $Id: Configure.pl,v 1.146 2004/09/29 15:02:17 jrieks Exp $
   
   =head1 NAME
   
  @@ -181,6 +181,13 @@
   
   =over
   
  +=item C<--icu-config=/path/to/icu-config>
  +
  +Use the specified icu-config script to determine the neccessary ICU options.
  +
  +Use --icu-config=none to disable the autodetect feature. Parrot will
  +then be build with its own ICU.
  +
   =item C<--icuplatform=(platform)>
   
   Use the given platform name to pass to ICU's runConfigureICU. (See 
icu/source/runConfigureICU for the list of available "platform" names, which specify 
both operating system and compiler.)
  @@ -269,7 +276,7 @@
   
     for($key) {
       /version/ && do {
  -      my $cvsid='$Id: Configure.pl,v 1.145 2004/06/19 09:11:34 leo Exp $';
  +      my $cvsid='$Id: Configure.pl,v 1.146 2004/09/29 15:02:17 jrieks Exp $';
         print <<"END";
   Parrot Version $parrot_version Configure 2.0
   $cvsid
  
  
  
  1.19      +43 -3     parrot/config/gen/icu.pl
  
  Index: icu.pl
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/icu.pl,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -w -r1.18 -r1.19
  --- icu.pl    17 Aug 2004 08:50:47 -0000      1.18
  +++ icu.pl    29 Sep 2004 15:02:20 -0000      1.19
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: icu.pl,v 1.18 2004/08/17 08:50:47 leo Exp $
  +# $Id: icu.pl,v 1.19 2004/09/29 15:02:20 jrieks Exp $
   
   =head1 NAME
   
  @@ -21,14 +21,54 @@
   $description="Configuring ICU if requested...";
   
   @args=qw(buildicu verbose icudatadir icuplatform icuconfigureargs
  -         icushared icuheaders);
  +         icushared icuheaders icu-config);
   
   sub runstep {
     my ($buildicu, $verbose, $icudatadir, $icuplatform, $icuconfigureargs,
  -           $icushared, $icuheaders) = @_;
  +           $icushared, $icuheaders, $icuconfig) = @_;
     my $icu_configure_command;
     my @icu_headers = qw(ucnv.h utypes.h uchar.h);
   
  +  print "\n" if $verbose;
  +  
  +  if (!defined $icuconfig || !$icuconfig) {
  +    `icu-config --exists`;
  +    if (($? == -1) || ($? >> 8) != 0 ) {
  +      undef $icuconfig;
  +      print "icu-config not found.\n" if $verbose;
  +    } else {
  +      $icuconfig = "icu-config";
  +      print "icu-config found... good!\n" if $verbose;
  +    }
  +  }
  +
  +  if ($icuconfig && $icuconfig ne "none") {
  +    my $slash = Configure::Data->get('slash');
  +
  +    # icu-config script to use
  +    $icuconfig = "icu-config" if $icuconfig eq "1";
  +  
  +    # ldflags
  +    $icushared = `$icuconfig --ldflags`;
  +    chomp $icushared;
  +
  +    # location of header files
  +    $icuheaders = `$icuconfig --prefix`;
  +    chomp $icuheaders;
  +    $icuheaders .= "${slash}include";
  +    
  +    # icu data dir
  +    $icudatadir = `$icuconfig --icudatadir`;
  +    chomp $icudatadir;
  +  }
  +
  +  if ($verbose) {
  +    print "icuconfig: $icuconfig\n" if defined $icuconfig;
  +    print "icushared='$icushared'\n" if defined $icushared;
  +    print "headers='$icuheaders'\n" if defined $icuheaders;
  +    print "datadir='$icudatadir'\n" if defined $icudatadir;
  +  }
  +  
     if (defined($icushared) && defined($icuheaders)) {
       $icuheaders =~ s![\\/]$!!;
       my $c_libs = Configure::Data->get('libs');
  
  
  

Reply via email to