aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2005-11-22 00:32:38 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-22 12:14:31 -0500
commitb3a5225f31180322fd7d692fd4cf786702826b94 (patch)
tree3ee46454260010cb57280bd85beeb3b63e290392 /scripts/kconfig
parent7692c5dd48026d952199c2b97c3418f927cc0407 (diff)
[PATCH] prefer pkg-config for the QT check
This makes pkg-config now the prefered way to configure QT and properly fixes the recent Fedora breakage and leaves the old QT detection as fallback mechanism. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/Makefile68
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
129HOSTCFLAGS_lex.zconf.o := -I$(src) 129HOSTCFLAGS_lex.zconf.o := -I$(src)
130HOSTCFLAGS_zconf.tab.o := -I$(src) 130HOSTCFLAGS_zconf.tab.o := -I$(src)
131 131
132HOSTLOADLIBES_qconf = -L$(QTLIBPATH) -Wl,-rpath,$(QTLIBPATH) -l$(LIBS_QT) -ldl 132HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl
133HOSTCXXFLAGS_qconf.o = -I$(QTDIR)/include -D LKC_DIRECT_LINK 133HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
134 134
135HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` 135HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs`
136HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ 136HOSTCFLAGS_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
141ifeq ($(qconf-target),1) 141ifeq ($(qconf-target),1)
142MOC = $(QTDIR)/bin/moc 142$(obj)/.tmp_qtcheck: $(src)/Makefile
143QTLIBPATH = $(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" >> $@
176endif 186endif
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)/'