Skip to contentSkip to conversation

configure: Detect native NetBSD curses(3)

PATCH Applied Kamil Rytarowski 4 participants 6 messages Apr 26, 2017 – May 23, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Detect native NetBSD curses(3)

NetBSD ships with traditional BSD curses with compatibility with ncurses. qemu works nicely with the basesystem version of curses(3) from NetBSD.

The only mismatch between curses(3) and ncurses is the lack of curses_version() in the NetBSD version. This function is used solely in the configure script, therefore eliminate it from the curses(3) detection.

With this change applied, configure detects correctly curses frontend.

---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
configure +1 -2
index c35acf1192..17dc7224f7 100755
@@ -3034,14 +3034,13 @@ if test "$curses" != "no" ; then
 #include <curses.h>
 #include <wchar.h>
 int main(void) {
-  const char *s = curses_version();
   wchar_t wch = L'w';
   setlocale(LC_ALL, "");
   resize_term(0, 0);
   addwstr(L"wide chars\n");
   addnwstr(&wch, 1);
   add_wch(WACS_DEGREE);
-  return s != 0;
+  return 0;
 }
 EOF
   IFS=:
Signature · 1 line
2.12.2
#1 lore raw

x1 ping

Quoted 35 lines · Kamil Rytarowski

NetBSD ships with traditional BSD curses with compatibility with ncurses. qemu works nicely with the basesystem version of curses(3) from NetBSD.

The only mismatch between curses(3) and ncurses is the lack of curses_version() in the NetBSD version. This function is used solely in the configure script, therefore eliminate it from the curses(3) detection.

With this change applied, configure detects correctly curses frontend.

---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
configure +1 -2
index c35acf1192..17dc7224f7 100755
@@ -3034,14 +3034,13 @@ if test "$curses" != "no" ; then
 #include <curses.h>
 #include <wchar.h>
 int main(void) {
-  const char *s = curses_version();
   wchar_t wch = L'w';
   setlocale(LC_ALL, "");
   resize_term(0, 0);
   addwstr(L"wide chars\n");
   addnwstr(&wch, 1);
   add_wch(WACS_DEGREE);
-  return s != 0;
+  return 0;
 }
 EOF
   IFS=:
Reviewed-by on v1 1/1
#2 lore raw
In reply to Kamil Rytarowski
Quoted 10 lines · Kamil Rytarowski

NetBSD ships with traditional BSD curses with compatibility with ncurses. qemu works nicely with the basesystem version of curses(3) from NetBSD.

The only mismatch between curses(3) and ncurses is the lack of curses_version() in the NetBSD version. This function is used solely in the configure script, therefore eliminate it from the curses(3) detection.

With this change applied, configure detects correctly curses frontend.

Quoted 14 lines
---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
configure +0 -1
index c35acf1192..17dc7224f7 100755
@@ -3034,14 +3034,13 @@ if test "$curses" != "no" ; then
 #include <curses.h>
 #include <wchar.h>
 int main(void) {
-  const char *s = curses_version();
   wchar_t wch = L'w';

configure if test "$curses" != "no" ; then · line 3046

Quoted 10 lines
configure +1 -1
   setlocale(LC_ALL, "");
   resize_term(0, 0);
   addwstr(L"wide chars\n");
   addnwstr(&wch, 1);
   add_wch(WACS_DEGREE);
-  return s != 0;
+  return 0;
 }
 EOF
   IFS=:

--
Alex Bennée

#3 lore raw

Ping? Could someone please put it on the pull-request?

Adding qemu-trivial@.

Quoted 45 lines · Alex Bennée
Quoted 10 lines · Kamil Rytarowski

NetBSD ships with traditional BSD curses with compatibility with ncurses. qemu works nicely with the basesystem version of curses(3) from NetBSD.

The only mismatch between curses(3) and ncurses is the lack of curses_version() in the NetBSD version. This function is used solely in the configure script, therefore eliminate it from the curses(3) detection.

With this change applied, configure detects correctly curses frontend.

Quoted 14 lines
---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
configure +0 -1
index c35acf1192..17dc7224f7 100755
@@ -3034,14 +3034,13 @@ if test "$curses" != "no" ; then
 #include <curses.h>
 #include <wchar.h>
 int main(void) {
-  const char *s = curses_version();
   wchar_t wch = L'w';

configure if test "$curses" != "no" ; then · line 3046

Quoted 10 lines
configure +1 -1
   setlocale(LC_ALL, "");
   resize_term(0, 0);
   addwstr(L"wide chars\n");
   addnwstr(&wch, 1);
   add_wch(WACS_DEGREE);
-  return s != 0;
+  return 0;
 }
 EOF
   IFS=:

--
Alex Bennée

Reviewed-by on v1 1/1
#4 lore raw
In reply to Kamil Rytarowski

Hi Kamil,

Quoted 19 lines · Kamil Rytarowski

NetBSD ships with traditional BSD curses with compatibility with ncurses. qemu works nicely with the basesystem version of curses(3) from NetBSD.

The only mismatch between curses(3) and ncurses is the lack of curses_version() in the NetBSD version. This function is used solely in the configure script, therefore eliminate it from the curses(3) detection.

With this change applied, configure detects correctly curses frontend.

---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
configure +0 -0
index c35acf1192..17dc7224f7 100755

configure if test "$curses" != "no" ; then · line 3034

Quoted 1 line
configure +0 -0
@@ -3034,14 +3034,13 @@ if test "$curses" != "no" ; then
 #include <curses.h>

This checks if the <curses.h> include in present,

configure if test "$curses" != "no" ; then · line 3037

Quoted 3 lines
configure +0 -1
 #include <wchar.h>
 int main(void) {
-  const char *s = curses_version();

This however checks if the library is present, trying to link it.

configure if test "$curses" != "no" ; then · line 3042

Quoted 6 lines
configure +0 -0
   wchar_t wch = L'w';
   setlocale(LC_ALL, "");
   resize_term(0, 0);
   addwstr(L"wide chars\n");
   addnwstr(&wch, 1);
   add_wch(WACS_DEGREE);

Those 3 functions also belong to the libcurse, so the link is still checked, and this patch looks good to me.

Quoted 6 lines
configure +1 -1
-  return s != 0;
+  return 0;
 }
 EOF
   IFS=:
#5 lore raw
In reply to Kamil Rytarowski
Quoted 8 lines · Kamil Rytarowski

NetBSD ships with traditional BSD curses with compatibility with ncurses. qemu works nicely with the basesystem version of curses(3) from NetBSD.

The only mismatch between curses(3) and ncurses is the lack of curses_version() in the NetBSD version. This function is used solely in the configure script, therefore eliminate it from the curses(3) detection.

With this change applied, configure detects correctly curses frontend.

Applied to -trivial, thanks!

/mjt