aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-30 17:49:50 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-30 17:49:50 +0000
commit357595cbeaadb53151dc48d81a2b4f1ba3fd6a16 (patch)
treec3f0224e1268668ce524daaf2f780a646329fa02
parentcc9925a1ba1013ebd68e95317d9261c82d94ebd9 (diff)
use proper method of detecting OSS support on Linux and FreeBSD
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23736 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/Makefile9
-rw-r--r--channels/chan_oss.c2
-rw-r--r--configure.ac17
3 files changed, 17 insertions, 11 deletions
diff --git a/channels/Makefile b/channels/Makefile
index aca979f52..0b4ddacc3 100644
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -103,15 +103,10 @@ ringtone.h: gentone
./gentone ringtone 440 480
chan_oss.o: chan_oss.c busy.h ringtone.h
+ $(CC) -c -o $@ $(CFLAGS) $(OSSAUDIO_INCLUDE) $<
-ifeq ($(OSARCH),OpenBSD)
chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
-endif
-ifeq ($(OSARCH),NetBSD)
-chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
-endif
+ $(CC) $(SOLINK) -o $@ chan_oss.o $(OSSAUDIO_LIB)
chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
$(CC) $(SOLINK) -o $@ $< iax2-parser.o iax2-provision.o
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 09b4b43bb..8e9bbe4f3 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -33,7 +33,7 @@
*/
/*** MODULEINFO
- <depend>osssound</depend>
+ <depend>ossaudio</depend>
***/
#include <stdio.h>
diff --git a/configure.ac b/configure.ac
index b90d5d32e..39967212c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -174,14 +174,25 @@ AST_EXT_LIB([tds], [tds_version], [tds.h], [FREETDS], [FreeTDS])
AST_EXT_LIB([vorbis], [vorbis_info_init], [vorbis/codec.h], [VORBIS], [Vorbis], [-lm -lvorbisenc])
AST_EXT_LIB([z], [compress], [zlib.h], [ZLIB], [zlib])
+PBX_LIBossaudio=0
if test "x${PBX_OSTYPE}" = "xLinux" ; then
- AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [linux/soundcard.h], [OSS], [Open Sound System])
+ AC_CHECK_HEADER([linux/soundcard.h],
+ [PBX_LIBossaudio=1
+ AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
+ ])
elif test "x${PBX_OSTYPE}" = "xFreeBSD" ; then
- AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [sys/soundcard.h], [OSS], [Open Sound System])
-else
+ AC_CHECK_HEADER([sys/soundcard.h],
+ [PBX_LIBossaudio=1
+ AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
+ ])
+elif test "x${PBX_OSTYPE}" = "xOpenBSD" ; then
+ AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [soundcard.h], [OSS], [Open Sound System])
+elif test "x${PBX_OSTYPE}" = "xNetBSD" ; then
AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [soundcard.h], [OSS], [Open Sound System])
fi
+AC_SUBST([PBX_LIBossaudio])
+
if test "x${PBX_OSTYPE}" = "xLinux" ; then
AST_EXT_LIB([tonezone], [tone_zone_find], [linux/zaptel.h], [ZAPTEL], [Zaptel])
else