diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-06-02 09:33:59 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-06-02 09:33:59 +0200 |
commit | 61b898e82e30d50e5da3ed64e79ec9d04fe7ee93 (patch) | |
tree | 85b98a12904f41fdfe9512273d80bb33f235bba5 | |
parent | ad42dfc20a4bc71221b079598414649a9bcfcad9 (diff) | |
download | alsa-driver-build-unstable-61b898e82e30d50e5da3ed64e79ec9d04fe7ee93.tar.gz |
Fix build with openSUSE Factory kernels
A few fixes for building alsa-driver modules properly with openSUSE
Factory kernels.
- Use the kernel-build directory for 2.6 kernel base directory
instead of source directory
- Undefine ALSA-related definitions before including the new config.h
and config1.h; a hack by including *.in file for that
- Properly check config.h and generated/autoconf.h in configure script
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | Makefile.conf.in | 1 | ||||
-rw-r--r-- | configure.in | 39 | ||||
-rw-r--r-- | include/adriver.h | 2 | ||||
-rw-r--r-- | include/alsa-autoconf.h | 2 | ||||
-rw-r--r-- | include/config-top.h | 8 | ||||
-rw-r--r-- | include/config.h.in | 2 |
7 files changed, 35 insertions, 21 deletions
@@ -160,7 +160,7 @@ include/sndversions.h: .PHONY: compile compile: include/sndversions.h ifdef NEW_KBUILD - $(MAKE) -C $(CONFIG_SND_KERNELDIR) SUBDIRS=$(MAINSRCDIR) $(MAKE_ADDS) CPP="$(CPP)" CC="$(CC)" modules + $(MAKE) -C $(CONFIG_SND_KERNELBUILD) SUBDIRS=$(MAINSRCDIR) $(MAKE_ADDS) CPP="$(CPP)" CC="$(CC)" modules utils/link-modules $(SND_TOPDIR) else @for d in $(SUBDIRS); do if ! $(MAKE) -C $$d; then exit 1; fi; done diff --git a/Makefile.conf.in b/Makefile.conf.in index c25f94b39..c1f62b4a9 100644 --- a/Makefile.conf.in +++ b/Makefile.conf.in @@ -46,6 +46,7 @@ kextraversion = @kextraversion@ CONFIG_SND_VERSION = @CONFIG_SND_VERSION@ CONFIG_SND_KERNELDIR = @CONFIG_SND_KERNELDIR@ +CONFIG_SND_KERNELBUILD = @CONFIG_SND_KERNELBUILD@ CONFIG_MODULES = y CONFIG_SND_MVERSION = @CONFIG_SND_MVERSION@ CONFIG_ISAPNP_KERNEL = @CONFIG_ISAPNP_KERNEL@ diff --git a/configure.in b/configure.in index d71180118..b40ec4735 100644 --- a/configure.in +++ b/configure.in @@ -121,6 +121,9 @@ AC_ARG_WITH(build, kernelbuild="$withval", kernelbuild="$DEFAULT_KERNEL_BUILD" ) +if test -d "$kernelbuild"; then + kernelbuild=$(cd "$kernelbuild" && pwd) +fi CONFIG_SND_KERNELBUILD="$kernelbuild" AC_MSG_RESULT($kernelbuild) @@ -669,6 +672,7 @@ fi dnl define kernel directory now AC_DEFINE_UNQUOTED(CONFIG_SND_KERNELDIR, "$CONFIG_SND_KERNELDIR") AC_SUBST(CONFIG_SND_KERNELDIR) +AC_SUBST(CONFIG_SND_KERNELBUILD) AC_SUBST(MAKE_ADDS) dnl update include/sound/version.h @@ -1468,23 +1472,26 @@ CHECK_KERNEL_HEADER(linux/config.h, [#ifndef _LINUX_CONFIG_H dnl Check for deprecated linux/config.h AC_MSG_CHECKING(for deprecated linux/config.h) -if test -n "$kernelbuild" -a \( -f "$kernelbuild/include/$1" -o -f "$kernelbuild/include2/$1" \) ; then - KERNDIR=$kernelbuild -else - KERNDIR=$CONFIG_SND_KERNELDIR -fi -deprecated_config_h="0" -if test -r $KERNDIR/include/linux/config.h ; then - if grep "Including config.h is deprecated." $KERNDIR/include/linux/config.h > /dev/null; then - deprecated_config_h="1" +deprecated_config_h="1" +for i in $kernelbuild/include/linux/config.h \ + $kernelbuild/include2/linux/config.h \ + $CONFIG_SND_KERNELDIR/include/linux/config.h; do + if test -r $i ; then + if ! grep -q "Including config.h is deprecated." $i; then + deprecated_config_h="0" + break + fi fi -else - deprecated_config_h="1" -fi -if test -r $KERNDIR/include/generated/autoconf.h ; then - deprecated_config_h="0" - AC_DEFINE(CONFIG_HAVE_GENERATED_AUTOCONF_H) -fi +done +for i in $kernelbuild/include/generated/autoconf.h \ + $kernelbuild/include2/generated/autoconf.h \ + $CONFIG_SND_KERNELDIR/include/generated/autoconf.h; do + if test -r $i ; then + deprecated_config_h="0" + AC_DEFINE(CONFIG_HAVE_GENERATED_AUTOCONF_H) + break + fi +done CONFIG_HAVE_DEPRECATED_CONFIG_H=$deprecated_config_h if test "$CONFIG_HAVE_DEPRECATED_CONFIG_H" = "1"; then AC_DEFINE(CONFIG_HAVE_DEPRECATED_CONFIG_H) diff --git a/include/adriver.h b/include/adriver.h index 2798408cd..0fede4a31 100644 --- a/include/adriver.h +++ b/include/adriver.h @@ -22,7 +22,7 @@ * */ -#include "config.h" +#include "config-top.h" /* number of supported soundcards */ #ifdef CONFIG_SND_DYNAMIC_MINORS diff --git a/include/alsa-autoconf.h b/include/alsa-autoconf.h index b85cfde85..bfa83a235 100644 --- a/include/alsa-autoconf.h +++ b/include/alsa-autoconf.h @@ -1,7 +1,6 @@ /* * include autoconf.h/config.h from proper location */ -#include "config.h" #if defined(CONFIG_HAVE_GENERATED_AUTOCONF_H) #include <generated/autoconf.h> #elif defined(CONFIG_HAVE_DEPRECATED_CONFIG_H) @@ -15,3 +14,4 @@ #else #include <linux/utsrelease.h> #endif +#include "config-top.h" diff --git a/include/config-top.h b/include/config-top.h new file mode 100644 index 000000000..521bb3789 --- /dev/null +++ b/include/config-top.h @@ -0,0 +1,8 @@ +/* undefine previous definitions in autoconf.h */ +#include "config1.h.in" +#include "config.h.in" + +/* override new definitions */ +#include "config1.h" +#include "config.h" + diff --git a/include/config.h.in b/include/config.h.in index ae9ca3360..09aea6041 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -2,8 +2,6 @@ * Configuration header file for compilation of the ALSA driver */ -#include "config1.h" - /* ALSA section */ #undef CONFIG_SND_ISA #undef CONFIG_SND_SEQUENCER_MODULE |