Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c8a9246

Browse files
committed
Add output directory argument to generate-unicode_norm_table.pl
This is in preparation for building postgres with meson / ninja. When building with meson, commands are run at the root of the build tree. Add an option to put build output into the appropriate place. Author: Andres Freund <andres@anarazel.de> Author: Peter Eisentraut <peter@eisentraut.org> Author: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://postgr.es/m/5e216522-ba3c-f0e6-7f97-5276d0270029@enterprisedb.com
1 parent 2bf626b commit c8a9246

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)