diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-20 20:34:43 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-20 20:34:43 +0100 |
commit | f89029d063c855b03adbcd20d09380fd42cb11c9 (patch) | |
tree | 31cc8a3fa00ea58f039cf2db6b513fc2fcc07b82 | |
parent | a98a21699f14c7e8f142d27886f9097dc45ba658 (diff) |
oss build fixes
-rw-r--r-- | configure.ac | 57 | ||||
-rw-r--r-- | plugins/oss/Makefile.am | 4 | ||||
-rw-r--r-- | plugins/oss/oss.c | 9 |
3 files changed, 27 insertions, 43 deletions
diff --git a/configure.ac b/configure.ac index a9f460fa..fcbe5930 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_SUBST(INSANE_CFLAGS) AC_SUBST(INSANE_CXXFLAGS) CXXFLAGS="$CXXFLAGS $INSANE_CXXFLAGS -D_GNU_SOURCE -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\"" -CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\"" +CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\" -std=c99" PKG_CHECK_MODULES(DEPS, samplerate) PKG_CHECK_MODULES(GTKUI_DEPS, gtk+-2.0 >= 2.12 gthread-2.0 glib-2.0, HAVE_GTK=1, NO_GTK=1) @@ -190,57 +190,40 @@ if test -f "/etc/oss.conf" ; then if test "x$i" != "x$t" ; then if test -f "$t/include/sys/soundcard.h" -o -f "$i/include/soundcard.h" ; then OSS4_CFLAGS="-I$t/include" + AC_MSG_RESULT([$OSS4_CFLAGS]) + have_oss4=yes fi fi done -fi -if test -n "$OSS4_CFLAGS" ; then - AC_MSG_RESULT([$OSS4_CFLAGS]) else AC_MSG_RESULT([not found]) fi -CFLAGS_save=$CFLAGS -CFLAGS="$CFLAGS $OSS4_CFLAGS" -AC_CHECK_HEADERS(soundcard.h) -AC_CHECK_HEADERS(sys/soundcard.h) -AC_CHECK_HEADERS(machine/soundcard.h) -CFLAGS=$CFLAGS_save - -if test "x${ac_cv_header_soundcard_h}" = "xyes" || test "x${ac_cv_header_sys_soundcard_h}" = "xyes" || test "x${ac_cv_header_machine_soundcard_h}" = "xyes"; then - have_oss4=yes -fi -if test "x${have_oss4}" = "xyes"; then -AC_MSG_CHECKING(whether we need -lossaudio) - AC_TRY_LINK([ - #include <sys/ioctl.h> - #ifdef HAVE_SYS_SOUNDCARD_H - #include <sys/soundcard.h> - #else - #include <soundcard.h> - #endif - ], [ - int fd, value; - ioctl(fd, SOUND_MIXER_READ_VOLUME, &value); -], AC_MSG_RESULT(no), [ - OSS4_LIBS="-lossaudio" - AC_MSG_RESULT(yes) - ]) +if test "x$have_oss4" != "xyes"; then + AC_MSG_CHECKING(for /usr/include/sys/soundcard.h) + AC_CHECK_HEADERS(sys/soundcard.h) + if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" ; then + have_oss4=yes + AC_MSG_RESULT([found]) + else + AC_MSG_RESULT([not found]) + fi fi -if test "x$have_oss4" = "xyes"; then - AC_DEFINE(HAVE_OSS4, 1, [Define if the OSS4 output plugin should be built]) -else - have_oss4=no -fi if test "x$have_oss4" = "xyes"; then OSS4_DIR="plugins/oss" AC_SUBST(OSS4_CFLAGS) AC_SUBST(OSS4_DIR) - AC_SUBST(OSS4_LIBS) fi +echo +echo "have_oss4=$have_oss4" +echo "OSS4_CFLAGS=$OSS4_CFLAGS" +echo "OSS4_LIBS=$OSS4_LIBS" +echo "OSS4_DIR=$OSS4_DIR" +echo + dnl print summary echo @@ -277,7 +260,7 @@ dnl PRINT_PLUGIN_INFO([faad2],[aac/mp4 player],[test $HAVE_FAAD && test $HAVE_MP PRINT_PLUGIN_INFO([cdda],[cd audio player],[test $HAVE_CDIO && test $HAVE_CDDB]) PRINT_PLUGIN_INFO([gtkui],[GTK user interface],[test $HAVE_GTK]) PRINT_PLUGIN_INFO([ffmpeg],[ffmpeg codecs],[test $HAVE_FFMPEG]) -PRINT_PLUGIN_INFO([oss],[oss4 output plugin],[test "x$have_oss"="xyes"]) +PRINT_PLUGIN_INFO([oss],[oss4 output plugin],[test "x$have_oss4" = "xyes"]) echo AC_OUTPUT([ diff --git a/plugins/oss/Makefile.am b/plugins/oss/Makefile.am index f8938ff4..810bd249 100644 --- a/plugins/oss/Makefile.am +++ b/plugins/oss/Makefile.am @@ -1,6 +1,6 @@ ossdir = $(libdir)/$(PACKAGE) pkglib_LTLIBRARIES = oss.la +AM_CFLAGS = $(CFLAGS) $(OSS4_CFLAGS) oss_la_SOURCES = oss.c oss_la_LDFLAGS = -module -include /etc/oss.conf -AM_CFLAGS = $(CFLAGS) -I$(OSSLIBDIR)/include/sys -std=c99 + diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c index 96b98fd9..11dd52ee 100644 --- a/plugins/oss/oss.c +++ b/plugins/oss/oss.c @@ -22,14 +22,15 @@ #endif #include <stdio.h> #include <string.h> -#include <soundcard.h> +#include <sys/soundcard.h> #include <fcntl.h> +#include <sys/ioctl.h> #include <stdlib.h> #include "../../deadbeef.h" -#if OSS_VERSION<0x040000 -#error oss4 plugin: at least oss v4.0 is required to build this plugin -#endif +//#if OSS_VERSION<0x040000 +//#error oss4 plugin: at least oss v4.0 is required to build this plugin +//#endif #define trace(...) { fprintf(stderr, __VA_ARGS__); } //#define trace(fmt,...) |