Re: zlib detection in Meson on Windows broken?
Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
From: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
To: Dave Page <dpage@pgadmin.org>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-05-21T07:19:33Z
Lists: pgsql-hackers
Hi Dave, Is the .pc file generated after the successful build of zlib? If yes, then meson should be able to detect the installation ideally On Mon, May 20, 2024 at 4:28 PM Dave Page <dpage@pgadmin.org> wrote: > Hi > > I'm working on updating the build of PostgreSQL that pgAdmin uses in its > Windows installers to use Meson ready for the v17 release. I'm using Visual > Studio 2022, on Windows Server 2022. > > I've been unable to persuade Meson to detect zlib, whilst OpenSSL seems to > be fine. > > The dependencies have been built and installed as follows: > > mkdir c:\build64 > > wget https://zlib.net/zlib-1.3.2.tar.gz > tar -zxvf zlib-1.3.2.tar.gz > cd zlib-1.3.2 > cmake -DCMAKE_INSTALL_PREFIX=C:/build64/zlib -G "Visual Studio 17 2022" . > msbuild ALL_BUILD.vcxproj /p:Configuration=Release > msbuild RUN_TESTS.vcxproj /p:Configuration=Release > msbuild INSTALL.vcxproj /p:Configuration=Release > cd .. > > wget https://www.openssl.org/source/openssl-3.0.13.tar.gz > tar -zxvf openssl-3.0.13.tar.gz > cd openssl-3.0.013 > perl Configure VC-WIN64A no-asm --prefix=C:\build64\openssl no-ssl3 > no-comp > nmake > nmake test > nmake install > cd .. > > This results in the following headers and libraries being installed for > zlib: > > C:\Users\dpage\git\postgresql>dir C:\build64\zlib\include > Volume in drive C has no label. > Volume Serial Number is 3AAD-5864 > > Directory of C:\build64\zlib\include > > 17/05/2024 15:56 <DIR> . > 17/05/2024 15:56 <DIR> .. > 17/05/2024 15:54 17,096 zconf.h > 22/01/2024 19:32 96,829 zlib.h > 2 File(s) 113,925 bytes > 2 Dir(s) 98,842,726,400 bytes free > > C:\Users\dpage\git\postgresql>dir C:\build64\zlib\lib > Volume in drive C has no label. > Volume Serial Number is 3AAD-5864 > > Directory of C:\build64\zlib\lib > > 17/05/2024 17:01 <DIR> . > 17/05/2024 15:56 <DIR> .. > 17/05/2024 15:55 16,638 zlib.lib > 17/05/2024 15:55 184,458 zlibstatic.lib > 2 File(s) 201,096 bytes > 2 Dir(s) 98,842,726,400 bytes free > > I then attempt to build PostgreSQL: > > meson setup build > -Dextra_include_dirs=C:/build64/openssl/include,C:/build64/zlib/include > -Dextra_lib_dirs=C:/build64/openssl/lib,C:/build64/zlib/lib -Dssl=openssl > -Dzlib=enabled --prefix=c:/build64/pgsql > > Which results in the output in output.txt, indicating that OpenSSL was > correctly found, but zlib was not. I've also attached the meson log. > > I have very little experience with Meson, and even less interpreting it's > logs, but it seems to me that it's not including the extra lib and include > directories when it runs the test compile, given the command line it's > reporting: > > cl > C:\Users\dpage\git\postgresql\build\meson-private\tmpg_h4xcue\testfile.c > /nologo /showIncludes /utf-8 /EP /nologo /showIncludes /utf-8 /EP /Od /Oi- > > Bug, or am I doing something silly? > > > -- > Dave Page > pgAdmin: https://www.pgadmin.org > PostgreSQL: https://www.postgresql.org > EDB: https://www.enterprisedb.com > > -- Sandeep Thakkar