Properly parse the name of contrib modules that aren't named the same
authorMagnus Hagander <magnus@hagander.net>
Sat, 24 Mar 2007 14:13:27 +0000 (14:13 +0000)
committerMagnus Hagander <magnus@hagander.net>
Sat, 24 Mar 2007 14:13:27 +0000 (14:13 +0000)
way as their directory (notably xml2/pgxml and intarray/_int)

src/tools/msvc/Mkvcbuild.pm

index c288ae4f5d939bff345ecb40a6953ce6f2197703..35294adca720f99ced0bd5cc620e932efdfb65b9 100644 (file)
@@ -3,7 +3,7 @@ package Mkvcbuild;
 #
 # Package that generates build files for msvc build
 #
-# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.5 2007/03/23 09:53:33 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.6 2007/03/24 14:13:27 mha Exp $
 #
 use Carp;
 use Win32;
@@ -205,13 +205,13 @@ sub mkvcbuild
 
     if ($solution->{options}->{xml})
     {
-        $contrib_extraincludes->{'xml2'} = [
+        $contrib_extraincludes->{'pgxml'} = [
             $solution->{options}->{xml} . '\include',
             $solution->{options}->{xslt} . '\include',
             $solution->{options}->{iconv} . '\include'
         ];
 
-        $contrib_extralibs->{'xml2'} = [
+        $contrib_extralibs->{'pgxml'} = [
             $solution->{options}->{xml} . '\lib\libxml2.lib',
             $solution->{options}->{xslt} . '\lib\libxslt.lib'
         ];
@@ -264,7 +264,7 @@ sub mkvcbuild
     }
     closedir($D);
 
-    my $mf = Project::read_file('src\backend\utils\mb\conversion_procs\Makefile');
+    $mf = Project::read_file('src\backend\utils\mb\conversion_procs\Makefile');
     $mf =~ s{\\s*[\r\n]+}{}mg;
     $mf =~ m{DIRS\s*=\s*(.*)$}m || die 'Could not match in conversion makefile' . "\n";
     foreach my $sub (split /\s+/,$1)
@@ -360,10 +360,11 @@ sub AddContrib
     my $n = shift;
     my $mf = Project::read_file('contrib\\' . $n . '\Makefile');
 
-    if ($mf =~ /^MODULE_big/mg)
+    if ($mf =~ /^MODULE_big\s*=\s*(.*)$/mg)
     {
+        my $dn = $1;
         $mf =~ s{\\\s*[\r\n]+}{}mg;
-        my $proj = $solution->AddProject($n, 'dll', 'contrib');
+        my $proj = $solution->AddProject($dn, 'dll', 'contrib');
         $mf =~ /^OBJS\s*=\s*(.*)$/gm || croak "Could not find objects in MODULE_big for $n\n";
         foreach my $o (split /\s+/, $1)
         {
@@ -456,7 +457,9 @@ sub GenerateContribSqlFiles
             {
                 print "Building $out from $in (contrib/$n)...\n";
                 my $cont = Project::read_file("contrib/$n/$in");
-                $cont =~ s/MODULE_PATHNAME/\$libdir\/$n/g;
+                my $dn = $n;
+                if ($mf =~ /^MODULE_big\s*=\s*(.*)$/m) { $dn = $1 }
+                $cont =~ s/MODULE_PATHNAME/\$libdir\/$dn/g;
                 my $o;
                 open($o,">contrib/$n/$out") || croak "Could not write to contrib/$n/$d";
                 print $o $cont;