public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [KBUILD] External modules, SUBDIRS=<absolute path> => really odd include directories
@ 2003-12-22  2:52 Richard Chan
  0 siblings, 0 replies; only message in thread
From: Richard Chan @ 2003-12-22  2:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: sam


When building external modules with SUBDIRS on the command line set to 
an absolute path, there
are really odd includes in the gcc command line.

Example:

I am building alsa-cvs against a current kernel tree.  I have built the 
kernel+modules once using

make -C /usr/src/linux-2.6.0-1.R  O=/usr/obj/2.6.0-1.R  EXTRAVERSION=-1.R

Now I want to build the latest alsa-kernel modules from CVS:

EXTMODDIR=/usr/src/alsa/alsa-kernel-20031220
make -C /usr/src/linux-2.6.0-1.R O=/usr/obj/2.6.0-1.R 
SUBDIRS=$EXTMODDIR  V=1 modules

Here is an excerpt

gcc -Wp,-MD,/usr/src/alsa/alsa-kernel-20031220/core/.hwdep.o.d -nostdinc 
-iwithprefix include -D__KERNEL__
   -Iinclude -Iinclude2 -I/usr/src/linux-2.6.0-1.R/include 
-I/usr/src/alsa/alsa-kernel-20031220/core
   -I/usr/src/linux-2.6.0-1.R//usr/src/alsa/alsa-kernel-20031220/core  
-D__KERNEL__
  -I/usr/src/linux-2.6.0-1.R/include  -I/usr/src/linux-2.6.0-1.R/include2
  -I/usr/src/linux-2.6.0-1.R//usr/src/linux-2.6.0-1.R/include  -Wall  
-Wstrict-prototypes
 -Wno-trigraphs  -O2  -fno-strict-aliasing  -fno-common  -pipe  
-mpreferred-stack-boundary=2  -march=athlon
 -I/usr/src/linux-2.6.0-1.R/include/asm-i386/mach-default  
-fomit-frame-pointer
 -Wdeclaration-after-statement -DMODULE -DKBUILD_BASENAME=hwdep
 -DKBUILD_MODNAME=snd_hwdep -c
  -o /usr/src/alsa/alsa-kernel-20031220/core/hwdep.o 
/usr/src/alsa/alsa-kernel-20031220/core/hwdep.c

Note two weird paths where an absolute path is concatenated with $(srctree)

   -I/usr/src/linux-2.6.0-1.R//usr/src/alsa/alsa-kernel-20031220/core
  -I/usr/src/linux-2.6.0-1.R//usr/src/linux-2.6.0-1.R/include

The first one looks like $(srctree)/<current build directory>, the 
second one looks like
$(srctree)/$(srctree)/include which is  odd.

Is it a feature of the system that SUBDIRS is best specified as a 
relative path to $(srctree)?
How to account for the fact that $(srctree)/include is concatenated to 
$(srctree)?

2nd question: How do you get an include directory to precede 
$(obj)/{include, include2}, $(srctree)/include?
You see in this case I need to use the sound/*.h files from Alsa CVS so 
I need my directory to win in the
include path race. Currently, I copy the include files to 
$(obj)/include/sound. Is there a more elegant way
to specify an include directory that will precede both $(obj)/include 
and $(srctree)/include?

Cheers
Richard














^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-22  2:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-22  2:52 [KBUILD] External modules, SUBDIRS=<absolute path> => really odd include directories Richard Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox