[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    [uClinux-dev] [PATCH] kconfig: dynamic support for system libs
From:       Mike Frysinger <vapier () gentoo ! org>
Date:       2008-09-29 3:53:14
Message-ID: 1222660394-22404-1-git-send-email-vapier () gentoo ! org
[Download RAW message or body]

These are a few fixes from upstream kconfig to get ncurses/gettext support
rolling on non-Linux systems (like Darwin or uClibc w/out locale).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 config/kconfig/Makefile                   |    4 +++-
 config/kconfig/check.sh                   |   14 ++++++++++++++
 config/kconfig/lxdialog/check-lxdialog.sh |   24 +++++++++---------------
 3 files changed, 26 insertions(+), 16 deletions(-)
 create mode 100755 config/kconfig/check.sh

diff --git a/config/kconfig/Makefile b/config/kconfig/Makefile
index e2d1c21..4ffb09e 100644
--- a/config/kconfig/Makefile
+++ b/config/kconfig/Makefile
@@ -4,11 +4,13 @@
 
 CC = cc
 
-# lxdialog peices needed locally
+# lxdialog pieces needed locally
 check-lxdialog := lxdialog/check-lxdialog.sh
 CFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
 LDLIBS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(CC))
 
+CPPFLAGS += $(shell $(CONFIG_SHELL) ./check.sh $(CC) $(CFLAGS) $(LDLIBS))
+
 conf-objs := conf.o zconf.tab.o
 mconf-objs := mconf.o zconf.tab.o
 gconf-objs := gconf.o kconfig_load.o zconf.tab.o
diff --git a/config/kconfig/check.sh b/config/kconfig/check.sh
new file mode 100755
index 0000000..fa59cbf
--- /dev/null
+++ b/config/kconfig/check.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Needed for systems without gettext
+$* -xc -o /dev/null - > /dev/null 2>&1 << EOF
+#include <libintl.h>
+int main()
+{
+	gettext("");
+	return 0;
+}
+EOF
+if [ ! "$?" -eq "0"  ]; then
+	echo -DKBUILD_NO_NLS;
+fi
+
diff --git a/config/kconfig/lxdialog/check-lxdialog.sh b/config/kconfig/lxdialog/check-lxdialog.sh
index 120d624..cdca738 100644
--- a/config/kconfig/lxdialog/check-lxdialog.sh
+++ b/config/kconfig/lxdialog/check-lxdialog.sh
@@ -4,21 +4,15 @@
 # What library to link
 ldflags()
 {
-	$cc -print-file-name=libncursesw.so | grep -q /
-	if [ $? -eq 0 ]; then
-		echo '-lncursesw'
-		exit
-	fi
-	$cc -print-file-name=libncurses.so | grep -q /
-	if [ $? -eq 0 ]; then
-		echo '-lncurses'
-		exit
-	fi
-	$cc -print-file-name=libcurses.so | grep -q /
-	if [ $? -eq 0 ]; then
-		echo '-lcurses'
-		exit
-	fi
+	for ext in so 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
 	exit 1
 }
 
-- 
1.6.0.1

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic