From: Richard Chan <rspchan@starhub.net.sg>
To: linux-kernel@vger.kernel.org
Cc: sam@ravnborg.org
Subject: [KBUILD] External modules, SUBDIRS=<absolute path> => really odd include directories
Date: Mon, 22 Dec 2003 10:52:17 +0800 [thread overview]
Message-ID: <3FE65C61.5010507@starhub.net.sg> (raw)
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
reply other threads:[~2003-12-22 2:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3FE65C61.5010507@starhub.net.sg \
--to=rspchan@starhub.net.sg \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome