aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/Makefile68
-rw-r--r--scripts/kconfig/util.c2
2 files changed, 40 insertions, 30 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 55bf95531f2..3d7f1ac9e00 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -130,8 +130,8 @@ endif
130HOSTCFLAGS_lex.zconf.o := -I$(src) 130HOSTCFLAGS_lex.zconf.o := -I$(src)
131HOSTCFLAGS_zconf.tab.o := -I$(src) 131HOSTCFLAGS_zconf.tab.o := -I$(src)
132 132
133HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(LIBS_QT) -ldl 133HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl
134HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include -D LKC_DIRECT_LINK 134HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
135 135
136HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` 136HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
137HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ 137HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \
@@ -140,40 +140,50 @@ HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \
140$(obj)/qconf.o: $(obj)/.tmp_qtcheck 140$(obj)/qconf.o: $(obj)/.tmp_qtcheck
141 141
142ifeq ($(qconf-target),1) 142ifeq ($(qconf-target),1)
143MOC = $(QTDIR)/bin/moc 143$(obj)/.tmp_qtcheck: $(src)/Makefile
144QTLIBPATH = $(QTDIR)/lib
145-include $(obj)/.tmp_qtcheck 144-include $(obj)/.tmp_qtcheck
146 145
147# QT needs some extra effort... 146# QT needs some extra effort...
148$(obj)/.tmp_qtcheck: 147$(obj)/.tmp_qtcheck:
149 @set -e; for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ 148 @set -e; echo " CHECK qt"; dir=""; pkg=""; \
150 if [ -f $$d/include/qconfig.h ]; then DIR=$$d; break; fi; \ 149 pkg-config --exists qt 2> /dev/null && pkg=qt; \
151 done; \ 150 pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
152 if [ -z "$$DIR" ]; then \ 151 if [ -n "$$pkg" ]; then \
153 echo "*"; \ 152 cflags="\$$(shell pkg-config $$pkg --cflags)"; \
154 echo "* Unable to find the QT installation. Please make sure that the"; \ 153 libs="\$$(shell pkg-config $$pkg --libs)"; \
155 echo "* QT development package is correctly installed and the QTDIR"; \ 154 moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \
156 echo "* environment variable is set to the correct location."; \ 155 dir="$$(pkg-config $$pkg --variable=prefix)"; \
157 echo "*"; \
158 false; \
159 fi; \
160 LIBPATH=$$DIR/lib; LIB=qt; \
161 if [ -f $$QTLIB/libqt-mt.so ] ; then \
162 LIB=qt-mt; \
163 LIBPATH=$$QTLIB; \
164 else \ 156 else \
165 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ 157 for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
166 LIBPATH=$$DIR/lib/$$($(HOSTCXX) -print-multi-os-directory); \ 158 if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
167 if [ -f $$LIBPATH/libqt-mt.so ]; then LIB=qt-mt; fi; \ 159 done; \
160 if [ -z "$$dir" ]; then \
161 echo "*"; \
162 echo "* Unable to find the QT installation. Please make sure that"; \
163 echo "* the QT development package is correctly installed and"; \
164 echo "* either install pkg-config or set the QTDIR environment"; \
165 echo "* variable to the correct location."; \
166 echo "*"; \
167 false; \
168 fi; \
169 libpath=$$dir/lib; lib=qt; osdir=""; \
170 $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
171 osdir=x$$($(HOSTCXX) -print-multi-os-directory); \
172 test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \
173 test -f $$libpath/libqt-mt.so && lib=qt-mt; \
174 cflags="-I$$dir/include"; \
175 libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
176 moc="$$dir/bin/moc"; \
168 fi; \ 177 fi; \
169 echo "QTDIR=$$DIR" > $@; echo "QTLIBPATH=$$LIBPATH" >> $@; \ 178 if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
170 echo "LIBS_QT=$$LIB" >> $@; \
171 if [ ! -x $$DIR/bin/moc -a -x /usr/bin/moc ]; then \
172 echo "*"; \ 179 echo "*"; \
173 echo "* Unable to find $$DIR/bin/moc, using /usr/bin/moc instead."; \ 180 echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
174 echo "*"; \ 181 echo "*"; \
175 echo "MOC=/usr/bin/moc" >> $@; \ 182 moc="/usr/bin/moc"; \
176 fi 183 fi; \
184 echo "KC_QT_CFLAGS=$$cflags" > $@; \
185 echo "KC_QT_LIBS=$$libs" >> $@; \
186 echo "KC_QT_MOC=$$moc" >> $@
177endif 187endif
178 188
179$(obj)/gconf.o: $(obj)/.tmp_gtkcheck 189$(obj)/gconf.o: $(obj)/.tmp_gtkcheck
@@ -211,7 +221,7 @@ $(obj)/qconf.o: $(obj)/qconf.moc $(obj)/lkc_defs.h
211$(obj)/gconf.o: $(obj)/lkc_defs.h 221$(obj)/gconf.o: $(obj)/lkc_defs.h
212 222
213$(obj)/%.moc: $(src)/%.h 223$(obj)/%.moc: $(src)/%.h
214 $(MOC) -i $< -o $@ 224 $(KC_QT_MOC) -i $< -o $@
215 225
216$(obj)/lkc_defs.h: $(src)/lkc_proto.h 226$(obj)/lkc_defs.h: $(src)/lkc_proto.h
217 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' 227 sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index a711007ebe3..656d2c87d66 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -101,7 +101,7 @@ void str_printf(struct gstr *gs, const char *fmt, ...)
101 va_end(ap); 101 va_end(ap);
102} 102}
103 103
104/* Retreive value of growable string */ 104/* Retrieve value of growable string */
105const char *str_get(struct gstr *gs) 105const char *str_get(struct gstr *gs)
106{ 106{
107 return gs->s; 107 return gs->s;