From 6fd304e5e6c8b386d3671f4932a74124fd37192a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 22 Apr 2013 11:31:06 +0200 Subject: Switch from autotools to a custom build system adapted from Libav. --- .gitignore | 26 - Makefile | 135 ++ Makefile.am | 1261 ---------------- autogen.sh | 137 -- configure | 2780 +++++++++++++++++++++++++++++++++++ configure.ac | 1234 ---------------- m4/ax_append_compile_flags.m4 | 63 - m4/ax_append_flag.m4 | 69 - m4/ax_check_compile_flag.m4 | 72 - m4/faad.m4 | 198 --- m4/libwrap.m4 | 14 - m4/mpd_auto.m4 | 80 - m4/pkg.m4 | 157 -- m4/pretty_print.m4 | 19 - m4/ucred.m4 | 32 - src/Makefile | 252 ++++ src/archive_list.c | 6 +- src/check.h | 2 +- src/client_new.c | 4 +- src/command.c | 8 +- src/decoder/ffmpeg_decoder_plugin.c | 1 + src/fd_util.c | 12 +- src/inotify_update.h | 16 - src/input_registry.c | 30 +- src/log.c | 10 +- src/main.c | 12 +- src/output_list.c | 34 +- src/pcm_resample.c | 20 +- src/pcm_resample.h | 4 +- src/pcm_resample_internal.h | 2 +- src/resolver.c | 16 +- src/server_socket.c | 28 +- src/update_archive.c | 2 +- src/update_archive.h | 2 +- src/update_remove.c | 4 +- src/zeroconf.c | 8 +- src/zeroconf.h | 2 +- 37 files changed, 3266 insertions(+), 3486 deletions(-) create mode 100644 Makefile delete mode 100644 Makefile.am delete mode 100755 autogen.sh create mode 100755 configure delete mode 100644 configure.ac delete mode 100644 m4/ax_append_compile_flags.m4 delete mode 100644 m4/ax_append_flag.m4 delete mode 100644 m4/ax_check_compile_flag.m4 delete mode 100644 m4/faad.m4 delete mode 100644 m4/libwrap.m4 delete mode 100644 m4/mpd_auto.m4 delete mode 100644 m4/pkg.m4 delete mode 100644 m4/pretty_print.m4 delete mode 100644 m4/ucred.m4 create mode 100644 src/Makefile diff --git a/.gitignore b/.gitignore index 67b26103..4fed4e16 100644 --- a/.gitignore +++ b/.gitignore @@ -7,35 +7,9 @@ *.la *.lo *.o -.deps -.dirstamp -Makefile -Makefile.in -aclocal.m4 -autom4te.cache -compile -config.guess -config.h -config.h.in -config.log -config.mk -config.status -config.sub -config_detected.h -config_detected.mk -configure -configure.lineno -depcomp -depmode -install-sh -libtool -ltmain.sh -missing -mkinstalldirs mpd mpd.exe mpd.service -stamp-h1 tags *~ .#* diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f17158d4 --- /dev/null +++ b/Makefile @@ -0,0 +1,135 @@ +include config.mak + +vpath %.c $(SRC_PATH) +vpath %.h $(SRC_PATH) + +ifndef V +Q = @ +ECHO = printf "$(1)\t%s\n" $(2) +BRIEF = CC HOSTCC HOSTLD AR LD +SILENT = DEPCC DEPHOSTCC RANLIB RM +MSG = $@ +M = @$(call ECHO,$(TAG),$@); +$(foreach VAR,$(BRIEF), \ + $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR)))) +$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR)))) +$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL)) +endif + +IFLAGS := -I. -I$(SRC_PATH) +CPPFLAGS := $(IFLAGS) $(CPPFLAGS) +CFLAGS += $(ECFLAGS) +CCFLAGS = $(CPPFLAGS) $(CFLAGS) +HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS) +LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS) + +define COMPILE + $(call $(1)DEP,$(1)) + $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $< +endef + +COMPILE_C = $(call COMPILE,CC) + +%.o: %.c + $(COMPILE_C) + +%.i: %.c + $(CC) $(CCFLAGS) $(CC_E) $< + +%.h.c: + $(Q)echo '#include "$*.h"' >$@ + +%.c %.h: TAG = GEN + +BASENAMES = mpd +PROGS = $(addprefix src/,$(BASENAMES:%=%$(EXESUF))) +OBJS := cmdutils.o $(EXEOBJS) +ALLMANPAGES = $(BASENAMES:%=%.1) + +DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset) + +SKIPHEADERS = + +include $(SRC_PATH)/common.mak + +all: $(PROGS) + +config.h: .config +.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) + @-tput bold 2>/dev/null + @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n' + @-tput sgr0 2>/dev/null + +SUBDIR_VARS := CLEANFILES EXAMPLES HOSTPROGS TESTPROGS TOOLS \ + HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ + OBJS HOSTOBJS TESTOBJS + +$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V)))) +SUBDIR = src/ +include $(SRC_PATH)/src/Makefile +include $(SRC_PATH)/common.mak + +$(PROGS): %$(EXESUF): $(OBJS) + $(LD) $(LDFLAGS) $(LD_O) $(OBJS) $(EXTRALIBS) + +OBJDIRS += tools + +-include $(wildcard tools/*.d) + +VERSION_SH = $(SRC_PATH)/version.sh +GIT_LOG = $(SRC_PATH)/.git/logs/HEAD + +.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak +.version: M=@ + +version.h .version: + $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION) + $(Q)touch .version + +# force version.sh to run whenever version might have changed +-include .version + +install: install-progs install-data + +install-progs: $(PROGS) + $(Q)mkdir -p "$(BINDIR)" + $(INSTALL) -c -m 755 $(PROGS) "$(BINDIR)" + +install-data: $(DATA_FILES) + $(Q)mkdir -p "$(DATADIR)" + $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" + +uninstall: uninstall-progs uninstall-data + +uninstall-progs: + $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS)) + +uninstall-data: + $(RM) -r "$(DATADIR)" + +clean:: + $(RM) $(ALLPROGS) + $(RM) $(CLEANSUFFIXES) + +distclean:: + $(RM) $(DISTCLEANSUFFIXES) + $(RM) config.* .config .version version.h + +config: + $(SRC_PATH)/configure $(value MPD_CONFIGURATION) + +check: all alltools checkheaders examples testprogs fate + +$(sort $(OBJDIRS)): + $(Q)mkdir -p $@ + +# Dummy rule to stop make trying to rebuild removed or renamed headers +%.h: + @: + +# Disable suffix rules. Most of the builtin rules are suffix rules, +# so this saves some time on slow systems. +.SUFFIXES: + +.PHONY: all all-yes alltools check *clean config examples install* +.PHONY: testprogs uninstall* diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index cb62d93f..00000000 --- a/Makefile.am +++ /dev/null @@ -1,1261 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = foreign 1.11 dist-bzip2 subdir-objects - -AM_CPPFLAGS += -I$(srcdir)/src $(GLIB_CFLAGS) - -AM_CPPFLAGS += -DSYSTEM_CONFIG_FILE_LOCATION='"$(sysconfdir)/mpd.conf"' - -bin_PROGRAMS = src/mpd - -noinst_LIBRARIES = \ - libutil.a \ - libpcm.a \ - libtag.a \ - libinput.a \ - libplaylist_plugins.a \ - libdecoder_plugins.a \ - libfilter_plugins.a \ - libmixer_plugins.a \ - liboutput_plugins.a - -src_mpd_CPPFLAGS = $(AM_CPPFLAGS) \ - $(AVAHI_CFLAGS) \ - $(LIBWRAP_CFLAGS) \ - $(SQLITE_CFLAGS) -src_mpd_LDADD = \ - $(PLAYLIST_LIBS) \ - $(AVAHI_LIBS) \ - $(LIBWRAP_LDFLAGS) \ - $(SQLITE_LIBS) \ - $(DECODER_LIBS) \ - $(INPUT_LIBS) \ - $(ARCHIVE_LIBS) \ - $(TAG_LIBS) \ - $(OUTPUT_LIBS) \ - $(FILTER_LIBS) \ - $(ENCODER_LIBS) \ - $(MIXER_LIBS) \ - libutil.a \ - $(SYSTEMD_DAEMON_LIBS) \ - $(GLIB_LIBS) - -mpd_headers = \ - src/check.h \ - src/notify.h \ - src/ack.h \ - src/ape.h \ - src/audio_format.h \ - src/audio_check.h \ - src/audio_parser.h \ - src/output_internal.h \ - src/output_api.h \ - src/output_list.h \ - src/output_all.h \ - src/output_thread.h \ - src/output_control.h \ - src/output_state.h \ - src/output_print.h \ - src/output_command.h \ - src/filter_internal.h \ - src/filter_config.h \ - src/filter_plugin.h \ - src/filter_registry.h \ - src/filter/autoconvert_filter_plugin.h \ - src/filter/chain_filter_plugin.h \ - src/filter/convert_filter_plugin.h \ - src/filter/replay_gain_filter_plugin.h \ - src/filter/volume_filter_plugin.h \ - src/command.h \ - src/idle.h \ - src/cmdline.h \ - src/conf.h \ - src/crossfade.h \ - src/dbUtils.h \ - src/decoder_thread.h \ - src/decoder_control.h \ - src/decoder_plugin.h \ - src/decoder_command.h \ - src/decoder_buffer.h \ - src/decoder_api.h \ - src/decoder_plugin.h \ - src/decoder_internal.h \ - src/directory.h \ - src/directory_save.h \ - src/database.h \ - src/encoder_plugin.h \ - src/encoder_list.h \ - src/encoder_api.h \ - src/exclude.h \ - src/fd_util.h \ - src/glib_compat.h \ - src/update.h \ - src/inotify_source.h \ - src/inotify_queue.h \ - src/inotify_update.h \ - src/gcc.h \ - src/decoder_list.h \ - src/decoder_print.h \ - src/input_init.h \ - src/input_plugin.h \ - src/input_registry.h \ - src/input_stream.h \ - src/input/file_input_plugin.h \ - src/input/ffmpeg_input_plugin.h \ - src/input/curl_input_plugin.h \ - src/input/rewind_input_plugin.h \ - src/input/mms_input_plugin.h \ - src/input/despotify_input_plugin.h \ - src/input/cdio_paranoia_input_plugin.h \ - src/despotify_utils.h \ - src/text_file.h \ - src/text_input_stream.h \ - src/icy_server.h \ - src/icy_metadata.h \ - src/client.h \ - src/client_internal.h \ - src/server_socket.h \ - src/listen.h \ - src/log.h \ - src/ls.h \ - src/main.h \ - src/mixer_all.h \ - src/mixer_api.h \ - src/mixer_control.h \ - src/mixer_list.h \ - src/event_pipe.h \ - src/mixer_plugin.h \ - src/mixer_type.h \ - src/mixer/software_mixer_plugin.h \ - src/mixer/pulse_mixer_plugin.h \ - src/daemon.h \ - src/AudioCompress/config.h \ - src/AudioCompress/compress.h \ - src/buffer.h \ - src/pipe.h \ - src/chunk.h \ - src/path.h \ - src/mapper.h \ - src/open.h \ - src/output/httpd_client.h \ - src/output/httpd_internal.h \ - src/page.h \ - src/permission.h \ - src/player_thread.h \ - src/player_control.h \ - src/playlist.h \ - src/playlist_error.h \ - src/playlist_internal.h \ - src/playlist_print.h \ - src/playlist_save.h \ - src/playlist_state.h \ - src/playlist_plugin.h \ - src/playlist_list.h \ - src/playlist_mapper.h \ - src/playlist_any.h \ - src/playlist_song.h \ - src/playlist_queue.h \ - src/playlist_vector.h \ - src/playlist_database.h \ - src/playlist/extm3u_playlist_plugin.h \ - src/playlist/m3u_playlist_plugin.h \ - src/playlist/pls_playlist_plugin.h \ - src/playlist/xspf_playlist_plugin.h \ - src/playlist/asx_playlist_plugin.h \ - src/playlist/rss_playlist_plugin.h \ - src/playlist/lastfm_playlist_plugin.h \ - src/playlist/despotify_playlist_plugin.h \ - src/playlist/cue_playlist_plugin.h \ - src/poison.h \ - src/riff.h \ - src/aiff.h \ - src/queue.h \ - src/queue_print.h \ - src/queue_save.h \ - src/refcount.h \ - src/replay_gain_config.h \ - src/replay_gain_info.h \ - src/replay_gain_ape.h \ - src/sig_handlers.h \ - src/song.h \ - src/song_print.h \ - src/song_save.h \ - src/song_sticker.h \ - src/song_sort.c src/song_sort.h \ - src/socket_util.h \ - src/state_file.h \ - src/stats.h \ - src/sticker.h \ - src/sticker_print.h \ - src/tag.h \ - src/tag_internal.h \ - src/tag_pool.h \ - src/tag_table.h \ - src/tag_ape.h \ - src/tag_id3.h \ - src/tag_rva2.h \ - src/tag_print.h \ - src/tag_save.h \ - src/tokenizer.h \ - src/strset.h \ - src/uri.h \ - src/utils.h \ - src/string_util.h \ - src/volume.h \ - src/zeroconf.h src/zeroconf-internal.h \ - src/locate.h \ - src/stored_playlist.h \ - src/timer.h \ - src/archive_api.h \ - src/archive_internal.h \ - src/archive_list.h \ - src/archive_plugin.h \ - src/archive/bz2_archive_plugin.h \ - src/archive/iso9660_archive_plugin.h \ - src/archive/zzip_archive_plugin.h \ - src/input/archive_input_plugin.h \ - src/mpd_error.h - -src_mpd_SOURCES = \ - $(mpd_headers) \ - $(DECODER_SRC) \ - $(OUTPUT_API_SRC) \ - $(MIXER_API_SRC) \ - src/glib_socket.h \ - src/notify.c \ - src/audio_config.c src/audio_config.h \ - src/audio_check.c \ - src/audio_format.c \ - src/audio_parser.c \ - src/protocol/argparser.c src/protocol/argparser.h \ - src/protocol/result.c src/protocol/result.h \ - src/command.c \ - src/idle.c \ - src/cmdline.c \ - src/conf.c \ - src/crossfade.c \ - src/cue/cue_parser.c src/cue/cue_parser.h \ - src/dbUtils.c \ - src/decoder_thread.c \ - src/decoder_control.c \ - src/decoder_api.c \ - src/decoder_internal.c \ - src/decoder_print.c \ - src/directory.c \ - src/directory_save.c \ - src/database.c \ - src/db_internal.h \ - src/db_error.h \ - src/db_lock.c src/db_lock.h \ - src/db_save.c src/db_save.h \ - src/db_print.c src/db_print.h \ - src/db_plugin.h \ - src/db_visitor.h \ - src/db_selection.h \ - src/db/simple_db_plugin.c src/db/simple_db_plugin.h \ - src/exclude.c \ - src/fd_util.c \ - src/fifo_buffer.c src/fifo_buffer.h \ - src/growing_fifo.c src/growing_fifo.h \ - src/filter_config.c \ - src/filter_plugin.c \ - src/filter_registry.c \ - src/update.c \ - src/update_queue.c src/update_queue.h \ - src/update_io.c src/update_io.h \ - src/update_db.c src/update_db.h \ - src/update_walk.c src/update_walk.h \ - src/update_song.c src/update_song.h \ - src/update_container.c src/update_container.h \ - src/update_internal.h \ - src/update_remove.c src/update_remove.h \ - src/client.c \ - src/client_event.c \ - src/client_expire.c \ - src/client_global.c \ - src/client_idle.h \ - src/client_idle.c \ - src/client_list.c \ - src/client_new.c \ - src/client_process.c \ - src/client_read.c \ - src/client_write.c \ - src/client_message.h \ - src/client_message.c \ - src/client_subscribe.h \ - src/client_subscribe.c \ - src/client_file.c src/client_file.h \ - src/server_socket.c \ - src/listen.c \ - src/log.c \ - src/ls.c \ - src/io_thread.c src/io_thread.h \ - src/main.c \ - src/main_win32.c \ - src/event_pipe.c \ - src/daemon.c \ - src/AudioCompress/compress.c \ - src/buffer.c \ - src/pipe.c \ - src/chunk.c \ - src/path.c \ - src/mapper.c \ - src/page.c \ - src/permission.c \ - src/player_thread.c \ - src/player_control.c \ - src/playlist.c \ - src/playlist_global.c \ - src/playlist_control.c \ - src/playlist_edit.c \ - src/playlist_print.c \ - src/playlist_save.c \ - src/playlist_mapper.c \ - src/playlist_any.c \ - src/playlist_song.c \ - src/playlist_state.c \ - src/playlist_queue.c \ - src/playlist_vector.c \ - src/playlist_database.c \ - src/queue.c \ - src/queue_print.c \ - src/queue_save.c \ - src/replay_gain_config.c \ - src/replay_gain_info.c \ - src/sig_handlers.c \ - src/song.c \ - src/song_update.c \ - src/song_print.c \ - src/song_save.c \ - src/resolver.c src/resolver.h \ - src/socket_util.c \ - src/state_file.c \ - src/stats.c \ - src/tag.c \ - src/tag_pool.c \ - src/tag_print.c \ - src/tag_save.c \ - src/tag_handler.c src/tag_handler.h \ - src/tag_file.c src/tag_file.h \ - src/tokenizer.c \ - src/text_file.c \ - src/text_input_stream.c \ - src/strset.c \ - src/uri.c \ - src/utils.c \ - src/string_util.c \ - src/volume.c \ - src/locate.c \ - src/stored_playlist.c \ - src/timer.c - -# -# Windows resource file -# - -src/win/mpd_win32_rc.$(OBJEXT): src/win/mpd_win32_rc.rc - $(WINDRES) -i $< -o $@ - -if HAVE_WINDOWS -noinst_DATA = src/win/mpd_win32_rc.rc - -src_mpd_DEPENDENCIES = src/win/mpd_win32_rc.$(OBJEXT) -src_mpd_LDFLAGS = -Wl,src/win/mpd_win32_rc.$(OBJEXT) -endif - -if ENABLE_DESPOTIFY -src_mpd_SOURCES += \ - src/despotify_utils.c -endif - -if ENABLE_INOTIFY -src_mpd_SOURCES += \ - src/inotify_source.c \ - src/inotify_queue.c \ - src/inotify_update.c -endif - -if ENABLE_SQLITE -src_mpd_SOURCES += \ - src/sticker.c \ - src/sticker_print.c \ - src/song_sticker.c -endif - -# Generic utility library - -libutil_a_SOURCES = \ - src/util/list.h \ - src/util/list_sort.c src/util/list_sort.h \ - src/util/byte_reverse.c src/util/byte_reverse.h \ - src/util/bit_reverse.c src/util/bit_reverse.h - -# PCM library - -libpcm_a_SOURCES = \ - src/pcm_buffer.c src/pcm_buffer.h \ - src/pcm_export.c src/pcm_export.h \ - src/pcm_convert.c src/pcm_convert.h \ - src/dsd2pcm/dsd2pcm.c src/dsd2pcm/dsd2pcm.h \ - src/pcm_dsd.c src/pcm_dsd.h \ - src/pcm_dsd_usb.c src/pcm_dsd_usb.h \ - src/pcm_volume.c src/pcm_volume.h \ - src/pcm_mix.c src/pcm_mix.h \ - src/pcm_channels.c src/pcm_channels.h \ - src/pcm_pack.c src/pcm_pack.h \ - src/pcm_format.c src/pcm_format.h \ - src/pcm_resample.c src/pcm_resample.h \ - src/pcm_resample_fallback.c \ - src/pcm_resample_internal.h \ - src/pcm_dither.c src/pcm_dither.h \ - src/pcm_prng.h \ - src/pcm_utils.h -libpcm_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(SAMPLERATE_CFLAGS) - -PCM_LIBS = \ - libpcm.a \ - $(SAMPLERATE_LIBS) - -if HAVE_LIBSAMPLERATE -libpcm_a_SOURCES += src/pcm_resample_libsamplerate.c -endif - -# archive plugins - -if ENABLE_ARCHIVE - -noinst_LIBRARIES += libarchive.a - -src_mpd_SOURCES += \ - src/update_archive.c src/update_archive.h - -libarchive_a_SOURCES = \ - src/archive_api.c \ - src/archive_list.c \ - src/archive_plugin.c \ - src/input/archive_input_plugin.c -libarchive_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(BZ2_CFLAGS) \ - $(ISO9660_CFLAGS) \ - $(ZZIP_CFLAGS) - -ARCHIVE_LIBS = \ - libarchive.a \ - $(BZ2_LIBS) \ - $(ISO9660_LIBS) \ - $(ZZIP_LIBS) - -if HAVE_BZ2 -libarchive_a_SOURCES += src/archive/bz2_archive_plugin.c -endif - -if HAVE_ZZIP -libarchive_a_SOURCES += src/archive/zzip_archive_plugin.c -endif - -if HAVE_ISO9660 -libarchive_a_SOURCES += src/archive/iso9660_archive_plugin.c -endif - -else -ARCHIVE_LIBS = -endif - - -# tag plugins - -libtag_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(ID3TAG_CFLAGS) -TAG_LIBS = \ - libtag.a \ - $(ID3TAG_LIBS) - -libtag_a_SOURCES =\ - src/ape.c \ - src/replay_gain_ape.c \ - src/tag_ape.c - -if HAVE_ID3TAG -libtag_a_SOURCES += \ - src/tag_id3.c \ - src/tag_rva2.c \ - src/riff.c src/aiff.c -endif - -# decoder plugins - -libdecoder_plugins_a_SOURCES = \ - src/decoder_buffer.c \ - src/decoder_plugin.c \ - src/decoder_list.c -libdecoder_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(FFMPEG_CFLAGS) - -DECODER_LIBS = \ - libdecoder_plugins.a \ - $(FFMPEG_LIBS) - -DECODER_SRC = - -if HAVE_FFMPEG -libdecoder_plugins_a_SOURCES += \ - src/decoder/ffmpeg_metadata.c \ - src/decoder/ffmpeg_metadata.h \ - src/decoder/ffmpeg_decoder_plugin.c -endif - -# encoder plugins - -if ENABLE_ENCODER - -noinst_LIBRARIES += libencoder_plugins.a - -libencoder_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(LAME_CFLAGS) \ - $(TWOLAME_CFLAGS) \ - $(VORBISENC_CFLAGS) - -ENCODER_LIBS = \ - libencoder_plugins.a \ - $(LAME_LIBS) \ - $(TWOLAME_LIBS) \ - $(FLAC_LIBS) \ - $(VORBISENC_LIBS) - -libencoder_plugins_a_SOURCES = - -libencoder_plugins_a_SOURCES += src/encoder_list.c -libencoder_plugins_a_SOURCES += src/encoder/null_encoder.c - -if ENABLE_WAVE_ENCODER -libencoder_plugins_a_SOURCES += src/encoder/wave_encoder.c -endif - -if ENABLE_VORBIS_ENCODER -libencoder_plugins_a_SOURCES += src/encoder/vorbis_encoder.c -endif - -if ENABLE_LAME_ENCODER -libencoder_plugins_a_SOURCES += src/encoder/lame_encoder.c -endif - -if ENABLE_TWOLAME_ENCODER -libencoder_plugins_a_SOURCES += src/encoder/twolame_encoder.c -endif - -if ENABLE_FLAC_ENCODER -libencoder_plugins_a_SOURCES += src/encoder/flac_encoder.c -endif - -else -ENCODER_LIBS = -endif - - -if HAVE_ZEROCONF -src_mpd_SOURCES += src/zeroconf.c - -if HAVE_AVAHI -src_mpd_SOURCES += src/zeroconf-avahi.c -endif - -if HAVE_BONJOUR -src_mpd_SOURCES += src/zeroconf-bonjour.c -endif -endif - -# -# input plugins -# - -libinput_a_SOURCES = \ - src/input_init.c \ - src/input_registry.c \ - src/input_stream.c \ - src/input_internal.c src/input_internal.h \ - src/input/rewind_input_plugin.c \ - src/input/file_input_plugin.c - -libinput_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(CURL_CFLAGS) \ - $(SOUP_CFLAGS) \ - $(CDIO_PARANOIA_CFLAGS) \ - $(FFMPEG_CFLAGS) \ - $(DESPOTIFY_CFLAGS) \ - $(MMS_CFLAGS) - -INPUT_LIBS = \ - libinput.a \ - $(CURL_LIBS) \ - $(SOUP_LIBS) \ - $(CDIO_PARANOIA_LIBS) \ - $(FFMPEG_LIBS) \ - $(DESPOTIFY_LIBS) \ - $(MMS_LIBS) - -if ENABLE_CURL -libinput_a_SOURCES += src/input/curl_input_plugin.c \ - src/icy_metadata.c -endif - -if ENABLE_SOUP -libinput_a_SOURCES += \ - src/input/soup_input_plugin.c \ - src/input/soup_input_plugin.h -endif - -if ENABLE_CDIO_PARANOIA -libinput_a_SOURCES += src/input/cdio_paranoia_input_plugin.c -endif - -if HAVE_FFMPEG -libinput_a_SOURCES += src/input/ffmpeg_input_plugin.c -endif - -if ENABLE_MMS -libinput_a_SOURCES += src/input/mms_input_plugin.c -endif - -if ENABLE_DESPOTIFY -libinput_a_SOURCES += src/input/despotify_input_plugin.c -endif - - -liboutput_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(AO_CFLAGS) \ - $(ALSA_CFLAGS) \ - $(FFADO_CFLAGS) \ - $(JACK_CFLAGS) \ - $(OPENAL_CFLAGS) \ - $(OPENSSL_CFLAGS) \ - $(PULSE_CFLAGS) \ - $(SHOUT_CFLAGS) - -OUTPUT_LIBS = \ - liboutput_plugins.a \ - $(LIBWRAP_LDFLAGS) \ - $(AO_LIBS) \ - $(ALSA_LIBS) \ - $(ROAR_LIBS) \ - $(FFADO_LIBS) \ - $(JACK_LIBS) \ - $(OPENAL_LIBS) \ - $(PULSE_LIBS) \ - $(SHOUT_LIBS) - -OUTPUT_API_SRC = \ - src/output_list.c \ - src/output_all.c \ - src/output_thread.c \ - src/output_control.c \ - src/output_state.c \ - src/output_print.c \ - src/output_command.c \ - src/output_plugin.c src/output_plugin.h \ - src/output_finish.c \ - src/output_init.c - -liboutput_plugins_a_SOURCES = \ - src/output/null_output_plugin.h \ - src/output/null_output_plugin.c - -MIXER_LIBS = \ - libmixer_plugins.a \ - $(PULSE_LIBS) - -MIXER_API_SRC = \ - src/mixer_control.c \ - src/mixer_type.c \ - src/mixer_all.c \ - src/mixer_api.c - -libmixer_plugins_a_SOURCES = \ - src/mixer/software_mixer_plugin.c -libmixer_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(ALSA_CFLAGS) \ - $(PULSE_CFLAGS) - -if HAVE_ALSA -liboutput_plugins_a_SOURCES += \ - src/output/alsa_output_plugin.c src/output/alsa_output_plugin.h -libmixer_plugins_a_SOURCES += src/mixer/alsa_mixer_plugin.c -endif - -if HAVE_ROAR -liboutput_plugins_a_SOURCES += \ - src/output/roar_output_plugin.c src/output/roar_output_plugin.h -libmixer_plugins_a_SOURCES += src/mixer/roar_mixer_plugin.c -endif - -if ENABLE_FFADO_OUTPUT -liboutput_plugins_a_SOURCES += \ - src/output/ffado_output_plugin.c src/output/ffado_output_plugin.h -endif - -if HAVE_AO -liboutput_plugins_a_SOURCES += \ - src/output/ao_output_plugin.c src/output/ao_output_plugin.h -endif - -if HAVE_FIFO -liboutput_plugins_a_SOURCES += \ - src/output/fifo_output_plugin.c src/output/fifo_output_plugin.h -endif - -if ENABLE_PIPE_OUTPUT -liboutput_plugins_a_SOURCES += \ - src/output/pipe_output_plugin.c src/output/pipe_output_plugin.h -endif - -if HAVE_JACK -liboutput_plugins_a_SOURCES += \ - src/output/jack_output_plugin.c src/output/jack_output_plugin.h -endif - -if HAVE_MVP -liboutput_plugins_a_SOURCES += \ - src/output/mvp_output_plugin.c src/output/mvp_output_plugin.h -endif - -if HAVE_OSS -liboutput_plugins_a_SOURCES += \ - src/output/oss_output_plugin.c src/output/oss_output_plugin.h -libmixer_plugins_a_SOURCES += src/mixer/oss_mixer_plugin.c -endif - -if HAVE_OPENAL -liboutput_plugins_a_SOURCES += \ - src/output/openal_output_plugin.c src/output/openal_output_plugin.h -endif - -if HAVE_OSX -liboutput_plugins_a_SOURCES += \ - src/output/osx_output_plugin.c src/output/osx_output_plugin.h -endif - -if HAVE_PULSE -liboutput_plugins_a_SOURCES += \ - src/output/pulse_output_plugin.c src/output/pulse_output_plugin.h -libmixer_plugins_a_SOURCES += src/mixer/pulse_mixer_plugin.c -endif - -if HAVE_SHOUT -liboutput_plugins_a_SOURCES += \ - src/output/shout_output_plugin.c src/output/shout_output_plugin.h -endif - -if ENABLE_RECORDER_OUTPUT -liboutput_plugins_a_SOURCES += \ - src/output/recorder_output_plugin.c src/output/recorder_output_plugin.h -endif - -if ENABLE_HTTPD_OUTPUT -liboutput_plugins_a_SOURCES += \ - src/icy_server.c \ - src/output/httpd_client.c \ - src/output/httpd_output_plugin.c src/output/httpd_output_plugin.h -endif - -if ENABLE_SOLARIS_OUTPUT -liboutput_plugins_a_SOURCES += \ - src/output/solaris_output_plugin.c src/output/solaris_output_plugin.h -endif - -if ENABLE_WINMM_OUTPUT -liboutput_plugins_a_SOURCES += \ - src/output/winmm_output_plugin.c src/output/winmm_output_plugin.h -libmixer_plugins_a_SOURCES += src/mixer/winmm_mixer_plugin.c -endif - - -# -# Playlist plugins -# - -libplaylist_plugins_a_SOURCES = \ - src/playlist/extm3u_playlist_plugin.c \ - src/playlist/m3u_playlist_plugin.c \ - src/playlist/pls_playlist_plugin.c \ - src/playlist/xspf_playlist_plugin.c \ - src/playlist/asx_playlist_plugin.c \ - src/playlist/rss_playlist_plugin.c \ - src/playlist/cue_playlist_plugin.c \ - src/playlist/embcue_playlist_plugin.c \ - src/playlist/embcue_playlist_plugin.h \ - src/playlist_list.c -libplaylist_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \ - $(YAJL_CFLAGS) \ - $(patsubst -I%/FLAC,-I%,$(FLAC_CFLAGS)) - -PLAYLIST_LIBS = \ - libplaylist_plugins.a \ - $(FLAC_LIBS) - -if ENABLE_LASTFM -libplaylist_plugins_a_SOURCES += src/playlist/lastfm_playlist_plugin.c -endif - -if ENABLE_DESPOTIFY -libplaylist_plugins_a_SOURCES += src/playlist/despotify_playlist_plugin.c -endif - -if ENABLE_SOUNDCLOUD -libplaylist_plugins_a_SOURCES += \ - src/playlist/soundcloud_playlist_plugin.h \ - src/playlist/soundcloud_playlist_plugin.c -PLAYLIST_LIBS += $(YAJL_LIBS) -endif - -# -# Filter plugins -# - -libfilter_plugins_a_SOURCES = \ - src/filter/null_filter_plugin.c \ - src/filter/chain_filter_plugin.c \ - src/filter/autoconvert_filter_plugin.c \ - src/filter/convert_filter_plugin.c \ - src/filter/route_filter_plugin.c \ - src/filter/normalize_filter_plugin.c \ - src/filter/replay_gain_filter_plugin.c \ - src/filter/volume_filter_plugin.c - -FILTER_LIBS = \ - libfilter_plugins.a \ - $(PCM_LIBS) - - -# -# Sparse code analysis -# -# sparse is a semantic parser -# URL: git://www.kernel.org/pub/scm/devel/sparse/sparse.git -# - -SPARSE = sparse -SPARSE_FLAGS = -SPARSE_CPPFLAGS = $(DEFAULT_INCLUDES) \ - -I$(shell $(CC) -print-file-name=include) \ - -I$(shell $(CC) -print-file-name=include-fixed) -SPARSE_CPPFLAGS += -D__SCHAR_MAX__=127 -D__SHRT_MAX__=32767 \ - -D__INT_MAX__=2147483647 -D__LONG_MAX__=2147483647 -SPARSE_SRC = $(addprefix $(top_srcdir)/,$(filter %.c,$(src_mpd_SOURCES))) -sparse-check: - $(SPARSE) -I. $(src_mpd_CFLAGS) $(src_mpd_CPPFLAGS) $(SPARSE_FLAGS) $(SPARSE_CPPFLAGS) $(SPARSE_SRC) - -.PHONY: sparse-check - - -# -# Test programs -# - -if ENABLE_TEST - -C_TESTS = \ - test/test_byte_reverse \ - test/test_pcm \ - test/test_queue_priority - -TESTS = $(C_TESTS) - -noinst_PROGRAMS = \ - $(C_TESTS) \ - test/read_conf \ - test/run_resolver \ - test/run_input \ - test/dump_text_file \ - test/dump_playlist \ - test/run_decoder \ - test/read_tags \ - test/run_filter \ - test/run_output \ - test/run_convert \ - test/run_normalize \ - test/software_volume - -if HAVE_ID3TAG -noinst_PROGRAMS += test/dump_rva2 -endif - -if HAVE_ALSA -# this debug program is still ALSA specific -noinst_PROGRAMS += test/read_mixer -endif - -test_read_conf_LDADD = \ - $(GLIB_LIBS) -test_read_conf_SOURCES = test/read_conf.c \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c - -test_run_resolver_LDADD = \ - $(GLIB_LIBS) -test_run_resolver_SOURCES = test/run_resolver.c \ - src/resolver.c - -test_run_input_LDADD = \ - $(INPUT_LIBS) \ - $(ARCHIVE_LIBS) \ - $(GLIB_LIBS) -test_run_input_SOURCES = test/run_input.c \ - test/stdbin.h \ - src/io_thread.c src/io_thread.h \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c\ - src/tag.c src/tag_pool.c src/tag_save.c \ - src/fd_util.c - -test_dump_text_file_LDADD = \ - $(INPUT_LIBS) \ - $(ARCHIVE_LIBS) \ - $(GLIB_LIBS) -test_dump_text_file_SOURCES = test/dump_text_file.c \ - test/stdbin.h \ - src/io_thread.c src/io_thread.h \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c\ - src/tag.c src/tag_pool.c \ - src/text_input_stream.c src/fifo_buffer.c \ - src/fd_util.c - -test_dump_playlist_LDADD = \ - $(PLAYLIST_LIBS) \ - $(FLAC_LIBS) \ - $(INPUT_LIBS) \ - $(ARCHIVE_LIBS) \ - $(DECODER_LIBS) \ - $(TAG_LIBS) \ - libutil.a \ - $(GLIB_LIBS) -test_dump_playlist_SOURCES = test/dump_playlist.c \ - $(DECODER_SRC) \ - src/io_thread.c src/io_thread.h \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c\ - src/uri.c \ - src/song.c src/tag.c src/tag_pool.c src/tag_save.c \ - src/tag_handler.c src/tag_file.c \ - src/audio_check.c src/pcm_buffer.c \ - src/text_input_stream.c src/fifo_buffer.c \ - src/cue/cue_parser.c src/cue/cue_parser.h \ - src/timer.c \ - src/fd_util.c - -test_run_decoder_LDADD = \ - $(DECODER_LIBS) \ - libpcm.a \ - $(INPUT_LIBS) \ - $(ARCHIVE_LIBS) \ - $(TAG_LIBS) \ - libutil.a \ - $(GLIB_LIBS) -test_run_decoder_SOURCES = test/run_decoder.c \ - test/stdbin.h \ - src/io_thread.c src/io_thread.h \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c src/log.c \ - src/tag.c src/tag_pool.c src/tag_handler.c \ - src/replay_gain_info.c \ - src/uri.c \ - src/fd_util.c \ - src/audio_check.c \ - src/audio_format.c \ - src/timer.c \ - $(ARCHIVE_SRC) \ - $(INPUT_SRC) \ - $(TAG_SRC) \ - $(DECODER_SRC) - -test_read_tags_LDADD = \ - $(DECODER_LIBS) \ - libpcm.a \ - $(INPUT_LIBS) \ - $(ARCHIVE_LIBS) \ - $(TAG_LIBS) \ - libutil.a \ - $(GLIB_LIBS) -test_read_tags_SOURCES = test/read_tags.c \ - src/io_thread.c src/io_thread.h \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c src/log.c \ - src/tag.c src/tag_pool.c src/tag_handler.c \ - src/replay_gain_info.c \ - src/uri.c \ - src/fd_util.c \ - src/audio_check.c \ - src/timer.c \ - $(DECODER_SRC) - -if HAVE_ID3TAG -test_dump_rva2_LDADD = \ - $(ID3TAG_LIBS) \ - $(GLIB_LIBS) -test_dump_rva2_SOURCES = test/dump_rva2.c \ - src/riff.c src/aiff.c \ - src/tag_handler.c \ - src/tag_id3.c \ - src/tag_rva2.c -endif - -test_run_filter_LDADD = \ - $(FILTER_LIBS) \ - $(GLIB_LIBS) -test_run_filter_SOURCES = test/run_filter.c \ - test/stdbin.h \ - src/filter_plugin.c \ - src/filter_registry.c \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c \ - src/audio_check.c \ - src/audio_format.c \ - src/audio_parser.c \ - src/replay_gain_config.c \ - src/replay_gain_info.c \ - src/AudioCompress/compress.c - -if ENABLE_DESPOTIFY -test_read_tags_SOURCES += \ - src/despotify_utils.c -test_run_input_SOURCES += \ - src/despotify_utils.c -test_dump_text_file_SOURCES += \ - src/despotify_utils.c -test_dump_playlist_SOURCES += \ - src/despotify_utils.c -test_run_decoder_SOURCES += \ - src/despotify_utils.c -endif - -if ENABLE_ENCODER -noinst_PROGRAMS += test/run_encoder -test_run_encoder_SOURCES = test/run_encoder.c \ - test/stdbin.h \ - src/fifo_buffer.c src/growing_fifo.c \ - src/conf.c src/tokenizer.c \ - src/utils.c src/string_util.c \ - src/tag.c src/tag_pool.c \ - src/audio_check.c \ - src/audio_format.c \ - src/audio_parser.c -test_run_encoder_LDADD = \ - $(ENCODER_LIBS) \ - libpcm.a \ - $(TAG_LIBS) \ - $(GLIB_LIBS) -endif - -if ENABLE_VORBIS_ENCODER -noinst_PROGRAMS += test/test_vorbis_encoder -test_test_vorbis_encoder_SOURCES = test/test_vorbis_encoder.c \ - test/stdbin.h \ - src/conf.c src/tokenizer.c \ - src/utils.c \ - src/string_util.c \ - src/tag.c src/tag_pool.c \ - src/audio_check.c \ - src/audio_format.c \ - src/audio_parser.c \ - src/pcm_buffer.c \ - src/fifo_buffer.c src/growing_fifo.c \ - $(ENCODER_SRC) -test_test_vorbis_encoder_CPPFLAGS = $(AM_CPPFLAGS) \ - $(ENCODER_CFLAGS) -test_test_vorbis_encoder_LDADD = $(MPD_LIBS) \ - $(ENCODER_LIBS) \ - $(GLIB_LIBS) -endif - -test_software_volume_SOURCES = test/software_volume.c \ - test/stdbin.h \ - src/audio_check.c \ - src/audio_parser.c -test_software_volume_LDADD = \ - $(PCM_LIBS) \ - $(GLIB_LIBS) - -test_run_normalize_SOURCES = test/run_normalize.c \ - test/stdbin.h \ - src/audio_check.c \ - src/audio_parser.c \ - src/AudioCompress/compress.c -test_run_normalize_LDADD = \ - $(GLIB_LIBS) - -test_run_convert_SOURCES = test/run_convert.c \ - src/dsd2pcm/dsd2pcm.c \ - src/fifo_buffer.c \ - src/audio_format.c \ - src/audio_check.c \ - src/audio_parser.c -test_run_convert_LDADD = \ - $(PCM_LIBS) \ - libutil.a \ - $(GLIB_LIBS) - -test_run_output_LDADD = $(MPD_LIBS) \ - $(OUTPUT_LIBS) \ - $(ENCODER_LIBS) \ - libmixer_plugins.a \ - $(FILTER_LIBS) \ - libutil.a \ - $(GLIB_LIBS) -test_run_output_SOURCES = test/run_output.c \ - test/stdbin.h \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c src/log.c \ - src/io_thread.c src/io_thread.h \ - src/audio_check.c \ - src/audio_format.c \ - src/audio_parser.c \ - src/timer.c \ - src/tag.c src/tag_pool.c \ - src/fifo_buffer.c src/growing_fifo.c \ - src/page.c \ - src/socket_util.c \ - src/resolver.c \ - src/output_init.c src/output_finish.c src/output_list.c \ - src/output_plugin.c \ - src/mixer_api.c \ - src/mixer_control.c \ - src/mixer_type.c \ - src/filter_plugin.c \ - src/filter_config.c \ - src/AudioCompress/compress.c \ - src/replay_gain_info.c \ - src/replay_gain_config.c \ - src/fd_util.c \ - src/server_socket.c - -test_read_mixer_LDADD = \ - libpcm.a \ - libmixer_plugins.a \ - $(OUTPUT_LIBS) \ - $(GLIB_LIBS) -test_read_mixer_SOURCES = test/read_mixer.c \ - src/conf.c src/tokenizer.c src/utils.c src/string_util.c src/log.c \ - src/mixer_control.c src/mixer_api.c \ - src/filter_plugin.c \ - src/filter/volume_filter_plugin.c \ - src/fd_util.c - -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.c \ - src/fd_util.c \ - src/fifo_buffer.c \ - src/inotify_source.c -test_run_inotify_LDADD = $(GLIB_LIBS) -endif - -test_test_byte_reverse_SOURCES = \ - test/test_byte_reverse.c -test_test_byte_reverse_LDADD = \ - libutil.a \ - $(GLIB_LIBS) - -test_test_pcm_SOURCES = \ - test/test_pcm_dither.c \ - test/test_pcm_pack.c \ - test/test_pcm_channels.c \ - test/test_pcm_volume.c \ - test/test_pcm_all.h \ - test/test_pcm_main.c -test_test_pcm_LDADD = \ - $(PCM_LIBS) \ - libutil.a \ - $(GLIB_LIBS) - -test_test_queue_priority_SOURCES = \ - src/queue.c \ - test/test_queue_priority.c -test_test_queue_priority_LDADD = \ - $(GLIB_LIBS) - -if HAVE_CXX -noinst_PROGRAMS += src/dsd2pcm/dsd2pcm - -src_dsd2pcm_dsd2pcm_SOURCES = \ - src/dsd2pcm/dsd2pcm.c src/dsd2pcm/dsd2pcm.h \ - src/dsd2pcm/noiseshape.c src/dsd2pcm/noiseshape.h \ - src/dsd2pcm/main.cpp -src_dsd2pcm_dsd2pcm_LDADD = libutil.a -endif - -endif - - -# -# Documentation -# - -man_MANS = doc/mpd.1 doc/mpd.conf.5 -doc_DATA = AUTHORS COPYING NEWS README UPGRADING doc/mpdconf.example - -DOCBOOK_FILES = doc/protocol.xml doc/user.xml doc/developer.xml - -if ENABLE_DOCUMENTATION -protocoldir = $(docdir)/protocol -protocol_DATA = $(wildcard doc/protocol/*.html) - -userdir = $(docdir)/user -user_DATA = $(wildcard doc/user/*.html) - -developerdir = $(docdir)/developer -developer_DATA = $(wildcard doc/developer/*.html) - -if HAVE_XMLTO - -DOCBOOK_HTML = $(patsubst %.xml,%/index.html,$(DOCBOOK_FILES)) - -$(DOCBOOK_HTML): %/index.html: %.xml - $(XMLTO) -o $(@D) --stringparam chunker.output.encoding=utf-8 html $< - -else - -DOCBOOK_HTML = - -endif - -doc/api/html/index.html: doc/doxygen.conf - @mkdir -p $(@D) - $(DOXYGEN) $< - -all-local: $(DOCBOOK_HTML) doc/api/html/index.html - -clean-local: - rm -rf $(patsubst %.xml,%,$(DOCBOOK_FILES)) - rm -rf doc/api - -install-data-local: doc/api/html/index.html - $(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: $(DOCBOOK_HTML) doc/api/html/index.html - rsync -vpruz --delete doc/ www.musicpd.org:/var/www/doc/ \ - --chmod=Dug+rwx,Do+rx,Fug+rw,Fo+r \ - --include=protocol --include=protocol/** \ - --include=user --include=user/** \ - --include=developer --include=developer/** \ - --include=api --include=api/** \ - --exclude=* - -endif - - -# -# Distribution -# - -EXTRA_DIST = $(doc_DATA) autogen.sh \ - $(wildcard scripts/*.sh) \ - $(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \ - src/win/mpd_win32_rc.rc.in diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index f163e35a..00000000 --- a/autogen.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh -# Run this to set up the build system: configure, makefiles, etc. -# (at one point this was based on the version in enlightenment's cvs) - -package="mpd" - -olddir="`pwd`" -srcdir="`dirname $0`" -test -z "$srcdir" && srcdir=. -cd "$srcdir" -DIE= -AM_VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9][0-9]*\).*/\1/" -AC_VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9][0-9]\).*/\1/" -VERSIONMKINT="sed -e s/[^0-9]//" -if test -n "$AM_FORCE_VERSION" -then - AM_VERSIONS="$AM_FORCE_VERSION" -else - AM_VERSIONS='1.11' -fi -if test -n "$AC_FORCE_VERSION" -then - AC_VERSIONS="$AC_FORCE_VERSION" -else - AC_VERSIONS='2.60 2.61' -fi - -versioned_bins () -{ - bin="$1" - needed_int=`echo $VERNEEDED | $VERSIONMKINT` - for i in $VERSIONS - do - i_int=`echo $i | $VERSIONMKINT` - if test $i_int -ge $needed_int - then - echo $bin-$i $bin$i $bin-$i_int $bin$i_int - fi - done - echo $bin -} - -for c in autoconf autoheader automake aclocal -do - uc=`echo $c | tr '[:lower:]' '[:upper:]'` - eval "val=`echo '$'$uc`" - if test -n "$val" - then - echo "$uc=$val in environment, will not attempt to auto-detect" - continue - fi - - case "$c" in - autoconf|autoheader) - VERNEEDED=`fgrep AC_PREREQ configure.ac | $AC_VERSIONGREP` - VERSIONS="$AC_VERSIONS" - pkg=autoconf - ;; - automake|aclocal) - VERNEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $AM_VERSIONGREP` - VERSIONS="$AM_VERSIONS" - pkg=automake - ;; - esac - printf "checking for $c ... " - for x in `versioned_bins $c`; do - ($x --version < /dev/null > /dev/null 2>&1) > /dev/null 2>&1 - if test $? -eq 0 - then - echo $x - eval $uc=$x - break - fi - done - eval "val=`echo '$'$uc`" - if test -z "$val" - then - if test $c = $pkg - then - DIE="$DIE $c=$VERNEEDED" - else - DIE="$DIE $c($pkg)=$VERNEEDED" - fi - fi -done - -if test -n "$DIE" -then - echo "You must have the following installed to compile $package:" - for i in $DIE - do - printf ' ' - echo $i | sed -e 's/(/ (from /' -e 's/=\(.*\)/ (>= \1)/' - done - echo "Download the appropriate package(s) for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - exit 1 -fi - -echo "Generating configuration files for $package, please wait...." - -ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" - -# /usr/share/aclocal is most likely included by default, already... -ac_local_paths=' -/usr/local/share/aclocal -/sw/share/aclocal -/usr/pkg/share/aclocal -/opt/share/aclocal -/usr/gnu/share/aclocal -' - -for i in $ac_local_paths; do - if test -d "$i"; then - ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $i" - # we probably only want one of these... - break - fi -done - -echo " $ACLOCAL $ACLOCAL_FLAGS" -$ACLOCAL $ACLOCAL_FLAGS || exit 1 - -echo " $AUTOHEADER" -$AUTOHEADER || exit 1 - -echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" -$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 - -echo " $AUTOCONF" -$AUTOCONF || exit 1 - -cd "$olddir" -if test x$NOCONFIGURE = x; then - "$srcdir"/configure "$@" || exit 1 -fi diff --git a/configure b/configure new file mode 100755 index 00000000..50a52cf4 --- /dev/null +++ b/configure @@ -0,0 +1,2780 @@ +#!/bin/sh +# +# MPD configure script +# adapted from Libav +# +# Copyright (c) 2000-2002 Fabrice Bellard +# Copyright (c) 2005-2008 Diego Biurrun +# Copyright (c) 2005-2008 Mans Rullgard +# + +# Prevent locale nonsense from breaking basic text processing. +LC_ALL=C +export LC_ALL + +# make sure we are running under a compatible shell +# try to make this part work with most shells + +try_exec(){ + echo "Trying shell $1" + type "$1" > /dev/null 2>&1 && exec "$@" +} + +unset foo +(: ${foo%%bar}) 2> /dev/null +E1="$?" + +(: ${foo?}) 2> /dev/null +E2="$?" + +if test "$E1" != 0 || test "$E2" = 0; then + echo "Broken shell detected. Trying alternatives." + export FF_CONF_EXEC + if test "0$FF_CONF_EXEC" -lt 1; then + FF_CONF_EXEC=1 + try_exec bash "$0" "$@" + fi + if test "0$FF_CONF_EXEC" -lt 2; then + FF_CONF_EXEC=2 + try_exec ksh "$0" "$@" + fi + if test "0$FF_CONF_EXEC" -lt 3; then + FF_CONF_EXEC=3 + try_exec /usr/xpg4/bin/sh "$0" "$@" + fi + echo "No compatible shell script interpreter found." + echo "This configure script requires a POSIX-compatible shell" + echo "such as bash or ksh." + echo "THIS IS NOT A BUG IN MPD, DO NOT REPORT IT AS SUCH." + echo "Instead, install a working POSIX-compatible shell." + echo "Disabling this configure test will create a broken MPD" + if test "$BASH_VERSION" = '2.04.0(1)-release'; then + echo "This bash version ($BASH_VERSION) is broken on your platform." + echo "Upgrade to a later version if available." + fi + exit 1 +fi + +test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH + +show_help(){ + cat <> $logfile +} + +log_file(){ + log BEGIN $1 + pr -n -t $1 >> $logfile + log END $1 +} + +echolog(){ + log "$@" + echo "$@" +} + +warn(){ + log "WARNING: $*" + WARNINGS="${WARNINGS}WARNING: $*\n" +} + +die(){ + echolog "$@" + cat <>file; + } else if (file ~ /\\.asm\$/) { + printf(\"%%define %s %d\\n\", c, v) >>file; + } else if (file ~ /\\.mak\$/) { + n = -v ? \"\" : \"!\"; + printf(\"%s%s=yes\\n\", n, c) >>file; + } + } + }" +} + +print_enabled(){ + suf=$1 + shift + for v; do + enabled $v && printf "%s\n" ${v%$suf}; + done +} + +append(){ + var=$1 + shift + eval "$var=\"\$$var $*\"" +} + +prepend(){ + var=$1 + shift + eval "$var=\"$* \$$var\"" +} + +add_cppflags(){ + append CPPFLAGS "$@" +} + +add_cflags(){ + append CFLAGS $($cflags_filter "$@") +} + +add_ldflags(){ + append LDFLAGS $($ldflags_filter "$@") +} + +add_extralibs(){ + prepend extralibs $($ldflags_filter "$@") +} + +add_host_cppflags(){ + append host_cppflags "$@" +} + +add_host_cflags(){ + append host_cflags $($host_cflags_filter "$@") +} + +add_host_ldflags(){ + append host_ldflags $($host_ldflags_filter "$@") +} + +add_compat(){ + append compat_objs $1 + shift + map 'add_cppflags -D$v' "$@" +} + +check_cmd(){ + log "$@" + "$@" >> $logfile 2>&1 +} + +cc_o(){ + eval printf '%s\\n' $CC_O +} + +cc_e(){ + eval printf '%s\\n' $CC_E +} + +check_cc(){ + log check_cc "$@" + cat > $TMPC + log_file $TMPC + check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC +} + +check_cpp(){ + log check_cpp "$@" + cat > $TMPC + log_file $TMPC + check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC +} + +ld_o(){ + eval printf '%s\\n' $LD_O +} + +check_ld(){ + log check_ld "$@" + flags=$(filter_out '-l*' "$@") + libs=$(filter '-l*' "$@") + check_cc $($cflags_filter $flags) || return + flags=$($ldflags_filter $flags) + libs=$($ldflags_filter $libs) + check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs +} + +check_code(){ + log check_code "$@" + check=$1 + headers=$2 + code=$3 + shift 3 + { + for hdr in $headers; do + echo "#include <$hdr>" + done + echo "int main(void) { $code; return 0; }" + } | check_$check "$@" +} + +check_cppflags(){ + log check_cppflags "$@" + check_cc "$@" < +int x; +EOF +} + +check_func(){ + log check_func "$@" + func=$1 + shift + disable $func + check_ld "$@" < +float foo(float f, float g) { return $func($args); } +int main(void){ return 0; } +EOF +} + +check_func_headers(){ + log check_func_headers "$@" + headers=$1 + funcs=$2 + shift 2 + { + for hdr in $headers; do + echo "#include <$hdr>" + done + for func in $funcs; do + echo "long check_$func(void) { return (long) $func; }" + done + echo "int main(void) { return 0; }" + } | check_ld "$@" && enable $funcs && enable_safe $headers +} + +check_cpp_condition(){ + log check_cpp_condition "$@" + header=$1 + condition=$2 + shift 2 + check_cpp "$@" < +#if !($condition) +#error "unsatisfied condition: $condition" +#endif +EOF +} + +check_lib(){ + log check_lib "$@" + header="$1" + func="$2" + shift 2 + check_header $header && check_func $func "$@" && add_extralibs "$@" +} + +check_lib2(){ + log check_lib2 "$@" + headers="$1" + funcs="$2" + shift 2 + check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@" +} + +check_pkg_config(){ + log check_pkg_config "$@" + pkg="$1" + headers="$2" + funcs="$3" + shift 3 + $pkg_config --exists $pkg || return + pkg_cflags=$($pkg_config --cflags $pkg) + pkg_libs=$($pkg_config --libs $pkg) + check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && + set_safe ${pkg}_cflags $pkg_cflags && + set_safe ${pkg}_libs $pkg_libs + add_cflags $(get_safe ${pkg}_cflags) + add_extralibs $(get_safe ${pkg}_libs) +} + +check_exec(){ + check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } +} + +check_exec_crash(){ + code=$(cat) + + # exit() is not async signal safe. _Exit (C99) and _exit (POSIX) + # are safe but may not be available everywhere. Thus we use + # raise(SIGTERM) instead. The check is run in a subshell so we + # can redirect the "Terminated" message from the shell. SIGBUS + # is not defined by standard C so it is used conditionally. + + (check_exec "$@") >> $logfile 2>&1 < +static void sighandler(int sig){ + raise(SIGTERM); +} +int foo(void){ + $code +} +int main(void){ + signal(SIGILL, sighandler); + signal(SIGFPE, sighandler); + signal(SIGSEGV, sighandler); +#ifdef SIGBUS + signal(SIGBUS, sighandler); +#endif + foo(); +} +EOF +} + +check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable_safe "$type" + check_code cc "$headers" "$type v" "$@" && enable_safe "$type" +} + +check_struct(){ + log check_struct "$@" + headers=$1 + struct=$2 + member=$3 + shift 3 + disable_safe "${struct}_${member}" + check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && + enable_safe "${struct}_${member}" +} + +check_builtin(){ + log check_builtin "$@" + name=$1 + headers=$2 + builtin=$3 + shift 3 + disable "$name" + check_code ld "$headers" "$builtin" "$@" && enable "$name" +} + +require(){ + name="$1" + header="$2" + func="$3" + shift 3 + check_lib $header $func "$@" || die "ERROR: $name not found" +} + +require2(){ + name="$1" + headers="$2" + func="$3" + shift 3 + check_lib2 "$headers" $func "$@" || die "ERROR: $name not found" +} + +require_pkg_config(){ + pkg="$1" + check_pkg_config "$@" || die "ERROR: $pkg not found" + add_cflags $(get_safe ${pkg}_cflags) + add_extralibs $(get_safe ${pkg}_libs) +} + +hostcc_o(){ + eval printf '%s\\n' $HOSTCC_O +} + +check_host_cc(){ + log check_host_cc "$@" + cat > $TMPC + log_file $TMPC + check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC +} + +check_host_cppflags(){ + log check_host_cppflags "$@" + check_host_cc "$@" < "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp" +} + +cp_if_changed(){ + cmp -s "$1" "$2" && echo "$2 is unchanged" && return + mkdir -p "$(dirname $2)" + $cp_f "$1" "$2" +} + +# CONFIG_LIST contains configurable options, while HAVE_LIST is for +# system-dependent things. + +COMPONENT_LIST=" + archives + encoders + inputs + outputs +" + +EXTERNAL_LIBRARY_LIST=" + bzlib + despotify + libao + libasound + libcdio_paranoia + libcurl + libffado + libflac + libiso9660 + libmp3lame + libpulse + libroar + libsamplerate + libsqlite3 + libsoup + libtwolame + libvorbis + libwrap + libyajl + zlib +" + +CONFIG_LIST=" + $COMPONENT_LIST + $EXTERNAL_LIBRARY_LIST + doc + inotify + small + ud +" + +ARCH_LIST=' + aarch64 + alpha + arm + avr32 + avr32_ap + avr32_uc + bfin + ia64 + m68k + mips + mips64 + parisc + ppc + ppc64 + s390 + sh4 + sparc + sparc64 + tilegx + tilepro + tomi + x86 + x86_32 + x86_64 +' + +ARCH_EXT_LIST_ARM=' + armv5te + armv6 + armv6t2 + neon + vfp + vfpv3 +' + +ARCH_EXT_LIST_X86=' + amd3dnow + amd3dnowext + avx + fma4 + mmx + mmxext + sse + sse2 + sse3 + sse4 + sse42 + ssse3 +' + +ARCH_EXT_LIST=" + $ARCH_EXT_LIST_ARM + $ARCH_EXT_LIST_X86 + altivec + ppc4xx + vis +" + +MATH_FUNCS=" + atanf + atan2f + cbrtf + cosf + exp2 + exp2f + expf + isinf + isnan + ldexpf + llrint + llrintf + log2 + log2f + log10f + lrint + lrintf + powf + rint + round + roundf + sinf + trunc + truncf +" + +HAVE_LIST=" + $ARCH_EXT_LIST + $(add_suffix _external $ARCH_EXT_LIST) + $(add_suffix _inline $ARCH_EXT_LIST) + $MATH_FUNCS + accept4 + alsa_asoundlib_h + arpa_inet_h + attribute_may_alias + attribute_packed + cdio_paranoia_h + cdio_paranoia_paranoia_h + closesocket + dos_paths + fork + getaddrinfo + getpeereid + getservbyport + gettimeofday + inet_aton + inotify_init + inotify_init1 + jack_port_get_latency_range + ldbrx + mkfifo + msvcrt + pipe2 + socklen_t + soundcard_h + strtok_r + struct_addrinfo + struct_group_source_req + struct_ip_mreq_source + struct_ipv6_mreq + struct_pollfd + struct_rusage_ru_maxrss + struct_sockaddr_in6 + struct_sockaddr_sa_len + struct_sockaddr_storage + struct_ucred + struct_v4l2_frmivalenum_discrete + syslog + unistd_h + windows_h + winsock2_h +" + +# options emitted with CONFIG_ prefix but not available on the command line +CONFIG_EXTRA=" +" + +CMDLINE_SELECT=" + $ARCH_EXT_LIST + $CONFIG_LIST + cross_compile + debug + extra_warnings + logging + lto + optimizations +" + +PATHS_LIST=' + bindir + confdir + datadir + mandir + prefix +' + +CMDLINE_SET=" + $PATHS_LIST + ar + arch + build_suffix + cc + cpu + cross_prefix + dep_cc + extra_version + host_cc + host_cflags + host_ld + host_ldflags + host_libs + host_os + ld + logfile + nm + optflags + pkg_config + sysinclude + sysroot + target_exec + target_os + target_path + toolchain +" + +CMDLINE_APPEND=" + extra_cflags + host_cppflags +" + +# code dependency declarations + +# architecture extensions + +log2_deps="!msvcrt" + +# archives +iso9660_archive_deps="libiso9660" +bzip2_archive_deps="bzlib" +zzip_archive_deps="zziplib" + +# inputs +curl_input_deps="libcurl" +soup_input_deps="libsoup" +lastfm_input_deps="libcurl" +despotify_input_deps="despotify" +soundcloud_input_deps="libyajl" + +# outputs +alsa_output_deps="alsa_asoundlib_h" +roar_output_deps="libroar" +ao_output_deps="libao" +ffado_output_deps="libffado" +fifo_output_deps="mkfifo" +httpd_output_deps="encoders" +jack_output_deps="libjack" +openal_output_deps="libopenal" +oss_output_deps_any="soundcard_h sys_soundcard_h" +osx_output_deps="AudioUnit CoreAudio CoreServices" +pulse_output_deps="libpulse" +recorder_output_deps="encoders" +shout_output_deps="libshout" +solaris_output_deps="solaris" +winmm_output_deps="winmm" + +# encoders +vorbis_encoder_deps="libvorbis" +lame_encoder_deps="libmp3lame" +twolame_encoder_deps="libtwolame" +flac_encoder_deps="libflac" + +# default parameters + +logfile="config.log" + +# installation paths +prefix_default="/usr/local" +bindir_default='${prefix}/bin' +datadir_default='${prefix}/share/mpd' +mandir_default='${prefix}/share/man' +confdir_default='/etc' + +# toolchain +cc_default="gcc" +host_cc_default="gcc" +cp_f="cp -f" +ln_s="ln -s -f" +nm_default="nm -g" +objformat="elf" +pkg_config_default=pkg-config +ranlib="ranlib" + +nogas=":" + +# machine +arch_default=$(uname -m) +cpu="generic" + +# OS +target_os_default=$(tolower $(uname -s)) +host_os=$target_os_default + +# configurable options +enable debug +enable doc +enable optimizations + +# build settings +FULLNAME='$(NAME)$(BUILDSUF)' + +cflags_filter=echo +ldflags_filter=echo + +CC_C='-c' +CC_E='-E -o $@' +CC_O='-o $@' +LD_O='-o $@' +LD_LIB='-l%' +LD_PATH='-L' +HOSTCC_C='-c' +HOSTCC_O='-o $@' +HOSTLD_O='-o $@' + +host_cflags='-O3 -g' +host_cppflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600' +host_libs='-lm' +host_cflags_filter=echo +host_ldflags_filter=echo + +target_path='$(CURDIR)' + +# since the object filename is not given with the -MM flag, the compiler +# is only able to print the basename, and we must add the path ourselves +DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)' +DEPFLAGS='-MM' + +# find source path +if test -f configure; then + source_path=. +else + source_path=$(cd $(dirname "$0"); pwd) + echo "$source_path" | grep -q '[[:blank:]]' && + die "Out of tree builds are impossible with whitespace in source path." + test -e "$source_path/config.h" && + die "Out of tree builds are impossible with config.h in source dir." +fi + +for v in "$@"; do + r=${v#*=} + l=${v%"$r"} + r=$(sh_quote "$r") + MPD_CONFIGURATION="${MPD_CONFIGURATION# } ${l}${r}" +done + +find_things(){ + thing=$1 + pattern=$2 + file=$source_path/$3 + sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file" +} + +#FIXME +ARCHIVE_LIST=" + bz2_archive + iso9660_archive + zzip_archive +" +ENCODER_LIST=" + flac_encoder + lame_encoder + twolame_encoder + vorbis_encoder + wave_encoder +" +OUTPUT_LIST=" + alsa_output + ao_output + ffado_output + fifo_output + httpd_output + jack_output + mvp_output + null_output + openal_output + oss_output + osx_output + pipe_output + pulse_output + recorder_output + roar_output + shout_output + solaris_output + winmm_output +" + +INPUT_LIST=" + cdio_paranoia_input + curl_input + despotify_input + ffmpeg_input + file_input + rewind_input + soup_input +" + +ALL_COMPONENTS=" + $ARCHIVE_LIST + $ENCODER_LIST + $OUTPUT_LIST + $INPUT_LIST +" + +for n in $COMPONENT_LIST; do + v=$(toupper ${n%s})_LIST + eval enable \$$v + eval ${n}_if_any="\$$v" +done + +enable $ARCH_EXT_LIST + +die_unknown(){ + echo "Unknown option \"$1\"." + echo "See $0 --help for available options." + exit 1 +} + +print_3_columns() { + cat | tr ' ' '\n' | sort | pr -r -3 -t +} + +show_list() { + suffix=_$1 + shift + echo $* | sed s/$suffix//g | print_3_columns + exit 0 +} + +for opt do + optval="${opt#*=}" + case "$opt" in + --extra-ldflags=*) + add_ldflags $optval + ;; + --extra-libs=*) + add_extralibs $optval + ;; + --disable-devices) + disable $INDEV_LIST $OUTDEV_LIST + ;; + --enable-debug=*) + debuglevel="$optval" + ;; + --disable-everything) + map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST + ;; + --disable-all) + map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST + disable $PROGRAM_LIST doc + ;; + --enable-*=*|--disable-*=*) + eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/') + is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt" + eval list=\$$(toupper $thing)_LIST + name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing} + $action $(filter "$name" $list) + ;; + --enable-?*|--disable-?*) + eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g') + if is_in $option $COMPONENT_LIST; then + test $action = disable && action=unset + eval $action \$$(toupper ${option%s})_LIST + elif is_in $option $CMDLINE_SELECT; then + $action $option + else + die_unknown $opt + fi + ;; + --list-*) + NAME="${opt#--list-}" + is_in $NAME $COMPONENT_LIST || die_unknown $opt + NAME=${NAME%s} + eval show_list $NAME \$$(toupper $NAME)_LIST + ;; + --help|-h) show_help + ;; + *) + optname="${opt%%=*}" + optname="${optname#--}" + optname=$(echo "$optname" | sed 's/-/_/g') + if is_in $optname $CMDLINE_SET; then + eval $optname='$optval' + elif is_in $optname $CMDLINE_APPEND; then + append $optname "$optval" + else + die_unknown $opt + fi + ;; + esac +done + +disabled logging && logfile=/dev/null + +echo "# $0 $MPD_CONFIGURATION" > $logfile +set >> $logfile + +test -n "$cross_prefix" && enable cross_compile + +if enabled cross_compile; then + test -n "$arch" && test -n "$target_os" || + die "Must specify target arch and OS when cross-compiling" +fi + +cc_default="${cross_prefix}${cc_default}" +nm_default="${cross_prefix}${nm_default}" +pkg_config_default="${cross_prefix}${pkg_config_default}" +ranlib="${cross_prefix}${ranlib}" + +sysinclude_default="${sysroot}/usr/include" + +case "$toolchain" in + clang-asan) + cc_default="clang" + add_cflags -fsanitize=address + add_ldflags -fsanitize=address + ;; + clang-tsan) + cc_default="clang" + add_cflags -fsanitize=thread -pie + add_ldflags -fsanitize=thread -pie + ;; + msvc) + cc_default="c99wrap cl" + ld_default="c99wrap link" + nm_default="dumpbin -symbols" + target_os_default="win32" + ;; + gcov) + add_cflags -fprofile-arcs -ftest-coverage + add_ldflags -fprofile-arcs -ftest-coverage + ;; + ?*) + die "Unknown toolchain $toolchain" + ;; +esac + +set_default arch cc pkg_config sysinclude target_os +enabled cross_compile || host_cc_default=$cc +set_default host_cc + +if ! $pkg_config --version >/dev/null 2>&1; then + warn "$pkg_config not found, library detection may fail." + pkg_config=false +fi + +exesuf() { + case $1 in + mingw32|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;; + esac +} + +EXESUF=$(exesuf $target_os) +HOSTEXESUF=$(exesuf $host_os) + +# set temporary file name +: ${TMPDIR:=$TEMPDIR} +: ${TMPDIR:=$TMP} +: ${TMPDIR:=/tmp} + +if ! check_cmd mktemp -u XXXXXX; then + # simple replacement for missing mktemp + # NOT SAFE FOR GENERAL USE + mktemp(){ + echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$" + } +fi + +tmpfile(){ + tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 && + (set -C; exec > $tmp) 2>/dev/null || + die "Unable to create temporary file in $TMPDIR." + append TMPFILES $tmp + eval $1=$tmp +} + +trap 'rm -f -- $TMPFILES' EXIT + +tmpfile TMPASM .asm +tmpfile TMPC .c +tmpfile TMPE $EXESUF +tmpfile TMPH .h +tmpfile TMPO .o +tmpfile TMPS .S +tmpfile TMPSH .sh +tmpfile TMPV .ver + +unset -f mktemp + +chmod +x $TMPE + +# make sure we can execute files in $TMPDIR +cat > $TMPSH 2>> $logfile <> $logfile 2>&1 +if ! $TMPSH >> $logfile 2>&1; then + cat <&1 | grep -q '^gcc.*LLVM'; then + _type=llvm_gcc + gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') + _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc -v 2>&1 | grep -qi ^gcc; then + _type=gcc + gcc_version=$($_cc --version | head -n1) + gcc_basever=$($_cc -dumpversion) + gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)') + gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)") + _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver") + if ! $_cc -dumpversion | grep -q '^2\.'; then + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + fi + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc --version 2>/dev/null | grep -q ^icc; then + _type=icc + _ident=$($_cc --version | head -n1) + _depflags='-MMD' + _cflags_speed='-O3' + _cflags_size='-Os' + _cflags_noopt='-O1' + elif $_cc -v 2>&1 | grep -q xlc; then + _type=xlc + _ident=$($_cc -qversion 2>/dev/null | head -n1) + _cflags_speed='-O5' + _cflags_size='-O5 -qcompact' + elif $_cc -V 2>/dev/null | grep -q Compaq; then + _type=ccc + _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3) + _DEPFLAGS='-M' + _cflags_speed='-fast' + _cflags_size='-O1' + _flags_filter=ccc_flags + elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then + test -d "$sysroot" || die "No valid sysroot specified." + _type=armcc + _ident=$($_cc --vsn | head -n1) + armcc_conf="$PWD/armcc.conf" + $_cc --arm_linux_configure \ + --arm_linux_config_file="$armcc_conf" \ + --configure_sysroot="$sysroot" \ + --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 || + die "Error creating armcc configuration file." + $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc + _flags="--arm_linux_config_file=$armcc_conf --translate_gcc" + as_default="${cross_prefix}gcc" + _depflags='-MMD' + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then + _type=tms470 + _ident=$($_cc -version | head -n1 | tr -s ' ') + _flags='--gcc --abi=eabi -me' + _cc_e='-ppl -fe=$@' + _cc_o='-fe=$@' + _depflags='-ppa -ppd=$(@:.o=.d)' + _cflags_speed='-O3 -mf=5' + _cflags_size='-O3 -mf=2' + _flags_filter=tms470_flags + elif $_cc -v 2>&1 | grep -q clang; then + _type=clang + _ident=$($_cc --version | head -n1) + _depflags='-MMD' + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc -V 2>&1 | grep -q Sun; then + _type=suncc + _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) + _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' + _DEPFLAGS='-xM1 -xc99' + _ldflags='-std=c99' + _cflags_speed='-O5' + _cflags_size='-O5 -xspace' + _flags_filter=suncc_flags + elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then + _type=pathscale + _ident=$($_cc -v 2>&1 | head -n1 | tr -d :) + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + _cflags_speed='-O2' + _cflags_size='-Os' + _flags_filter='filter_out -Wdisabled-optimization' + elif $_cc -v 2>&1 | grep -q Open64; then + _type=open64 + _ident=$($_cc -v 2>&1 | head -n1 | tr -d :) + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + _cflags_speed='-O2' + _cflags_size='-Os' + _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' + elif $_cc -V 2>&1 | grep -q Portland; then + _type=pgi + _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')" + opt_common='-alias=ansi -Mdse -Mlre -Mpre' + _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common" + _cflags_size="-O2 -Munroll=c:1 $opt_common" + _cflags_noopt="-O1" + _flags_filter=pgi_flags + elif $_cc 2>&1 | grep -q Microsoft; then + _type=msvc + _ident=$($cc 2>&1 | head -n1) + _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)' + _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' + _cflags_speed="-O2" + _cflags_size="-O1" + # Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it + if $_cc 2>&1 | grep -q Linker; then + _ld_o='-out $@' + else + _ld_o='-Fe$@' + fi + _cc_o='-Fo $@' + _cc_e='-P -Fi $@' + _flags_filter=msvc_flags + _ld_lib='lib%.a' + _ld_path='-libpath:' + _flags='-nologo' + _cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64' + if [ $pfx = hostcc ]; then + append _cflags -Dsnprintf=_snprintf + fi + fi + + eval ${pfx}_type=\$_type + eval ${pfx}_ident=\$_ident +} + +set_ccvars(){ + eval ${1}_C=\${_cc_c-\${${1}_C}} + eval ${1}_E=\${_cc_e-\${${1}_E}} + eval ${1}_O=\${_cc_o-\${${1}_O}} + + if [ -n "$_depflags" ]; then + eval ${1}_DEPFLAGS=\$_depflags + else + eval ${1}DEP=\${_DEPCMD:-\$DEPCMD} + eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS} + eval DEP${1}FLAGS=\$_flags + fi +} + +probe_cc cc "$cc" +cflags_filter=$_flags_filter +cflags_speed=$_cflags_speed +cflags_size=$_cflags_size +cflags_noopt=$_cflags_noopt +add_cflags $_flags $_cflags +add_cflags -I$source_path/src +cc_ldflags=$_ldflags +set_ccvars CC + +probe_cc hostcc "$host_cc" +host_cflags_filter=$_flags_filter +add_host_cflags $_flags $_cflags +set_ccvars HOSTCC + +test -n "$cc_type" && enable $cc_type || + warn "Unknown C compiler $cc, unable to select optimal CFLAGS" + +: ${as_default:=$cc} +: ${dep_cc_default:=$cc} +: ${ld_default:=$cc} +: ${host_ld_default:=$host_cc} +set_default ar as dep_cc ld host_ld + +probe_cc as "$as" +set_ccvars AS + +probe_cc ld "$ld" +ldflags_filter=$_flags_filter +add_ldflags $_flags $_ldflags +test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags +LD_O=${_ld_o-$LD_O} +LD_LIB=${_ld_lib-$LD_LIB} +LD_PATH=${_ld_path-$LD_PATH} + +probe_cc hostld "$host_ld" +host_ldflags_filter=$_flags_filter +add_host_ldflags $_flags $_ldflags +HOSTLD_O=${_ld_o-$HOSTLD_O} + +if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then + probe_cc depcc "$dep_cc" + CCDEP=${_DEPCMD:-$DEPCMD} + CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS} + DEPCCFLAGS=$_flags +fi + +if $ar 2>&1 | grep -q Microsoft; then + arflags="-nologo" + ar_o='-out:$@' +elif $ar 2>&1 | grep -q 'Texas Instruments'; then + arflags="rq" + ar_o='$@' +else + arflags="rc" + ar_o='$@' +fi + +add_cflags $extra_cflags + +if test -n "$sysroot"; then + case "$cc_type" in + gcc|llvm_gcc|clang) + add_cppflags --sysroot="$sysroot" + add_ldflags --sysroot="$sysroot" + ;; + tms470) + add_cppflags -I"$sysinclude" + add_ldflags --sysroot="$sysroot" + ;; + esac +fi + +if test "$cpu" = host; then + enabled cross_compile && die "--cpu=host makes no sense when cross-compiling." + + case "$cc_type" in + gcc|llvm_gcc) + check_native(){ + $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return + sed -n "/cc1.*$1=/{ + s/.*$1=\\([^ ]*\\).*/\\1/ + p + q + }" $TMPE + } + cpu=$(check_native -march || check_native -mcpu) + ;; + esac + + test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc" +fi + +# Deal with common $arch aliases +case "$arch" in + aarch64|arm64) + arch="aarch64" + ;; + arm*) + arch="arm" + ;; + mips*|IP*) + arch="mips" + ;; + parisc*|hppa*) + arch="parisc" + ;; + "Power Macintosh"|ppc*|powerpc*) + arch="ppc" + ;; + s390|s390x) + arch="s390" + ;; + sh4|sh) + arch="sh4" + ;; + sun4u|sparc*) + arch="sparc" + ;; + tilegx|tile-gx) + arch="tilegx" + ;; + i[3-6]86|i86pc|BePC|x86pc|x86_64|amd64) + arch="x86" + ;; +esac + +is_in $arch $ARCH_LIST || warn "unknown architecture $arch" +enable $arch + +# Add processor-specific flags +if enabled aarch64; then + + case $cpu in + armv*) + cpuflags="-march=$cpu" + ;; + *) + cpuflags="-mcpu=$cpu" + ;; + esac + +elif enabled alpha; then + + cpuflags="-mcpu=$cpu" + +elif enabled arm; then + + check_arm_arch() { + check_cpp_condition stddef.h \ + "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \ + $cpuflags + } + + probe_arm_arch() { + if check_arm_arch 4; then echo armv4; + elif check_arm_arch 4T; then echo armv4t; + elif check_arm_arch 5; then echo armv5; + elif check_arm_arch 5E; then echo armv5e; + elif check_arm_arch 5T; then echo armv5t; + elif check_arm_arch 5TE; then echo armv5te; + elif check_arm_arch 5TEJ; then echo armv5te; + elif check_arm_arch 6; then echo armv6; + elif check_arm_arch 6J; then echo armv6j; + elif check_arm_arch 6K; then echo armv6k; + elif check_arm_arch 6Z; then echo armv6z; + elif check_arm_arch 6ZK; then echo armv6zk; + elif check_arm_arch 6T2; then echo armv6t2; + elif check_arm_arch 7; then echo armv7; + elif check_arm_arch 7A 7_A; then echo armv7-a; + elif check_arm_arch 7R 7_R; then echo armv7-r; + elif check_arm_arch 7M 7_M; then echo armv7-m; + elif check_arm_arch 7EM 7E_M; then echo armv7-m; + elif check_arm_arch 8A 8_A; then echo armv8-a; + fi + } + + [ "$cpu" = generic ] && cpu=$(probe_arm_arch) + + case $cpu in + armv*) + cpuflags="-march=$cpu" + subarch=$(echo $cpu | sed 's/[^a-z0-9]//g') + ;; + *) + cpuflags="-mcpu=$cpu" + case $cpu in + cortex-a*) subarch=armv7a ;; + cortex-r*) subarch=armv7r ;; + cortex-m*) enable thumb; subarch=armv7m ;; + arm11*) subarch=armv6 ;; + arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;; + armv4*|arm7*|arm9[24]*) subarch=armv4 ;; + *) subarch=$(probe_arm_arch) ;; + esac + ;; + esac + + case "$subarch" in + armv5t*) enable fast_clz ;; + armv[6-8]*) enable fast_clz fast_unaligned ;; + esac + +elif enabled avr32; then + + case $cpu in + ap7[02]0[0-2]) + subarch="avr32_ap" + cpuflags="-mpart=$cpu" + ;; + ap) + subarch="avr32_ap" + cpuflags="-march=$cpu" + ;; + uc3[ab]*) + subarch="avr32_uc" + cpuflags="-mcpu=$cpu" + ;; + uc) + subarch="avr32_uc" + cpuflags="-march=$cpu" + ;; + esac + +elif enabled bfin; then + + cpuflags="-mcpu=$cpu" + +elif enabled mips; then + + cpuflags="-march=$cpu" + +elif enabled ppc; then + + case $(tolower $cpu) in + 601|ppc601|powerpc601) + cpuflags="-mcpu=601" + disable altivec + ;; + 603*|ppc603*|powerpc603*) + cpuflags="-mcpu=603" + disable altivec + ;; + 604*|ppc604*|powerpc604*) + cpuflags="-mcpu=604" + disable altivec + ;; + g3|75*|ppc75*|powerpc75*) + cpuflags="-mcpu=750" + disable altivec + ;; + g4|745*|ppc745*|powerpc745*) + cpuflags="-mcpu=7450" + ;; + 74*|ppc74*|powerpc74*) + cpuflags="-mcpu=7400" + ;; + g5|970|ppc970|powerpc970) + cpuflags="-mcpu=970" + ;; + power[3-7]*) + cpuflags="-mcpu=$cpu" + ;; + cell) + cpuflags="-mcpu=cell" + enable ldbrx + ;; + e500mc) + cpuflags="-mcpu=e500mc" + disable altivec + ;; + e500v2) + cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double" + disable altivec + ;; + e500) + cpuflags="-mcpu=8540 -mhard-float" + disable altivec + ;; + esac + +elif enabled sparc; then + + case $cpu in + cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789]) + cpuflags="-mcpu=$cpu" + disable vis + ;; + ultrasparc*|niagara[234]) + cpuflags="-mcpu=$cpu" + ;; + esac + +elif enabled x86; then + + case $cpu in + i[345]86|pentium) + cpuflags="-march=$cpu" + disable mmx + ;; + # targets that do NOT support conditional mov (cmov) + pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) + cpuflags="-march=$cpu" + disable cmov + ;; + # targets that do support conditional mov (cmov) + i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*) + cpuflags="-march=$cpu" + enable cmov + enable fast_cmov + ;; + # targets that do support conditional mov but on which it's slow + pentium4|pentium4m|prescott|nocona) + cpuflags="-march=$cpu" + enable cmov + disable fast_cmov + ;; + esac + +fi + +if [ "$cpu" != generic ]; then + add_cflags $cpuflags +fi + +# compiler sanity check +check_exec < +EOF +check_cc -D_LARGEFILE_SOURCE < +EOF + +check_host_cflags -std=gnu99 +check_host_cflags -Wall + +check_64bit(){ + arch32=$1 + arch64=$2 + expr=$3 + check_code cc "" "int test[2*($expr) - 1]" && + subarch=$arch64 || subarch=$arch32 +} + +case "$arch" in + aarch64|alpha|ia64) + spic=$shared + ;; + mips) + check_64bit mips mips64 '_MIPS_SIM > 1' + spic=$shared + ;; + parisc) + check_64bit parisc parisc64 'sizeof(void *) > 4' + spic=$shared + ;; + ppc) + check_64bit ppc ppc64 'sizeof(void *) > 4' + spic=$shared + ;; + sparc) + check_64bit sparc sparc64 'sizeof(void *) > 4' + spic=$shared + ;; + x86) + check_64bit x86_32 x86_64 'sizeof(void *) > 4' + if test "$subarch" = "x86_64"; then + spic=$shared + fi + ;; +esac + +enable $subarch +enabled spic && enable pic + +# OS specific +case $target_os in + haiku) + prefix_default="/boot/common" + network_extralibs="-lnetwork" + host_libs= + ;; + sunos) + network_extralibs="-lsocket -lnsl" + add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 + # When using suncc to build, the Solaris linker will mark + # an executable with each instruction set encountered by + # the Solaris assembler. As our libraries contain their own + # guards for processor-specific code, instead suppress + # generation of the HWCAPS ELF section on Solaris x86 only. + enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile + nm_default='nm -P -g' + ;; + netbsd) + oss_output_extralibs="-lossaudio" + ;; + openbsd|bitrig) + SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)' + SLIB_INSTALL_LINKS= + oss_output_extralibs="-lossaudio" + ;; + dragonfly) + ;; + freebsd) + ;; + bsd/os) + add_extralibs -lpoll -lgnugetopt + ;; + darwin) + gas="gas-preprocessor.pl $cc" + add_ldflags -Wl,-dynamic,-search_paths_first + SLIBSUF=".dylib" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)' + objformat="macho" + enabled x86_64 && objformat="macho64" + ;; + mingw32) + LIBTARGET=i386 + if enabled x86_64; then + LIBTARGET="i386:x86-64" + elif enabled arm; then + LIBTARGET=arm-wince + fi + shlibdir_default="$bindir_default" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_LINKS= + SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' + SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' + objformat="win32" + dlltool="${cross_prefix}dlltool" + ranlib=: + enable dos_paths + ;; + win32|win64) + if enabled shared; then + # Link to the import library instead of the normal static library + # for shared libs. + LD_LIB='%.lib' + # Cannot build shared and static libraries at the same time with + # MSVC. + disable static + fi + shlibdir_default="$bindir_default" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIB_CREATE_DEF_CMD='makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' + SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_LINKS= + SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' + SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' + objformat="win32" + ranlib=: + enable dos_paths + ;; + cygwin*) + target_os=cygwin + shlibdir_default="$bindir_default" + SLIBPREF="cyg" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_LINKS= + SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a' + objformat="win32" + enable dos_paths + ;; + *-dos|freedos|opendos) + network_extralibs="-lsocket" + objformat="coff" + enable dos_paths + add_cppflags -U__STRICT_ANSI__ + ;; + linux) + enable dv1394 + ;; + irix*) + target_os=irix + ranlib="echo ignoring ranlib" + ;; + os/2*) + ln_s="cp -f" + objformat="aout" + add_cppflags -D_GNU_SOURCE + add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap + LIBSUF="_s.a" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)' + SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \ + echo PROTMODE >> $(SUBDIR)$(NAME).def; \ + echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \ + echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \ + echo EXPORTS >> $(SUBDIR)$(NAME).def; \ + emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def' + SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \ + emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' + SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib' + enable dos_paths + ;; + gnu/kfreebsd) + add_cppflags -D_BSD_SOURCE + ;; + gnu) + ;; + qnx) + add_cppflags -D_QNX_SOURCE + network_extralibs="-lsocket" + ;; + symbian) + SLIBSUF=".dll" + enable dos_paths + add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default + add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS + add_ldflags -Wl,--target1-abs,--no-undefined \ + -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \ + -Wl,--entry=_E32Startup -Wl,-u,_E32Startup + add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \ + -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \ + -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib + ;; + osf1) + add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT + ;; + minix) + ;; + plan9) + add_cppflags -D_C99_SNPRINTF_EXTENSION \ + -D_REENTRANT_SOURCE \ + -D_RESEARCH_SOURCE \ + -DFD_SETSIZE=96 \ + -DHAVE_SOCK_OPTS + add_compat strtod.o strtod=avpriv_strtod + network_extralibs='-lbsd' + exeobjs=compat/plan9/main.o + disable avserver + cp_f='cp' + ;; + none) + ;; + *) + die "Unknown OS '$target_os'." + ;; +esac + +# determine libc flavour + +# uclibc defines __GLIBC__, so it needs to be checked before glibc. +if check_cpp_condition features.h "defined __UCLIBC__"; then + libc_type=uclibc + add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 +elif check_cpp_condition features.h "defined __GLIBC__"; then + libc_type=glibc + add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 +# MinGW headers can be installed on Cygwin, so check for newlib first. +elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + libc_type=newlib + add_cppflags -U__STRICT_ANSI__ +elif check_header _mingw.h; then + libc_type=mingw + check_cpp_condition _mingw.h \ + "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \ + (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || + die "ERROR: MinGW runtime version must be >= 3.15." + add_cppflags -U__STRICT_ANSI__ +elif check_func_headers stdlib.h _get_doserrno; then + libc_type=msvcrt + add_compat strtod.o strtod=avpriv_strtod + add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ + _snprintf=avpriv_snprintf \ + vsnprintf=avpriv_vsnprintf +elif check_cpp_condition stddef.h "defined __KLIBC__"; then + libc_type=klibc +fi + +test -n "$libc_type" && enable $libc_type + +# hacks for compiler/libc/os combinations + +if enabled_all tms470 glibc; then + CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}" + add_cppflags -D__USER_LABEL_PREFIX__= + add_cppflags -D__builtin_memset=memset + add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED + add_cflags -pds=48 # incompatible redefinition of macro +fi + +if enabled_all ccc glibc; then + add_ldflags -Wl,-z,now # calls to libots crash without this +fi + +esc(){ + echo "$*" | sed 's/%/%25/g;s/:/%3a/g' +} + +check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic + +set_default $PATHS_LIST +set_default nm + +disabled optimizations || check_cflags -fomit-frame-pointer + +enable_pic() { + enable pic + add_cppflags -DPIC + add_cflags -fPIC +} + +enabled pic && enable_pic + +check_cc <= AV_VERSION_INT(55, 0, 0)" || + die "ERROR: libavcodec not found" +check_lib libavformat/avformat.h avformat_open_input -lavformat && + check_cpp_condition libavformat/avformat.h "LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55, 0, 0)" || + die "ERROR: libavformat not found" +check_lib libavutil/avutil.h avutil_configuration -lavutil && + check_cpp_condition libavutil/avutil.h "LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 8, 0)" || + die "ERROR: libavutil not found" +check_lib libavresample/avresample.h avresample_open -lavresample && + check_cpp_condition libavresample/avresample.h "LIBAVRESAMPLE_VERSION_INT >= AV_VERSION_INT(1, 0, 0)" || + die "ERROR: libavresample not found" + +check_pkg_config glib-2.0 glib.h g_main_loop_new || die "ERROR: glib not found" +check_pkg_config gthread-2.0 glib.h g_thread_init || die "ERROR: gthread not found" + +check_type "sys/types.h sys/socket.h" socklen_t +check_type netdb.h "struct addrinfo" +check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE +check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE +check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE +check_type netinet/in.h "struct sockaddr_in6" +check_type poll.h "struct pollfd" +check_type "sys/types.h sys/socket.h" "struct sockaddr_storage" +check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len +check_type "sys/socket.h" "struct ucred" -D_GNU_SOURCE +check_type netinet/sctp.h "struct sctp_event_subscribe" +check_func getpeereid $network_extralibs +check_func getaddrinfo $network_extralibs +check_func getservbyport $network_extralibs +# Prefer arpa/inet.h over winsock2 +if check_header arpa/inet.h ; then + check_func closesocket +elif check_header winsock2.h ; then + check_func_headers winsock2.h closesocket -lws2 && + network_extralibs="-lws2" || + { check_func_headers winsock2.h closesocket -lws2_32 && + network_extralibs="-lws2_32"; } + check_func_headers ws2tcpip.h getaddrinfo $network_extralibs + check_type ws2tcpip.h socklen_t + check_type ws2tcpip.h "struct addrinfo" + check_type ws2tcpip.h "struct group_source_req" + check_type ws2tcpip.h "struct ip_mreq_source" + check_type ws2tcpip.h "struct ipv6_mreq" + check_type winsock2.h "struct pollfd" + check_type ws2tcpip.h "struct sockaddr_in6" + check_type ws2tcpip.h "struct sockaddr_storage" + check_struct winsock2.h "struct sockaddr" sa_len +else + die "ERROR: no usable networking implementation could be found" +fi + +check_func accept4 +check_func fork +check_func gettimeofday +check_func inet_aton $network_extralibs +check_func inotify_init +check_func inotify_init1 +check_func mkfifo +check_func pipe2 +check_func strtok_r + +for lib in -lbsd -linet -lsocket; do + check_func syslog $lib && break +done + +disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib +disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib + + +check_lib math.h sin -lm && LIBM="-lm" + +atan2f_args=2 +ldexpf_args=2 +powf_args=2 + +for func in $MATH_FUNCS; do + eval check_mathfunc $func \${${func}_args:-1} +done + +texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html + +check_header sys/soundcard.h +check_header soundcard.h + +check_lib2 ao/ao.h ao_open_live -lao && enable libao +check_lib2 alsa/asoundlib.h snd_pcm_open -lasound && enable libasound +check_pkg_config roar roaraudio.h roar_simple_connect && enable libroar +check_lib2 jack/jack.h jack_client_open -ljack && check_func jack_port_get_latency_range -ljack && enable libjack +check_lib2 libffado/ffado.h ffado_streaming_init -lffado && enable libffado +check_lib2 shout/shout.h shout_init -lshout && enable libshout +check_header OpenAL/al.h && check_header OpenAL/alc.h && enable libopenal +check_pkg_config libpulse-simple pulse/simple.h pa_simple_new && enable libpulse +check_lib2 windows.h waveOutOpen -lwinmm && enable winmm + +check_lib2 FLAC/stream_encoder.h FLAC__stream_encoder_new -lFLAC && enable libflac +check_lib vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg && enable libvorbis +check_lib lame/lame.h lame_set_VBR_quality -lmp3lame && enable libmp3lame +check_lib twolame.h twolame_init -ltwolame && enable libtwolame + +check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio && enable libcdio_paranoia +check_lib2 "cdio/cdio.h cdio/iso9660.h" iso9660_open -liso9660 -lcdio && enable libiso9660 +check_pkg_config zziplib zzip/zzip.h zzip_dir_open && enable zziplib + +check_pkg_config curl libcurl curl/curl.h curl_global_init && enable libcurl +check_pkg_config soup "libsoup/soup-uri.h libsoup/soup-session-async.h" soup_message_new && enable libsoup +check_pkg_config despotify despotify.h despotify_play && enable despotify +check_pkg_config yajl yajl/yajl_parse.h yajl_parse && enable libyajl + +check_lib samplerate.h src_new -lsamplerate && enable libsamplerate +check_lib sqlite3.h sqlite3_open -lsqlite3 && enable libsqlite3 + +check_lib tcpd.h hosts_access -lwrap && enable libwrap + +enabled debug && add_cflags -g"$debuglevel" + +# add some useful compiler flags if supported +check_cflags -Wdeclaration-after-statement +check_cflags -Wall +check_cflags -Wno-parentheses +check_cflags -Wno-switch +check_cflags -Wno-format-zero-length +check_cflags -Wdisabled-optimization +check_cflags -Wpointer-arith +check_cflags -Wredundant-decls +check_cflags -Wno-pointer-sign +check_cflags -Wcast-qual +check_cflags -Wwrite-strings +check_cflags -Wtype-limits +check_cflags -Wundef +check_cflags -Wmissing-prototypes +check_cflags -Wstrict-prototypes +enabled extra_warnings && check_cflags -Winline + +# add some linker flags +check_ldflags -Wl,--warn-common + +if [ -z "$optflags" ]; then + if enabled small; then + optflags=$cflags_size + elif enabled optimizations; then + optflags=$cflags_speed + else + optflags=$cflags_noopt + fi +fi + +check_optflags(){ + check_cflags "$@" + enabled lto && check_ldflags "$@" +} + + +if enabled lto; then + test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker" + check_cflags -flto + check_ldflags -flto $cpuflags +fi + +check_optflags $optflags +check_optflags -fno-math-errno +check_optflags -fno-signed-zeros + +if enabled icc; then + # Just warnings, no remarks + check_cflags -w1 + # -wd: Disable following warnings + # 144, 167, 556: -Wno-pointer-sign + # 1292: attribute "foo" ignored + # 1419: external declaration in primary source file + # 10006: ignoring unknown option -fno-signed-zeros + # 10148: ignoring unknown option -Wno-parentheses + # 10156: ignoring option '-W'; no argument required + check_cflags -wd144,167,556,1292,1419,10006,10148,10156 + # 11030: Warning unknown option --as-needed + # 10156: ignoring option '-export'; no argument required + check_ldflags -wd10156,11030 + # icc 11.0 and 11.1 work with ebp_available, but don't pass the test + enable ebp_available + if enabled x86_32; then + icc_version=$($cc -dumpversion) + test ${icc_version%%.*} -ge 11 && + check_cflags -falign-stack=maintain-16-byte || + disable aligned_stack + fi +elif enabled ccc; then + # disable some annoying warnings + add_cflags -msg_disable bitnotint + add_cflags -msg_disable mixfuncvoid + add_cflags -msg_disable nonstandcast + add_cflags -msg_disable unsupieee +elif enabled gcc; then + check_optflags -fno-tree-vectorize + check_cflags -Werror=implicit-function-declaration + check_cflags -Werror=missing-prototypes + check_cflags -Werror=return-type + #FIXME check_cflags -Werror=declaration-after-statement + #FIXME check_cflags -Werror=vla +elif enabled llvm_gcc; then + check_cflags -mllvm -stack-alignment=16 +elif enabled clang; then + check_cflags -mllvm -stack-alignment=16 + check_cflags -Qunused-arguments + check_cflags -Werror=implicit-function-declaration + check_cflags -Werror=missing-prototypes + check_cflags -Werror=return-type +elif enabled armcc; then + # 2523: use of inline assembler is deprecated + add_cflags -W${armcc_opt},--diag_suppress=2523 + add_cflags -W${armcc_opt},--diag_suppress=1207 + add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition + add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat + add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign + add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign +elif enabled tms470; then + add_cflags -pds=824 -pds=837 +elif enabled pathscale; then + add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF +elif enabled msvc; then + enabled x86_32 && disable aligned_stack +fi + +case $target_os in + osf1) + enabled ccc && add_ldflags '-Wl,-expect_unresolved,*' + ;; + plan9) + add_cppflags -Dmain=plan9_main + ;; +esac + +enabled ud && { enabled struct_ucred || enabled getpeereid || die "ERROR: cannot enable Unix domain sockets"; } + +enabled inotify && enabled inotify_init || die "ERROR: inotify_init() not found" + +enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } + +check_deps $CONFIG_LIST \ + $CONFIG_EXTRA \ + $HAVE_LIST \ + $ALL_COMPONENTS \ + +echo "install prefix $prefix" +echo "source path $source_path" +echo "C compiler $cc" +echo "ARCH $arch ($cpu)" +if test "$build_suffix" != ""; then + echo "build suffix $build_suffix" +fi +if test "$extra_version" != ""; then + echo "version string suffix $extra_version" +fi +echo "debug symbols ${debug-no}" +echo "optimize for size ${small-no}" +echo "optimizations ${optimizations-no}" +echo "Unix domain sockets ${ud-no}" +echo "Inotify DB updates ${inotify-no}" + +echo "External libraries:" +print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns +echo + +for type in encoder input output archive; do + echo "Enabled ${type}s:" + eval list=\$$(toupper $type)_LIST + print_enabled '_*' $list | print_3_columns + echo +done + +echo "Creating config.mak and config.h..." + +test -e Makefile || $ln_s "$source_path/Makefile" . + +config_files="$TMPH config.mak" + +cat > config.mak < $TMPH <>$TMPH + +print_config ARCH_ "$config_files" $ARCH_LIST +print_config HAVE_ "$config_files" $HAVE_LIST +print_config CONFIG_ "$config_files" $CONFIG_LIST \ + $CONFIG_EXTRA \ + $ALL_COMPONENTS \ + +echo "#endif /* MPD_CONFIG_H */" >> $TMPH + +# Do not overwrite an unchanged config.h to avoid superfluous rebuilds. +cp_if_changed $TMPH config.h +touch .config + +test -n "$WARNINGS" && printf "\n$WARNINGS" diff --git a/configure.ac b/configure.ac deleted file mode 100644 index a56e0095..00000000 --- a/configure.ac +++ /dev/null @@ -1,1234 +0,0 @@ -AC_PREREQ(2.60) - -AC_INIT(mpd, 0.18~git, musicpd-dev-team@lists.sourceforge.net) - -VERSION_MAJOR=0 -VERSION_MINOR=17 -VERSION_REVISION=0 -VERSION_EXTRA=0 - -AC_CONFIG_SRCDIR([src/main.c]) -AM_INIT_AUTOMAKE([foreign 1.11 dist-bzip2 subdir-objects]) -AM_SILENT_RULES -AC_CONFIG_HEADERS(config.h) -AC_CONFIG_MACRO_DIR([m4]) - -AC_DEFINE(PROTOCOL_VERSION, "0.17.0", [The MPD protocol version]) - - -dnl --------------------------------------------------------------------------- -dnl Programs -dnl --------------------------------------------------------------------------- -AC_PROG_CC_C99 -AC_PROG_CXX -AC_PROG_RANLIB - -HAVE_CXX=yes -if test x$CXX = xg++; then - # CXX=g++ probably means that autoconf hasn't found any C++ - # compiler; to be sure, we check again - AC_PATH_PROG(CXX, $CXX, no) - if test x$CXX = xno; then - # no, we don't have C++ - the following hack is - # required because automake insists on using $(CXX) - # for linking the MPD binary - AC_MSG_NOTICE([Disabling C++ support]) - CXX="$CC" - HAVE_CXX=no - fi -fi -AM_CONDITIONAL(HAVE_CXX, test x$HAVE_CXX = xyes) - -AC_PROG_INSTALL -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG - -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 - -case "$host_os" in -mingw32* | windows*) - AC_CONFIG_FILES([ - src/win/mpd_win32_rc.rc - ]) - AC_CHECK_TOOL(WINDRES, windres) - AM_CPPFLAGS="$AM_CPPFLAGS -DWINVER=0x0501" - LIBS="$LIBS -lws2_32" - HAVE_WINDOWS=1 - ;; -esac -AM_CONDITIONAL([HAVE_WINDOWS], [test x$HAVE_WINDOWS = x1]) - -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 Header/Library Checks -dnl --------------------------------------------------------------------------- -AC_CHECK_FUNCS(daemon fork) - -AC_SEARCH_LIBS([syslog], [bsd socket inet], - [AC_DEFINE(HAVE_SYSLOG, 1, [Define if syslog() is available])]) - -AC_SEARCH_LIBS([socket], [socket]) -AC_SEARCH_LIBS([gethostbyname], [nsl]) - -AC_CHECK_FUNCS(pipe2 accept4) - -AC_SEARCH_LIBS([exp], [m],, - [AC_MSG_ERROR([exp() not found])]) - -AC_CHECK_HEADERS(locale.h) -AC_CHECK_HEADERS(valgrind/memcheck.h) - -dnl --------------------------------------------------------------------------- -dnl Allow tools to be specifically built -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(alsa, - AS_HELP_STRING([--enable-alsa], [enable ALSA support]),, - [enable_alsa=auto]) - -AC_ARG_ENABLE(roar, - AS_HELP_STRING([--enable-roar], - [enable support for RoarAudio]),, - [enable_roar=auto]) - -AC_ARG_ENABLE(ao, - AS_HELP_STRING([--enable-ao], - [enable support for libao]),, - enable_ao=auto) - -AC_ARG_ENABLE(bzip2, - AS_HELP_STRING([--enable-bzip2], - [enable bzip2 archive support (default: disabled)]),, - enable_bzip2=no) - -AC_ARG_ENABLE(cdio-paranoia, - AS_HELP_STRING([--enable-cdio-paranoia], - [enable support for audio CD support]),, - enable_cdio_paranoia=auto) - -AC_ARG_ENABLE(curl, - AS_HELP_STRING([--enable-curl], - [enable support for libcurl HTTP streaming (default: auto)]),, - [enable_curl=auto]) - -AC_ARG_ENABLE(soup, - AS_HELP_STRING([--enable-soup], - [enable support for libsoup HTTP streaming (default: auto)]),, - [enable_soup=auto]) - -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(ffado, - AS_HELP_STRING([--enable-ffado], [enable libffado (FireWire) support]),, - [enable_ffado=no]) - -AC_ARG_ENABLE(ffmpeg, - AS_HELP_STRING([--enable-ffmpeg], - [enable FFMPEG support]),, - enable_ffmpeg=auto) - -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(id3, - AS_HELP_STRING([--enable-id3], - [enable id3 support]),, - enable_id3=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_ARG_ENABLE(iso9660, - AS_HELP_STRING([--enable-iso9660], - [enable iso9660 archive support (default: disabled)]),, - enable_iso9660=no) - -AC_ARG_ENABLE(jack, - AS_HELP_STRING([--enable-jack], - [enable jack support]),, - enable_jack=auto) - -AC_SYS_LARGEFILE - -AC_ARG_ENABLE(lastfm, - AS_HELP_STRING([--enable-lastfm], - [enable support for last.fm radio (default: disable)]),, - [enable_lastfm=no]) - -AC_ARG_ENABLE(despotify, - AS_HELP_STRING([--enable-despotify], - [enable support for despotify (default: disable)]),, - [enable_despotify=no]) - -AC_ARG_ENABLE(soundcloud, - AS_HELP_STRING([--enable-soundcloud], - [enable support for soundcloud.com]),, - [enable_soundcloud=auto]) - -AC_ARG_ENABLE(lame-encoder, - AS_HELP_STRING([--enable-lame-encoder], - [enable the LAME mp3 encoder]),, - enable_lame_encoder=auto) - -AC_ARG_ENABLE([libwrap], - AS_HELP_STRING([--enable-libwrap], [use libwrap]),, - [enable_libwrap=auto]) - -AC_ARG_ENABLE(lsr, - AS_HELP_STRING([--enable-lsr], - [enable libsamplerate support]),, - enable_lsr=auto) - -AC_ARG_ENABLE(mms, - AS_HELP_STRING([--enable-mms], - [enable the MMS protocol with libmms]),, - [enable_mms=auto]) - -AC_ARG_ENABLE(mvp, - AS_HELP_STRING([--enable-mvp], - [enable support for Hauppauge Media MVP (default: disable)]),, - enable_mvp=no) - -AC_ARG_ENABLE(openal, - AS_HELP_STRING([--enable-openal], - [enable OpenAL support (default: disable)]),, - enable_openal=no) - -AC_ARG_ENABLE(oss, - AS_HELP_STRING([--disable-oss], - [disable OSS support (default: enable)]),, - enable_oss=yes) - -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(pulse, - AS_HELP_STRING([--enable-pulse], - [enable support for the PulseAudio sound server]),, - enable_pulse=auto) - -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(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=auto]) - -AC_ARG_ENABLE(sqlite, - AS_HELP_STRING([--enable-sqlite], - [enable support for the SQLite database]),, - [enable_sqlite=auto]) - -AC_ARG_ENABLE(systemd-daemon, - AS_HELP_STRING([--enable-systemd-daemon], - [use the systemd daemon library (default=auto)]),, - [enable_systemd_daemon=auto]) - -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(twolame-encoder, - AS_HELP_STRING([--enable-twolame-encoder], - [enable the TwoLAME mp2 encoder]),, - enable_twolame_encoder=auto) - -AC_ARG_ENABLE(un, - AS_HELP_STRING([--disable-un], - [disable support for clients connecting via unix domain sockets (default: enable)]),, - [enable_un=yes]) - -AC_ARG_ENABLE(vorbis-encoder, - AS_HELP_STRING([--enable-vorbis-encoder], - [enable the Ogg Vorbis encoder]),, - [enable_vorbis_encoder=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") - -AC_ARG_ENABLE(zzip, - AS_HELP_STRING([--enable-zzip], - [enable zip archive support (default: disabled)]),, - enable_zzip=no) - - -AC_ARG_WITH(tremor-libraries, - AS_HELP_STRING([--with-tremor-libraries=DIR], - [directory where Tremor library is installed (optional)]),, - tremor_libraries="") - -AC_ARG_WITH(tremor-includes, - AS_HELP_STRING([--with-tremor-includes=DIR], - [directory where Tremor header files are installed (optional)]),, - tremor_includes="") - -dnl --------------------------------------------------------------------------- -dnl Mandatory Libraries -dnl --------------------------------------------------------------------------- -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16 gthread-2.0],, - [AC_MSG_ERROR([GLib 2.16 is required])]) - -if test x$GCC = xyes; then - # suppress warnings in the GLib headers - GLIB_CFLAGS=`echo $GLIB_CFLAGS |sed -e 's,-I/,-isystem /,g'` -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 -#ifdef WIN32 -#include -#else -#include -#endif -#include -#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 - -case "$host_os" in -mingw* | windows* | cygwin*) - enable_un=no - ;; -esac - -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_AUTO_PKG(systemd_daemon, SYSTEMD_DAEMON, libsystemd-daemon, - [systemd activation], [libsystemd-daemon not found]) -AM_CONDITIONAL(ENABLE_SYSTEMD_DAEMON, test x$enable_systemd_daemon = xyes) -if test x$enable_systemd_daemon = xyes; then - AC_DEFINE([ENABLE_SYSTEMD_DAEMON], 1, [Define to use the systemd daemon library]) -fi - -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 --------------------------------- inotify --------------------------------- -AC_CHECK_FUNCS(inotify_init inotify_init1) - -if test x$ac_cv_func_inotify_init = xno; then - enable_inotify=no -fi - -if test x$enable_inotify = xyes; then - AC_DEFINE([ENABLE_INOTIFY], 1, [Define to enable inotify support]) -fi -AM_CONDITIONAL(ENABLE_INOTIFY, test x$enable_inotify = xyes) - -dnl --------------------------------- libwrap --------------------------------- -if test x$enable_libwrap != xno; then - AC_CHECK_LIBWRAP(found_libwrap=yes, found_libwrap=no) - 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 Metadata Plugins -dnl --------------------------------------------------------------------------- - -dnl -------------------------------- libid3tag -------------------------------- -MPD_AUTO_PKG_LIB(id3, ID3TAG, id3tag, id3tag, id3_file_open, [-lid3tag -lz], [], - [id3tag], [libid3tag not found]) -if test x$enable_id3 = xyes; then - AC_DEFINE(HAVE_ID3TAG, 1, [Define to use id3tag]) -fi - -AM_CONDITIONAL(HAVE_ID3TAG, test x$enable_id3 = xyes) - -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 avahi-glib], - [avahi client library], [avahi client+glib not found]) -if test x$enable_avahi = xyes; then - AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support]) - with_zeroconf=avahi -fi - -AM_CONDITIONAL(HAVE_AVAHI, test x$enable_avahi = xyes) - -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_AUTO_PKG(sqlite, SQLITE, [sqlite3], - [SQLite database support], [sqlite not found]) -if test x$enable_sqlite = xyes; then - AC_DEFINE([ENABLE_SQLITE], 1, [Define to enable sqlite database support]) -fi - -AM_CONDITIONAL(ENABLE_SQLITE, test x$enable_sqlite = xyes) - -dnl --------------------------------------------------------------------------- -dnl Converter Plugins -dnl --------------------------------------------------------------------------- - -dnl ------------------------------ libsamplerate ------------------------------ -MPD_AUTO_PKG(lsr, SAMPLERATE, [samplerate >= 0.0.15], - [libsamplerate resampling], [libsamplerate not found]) -if test x$enable_lsr = xyes; then - AC_DEFINE([HAVE_LIBSAMPLERATE], 1, - [Define to enable libsamplerate]) -fi - -if test x$enable_lsr = xyes; then - PKG_CHECK_MODULES([SAMPLERATE_013], - [samplerate >= 0.1.3],, - [AC_DEFINE([HAVE_LIBSAMPLERATE_NOINT], 1, - [libsamplerate doesn't provide src_int_to_float_array() (<0.1.3)])]) -fi - -AM_CONDITIONAL(HAVE_LIBSAMPLERATE, test x$enable_lsr = xyes) - -dnl --------------------------------------------------------------------------- -dnl Input Plugins -dnl --------------------------------------------------------------------------- - -dnl ----------------------------------- CURL ---------------------------------- -MPD_AUTO_PKG(curl, CURL, [libcurl], - [libcurl HTTP streaming], [libcurl not found]) -if test x$enable_curl = xyes; then - AC_DEFINE(ENABLE_CURL, 1, [Define when libcurl is used for HTTP streaming]) -fi -AM_CONDITIONAL(ENABLE_CURL, test x$enable_curl = xyes) - -dnl ----------------------------------- SOUP ---------------------------------- -MPD_AUTO_PKG(soup, SOUP, [libsoup-2.4], - [libsoup HTTP streaming], [libsoup not found]) -if test x$enable_soup = xyes; then - AC_DEFINE(ENABLE_SOUP, 1, [Define when libsoup is used for HTTP streaming]) -fi -AM_CONDITIONAL(ENABLE_SOUP, test x$enable_soup = xyes) - -dnl --------------------------------- Last.FM --------------------------------- -if test x$enable_lastfm = xyes; then - if test x$enable_curl != xyes; then - AC_MSG_ERROR([Cannot enable last.fm radio without curl]) - fi - - AC_DEFINE(ENABLE_LASTFM, 1, [Define when last.fm radio is enabled]) -fi -AM_CONDITIONAL(ENABLE_LASTFM, test x$enable_lastfm = xyes) - -dnl --------------------------------- Despotify --------------------------------- -MPD_AUTO_PKG(despotify, DESPOTIFY, [despotify], - [Despotify support], [despotify not found]) -if test x$enable_despotify = xyes; then - AC_DEFINE(ENABLE_DESPOTIFY, 1, [Define when despotify is enabled]) -fi -AM_CONDITIONAL(ENABLE_DESPOTIFY, test x$enable_despotify = xyes) - -dnl --------------------------------- Soundcloud ------------------------------ -if test x$enable_soundcloud != xno; then - PKG_CHECK_MODULES([YAJL], [yajl >= 2.0], - [found_soundcloud=yes], - AC_CHECK_LIB([yajl], [yajl_alloc], - [found_soundcloud=yes YAJL_CFLAGS=-DHAVE_YAJL1 YAJL_LIBS=-lyajl], - [found_soundcloud=no])) -fi -MPD_AUTO_RESULT([soundcloud], [soundcloud.com support], [libyajl not found]) -if test x$enable_soundcloud = xyes; then - AC_DEFINE(ENABLE_SOUNDCLOUD, 1, [Define when soundcloud is enabled]) -fi -AM_CONDITIONAL(ENABLE_SOUNDCLOUD, test x$enable_soundcloud = xyes) -AC_SUBST(YAJL_LIBS) - -dnl ---------------------------------- cdio --------------------------------- -MPD_AUTO_PKG(cdio_paranoia, CDIO_PARANOIA, [libcdio_paranoia], - [libcdio_paranoia audio CD library], [libcdio_paranoia not found]) -if test x$enable_cdio_paranoia = xyes; then - AC_DEFINE([ENABLE_CDIO_PARANOIA], 1, - [Define to enable libcdio_paranoia support]) -fi - -AM_CONDITIONAL(ENABLE_CDIO_PARANOIA, test x$enable_cdio_paranoia = xyes) - -dnl ---------------------------------- libmms --------------------------------- -MPD_AUTO_PKG(mms, MMS, [libmms >= 0.4], - [libmms mms:// protocol support], [libmms not found]) -if test x$enable_mms = xyes; then - AC_DEFINE(ENABLE_MMS, 1, - [Define when libmms is used for the MMS protocol]) -fi -AM_CONDITIONAL(ENABLE_MMS, test x$enable_mms = xyes) - -dnl --------------------------------------------------------------------------- -dnl Archive Plugins -dnl --------------------------------------------------------------------------- - -dnl --------------------------------- iso9660 --------------------------------- -MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660], - [libiso9660 archive library], [libiso9660 not found]) - -AM_CONDITIONAL(HAVE_ISO9660, test x$enable_iso9660 = xyes) -if test x$enable_iso9660 = xyes; then - AC_DEFINE(HAVE_ISO9660, 1, [Define to have ISO9660 archive support]) - - AC_PATH_PROG(MKISOFS, mkisofs, no) -else - MKISOFS="no" -fi - -AM_CONDITIONAL(ENABLE_ISO9660_TEST, test x$MKISOFS != xno) - -dnl ---------------------------------- libbz2 --------------------------------- -if test x$enable_bzip2 = xyes; then - AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, - [BZ2_LIBS="-lbz2"], - [AC_MSG_ERROR([libbz2 not found])]) -fi -AC_SUBST(BZ2_LIBS) - -AM_CONDITIONAL(HAVE_BZ2, test x$enable_bzip2 = xyes) -if test x$enable_bzip2 = xyes; then - AC_DEFINE(HAVE_BZ2, 1, [Define to have bz2 archive support]) - - AC_PATH_PROG(BZIP2, bzip2, no) -else - BZIP2="no" -fi - -AM_CONDITIONAL(ENABLE_BZIP2_TEST, test x$BZIP2 != xno) - -dnl --------------------------------- libzzip --------------------------------- -MPD_AUTO_PKG(zzip, ZZIP, [zziplib >= 0.13], - [libzzip archive library], [libzzip not found]) - -AM_CONDITIONAL(HAVE_ZZIP, test x$enable_zzip = xyes) -if test x$enable_zzip = xyes; then - AC_DEFINE(HAVE_ZZIP, 1, [Define to have zip archive support]) - - 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 - AC_DEFINE(ENABLE_ARCHIVE, 1, [The archive API is available]) -else - enable_archive=no -fi - -AM_CONDITIONAL(ENABLE_ARCHIVE, test x$enable_archive = xyes) - -dnl --------------------------------------------------------------------------- -dnl Decoder Plugins -dnl --------------------------------------------------------------------------- - -dnl ---------------------------------- ffmpeg --------------------------------- -MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 52.31 libavcodec >= 52.20 libavutil >= 49.15], - [ffmpeg decoder library], [libavformat+libavcodec+libavutil not found]) - -if test x$enable_ffmpeg = xyes; then - AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support]) -fi - -AM_CONDITIONAL(HAVE_FFMPEG, test x$enable_ffmpeg = xyes) - -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_wave_encoder=no - enable_flac_encoder=no -fi - -dnl ------------------------------- FLAC Encoder ------------------------------ -if test x$enable_flac_encoder = xyes; then - AC_DEFINE(ENABLE_FLAC_ENCODER, 1, - [Define to enable the FLAC encoder plugin]) -fi -AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes) - -dnl ---------------------------- Ogg Vorbis Encoder --------------------------- -MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc], - [Ogg Vorbis encoder], [libvorbisenc not found]) - -if test x$enable_vorbis_encoder = xyes; then - AC_DEFINE(ENABLE_VORBIS_ENCODER, 1, - [Define to enable the vorbis encoder plugin]) -fi -AM_CONDITIONAL(ENABLE_VORBIS_ENCODER, test x$enable_vorbis_encoder = xyes) - -dnl ------------------------------- LAME Encoder ------------------------------ -if test x$enable_lame_encoder != xno; then - AC_CHECK_HEADERS(lame/lame.h,, - [AC_CHECK_HEADERS(lame.h,, using_lame=no)]) - AC_CHECK_LIB(mp3lame, lame_init,, using_lame=no) - if test x$using_lame != xno; then - AC_DEFINE(HAVE_LAME, 1, [Define to 1 if you have lame 3.98 or greater.]) - LAME_LIBS="-lmp3lame -lm" - enable_lame_encoder=yes - fi - - if test "$enable_lame_encoder" = "yes" -a "$using_lame" = "no"; then - AC_MSG_ERROR([LAME libraries and development support files not found.]) - fi -fi - -AC_SUBST(LAME_LIBS) - -if test x$enable_lame_encoder = xyes; then - AC_DEFINE(ENABLE_LAME_ENCODER, 1, - [Define to enable the lame encoder plugin]) -fi -AM_CONDITIONAL(ENABLE_LAME_ENCODER, test x$enable_lame_encoder = xyes) - -dnl ----------------------------- TwoLAME Encoder ----------------------------- -MPD_AUTO_PKG(twolame_encoder, TWOLAME, [twolame], - [TwoLAME encoder], [libtwolame not found]) - -if test x$enable_twolame_encoder = xyes; then - AC_DEFINE(ENABLE_TWOLAME_ENCODER, 1, - [Define to enable the TwoLAME encoder plugin]) -fi -AM_CONDITIONAL(ENABLE_TWOLAME_ENCODER, test x$enable_twolame_encoder = xyes) - -dnl ------------------------------- WAVE Encoder ------------------------------ -AM_CONDITIONAL(ENABLE_WAVE_ENCODER, test x$enable_wave_encoder = xyes) -if test x$enable_wave_encoder = xyes; then - AC_DEFINE(ENABLE_WAVE_ENCODER, 1, - [Define to enable the PCM wave encoder plugin]) -fi - -dnl --------------------------- encoder plugins test -------------------------- -if test x$enable_vorbis_encoder != xno || - test x$enable_lame_encoder != xno || - test x$enable_twolame_encoder != xno || - test x$enable_flac_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 - -if test x$enable_encoder = xyes; then - AC_DEFINE(ENABLE_ENCODER, 1, - [Define to enable the encoder plugins]) -fi -AM_CONDITIONAL(ENABLE_ENCODER, test x$enable_encoder = xyes) - -dnl --------------------------------------------------------------------------- -dnl Audio Output Plugins -dnl --------------------------------------------------------------------------- - -dnl ----------------------------------- ALSA ---------------------------------- -MPD_AUTO_PKG(alsa, ALSA, [alsa >= 0.9.0], - [ALSA output plugin], [libasound not found]) - -if test x$enable_alsa = xyes; then - AC_DEFINE(HAVE_ALSA, 1, [Define to enable ALSA support]) -fi - -AM_CONDITIONAL(HAVE_ALSA, test x$enable_alsa = xyes) - -dnl ----------------------------------- ROAR ---------------------------------- -MPD_AUTO_PKG(roar, ROAR, [libroar >= 0.4.0], - [ROAR output plugin], [libroar not found]) - -if test x$enable_roar = xyes; then - AC_DEFINE(HAVE_ROAR, 1, [Define to enable ROAR support]) -fi - -AM_CONDITIONAL(HAVE_ROAR, test x$enable_roar = xyes) - -dnl ----------------------------------- FFADO --------------------------------- - -MPD_AUTO_PKG(ffado, FFADO, [libffado], - [libffado output plugin], [libffado not found]) - -if test x$enable_ffado = xyes; then - AC_DEFINE(ENABLE_FFADO_OUTPUT, 1, [Define to enable the libffado output plugin]) -fi - -AM_CONDITIONAL(ENABLE_FFADO_OUTPUT, test x$enable_ffado = xyes) - -dnl ----------------------------------- FIFO ---------------------------------- -if test x$enable_fifo = xyes; then - AC_CHECK_FUNC([mkfifo], - [enable_fifo=yes;AC_DEFINE([HAVE_FIFO], 1, - [Define to enable support for writing audio to a FIFO])], - [enable_fifo=no;AC_MSG_WARN([mkfifo not found -- disabling support for writing audio to a FIFO])]) -fi - -AM_CONDITIONAL(HAVE_FIFO, test x$enable_fifo = xyes) - -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 - -if test x$enable_httpd_output = xyes; then - AC_DEFINE(ENABLE_HTTPD_OUTPUT, 1, [Define to enable the HTTP server output]) -fi -AM_CONDITIONAL(ENABLE_HTTPD_OUTPUT, test x$enable_httpd_output = xyes) - -dnl ----------------------------------- JACK ---------------------------------- -MPD_AUTO_PKG(jack, JACK, [jack >= 0.100], - [JACK output plugin], [libjack not found]) -if test x$enable_jack = xyes; then - AC_DEFINE([HAVE_JACK], 1, [Define to enable JACK support]) -fi - -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 - -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 - - -AM_CONDITIONAL(HAVE_JACK, test x$enable_jack = xyes) - -dnl ---------------------------------- libao ---------------------------------- -MPD_AUTO_PKG(ao, AO, [ao], - [libao output plugin], [libao not found]) -if test x$enable_ao = xyes; then - AC_DEFINE(HAVE_AO, 1, [Define to play with ao]) -fi - -AM_CONDITIONAL(HAVE_AO, test x$enable_ao = xyes) - -dnl ----------------------------------- MVP ----------------------------------- -if test x$enable_mvp = xyes; then - AC_DEFINE(HAVE_MVP,1,[Define to enable Hauppauge Media MVP support]) -fi - -AM_CONDITIONAL(HAVE_MVP, test x$enable_mvp = xyes) - -dnl ---------------------------------- OpenAL --------------------------------- -AC_SUBST(OPENAL_CFLAGS,"") -AC_SUBST(OPENAL_LIBS,"") - -if test x$enable_openal = xyes; then - if test x$enable_osx = xyes; then - AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h], [], [enable_openal=no]) - if test x$enable_openal = xyes; then - OPENAL_LIBS="-framework OpenAL" - AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]) - else - AC_MSG_WARN(OpenAL headers not found -- disabling OpenAL support) - fi - else - PKG_CHECK_MODULES([OPENAL], [openal], - AC_DEFINE(HAVE_OPENAL, 1, [Define for OpenAL support]), - enable_openal=no) - fi -fi - -AM_CONDITIONAL(HAVE_OPENAL, test x$enable_openal = xyes) - -dnl ---------------------------- Open Sound System ---------------------------- -if test x$enable_oss = xyes; then - AC_CHECK_HEADER(sys/soundcard.h, - [enable_oss=yes;AC_DEFINE(HAVE_OSS,1,[Define to enable OSS])], - [AC_MSG_WARN(Soundcard headers not found -- disabling OSS support); - enable_oss=no]) -fi - -AM_CONDITIONAL(HAVE_OSS, test x$enable_oss = xyes) - -dnl ----------------------------------- OSX ----------------------------------- -enable_osx=no -case "$host_os" in - darwin*) - AC_DEFINE(HAVE_OSX, 1, [Define for compiling OS X support]) - LIBS="$LIBS -framework AudioUnit -framework CoreAudio -framework CoreServices" - enable_osx=yes ;; -esac - -AM_CONDITIONAL(HAVE_OSX, test x$enable_osx = xyes) - -dnl ------------------------------- Pipe Output ------------------------------- -if test x$enable_pipe_output = xyes; then - AC_DEFINE([ENABLE_PIPE_OUTPUT], 1, - [Define to enable support for writing audio to a pipe]) -fi -AM_CONDITIONAL(ENABLE_PIPE_OUTPUT, test x$enable_pipe_output = xyes) - -dnl -------------------------------- PulseAudio ------------------------------- -MPD_AUTO_PKG(pulse, PULSE, [libpulse], - [PulseAudio output plugin], [libpulse not found]) -if test x$enable_pulse = xyes; then - AC_DEFINE([HAVE_PULSE], 1, - [Define to enable PulseAudio support]) -fi - -AM_CONDITIONAL(HAVE_PULSE, test x$enable_pulse = xyes) - -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 - -if test x$enable_recorder_output = xyes; then - AC_DEFINE(ENABLE_RECORDER_OUTPUT, 1, [Define to enable the recorder output]) -fi -AM_CONDITIONAL(ENABLE_RECORDER_OUTPUT, test x$enable_recorder_output = xyes) - -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 - -if test x$enable_shout = xyes; then - AC_DEFINE(HAVE_SHOUT, 1, [Define to enable the shoutcast output]) -fi -AM_CONDITIONAL(HAVE_SHOUT, test x$enable_shout = xyes) - -dnl --------------------------------- Solaris --------------------------------- - -if test x$enable_solaris_output = xauto; then - case "$host_os" in - solaris*) - enable_solaris_output=yes - ;; - - *) - enable_solaris_output=no - ;; - esac -fi - -if test x$enable_solaris_output = xyes; then - AC_DEFINE(ENABLE_SOLARIS_OUTPUT, 1, [Define to enable Solaris /dev/audio support]) -fi - -AM_CONDITIONAL(ENABLE_SOLARIS_OUTPUT, test x$enable_solaris_output = xyes) - -dnl --------------------------------- WinMM --------------------------------- - -case "$host_os" in - mingw32* | windows*) - AC_DEFINE(ENABLE_WINMM_OUTPUT, 1, [Define to enable WinMM support]) - enable_winmm_output=yes - LIBS="$LIBS -lwinmm" - ;; - - *) - enable_winmm_output=no - ;; -esac - -AM_CONDITIONAL(ENABLE_WINMM_OUTPUT, test x$enable_winmm_output = xyes) - -dnl --------------------- Post Audio Output Plugins Tests --------------------- -if - test x$enable_alsa = xno && - test x$enable_roar = xno && - test x$enable_ao = xno && - test x$enable_ffado = xno && - test x$enable_fifo = xno && - test x$enable_httpd_output = xno && - test x$enable_jack = xno && - test x$enable_mvp = xno; then - test x$enable_openal = xno && - test x$enable_oss = xno && - test x$enable_osx = xno && - test x$enable_pipe_output = xno && - test x$enable_pulse = xno && - test x$enable_recorder_output = xno && - test x$enable_shout = xno && - test x$enable_solaris_output = xno && - test x$enable_winmm_output = xno && - - AC_MSG_ERROR([No Audio Output types configured!]) -fi - -dnl --------------------------------------------------------------------------- -dnl Documentation -dnl --------------------------------------------------------------------------- -if test x$enable_documentation = xyes; then - AC_PATH_PROG(XMLTO, xmlto) - AC_SUBST(XMLTO) - AM_CONDITIONAL(HAVE_XMLTO, test x$XMLTO != x) - - AC_PATH_PROG(DOXYGEN, doxygen) - if test x$DOXYGEN = x; then - AC_MSG_ERROR([doxygen not found]) - fi - - AC_SUBST(DOXYGEN) -else - AM_CONDITIONAL(HAVE_XMLTO, false) -fi - -AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes) - -dnl --------------------------------------------------------------------------- -dnl test suite -dnl --------------------------------------------------------------------------- -AM_CONDITIONAL(ENABLE_TEST, test "x$enable_test" = xyes) - -dnl --------------------------------------------------------------------------- -dnl CFLAGS -dnl --------------------------------------------------------------------------- - -dnl ---------------------------------- debug ---------------------------------- -if test "x$enable_debug" = xno; then - AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG" -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]) -fi - -dnl ---------------------------- warnings as errors --------------------------- -if test "x$enable_werror" = xyes; then - AM_CFLAGS="$AM_CFLAGS -Werror -pedantic-errors" - AM_CXXFLAGS="$AM_CXXFLAGS -Werror" -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 '\nFile format support:\n\t' -results(ffmpeg, [FFMPEG]) - -printf '\nOther features:\n\t' -results(lsr, [libsamplerate]) -results(inotify, [inotify]) -results(sqlite, [SQLite]) - -printf '\nMetadata support:\n\t' -results(id3,[ID3]) - -printf '\nPlayback support:\n\t' -results(alsa,ALSA) -results(ffado,FFADO) -results(fifo,FIFO) -results(recorder_output,[File Recorder]) -results(httpd_output,[HTTP Daemon]) -results(jack,[JACK]) -printf '\n\t' -results(ao,[libao]) -results(mvp, [Media MVP]) -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(vorbis_encoder, [Ogg Vorbis]) - results(twolame_encoder, [TwoLAME]) - results(wave_encoder, [WAVE]) -fi - -printf '\nStreaming support:\n\t' -results(cdio_paranoia, [CDIO_PARANOIA]) -results(curl,[CURL]) -results(despotify,[Despotify]) -results(lastfm,[Last.FM]) -results(soundcloud,[Soundcloud]) -printf '\n\t' -results(mms,[MMS]) -results(soup, [SOUP]) - -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_OUTPUT - -echo 'MPD is ready for compilation, type "make" to begin.' diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4 deleted file mode 100644 index 42541700..00000000 --- a/m4/ax_append_compile_flags.m4 +++ /dev/null @@ -1,63 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS]) -# -# 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. -# -# 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 -# -# 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 . -# -# 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 2 - -AC_DEFUN([AX_APPEND_COMPILE_FLAGS], -[for flag in $1; do - AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3]) -done -])dnl AX_APPEND_COMPILE_FLAGS diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4 deleted file mode 100644 index 1d38b76f..00000000 --- a/m4/ax_append_flag.m4 +++ /dev/null @@ -1,69 +0,0 @@ -# =========================================================================== -# http://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 -# Copyright (c) 2011 Maarten Bosmans -# -# 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 . -# -# 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 2 - -AC_DEFUN([AX_APPEND_FLAG], -[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX -AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl -AS_VAR_SET_IF(FLAGS, - [case " AS_VAR_GET(FLAGS) " in - *" $1 "*) - AC_RUN_LOG([: FLAGS already contains $1]) - ;; - *) - AC_RUN_LOG([: FLAGS="$FLAGS $1"]) - AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"]) - ;; - esac], - [AS_VAR_SET(FLAGS,["$1"])]) -AS_VAR_POPDEF([FLAGS])dnl -])dnl AX_APPEND_FLAG diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 deleted file mode 100644 index c3a8d695..00000000 --- a/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,72 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) -# -# 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. -# -# 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 -# Copyright (c) 2011 Maarten Bosmans -# -# 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 . -# -# 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 2 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX -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([AC_LANG_PROGRAM()], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS diff --git a/m4/faad.m4 b/m4/faad.m4 deleted file mode 100644 index 1048c566..00000000 --- a/m4/faad.m4 +++ /dev/null @@ -1,198 +0,0 @@ -AC_DEFUN([AM_PATH_FAAD], -[dnl ## -dnl faad -dnl ## - -AC_ARG_ENABLE(aac, - AS_HELP_STRING([--disable-aac], - [disable AAC support (default: enable)]),, - enable_aac=yes) - -AC_ARG_WITH(faad, - AS_HELP_STRING([--with-faad=PFX], - [prefix where faad2 is installed (optional)]),, - faad_prefix="") -AC_ARG_WITH(faad-libraries, - AS_HELP_STRING([--with-faad-libraries=DIR], - [directory where faad2 library is installed (optional)]),, - faad_libraries="") -AC_ARG_WITH(faad-includes, - AS_HELP_STRING([--with-faad-includes=DIR], - [directory where faad2 header files are installed (optional)]),, - faad_includes="") - -if test x$enable_aac = xyes; then - if test "x$faad_libraries" != "x" ; then - FAAD_LIBS="-L$faad_libraries" - elif test "x$faad_prefix" != "x" ; then - FAAD_LIBS="-L$faad_prefix/lib" - fi - - FAAD_LIBS="$FAAD_LIBS -lfaad" - - if test "x$faad_includes" != "x" ; then - FAAD_CFLAGS="-I$faad_includes" - elif test "x$faad_prefix" != "x" ; then - FAAD_CFLAGS="-I$faad_prefix/include" - fi - - oldcflags=$CFLAGS - oldlibs=$LIBS - oldcppflags=$CPPFLAGS - CFLAGS="$CFLAGS $FAAD_CFLAGS -I." - LIBS="$LIBS $FAAD_LIBS" - CPPFLAGS=$CFLAGS - AC_CHECK_HEADER(faad.h,,enable_aac=no) - if test x$enable_aac = xyes; then - AC_CHECK_DECL(FAAD2_VERSION,,enable_aac=no,[#include ]) - fi - if test x$enable_aac = xyes; then - AC_CHECK_DECL(faacDecInit2,,enable_aac=no,[#include ]) - fi - if test x$enable_aac = xyes; then - AC_CHECK_LIB(faad,faacDecInit2,,enable_aac=no) - if test x$enable_aac = xno; then - enable_aac=yes - AC_CHECK_LIB(faad,NeAACDecInit2,,enable_aac=no) - fi - fi - if test x$enable_aac = xyes; then - AC_MSG_CHECKING(that FAAD2 uses buffer and bufferlen) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ -#include - -int main() { - char buffer; - long bufferlen = 0; - faacDecHandle decoder; - faacDecFrameInfo frameInfo; - faacDecConfigurationPtr config; - unsigned char channels; - long sampleRate; - mp4AudioSpecificConfig mp4ASC; - - decoder = faacDecOpen(); - config = faacDecGetCurrentConfiguration(decoder); - config->outputFormat = FAAD_FMT_16BIT; - faacDecSetConfiguration(decoder,config); - AudioSpecificConfig(&buffer, bufferlen, &mp4ASC); - faacDecInit(decoder,&buffer,bufferlen,&sampleRate,&channels); - faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels); - faacDecDecode(decoder,&frameInfo,&buffer,bufferlen); - - return 0; -} -])],[AC_MSG_RESULT(yes);AC_DEFINE(HAVE_FAAD_BUFLEN_FUNCS,1,[Define if FAAD2 uses buflen in function calls])],[AC_MSG_RESULT(no); - AC_MSG_CHECKING(that FAAD2 can even be used) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ -#include - -int main() { - char buffer; - faacDecHandle decoder; - faacDecFrameInfo frameInfo; - faacDecConfigurationPtr config; - unsigned char channels; - long sampleRate; - long bufferlen = 0; - unsigned long dummy1_32; - unsigned char dummy2_8, dummy3_8, dummy4_8, dummy5_8, dummy6_8, - dummy7_8, dummy8_8; - - decoder = faacDecOpen(); - config = faacDecGetCurrentConfiguration(decoder); - config->outputFormat = FAAD_FMT_16BIT; - faacDecSetConfiguration(decoder,config); - AudioSpecificConfig(&buffer,&dummy1_32,&dummy2_8, - &dummy3_8,&dummy4_8,&dummy5_8, - &dummy6_8,&dummy7_8,&dummy8_8); - faacDecInit(decoder,&buffer,&sampleRate,&channels); - faacDecInit2(decoder,&buffer,bufferlen,&sampleRate,&channels); - faacDecDecode(decoder,&frameInfo,&buffer); - faacDecClose(decoder); - - return 0; -} -])],AC_MSG_RESULT(yes),[AC_MSG_RESULT(no);enable_aac=no]) - ]) - fi - if test x$enable_aac = xyes; then - AC_CHECK_MEMBERS([faacDecConfiguration.downMatrix,faacDecConfiguration.dontUpSampleImplicitSBR,faacDecFrameInfo.samplerate],,,[#include ]) - AC_DEFINE(HAVE_FAAD,1,[Define to use FAAD2 for AAC decoding]) - else - AC_MSG_WARN([faad2 lib needed for MP4/AAC support -- disabling MP4/AAC support]) - fi - CFLAGS=$oldcflags - LIBS=$oldlibs - CPPFLAGS=$oldcppflags -fi - -if test x$enable_aac = xyes; then - oldcflags=$CFLAGS - oldlibs=$LIBS - oldcppflags=$CPPFLAGS - CFLAGS="$CFLAGS $FAAD_CFLAGS -Werror" - LIBS="$LIBS $FAAD_LIBS" - CPPFLAGS=$CFLAGS - - AC_MSG_CHECKING(for broken libfaad headers) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ -#include -#include -#include - -int main() { - unsigned char channels; - uint32_t sample_rate; - - faacDecInit2(NULL, NULL, 0, &sample_rate, &channels); - return 0; -} - ])], - [AC_MSG_RESULT(correct)], - [AC_MSG_RESULT(broken); - AC_DEFINE(HAVE_FAAD_LONG, 1, [Define if faad.h uses the broken "unsigned long" pointers])]) - - CFLAGS=$oldcflags - LIBS=$oldlibs - CPPFLAGS=$oldcppflags -fi - -if test x$enable_aac = xyes; then - enable_mp4=yes - MP4FF_LIBS="-lmp4ff" - - oldcflags=$CFLAGS - oldlibs=$LIBS - oldcppflags=$CPPFLAGS - CFLAGS="$CFLAGS $FAAD_CFLAGS" - LIBS="$LIBS $FAAD_LIBS $MP4FF_LIBS" - CPPFLAGS=$CFLAGS - - AC_CHECK_HEADER(mp4ff.h,,enable_mp4=no) - - if test x$enable_mp4 = xyes; then - AC_CHECK_LIB(mp4ff,mp4ff_open_read,,enable_mp4=no) - fi - - if test x$enable_mp4 = xyes; then - AC_SUBST(MP4FF_LIBS) - AC_DEFINE(HAVE_MP4, 1, [Define to use FAAD2+mp4ff for MP4 decoding]) - else - AC_MSG_WARN([libmp4ff needed for MP4 support -- disabling MP4 support]) - unset MP4FF_LIBS - fi - - CFLAGS=$oldcflags - LIBS=$oldlibs - CPPFLAGS=$oldcppflags -else - enable_mp4=no - FAAD_CFLAGS="" - FAAD_LIBS="" -fi - -AC_SUBST(FAAD_CFLAGS) -AC_SUBST(FAAD_LIBS) - -]) diff --git a/m4/libwrap.m4 b/m4/libwrap.m4 deleted file mode 100644 index 5ad3df19..00000000 --- a/m4/libwrap.m4 +++ /dev/null @@ -1,14 +0,0 @@ -dnl -dnl Usage: -dnl AC_CHECK_LIBWRAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl - -AC_DEFUN([AC_CHECK_LIBWRAP],[ - AC_CHECK_HEADERS([tcpd.h], - AC_CHECK_LIB([wrap], [request_init], - [LIBWRAP_CFLAGS="" - LIBWRAP_LDFLAGS="-lwrap" - $1], - $2), - $2) -]) diff --git a/m4/mpd_auto.m4 b/m4/mpd_auto.m4 deleted file mode 100644 index 23713d5b..00000000 --- a/m4/mpd_auto.m4 +++ /dev/null @@ -1,80 +0,0 @@ -AC_DEFUN([MPD_AUTO_ENABLED], [ - var="enable_$1" - feature="$2" - - if eval "test x`echo '$'$var` = xauto"; then - AC_MSG_NOTICE([auto-detected $feature]) - eval "$var=yes" - fi -]) - -AC_DEFUN([MPD_AUTO_DISABLED], [ - var="enable_$1" - feature="$2" - msg="$3" - - if eval "test x`echo '$'$var` = xauto"; then - AC_MSG_WARN([$msg -- disabling $feature]) - eval "$var=no" - elif eval "test x`echo '$'$var` = xyes"; then - AC_MSG_ERROR([$feature: $msg]) - 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], [ - name="$1" - var="enable_$1" - found="found_$name" - feature="$2" - msg="$3" - - if eval "test x`echo '$'$var` != xno" && eval "test x`echo '$'$found` = xno"; then - MPD_AUTO_DISABLED([$name], [$feature], [$msg]) - fi -]) - -AC_DEFUN([MPD_AUTO_RESULT], [ - name="$1" - var="enable_$1" - found="found_$name" - feature="$2" - msg="$3" - - if eval "test x`echo '$'$var` = xno"; then - eval "$found=no" - fi - - if eval "test x`echo '$'$found` = xyes"; then - MPD_AUTO_ENABLED([$name], [$feature]) - else - MPD_AUTO_DISABLED([$name], [$feature], [$msg]) - fi -]) - -AC_DEFUN([MPD_AUTO_PKG], [ - if eval "test x`echo '$'enable_$1` != xno"; then - PKG_CHECK_MODULES([$2], [$3], - [eval "found_$1=yes"], - [eval "found_$1=no"]) - fi - - MPD_AUTO_RESULT([$1], [$4], [$5]) -]) - -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], [ - if eval "test x`echo '$'enable_$1` != xno"; then - PKG_CHECK_MODULES([$2], [$3], - [eval "found_$1=yes"], - AC_CHECK_LIB($4, $5, - [eval "found_$1=yes $2_LIBS='$6' $2_CFLAGS='$7'"], - [eval "found_$1=no"])) - fi - - MPD_AUTO_RESULT([$1], [$8], [$9]) -]) diff --git a/m4/pkg.m4 b/m4/pkg.m4 deleted file mode 100644 index c29b6c05..00000000 --- a/m4/pkg.m4 +++ /dev/null @@ -1,157 +0,0 @@ -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl -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 -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure 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_ifval([$2], [$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -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 -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# 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 - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[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 -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[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 .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MODULES diff --git a/m4/pretty_print.m4 b/m4/pretty_print.m4 deleted file mode 100644 index 687dceef..00000000 --- a/m4/pretty_print.m4 +++ /dev/null @@ -1,19 +0,0 @@ -AC_DEFUN([results], [ - dnl This is a hack to allow "with" names, otherwise "enable". - num=`expr $1 : 'with'` - if test "$num" != "0"; then - var="`echo '$'$1`" - else - var="`echo '$'enable_$1`" - fi - - printf '(' - if eval "test x$var = xyes"; then - printf '+' - elif test -n "$3" && eval "test x$var = x$3"; then - printf '+' - else - printf '-' - fi - printf '%s) ' "$2" -]) diff --git a/m4/ucred.m4 b/m4/ucred.m4 deleted file mode 100644 index cdc6ea3b..00000000 --- a/m4/ucred.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# Check if "struct ucred" is available. If not, try harder with -# _GNU_SOURCE. -# -# Author: Max Kellermann - -AC_DEFUN([STRUCT_UCRED],[ - AC_MSG_CHECKING([for struct ucred]) - AC_CACHE_VAL(mpd_cv_have_struct_ucred, [ - AC_TRY_COMPILE([#include ], - [struct ucred cred;], - mpd_cv_have_struct_ucred=yes, - mpd_cv_have_struct_ucred=no) - if test x$mpd_cv_have_struct_ucred = xno; then - # glibc 2.8 forces _GNU_SOURCE on us - AC_TRY_COMPILE( - [#define _GNU_SOURCE - #include ], - [struct ucred cred;], - mpd_cv_have_struct_ucred=yes, - mpd_cv_have_struct_ucred=no) - if test x$mpd_cv_have_struct_ucred = xyes; then - # :( - CFLAGS="$CFLAGS -D_GNU_SOURCE" - fi - fi - ]) - - 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 -]) diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 00000000..2806667f --- /dev/null +++ b/src/Makefile @@ -0,0 +1,252 @@ +OBJS = aiff.o \ + ape.o \ + archive_api.o \ + archive_list.o \ + archive_plugin.o \ + audio_check.o \ + audio_config.o \ + audio_format.o \ + audio_parser.o \ + buffer.o \ + chunk.o \ + client.o \ + client_event.o \ + client_expire.o \ + client_file.o \ + client_global.o \ + client_idle.o \ + client_list.o \ + client_message.o \ + client_new.o \ + client_process.o \ + client_read.o \ + client_subscribe.o \ + client_write.o \ + cmdline.o \ + command.o \ + conf.o \ + crossfade.o \ + daemon.o \ + database.o \ + db_lock.o \ + db_print.o \ + db_save.o \ + dbUtils.o \ + decoder_api.o \ + decoder_buffer.o \ + decoder_control.o \ + decoder_internal.o \ + decoder_list.o \ + decoder_plugin.o \ + decoder_print.o \ + decoder_thread.o \ + directory.o \ + directory_save.o \ + encoder_list.o \ + event_pipe.o \ + exclude.o \ + fd_util.o \ + fifo_buffer.o \ + filter_config.o \ + filter_plugin.o \ + filter_registry.o \ + growing_fifo.o \ + icy_metadata.o \ + icy_server.o \ + idle.o \ + inotify_queue.o \ + inotify_source.o \ + inotify_update.o \ + input_init.o \ + input_internal.o \ + input_registry.o \ + input_stream.o \ + io_thread.o \ + listen.o \ + locate.o \ + log.o \ + ls.o \ + main.o \ + main_win32.o \ + mapper.o \ + mixer_all.o \ + mixer_api.o \ + mixer_control.o \ + mixer_type.o \ + notify.o \ + output_all.o \ + output_command.o \ + output_control.o \ + output_finish.o \ + output_init.o \ + output_list.o \ + output_plugin.o \ + output_print.o \ + output_state.o \ + output_thread.o \ + page.o \ + path.o \ + pcm_buffer.o \ + pcm_channels.o \ + pcm_convert.o \ + pcm_dither.o \ + pcm_dsd.o \ + pcm_dsd_usb.o \ + pcm_export.o \ + pcm_format.o \ + pcm_mix.o \ + pcm_pack.o \ + pcm_resample.o \ + pcm_resample_fallback.o \ + pcm_resample_libsamplerate.o \ + pcm_volume.o \ + permission.o \ + pipe.o \ + player_control.o \ + player_thread.o \ + playlist_any.o \ + playlist.o \ + playlist_control.o \ + playlist_database.o \ + playlist_edit.o \ + playlist_global.o \ + playlist_list.o \ + playlist_mapper.o \ + playlist_print.o \ + playlist_queue.o \ + playlist_save.o \ + playlist_song.o \ + playlist_state.o \ + playlist_vector.o \ + queue.o \ + queue_print.o \ + queue_save.o \ + replay_gain_ape.o \ + replay_gain_config.o \ + replay_gain_info.o \ + resolver.o \ + riff.o \ + server_socket.o \ + sig_handlers.o \ + socket_util.o \ + song.o \ + song_print.o \ + song_save.o \ + song_sort.o \ + song_sticker.o \ + song_update.o \ + state_file.o \ + stats.o \ + sticker.o \ + sticker_print.o \ + stored_playlist.o \ + string_util.o \ + strset.o \ + tag_ape.o \ + tag.o \ + tag_file.o \ + tag_handler.o \ + tag_pool.o \ + tag_print.o \ + tag_save.o \ + text_file.o \ + text_input_stream.o \ + timer.o \ + tokenizer.o \ + update_archive.o \ + update.o \ + update_container.o \ + update_db.o \ + update_io.o \ + update_queue.o \ + update_remove.o \ + update_song.o \ + update_walk.o \ + uri.o \ + utils.o \ + volume.o \ + encoder/null_encoder.o \ + AudioCompress/compress.o \ + cue/cue_parser.o \ + db/simple_db_plugin.o \ + decoder/ffmpeg_decoder_plugin.o \ + decoder/ffmpeg_metadata.o \ + dsd2pcm/dsd2pcm.o \ + dsd2pcm/noiseshape.o \ + filter/autoconvert_filter_plugin.o \ + filter/chain_filter_plugin.o \ + filter/convert_filter_plugin.o \ + filter/normalize_filter_plugin.o \ + filter/null_filter_plugin.o \ + filter/replay_gain_filter_plugin.o \ + filter/route_filter_plugin.o \ + filter/volume_filter_plugin.o \ + input/archive_input_plugin.o \ + mixer/software_mixer_plugin.o \ + playlist/asx_playlist_plugin.o \ + playlist/cue_playlist_plugin.o \ + playlist/embcue_playlist_plugin.o \ + playlist/extm3u_playlist_plugin.o \ + playlist/lastfm_playlist_plugin.o \ + playlist/m3u_playlist_plugin.o \ + playlist/pls_playlist_plugin.o \ + playlist/rss_playlist_plugin.o \ + playlist/xspf_playlist_plugin.o \ + protocol/argparser.o \ + protocol/result.o \ + util/bit_reverse.o \ + util/byte_reverse.o \ + util/list_sort.o \ + +OBJS-$(CONFIG_LAME_ENCODER) += encoder/lame_encoder.o +OBJS-$(CONFIG_FLAC_ENCODER) += encoder/flac_encoder.o +OBJS-$(CONFIG_TWOLAME_ENCODER) += encoder/twolame_encoder.o +OBJS-$(CONFIG_VORBIS_ENCODER) += encoder/vorbis_encoder.o +OBJS-$(CONFIG_WAVE_ENCODER) += encoder/wave_encoder.o + +OBJS-$(CONFIG_BZ2_ARCHIVE) += archive/bz2_archive_plugin.o +OBJS-$(CONFIG_ISO9660_ARCHIVE) += archive/iso9660_archive_plugin.o +OBJS-$(CONFIG_ZZIP_ARCHIVE) += archive/zzip_archive_plugin.o + +OBJS-$(CONFIG_CDIO_PARANOIA_INPUT) += input/cdio_paranoia_input_plugin.o +OBJS-$(CONFIG_CURL_PROTOCL) += input/curl_input_plugin.o +OBJS-$(CONFIG_DESPOTIFY_INPUT) += input/despotify_input_plugin.o \ + despotify_utils.o \ + playlist/despotify_playlist_plugin.o +OBJS-$(CONFIG_FFMPEG_INPUT) += input/ffmpeg_input_plugin.o +OBJS-$(CONFIG_FILE_INPUT) += input/file_input_plugin.o +OBJS-$(CONFIG_REWIND_INPUT) += input/rewind_input_plugin.o +OBJS-$(CONFIG_SOUNDCLOUD_INPUT) += playlist/soundcloud_playlist_plugin.o +OBJS-$(CONFIG_SOUP_INPUT) += input/soup_input_plugin.o + +OBJS-$(CONFIG_ALSA_OUTPUT) += mixer/alsa_mixer_plugin.o \ + output/alsa_output_plugin.o +OBJS-$(CONFIG_OSS_OUTPUT) += mixer/oss_mixer_plugin.o \ + output/oss_output_plugin.o +OBJS-$(CONFIG_PULSE_OUTPUT) += mixer/pulse_mixer_plugin.o \ + output/pulse_output_plugin.o +OBJS-$(CONFIG_ROAR_OUTPUT) += mixer/roar_mixer_plugin.o \ + output/roar_output_plugin.o +OBJS-$(CONFIG_WINMM_OUTPUT) += mixer/winmm_mixer_plugin.o \ + output/winmm_output_plugin.o +OBJS-$(CONFIG_AO_OUTPUT) += output/ao_output_plugin.o +OBJS-$(CONFIG_FFADO_OUTPUT) += output/ffado_output_plugin.o +OBJS-$(CONFIG_FIFO_OUTPUT) += output/fifo_output_plugin.o +OBJS-$(CONFIG_HTTPD_OUTPUT) += output/httpd_client.o \ + output/httpd_output_plugin.o +OBJS-$(CONFIG_JACK_OUTPUT) += output/jack_output_plugin.o +OBJS-$(CONFIG_MVP_OUTPUT) += output/mvp_output_plugin.o +OBJS-$(CONFIG_NULL_OUTPUT) += output/null_output_plugin.o +OBJS-$(CONFIG_OPENAL_OUTPUT) += output/openal_output_plugin.o +OBJS-$(CONFIG_OSX_OUTPUT) += output/osx_output_plugin.o +OBJS-$(CONFIG_PIPE_OUTPUT) += output/pipe_output_plugin.o +OBJS-$(CONFIG_RECORDER_OUTPUT) += output/recorder_output_plugin.o +OBJS-$(CONFIG_SHOUT_OUTPUT) += output/shout_output_plugin.o +OBJS-$(CONFIG_SOLARIS_OUTPUT) += output/solaris_output_plugin.o + +OBJS-$(CONFIG_LIBID3TAG) += tag_id3.o \ + tag_rva2.o + +OBJS-$(CONFIG_ZEROCONF) += zeroconf.o +OBJS-$(CONFIG_AVAHI) += zeroconf-avahi.o +OBJS-$(CONFIG_BONJOUR) += zeroconf-bonjour.o diff --git a/src/archive_list.c b/src/archive_list.c index e23567bd..2cdb750c 100644 --- a/src/archive_list.c +++ b/src/archive_list.c @@ -29,13 +29,13 @@ #include const struct archive_plugin *const archive_plugins[] = { -#ifdef HAVE_BZ2 +#if CONFIG_BZ2_ARCHIVE &bz2_archive_plugin, #endif -#ifdef HAVE_ZZIP +#if CONFIG_ZZIP_ARCHIVE &zzip_archive_plugin, #endif -#ifdef HAVE_ISO9660 +#if CONFIG_ISO9660_ARCHIVE &iso9660_archive_plugin, #endif NULL diff --git a/src/check.h b/src/check.h index 0642a4b9..6baef90d 100644 --- a/src/check.h +++ b/src/check.h @@ -33,7 +33,7 @@ * */ -#ifndef PACKAGE_VERSION +#ifndef MPD_CONFIG_H #error config.h missing #endif diff --git a/src/client_new.c b/src/client_new.c index cf28c43c..4dba4d88 100644 --- a/src/client_new.c +++ b/src/client_new.c @@ -34,7 +34,7 @@ #endif #include -#ifdef HAVE_LIBWRAP +#if CONFIG_LIBWRAP #include #endif @@ -54,7 +54,7 @@ client_new(struct player_control *player_control, assert(player_control != NULL); assert(fd >= 0); -#ifdef HAVE_LIBWRAP +#if CONFIG_LIBWRAP if (sa->sa_family != AF_UNIX) { char *hostaddr = sockaddr_to_string(sa, sa_length, NULL); const char *progname = g_get_prgname(); diff --git a/src/command.c b/src/command.c index 86d216a7..9cb0e69b 100644 --- a/src/command.c +++ b/src/command.c @@ -62,7 +62,7 @@ #include "song.h" #include "song_print.h" -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 #include "sticker.h" #include "sticker_print.h" #include "song_sticker.h" @@ -1655,7 +1655,7 @@ handle_idle(struct client *client, return 1; } -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 struct sticker_song_find_data { struct client *client; const char *name; @@ -2065,7 +2065,7 @@ static const struct command commands[] = { { "single", PERMISSION_CONTROL, 1, 1, handle_single }, { "stats", PERMISSION_READ, 0, 0, handle_stats }, { "status", PERMISSION_READ, 0, 0, handle_status }, -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 { "sticker", PERMISSION_ADMIN, 3, -1, handle_sticker }, #endif { "stop", PERMISSION_CONTROL, 0, 0, handle_stop }, @@ -2083,7 +2083,7 @@ static const unsigned num_commands = sizeof(commands) / sizeof(commands[0]); static bool command_available(G_GNUC_UNUSED const struct command *cmd) { -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 if (strcmp(cmd->cmd, "sticker") == 0) return sticker_enabled(); #endif diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index b6309440..cffbefcc 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -285,6 +285,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is, #endif #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0) +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 50000 uint8_t aligned_buffer[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16]; const size_t buffer_size = sizeof(aligned_buffer); #else diff --git a/src/fd_util.c b/src/fd_util.c index 882b4c7d..9807cd16 100644 --- a/src/fd_util.c +++ b/src/fd_util.c @@ -45,7 +45,7 @@ #include #endif -#ifdef HAVE_INOTIFY_INIT +#if HAVE_INOTIFY_INIT #include #endif @@ -141,7 +141,7 @@ pipe_cloexec(int fd[2]) #else int ret; -#ifdef HAVE_PIPE2 +#if HAVE_PIPE2 ret = pipe2(fd, O_CLOEXEC); if (ret >= 0 || errno != ENOSYS) return ret; @@ -165,7 +165,7 @@ pipe_cloexec_nonblock(int fd[2]) #else int ret; -#ifdef HAVE_PIPE2 +#if HAVE_PIPE2 ret = pipe2(fd, O_CLOEXEC|O_NONBLOCK); if (ret >= 0 || errno != ENOSYS) return ret; @@ -258,7 +258,7 @@ accept_cloexec_nonblock(int fd, struct sockaddr *address, int ret; socklen_t address_length = *address_length_r; -#ifdef HAVE_ACCEPT4 +#if HAVE_ACCEPT4 ret = accept4(fd, address, &address_length, SOCK_CLOEXEC|SOCK_NONBLOCK); if (ret >= 0 || errno != ENOSYS) { @@ -306,14 +306,14 @@ recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags) #endif -#ifdef HAVE_INOTIFY_INIT +#if HAVE_INOTIFY_INIT int inotify_init_cloexec(void) { int fd; -#ifdef HAVE_INOTIFY_INIT1 +#if HAVE_INOTIFY_INIT1 fd = inotify_init1(IN_CLOEXEC); if (fd >= 0 || errno != ENOSYS) return fd; diff --git a/src/inotify_update.h b/src/inotify_update.h index ca75c0f4..9bf6e4df 100644 --- a/src/inotify_update.h +++ b/src/inotify_update.h @@ -22,26 +22,10 @@ #include "check.h" -#ifdef HAVE_INOTIFY_INIT - void mpd_inotify_init(unsigned max_depth); void mpd_inotify_finish(void); -#else /* !HAVE_INOTIFY_INIT */ - -static inline void -mpd_inotify_init(G_GNUC_UNUSED unsigned max_depth) -{ -} - -static inline void -mpd_inotify_finish(void) -{ -} - -#endif /* !HAVE_INOTIFY_INIT */ - #endif diff --git a/src/input_registry.c b/src/input_registry.c index dca49449..8581b3d3 100644 --- a/src/input_registry.c +++ b/src/input_registry.c @@ -20,28 +20,22 @@ #include "config.h" #include "input_registry.h" #include "input/file_input_plugin.h" - -#ifdef ENABLE_ARCHIVE #include "input/archive_input_plugin.h" -#endif +#include "input/ffmpeg_input_plugin.h" -#ifdef ENABLE_CURL +#if CONFIG_CURL_INPUT #include "input/curl_input_plugin.h" #endif -#ifdef ENABLE_SOUP +#if CONFIG_SOUP_INPUT #include "input/soup_input_plugin.h" #endif -#ifdef HAVE_FFMPEG -#include "input/ffmpeg_input_plugin.h" -#endif - -#ifdef ENABLE_CDIO_PARANOIA +#if CONFIG_CDIO_PARANOIA_INPUT #include "input/cdio_paranoia_input_plugin.h" #endif -#ifdef ENABLE_DESPOTIFY +#if CONFIG_DESPOTIFY_INPUT #include "input/despotify_input_plugin.h" #endif @@ -49,22 +43,18 @@ const struct input_plugin *const input_plugins[] = { &input_plugin_file, -#ifdef ENABLE_ARCHIVE + &input_plugin_ffmpeg, &input_plugin_archive, -#endif -#ifdef ENABLE_CURL +#if CONFIG_CURL_INPUT &input_plugin_curl, #endif -#ifdef ENABLE_SOUP +#if CONFIG_SOUP_INPUT &input_plugin_soup, #endif -#ifdef HAVE_FFMPEG - &input_plugin_ffmpeg, -#endif -#ifdef ENABLE_CDIO_PARANOIA +#if CONFIG_CDIO_PARANOIA_INPUT &input_plugin_cdio_paranoia, #endif -#ifdef ENABLE_DESPOTIFY +#if CONFIG_DESPOTIFY_INPUT &input_plugin_despotify, #endif NULL diff --git a/src/log.c b/src/log.c index 86dd86ea..aa19e80f 100644 --- a/src/log.c +++ b/src/log.c @@ -37,7 +37,7 @@ #include #include -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG #include #endif @@ -149,7 +149,7 @@ log_init_file(const char *path, unsigned line, GError **error_r) return true; } -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG static int glib_to_syslog_level(GLogLevelFlags log_level) @@ -254,7 +254,7 @@ log_init(bool verbose, bool use_stdout, GError **error_r) } else { param = config_get_param(CONF_LOG_FILE); if (param == NULL) { -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG /* no configuration: default to syslog (if available) */ log_init_syslog(); @@ -265,7 +265,7 @@ log_init(bool verbose, bool use_stdout, GError **error_r) CONF_LOG_FILE); return false; #endif -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG } else if (strcmp(param->value, "syslog") == 0) { log_init_syslog(); return true; @@ -333,7 +333,7 @@ void close_log_files(void) if (stdout_mode) return; -#ifdef HAVE_SYSLOG +#if HAVE_SYSLOG if (out_filename == NULL) closelog(); #endif diff --git a/src/main.c b/src/main.c index 4a10f143..b13358c1 100644 --- a/src/main.c +++ b/src/main.c @@ -57,11 +57,11 @@ #include "tag_pool.h" #include "mpd_error.h" -#ifdef ENABLE_INOTIFY +#if CONFIG_INOTIFY #include "inotify_update.h" #endif -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 #include "sticker.h" #endif @@ -188,7 +188,7 @@ glue_db_init_and_load(void) static void glue_sticker_init(void) { -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 GError *error = NULL; char *sticker_file = config_dup_path(CONF_STICKER_FILE, &error); if (sticker_file == NULL && error != NULL) @@ -461,7 +461,7 @@ int mpd_main(int argc, char *argv[]) } success = config_get_bool(CONF_AUTO_UPDATE, false); -#ifdef ENABLE_INOTIFY +#if CONFIG_INOTIFY if (success && mapper_has_music_directory()) mpd_inotify_init(config_get_unsigned(CONF_AUTO_UPDATE_DEPTH, G_MAXUINT)); @@ -491,7 +491,7 @@ int mpd_main(int argc, char *argv[]) g_main_loop_unref(main_loop); -#ifdef ENABLE_INOTIFY +#if CONFIG_INOTIFY mpd_inotify_finish(); #endif @@ -507,7 +507,7 @@ int mpd_main(int argc, char *argv[]) g_debug("db_finish took %f seconds", ((float)(clock()-start))/CLOCKS_PER_SEC); -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 sticker_global_finish(); #endif diff --git a/src/output_list.c b/src/output_list.c index 835c02bb..8ec08abb 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -40,56 +40,56 @@ #include "output/winmm_output_plugin.h" const struct audio_output_plugin *const audio_output_plugins[] = { -#ifdef HAVE_SHOUT +#if CONFIG_SHOUT_OUTPUT &shout_output_plugin, #endif &null_output_plugin, -#ifdef HAVE_FIFO +#if CONFIG_FIFO_OUTPUT &fifo_output_plugin, #endif -#ifdef ENABLE_PIPE_OUTPUT +#if CONFIG_PIPE_OUTPUT &pipe_output_plugin, #endif -#ifdef HAVE_ALSA +#if CONFIG_ALSA_OUTPUT &alsa_output_plugin, #endif -#ifdef HAVE_ROAR +#if CONFIG_ROAR_OUTPUT &roar_output_plugin, #endif -#ifdef HAVE_AO +#if CONFIG_AO_OUTPUT &ao_output_plugin, #endif -#ifdef HAVE_OSS +#if CONFIG_OSS_OUTPUT &oss_output_plugin, #endif -#ifdef HAVE_OPENAL +#if CONFIG_OPENAL_OUTPUT &openal_output_plugin, #endif -#ifdef HAVE_OSX +#if CONFIG_OSX_OUTPUT &osx_output_plugin, #endif -#ifdef ENABLE_SOLARIS_OUTPUT +#if CONFIG_SOLARIS_OUTPUT &solaris_output_plugin, #endif -#ifdef HAVE_PULSE +#if CONFIG_PULSE_OUTPUT &pulse_output_plugin, #endif -#ifdef HAVE_MVP +#if CONFIG_MVP_OUTPUT &mvp_output_plugin, #endif -#ifdef HAVE_JACK +#if CONFIG_JACK_OUTPUT &jack_output_plugin, #endif -#ifdef ENABLE_HTTPD_OUTPUT +#if CONFIG_HTTPD_OUTPUT &httpd_output_plugin, #endif -#ifdef ENABLE_RECORDER_OUTPUT +#if CONFIG_RECORDER_OUTPUT &recorder_output_plugin, #endif -#ifdef ENABLE_WINMM_OUTPUT +#if CONFIG_WINMM_OUTPUT &winmm_output_plugin, #endif -#ifdef ENABLE_FFADO_OUTPUT +#if CONFIG_FFADO_OUTPUT &ffado_output_plugin, #endif NULL diff --git a/src/pcm_resample.c b/src/pcm_resample.c index 4bc057a7..bb75db6c 100644 --- a/src/pcm_resample.c +++ b/src/pcm_resample.c @@ -20,17 +20,17 @@ #include "config.h" #include "pcm_resample_internal.h" -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE #include "conf.h" #endif #include -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE static bool lsr_enabled; #endif -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE static bool pcm_resample_lsr_enabled(void) { @@ -41,7 +41,7 @@ pcm_resample_lsr_enabled(void) bool pcm_resample_global_init(GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE const char *converter = config_get_string(CONF_SAMPLERATE_CONVERTER, ""); @@ -58,7 +58,7 @@ pcm_resample_global_init(GError **error_r) void pcm_resample_init(struct pcm_resample_state *state) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) pcm_resample_lsr_init(state); else @@ -68,7 +68,7 @@ void pcm_resample_init(struct pcm_resample_state *state) void pcm_resample_deinit(struct pcm_resample_state *state) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) pcm_resample_lsr_deinit(state); else @@ -79,7 +79,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state) void pcm_resample_reset(struct pcm_resample_state *state) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE pcm_resample_lsr_reset(state); #else (void)state; @@ -94,7 +94,7 @@ pcm_resample_float(struct pcm_resample_state *state, unsigned dest_rate, size_t *dest_size_r, GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) return pcm_resample_lsr_float(state, channels, src_rate, src_buffer, src_size, @@ -121,7 +121,7 @@ pcm_resample_16(struct pcm_resample_state *state, unsigned dest_rate, size_t *dest_size_r, GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) return pcm_resample_lsr_16(state, channels, src_rate, src_buffer, src_size, @@ -143,7 +143,7 @@ pcm_resample_32(struct pcm_resample_state *state, unsigned dest_rate, size_t *dest_size_r, GError **error_r) { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE if (pcm_resample_lsr_enabled()) return pcm_resample_lsr_32(state, channels, src_rate, src_buffer, src_size, diff --git a/src/pcm_resample.h b/src/pcm_resample.h index a49a2414..8e73659d 100644 --- a/src/pcm_resample.h +++ b/src/pcm_resample.h @@ -27,7 +27,7 @@ #include #include -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE #include #endif @@ -36,7 +36,7 @@ * holds buffer allocations and the state for the resampler. */ struct pcm_resample_state { -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE SRC_STATE *state; SRC_DATA data; diff --git a/src/pcm_resample_internal.h b/src/pcm_resample_internal.h index a0e108d4..528ea2d6 100644 --- a/src/pcm_resample_internal.h +++ b/src/pcm_resample_internal.h @@ -30,7 +30,7 @@ #include "check.h" #include "pcm_resample.h" -#ifdef HAVE_LIBSAMPLERATE +#if CONFIG_LIBSAMPLERATE bool pcm_resample_lsr_global_init(const char *converter, GError **error_r); diff --git a/src/resolver.c b/src/resolver.c index 243b7cd0..3ab0a50e 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -20,13 +20,13 @@ #include "config.h" #include "resolver.h" -#ifndef G_OS_WIN32 -#include -#include -#else /* G_OS_WIN32 */ +#if HAVE_WINSOCK2_H #include #include -#endif /* G_OS_WIN32 */ +#else +#include +#include +#endif #include @@ -38,7 +38,7 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) struct sockaddr_in a4; #endif int ret; - char host[NI_MAXHOST], serv[NI_MAXSERV]; + char host[1024], serv[1024]; #if defined(HAVE_IPV6) && defined(IN6_IS_ADDR_V4MAPPED) if (sa->sa_family == AF_INET6 && @@ -64,14 +64,14 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) return NULL; } -#ifdef HAVE_UN +#if HAVE_UN if (sa->sa_family == AF_UNIX) /* "serv" contains corrupt information with unix sockets */ return g_strdup(host); #endif -#ifdef HAVE_IPV6 +#if HAVE_IPV6 if (strchr(host, ':') != NULL) return g_strconcat("[", host, "]:", serv, NULL); #endif diff --git a/src/server_socket.c b/src/server_socket.c index 39639959..4616fa25 100644 --- a/src/server_socket.c +++ b/src/server_socket.c @@ -19,7 +19,7 @@ #include "config.h" -#ifdef HAVE_STRUCT_UCRED +#if HAVE_STRUCT_UCRED #define _GNU_SOURCE 1 #endif @@ -127,7 +127,7 @@ one_socket_to_string(const struct one_socket *s) static int get_remote_uid(int fd) { -#ifdef HAVE_STRUCT_UCRED +#if HAVE_STRUCT_UCRED struct ucred cred; socklen_t len = sizeof (cred); @@ -136,7 +136,7 @@ get_remote_uid(int fd) return cred.uid; #else -#ifdef HAVE_GETPEEREID +#if HAVE_GETPEEREID uid_t euid; gid_t egid; @@ -346,7 +346,7 @@ server_socket_add_address(struct server_socket *ss, return s; } -#ifdef HAVE_TCP +#if 1 /** * Add a listener on a port on all IPv4 interfaces. @@ -385,13 +385,13 @@ server_socket_add_port_ipv6(struct server_socket *ss, unsigned port) } #endif /* HAVE_IPV6 */ -#endif /* HAVE_TCP */ +#endif bool server_socket_add_port(struct server_socket *ss, unsigned port, GError **error_r) { -#ifdef HAVE_TCP +#if 1 if (port == 0 || port > 0xffff) { g_set_error(error_r, server_socket_quark(), 0, "Invalid TCP port"); @@ -406,21 +406,21 @@ server_socket_add_port(struct server_socket *ss, unsigned port, ++ss->next_serial; return true; -#else /* HAVE_TCP */ +#else (void)ss; (void)port; g_set_error(error_r, server_socket_quark(), 0, "TCP support is disabled"); return false; -#endif /* HAVE_TCP */ +#endif } bool server_socket_add_host(struct server_socket *ss, const char *hostname, unsigned port, GError **error_r) { -#ifdef HAVE_TCP +#if 1 struct addrinfo *ai = resolve_host_port(hostname, port, AI_PASSIVE, SOCK_STREAM, error_r); @@ -435,7 +435,7 @@ server_socket_add_host(struct server_socket *ss, const char *hostname, ++ss->next_serial; return true; -#else /* HAVE_TCP */ +#else (void)ss; (void)hostname; (void)port; @@ -443,14 +443,14 @@ server_socket_add_host(struct server_socket *ss, const char *hostname, g_set_error(error_r, server_socket_quark(), 0, "TCP support is disabled"); return false; -#endif /* HAVE_TCP */ +#endif } bool server_socket_add_path(struct server_socket *ss, const char *path, GError **error_r) { -#ifdef HAVE_UN +#if CONFIG_UD struct sockaddr_un s_un; size_t path_length = strlen(path); @@ -471,13 +471,13 @@ server_socket_add_path(struct server_socket *ss, const char *path, s->path = g_strdup(path); return true; -#else /* !HAVE_UN */ +#else (void)ss; (void)path; g_set_error(error_r, server_socket_quark(), 0, "UNIX domain socket support is disabled"); return false; -#endif /* !HAVE_UN */ +#endif } diff --git a/src/update_archive.c b/src/update_archive.c index 3fb2bc18..932b5d86 100644 --- a/src/update_archive.c +++ b/src/update_archive.c @@ -137,7 +137,7 @@ update_archive_file(struct directory *directory, const char *name, const char *suffix, const struct stat *st) { -#ifdef ENABLE_ARCHIVE +#if CONFIG_ARCHIVES const struct archive_plugin *plugin = archive_plugin_from_suffix(suffix); if (plugin == NULL) diff --git a/src/update_archive.h b/src/update_archive.h index 838697dd..4be262f5 100644 --- a/src/update_archive.h +++ b/src/update_archive.h @@ -28,7 +28,7 @@ struct directory; struct archive_plugin; -#ifdef ENABLE_ARCHIVE +#if CONFIG_ARCHIVES bool update_archive_file(struct directory *directory, diff --git a/src/update_remove.c b/src/update_remove.c index f443f5eb..3dd67da6 100644 --- a/src/update_remove.c +++ b/src/update_remove.c @@ -24,7 +24,7 @@ #include "playlist.h" #include "main.h" -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 #include "sticker.h" #include "song_sticker.h" #endif @@ -53,7 +53,7 @@ song_remove_event(void) g_message("removing %s", uri); g_free(uri); -#ifdef ENABLE_SQLITE +#if CONFIG_LIBSQLITE3 /* if the song has a sticker, remove it */ if (sticker_enabled()) sticker_song_delete(removed_song); diff --git a/src/zeroconf.c b/src/zeroconf.c index 4a399e4a..cd1c3fa7 100644 --- a/src/zeroconf.c +++ b/src/zeroconf.c @@ -51,11 +51,11 @@ void initZeroconf(void) serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME); -#ifdef HAVE_AVAHI +#if HAVE_AVAHI init_avahi(serviceName); #endif -#ifdef HAVE_BONJOUR +#if HAVE_BONJOUR init_zeroconf_osx(serviceName); #endif } @@ -65,11 +65,11 @@ void finishZeroconf(void) if (!zeroconfEnabled) return; -#ifdef HAVE_AVAHI +#if HAVE_AVAHI avahi_finish(); #endif /* HAVE_AVAHI */ -#ifdef HAVE_BONJOUR +#if HAVE_BONJOUR bonjour_finish(); #endif } diff --git a/src/zeroconf.h b/src/zeroconf.h index 8e33a3d8..7a792d7d 100644 --- a/src/zeroconf.h +++ b/src/zeroconf.h @@ -22,7 +22,7 @@ #include "check.h" -#ifdef HAVE_ZEROCONF +#if HAVE_ZEROCONF void initZeroconf(void); void finishZeroconf(void); -- cgit v1.2.3