1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

meson: libpq: Revise static / shared library setup

Improvements:
- we don't need -DFRONTEND for libpq anymore since 1d77afefbd
- the .pc file contents for a static libpq were wrong (referencing
  {pgport, common}_shlib)
- incidentally fixes meson not supporting link_whole on AIX yet
- added explanatory comments

Previously I tried to avoid building libpq's sources twice, once for the
static and once for the shared library. We could still do so, but it's not
clear that it's worth the complication.

Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
This commit is contained in:
Andres Freund
2022-10-05 09:56:05 -07:00
parent 29668e3186
commit 089c0bc7a7
2 changed files with 36 additions and 15 deletions

View File

@ -2619,17 +2619,29 @@ backend_common_code = declare_dependency(
subdir('src/common')
frontend_shlib_code = declare_dependency(
compile_args: ['-DFRONTEND'],
include_directories: [postgres_inc],
# all shared libraries should depend on shlib_code
shlib_code = declare_dependency(
link_args: ldflags_sl,
link_with: [pgport_shlib, common_shlib],
)
# all static libraries not part of the backend should depend on this
frontend_stlib_code = declare_dependency(
include_directories: [postgres_inc],
link_with: [common_static, pgport_static],
sources: generated_headers,
dependencies: [os_deps, libintl],
)
# all shared libraries not part of the backend should depend on this
frontend_shlib_code = declare_dependency(
include_directories: [postgres_inc],
link_with: [common_shlib, pgport_shlib],
sources: generated_headers,
dependencies: [shlib_code, os_deps, libintl],
)
# Dependencies both for static and shared libpq
libpq_deps += [
frontend_shlib_code,
thread_dep,
gssapi,
@ -2642,6 +2654,7 @@ subdir('src/interfaces/libpq')
# fe_utils depends on libpq
subdir('src/fe_utils')
# for frontend binaries
frontend_code = declare_dependency(
include_directories: [postgres_inc],
link_with: [fe_utils, common_static, pgport_static],