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