pgsql: Support falling back to non-preferred readline implementation wi

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Support falling back to non-preferred readline implementation wi
Date: 2024-07-27 11:17:46
Message-ID: E1sXfQo-001Rdd-L4@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/67427f10093a9c50c79e1dbfdcd1698433e8a88f

Modified Files
--------------
meson.build | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2024-07-27 11:46:57 pgsql: Optimize escaping of JSON strings
Previous Message Michael Paquier 2024-07-26 22:24:22 pgsql: Fix more holes with SLRU code in need of int64 for segment numbe