Thread: Include files for static VC libpq.lib
Hi, I'm upgrading libpq bundled in PHP win32 distribution. I have no problem compiling static libpq.lib using bundled makefiles and msvc++. However getting the needed include files is bit more difficult. So far I have been installing pgsql on a linux box, took its include files and replaced pg_config.h with the one used for msvc++ build. Is there an easier way to do that? Adding some sort of "make install" would be handy as well. Edin
>Hi, > >I'm upgrading libpq bundled in PHP win32 distribution. I have >no problem >compiling static libpq.lib using bundled makefiles and msvc++. However >getting the needed include files is bit more difficult. So far >I have been >installing pgsql on a linux box, took its include files and replaced >pg_config.h with the one used for msvc++ build. Is there an >easier way to do >that? Adding some sort of "make install" would be handy as well. If you build with MingW you will have access to more or less everything that the unix builds has. Such as the "make install" command... //Magnus
On Saturday 22 January 2005 23:55, Magnus Hagander wrote: > >Hi, > > > >I'm upgrading libpq bundled in PHP win32 distribution. I have > >no problem > >compiling static libpq.lib using bundled makefiles and msvc++. However > >getting the needed include files is bit more difficult. So far > >I have been > >installing pgsql on a linux box, took its include files and replaced > >pg_config.h with the one used for msvc++ build. Is there an > >easier way to do > >that? Adding some sort of "make install" would be handy as well. > > If you build with MingW you will have access to more or less everything > that the unix builds has. Such as the "make install" command... Yes, I'm aware of that. However that doesn't change the situation much. I still need to build VC lib using msvc++ and then make the whole postgresql with mingw. At least linux build/install is faster :) I was looking for "make install" in VC makefile which would make include dir with neccessary .h files in it. Edin
>> >Hi, >> > >> >I'm upgrading libpq bundled in PHP win32 distribution. I have >> >no problem >> >compiling static libpq.lib using bundled makefiles and >msvc++. However >> >getting the needed include files is bit more difficult. So far >> >I have been >> >installing pgsql on a linux box, took its include files and replaced >> >pg_config.h with the one used for msvc++ build. Is there an >> >easier way to do >> >that? Adding some sort of "make install" would be handy as well. >> >> If you build with MingW you will have access to more or less >everything >> that the unix builds has. Such as the "make install" command... > >Yes, I'm aware of that. However that doesn't change the >situation much. I >still need to build VC lib using msvc++ and then make the >whole postgresql >with mingw. At least linux build/install is faster :) I was >looking for "make >install" in VC makefile which would make include dir with >neccessary .h files >in it. There is no such support in the VC Makefiles. It's only supported in the MingW build. FWIW, you can build the VC libs from the DEF file - we do so in the installer. You just run LINK /LIB /MACHINE:x86 /def:libpqdll.def /out:libpq.lib /name:libpq.dll //Magnus
Magnus Hagander wrote: > There is no such support in the VC Makefiles. It's only supported in the > MingW build. Ok, thanks for the info. I just wanted to make sure that I wasn't missing something and making things more difficult for me. > FWIW, you can build the VC libs from the DEF file - we do so in the > installer. You just run > > LINK /LIB /MACHINE:x86 /def:libpqdll.def /out:libpq.lib /name:libpq.dll This would create dynamic lib (needing libpq.dll for the app), right? PHP distribution has too many dlls alredy which is why I'm compiling php_pgsql.dll with the libpq built in. Edin
>> FWIW, you can build the VC libs from the DEF file - we do so in the >> installer. You just run >> >> LINK /LIB /MACHINE:x86 /def:libpqdll.def /out:libpq.lib >/name:libpq.dll > >This would create dynamic lib (needing libpq.dll for the app), right? Correct. >PHP distribution has too many dlls alredy which is why I'm compiling >php_pgsql.dll with the libpq built in. Ok. Then you have no choice but building MSVC. But then you shouldn't need to copy the includefiles - can't you just use them directly from the source tree? //Magnus
Magnus Hagander wrote: > Ok. Then you have no choice but building MSVC. But then you shouldn't > need to copy the includefiles - can't you just use them directly from > the source tree? Not really. The layout is changed by make install so for example libpq-fe.h gets installed in $prefix/include while in the source tree its at src/interfaces/libpq. The layout of include files is major headache. Take pg_type.h for example. RPM installs it at: $prefix/include/pgsql/server/catalog "make install" on unix: $prefix/include/postgresql/server/catalog "make install" on windows with mingw: $prefix/include/server/catalog libpq-fe.h is installed in $prefix/include in all 3 cases. Edin