]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Support falling back to non-preferred readline implementation with meson
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sat, 27 Jul 2024 10:53:16 +0000 (13:53 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sat, 27 Jul 2024 10:54:16 +0000 (13:54 +0300)
commited9d0446320050b5506861c0b583e0a24c7cb9d7
treeb49fec9995a0e81dc2f0cb01c5c9118bb555ebde
parenteb6765d57cfabc63bdb02375ec2e788783b88a0f
Support falling back to non-preferred readline implementation with meson

To build with -Dreadline=enabled one can use either readline or
libedit. The -Dlibedit_preferred flag is supposed to control the order
of names to lookup.  This works fine when either both libraries are
present or -Dreadline is set to auto. However, explicitly enabling
readline with only libedit present, but not setting libedit_preferred,
or alternatively enabling readline with only readline present, but
setting libedit_preferred, too, are both broken. This is because
cc.find_library will throw an error for a not found dependency as soon
as the first required dependency is checked, thus it's impossible to
fallback to the alternative.

Here we only check the second of the two dependencies for
requiredness, thus we only fail when none of the two can be found.

Author: Wolfgang Walther
Reviewed-by: Nazir Bilal Yavuz, Alvaro Herrera, Peter Eisentraut
Reviewed-by: Tristan Partin
Discussion: https://www.postgresql.org/message-id/ca8f37e1-a2c3-40e2-91f6-59c3d3652ad4@technowledgy.de
Backpatch: 16-, where meson support was added
meson.build