aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-08 14:21:12 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-08 14:21:47 +0100
commitb2b2342e8edf51032f4f293e7d643783ffaa50d3 (patch)
tree546b6d04ba500b17fb051d1ccb50ededea877069
parent6ad50a1799e23a074e0fe39f3138ec3c9fd2445e (diff)
downloadhda-emu-b2b2342e8edf51032f4f293e7d643783ffaa50d3.tar.gz
Conditional builds of hda_auto_parser.c and hda_jack.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--configure.ac16
-rw-r--r--kernel/Makefile.am11
2 files changed, 25 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 70e47e2..3103eb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,22 @@ CHECK_CODEC(ca0110, CONFIG_SND_HDA_CODEC_CA0110)
CHECK_CODEC(ca0132, CONFIG_SND_HDA_CODEC_CA0132)
CHECK_CODEC(cirrus, CONFIG_SND_HDA_CODEC_CIRRUS)
+AC_DEFUN([CHECK_HELPER], [
+ AC_MSG_CHECKING(for helper $1)
+ if test -f hda/$1; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE($2)
+ codec_found=yes
+ else
+ AC_MSG_RESULT(no)
+ codec_found=
+ fi
+ AM_CONDITIONAL($2, test "$codec_found" = "yes")
+])
+
+CHECK_HELPER([hda_auto_parser.c], [HAVE_HDA_AUTO_PARSER])
+CHECK_HELPER([hda_jack.c], [HAVE_HDA_JACK])
+
AC_ARG_ENABLE(own-proc,
AS_HELP_STRING([--enable-own-proc],
[use own proc-file output function]),
diff --git a/kernel/Makefile.am b/kernel/Makefile.am
index 5bc843d..59bc8db 100644
--- a/kernel/Makefile.am
+++ b/kernel/Makefile.am
@@ -50,10 +50,17 @@ endif
# HELPERS += hda_beep.c
+if HAVE_HDA_AUTO_PARSER
+HELPERS += hda_auto_parser.c
+endif
+
+if HAVE_HDA_JACK
+HELPERS += hda_jack.c
+endif
+
noinst_LIBRARIES = libhda.a
libhda_a_SOURCES = hda_codec.c hda_generic.c \
- hda_eld.c hda_jack.c hda_auto_parser.c \
- misc_wrapper.c \
+ hda_eld.c misc_wrapper.c \
$(PATCHES) $(HELPERS)
noinst_HEADERS = init_hooks.h