aboutsummaryrefslogtreecommitdiff
path: root/ports/libpq/patches/windows/Solution.patch
blob: 2259e3e8abdf8446f0b37be423690656a86daad3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 51711c2bf..d33fdc3b0 100644
--- a/src/tools/msvc/Solution.pm	
+++ b/src/tools/msvc/Solution.pm
@@ -69,9 +69,15 @@ sub DeterminePlatform
        my $self = shift;
 
        # Examine CL help output to determine if we are in 32 or 64-bit mode.
-       my $output = `cl /? 2>&1`;
+       my $output = `cl 2>&1`;
        $? >> 8 == 0 or die "cl command not found";
-       $self->{platform} = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32';
+       if ($output =~ m/x64\n/) { $self->{platform} = 'x64';
+       } elsif ($output =~ m/x86\n/) { $self->{platform} = 'Win32';
+       } elsif ($output =~ m/ARM64\n/) { $self->{platform} = 'ARM64';
+       } elsif ($output =~ m/ARM\n/) { $self->{platform} = 'ARM';
+       } else { $self->{platform} = 'Unknown'
+       }
+       print "cl output $output.";
        print "Detected hardware platform: $self->{platform}\n";
        return;
 }
@@ -526,14 +526,14 @@ EOF
                  || confess "Could not open pg_config_paths.h";
                print $o <<EOF;
 #define PGBINDIR "/bin"
-#define PGSHAREDIR "/share"
+#define PGSHAREDIR "/share/libpq"
 #define SYSCONFDIR "/etc"
 #define INCLUDEDIR "/include"
 #define PKGINCLUDEDIR "/include"
 #define INCLUDEDIRSERVER "/include/server"
 #define LIBDIR "/lib"
 #define PKGLIBDIR "/lib"
-#define LOCALEDIR "/share/locale"
+#define LOCALEDIR "/share/libpq/locale"
 #define DOCDIR "/doc"
 #define HTMLDIR "/doc"
 #define MANDIR "/man"