From b13635ce59ca44cc0bc1dcccd9bf7e086fa13ac7 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Thu, 28 Feb 2008 12:17:59 +0000 Subject: [PATCH] Support for building contrib/uuid-ossp with MSVC. Original patch from Hiroshi Saito, modified by me. --- doc/src/sgml/install-win32.sgml | 11 ++++++++++- src/tools/msvc/Install.pm | 4 ++-- src/tools/msvc/Mkvcbuild.pm | 14 ++++++++++++-- src/tools/msvc/Solution.pm | 7 ++++++- src/tools/msvc/config.pl | 1 + 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/doc/src/sgml/install-win32.sgml b/doc/src/sgml/install-win32.sgml index 9485280489..4b3f2dcb2e 100644 --- a/doc/src/sgml/install-win32.sgml +++ b/doc/src/sgml/install-win32.sgml @@ -1,4 +1,4 @@ - + Installation on <productname>Windows</productname> @@ -160,6 +160,15 @@ + + ossp-uuid + + Required for UUID-OSSP support (contrib only). Source can be + downloaded from + . + + + Python diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index 7ada204c95..ba445628b3 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.28 2008/02/07 17:58:16 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.29 2008/02/28 12:17:59 mha Exp $ # use strict; use warnings; @@ -291,7 +291,7 @@ sub CopyContribFiles { next if ($d =~ /^\./); next unless (-f "contrib/$d/Makefile"); - next if ($d eq "uuid-ossp"); + next if ($d eq "uuid-ossp"&& !defined($config->{uuid})); next if ($d eq "sslinfo" && !defined($config->{openssl})); next if ($d eq "xml2" && !defined($config->{xml})); diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 85b1b841ff..8081af3d92 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -3,7 +3,7 @@ package Mkvcbuild; # # Package that generates build files for msvc build # -# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.25 2008/02/05 14:17:23 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.26 2008/02/28 12:17:59 mha Exp $ # use Carp; use Win32; @@ -31,7 +31,7 @@ my $contrib_extrasource = { 'cube' => ['cubescan.l','cubeparse.y'], 'seg' => ['segscan.l','segparse.y'] }; -my @contrib_excludes = ('pgcrypto','uuid-ossp'); +my @contrib_excludes = ('pgcrypto'); sub mkvcbuild { @@ -247,6 +247,16 @@ sub mkvcbuild push @contrib_excludes,'sslinfo'; } + if ($solution->{options}->{uuid}) + { + $contrib_extraincludes->{'uuid-ossp'} = [ $solution->{options}->{uuid} . '\include' ]; + $contrib_extralibs->{'uuid-ossp'} = [ $solution->{options}->{uuid} . '\lib\uuid.lib' ]; + } + else + { + push @contrib_excludes,'uuid-ossp'; + } + # Pgcrypto makefile too complex to parse.... my $pgcrypto = $solution->AddProject('pgcrypto','dll','crypto'); $pgcrypto->AddFiles( diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 8f3e4bf57d..d58169c066 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.35 2008/02/19 12:00:03 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.36 2008/02/28 12:17:59 mha Exp $ # use Carp; use strict; @@ -113,6 +113,10 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY print O "#define USE_SSL 1\n" if ($self->{options}->{openssl}); print O "#define ENABLE_NLS 1\n" if ($self->{options}->{nls}); + if ($self->{options}->{uuid}) + { + print O "#define HAVE_UUID_H\n"; + } if ($self->{options}->{xml}) { print O "#define HAVE_LIBXML2\n"; @@ -451,6 +455,7 @@ sub GetFakeConfigure $cfg .= ' --with-ldap' if ($self->{options}->{ldap}); $cfg .= ' --without-zlib' unless ($self->{options}->{zlib}); $cfg .= ' --with-openssl' if ($self->{options}->{ssl}); + $cfg .= ' --with-ossp-uuid' if ($self->{options}->{uuid}); $cfg .= ' --with-libxml' if ($self->{options}->{xml}); $cfg .= ' --with-libxslt' if ($self->{options}->{xslt}); $cfg .= ' --with-krb5' if ($self->{options}->{krb5}); diff --git a/src/tools/msvc/config.pl b/src/tools/msvc/config.pl index 548485a074..52e64ef609 100644 --- a/src/tools/msvc/config.pl +++ b/src/tools/msvc/config.pl @@ -12,6 +12,7 @@ our $config = { 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', -- 2.40.0