Final versions of ncurses libs detection patches

2013-03-06 Thread jlec

Hello,

I am sorry for the long delay.
Final versions of the patches which are reduced to the usage of pkg-config. And
if unavailable we use the old code.

Thanks for all suggestions,
Justin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] menuconfig: optionally use pkg-config to detect ncurses libs

2013-03-06 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

The ncurses pkg-config module will be used to detect the necessary libs for
linking. If not available the old heuristic for detection of the ncurses libs
will be used.

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 8078813..782d200 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,6 +4,8 @@
 # What library to link
 ldflags()
 {
+   pkg-config --libs ncursesw 2>/dev/null && exit
+   pkg-config --libs ncurses 2>/dev/null && exit
for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q /
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] kconfig: optionally use pkg-config to detect ncurses libs

2013-03-06 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

The ncurses pkg-config module will be used to detect the necessary libs for
linking. If not available the old way of directly specifying libs will be
used.

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 231b475..e76ae5d 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -219,7 +219,9 @@ HOSTCFLAGS_gconf.o  = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= $(shell \
+   pkg-config --libs menu panel ncurses 
2>/dev/null \
+   || echo "-lmenu -lpanel -ncurses"  )
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] kconfig: optionally use pkg-config to detect ncurses libs

2013-03-06 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

The ncurses pkg-config module will be used to detect the necessary libs for
linking. If not available the old way of directly specifying libs will be
used.

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 231b475..e76ae5d 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -219,7 +219,9 @@ HOSTCFLAGS_gconf.o  = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= $(shell \
+   pkg-config --libs menu panel ncurses 
2/dev/null \
+   || echo -lmenu -lpanel -ncurses  )
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Final versions of ncurses libs detection patches

2013-03-06 Thread jlec

Hello,

I am sorry for the long delay.
Final versions of the patches which are reduced to the usage of pkg-config. And
if unavailable we use the old code.

Thanks for all suggestions,
Justin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] menuconfig: optionally use pkg-config to detect ncurses libs

2013-03-06 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

The ncurses pkg-config module will be used to detect the necessary libs for
linking. If not available the old heuristic for detection of the ncurses libs
will be used.

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 8078813..782d200 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,6 +4,8 @@
 # What library to link
 ldflags()
 {
+   pkg-config --libs ncursesw 2/dev/null  exit
+   pkg-config --libs ncurses 2/dev/null  exit
for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q /
-- 
1.8.1.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] kconfig: use config scripts to detect ncurses libs

2013-03-01 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so. Ncurses provides a config script
(ncurses5-config) or in very recent version even a pkg-config module to assist
finding ncurses.

This patch makes use of it to detect the necessary libs for linking of the
ncurses nconfig dialog

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/Makefile | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 231b475..cc81db5 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -219,7 +219,11 @@ HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= -lmenu -lpanel
+HOSTLOADLIBES_nconf+= $(shell \
+   pkg-config --libs ncurses 2>/dev/null \
+   || ncurses5-config --libs 2>/dev/null \
+   || ncurses6-config --libs 2>/dev/null  )
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] menuconfig: use config scripts to detect ncurses libs

2013-03-01 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so. Ncurses provides a config script
(ncurses5-config) or in very recent version even a pkg-config module to assist
finding ncurses.

The old heuristic for detection of ncurses libs will be extended to the
pkg-config and the config scripts.

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 8078813..8086874 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,6 +4,12 @@
 # What library to link
 ldflags()
 {
+   pkg-config --libs ncursesw 2>/dev/null && exit
+   pkg-config --libs ncurses 2>/dev/null && exit
+   ncursesw5-config --libs 2>/dev/null && exit
+   ncurses5-config --libs 2>/dev/null && exit
+   ncursesw6-config --libs 2>/dev/null && exit
+   ncurses6-config --libs 2>/dev/null && exit
for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q /
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


ncurses detection for nconfig/menuconfig patches revised

2013-03-01 Thread jlec

Hello,

After the discussion I modified the patches to respect following things

1. Don't remove the legacy detection
2. use helpers in following order: 
pkg-config, ncurses5-config, ncurses6-config, old heuristic
3. only support the wide char implementation for menuconfig


Regards,
justin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


ncurses detection for nconfig/menuconfig patches revised

2013-03-01 Thread jlec

Hello,

After the discussion I modified the patches to respect following things

1. Don't remove the legacy detection
2. use helpers in following order: 
pkg-config, ncurses5-config, ncurses6-config, old heuristic
3. only support the wide char implementation for menuconfig


Regards,
justin

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] menuconfig: use config scripts to detect ncurses libs

