- "grep -q" doesn't exist on solaris (and probably is just a gnu

extension), replaced with >/dev/null
- "test ==" replaced with "test -eq" which does the same, but exists on
  more systems
- use the output of check-lxdialog.sh to link against (n)curses,
  depending on which libraries exist

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Peter Stuge <peter@stuge.se>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@279 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Uwe Hermann 2007-04-13 16:19:46 +00:00
commit 24a6fcaaf8
2 changed files with 10 additions and 6 deletions

View file

@ -15,6 +15,10 @@
# Kernel configuration targets
# These targets are used from top-level makefile
CONFIG_SHELL := sh
check-lxdialog := $(src)/util/kconfig/lxdialog/check-lxdialog.sh
CURSESLIBS := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
xconfig: $(obj)/util/kconfig/.tmp_qtcheck $(obj)/util/kconfig/qconf
@ -98,11 +102,11 @@ gconf-objects := gconf.o kconfig_load.o zconf.tab.o
$(obj)/util/kconfig/mconf: $(patsubst %,$(obj)/util/kconfig/%,$(mconf-objects))
$(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(HOSTCC) -lncurses -o $@ $^
$(Q)$(HOSTCC) $(CURSESLIBS) -o $@ $^
$(obj)/util/kconfig/conf: $(patsubst %,$(obj)/util/kconfig/%,$(conf-objects))
$(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(HOSTCC) -lncurses -o $@ $^
$(Q)$(HOSTCC) $(CURSESLIBS) -o $@ $^
$(obj)/util/kconfig/qconf: $(patsubst %,$(obj)/util/kconfig/%,$(qconf-objects))
$(Q)printf " HOSTCXX $(subst $(shell pwd)/,,$(@))\n"

View file

@ -4,17 +4,17 @@
# What library to link
ldflags()
{
$cc -print-file-name=libncursesw.so | grep -q /
$cc -print-file-name=libncursesw.so | grep / >/dev/null
if [ $? -eq 0 ]; then
echo '-lncursesw'
exit
fi
$cc -print-file-name=libncurses.so | grep -q /
$cc -print-file-name=libncurses.so | grep / >/dev/null
if [ $? -eq 0 ]; then
echo '-lncurses'
exit
fi
$cc -print-file-name=libcurses.so | grep -q /
$cc -print-file-name=libcurses.so | grep / >/dev/null
if [ $? -eq 0 ]; then
echo '-lcurses'
exit
@ -60,7 +60,7 @@ usage() {
printf "Usage: $0 [-check compiler options|-header|-library]\n"
}
if [ $# == 0 ]; then
if [ $# -eq 0 ]; then
usage
exit 1
fi