All of lore.kernel.org
 help / color / mirror / Atom feed
From: trini@kernel.crashing.org
To: sam@ravnborg.org
Cc: linux-kernel@vger.kernel.org, trini@kernel.crashing.org
Subject: [patch 3/3]
Date: Fri, 27 Aug 2004 14:53:12 -0700	[thread overview]
Message-ID: <200408272153.OAA28851@av.mvista.com> (raw)


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: Tom Rini <trini@kernel.crashing.org>
---

 linux-2.6-solaris-trini/Makefile                 |    8 ++++----
 linux-2.6-solaris-trini/scripts/Makefile.build   |    6 +++---
 linux-2.6-solaris-trini/scripts/Makefile.modinst |    2 +-
 linux-2.6-solaris-trini/scripts/Makefile.modpost |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff -puN Makefile~shell_commands Makefile
--- linux-2.6-solaris/Makefile~shell_commands	2004-08-27 14:47:07.033077973 -0700
+++ linux-2.6-solaris-trini/Makefile	2004-08-27 14:47:07.042075885 -0700
@@ -673,10 +673,10 @@ $(vmlinux-dirs): prepare-all scripts
 # using a seperate output directory. This allows convinient use
 # of make in output directory
 prepare2:
-	$(Q)if [ ! $(srctree) -ef $(objtree) ]; then       \
-	$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile      \
-	    $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \
-	    > $(objtree)/Makefile;                         \
+	$(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \
+	$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile              \
+	    $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)         \
+	    > $(objtree)/Makefile;                                 \
 	fi
 
 # prepare1 is used to check if we are building in a separate output directory,
diff -puN scripts/Makefile.build~shell_commands scripts/Makefile.build
--- linux-2.6-solaris/scripts/Makefile.build~shell_commands	2004-08-27 14:47:07.035077509 -0700
+++ linux-2.6-solaris-trini/scripts/Makefile.build	2004-08-27 14:47:07.043075653 -0700
@@ -160,9 +160,7 @@ else
 
 cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
 cmd_modversions =							\
-	if ! $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then	\
-		mv $(@D)/.tmp_$(@F) $@;					\
-	else								\
+	if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then	\
 		$(CPP) -D__GENKSYMS__ $(c_flags) $<			\
 		| $(GENKSYMS)						\
 		> $(@D)/.tmp_$(@F:.o=.ver);				\
@@ -170,6 +168,8 @@ cmd_modversions =							\
 		$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) 		\
 			-T $(@D)/.tmp_$(@F:.o=.ver);			\
 		rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver);	\
+	else								\
+		mv $(@D)/.tmp_$(@F) $@;					\
 	fi;
 endif
 
diff -puN scripts/Makefile.modinst~shell_commands scripts/Makefile.modinst
--- linux-2.6-solaris/scripts/Makefile.modinst~shell_commands	2004-08-27 14:47:07.036077277 -0700
+++ linux-2.6-solaris-trini/scripts/Makefile.modinst	2004-08-27 14:47:07.043075653 -0700
@@ -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)))
 
 .PHONY: $(modules)
diff -puN scripts/Makefile.modpost~shell_commands scripts/Makefile.modpost
--- linux-2.6-solaris/scripts/Makefile.modpost~shell_commands	2004-08-27 14:47:07.038076813 -0700
+++ linux-2.6-solaris-trini/scripts/Makefile.modpost	2004-08-27 14:47:07.043075653 -0700
@@ -41,7 +41,7 @@ include scripts/Makefile.lib
 symverfile := $(objtree)/Module.symvers
 
 # 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)))
 
 _modpost: $(modules)
_

             reply	other threads:[~2004-08-27 21:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 21:53 trini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-10-11  9:08 [PATCH][3/3] Zhang, Xiantao
     [not found] ` <42DFA526FC41B1429CE7279EF83C6BDC7AEDD9-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-11  9:32   ` [PATCH][3/3] Zhang, Xiantao
2008-01-06 12:30 [PATCH 3/3] Dmitry Baryshkov
2008-01-06 22:53 ` Anton Vorontsov
2008-01-06 23:12   ` Dmitry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200408272153.OAA28851@av.mvista.com \
    --to=trini@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.