Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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


git-svn-id: https://svn.parrot.org/parrot/trunk@6721 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit acf4fa4e1acc2cdc3c8513c3f9c4441d8ead5cf1 1 parent bc98801
Jens Rieks authored
Showing with 49 additions and 2 deletions.
  1. +7 −0 Configure.pl
  2. +42 −2 config/gen/icu.pl
7 Configure.pl
View
@@ -181,6 +181,13 @@ =head2 Command-line Options
=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.)
44 config/gen/icu.pl
View
@@ -21,14 +21,54 @@ package Configure::Step;
$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');
Please sign in to comment.
Something went wrong with that request. Please try again.