2013-03-01 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so. Ncurses provides a config script
(ncurses5-config) or in very recent version even a pkg-config module to assist
finding ncurses.

The old heuristic for detection of ncurses libs will be extended to the
pkg-config and the config scripts.

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 8078813..8086874 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,6 +4,12 @@
 # What library to link
 ldflags()
 {
+   pkg-config --libs ncursesw 2/dev/null  exit
+   pkg-config --libs ncurses 2/dev/null  exit
+   ncursesw5-config --libs 2/dev/null  exit
+   ncurses5-config --libs 2/dev/null  exit
+   ncursesw6-config --libs 2/dev/null  exit
+   ncurses6-config --libs 2/dev/null  exit
for ext in so a dll.a dylib ; do
for lib in ncursesw ncurses curses ; do
$cc -print-file-name=lib${lib}.${ext} | grep -q /
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] kconfig: use config scripts to detect ncurses libs

2013-03-01 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so. Ncurses provides a config script
(ncurses5-config) or in very recent version even a pkg-config module to assist
finding ncurses.

This patch makes use of it to detect the necessary libs for linking of the
ncurses nconfig dialog

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/Makefile | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 231b475..cc81db5 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -219,7 +219,11 @@ HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= -lmenu -lpanel
+HOSTLOADLIBES_nconf+= $(shell \
+   pkg-config --libs ncurses 2/dev/null \
+   || ncurses5-config --libs 2/dev/null \
+   || ncurses6-config --libs 2/dev/null  )
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] menuconfig: use config scripts to detect ncurses libs

2013-02-28 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so. Ncurses provides a config script
(ncurses5-config) to assist finding ncurses.

This patch replaces the old heuristic for detection of ncurses libs for
linking the ncurses menuconfig dialog by the use of the config scripts.
This results in the requirement of ncurses version 5.6 or newer for menuconfig.

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index c8e8a71..10df55b 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,15 +4,8 @@
 # What library to link
 ldflags()
 {
-   for ext in so a dll.a dylib ; do
-   for lib in ncursesw ncurses curses ; do
-   $cc -print-file-name=lib${lib}.${ext} | grep -q /
-   if [ $? -eq 0 ]; then
-   echo "-l${lib}"
-   exit
-   fi
-   done
-   done
+   ncursesw5-config --libs 2>/dev/null && exit
+   ncurses5-config --libs 2>/dev/null && exit
exit 1
 }
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] kconfig: use config scripts to detect ncurses libs

2013-02-28 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

Ncurses provides a config script (ncurses5-config) to assist finding ncurses.
This patch makes use of it to detect the necessary libs for linking of the
ncurses nconfig dialog.

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3091794..c372976 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -216,7 +216,9 @@ HOSTCFLAGS_gconf.o  = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= -lmenu -lpanel
+HOSTLOADLIBES_nconf+= $(shellncursesw5-config --libs 2>/dev/null \
+  || ncurses5-config --libs 2>/dev/null  )
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] kconfig: use config scripts to detect ncurses libs

2013-02-28 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

Ncurses provides a config script (ncurses5-config) to assist finding ncurses.
This patch makes use of it to detect the necessary libs for linking of the
ncurses nconfig dialog.

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3091794..c372976 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -216,7 +216,9 @@ HOSTCFLAGS_gconf.o  = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= -lmenu -lpanel
+HOSTLOADLIBES_nconf+= $(shellncursesw5-config --libs 2/dev/null \
+  || ncurses5-config --libs 2/dev/null  )
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] menuconfig: use config scripts to detect ncurses libs

2013-02-28 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so. Ncurses provides a config script
(ncurses5-config) to assist finding ncurses.

This patch replaces the old heuristic for detection of ncurses libs for
linking the ncurses menuconfig dialog by the use of the config scripts.
This results in the requirement of ncurses version 5.6 or newer for menuconfig.

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index c8e8a71..10df55b 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,15 +4,8 @@
 # What library to link
 ldflags()
 {
-   for ext in so a dll.a dylib ; do
-   for lib in ncursesw ncurses curses ; do
-   $cc -print-file-name=lib${lib}.${ext} | grep -q /
-   if [ $? -eq 0 ]; then
-   echo -l${lib}
-   exit
-   fi
-   done
-   done
+   ncursesw5-config --libs 2/dev/null  exit
+   ncurses5-config --libs 2/dev/null  exit
exit 1
 }
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] Use config scripts to detect ncurses libs for menuconfig

