Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited9d044

Browse files
committed
Support falling back to non-preferred readline implementation with meson
To build with -Dreadline=enabled one can use either readline orlibedit. The -Dlibedit_preferred flag is supposed to control the orderof names to lookup. This works fine when either both libraries arepresent or -Dreadline is set to auto. However, explicitly enablingreadline with only libedit present, but not setting libedit_preferred,or alternatively enabling readline with only readline present, butsetting libedit_preferred, too, are both broken. This is becausecc.find_library will throw an error for a not found dependency as soonas the first required dependency is checked, thus it's impossible tofallback to the alternative.Here we only check the second of the two dependencies forrequiredness, thus we only fail when none of the two can be found.Author: Wolfgang WaltherReviewed-by: Nazir Bilal Yavuz, Alvaro Herrera, Peter EisentrautReviewed-by: Tristan PartinDiscussion:https://www.postgresql.org/message-id/ca8f37e1-a2c3-40e2-91f6-59c3d3652ad4@technowledgy.deBackpatch: 16-, where meson support was added
1 parenteb6765d commited9d044

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

‎meson.build

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,15 +1149,26 @@ endif
11491149

11501150
ifnotget_option('readline').disabled()
11511151
libedit_preferred=get_option('libedit_preferred')
1152-
# Set the order of readline dependencies
1153-
check_readline_deps= libedit_preferred ? \
1154-
['libedit','readline'] : ['readline','libedit']
1152+
# Set the order of readline dependencies.
1153+
# cc.find_library breaks and throws on the first dependency which
1154+
# is marked as required=true and can't be found. Thus, we only mark
1155+
# the last dependency to look up as required, to not throw too early.
1156+
check_readline_deps= [
1157+
{
1158+
'name': libedit_preferred ?'libedit' :'readline',
1159+
'required':false
1160+
},
1161+
{
1162+
'name': libedit_preferred ?'readline' :'libedit',
1163+
'required':get_option('readline')
1164+
}
1165+
]
11551166

11561167
foreachreadline_dep: check_readline_deps
1157-
readline=dependency(readline_dep,required:false)
1168+
readline=dependency(readline_dep['name'],required:false)
11581169
ifnot readline.found()
1159-
readline= cc.find_library(readline_dep,
1160-
required:get_option('readline'),
1170+
readline= cc.find_library(readline_dep['name'],
1171+
required:readline_dep['required'],
11611172
dirs: test_lib_d)
11621173
endif
11631174
if readline.found()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp