CONFIGURE: Add detection of liba52
This is for an experiment aiming to decode audio for the hi-res videos in Zork: Grand Inquisitor. I don't know if we want to add a dependency on liba52, but the license should allow us to include the code verbatim, if that's preferrable.
This commit is contained in:
parent
14bdaae4d5
commit
8b692f8d89
1 changed files with 52 additions and 1 deletions
53
configure
vendored
53
configure
vendored
|
@ -149,6 +149,7 @@ _sndio=auto
|
|||
_timidity=auto
|
||||
_zlib=auto
|
||||
_mpeg2=auto
|
||||
_a52=auto
|
||||
_sparkle=auto
|
||||
_osxdockplugin=auto
|
||||
_jpeg=auto
|
||||
|
@ -1046,7 +1047,10 @@ Optional Libraries:
|
|||
--with-mpeg2-prefix=DIR prefix where libmpeg2 is installed (optional)
|
||||
--enable-mpeg2 enable mpeg2 codec for cutscenes [autodetect]
|
||||
|
||||
--with-jpeg-prefix=DIR prefix where libjpeg is installed (optional)
|
||||
--with-a52-prefix=DIR Prefix where liba52 is installed (optional)
|
||||
--enable-a52 enable a52 codec for MPEG decoder [autodetect]
|
||||
|
||||
--with-jpeg-prefix=DIR Prefix where libjpeg is installed (optional)
|
||||
--disable-jpeg disable JPEG decoder [autodetect]
|
||||
|
||||
--with-png-prefix=DIR prefix where libpng is installed (optional)
|
||||
|
@ -1176,6 +1180,8 @@ for ac_option in $@; do
|
|||
--disable-nasm) _nasm=no ;;
|
||||
--enable-mpeg2) _mpeg2=yes ;;
|
||||
--disable-mpeg2) _mpeg2=no ;;
|
||||
--enable-a52) _a52=yes ;;
|
||||
--disable-a52) _a52=no ;;
|
||||
--disable-jpeg) _jpeg=no ;;
|
||||
--enable-jpeg) _jpeg=yes ;;
|
||||
--disable-png) _png=no ;;
|
||||
|
@ -1233,6 +1239,11 @@ for ac_option in $@; do
|
|||
MPEG2_CFLAGS="-I$arg/include"
|
||||
MPEG2_LIBS="-L$arg/lib"
|
||||
;;
|
||||
--with-a52-prefix=*)
|
||||
arg=`echo $ac_option | cut -d '=' -f 2`
|
||||
A52_CFLAGS="-I$arg/include"
|
||||
A52_LIBS="-L$arg/lib"
|
||||
;;
|
||||
--with-alsa-prefix=*)
|
||||
arg=`echo $ac_option | cut -d '=' -f 2`
|
||||
ALSA_CFLAGS="-I$arg/include"
|
||||
|
@ -4427,6 +4438,46 @@ fi
|
|||
define_in_config_if_yes "$_mpeg2" 'USE_MPEG2'
|
||||
echo "$_mpeg2"
|
||||
|
||||
#
|
||||
# Check for liba52
|
||||
#
|
||||
echocheck "liba52"
|
||||
if test "$_a52" = auto ; then
|
||||
_a52=no
|
||||
cat > $TMPC << EOF
|
||||
typedef signed $type_1_byte int8_t;
|
||||
typedef signed $type_2_byte int16_t;
|
||||
typedef signed $type_4_byte int32_t;
|
||||
|
||||
typedef unsigned $type_1_byte uint8_t;
|
||||
typedef unsigned $type_2_byte uint16_t;
|
||||
typedef unsigned $type_4_byte uint32_t;
|
||||
|
||||
extern "C" {
|
||||
#include <a52dec/a52.h>
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
a52_init(0);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
if test -n "$_host"; then
|
||||
# don't execute while cross compiling
|
||||
cc_check $A52_CFLAGS $A52_LIBS -la52 && _a52=yes
|
||||
else
|
||||
cc_check_no_clean $A52_CFLAGS $A52_LIBS -la52 && $TMPO$HOSTEXEEXT && _a52=yes
|
||||
cc_check_clean
|
||||
fi
|
||||
fi
|
||||
if test "$_a52" = yes ; then
|
||||
INCLUDES="$INCLUDES $A52_FLAGS"
|
||||
LIBS="$LIBS $A52_LIBS -la52"
|
||||
fi
|
||||
define_in_config_if_yes "$_a52" 'USE_A52'
|
||||
echo "$_a52"
|
||||
|
||||
#
|
||||
# Check for Sparkle if updates support is enabled
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue