build with Meson instead of autotools

So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
This commit is contained in:
Max Kellermann 2017-12-29 17:12:55 +01:00
parent 13ce142df1
commit 94592c1406
111 changed files with 4039 additions and 7270 deletions

2
.gitignore vendored
View File

@ -33,7 +33,7 @@ tags
/libtool /libtool
/ltmain.sh /ltmain.sh
/mkinstalldirs /mkinstalldirs
/build /output/
/src/mpd /src/mpd
/systemd/system/mpd.service /systemd/system/mpd.service
/systemd/user/mpd.service /systemd/user/mpd.service

View File

@ -9,12 +9,23 @@ matrix:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- sourceline: 'ppa:mhier/libboost-latest' - sourceline: 'ppa:mhier/libboost-latest'
- sourceline: 'ppa:saiarcot895/chromium-dev' # for ninja-build
- sourceline: 'ppa:deadsnakes/ppa' # for Python 3.7 (required by Meson)
packages: packages:
- g++-6 - g++-6
- libcppunit-dev - libcppunit-dev
- boost1.67 - boost1.67
- python3.6
- python3-urllib3
- ninja-build
before_install:
- wget https://bootstrap.pypa.io/get-pip.py
- /usr/bin/python3.6 get-pip.py --user
install:
- /usr/bin/python3.6 $HOME/.local/bin/pip install --user meson
env: env:
- MATRIX_EVAL="export CC=gcc-6 CXX=g++-6" # use gold as workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=17068
- MATRIX_EVAL="export CC=gcc-6 CXX=g++-6 LDFLAGS=-fuse-ld=gold PATH=$HOME/.local/bin:$PATH"
- os: linux - os: linux
dist: trusty dist: trusty
@ -23,22 +34,29 @@ matrix:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- sourceline: 'ppa:mhier/libboost-latest' - sourceline: 'ppa:mhier/libboost-latest'
- sourceline: 'ppa:saiarcot895/chromium-dev' # for ninja-build
- sourceline: 'ppa:deadsnakes/ppa' # for Python 3.7 (required by Meson)
packages: packages:
- g++-8 - g++-8
- libcppunit-dev - libcppunit-dev
- boost1.67 - boost1.67
- python3.6
- python3-urllib3
- ninja-build
before_install:
- wget https://bootstrap.pypa.io/get-pip.py
- /usr/bin/python3.6 get-pip.py --user
install:
- /usr/bin/python3.6 $HOME/.local/bin/pip install --user meson
env: env:
- MATRIX_EVAL="export CC=gcc-8 CXX=g++-8" # use gold as workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=17068
- MATRIX_EVAL="export CC=gcc-8 CXX=g++-8 LDFLAGS=-fuse-ld=gold PATH=$HOME/.local/bin:$PATH"
- os: osx - os: osx
osx_image: xcode9.3beta osx_image: xcode9.3beta
env: env:
- MATRIX_EVAL="" - MATRIX_EVAL=""
env:
global:
- MAKEFLAGS="-j2"
cache: cache:
- apt - apt
- ccache - ccache
@ -50,16 +68,14 @@ before_install:
install: install:
# C++14 # C++14
- test "$TRAVIS_OS_NAME" != "osx" || brew install cppunit ccache - test "$TRAVIS_OS_NAME" != "osx" || brew install cppunit ccache meson
before_script: before_script:
- ccache -s - ccache -s
script: script:
- OPTIONS="--enable-test" - eval "${MATRIX_EVAL}"
- test "$TRAVIS_OS_NAME" != "osx" || OPTIONS="$OPTIONS --enable-osx" - OPTIONS="-Dtest=true"
- ./autogen.sh - meson . output --werror $OPTIONS
- ./configure CC="ccache $CC" CXX="ccache $CXX" --disable-silent-rules --disable-dependency-tracking $OPTIONS - ninja -C output -v test
- make
- make check
- ccache -s - ccache -s

File diff suppressed because it is too large Load Diff

1
NEWS
View File

@ -46,6 +46,7 @@ ver 0.21 (not yet released)
- opus: support for sending metadata using ogg stream chaining - opus: support for sending metadata using ogg stream chaining
* systemd watchdog support * systemd watchdog support
* require GCC 6 * require GCC 6
* build with Meson instead of autotools
ver 0.20.22 (not yet released) ver 0.20.22 (not yet released)
* storage * storage

View File

@ -0,0 +1,21 @@
#!/bin/sh -e
S=`dirname "$0"`
ANDROID_ABI=$1
STRIP=$2
ZIP=$3
UNSIGNED_APK=$4
LIBMPD_SO=$5
CLASSES_DEX=$6
RESOURCES_APK=$7
D=`dirname "$UNSIGNED_APK"`
rm -rf "$D/apk"
mkdir -p "$D/apk/lib/$ANDROID_ABI"
"$STRIP" "$LIBMPD_SO" -o "$D/apk/lib/$ANDROID_ABI/`basename $LIBMPD_SO`"
cp "$CLASSES_DEX" "$D/apk/"
cp "$RESOURCES_APK" "$UNSIGNED_APK"
cd "$D/apk"
exec zip -q -r "../`basename $UNSIGNED_APK`" .

59
android/apk/meson.build Normal file
View File

@ -0,0 +1,59 @@
unsigned_apk = custom_target(
'mpd-unsigned.apk',
output: 'mpd-unsigned.apk',
input: [mpd, classes_dex, resources_apk[0]],
command: [
join_paths(meson.current_source_dir(), 'make-unsigned-apk.sh'),
android_abi,
get_option('android_strip'),
zip,
'@OUTPUT0@',
'@INPUT@',
],
)
if get_option('android_debug_keystore') != ''
debug_apk = custom_target(
'mpd-debug.apk',
output: 'mpd-debug.apk',
input: unsigned_apk,
command: [
jarsigner,
'-keystore', get_option('android_debug_keystore'),
'-storepass', 'android',
'-signedjar', '@OUTPUT@',
'@INPUT@',
'androiddebugkey',
],
build_by_default: true
)
endif
if get_option('android_keystore') != '' and get_option('android_keyalias') != '' and get_option('android_keypass') != ''
unaligned_apk = custom_target(
'mpd-unaligned.apk',
output: 'mpd-unaligned.apk',
input: unsigned_apk,
command: [
jarsigner,
'-digestalg', 'SHA1', '-sigalg', 'MD5withRSA',
'-keystore', get_option('android_keystore'),
'-storepass', get_option('android_keypass'),
'-signedjar', '@OUTPUT@',
'@INPUT@',
get_option('android_keyalias'),
],
)
apk = custom_target(
'mpd.apk',
output: 'mpd.apk',
input: unaligned_apk,
command: [
android_zipalign,
'-f', '4',
'@INPUT@', '@OUTPUT@',
],
build_by_default: true
)
endif

View File

@ -57,6 +57,7 @@ sys.path[0] = os.path.join(mpd_path, 'python')
# output directories # output directories
from build.dirs import lib_path, tarball_path, src_path from build.dirs import lib_path, tarball_path, src_path
from build.meson import configure as run_meson
arch_path = os.path.join(lib_path, arch) arch_path = os.path.join(lib_path, arch)
build_path = os.path.join(arch_path, 'build') build_path = os.path.join(arch_path, 'build')
@ -144,7 +145,15 @@ class AndroidNdkToolchain:
# redirect pkg-config to use our root directory instead of the # redirect pkg-config to use our root directory instead of the
# default one on the build host # default one on the build host
self.env['PKG_CONFIG_LIBDIR'] = os.path.join(install_prefix, 'lib/pkgconfig') import shutil
bin_dir = os.path.join(install_prefix, 'bin')
try:
os.makedirs(bin_dir)
except:
pass
self.pkg_config = shutil.copy(os.path.join(mpd_path, 'build', 'pkg-config.sh'),
os.path.join(bin_dir, 'pkg-config'))
self.env['PKG_CONFIG'] = self.pkg_config
# a list of third-party libraries to be used by MPD on Android # a list of third-party libraries to be used by MPD on Android
from build.libs import * from build.libs import *
@ -173,32 +182,13 @@ for x in thirdparty_libs:
toolchain = AndroidNdkToolchain(tarball_path, src_path, build_path, toolchain = AndroidNdkToolchain(tarball_path, src_path, build_path,
use_cxx=True) use_cxx=True)
configure = [ configure_args += [
os.path.join(mpd_path, 'configure'), '-Dandroid_sdk=' + sdk_path,
'CC=' + toolchain.cc, '-Dandroid_ndk=' + ndk_path,
'CXX=' + toolchain.cxx, '-Dandroid_abi=' + android_abi,
'CFLAGS=' + toolchain.cflags, '-Dandroid_strip=' + toolchain.strip,
'CXXFLAGS=' + toolchain.cxxflags, ]
'CPPFLAGS=' + toolchain.cppflags,
'LDFLAGS=' + toolchain.ldflags,
'LIBS=' + toolchain.libs,
'AR=' + toolchain.ar,
'RANLIB=' + toolchain.ranlib,
'STRIP=' + toolchain.strip,
'--host=' + toolchain.arch,
'--prefix=' + toolchain.install_prefix,
'--with-sysroot=' + toolchain.sysroot,
'--with-android-sdk=' + sdk_path,
'--enable-silent-rules', from build.meson import configure as run_meson
run_meson(toolchain, mpd_path, '.', configure_args)
'--disable-icu', subprocess.check_call(['/usr/bin/ninja'], env=toolchain.env)
] + configure_args
from build.cmdline import concatenate_cmdline_variables
configure = concatenate_cmdline_variables(configure,
set(('CFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'LDFLAGS', 'LIBS')))
subprocess.check_call(configure, env=toolchain.env)
subprocess.check_call(['/usr/bin/make', '--quiet', '-j12'], env=toolchain.env)

24
android/make-resources-apk.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh -e
S=`dirname "$0"`
AAPT=$1
BASE_JAR=$2
JAVA_PKG=$3
JAVA_PKG_PATH=$4
APK_FILE="$5"
D=`dirname "$APK_FILE"`
rm -rf "$D/res"
mkdir -p "$D/res/drawable" "$D/src"
cp "$D/icon.png" "$D/notification_icon.png" "$D/res/drawable/"
"$AAPT" package -f -m --auto-add-overlay \
--custom-package "$JAVA_PKG" \
-M "$S/AndroidManifest.xml" \
-S "$D/res" \
-S "$S/res" \
-J "$D/src" \
-I "$BASE_JAR" \
-F "$D/resources.apk"
cp "$D/src/$JAVA_PKG_PATH/R.java" "$D/"

140
android/meson.build Normal file
View File

@ -0,0 +1,140 @@
android_package = 'org.musicpd'
android_package_path = join_paths(android_package.split('.'))
android_ndk = get_option('android_ndk')
android_sdk = get_option('android_sdk')
android_abi = get_option('android_abi')
android_sdk_build_tools_version = '27.0.0'
android_sdk_platform = 'android-21'
android_build_tools_dir = join_paths(android_sdk, 'build-tools', android_sdk_build_tools_version)
android_sdk_platform_dir = join_paths(android_sdk, 'platforms', android_sdk_platform)
android_aidl = join_paths(android_build_tools_dir, 'aidl')
android_aapt = join_paths(android_build_tools_dir, 'aapt')
android_dx = join_paths(android_build_tools_dir, 'dx')
android_zipalign = join_paths(android_build_tools_dir, 'zipalign')
javac = find_program('javac')
jarsigner = find_program('jarsigner')
rsvg_convert = find_program('rsvg-convert')
convert = find_program('convert')
zip = find_program('zip')
common_cppflags += '-I' + join_paths(meson.current_build_dir(), 'include')
#
# AIDL
#
IMainCallback_java = custom_target(
'IMainCallback.java',
output: 'IMainCallback.java',
input: join_paths(meson.current_source_dir(), 'src', 'IMainCallback.aidl'),
command: [
join_paths(meson.current_source_dir(), 'run-aidl.sh'),
android_aidl,
'@INPUT@',
'@OUTPUT@',
join_paths(meson.current_build_dir(), 'src'),
android_package_path,
],
)
IMain_java = custom_target(
'IMain.java',
output: 'IMain.java',
input: join_paths(meson.current_source_dir(), 'src', 'IMain.aidl'),
depends: IMainCallback_java,
command: [
join_paths(meson.current_source_dir(), 'run-aidl.sh'),
android_aidl,
'@INPUT@',
'@OUTPUT@',
join_paths(meson.current_build_dir(), 'src'),
android_package_path,
],
)
#
# Resources
#
android_icon = custom_target(
'Android icon',
output: 'icon.png',
input: '../mpd.svg',
command: [
rsvg_convert, '--width=48', '--height=48', '@INPUT@', '-o', '@OUTPUT@',
],
)
android_notification_icon = custom_target(
'Android notification icon',
output: 'notification_icon.png',
input: android_icon,
command: [
convert, '@INPUT@', '-colorspace', 'Gray', '-gamma', '2.2', '@OUTPUT@',
],
)
resources_apk = custom_target(
'resources.apk',
output: ['resources.apk', 'R.java'],
input: [
'res/layout/custom_notification_gb.xml',
'res/layout/log_item.xml',
'res/layout/settings.xml',
'res/values/strings.xml',
android_icon,
android_notification_icon,
],
command: [
join_paths(meson.current_source_dir(), 'make-resources-apk.sh'),
android_aapt,
join_paths(android_sdk_platform_dir, 'android.jar'),
android_package,
android_package_path,
'@OUTPUT0@',
],
)
#
# Compile Java
#
classes_jar = custom_target(
'classes.jar',
output: 'classes.jar',
input: [
'src/Bridge.java',
'src/Loader.java',
'src/Main.java',
'src/Receiver.java',
'src/Settings.java',
IMain_java,
IMainCallback_java,
resources_apk[1],
],
command: [
join_paths(meson.current_source_dir(), 'run-javac.sh'),
javac,
join_paths(android_sdk_platform_dir, 'android.jar'),
android_package_path,
zip,
'@OUTPUT@',
'@INPUT@',
],
)
classes_dex = custom_target(
'classes.dex',
output: 'classes.dex',
input: classes_jar,
command: [
android_dx,
'--dex', '--output', '@OUTPUT@',
'@INPUT@',
],
)

12
android/run-aidl.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh -e
AIDL=$1
SRC=$2
DST=$3
GENSRC=$4
JAVA_PKG_PATH=$5
mkdir -p "$GENSRC/$JAVA_PKG_PATH"
cp "$SRC" "$GENSRC/$JAVA_PKG_PATH/"
"$AIDL" -I"$GENSRC" -o"$GENSRC" "$GENSRC/$JAVA_PKG_PATH/`basename $SRC`"
exec cp "$GENSRC/$JAVA_PKG_PATH/`basename $DST`" "$DST"

22
android/run-javac.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh -e
JAVAC=$1
CLASSPATH=$2
JAVA_PKG_PATH=$3
ZIP=$4
JARFILE=`realpath "$5"`
shift 5
D=`dirname "$JARFILE"`
GENSRC="$D/src"
GENCLASS="$D/classes"
GENINCLUDE="$D/include"
mkdir -p "$GENSRC/$JAVA_PKG_PATH"
"$JAVAC" -source 1.6 -target 1.6 -Xlint:-options \
-cp "$CLASSPATH" \
-h "$GENINCLUDE" \
-d "$GENCLASS" \
"$@"
cd "$GENCLASS"
zip -q -r "$JARFILE" .

9
build/pkg-config.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh -e
BIN=`dirname $0`
ROOT=`dirname "$BIN"`
export PKG_CONFIG_DIR=
export PKG_CONFIG_LIBDIR="${ROOT}/lib/pkgconfig:${ROOT}/share/pkgconfig"
exec /usr/bin/pkg-config "$@"

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,8 @@ If you already have a clone, update it:
You can do without :option:`--rebase`, but we recommend that you rebase your repository on the "master" repository all the time. You can do without :option:`--rebase`, but we recommend that you rebase your repository on the "master" repository all the time.
Configure with the options :option:`--enable-debug --enable-werror`. Enable as many plugins as possible, to be sure that you don't break any disabled code. Configure with the option :option:`--werror`. Enable as many plugins
as possible, to be sure that you don't break any disabled code.
Don't mix several changes in one single patch. Create a separate patch for every change. Tools like :program:`stgit` help you with that. This way, we can review your patches more easily, and we can pick the patches we like most first. Don't mix several changes in one single patch. Create a separate patch for every change. Tools like :program:`stgit` help you with that. This way, we can review your patches more easily, and we can pick the patches we like most first.

49
doc/meson.build Normal file
View File

@ -0,0 +1,49 @@
install_man(['mpd.1', 'mpd.conf.5'])
sphinx = find_program('sphinx-build')
sphinx_output = custom_target(
'HTML documentation',
output: 'html',
input: [
'index.rst', 'user.rst', 'developer.rst',
'conf.py',
],
command: [sphinx, '-q', '-b', 'html', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@'],
build_by_default: true,
install: true,
install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()),
)
xmlto = find_program('xmlto')
xmlto_output = custom_target(
'Protocol documentation',
output: 'protocol',
input: 'protocol.xml',
command: [
xmlto, '-o', '@OUTPUT@',
'--stringparam=chunker.output.encoding=utf-8',
'html',
'--stringparam=use.id.as.filename=1',
'@INPUT@',
],
build_by_default: true,
install: true,
install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()),
)
custom_target(
'upload',
input: [sphinx_output, xmlto_output],
output: 'upload',
build_always_stale: true,
command: [
'rsync', '-vpruz', '--delete', meson.current_source_dir(),
'www.musicpd.org:/var/www/mpd/doc/',
'--chmod=Dug+rwx,Do+rx,Fug+rw,Fo+r',
'--include=protocol', '--include=protocol/**',
'--include=html', '--include=html/**',
'--exclude=*',
],
)

View File

@ -47,6 +47,8 @@ Download the source tarball from the `MPD home page <https://musicpd.org>`_ and
In any case, you need: In any case, you need:
* a C++14 compiler (e.g. gcc 6.0 or clang 3.9) * a C++14 compiler (e.g. gcc 6.0 or clang 3.9)
* `Meson 0.47 <http://mesonbuild.com/>`__ and `Ninja
<https://ninja-build.org/>`__
* Boost 1.58 * Boost 1.58
* pkg-config * pkg-config
@ -87,44 +89,54 @@ Now configure the source tree:
.. code-block:: none .. code-block:: none
./configure meson . output/release --buildtype=debugpotimized -Db_ndebug=true
The :option:`--help` argument shows a list of compile-time options. When everything is ready and configured, compile: The following command shows a list of compile-time options:
.. code-block:: none .. code-block:: none
make meson configure output/release
When everything is ready and configured, compile:
.. code-block:: none
ninja -C output/release
And install: And install:
.. code-block:: none .. code-block:: none
make install ninja -C output/release install
Compiling for Windows Compiling for Windows
--------------------- ---------------------
Even though it does not "feel" like a Windows application, :program:`MPD` works well under Windows. Its build process follows the "Linux style" and may seem awkward for Windows people (who are not used to compiling their software, anyway). Even though it does not "feel" like a Windows application, :program:`MPD` works well under Windows. Its build process follows the "Linux style" and may seem awkward for Windows people (who are not used to compiling their software, anyway).
Basically, there are three ways to compile :program:`MPD` for Windows: Basically, there are two ways to compile :program:`MPD` for Windows:
* Build on Windows for Windows. All you need to do is described above already: configure and make. * Build as described above: with :program:`meson` and
:program:`ninja`. To cross-compile from Linux, you need `a Meson
cross file <https://mesonbuild.com/Cross-compilation.html>`__.
For Windows users, this is kind of unusual, because few Windows users have a GNU toolchain and a UNIX shell installed. The remaining difficulty is installing all the external libraries.
And :program:`MPD` usually needs many, making this method cumbersome
* Build on Linux for Windows. This is described above already: configure and make. You need the :program:`mingw-w64` cross compiler. Pass :option:`--host=i686-w64-mingw32` (32 bit) or :option:`--host=x86_64-w64-mingw32` (64 bit) to configure. for the casual user.
This is somewhat natural for Linux users. Many distributions have mingw-w64 packages. The remaining difficulty here is installing all the external libraries. And :program:`MPD` usually needs many, making this method cumbersome for the casual user.
* Build on Linux for Windows using :program:`MPD`'s library build script. * Build on Linux for Windows using :program:`MPD`'s library build script.
This section is about the latter. This section is about the latter.
Just like with the native build, unpack the :program:`MPD` source tarball and change into the directory. Then, instead of ./configure, type: Just like with the native build, unpack the :program:`MPD` source
tarball and change into the directory. Then, instead of
:program:`meson`, type:
.. code-block:: none .. code-block:: none
./win32/build.py --64 mkdir -p output/win64
cd output/win64
../../win32/build.py --64
This downloads various library sources, and then configures and builds :program:`MPD` (for x64; to build a 32 bit binary, pass :option:`--32`). The resulting EXE files is linked statically, i.e. it contains all the libraries already and you do not need carry DLLs around. It is large, but easy to use. If you wish to have a small mpd.exe with DLLs, you need to compile manually, without the :file:`build.py` script. This downloads various library sources, and then configures and builds :program:`MPD` (for x64; to build a 32 bit binary, pass :option:`--32`). The resulting EXE files is linked statically, i.e. it contains all the libraries already and you do not need carry DLLs around. It is large, but easy to use. If you wish to have a small mpd.exe with DLLs, you need to compile manually, without the :file:`build.py` script.
@ -138,12 +150,17 @@ You need:
* Android SDK * Android SDK
* Android NDK * Android NDK
Just like with the native build, unpack the :program:`MPD` source tarball and change into the directory. Then, instead of ./configure, type: Just like with the native build, unpack the :program:`MPD` source
tarball and change into the directory. Then, instead of
:program:`meson`, type:
.. code-block:: none .. code-block:: none
./android/build.py SDK_PATH NDK_PATH ABI mkdir -p output/android
make android/build/mpd-debug.apk cd output/android
../../android/build.py SDK_PATH NDK_PATH ABI
meson configure -Dandroid_debug_keystore=$HOME/.android/debug.keystore
ninja android/apk/mpd-debug.apk
:envvar:`SDK_PATH` is the absolute path where you installed the Android SDK; :envvar:`NDK_PATH` is the Android NDK installation path; ABI is the Android ABI to be built, e.g. "armeabi-v7a". :envvar:`SDK_PATH` is the absolute path where you installed the Android SDK; :envvar:`NDK_PATH` is the Android NDK installation path; ABI is the Android ABI to be built, e.g. "armeabi-v7a".
@ -154,7 +171,10 @@ systemd socket activation
Using systemd, you can launch :program:`MPD` on demand when the first client attempts to connect. Using systemd, you can launch :program:`MPD` on demand when the first client attempts to connect.
:program:`MPD` comes with two systemd unit files: a "service" unit and a "socket" unit. These will only be installed when :program:`MPD` was configured with :option:`--with-systemdsystemunitdir=/lib/systemd/system`. :program:`MPD` comes with two systemd unit files: a "service" unit and
a "socket" unit. These will be installed to the directory specified
with :option:`-Dsystemd_system_unit_dir=...`,
e.g. :file:`/lib/systemd/system`.
To enable socket activation, type: To enable socket activation, type:
@ -168,7 +188,11 @@ In this configuration, :program:`MPD` will ignore the :dfn:`bind_to_address` and
systemd user unit systemd user unit
----------------- -----------------
You can launch :program:`MPD` as a systemd user unit. The service file will only be installed when :program:`MPD` was configured with :option:`--with-systemduserunitdir=/usr/lib/systemd/user` or :option:`--with-systemduserunitdir=$HOME/.local/share/systemd/user`. You can launch :program:`MPD` as a systemd user unit. These will be
installed to the directory specified with
:option:`-Dsystemd_user_unit_dir=...`,
e.g. :file:`/usr/lib/systemd/user` or
:file:`$HOME/.local/share/systemd/user`.
Once the user unit is installed, you can start and stop :program:`MPD` like any other service: Once the user unit is installed, you can start and stop :program:`MPD` like any other service:
@ -529,7 +553,10 @@ The State File
The Sticker Database The Sticker Database
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
"Stickers" are pieces of information attached to songs. Some clients use them to store ratings and other volatile data. This feature requires :program:`SQLite`, compile-time configure option :option:`--enable-sqlite.` "Stickers" are pieces of information attached to songs. Some clients
use them to store ratings and other volatile data. This feature
requires :program:`SQLite`, compile-time configure option
:option:`-Dsqlite`.
.. list-table:: .. list-table::
:widths: 20 80 :widths: 20 80
@ -579,7 +606,10 @@ Do not change these unless you know what you are doing.
Zeroconf Zeroconf
~~~~~~~~ ~~~~~~~~
If Zeroconf support (`Avahi <http://avahi.org/>`_ or Apple's Bonjour) was enabled at compile time with :option:`--with-zeroconf=...`, :program:`MPD` can announce its presence on the network. The following settings control this feature: If Zeroconf support (`Avahi <http://avahi.org/>`_ or Apple's Bonjour)
was enabled at compile time with :option:`-Dzeroconf=...`,
:program:`MPD` can announce its presence on the network. The following
settings control this feature:
.. list-table:: .. list-table::
:widths: 20 80 :widths: 20 80

View File

@ -1,67 +0,0 @@
# ============================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
# ============================================================================
#
# SYNOPSIS
#
# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# For every FLAG1, FLAG2 it is checked whether the compiler works with the
# flag. If it does, the flag is added FLAGS-VARIABLE
#
# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
# CFLAGS) is used. During the check the flag is always added to the
# current language's flags.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: This macro depends on the AX_APPEND_FLAG and
# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
# AX_APPEND_LINK_FLAGS.
#
# LICENSE
#
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 6
AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for flag in $1; do
AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
done
])dnl AX_APPEND_COMPILE_FLAGS

