Commit 94592c14 authored by Max Kellermann's avatar Max Kellermann

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!
parent 13ce142d
......@@ -33,7 +33,7 @@ tags
/libtool
/ltmain.sh
/mkinstalldirs
/build
/output/
/src/mpd
/systemd/system/mpd.service
/systemd/user/mpd.service
......
......@@ -9,12 +9,23 @@ matrix:
sources:
- ubuntu-toolchain-r-test
- 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:
- g++-6
- libcppunit-dev
- 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:
- 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
dist: trusty
......@@ -23,22 +34,29 @@ matrix:
sources:
- ubuntu-toolchain-r-test
- 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:
- g++-8
- libcppunit-dev
- 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:
- 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
osx_image: xcode9.3beta
env:
- MATRIX_EVAL=""
env:
global:
- MAKEFLAGS="-j2"
cache:
- apt
- ccache
......@@ -50,16 +68,14 @@ before_install:
install:
# C++14
- test "$TRAVIS_OS_NAME" != "osx" || brew install cppunit ccache
- test "$TRAVIS_OS_NAME" != "osx" || brew install cppunit ccache meson
before_script:
- ccache -s
script:
- OPTIONS="--enable-test"
- test "$TRAVIS_OS_NAME" != "osx" || OPTIONS="$OPTIONS --enable-osx"
- ./autogen.sh
- ./configure CC="ccache $CC" CXX="ccache $CXX" --disable-silent-rules --disable-dependency-tracking $OPTIONS
- make
- make check
- eval "${MATRIX_EVAL}"
- OPTIONS="-Dtest=true"
- meson . output --werror $OPTIONS
- ninja -C output -v test
- ccache -s
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign 1.11 dist-xz subdir-objects
AM_CPPFLAGS += -I$(srcdir)/src $(BOOST_CPPFLAGS)
AM_CPPFLAGS += -DSYSTEM_CONFIG_FILE_LOCATION='"$(sysconfdir)/mpd.conf"'
APK_NAME = mpd
if ANDROID
else
bin_PROGRAMS = src/mpd
endif
noinst_LIBRARIES = \
libmpd.a \
libutil.a \
libthread.a \
libnet.a \
libsystem.a \
libevent.a \
libicu.a \
libpcm.a \
libbasic.a \
libconf.a \
libsong.a \
libtag.a \
libinput.a \
libfs.a \
libplaylist_plugins.a \
libdecoder.a \
libfilter_api.a \
libfilter_plugins.a \
libfilter_glue.a \
libmixer_plugins.a \
liboutput_plugins.a
libmpd_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(LIBMPDCLIENT_CFLAGS) \
$(AVAHI_CFLAGS) \
$(LIBWRAP_CFLAGS) \
$(SQLITE_CFLAGS)
src_mpd_LDADD = \
libmpd.a \
$(NEIGHBOR_LIBS) \
$(DB_LIBS) \
$(STORAGE_LIBS) \
$(PLAYLIST_LIBS) \
$(AVAHI_LIBS) \
$(DBUS_LIBS) \
$(LIBWRAP_LDFLAGS) \
$(SQLITE_LIBS) \
$(DECODER_LIBS) \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(OUTPUT_LIBS) \
libsong.a \
$(TAG_LIBS) \
$(FILTER_LIBS) \
$(ENCODER_LIBS) \
$(MIXER_LIBS) \
libconf.a \
libbasic.a \
libevent.a \
libthread.a \
libnet.a \
$(FS_LIBS) \
libsystem.a \
$(ICU_LDADD) \
libutil.a \
$(SYSTEMD_DAEMON_LIBS)
src_mpd_CPPFLAGS = $(AM_CPPFLAGS) $(DBUS_CFLAGS)
src_mpd_SOURCES = \
src/Main.cxx src/Main.hxx
libmpd_a_SOURCES = \
$(OUTPUT_API_SRC) \
$(MIXER_API_SRC) \
src/check.h \
src/open.h \
src/protocol/Ack.cxx src/protocol/Ack.hxx \
src/protocol/ArgParser.cxx src/protocol/ArgParser.hxx \
src/protocol/RangeArg.hxx \
src/protocol/Result.cxx src/protocol/Result.hxx \
src/command/Request.hxx \
src/command/CommandResult.hxx \
src/command/CommandError.cxx src/command/CommandError.hxx \
src/command/AllCommands.cxx src/command/AllCommands.hxx \
src/command/QueueCommands.cxx src/command/QueueCommands.hxx \
src/command/TagCommands.cxx src/command/TagCommands.hxx \
src/command/PlayerCommands.cxx src/command/PlayerCommands.hxx \
src/command/PlaylistCommands.cxx src/command/PlaylistCommands.hxx \
src/command/FileCommands.cxx src/command/FileCommands.hxx \
src/command/OutputCommands.cxx src/command/OutputCommands.hxx \
src/command/MessageCommands.cxx src/command/MessageCommands.hxx \
src/command/ClientCommands.cxx src/command/ClientCommands.hxx \
src/command/PartitionCommands.cxx src/command/PartitionCommands.hxx \
src/command/OtherCommands.cxx src/command/OtherCommands.hxx \
src/command/CommandListBuilder.cxx src/command/CommandListBuilder.hxx \
src/Idle.cxx src/Idle.hxx \
src/IdleFlags.cxx src/IdleFlags.hxx \
src/decoder/Domain.cxx src/decoder/Domain.hxx \
src/decoder/Thread.cxx \
src/decoder/Command.hxx \
src/decoder/Control.cxx src/decoder/Control.hxx \
src/decoder/Client.hxx \
src/decoder/DecoderPlugin.hxx \
src/decoder/Bridge.cxx src/decoder/Bridge.hxx \
src/decoder/DecoderPrint.cxx src/decoder/DecoderPrint.hxx \
src/client/Listener.cxx src/client/Listener.hxx \
src/client/Client.cxx src/client/Client.hxx \
src/client/ClientInternal.hxx \
src/client/ClientEvent.cxx \
src/client/ClientExpire.cxx \
src/client/ClientGlobal.cxx \
src/client/ClientIdle.cxx \
src/client/ClientList.cxx src/client/ClientList.hxx \
src/client/ClientNew.cxx \
src/client/ClientProcess.cxx \
src/client/ClientRead.cxx \
src/client/ClientWrite.cxx \
src/client/ClientMessage.cxx src/client/ClientMessage.hxx \
src/client/ClientSubscribe.cxx \
src/client/ClientFile.cxx \
src/client/Response.cxx src/client/Response.hxx \
src/Listen.cxx src/Listen.hxx \
src/LogInit.cxx src/LogInit.hxx \
src/LogBackend.cxx src/LogBackend.hxx \
src/Log.cxx src/Log.hxx src/LogV.hxx \
src/LogLevel.hxx \
src/ls.cxx src/ls.hxx \
src/Instance.cxx src/Instance.hxx \
src/win32/Win32Main.cxx \
src/MixRampInfo.hxx \
src/MusicBuffer.cxx src/MusicBuffer.hxx \
src/MusicPipe.cxx src/MusicPipe.hxx \
src/MusicChunk.cxx src/MusicChunk.hxx \
src/MusicChunkPtr.cxx src/MusicChunkPtr.hxx \
src/Mapper.cxx src/Mapper.hxx \
src/Partition.cxx src/Partition.hxx \
src/Permission.cxx src/Permission.hxx \
src/player/CrossFade.cxx src/player/CrossFade.hxx \
src/player/Thread.cxx \
src/player/Control.cxx src/player/Control.hxx \
src/player/Listener.hxx \
src/player/Outputs.hxx \
src/PlaylistError.cxx src/PlaylistError.hxx \
src/PlaylistPrint.cxx src/PlaylistPrint.hxx \
src/PlaylistSave.cxx src/PlaylistSave.hxx \
src/playlist/PlaylistStream.cxx src/playlist/PlaylistStream.hxx \
src/playlist/PlaylistMapper.cxx src/playlist/PlaylistMapper.hxx \
src/playlist/PlaylistAny.cxx src/playlist/PlaylistAny.hxx \
src/playlist/PlaylistSong.cxx src/playlist/PlaylistSong.hxx \
src/playlist/PlaylistQueue.cxx src/playlist/PlaylistQueue.hxx \
src/playlist/Print.cxx src/playlist/Print.hxx \
src/BulkEdit.hxx \
src/db/PlaylistVector.cxx src/db/PlaylistVector.hxx \
src/db/PlaylistInfo.hxx \
src/queue/IdTable.hxx \
src/queue/Queue.cxx src/queue/Queue.hxx \
src/queue/QueuePrint.cxx src/queue/QueuePrint.hxx \
src/queue/QueueSave.cxx src/queue/QueueSave.hxx \
src/queue/Playlist.cxx src/queue/Playlist.hxx \
src/queue/PlaylistControl.cxx \
src/queue/PlaylistEdit.cxx \
src/queue/PlaylistTag.cxx \
src/queue/PlaylistState.cxx src/queue/PlaylistState.hxx \
src/queue/Listener.hxx \
src/PluginUnavailable.hxx \
src/ReplayGainGlobal.cxx src/ReplayGainGlobal.hxx \
src/LocateUri.cxx src/LocateUri.hxx \
src/SongUpdate.cxx \
src/SongLoader.cxx src/SongLoader.hxx \
src/SongPrint.cxx src/SongPrint.hxx \
src/SongSave.cxx src/SongSave.hxx \
src/StateFile.cxx src/StateFile.hxx \
src/StateFileConfig.cxx src/StateFileConfig.hxx \
src/Stats.cxx src/Stats.hxx \
src/TagPrint.cxx src/TagPrint.hxx \
src/TagSave.cxx src/TagSave.hxx \
src/TagFile.cxx src/TagFile.hxx \
src/TagStream.cxx src/TagStream.hxx \
src/TimePrint.cxx src/TimePrint.hxx \
src/mixer/Volume.cxx src/mixer/Volume.hxx \
src/Chrono.hxx \
src/PlaylistFile.cxx src/PlaylistFile.hxx
if ENABLE_CURL
libmpd_a_SOURCES += \
src/RemoteTagCache.cxx src/RemoteTagCache.hxx \
src/RemoteTagCacheHandler.hxx
endif
if ANDROID
else
libmpd_a_SOURCES += \
src/unix/SignalHandlers.cxx src/unix/SignalHandlers.hxx \
src/CommandLine.cxx src/CommandLine.hxx
if ENABLE_DAEMON
libmpd_a_SOURCES += \
src/unix/Daemon.cxx src/unix/Daemon.hxx \
src/unix/PidFile.hxx
endif
if ENABLE_SYSTEMD_DAEMON
libmpd_a_SOURCES += \
src/lib/systemd/Watchdog.cxx src/lib/systemd/Watchdog.hxx
endif
endif
if ENABLE_DATABASE
libmpd_a_SOURCES += \
src/queue/PlaylistUpdate.cxx \
src/command/StorageCommands.cxx src/command/StorageCommands.hxx \
src/command/DatabaseCommands.cxx src/command/DatabaseCommands.hxx \
src/db/Count.cxx src/db/Count.hxx \
src/db/LightDirectory.hxx \
src/db/update/UpdateDomain.cxx src/db/update/UpdateDomain.hxx \
src/db/update/Config.cxx src/db/update/Config.hxx \
src/db/update/Service.cxx src/db/update/Service.hxx \
src/db/update/Queue.cxx src/db/update/Queue.hxx \
src/db/update/UpdateIO.cxx src/db/update/UpdateIO.hxx \
src/db/update/Editor.cxx src/db/update/Editor.hxx \
src/db/update/Walk.cxx src/db/update/Walk.hxx \
src/db/update/UpdateSong.cxx \
src/db/update/Container.cxx \
src/db/update/Remove.cxx src/db/update/Remove.hxx \
src/db/update/ExcludeList.cxx src/db/update/ExcludeList.hxx \
src/db/Uri.hxx \
src/db/DatabaseGlue.cxx src/db/DatabaseGlue.hxx \
src/db/Configured.cxx src/db/Configured.hxx \
src/db/DatabaseSong.cxx src/db/DatabaseSong.hxx \
src/db/DatabasePrint.cxx src/db/DatabasePrint.hxx \
src/db/DatabaseQueue.cxx src/db/DatabaseQueue.hxx \
src/db/DatabasePlaylist.cxx src/db/DatabasePlaylist.hxx \
src/db/DatabaseError.hxx \
src/db/DatabaseLock.cxx src/db/DatabaseLock.hxx \
src/db/DatabasePlugin.hxx \
src/db/Interface.hxx \
src/db/Stats.hxx \
src/db/DatabaseListener.hxx \
src/db/Visitor.hxx \
src/db/Selection.cxx src/db/Selection.hxx
endif
CURL_SOURCES = \
src/lib/curl/Error.hxx \
src/lib/curl/Delegate.cxx src/lib/curl/Delegate.hxx \
src/lib/curl/Parser.hxx \
src/lib/curl/Version.cxx src/lib/curl/Version.hxx \
src/lib/curl/Init.cxx src/lib/curl/Init.hxx \
src/lib/curl/Global.cxx src/lib/curl/Global.hxx \
src/lib/curl/Request.cxx src/lib/curl/Request.hxx \
src/lib/curl/Form.cxx src/lib/curl/Form.hxx \
src/lib/curl/Handler.hxx \
src/lib/curl/Easy.hxx \
src/lib/curl/Multi.hxx \
src/lib/curl/Slist.hxx
YAJL_SOURCES = \
src/lib/yajl/ResponseParser.cxx src/lib/yajl/ResponseParser.hxx \
src/lib/yajl/ParseInputStream.cxx src/lib/yajl/ParseInputStream.hxx \
src/lib/yajl/Callbacks.hxx \
src/lib/yajl/Handle.hxx
UPNP_SOURCES = \
src/lib/upnp/Compat.hxx \
src/lib/upnp/Init.cxx src/lib/upnp/Init.hxx \
src/lib/upnp/ClientInit.cxx src/lib/upnp/ClientInit.hxx \
src/lib/upnp/Device.cxx src/lib/upnp/Device.hxx \
src/lib/upnp/ContentDirectoryService.cxx src/lib/upnp/ContentDirectoryService.hxx \
src/lib/upnp/Discovery.cxx src/lib/upnp/Discovery.hxx \
src/lib/upnp/ixmlwrap.cxx src/lib/upnp/ixmlwrap.hxx \
src/lib/upnp/Callback.hxx \
src/lib/upnp/Util.cxx src/lib/upnp/Util.hxx \
src/lib/upnp/UniqueIxml.hxx \
src/lib/upnp/Action.hxx
ALSA_SOURCES = \
src/lib/alsa/Version.cxx src/lib/alsa/Version.hxx \
src/lib/alsa/AllowedFormat.cxx src/lib/alsa/AllowedFormat.hxx \
src/lib/alsa/HwSetup.cxx src/lib/alsa/HwSetup.hxx \
src/lib/alsa/Format.hxx \
src/lib/alsa/PeriodBuffer.hxx \
src/lib/alsa/NonBlock.cxx src/lib/alsa/NonBlock.hxx
if ENABLE_DBUS
noinst_LIBRARIES += libodbus.a
libodbus_a_SOURCES = \
src/lib/dbus/Init.hxx \
src/lib/dbus/AppendIter.hxx \
src/lib/dbus/AsyncRequest.hxx \
src/lib/dbus/Connection.cxx src/lib/dbus/Connection.hxx \
src/lib/dbus/Error.cxx src/lib/dbus/Error.hxx \
src/lib/dbus/Iter.hxx \
src/lib/dbus/Message.cxx src/lib/dbus/Message.hxx \
src/lib/dbus/PendingCall.hxx \
src/lib/dbus/ReadIter.hxx \
src/lib/dbus/ObjectManager.hxx \
src/lib/dbus/UDisks2.cxx src/lib/dbus/UDisks2.hxx \
src/lib/dbus/ScopeMatch.cxx src/lib/dbus/ScopeMatch.hxx \
src/lib/dbus/Types.hxx \
src/lib/dbus/Values.hxx \
src/lib/dbus/Glue.cxx src/lib/dbus/Glue.hxx \
src/lib/dbus/Watch.cxx src/lib/dbus/Watch.hxx
libodbus_a_CPPFLAGS = $(AM_CPPFLAGS) $(DBUS_CFLAGS)
endif
#
# Android native library
#
if ANDROID
noinst_LIBRARIES += libjava.a
libjava_a_SOURCES = \
src/java/Class.hxx \
src/java/Exception.hxx \
src/java/Global.cxx src/java/Global.hxx \
src/java/Object.hxx \
src/java/Ref.hxx \
src/java/File.cxx src/java/File.hxx \
src/java/String.cxx src/java/String.hxx
noinst_LIBRARIES += libandroid.a
libandroid_a_SOURCES = \
src/android/Context.cxx src/android/Context.hxx \
src/android/Environment.cxx src/android/Environment.hxx \
src/android/LogListener.cxx src/android/LogListener.hxx
libandroid_a_CPPFLAGS = $(AM_CPPFLAGS) -Iandroid/build/include
noinst_LIBRARIES += libmain.a
libmain_a_SOURCES = \
src/Main.cxx src/Main.hxx
libmain_a_CPPFLAGS = $(AM_CPPFLAGS) -Iandroid/build/include
src_mpd_LDADD += libandroid.a libjava.a
all-local: android/build/$(APK_NAME)-debug.apk
clean-local:
rm -rf android/build
libmpd.so: $(filter %.a,$(src_mpd_LDADD)) libmain.a
$(AM_V_GEN)
$(AM_V_CXXLD)$(CXXLD) -shared -Wl,--no-undefined,-shared,-Bsymbolic -llog -lz -o $@ $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) src/libmain_a-Main.o $(src_mpd_LDADD) $(LIBS)
ANDROID_SDK_BUILD_TOOLS_VERSION = 27.0.0
ANDROID_SDK_PLATFORM = android-21
ANDROID_BUILD_TOOLS_DIR = $(ANDROID_SDK)/build-tools/$(ANDROID_SDK_BUILD_TOOLS_VERSION)
ANDROID_SDK_PLATFORM_DIR = $(ANDROID_SDK)/platforms/$(ANDROID_SDK_PLATFORM)
JAVAC = javac
AIDL = $(ANDROID_BUILD_TOOLS_DIR)/aidl
AAPT = $(ANDROID_BUILD_TOOLS_DIR)/aapt
DX = $(ANDROID_BUILD_TOOLS_DIR)/dx
ZIPALIGN = $(ANDROID_BUILD_TOOLS_DIR)/zipalign
ANDROID_XML_RES := $(wildcard $(srcdir)/android/res/*/*.xml)
ANDROID_XML_RES_COPIES := $(patsubst $(srcdir)/android/%,android/build/%,$(ANDROID_XML_RES))
JAVA_SOURCE_NAMES = Bridge.java Loader.java Main.java Settings.java
JAVA_SOURCE_PATHS = $(addprefix $(srcdir)/android/src/,$(JAVA_SOURCE_NAMES))
JAVA_CLASSFILES_DIR = android/build/classes
AIDL_FILES = $(wildcard $(srcdir)/android/src/*.aidl)
AIDL_JAVA_FILES = $(patsubst $(srcdir)/android/src/%.aidl,android/build/src/org/musicpd/%.java,$(AIDL_FILES))
android/build/src/org/musicpd/IMain.java: android/build/src/org/musicpd/IMainCallback.java
$(AIDL_JAVA_FILES): android/build/src/org/musicpd/%.java: $(srcdir)/android/src/%.aidl
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_at)cp $< $(@D)/
$(AM_V_at)$(AIDL) -Iandroid/build/src -oandroid/build/src $(patsubst %.java,%.aidl,$@)
$(ANDROID_XML_RES_COPIES): $(ANDROID_XML_RES)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_at)cp $(patsubst android/build/%,$(srcdir)/android/%,$@) $@
android/build/resources.apk: $(ANDROID_XML_RES_COPIES) android/build/res/drawable/icon.png android/build/res/drawable/notification_icon.png
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) android/build/gen
$(AM_V_at)$(AAPT) package -f -m --auto-add-overlay \
--custom-package org.musicpd \
-M $(srcdir)/android/AndroidManifest.xml \
-S android/build/res \
-J android/build/gen \
-I $(ANDROID_SDK_PLATFORM_DIR)/android.jar \
-F android/build/resources.apk
# R.java is generated by aapt, when resources.apk is generated
android/build/gen/org/musicpd/R.java: android/build/resources.apk
android/build/classes.dex: $(JAVA_SOURCE_PATHS) $(AIDL_JAVA_FILES) android/build/gen/org/musicpd/R.java
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) $(JAVA_CLASSFILES_DIR)
$(AM_V_at)$(JAVAC) -source 1.6 -target 1.6 -Xlint:-options \
-cp $(ANDROID_SDK_PLATFORM_DIR)/android.jar:$(JAVA_CLASSFILES_DIR) \
-h android/build/include \
-d $(JAVA_CLASSFILES_DIR) $^
$(AM_V_at)$(DX) --dex --output $@ $(JAVA_CLASSFILES_DIR)
android/build/include/org_musicpd_Bridge.h: android/build/classes.dex
BUILT_SOURCES = android/build/include/org_musicpd_Bridge.h
android/build/lib/$(ANDROID_ABI)/libmpd.so: libmpd.so
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_at)rm -f $@
$(AM_V_at)$(STRIP) -o $@ $<
android/build/res/drawable/icon.png: mpd.svg
$(AM_V_GEN)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_at)rsvg-convert --width=48 --height=48 $< -o $@
android/build/res/drawable/notification_icon.png: android/build/res/drawable/icon.png
$(AM_V_GEN)
$(AM_V_at)convert $< -colorspace Gray -gamma 2.2 $@
.DELETE_ON_ERROR: android/build/unsigned.apk
android/build/unsigned.apk: android/build/classes.dex android/build/resources.apk android/build/lib/$(ANDROID_ABI)/libmpd.so
$(AM_V_GEN)
$(AM_V_at)cp android/build/resources.apk $@
$(AM_V_at)cd $(@D) && zip -q -r $(@F) classes.dex lib
android/build/$(APK_NAME)-debug.apk: android/build/unsigned.apk
$(AM_V_GEN)
$(AM_V_at)jarsigner -keystore $(HOME)/.android/debug.keystore -storepass android -signedjar $@ $< androiddebugkey
android/build/$(APK_NAME)-release-unaligned.apk: android/build/unsigned.apk
$(AM_V_GEN)
$(AM_V_at)jarsigner -digestalg SHA1 -sigalg MD5withRSA -storepass:env ANDROID_KEYSTORE_PASS -keystore $(ANDROID_KEYSTORE) -signedjar $@ $< $(ANDROID_KEY_ALIAS)
android/build/$(APK_NAME).apk: android/build/$(APK_NAME)-release-unaligned.apk
$(AM_V_GEN)
$(AM_V_at)$(ZIPALIGN) -f 4 $< $@
endif
#
# Windows resource file
#
win32/res/mpd.$(OBJEXT): %.$(OBJEXT): %.rc
$(WINDRES) -i $< -o $@
if HAVE_WINDOWS
noinst_DATA = win32/res/mpd.rc
EXTRA_src_mpd_DEPENDENCIES = win32/res/mpd.$(OBJEXT)
src_mpd_LDFLAGS = -Wl,win32/res/mpd.$(OBJEXT)
endif
#
# Haiku resource file
#
src/haiku/mpd.rsrc: src/haiku/mpd.rdef
$(RC) -o $@ $<
if ENABLE_HAIKU
noinst_DATA = src/haiku/mpd.rdef
EXTRA_src_mpd_DEPENDENCIES = src/haiku/mpd.rsrc
src/mpd.haiku-rsrc-done: src/mpd src/haiku/mpd.rsrc
$(XRES) -o src/mpd src/haiku/mpd.rsrc
@touch src/mpd.haiku-rsrc-done
all-local: src/mpd.haiku-rsrc-done
clean-local:
rm -rf src/haiku/mpd.rsrc src/mpd.haiku-rsrc-done
endif
if ENABLE_DATABASE
if ENABLE_INOTIFY
libmpd_a_SOURCES += \
src/db/update/InotifyDomain.cxx src/db/update/InotifyDomain.hxx \
src/db/update/InotifySource.cxx src/db/update/InotifySource.hxx \
src/db/update/InotifyQueue.cxx src/db/update/InotifyQueue.hxx \
src/db/update/InotifyUpdate.cxx src/db/update/InotifyUpdate.hxx
endif
endif
if ENABLE_SQLITE
libmpd_a_SOURCES += \
src/command/StickerCommands.cxx src/command/StickerCommands.hxx \
src/lib/sqlite/Error.cxx src/lib/sqlite/Error.hxx \
src/lib/sqlite/Util.hxx \
src/sticker/Match.hxx \
src/sticker/StickerDatabase.cxx src/sticker/StickerDatabase.hxx \
src/sticker/StickerPrint.cxx src/sticker/StickerPrint.hxx \
src/sticker/SongSticker.cxx src/sticker/SongSticker.hxx
endif
# Generic utility library
libutil_a_SOURCES = \
src/Compiler.h \
src/util/Exception.cxx src/util/Exception.hxx \
src/util/RuntimeError.hxx \
src/util/Macros.hxx \
src/util/BindMethod.hxx \
src/util/Cast.hxx \
src/util/Chrono.hxx \
src/util/Clamp.hxx \
src/util/DeleteDisposer.hxx \
src/util/OffsetPointer.hxx \
src/util/Alloc.cxx src/util/Alloc.hxx \
src/util/AllocatedArray.hxx \
src/util/VarSize.hxx \
src/util/ScopeExit.hxx \
src/util/Domain.hxx \
src/util/ReusableArray.hxx \
src/util/ASCII.hxx \
src/util/UTF8.cxx src/util/UTF8.hxx \
src/util/CharUtil.hxx \
src/util/WCharUtil.hxx \
src/util/NumberParser.hxx \
src/util/HexFormat.cxx src/util/HexFormat.hxx \
src/util/MimeType.cxx src/util/MimeType.hxx \
src/util/StringBuffer.hxx \
src/util/StringFormat.hxx \
src/util/StringPointer.hxx \
src/util/StringView.cxx src/util/StringView.hxx \
src/util/WStringView.hxx \
src/util/TStringView.hxx \
src/util/ConcatString.hxx \
src/util/AllocatedString.cxx src/util/AllocatedString.hxx \
src/util/TruncateString.cxx src/util/TruncateString.hxx \
src/util/StringStrip.cxx src/util/StringStrip.hxx \
src/util/StringUtil.cxx src/util/StringUtil.hxx \
src/util/StringCompare.cxx src/util/StringCompare.hxx \
src/util/WStringCompare.cxx src/util/WStringCompare.hxx \
src/util/StringAPI.hxx \
src/util/WStringAPI.hxx \
src/util/DivideString.cxx src/util/DivideString.hxx \
src/util/SplitString.cxx src/util/SplitString.hxx \
src/util/IterableSplitString.hxx \
src/util/FormatString.cxx src/util/FormatString.hxx \
src/util/Tokenizer.cxx src/util/Tokenizer.hxx \
src/util/TextFile.hxx \
src/util/TemplateString.hxx \
src/util/TimeParser.cxx src/util/TimeParser.hxx \
src/util/TimeConvert.cxx src/util/TimeConvert.hxx \
src/util/TimeISO8601.cxx src/util/TimeISO8601.hxx \
src/util/UriUtil.cxx src/util/UriUtil.hxx \
src/util/Manual.hxx \
src/util/StaticFifoBuffer.hxx \
src/util/ForeignFifoBuffer.hxx \
src/util/DynamicFifoBuffer.hxx \
src/util/ConstBuffer.hxx \
src/util/WritableBuffer.hxx \
src/util/CircularBuffer.hxx \
src/util/LazyRandomEngine.cxx src/util/LazyRandomEngine.hxx \
src/util/SliceBuffer.hxx \
src/util/HugeAllocator.cxx src/util/HugeAllocator.hxx \
src/util/PeakBuffer.cxx src/util/PeakBuffer.hxx \
src/util/PrintException.cxx src/util/PrintException.hxx \
src/util/SparseBuffer.cxx src/util/SparseBuffer.hxx \
src/util/OptionParser.cxx src/util/OptionParser.hxx \
src/util/OptionDef.hxx \
src/util/ByteReverse.cxx src/util/ByteReverse.hxx \
src/util/format.c src/util/format.h \
src/util/bit_reverse.c src/util/bit_reverse.h
# Multi-threading library
libthread_a_SOURCES = \
src/thread/SafeSingleton.hxx \
src/thread/Util.cxx src/thread/Util.hxx \
src/thread/Name.hxx \
src/thread/Slack.hxx \
src/thread/Mutex.hxx \
src/thread/PosixMutex.hxx \
src/thread/CriticalSection.hxx \
src/thread/Cond.hxx \
src/thread/PosixCond.hxx \
src/thread/WindowsCond.hxx \
src/thread/Thread.cxx src/thread/Thread.hxx \
src/thread/Id.hxx
# Networking library
libnet_a_SOURCES = \
src/net/Features.hxx \
src/net/Init.hxx \
src/net/ToString.cxx src/net/ToString.hxx \
src/net/HostParser.cxx src/net/HostParser.hxx \
src/net/Resolver.cxx src/net/Resolver.hxx \
src/net/AddressInfo.cxx src/net/AddressInfo.hxx \
src/net/StaticSocketAddress.cxx src/net/StaticSocketAddress.hxx \
src/net/AllocatedSocketAddress.cxx src/net/AllocatedSocketAddress.hxx \
src/net/IPv4Address.cxx src/net/IPv4Address.hxx \
src/net/IPv6Address.cxx src/net/IPv6Address.hxx \
src/net/SocketAddress.cxx src/net/SocketAddress.hxx \
src/net/SocketUtil.cxx src/net/SocketUtil.hxx \
src/net/SocketDescriptor.cxx src/net/SocketDescriptor.hxx \
src/net/UniqueSocketDescriptor.hxx \
src/net/SocketError.cxx src/net/SocketError.hxx
# System library
libsystem_a_SOURCES = \
src/system/ByteOrder.hxx \
src/system/Error.hxx \
src/system/FatalError.cxx src/system/FatalError.hxx \
src/system/FileDescriptor.cxx src/system/FileDescriptor.hxx \
src/system/UniqueFileDescriptor.hxx \
src/system/Open.cxx src/system/Open.hxx \
src/system/EventPipe.cxx src/system/EventPipe.hxx \
src/system/PeriodClock.hxx \
src/system/Clock.cxx src/system/Clock.hxx
if LINUX
libsystem_a_SOURCES += \
src/system/EventFD.cxx src/system/EventFD.hxx \
src/system/SignalFD.cxx src/system/SignalFD.hxx \
src/system/EpollFD.cxx src/system/EpollFD.hxx
endif
# Event loop library
libevent_a_SOURCES = \
src/event/WakeFD.hxx \
src/event/PollGroup.hxx \
src/event/PollGroupEpoll.hxx \
src/event/PollGroupPoll.hxx src/event/PollGroupPoll.cxx \
src/event/PollGroupWinSelect.hxx src/event/PollGroupWinSelect.cxx \
src/event/PollResultGeneric.hxx \
src/event/SignalMonitor.hxx src/event/SignalMonitor.cxx \
src/event/TimerEvent.hxx src/event/TimerEvent.cxx \
src/event/IdleMonitor.hxx src/event/IdleMonitor.cxx \
src/event/DeferEvent.cxx src/event/DeferEvent.hxx \
src/event/MaskMonitor.hxx src/event/MaskMonitor.cxx \
src/event/SocketMonitor.cxx src/event/SocketMonitor.hxx \
src/event/BufferedSocket.cxx src/event/BufferedSocket.hxx \
src/event/FullyBufferedSocket.cxx src/event/FullyBufferedSocket.hxx \
src/event/MultiSocketMonitor.cxx src/event/MultiSocketMonitor.hxx \
src/event/ServerSocket.cxx src/event/ServerSocket.hxx \
src/event/Call.hxx src/event/Call.cxx \
src/event/Thread.cxx src/event/Thread.hxx \
src/event/Loop.cxx src/event/Loop.hxx
# UTF-8 library
libicu_a_SOURCES = \
src/lib/icu/CaseFold.cxx src/lib/icu/CaseFold.hxx \
src/lib/icu/Compare.cxx src/lib/icu/Compare.hxx \
src/lib/icu/Collate.cxx src/lib/icu/Collate.hxx \
src/lib/icu/Converter.cxx src/lib/icu/Converter.hxx
if HAVE_ICU
libicu_a_SOURCES += \
src/lib/icu/Util.cxx src/lib/icu/Util.hxx \
src/lib/icu/Init.cxx src/lib/icu/Init.hxx
endif
if HAVE_WINDOWS
libicu_a_SOURCES += \
src/lib/icu/Win32.cxx src/lib/icu/Win32.hxx
endif
libicu_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(ICU_CFLAGS)
ICU_LDADD = libicu.a $(ICU_LIBS)
# PCM library
libpcm_a_SOURCES = \
src/CheckAudioFormat.cxx src/CheckAudioFormat.hxx \
src/AudioFormat.cxx src/AudioFormat.hxx \
src/AudioParser.cxx src/AudioParser.hxx \
src/pcm/SampleFormat.cxx src/pcm/SampleFormat.hxx \
src/pcm/Traits.hxx \
src/pcm/Interleave.cxx src/pcm/Interleave.hxx \
src/pcm/PcmBuffer.cxx src/pcm/PcmBuffer.hxx \
src/pcm/PcmExport.cxx src/pcm/PcmExport.hxx \
src/pcm/PcmConvert.cxx src/pcm/PcmConvert.hxx \
src/pcm/PcmDop.cxx src/pcm/PcmDop.hxx \
src/pcm/Volume.cxx src/pcm/Volume.hxx \
src/pcm/Silence.cxx src/pcm/Silence.hxx \
src/pcm/PcmMix.cxx src/pcm/PcmMix.hxx \
src/pcm/PcmChannels.cxx src/pcm/PcmChannels.hxx \
src/pcm/PcmPack.cxx src/pcm/PcmPack.hxx \
src/pcm/PcmFormat.cxx src/pcm/PcmFormat.hxx \
src/pcm/FloatConvert.hxx \
src/pcm/ShiftConvert.hxx \
src/pcm/Neon.hxx \
src/pcm/FormatConverter.cxx src/pcm/FormatConverter.hxx \
src/pcm/ChannelsConverter.cxx src/pcm/ChannelsConverter.hxx \
src/pcm/Order.cxx src/pcm/Order.hxx \
src/pcm/Resampler.hxx \
src/pcm/GlueResampler.cxx src/pcm/GlueResampler.hxx \
src/pcm/FallbackResampler.cxx src/pcm/FallbackResampler.hxx \
src/pcm/ConfiguredResampler.cxx src/pcm/ConfiguredResampler.hxx \
src/pcm/PcmDither.cxx src/pcm/PcmDither.hxx \
src/pcm/PcmPrng.hxx \
src/pcm/PcmUtils.hxx
libpcm_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(SOXR_CFLAGS) \
$(LIBSAMPLERATE_CFLAGS)
PCM_LIBS = \
libpcm.a \
$(SOXR_LIBS) \
$(LIBSAMPLERATE_LIBS)
if ENABLE_DSD
libpcm_a_SOURCES += \
src/pcm/Dsd16.cxx src/pcm/Dsd16.hxx \
src/pcm/Dsd32.cxx src/pcm/Dsd32.hxx \
src/pcm/PcmDsd.cxx src/pcm/PcmDsd.hxx \
src/pcm/dsd2pcm/dsd2pcm.c src/pcm/dsd2pcm/dsd2pcm.h
endif
if ENABLE_LIBSAMPLERATE
libpcm_a_SOURCES += \
src/pcm/LibsamplerateResampler.cxx src/pcm/LibsamplerateResampler.hxx
endif
if ENABLE_SOXR
libpcm_a_SOURCES += \
src/pcm/SoxrResampler.cxx src/pcm/SoxrResampler.hxx
endif
# Xiph codec support library
if HAVE_XIPH
noinst_LIBRARIES += libxiph.a
libxiph_a_SOURCES = \
src/lib/xiph/VorbisComment.hxx \
src/lib/xiph/VorbisComments.cxx src/lib/xiph/VorbisComments.hxx \
src/lib/xiph/XiphTags.cxx src/lib/xiph/XiphTags.hxx
libxiph_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(OGG_CFLAGS)
if HAVE_OGG
libxiph_a_SOURCES += \
src/lib/xiph/OggVisitor.cxx src/lib/xiph/OggVisitor.hxx \
src/lib/xiph/OggSerial.cxx src/lib/xiph/OggSerial.hxx \
src/lib/xiph/OggSyncState.cxx src/lib/xiph/OggSyncState.hxx \
src/lib/xiph/OggFind.cxx src/lib/xiph/OggFind.hxx \
src/lib/xiph/OggPage.hxx \
src/lib/xiph/OggPacket.cxx src/lib/xiph/OggPacket.hxx \
src/lib/xiph/OggStreamState.hxx
endif
XIPH_LIBS = libxiph.a \
$(OGG_LIBS)
endif
# File system library
FS_LIBS = libfs.a
libfs_a_SOURCES = \
src/fs/io/Reader.hxx \
src/fs/io/PeekReader.cxx src/fs/io/PeekReader.hxx \
src/fs/io/FileReader.cxx src/fs/io/FileReader.hxx \
src/fs/io/BufferedReader.cxx src/fs/io/BufferedReader.hxx \
src/fs/io/TextFile.cxx src/fs/io/TextFile.hxx \
src/fs/io/OutputStream.hxx \
src/fs/io/StdioOutputStream.hxx \
src/fs/io/FileOutputStream.cxx src/fs/io/FileOutputStream.hxx \
src/fs/io/BufferedOutputStream.cxx src/fs/io/BufferedOutputStream.hxx \
src/fs/Domain.cxx src/fs/Domain.hxx \
src/fs/Limits.hxx \
src/fs/Traits.cxx src/fs/Traits.hxx \
src/fs/Config.cxx src/fs/Config.hxx \
src/fs/Charset.cxx src/fs/Charset.hxx \
src/fs/Path.cxx src/fs/Path2.cxx src/fs/Path.hxx \
src/fs/AllocatedPath.cxx src/fs/AllocatedPath.hxx \
src/fs/NarrowPath.hxx \
src/fs/FileSystem.cxx src/fs/FileSystem.hxx \
src/fs/FileInfo.hxx \
src/fs/Glob.hxx \
src/fs/List.cxx src/fs/List.hxx \
src/fs/StandardDirectory.cxx src/fs/StandardDirectory.hxx \
src/fs/CheckFile.cxx src/fs/CheckFile.hxx \
src/fs/DirectoryReader.cxx src/fs/DirectoryReader.hxx
libfs_a_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS)
if ENABLE_ZLIB
libfs_a_SOURCES += \
src/lib/zlib/Error.cxx src/lib/zlib/Error.hxx \
src/fs/io/GunzipReader.cxx src/fs/io/GunzipReader.hxx \
src/fs/io/AutoGunzipReader.cxx src/fs/io/AutoGunzipReader.hxx \
src/fs/io/GzipOutputStream.cxx src/fs/io/GzipOutputStream.hxx
FS_LIBS += $(ZLIB_LIBS)
endif
if HAVE_WINDOWS
# for PathMatchSpec()
FS_LIBS += -lshlwapi
endif
# Storage library
SMBCLIENT_SOURCES = \
src/lib/smbclient/Domain.cxx src/lib/smbclient/Domain.hxx \
src/lib/smbclient/Mutex.cxx src/lib/smbclient/Mutex.hxx \
src/lib/smbclient/Init.cxx src/lib/smbclient/Init.hxx
NFS_SOURCES = \
src/lib/nfs/Callback.hxx \
src/lib/nfs/Cancellable.hxx \
src/lib/nfs/Lease.hxx \
src/lib/nfs/Connection.cxx src/lib/nfs/Connection.hxx \
src/lib/nfs/Error.cxx src/lib/nfs/Error.hxx \
src/lib/nfs/Manager.cxx src/lib/nfs/Manager.hxx \
src/lib/nfs/Glue.cxx src/lib/nfs/Glue.hxx \
src/lib/nfs/Base.cxx src/lib/nfs/Base.hxx \
src/lib/nfs/FileReader.cxx src/lib/nfs/FileReader.hxx \
src/lib/nfs/Blocking.cxx src/lib/nfs/Blocking.hxx
if ENABLE_DATABASE
noinst_LIBRARIES += libstorage.a
libstorage_a_SOURCES = \
src/storage/StoragePlugin.hxx \
src/storage/Registry.cxx src/storage/Registry.hxx \
src/storage/StorageInterface.cxx src/storage/StorageInterface.hxx \
src/storage/CompositeStorage.cxx src/storage/CompositeStorage.hxx \
src/storage/MemoryDirectoryReader.cxx src/storage/MemoryDirectoryReader.hxx \
src/storage/Configured.cxx src/storage/Configured.hxx \
src/storage/plugins/LocalStorage.cxx src/storage/plugins/LocalStorage.hxx \
src/storage/StorageState.cxx src/storage/StorageState.hxx \
src/storage/FileInfo.hxx
libstorage_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(DBUS_CFLAGS) \
$(CURL_CFLAGS) \
$(EXPAT_CFLAGS) \
$(NFS_CFLAGS) \
$(SMBCLIENT_CFLAGS)
STORAGE_LIBS = \
libstorage.a \
$(CURL_LIBS) \
$(EXPAT_LIBS) \
$(NFS_LIBS) \
$(SMBCLIENT_LIBS)
if ENABLE_UDISKS
libstorage_a_SOURCES += \
src/storage/plugins/UdisksStorage.cxx src/storage/plugins/UdisksStorage.hxx
STORAGE_LIBS += \
$(DBUS_LIBS) \
libodbus.a
endif
if ENABLE_SMBCLIENT
libstorage_a_SOURCES += \
$(SMBCLIENT_SOURCES) \
src/storage/plugins/SmbclientStorage.cxx src/storage/plugins/SmbclientStorage.hxx
endif
if ENABLE_NFS
libstorage_a_SOURCES += \
$(NFS_SOURCES) \
src/storage/plugins/NfsStorage.cxx src/storage/plugins/NfsStorage.hxx
endif
if ENABLE_WEBDAV
libstorage_a_SOURCES += \
src/lib/expat/ExpatParser.cxx \
src/storage/plugins/CurlStorage.cxx src/storage/plugins/CurlStorage.hxx
endif
endif
# neighbor plugins
if ENABLE_NEIGHBOR_PLUGINS
libmpd_a_SOURCES += \
src/command/NeighborCommands.cxx \
src/command/NeighborCommands.hxx
noinst_LIBRARIES += libneighbor.a
libneighbor_a_SOURCES = \
src/neighbor/Registry.cxx src/neighbor/Registry.hxx \
src/neighbor/Glue.cxx src/neighbor/Glue.hxx \
src/neighbor/Info.hxx \
src/neighbor/Listener.hxx \
src/neighbor/Explorer.hxx \
src/neighbor/NeighborPlugin.hxx
libneighbor_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(DBUS_CFLAGS) \
$(UPNP_CFLAGS) \
$(SMBCLIENT_CFLAGS)
if ENABLE_SMBCLIENT
libneighbor_a_SOURCES += \
$(SMBCLIENT_SOURCES) \
src/neighbor/plugins/SmbclientNeighborPlugin.cxx src/neighbor/plugins/SmbclientNeighborPlugin.hxx
endif
NEIGHBOR_LIBS = \
$(SMBCLIENT_LIBS) \
libneighbor.a
if ENABLE_UPNP
libneighbor_a_SOURCES += \
$(UPNP_SOURCES) \
src/neighbor/plugins/UpnpNeighborPlugin.cxx src/neighbor/plugins/UpnpNeighborPlugin.hxx
NEIGHBOR_LIBS += \
$(EXPAT_LIBS) \
$(UPNP_LIBS)
endif
if ENABLE_UDISKS
libneighbor_a_SOURCES += \
$(UDISKS_SOURCES) \
src/neighbor/plugins/UdisksNeighborPlugin.cxx src/neighbor/plugins/UdisksNeighborPlugin.hxx
NEIGHBOR_LIBS += \
$(DBUS_LIBS) \
libodbus.a
endif
endif
# database plugins
if ENABLE_DATABASE
noinst_LIBRARIES += libdb_plugins.a
libdb_plugins_a_SOURCES = \
src/PlaylistDatabase.cxx src/PlaylistDatabase.hxx \
src/db/Registry.cxx src/db/Registry.hxx \
src/db/Helpers.cxx src/db/Helpers.hxx \
src/db/VHelper.cxx src/db/VHelper.hxx \
src/db/UniqueTags.cxx src/db/UniqueTags.hxx \
src/db/plugins/simple/DatabaseSave.cxx \
src/db/plugins/simple/DatabaseSave.hxx \
src/db/plugins/simple/DirectorySave.cxx \
src/db/plugins/simple/DirectorySave.hxx \
src/db/plugins/simple/Directory.cxx \
src/db/plugins/simple/Directory.hxx \
src/db/plugins/simple/Song.cxx \
src/db/plugins/simple/Song.hxx \
src/db/plugins/simple/SongSort.cxx \
src/db/plugins/simple/SongSort.hxx \
src/db/plugins/simple/Mount.cxx \
src/db/plugins/simple/Mount.hxx \
src/db/plugins/simple/PrefixedLightSong.hxx \
src/db/plugins/simple/SimpleDatabasePlugin.cxx \
src/db/plugins/simple/SimpleDatabasePlugin.hxx
libdb_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(UPNP_CFLAGS)
if ENABLE_LIBMPDCLIENT
libdb_plugins_a_SOURCES += \
src/db/plugins/ProxyDatabasePlugin.cxx src/db/plugins/ProxyDatabasePlugin.hxx
endif
DB_LIBS = \
libdb_plugins.a \
$(LIBMPDCLIENT_LIBS)
if ENABLE_UPNP
libdb_plugins_a_SOURCES += \
$(UPNP_SOURCES) \
src/db/plugins/upnp/UpnpDatabasePlugin.cxx src/db/plugins/upnp/UpnpDatabasePlugin.hxx \
src/db/plugins/upnp/Tags.cxx src/db/plugins/upnp/Tags.hxx \
src/db/plugins/upnp/ContentDirectoryService.cxx \
src/db/plugins/upnp/Directory.cxx src/db/plugins/upnp/Directory.hxx \
src/db/plugins/upnp/Object.cxx src/db/plugins/upnp/Object.hxx
DB_LIBS += \
$(EXPAT_LIBS) \
$(UPNP_LIBS)
endif
endif
# archive plugins
if ENABLE_ARCHIVE
noinst_LIBRARIES += libarchive.a
libmpd_a_SOURCES += \
src/TagArchive.cxx src/TagArchive.hxx \
src/db/update/Archive.cxx
libarchive_a_SOURCES = \
src/archive/ArchiveDomain.cxx src/archive/ArchiveDomain.hxx \
src/archive/ArchiveLookup.cxx src/archive/ArchiveLookup.hxx \
src/archive/ArchiveList.cxx src/archive/ArchiveList.hxx \
src/archive/ArchivePlugin.cxx src/archive/ArchivePlugin.hxx \
src/archive/ArchiveVisitor.hxx \
src/archive/ArchiveFile.hxx \
src/input/plugins/ArchiveInputPlugin.cxx src/input/plugins/ArchiveInputPlugin.hxx
libarchive_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(BZ2_CFLAGS) \
$(ISO9660_CFLAGS) \
$(ZZIP_CFLAGS)
ARCHIVE_LIBS = \
libarchive.a \
$(BZ2_LIBS) \
$(ISO9660_LIBS) \
$(ZZIP_LIBS)
if ENABLE_BZ2
libarchive_a_SOURCES += \
src/archive/plugins/Bzip2ArchivePlugin.cxx \
src/archive/plugins/Bzip2ArchivePlugin.hxx
endif
if ENABLE_ZZIP
libarchive_a_SOURCES += \
src/archive/plugins/ZzipArchivePlugin.cxx \
src/archive/plugins/ZzipArchivePlugin.hxx
endif
if ENABLE_ISO9660
libarchive_a_SOURCES += \
src/archive/plugins/Iso9660ArchivePlugin.cxx \
src/archive/plugins/Iso9660ArchivePlugin.hxx
endif
else
ARCHIVE_LIBS =
endif
libbasic_a_SOURCES = \
src/ReplayGainConfig.hxx \
src/ReplayGainMode.cxx src/ReplayGainMode.hxx \
src/SingleMode.cxx src/SingleMode.hxx \
src/ReplayGainInfo.cxx src/ReplayGainInfo.hxx
# configuration library
libconf_a_SOURCES = \
src/config/Defaults.hxx \
src/config/Path.cxx src/config/Path.hxx \
src/config/Check.cxx src/config/Check.hxx \
src/config/Data.cxx src/config/Data.hxx \
src/config/Block.cxx src/config/Block.hxx \
src/config/Param.cxx src/config/Param.hxx \
src/config/Parser.cxx src/config/Parser.hxx \
src/config/File.cxx src/config/File.hxx \
src/config/Migrate.cxx src/config/Migrate.hxx \
src/config/Templates.cxx src/config/Templates.hxx \
src/config/Domain.cxx src/config/Domain.hxx \
src/config/Net.cxx src/config/Net.hxx \
src/config/Option.hxx
# the Song library
libsong_a_SOURCES = \
src/song/DetachedSong.cxx src/song/DetachedSong.hxx \
src/song/ISongFilter.hxx \
src/song/UriSongFilter.hxx \
src/song/StringFilter.cxx src/song/StringFilter.hxx \
src/song/UriSongFilter.cxx src/song/UriSongFilter.hxx \
src/song/BaseSongFilter.cxx src/song/BaseSongFilter.hxx \
src/song/TagSongFilter.cxx src/song/TagSongFilter.hxx \
src/song/ModifiedSinceSongFilter.cxx src/song/ModifiedSinceSongFilter.hxx \
src/song/AudioFormatSongFilter.cxx src/song/AudioFormatSongFilter.hxx \
src/song/AndSongFilter.cxx src/song/AndSongFilter.hxx \
src/song/NotSongFilter.hxx \
src/song/OptimizeFilter.cxx src/song/OptimizeFilter.hxx \
src/song/Filter.cxx src/song/Filter.hxx \
src/song/LightSong.cxx src/song/LightSong.hxx
# tag plugins
libtag_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(ID3TAG_CFLAGS)
TAG_LIBS = \
libtag.a \
$(ID3TAG_LIBS)
libtag_a_SOURCES =\
src/tag/Type.h \
src/tag/Tag.cxx src/tag/Tag.hxx \
src/tag/Builder.cxx src/tag/Builder.hxx \
src/tag/Item.hxx \
src/tag/Handler.cxx src/tag/Handler.hxx \
src/tag/Mask.hxx \
src/tag/Settings.cxx src/tag/Settings.hxx \
src/tag/Config.cxx src/tag/Config.hxx \
src/tag/ParseName.cxx src/tag/ParseName.hxx \
src/tag/Names.c \
src/tag/FixString.cxx src/tag/FixString.hxx \
src/tag/Pool.cxx src/tag/Pool.hxx \
src/tag/Table.cxx src/tag/Table.hxx \
src/tag/Set.cxx src/tag/Set.hxx \
src/tag/Format.cxx src/tag/Format.hxx \
src/tag/VorbisComment.cxx src/tag/VorbisComment.hxx \
src/tag/ReplayGain.cxx src/tag/ReplayGain.hxx \
src/tag/MixRamp.cxx src/tag/MixRamp.hxx \
src/tag/Generic.cxx src/tag/Generic.hxx \
src/tag/Id3MusicBrainz.cxx src/tag/Id3MusicBrainz.hxx \
src/tag/ApeLoader.cxx src/tag/ApeLoader.hxx \
src/tag/ApeReplayGain.cxx src/tag/ApeReplayGain.hxx \
src/tag/ApeTag.cxx src/tag/ApeTag.hxx
if ENABLE_ID3TAG
libtag_a_SOURCES += \
src/tag/Id3Load.cxx src/tag/Id3Load.hxx \
src/tag/Id3Unique.hxx \
src/tag/Id3Scan.cxx src/tag/Id3Scan.hxx \
src/tag/Rva2.cxx src/tag/Rva2.hxx \
src/tag/Riff.cxx src/tag/Riff.hxx \
src/tag/Aiff.cxx src/tag/Aiff.hxx
endif
# ffmpeg
if ENABLE_FFMPEG
noinst_LIBRARIES += libffmpeg.a
libffmpeg_a_SOURCES = \
src/lib/ffmpeg/Init.cxx src/lib/ffmpeg/Init.hxx \
src/lib/ffmpeg/Time.hxx \
src/lib/ffmpeg/Buffer.hxx \
src/lib/ffmpeg/LogError.cxx src/lib/ffmpeg/LogError.hxx \
src/lib/ffmpeg/LogCallback.cxx src/lib/ffmpeg/LogCallback.hxx \
src/lib/ffmpeg/Error.cxx src/lib/ffmpeg/Error.hxx \
src/lib/ffmpeg/Domain.cxx src/lib/ffmpeg/Domain.hxx
libffmpeg_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(FFMPEG_CFLAGS)
FFMPEG_LIBS2 = libffmpeg.a $(FFMPEG_LIBS)
endif
# decoder plugins
libdecoder_a_SOURCES = \
src/decoder/plugins/PcmDecoderPlugin.cxx \
src/decoder/plugins/PcmDecoderPlugin.hxx \
src/decoder/DecoderAPI.cxx src/decoder/DecoderAPI.hxx \
src/decoder/Reader.cxx src/decoder/Reader.hxx \
src/decoder/DecoderBuffer.cxx src/decoder/DecoderBuffer.hxx \
src/decoder/DecoderPlugin.cxx \
src/decoder/DecoderList.cxx src/decoder/DecoderList.hxx
libdecoder_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(VORBIS_CFLAGS) $(TREMOR_CFLAGS) \
$(patsubst -I%/FLAC,-I%,$(FLAC_CFLAGS)) \
$(SNDFILE_CFLAGS) \
$(AUDIOFILE_CFLAGS) \
$(LIBMIKMOD_CFLAGS) \
$(GME_CFLAGS) \
$(SIDPLAY_CFLAGS) \
$(FLUIDSYNTH_CFLAGS) \
$(WILDMIDI_CFLAGS) \
$(WAVPACK_CFLAGS) \
$(MAD_CFLAGS) \
$(MPG123_CFLAGS) \
$(OPUS_CFLAGS) \
$(FFMPEG_CFLAGS) \
$(MPCDEC_CFLAGS) \
$(ADPLUG_CFLAGS) \
$(FAAD_CFLAGS)
DECODER_LIBS = \
libdecoder.a \
$(XIPH_LIBS) \
$(VORBIS_LIBS) $(TREMOR_LIBS) \
$(FLAC_LIBS) \
$(SNDFILE_LIBS) \
$(AUDIOFILE_LIBS) $(LIBMIKMOD_LIBS) \
$(GME_LIBS) \
$(SIDPLAY_LIBS) \
$(FLUIDSYNTH_LIBS) \
$(WILDMIDI_LIBS) \
$(WAVPACK_LIBS) \
$(MAD_LIBS) \
$(MPG123_LIBS) \
$(OPUS_LIBS) \
$(FFMPEG_LIBS2) \
$(MPCDEC_LIBS) \
$(ADPLUG_LIBS) \
$(FAAD_LIBS)
if ENABLE_DSD
libdecoder_a_SOURCES += \
src/decoder/plugins/HybridDsdDecoderPlugin.cxx \
src/decoder/plugins/HybridDsdDecoderPlugin.hxx \
src/decoder/plugins/DsdiffDecoderPlugin.cxx \
src/decoder/plugins/DsdiffDecoderPlugin.hxx \
src/decoder/plugins/DsfDecoderPlugin.cxx \
src/decoder/plugins/DsfDecoderPlugin.hxx \
src/decoder/plugins/DsdLib.cxx \
src/decoder/plugins/DsdLib.hxx
endif
if ENABLE_MAD
libdecoder_a_SOURCES += \
src/decoder/plugins/MadDecoderPlugin.cxx \
src/decoder/plugins/MadDecoderPlugin.hxx
endif
if ENABLE_MPG123
libdecoder_a_SOURCES += \
src/decoder/plugins/Mpg123DecoderPlugin.cxx \
src/decoder/plugins/Mpg123DecoderPlugin.hxx
endif
if ENABLE_MPCDEC
libdecoder_a_SOURCES += \
src/decoder/plugins/MpcdecDecoderPlugin.cxx \
src/decoder/plugins/MpcdecDecoderPlugin.hxx
endif
if ENABLE_OPUS
libdecoder_a_SOURCES += \
src/decoder/plugins/OpusDomain.cxx src/decoder/plugins/OpusDomain.hxx \
src/decoder/plugins/OpusReader.hxx \
src/decoder/plugins/OpusHead.hxx \
src/decoder/plugins/OpusHead.cxx \
src/decoder/plugins/OpusTags.cxx \
src/decoder/plugins/OpusTags.hxx \
src/decoder/plugins/OpusDecoderPlugin.cxx \
src/decoder/plugins/OpusDecoderPlugin.h
endif
if ENABLE_WAVPACK
libdecoder_a_SOURCES += \
src/decoder/plugins/WavpackDecoderPlugin.cxx \
src/decoder/plugins/WavpackDecoderPlugin.hxx
endif
if ENABLE_ADPLUG
libdecoder_a_SOURCES += \
src/decoder/plugins/AdPlugDecoderPlugin.cxx \
src/decoder/plugins/AdPlugDecoderPlugin.h
endif
if ENABLE_FAAD
libdecoder_a_SOURCES += \
src/decoder/plugins/FaadDecoderPlugin.cxx src/decoder/plugins/FaadDecoderPlugin.hxx
endif
if HAVE_OGG
libdecoder_a_SOURCES += \
src/decoder/plugins/OggDecoder.cxx src/decoder/plugins/OggDecoder.hxx
endif
if HAVE_XIPH
libdecoder_a_SOURCES += \
src/decoder/plugins/OggCodec.cxx src/decoder/plugins/OggCodec.hxx
endif
if ENABLE_VORBIS_DECODER
libdecoder_a_SOURCES += \
src/decoder/plugins/VorbisDomain.cxx src/decoder/plugins/VorbisDomain.hxx \
src/decoder/plugins/VorbisDecoderPlugin.cxx src/decoder/plugins/VorbisDecoderPlugin.h
endif
if ENABLE_FLAC
libdecoder_a_SOURCES += \
src/lib/xiph/FlacAudioFormat.hxx \
src/lib/xiph/FlacMetadataIterator.hxx \
src/lib/xiph/FlacIOHandle.cxx src/lib/xiph/FlacIOHandle.hxx \
src/lib/xiph/FlacMetadataChain.cxx src/lib/xiph/FlacMetadataChain.hxx \
src/lib/xiph/FlacStreamMetadata.cxx src/lib/xiph/FlacStreamMetadata.hxx \
src/decoder/plugins/FlacInput.cxx src/decoder/plugins/FlacInput.hxx \
src/decoder/plugins/FlacPcm.cxx src/decoder/plugins/FlacPcm.hxx \
src/decoder/plugins/FlacDomain.cxx src/decoder/plugins/FlacDomain.hxx \
src/decoder/plugins/FlacCommon.cxx src/decoder/plugins/FlacCommon.hxx \
src/decoder/plugins/FlacStreamDecoder.hxx \
src/decoder/plugins/FlacDecoderPlugin.cxx \
src/decoder/plugins/FlacDecoderPlugin.h
endif
if ENABLE_AUDIOFILE
libdecoder_a_SOURCES += \
src/decoder/plugins/AudiofileDecoderPlugin.cxx \
src/decoder/plugins/AudiofileDecoderPlugin.hxx
endif
if ENABLE_LIBMIKMOD
libdecoder_a_SOURCES += \
src/decoder/plugins/MikmodDecoderPlugin.cxx \
src/decoder/plugins/MikmodDecoderPlugin.hxx
endif
if ENABLE_MODPLUG
libmodplug_decoder_plugin_a_SOURCES = \
src/decoder/plugins/ModplugDecoderPlugin.cxx \
src/decoder/plugins/ModplugDecoderPlugin.hxx
libmodplug_decoder_plugin_a_CXXFLAGS = $(AM_CXXFLAGS) $(MODPLUG_CFLAGS)
libmodplug_decoder_plugin_a_CPPFLAGS = $(AM_CPPFLAGS)
noinst_LIBRARIES += libmodplug_decoder_plugin.a
DECODER_LIBS += libmodplug_decoder_plugin.a $(MODPLUG_LIBS)
endif
if ENABLE_SIDPLAY
libdecoder_a_SOURCES += \
src/decoder/plugins/SidplayDecoderPlugin.cxx \
src/decoder/plugins/SidplayDecoderPlugin.hxx
endif
if ENABLE_FLUIDSYNTH
libdecoder_a_SOURCES += \
src/decoder/plugins/FluidsynthDecoderPlugin.cxx \
src/decoder/plugins/FluidsynthDecoderPlugin.hxx
endif
if ENABLE_WILDMIDI
libdecoder_a_SOURCES += \
src/decoder/plugins/WildmidiDecoderPlugin.cxx \
src/decoder/plugins/WildmidiDecoderPlugin.hxx
endif
if ENABLE_FFMPEG
libdecoder_a_SOURCES += \
src/decoder/plugins/FfmpegIo.cxx \
src/decoder/plugins/FfmpegIo.hxx \
src/decoder/plugins/FfmpegMetaData.cxx \
src/decoder/plugins/FfmpegMetaData.hxx \
src/decoder/plugins/FfmpegDecoderPlugin.cxx \
src/decoder/plugins/FfmpegDecoderPlugin.hxx
endif
if ENABLE_SNDFILE
libdecoder_a_SOURCES += \
src/decoder/plugins/SndfileDecoderPlugin.cxx \
src/decoder/plugins/SndfileDecoderPlugin.hxx
endif
if ENABLE_GME
libdecoder_a_SOURCES += \
src/decoder/plugins/GmeDecoderPlugin.cxx src/decoder/plugins/GmeDecoderPlugin.hxx
endif
# encoder plugins
if ENABLE_ENCODER
noinst_LIBRARIES += libencoder_plugins.a
libencoder_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(LAME_CFLAGS) \
$(TWOLAME_CFLAGS) \
$(patsubst -I%/FLAC,-I%,$(FLAC_CFLAGS)) \
$(OPUS_CFLAGS) \
$(SHINE_CFLAGS) \
$(VORBISENC_CFLAGS)
ENCODER_LIBS = \
libencoder_plugins.a \
$(XIPH_LIBS) \
$(LAME_LIBS) \
$(TWOLAME_LIBS) \
$(FLAC_LIBS) \
$(OPUS_LIBS) \
$(SHINE_LIBS) \
$(VORBISENC_LIBS)
libencoder_plugins_a_SOURCES = \
src/encoder/Configured.cxx src/encoder/Configured.hxx \
src/encoder/EncoderAPI.hxx \
src/encoder/EncoderInterface.hxx \
src/encoder/EncoderPlugin.hxx \
src/encoder/ToOutputStream.cxx src/encoder/ToOutputStream.hxx \
src/encoder/plugins/NullEncoderPlugin.cxx \
src/encoder/plugins/NullEncoderPlugin.hxx \
src/encoder/EncoderList.cxx src/encoder/EncoderList.hxx
if ENABLE_WAVE_ENCODER
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/WaveEncoderPlugin.cxx \
src/encoder/plugins/WaveEncoderPlugin.hxx
endif
if HAVE_OGG
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/OggEncoder.hxx
endif
if ENABLE_VORBISENC
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/VorbisEncoderPlugin.cxx \
src/encoder/plugins/VorbisEncoderPlugin.hxx
endif
if ENABLE_OPUS
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/OpusEncoderPlugin.cxx \
src/encoder/plugins/OpusEncoderPlugin.hxx
endif
if ENABLE_LAME
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/LameEncoderPlugin.cxx \
src/encoder/plugins/LameEncoderPlugin.hxx
endif
if ENABLE_TWOLAME
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/TwolameEncoderPlugin.cxx \
src/encoder/plugins/TwolameEncoderPlugin.hxx
endif
if ENABLE_FLAC_ENCODER
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/FlacEncoderPlugin.cxx \
src/encoder/plugins/FlacEncoderPlugin.hxx
endif
if ENABLE_SHINE
libencoder_plugins_a_SOURCES += \
src/encoder/plugins/ShineEncoderPlugin.cxx \
src/encoder/plugins/ShineEncoderPlugin.hxx
endif
else
ENCODER_LIBS =
endif
if HAVE_ZEROCONF
libmpd_a_SOURCES += \
src/zeroconf/ZeroconfInternal.hxx \
src/zeroconf/ZeroconfGlue.cxx src/zeroconf/ZeroconfGlue.hxx
if HAVE_AVAHI
libmpd_a_SOURCES += \
src/zeroconf/AvahiPoll.cxx src/zeroconf/AvahiPoll.hxx \
src/zeroconf/ZeroconfAvahi.cxx src/zeroconf/ZeroconfAvahi.hxx
endif
if HAVE_BONJOUR
libmpd_a_SOURCES += src/zeroconf/ZeroconfBonjour.cxx src/zeroconf/ZeroconfBonjour.hxx
endif
endif
#
# input plugins
#
libinput_a_SOURCES = \
src/input/Error.cxx src/input/Error.hxx \
src/input/Init.cxx src/input/Init.hxx \
src/input/Registry.cxx src/input/Registry.hxx \
src/input/Open.cxx \
src/input/LocalOpen.cxx src/input/LocalOpen.hxx \
src/input/Offset.hxx \
src/input/InputStream.cxx src/input/InputStream.hxx \
src/input/Ptr.hxx \
src/input/InputPlugin.hxx \
src/input/Handler.hxx \
src/input/RemoteTagScanner.hxx \
src/input/ScanTags.cxx src/input/ScanTags.hxx \
src/input/Reader.cxx src/input/Reader.hxx \
src/input/TextInputStream.cxx src/input/TextInputStream.hxx \
src/input/ThreadInputStream.cxx src/input/ThreadInputStream.hxx \
src/input/AsyncInputStream.cxx src/input/AsyncInputStream.hxx \
src/input/ProxyInputStream.cxx src/input/ProxyInputStream.hxx \
src/input/RewindInputStream.cxx src/input/RewindInputStream.hxx \
src/input/BufferedInputStream.cxx src/input/BufferedInputStream.hxx \
src/input/MaybeBufferedInputStream.cxx src/input/MaybeBufferedInputStream.hxx \
src/input/plugins/FileInputPlugin.cxx src/input/plugins/FileInputPlugin.hxx
libinput_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(CURL_CFLAGS) \
$(SMBCLIENT_CFLAGS) \
$(NFS_CFLAGS) \
$(CDIO_PARANOIA_CFLAGS) \
$(FFMPEG_CFLAGS) \
$(MMS_CFLAGS)
INPUT_LIBS = \
libinput.a \
$(CURL_LIBS) \
$(SMBCLIENT_LIBS) \
$(NFS_LIBS) \
$(CDIO_PARANOIA_LIBS) \
$(FFMPEG_LIBS2) \
$(MMS_LIBS)
if ENABLE_ALSA
libinput_a_SOURCES += \
$(ALSA_SOURCES) \
src/input/plugins/AlsaInputPlugin.cxx \
src/input/plugins/AlsaInputPlugin.hxx
INPUT_LIBS += $(ALSA_LIBS)
endif
if ENABLE_CURL
libinput_a_SOURCES += \
src/input/IcyInputStream.cxx src/input/IcyInputStream.hxx \
src/input/plugins/CurlInputPlugin.cxx src/input/plugins/CurlInputPlugin.hxx \
$(CURL_SOURCES) \
src/IcyMetaDataParser.cxx src/IcyMetaDataParser.hxx
endif
if ENABLE_TIDAL
libinput_a_SOURCES += \
$(YAJL_SOURCES) \
src/input/plugins/TidalError.hxx \
src/input/plugins/TidalErrorParser.cxx src/input/plugins/TidalErrorParser.hxx \
src/input/plugins/TidalLoginRequest.cxx src/input/plugins/TidalLoginRequest.hxx \
src/input/plugins/TidalSessionManager.cxx src/input/plugins/TidalSessionManager.hxx \
src/input/plugins/TidalTrackRequest.cxx src/input/plugins/TidalTrackRequest.hxx \
src/input/plugins/TidalTagScanner.cxx src/input/plugins/TidalTagScanner.hxx \
src/input/plugins/TidalInputPlugin.cxx src/input/plugins/TidalInputPlugin.hxx
INPUT_LIBS += $(YAJL_LIBS)
endif
if ENABLE_QOBUZ
libinput_a_SOURCES += \
$(YAJL_SOURCES) \
src/lib/gcrypt/MD5.cxx src/lib/gcrypt/MD5.hxx \
src/lib/gcrypt/Hash.hxx \
src/lib/gcrypt/Init.hxx \
src/input/plugins/QobuzSession.hxx \
src/input/plugins/QobuzClient.cxx src/input/plugins/QobuzClient.hxx \
src/input/plugins/QobuzErrorParser.cxx src/input/plugins/QobuzErrorParser.hxx \
src/input/plugins/QobuzLoginRequest.cxx src/input/plugins/QobuzLoginRequest.hxx \
src/input/plugins/QobuzTrackRequest.cxx src/input/plugins/QobuzTrackRequest.hxx \
src/input/plugins/QobuzTagScanner.cxx src/input/plugins/QobuzTagScanner.hxx \
src/input/plugins/QobuzInputPlugin.cxx src/input/plugins/QobuzInputPlugin.hxx
INPUT_LIBS += $(YAJL_LIBS) $(LIBGCRYPT_LIBS)
endif
if ENABLE_SMBCLIENT
libinput_a_SOURCES += \
$(SMBCLIENT_SOURCES) \
src/input/plugins/SmbclientInputPlugin.cxx src/input/plugins/SmbclientInputPlugin.hxx
endif
if ENABLE_NFS
libinput_a_SOURCES += \
$(NFS_SOURCES) \
src/input/plugins/NfsInputPlugin.cxx src/input/plugins/NfsInputPlugin.hxx
endif
if ENABLE_CDIO_PARANOIA
libinput_a_SOURCES += \
src/input/plugins/CdioParanoiaInputPlugin.cxx \
src/input/plugins/CdioParanoiaInputPlugin.hxx
endif
if ENABLE_FFMPEG
libinput_a_SOURCES += \
src/input/plugins/FfmpegInputPlugin.cxx src/input/plugins/FfmpegInputPlugin.hxx
endif
if ENABLE_MMS
libinput_a_SOURCES += \
src/input/plugins/MmsInputPlugin.cxx src/input/plugins/MmsInputPlugin.hxx
endif
liboutput_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(AO_CFLAGS) \
$(ALSA_CFLAGS) \
$(JACK_CFLAGS) \
$(HAIKU_CFLAGS) \
$(OPENAL_CFLAGS) \
$(OPENSSL_CFLAGS) \
$(PULSE_CFLAGS) \
$(SNDIO_CFLAGS) \
$(SHOUT_CFLAGS)
OUTPUT_LIBS = \
liboutput_plugins.a \
$(LIBWRAP_LDFLAGS) \
$(AO_LIBS) \
$(ALSA_LIBS) \
$(ROAR_LIBS) \
$(JACK_LIBS) \
$(HAIKU_LIBS) \
$(OPENAL_LIBS) \
$(SNDIO_LIBS) \
$(SHOUT_LIBS)
OUTPUT_API_SRC = \
src/output/Defaults.cxx src/output/Defaults.hxx \
src/output/Client.hxx \
src/output/OutputAPI.hxx \
src/output/Filtered.cxx src/output/Filtered.hxx \
src/output/Registry.cxx src/output/Registry.hxx \
src/output/MultipleOutputs.cxx src/output/MultipleOutputs.hxx \
src/output/SharedPipeConsumer.cxx src/output/SharedPipeConsumer.hxx \
src/output/Source.cxx src/output/Source.hxx \
src/output/Thread.cxx \
src/output/Domain.cxx src/output/Domain.hxx \
src/output/Control.cxx src/output/Control.hxx \
src/output/State.cxx src/output/State.hxx \
src/output/Print.cxx src/output/Print.hxx \
src/output/OutputCommand.cxx src/output/OutputCommand.hxx \
src/output/OutputPlugin.cxx src/output/OutputPlugin.hxx \
src/output/Finish.cxx \
src/output/Init.cxx
liboutput_plugins_a_SOURCES = \
src/output/Interface.cxx src/output/Interface.hxx \
src/output/Timer.cxx src/output/Timer.hxx \
src/output/plugins/NullOutputPlugin.cxx \
src/output/plugins/NullOutputPlugin.hxx
MIXER_LIBS = \
libmixer_plugins.a \
$(ALSA_LIBS) \
$(PULSE_LIBS2)
MIXER_API_SRC = \
src/mixer/Listener.hxx \
src/mixer/MixerPlugin.hxx \
src/mixer/MixerList.hxx \
src/mixer/MixerControl.cxx src/mixer/MixerControl.hxx \
src/mixer/MixerType.cxx src/mixer/MixerType.hxx \
src/mixer/MixerAll.cxx \
src/mixer/MixerInternal.hxx
libmixer_plugins_a_SOURCES = \
src/mixer/plugins/NullMixerPlugin.cxx \
src/mixer/plugins/SoftwareMixerPlugin.cxx \
src/mixer/plugins/SoftwareMixerPlugin.hxx
libmixer_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(ALSA_CFLAGS) \
$(PULSE_CFLAGS)
if ENABLE_ALSA
liboutput_plugins_a_SOURCES += \
$(ALSA_SOURCES) \
src/output/plugins/AlsaOutputPlugin.cxx \
src/output/plugins/AlsaOutputPlugin.hxx
libmixer_plugins_a_SOURCES += \
$(ALSA_SOURCES) \
src/mixer/plugins/volume_mapping.h \
src/mixer/plugins/volume_mapping.c \
src/mixer/plugins/AlsaMixerPlugin.cxx
endif
if ANDROID
liboutput_plugins_a_SOURCES += \
src/output/plugins/sles/Object.hxx \
src/output/plugins/sles/Engine.hxx \
src/output/plugins/sles/Play.hxx \
src/output/plugins/sles/AndroidSimpleBufferQueue.hxx \
src/output/plugins/sles/SlesOutputPlugin.cxx \
src/output/plugins/sles/SlesOutputPlugin.hxx
OUTPUT_LIBS += -lOpenSLES
endif
if ENABLE_ROAR
liboutput_plugins_a_SOURCES += \
src/output/plugins/RoarOutputPlugin.cxx \
src/output/plugins/RoarOutputPlugin.hxx
libmixer_plugins_a_SOURCES += src/mixer/plugins/RoarMixerPlugin.cxx
endif
if ENABLE_AO
liboutput_plugins_a_SOURCES += \
src/output/plugins/AoOutputPlugin.cxx \
src/output/plugins/AoOutputPlugin.hxx
endif
if HAVE_FIFO
liboutput_plugins_a_SOURCES += \
src/output/plugins/FifoOutputPlugin.cxx \
src/output/plugins/FifoOutputPlugin.hxx
endif
if ENABLE_SNDIO
liboutput_plugins_a_SOURCES += \
src/output/plugins/SndioOutputPlugin.cxx \
src/output/plugins/SndioOutputPlugin.hxx
libmixer_plugins_a_SOURCES += src/mixer/plugins/SndioMixerPlugin.cxx
endif
if ENABLE_HAIKU
liboutput_plugins_a_SOURCES += \
src/output/plugins/HaikuOutputPlugin.cxx \
src/output/plugins/HaikuOutputPlugin.hxx
libmixer_plugins_a_SOURCES += \
src/mixer/plugins/HaikuMixerPlugin.cxx
endif
if ENABLE_PIPE_OUTPUT
liboutput_plugins_a_SOURCES += \
src/output/plugins/PipeOutputPlugin.cxx \
src/output/plugins/PipeOutputPlugin.hxx
endif
if ENABLE_JACK
liboutput_plugins_a_SOURCES += \
src/output/plugins/JackOutputPlugin.cxx \
src/output/plugins/JackOutputPlugin.hxx
endif
if HAVE_OSS
liboutput_plugins_a_SOURCES += \
src/output/plugins/OssOutputPlugin.cxx \
src/output/plugins/OssOutputPlugin.hxx
libmixer_plugins_a_SOURCES += src/mixer/plugins/OssMixerPlugin.cxx
endif
if HAVE_OPENAL
liboutput_plugins_a_SOURCES += \
src/output/plugins/OpenALOutputPlugin.cxx \
src/output/plugins/OpenALOutputPlugin.hxx
endif
if HAVE_OSX
liboutput_plugins_a_SOURCES += \
src/output/plugins/OSXOutputPlugin.cxx \
src/output/plugins/OSXOutputPlugin.hxx
endif
libmixer_plugins_a_SOURCES += \
src/mixer/plugins/OSXMixerPlugin.cxx
if ENABLE_PULSE
liboutput_plugins_a_SOURCES += \
src/output/plugins/PulseOutputPlugin.cxx \
src/output/plugins/PulseOutputPlugin.hxx
libmixer_plugins_a_SOURCES += \
src/mixer/plugins/PulseMixerPlugin.cxx src/mixer/plugins/PulseMixerPlugin.hxx
noinst_LIBRARIES += libpulse.a
libpulse_a_SOURCES = \
src/lib/pulse/LockGuard.hxx \
src/lib/pulse/LogError.cxx src/lib/pulse/LogError.hxx \
src/lib/pulse/Error.cxx src/lib/pulse/Error.hxx \
src/lib/pulse/Domain.cxx src/lib/pulse/Domain.hxx
libpulse_a_CPPFLAGS = $(AM_CPPFLAGS) $(PULSE_CFLAGS)
PULSE_LIBS2 = libpulse.a $(PULSE_LIBS)
OUTPUT_LIBS += $(PULSE_LIBS2)
endif
if HAVE_SHOUT
liboutput_plugins_a_SOURCES += \
src/output/plugins/ShoutOutputPlugin.cxx \
src/output/plugins/ShoutOutputPlugin.hxx
endif
if ENABLE_RECORDER_OUTPUT
liboutput_plugins_a_SOURCES += \
src/output/plugins/RecorderOutputPlugin.cxx \
src/output/plugins/RecorderOutputPlugin.hxx
endif
if ENABLE_HTTPD_OUTPUT
liboutput_plugins_a_SOURCES += \
src/output/plugins/httpd/IcyMetaDataServer.cxx \
src/output/plugins/httpd/IcyMetaDataServer.hxx \
src/output/plugins/httpd/Page.cxx src/output/plugins/httpd/Page.hxx \
src/output/plugins/httpd/HttpdInternal.hxx \
src/output/plugins/httpd/HttpdClient.cxx \
src/output/plugins/httpd/HttpdClient.hxx \
src/output/plugins/httpd/HttpdOutputPlugin.cxx \
src/output/plugins/httpd/HttpdOutputPlugin.hxx
endif
if ENABLE_SOLARIS_OUTPUT
liboutput_plugins_a_SOURCES += \
src/output/plugins/SolarisOutputPlugin.cxx src/output/plugins/SolarisOutputPlugin.hxx
endif
if ENABLE_WINMM_OUTPUT
liboutput_plugins_a_SOURCES += \
src/output/plugins/WinmmOutputPlugin.cxx \
src/output/plugins/WinmmOutputPlugin.hxx
libmixer_plugins_a_SOURCES += src/mixer/plugins/WinmmMixerPlugin.cxx
endif
#
# Playlist plugins
#
libplaylist_plugins_a_SOURCES = \
src/playlist/PlaylistPlugin.hxx \
src/playlist/SongEnumerator.hxx \
src/playlist/MemorySongEnumerator.cxx \
src/playlist/MemorySongEnumerator.hxx \
src/playlist/plugins/ExtM3uPlaylistPlugin.cxx \
src/playlist/plugins/ExtM3uPlaylistPlugin.hxx \
src/playlist/plugins/M3uPlaylistPlugin.cxx \
src/playlist/plugins/M3uPlaylistPlugin.hxx \
src/playlist/plugins/PlsPlaylistPlugin.cxx \
src/playlist/plugins/PlsPlaylistPlugin.hxx \
src/playlist/PlaylistRegistry.cxx src/playlist/PlaylistRegistry.hxx
libplaylist_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(EXPAT_CFLAGS) \
$(YAJL_CFLAGS) \
$(patsubst -I%/FLAC,-I%,$(FLAC_CFLAGS))
PLAYLIST_LIBS = \
libplaylist_plugins.a \
$(EXPAT_LIBS) \
$(FLAC_LIBS)
if ENABLE_FLAC
libplaylist_plugins_a_SOURCES += \
src/playlist/plugins/FlacPlaylistPlugin.cxx \
src/playlist/plugins/FlacPlaylistPlugin.hxx
endif
if ENABLE_CUE
libplaylist_plugins_a_SOURCES += \
src/playlist/cue/CueParser.cxx src/playlist/cue/CueParser.hxx \
src/playlist/plugins/CuePlaylistPlugin.cxx \
src/playlist/plugins/CuePlaylistPlugin.hxx \
src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx \
src/playlist/plugins/EmbeddedCuePlaylistPlugin.hxx
endif
if ENABLE_SOUNDCLOUD
libplaylist_plugins_a_SOURCES += \
$(YAJL_SOURCES) \
src/playlist/plugins/SoundCloudPlaylistPlugin.cxx \
src/playlist/plugins/SoundCloudPlaylistPlugin.hxx
PLAYLIST_LIBS += $(YAJL_LIBS)
endif
if ENABLE_EXPAT
libplaylist_plugins_a_SOURCES += \
src/lib/expat/StreamExpatParser.cxx \
src/lib/expat/ExpatParser.cxx src/lib/expat/ExpatParser.hxx \
src/playlist/plugins/XspfPlaylistPlugin.cxx \
src/playlist/plugins/XspfPlaylistPlugin.hxx \
src/playlist/plugins/AsxPlaylistPlugin.cxx \
src/playlist/plugins/AsxPlaylistPlugin.hxx \
src/playlist/plugins/RssPlaylistPlugin.cxx \
src/playlist/plugins/RssPlaylistPlugin.hxx
endif
#
# Filter plugins
#
libfilter_api_a_SOURCES = \
src/filter/Observer.cxx src/filter/Observer.hxx \
src/filter/FilterPlugin.hxx \
src/filter/Prepared.hxx \
src/filter/Filter.cxx src/filter/Filter.hxx
libfilter_plugins_a_SOURCES = \
src/AudioCompress/config.h \
src/AudioCompress/compress.h \
src/AudioCompress/compress.c \
src/filter/plugins/NullFilterPlugin.cxx \
src/filter/plugins/ChainFilterPlugin.cxx \
src/filter/plugins/ChainFilterPlugin.hxx \
src/filter/plugins/AutoConvertFilterPlugin.cxx \
src/filter/plugins/AutoConvertFilterPlugin.hxx \
src/filter/plugins/ConvertFilterPlugin.cxx \
src/filter/plugins/ConvertFilterPlugin.hxx \
src/filter/plugins/RouteFilterPlugin.cxx \
src/filter/plugins/NormalizeFilterPlugin.cxx \
src/filter/plugins/NormalizeFilterPlugin.hxx \
src/filter/plugins/ReplayGainFilterPlugin.cxx \
src/filter/plugins/ReplayGainFilterPlugin.hxx \
src/filter/plugins/VolumeFilterPlugin.cxx \
src/filter/plugins/VolumeFilterPlugin.hxx
libfilter_glue_a_SOURCES = \
src/filter/FilterRegistry.cxx src/filter/FilterRegistry.hxx \
src/filter/Factory.cxx src/filter/Factory.hxx \
src/filter/LoadOne.cxx src/filter/LoadOne.hxx \
src/filter/LoadChain.cxx src/filter/LoadChain.hxx
FILTER_LIBS = \
libfilter_glue.a \
libfilter_plugins.a \
libfilter_api.a \
$(PCM_LIBS)
#
# systemd unit
#
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
systemd/system/mpd.socket \
systemd/system/mpd.service
endif
if HAVE_SYSTEMD_USER
systemduserunit_DATA = \
systemd/user/mpd.service
endif
#
# Test programs
#
if ENABLE_TEST
C_TESTS = \
test/test_util \
test/test_byte_reverse \
test/test_rewind \
test/test_mixramp \
test/test_pcm \
test/test_protocol \
test/test_queue_priority \
test/TestFs \
test/TestIcu
if ENABLE_CURL
C_TESTS += test/test_icy_parser
endif
if ENABLE_DATABASE
C_TESTS += test/test_translate_song
endif
if ENABLE_ARCHIVE
C_TESTS += test/test_archive
endif
TESTS = $(C_TESTS)
noinst_PROGRAMS = \
$(C_TESTS) \
test/ParseSongFilter \
test/read_conf \
test/run_resolver \
test/run_input \
test/WriteFile \
test/dump_text_file \
test/dump_playlist \
test/run_decoder \
test/read_tags \
test/ReadApeTags \
test/ContainerScan \
test/run_filter \
test/run_output \
test/run_convert \
test/run_normalize \
test/software_volume
if ENABLE_DATABASE
noinst_PROGRAMS += test/DumpDatabase
noinst_PROGRAMS += test/run_storage
endif
if ENABLE_NEIGHBOR_PLUGINS
noinst_PROGRAMS += test/run_neighbor_explorer
endif
if HAVE_AVAHI
noinst_PROGRAMS += test/run_avahi
endif
if ENABLE_ARCHIVE
noinst_PROGRAMS += test/visit_archive
endif
if ENABLE_ID3TAG
noinst_PROGRAMS += test/dump_rva2
endif
if ENABLE_ALSA
# this debug program is still ALSA specific
noinst_PROGRAMS += test/read_mixer
endif
test_ParseSongFilter_LDADD = \
libsong.a \
libpcm.a \
$(TAG_LIBS) \
$(ICU_LDADD) \
libutil.a
test_ParseSongFilter_SOURCES = \
test/ParseSongFilter.cxx
test_read_conf_LDADD = \
libconf.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_read_conf_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/read_conf.cxx
test_run_resolver_LDADD = \
libnet.a \
libutil.a
test_run_resolver_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/run_resolver.cxx
if ENABLE_DATABASE
test_DumpDatabase_LDADD = \
$(DB_LIBS) \
libsong.a \
$(TAG_LIBS) \
libconf.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
libsystem.a \
$(ICU_LDADD) \
libutil.a
test_DumpDatabase_SOURCES = test/DumpDatabase.cxx \
src/protocol/Ack.cxx \
src/Log.cxx src/LogBackend.cxx \
src/db/Registry.cxx \
src/db/Selection.cxx \
src/db/PlaylistVector.cxx \
src/db/DatabaseLock.cxx \
src/AudioFormat.cxx \
src/AudioParser.cxx \
src/pcm/SampleFormat.cxx \
src/SongSave.cxx \
src/TagSave.cxx
test_DumpDatabase_CPPFLAGS = $(AM_CPPFLAGS)
if ENABLE_UPNP
test_DumpDatabase_SOURCES += \
$(CURL_SOURCES) \
src/lib/expat/ExpatParser.cxx
test_DumpDatabase_CPPFLAGS += $(CURL_CFLAGS)
test_DumpDatabase_LDADD += $(CURL_LIBS)
endif
test_run_storage_LDADD = \
$(STORAGE_LIBS) \
$(FS_LIBS) \
$(ICU_LDADD) \
libevent.a \
libthread.a \
libsystem.a \
libutil.a
test_run_storage_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/run_storage.cxx
if ENABLE_WEBDAV
test_run_storage_SOURCES += $(CURL_SOURCES)
endif
endif
test_run_input_LDADD = \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(TAG_LIBS) \
libconf.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_run_input_SOURCES = test/run_input.cxx \
src/Log.cxx src/LogBackend.cxx \
src/TagSave.cxx
if ENABLE_NEIGHBOR_PLUGINS
test_run_neighbor_explorer_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/ShutdownHandler.cxx test/ShutdownHandler.hxx \
test/run_neighbor_explorer.cxx
test_run_neighbor_explorer_LDADD = $(AM_LDADD) \
$(NEIGHBOR_LIBS) \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
libtag.a \
libconf.a \
libevent.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libthread.a \
libutil.a
if ENABLE_UPNP
test_run_neighbor_explorer_SOURCES += src/lib/expat/ExpatParser.cxx
endif
endif
if ENABLE_ARCHIVE
test_visit_archive_LDADD = \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(TAG_LIBS) \
libconf.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_visit_archive_SOURCES = test/visit_archive.cxx \
src/Log.cxx src/LogBackend.cxx \
src/input/Open.cxx
endif
if ENABLE_ZLIB
noinst_PROGRAMS += test/run_gzip test/run_gunzip
test_run_gzip_LDADD = \
libutil.a \
$(FS_LIBS)
test_run_gzip_SOURCES = test/run_gzip.cxx \
src/Log.cxx src/LogBackend.cxx
test_run_gunzip_SOURCES = test/run_gunzip.cxx \
src/Log.cxx src/LogBackend.cxx
test_run_gunzip_LDADD = \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
endif
test_WriteFile_LDADD = \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_WriteFile_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/WriteFile.cxx
test_dump_text_file_LDADD = \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(TAG_LIBS) \
libconf.a \
libevent.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libthread.a \
libutil.a
test_dump_text_file_SOURCES = test/dump_text_file.cxx \
src/Log.cxx src/LogBackend.cxx
test_dump_playlist_LDADD = \
$(PLAYLIST_LIBS) \
$(FLAC_LIBS) \
$(DECODER_LIBS) \
$(TAG_LIBS) \
$(XIPH_LIBS) \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
libconf.a \
libbasic.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a \
libpcm.a
test_dump_playlist_SOURCES = test/dump_playlist.cxx \
src/Log.cxx src/LogBackend.cxx \
src/TagSave.cxx \
src/TagFile.cxx
if ENABLE_FLAC
test_dump_playlist_SOURCES += \
src/ReplayGainInfo.cxx
endif
test_run_decoder_LDADD = \
$(DECODER_LIBS) \
libpcm.a \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(TAG_LIBS) \
libconf.a \
libbasic.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_run_decoder_SOURCES = test/run_decoder.cxx \
test/DumpDecoderClient.cxx test/DumpDecoderClient.hxx \
src/Log.cxx src/LogBackend.cxx \
src/ReplayGainInfo.cxx
test_read_tags_LDADD = \
$(DECODER_LIBS) \
libpcm.a \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(TAG_LIBS) \
libconf.a \
libbasic.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_read_tags_SOURCES = test/read_tags.cxx \
src/Log.cxx src/LogBackend.cxx \
src/ReplayGainInfo.cxx
test_ReadApeTags_LDADD = \
$(TAG_LIBS) \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_ReadApeTags_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/ReadApeTags.cxx
test_ContainerScan_LDADD = \
$(DECODER_LIBS) \
libpcm.a \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(TAG_LIBS) \
libconf.a \
libbasic.a \
libevent.a \
libthread.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_ContainerScan_SOURCES = test/ContainerScan.cxx \
src/SongSave.cxx src/TagSave.cxx \
src/Log.cxx src/LogBackend.cxx \
src/ReplayGainInfo.cxx \
$(DECODER_SRC)
if ENABLE_ID3TAG
test_dump_rva2_LDADD = \
$(TAG_LIBS) \
$(INPUT_LIBS) \
$(ARCHIVE_LIBS) \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_dump_rva2_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/dump_rva2.cxx
endif
test_run_filter_LDADD = \
$(FILTER_LIBS) \
libconf.a \
libbasic.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_run_filter_SOURCES = test/run_filter.cxx \
src/Log.cxx src/LogBackend.cxx
if ENABLE_ENCODER
noinst_PROGRAMS += test/run_encoder
test_run_encoder_SOURCES = test/run_encoder.cxx \
src/Log.cxx src/LogBackend.cxx
test_run_encoder_LDADD = \
$(ENCODER_LIBS) \
$(TAG_LIBS) \
libconf.a \
libbasic.a \
libpcm.a \
libthread.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
endif
if ENABLE_VORBISENC
noinst_PROGRAMS += test/test_vorbis_encoder
test_test_vorbis_encoder_SOURCES = test/test_vorbis_encoder.cxx \
src/Log.cxx src/LogBackend.cxx
test_test_vorbis_encoder_CPPFLAGS = $(AM_CPPFLAGS) \
$(ENCODER_CFLAGS)
test_test_vorbis_encoder_LDADD = $(MPD_LIBS) \
$(ENCODER_LIBS) \
$(PCM_LIBS) \
$(TAG_LIBS) \
libconf.a \
libbasic.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
endif
test_software_volume_SOURCES = test/software_volume.cxx \
src/Log.cxx src/LogBackend.cxx
test_software_volume_LDADD = \
$(PCM_LIBS) \
libbasic.a \
libutil.a
test_run_avahi_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
src/zeroconf/ZeroconfAvahi.cxx src/zeroconf/AvahiPoll.cxx \
test/ShutdownHandler.cxx test/ShutdownHandler.hxx \
test/run_avahi.cxx
test_run_avahi_CPPFLAGS = $(AM_CPPFLAGS) \
$(AVAHI_CFLAGS)
test_run_avahi_LDADD = \
libevent.a \
libsystem.a \
libutil.a \
$(AVAHI_LIBS)
test_run_normalize_SOURCES = test/run_normalize.cxx \
src/Log.cxx src/LogBackend.cxx \
src/CheckAudioFormat.cxx \
src/AudioCompress/compress.c \
src/AudioParser.cxx
test_run_normalize_LDADD = \
libutil.a
test_run_convert_SOURCES = test/run_convert.cxx \
src/Log.cxx src/LogBackend.cxx
test_run_convert_LDADD = \
$(PCM_LIBS) \
libconf.a \
libbasic.a \
$(FS_LIBS) \
libsystem.a \
$(ICU_LDADD) \
libutil.a
test_run_output_LDADD = $(MPD_LIBS) \
$(OUTPUT_LIBS) \
$(ENCODER_LIBS) \
libmixer_plugins.a \
$(PCM_LIBS) \
$(TAG_LIBS) \
libconf.a \
libbasic.a \
libevent.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libnet.a \
libsystem.a \
libthread.a \
libutil.a
test_run_output_SOURCES = test/run_output.cxx \
test/NullMixerListener.hxx \
src/Log.cxx src/LogBackend.cxx \
src/output/Domain.cxx \
src/output/Registry.cxx \
src/output/OutputPlugin.cxx \
src/mixer/MixerControl.cxx \
src/mixer/MixerType.cxx
test_read_mixer_LDADD = \
libpcm.a \
libmixer_plugins.a \
$(OUTPUT_LIBS) \
libfilter_api.a \
libconf.a \
libbasic.a \
libevent.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a
test_read_mixer_SOURCES = test/read_mixer.cxx \
test/NullMixerListener.hxx \
src/Log.cxx src/LogBackend.cxx \
src/mixer/MixerControl.cxx \
src/filter/plugins/VolumeFilterPlugin.cxx
if ENABLE_BZIP2_TEST
TESTS += test/test_archive_bzip2.sh
endif
if ENABLE_ZZIP_TEST
TESTS += test/test_archive_zzip.sh
endif
if ENABLE_ISO9660_TEST
TESTS += test/test_archive_iso9660.sh
endif
if ENABLE_INOTIFY
noinst_PROGRAMS += test/run_inotify
test_run_inotify_SOURCES = test/run_inotify.cxx \
test/ShutdownHandler.cxx test/ShutdownHandler.hxx \
src/Log.cxx src/LogBackend.cxx \
src/db/update/InotifyDomain.cxx \
src/db/update/InotifySource.cxx
test_run_inotify_LDADD = \
libevent.a \
libsystem.a \
libutil.a
endif
test_test_util_SOURCES = \
test/DivideStringTest.hxx \
test/SplitStringTest.hxx \
test/UriUtilTest.hxx \
test/MimeTypeTest.hxx \
test/TestCircularBuffer.hxx \
test/test_util.cxx
test_test_util_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_util_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_util_LDADD = \
libutil.a \
$(CPPUNIT_LIBS)
test_test_byte_reverse_SOURCES = \
test/test_byte_reverse.cxx
test_test_byte_reverse_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_byte_reverse_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_byte_reverse_LDADD = \
libutil.a \
$(CPPUNIT_LIBS)
test_test_rewind_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/test_rewind.cxx
test_test_rewind_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_rewind_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_rewind_LDADD = \
$(INPUT_LIBS) \
libthread.a \
libtag.a \
libutil.a \
$(CPPUNIT_LIBS)
test_test_mixramp_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/test_mixramp.cxx
test_test_mixramp_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_mixramp_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_mixramp_LDADD = \
libutil.a \
$(CPPUNIT_LIBS)
if ENABLE_CURL
test_test_icy_parser_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/test_icy_parser.cxx
test_test_icy_parser_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_icy_parser_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_icy_parser_LDADD = \
libtag.a \
libutil.a \
$(CPPUNIT_LIBS)
endif
test_test_pcm_SOURCES = \
test/TestAudioFormat.cxx test/TestAudioFormat.hxx \
test/test_pcm_util.hxx \
test/test_pcm_dither.cxx \
test/test_pcm_pack.cxx \
test/test_pcm_channels.cxx \
test/test_pcm_format.cxx \
test/test_pcm_volume.cxx \
test/test_pcm_mix.cxx \
test/test_pcm_interleave.cxx \
test/test_pcm_export.cxx \
test/test_pcm_all.hxx \
test/test_pcm_main.cxx
test_test_pcm_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_pcm_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_pcm_LDADD = \
$(PCM_LIBS) \
libbasic.a \
libutil.a \
$(CPPUNIT_LIBS)
test_test_archive_SOURCES = \
src/Log.cxx src/LogBackend.cxx \
test/test_archive.cxx
test_test_archive_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_archive_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_archive_LDADD = \
libarchive.a \
libutil.a \
$(CPPUNIT_LIBS)
if ENABLE_DATABASE
test_test_translate_song_SOURCES = \
src/playlist/PlaylistSong.cxx \
src/PlaylistError.cxx \
src/SongLoader.cxx \
src/LocateUri.cxx \
src/Log.cxx \
test/test_translate_song.cxx
test_test_translate_song_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_translate_song_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_translate_song_LDADD = \
$(STORAGE_LIBS) \
libtag.a \
$(FS_LIBS) \
$(ICU_LDADD) \
libsystem.a \
libutil.a \
$(CPPUNIT_LIBS)
endif
test_test_protocol_SOURCES = \
src/protocol/ArgParser.cxx \
test/test_protocol.cxx
test_test_protocol_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_protocol_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_protocol_LDADD = \
libsystem.a \
libutil.a \
$(CPPUNIT_LIBS)
test_test_queue_priority_SOURCES = \
src/queue/Queue.cxx \
test/test_queue_priority.cxx
test_test_queue_priority_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_test_queue_priority_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_queue_priority_LDADD = \
libsystem.a \
libutil.a \
$(CPPUNIT_LIBS)
test_TestFs_SOURCES = \
test/TestFs.cxx
test_TestFs_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_TestFs_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_TestFs_LDADD = \
$(FS_LIBS) \
$(CPPUNIT_LIBS)
test_TestIcu_SOURCES = \
test/TestIcu.cxx
test_TestIcu_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS)
test_TestIcu_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_TestIcu_LDADD = \
$(ICU_LDADD) \
libutil.a \
$(CPPUNIT_LIBS)
if ENABLE_DSD
noinst_PROGRAMS += src/pcm/dsd2pcm/dsd2pcm
src_pcm_dsd2pcm_dsd2pcm_SOURCES = \
src/pcm/dsd2pcm/dsd2pcm.c src/pcm/dsd2pcm/dsd2pcm.h \
src/pcm/dsd2pcm/dsd2pcm.hpp \
src/pcm/dsd2pcm/noiseshape.c src/pcm/dsd2pcm/noiseshape.h \
src/pcm/dsd2pcm/noiseshape.hpp \
src/pcm/dsd2pcm/main.cpp
src_pcm_dsd2pcm_dsd2pcm_LDADD = libutil.a
endif
endif
#
# Documentation
#
man_MANS = doc/mpd.1 doc/mpd.conf.5
doc_DATA = AUTHORS COPYING NEWS README.md doc/mpdconf.example
DOCBOOK_FILES = doc/protocol.xml
if ENABLE_DOCUMENTATION
protocoldir = $(docdir)/protocol
protocol_DATA = $(wildcard doc/protocol/*.html)
DOCBOOK_HTML = $(patsubst %.xml,%/index.html,$(DOCBOOK_FILES))
DOCBOOK_INCLUDES = $(wildcard $(srcdir)/doc/include/*.xml)
doc/html/index.html: $(srcdir)/doc/conf.py $(srcdir)/doc/*.rst
$(SPHINX) -q -b html -d doc/doctrees $(srcdir)/doc doc/html
$(DOCBOOK_HTML): %/index.html: %.xml $(DOCBOOK_INCLUDES)
$(XMLTO) -o $(@D) --stringparam chunker.output.encoding=utf-8 html --stringparam use.id.as.filename=1 $<
doc/api/html/index.html: doc/doxygen.conf
@$(MKDIR_P) $(@D)
$(DOXYGEN) $<
all-local: doc/html/index.html $(DOCBOOK_HTML) doc/api/html/index.html
clean-local:
rm -rf $(patsubst %.xml,%,$(DOCBOOK_FILES))
rm -rf doc/api doc/doctrees doc/html
install-data-local: doc/api/html/index.html
$(mkinstalldirs) $(DESTDIR)$(docdir)/html $(DESTDIR)$(docdir)/html/_sources $(DESTDIR)$(docdir)/html/_static
$(INSTALL_DATA) -c doc/html/*.* $(DESTDIR)$(docdir)/html
$(INSTALL_DATA) -c doc/html/_sources/*.* $(DESTDIR)$(docdir)/html/_sources
$(INSTALL_DATA) -c doc/html/_static/*.* $(DESTDIR)$(docdir)/html/_static
$(mkinstalldirs) $(DESTDIR)$(docdir)/api/html
$(INSTALL_DATA) -c -m 644 doc/api/html/*.* \
$(DESTDIR)$(docdir)/api/html
uninstall-local:
rm -f $(DESTDIR)$(docdir)/api/html/*.*
upload: doc/html/index.html $(DOCBOOK_HTML) doc/api/html/index.html
rsync -vpruz --delete doc/ www.musicpd.org:/var/www/mpd/doc/ \
--chmod=Dug+rwx,Do+rx,Fug+rw,Fo+r \
--include=protocol --include=protocol/** \
--include=user --include=user/** \
--include=api --include=api/** \
--include=html --include=html/** \
--exclude=*
endif
#
# Distribution
#
EXTRA_DIST = $(doc_DATA) autogen.sh \
test/test_archive_bzip2.sh \
test/test_archive_iso9660.sh \
test/test_archive_zzip.sh \
$(wildcard $(srcdir)/scripts/*.rb) \
$(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \
$(wildcard $(srcdir)/doc/include/*.xml) \
systemd/system/mpd.socket \
$(wildcard $(srcdir)/python/build/*.py) \
android/AndroidManifest.xml \
android/build.py \
android/custom_rules.xml \
android/res/values/strings.xml \
android/src/Bridge.java \
android/src/Loader.java \
android/src/Main.java \
win32/build.py \
win32/res/mpd.rc.in win32/res/mpd.ico \
src/haiku/App_MusicPD
......@@ -46,6 +46,7 @@ ver 0.21 (not yet released)
- opus: support for sending metadata using ogg stream chaining
* systemd watchdog support
* require GCC 6
* build with Meson instead of autotools
ver 0.20.22 (not yet released)
* storage
......
#!/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`" .
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
......@@ -57,6 +57,7 @@ sys.path[0] = os.path.join(mpd_path, 'python')
# output directories
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)
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
# 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
from build.libs import *
......@@ -173,32 +182,13 @@ for x in thirdparty_libs:
toolchain = AndroidNdkToolchain(tarball_path, src_path, build_path,
use_cxx=True)
configure = [
os.path.join(mpd_path, 'configure'),
'CC=' + toolchain.cc,
'CXX=' + toolchain.cxx,
'CFLAGS=' + toolchain.cflags,
'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',
'--disable-icu',
] + 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)
configure_args += [
'-Dandroid_sdk=' + sdk_path,
'-Dandroid_ndk=' + ndk_path,
'-Dandroid_abi=' + android_abi,
'-Dandroid_strip=' + toolchain.strip,
]
from build.meson import configure as run_meson
run_meson(toolchain, mpd_path, '.', configure_args)
subprocess.check_call(['/usr/bin/ninja'], env=toolchain.env)
#!/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/"
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@',
],
)
#!/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"
#!/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" .
#!/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 "$@"
AC_PREREQ(2.60)
AC_INIT(mpd, 0.21, musicpd-dev-team@lists.sourceforge.net)
VERSION_MAJOR=0
VERSION_MINOR=21
VERSION_REVISION=0
VERSION_EXTRA=0
AC_CONFIG_SRCDIR([src/Main.cxx])
AC_CONFIG_AUX_DIR(build)
AM_INIT_AUTOMAKE([foreign 1.11 dist-xz subdir-objects])
AM_SILENT_RULES
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_DEFINE(PROTOCOL_VERSION, "0.21.0", [The MPD protocol version])
GIT_COMMIT=`cd "$srcdir" && git describe --dirty --always 2>/dev/null`
if test x$GIT_COMMIT != x; then
AC_DEFINE_UNQUOTED(GIT_COMMIT, ["$GIT_COMMIT"], [The current git commit])
fi
dnl ---------------------------------------------------------------------------
dnl Programs
dnl ---------------------------------------------------------------------------
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_RANLIB
AN_MAKEVAR([AR], [AC_PROG_AR])
AN_PROGRAM([ar], [AC_PROG_AR])
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
AC_PROG_AR
AC_PROG_INSTALL
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[], [with_systemdsystemunitdir=no])
if test "x$with_systemdsystemunitdir" = xyes; then
AC_MSG_CHECKING(for systemd)
with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
if test -z "$with_systemdsystemunitdir"; then
AC_MSG_ERROR([Failed to detect systemd])
fi
AC_MSG_RESULT([$with_systemdsystemunitdir])
fi
if test "x$with_systemdsystemunitdir" != xno; then
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
AC_ARG_WITH([systemduserunitdir],
AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd service files]),
[], [with_systemduserunitdir=no])
if test "x$with_systemduserunitdir" = xyes; then
AC_MSG_CHECKING(for systemd)
with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)
if test -z "$with_systemduserunitdir"; then
AC_MSG_ERROR([Failed to detect systemd])
fi
AC_MSG_RESULT([$with_systemduserunitdir])
fi
if test "x$with_systemduserunitdir" != xno; then
AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
fi
AM_CONDITIONAL(HAVE_SYSTEMD_USER, [test -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != xno ])
dnl ---------------------------------------------------------------------------
dnl Declare Variables
dnl ---------------------------------------------------------------------------
AC_SUBST(AM_CPPFLAGS,"")
AC_SUBST(AM_CFLAGS,"")
AC_SUBST(AM_CXXFLAGS,"")
## Used for the windows resource file
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION)
AC_SUBST(VERSION_EXTRA)
dnl ---------------------------------------------------------------------------
dnl OS Specific Defaults
dnl ---------------------------------------------------------------------------
AC_CANONICAL_HOST
host_is_unix=yes
host_is_linux=no
host_is_android=no
host_is_darwin=no
host_is_solaris=no
host_is_windows=no
linux_auto=no
case "$host_os" in
linux-android*)
host_is_android=yes
host_is_linux=yes
linux_auto=auto
AM_CPPFLAGS="$AM_CPPFLAGS -DANDROID"
;;
linux*)
host_is_linux=yes
linux_auto=auto
dnl allow using all glibc features
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
;;
mingw32* | windows*)
AC_CONFIG_FILES([
win32/res/mpd.rc
])
AC_CHECK_TOOL(WINDRES, windres)
AM_CPPFLAGS="$AM_CPPFLAGS -DWIN32_LEAN_AND_MEAN"
AM_CPPFLAGS="$AM_CPPFLAGS -DWINVER=0x0600 -D_WIN32_WINNT=0x0600"
AM_CPPFLAGS="$AM_CPPFLAGS -DSTRICT"
AM_CPPFLAGS="$AM_CPPFLAGS -DUNICODE -D_UNICODE"
LIBS="$LIBS -lws2_32"
host_is_windows=yes
host_is_unix=no
;;
darwin*)
host_is_darwin=yes
;;
solaris*)
host_is_solaris=yes
;;
haiku*)
AC_CHECK_TOOL(RC, rc)
AC_CHECK_TOOL(XRES, xres)
;;
esac
AM_CONDITIONAL([LINUX], [test x$host_is_linux = xyes])
AM_CONDITIONAL([ANDROID], [test x$host_is_android = xyes])
AM_CONDITIONAL([HAVE_WINDOWS], [test x$host_is_windows = xyes])
if test -z "$prefix" || test "x$prefix" = xNONE; then
local_lib=
local_include=
# aren't autotools supposed to be smart enough to figure this out? oh
# well, the git-core Makefile managed to do some of the work for us :)
case "$host_os" in
darwin*)
local_lib='/sw/lib /opt/local/lib'
local_include='/sw/include /opt/local/include'
;;
freebsd* | openbsd*)
local_lib=/usr/local/lib
local_include=/usr/local/include
;;
netbsd*)
local_lib=/usr/pkg/lib
local_include=/usr/pkg/include
LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/pkg/lib"
;;
esac
for d in $local_lib; do
if test -d "$d"; then
LDFLAGS="$LDFLAGS -L$d"
break
fi
done
for d in $local_include; do
if test -d "$d"; then
CPPFLAGS="$CPPFLAGS -I$d"
break
fi
done
fi
dnl ---------------------------------------------------------------------------
dnl Android
dnl ---------------------------------------------------------------------------
AC_ARG_WITH([android-sdk],
AS_HELP_STRING([--with-android-sdk=DIR],
[Directory for Android SDK]),
[], [with_android_sdk=no])
android_abi=""
if test x$host_is_android = xyes; then
if test x$with_android_sdk = xno; then
AC_MSG_ERROR([Android build requires option --with-android-sdk=DIR])
fi
if ! test -x $with_android_sdk/tools/android; then
AC_MSG_ERROR([Android SDK not found in $with_android_sdk])
fi
AS_CASE([$host_cpu],
[i686], [android_abi="x86"],
[aarch64], [android_abi="arm64-v8a"],
[android_abi="armeabi-v7a"])
fi
AC_SUBST(ANDROID_SDK, [$with_android_sdk])
AC_SUBST(ANDROID_ABI, [$android_abi])
dnl ---------------------------------------------------------------------------
dnl Language Checks
dnl ---------------------------------------------------------------------------
AX_CXX_COMPILE_STDCXX_14([noext], [mandatory])
dnl ---------------------------------------------------------------------------
dnl Header/Library Checks
dnl ---------------------------------------------------------------------------
AX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBS"
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
AM_CXXFLAGS="$AM_CXXFLAGS $PTHREAD_CFLAGS"
MPD_WITH_LIBRARY([PTHREAD],
[AC_CHECK_FUNCS([pthread_setname_np])])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_ARG_ENABLE(syslog,
AS_HELP_STRING([--enable-syslog],
[enable syslog support (default: auto)]),,
enable_syslog=auto)
MPD_AUTO(syslog, [syslog support], [syslog() not available],
[AC_SEARCH_LIBS([syslog], [bsd socket inet],
[found_syslog=yes],
[found_syslog=no])])
if test x$enable_syslog = xyes; then
AC_DEFINE(HAVE_SYSLOG, 1, [Define if syslog() is available])
fi
AC_SEARCH_LIBS([socket], [network socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
AC_CHECK_FUNCS(getpwnam_r getpwuid_r)
AC_CHECK_FUNCS(initgroups)
AC_CHECK_FUNCS(fnmatch)
AC_CHECK_FUNCS(strndup)
AC_CHECK_FUNCS(strcasestr)
AC_CHECK_MEMBERS([struct sockaddr_in.sin_len], [], [], [[#include <netinet/in.h>]])
if test x$host_is_linux = xyes; then
MPD_OPTIONAL_FUNC(eventfd, eventfd, USE_EVENTFD)
MPD_OPTIONAL_FUNC(signalfd, signalfd, USE_SIGNALFD)
fi
AC_SEARCH_LIBS([exp], [m],,
[AC_MSG_ERROR([exp() not found])])
AC_CHECK_HEADERS(locale.h)
AC_CHECK_HEADERS([sys/prctl.h], AC_CHECK_FUNCS([prctl]))
dnl ---------------------------------------------------------------------------
dnl Event loop selection
dnl ---------------------------------------------------------------------------
MPD_OPTIONAL_FUNC_NODEF(poll, poll)
if test x$host_is_linux = xyes; then
MPD_OPTIONAL_FUNC_NODEF(epoll, epoll_create1)
fi
AC_ARG_WITH(pollmethod,
AS_HELP_STRING(
[--with-pollmethod=@<:@epoll|poll|winselect|auto@:>@],
[specify poll method for internal event loop (default=auto)]),,
[with_pollmethod=auto])
if test "x$with_pollmethod" = xauto; then
if test "x$enable_epoll" = xyes; then
with_pollmethod=epoll
elif test "x$enable_poll" = xyes; then
with_pollmethod=poll
elif test "x$host_is_windows" = xyes; then
with_pollmethod=winselect
else
AC_MSG_ERROR([no poll method is available for your platform])
fi
fi
case "$with_pollmethod" in
epoll)
AC_DEFINE(USE_EPOLL, 1, [Define to poll sockets with epoll])
;;
poll)
AC_DEFINE(USE_POLL, 1, [Define to poll sockets with poll])
;;
winselect)
AC_DEFINE(USE_WINSELECT, 1,
[Define to poll sockets with Windows select])
;;
*)
AC_MSG_ERROR([unknown pollmethod option: $with_pollmethod])
esac
dnl ---------------------------------------------------------------------------
dnl Allow tools to be specifically built
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(database,
AS_HELP_STRING([--enable-database],
[enable support for the music database]),,
enable_database=yes)
MPD_DEFINE_CONDITIONAL(enable_database, ENABLE_DATABASE,
[the music database])
if test x$enable_database = xyes; then
database_auto=auto
else
database_auto=no
fi
default_enable_daemon=yes
if test x$host_is_android = xyes || test x$host_is_windows = xyes; then
default_enable_daemon=no
fi
AC_ARG_ENABLE(daemon,
AS_HELP_STRING([--enable-daemon],
[enable daemonization (default: enabled)]),,
enable_daemon=$default_enable_daemon)
MPD_DEFINE_CONDITIONAL(enable_daemon, ENABLE_DAEMON, [Enable daemonization?])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging (default: disabled)]),,
enable_debug=no)
AC_ARG_ENABLE(documentation,
AS_HELP_STRING([--enable-documentation],
[build documentation (default: disable)]),,
[enable_documentation=no])
AC_ARG_ENABLE(dsd,
AS_HELP_STRING([--enable-dsd],
[enable DSD decoder (default: enable)]),,
[enable_dsd=yes])
AC_ARG_ENABLE(fifo,
AS_HELP_STRING([--disable-fifo],
[disable support for writing audio to a FIFO (default: enable)]),,
enable_fifo=yes)
AC_ARG_ENABLE(httpd-output,
AS_HELP_STRING([--enable-httpd-output],
[enables the HTTP server output]),,
[enable_httpd_output=auto])
AC_ARG_ENABLE(inotify,
AS_HELP_STRING([--disable-inotify],
[disable support Inotify automatic database update (default: enabled) ]),,
[enable_inotify=yes])
AC_ARG_ENABLE(ipv6,
AS_HELP_STRING([--disable-ipv6],
[disable IPv6 support (default: enable)]),,
[enable_ipv6=yes])
AC_SYS_LARGEFILE
AC_ARG_ENABLE(qobuz,
AS_HELP_STRING([--enable-qobuz],
[enable support for Qobuz streaming]),,
[enable_qobuz=auto])
AC_ARG_ENABLE(soundcloud,
AS_HELP_STRING([--enable-soundcloud],
[enable support for soundcloud.com]),,
[enable_soundcloud=auto])
AC_ARG_ENABLE(tidal,
AS_HELP_STRING([--enable-tidal],
[enable support for Tidal streaming]),,
[enable_tidal=auto])
AC_ARG_ENABLE([libwrap],
AS_HELP_STRING([--enable-libwrap], [use libwrap]),,
[enable_libwrap=auto])
AC_ARG_ENABLE(openal,
AS_HELP_STRING([--enable-openal],
[enable OpenAL support (default: auto)]),,
enable_openal=auto)
AC_ARG_ENABLE(oss,
AS_HELP_STRING([--disable-oss],
[disable OSS support (default: enable)]),,
enable_oss=yes)
AC_ARG_ENABLE(osx,
AS_HELP_STRING([--enable-osx],
[enable the OS X output plugin - unsupported! (default: disable)]),,
enable_osx=no)
AC_ARG_ENABLE(pipe-output,
AS_HELP_STRING([--enable-pipe-output],
[enable support for writing audio to a pipe (default: disable)]),,
enable_pipe_output=no)
AC_ARG_ENABLE(recorder-output,
AS_HELP_STRING([--enable-recorder-output],
[enables the recorder file output plugin (default: disable)]),,
[enable_recorder_output=auto])
AC_ARG_ENABLE(sidplay,
AS_HELP_STRING([--enable-sidplay],
[enable C64 SID support via libsidplayfp or libsidplay2]),,
enable_sidplay=auto)
AC_ARG_ENABLE(shout,
AS_HELP_STRING([--enable-shout],
[enables the shoutcast streaming output]),,
[enable_shout=auto])
AC_ARG_ENABLE(solaris_output,
AS_HELP_STRING([--enable-solaris-output],
[enables the Solaris /dev/audio output]),,
[enable_solaris_output=$host_is_solaris])
AC_ARG_ENABLE(tcp,
AS_HELP_STRING([--disable-tcp],
[disable support for clients connecting via TCP (default: enable)]),,
[enable_tcp=yes])
AC_ARG_ENABLE(test,
AS_HELP_STRING([--enable-test],
[build the test programs (default: disabled)]),,
enable_test=no)
AC_ARG_ENABLE(un,
AS_HELP_STRING([--disable-un],
[disable support for clients connecting via unix domain sockets (default: enable)]),,
[enable_un=$host_is_unix])
AC_ARG_ENABLE(vorbis,
AS_HELP_STRING([--enable-vorbis],
[enable Ogg Vorbis decoder]),,
enable_vorbis=auto)
AC_ARG_ENABLE(wave-encoder,
AS_HELP_STRING([--enable-wave-encoder],
[enable the PCM wave encoder]),,
enable_wave_encoder=yes)
AC_ARG_ENABLE(werror,
AS_HELP_STRING([--enable-werror],
[treat warnings as errors (default: disabled)]),,
enable_werror=no)
AC_ARG_WITH(zeroconf,
AS_HELP_STRING([--with-zeroconf=@<:@auto|avahi|bonjour|no@:>@],
[enable zeroconf backend (default=auto)]),,
with_zeroconf="auto")
dnl ---------------------------------------------------------------------------
dnl Mandatory Libraries
dnl ---------------------------------------------------------------------------
AX_BOOST_BASE([1.58],, [AC_MSG_ERROR([Boost not found])])
AC_ARG_ENABLE(icu,
AS_HELP_STRING([--enable-icu],
[enable libicu for Unicode (default: auto)]),,
enable_icu=auto)
MPD_AUTO_PKG(icu, ICU, [icu-i18n >= 50], [libicu], [libicu not found])
MPD_DEFINE_CONDITIONAL(enable_icu, HAVE_ICU, [libicu])
AC_ARG_ENABLE(iconv,
AS_HELP_STRING([--enable-iconv],
[enable iconv for character set conversion (default: auto)]),,
enable_iconv=yes)
if test x$enable_icu = xyes; then
dnl We don't need iconv() if we have libicu
enable_iconv=no
fi
if test x$enable_iconv = xyes; then
AC_CHECK_FUNCS(iconv)
fi
dnl ---------------------------------------------------------------------------
dnl Protocol Options
dnl ---------------------------------------------------------------------------
if test x$enable_tcp = xno; then
# if we don't support TCP, we don't need IPv6 either
enable_ipv6=no
fi
if test x$enable_ipv6 = xyes; then
AC_MSG_CHECKING(for ipv6)
AC_EGREP_CPP([AP_maGiC_VALUE],
[
#include <sys/types.h>
#ifdef _WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#endif
#include <netdb.h>
#ifdef PF_INET6
#ifdef AF_INET6
AP_maGiC_VALUE
#endif
#endif
],
AC_DEFINE(HAVE_IPV6, 1, [Define if IPv6 support present])
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
)
fi
if test x$enable_tcp = xyes; then
AC_DEFINE(HAVE_TCP, 1, [Define if TCP socket support is enabled])
fi
if test x$enable_un = xyes; then
AC_DEFINE(HAVE_UN, 1, [Define if unix domain socket support is enabled])
STRUCT_UCRED
AC_CHECK_FUNCS(getpeereid)
fi
dnl --------------------------- Post Protocol Tests ---------------------------
if
test x$enable_tcp = xno &&
test x$enable_un = xno; then
AC_MSG_ERROR([No client interfaces configured!])
fi
MPD_ENABLE_AUTO(systemd_daemon, SYSTEMD_DAEMON, [systemd socket activation],
[libsystemd not found], [$linux_auto], [
dnl Check for libsystemd and fall back to (the older)
dnl libsystemd-daemon
PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
[found_systemd_daemon=yes],
[PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
[found_systemd_daemon=yes],
[found_systemd_daemon=no])])
])
dnl ---------------------------------------------------------------------------
dnl LIBC Features
dnl ---------------------------------------------------------------------------
if test x$enable_largefile != xno; then
AC_DEFINE([ENABLE_LARGEFILE], 1, [Define if large file support is enabled])
fi
dnl ---------------------------------------------------------------------------
dnl Miscellaneous Libraries
dnl ---------------------------------------------------------------------------
dnl -------------------------------- libmpdclient --------------------------------
MPD_ENABLE_AUTO_PKG_DEPENDS(libmpdclient, LIBMPDCLIENT,
[libmpdclient >= 2.9],
[MPD client library], [libmpdclient not found], [],
[enable_database], [Database support is disabled])
dnl -------------------------------- expat --------------------------------
MPD_ENABLE_AUTO_PKG(expat, EXPAT, [expat],
[expat XML parser], [expat not found])
dnl -------------------------------- libgcrypt --------------------------------
if test x$enable_qobuz != xno; then
AM_PATH_LIBGCRYPT([1], [found_gcrypt=yes], [found_gcrypt=no])
fi
dnl -------------------------------- yajl -------------------------------------
if test x$enable_qobuz != xno || test x$enable_soundcloud != xno || test x$enable_tidal != xno; then
PKG_CHECK_MODULES([YAJL], [yajl >= 2.0],
[found_yajl=yes],
[found_yajl=no])
fi
dnl --------------------------------- inotify ---------------------------------
if test x$host_is_linux = xno; then
enable_inotify=no
fi
MPD_DEFINE_CONDITIONAL(enable_inotify, ENABLE_INOTIFY, [inotify support])
dnl --------------------------------- libwrap ---------------------------------
if test x$enable_libwrap != xno; then
AC_CHECK_LIBWRAP(found_libwrap=yes, found_libwrap=no)
if test x$found_libwrap = xyes; then
dnl See if libwrap is compatible with C++; it is
dnl broken on many systems
AC_MSG_CHECKING(whether libwrap is compatible with C++)
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#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);
}
])],
AC_MSG_RESULT([yes]),
[found_libwrap=no; AC_MSG_RESULT([no]);
AC_MSG_WARN([Your version of libwrap is broken with C++])])
AC_LANG_POP
fi
MPD_AUTO_RESULT(libwrap, libwrap, [libwrap not found])
fi
if test x$enable_libwrap = xyes; then
AC_SUBST(LIBWRAP_CFLAGS)
AC_SUBST(LIBWRAP_LDFLAGS)
AC_DEFINE(HAVE_LIBWRAP, 1, [define to enable libwrap library])
fi
dnl ---------------------------------------------------------------------------
dnl D-Bus
dnl ---------------------------------------------------------------------------
MPD_ENABLE_AUTO_PKG(dbus, DBUS, [dbus-1], [D-Bus support], [dbus-1 not found])
AC_ARG_ENABLE(udisks,
AS_HELP_STRING([--enable-udisks],
[support for removable media via udisks2]),,
[enable_udisks=auto])
MPD_DEPENDS([enable_udisks], [found_dbus], [support for removable media via udisks2], [dbus-1 not found])
MPD_AUTO(udisks, [support for removable media via udisks2], [udisks not available], [found_udisks=yes])
MPD_DEFINE_CONDITIONAL(enable_udisks, ENABLE_UDISKS, [support for removable media via udisks2])
dnl ---------------------------------------------------------------------------
dnl Metadata Plugins
dnl ---------------------------------------------------------------------------
dnl -------------------------------- libid3tag --------------------------------
MPD_ENABLE_AUTO_PKG_LIB(id3, ID3TAG,
id3tag, id3tag, id3_file_open, [-lid3tag -lz], [],
[ID3 support using libid3tag], [libid3tag not found])
dnl ---------------------------------------------------------------------------
dnl Autodiscovery
dnl ---------------------------------------------------------------------------
dnl --------------------------------- zeroconf --------------------------------
case $with_zeroconf in
no|bonjour)
enable_avahi=no
;;
avahi)
enable_avahi=yes
;;
*)
with_zeroconf=auto
enable_avahi=auto
;;
esac
MPD_AUTO_PKG(avahi, AVAHI, [avahi-client dbus-1],
[avahi client library], [avahi-client not found])
if test x$enable_avahi = xyes; then
with_zeroconf=avahi
fi
MPD_DEFINE_CONDITIONAL(enable_avahi, HAVE_AVAHI, [Avahi Zeroconf])
enable_bounjour=no
if test x$with_zeroconf != xno; then
if test x$with_zeroconf = xbonjour || test x$with_zeroconf = xauto; then
AC_CHECK_HEADER(dns_sd.h,
[enable_bonjour=yes;AC_DEFINE([HAVE_BONJOUR], 1, [Define to enable Bonjour Zeroconf support])])
AC_CHECK_LIB([dns_sd], [DNSServiceRegister])
fi
if test x$enable_bonjour = xyes; then
with_zeroconf=bonjour
elif test x$with_zeroconf = xbonjour; then
AC_MSG_ERROR([Bonjour support requested but not found])
fi
if test x$with_zeroconf = xauto; then
AC_MSG_WARN([No supported Zeroconf backend found, disabling Zeroconf])
with_zeroconf=no
else
AC_DEFINE([HAVE_ZEROCONF], 1, [Define to enable Zeroconf support])
fi
fi
AM_CONDITIONAL(HAVE_ZEROCONF, test x$with_zeroconf != xno)
AM_CONDITIONAL(HAVE_BONJOUR, test x$with_zeroconf = xbonjour)
dnl ---------------------------------------------------------------------------
dnl Sticker Database
dnl ---------------------------------------------------------------------------
dnl ---------------------------------- sqlite ---------------------------------
MPD_ENABLE_AUTO_PKG(sqlite, SQLITE, [sqlite3 >= 3.7.3],
[SQLite database support], [sqlite not found],
[$database_auto])
dnl ---------------------------------------------------------------------------
dnl Converter Plugins
dnl ---------------------------------------------------------------------------
dnl ------------------------------ libsamplerate ------------------------------
MPD_ENABLE_AUTO_PKG(lsr, LIBSAMPLERATE, [samplerate >= 0.1.3],
[libsamplerate resampling], [libsamplerate not found])
dnl ------------------------------ libsoxr ------------------------------------
MPD_ENABLE_AUTO_PKG(soxr, SOXR, [soxr],
[libsoxr resampler], [libsoxr not found])
dnl ---------------------------------------------------------------------------
dnl Input Plugins
dnl ---------------------------------------------------------------------------
dnl ----------------------------------- CURL ----------------------------------
MPD_ENABLE_AUTO_PKG(curl, CURL, [libcurl >= 7.18],
[libcurl HTTP streaming], [libcurl not found])
dnl ----------------------------------- smbclient -----------------------------
MPD_ENABLE_AUTO_PKG_LIB(smbclient, SMBCLIENT, [smbclient >= 0.2],
[smbclient], [smbc_init], [-lsmbclient], [],
[smbclient input plugin], [libsmbclient not found])
dnl ----------------------------------- NFS -----------------------------
MPD_ENABLE_AUTO_PKG(nfs, NFS, [libnfs >= 1.11],
[NFS input plugin], [libnfs not found])
dnl --------------------------------- Qobuz -----------------------------------
MPD_DEPENDS([enable_qobuz], [found_yajl], [Qobuz streaming], [libyajl not found])
MPD_DEPENDS([enable_qobuz], [found_gcrypt], [Qobuz streaming], [libgcrypt not found])
MPD_DEPENDS([enable_qobuz], [enable_curl], [Qobuz streaming], [libcurl not found])
MPD_AUTO(qobuz, [Qobuz streaming], [Qobuz not available], [found_qobuz=yes])
MPD_DEFINE_CONDITIONAL(enable_qobuz, ENABLE_QOBUZ, [Qobuz streaming])
dnl --------------------------------- Soundcloud ------------------------------
MPD_DEPENDS([enable_soundcloud], [found_yajl],
[soundcloud.com support], [libyajl not found])
MPD_DEFINE_CONDITIONAL(enable_soundcloud, ENABLE_SOUNDCLOUD,
[soundcloud.com support])
dnl --------------------------------- Tidal -----------------------------------
MPD_DEPENDS([enable_tidal], [found_yajl], [Tidal streaming], [libyajl not found])
MPD_DEPENDS([enable_tidal], [enable_curl], [Tidal streaming], [libcurl not found])
MPD_AUTO(tidal, [Tidal streaming], [Tidal not available], [found_tidal=yes])
MPD_DEFINE_CONDITIONAL(enable_tidal, ENABLE_TIDAL, [Tidal streaming])
dnl ---------------------------------- cdio ---------------------------------
MPD_ENABLE_AUTO_PKG(cdio_paranoia, CDIO_PARANOIA, [libcdio_paranoia],
[libcdio_paranoia input plugin], [libcdio_paranoia not found])
if test x$enable_cdio_paranoia = xyes; then
AC_CHECK_HEADERS(cdio/paranoia/paranoia.h)
fi
MPD_ENABLE_AUTO_PKG(mms, MMS, [libmms >= 0.4],
[libmms mms:// protocol support], [libmms not found])
dnl ---------------------------------------------------------------------------
dnl Storage Plugins
dnl ---------------------------------------------------------------------------
MPD_ENABLE_AUTO(webdav, WEBDAV, [WebDAV storage plugin],
[WebDAV requires libcurl and libexpat],
[auto],
[if test x$enable_curl = xyes && test x$enable_expat = xyes; then
found_webdav=yes
else
found_webdav=no
fi])
dnl ---------------------------------------------------------------------------
dnl Playlist Plugins
dnl ---------------------------------------------------------------------------
MPD_ARG_ENABLE(cue, CUE, [CUE sheet parser], yes)
dnl ---------------------------------------------------------------------------
dnl Neighbor Plugins
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(neighbor-plugins,
AS_HELP_STRING([--enable-neighbor-plugins],
[enable support for neighbor discovery (default: auto)]),,
[enable_neighbor_plugins=auto])
if test x$enable_neighbor_plugins = xauto; then
if test x$enable_smbclient = xyes; then
enable_neighbor_plugins=yes
fi
if test x$enable_upnp = xyes; then
enable_neighbor_plugins=yes
fi
if test x$enable_udisks = xyes; then
enable_neighbor_plugins=yes
fi
fi
MPD_DEFINE_CONDITIONAL(enable_neighbor_plugins, ENABLE_NEIGHBOR_PLUGINS,
[neighbor discovery])
dnl ---------------------------------------------------------------------------
dnl Archive Plugins
dnl ---------------------------------------------------------------------------
dnl --------------------------------- iso9660 ---------------------------------
MPD_ENABLE_AUTO_PKG(iso9660, ISO9660, [libiso9660],
[libiso9660 archive plugin], [libiso9660 not found])
if test x$enable_iso9660 = xyes; then
AC_PATH_PROG(MKISOFS, mkisofs, no)
else
MKISOFS="no"
fi
AM_CONDITIONAL(ENABLE_ISO9660_TEST, test x$MKISOFS != xno)
dnl ---------------------------------- zlib ---------------------------------
MPD_ENABLE_AUTO_PKG(zlib, ZLIB, [zlib],
[zlib support], [zlib not found])
dnl ---------------------------------- libbz2 ---------------------------------
MPD_ENABLE_AUTO_LIB(bzip2, BZ2, bz2, BZ2_bzDecompressInit, [-lbz2], [],
[bzip2 archive plugin], [libbz2 not found])
if test x$enable_bzip2 = xyes; then
AC_PATH_PROG(BZIP2, bzip2, no)
else
BZIP2="no"
fi
AM_CONDITIONAL(ENABLE_BZIP2_TEST, test x$BZIP2 != xno)
dnl ---------------------------------- libupnp ---------------------------------
MPD_ENABLE_AUTO_PKG_DEPENDS(upnp, UPNP, [libupnp],
[UPnP client support], [libupnp not found], [],
[enable_database], [Database support is disabled], [
MPD_DEPENDS([enable_upnp], [enable_curl],
[UPnP client support],
[UPnP requires CURL])
MPD_DEPENDS([enable_upnp], [enable_expat],
[UPnP client support],
[UPnP requires expat])
]
)
dnl --------------------------------- libzzip ---------------------------------
MPD_ENABLE_AUTO_PKG(zzip, ZZIP, [zziplib >= 0.13],
[libzzip archive library], [libzzip not found],
[no])
if test x$enable_zzip = xyes; then
AC_PATH_PROG(ZIP, zip, no)
else
ZIP="no"
fi
AM_CONDITIONAL(ENABLE_ZZIP_TEST, test x$ZIP != xno)
dnl ------------------------------- Archive API -------------------------------
if
test x$enable_bzip2 = xyes ||
test x$enable_zzip = xyes ||
test x$enable_iso9660 = xyes; then
enable_archive=yes
else
enable_archive=no
fi
MPD_DEFINE_CONDITIONAL(enable_archive, ENABLE_ARCHIVE, [the archive API])
dnl ---------------------------------------------------------------------------
dnl Decoder Plugins
dnl ---------------------------------------------------------------------------
dnl -------------------------------- libadplug --------------------------------
MPD_ENABLE_AUTO_PKG(adplug, ADPLUG, [adplug],
[AdPlug decoder plugin], [libadplug not found])
dnl -------------------------------- audiofile --------------------------------
MPD_ENABLE_AUTO_PKG(audiofile, AUDIOFILE, [audiofile >= 0.3],
[audiofile decoder plugin], [libaudiofile not found])
dnl ----------------------------------- DSD -----------------------------------
MPD_DEFINE_CONDITIONAL(enable_dsd, ENABLE_DSD, [DSD decoder])
dnl ----------------------------------- FAAD ----------------------------------
MPD_ENABLE_AUTO_LIB(aac, FAAD, faad, NeAACDecOpen, [-lfaad], [],
[FAAD decoder plugin], [libfaad not found])
dnl ---------------------------------- ffmpeg ---------------------------------
MPD_ENABLE_AUTO_PKG(ffmpeg, FFMPEG,
[libavformat >= 56.1 libavcodec >= 56.1 libavutil >= 54.3],
[ffmpeg decoder library], [libavformat+libavcodec+libavutil not found])
dnl ----------------------------------- FLAC ----------------------------------
MPD_ENABLE_AUTO_PKG(flac, FLAC, [flac >= 1.2],
[FLAC decoder], [libFLAC not found])
enable_flac_encoder=$enable_flac
dnl -------------------------------- FluidSynth -------------------------------
MPD_ENABLE_AUTO_PKG(fluidsynth, FLUIDSYNTH, [fluidsynth >= 1.1],
[fluidsynth MIDI decoder plugin], [fluidsynth not found])
dnl ---------------------------------- libgme ---------------------------------
MPD_ENABLE_AUTO_PKG_LIB(gme, GME, [libgme],
gme, gme_open_file, [-lgme], [],
[Game Music Emulator decoder plugin], [libgme not found])
dnl ---------------------------------- libmad ---------------------------------
MPD_ENABLE_AUTO_PKG_LIB(mad, MAD, [mad],
mad, mad_stream_init, [-lmad], [],
[libmad MP3 decoder plugin], [libmad not found])
enable_shout2="$enable_shout"
MPD_AUTO_PKG(shout, SHOUT, [shout],
[shout output plugin], [libshout not found])
if test x$enable_shout = xyes && test x$enable_shout2 = xauto; then
enable_shout=auto
fi
dnl -------------------------------- libmpg123 --------------------------------
MPD_ENABLE_AUTO_PKG(mpg123, MPG123, [libmpg123],
[libmpg123 decoder plugin], [libmpg123 not found])
dnl -------------------------------- libmikmod --------------------------------
MPD_ENABLE_AUTO_PKG(mikmod, LIBMIKMOD, [libmikmod >= 3.2],
[MikMod decoder plugin], [libmikmod not found])
dnl -------------------------------- libmodplug -------------------------------
MPD_ENABLE_AUTO_PKG(modplug, MODPLUG, [libmodplug],
[modplug decoder plugin], [libmodplug not found])
dnl -------------------------------- libopus ----------------------------------
MPD_ENABLE_AUTO_PKG(opus, OPUS, [opus ogg],
[opus decoder plugin], [libopus not found])
dnl -------------------------------- libsndfile -------------------------------
dnl See above test, which may disable this.
MPD_ENABLE_AUTO_PKG(sndfile, SNDFILE, [sndfile],
[libsndfile decoder plugin], [libsndfile not found])
dnl --------------------------------- musepack --------------------------------
MPD_ENABLE_AUTO_LIB(mpc, MPCDEC, mpcdec, mpc_demux_init, [-lmpcdec], [],
[Musepack decoder plugin], [libmpcdec not found])
dnl -------------------------------- Ogg Tremor -------------------------------
AC_ARG_WITH(tremor,
AS_HELP_STRING([--with-tremor=PFX],
[use Tremor (vorbisidec) integer Ogg Vorbis decoder (with optional prefix)]),,
with_tremor=no)
AC_ARG_VAR([TREMOR_CFLAGS], [C compiler flags for Tremor])
AC_ARG_VAR([TREMOR_LIBS], [linker flags for Tremor])
if test x$with_tremor = xyes || test x$with_tremor = xno; then
enable_tremor="$with_tremor"
tremor_prefix=""
else
tremor_prefix="$with_tremor"
enable_tremor=yes
fi
if test x$enable_tremor = xyes; then
if test x$TREMOR_CFLAGS = x && test x$tremor_prefix != x; then
TREMOR_CFLAGS="-I$tremor_prefix/include"
fi
if test x$TREMOR_LIBS = x; then
TREMOR_LIBS="-lvorbisidec"
if test x$tremor_prefix != x; then
TREMOR_LIBS="-L$tremor_prefix/lib $TREMOR_LIBS"
fi
fi
MPD_WITH_LIBRARY([TREMOR],
[AC_CHECK_FUNC([ov_read],,
[AC_MSG_ERROR([libvorbisidec not found])])])
AC_DEFINE(HAVE_TREMOR,1,
[Define to use tremor (libvorbisidec) for ogg support])
AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support])
else
TREMOR_CFLAGS=
TREMOR_LIBS=
fi
dnl -------------------------------- Ogg Vorbis -------------------------------
if test x$enable_tremor = xyes; then
if test x$enable_vorbis = xyes; then
AC_MSG_WARN(["OggTremor detected, could not enable Vorbis."])
fi
enable_vorbis=no
if test x$enable_vorbis_encoder = xauto; then
AC_MSG_WARN([OggTremor detected, disabling the Vorbis encoder plugin.])
enable_vorbis_encoder=no
fi
fi
MPD_AUTO_PKG(vorbis, VORBIS, [vorbis ogg],
[Ogg Vorbis decoder], [libvorbis not found])
if test x$enable_vorbis = xyes; then
AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support])
fi
AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes || test x$enable_tremor = xyes)
dnl --------------------------------- sidplay ---------------------------------
if test x$enable_sidplay != xno; then
dnl Check for libsidplayfp first
PKG_CHECK_MODULES([SIDPLAY], [libsidplayfp],
[found_sidplayfp=yes],
[found_sidplayfp=no])
found_sidplay=$found_sidplayfp
fi
if test x$enable_sidplay != xno && test x$found_sidplayfp = xno; then
PKG_CHECK_MODULES([SIDPLAY], [libsidplay2 libsidutils],
[found_sidplay=yes],
[found_sidplay=no])
MPD_AUTO_PRE(sidplay, [sidplay decoder plugin],
[libsidplay2 or libsidutils not found])
fi
if test x$enable_sidplay != xno && test x$found_sidplayfp = xno; then
AC_CHECK_LIB([resid-builder], [main],
[found_sidplay=yes], [found_sidplay=no])
MPD_AUTO_RESULT(sidplay, [sidplay decoder plugin],
[libresid-builder not found])
fi
if test x$enable_sidplay = xyes; then
AC_DEFINE(ENABLE_SIDPLAY, 1, [Define for libsidplayfp or libsidplay2 support])
if test x$found_sidplayfp = xyes; then
AC_DEFINE(HAVE_SIDPLAYFP, 1, [Define if libsidplayfp is used instead of libsidplay2])
else
SIDPLAY_LIBS="$SIDPLAY_LIBS -lresid-builder"
fi
fi
AM_CONDITIONAL(ENABLE_SIDPLAY, test x$enable_sidplay = xyes)
dnl --------------------------------- wavpack ---------------------------------
MPD_ENABLE_AUTO_PKG(wavpack, WAVPACK, [wavpack],
[WavPack decoder plugin], [libwavpack not found])
dnl --------------------------------- WildMidi --------------------------------
MPD_ENABLE_AUTO_LIB(wildmidi, WILDMIDI, WildMidi, WildMidi_Init, [-lWildMidi], [],
[WildMidi decoder plugin], [libwildmidi not found])
dnl ---------------------------------------------------------------------------
dnl Encoders for Streaming Audio Output Plugins
dnl ---------------------------------------------------------------------------
dnl ------------------------------- Encoder API -------------------------------
if test x$enable_shout = xyes || \
test x$enable_recorder_output = xyes || \
test x$enable_httpd_output = xyes; then
# at least one output using encoders is explicitly enabled
need_encoder=yes
elif test x$enable_shout = xauto || \
test x$enable_recorder_output = xauto || \
test x$enable_httpd_output = xauto; then
need_encoder=auto
else
# all outputs using encoders are disabled
need_encoder=no
# don't bother to check for encoder plugins
enable_vorbis_encoder=no
enable_lame_encoder=no
enable_twolame_encoder=no
enable_shine_encoder=no
enable_wave_encoder=no
enable_flac_encoder=no
fi
dnl ------------------------------- FLAC Encoder ------------------------------
MPD_DEFINE_CONDITIONAL(enable_flac_encoder, ENABLE_FLAC_ENCODER,
[FLAC encoder plugin])
dnl ------------------------------- Shine Encoder ------------------------------
MPD_ENABLE_AUTO_PKG(shine_encoder, SHINE, [shine >= 3.1],
[shine encoder], [libshine not found])
dnl ---------------------------- Ogg Vorbis Encoder ---------------------------
MPD_ENABLE_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc vorbis ogg],
[Ogg Vorbis encoder], [libvorbisenc not found])
dnl ------------------------------- LAME Encoder ------------------------------
MPD_ENABLE_AUTO_LIB(lame_encoder, LAME, mp3lame, lame_init, [-lmp3lame], [],
[LAME encoder plugin], [libmp3lame not found])
dnl ----------------------------- TwoLAME Encoder -----------------------------
MPD_ENABLE_AUTO_PKG(twolame_encoder, TWOLAME, [twolame],
[TwoLAME encoder plugin], [libtwolame not found])
dnl ------------------------------- WAVE Encoder ------------------------------
MPD_DEFINE_CONDITIONAL(enable_wave_encoder, ENABLE_WAVE_ENCODER,
[PCM wave encoder plugin])
dnl --------------------------- encoder plugins test --------------------------
if test x$enable_vorbis_encoder != xno ||
test x$enable_opus != xno ||
test x$enable_lame_encoder != xno ||
test x$enable_twolame_encoder != xno ||
test x$enable_flac_encoder != xno ||
test x$enable_shine_encoder != xno ||
test x$enable_wave_encoder != xno; then
# at least one encoder plugin is enabled
enable_encoder=yes
else
# no encoder plugin is enabled: disable the whole encoder API
enable_encoder=no
if test x$need_encoder = xyes; then
AC_MSG_ERROR([No encoder plugin found])
fi
fi
MPD_DEFINE_CONDITIONAL(enable_encoder, ENABLE_ENCODER,
[the encoder plugins])
dnl ---------------------------------------------------------------------------
dnl Audio Output Plugins
dnl ---------------------------------------------------------------------------
dnl ----------------------------------- ALSA ----------------------------------
MPD_ENABLE_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0],
[ALSA output plugin], [libasound not found],
[$linux_auto])
dnl ----------------------------------- ROAR ----------------------------------
MPD_ENABLE_AUTO_PKG(roar, ROAR, [libroar >= 0.4.0],
[RoarAudio output plugin], [libroar not found])
dnl ----------------------------------- FIFO ----------------------------------
if test x$enable_fifo = xyes; then
AC_CHECK_FUNC([mkfifo],
[enable_fifo=yes],
[enable_fifo=no;AC_MSG_WARN([mkfifo not found -- disabling support for writing audio to a FIFO])])
fi
MPD_DEFINE_CONDITIONAL(enable_fifo, HAVE_FIFO,
[support for writing audio to a FIFO])
dnl ----------------------------------- SNDIO ----------------------------------
MPD_ARG_ENABLE([sndio], [SNDIO], [sndio output plugin], [], [
AC_SUBST([SNDIO_LIBS], [])
AC_SUBST([SNDIO_CFLAGS], [])
found_sndio=no
MPD_AUTO([sndio], [SNDIO], [sndio output plugin],
[AC_CHECK_HEADER([sndio.h],
[AC_PREPROC_IFELSE(
[AC_LANG_PROGRAM([
#include <sndio.h>
#ifdef ROAR_VERSION
#error libroarsndio not supported
#endif
])],
[found_sndio=yes SNDIO_LIBS='-lsndio' SNDIO_CFLAGS=''],
[AC_MSG_WARN([Found libroarsndio, which is known to be broken; ignoring it.])],
)]
)]
)
])
dnl ----------------------------------- Haiku ---------------------------------
MPD_ENABLE_AUTO_HEADER([haiku], [HAIKU], [media/MediaDefs.h],
[-lbe -lmedia], [],
[Haiku output plugin],
[Haiku headers not found])
dnl ------------------------------- HTTPD Output ------------------------------
if test x$enable_httpd_output = xauto; then
# handle HTTPD auto-detection: disable if no encoder is
# available
if test x$enable_encoder = xyes; then
enable_httpd_output=yes
else
AC_MSG_WARN([No encoder plugin -- disabling the HTTP output plugin])
enable_httpd_output=no
fi
fi
MPD_DEFINE_CONDITIONAL(enable_httpd_output, ENABLE_HTTPD_OUTPUT,
[the HTTP server output])
dnl ----------------------------------- JACK ----------------------------------
MPD_ENABLE_AUTO_PKG(jack, JACK, [jack >= 0.100],
[JACK output plugin], [libjack not found])
if test x$enable_jack = xyes; then
# check whether jack_set_info_function() is available
old_LIBS=$LIBS
LIBS="$LIBS $JACK_LIBS"
AC_CHECK_FUNCS(jack_set_info_function)
LIBS=$old_LIBS
fi
dnl ---------------------------------- libao ----------------------------------
MPD_ENABLE_AUTO_PKG(ao, AO, [ao],
[libao output plugin], [libao not found])
dnl ---------------------------------- OpenAL ---------------------------------
AC_SUBST(OPENAL_CFLAGS,"")
AC_SUBST(OPENAL_LIBS,"")
if test x$host_is_darwin = xyes; then
if test x$enable_openal != xno; then
AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h],
[found_openal=yes], [found_openal=no])
fi
MPD_AUTO_RESULT(openal, [OpenAL output plugin], [OpenAL not found])
if test x$enable_openal = xyes; then
OPENAL_LIBS="-framework OpenAL"
fi
else
MPD_AUTO_PKG(openal, [OPENAL], [openal],
[OpenAL output plugin], [OpenAL not found])
fi
MPD_DEFINE_CONDITIONAL(enable_openal, HAVE_OPENAL, [OpenAL support])
dnl ---------------------------- Open Sound System ----------------------------
if test x$enable_oss = xyes; then
AC_CHECK_HEADER(sys/soundcard.h,
[enable_oss=yes],
[AC_MSG_WARN(Soundcard headers not found -- disabling OSS support);
enable_oss=no])
fi
MPD_DEFINE_CONDITIONAL(enable_oss, HAVE_OSS, [Open Sound System])
dnl ----------------------------------- OSX -----------------------------------
if test x$enable_osx = xyes; then
AC_DEFINE(HAVE_OSX, 1, [Define for compiling OS X support])
LIBS="$LIBS -framework AudioUnit -framework CoreAudio -framework CoreServices"
fi
AM_CONDITIONAL(HAVE_OSX, test x$enable_osx = xyes)
dnl ------------------------------- Pipe Output -------------------------------
MPD_DEFINE_CONDITIONAL(enable_pipe_output, ENABLE_PIPE_OUTPUT,
[support for writing audio to a pipe])
dnl -------------------------------- PulseAudio -------------------------------
MPD_ENABLE_AUTO_PKG(pulse, PULSE, [libpulse >= 0.9.16],
[PulseAudio output plugin], [libpulse not found])
dnl --------------------------------- Recorder --------------------------------
if test x$enable_recorder_output = xauto; then
# handle recorder auto-detection: disable if no encoder is
# available
if test x$enable_encoder = xyes; then
enable_recorder_output=yes
else
AC_MSG_WARN([No encoder plugin -- disabling the recorder output plugin])
enable_recorder_output=no
fi
fi
MPD_DEFINE_CONDITIONAL(enable_recorder_output, ENABLE_RECORDER_OUTPUT,
[the recorder output])
dnl -------------------------------- SHOUTcast --------------------------------
if test x$enable_shout = xauto; then
# handle shout auto-detection: disable if no encoder is
# available
if test x$enable_encoder = xyes; then
enable_shout=yes
else
AC_MSG_WARN([No encoder plugin -- disabling the shout output plugin])
enable_shout=no
fi
fi
MPD_DEFINE_CONDITIONAL(enable_shout, HAVE_SHOUT,
[shoutcast output])
dnl --------------------------------- Solaris ---------------------------------
MPD_DEFINE_CONDITIONAL(enable_solaris_output, ENABLE_SOLARIS_OUTPUT,
[Solaris /dev/audio support])
dnl --------------------------------- WinMM ---------------------------------
if test "x$host_is_windows" = xyes; then
AC_DEFINE(ENABLE_WINMM_OUTPUT, 1, [Define to enable WinMM support])
enable_winmm_output=yes
LIBS="$LIBS -lwinmm"
else
enable_winmm_output=no
fi
AM_CONDITIONAL(ENABLE_WINMM_OUTPUT, test x$enable_winmm_output = xyes)
dnl ---------------------------------------------------------------------------
dnl Option groups
dnl ---------------------------------------------------------------------------
have_ogg=no
if test x$enable_vorbis = xyes || test x$enable_tremor = xyes || test x$enable_opus = xyes || test x$enable_vorbis_encoder = xyes; then
have_ogg=yes
fi
have_xiph=no
if test x$have_ogg = xyes || test x$enable_flac = xyes || test x$enable_flac_encoder = xyes; then
have_xiph=yes
fi
if test x$have_ogg = xyes; then
PKG_CHECK_MODULES([OGG], [ogg],, [AC_MSG_ERROR([libogg not found])])
fi
AM_CONDITIONAL(HAVE_OGG, test x$have_ogg = xyes)
AM_CONDITIONAL(HAVE_XIPH, test x$have_xiph = xyes)
dnl ---------------------------------------------------------------------------
dnl Documentation
dnl ---------------------------------------------------------------------------
if test x$enable_documentation = xyes; then
AC_PATH_PROG(SPHINX, sphinx-build)
if test x$SPHINX = x; then
AC_MSG_ERROR([sphinx-build not found])
fi
AC_SUBST(SPHINX)
AC_PATH_PROG(XMLTO, xmlto)
if test x$XMLTO = x; then
AC_MSG_ERROR([xmlto not found])
fi
AC_SUBST(XMLTO)
AC_PATH_PROG(DOXYGEN, doxygen)
if test x$DOXYGEN = x; then
AC_MSG_ERROR([doxygen not found])
fi
AC_SUBST(DOXYGEN)
fi
AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
dnl ---------------------------------------------------------------------------
dnl test suite
dnl ---------------------------------------------------------------------------
if test "x$enable_test" = xyes; then
PKG_CHECK_MODULES([CPPUNIT], [cppunit],,
[AC_MSG_ERROR([cppunit not found])])
fi
AM_CONDITIONAL(ENABLE_TEST, test "x$enable_test" = xyes)
dnl ---------------------------------------------------------------------------
dnl CFLAGS
dnl ---------------------------------------------------------------------------
dnl ---------------------------- warnings as errors ---------------------------
if test "x$enable_werror" = xyes; then
CFLAGS="$CFLAGS -Werror -pedantic-errors"
CXXFLAGS="$CXXFLAGS -Werror"
fi
dnl ---------------------------- language features ----------------------------
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AX_APPEND_COMPILE_FLAGS([-ffast-math])
AX_APPEND_COMPILE_FLAGS([-ftree-vectorize])
AC_LANG_PUSH([C++])
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AX_APPEND_COMPILE_FLAGS([-fno-threadsafe-statics])
AX_APPEND_COMPILE_FLAGS([-fmerge-all-constants])
AX_APPEND_COMPILE_FLAGS([-ffast-math])
AX_APPEND_COMPILE_FLAGS([-ftree-vectorize])
AC_LANG_POP
dnl ---------------------------------- debug ----------------------------------
if test "x$enable_debug" = xno; then
AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"
AX_APPEND_COMPILE_FLAGS([-ffunction-sections])
AX_APPEND_COMPILE_FLAGS([-fdata-sections])
AC_LANG_PUSH([C++])
AX_APPEND_COMPILE_FLAGS([-ffunction-sections])
AX_APPEND_COMPILE_FLAGS([-fdata-sections])
AC_LANG_POP
AX_APPEND_LINK_FLAGS([-Wl,--gc-sections])
fi
dnl ----------------------------------- GCC -----------------------------------
if test x$GCC = xyes
then
AX_APPEND_COMPILE_FLAGS([-Wall])
AX_APPEND_COMPILE_FLAGS([-Wextra])
AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes])
AX_APPEND_COMPILE_FLAGS([-Wshadow])
AX_APPEND_COMPILE_FLAGS([-Wpointer-arith])
AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes])
AX_APPEND_COMPILE_FLAGS([-Wcast-qual])
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
AX_APPEND_COMPILE_FLAGS([-pedantic])
AC_LANG_PUSH([C++])
AX_APPEND_COMPILE_FLAGS([-Wall])
AX_APPEND_COMPILE_FLAGS([-Wextra])
AX_APPEND_COMPILE_FLAGS([-Wmissing-declarations])
AX_APPEND_COMPILE_FLAGS([-Wshadow])
AX_APPEND_COMPILE_FLAGS([-Wpointer-arith])
AX_APPEND_COMPILE_FLAGS([-Wcast-qual])
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
AX_APPEND_COMPILE_FLAGS([-Wsign-compare])
dnl This GCC8 warning for C++17 ABI compatibility is of no
dnl interest for us, because we're not a shared library.
AX_APPEND_COMPILE_FLAGS([-Wno-noexcept-type])
AC_LANG_POP
fi
dnl ---------------------------------------------------------------------------
dnl Pretty-Print Results
dnl ---------------------------------------------------------------------------
echo ''
echo '########### MPD CONFIGURATION ############'
printf '\nArchive support:\n\t'
results(bzip2,[bzip2])
results(iso9660,[ISO9660])
results(zzip,[ZIP])
if test x$with_zeroconf != xno; then
printf '\nAutodiscovery support:\n\t'
results(avahi, [Avahi])
results(bonjour, [Bonjour])
fi
printf '\nClient support:\n\t'
results(ipv6, "IPv6")
results(tcp, "TCP")
results(un,[UNIX Domain Sockets])
printf '\nStorage support:\n\t'
results(nfs, [NFS])
results(smbclient, [SMB])
printf '\nFile format support:\n\t'
results(aac, [AAC])
results(adplug, [AdPlug])
results(dsd, [DSD])
results(sidplay, [C64 SID])
results(ffmpeg, [FFMPEG])
results(flac, [FLAC])
results(fluidsynth, [FluidSynth])
results(gme, [GME])
printf '\n\t'
results(sndfile, [libsndfile])
results(mikmod, [MikMod])
results(modplug, [MODPLUG])
results(mad, [MAD])
results(mpg123, [MPG123])
results(mpc, [Musepack])
printf '\n\t'
results(opus, [Opus])
results(tremor, [OggTremor])
results(vorbis, [OggVorbis])
results(audiofile, [WAVE])
results(wavpack, [WavPack])
results(wildmidi, [WildMidi])
printf '\nOther features:\n\t'
results(lsr, [libsamplerate])
results(soxr, [libsoxr])
results(libmpdclient, [libmpdclient])
results(inotify, [inotify])
results(sqlite, [SQLite])
results(dbus, [DBUS])
results(udisks, [UDISKS])
printf '\nMetadata support:\n\t'
results(id3,[ID3])
printf '\nPlayback support:\n\t'
results(alsa,ALSA)
results(fifo,FIFO)
results(sndio,[SNDIO])
results(recorder_output,[File Recorder])
results(haiku,[Haiku])
results(httpd_output,[HTTP Daemon])
results(jack,[JACK])
printf '\n\t'
results(ao,[libao])
results(oss,[OSS])
results(openal,[OpenAL])
results(osx, [OS X])
results(pipe_output, [Pipeline])
printf '\n\t'
results(pulse, [PulseAudio])
results(roar,[ROAR])
results(shout, [SHOUTcast])
results(solaris_output, [Solaris])
results(winmm_output, [WinMM])
if
test x$enable_shout = xyes ||
test x$enable_recorder = xyes ||
test x$enable_httpd_output = xyes; then
printf '\nStreaming encoder support:\n\t'
results(flac_encoder, [FLAC])
results(lame_encoder, [LAME])
results(shine_encoder, [Shine])
results(vorbis_encoder, [Ogg Vorbis])
results(opus, [Opus])
results(twolame_encoder, [TwoLAME])
results(wave_encoder, [WAVE])
fi
printf '\nStreaming support:\n\t'
results(cdio_paranoia, [CDIO_PARANOIA])
results(curl,[CURL])
results(qobuz,[Qobuz])
results(smbclient,[SMBCLIENT])
results(soundcloud,[Soundcloud])
results(tidal,[Tidal])
printf '\n\t'
results(mms,[MMS])
printf '\nEvent loop:\n\t'
printf $with_pollmethod
printf '\n\n##########################################\n\n'
echo 'Generating files needed for compilation'
dnl ---------------------------------------------------------------------------
dnl Generate files
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(doc/doxygen.conf)
AC_CONFIG_FILES(systemd/system/mpd.service)
AC_CONFIG_FILES(systemd/user/mpd.service)
AC_OUTPUT
echo 'MPD is ready for compilation, type "make" to begin.'
......@@ -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.
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.
......
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=*',
],
)
......@@ -47,6 +47,8 @@ Download the source tarball from the `MPD home page <https://musicpd.org>`_ and
In any case, you need:
* 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
* pkg-config
......@@ -87,44 +89,54 @@ Now configure the source tree:
.. 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
make
meson configure output/release
When everything is ready and configured, compile:
.. code-block:: none
ninja -C output/release
And install:
.. code-block:: none
make install
ninja -C output/release install
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).
Basically, there are three ways to compile :program:`MPD` for Windows:
* Build on Windows for Windows. All you need to do is described above already: configure and make.
For Windows users, this is kind of unusual, because few Windows users have a GNU toolchain and a UNIX shell installed.
Basically, there are two ways to compile :program:`MPD` for Windows:
* 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.
* 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>`__.
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.
The remaining difficulty 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.
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
./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.
......@@ -138,12 +150,17 @@ You need:
* Android SDK
* 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
./android/build.py SDK_PATH NDK_PATH ABI
make android/build/mpd-debug.apk
mkdir -p output/android
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".
......@@ -154,7 +171,10 @@ systemd socket activation
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:
......@@ -168,7 +188,11 @@ In this configuration, :program:`MPD` will ignore the :dfn:`bind_to_address` and
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:
......@@ -529,7 +553,10 @@ The State File
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::
:widths: 20 80
......@@ -579,7 +606,10 @@ Do not change these unless you know what you are doing.
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::
:widths: 20 80
......
# ============================================================================
# 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
# ===========================================================================
# 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
# ===========================================================================
# 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
# ===========================================================================
# 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
])
# ===========================================================================
# 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
# ===========================================================================
# 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
# ===========================================================================
# 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
]])
# =============================================================================
# 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])])
# ===========================================================================
# 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
# ===========================================================================
# 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
# 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)
])
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)
])
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])
])
])
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])
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
])
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],)])
])
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])])
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
AC_DEFUN([results], [
printf '('
if test x$[]enable_$1 = xyes; then
printf '+'
else
printf '-'
fi
printf '%s) ' "$2"
])
# 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
])
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
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')
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
......@@ -40,6 +40,7 @@ c = '%s'
cpp = '%s'
ar = '%s'
strip = '%s'
pkgconfig = '%s'
%s
[properties]
......@@ -60,6 +61,7 @@ cpu_family = '%s'
cpu = '%s'
endian = '%s'
""" % (toolchain.cc, toolchain.cxx, toolchain.ar, toolchain.strip,
toolchain.pkg_config,
windres,
toolchain.install_prefix,
repr((toolchain.cppflags + ' ' + toolchain.cflags).split()),
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "CommandLine.hxx"
#include "GitVersion.hxx"
#include "ls.hxx"
#include "LogInit.hxx"
#include "Log.hxx"
......@@ -107,11 +108,7 @@ static constexpr Domain cmdline_domain("cmdline");
gcc_noreturn
static void version(void)
{
printf("Music Player Daemon " VERSION
#ifdef GIT_COMMIT
" (" GIT_COMMIT ")"
#endif
"\n"
printf("Music Player Daemon " VERSION " (%s)\n"
"\n"
"Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>\n"
"Copyright 2008-2017 Max Kellermann <max.kellermann@gmail.com>\n"
......@@ -120,7 +117,8 @@ static void version(void)
#ifdef ENABLE_DATABASE
"\n"
"Database plugins:\n");
"Database plugins:\n",
GIT_VERSION);
for (auto i = database_plugins; *i != nullptr; ++i)
printf(" %s", (*i)->name);
......
/*
* 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@";
/*
* 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
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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'),
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
)
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,
)
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,
],
)
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,
],
)
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,
],
)
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)
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,
],
)
libroar_dep = dependency('libroar', version: '>= 0.4.0', required: get_option('roar'))
conf.set('ENABLE_ROAR', libroar_dep.found())
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,
],
)
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())
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,
)
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,
)
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,
],
)
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())
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
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,
],
)
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,
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
)
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,
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
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,
],
)
thread = static_library(
'thread',
'Util.cxx',
'Thread.cxx',
include_directories: inc,
dependencies: [
dependency('threads')
],
)
thread_dep = declare_dependency(
link_with: thread,
)
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,
)
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)
systemd_unit_conf = configuration_data()
systemd_unit_conf.set('prefix', get_option('prefix'))
subdir('system')
subdir('user')
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,
)
systemd_user_unit_dir = get_option('systemd_user_unit_dir')
if systemd_user_unit_dir == ''
systemd_user_unit_dir = join_paths(get_option('prefix'), 'lib', 'systemd', 'user')
endif
configure_file(
input: 'mpd.service.in',
output: 'mpd.service',
configuration: systemd_unit_conf,
install_dir: systemd_user_unit_dir,
)
cppunit_dep = dependency('cppunit', required: true)
executable(
'ParseSongFilter',
'ParseSongFilter.cxx',
include_directories: inc,
dependencies: [
song_dep,
pcm_dep,
],
)
executable(
'read_conf',
'read_conf.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
config_dep,
],
)
test('test_util', executable(
'test_util',
'test_util.cxx',
include_directories: inc,
dependencies: [
util_dep,
cppunit_dep,
],
))
test('test_byte_reverse', executable(
'test_byte_reverse',
'test_byte_reverse.cxx',
include_directories: inc,
dependencies: [
util_dep,
cppunit_dep,
],
))
test('test_rewind', executable(
'test_rewind',
'test_rewind.cxx',
include_directories: inc,
dependencies: [
input_glue_dep,
cppunit_dep,
],
))
test('test_mixramp', executable(
'test_mixramp',
'test_mixramp.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
util_dep,
cppunit_dep,
],
))
test('test_protocol', executable(
'test_protocol',
'test_protocol.cxx',
'../src/protocol/ArgParser.cxx',
include_directories: inc,
dependencies: [
cppunit_dep,
],
))
test('test_queue_priority', executable(
'test_queue_priority',
'test_queue_priority.cxx',
'../src/queue/Queue.cxx',
include_directories: inc,
dependencies: [
util_dep,
cppunit_dep,
],
))
test('TestFs', executable(
'TestFs',
'TestFs.cxx',
include_directories: inc,
dependencies: [
fs_dep,
cppunit_dep,
],
))
test('TestIcu', executable(
'TestIcu',
'TestIcu.cxx',
include_directories: inc,
dependencies: [
util_dep,
icu_dep,
cppunit_dep,
],
))
if libavahi_client_dep.found()
executable(
'run_avahi',
'run_avahi.cxx',
'ShutdownHandler.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
zeroconf_dep,
util_dep,
],
)
endif
if enable_inotify
executable(
'run_inotify',
'run_inotify.cxx',
'ShutdownHandler.cxx',
'../src/db/update/InotifyDomain.cxx',
'../src/db/update/InotifySource.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
event_dep,
util_dep,
],
)
endif
executable(
'run_resolver',
'run_resolver.cxx',
include_directories: inc,
dependencies: [
net_dep,
util_dep,
],
)
#
# I/O
#
executable(
'WriteFile',
'WriteFile.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
fs_dep,
],
)
executable(
'dump_text_file',
'dump_text_file.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
input_glue_dep,
archive_glue_dep,
],
)
if zlib_dep.found()
executable(
'run_gzip',
'run_gzip.cxx',
include_directories: inc,
dependencies: [
fs_dep,
],
)
executable(
'run_gunzip',
'run_gunzip.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
fs_dep,
],
)
endif
#
# Neighbor
#
if neighbor_glue_dep.found()
executable(
'run_neighbor_explorer',
'run_neighbor_explorer.cxx',
'ShutdownHandler.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
neighbor_glue_dep,
],
)
endif
#
# Database
#
if enable_database
executable(
'run_storage',
'run_storage.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
storage_glue_dep,
],
)
executable(
'DumpDatabase',
'DumpDatabase.cxx',
'../src/protocol/Ack.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
'../src/db/Registry.cxx',
'../src/db/Selection.cxx',
'../src/db/PlaylistVector.cxx',
'../src/db/DatabaseLock.cxx',
'../src/AudioFormat.cxx',
'../src/AudioParser.cxx',
'../src/pcm/SampleFormat.cxx',
'../src/SongSave.cxx',
'../src/TagSave.cxx',
include_directories: inc,
dependencies: [
song_dep,
fs_dep,
event_dep,
db_plugins_dep,
],
)
test('test_translate_song', executable(
'test_translate_song',
'test_translate_song.cxx',
'../src/playlist/PlaylistSong.cxx',
'../src/SongLoader.cxx',
'../src/LocateUri.cxx',
'../src/Log.cxx',
include_directories: inc,
dependencies: [
tag_dep,
storage_glue_dep,
cppunit_dep,
],
))
endif
#
# Input
#
executable(
'run_input',
'run_input.cxx',
'../src/TagSave.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
input_glue_dep,
archive_glue_dep,
],
)
if curl_dep.found()
test('test_icy_parser', executable(
'test_icy_parser',
'test_icy_parser.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
tag_dep,
cppunit_dep,
],
))
endif
#
# Archive
#
if archive_glue_dep.found()
test('test_archive', executable(
'test_archive',
'test_archive.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
archive_glue_dep,
cppunit_dep,
],
))
executable(
'visit_archive',
'visit_archive.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
archive_glue_dep,
],
)
if libiso9660_dep.found()
if find_program('mkisofs', required: false).found()
test('test_archive_iso9660', find_program('test_archive_iso9660.sh'))
endif
endif
if libbz2_dep.found()
if find_program('bzip2', required: false).found()
test('test_archive_bzip2', find_program('test_archive_bzip2.sh'))
endif
endif
if libzzip_dep.found()
if find_program('zip', required: false).found()
test('test_archive_zzip', find_program('test_archive_zzip.sh'))
endif
endif
endif
#
# Playlist
#
executable(
'dump_playlist',
'dump_playlist.cxx',
'../src/TagSave.cxx',
'../src/TagFile.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
playlist_glue_dep,
input_glue_dep,
archive_glue_dep,
decoder_glue_dep,
],
)
#
# Decoder
#
executable(
'run_decoder',
'run_decoder.cxx',
'DumpDecoderClient.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
decoder_glue_dep,
input_glue_dep,
archive_glue_dep,
],
)
executable(
'read_tags',
'read_tags.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
decoder_glue_dep,
input_glue_dep,
archive_glue_dep,
],
)
executable(
'ContainerScan',
'ContainerScan.cxx',
'../src/SongSave.cxx',
'../src/TagSave.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
decoder_glue_dep,
input_glue_dep,
archive_glue_dep,
],
)
executable(
'ReadApeTags',
'ReadApeTags.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
tag_dep,
input_glue_dep,
archive_glue_dep,
],
)
if libid3tag_dep.found()
executable(
'dump_rva2',
'dump_rva2.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
tag_dep,
input_glue_dep,
archive_glue_dep,
],
)
endif
#
# Filter
#
test('test_pcm', executable(
'test_pcm',
'TestAudioFormat.cxx',
'test_pcm_dither.cxx',
'test_pcm_pack.cxx',
'test_pcm_channels.cxx',
'test_pcm_format.cxx',
'test_pcm_volume.cxx',
'test_pcm_mix.cxx',
'test_pcm_interleave.cxx',
'test_pcm_export.cxx',
'test_pcm_main.cxx',
include_directories: inc,
dependencies: [
pcm_dep,
cppunit_dep,
],
))
executable(
'run_filter',
'run_filter.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
filter_glue_dep,
],
)
executable(
'software_volume',
'software_volume.cxx',
include_directories: inc,
dependencies: [
pcm_dep,
],
)
executable(
'run_normalize',
'run_normalize.cxx',
'../src/AudioCompress/compress.c',
include_directories: inc,
dependencies: [
pcm_dep,
],
)
executable(
'run_convert',
'run_convert.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
pcm_dep,
config_dep,
],
)
#
# Encoder
#
if encoder_glue_dep.found()
executable(
'run_encoder',
'run_encoder.cxx',
'../src/AudioParser.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
encoder_glue_dep,
],
)
executable(
'test_vorbis_encoder',
'test_vorbis_encoder.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
encoder_glue_dep,
],
)
endif
#
# Output
#
executable(
'run_output',
'run_output.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
output_glue_dep,
encoder_glue_dep,
],
)
#
# Mixer
#
if alsa_dep.found()
# this debug program is still ALSA specific
executable(
'read_mixer',
'read_mixer.cxx',
'../src/Log.cxx',
'../src/LogBackend.cxx',
include_directories: inc,
dependencies: [
mixer_glue_dep,
],
)
endif
......@@ -22,7 +22,7 @@
#include "net/AddressInfo.hxx"
#include "net/ToString.hxx"
#include "net/SocketAddress.hxx"
#include "Log.hxx"
#include "util/PrintException.hxx"
#include <exception>
......@@ -42,6 +42,6 @@ try {
return EXIT_SUCCESS;
} catch (...) {
LogError(std::current_exception());
PrintException(std::current_exception());
return EXIT_FAILURE;
}
......@@ -44,11 +44,13 @@ ArchiveLookupTest::TestArchiveLookup()
archive_lookup(path, &archive, &inpath, &suffix));
free(path);
path = strdup("Makefile/foo/bar");
fclose(fopen("dummy", "w"));
path = strdup("dummy/foo/bar");
CPPUNIT_ASSERT_EQUAL(true,
archive_lookup(path, &archive, &inpath, &suffix));
CPPUNIT_ASSERT_EQUAL((const char *)path, archive);
CPPUNIT_ASSERT_EQUAL(0, strcmp(archive, "Makefile"));
CPPUNIT_ASSERT_EQUAL(0, strcmp(archive, "dummy"));
CPPUNIT_ASSERT_EQUAL(0, strcmp(inpath, "foo/bar"));
CPPUNIT_ASSERT_EQUAL((const char *)nullptr, suffix);
free(path);
......
#!/bin/sh -e
SRC_BASE=configure
SRC_BASE=meson.build
SRC="$(dirname $0)/../${SRC_BASE}"
DST="$(pwd)/test/tmp/${SRC_BASE}.bz2"
......
#!/bin/sh -e
SRC_BASE=configure
SRC_BASE=meson.build
SRC="$(dirname $0)/../${SRC_BASE}"
DST="$(pwd)/test/tmp/${SRC_BASE}.iso"
......
#!/bin/sh -e
SRC_BASE=configure
SRC_BASE=meson.build
SRC="$(dirname $0)/../${SRC_BASE}"
DST="$(pwd)/test/tmp/${SRC_BASE}.zip"
......
......@@ -2,6 +2,7 @@
import os, os.path
import sys, subprocess
import shutil
configure_args = sys.argv[1:]
......@@ -73,7 +74,15 @@ class CrossGccToolchain:
# redirect pkg-config to use our root directory instead of the
# 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
from build.libs import *
......@@ -103,30 +112,6 @@ for x in thirdparty_libs:
# configure and build MPD
configure = [
os.path.join(mpd_path, 'configure'),
'CC=' + toolchain.cc,
'CXX=' + toolchain.cxx,
'CFLAGS=' + toolchain.cflags,
'CXXFLAGS=' + toolchain.cxxflags,
'CPPFLAGS=' + toolchain.cppflags,
'LDFLAGS=' + toolchain.ldflags + ' -static',
'LIBS=' + toolchain.libs,
'AR=' + toolchain.ar,
'RANLIB=' + toolchain.ranlib,
'STRIP=' + toolchain.strip,
'--host=' + toolchain.arch,
'--prefix=' + toolchain.install_prefix,
'--enable-silent-rules',
'--disable-icu',
] + 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)
from build.meson import configure as run_meson
run_meson(toolchain, mpd_path, '.', configure_args)
subprocess.check_call(['/usr/bin/ninja'], env=toolchain.env)
subdir('res')
windows_conf = configuration_data()
windows_conf.set('VERSION', meson.project_version())
splitted_version = meson.project_version().split('.')
windows_conf.set('VERSION_MAJOR', splitted_version[0])
windows_conf.set('VERSION_MINOR', splitted_version.get(1, '0'))
windows_conf.set('VERSION_REVISION', splitted_version.get(2, '0'))
windows_conf.set('VERSION_EXTRA', splitted_version.get(3, '0'))
windows_conf.set('srcdir', meson.current_source_dir())
mpd_rc = configure_file(
input: 'mpd.rc.in',
output: 'mpd.rc',
configuration: windows_conf,
)
windows_mod = import('windows')
windows_resources = windows_mod.compile_resources(mpd_rc)
......@@ -3,7 +3,7 @@
#define VERSION_NUMBER @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@
#define VERSION_NUMBER_STR "@VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@"
MPD_ICON ICON "@top_srcdir@/win32/res/mpd.ico"
MPD_ICON ICON "@srcdir@/mpd.ico"
1 VERSIONINFO
FILETYPE VFT_APP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment