Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Chris Rankin <rankincj@yahoo.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: ALSA, and building the Linux kernel outside its source tree...
Date: Thu, 14 Oct 2004 17:06:14 +0200	[thread overview]
Message-ID: <s5h7jptgx09.wl@alsa2.suse.de> (raw)
In-Reply-To: <20041012234344.2098.qmail@web52905.mail.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

At Wed, 13 Oct 2004 00:43:44 +0100 (BST),
Chris Rankin wrote:
> 
> Hi,
> 
> I have a number of Linux boxes, each with different
> CPUs of various speeds. For the sake of speed and
> storage space, I am experimenting with having a single
> source tree from which I can build multiple kernels.
> (It really doesn't make sense to force a P200 to
> compile its own kernel while its networked P4
> neighbour 'twiddles its bits', if you catch my
> meaning.) The Linux build process now allows this by
> specifying:
> 
> make O=<output directory path> menuconfig
> make O=<output directory path>
> make O=<output directory path> modules_install
> 
> You get the idea. The installation procedure now
> creates two symlinks:
> 
> /lib/modules/<version>/build
> /lib/modules/<version>/source
> 
> However, the ALSA driver cvscompile script expects
> everything to be accessible via the 'build' link,
> although the only headers available under
> build/include/linux are:
> 
> version.h
> compile.h
> autoconf.h
> 
> Would it be difficult to change the ALSA driver
> configure script to allow for separate source and
> build trees, please?

The attached patch adds --with-build configure option to specify the
build tree.  As default, it's taken from /lib/modules/XXX/build.
Also the patch includes clean ups.

I didn't test the patch for 2.2/2.4 kernels.  It would be appreciated
if anyone can test it on older kernels.


Takashi