View File

@ -1,71 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
#
# DESCRIPTION
#
# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
# added in between.
#
# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
# FLAG.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 7
AC_DEFUN([AX_APPEND_FLAG],
[dnl
AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
AS_VAR_SET_IF(FLAGS,[
AS_CASE([" AS_VAR_GET(FLAGS) "],
[*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
[
AS_VAR_APPEND(FLAGS,[" $1"])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
],
[
AS_VAR_SET(FLAGS,[$1])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
AS_VAR_POPDEF([FLAGS])dnl
])dnl AX_APPEND_FLAG

View File

@ -1,65 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# For every FLAG1, FLAG2 it is checked whether the linker works with the
# flag. If it does, the flag is added FLAGS-VARIABLE
#
# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
# used. During the check the flag is always added to the linker's flags.
#
# If EXTRA-FLAGS is defined, it is added to the linker's default flags
# when the check is done. The check is thus made with the flags: "LDFLAGS
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
#
# LICENSE
#
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 6
AC_DEFUN([AX_APPEND_LINK_FLAGS],
[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for flag in $1; do
AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
done
])dnl AX_APPEND_LINK_FLAGS

View File

@ -1,285 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# DESCRIPTION
#
# Test for the Boost C++ libraries of a particular version (or newer)
#
# If no path to the installed boost library is given the macro searchs
# under /usr, /usr/local, /opt and /opt/local and evaluates the
# $BOOST_ROOT environment variable. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
#
# And sets:
#
# HAVE_BOOST
#
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2009 Peter Adolphs
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 27
AC_DEFUN([AX_BOOST_BASE],
[
AC_ARG_WITH([boost],
[AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
[use Boost library from a standard location (ARG=yes),
from the specified location (ARG=<path>),
or disable it (ARG=no)
@<:@ARG=yes@:>@ ])],
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ac_boost_path=""
else
want_boost="yes"
ac_boost_path="$withval"
fi
],
[want_boost="yes"])
AC_ARG_WITH([boost-libdir],
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
[Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
[
if test -d "$withval"
then
ac_boost_lib_path="$withval"
else
AC_MSG_ERROR(--with-boost-libdir expected directory name)
fi
],
[ac_boost_lib_path=""]
)
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
boost_lib_version_req_sub_minor="0"
fi
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
succeeded=no
dnl On 64-bit systems check for system libraries in both lib64 and lib.
dnl The former is specified by FHS, but e.g. Debian does not adhere to
dnl this (as it rises problems for generic multi-arch support).
dnl The last entry in the list is chosen by default when no libraries
dnl are found, e.g. when only header-only libraries are installed!
libsubdirs="lib"
ax_arch=`uname -m`
case $ax_arch in
x86_64)
libsubdirs="lib64 libx32 lib lib64"
;;
ppc64|s390x|sparc64|aarch64|ppc64le)
libsubdirs="lib64 lib lib64"
;;
esac
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
dnl them priority over the other paths since, if libs are found there, they
dnl are almost assuredly the ones desired.
AC_REQUIRE([AC_CANONICAL_HOST])
libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
case ${host_cpu} in
i?86)
libsubdirs="lib/i386-${host_os} $libsubdirs"
;;
esac
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
BOOST_CPPFLAGS="-I$ac_boost_path/include"
for ac_boost_path_tmp in $libsubdirs; do
if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
break
fi
done
elif test "$cross_compiling" != yes; then
for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
for libsubdir in $libsubdirs ; do
if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
break;
fi
done
fi
dnl overwrite ld flags if we have required special directory with
dnl --with-boost-libdir parameter
if test "$ac_boost_lib_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_lib_path"
fi
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_REQUIRE([AC_PROG_CXX])
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
BOOST_CPPFLAGS=
BOOST_LDFLAGS=
_version=0
if test "$ac_boost_path" != ""; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
fi
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
dnl if nothing found search for layout used in Windows distributions
if test -z "$BOOST_CPPFLAGS"; then
if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
BOOST_CPPFLAGS="-I$ac_boost_path"
fi
fi
fi
else
if test "$cross_compiling" != yes; then
for ac_boost_path in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
best_path=$ac_boost_path
fi
done
fi
done
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
if test "$ac_boost_lib_path" = ""; then
for libsubdir in $libsubdirs ; do
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
BOOST_LDFLAGS="-L$best_path/$libsubdir"
fi
fi
if test "x$BOOST_ROOT" != "x"; then
for libsubdir in $libsubdirs ; do
if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
V_CHECK=`expr $stage_version_shorten \>\= $_version`
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
BOOST_CPPFLAGS="-I$BOOST_ROOT"
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
fi
fi
fi
fi
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
# execute ACTION-IF-NOT-FOUND (if present):
ifelse([$3], , :, [$3])
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
# execute ACTION-IF-FOUND (if present):
ifelse([$2], , :, [$2])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,74 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 5
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS

View File

@ -1,74 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the linker or gives an error.
# (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the linker's default flags
# when the check is done. The check is thus made with the flags: "LDFLAGS
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_LINK_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 5
AC_DEFUN([AX_CHECK_LINK_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
ax_check_save_flags=$LDFLAGS
LDFLAGS="$LDFLAGS $4 $1"
AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
LDFLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_LINK_FLAGS

View File

@ -1,982 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
# -std=c++11). If neither is specified, you get whatever works, with
# preference for an extended mode.
#
# The third argument, if specified 'mandatory' or if left unspecified,
# indicates that baseline support for the specified C++ standard is
# required and that the macro should error out if no mode with that
# support is found. If specified 'optional', then configuration proceeds
# regardless, after defining HAVE_CXX${VERSION} if and only if a
# supporting mode is found.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
# Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 7
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
AX_REQUIRE_DEFINED([AC_MSG_WARN])
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
[$1], [14], [ax_cxx_compile_alternatives="14 1y"],
[$1], [17], [ax_cxx_compile_alternatives="17 1z"],
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$2], [], [],
[$2], [ext], [],
[$2], [noext], [],
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
[$3], [optional], [ax_cxx_compile_cxx$1_required=false],
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
AC_LANG_PUSH([C++])dnl
ac_success=no
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
ax_cv_cxx_compile_cxx$1,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[ax_cv_cxx_compile_cxx$1=yes],
[ax_cv_cxx_compile_cxx$1=no])])
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
ac_success=yes
fi
m4_if([$2], [noext], [], [dnl
if test x$ac_success = xno; then
for alternative in ${ax_cxx_compile_alternatives}; do
switch="-std=gnu++${alternative}"
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
fi])
m4_if([$2], [ext], [], [dnl
if test x$ac_success = xno; then
dnl HP's aCC needs +std=c++11 according to:
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
dnl Cray's crayCC needs "-h std=c++11"
for alternative in ${ax_cxx_compile_alternatives}; do
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
if test x$ac_success = xyes; then
break
fi
done
fi])
AC_LANG_POP([C++])
if test x$ax_cxx_compile_cxx$1_required = xtrue; then
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
fi
fi
if test x$ac_success = xno; then
HAVE_CXX$1=0
AC_MSG_NOTICE([No compiler with C++$1 support was found])
else
HAVE_CXX$1=1
AC_DEFINE(HAVE_CXX$1,1,
[define if the compiler supports basic C++$1 syntax])
fi
AC_SUBST(HAVE_CXX$1)
m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])])
])
dnl Test body for checking C++11 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
)
dnl Test body for checking C++14 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
)
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
)
dnl Tests for new features in C++11
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual void f() {}
};
struct Derived : public Base
{
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check<void> single_type;
typedef check<check<void>> double_type;
typedef check<check<check<void>>> triple_type;
typedef check<check<check<check<void>>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same<T, T>
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same<int, decltype(0)>::value == true, "");
static_assert(is_same<int, decltype(c)>::value == false, "");
static_assert(is_same<int, decltype(v)>::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same<int, decltype(ac)>::value == true, "");
static_assert(is_same<int, decltype(av)>::value == true, "");
static_assert(is_same<int, decltype(sumi)>::value == true, "");
static_assert(is_same<int, decltype(sumf)>::value == false, "");
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template <int...>
struct sum;
template <int N0, int... N1toN>
struct sum<N0, N1toN...>
{
static constexpr auto value = N0 + sum<N1toN...>::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template<typename T>
using member = typename T::member_type;
template<typename T>
void func(...) {}
template<typename T>
void func(member<T>*) {}
void test();
void test() { func<foo>(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
]])
dnl Tests for new features in C++14
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
// If the compiler admits that it is not ready for C++14, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201402L
#error "This is not a C++14 compiler"
#else
namespace cxx14
{
namespace test_polymorphic_lambdas
{
int
test()
{
const auto lambda = [](auto&&... args){
const auto istiny = [](auto x){
return (sizeof(x) == 1UL) ? 1 : 0;
};
const int aretiny[] = { istiny(args)... };
return aretiny[0];
};
return lambda(1, 1L, 1.0f, '1');
}
}
namespace test_binary_literals
{
constexpr auto ivii = 0b0000000000101010;
static_assert(ivii == 42, "wrong value");
}
namespace test_generalized_constexpr
{
template < typename CharT >
constexpr unsigned long
strlen_c(const CharT *const s) noexcept
{
auto length = 0UL;
for (auto p = s; *p; ++p)
++length;
return length;
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("x") == 1UL, "");
static_assert(strlen_c("test") == 4UL, "");
static_assert(strlen_c("another\0test") == 7UL, "");
}
namespace test_lambda_init_capture
{
int
test()
{
auto x = 0;
const auto lambda1 = [a = x](int b){ return a + b; };
const auto lambda2 = [a = lambda1(x)](){ return a; };
return lambda2();
}
}
namespace test_digit_separators
{
constexpr auto ten_million = 100'000'000;
static_assert(ten_million == 100000000, "");
}
namespace test_return_type_deduction
{
auto f(int& x) { return x; }
decltype(auto) g(int& x) { return x; }
template < typename T1, typename T2 >
struct is_same
{
static constexpr auto value = false;
};
template < typename T >
struct is_same<T, T>
{
static constexpr auto value = true;
};
int
test()
{
auto x = 0;
static_assert(is_same<int, decltype(f(x))>::value, "");
static_assert(is_same<int&, decltype(g(x))>::value, "");
return x;
}
}
} // namespace cxx14
#endif // __cplusplus >= 201402L
]])
dnl Tests for new features in C++17
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
// If the compiler admits that it is not ready for C++17, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus <= 201402L
#error "This is not a C++17 compiler"
#else
#if defined(__clang__)
#define REALLY_CLANG
#else
#if defined(__GNUC__)
#define REALLY_GCC
#endif
#endif
#include <initializer_list>
#include <utility>
#include <type_traits>
namespace cxx17
{
#if !defined(REALLY_CLANG)
namespace test_constexpr_lambdas
{
// TODO: test it with clang++ from git
constexpr int foo = [](){return 42;}();
}
#endif // !defined(REALLY_CLANG)
namespace test::nested_namespace::definitions
{
}
namespace test_fold_expression
{
template<typename... Args>
int multiply(Args... args)
{
return (args * ... * 1);
}
template<typename... Args>
bool all(Args... args)
{
return (args && ...);
}
}
namespace test_extended_static_assert
{
static_assert (true);
}
namespace test_auto_brace_init_list
{
auto foo = {5};
auto bar {5};
static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
static_assert(std::is_same<int, decltype(bar)>::value);
}
namespace test_typename_in_template_template_parameter
{
template<template<typename> typename X> struct D;
}
namespace test_fallthrough_nodiscard_maybe_unused_attributes
{
int f1()
{
return 42;
}
[[nodiscard]] int f2()
{
[[maybe_unused]] auto unused = f1();
switch (f1())
{
case 17:
f1();
[[fallthrough]];
case 42:
f1();
}
return f1();
}
}
namespace test_extended_aggregate_initialization
{
struct base1
{
int b1, b2 = 42;
};
struct base2
{
base2() {
b3 = 42;
}
int b3;
};
struct derived : base1, base2
{
int d;
};
derived d1 {{1, 2}, {}, 4}; // full initialization
derived d2 {{}, {}, 4}; // value-initialized bases
}
namespace test_general_range_based_for_loop
{
struct iter
{
int i;
int& operator* ()
{
return i;
}
const int& operator* () const
{
return i;
}
iter& operator++()
{
++i;
return *this;
}
};
struct sentinel
{
int i;
};
bool operator== (const iter& i, const sentinel& s)
{
return i.i == s.i;
}
bool operator!= (const iter& i, const sentinel& s)
{
return !(i == s);
}
struct range
{
iter begin() const
{
return {0};
}
sentinel end() const
{
return {5};
}
};
void f()
{
range r {};
for (auto i : r)
{
[[maybe_unused]] auto v = i;
}
}
}
namespace test_lambda_capture_asterisk_this_by_value
{
struct t
{
int i;
int foo()
{
return [*this]()
{
return i;
}();
}
};
}
namespace test_enum_class_construction
{
enum class byte : unsigned char
{};
byte foo {42};
}
namespace test_constexpr_if
{
template <bool cond>
int f ()
{
if constexpr(cond)
{
return 13;
}
else
{
return 42;
}
}
}
namespace test_selection_statement_with_initializer
{
int f()
{
return 13;
}
int f2()
{
if (auto i = f(); i > 0)
{
return 3;
}
switch (auto i = f(); i + 4)
{
case 17:
return 2;
default:
return 1;
}
}
}
#if !defined(REALLY_CLANG)
namespace test_template_argument_deduction_for_class_templates
{
// TODO: test it with clang++ from git
template <typename T1, typename T2>
struct pair
{
pair (T1 p1, T2 p2)
: m1 {p1},
m2 {p2}
{}
T1 m1;
T2 m2;
};
void f()
{
[[maybe_unused]] auto p = pair{13, 42u};
}
}
#endif // !defined(REALLY_CLANG)
namespace test_non_type_auto_template_parameters
{
template <auto n>
struct B
{};
B<5> b1;
B<'a'> b2;
}
#if !defined(REALLY_CLANG)
namespace test_structured_bindings
{
// TODO: test it with clang++ from git
int arr[2] = { 1, 2 };
std::pair<int, int> pr = { 1, 2 };
auto f1() -> int(&)[2]
{
return arr;
}
auto f2() -> std::pair<int, int>&
{
return pr;
}
struct S
{
int x1 : 2;
volatile double y1;
};
S f3()
{
return {};
}
auto [ x1, y1 ] = f1();
auto& [ xr1, yr1 ] = f1();
auto [ x2, y2 ] = f2();
auto& [ xr2, yr2 ] = f2();
const auto [ x3, y3 ] = f3();
}
#endif // !defined(REALLY_CLANG)
#if !defined(REALLY_CLANG)
namespace test_exception_spec_type_system
{
// TODO: test it with clang++ from git
struct Good {};
struct Bad {};
void g1() noexcept;
void g2();
template<typename T>
Bad
f(T*, T*);
template<typename T1, typename T2>
Good
f(T1*, T2*);
static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
}
#endif // !defined(REALLY_CLANG)
namespace test_inline_variables
{
template<class T> void f(T)
{}
template<class T> inline T g(T)
{
return T{};
}
template<> inline void f<>(int)
{}
template<> int g<>(int)
{
return 5;
}
}
} // namespace cxx17
#endif // __cplusplus <= 201402L
]])