2013-02-27 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

Ncurses provides a config script (ncurses5-config) to assist finding ncurses.
This patch makes use of it to detect the necessary libs for linking of the
ncurses menuconfig dialog.

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 24 
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index c8e8a71..e429207 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,15 +4,23 @@
 # What library to link
 ldflags()
 {
-   for ext in so a dll.a dylib ; do
-   for lib in ncursesw ncurses curses ; do
-   $cc -print-file-name=lib${lib}.${ext} | grep -q /
-   if [ $? -eq 0 ]; then
-   echo "-l${lib}"
-   exit
-   fi
+   if ncursesw5-config --libs >/dev/null 2>&1; then
+   ncursesw5-config --libs
+   exit
+   elif ncurses5-config --libs >/dev/null 2>&1; then
+   ncurses5-config --libs
+   exit
+   else
+   for ext in so a dll.a dylib ; do
+   for lib in ncursesw ncurses curses ; do
+   $cc -print-file-name=lib${lib}.${ext} | grep -q 
/
+   if [ $? -eq 0 ]; then
+   echo "-l${lib}"
+   exit
+   fi
+   done
done
-   done
+   fi
exit 1
 }
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] Use config scripts to detect ncurses libs for nconfig

2013-02-27 Thread jlec
From: Justin Lecher 

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

Ncurses provides a config script (ncurses5-config) to assist finding ncurses.
This patch makes use of it to detect the necessary libs for linking of the
ncurses nconfig dialog.

Signed-off-by: Justin Lecher 
---
 scripts/kconfig/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3091794..7ddbf98 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -216,7 +216,7 @@ HOSTCFLAGS_gconf.o  = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= -lmenu -lpanel `ncursesw5-config --libs 2>/dev/null 
|| ncurses5-config --libs 2>/dev/null`
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] Use config scripts to detect ncurses libs for nconfig

2013-02-27 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

Ncurses provides a config script (ncurses5-config) to assist finding ncurses.
This patch makes use of it to detect the necessary libs for linking of the
ncurses nconfig dialog.

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3091794..7ddbf98 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -216,7 +216,7 @@ HOSTCFLAGS_gconf.o  = `pkg-config --cflags gtk+-2.0 
gmodule-2.0 libglade-2.0` \
 
 HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags 
$(HOSTCC))
 
-HOSTLOADLIBES_nconf= -lmenu -lpanel -lncurses
+HOSTLOADLIBES_nconf= -lmenu -lpanel `ncursesw5-config --libs 2/dev/null 
|| ncurses5-config --libs 2/dev/null`
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] Use config scripts to detect ncurses libs for menuconfig

2013-02-27 Thread jlec
From: Justin Lecher j...@gentoo.org

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

Ncurses provides a config script (ncurses5-config) to assist finding ncurses.
This patch makes use of it to detect the necessary libs for linking of the
ncurses menuconfig dialog.

Signed-off-by: Justin Lecher j...@gentoo.org
---
 scripts/kconfig/lxdialog/check-lxdialog.sh | 24 
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh 
b/scripts/kconfig/lxdialog/check-lxdialog.sh
index c8e8a71..e429207 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -4,15 +4,23 @@
 # What library to link
 ldflags()
 {
-   for ext in so a dll.a dylib ; do
-   for lib in ncursesw ncurses curses ; do
-   $cc -print-file-name=lib${lib}.${ext} | grep -q /
-   if [ $? -eq 0 ]; then
-   echo -l${lib}
-   exit
-   fi
+   if ncursesw5-config --libs /dev/null 21; then
+   ncursesw5-config --libs
+   exit
+   elif ncurses5-config --libs /dev/null 21; then
+   ncurses5-config --libs
+   exit
+   else
+   for ext in so a dll.a dylib ; do
+   for lib in ncursesw ncurses curses ; do
+   $cc -print-file-name=lib${lib}.${ext} | grep -q 
/
+   if [ $? -eq 0 ]; then
+   echo -l${lib}
+   exit
+   fi
+   done
done
-   done
+   fi
exit 1
 }
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/