Skip to contentSkip to conversation

meson: fix ncurses detection on macOS

PATCH In review Chris Hofstaedtler 4 participants 4 messages Dec 30, 2020 – Jan 1, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 meson: fix ncurses detection on macOS

Without this, meson fails with "curses package not usable" when using ncurses 6.2. Apparently the wide functions (addwstr, etc) are hidden behind the extra define, and meson does not define it at that detection stage.

Regression from b01a4fd3bd7d6f2 ("configure: Define NCURSES_WIDECHAR if we're using curses"). The meson conversion has seen many iterations of the curses check, so pinpointing the exact commit breaking this is not so easy.

Cc Peter Maydell <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>
Cc Samuel Thibault <[email protected]>
Cc Yonggang Luo <[email protected]>
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meson.build +3 -3
index 372576f82c..fd74728674 100644
@@ -500,16 +500,16 @@ if have_system and not get_option('curses').disabled()
     endif
   endforeach
   msg = get_option('curses').enabled() ? 'curses library not found' : ''
+  curses_compile_args = ['-DNCURSES_WIDECHAR']
   if curses.found()
-    if cc.links(curses_test, dependencies: [curses])
-      curses = declare_dependency(compile_args: '-DNCURSES_WIDECHAR', dependencies: [curses])
+    if cc.links(curses_test, args: curses_compile_args, dependencies: [curses])
+      curses = declare_dependency(compile_args: curses_compile_args, dependencies: [curses])
     else
       msg = 'curses package not usable'
       curses = not_found
     endif
   endif
   if not curses.found()
-    curses_compile_args = ['-DNCURSES_WIDECHAR']
     has_curses_h = cc.has_header('curses.h', args: curses_compile_args)
     if targetos != 'windows' and not has_curses_h
       message('Trying with /usr/include/ncursesw')
Signature · 1 line
2.29.2
Reviewed-by on v2 1/1
#1 lore raw

Chris Hofstaedtler, le mer. 30 déc. 2020 23:17:27 +0100, a ecrit:

Quoted 8 lines

Without this, meson fails with "curses package not usable" when using ncurses 6.2. Apparently the wide functions (addwstr, etc) are hidden behind the extra define, and meson does not define it at that detection stage.

Regression from b01a4fd3bd7d6f2 ("configure: Define NCURSES_WIDECHAR if we're using curses"). The meson conversion has seen many iterations of the curses check, so pinpointing the exact commit breaking this is not so easy.

Quoted 5 lines
Cc Peter Maydell <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>
Cc Samuel Thibault <[email protected]>
Cc Yonggang Luo <[email protected]>
Quoted 31 lines
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meson.build +3 -3
index 372576f82c..fd74728674 100644
@@ -500,16 +500,16 @@ if have_system and not get_option('curses').disabled()
     endif
   endforeach
   msg = get_option('curses').enabled() ? 'curses library not found' : ''
+  curses_compile_args = ['-DNCURSES_WIDECHAR']
   if curses.found()
-    if cc.links(curses_test, dependencies: [curses])
-      curses = declare_dependency(compile_args: '-DNCURSES_WIDECHAR', dependencies: [curses])
+    if cc.links(curses_test, args: curses_compile_args, dependencies: [curses])
+      curses = declare_dependency(compile_args: curses_compile_args, dependencies: [curses])
     else
       msg = 'curses package not usable'
       curses = not_found
     endif
   endif
   if not curses.found()
-    curses_compile_args = ['-DNCURSES_WIDECHAR']
     has_curses_h = cc.has_header('curses.h', args: curses_compile_args)
     if targetos != 'windows' and not has_curses_h
       message('Trying with /usr/include/ncursesw')
Signature · 1 line
2.29.2
Reviewed-by on v2 1/1
#2 lore raw
In reply to Chris Hofstaedtler
Quoted 2 lines · Chris Hofstaedtler

Without this, meson fails with "curses package not usable" when using

ncurses

Quoted 1 line

6.2. Apparently the wide functions (addwstr, etc) are hidden behind the

extra

Quoted 3 lines

define, and meson does not define it at that detection stage.

Regression from b01a4fd3bd7d6f2 ("configure: Define NCURSES_WIDECHAR if

we're

Quoted 1 line

using curses"). The meson conversion has seen many iterations of the

curses

meson.build if have_system and not

Quoted 16 lines

check, so pinpointing the exact commit breaking this is not so easy.

Cc Peter Maydell <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>
Cc Samuel Thibault <[email protected]>
Cc Yonggang Luo <[email protected]>
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meson.build +0 -0
index 372576f82c..fd74728674 100644
@@ -500,16 +500,16 @@ if have_system and not

get_option('curses').disabled()

meson.build if have_system and not get_option('curses').disabled()

Quoted 7 lines
meson.build +1 -2
     endif
   endforeach
   msg = get_option('curses').enabled() ? 'curses library not found' : ''
+  curses_compile_args = ['-DNCURSES_WIDECHAR']
   if curses.found()
-    if cc.links(curses_test, dependencies: [curses])
-      curses = declare_dependency(compile_args: '-DNCURSES_WIDECHAR',

dependencies: [curses])

meson.build if have_system and not · line 505

Quoted 1 line
meson.build +1 -0
+    if cc.links(curses_test, args: curses_compile_args, dependencies:

[curses])

meson.build if have_system and not · line 506

Quoted 1 line
meson.build +1 -0
+      curses = declare_dependency(compile_args: curses_compile_args,

dependencies: [curses])

Quoted 11 lines
meson.build +0 -2
     else
       msg = 'curses package not usable'
       curses = not_found
     endif
   endif
   if not curses.found()
-    curses_compile_args = ['-DNCURSES_WIDECHAR']
     has_curses_h = cc.has_header('curses.h', args: curses_compile_args)
     if targetos != 'windows' and not has_curses_h
       message('Trying with /usr/include/ncursesw')
--
Quoted 2 lines

2.29.2

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

Reviewed-by on v2 1/1
#3 lore raw
In reply to Chris Hofstaedtler
Quoted 8 lines · Chris Hofstaedtler

Without this, meson fails with "curses package not usable" when using ncurses 6.2. Apparently the wide functions (addwstr, etc) are hidden behind the extra define, and meson does not define it at that detection stage.

Regression from b01a4fd3bd7d6f2 ("configure: Define NCURSES_WIDECHAR if we're using curses"). The meson conversion has seen many iterations of the curses check, so pinpointing the exact commit breaking this is not so easy.

Quoted 8 lines
Cc Peter Maydell <[email protected]>
Cc Philippe Mathieu-Daudé <[email protected]>
Cc Samuel Thibault <[email protected]>
Cc Yonggang Luo <[email protected]>
---
 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)