OSDN Git Service

Move the default configuration for the MSVC build system to config_default.pl,
authorMagnus Hagander <magnus@hagander.net>
Tue, 5 Jan 2010 13:31:58 +0000 (13:31 +0000)
committerMagnus Hagander <magnus@hagander.net>
Tue, 5 Jan 2010 13:31:58 +0000 (13:31 +0000)
and allow using config.pl to override the defaults. config.pl is removed from
the repository, so changes there will no longer show up when doing diff, and
will not prevent switching branches and such things.

config.pl would normally be used to override single values, but if an
old-style config.pl is read, it will override the entire default configuration,
making it backwards compatible.

src/tools/msvc/Install.pm
src/tools/msvc/Solution.pm
src/tools/msvc/build.pl
src/tools/msvc/config_default.pl [moved from src/tools/msvc/config.pl with 53% similarity]
src/tools/msvc/mkvcbuild.pl

index 7bdc2b8..bffad8f 100644 (file)
@@ -3,7 +3,7 @@ package Install;
 #
 # Package that provides 'make install' functionality for msvc builds
 #
-# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.33 2009/04/20 08:38:00 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.34 2010/01/05 13:31:58 mha Exp $
 #
 use strict;
 use warnings;
@@ -38,7 +38,8 @@ sub Install
 
     my $target = shift;
     our $config;
-    require 'config.pl';
+    require "config_default.pl";
+    require "config.pl" if (-f "config.pl");
 
     chdir("../../..") if (-f "../../../configure");
     chdir("../../../..") if (-f "../../../../configure");
index 9cd8ce5..084d107 100644 (file)
@@ -3,7 +3,7 @@ package Solution;
 #
 # Package that encapsulates a Visual C++ solution file generation
 #
-# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.52 2010/01/05 01:06:57 tgl Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.53 2010/01/05 13:31:58 mha Exp $
 #
 use Carp;
 use strict;
@@ -93,9 +93,10 @@ sub DetermineToolVersions
 sub IsNewer
 {
     my ($newfile, $oldfile) = @_;
-    if ($oldfile ne 'src\tools\msvc\config.pl')
+    if ($oldfile ne 'src\tools\msvc\config.pl' && $oldfile ne 'src\tools\msvc\config_default.pl')
     {
-        return 1 if IsNewer($newfile, 'src\tools\msvc\config.pl');
+        return 1 if (-f 'src\tools\msvc\config.pl') && IsNewer($newfile, 'src\tools\msvc\config.pl');
+        return 1 if (-f 'src\tools\msvc\config_default.pl') && IsNewer($newfile, 'src\tools\msvc\config_default.pl');
     }
     return 1 if (!(-e $newfile));
     my @nstat = stat($newfile);
index 534492b..d3c299e 100644 (file)
@@ -1,7 +1,7 @@
 
 # -*-perl-*- hey - emacs - this is a perl file
 
-# $PostgreSQL: pgsql/src/tools/msvc/build.pl,v 1.1 2007/09/23 21:52:56 adunstan Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/build.pl,v 1.2 2010/01/05 13:31:58 mha Exp $
 
 BEGIN
 {
@@ -32,7 +32,8 @@ elsif (-e "./buildenv.pl" )
 
 # set up the project
 our $config;
-require "config.pl";
+require "config_default.pl";
+require "config.pl" if (-f "src/tools/msvc/config.pl");
 
 Mkvcbuild::mkvcbuild($config);
 
similarity index 53%
rename from src/tools/msvc/config.pl
rename to src/tools/msvc/config_default.pl
index 1e37505..eea4a70 100644 (file)
@@ -10,18 +10,18 @@ our $config = {
     # blocksize => 8,         # --with-blocksize, 8kB by default
     # wal_blocksize => 8,     # --with-wal-blocksize, 8kb by default
     # wal_segsize => 16,      # --with-wal-segsize, 16MB by default
+    ldap=>1,                           # --with-ldap
     nls=>undef,                                # --enable-nls=<path>
-    tcl=>'c:\tcl',             # --with-tls=<path>
-    perl=>'c:\perl',                   # --with-perl
-    python=>'c:\python24', # --with-python=<path>
-    krb5=>'c:\prog\pgsql\depend\krb5', # --with-krb5=<path>
-    ldap=>1,                   # --with-ldap
-    openssl=>'c:\openssl', # --with-ssl=<path>
-    uuid=>'c:\prog\pgsql\depend\ossp-uuid', #--with-ossp-uuid
-    xml=>'c:\prog\pgsql\depend\libxml2',
-    xslt=>'c:\prog\pgsql\depend\libxslt',
-    iconv=>'c:\prog\pgsql\depend\iconv',
-    zlib=>'c:\prog\pgsql\depend\zlib'# --with-zlib=<path>
+    tcl=>undef,                                # --with-tls=<path>
+    perl=>undef,                       # --with-perl
+    python=>undef,                     # --with-python=<path>
+    krb5=>undef,                       # --with-krb5=<path>
+    openssl=>undef,                    # --with-ssl=<path>
+    uuid=>undef,                       # --with-ossp-uuid
+    xml=>undef,                                # --with-libxml=<path>
+    xslt=>undef,                       # --with-libxslt=<path>
+    iconv=>undef,                      # (not in configure, path to iconv)
+    zlib=>undef                                # --with-zlib=<path>
 };
 
 1;
index 81ff748..bdb1cc4 100644 (file)
@@ -2,7 +2,7 @@
 # Script that parses Unix style build environment and generates build files
 # for building with Visual Studio.
 #
-# $PostgreSQL: pgsql/src/tools/msvc/mkvcbuild.pl,v 1.18 2007/03/17 14:01:01 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/mkvcbuild.pl,v 1.19 2010/01/05 13:31:58 mha Exp $
 #
 use strict;
 use warnings;
@@ -12,9 +12,11 @@ use Mkvcbuild;
 chdir('..\..\..') if (-d '..\msvc' && -d '..\..\..\src');
 die 'Must run from root or msvc directory' unless (-d 'src\tools\msvc' && -d 'src');
 
-die 'Could not find config.pl' unless (-f 'src/tools/msvc/config.pl');
+die 'Could not find config_default.pl' unless (-f 'src/tools/msvc/config_default.pl');
+print "Warning: no config.pl found, using default.\n" unless (-f 'src/tools/msvc/config.pl');
 
 our $config;
-require 'src/tools/msvc/config.pl';
+require 'src/tools/msvc/config_default.pl';
+require 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl');
 
 Mkvcbuild::mkvcbuild($config);