Skip to content

Commit fb8f52f

Browse files
committed
meson: prereq: unicode: Allow to specify output directory
Author: Andres Freund <andres@anarazel.de> Author: Peter Eisentraut <peter@eisentraut.org> Author: nbyavuz <byavuz81@gmail.com>
1 parent 2db97b0 commit fb8f52f

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/common/unicode/generate-unicode_norm_table.pl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,27 @@
1010

1111
use strict;
1212
use warnings;
13+
use Getopt::Long;
1314

1415
use FindBin;
1516
use lib "$FindBin::RealBin/../../tools/";
1617
use PerfectHash;
1718

18-
my $output_table_file = "unicode_norm_table.h";
19-
my $output_func_file = "unicode_norm_hashfunc.h";
19+
my $output_path = '.';
20+
21+
GetOptions(
22+
'outdir:s' => \$output_path);
23+
24+
my $output_table_file = "$output_path/unicode_norm_table.h";
25+
my $output_func_file = "$output_path/unicode_norm_hashfunc.h";
26+
2027

2128
my $FH;
2229

2330
# Read list of codes that should be excluded from re-composition.
2431
my @composition_exclusion_codes = ();
25-
open($FH, '<', "CompositionExclusions.txt")
26-
or die "Could not open CompositionExclusions.txt: $!.";
32+
open($FH, '<', "$output_path/CompositionExclusions.txt")
33+
or die "Could not open $output_path/CompositionExclusions.txt: $!.";
2734
while (my $line = <$FH>)
2835
{
2936
if ($line =~ /^([[:xdigit:]]+)/)
@@ -38,8 +45,8 @@
3845
# and character decomposition mapping
3946
my @characters = ();
4047
my %character_hash = ();
41-
open($FH, '<', "UnicodeData.txt")
42-
or die "Could not open UnicodeData.txt: $!.";
48+
open($FH, '<', "$output_path/UnicodeData.txt")
49+
or die "Could not open $output_path/UnicodeData.txt: $!.";
4350
while (my $line = <$FH>)
4451
{
4552

0 commit comments

Comments
 (0)