View File

@ -1,34 +0,0 @@
# =============================================================================
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html
# =============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++14
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++14. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 5
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])])

View File

@ -1,485 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise). (This
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 24
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on Tru64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
CC="$ax_pthread_save_CC"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
# (Note: HP C rejects this with "bad form for `-t' option")
# -pthreads: Solaris/gcc (Note: HP C also rejects)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case $host_os in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (N.B.: The stubs are missing
# pthread_cleanup_push, or rather a function called by this macro,
# so we could check for that, but who knows whether they'll stub
# that too in a future libc.) So we'll check first for the
# standard Solaris way of linking pthreads (-mt -lpthread).
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
;;
esac
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $host_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
# Are we compiling with Clang?
AC_CACHE_CHECK([whether $CC is Clang],
[ax_cv_PTHREAD_CLANG],
[ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
AX_PTHREAD_CC_IS_CLANG
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
ax_pthread_clang_warning=no
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
PTHREAD_CFLAGS="-pthread"
PTHREAD_LIBS=
ax_pthread_ok=yes
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-mt,pthread)
AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
PTHREAD_CFLAGS="-mt"
PTHREAD_LIBS="-lpthread"
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
# if $ax_pthread_check_cond
# error "$ax_pthread_check_macro must be defined"
# endif
static void routine(void *a) { a = 0; }
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
AC_MSG_RESULT([$ax_pthread_ok])
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$ax_pthread_ok" = "xyes"; then
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_CACHE_CHECK([for joinable pthread attribute],
[ax_cv_PTHREAD_JOINABLE_ATTR],
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $ax_pthread_attr; return attr /* ; */])],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
[])
done
])
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $host_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
])
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
test "x$ax_pthread_special_flags_added" != "xyes"],
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes])
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != "xyes"; then
case $host_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
;;
esac
fi
fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD

View File

@ -1,37 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_REQUIRE_DEFINED(MACRO)
#
# DESCRIPTION
#
# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
# been defined and thus are available for use. This avoids random issues
# where a macro isn't expanded. Instead the configure script emits a
# non-fatal:
#
# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
#
# It's like AC_REQUIRE except it doesn't expand the required macro.
#
# Here's an example:
#
# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
#
# LICENSE
#
# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 2
AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
])dnl AX_REQUIRE_DEFINED

View File

@ -1,143 +0,0 @@
# libgcrypt.m4 - Autoconf macros to detect libgcrypt
# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Last-changed: 2014-10-02
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
dnl with the API version to also check the API compatibility. Example:
dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using
dnl this features allows to prevent build against newer versions of libgcrypt
dnl with a changed API.
dnl
dnl If a prefix option is not used, the config script is first
dnl searched in $SYSROOT/bin and then along $PATH. If the used
dnl config script does not match the host specification the script
dnl is added to the gpg_config_script_warn variable.
dnl
AC_DEFUN([AM_PATH_LIBGCRYPT],
[ AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_WITH(libgcrypt-prefix,
AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
[prefix where LIBGCRYPT is installed (optional)]),
libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
if test x"${LIBGCRYPT_CONFIG}" = x ; then
if test x"${libgcrypt_config_prefix}" != x ; then
LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
else
case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
fi
;;
'')
;;
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
esac
fi
fi
AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
tmp=ifelse([$1], ,1:1.2.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
else
req_libgcrypt_api=0
min_libgcrypt_version="$tmp"
fi
AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
ok=no
if test "$LIBGCRYPT_CONFIG" != "no" ; then
req_major=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
major=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
micro=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
if test "$major" -gt "$req_major"; then
ok=yes
else
if test "$major" -eq "$req_major"; then
if test "$minor" -gt "$req_minor"; then
ok=yes
else
if test "$minor" -eq "$req_minor"; then
if test "$micro" -ge "$req_micro"; then
ok=yes
fi
fi
fi
fi
fi
fi
if test $ok = yes; then
AC_MSG_RESULT([yes ($libgcrypt_config_version)])
else
AC_MSG_RESULT(no)
fi
if test $ok = yes; then
# If we have a recent libgcrypt, we should also check that the
# API is compatible
if test "$req_libgcrypt_api" -gt 0 ; then
tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBGCRYPT API version])
if test "$req_libgcrypt_api" -eq "$tmp" ; then
AC_MSG_RESULT([okay])
else
ok=no
AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
fi
fi
fi
fi
if test $ok = yes; then
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
ifelse([$2], , :, [$2])
libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
if test x"$libgcrypt_config_host" != xnone ; then
if test x"$libgcrypt_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
*** The config script $LIBGCRYPT_CONFIG was
*** built for $libgcrypt_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-libgcrypt-prefix
*** to specify a matching config script or use \$SYSROOT.
***]])
gpg_config_script_warn="$gpg_config_script_warn libgcrypt"
fi
fi
else
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(LIBGCRYPT_CFLAGS)
AC_SUBST(LIBGCRYPT_LIBS)
])

View File

@ -1,14 +0,0 @@
dnl
dnl Usage:
dnl AC_CHECK_LIBWRAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl
AC_DEFUN([AC_CHECK_LIBWRAP],[
AC_CHECK_HEADERS([tcpd.h],
AC_CHECK_LIB([wrap], [request_init],
[LIBWRAP_CFLAGS=""
LIBWRAP_LDFLAGS="-lwrap"
$1],
$2),
$2)
])

View File

@ -1,187 +0,0 @@
dnl Parameters: varname1, description
AC_DEFUN([MPD_AUTO_ENABLED], [
if test x$[]enable_$1 = xauto; then
AC_MSG_NOTICE([auto-detected $2])
enable_$1=yes
fi
])
dnl Parameters: varname1, description, errmsg
AC_DEFUN([MPD_AUTO_DISABLED], [
if test x$[]enable_$1 = xauto; then
AC_MSG_WARN([$3 -- disabling $2])
enable_$1=no
elif test x$[]enable_$1 = xyes; then
AC_MSG_ERROR([$2: $3])
fi
])
dnl Check whether a prerequisite for a feature was found. This is
dnl very similar to MPD_AUTO_RESULT, but does not finalize the
dnl detection; it assumes that more checks will follow.
AC_DEFUN([MPD_AUTO_PRE], [
if test x$[]enable_$1 != xno && test x$[]found_$1 = xno; then
MPD_AUTO_DISABLED([$1], [$2], [$3])
fi
])
dnl Evaluate a check's result. Abort if the feature was requested
dnl explicitly but is unavailable.
dnl
dnl Parameters: varname1, description, errmsg
AC_DEFUN([MPD_AUTO_RESULT], [
if test x$[]enable_$1 = xno; then
found_$1=no
fi
if test x$[]found_$1 = xyes; then
MPD_AUTO_ENABLED([$1], [$2])
else
MPD_AUTO_DISABLED([$1], [$2], [$3])
fi
])
dnl Invoke a check if its configuration is "yes" or "auto" and call
dnl MPD_AUTO_RESULT.
dnl
dnl Parameters: varname1, description, errmsg, check
AC_DEFUN([MPD_AUTO], [
if test x$[]enable_$1 != xno; then
$4
fi
MPD_AUTO_RESULT([$1], [$2], [$3])
])
dnl Wrapper for MPD_AUTO and PKG_CHECK_MODULES.
dnl
dnl Parameters: varname1, varname2, pkgname, description, errmsg
AC_DEFUN([MPD_AUTO_PKG], [
MPD_AUTO([$1], [$4], [$5],
[PKG_CHECK_MODULES([$2], [$3],
[found_$1=yes],
[found_$1=no])])
])
dnl Check with pkg-config first, fall back to AC_CHECK_LIB.
dnl
dnl Parameters: varname1, varname2, pkgname, libname, symname, libs, cflags, description, errmsg
AC_DEFUN([MPD_AUTO_PKG_LIB], [
MPD_AUTO([$1], [$8], [$9],
[PKG_CHECK_MODULES([$2], [$3],
[found_$1=yes],
AC_CHECK_LIB($4, $5,
[found_$1=yes $2_LIBS='$6' $2_CFLAGS='$7'],
[found_$1=no],
[$6]))])
])
dnl Wrapper for AC_CHECK_LIB.
dnl
dnl Parameters: varname1, varname2, libname, symname, libs, cflags, description, errmsg
AC_DEFUN([MPD_AUTO_LIB], [
AC_SUBST([$2_LIBS], [])
AC_SUBST([$2_CFLAGS], [])
MPD_AUTO([$1], [$7], [$8],
[AC_CHECK_LIB($3, $4,
[found_$1=yes $2_LIBS='$5' $2_CFLAGS='$6'],
[found_$1=no],
[$5])])
])
dnl Wrapper for AC_CHECK_HEADER.
dnl
dnl Parameters: varname1, varname2, header, libs, cflags, description, errmsg
AC_DEFUN([MPD_AUTO_HEADER], [
AC_SUBST([$2_LIBS], [])
AC_SUBST([$2_CFLAGS], [])
MPD_AUTO([$1], [$6], [$7],
[AC_CHECK_HEADER([$3],
[found_$1=yes $2_LIBS='$4' $2_CFLAGS='$5'],
[found_$1=no])])
])
dnl Convert the given string into a string for the "default value" in
dnl the help text. If the string is a literal, then it is returned
dnl as-is; if it contains a variable reference, just "auto" is
dnl emitted.
dnl
dnl Parameters: varname1
AC_DEFUN([MPD_FORMAT_DEFAULT],
[ifelse([$1], [], [auto],
index([$1], [$]), [-1], [$1],
[auto])])
dnl Wrapper for AC_ARG_ENABLE, AC_DEFINE and AM_CONDITIONAL
dnl
dnl Parameters: varname1, varname2, description, default, check
AC_DEFUN([MPD_ARG_ENABLE], [
AC_ARG_ENABLE(translit([$1], [_], [-]),
AS_HELP_STRING([--enable-]translit([$1], [_], [-]),
[enable $3 (default: ]MPD_FORMAT_DEFAULT([$4])[)]),,
[enable_$1=]ifelse([$4], [], [auto], [$4]))
$5
MPD_DEFINE_CONDITIONAL(enable_$1, ENABLE_$2, [$3])
])
dnl Wrapper for MPD_ARG_ENABLE and MPD_AUTO
dnl
dnl Parameters: varname1, varname2, description, errmsg, default, check
AC_DEFUN([MPD_ENABLE_AUTO], [
MPD_ARG_ENABLE([$1], [$2], [$3], [$5], [
MPD_AUTO([$1], [$3], [$4], [$6])
])
])
dnl Wrapper for AC_ARG_ENABLE and MPD_AUTO_PKG
dnl
dnl Parameters: varname1, varname2, pkg, description, errmsg, default, pre
AC_DEFUN([MPD_ENABLE_AUTO_PKG], [
MPD_ARG_ENABLE([$1], [$2], [$4], [$6], [
$7
MPD_AUTO_PKG($1, $2, $3, $4, $5)
])
])
dnl Wrapper for AC_ARG_ENABLE and MPD_AUTO_PKG_LIB
dnl
dnl Parameters: varname1, varname2, pkg, libname, symname, libs, cflags, description, errmsg, default, pre
AC_DEFUN([MPD_ENABLE_AUTO_PKG_LIB], [
MPD_ARG_ENABLE([$1], [$2], [$8], [$10], [
$11
MPD_AUTO_PKG_LIB($1, $2, $3, $4, $5, $6, $7, $8, $9)
])
])
dnl Wrapper for AC_ARG_ENABLE and MPD_AUTO_LIB
dnl
dnl Parameters: varname1, varname2, libname, symname, libs, cflags, description, errmsg, default, pre
AC_DEFUN([MPD_ENABLE_AUTO_LIB], [
MPD_ARG_ENABLE([$1], [$2], [$7], [$9], [
$10
MPD_AUTO_LIB($1, $2, $3, $4, $5, $6, $7, $8)
])
])
dnl Wrapper for AC_ARG_ENABLE and MPD_AUTO_HEADER
dnl
dnl Parameters: varname1, varname2, header, libs, cflags, description, errmsg, default, pre
AC_DEFUN([MPD_ENABLE_AUTO_HEADER], [
MPD_ARG_ENABLE([$1], [$2], [$6], [$8], [
$9
MPD_AUTO_HEADER($1, $2, $3, $4, $5, $6, $7)
])
])
dnl Wrapper for MPD_ENABLE_AUTO_PKG and MPD_DEPENDS
dnl
dnl Parameters: varname1, varname2, pkg, description, errmsg, default, dep_variable, dep_errmsg, pre
AC_DEFUN([MPD_ENABLE_AUTO_PKG_DEPENDS], [
MPD_ENABLE_AUTO_PKG([$1], [$2], [$3], [$4], [$5], [$6], [
$9
MPD_DEPENDS([enable_$1], [$7], [$4], [$8])
])
])

