On Thu, 20 Dec 2001 09:45:16 +1100, 
Keith Owens <[EMAIL PROTECTED]> wrote:
>On Wed, 19 Dec 2001 13:27:19 -0700, 
>Tom Rini <[EMAIL PROTECTED]> wrote:
>>On PPC, the APUS platform (which is an m68k + PPC upgrade), we need to
>>include a bunch of m68k headers.  How should this be done w/ kbuild-2.5?
>
>Try this (untested).  It should create a symlink for asm-m68k under
>$KBUILD_OBJTREE/.tmp_include/src_000/.
>
>Index: 16.35/Makefile-2.5
>--- 16.35/Makefile-2.5 Sun, 16 Dec 2001 01:01:02 +1100 kaos 
>(linux-2.4/E/d/40_Makefile-2 1.32.2.14 644)
>+++ 16.35(w)/Makefile-2.5 Thu, 20 Dec 2001 09:40:31 +1100 kaos 
>(linux-2.4/E/d/40_Makefile-2 1.32.2.14 644)
>@@ -94,6 +94,12 @@ export KBUILD_WRITABLE check_writable
> 
> # A list of directories under linux/include to scan, excluding asm-$(ARCH).
> KBUILD_INCLUDE_DIRS    := linux math-emu net pcmcia scsi video asm-generic
>+# The APUS platform (m68k + PPC upgrade) needs to include a bunch of m68k
>+# headers via #include <asm-m68k/xxx.h>.  Why, oh why do they do these things?
>+# Since .config is not available yet, add asm-m68k for all PPC platforms.
>+ifeq ($(ARCH),ppc)
>+  KBUILD_INCLUDE_DIRS  += asm-m68k
>+endif
> 
> # Unfortunately the make 'export' command only applies to commands in rules.
> # Exported variables are not available to $(shell) commands, at least up to

Tom, please back out the patch above and try this one.  It restricts
the extra include path to apus only instead of adding asm-m68k for all
ppc compiles.  May as well isolate the broken code as much as possible.

Index: 16.35/Makefile-2.5
--- 16.35/Makefile-2.5 Sun, 16 Dec 2001 01:01:02 +1100 kaos 
(linux-2.4/E/d/40_Makefile-2 1.32.2.14 644)
+++ 16.35(w)/Makefile-2.5 Thu, 20 Dec 2001 12:12:21 +1100 kaos 
+(linux-2.4/E/d/40_Makefile-2 1.32.2.14 644)
@@ -92,9 +92,18 @@ else
 endif
 export KBUILD_WRITABLE check_writable
 
+# For broken architectures that need config data at the top level.
+get_one_config := $(KBUILD_SHELL) $(KBUILD_SRCTREE_000)/scripts/get_one_config
+
 # A list of directories under linux/include to scan, excluding asm-$(ARCH).
 KBUILD_INCLUDE_DIRS    := linux math-emu net pcmcia scsi video asm-generic
 
+# The APUS platform (m68k + PPC upgrade) needs to include a bunch of m68k
+# headers via #include <asm-m68k/xxx.h>.  Why, oh why do they do these things?
+ifeq ($(shell $(get_one_config) CONFIG_APUS),y)
+  KBUILD_INCLUDE_DIRS  += asm-m68k
+endif
+
 # Unfortunately the make 'export' command only applies to commands in rules.
 # Exported variables are not available to $(shell) commands, at least up to
 # make 3.79.1.  Can you say "pain in the neck?"  KAO
Index: 16.35/scripts/get_one_config
--- 16.35/scripts/get_one_config Thu, 20 Dec 2001 12:16:11 +1100 kaos ()
+++ 16.35(w)/scripts/get_one_config Thu, 20 Dec 2001 12:15:41 +1100 kaos 
+(linux-2.4/O/f/41_get_one_co  644)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# In an ideal world the top level makefile would be completely independent of
+# the config, it should only contain global settings that apply to all builds.
+# However at least one architecture (ppc) is breaking the rules, its include
+# path depends on the config settings instead of using the same include paths as
+# everyone else.
+#
+# I do _not_ want to include .config in the top level makefile, it leads to make
+# recursion hell, see the barf bag code in scripts/Makefile-2.5.  The script
+# below extracts and prints one option from .config, without tripping the
+# recursion problem.  If .config does not exist or the option is not set then it
+# prints nothing.  KAO
+
+[ -r $KBUILD_OBJTREE/.config ] && sed -ne "/^$1=/s/^$1=//p" $KBUILD_OBJTREE/.config


_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to