Skip to content

Commit

Permalink
BUILD: Use pkg-config to check for OpenAL Soft
Browse files Browse the repository at this point in the history
macOS is still using Apple's OpenAL framework.
  • Loading branch information
DrMcCoy committed Jun 25, 2018
1 parent 700c4a7 commit 21491d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 35 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ dnl Graphic libraries
AX_CHECK_QT5(5.7.1, , AC_MSG_ERROR([Qt5 (>= 5.7.1, modules Core, Gui, Widgets) is required and could not be found!]))

dnl Sound libraries
AX_CHECK_AL( , AC_MSG_ERROR([OpenAL or OpenAL Soft (>= 1.12) is required and could not be found!]))
AX_CHECK_AL([1.12], , AC_MSG_ERROR([OpenAL Soft (>= 1.12) is required and could not be found!]))
AX_CHECK_MAD(0, 15, 1, , AC_MSG_ERROR([libMAD (>= 0.15.1) is required and could not be found!]))
AX_CHECK_OGG(, AC_MSG_ERROR([libOgg (>= 1.2.0) is required and could not be found!]))
AX_CHECK_VORBIS(, AC_MSG_ERROR([libVorbisFile (>= 1.3.1) is required and could not be found!]))
Expand Down
2 changes: 1 addition & 1 deletion dists/debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Copyright: 2017 Sven Hesse <[email protected]>
License: CC0-1.0

Files: m4/ax_check_al.m4
Copyright: 2013 Sven Hesse <[email protected]>
Copyright: 2013, 2018 Sven Hesse <[email protected]>
2013 Matthew Hoops <[email protected]>
License: CC0-1.0

Expand Down
40 changes: 7 additions & 33 deletions m4/ax_check_al.m4
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#serial 1000
dnl @synopsis AX_CHECK_AL(action-if, action-if-not)
#serial 1001
dnl @synopsis AX_CHECK_AL(version, action-if, action-if-not)
dnl
dnl @summary check for OpenAL Soft.
dnl @summary check for OpenAL (Soft).
dnl
dnl Defines AL_LIBS, AL_CFLAGS.
dnl
dnl @category InstalledPackages
dnl @author Sven Hesse <[email protected]>, Matthew Hoops <[email protected]>
dnl @version 2013-12-14
dnl @version 2018-06-19
dnl @license Creative Commons CC0 1.0 Universal Public Domain Dedication

AC_DEFUN([AX_CHECK_AL], [
AC_ARG_VAR(AL_CFLAGS, [C compiler flags for OpenAL Soft])
AC_ARG_VAR(AL_LIBS, [libraries to pass to the linker for OpenAL Soft])
AC_ARG_VAR(AL_CFLAGS, [C compiler flags for OpenAL (Soft)])
AC_ARG_VAR(AL_LIBS, [libraries to pass to the linker for OpenAL (Soft)])
case "$target" in
*darwin*)
Expand All @@ -24,39 +24,13 @@ AC_DEFUN([AX_CHECK_AL], [
if test -z "$AL_LIBS"; then
AL_LIBS="-framework OpenAL"
fi
noal=0
;;
*)
if test -z "$AL_CFLAGS"; then
AL_CFLAGS=""
fi
if test -z "$AL_LIBS"; then
AL_LIBS="-lopenal"
fi
save_CFLAGS="$CFLAGS"
save_CXXFLAGS="$CXXFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $AL_CFLAGS"
CXXFLAGS="$CXXFLAGS $AL_CFLAGS"
LIBS="$LIBS $AL_LIBS"
AC_CHECK_HEADER([AL/al.h], AC_CHECK_HEADER([AL/alc.h], noal=0, noal=1), noal=1)
CFLAGS="$save_CFLAGS"
CXXFLAGS="$save_CXXFLAGS"
LIBS="$save_LIBS"
PKG_CHECK_MODULES([AL], [openal >= $1], [$2], [$3])
;;
esac;
if test "$noal" = "1"; then
ifelse([$2], , :, [$2])
else
ifelse([$1], , :, [$1])
fi
AC_SUBST(AL_CFLAGS)
AC_SUBST(AL_LIBS)
])

0 comments on commit 21491d7

Please sign in to comment.