2 # Haiku OS: we don't care!
6 my $in = 'cmake-config.h.in';
10 open $fin, "< $in" or die "can't open $in: $!";
11 open $fout, "> $out" or die "can't create $out: $!";
13 my $zipconf_defines = read_zipconf_defines();
16 while (my $line = <$fin>) {
18 if ($line =~ m,/* END DEFINES,) {
26 if ($line =~ m,/\* BEGIN DEFINES,) {
28 add_defines($fout, $zipconf_defines);
38 my ($fout, $zipconf_defines) = @_;
41 open $fin, "< CMakeLists.txt" or die "can't open CMakeLists.txt: $!";
43 while (my $line = <$fin>) {
46 if ($line =~ m/CHECK_TYPE_SIZE\(.* (\S*)\)/) {
50 elsif ($line =~ m/CHECK_\S*\(.* (\S*)\)/) {
54 if (defined($key) && !defined($zipconf_defines->{$key})) {
55 print $fout "#cmakedefine $key" . ($value ? " $value" : "") . "\n";
62 sub read_zipconf_defines {
63 my %zipconf_defines = ();
66 open $fin, "< cmake-zipconf.h.in" or die "can't open cmake-zipconf.h.in: $!";
68 while (my $line = <$fin>) {
69 if ($line =~ m/#cmakedefine\s+(\S+)/) {
70 $zipconf_defines{$1} = 1;
76 return \%zipconf_defines;