Commit 0a8e9edb authored by Rye Mutt's avatar Rye Mutt 🍞

vendor source libogg-1.3.4 libvorbis-1.3.7

parent 7d0d44ea
Version 1.3.4 (2019 August 30)
* Faster slice-by-8 CRC32 implementation.
see https://lwn.net/Articles/453931/ for motivation.
* Add CMake build.
* Deprecate Visual Studio project files in favor of CMake.
* configure --disable-crc option for fuzzing.
* Various build fixes.
* Documentation and example code fixes.
Version 1.3.3 (2017 November 7)
* Fix and issue with corrupt continued packet handling.
* Fix an issue with corrupt continued packet handling.
* Update Windows projects and build settings.
* Remove Mac OS 9 build support.
......@@ -82,7 +92,7 @@ Version 1.1 (2003 November 17)
* big-endian bitpacker routines for Theora
* various portability fixes
* improved API documenation
* improved API documentation
* RFC 3533 documentation of the format by Silvia Pfeiffer at CSIRO
* RFC 3534 documentation of the application/ogg mime-type by Linus Walleij
......
cmake_minimum_required(VERSION 2.8.12)
project(libogg)
# Required modules
include(GNUInstallDirs)
include(CheckIncludeFiles)
include(CMakePackageConfigHelpers)
include(CTest)
# Build options
option(BUILD_SHARED_LIBS "Build shared library" OFF)
if(APPLE)
option(BUILD_FRAMEWORK "Build Framework bundle for OSX" OFF)
endif()
# Install options
option(INSTALL_DOCS "Install documentation" ON)
option(INSTALL_PKG_CONFIG_MODULE "Install ogg.pc file" ON)
option(INSTALL_CMAKE_PACKAGE_MODULE "Install CMake package configiguration module" ON)
# Extract project version from configure.ac
file(READ configure.ac CONFIGURE_AC_CONTENTS)
string(REGEX MATCH "AC_INIT\\(\\[libogg\\],\\[([0-9]*).([0-9]*).([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})
set(PROJECT_VERSION_MINOR ${CMAKE_MATCH_2})
set(PROJECT_VERSION_PATCH ${CMAKE_MATCH_3})
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
# Extract library version from configure.ac
string(REGEX MATCH "LIB_CURRENT=([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(LIB_CURRENT ${CMAKE_MATCH_1})
string(REGEX MATCH "LIB_AGE=([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(LIB_AGE ${CMAKE_MATCH_1})
string(REGEX MATCH "LIB_REVISION=([0-9]*)" DUMMY ${CONFIGURE_AC_CONTENTS})
set(LIB_REVISION ${CMAKE_MATCH_1})
math(EXPR LIB_SOVERSION "${LIB_CURRENT} - ${LIB_AGE}")
set(LIB_VERSION "${LIB_SOVERSION}.${LIB_AGE}.${LIB_REVISION}")
# Helper function to configure pkg-config files
function(configure_pkg_config_file pkg_config_file_in)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_FULL_BINDIR})
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(VERSION ${PROJECT_VERSION})
string(REPLACE ".in" "" pkg_config_file ${pkg_config_file_in})
configure_file(${pkg_config_file_in} ${pkg_config_file} @ONLY)
endfunction()
message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
# Configure config_type.h
check_include_files(inttypes.h INCLUDE_INTTYPES_H)
check_include_files(stdint.h INCLUDE_STDINT_H)
check_include_files(sys/types.h INCLUDE_SYS_TYPES_H)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(SIZE16 int16_t)
set(USIZE16 uint16_t)
set(SIZE32 int32_t)
set(USIZE32 uint32_t)
set(SIZE64 int64_t)
set(USIZE64 uint64_t)
include(CheckSizes)
configure_file(include/ogg/config_types.h.in include/ogg/config_types.h @ONLY)
set(OGG_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/include/ogg/config_types.h
include/ogg/ogg.h
include/ogg/os_types.h
)
set(OGG_SOURCES
src/bitwise.c
src/framing.c
src/crctable.h
)
if(WIN32 AND BUILD_SHARED_LIBS)
list(APPEND OGG_SOURCES win32/ogg.def)
endif()
if(BUILD_FRAMEWORK)
set(BUILD_SHARED_LIBS TRUE)
endif()
add_library(ogg ${OGG_HEADERS} ${OGG_SOURCES})
target_include_directories(ogg PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
set_target_properties(
ogg PROPERTIES
SOVERSION ${LIB_SOVERSION}
VERSION ${LIB_VERSION}
PUBLIC_HEADER "${OGG_HEADERS}"
)
if(BUILD_FRAMEWORK)
set_target_properties(ogg PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION ${PROJECT_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER org.xiph.ogg
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION}
MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
OUTPUT_NAME Ogg
)
endif()
configure_pkg_config_file(ogg.pc.in)
install(TARGETS ogg
EXPORT OggTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ogg
)
if(INSTALL_CMAKE_PACKAGE_MODULE)
set(CMAKE_INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Ogg)
install(EXPORT OggTargets
DESTINATION ${CMAKE_INSTALL_CONFIGDIR}
NAMESPACE Ogg::
)
include(CMakePackageConfigHelpers)
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/OggConfig.cmake.in ${PROJECT_BINARY_DIR}/OggConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_CONFIGDIR}
PATH_VARS CMAKE_INSTALL_FULL_INCLUDEDIR
)
write_basic_package_version_file(${PROJECT_BINARY_DIR}/OggConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES ${PROJECT_BINARY_DIR}/OggConfig.cmake ${PROJECT_BINARY_DIR}/OggConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_CONFIGDIR}
)
endif()
if(INSTALL_PKG_CONFIG_MODULE)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ogg.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
endif()
if(INSTALL_DOCS)
set(OGG_DOCS
doc/framing.html
doc/index.html
doc/oggstream.html
doc/ogg-multiplex.html
doc/fish_xiph_org.png
doc/multiplex1.png
doc/packets.png
doc/pages.png
doc/stream.png
doc/vorbisword2.png
doc/white-ogg.png
doc/white-xifish.png
doc/rfc3533.txt
doc/rfc5334.txt
doc/skeleton.html
)
install(FILES ${OGG_DOCS} DESTINATION ${CMAKE_INSTALL_DOCDIR}/html)
install(DIRECTORY doc/libogg DESTINATION ${CMAKE_INSTALL_DOCDIR}/html)
endif()
if(BUILD_TESTING)
add_executable(test_bitwise src/bitwise.c ${OGG_HEADERS})
target_compile_definitions(test_bitwise PRIVATE _V_SELFTEST)
target_include_directories(test_bitwise PRIVATE
include
${CMAKE_CURRENT_BINARY_DIR}/include
)
add_test(NAME test_bitwise COMMAND $<TARGET_FILE:test_bitwise>)
add_executable(test_framing src/framing.c ${OGG_HEADERS})
target_compile_definitions(test_framing PRIVATE _V_SELFTEST)
target_include_directories(test_framing PRIVATE
include
${CMAKE_CURRENT_BINARY_DIR}/include
)
add_test(NAME test_framing COMMAND $<TARGET_FILE:test_framing>)
endif()
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
include(CPack)
......@@ -3,6 +3,7 @@
#AUTOMAKE_OPTIONS = foreign 1.6 dist-zip
AUTOMAKE_OPTIONS = foreign 1.11 dist-zip dist-xz
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src include doc
......@@ -15,7 +16,7 @@ pkgconfig_DATA = ogg.pc
EXTRA_DIST = README.md AUTHORS CHANGES COPYING \
libogg.spec libogg.spec.in \
ogg.m4 ogg.pc.in ogg-uninstalled.pc.in \
macosx win32
macosx win32 CMakeLists.txt cmake
dist-hook:
for item in $(EXTRA_DIST); do \
......@@ -25,6 +26,17 @@ dist-hook:
echo "OK"; \
fi; \
done
# Verify cmake works with the dist tarball.
cmake_builddir = _build.cmake
distcheck-hook:
$(RM) -rf $(cmake_builddir)
mkdir $(cmake_builddir)
cd $(cmake_builddir) && cmake ../$(top_distdir)
cd $(cmake_builddir) && cmake --build .
cd $(cmake_builddir) && ctest
$(RM) -rf $(cmake_builddir)
debug:
$(MAKE) all CFLAGS="@DEBUG@"
......
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -90,7 +90,10 @@ build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
......@@ -164,7 +167,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
......@@ -190,7 +193,7 @@ DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/libogg.spec.in $(srcdir)/ogg-uninstalled.pc.in \
$(srcdir)/ogg.pc.in AUTHORS COPYING compile config.guess \
config.sub install-sh ltmain.sh missing
config.sub depcomp install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
......@@ -311,6 +314,7 @@ SIZE64 = @SIZE64@
STRIP = @STRIP@
USIZE16 = @USIZE16@
USIZE32 = @USIZE32@
USIZE64 = @USIZE64@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
......@@ -367,6 +371,7 @@ top_srcdir = @top_srcdir@
#AUTOMAKE_OPTIONS = foreign 1.6 dist-zip
AUTOMAKE_OPTIONS = foreign 1.11 dist-zip dist-xz
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src include doc
m4datadir = $(datadir)/aclocal
m4data_DATA = ogg.m4
......@@ -375,8 +380,11 @@ pkgconfig_DATA = ogg.pc
EXTRA_DIST = README.md AUTHORS CHANGES COPYING \
libogg.spec libogg.spec.in \
ogg.m4 ogg.pc.in ogg-uninstalled.pc.in \
macosx win32
macosx win32 CMakeLists.txt cmake
# Verify cmake works with the dist tarball.
cmake_builddir = _build.cmake
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
......@@ -402,8 +410,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
......@@ -593,7 +601,10 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
......@@ -724,6 +735,7 @@ distcheck: dist
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
......@@ -921,6 +933,14 @@ dist-hook:
echo "OK"; \
fi; \
done
distcheck-hook:
$(RM) -rf $(cmake_builddir)
mkdir $(cmake_builddir)
cd $(cmake_builddir) && cmake ../$(top_distdir)
cd $(cmake_builddir) && cmake --build .
cd $(cmake_builddir) && ctest
$(RM) -rf $(cmake_builddir)
debug:
$(MAKE) all CFLAGS="@DEBUG@"
......
......@@ -92,12 +92,14 @@ be found in those source modules' README files)
Ogg supports building using [CMake](http://www.cmake.org/). CMake is a meta build system that generates native projects for each platform.
To generate projects just run cmake replacing `YOUR-PROJECT-GENERATOR` with a proper generator from a list [here](http://www.cmake.org/cmake/help/v3.2/manual/cmake-generators.7.html):
cmake -G YOUR-PROJECT-GENERATOR .
mkdir build
cd build
cmake -G YOUR-PROJECT-GENERATOR ..
Note that by default cmake generates projects that will build static libraries.
To generate projects that will build dynamic library use `BUILD_SHARED_LIBS` option like this:
cmake -G YOUR-PROJECT-GENERATOR -DBUILD_SHARED_LIBS=1 .
cmake -G YOUR-PROJECT-GENERATOR -DBUILD_SHARED_LIBS=1 ..
After projects are generated use them as usual
......@@ -105,19 +107,19 @@ After projects are generated use them as usual
Use proper generator for your Visual Studio version like:
cmake -G "Visual Studio 12 2013" .
cmake -G "Visual Studio 12 2013" ..
#### Building on Mac OS X ####
Use Xcode generator. To build framework run:
cmake -G Xcode -DBUILD_FRAMEWORK=1 .
cmake -G Xcode -DBUILD_FRAMEWORK=1 ..
#### Building on Linux ####
Use Makefile generator which is default one.
cmake .
cmake ..
make
## License ##
......@@ -127,5 +129,5 @@ USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS
GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE
IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.
THE OggVorbis SOURCE CODE IS COPYRIGHT (C) 1994-2015
THE OggVorbis SOURCE CODE IS COPYRIGHT (C) 1994-2019
by the Xiph.Org Foundation https://www.xiph.org/
This diff is collapsed.
include(CheckTypeSize)
check_type_size("int16_t" INT16_SIZE LANGUAGE C)
check_type_size("uint16_t" UINT16_SIZE LANGUAGE C)
check_type_size("u_int16_t" U_INT16_SIZE LANGUAGE C)
check_type_size("int32_t" INT32_SIZE LANGUAGE C)
check_type_size("uint32_t" UINT32_SIZE LANGUAGE C)
check_type_size("u_int32_t" U_INT32_SIZE LANGUAGE C)
check_type_size("int64_t" INT64_SIZE LANGUAGE C)
check_type_size("short" SHORT_SIZE LANGUAGE C)
check_type_size("int" INT_SIZE LANGUAGE C)
check_type_size("long" LONG_SIZE LANGUAGE C)
check_type_size("long long" LONG_LONG_SIZE LANGUAGE C)
if(INT16_SIZE EQUAL 2)
set(SIZE16 "int16_t")
elseif(SHORT_SIZE EQUAL 2)
set(SIZE16 "short")
elseif(INT_SIZE EQUAL 2)
set(SIZE16 "int")
else()
message(FATAL_ERROR "No 16 bit type found on this platform!")
endif()
if(UINT16_SIZE EQUAL 2)
set(USIZE16 "uint16_t")
elseif(SHORT_SIZE EQUAL 2)
set(USIZE16 "unsigned short")
elseif(INT_SIZE EQUAL 2)
set(USIZE16 "unsigned int")
elseif(U_INT_SIZE EQUAL 2)
set(USIZE16 "u_int16_t")
else()
message(FATAL_ERROR "No unsigned 16 bit type found on this platform!")
endif()
if(INT32_SIZE EQUAL 4)
set(SIZE32 "int32_t")
elseif(SHORT_SIZE EQUAL 4)
set(SIZE32 "short")
elseif(INT_SIZE EQUAL 4)
set(SIZE32 "int")
elseif(LONG_SIZE EQUAL 4)