Commit 8a0aa84c authored by Tom Rini's avatar Tom Rini

kbuild: Solaris fixes in various kbuild Makfiles's

Additional Makefile fixes for Solaris 2.8

On Solaris, 'head' doesn't take a -q argument.  But we can use 'grep -h'
instead, so do that in Makefile.mod{inst,post}.  The built-in test to
/bin/sh doesn't like 'if ! cmd' syntax, so when determining if we need
to do modversion stuff, invert the if/else cases.  The built-in test
also doesn't understand -ef, so invoke a real version of test which does.
Signed-off-by: default avatarTom Rini <trini@kernel.crashing.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent b7622cab
...@@ -673,7 +673,7 @@ $(vmlinux-dirs): prepare-all scripts ...@@ -673,7 +673,7 @@ $(vmlinux-dirs): prepare-all scripts
# using a seperate output directory. This allows convinient use # using a seperate output directory. This allows convinient use
# of make in output directory # of make in output directory
prepare2: prepare2:
$(Q)if [ ! $(srctree) -ef $(objtree) ]; then \ $(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \
$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \
> $(objtree)/Makefile; \ > $(objtree)/Makefile; \
......
...@@ -160,9 +160,7 @@ else ...@@ -160,9 +160,7 @@ else
cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
cmd_modversions = \ cmd_modversions = \
if ! $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
mv $(@D)/.tmp_$(@F) $@; \
else \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \ $(CPP) -D__GENKSYMS__ $(c_flags) $< \
| $(GENKSYMS) \ | $(GENKSYMS) \
> $(@D)/.tmp_$(@F:.o=.ver); \ > $(@D)/.tmp_$(@F:.o=.ver); \
...@@ -170,6 +168,8 @@ cmd_modversions = \ ...@@ -170,6 +168,8 @@ cmd_modversions = \
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \ -T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
mv $(@D)/.tmp_$(@F) $@; \
fi; fi;
endif endif
......
...@@ -9,7 +9,7 @@ include scripts/Makefile.lib ...@@ -9,7 +9,7 @@ include scripts/Makefile.lib
# #
__modules := $(sort $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod))) __modules := $(sort $(shell grep -h .ko /dev/null $(wildcard $(MODVERDIR)/*.mod)))
modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
.PHONY: $(modules) .PHONY: $(modules)
......
...@@ -41,7 +41,7 @@ include scripts/Makefile.lib ...@@ -41,7 +41,7 @@ include scripts/Makefile.lib
symverfile := $(objtree)/Module.symvers symverfile := $(objtree)/Module.symvers
# Step 1), find all modules listed in $(MODVERDIR)/ # Step 1), find all modules listed in $(MODVERDIR)/
__modules := $(sort $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod))) __modules := $(sort $(shell grep -h .ko /dev/null $(wildcard $(MODVERDIR)/*.mod)))
modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
_modpost: $(modules) _modpost: $(modules)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment