diff options
author | pav <pav@FreeBSD.org> | 2010-01-26 03:15:18 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2010-01-26 03:15:18 +0800 |
commit | dfee6d5c62ab6b269042d70b16ee7a2529db951e (patch) | |
tree | be83fbf870c86e4040bbca6fff53505cd1e7c8e2 /Mk | |
parent | 4c40a810f99571b1f539a6fbd7c3a13147bb82c0 (diff) | |
download | freebsd-ports-gnome-dfee6d5c62ab6b269042d70b16ee7a2529db951e.tar.gz freebsd-ports-gnome-dfee6d5c62ab6b269042d70b16ee7a2529db951e.tar.zst freebsd-ports-gnome-dfee6d5c62ab6b269042d70b16ee7a2529db951e.zip |
- Introduce USE_OPENAL variable for OpenAL consumers
- Switch to openal-soft as a default OpenAL implementation
PR: ports/142123
Submitted by: mva
Tested by: pointyhat exp-run
Approved by: portmgr (hat)
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/bsd.port.mk | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index e8c127332688..4b0336defeae 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -395,6 +395,12 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org # USE_SDL - If set, this port uses the sdl libraries. # See bsd.sdl.mk for more information. ## +# USE_OPENAL - If set, this port relies on the OpenAL package. +# Legal values are: al, soft, si, alut. +# If set to an unknown value, the port is marked broken. +# WANT_OPENAL - User-specific OpenAL wishes. +# Legal values are: soft, si. The default is soft. +## # USE_OPENSSL - If set, this port relies on the OpenSSL package. ## # USE_OPENLDAP - If set, this port uses the OpenLDAP libraries. @@ -1744,6 +1750,83 @@ CONFIGURE_ENV+= MAKE=${GMAKE} .include "${PORTSDIR}/Mk/bsd.ldap.mk" .endif +.if defined(USE_OPENAL) +_OPENAL_ALL= al si soft alut +_OPENAL_LIBS= si soft +# Default choie. +_DEFAULT_OPENAL= soft + +_OPENAL_SOFT= openal.1:${PORTSDIR}/audio/openal-soft +_OPENAL_SI= openal.0:${PORTSDIR}/audio/openal +_OPENAL_ALUT= alut.1:${PORTSDIR}/audio/freealut + +.if exists(${LOCALBASE}/lib/libopenal.a) +_HAVE_OPENAL= si +.elif exists(${LOCALBASE}/bin/openal-info) +_HAVE_OPENAL= soft +.endif + +.if ${USE_OPENAL} == "yes" +# Be friendly. +USE_OPENAL= ${_DEFAULT_OPENAL} +.endif + +__USED_OPENAL= +_USE_OPENAL= +.for component in ${USE_OPENAL} +.if ${__USED_OPENAL:M${component}} == "" +__USED_OPENAL+= ${component} + +.if ${_OPENAL_ALL:M${component}} == "" +BROKEN= OPENAL mismatch: unknown component ${component} +.elif ${_OPENAL_ALL:M${component}} == "al" + +# Check if the user wish matches the found OpenAL system. +.if defined(WANT_OPENAL) && defined(_HAVE_OPENAL) && ${_HAVE_OPENAL} != ${WANT_OPENAL} +BROKEN= OPENAL mismatch: ${_HAVE_OPENAL} is installed, but ${WANT_OPENAL} desired +.endif # WANT_OPENAL + +.if defined(_HAVE_OPENAL) +_OPENAL_SYSTEM= ${_HAVE_OPENAL} +.elif defined(WANT_OPENAL) +_OPENAL_SYSTEM= ${WANT_OPENAL} +.else +_OPENAL_SYSTEM= ${_DEFAULT_OPENAL} +.endif # _HAVE_OPENAL + +_USE_OPENAL+= ${_OPENAL_${_OPENAL_SYSTEM:U}} + +.else # ${_OPENAL_ALL:M${component}} == "" + +.if ${_OPENAL_LIBS:M${component}} == ${component} +# Check for the system implementation to use. +.if defined(WANT_OPENAL) && ${WANT_OPENAL} != ${component} +BROKEN= OPENAL mismatch: wants to use ${component}, while you wish to use ${WANT_OPENAL} +.endif +.if defined(_OPENAL_SYSTEM) +BROKEN= OPENAL mismatch: cannot use ${component} and al together. +.endif +.if defined(_HAVE_OPENAL) && ${_HAVE_OPENAL} != ${component} +BROKEN= OPENAL mismatch: wants to use ${component}, but ${_HAVE_OPENAL} is installed +.endif + +_OPENAL_SYSTEM= ${component} + +.endif # ${_OPENAL_LIBS:M${component}} == ${component} + +_USE_OPENAL+= ${_OPENAL_${component:U}} + +.endif # ${_OPENAL_ALL:M${component}} == "" + +.endif # ${__USED_OPENAL:M${component} == "" +.endfor # component in ${USE_OPENAL} + +.for dep in ${_USE_OPENAL} +LIB_DEPENDS+= ${dep} +.endfor + +.endif # USE_OPENAL + .if defined(USE_FAM) DEFAULT_FAM_SYSTEM= gamin # Currently supported FAM systems |