From af322a8a3ef28d9b0425238353a8bffa94bfaa47 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 5 Jan 2010 13:31:58 +0000 Subject: Move the default configuration for the MSVC build system to config_default.pl, 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 | 5 +++-- src/tools/msvc/Solution.pm | 7 ++++--- src/tools/msvc/build.pl | 5 +++-- src/tools/msvc/config.pl | 27 --------------------------- src/tools/msvc/config_default.pl | 27 +++++++++++++++++++++++++++ src/tools/msvc/mkvcbuild.pl | 8 +++++--- 6 files changed, 42 insertions(+), 37 deletions(-) delete mode 100644 src/tools/msvc/config.pl create mode 100644 src/tools/msvc/config_default.pl (limited to 'src') diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index 7bdc2b8cbdf..bffad8f2a7d 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -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"); diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 9cd8ce557fa..084d107a935 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -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); diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl index 534492b9eb0..d3c299e2138 100644 --- a/src/tools/msvc/build.pl +++ b/src/tools/msvc/build.pl @@ -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); diff --git a/src/tools/msvc/config.pl b/src/tools/msvc/config.pl deleted file mode 100644 index 1e3750535de..00000000000 --- a/src/tools/msvc/config.pl +++ /dev/null @@ -1,27 +0,0 @@ -# Configuration arguments for vcbuild. -use strict; -use warnings; - -our $config = { - asserts=>0, # --enable-cassert - # integer_datetimes=>1, # --enable-integer-datetimes - on is now default - # float4byval=>1, # --disable-float4-byval, on by default - # float8byval=>0, # --disable-float8-byval, off by default - # 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 - nls=>undef, # --enable-nls= - tcl=>'c:\tcl', # --with-tls= - perl=>'c:\perl', # --with-perl - python=>'c:\python24', # --with-python= - krb5=>'c:\prog\pgsql\depend\krb5', # --with-krb5= - ldap=>1, # --with-ldap - openssl=>'c:\openssl', # --with-ssl= - 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= -}; - -1; diff --git a/src/tools/msvc/config_default.pl b/src/tools/msvc/config_default.pl new file mode 100644 index 00000000000..eea4a70fe76 --- /dev/null +++ b/src/tools/msvc/config_default.pl @@ -0,0 +1,27 @@ +# Configuration arguments for vcbuild. +use strict; +use warnings; + +our $config = { + asserts=>0, # --enable-cassert + # integer_datetimes=>1, # --enable-integer-datetimes - on is now default + # float4byval=>1, # --disable-float4-byval, on by default + # float8byval=>0, # --disable-float8-byval, off by default + # 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= + tcl=>undef, # --with-tls= + perl=>undef, # --with-perl + python=>undef, # --with-python= + krb5=>undef, # --with-krb5= + openssl=>undef, # --with-ssl= + uuid=>undef, # --with-ossp-uuid + xml=>undef, # --with-libxml= + xslt=>undef, # --with-libxslt= + iconv=>undef, # (not in configure, path to iconv) + zlib=>undef # --with-zlib= +}; + +1; diff --git a/src/tools/msvc/mkvcbuild.pl b/src/tools/msvc/mkvcbuild.pl index 81ff7485cf7..bdb1cc4d822 100644 --- a/src/tools/msvc/mkvcbuild.pl +++ b/src/tools/msvc/mkvcbuild.pl @@ -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); -- cgit v1.2.3