PKGNAME=mpg123
PKGSEC=sound
PKGDES="A console-based MP3 player"
PKGDEP="alsa-lib jack libtool pulseaudio"
PKGDEP__RETRO="alsa-lib libtool"
PKGDEP__ARMV4="${PKGDEP__RETRO}"
PKGDEP__ARMV6HF="${PKGDEP__RETRO}"
PKGDEP__ARMV7HF="${PKGDEP__RETRO}"
PKGDEP__I486="${PKGDEP__RETRO}"
PKGDEP__LOONGSON2F="${PKGDEP__RETRO}"
PKGDEP__M68K="${PKGDEP__RETRO}"
PKGDEP__POWERPC="${PKGDEP__RETRO}"
PKGDEP__PPC64="${PKGDEP__RETRO}"

# Note:
#
# --with-seektable=1000: <size> choose size of seek index table
# (0 disables it), default 1000
#
# --disable-runtime-tables: calculate tables at runtime saving size at the
# expense of additional computation at load time
#
# --enable-portable: *only* enable portable (as in devices) APIs.   
AUTOTOOLS_AFTER=(
    '--enable-modules'
    '--enable-libmpg123'
    '--enable-libout123'
    '--enable-libout123-modules'
    '--enable-libsyn123'
    '--disable-debug'
    '--disable-xdebug'
    '--disable-nagging'
    '--enable-gapless'
    '--enable-fifo'
    '--enable-id3v2'
    '--enable-string'
    '--enable-icy'
    '--enable-ntom'
    '--enable-downsample'
    '--enable-feeder'
    '--enable-moreinfo'
    '--enable-messages'
    '--disable-runtime-tables'
    '--enable-new-huffman'
    '--enable-int-quality'
    '--enable-16bit'
    '--enable-8bit'
    '--enable-32bit'
    '--enable-real'
    '--enable-equalizer'
    '--enable-ieeefloat'
    '--enable-cases'
    '--enable-buffer'
    '--enable-newoldwritesample'
    '--enable-layer1'
    '--enable-layer2'
    '--enable-layer3'
    '--disable-portable'
    '--enable-largefile'
    '--enable-feature_report'
    '--enable-ipv6'
    '--enable-network'
    '--with-audio=alsa,jack,pulse'
    '--with-default-audio=pulse'
    '--with-optimization=2'
    '--with-seektable=1000'
    '--with-network=auto'
    '--with-cpu=generic'
)

# FIXME:
#
# --disable yasm: configure: error: Yasm for AVX is currently broken and might go away.
AUTOTOOLS_AFTER__AMD64=(
    "${AUTOTOOLS_AFTER[@]}"
    '--with-cpu=x86-64'
    '--disable-yasm'
)
# Note: Our AArch64 port requires NEON.
AUTOTOOLS_AFTER__ARM64=(
    "${AUTOTOOLS_AFTER[@]}"
    '--with-cpu=neon64'
)
AUTOTOOLS_AFTER__PPC64EL=(
    "${AUTOTOOLS_AFTER[@]}"
    '--with-cpu=altivec'
)


AUTOTOOLS_AFTER__RETRO=(
    "${AUTOTOOLS_AFTER[@]}"
    '--with-audio=alsa'
)
AUTOTOOLS_AFTER__ARMV4=(
    "${AUTOTOOLS_AFTER__RETRO[@]}"
    '--with-cpu=arm_nofpu'
)
AUTOTOOLS_AFTER__ARMV6HF=(
    "${AUTOTOOLS_AFTER__RETRO[@]}"
    '--with-cpu=arm_fpu'
)
AUTOTOOLS_AFTER__ARMV7HF=(
    "${AUTOTOOLS_AFTER__RETRO[@]}"
    '--with-cpu=neon'
)
AUTOTOOLS_AFTER__I486=(
    "${AUTOTOOLS_AFTER__RETRO[@]}"
    '--with-cpu=i486'
)
AUTOTOOLS_AFTER__PPC64=(
    "${AUTOTOOLS_AFTER__RETRO[@]}"
    '--with-cpu=altivec'
)

# Needed by Afterglow, whereas FAIL_ARCH defaults to mainline-only.
FAIL_ARCH="!(mainline|retro)"
