-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Linux build scripts, enable alsa, remove libpng dependency.
- Loading branch information
Showing
84 changed files
with
14,891 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/doxygen/html | ||
/doxygen/man | ||
|
||
/build | ||
|
||
*.o | ||
*.so | ||
*.so.* | ||
*.a | ||
|
||
/libs | ||
/obj | ||
|
||
/examples/audio.raw | ||
/examples/pcm-readi | ||
/examples/pcm-writei | ||
|
||
/utils/tinyplay | ||
/utils/tinycap | ||
/utils/tinymix | ||
/utils/tinypcminfo | ||
|
||
/bazel* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
os: linux | ||
dist: bionic | ||
sudo: false | ||
language: c | ||
compiler: | ||
- gcc | ||
- clang | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- doxygen | ||
- graphviz | ||
- python3-pip | ||
- python3-setuptools | ||
|
||
before_script: | ||
- pip3 install --upgrade pip | ||
- pip3 install --user ninja | ||
- pip3 install --user meson | ||
|
||
script: | ||
- scripts/travis-build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package { | ||
default_applicable_licenses: ["external_tinyalsa_new_license"], | ||
} | ||
|
||
// Added automatically by a large-scale-change that took the approach of | ||
// 'apply every license found to every target'. While this makes sure we respect | ||
// every license restriction, it may not be entirely correct. | ||
// | ||
// e.g. GPL in an MIT project might only apply to the contrib/ directory. | ||
// | ||
// Please consider splitting the single license below into multiple licenses, | ||
// taking care not to lose any license_kind information, and overriding the | ||
// default license using the 'licenses: [...]' property on targets as needed. | ||
// | ||
// For unused files, consider creating a 'fileGroup' with "//visibility:private" | ||
// to attach the license to, and including a comment whether the files may be | ||
// used in the current project. | ||
// See: http://go/android-license-faq | ||
license { | ||
name: "external_tinyalsa_new_license", | ||
visibility: [":__subpackages__"], | ||
license_kinds: [ | ||
"SPDX-license-identifier-BSD", | ||
"SPDX-license-identifier-Unlicense", | ||
], | ||
license_text: [ | ||
"NOTICE", | ||
], | ||
} | ||
|
||
cc_library { | ||
name: "libtinyalsav2", | ||
host_supported: true, | ||
vendor_available: true, | ||
srcs: [ | ||
"src/mixer.c", | ||
"src/mixer_hw.c", | ||
"src/mixer_plugin.c", | ||
"src/pcm.c", | ||
"src/pcm_hw.c", | ||
"src/pcm_plugin.c", | ||
"src/snd_card_plugin.c", | ||
], | ||
cflags: ["-Werror", "-Wno-macro-redefined"], | ||
export_include_dirs: ["include"], | ||
local_include_dirs: ["include"], | ||
|
||
target: { | ||
darwin: { | ||
enabled: false, | ||
}, | ||
}, | ||
|
||
system_shared_libs: ["libc", "libdl"], | ||
|
||
sanitize: { | ||
integer_overflow: true, | ||
misc_undefined: ["bounds"], | ||
diag: { | ||
integer_overflow: true, | ||
misc_undefined: ["bounds"], | ||
}, | ||
}, | ||
} | ||
|
||
cc_library_headers { | ||
name: "libtinyalsav2_headers", | ||
export_include_dirs: ["include"], | ||
vendor_available: true, | ||
} | ||
|
||
cc_binary { | ||
name: "tinyplay2", | ||
host_supported: true, | ||
srcs: ["utils/tinyplay.c"], | ||
static_libs: ["libtinyalsav2"], | ||
cflags: ["-Werror"], | ||
target: { | ||
darwin: { | ||
enabled: false, | ||
}, | ||
}, | ||
} | ||
|
||
cc_binary { | ||
name: "tinycap2", | ||
srcs: ["utils/tinycap.c"], | ||
static_libs: ["libtinyalsav2"], | ||
cflags: ["-Werror"], | ||
} | ||
|
||
cc_binary { | ||
name: "tinymix2", | ||
srcs: ["utils/tinymix.c"], | ||
static_libs: ["libtinyalsav2"], | ||
cflags: ["-Werror", "-Wall"], | ||
} | ||
|
||
cc_binary { | ||
name: "tinypcminfo2", | ||
srcs: ["utils/tinypcminfo.c"], | ||
static_libs: ["libtinyalsav2"], | ||
cflags: ["-Werror"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# BUILD | ||
# | ||
# Copyright 2020, The Android Open Source Project | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of The Android Open Source Project nor the names of | ||
# its contributors may be used to endorse or promote products derived | ||
# from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY The Android Open Source Project ``AS IS'' AND | ||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL The Android Open Source Project BE LIABLE | ||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
# DAMAGE. | ||
# | ||
|
||
cc_library( | ||
name = "tinyalsa", | ||
srcs = glob(["src/*.c"]), | ||
includes = ["include"], | ||
hdrs = glob([ | ||
"include/**/*.h", | ||
"src/*.h", | ||
]), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_test( | ||
name = "tinyalsa_tests", | ||
srcs = glob([ | ||
"tests/src/*.cc", | ||
"tests/include/*.h", | ||
]), | ||
includes = ["tests/include"], | ||
deps = [ | ||
"//:tinyalsa", | ||
"@googletest//:gtest_main" | ||
], | ||
linkopts = [ | ||
"-ldl", | ||
], | ||
copts = [ | ||
"-std=c++17", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/version.sh -s print | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
OUTPUT_VARIABLE TINYALSA_VERSION) | ||
|
||
project("TinyALSA" VERSION ${TINYALSA_VERSION} LANGUAGES C) | ||
|
||
set(CMAKE_C_STANDARD 99) | ||
set(CMAKE_C_STANDARD_REQUIRED ON) | ||
set(CMAKE_C_EXTENSIONS OFF) | ||
|
||
# Options | ||
option(BUILD_SHARED_LIBS "Build shared libraries" ON) | ||
option(TINYALSA_USES_PLUGINS "Whether or not to build with plugin support" OFF) | ||
option(TINYALSA_BUILD_EXAMPLES "Build examples" ON) | ||
option(TINYALSA_BUILD_UTILS "Build utility tools" ON) | ||
|
||
# Library | ||
add_library("tinyalsa" | ||
"src/pcm.c" | ||
"src/pcm_hw.c" | ||
"src/pcm_plugin.c" | ||
"src/snd_card_plugin.c" | ||
"src/mixer.c" | ||
"src/mixer_hw.c" | ||
"src/mixer_plugin.c") | ||
|
||
set_property(TARGET "tinyalsa" PROPERTY PUBLIC_HEADER | ||
"include/tinyalsa/attributes.h" | ||
"include/tinyalsa/version.h" | ||
"include/tinyalsa/asoundlib.h" | ||
"include/tinyalsa/pcm.h" | ||
"include/tinyalsa/plugin.h" | ||
"include/tinyalsa/mixer.h") | ||
|
||
set_target_properties("tinyalsa" PROPERTIES | ||
VERSION ${TinyALSA_VERSION} | ||
SOVERSION ${TinyALSA_VERSION_MAJOR}) | ||
|
||
target_include_directories("tinyalsa" PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include>) | ||
target_compile_definitions("tinyalsa" PRIVATE | ||
$<$<BOOL:${TINYALSA_USES_PLUGINS}>:TINYALSA_USES_PLUGINS> | ||
PUBLIC _POSIX_C_SOURCE=200809L) | ||
target_link_libraries("tinyalsa" PUBLIC ${CMAKE_DL_LIBS}) | ||
|
||
# Examples | ||
if(TINYALSA_BUILD_EXAMPLES) | ||
set(TINYALSA_EXAMPLES pcm-readi pcm-writei) | ||
else() | ||
set(TINYALSA_EXAMPLES) | ||
endif() | ||
|
||
foreach(EXAMPLE IN LISTS TINYALSA_EXAMPLES) | ||
add_executable("${EXAMPLE}" "examples/${EXAMPLE}.c") | ||
target_link_libraries("${EXAMPLE}" PRIVATE "tinyalsa") | ||
endforeach() | ||
|
||
# Utilities | ||
if(TINYALSA_BUILD_UTILS) | ||
set(TINYALSA_UTILS tinyplay tinycap tinypcminfo tinymix tinywavinfo) | ||
else() | ||
set(TINYALSA_UTILS) | ||
endif() | ||
|
||
foreach(UTIL IN LISTS TINYALSA_UTILS) | ||
add_executable("${UTIL}" "utils/${UTIL}.c") | ||
target_link_libraries("${UTIL}" PRIVATE "tinyalsa") | ||
endforeach() | ||
|
||
if(TINYALSA_BUILD_UTILS) | ||
target_link_libraries("tinywavinfo" PRIVATE m) | ||
endif() | ||
|
||
# Add C warning flags | ||
include(CheckCCompilerFlag) | ||
foreach(FLAG IN ITEMS -Wall -Wextra -Wpedantic -Werror -Wfatal-errors) | ||
string(TOUPPER "HAVE${FLAG}" HAVE_VAR) | ||
string(REPLACE "-" "_" HAVE_VAR "${HAVE_VAR}") | ||
check_c_compiler_flag("${FLAG}" "${HAVE_VAR}") | ||
if("${${HAVE_VAR}}") | ||
target_compile_options("tinyalsa" PRIVATE "${FLAG}") | ||
foreach(UTIL IN LISTS TINYALSA_UTILS) | ||
target_compile_options("${UTIL}" PRIVATE "${FLAG}") | ||
endforeach() | ||
endif() | ||
endforeach() | ||
|
||
# Install | ||
include(GNUInstallDirs) | ||
install(TARGETS "tinyalsa" ${TINYALSA_UTILS} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tinyalsa) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NOTICE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
third_party { | ||
license_type: NOTICE | ||
} |
Empty file.
Oops, something went wrong.