diff options
Diffstat (limited to 'scripts/kconfig/Makefile')
-rw-r--r-- | scripts/kconfig/Makefile | 164 |
1 files changed, 87 insertions, 77 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7ea649da1940..368ae306aee4 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -8,7 +8,7 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-c | |||
8 | ifdef KBUILD_KCONFIG | 8 | ifdef KBUILD_KCONFIG |
9 | Kconfig := $(KBUILD_KCONFIG) | 9 | Kconfig := $(KBUILD_KCONFIG) |
10 | else | 10 | else |
11 | Kconfig := arch/$(SRCARCH)/Kconfig | 11 | Kconfig := Kconfig |
12 | endif | 12 | endif |
13 | 13 | ||
14 | xconfig: $(obj)/qconf | 14 | xconfig: $(obj)/qconf |
@@ -21,17 +21,17 @@ menuconfig: $(obj)/mconf | |||
21 | $< $(Kconfig) | 21 | $< $(Kconfig) |
22 | 22 | ||
23 | config: $(obj)/conf | 23 | config: $(obj)/conf |
24 | $< $(Kconfig) | 24 | $< --oldaskconfig $(Kconfig) |
25 | 25 | ||
26 | nconfig: $(obj)/nconf | 26 | nconfig: $(obj)/nconf |
27 | $< $(Kconfig) | 27 | $< $(Kconfig) |
28 | 28 | ||
29 | oldconfig: $(obj)/conf | 29 | oldconfig: $(obj)/conf |
30 | $< -o $(Kconfig) | 30 | $< --$@ $(Kconfig) |
31 | 31 | ||
32 | silentoldconfig: $(obj)/conf | 32 | silentoldconfig: $(obj)/conf |
33 | $(Q)mkdir -p include/generated | 33 | $(Q)mkdir -p include/generated |
34 | $< -s $(Kconfig) | 34 | $< --$@ $(Kconfig) |
35 | 35 | ||
36 | # if no path is given, then use src directory to find file | 36 | # if no path is given, then use src directory to find file |
37 | ifdef LSMOD | 37 | ifdef LSMOD |
@@ -44,15 +44,15 @@ endif | |||
44 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf | 44 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
45 | $(Q)mkdir -p include/generated | 45 | $(Q)mkdir -p include/generated |
46 | $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config | 46 | $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config |
47 | $(Q)if [ -f .config ]; then \ | 47 | $(Q)if [ -f .config ]; then \ |
48 | cmp -s .tmp.config .config || \ | 48 | cmp -s .tmp.config .config || \ |
49 | (mv -f .config .config.old.1; \ | 49 | (mv -f .config .config.old.1; \ |
50 | mv -f .tmp.config .config; \ | 50 | mv -f .tmp.config .config; \ |
51 | $(obj)/conf -s $(Kconfig); \ | 51 | $(obj)/conf --silentoldconfig $(Kconfig); \ |
52 | mv -f .config.old.1 .config.old) \ | 52 | mv -f .config.old.1 .config.old) \ |
53 | else \ | 53 | else \ |
54 | mv -f .tmp.config .config; \ | 54 | mv -f .tmp.config .config; \ |
55 | $(obj)/conf -s $(Kconfig); \ | 55 | $(obj)/conf --silentoldconfig $(Kconfig); \ |
56 | fi | 56 | fi |
57 | $(Q)rm -f .tmp.config | 57 | $(Q)rm -f .tmp.config |
58 | 58 | ||
@@ -60,15 +60,15 @@ localyesconfig: $(obj)/streamline_config.pl $(obj)/conf | |||
60 | $(Q)mkdir -p include/generated | 60 | $(Q)mkdir -p include/generated |
61 | $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config | 61 | $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config |
62 | $(Q)sed -i s/=m/=y/ .tmp.config | 62 | $(Q)sed -i s/=m/=y/ .tmp.config |
63 | $(Q)if [ -f .config ]; then \ | 63 | $(Q)if [ -f .config ]; then \ |
64 | cmp -s .tmp.config .config || \ | 64 | cmp -s .tmp.config .config || \ |
65 | (mv -f .config .config.old.1; \ | 65 | (mv -f .config .config.old.1; \ |
66 | mv -f .tmp.config .config; \ | 66 | mv -f .tmp.config .config; \ |
67 | $(obj)/conf -s $(Kconfig); \ | 67 | $(obj)/conf --silentoldconfig $(Kconfig); \ |
68 | mv -f .config.old.1 .config.old) \ | 68 | mv -f .config.old.1 .config.old) \ |
69 | else \ | 69 | else \ |
70 | mv -f .tmp.config .config; \ | 70 | mv -f .tmp.config .config; \ |
71 | $(obj)/conf -s $(Kconfig); \ | 71 | $(obj)/conf --silentoldconfig $(Kconfig); \ |
72 | fi | 72 | fi |
73 | $(Q)rm -f .tmp.config | 73 | $(Q)rm -f .tmp.config |
74 | 74 | ||
@@ -95,30 +95,29 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h | |||
95 | $(Q)rm -f arch/um/Kconfig.arch | 95 | $(Q)rm -f arch/um/Kconfig.arch |
96 | $(Q)rm -f $(obj)/config.pot | 96 | $(Q)rm -f $(obj)/config.pot |
97 | 97 | ||
98 | PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig | 98 | PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig |
99 | 99 | ||
100 | randconfig: $(obj)/conf | 100 | allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf |
101 | $< -r $(Kconfig) | 101 | $< --$@ $(Kconfig) |
102 | 102 | ||
103 | allyesconfig: $(obj)/conf | 103 | PHONY += listnewconfig oldnoconfig savedefconfig defconfig |
104 | $< -y $(Kconfig) | ||
105 | 104 | ||
106 | allnoconfig: $(obj)/conf | 105 | listnewconfig oldnoconfig: $(obj)/conf |
107 | $< -n $(Kconfig) | 106 | $< --$@ $(Kconfig) |
108 | 107 | ||
109 | allmodconfig: $(obj)/conf | 108 | savedefconfig: $(obj)/conf |
110 | $< -m $(Kconfig) | 109 | $< --$@=defconfig $(Kconfig) |
111 | 110 | ||
112 | defconfig: $(obj)/conf | 111 | defconfig: $(obj)/conf |
113 | ifeq ($(KBUILD_DEFCONFIG),) | 112 | ifeq ($(KBUILD_DEFCONFIG),) |
114 | $< -d $(Kconfig) | 113 | $< --defconfig $(Kconfig) |
115 | else | 114 | else |
116 | @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" | 115 | @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" |
117 | $(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) | 116 | $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) |
118 | endif | 117 | endif |
119 | 118 | ||
120 | %_defconfig: $(obj)/conf | 119 | %_defconfig: $(obj)/conf |
121 | $(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig) | 120 | $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) |
122 | 121 | ||
123 | # Help text used by make help | 122 | # Help text used by make help |
124 | help: | 123 | help: |
@@ -131,22 +130,23 @@ help: | |||
131 | @echo ' localmodconfig - Update current config disabling modules not loaded' | 130 | @echo ' localmodconfig - Update current config disabling modules not loaded' |
132 | @echo ' localyesconfig - Update current config converting local mods to core' | 131 | @echo ' localyesconfig - Update current config converting local mods to core' |
133 | @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' | 132 | @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' |
134 | @echo ' randconfig - New config with random answer to all options' | 133 | @echo ' defconfig - New config with default from ARCH supplied defconfig' |
135 | @echo ' defconfig - New config with default answer to all options' | 134 | @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' |
136 | @echo ' allmodconfig - New config selecting modules when possible' | ||
137 | @echo ' allyesconfig - New config where all options are accepted with yes' | ||
138 | @echo ' allnoconfig - New config where all options are answered with no' | 135 | @echo ' allnoconfig - New config where all options are answered with no' |
136 | @echo ' allyesconfig - New config where all options are accepted with yes' | ||
137 | @echo ' allmodconfig - New config selecting modules when possible' | ||
138 | @echo ' alldefconfig - New config with all symbols set to default' | ||
139 | @echo ' randconfig - New config with random answer to all options' | ||
140 | @echo ' listnewconfig - List new options' | ||
141 | @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' | ||
139 | 142 | ||
140 | # lxdialog stuff | 143 | # lxdialog stuff |
141 | check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh | 144 | check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh |
142 | 145 | ||
143 | # Use recursively expanded variables so we do not call gcc unless | 146 | # Use recursively expanded variables so we do not call gcc unless |
144 | # we really need to do so. (Do not call gcc as part of make mrproper) | 147 | # we really need to do so. (Do not call gcc as part of make mrproper) |
145 | HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) | 148 | HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ |
146 | HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) | 149 | -DLOCALE |
147 | |||
148 | HOST_EXTRACFLAGS += -DLOCALE | ||
149 | |||
150 | 150 | ||
151 | # =========================================================================== | 151 | # =========================================================================== |
152 | # Shared Makefile for the various kconfig executables: | 152 | # Shared Makefile for the various kconfig executables: |
@@ -205,7 +205,7 @@ clean-files += config.pot linux.pot | |||
205 | PHONY += $(obj)/dochecklxdialog | 205 | PHONY += $(obj)/dochecklxdialog |
206 | $(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog | 206 | $(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog |
207 | $(obj)/dochecklxdialog: | 207 | $(obj)/dochecklxdialog: |
208 | $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) | 208 | $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf) |
209 | 209 | ||
210 | always := dochecklxdialog | 210 | always := dochecklxdialog |
211 | 211 | ||
@@ -223,6 +223,8 @@ HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl | |||
223 | HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ | 223 | HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ |
224 | -D LKC_DIRECT_LINK | 224 | -D LKC_DIRECT_LINK |
225 | 225 | ||
226 | HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) | ||
227 | |||
226 | HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses | 228 | HOSTLOADLIBES_nconf = -lmenu -lpanel -lncurses |
227 | $(obj)/qconf.o: $(obj)/.tmp_qtcheck | 229 | $(obj)/qconf.o: $(obj)/.tmp_qtcheck |
228 | 230 | ||
@@ -233,40 +235,48 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile | |||
233 | # QT needs some extra effort... | 235 | # QT needs some extra effort... |
234 | $(obj)/.tmp_qtcheck: | 236 | $(obj)/.tmp_qtcheck: |
235 | @set -e; echo " CHECK qt"; dir=""; pkg=""; \ | 237 | @set -e; echo " CHECK qt"; dir=""; pkg=""; \ |
236 | pkg-config --exists qt 2> /dev/null && pkg=qt; \ | 238 | if ! pkg-config --exists QtCore 2> /dev/null; then \ |
237 | pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ | 239 | echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \ |
238 | if [ -n "$$pkg" ]; then \ | 240 | pkg-config --exists qt 2> /dev/null && pkg=qt; \ |
239 | cflags="\$$(shell pkg-config $$pkg --cflags)"; \ | 241 | pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \ |
240 | libs="\$$(shell pkg-config $$pkg --libs)"; \ | 242 | if [ -n "$$pkg" ]; then \ |
241 | moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ | 243 | cflags="\$$(shell pkg-config $$pkg --cflags)"; \ |
242 | dir="$$(pkg-config $$pkg --variable=prefix)"; \ | 244 | libs="\$$(shell pkg-config $$pkg --libs)"; \ |
245 | moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \ | ||
246 | dir="$$(pkg-config $$pkg --variable=prefix)"; \ | ||
247 | else \ | ||
248 | for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ | ||
249 | if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ | ||
250 | done; \ | ||
251 | if [ -z "$$dir" ]; then \ | ||
252 | echo "*"; \ | ||
253 | echo "* Unable to find any QT installation. Please make sure that"; \ | ||
254 | echo "* the QT4 or QT3 development package is correctly installed and"; \ | ||
255 | echo "* either qmake can be found or install pkg-config or set"; \ | ||
256 | echo "* the QTDIR environment variable to the correct location."; \ | ||
257 | echo "*"; \ | ||
258 | false; \ | ||
259 | fi; \ | ||
260 | libpath=$$dir/lib; lib=qt; osdir=""; \ | ||
261 | $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ | ||
262 | osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ | ||
263 | test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ | ||
264 | test -f $$libpath/libqt-mt.so && lib=qt-mt; \ | ||
265 | cflags="-I$$dir/include"; \ | ||
266 | libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ | ||
267 | moc="$$dir/bin/moc"; \ | ||
268 | fi; \ | ||
269 | if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ | ||
270 | echo "*"; \ | ||
271 | echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ | ||
272 | echo "*"; \ | ||
273 | moc="/usr/bin/moc"; \ | ||
274 | fi; \ | ||
243 | else \ | 275 | else \ |
244 | for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \ | 276 | cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ |
245 | if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ | 277 | libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ |
246 | done; \ | 278 | binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ |
247 | if [ -z "$$dir" ]; then \ | 279 | moc="$$binpath/bin/moc"; \ |
248 | echo "*"; \ | ||
249 | echo "* Unable to find the QT3 installation. Please make sure that"; \ | ||
250 | echo "* the QT3 development package is correctly installed and"; \ | ||
251 | echo "* either install pkg-config or set the QTDIR environment"; \ | ||
252 | echo "* variable to the correct location."; \ | ||
253 | echo "*"; \ | ||
254 | false; \ | ||
255 | fi; \ | ||
256 | libpath=$$dir/lib; lib=qt; osdir=""; \ | ||
257 | $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \ | ||
258 | osdir=x$$($(HOSTCXX) -print-multi-os-directory); \ | ||
259 | test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \ | ||
260 | test -f $$libpath/libqt-mt.so && lib=qt-mt; \ | ||
261 | cflags="-I$$dir/include"; \ | ||
262 | libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \ | ||
263 | moc="$$dir/bin/moc"; \ | ||
264 | fi; \ | ||
265 | if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \ | ||
266 | echo "*"; \ | ||
267 | echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \ | ||
268 | echo "*"; \ | ||
269 | moc="/usr/bin/moc"; \ | ||
270 | fi; \ | 280 | fi; \ |
271 | echo "KC_QT_CFLAGS=$$cflags" > $@; \ | 281 | echo "KC_QT_CFLAGS=$$cflags" > $@; \ |
272 | echo "KC_QT_LIBS=$$libs" >> $@; \ | 282 | echo "KC_QT_LIBS=$$libs" >> $@; \ |