View File

@ -1,8 +0,0 @@
dnl Wrapper for AC_DEFINE and AM_CONDITIONAL
dnl
dnl Parameters: varname1, varname2, description
AC_DEFUN([MPD_DEFINE_CONDITIONAL], [dnl
AM_CONDITIONAL($2, test x$[]$1 = xyes)
if test x$[]$1 = xyes; then
AC_DEFINE($2, 1, [Define to enable $3])
fi])

View File

@ -1,15 +0,0 @@
dnl Declare a dependency of one feature on another. If the depending
dnl feature is disabled, the former must be disabled as well. If the
dnl former was explicitly enabled, abort with an error message.
dnl
dnl Parameters: varname1, varname2 (=dependency), description, errmsg
AC_DEFUN([MPD_DEPENDS], [
if test x$$2 = xno; then
if test x$$1 = xauto; then
AC_MSG_WARN([$4: disabling $3])
$1=no
elif test x$$1 = xyes; then
AC_MSG_ERROR([$3: $4])
fi
fi
])

View File

@ -1,25 +0,0 @@
dnl MPD_OPTIONAL_FUNC(name, func, macro)
dnl
dnl Allow the user to enable or disable the use of a function. If the
dnl option is not specified, the function is auto-detected.
AC_DEFUN([MPD_OPTIONAL_FUNC], [
AC_ARG_ENABLE([$1],
AS_HELP_STRING([--enable-$1],
[use the function "$1" (default: auto)]),
[test x$[]enable_$1 = xyes && AC_DEFINE([$3], 1, [Define to use $1])],
[AC_CHECK_FUNC([$2],
[AC_DEFINE([$3], 1, [Define to use $1])],)])
])
dnl MPD_OPTIONAL_FUNC_NODEF(name, func)
dnl
dnl Allow the user to enable or disable the use of a function.
dnl Works similar to MPD_OPTIONAL_FUNC, however MPD_OPTIONAL_FUNC_NODEF
dnl does not invoke AC_DEFINE when function is enabled. Shell variable
dnl enable_$name is set to "yes" instead.
AC_DEFUN([MPD_OPTIONAL_FUNC_NODEF], [
AC_ARG_ENABLE([$1],
AS_HELP_STRING([--enable-$1],
[use the function "$1" (default: auto)]),,
[AC_CHECK_FUNC([$2], [enable_$1=yes],)])
])

View File

@ -1,23 +0,0 @@
dnl Run code with the specified CFLAGS/CXXFLAGS and LIBS appended.
dnl Restores the old values afterwards.
dnl
dnl Parameters: cflags, libs, code
AC_DEFUN([MPD_WITH_FLAGS], [
ac_save_CFLAGS="$[]CFLAGS"
ac_save_CXXFLAGS="$[]CXXFLAGS"
ac_save_LIBS="$[]LIBS"
CFLAGS="$[]CFLAGS $1"
CXXFLAGS="$[]CXXFLAGS $1"
LIBS="$[]LIBS $2"
$3
CFLAGS="$[]ac_save_CFLAGS"
CXXFLAGS="$[]ac_save_CXXFLAGS"
LIBS="$[]ac_save_LIBS"
])
dnl Run code with the specified library's CFLAGS/CXXFLAGS and LIBS
dnl appended. Restores the old values afterwards.
dnl
dnl Parameters: libname, code
AC_DEFUN([MPD_WITH_LIBRARY],
[MPD_WITH_FLAGS([$[]$1_CFLAGS], [$[]$1_LIBS], [$2])])

275
m4/pkg.m4
View File

@ -1,275 +0,0 @@
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
dnl serial 11 (pkg-config-0.29)
dnl
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR

View File

@ -1,9 +0,0 @@
AC_DEFUN([results], [
printf '('
if test x$[]enable_$1 = xyes; then
printf '+'
else
printf '-'
fi
printf '%s) ' "$2"
])

View File

@ -1,18 +0,0 @@
# Check if "struct ucred" is available.
#
# Author: Max Kellermann <max.kellermann@gmail.com>
AC_DEFUN([STRUCT_UCRED],[
AC_MSG_CHECKING([for struct ucred])
AC_CACHE_VAL(mpd_cv_have_struct_ucred, [
AC_TRY_COMPILE([#include <sys/socket.h>],
[struct ucred cred;],
mpd_cv_have_struct_ucred=yes,
mpd_cv_have_struct_ucred=no)
])
AC_MSG_RESULT($mpd_cv_have_struct_ucred)
if test x$mpd_cv_have_struct_ucred = xyes; then
AC_DEFINE(HAVE_STRUCT_UCRED, 1, [Define if struct ucred is present from sys/socket.h])
fi
])

451
meson.build Normal file
View File

@ -0,0 +1,451 @@
project(
'mpd',
['c', 'cpp'],
version: '0.21',
meson_version: '>= 0.47',
default_options: [
'c_std=c99',
'cpp_std=c++14'
],
license: 'GPLv2+',
)
version_cxx = vcs_tag(input: 'src/GitVersion.cxx', output: 'GitVersion.cxx')
compiler = meson.get_compiler('cpp')
c_compiler = meson.get_compiler('c')
conf = configuration_data()
conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('PROTOCOL_VERSION', '0.21.0')
conf.set_quoted('SYSTEM_CONFIG_FILE_LOCATION', join_paths(get_option('prefix'), get_option('sysconfdir'), 'mpd.conf'))
common_cppflags = [
'-D_GNU_SOURCE',
]
common_cflags = [
]
common_cxxflags = [
]
test_common_flags = [
'-Wall',
'-Wextra',
'-fvisibility=hidden',
'-ffast-math',
'-ftree-vectorize',
]
test_cxxflags = test_common_flags + [
'-fno-threadsafe-statics',
'-fmerge-all-constants',
'-Wmissing-declarations',
'-Wshadow',
'-Wpointer-arith',
'-Wcast-qual',
'-Wwrite-strings',
'-Wsign-compare',
'-Wno-non-virtual-dtor',
# work around bogus GCC7 warning "mangled name for ... will change
# in C++17 because the exception specification is part of a function
# type"
'-Wno-noexcept-type',
]
test_cflags = test_common_flags + [
'-Wmissing-prototypes',
'-Wshadow',
'-Wpointer-arith',
'-Wstrict-prototypes',
'-Wcast-qual',
'-Wwrite-strings',
'-pedantic',
]
test_ldflags = [
]
if get_option('buildtype') != 'debug'
test_cflags += [
'-ffunction-sections',
'-fdata-sections',
]
test_ldflags += [
'-Wl,--gc-sections',
]
endif
add_global_arguments(common_cxxflags + compiler.get_supported_arguments(test_cxxflags), language: 'cpp')
add_global_arguments(common_cflags + c_compiler.get_supported_arguments(test_cflags), language: 'c')
add_global_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'cpp')
is_linux = host_machine.system() == 'linux'
is_android = get_option('android_ndk') != ''
is_darwin = host_machine.system() == 'darwin'
is_windows = host_machine.system() == 'windows'
is_haiku = host_machine.system() == 'haiku' # TODO is this correct?
if is_android
common_cppflags += '-DANDROID'
endif
if is_windows
common_cppflags += [
'-DWIN32_LEAN_AND_MEAN',
'-DWINVER=0x0600', '-D_WIN32_WINNT=0x0600',
'-DSTRICT',
'-DUNICODE', '-D_UNICODE',
]
subdir('win32')
endif
if is_android
subdir('android')
endif
add_global_arguments(common_cppflags, language: 'c')
add_global_arguments(common_cppflags, language: 'cpp')
enable_daemon = not is_windows and not is_android and get_option('daemon')
conf.set('ENABLE_DAEMON', enable_daemon)
conf.set('HAVE_LOCALE_H', compiler.has_header('locale.h'))
conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r'))
conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r'))
conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups'))
conf.set('HAVE_FNMATCH', compiler.has_function('fnmatch'))
conf.set('HAVE_STRNDUP', compiler.has_function('strndup', prefix: '#define _GNU_SOURCE\n#include <string.h>'))
conf.set('HAVE_STRCASESTR', compiler.has_function('strcasestr'))
conf.set('HAVE_PRCTL', is_linux)
conf.set('USE_EVENTFD', is_linux and get_option('eventfd'))
conf.set('USE_SIGNALFD', is_linux and get_option('signalfd'))
if is_windows
conf.set('USE_WINSELECT', true)
elif is_linux and get_option('epoll')
conf.set('USE_EPOLL', true)
else
conf.set('USE_POLL', true)
endif
if not get_option('syslog').disabled()
if compiler.has_function('syslog')
conf.set('HAVE_SYSLOG', true)
elif get_option('syslog').enabled()
error('syslog() not found')
endif
endif
enable_database = get_option('database')
conf.set('ENABLE_DATABASE', enable_database)
enable_inotify = get_option('inotify') and is_linux and enable_database
conf.set('ENABLE_INOTIFY', enable_inotify)
conf.set('ENABLE_DSD', get_option('dsd'))
inc = include_directories(
'src',
# for the generated config.h
'.',
)
boost_dep = dependency('boost', version: '>= 1.58')
sources = [
version_cxx,
'src/Main.cxx',
'src/protocol/Ack.cxx',
'src/protocol/ArgParser.cxx',
'src/protocol/Result.cxx',
'src/command/CommandError.cxx',
'src/command/AllCommands.cxx',
'src/command/QueueCommands.cxx',
'src/command/TagCommands.cxx',
'src/command/PlayerCommands.cxx',
'src/command/PlaylistCommands.cxx',
'src/command/FileCommands.cxx',
'src/command/OutputCommands.cxx',
'src/command/MessageCommands.cxx',
'src/command/ClientCommands.cxx',
'src/command/PartitionCommands.cxx',
'src/command/OtherCommands.cxx',
'src/command/CommandListBuilder.cxx',
'src/Idle.cxx',
'src/IdleFlags.cxx',
'src/decoder/Domain.cxx',
'src/decoder/Thread.cxx',
'src/decoder/Control.cxx',
'src/decoder/Bridge.cxx',
'src/decoder/DecoderPrint.cxx',
'src/client/Listener.cxx',
'src/client/Client.cxx',
'src/client/ClientEvent.cxx',
'src/client/ClientExpire.cxx',
'src/client/ClientGlobal.cxx',
'src/client/ClientIdle.cxx',
'src/client/ClientList.cxx',
'src/client/ClientNew.cxx',
'src/client/ClientProcess.cxx',
'src/client/ClientRead.cxx',
'src/client/ClientWrite.cxx',
'src/client/ClientMessage.cxx',
'src/client/ClientSubscribe.cxx',
'src/client/ClientFile.cxx',
'src/client/Response.cxx',
'src/Listen.cxx',
'src/LogInit.cxx',
'src/LogBackend.cxx',
'src/Log.cxx',
'src/ls.cxx',
'src/Instance.cxx',
'src/win32/Win32Main.cxx',
'src/MusicBuffer.cxx',
'src/MusicPipe.cxx',
'src/MusicChunk.cxx',
'src/MusicChunkPtr.cxx',
'src/Mapper.cxx',
'src/Partition.cxx',
'src/Permission.cxx',
'src/player/CrossFade.cxx',
'src/player/Thread.cxx',
'src/player/Control.cxx',
'src/PlaylistError.cxx',
'src/PlaylistPrint.cxx',
'src/PlaylistSave.cxx',
'src/playlist/PlaylistStream.cxx',
'src/playlist/PlaylistMapper.cxx',
'src/playlist/PlaylistAny.cxx',
'src/playlist/PlaylistSong.cxx',
'src/playlist/PlaylistQueue.cxx',
'src/playlist/Print.cxx',
'src/db/PlaylistVector.cxx',
'src/queue/Queue.cxx',
'src/queue/QueuePrint.cxx',
'src/queue/QueueSave.cxx',
'src/queue/Playlist.cxx',
'src/queue/PlaylistControl.cxx',
'src/queue/PlaylistEdit.cxx',
'src/queue/PlaylistTag.cxx',
'src/queue/PlaylistState.cxx',
'src/ReplayGainGlobal.cxx',
'src/LocateUri.cxx',
'src/SongUpdate.cxx',
'src/SongLoader.cxx',
'src/SongPrint.cxx',
'src/SongSave.cxx',
'src/StateFile.cxx',
'src/StateFileConfig.cxx',
'src/Stats.cxx',
'src/TagPrint.cxx',
'src/TagSave.cxx',
'src/TagFile.cxx',
'src/TagStream.cxx',
'src/TimePrint.cxx',
'src/mixer/Volume.cxx',
'src/PlaylistFile.cxx',
]
if not is_android
sources += [
'src/CommandLine.cxx',
'src/unix/SignalHandlers.cxx',
]
else
sources += [
'src/android/Context.cxx',
'src/android/Environment.cxx',
'src/android/LogListener.cxx',
]
endif
if enable_daemon
sources += 'src/unix/Daemon.cxx'
endif
if enable_database
sources += [
'src/queue/PlaylistUpdate.cxx',
'src/command/StorageCommands.cxx',
'src/command/DatabaseCommands.cxx',
]
endif
subdir('src/util')
subdir('src/system')
subdir('src/thread')
subdir('src/event')
subdir('src/lib/dbus')
subdir('src/lib/icu')
subdir('src/lib/smbclient')
subdir('src/lib/zlib')
subdir('src/lib/alsa')
subdir('src/lib/curl')
subdir('src/lib/expat')
subdir('src/lib/ffmpeg')
subdir('src/lib/gcrypt')
subdir('src/lib/wrap')
subdir('src/lib/nfs')
subdir('src/lib/oss')
subdir('src/lib/pulse')
subdir('src/lib/roar')
subdir('src/lib/sndio')
subdir('src/lib/sqlite')
subdir('src/lib/systemd')
subdir('src/lib/upnp')
subdir('src/lib/yajl')
subdir('src/fs')
subdir('src/config')
subdir('src/net')
subdir('src/tag')
subdir('src/pcm')
subdir('src/neighbor')
subdir('src/input')
subdir('src/archive')
subdir('src/filter')
subdir('src/mixer')
subdir('src/output')
subdir('src/lib/xiph')
subdir('src/decoder')
subdir('src/encoder')
subdir('src/song')
subdir('src/playlist')
subdir('src/zeroconf')
if curl_dep.found()
sources += 'src/RemoteTagCache.cxx'
endif
if sqlite_dep.found()
sources += [
'src/command/StickerCommands.cxx',
'src/sticker/StickerDatabase.cxx',
'src/sticker/StickerPrint.cxx',
'src/sticker/SongSticker.cxx',
]
endif
basic = static_library(
'basic',
'src/ReplayGainInfo.cxx',
'src/ReplayGainMode.cxx',
'src/SingleMode.cxx',
include_directories: inc,
)
basic_dep = declare_dependency(
link_with: basic,
)
if enable_database
subdir('src/storage')
subdir('src/db')
endif
if neighbor_glue_dep.found()
sources += 'src/command/NeighborCommands.cxx'
endif
if archive_glue_dep.found()
sources += [
'src/TagArchive.cxx',
'src/db/update/Archive.cxx',
]
endif
if is_windows
sources += windows_resources
endif
link_args = []
more_deps = []
if is_android
subdir('src/java')
target_type = 'shared_library'
link_args += [
'-Wl,--no-undefined,-shared,-Bsymbolic',
'-llog',
'-lz',
]
more_deps += [
declare_dependency(sources: [classes_jar]),
java_dep,
]
else
target_type = 'executable'
endif
mpd = build_target(
'mpd',
sources,
target_type: target_type,
include_directories: inc,
dependencies: [
basic_dep,
config_dep,
dbus_dep,
fs_dep,
net_dep,
util_dep,
event_dep,
thread_dep,
neighbor_glue_dep,
input_glue_dep,
archive_glue_dep,
output_glue_dep,
mixer_glue_dep,
decoder_glue_dep,
encoder_glue_dep,
playlist_glue_dep,
db_glue_dep,
storage_glue_dep,
song_dep,
systemd_dep,
sqlite_dep,
zeroconf_dep,
libwrap_dep,
more_deps,
],
link_args: link_args,
install: not is_android and not is_haiku,
)
if is_android
subdir('android/apk')
endif
if is_haiku
subdir('src/haiku')
endif
configure_file(output: 'config.h', configuration: conf)
if systemd_dep.found()
subdir('systemd')
endif
if get_option('documentation')
subdir('doc')
endif
if get_option('test')
subdir('test')
endif

186
meson_options.txt Normal file
View File