[-- Attachment #2: Type: text/plain, Size: 17043 bytes --]

Index: alsa-driver/configure.in
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-driver/configure.in,v
retrieving revision 1.199
diff -u -r1.199 configure.in
--- alsa-driver/configure.in	12 Oct 2004 10:57:50 -0000	1.199
+++ alsa-driver/configure.in	14 Oct 2004 14:57:52 -0000
@@ -63,23 +63,36 @@
 
 dnl Check for directory with kernel source...
 AC_MSG_CHECKING(for directory with kernel source)
-if test -d "/lib/modules/`uname -r`/build" -o -L "/lib/modules/`uname -r`/build"; then
+if test -d "/lib/modules/`uname -r`/source" -o -L "/lib/modules/`uname -r`/source"; then
+  DEFAULT_KERNEL_DIR="/lib/modules/`uname -r`/source"
+  DEFAULT_KERNEL_BUILD="/lib/modules/`uname -r`/build"
+elif test -d "/lib/modules/`uname -r`/build" -o -L "/lib/modules/`uname -r`/build"; then
   DEFAULT_KERNEL_DIR="/lib/modules/`uname -r`/build"
 else
   DEFAULT_KERNEL_DIR="/usr/src/linux"
 fi
 AC_ARG_WITH(kernel,
   [  --with-kernel=dir       give the directory with kernel sources]
-  [                        [/usr/src/linux]],
+  [                        [[/usr/src/linux]]],
   kerneldir="$withval",
   kerneldir="$DEFAULT_KERNEL_DIR"
 )
 CONFIG_SND_KERNELDIR="$kerneldir"
+
+dnl Check for directory with kernel build tree...
+AC_MSG_CHECKING(for directory with kernel build)
 AC_MSG_RESULT($kerneldir)
+AC_ARG_WITH(build,
+  [  --with-build=dir        give the directory with kernel build tree],
+  kernelbuild="$withval",
+  kernelbuild="$DEFAULT_KERNEL_BUILD"
+)
+AC_MSG_RESULT($kernelbuild)
 
 dnl Check for kernel version...
 AC_MSG_CHECKING(for kernel version)
 if ! test -r $CONFIG_SND_KERNELDIR/include/linux/version.h; then
+  if test -n "$kernelbuild" -a ! -f $kernelbuild/include/linux/version.h; then
   cat << EOF
 The file $CONFIG_SND_KERNELDIR/include/linux/version.h does not exist.
 Please, install the package with full kernel sources for your distribution
@@ -87,16 +100,27 @@
 sources (default is $DEFAULT_KERNEL_DIR).
 EOF
   exit 1
+  fi
 fi
 KERNEL_INC="-I$CONFIG_SND_KERNELDIR/include"
+MAKE_ADDS=""
+if test -n "$kernelbuild"; then
+  KERNEL_INC="-I$kernelbuild/include $KERNEL_INC"
+  MAKE_ADDS="O=$kernelbuild"
+fi
 HACK_KERNEL_INC=""
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+if test -n "$kernelbuild" - a -f $kernelbuild/include/linux/version.h; then
+  KERNDIR=$kernelbuild
+else
+  KERNDIR=$CONFIG_SND_KERNELDIR
+fi
 AC_CACHE_VAL(kaversion,
 [AC_TRY_RUN([
 #include <stdio.h>
 #include <ctype.h>
-#include "$CONFIG_SND_KERNELDIR/include/linux/version.h"
+#include "$KERNDIR/include/linux/version.h"
 int main()
 {
  FILE *f;
@@ -158,12 +182,17 @@
 AC_MSG_CHECKING(for GCC version)
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+if test -n "$kernelbuild" -a -f $kernelbuild/include/linux/compile.h; then
+  KERNDIR=$kernelbuild
+else
+  KERNDIR=$CONFIG_SND_KERNELDIR
+fi
 AC_CACHE_VAL(kernel_gcc,
 [AC_TRY_RUN([
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
-#include "$CONFIG_SND_KERNELDIR/include/linux/compile.h"
+#include "$KERNDIR/include/linux/compile.h"
 int main()
 {
  FILE *f;
@@ -300,7 +329,12 @@
 
 AC_DEFUN([CHECK_KERNEL_HEADER], [
   AC_MSG_CHECKING(for kernel $1)
-  if test -f "$CONFIG_SND_KERNELDIR/include/$1"; then
+  if test -n "$kernelbuild" -a -f "$kernelbuild/include/$1"; then
+    KERNDIR=$kernelbuild
+  else
+    KERNDIR=$CONFIG_SND_KERNELDIR
+  fi
+  if test -f "$KERNDIR/include/$1"; then
     AC_MSG_RESULT("yes")
     if test -f include/$1; then
       echo "Removing a dummy $1."
@@ -326,7 +360,12 @@
 
 AC_DEFUN([MODIFY_KERNEL_HEADER], [
   AC_MSG_CHECKING(to modify of kernel $1)
-  if grep $2 "$CONFIG_SND_KERNELDIR/include/$1" > /dev/null 2>&1; then
+  if test -n "$kernelbuild" -a -f "$kernelbuild/include/$1"; then
+    KERNDIR=$kernelbuild
+  else
+    KERNDIR=$CONFIG_SND_KERNELDIR
+  fi
+  if grep $2 "$KERNDIR/include/$1" > /dev/null 2>&1; then
     AC_MSG_RESULT("no")
     if test -f include/$1; then
       echo "Removing a dummy $1."
@@ -338,7 +377,7 @@
     mkdir -p include/asm
     echo "#ifndef $2" > include/$1
     echo "#define $2" >> include/$1
-    cat "$CONFIG_SND_KERNELDIR/include/$1" >> include/$1
+    cat "$KERNDIR/include/$1" >> include/$1
     echo "#endif /* $2 */" >> include/$1
   fi
 ])
@@ -349,9 +388,14 @@
   AC_MSG_CHECKING(for $2)
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+  if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
+    KERNDIR=$kernelbuild
+  else
+    KERNDIR=$CONFIG_SND_KERNELDIR
+  fi
   boolchk=""
   AC_TRY_RUN([
-#include "$CONFIG_SND_KERNELDIR/include/linux/autoconf.h"
+#include "$KERNDIR/include/linux/autoconf.h"
 int main( void ) {
 #ifndef $boolvar
   exit(1);
@@ -375,9 +419,14 @@
   AC_MSG_CHECKING(for $2)
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+  if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
+    KERNDIR=$kernelbuild
+  else
+    KERNDIR=$CONFIG_SND_KERNELDIR
+  fi
   boolchk=""
   AC_TRY_RUN([
-#include "$CONFIG_SND_KERNELDIR/include/linux/autoconf.h"
+#include "$KERNDIR/include/linux/autoconf.h"
 int main( void ) {
 #if !defined($boolvar) && !defined($boolvar1)
   exit(1);
@@ -401,9 +450,14 @@
   AC_MSG_CHECKING(for $2)
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+  if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
+    KERNDIR=$kernelbuild
+  else
+    KERNDIR=$CONFIG_SND_KERNELDIR
+  fi
   tristatechk=""
   AC_TRY_RUN([
-#include "$CONFIG_SND_KERNELDIR/include/linux/autoconf.h"
+#include "$KERNDIR/include/linux/autoconf.h"
 #include <stdio.h>
 int main(void) {
 	FILE *file = fopen("tristate.result", "w+");
@@ -505,18 +559,6 @@
   fi
 fi
 
-MAKE_ADDS=""
-if test "$CONFIG_SUSE_KERNEL" = "y"; then
-  if test ! -f $CONFIG_SND_KERNELDIR/include/linux/kernel.h; then
-    if test "$CONFIG_SND_KERNELDIR" != "/usr/src/linux"; then
-      echo "Tweaking the kernel source directories for SUSE kernels..."
-      MAKE_ADDS="O=$CONFIG_SND_KERNELDIR"
-      CONFIG_SND_KERNELDIR="/usr/src/linux"
-      KERNEL_INC="-I$CONFIG_SND_KERNELDIR/include"
-    fi
-  fi
-fi
-
 dnl define kernel directory now
 AC_DEFINE_UNQUOTED(CONFIG_SND_KERNELDIR, "$CONFIG_SND_KERNELDIR")
 AC_SUBST(CONFIG_SND_KERNELDIR)
@@ -613,7 +655,7 @@
 AC_MSG_CHECKING(for directory to store kernel modules)
 AC_ARG_WITH(moddir,
   [  --with-moddir=/path     give the path for the alsa driver kernel modules]
-  [                        [/lib/modules/<KVER>/misc]],
+  [                        [[/lib/modules/<KVER>/misc]]],
   moddir="$withval", 
   moddir_tree=
   modsubdir="misc"
@@ -706,9 +748,14 @@
 rm -f processor.id
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
+  KERNDIR=$kernelbuild
+else
+  KERNDIR=$CONFIG_SND_KERNELDIR
+fi
 AC_TRY_RUN([
 #include <stdio.h>
-#include "$CONFIG_SND_KERNELDIR/include/linux/autoconf.h"
+#include "$KERNDIR/include/linux/autoconf.h"
 int main(void) {
 	FILE *file = fopen("processor.id", "w+");
 	if (file == NULL)
@@ -1004,9 +1051,14 @@
 	ac_save_CFLAGS="$CFLAGS"
 	CFLAGS="$CFLAGS -I$CONFIG_SND_KERNELDIR/include"
 	rm -f machine.id
+	if test -n "$kernelbuild" -a -f "$kernelbuild/include/linux/autoconf.h"; then
+	  KERNDIR=$kernelbuild
+	else
+	  KERNDIR=$CONFIG_SND_KERNELDIR
+	fi
 	AC_TRY_RUN([
 #include <stdio.h>
-#include "$CONFIG_SND_KERNELDIR/include/linux/autoconf.h"
+#include "$KERNDIR/include/linux/autoconf.h"
 int main(void) {
 	FILE *file = fopen("machine.id", "w+");
 	if (file == NULL)
@@ -1154,12 +1206,12 @@
 AC_MSG_CHECKING(for strlcpy)
 strlcpy="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/kernel.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/string.h"
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
 ],[
   char buf[128];
   strlcpy(buf, "abcd", sizeof(buf));
@@ -1179,11 +1231,11 @@
 AC_MSG_CHECKING(for snprintf)
 snprintf="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/kernel.h"
+#include <linux/config.h>
+#include <linux/kernel.h>
 ],[
   char buf[128];
   snprintf(buf, sizeof(buf), "abcd");
@@ -1203,11 +1255,11 @@
 AC_MSG_CHECKING(for scnprintf)
 scnprintf="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/kernel.h"
+#include <linux/config.h>
+#include <linux/kernel.h>
 ],[
   char buf[128];
   scnprintf(buf, sizeof(buf), "abcd");
@@ -1227,11 +1279,11 @@
 AC_MSG_CHECKING(for sscanf)
 sscanf="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="-Wall -Werror $CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/kernel.h"
+#include <linux/config.h>
+#include <linux/kernel.h>
 ],[
   unsigned int i;
   sscanf("2a", "%x", &i);
@@ -1251,12 +1303,12 @@
 AC_MSG_CHECKING(for vmalloc_to_page)
 vmalloc_to_page="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/time.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/mm.h"
+#include <linux/config.h>
+#include <linux/time.h>
+#include <linux/mm.h>
 ],[
   struct page * (*func)(void*);
   func = vmalloc_to_page;
@@ -1276,11 +1328,11 @@
 AC_MSG_CHECKING(for old kmod)
 old_kmod="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/kmod.h"
+#include <linux/config.h>
+#include <linux/kmod.h>
 ],[
 	request_module("abcd", "def", "ixj");
 ],
@@ -1299,12 +1351,12 @@
 AC_MSG_CHECKING(for PDE)
 pde_defined="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/fs.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/proc_fs.h"
+#include <linux/config.h>
+#include <linux/fs.h>
+#include <linux/proc_fs.h>
 ],[
 	struct proc_dir_entry * (*func)();
 	func = PDE;
@@ -1324,11 +1376,11 @@
 AC_MSG_CHECKING(for pci_set_consistent_dma_mask)
 pci_consistent_defined="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/pci.h"
+#include <linux/config.h>
+#include <linux/pci.h>
 ],[
 	int (*func)();
 	func = pci_set_consistent_dma_mask;
@@ -1347,11 +1399,11 @@
 AC_MSG_CHECKING(for tty->count is the atomic type)
 tty_count_atomic="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS -Wall $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/tty.h"
+#include <linux/config.h>
+#include <linux/tty.h>
 ],[
 	struct tty_struct tty;
 	atomic_read(&tty.count);
@@ -1371,11 +1423,11 @@
 AC_MSG_CHECKING(for video_get_drvdata)
 video_get_drvdata="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/videodev.h"
+#include <linux/config.h>
+#include <linux/videodev.h>
 ],[
   void *(*func)(struct video_device *);
   func = video_get_drvdata;
@@ -1396,11 +1448,11 @@
 AC_MSG_CHECKING(for remap_pfn_range)
 remap_pfn_range="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/mm.h"
+#include <linux/config.h>
+#include <linux/mm.h>
 ],[
   int (*func)(struct vm_area_struct *, unsigned long, unsigned long, unsigned long, pgprot_t);
   pgprot_t p;
@@ -1420,11 +1472,11 @@
 AC_MSG_CHECKING(for new remap_page_range)
 new_remap="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/mm.h"
+#include <linux/config.h>
+#include <linux/mm.h>
 ],[
   int (*func)(struct vm_area_struct *, unsigned long, unsigned long, unsigned long, pgprot_t);
   pgprot_t p;
@@ -1445,11 +1497,11 @@
 AC_MSG_CHECKING(for kcalloc)
 kcalloc="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/slab.h"
+#include <linux/config.h>
+#include <linux/slab.h>
 ],[
   void * (*func)(size_t, size_t, int);
   func = kcalloc;
@@ -1469,11 +1521,11 @@
 AC_MSG_CHECKING(for saved_config_space in pci_dev)
 pci_saved_config="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/pci.h"
+#include <linux/config.h>
+#include <linux/pci.h>
 ],[
   struct pci_dev dev;
   dev.saved_config_space[0] = 0;
@@ -1494,11 +1546,11 @@
 AC_MSG_CHECKING(for new pci_save_state)
 new_pci_save_state="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/pci.h"
+#include <linux/config.h>
+#include <linux/pci.h>
 ],[
   struct pci_dev *pci;
   pci_save_state(pci);
@@ -1517,11 +1569,11 @@
 AC_MSG_CHECKING(for acpi_register_gsi)
 acpi_register_gsi="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_COMPILE([
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/acpi.h"
+#include <linux/config.h>
+#include <linux/acpi.h>
 ],[
   unsigned int (*func)(u32, int, int);
   func = acpi_register_gsi;
@@ -1698,19 +1750,19 @@
 AC_MSG_CHECKING(for RTC callback support in kernel)
 rtcsup="0"
 ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC"
+CFLAGS="$CFLAGS $KERNEL_INC $HACK_KERNEL_INC -nostdinc -iwithprefix include"
 AC_TRY_RUN([
-#include "$CONFIG_SND_KERNELDIR/include/linux/autoconf.h"
+#include <linux/autoconf.h>
 #if defined(__alpha__) || (!defined(CONFIG_RTC) && !defined(CONFIG_RTC_MODULE))
 int main(void) { exit(1); }
 #else
 #define __KERNEL__
-#include "$CONFIG_SND_KERNELDIR/include/linux/version.h"
-#include "$CONFIG_SND_KERNELDIR/include/linux/config.h"
+#include <linux/version.h>
+#include <linux/config.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 12)	/* FIXME: which 2.2.x kernel? */
-#include "$CONFIG_SND_KERNELDIR/include/linux/rtc.h"
+#include <linux/rtc.h>
 #else
-#include "$CONFIG_SND_KERNELDIR/include/linux/mc146818rtc.h"
+#include <linux/mc146818rtc.h>
 #endif
 int main(void)
 {

  reply	other threads:[~2004-10-14 15:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-12 23:43 ALSA, and building the Linux kernel outside its source tree Chris Rankin
2004-10-14 15:06 ` Takashi Iwai [this message]
2004-10-15 13:15   ` Clemens Ladisch
2004-10-16 13:10   ` Chris Rankin
2004-10-18 10:47     ` Takashi Iwai
2004-10-18 14:51       ` Takashi Iwai

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=s5h7jptgx09.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=rankincj@yahoo.com \
    /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