diff --git a/Makefile b/Makefile index 1750f494f8..e9df198f97 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,12 @@ ifeq ($(HAVE_ROAR), 1) endif ifeq ($(HAVE_AL), 1) OBJ += audio/openal.o +ifneq ($(findstring Darwin,$(shell uname -a)),) + LIBS += -framework OpenAL +else LIBS += -lopenal endif +endif ifeq ($(HAVE_JACK),1) OBJ += audio/jack.o LIBS += -ljack diff --git a/audio/openal.c b/audio/openal.c index a73308dc03..e556bc35f7 100644 --- a/audio/openal.c +++ b/audio/openal.c @@ -17,8 +17,15 @@ #include "driver.h" + +#ifdef __APPLE__ +#include +#include +#else #include #include +#endif + #include #include diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 19e397bf12..c3de3d0248 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -17,7 +17,13 @@ fi check_lib ALSA -lasound snd_pcm_open check_header OSS sys/soundcard.h -check_lib AL -lopenal alcOpenDevice + +if [ "$OS" = "Darwin" ]; then + check_lib AL "-framework OpenAL" alcOpenDevice +else + check_lib AL -lopenal alcOpenDevice +fi + check_lib RSOUND -lrsound rsd_init check_lib ROAR -lroar roar_vs_new check_lib JACK -ljack jack_client_open