2016-11-27 07:02:42 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
2019-03-08 08:04:13 +00:00
|
|
|
# If this is set to true (via the environment) then CRC checking will be
|
|
|
|
# disabled in libogg giving fuzzers a better chance at finding something.
|
|
|
|
disable_ogg_crc ?= false
|
|
|
|
|
2016-11-27 07:02:42 +00:00
|
|
|
# Build libsndfile as a dynamic/shared library, but statically link to
|
2019-02-24 06:50:56 +00:00
|
|
|
# libFLAC, libogg, libopus and libvorbis
|
2016-11-27 07:02:42 +00:00
|
|
|
|
2020-08-04 11:52:58 +00:00
|
|
|
ogg_version = libogg-1.3.4
|
|
|
|
ogg_sha256sum = c163bc12bc300c401b6aa35907ac682671ea376f13ae0969a220f7ddf71893fe
|
2016-11-27 07:02:42 +00:00
|
|
|
|
2020-08-04 11:52:58 +00:00
|
|
|
vorbis_version = libvorbis-1.3.7
|
|
|
|
vorbis_sha256sum = b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b
|
2016-11-27 07:02:42 +00:00
|
|
|
|
2020-08-04 11:52:58 +00:00
|
|
|
flac_version = flac-1.3.3
|
|
|
|
flac_sha256sum = 213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748
|
2019-02-24 06:50:56 +00:00
|
|
|
|
2020-08-04 11:52:58 +00:00
|
|
|
opus_version = opus-1.3.1
|
|
|
|
opus_sha256sum = 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d
|
2016-11-27 07:02:42 +00:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Code follows.
|
|
|
|
|
|
|
|
ogg_tarball = $(ogg_version).tar.xz
|
|
|
|
vorbis_tarball = $(vorbis_version).tar.xz
|
|
|
|
flac_tarball = $(flac_version).tar.xz
|
2019-02-24 06:50:56 +00:00
|
|
|
opus_tarball = $(opus_version).tar.gz
|
2016-11-27 07:02:42 +00:00
|
|
|
|
|
|
|
download_url = http://downloads.xiph.org/releases/
|
|
|
|
tarball_dir = Build/Tarballs
|
|
|
|
stamp_dir = Build/Stamp
|
|
|
|
|
|
|
|
build_dir = $(shell pwd)/Build
|
2019-03-08 08:04:13 +00:00
|
|
|
config_options = --prefix=$(build_dir) --disable-shared --enable-option-checking
|
2016-11-27 07:02:42 +00:00
|
|
|
|
|
|
|
pwd = $(shell pwd)
|
|
|
|
|
|
|
|
help :
|
|
|
|
@echo
|
|
|
|
@echo "This script will build libsndfile as a dynamic/shared library but statically linked"
|
|
|
|
@echo "to libFLAC, libogg and libvorbis. It should work on Linux and Mac OS X. It might"
|
|
|
|
@echo "work on Windows with a correctly set up MinGW."
|
|
|
|
@echo
|
|
|
|
@echo "It requires all the normal build tools require to build libsndfile plus wget."
|
|
|
|
@echo
|
|
|
|
|
|
|
|
config : Build/Stamp/configure
|
|
|
|
|
|
|
|
build : Build/Stamp/build
|
|
|
|
|
|
|
|
clean :
|
2019-03-08 08:04:13 +00:00
|
|
|
rm -rf Build/flac-* Build/libogg-* Build/libvorbis-* Build/opus-*
|
2016-11-27 07:02:42 +00:00
|
|
|
rm -rf Build/bin Build/include Build/lib Build/share
|
2019-03-08 08:04:13 +00:00
|
|
|
rm -f Build/Stamp/install Build/Stamp/extract Build/Stamp/sha256sum Build/Stamp/build-ogg
|
2016-11-27 07:02:42 +00:00
|
|
|
|
|
|
|
Build/Stamp/init :
|
|
|
|
mkdir -p $(stamp_dir) $(tarball_dir)
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
Build/Tarballs/$(flac_tarball) : Build/Stamp/init
|
|
|
|
(cd $(tarball_dir) && wget $(download_url)flac/$(flac_tarball) -O $(flac_tarball))
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
Build/Tarballs/$(ogg_tarball) : Build/Stamp/init
|
|
|
|
(cd $(tarball_dir) && wget $(download_url)ogg/$(ogg_tarball) -O $(ogg_tarball))
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
Build/Tarballs/$(vorbis_tarball) : Build/Stamp/init
|
|
|
|
(cd $(tarball_dir) && wget $(download_url)vorbis/$(vorbis_tarball) -O $(vorbis_tarball))
|
|
|
|
touch $@
|
|
|
|
|
2019-02-24 06:50:56 +00:00
|
|
|
Build/Tarballs/$(opus_tarball) : Build/Stamp/init
|
|
|
|
(cd $(tarball_dir) && wget https://archive.mozilla.org/pub/opus/$(opus_tarball) -O $(opus_tarball))
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
Build/Stamp/tarballs : Build/Tarballs/$(flac_tarball) Build/Tarballs/$(ogg_tarball) Build/Tarballs/$(vorbis_tarball) Build/Tarballs/$(opus_tarball)
|
2016-11-27 07:02:42 +00:00
|
|
|
touch $@
|
|
|
|
|
2019-02-24 06:50:56 +00:00
|
|
|
Build/Stamp/sha256sum : Build/Stamp/tarballs
|
|
|
|
test `sha256sum $(tarball_dir)/$(ogg_tarball) | sed "s/ .*//"` = $(ogg_sha256sum)
|
|
|
|
test `sha256sum $(tarball_dir)/$(vorbis_tarball) | sed "s/ .*//"` = $(vorbis_sha256sum)
|
|
|
|
test `sha256sum $(tarball_dir)/$(flac_tarball) | sed "s/ .*//"` = $(flac_sha256sum)
|
|
|
|
test `sha256sum $(tarball_dir)/$(opus_tarball) | sed "s/ .*//"` = $(opus_sha256sum)
|
2016-11-27 07:02:42 +00:00
|
|
|
touch $@
|
|
|
|
|
2019-02-24 06:50:56 +00:00
|
|
|
Build/Stamp/extract : Build/Stamp/sha256sum
|
2019-03-08 08:04:13 +00:00
|
|
|
# (cd Build && tar xf Tarballs/$(ogg_tarball))
|
2016-11-27 07:02:42 +00:00
|
|
|
(cd Build && tar xf Tarballs/$(flac_tarball))
|
|
|
|
(cd Build && tar xf Tarballs/$(vorbis_tarball))
|
2019-02-24 06:50:56 +00:00
|
|
|
(cd Build && tar xf Tarballs/$(opus_tarball))
|
2016-11-27 07:02:42 +00:00
|
|
|
touch $@
|
|
|
|
|
2019-03-08 08:04:13 +00:00
|
|
|
Build/Stamp/build-ogg : Build/Stamp/sha256sum
|
|
|
|
ifeq ($(disable_ogg_crc), true)
|
|
|
|
echo "Ogg/CRC enabled"
|
|
|
|
(cd Build && git clone https://github.com/xiph/ogg $(ogg_version))
|
2022-09-24 10:51:49 +00:00
|
|
|
(cd Build/$(ogg_version) && autoreconf -vif && CFLAGS=-fPIC ./configure $(config_options) --disable-crc && make all install)
|
2019-03-08 08:04:13 +00:00
|
|
|
else
|
|
|
|
echo "Ogg/CRC disabled"
|
|
|
|
(cd Build && tar xf Tarballs/$(ogg_tarball))
|
2016-11-27 07:02:42 +00:00
|
|
|
(cd Build/$(ogg_version) && CFLAGS=-fPIC ./configure $(config_options) && make all install)
|
2019-03-08 08:04:13 +00:00
|
|
|
endif
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
Build/Stamp/install-libs : Build/Stamp/extract Build/Stamp/build-ogg
|
2016-11-27 07:02:42 +00:00
|
|
|
(cd Build/$(vorbis_version) && CFLAGS=-fPIC ./configure $(config_options) && make all install)
|
|
|
|
(cd Build/$(flac_version) && CFLAGS=-fPIC ./configure $(config_options) && make all install)
|
2019-02-24 06:50:56 +00:00
|
|
|
(cd Build/$(opus_version) && CFLAGS=-fPIC ./configure $(config_options) && make all install)
|
2016-11-27 07:02:42 +00:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
configure : configure.ac
|
2022-09-24 10:51:49 +00:00
|
|
|
autoreconf -vif
|
2016-11-27 07:02:42 +00:00
|
|
|
|
|
|
|
Build/Stamp/configure : Build/Stamp/install-libs configure
|
|
|
|
PKG_CONFIG_LIBDIR=Build/lib/pkgconfig ./configure
|
2019-02-24 06:50:56 +00:00
|
|
|
sed -i 's#^EXTERNAL_XIPH_CFLAGS.*#EXTERNAL_XIPH_CFLAGS = -I$(pwd)/Build/include#' Makefile
|
|
|
|
sed -i 's#^EXTERNAL_XIPH_LIBS.*#EXTERNAL_XIPH_LIBS = -static $(pwd)/Build/lib/libFLAC.la $(pwd)/Build/lib/libvorbis.la $(pwd)/Build/lib/libvorbisenc.la $(pwd)/Build/lib/libopus.la $(pwd)/Build/lib/libogg.la -dynamic #' Makefile
|
2016-11-27 07:02:42 +00:00
|
|
|
make clean
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
Build/Stamp/build : Build/Stamp/configure
|
|
|
|
make all check
|
|
|
|
touch $@
|
|
|
|
|