It isn't necessarily the case that use of iconv requires an additional
library. For that reason we shouldn't conditionalize iconv detection on
libiconv.found.
Fixes: 5285e593c33 (configure: Fixes ncursesw detection under msys2/mingw by convert them to meson)
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
meson.build | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index 1a4a482492..84c8ec9541 100644
--- a/meson.build
+++ b/meson.build
@@ -431,15 +431,13 @@ if not get_option('iconv').disabled()
libiconv = cc.find_library('iconv',
required: false,
static: enable_static)
- if libiconv.found()
- if cc.links('''
- #include <iconv.h>
- int main(void) {
- iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
- return conv != (iconv_t) -1;
- }''', dependencies: [libiconv])
- iconv = declare_dependency(dependencies: [libiconv])
- endif
+ if cc.links('''
+ #include <iconv.h>
+ int main(void) {
+ iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
+ return conv != (iconv_t) -1;
+ }''', dependencies: [libiconv])
+ iconv = declare_dependency(dependencies: [libiconv])
endif
endif
if get_option('iconv').enabled() and not iconv.found()
--
2.28.0
On Thu, Oct 15, 2020 at 6:19 AM Bruce Rogers <brogers@suse.com> wrote:
>
> It isn't necessarily the case that use of iconv requires an additional
> library. For that reason we shouldn't conditionalize iconv detection on
> libiconv.found.
>
> Fixes: 5285e593c33 (configure: Fixes ncursesw detection under msys2/mingw
by convert them to meson)
>
> Signed-off-by: Bruce Rogers <brogers@suse.com>
> ---
> meson.build | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 1a4a482492..84c8ec9541 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -431,15 +431,13 @@ if not get_option('iconv').disabled()
> libiconv = cc.find_library('iconv',
> required: false,
> static: enable_static)
> - if libiconv.found()
> - if cc.links('''
> - #include <iconv.h>
> - int main(void) {
> - iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
> - return conv != (iconv_t) -1;
> - }''', dependencies: [libiconv])
> - iconv = declare_dependency(dependencies: [libiconv])
> - endif
> + if cc.links('''
> + #include <iconv.h>
> + int main(void) {
> + iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
> + return conv != (iconv_t) -1;
> + }''', dependencies: [libiconv])
> + iconv = declare_dependency(dependencies: [libiconv])
> endif
> endif
> if get_option('iconv').enabled() and not iconv.found()
> --
> 2.28.0
>
Reviewed-by: Yonggang Luo<l <brogers@suse.com>uoyonggang@gmail.com>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
On 10/15/20 6:33 AM, 罗勇刚(Yonggang Luo) wrote:
>
>
> On Thu, Oct 15, 2020 at 6:19 AM Bruce Rogers <brogers@suse.com
> <mailto:brogers@suse.com>> wrote:
> >
> > It isn't necessarily the case that use of iconv requires an additional
> > library. For that reason we shouldn't conditionalize iconv detection on
> > libiconv.found.
> >
> > Fixes: 5285e593c33 (configure: Fixes ncursesw detection under
> msys2/mingw by convert them to meson)
> >
> > Signed-off-by: Bruce Rogers <brogers@suse.com <mailto:brogers@suse.com>>
> > ---
> > meson.build | 16 +++++++---------
> > 1 file changed, 7 insertions(+), 9 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 1a4a482492..84c8ec9541 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -431,15 +431,13 @@ if not get_option('iconv').disabled()
> > libiconv = cc.find_library('iconv',
> > required: false,
> > static: enable_static)
> > - if libiconv.found()
> > - if cc.links('''
> > - #include <iconv.h>
> > - int main(void) {
> > - iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
> > - return conv != (iconv_t) -1;
> > - }''', dependencies: [libiconv])
> > - iconv = declare_dependency(dependencies: [libiconv])
> > - endif
> > + if cc.links('''
> > + #include <iconv.h>
> > + int main(void) {
> > + iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
> > + return conv != (iconv_t) -1;
> > + }''', dependencies: [libiconv])
> > + iconv = declare_dependency(dependencies: [libiconv])
> > endif
> > endif
> > if get_option('iconv').enabled() and not iconv.found()
> > --
> > 2.28.0
> >
> Reviewed-by: Yonggang Luo<l
> <mailto:brogers@suse.com>uoyonggang@gmail.com <mailto:uoyonggang@gmail.com>>
Something is certainly wrong here =)
I suppose you meant:
Reviewed-by:Yonggang Luo <luoyonggang@gmail.com>
>
> --
> 此致
> 礼
> 罗勇刚
> Yours
> sincerely,
> Yonggang Luo
On 15/10/20 00:19, Bruce Rogers wrote:
> It isn't necessarily the case that use of iconv requires an additional
> library. For that reason we shouldn't conditionalize iconv detection on
> libiconv.found.
>
> Fixes: 5285e593c33 (configure: Fixes ncursesw detection under msys2/mingw by convert them to meson)
>
> Signed-off-by: Bruce Rogers <brogers@suse.com>
> ---
> meson.build | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 1a4a482492..84c8ec9541 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -431,15 +431,13 @@ if not get_option('iconv').disabled()
> libiconv = cc.find_library('iconv',
> required: false,
> static: enable_static)
> - if libiconv.found()
> - if cc.links('''
> - #include <iconv.h>
> - int main(void) {
> - iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
> - return conv != (iconv_t) -1;
> - }''', dependencies: [libiconv])
> - iconv = declare_dependency(dependencies: [libiconv])
> - endif
> + if cc.links('''
> + #include <iconv.h>
> + int main(void) {
> + iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
> + return conv != (iconv_t) -1;
> + }''', dependencies: [libiconv])
> + iconv = declare_dependency(dependencies: [libiconv])
> endif
> endif
> if get_option('iconv').enabled() and not iconv.found()
>
Queued, thanks.
Paolo
© 2016 - 2026 Red Hat, Inc.