Repair memory leaks in plpython.
[pgsql.git] / doc / src / sgml / generate-targets-meson.pl
blobd127429c981816a5a02da481f27ddaf2965588dd
1 #!/usr/bin/perl
3 # Generate the targets-meson.sgml file from targets-meson.txt
4 # Copyright (c) 2000-2025, PostgreSQL Global Development Group
6 use strict;
7 use warnings FATAL => 'all';
9 my $targets_meson_file = $ARGV[0];
10 open my $targets_meson, '<', $targets_meson_file or die;
12 print
13 "<!-- autogenerated from doc/src/sgml/targets-meson.txt, do not edit -->\n";
15 # Find the start of each group of targets
16 while (<$targets_meson>)
18 next if /^#/;
20 if (/^(.*) Targets:$/)
22 my $targets = $1;
23 my $targets_id = lc $targets;
25 print qq(
26 <sect3 id="targets-meson-$targets_id">
27 <title>$targets Targets</title>
29 <variablelist>
32 # Each target in the group
33 while (<$targets_meson>)
35 next if /^#/;
36 last if !/^\s+([^ ]+)\s+(.+)/;
38 my $target = $1;
39 my $desc = $2;
40 my $target_id = $1;
42 $target_id =~ s/\//-/g;
44 print qq(
45 <varlistentry id="meson-target-${target_id}">
46 <term><option>${target}</option></term>
47 <listitem>
48 <para>
49 ${desc}
50 </para>
51 </listitem>
52 </varlistentry>
56 print qq(
57 </variablelist>
58 </sect3>
63 close $targets_meson;