Re: Install shared libs in lib/ and bin/ with MSVC (Was: install libpq.dll in bin directory on Windows / Cygwin)

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Install shared libs in lib/ and bin/ with MSVC (Was: install libpq.dll in bin directory on Windows / Cygwin)
Дата
Msg-id CAB7nPqRjix3AbQ0G5bK7pe9679OGVKSvuNFp6hyjVFnPT4TvFw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Install shared libs in lib/ and bin/ with MSVC (Was: install libpq.dll in bin directory on Windows / Cygwin)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Install shared libs in lib/ and bin/ with MSVC (Was: install libpq.dll in bin directory on Windows / Cygwin)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On Wed, Mar 18, 2015 at 3:13 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> 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?

Why should we install unnecessary stuff? This complicates the
installation contents, the point being to have only shared libraries's
dll installed in bin/, and make things consistent with what MinGW
does.

>>                       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.)

No, it fails. And we should actually have a bin/lib that has been
correctly generated. Do you think this is a problem? Normally we
*should* fail IMO, meaning that the build process has broken what it
should have done.
-- 
Michael



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Rethinking the parameter access hooks for plpgsql's benefit