Hello Randy!

On Wednesday 19 September 2007 Randy Dunlap wrote:
> Yes, I've tried to coerce the top-level Makefile into honoring/using
> the include/asm symlink if it exists, i.e., taking ARCH from
> readlink include/asm && sed -e 's/include-asm//', but sadly my
> makefile foo was not good enough.
How about that?
        readlink include/asm
returns
        asm-um
in my case, so I only have to strip the "asm-" part ...


Regards,

Phil


diff --git a/Makefile b/Makefile
index e0fdf49..c9284ba 100644
--- a/Makefile
+++ b/Makefile
@@ -163,6 +163,9 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e 
s/sun4u/sparc64/ \
                                  -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )

+# sadly perl is defined below ... so we can't use it here, can we?
+ASMARCH        := $(shell test -s include/asm && readlink include/asm | cut 
-f2 -d-)
+
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
 #
@@ -182,7 +185,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e 
s/sun4u/sparc64/ \
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile

-ARCH           ?= $(SUBARCH)
+ARCH           ?= $(or $(SUBARCH), $(ASMARCH))
 CROSS_COMPILE  ?=

 # Architecture as present in compile.h


-- 
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to