From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | Asif Naeem <anaeem(dot)it(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Install shared libs in lib/ and bin/ with MSVC (Was: install libpq.dll in bin directory on Windows / Cygwin) |
Date: | 2015-03-17 18:13:47 |
Message-ID: | 20150317181347.GO3636@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Michael Paquier wrote:
> So I have recoded the patch to use an hash of arrays (makes the code
> more readable IMO) to be able to track more easily what to install
> where, and process now does the following for shared libraries:
> - In lib/, install all .dll and .lib
> - In bin/, install all .dll
I wonder why do we need this part:
> @@ -247,22 +250,47 @@ sub CopySolutionOutput
>
> my $proj = read_file("$pf.$vcproj")
> || croak "Could not open $pf.$vcproj\n";
> +
> + # Check if this project uses a shared library by looking if
> + # SO_MAJOR_VERSION is defined in its Makefile, whose path
> + # can be found using the resource file of this project.
> + if (($vcproj eq 'vcxproj' &&
> + $proj =~ qr{ResourceCompile\s*Include="([^"]+)"}) ||
> + ($vcproj eq 'vcproj' &&
> + $proj =~ qr{File\s*RelativePath="([^\"]+)\.rc"}))
> + {
> + my $projpath = dirname($1);
> + my $mfname = -e "$projpath/GNUmakefile" ?
> + "$projpath/GNUmakefile" : "$projpath/Makefile";
> + my $mf = read_file($mfname) ||
> + croak "Could not open $mfname\n";
> +
> + if ($mf =~ /^SO_MAJOR_VERSION\s*=\s*(.*)$/mg)
> + {
> + $is_sharedlib = 1;
> + }
> + }
I mean, can't we just do the "push" unconditionally here?
> elsif ($1 == 2)
> {
> - $dir = "lib";
> - $ext = "dll";
> + push( @{ $install_list { 'lib' } }, "dll");
> + if ($is_sharedlib)
> + {
> + push( @{ $install_list { 'bin' } }, "dll");
> + push( @{ $install_list { 'lib' } }, "lib");
> + }
> }
Surely if there are no "lib/dll" files in the subdirectory, nothing will
happen, right? (I haven't actually tried.)
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2015-03-17 18:17:07 | Re: Strange assertion using VACOPT_FREEZE in vacuum.c |
Previous Message | Josh Berkus | 2015-03-17 17:51:04 | Re: Bug in point releases 9.3.6 and 9.2.10? |