Skip to contentSkip to conversation

meson.build: don't condition iconv detection on library detection

PATCH Applied Bruce Rogers 4 participants 4 messages Oct 14, 2020 – Oct 15, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson.build: don't condition iconv detection on library detection

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)
---
 meson.build | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
meson.build +7 -9
index 1a4a482492..84c8ec9541 100644
@@ -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()
Signature · 1 line
2.28.0
Reviewed-by Yonggang Luo on v1 1/1
#1 lore raw
Quoted 6 lines · Bruce Rogers

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)

Quoted 34 lines
---
 meson.build | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
meson.build +7 -10
index 1a4a482492..84c8ec9541 100644
@@ -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()
--
Quoted 2 lines

2.28.0

Reviewed-by Yonggang Luo<l <[email protected]>[email protected]>

--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo

Reviewed-by Yonggang Luo
#2 lore raw
Quoted 39 lines · 罗勇刚(Yonggang Luo)
Quoted 6 lines · On Thu, Oct 15, 2020 at 6:19 AM Bruce Rogers <[email protected]…

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)

Quoted 29 lines
Signed-off-by Bruce Rogers <[email protected] <mailto:[email protected]>>

---
 meson.build | 16 +++++++---------

 1 file changed, 7 insertions(+), 9 deletions(-)
meson.build +6 -9
index 1a4a482492..84c8ec9541 100644
@@ -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])
Quoted 8 lines
Quoted 7 lines
meson.build +1 -0
+    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:[email protected]>[email protected] <mailto:[email protected]>>

Something is certainly wrong here =)
I suppose you meant:

Quoted 8 lines

--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

#3 lore raw
In reply to Bruce Rogers
Quoted 29 lines · Bruce Rogers

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)
---
 meson.build | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
meson.build +0 -9
index 1a4a482492..84c8ec9541 100644
@@ -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

meson.build if not get_option('iconv').disabled() · line 443

Quoted 10 lines
meson.build +7 -0
+  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