--- aplay/aplay.c.orig 2009-08-31 23:13:36.000000000 +0800 +++ aplay/aplay.c 2009-09-15 01:20:00.000000000 +0800 @@ -28,7 +28,9 @@ #define _GNU_SOURCE #include +#ifndef __FreeBSD__ #include +#endif #include #include #include @@ -45,7 +47,9 @@ #include #include #include +#ifndef __FreeBSD__ #include +#endif #include "aconfig.h" #include "gettext.h" #include "formats.h" @@ -112,6 +116,11 @@ static int test_nowait = 0; static snd_output_t *log; +typedef off_t off64_t; + +#define lseek64 lseek +#define open64 open + static int fd = -1; static off64_t pbrec_count = LLONG_MAX, fdcount; static int vocmajor, vocminor; --- aplay/formats.h.orig 2009-08-31 23:13:36.000000000 +0800 +++ aplay/formats.h 2009-09-15 01:22:05.000000000 +0800 @@ -1,8 +1,15 @@ #ifndef FORMATS_H #define FORMATS_H 1 +#ifdef __FreeBSD__ +#include +#define bswap_16(x) bswap16(x) +#define bswap_32(x) bswap32(x) +#define bswap_64(x) bswap64(x) +#else #include #include +#endif /* Definitions for .VOC files */ --- configure.orig 2009-08-31 23:14:25.000000000 +0800 +++ configure 2009-09-14 12:36:45.000000000 +0800 @@ -6480,7 +6480,7 @@ LDFLAGS="$LDFLAGS $ALSA_LIBS" fi -ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +ALSA_LIBS="$ALSA_LIBS -lasound -lm -lpthread" LIBS="$ALSA_LIBS $LIBS" { echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 echo "${ECHO_T}$ALSA_LIBS" >&6; } --- speaker-test/speaker-test.c.orig 2009-08-31 23:13:36.000000000 +0800 +++ speaker-test/speaker-test.c 2009-09-15 01:22:48.000000000 +0800 @@ -44,7 +44,9 @@ #include #include #include +#ifndef __FreeBSD__ #include +#endif #define ALSA_PCM_NEW_HW_PARAMS_API #define ALSA_PCM_NEW_SW_PARAMS_API