@ -0,0 +1,186 @@
option('documentation', type: 'boolean', value: false, description: 'Build documentation')
option('test', type: 'boolean', value: false, description: 'Build the unit tests and debug programs')
option('syslog', type: 'feature', description: 'syslog support')
option('inotify', type: 'boolean', value: true, description: 'inotify support (for automatic database update)')
option('daemon', type: 'boolean', value: true, description: 'enable daemonization')
option('systemd', type: 'feature', description: 'systemd support')
option('systemd_system_unit_dir', type: 'string', description: 'systemd system service directory')
option('systemd_user_unit_dir', type: 'string', description: 'systemd user service directory')
#
# Android
#
option('android_sdk', type: 'string', description: 'The path where Android SDK is installed')
option('android_ndk', type: 'string', description: 'The path where Android NDK is installed')
option('android_abi', type: 'string', value: 'armeabi-v7a', description: 'The Android ABI to be built')
option('android_strip', type: 'string', value: 'strip', description: 'The "strip" tool from the NDK')
option('android_debug_keystore', type: 'string', description: 'The keystore file used to sign debug APK files')
option('android_keystore', type: 'string', description: 'The keystore file used to sign APK files')
option('android_keyalias', type: 'string', description: 'The key alias used to sign APK files')
option('android_keypass', type: 'string', description: 'The password of the keystore used to sign APK files')
#
# System call support
#
option('epoll', type: 'boolean', value: true, description: 'Use epoll on Linux')
option('eventfd', type: 'boolean', value: true, description: 'Use eventfd() on Linux')
option('signalfd', type: 'boolean', value: true, description: 'Use signalfd() on Linux')
#
# Network support
#
option('tcp', type: 'boolean', value: true, description: 'Support for clients connecting via TCP')
option('ipv6', type: 'feature', description: 'Support for IPv6')
option('local_socket', type: 'boolean', value: true, description: 'Support for clients connecting via local sockets')
#
# Audio formats
#
option('dsd', type: 'boolean', value: true, description: 'Support the DSD audio format')
#
# Database plugins
#
option('database', type: 'boolean', value: true, description: 'enable support for the music database')
option('upnp', type: 'feature', description: 'UPnP client support')
option('libmpdclient', type: 'feature', description: 'libmpdclient support (for the proxy database plugin)')
#
# Neighbor plugins
#
option('neighbor', type: 'boolean', value: true, description: 'enable support for neighbor discovery')
#
# Storage plugins
#
option('udisks', type: 'feature', description: 'Support for removable media using udisks2')
option('webdav', type: 'feature', description: 'WebDAV support using CURL and Expat')
#
# Playlist plugins
#
option('cue', type: 'boolean', value: true, description: 'CUE sheet support')
#
# Input plugins
#
option('cdio_paranoia', type: 'feature', description: 'libcdio_paranoia input plugin')
option('curl', type: 'feature', description: 'HTTP client using CURL')
option('mms', type: 'feature', description: 'MMS protocol support using libmms')
option('nfs', type: 'feature', description: 'NFS protocol support using libnfs')
option('smbclient', type: 'feature', description: 'SMB support using libsmbclient')
#
# Commercial services
#
option('qobuz', type: 'feature', description: 'Qobuz client')
option('soundcloud', type: 'feature', description: 'SoundCloud client')
option('tidal', type: 'feature', description: 'Tidal client')
#
# Archive plugins
#
option('bzip2', type: 'feature', description: 'bzip2 support using libbz2')
option('iso9660', type: 'feature', description: 'ISO9660 support using libiso9660')
option('zzip', type: 'feature', description: 'ZIP support using zziplib')
#
# Tag plugins
#
option('id3tag', type: 'feature', description: 'ID3 support using libid3tag')
#
# Decoder plugins
#
option('adplug', type: 'feature', description: 'AdPlug decoder plugin')
option('audiofile', type: 'feature', description: 'libaudiofile decoder plugin')
option('faad', type: 'feature', description: 'AAC decoder using libfaad')
option('ffmpeg', type: 'feature', description: 'FFmpeg codec support')
option('flac', type: 'feature', description: 'FLAC decoder plugin')
option('fluidsynth', type: 'feature', description: 'fluidsynth MIDI decoder plugin')
option('gme', type: 'feature', description: 'Game Music Emulator decoder plugin')
option('mad', type: 'feature', description: 'MP3 decoder using libmad')
option('mikmod', type: 'feature', description: 'MikMod decoder plugin')
option('modplug', type: 'feature', description: 'Modplug decoder plugin')
option('mpcdec', type: 'feature', description: 'Musepack decoder plugin')
option('mpg123', type: 'feature', description: 'MP3 decoder using libmpg123')
option('opus', type: 'feature', description: 'Opus decoder plugin')
option('sidplay', type: 'feature', description: 'C64 SID support via libsidplayfp or libsidplay2')
option('sndfile', type: 'feature', description: 'libsndfile decoder plugin')
option('vorbis', type: 'feature', description: 'Vorbis decoder plugin')
option('wavpack', type: 'feature', description: 'WavPack decoder plugin')
option('wildmidi', type: 'feature', description: 'WildMidi decoder plugin')
#
# Decoder plugins
#
option('vorbisenc', type: 'feature', description: 'Vorbis encoder plugin')
option('lame', type: 'feature', description: 'LAME MP3 encoder plugin')
option('twolame', type: 'feature', description: 'TwoLAME MP2 encoder plugin')
option('shine', type: 'feature', description: 'shine MP3 encoder plugin')
option('wave_encoder', type: 'boolean', value: true, description: 'PCM wave encoder encoder plugin')
#
# Filter plugins
#
option('libsamplerate', type: 'feature', description: 'libsamplerate resampler')
option('soxr', type: 'feature', description: 'libsoxr resampler')
#
# Output plugins
#
option('alsa', type: 'feature', description: 'ALSA support')
option('ao', type: 'feature', description: 'libao output plugin')
option('fifo', type: 'boolean', value: true, description: 'FIFO output plugin')
option('httpd', type: 'boolean', value: true, description: 'HTTP streaming output plugin')
option('jack', type: 'feature', description: 'JACK output plugin')
option('openal', type: 'feature', description: 'OpenAL output plugin')
option('oss', type: 'feature', description: 'Open Sound System support')
option('pipe', type: 'boolean', value: true, description: 'Pipe output plugin')
option('pulse', type: 'feature', description: 'PulseAudio support')
option('recorder', type: 'boolean', value: true, description: 'Recorder output plugin')
option('roar', type: 'feature', description: 'Roar output plugin')
option('shout', type: 'feature', description: 'Shoutcast streaming support using libshout')
option('sndio', type: 'feature', description: 'sndio output plugin')
option('solaris_output', type: 'feature', description: 'Solaris /dev/audio support')
#
# Misc libraries
#
option('dbus', type: 'feature', description: 'D-Bus support')
option('expat', type: 'feature', description: 'Expat XML support')
option('icu', type: 'feature', description: 'Use libicu for Unicode')
option('iconv', type: 'feature', description: 'Use iconv() for character set conversion')
option('libwrap', type: 'feature', description: 'libwrap support')
option('sqlite', type: 'feature', description: 'SQLite database support (for stickers)')
option('yajl', type: 'feature', description: 'libyajl for YAML support')
option('zlib', type: 'feature', description: 'zlib support (for database compression)')
option('zeroconf', type: 'combo',
choices: ['auto', 'avahi', 'bonjour', 'disabled'],
value: 'auto',
description: 'Zeroconf support')

View File

@ -1,29 +0,0 @@
def concatenate_cmdline_variables(src, names):
"""Find duplicate variable declarations on the given source list, and
concatenate the values of those in the 'names' list."""
# the result list being constructed
dest = []
# a map of variable name to destination list index
positions = {}
for item in src:
i = item.find('=')
if i > 0:
# it's a variable
name = item[:i]
if name in names:
# it's a known variable
if name in positions:
# already specified: concatenate instead of
# appending it
dest[positions[name]] += ' ' + item[i + 1:]
continue
else:
# not yet seen: append it and remember the list
# index
positions[name] = len(dest)
dest.append(item)
return dest

View File

