This patch takes changes from newer kconfig and tweaks the local kconfig
Makefile so that it builds properly on systems that lack gettext/libintl (like
OS X).

Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
---
--- config/kconfig/check.sh
+++ 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
+
--- config/kconfig/lxdialog/check-lxdialog.sh
+++ 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
 }
 
--- config/kconfig/Makefile
+++ 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
 qconfig-objs := conf.o kconfig_load.o kxgettext.o zconf.tab.o qconf.o
_______________________________________________
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

Reply via email to