path with spaces in config.pl

Started by Gevik Babakhanialmost 18 years ago4 messages
#1Gevik Babakhani
pgdev@xs4all.nl

Hi,

I would like report an observations regarding compilation with msvc++
I was trying to compile with nls=>'C:\Program Files\GnuWin32\' (of course
with GetText installed and everything)
The build process breaks on link with missing "Program.obj" error. When I
changed nls='C:\prog\pgsql\depend\gettext' everything compiled just fine.

Perhaps we should document this.

Regards,
Gevik.

#2Magnus Hagander
magnus@hagander.net
In reply to: Gevik Babakhani (#1)
Re: path with spaces in config.pl

On Tue, Feb 05, 2008 at 11:11:42AM +0100, Gevik Babakhani wrote:

Hi,

I would like report an observations regarding compilation with msvc++
I was trying to compile with nls=>'C:\Program Files\GnuWin32\' (of course
with GetText installed and everything)
The build process breaks on link with missing "Program.obj" error. When I
changed nls='C:\prog\pgsql\depend\gettext' everything compiled just fine.

Perhaps we should document this.

Or we should fix it, if we can figure out why. Is it the fact that it only
works with what happens to be the directory layout I use, or is it the
space in the filename that's breaking something? Can you test a third case
to figure that out?

//Magnus

#3Gevik Babakhani
pgdev@xs4all.nl
In reply to: Magnus Hagander (#2)
1 attachment(s)
Re: path with spaces in config.pl

Or we should fix it, if we can figure out why. Is it the fact
that it only works with what happens to be the directory
layout I use, or is it the space in the filename that's
breaking something? Can you test a third case to figure that out?

I think it is the darn msbuild which accepts spaces in "include" but not in
"lib"
Attached is a quick patch that fixed the link error on my machine.

Regards,
Gevik Babakhani
------------------------------------------------
PostgreSQL NL http://www.postgresql.nl
TrueSoftware BV http://www.truesoftware.nl
------------------------------------------------

Attachments:

patch-0.2-combined.patchapplication/octet-stream; name=patch-0.2-combined.patchDownload
*** pgsql/src/tools/msvc/Mkvcbuild.pm.orig	2007-11-13 23:49:47.000000000 +0100
--- pgsql/src/tools/msvc/Mkvcbuild.pm	2008-02-05 13:28:20.658331200 +0100
***************
*** 66,72 ****
      $postgres->AddFiles('src\backend\bootstrap','bootscanner.l','bootparse.y');
      $postgres->AddFiles('src\backend\utils\misc','guc-file.l');
      $postgres->AddDefine('BUILDING_DLL');
!     $postgres->AddLibrary('wsock32.lib ws2_32.lib secur32.lib');
      $postgres->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap});
      $postgres->FullExportDLL('postgres.lib');
  
--- 66,75 ----
      $postgres->AddFiles('src\backend\bootstrap','bootscanner.l','bootparse.y');
      $postgres->AddFiles('src\backend\utils\misc','guc-file.l');
      $postgres->AddDefine('BUILDING_DLL');
!     $postgres->AddLibrary('wsock32.lib');
!     $postgres->AddLibrary('ws2_32.lib');
!     $postgres->AddLibrary('secur32.lib');
!     
      $postgres->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap});
      $postgres->FullExportDLL('postgres.lib');
  
***************
*** 179,185 ****
      my $initdb = AddSimpleFrontend('initdb');
      $initdb->AddIncludeDir('src\interfaces\libpq');
      $initdb->AddDefine('FRONTEND');
!     $initdb->AddLibrary('wsock32.lib ws2_32.lib');
  
      my $pgconfig = AddSimpleFrontend('pg_config');
  
--- 182,189 ----
      my $initdb = AddSimpleFrontend('initdb');
      $initdb->AddIncludeDir('src\interfaces\libpq');
      $initdb->AddDefine('FRONTEND');
!     $initdb->AddLibrary('wsock32.lib');
!     $initdb->AddLibrary('ws2_32.lib');
  
      my $pgconfig = AddSimpleFrontend('pg_config');
  
*** pgsql/src/tools/msvc/Project.pm.orig	2007-12-11 15:34:43.000000000 +0100
--- pgsql/src/tools/msvc/Project.pm	2008-02-05 13:26:21.376812800 +0100
***************
*** 123,128 ****
--- 123,133 ----
  sub AddLibrary
  {
      my ($self, $lib, $dbgsuffix) = @_;
+     
+     if ($lib =~ m/\s/)
+     {
+     	$lib = '"' . $lib . """;
+     }
  
      push @{$self->{libraries}}, $lib;
      if ($dbgsuffix)
#4Magnus Hagander
magnus@hagander.net
In reply to: Gevik Babakhani (#3)
Re: path with spaces in config.pl

On Tue, Feb 05, 2008 at 01:55:40PM +0100, Gevik Babakhani wrote:

Or we should fix it, if we can figure out why. Is it the fact
that it only works with what happens to be the directory
layout I use, or is it the space in the filename that's
breaking something? Can you test a third case to figure that out?

I think it is the darn msbuild which accepts spaces in "include" but not in
"lib"
Attached is a quick patch that fixed the link error on my machine.

Looks good to me, applied, thanks!

//Magnus