@ -40,6 +40,7 @@ c = '%s'
cpp = '%s' cpp = '%s'
ar = '%s' ar = '%s'
strip = '%s' strip = '%s'
pkgconfig = '%s'
%s %s
[properties] [properties]
@ -60,6 +61,7 @@ cpu_family = '%s'
cpu = '%s' cpu = '%s'
endian = '%s' endian = '%s'
""" % (toolchain.cc, toolchain.cxx, toolchain.ar, toolchain.strip, """ % (toolchain.cc, toolchain.cxx, toolchain.ar, toolchain.strip,
toolchain.pkg_config,
windres, windres,
toolchain.install_prefix, toolchain.install_prefix,
repr((toolchain.cppflags + ' ' + toolchain.cflags).split()), repr((toolchain.cppflags + ' ' + toolchain.cflags).split()),

View File

@ -19,6 +19,7 @@
#include "config.h" #include "config.h"
#include "CommandLine.hxx" #include "CommandLine.hxx"
#include "GitVersion.hxx"
#include "ls.hxx" #include "ls.hxx"
#include "LogInit.hxx" #include "LogInit.hxx"
#include "Log.hxx" #include "Log.hxx"
@ -107,11 +108,7 @@ static constexpr Domain cmdline_domain("cmdline");
gcc_noreturn gcc_noreturn
static void version(void) static void version(void)
{ {
printf("Music Player Daemon " VERSION printf("Music Player Daemon " VERSION " (%s)\n"
#ifdef GIT_COMMIT
" (" GIT_COMMIT ")"
#endif
"\n"
"\n" "\n"
"Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n" "Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n"
"Copyright 2008-2017 Max Kellermann <max.kellermann@gmail.com>\n" "Copyright 2008-2017 Max Kellermann <max.kellermann@gmail.com>\n"
@ -120,7 +117,8 @@ static void version(void)
#ifdef ENABLE_DATABASE #ifdef ENABLE_DATABASE
"\n" "\n"
"Database plugins:\n"); "Database plugins:\n",
GIT_VERSION);
for (auto i = database_plugins; *i != nullptr; ++i) for (auto i = database_plugins; *i != nullptr; ++i)
printf(" %s", (*i)->name); printf(" %s", (*i)->name);

22
src/GitVersion.cxx Normal file
View File

@ -0,0 +1,22 @@
/*
* Copyright 2003-2017 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "GitVersion.hxx"
char GIT_VERSION[] = "@VCS_TAG@";

25
src/GitVersion.hxx Normal file
View File

@ -0,0 +1,25 @@
/*
* Copyright 2003-2017 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_GIT_VERSION_HXX
#define MPD_GIT_VERSION_HXX
extern char GIT_VERSION[];
#endif

33
src/archive/meson.build Normal file
View File

@ -0,0 +1,33 @@
archive_api = static_library(
'archive_api',
'ArchiveDomain.cxx',
'ArchiveLookup.cxx',
'ArchiveList.cxx',
include_directories: inc,
)
archive_api_dep = declare_dependency(
link_with: archive_api,
)
subdir('plugins')
conf.set('ENABLE_ARCHIVE', found_archive_plugin)
if not found_archive_plugin
archive_glue_dep = dependency('', required: false)
subdir_done()
endif
archive_glue = static_library(
'archive_glue',
'ArchivePlugin.cxx',
'../input/plugins/ArchiveInputPlugin.cxx',
include_directories: inc,
)
archive_glue_dep = declare_dependency(
link_with: archive_glue,
dependencies: [
archive_plugins_dep,
],
)

View File

@ -0,0 +1,42 @@
archive_plugins_sources = []
found_archive_plugin = false
libiso9660_dep = dependency('libiso9660', required: get_option('iso9660'))
conf.set('ENABLE_ISO9660', libiso9660_dep.found())
if libiso9660_dep.found()
archive_plugins_sources += 'Iso9660ArchivePlugin.cxx'
found_archive_plugin = true
endif
libbz2_dep = c_compiler.find_library('bz2', required: get_option('bzip2'))
conf.set('ENABLE_BZ2', libbz2_dep.found())
if libbz2_dep.found()
archive_plugins_sources += 'Bzip2ArchivePlugin.cxx'
found_archive_plugin = true
endif
libzzip_dep = dependency('zziplib', version: '>= 0.13', required: get_option('zzip'))
conf.set('ENABLE_ZZIP', libzzip_dep.found())
if libzzip_dep.found()
archive_plugins_sources += 'ZzipArchivePlugin.cxx'
found_archive_plugin = true
endif
archive_plugins = static_library(
'archive_plugins',
archive_plugins_sources,
include_directories: inc,
dependencies: [
libbz2_dep,
libiso9660_dep,
libzzip_dep,
],
)
archive_plugins_dep = declare_dependency(
link_with: archive_plugins,
dependencies: [
archive_api_dep,
input_glue_dep,
],
)

22
src/config/meson.build Normal file
View File

@ -0,0 +1,22 @@
config = static_library(
'fs',
'Path.cxx',
'Check.cxx',
'Data.cxx',
'Block.cxx',
'Param.cxx',
'Parser.cxx',
'File.cxx',
'Migrate.cxx',
'Templates.cxx',
'Domain.cxx',
'Net.cxx',
include_directories: inc,
)
config_dep = declare_dependency(
link_with: config,
dependencies: [
fs_dep,
],
)

55
src/db/meson.build Normal file
View File

@ -0,0 +1,55 @@
db_api = static_library(
'db_api',
'DatabaseLock.cxx',
'Selection.cxx',
include_directories: inc,
)
db_api_dep = declare_dependency(
link_with: db_api,
)
subdir('plugins')
db_glue_sources = [
'Count.cxx',
'update/UpdateDomain.cxx',
'update/Config.cxx',
'update/Service.cxx',
'update/Queue.cxx',
'update/UpdateIO.cxx',
'update/Editor.cxx',
'update/Walk.cxx',
'update/UpdateSong.cxx',
'update/Container.cxx',
'update/Remove.cxx',
'update/ExcludeList.cxx',
'DatabaseGlue.cxx',
'Configured.cxx',
'DatabaseSong.cxx',
'DatabasePrint.cxx',
'DatabaseQueue.cxx',
'DatabasePlaylist.cxx',
]
if enable_inotify
db_glue_sources += [
'update/InotifyDomain.cxx',
'update/InotifySource.cxx',
'update/InotifyQueue.cxx',
'update/InotifyUpdate.cxx',
]
endif
db_glue = static_library(
'db_glue',
db_glue_sources,
include_directories: inc,
)
db_glue_dep = declare_dependency(
link_with: db_glue,
dependencies: [
db_plugins_dep,
],
)

View File

@ -0,0 +1,49 @@
db_plugins_sources = [
'../../PlaylistDatabase.cxx',
'../Registry.cxx',
'../Helpers.cxx',
'../VHelper.cxx',
'../UniqueTags.cxx',
'simple/DatabaseSave.cxx',
'simple/DirectorySave.cxx',
'simple/Directory.cxx',
'simple/Song.cxx',
'simple/SongSort.cxx',
'simple/Mount.cxx',
'simple/SimpleDatabasePlugin.cxx',
]
if upnp_dep.found()
db_plugins_sources += [
'upnp/UpnpDatabasePlugin.cxx',
'upnp/Tags.cxx',
'upnp/ContentDirectoryService.cxx',
'upnp/Directory.cxx',
'upnp/Object.cxx',
]
endif
libmpdclient_dep = dependency('libmpdclient', version: '>= 2.9', required: get_option('libmpdclient'))
conf.set('ENABLE_LIBMPDCLIENT', libmpdclient_dep.found())
if libmpdclient_dep.found()
db_plugins_sources += 'ProxyDatabasePlugin.cxx'
endif
db_plugins = static_library(
'db_plugins',
db_plugins_sources,
include_directories: inc,
dependencies: [
upnp_dep,
libmpdclient_dep,
],
)
db_plugins_dep = declare_dependency(
link_with: db_plugins,
dependencies: [
db_api_dep,
storage_api_dep,
config_dep,
],
)

32
src/decoder/meson.build Normal file
View File

@ -0,0 +1,32 @@
decoder_api = static_library(
'decoder_api',
'DecoderAPI.cxx',
'Reader.cxx',
'DecoderBuffer.cxx',
'DecoderPlugin.cxx',
include_directories: inc,
)
decoder_api_dep = declare_dependency(
link_with: decoder_api,
dependencies: [
tag_dep,
config_dep,
input_api_dep,
],
)
subdir('plugins')
decoder_glue = static_library(
'decoder_glue',
'DecoderList.cxx',
include_directories: inc,
)
decoder_glue_dep = declare_dependency(
link_with: decoder_glue,
dependencies: [
decoder_plugins_dep,
],
)

View File

@ -0,0 +1,196 @@
decoder_plugins_sources = [
'PcmDecoderPlugin.cxx',
]
if get_option('dsd')
decoder_plugins_sources += [
'HybridDsdDecoderPlugin.cxx',
'DsdiffDecoderPlugin.cxx',
'DsfDecoderPlugin.cxx',
'DsdLib.cxx',
]
endif
if ffmpeg_dep.found()
decoder_plugins_sources += [
'FfmpegIo.cxx',
'FfmpegMetaData.cxx',
'FfmpegDecoderPlugin.cxx',
]
endif
adplug_dep = dependency('adplug', required: get_option('adplug'))
conf.set('ENABLE_ADPLUG', adplug_dep.found())
if adplug_dep.found()
decoder_plugins_sources += 'AdPlugDecoderPlugin.cxx'
endif
conf.set('ENABLE_FLAC', flac_dep.found())
if flac_dep.found()
decoder_plugins_sources += [
'FlacDecoderPlugin.cxx',
'FlacInput.cxx',
'FlacPcm.cxx',
'FlacDomain.cxx',
'FlacCommon.cxx',
]
endif
conf.set('ENABLE_VORBIS_DECODER', libvorbis_dep.found())
if libvorbis_dep.found()
decoder_plugins_sources += [
'VorbisDecoderPlugin.cxx',
'VorbisDomain.cxx',
]
endif
conf.set('ENABLE_OPUS', libopus_dep.found())
if libopus_dep.found()
decoder_plugins_sources += [
'OpusDecoderPlugin.cxx',
'OpusDomain.cxx',
'OpusHead.cxx',
'OpusTags.cxx',
]
endif
if ogg_dep.found()
decoder_plugins_sources += 'OggDecoder.cxx'
endif
if xiph_dep.found()
decoder_plugins_sources += 'OggCodec.cxx'
endif
fluidsynth_dep = dependency('fluidsynth', version: '>= 1.1', required: get_option('fluidsynth'))
conf.set('ENABLE_FLUIDSYNTH', fluidsynth_dep.found())
if fluidsynth_dep.found()
decoder_plugins_sources += 'FluidsynthDecoderPlugin.cxx'
endif
libaudiofile_dep = dependency('audiofile', version: '>= 0.3', required: get_option('audiofile'))
conf.set('ENABLE_AUDIOFILE', libaudiofile_dep.found())
if libaudiofile_dep.found()
decoder_plugins_sources += 'AudiofileDecoderPlugin.cxx'
endif
libfaad_dep = c_compiler.find_library('faad', required: get_option('faad'))
conf.set('ENABLE_FAAD', libfaad_dep.found())
if libfaad_dep.found()
decoder_plugins_sources += 'FaadDecoderPlugin.cxx'
endif
libgme_dep = c_compiler.find_library('gme', required: get_option('gme'))
conf.set('ENABLE_GME', libgme_dep.found())
if libgme_dep.found()
decoder_plugins_sources += 'GmeDecoderPlugin.cxx'
endif
libmad_dep = c_compiler.find_library('mad', required: get_option('mad'))
conf.set('ENABLE_MAD', libmad_dep.found())
if libmad_dep.found()
decoder_plugins_sources += 'MadDecoderPlugin.cxx'
endif
libmikmod_dep = dependency('libmikmod', version: '>= 3.2', required: get_option('mikmod'))
conf.set('ENABLE_LIBMIKMOD', libmikmod_dep.found())
if libmikmod_dep.found()
decoder_plugins_sources += 'MikmodDecoderPlugin.cxx'
endif
libmodplug_dep = dependency('libmodplug', required: get_option('modplug'))
conf.set('ENABLE_MODPLUG', libmodplug_dep.found())
if libmodplug_dep.found()
decoder_plugins_sources += 'ModplugDecoderPlugin.cxx'
endif
libmpcdec_dep = c_compiler.find_library('mpcdec', required: get_option('mpcdec'))
conf.set('ENABLE_MPCDEC', libmpcdec_dep.found())
if libmpcdec_dep.found()
decoder_plugins_sources += 'MpcdecDecoderPlugin.cxx'
endif
libmpg123_dep = dependency('libmpg123', required: get_option('mpg123'))
conf.set('ENABLE_MPG123', libmpg123_dep.found())
if libmpg123_dep.found()
decoder_plugins_sources += 'Mpg123DecoderPlugin.cxx'
endif
libsndfile_dep = dependency('sndfile', required: get_option('sndfile'))
conf.set('ENABLE_SNDFILE', libsndfile_dep.found())
if libsndfile_dep.found()
decoder_plugins_sources += 'SndfileDecoderPlugin.cxx'
endif
wavpack_dep = dependency('wavpack', required: get_option('wavpack'))
conf.set('ENABLE_WAVPACK', wavpack_dep.found())
if wavpack_dep.found()
decoder_plugins_sources += 'WavpackDecoderPlugin.cxx'
endif
wildmidi_dep = c_compiler.find_library('WildMidi', required: get_option('wildmidi'))
conf.set('ENABLE_WILDMIDI', wildmidi_dep.found())
if wildmidi_dep.found()
decoder_plugins_sources += 'WildmidiDecoderPlugin.cxx'
endif
if not get_option('sidplay').disabled()
libsidplayfp_dep = dependency('libsidplayfp', required: false)
conf.set('HAVE_SIDPLAYFP', libsidplayfp_dep.found())
if libsidplayfp_dep.found()
libsidplay_dep = libsidplayfp_dep
else
libsidplay2_dep = dependency('libsidplay2', required: false)
if libsidplay2_dep.found()
libsidutils_dep = dependency('libsidutils')
libresid_builder_dep = compiler.find_library('resid-builder')
libsidplay_dep = declare_dependency(dependencies: [libsidplay2_dep, libsidutils_dep, libresid_builder_dep])
elif get_option('sidplay').enabled()
error('Neither libsidplayfp nor libsidplay2 found')
else
libsidplay_dep = libsidplay2_dep
endif
endif
else
libsidplay_dep = dependency('', required: false)
endif
conf.set('ENABLE_SIDPLAY', libsidplay_dep.found())
if libsidplay_dep.found()
decoder_plugins_sources += 'SidplayDecoderPlugin.cxx'
endif
decoder_plugins = static_library(
'decoder_plugins',
decoder_plugins_sources,
include_directories: inc,
dependencies: [
adplug_dep,
ffmpeg_dep,
flac_dep,
fluidsynth_dep,
libaudiofile_dep,
libfaad_dep,
libgme_dep,
libmad_dep,
libmikmod_dep,
libmodplug_dep,
libmpcdec_dep,
libmpg123_dep,
libopus_dep,
libsidplay_dep,
libsndfile_dep,
libvorbis_dep,
ogg_dep,
wavpack_dep,
wildmidi_dep,
],
)
decoder_plugins_dep = declare_dependency(
link_with: decoder_plugins,
dependencies: [
decoder_api_dep,
pcm_dep,
],
)

25
src/encoder/meson.build Normal file
View File

@ -0,0 +1,25 @@
conf.set('ENABLE_ENCODER', need_encoder)
if not need_encoder
encoder_glue_dep = dependency('', required: false)
subdir_done()
endif
encoder_api_dep = declare_dependency()
subdir('plugins')
encoder_glue = static_library(
'encoder_glue',
'Configured.cxx',
'ToOutputStream.cxx',
'EncoderList.cxx',
include_directories: inc,
)
encoder_glue_dep = declare_dependency(
link_with: encoder_glue,
dependencies: [
encoder_plugins_dep,
],
)

View File

@ -0,0 +1,66 @@
encoder_plugins_sources = [
'NullEncoderPlugin.cxx',
]
conf.set('ENABLE_FLAC_ENCODER', flac_dep.found())
if flac_dep.found()
encoder_plugins_sources += 'FlacEncoderPlugin.cxx'
endif
if libopus_dep.found()
encoder_plugins_sources += 'OpusEncoderPlugin.cxx'
endif
conf.set('ENABLE_VORBISENC', libvorbisenc_dep.found())
if libvorbisenc_dep.found()
encoder_plugins_sources += 'VorbisEncoderPlugin.cxx'
endif
liblame_dep = c_compiler.find_library('mp3lame', required: get_option('lame'))
conf.set('ENABLE_LAME', liblame_dep.found())
if liblame_dep.found()
encoder_plugins_sources += 'LameEncoderPlugin.cxx'
endif
libtwolame_dep = dependency('twolame', required: get_option('twolame'))
conf.set('ENABLE_TWOLAME', libtwolame_dep.found())
if libtwolame_dep.found()
encoder_plugins_sources += 'TwolameEncoderPlugin.cxx'
endif
libshine_dep = dependency('shine', version: '>= 3.1', required: get_option('shine'))
conf.set('ENABLE_SHINE', libshine_dep.found())
if libshine_dep.found()
encoder_plugins_sources += 'ShineEncoderPlugin.cxx'
endif
conf.set('ENABLE_WAVE_ENCODER', get_option('wave_encoder'))
if get_option('wave_encoder')
encoder_plugins_sources += 'WaveEncoderPlugin.cxx'
endif
encoder_plugins = static_library(
'encoder_plugins',
encoder_plugins_sources,
include_directories: inc,
dependencies: [
flac_dep,
ogg_dep,
libopus_dep,
libvorbisenc_dep,
libvorbis_dep,
liblame_dep,
libtwolame_dep,
libshine_dep,
],
)
encoder_plugins_dep = declare_dependency(
link_with: encoder_plugins,
dependencies: [
encoder_api_dep,
tag_dep,
pcm_dep,
config_dep,
],
)

28
src/event/meson.build Normal file
View File

@ -0,0 +1,28 @@
event = static_library(
'event',
'PollGroupPoll.cxx',
'PollGroupWinSelect.cxx',
'SignalMonitor.cxx',
'TimerEvent.cxx',
'IdleMonitor.cxx',
'DeferEvent.cxx',
'MaskMonitor.cxx',
'SocketMonitor.cxx',
'BufferedSocket.cxx',
'FullyBufferedSocket.cxx',
'MultiSocketMonitor.cxx',
'ServerSocket.cxx',
'Call.cxx',
'Thread.cxx',
'Loop.cxx',
include_directories: inc,
)
event_dep = declare_dependency(
link_with: event,
dependencies: [
thread_dep,
system_dep,
boost_dep,
],
)

28
src/filter/meson.build Normal file
View File

@ -0,0 +1,28 @@
filter_api = static_library(
'filter_api',
'Observer.cxx',
'Filter.cxx',
include_directories: inc,
)
filter_api_dep = declare_dependency(
link_with: filter_api,
)
subdir('plugins')
filter_glue = static_library(
'filter_glue',
'FilterRegistry.cxx',
'Factory.cxx',
'LoadOne.cxx',
'LoadChain.cxx',
include_directories: inc,
)
filter_glue_dep = declare_dependency(
link_with: filter_glue,
dependencies: [
filter_plugins_dep,
],
)

View File

@ -0,0 +1,22 @@
filter_plugins = static_library(
'filter_plugins',
'../../AudioCompress/compress.c',
'NullFilterPlugin.cxx',
'ChainFilterPlugin.cxx',
'AutoConvertFilterPlugin.cxx',
'ConvertFilterPlugin.cxx',
'RouteFilterPlugin.cxx',
'NormalizeFilterPlugin.cxx',
'ReplayGainFilterPlugin.cxx',
'VolumeFilterPlugin.cxx',
include_directories: inc,
)
filter_plugins_dep = declare_dependency(
link_with: filter_plugins,
dependencies: [
filter_api_dep,
pcm_dep,
config_dep,
],
)

52
src/fs/meson.build Normal file
View File

@ -0,0 +1,52 @@
fs_sources = [
'Domain.cxx',
'Traits.cxx',
'Config.cxx',
'Charset.cxx',
'Path.cxx',
'Path2.cxx',
'AllocatedPath.cxx',
'FileSystem.cxx',
'List.cxx',
'StandardDirectory.cxx',
'CheckFile.cxx',
'DirectoryReader.cxx',
'io/PeekReader.cxx',
'io/FileReader.cxx',
'io/BufferedReader.cxx',
'io/TextFile.cxx',
'io/FileOutputStream.cxx',
'io/BufferedOutputStream.cxx',
]
if is_windows
shlwapi_dep = c_compiler.find_library('shlwapi')
else
shlwapi_dep = dependency('', required: false)
endif
if zlib_dep.found()
fs_sources += [
'io/GunzipReader.cxx',
'io/AutoGunzipReader.cxx',
'io/GzipOutputStream.cxx',
]
endif
fs = static_library(
'fs',
fs_sources,
include_directories: inc,
dependencies: [
zlib_dep,
],
)
fs_dep = declare_dependency(
link_with: fs,
dependencies: [
system_dep,
icu_dep,
shlwapi_dep,
],
)

18
src/haiku/meson.build Normal file
View File

@ -0,0 +1,18 @@
rc = meson.find_program('rc')
xres = meson.find_program('xres')
rsrc = custom_target(
'mpd.rsrc',
output: 'mpd.rsrc',
input: 'mpd.rdef',
command: [rc, '-o', '@OUTPUT@', '@INPUT@'],
)
custom_target(
'mpd.rsrc',
output: 'mpd',
input: [mpd, rsrc],
command: [xres, '-o', '@OUTPUT@', '--', '@INPUT@'],
install: true,
install_dir: get_option('bindir'),
)

44
src/input/meson.build Normal file
View File

@ -0,0 +1,44 @@
input_api = static_library(
'input_api',
'Error.cxx',
'InputStream.cxx',
'ThreadInputStream.cxx',
'AsyncInputStream.cxx',
'ProxyInputStream.cxx',
include_directories: inc,
)
input_api_dep = declare_dependency(
link_with: input_api,
dependencies: [
event_dep,
],
)
subdir('plugins')
input_glue = static_library(
'input_glue',
'Init.cxx',
'Registry.cxx',
'Open.cxx',
'LocalOpen.cxx',
'ScanTags.cxx',
'Reader.cxx',
'TextInputStream.cxx',
'ProxyInputStream.cxx',
'RewindInputStream.cxx',
'BufferedInputStream.cxx',
'MaybeBufferedInputStream.cxx',
include_directories: inc,
)
input_glue_dep = declare_dependency(
link_with: input_glue,
dependencies: [
input_plugins_dep,
fs_dep,
config_dep,
tag_dep,
],
)

View File

@ -0,0 +1,110 @@
input_plugins_sources = [
'FileInputPlugin.cxx',
]
if alsa_dep.found()
input_plugins_sources += 'AlsaInputPlugin.cxx'
endif
libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 0.4', required: get_option('cdio_paranoia'))
conf.set('ENABLE_CDIO_PARANOIA', libcdio_paranoia_dep.found())
if libcdio_paranoia_dep.found()
input_plugins_sources += 'CdioParanoiaInputPlugin.cxx'
conf.set('HAVE_CDIO_PARANOIA_PARANOIA_H',
compiler.has_header('cdio/paranoia/paranoia.h',
dependencies: libcdio_paranoia_dep))
endif
if curl_dep.found()
input_plugins_sources += [
'CurlInputPlugin.cxx',
'../IcyInputStream.cxx',
'../../IcyMetaDataParser.cxx',
]
endif
if ffmpeg_dep.found()
input_plugins_sources += 'FfmpegInputPlugin.cxx'
endif
libmms_dep = dependency('libmms', version: '>= 0.4', required: get_option('mms'))
conf.set('ENABLE_MMS', libmms_dep.found())
if libmms_dep.found()
input_plugins_sources += 'MmsInputPlugin.cxx'
endif
if nfs_dep.found()
input_plugins_sources += 'NfsInputPlugin.cxx'
endif
if smbclient_dep.found()
input_plugins_sources += 'SmbclientInputPlugin.cxx'
endif
qobuz_feature = get_option('qobuz')
if qobuz_feature.disabled()
enable_qobuz = false
else
enable_qobuz = curl_dep.found() and yajl_dep.found() and gcrypt_dep.found()
if not enable_qobuz and qobuz_feature.enabled()
error('Qobuz requires CURL, libyajl and libgcrypt')
endif
endif
conf.set('ENABLE_QOBUZ', enable_qobuz)
if enable_qobuz
input_plugins_sources += [
'QobuzClient.cxx',
'QobuzErrorParser.cxx',
'QobuzLoginRequest.cxx',
'QobuzTrackRequest.cxx',
'QobuzTagScanner.cxx',
'QobuzInputPlugin.cxx',
]
endif
tidal_feature = get_option('tidal')
if tidal_feature.disabled()
enable_tidal = false
else
enable_tidal = curl_dep.found() and yajl_dep.found()
if not enable_tidal and tidal_feature.enabled()
error('Tidal requires CURL and libyajl')
endif
endif
conf.set('ENABLE_TIDAL', enable_tidal)
if enable_tidal
input_plugins_sources += [
'TidalErrorParser.cxx',
'TidalLoginRequest.cxx',
'TidalSessionManager.cxx',
'TidalTrackRequest.cxx',
'TidalTagScanner.cxx',
'TidalInputPlugin.cxx',
]
endif
input_plugins = static_library(
'input_plugins',
input_plugins_sources,
include_directories: inc,
dependencies: [
alsa_dep,
curl_dep,
ffmpeg_dep,
libcdio_paranoia_dep,
libmms_dep,
nfs_dep,
smbclient_dep,
yajl_dep,
gcrypt_dep,
],
)
input_plugins_dep = declare_dependency(
link_with: input_plugins,
dependencies: [
input_api_dep,
pcm_dep,
],
)

17
src/java/meson.build Normal file
View File

@ -0,0 +1,17 @@
java = static_library(
'java',
'Global.cxx',
'File.cxx',
'String.cxx',
include_directories: inc,
dependencies: [
],
)
java_dep = declare_dependency(
link_with: java,
dependencies: [
util_dep,
fs_dep,
],
)

31
src/lib/alsa/meson.build Normal file
View File

@ -0,0 +1,31 @@
if not is_linux
alsa_dep = dependency('', required: false)
subdir_done()
endif
libasound_dep = dependency('alsa', version: '>= 0.9.0', required: get_option('alsa'))
if not libasound_dep.found()
alsa_dep = dependency('', required: false)
subdir_done()
endif
conf.set('ENABLE_ALSA', true)
alsa = static_library(
'alsa',
'Version.cxx',
'AllowedFormat.cxx',
'HwSetup.cxx',
'NonBlock.cxx',
include_directories: inc,
dependencies: [
libasound_dep,
],
)
alsa_dep = declare_dependency(
link_with: alsa,
dependencies: [
event_dep,
],
)

28
src/lib/curl/meson.build Normal file
View File

@ -0,0 +1,28 @@
curl_dep = dependency('libcurl', version: '>= 7.18', required: get_option('curl'))
conf.set('ENABLE_CURL', curl_dep.found())
if not curl_dep.found()
subdir_done()
endif
curl = static_library(
'curl',
'Delegate.cxx',
'Version.cxx',
'Init.cxx',
'Global.cxx',
'Request.cxx',
'Form.cxx',
include_directories: inc,
dependencies: [
curl_dep,
],
)
curl_dep = declare_dependency(
link_with: curl,
dependencies: [
event_dep,
util_dep,
curl_dep,
],
)

37
src/lib/dbus/meson.build Normal file
View File

@ -0,0 +1,37 @@
dbus_dep = dependency('dbus-1', required: get_option('dbus'))
conf.set('ENABLE_DBUS', dbus_dep.found())
if not dbus_dep.found()
if get_option('udisks').enabled()
error('udisks2 requires D-Bus')
endif
enable_udisks = false
conf.set('ENABLE_UDISKS', enable_udisks)
subdir_done()
endif
enable_udisks = not get_option('udisks').disabled()
conf.set('ENABLE_UDISKS', enable_udisks)
dbus = static_library(
'dbus',
'Connection.cxx',
'Error.cxx',
'Message.cxx',
'UDisks2.cxx',
'ScopeMatch.cxx',
'Glue.cxx',
'Watch.cxx',
include_directories: inc,
dependencies: [
dbus_dep,
],
)
dbus_dep = declare_dependency(
link_with: dbus,
dependencies: [
dbus_dep,
event_dep,
],
)

19
src/lib/expat/meson.build Normal file
View File

@ -0,0 +1,19 @@
expat_dep = dependency('expat', required: get_option('expat'))
conf.set('ENABLE_EXPAT', expat_dep.found())
if not expat_dep.found()
subdir_done()
endif
expat = static_library(
'expat',
'ExpatParser.cxx',
'StreamExpatParser.cxx',
include_directories: inc,
dependencies: [
expat_dep,
],
)
expat_dep = declare_dependency(
link_with: expat,
)

View File

@ -0,0 +1,29 @@
libavformat_dep = dependency('libavformat', version: '>= 56.1', required: get_option('ffmpeg'))
libavcodec_dep = dependency('libavcodec', version: '>= 56.1', required: get_option('ffmpeg'))
libavutil_dep = dependency('libavutil', version: '>= 54.3', required: get_option('ffmpeg'))
enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()
conf.set('ENABLE_FFMPEG', enable_ffmpeg)
if not enable_ffmpeg
ffmpeg_dep = dependency('', required: false)
subdir_done()
endif
ffmpeg = static_library(
'ffmpeg',
'Init.cxx',
'LogError.cxx',
'LogCallback.cxx',
'Error.cxx',
'Domain.cxx',
include_directories: inc,
dependencies: [
libavformat_dep,
libavcodec_dep,
libavutil_dep,
],
)
ffmpeg_dep = declare_dependency(
link_with: ffmpeg,
)

View File

@ -0,0 +1,20 @@
gcrypt_dep = c_compiler.find_library('gcrypt', required: get_option('qobuz'))
if not gcrypt_dep.found()
subdir_done()
endif
gcrypt = static_library(
'gcrypt',
'MD5.cxx',
include_directories: inc,
dependencies: [
gcrypt_dep,
],
)
gcrypt_dep = declare_dependency(
link_with: gcrypt,
dependencies: [
gcrypt_dep,
],
)

42
src/lib/icu/meson.build Normal file
View File

@ -0,0 +1,42 @@
icu_dep = dependency('icu-i18n', version: '>= 50', required: get_option('icu'))
conf.set('HAVE_ICU', icu_dep.found())
icu_sources = [
'CaseFold.cxx',
'Compare.cxx',
'Collate.cxx',
'Converter.cxx',
]
if is_windows
icu_sources += 'Win32.cxx'
endif
if icu_dep.found()
icu_sources += [
'Util.cxx',
'Init.cxx',
]
elif not get_option('iconv').disabled()
have_iconv = compiler.has_function('iconv')
conf.set('HAVE_ICONV', have_iconv)
if get_option('iconv').enabled()
error('iconv() not available')
endif
endif
icu = static_library(
'icu',
icu_sources,
include_directories: inc,
dependencies: [
icu_dep,
],
)
icu_dep = declare_dependency(
link_with: icu,
dependencies: [
util_dep,
],
)

27
src/lib/nfs/meson.build Normal file
View File

@ -0,0 +1,27 @@
nfs_dep = dependency('libnfs', version: '>= 1.11', required: get_option('nfs'))
conf.set('ENABLE_NFS', nfs_dep.found())
if not nfs_dep.found()
subdir_done()
endif
nfs = static_library(
'nfs',
'Connection.cxx',
'Error.cxx',
'Manager.cxx',
'Glue.cxx',
'Base.cxx',
'FileReader.cxx',
'Blocking.cxx',
include_directories: inc,
dependencies: [
nfs_dep,
],
)
nfs_dep = declare_dependency(
link_with: nfs,
dependencies: [
nfs_dep,
],
)

15
src/lib/oss/meson.build Normal file
View File

@ -0,0 +1,15 @@
enable_oss = get_option('oss')
if enable_oss.disabled()
enable_oss = false
elif enable_oss.auto() and alsa_dep.found()
# don't bother auto-enabling OSS if ALSA is available
enable_oss = false
elif compiler.has_header('sys/soundcard.h') or compiler.has_header('soundcard.h')
enable_oss = true
elif enable_oss.auto()
enable_oss = false
else
error('sys/soundcard.h not found')
endif
conf.set('HAVE_OSS', enable_oss)

23
src/lib/pulse/meson.build Normal file
View File

@ -0,0 +1,23 @@
pulse_dep = dependency('libpulse', version: '>= 0.9.16', required: get_option('pulse'))
conf.set('ENABLE_PULSE', pulse_dep.found())
if not pulse_dep.found()
subdir_done()
endif
pulse = static_library(
'pulse',
'LogError.cxx',
'Error.cxx',
'Domain.cxx',
include_directories: inc,
dependencies: [
pulse_dep,
],
)
pulse_dep = declare_dependency(
link_with: pulse,
dependencies: [
pulse_dep,
],
)

2
src/lib/roar/meson.build Normal file
View File

@ -0,0 +1,2 @@
libroar_dep = dependency('libroar', version: '>= 0.4.0', required: get_option('roar'))
conf.set('ENABLE_ROAR', libroar_dep.found())

View File

@ -0,0 +1,23 @@
smbclient_dep = dependency('smbclient', version: '>= 0.2', required: get_option('smbclient'))
conf.set('ENABLE_SMBCLIENT', smbclient_dep.found())
if not smbclient_dep.found()
subdir_done()
endif
smbclient = static_library(
'smbclient',
'Domain.cxx',
'Mutex.cxx',
'Init.cxx',
include_directories: inc,
dependencies: [
smbclient_dep,
],
)
smbclient_dep = declare_dependency(
link_with: smbclient,
dependencies: [
smbclient_dep,
],
)

12
src/lib/sndio/meson.build Normal file
View File

@ -0,0 +1,12 @@
libsndio_dep = c_compiler.find_library('sndio', required: get_option('sndio'))
if libsndio_dep.found()
if c_compiler.has_header_symbol('sndio.h', 'ROAR_VERSION')
if get_option('sndio').enabled()
error('Found libroarsndio, which is known to be broken.')
else
warning('Found libroarsndio, which is known to be broken; ignoring it.')
libsndio_dep = dependency('', required: false)
endif
endif
endif
conf.set('ENABLE_SNDIO', libsndio_dep.found())

View File

@ -0,0 +1,18 @@
sqlite_dep = dependency('sqlite3', version: '>= 3.7.3', required: get_option('sqlite'))
conf.set('ENABLE_SQLITE', sqlite_dep.found())
if not sqlite_dep.found()
subdir_done()
endif
sqlite = static_library(
'sqlite',
'Error.cxx',
include_directories: inc,
dependencies: [
sqlite_dep,
],
)
sqlite_dep = declare_dependency(
link_with: sqlite,
)

View File

@ -0,0 +1,23 @@
if not is_linux or is_android
systemd_dep = dependency('', required: false)
subdir_done()
endif
systemd_dep = dependency('libsystemd', required: get_option('systemd'))
conf.set('ENABLE_SYSTEMD_DAEMON', systemd_dep.found())
if not systemd_dep.found()
subdir_done()
endif
systemd = static_library(
'systemd',
'Watchdog.cxx',
include_directories: inc,
dependencies: [
systemd_dep,
],
)
systemd_dep = declare_dependency(
link_with: systemd,
)

40
src/lib/upnp/meson.build Normal file
View File

@ -0,0 +1,40 @@
upnp_dep = dependency('libupnp', required: get_option('upnp'))
conf.set('ENABLE_UPNP', upnp_dep.found())
if not upnp_dep.found()
subdir_done()
endif
if not curl_dep.found()
error('UPnP requires CURL')
endif
if not expat_dep.found()
error('UPnP requires expat')
endif
upnp = static_library(
'upnp',
'Init.cxx',
'ClientInit.cxx',
'Device.cxx',
'ContentDirectoryService.cxx',
'Discovery.cxx',
'ixmlwrap.cxx',
'Util.cxx',
include_directories: inc,
dependencies: [
upnp_dep,
curl_dep,
expat_dep,
],
)
upnp_dep = declare_dependency(
link_with: upnp,
dependencies: [
upnp_dep,
curl_dep,
expat_dep,
event_dep,
],
)

21
src/lib/wrap/meson.build Normal file
View File

@ -0,0 +1,21 @@
libwrap_option = get_option('libwrap')
enable_libwrap = false
if not libwrap_option.disabled() and compiler.has_header('tcpd.h') and compiler.compiles('''
#include <tcpd.h>
bool CheckLibWrap(int fd, const char &progname) {
struct request_info req;
request_init(&req, RQ_FILE, fd, RQ_DAEMON, progname, 0);
fromhost(&req);
return hosts_access(&req);
}
''')
libwrap_dep = compiler.find_library('wrap', required: libwrap_option)
else
libwrap_dep = dependency('', required: libwrap_option)
endif
if not libwrap_dep.found() and libwrap_option.enabled()
error('libwrap not found')
endif
conf.set('HAVE_LIBWRAP', libwrap_dep.found())

81
src/lib/xiph/meson.build Normal file
View File

@ -0,0 +1,81 @@
libflac_dep = dependency('flac', version: '>= 1.2', required: get_option('flac'))
libopus_dep = dependency('opus', required: get_option('opus'))
libvorbis_dep = dependency('vorbis', required: get_option('vorbis'))
if need_encoder
libvorbisenc_dep = dependency('vorbisenc', required: get_option('vorbisenc'))
else
libvorbisenc_dep = dependency('', required: false)
endif
if libopus_dep.found() or libvorbis_dep.found() or libvorbisenc_dep.found()
libogg_dep = dependency('ogg')
else
libogg_dep = dependency('', required: false)
endif
if not libogg_dep.found() or not libflac_dep.found()
xiph_dep = dependency('', required: false)
ogg_dep = dependency('', required: false)
flac_dep = dependency('', required: false)
subdir_done()
endif
xiph = static_library(
'xiph',
'VorbisComments.cxx',
'XiphTags.cxx',
include_directories: inc,
)
xiph_dep = declare_dependency(
link_with: xiph,
)
if libogg_dep.found()
ogg = static_library(
'ogg',
'OggVisitor.cxx',
'OggSerial.cxx',
'OggSyncState.cxx',
'OggFind.cxx',
'OggPacket.cxx',
include_directories: inc,
dependencies: [
libogg_dep,
],
)
ogg_dep = declare_dependency(
link_with: ogg,
dependencies: [
xiph_dep,
libogg_dep,
],
)
else
ogg_dep = dependency('', required: false)
endif
if libflac_dep.found()
flac = static_library(
'flac',
'FlacIOHandle.cxx',
'FlacMetadataChain.cxx',
'FlacStreamMetadata.cxx',
include_directories: inc,
dependencies: [
libflac_dep,
],
)
flac_dep = declare_dependency(
link_with: flac,
dependencies: [
xiph_dep,
libflac_dep,
],
)
else
flac_dep = dependency('', required: false)
endif

21
src/lib/yajl/meson.build Normal file
View File

@ -0,0 +1,21 @@
yajl_dep = dependency('yajl', required: get_option('yajl'))
if not yajl_dep.found()
subdir_done()
endif
yajl = static_library(
'yajl',
'ResponseParser.cxx',
'ParseInputStream.cxx',
include_directories: inc,
dependencies: [
yajl_dep,
],
)
yajl_dep = declare_dependency(
link_with: yajl,
dependencies: [
yajl_dep,
],
)

17
src/lib/zlib/meson.build Normal file
View File

@ -0,0 +1,17 @@
zlib_dep = dependency('zlib', required: get_option('zlib'))
if not zlib_dep.found()
subdir_done()
endif
zlib = static_library(
'zlib',
'Error.cxx',
include_directories: inc,
dependencies: [
zlib_dep,
],
)
zlib_dep = declare_dependency(
link_with: zlib,
)

18
src/mixer/meson.build Normal file
View File

@ -0,0 +1,18 @@
mixer_api_dep = declare_dependency()
subdir('plugins')
mixer_glue = static_library(
'mixer_glue',
'MixerControl.cxx',
'MixerType.cxx',
'MixerAll.cxx',
include_directories: inc,
)
mixer_glue_dep = declare_dependency(
link_with: mixer_glue,
dependencies: [
mixer_plugins_dep,
],
)

View File

@ -0,0 +1,58 @@
mixer_plugins_sources = [
'NullMixerPlugin.cxx',
'SoftwareMixerPlugin.cxx',
]
if alsa_dep.found()
mixer_plugins_sources += [
'AlsaMixerPlugin.cxx',
'volume_mapping.c',
]
endif
if is_haiku
mixer_plugins_sources += 'HaikuMixerPlugin.cxx'
endif
if enable_oss
mixer_plugins_sources += 'OssMixerPlugin.cxx'
endif
if is_darwin
mixer_plugins_sources += 'OSXMixerPlugin.cxx'
endif
if pulse_dep.found()
mixer_plugins_sources += 'PulseMixerPlugin.cxx'
endif
if libroar_dep.found()
mixer_plugins_sources += 'RoarMixerPlugin.cxx'
endif
if libsndio_dep.found()
mixer_plugins_sources += 'SndioMixerPlugin.cxx'
endif
if is_windows
mixer_plugins_sources += 'WinmmMixerPlugin.cxx'
endif
mixer_plugins = static_library(
'mixer_plugins',
mixer_plugins_sources,
include_directories: inc,
dependencies: [
alsa_dep,
pulse_dep,
libroar_dep,
libsndio_dep,
]
)
mixer_plugins_dep = declare_dependency(
link_with: mixer_plugins,
dependencies: [
config_dep,
],
)

31
src/neighbor/meson.build Normal file
View File

@ -0,0 +1,31 @@
if not get_option('neighbor')
conf.set('ENABLE_NEIGHBOR_PLUGINS', false)
neighbor_glue_dep = dependency('', required: false)
subdir_done()
endif
neighbor_api_dep = declare_dependency()
subdir('plugins')
conf.set('ENABLE_NEIGHBOR_PLUGINS', found_neighbor_plugin)
if not found_neighbor_plugin
neighbor_glue_dep = dependency('', required: false)
subdir_done()
endif
neighbor_glue = static_library(
'neighbor_glue',
'Glue.cxx',
'Registry.cxx',
include_directories: inc,
)
neighbor_glue_dep = declare_dependency(
link_with: neighbor_glue,
dependencies: [
neighbor_plugins_dep,
config_dep,
],
)

View File

@ -0,0 +1,40 @@
neighbor_plugins_sources = []
found_neighbor_plugin = false
if smbclient_dep.found()
neighbor_plugins_sources += 'SmbclientNeighborPlugin.cxx'
found_neighbor_plugin = true
endif
if enable_udisks
neighbor_plugins_sources += 'UdisksNeighborPlugin.cxx'
found_neighbor_plugin = true
endif
if upnp_dep.found()
neighbor_plugins_sources += 'UpnpNeighborPlugin.cxx'
found_neighbor_plugin = true
endif
if not found_neighbor_plugin
subdir_done()
endif
neighbor_plugins = static_library(
'neighbor_plugins',
neighbor_plugins_sources,
include_directories: inc,
dependencies: [
dbus_dep,
smbclient_dep,
upnp_dep,
],
)
neighbor_plugins_dep = declare_dependency(
link_with: neighbor_plugins,
dependencies: [
neighbor_api_dep,
event_dep,
],
)

60
src/net/meson.build Normal file
View File

@ -0,0 +1,60 @@
have_tcp = get_option('tcp')
conf.set('HAVE_TCP', have_tcp)
if have_tcp and not get_option('ipv6').disabled()
if is_windows
have_ipv6 = c_compiler.has_header_symbol('winsock2.h', 'AF_INET6')
else
have_ipv6 = c_compiler.has_header_symbol('sys/socket.h', 'AF_INET6')
endif
if not have_ipv6 and get_option('ipv6').enabled()
error('IPv6 not supported by OS')
endif
conf.set('HAVE_STRUCT_SOCKADDR_IN_SIN_LEN', c_compiler.has_member('struct sockaddr_in', 'sin_len', prefix: '''
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <netinet/in.h>
#endif'''))
else
have_ipv6 = false
endif
conf.set('HAVE_IPV6', have_ipv6)
have_local_socket = not is_windows and get_option('local_socket')
conf.set('HAVE_UN', have_local_socket)
if have_local_socket
conf.set('HAVE_STRUCT_UCRED', compiler.has_header_symbol('sys/socket.h', 'struct ucred') and compiler.has_header_symbol('sys/socket.h', 'SO_PEERCRED'))
conf.set('HAVE_GETPEEREID', compiler.has_function('getpeereid'))
endif
if not have_tcp and not have_local_socket
error('Must enable either "tcp" or "local_socket"')
endif
net = static_library(
'net',
'ToString.cxx',
'HostParser.cxx',
'Resolver.cxx',
'AddressInfo.cxx',
'StaticSocketAddress.cxx',
'AllocatedSocketAddress.cxx',
'IPv4Address.cxx',
'IPv6Address.cxx',
'SocketAddress.cxx',
'SocketUtil.cxx',
'SocketDescriptor.cxx',
'SocketError.cxx',
include_directories: inc,
)
net_dep = declare_dependency(
link_with: net,
dependencies: [
system_dep,
],
)

46
src/output/meson.build Normal file
View File

@ -0,0 +1,46 @@
output_api = static_library(
'output_api',
'Interface.cxx',
'Timer.cxx',
include_directories: inc,
)
output_api_dep = declare_dependency(
link_with: output_api,
dependencies: [
filter_plugins_dep,
mixer_plugins_dep,
],
)
subdir('plugins')
output_glue = static_library(
'output_glue',
'Defaults.cxx',
'Filtered.cxx',
'Registry.cxx',
'MultipleOutputs.cxx',
'SharedPipeConsumer.cxx',
'Source.cxx',
'Thread.cxx',
'Domain.cxx',
'Control.cxx',
'State.cxx',
'Print.cxx',
'OutputCommand.cxx',
'OutputPlugin.cxx',
'Finish.cxx',
'Init.cxx',
include_directories: inc,
)
output_glue_dep = declare_dependency(
link_with: output_glue,
dependencies: [
filter_glue_dep,
mixer_plugins_dep,
output_plugins_dep,
],
)

View File

@ -0,0 +1,165 @@
output_plugins_sources = [
'NullOutputPlugin.cxx',
]
output_plugins_deps = [
output_api_dep,
config_dep,
tag_dep,
]
need_encoder = false
if alsa_dep.found()
output_plugins_sources += 'AlsaOutputPlugin.cxx'
endif
libao_dep = dependency('ao', required: get_option('ao'))
conf.set('ENABLE_AO', libao_dep.found())
if libao_dep.found()
output_plugins_sources += 'AoOutputPlugin.cxx'
endif
enable_fifo_output = get_option('fifo') and not is_windows
conf.set('HAVE_FIFO', enable_fifo_output)
if enable_fifo_output
output_plugins_sources += 'FifoOutputPlugin.cxx'
endif
if is_haiku
output_plugins_sources += 'HaikuOutputPlugin.cxx'
endif
conf.set('ENABLE_HTTPD_OUTPUT', get_option('httpd'))
if get_option('httpd')
output_plugins_sources += [
'httpd/IcyMetaDataServer.cxx',
'httpd/Page.cxx',
'httpd/HttpdClient.cxx',
'httpd/HttpdOutputPlugin.cxx',
]
output_plugins_deps += [ event_dep, net_dep, libwrap_dep ]
need_encoder = true
endif
libjack_dep = dependency('jack', version: '>= 0.100', required: get_option('jack'))
conf.set('ENABLE_JACK', libjack_dep.found())
if libjack_dep.found()
output_plugins_sources += 'JackOutputPlugin.cxx'
conf.set('HAVE_JACK_SET_INFO_FUNCTION', compiler.has_header_symbol('jack/jack.h', 'jack_set_info_function'))
endif
openal_dep = dependency('', required: false)
if not get_option('openal').disabled()
if is_darwin
if compiler.has_header('OpenAL/al.h')
openal_dep = declare_dependency(link_args: ['-framework', 'OpenAL'])
endif
else
openal_dep = dependency('openal', required: false)
endif
if openal_dep.found()
output_plugins_sources += 'OpenALOutputPlugin.cxx'
elif get_option('openal').enabled()
error('OpenAL not available')
endif
endif
conf.set('HAVE_OPENAL', openal_dep.found())
if enable_oss
output_plugins_sources += 'OssOutputPlugin.cxx'
endif
if is_darwin
output_plugins_sources += 'OSXOutputPlugin.cxx'
audiounit_dep = declare_dependency(
link_args: [
'-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreServices',
]
)
else
audiounit_dep = dependency('', required: false)
endif
conf.set('HAVE_OSX', is_darwin)
enable_pipe_output = get_option('pipe') and not is_windows
conf.set('ENABLE_PIPE_OUTPUT', enable_pipe_output)
if enable_pipe_output
output_plugins_sources += 'PipeOutputPlugin.cxx'
endif
if pulse_dep.found()
output_plugins_sources += 'PulseOutputPlugin.cxx'
endif
conf.set('ENABLE_RECORDER_OUTPUT', get_option('recorder'))
if get_option('recorder')
output_plugins_sources += 'RecorderOutputPlugin.cxx'
need_encoder = true
endif
if libroar_dep.found()
output_plugins_sources += 'RoarOutputPlugin.cxx'
endif
libshout_dep = dependency('shout', required: get_option('shout'))
conf.set('HAVE_SHOUT', libshout_dep.found())
if libshout_dep.found()
output_plugins_sources += 'ShoutOutputPlugin.cxx'
need_encoder = true
endif
if is_android
sles_dep = c_compiler.find_library('OpenSLES')
output_plugins_sources += 'sles/SlesOutputPlugin.cxx'
else
sles_dep = dependency('', required: false)
endif
if libsndio_dep.found()
output_plugins_sources += 'SndioOutputPlugin.cxx'
endif
enable_solaris_output = get_option('solaris_output')
if enable_solaris_output.auto()
enable_solaris_output = host_machine.system() == 'sunos' or host_machine.system() == 'solaris'
else
enable_solaris_output = enable_solaris_output.enabled()
endif
conf.set('ENABLE_SOLARIS_OUTPUT', enable_solaris_output)
if enable_solaris_output
output_plugins_sources += 'SolarisOutputPlugin.cxx'
endif
conf.set('ENABLE_WINMM_OUTPUT', is_windows)
if is_windows
output_plugins_sources += 'WinmmOutputPlugin.cxx'
winmm_dep = c_compiler.find_library('winmm')
else
winmm_dep = dependency('', required: false)
endif
output_plugins = static_library(
'output_plugins',
output_plugins_sources,
include_directories: inc,
dependencies: [
alsa_dep,
audiounit_dep,
libao_dep,
libjack_dep,
pulse_dep,
libroar_dep,
libshout_dep,
libsndio_dep,
openal_dep,
sles_dep,
winmm_dep,
],
)
output_plugins_dep = declare_dependency(
link_with: output_plugins,
dependencies: output_plugins_deps,
)

72
src/pcm/meson.build Normal file
View File

@ -0,0 +1,72 @@
pcm_sources = [
'../CheckAudioFormat.cxx',
'../AudioFormat.cxx',
'../AudioParser.cxx',
'SampleFormat.cxx',
'Interleave.cxx',
'PcmBuffer.cxx',
'PcmExport.cxx',
'PcmConvert.cxx',
'PcmDop.cxx',
'Volume.cxx',
'Silence.cxx',
'PcmMix.cxx',
'PcmChannels.cxx',
'PcmPack.cxx',
'PcmFormat.cxx',
'FormatConverter.cxx',
'ChannelsConverter.cxx',
'Order.cxx',
'GlueResampler.cxx',
'FallbackResampler.cxx',
'ConfiguredResampler.cxx',
'PcmDither.cxx',
]
if get_option('dsd')
pcm_sources += [
'Dsd16.cxx',
'Dsd32.cxx',
'PcmDsd.cxx',
'dsd2pcm/dsd2pcm.c',
]
executable(
'dsd2pcm',
'dsd2pcm/main.cpp',
'dsd2pcm/dsd2pcm.c',
'dsd2pcm/noiseshape.c',
include_directories: inc,
dependencies: [
util_dep,
],
install: false,
)
endif
libsamplerate_dep = dependency('samplerate', version: '>= 0.1.3', required: get_option('libsamplerate'))
if libsamplerate_dep.found()
conf.set('ENABLE_LIBSAMPLERATE', true)
pcm_sources += 'LibsamplerateResampler.cxx'
endif
soxr_dep = dependency('soxr', required: get_option('soxr'))
if soxr_dep.found()
conf.set('ENABLE_SOXR', true)
pcm_sources += 'SoxrResampler.cxx'
endif
pcm = static_library(
'pcm',
pcm_sources,
include_directories: inc,
dependencies: [
util_dep,
libsamplerate_dep,
soxr_dep,
],
)
pcm_dep = declare_dependency(
link_with: pcm,
)

24
src/playlist/meson.build Normal file
View File

@ -0,0 +1,24 @@
playlist_api = static_library(
'playlist_api',
'MemorySongEnumerator.cxx',
include_directories: inc,
)
playlist_api_dep = declare_dependency(
link_with: playlist_api,
)
subdir('plugins')
playlist_glue = static_library(
'playlist_glue',
'PlaylistRegistry.cxx',
include_directories: inc,
)
playlist_glue_dep = declare_dependency(
link_with: playlist_glue,
dependencies: [
playlist_plugins_dep,
],
)

View File

@ -0,0 +1,61 @@
playlist_plugins_sources = [
'ExtM3uPlaylistPlugin.cxx',
'M3uPlaylistPlugin.cxx',
'PlsPlaylistPlugin.cxx',
]
playlist_plugins_deps = [
expat_dep,
flac_dep,
]
conf.set('ENABLE_CUE', get_option('cue'))
if get_option('cue')
playlist_plugins_sources += [
'../cue/CueParser.cxx',
'CuePlaylistPlugin.cxx',
'EmbeddedCuePlaylistPlugin.cxx',
]
endif
if expat_dep.found()
playlist_plugins_sources += [
'XspfPlaylistPlugin.cxx',
'AsxPlaylistPlugin.cxx',
'RssPlaylistPlugin.cxx',
]
endif
if flac_dep.found()
playlist_plugins_sources += 'FlacPlaylistPlugin.cxx'
endif
soundcloud_feature = get_option('soundcloud')
if soundcloud_feature.disabled()
enable_soundcloud = false
else
enable_soundcloud = curl_dep.found() and yajl_dep.found()
if not enable_soundcloud and soundcloud_feature.enabled()
error('SoundCloud requires CURL and libyajl')
endif
endif
conf.set('ENABLE_SOUNDCLOUD', enable_soundcloud)
if enable_soundcloud
playlist_plugins_sources += 'SoundCloudPlaylistPlugin.cxx'
playlist_plugins_deps += yajl_dep
endif
playlist_plugins = static_library(
'playlist_plugins',
playlist_plugins_sources,
include_directories: inc,
dependencies: playlist_plugins_deps,
)
playlist_plugins_dep = declare_dependency(
link_with: playlist_plugins,
dependencies: [
playlist_api_dep,
tag_dep,
],
)

24
src/song/meson.build Normal file
View File

@ -0,0 +1,24 @@
song = static_library(
'song',
'DetachedSong.cxx',
'StringFilter.cxx',
'UriSongFilter.cxx',
'BaseSongFilter.cxx',
'TagSongFilter.cxx',
'ModifiedSinceSongFilter.cxx',
'AudioFormatSongFilter.cxx',
'AndSongFilter.cxx',
'OptimizeFilter.cxx',
'Filter.cxx',
'LightSong.cxx',
include_directories: inc,
)
song_dep = declare_dependency(
link_with: song,
dependencies: [
icu_dep,
tag_dep,
util_dep,
],
)

29
src/storage/meson.build Normal file
View File

@ -0,0 +1,29 @@
storage_api = static_library(
'storage_api',
'StorageInterface.cxx',
include_directories: inc,
)
storage_api_dep = declare_dependency(
link_with: storage_api,
)
subdir('plugins')
storage_glue = static_library(
'storage_glue',
'Registry.cxx',
'CompositeStorage.cxx',
'MemoryDirectoryReader.cxx',
'Configured.cxx',
'StorageState.cxx',
include_directories: inc,
)
storage_glue_dep = declare_dependency(
link_with: storage_glue,
dependencies: [
storage_plugins_dep,
],
)

View File

@ -0,0 +1,61 @@
storage_plugins_sources = [
'LocalStorage.cxx',
]
webdav_option = get_option('webdav')
enable_webdav = false
if not webdav_option.disabled()
enable_webdav = true
if not curl_dep.found()
if webdav_option.enabled()
error('WebDAV requires CURL')
endif
enable_webdav = false
endif
if not expat_dep.found()
if webdav_option.enabled()
error('WebDAV requires Expat')
endif
enable_webdav = false
endif
if enable_webdav
storage_plugins_sources += 'CurlStorage.cxx'
endif
endif
conf.set('ENABLE_WEBDAV', enable_webdav)
if nfs_dep.found()
storage_plugins_sources += 'NfsStorage.cxx'
endif
if smbclient_dep.found()
storage_plugins_sources += 'SmbclientStorage.cxx'
endif
if enable_udisks
storage_plugins_sources += 'UdisksStorage.cxx'
endif
storage_plugins = static_library(
'storage_plugins',
storage_plugins_sources,
include_directories: inc,
dependencies: [
curl_dep,
dbus_dep,
expat_dep,
nfs_dep,
smbclient_dep,
],
)
storage_plugins_dep = declare_dependency(
link_with: storage_plugins,
dependencies: [
storage_api_dep,
fs_dep,
],
)

34
src/system/meson.build Normal file
View File

@ -0,0 +1,34 @@
system_sources = [
'FatalError.cxx',
'FileDescriptor.cxx',
'Open.cxx',
'EventPipe.cxx',
'Clock.cxx',
]
if host_machine.system() == 'linux'
system_sources += [
'EventFD.cxx',
'SignalFD.cxx',
'EpollFD.cxx',
]
endif
system = static_library(
'system',
system_sources,
include_directories: inc,
)
if is_windows
winsock_dep = c_compiler.find_library('ws2_32')
else
winsock_dep = dependency('', required: false)
endif
system_dep = declare_dependency(
link_with: system,
dependencies: [
winsock_dep,
],
)

50
src/tag/meson.build Normal file
View File

@ -0,0 +1,50 @@
tag_sources = [
'Tag.cxx',
'Builder.cxx',
'Handler.cxx',
'Settings.cxx',
'Config.cxx',
'ParseName.cxx',
'Names.c',
'FixString.cxx',
'Pool.cxx',
'Table.cxx',
'Set.cxx',
'Format.cxx',
'VorbisComment.cxx',
'ReplayGain.cxx',
'MixRamp.cxx',
'Generic.cxx',
'Id3MusicBrainz.cxx',
'ApeLoader.cxx',
'ApeReplayGain.cxx',
'ApeTag.cxx',
]
libid3tag_dep = dependency('id3tag', required: get_option('id3tag'))
conf.set('ENABLE_ID3TAG', libid3tag_dep.found())
if libid3tag_dep.found()
tag_sources += [
'Id3Load.cxx',
'Id3Scan.cxx',
'Rva2.cxx',
'Riff.cxx',
'Aiff.cxx',
]
endif
tag = static_library(
'tag',
tag_sources,
include_directories: inc,
dependencies: [
libid3tag_dep,
],
)
tag_dep = declare_dependency(
link_with: tag,
dependencies: [
util_dep,
],
)

13
src/thread/meson.build Normal file
View File

@ -0,0 +1,13 @@
thread = static_library(
'thread',
'Util.cxx',
'Thread.cxx',
include_directories: inc,
dependencies: [
dependency('threads')
],
)
thread_dep = declare_dependency(
link_with: thread,
)

37
src/util/meson.build Normal file
View File

@ -0,0 +1,37 @@
util = static_library(
'util',
'Exception.cxx',
'Alloc.cxx',
'UTF8.cxx',
'HexFormat.cxx',
'MimeType.cxx',
'StringView.cxx',
'AllocatedString.cxx',
'TruncateString.cxx',
'StringStrip.cxx',
'StringUtil.cxx',
'StringCompare.cxx',
'WStringCompare.cxx',
'DivideString.cxx',
'SplitString.cxx',
'FormatString.cxx',
'Tokenizer.cxx',
'TimeParser.cxx',
'TimeConvert.cxx',
'TimeISO8601.cxx',
'UriUtil.cxx',
'LazyRandomEngine.cxx',
'HugeAllocator.cxx',
'PeakBuffer.cxx',
'PrintException.cxx',
'SparseBuffer.cxx',
'OptionParser.cxx',
'ByteReverse.cxx',
'format.c',
'bit_reverse.c',
include_directories: inc,
)
util_dep = declare_dependency(
link_with: util,
)

74
src/zeroconf/meson.build Normal file
View File

@ -0,0 +1,74 @@
zeroconf_option = get_option('zeroconf')
libavahi_client_dep = dependency('', required: false)
if zeroconf_option == 'auto'
if is_darwin
# Bonjour disabled for now because its build is broken
#zeroconf_option = 'bonjour'
zeroconf_option = 'disabled'
elif is_android or is_windows
zeroconf_option = 'disabled'
elif dbus_dep.found()
libavahi_client_dep = dependency('avahi-client', required: false)
if libavahi_client_dep.found()
zeroconf_option = 'avahi'
else
zeroconf_option = 'disabled'
endif
else
zeroconf_option = 'disabled'
endif
endif
if zeroconf_option == 'disabled'
zeroconf_dep = dependency('', required: false)
subdir_done()
endif
if zeroconf_option == 'bonjour'
if not compiler.has_header('dns_sd.h')
error('dns_sd.h not found')
endif
bonjour_dep = declare_dependency(link_args: ['-framework', 'dnssd'])
conf.set('HAVE_BONJOUR', true)
zeroconf = static_library(
'zeroconf_bonjour',
'ZeroconfGlue.cxx',
'ZeroconfBonjour.cxx',
include_directories: inc,
)
zeroconf_dep = declare_dependency(
link_with: zeroconf,
dependencies: [
bonjour_dep,
],
)
else
if not libavahi_client_dep.found()
libavahi_client_dep = dependency('avahi-client')
endif
conf.set('HAVE_AVAHI', true)
zeroconf = static_library(
'zeroconf_bonjour',
'ZeroconfGlue.cxx',
'ZeroconfAvahi.cxx',
'AvahiPoll.cxx',
include_directories: inc,
dependencies: [
libavahi_client_dep,
dbus_dep,
],
)
zeroconf_dep = declare_dependency(
link_with: zeroconf,
)
endif
conf.set('HAVE_ZEROCONF', true)

5
systemd/meson.build Normal file
View File

@ -0,0 +1,5 @@
systemd_unit_conf = configuration_data()
systemd_unit_conf.set('prefix', get_option('prefix'))
subdir('system')
subdir('user')

View File

@ -0,0 +1,16 @@
systemd_system_unit_dir = get_option('systemd_system_unit_dir')
if systemd_system_unit_dir == ''
systemd_system_unit_dir = join_paths(get_option('prefix'), 'lib', 'systemd', 'system')
endif
install_data(
'mpd.socket',
install_dir: systemd_system_unit_dir,
)
configure_file(
input: 'mpd.service.in',
output: 'mpd.service',
configuration: systemd_unit_conf,
install_dir: systemd_system_unit_dir,
)

Some files were not shown because too many files have changed in this diff Show More