2003-10-13 11:03:14 -04:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2009-04-01 08:33:00 -04:00
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_PREREQ([2.60])
|
2017-07-21 18:25:35 -04:00
|
|
|
AC_INIT([forked-daapd], [25.0])
|
2016-12-27 18:57:41 -05:00
|
|
|
|
2014-04-14 16:44:05 -04:00
|
|
|
AC_CONFIG_SRCDIR([config.h.in])
|
2010-06-21 11:50:09 -04:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2016-12-27 17:51:37 -05:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2014-04-14 16:44:05 -04:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2017-02-16 13:44:00 -05:00
|
|
|
AM_INIT_AUTOMAKE([foreign subdir-objects 1.11])
|
|
|
|
AM_SILENT_RULES([no])
|
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
dnl Requires autoconf 2.60
|
2007-01-16 20:06:16 -05:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
2003-10-13 11:03:14 -04:00
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_PROG_CC_C_O
|
|
|
|
AC_PROG_SED
|
|
|
|
AC_PROG_MKDIR_P
|
2009-04-05 12:22:48 -04:00
|
|
|
LT_INIT([disable-static])
|
2006-10-18 23:08:13 -04:00
|
|
|
|
2017-01-06 15:49:57 -05:00
|
|
|
AC_PATH_PROG([GPERF], [[gperf]])
|
2017-01-06 03:44:18 -05:00
|
|
|
AS_IF([[test -z "$GPERF"]],
|
|
|
|
[AS_IF([[test -f "$srcdir/src/dmap_fields_hash.h"]],
|
2017-01-06 15:49:57 -05:00
|
|
|
[AM_MISSING_PROG([GPERF], [[gperf]])
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_MSG_NOTICE([[
|
2016-12-27 18:32:08 -05:00
|
|
|
|
|
|
|
GNU gperf not found, but it's output appears to be present.
|
2017-01-06 03:44:18 -05:00
|
|
|
If you modify any gperf or ANTLR grammar files (.g), you will need
|
|
|
|
to install it.]])],
|
|
|
|
[AC_MSG_ERROR([[GNU gperf required, please install it.]])])
|
|
|
|
])
|
2011-03-31 11:33:12 -04:00
|
|
|
|
2017-01-06 15:49:57 -05:00
|
|
|
AC_PATH_PROG([ANTLR], [[antlr3]])
|
2017-01-06 03:44:18 -05:00
|
|
|
AS_IF([[test -z "$ANTLR"]],
|
|
|
|
[AS_IF([[test -f "$srcdir/src/SMARTPLLexer.h"]],
|
2017-01-06 15:49:57 -05:00
|
|
|
[AM_MISSING_PROG([ANTLR], [[antlr3]])
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_MSG_NOTICE([[
|
2016-12-27 18:32:08 -05:00
|
|
|
|
|
|
|
antlr3 not found, but it's output appears to be present.
|
2017-01-06 03:44:18 -05:00
|
|
|
If you modify any ANTLR grammar files (.g), you will need to install it.]])],
|
|
|
|
[AC_MSG_ERROR([[antlr3 wrapper required, please install it.]])])
|
|
|
|
])
|
2009-06-02 09:51:38 -04:00
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
dnl Enable all warnings by default.
|
|
|
|
AM_CPPFLAGS="-Wall"
|
2016-12-27 17:51:37 -05:00
|
|
|
AC_SUBST([AM_CPPFLAGS])
|
2009-04-05 12:31:00 -04:00
|
|
|
|
2016-12-29 19:14:22 -05:00
|
|
|
dnl Checks for header files.
|
|
|
|
AC_CHECK_HEADERS_ONCE([regex.h pthread_np.h])
|
|
|
|
AC_CHECK_HEADERS([sys/wait.h sys/param.h dirent.h getopt.h stdint.h], [],
|
2017-01-06 03:44:18 -05:00
|
|
|
[AC_MSG_ERROR([[Missing header required to build forked-daapd]])])
|
|
|
|
AC_CHECK_HEADERS([time.h], [],
|
|
|
|
[AC_MSG_ERROR([[Missing header required to build forked-daapd]])])
|
2016-12-29 19:14:22 -05:00
|
|
|
AC_CHECK_FUNCS_ONCE([posix_fadvise euidaccess pipe2])
|
|
|
|
AC_CHECK_FUNCS([strptime strtok_r], [],
|
2017-01-06 03:44:18 -05:00
|
|
|
[AC_MSG_ERROR([[Missing function required to build forked-daapd]])])
|
|
|
|
|
2017-01-14 00:56:43 -05:00
|
|
|
dnl check for clock_gettime or replace it
|
|
|
|
AC_SEARCH_LIBS([clock_gettime], [rt],
|
|
|
|
[AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
|
|
|
|
[Define to 1 if have clock_gettime function])],
|
|
|
|
[AC_CHECK_HEADER([mach/mach_time.h],
|
|
|
|
[AC_DEFINE([HAVE_MACH_CLOCK], 1,
|
|
|
|
[Define to 1 if mach kernel clock replacement available])],
|
|
|
|
[AC_MSG_ERROR([[Missing clock_gettime and any replacement]])])])
|
|
|
|
|
|
|
|
dnl check for timer_settime or replace it
|
|
|
|
AC_SEARCH_LIBS([timer_settime], [rt],
|
|
|
|
[AC_DEFINE([HAVE_TIMER_SETTIME], 1,
|
|
|
|
[Define to 1 if have timer_settime function])],
|
|
|
|
[AC_CHECK_HEADER([mach/mach_time.h],
|
|
|
|
[AC_DEFINE([HAVE_MACH_TIMER], 1,
|
|
|
|
[Define to 1 if mach kernel clock replacement available])],
|
|
|
|
[AC_MSG_ERROR([[Missing timer_settime and any replacement]])])])
|
2017-01-06 03:44:18 -05:00
|
|
|
|
|
|
|
AC_SEARCH_LIBS([pthread_exit], [pthread], [],
|
|
|
|
[AC_MSG_ERROR([[pthreads library is required]])])
|
2017-01-06 16:58:02 -05:00
|
|
|
AC_SEARCH_LIBS([pthread_setname_np], [pthread],
|
|
|
|
[dnl Validate pthread_setname_np with 2 args (some have 1)
|
|
|
|
AC_MSG_CHECKING([[for two-parameter pthread_setname_np]])
|
|
|
|
AC_TRY_LINK([@%:@include <pthread.h>],
|
|
|
|
[pthread_setname_np(pthread_self(), "name");],
|
|
|
|
[AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE([HAVE_PTHREAD_SETNAME_NP], 1,
|
|
|
|
[Define to 1 if you have pthread_setname_np])],
|
|
|
|
[AC_MSG_RESULT([[no]])])],
|
|
|
|
[AC_SEARCH_LIBS([pthread_set_name_np], [pthread],
|
|
|
|
[AC_CHECK_FUNCS([pthread_set_name_np])])])
|
2016-04-12 16:11:56 -04:00
|
|
|
|
2010-02-02 15:00:06 -05:00
|
|
|
dnl Large File Support (LFS)
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
|
2003-10-13 11:03:14 -04:00
|
|
|
dnl Checks for libraries.
|
2010-06-21 11:50:09 -04:00
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_SUBST([COMMON_LIBS])
|
|
|
|
AC_SUBST([COMMON_CPPFLAGS])
|
|
|
|
AC_SUBST([FORKED_LIBS])
|
|
|
|
AC_SUBST([FORKED_CPPFLAGS])
|
2017-02-19 09:21:00 -05:00
|
|
|
AC_SUBST([FORKED_OPTS_LIBS])
|
|
|
|
AC_SUBST([FORKED_OPTS_CPPFLAGS])
|
2017-01-06 03:44:18 -05:00
|
|
|
|
|
|
|
AM_ICONV
|
|
|
|
dnl All FORK_ macros defined in m4/fork_checks.m4
|
2017-01-10 13:10:09 -05:00
|
|
|
FORK_FUNC_REQUIRE([COMMON], [GNU libunistring], [LIBUNISTRING], [unistring],
|
2017-01-14 00:56:43 -05:00
|
|
|
[u8_strconv_from_locale], [uniconv.h], [],
|
|
|
|
[dnl Retry test with iconv library
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_VARS_PREPEND([COMMON], [LIBICONV], [INCICONV])
|
2017-01-14 00:56:43 -05:00
|
|
|
FORK_FUNC_REQUIRE([COMMON], [GNU libunistring], [LIBUNISTRING],
|
|
|
|
[unistring], [u8_strconv_from_locale], [uniconv.h])])
|
2017-01-06 03:44:18 -05:00
|
|
|
|
|
|
|
FORK_MODULES_CHECK([FORKED], [ZLIB], [zlib], [deflate], [zlib.h])
|
|
|
|
FORK_MODULES_CHECK([FORKED], [CONFUSE], [libconfuse], [cfg_init], [confuse.h])
|
|
|
|
FORK_MODULES_CHECK([FORKED], [MINIXML], [mxml], [mxmlNewElement], [mxml.h],
|
2017-01-27 18:16:33 -05:00
|
|
|
[AC_CHECK_FUNCS([mxmlGetOpaque] [mxmlGetText] [mxmlGetType] [mxmlGetFirstChild])])
|
2017-01-06 03:44:18 -05:00
|
|
|
|
|
|
|
dnl SQLite3 requires extra checks
|
|
|
|
FORK_MODULES_CHECK([COMMON], [SQLITE3], [sqlite3 >= 3.5.0],
|
|
|
|
[sqlite3_initialize], [sqlite3.h],
|
|
|
|
[dnl Check that SQLite3 has the unlock notify API built-in
|
|
|
|
AC_CHECK_FUNC([[sqlite3_unlock_notify]], [],
|
|
|
|
[AC_MSG_ERROR([[SQLite3 was built without unlock notify support]])])
|
|
|
|
dnl Check that SQLite3 has been built with threadsafe operations
|
|
|
|
AC_MSG_CHECKING([[if SQLite3 was built with threadsafe operations support]])
|
|
|
|
AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <sqlite3.h>
|
|
|
|
]], [[
|
|
|
|
int ret = sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
|
|
|
|
if (ret != SQLITE_OK)
|
|
|
|
return 1;]])],
|
|
|
|
[AC_MSG_RESULT([[yes]])],
|
|
|
|
[AC_MSG_RESULT([[no]])
|
|
|
|
AC_MSG_ERROR([[SQLite3 was not built with threadsafe operations support]])],
|
|
|
|
[AC_MSG_RESULT([[runtime will tell]])])
|
|
|
|
])
|
2015-07-21 17:00:55 -04:00
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
dnl libevent2 requires version checks
|
|
|
|
FORK_MODULES_CHECK([FORKED], [LIBEVENT], [libevent >= 2],
|
|
|
|
[event_base_new], [event2/event.h],
|
|
|
|
[dnl check for old version
|
|
|
|
PKG_CHECK_EXISTS([libevent >= 2.1.4], [],
|
|
|
|
[AC_DEFINE([HAVE_LIBEVENT2_OLD], 1,
|
|
|
|
[Define to 1 if you have libevent 2 (<2.1.4)])])
|
|
|
|
])
|
2015-07-21 17:00:55 -04:00
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
dnl antlr version checks
|
2017-01-10 13:10:09 -05:00
|
|
|
FORK_FUNC_REQUIRE([FORKED], [ANTLR3 C runtime], [ANTLR3C], [antlr3c],
|
2017-01-06 03:44:18 -05:00
|
|
|
[antlr3BaseRecognizerNew], [antlr3.h],
|
|
|
|
[AC_CHECK_FUNC([[antlr3NewAsciiStringInPlaceStream]],
|
|
|
|
[AC_DEFINE([ANTLR3C_NEW_INPUT], 0,
|
|
|
|
[define if antlr3 C runtime uses new input routines])],
|
|
|
|
[AC_DEFINE([ANTLR3C_NEW_INPUT], 1,
|
|
|
|
[define if antlr3 C runtime uses new input routines])])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_PATH_LIBGCRYPT([1:1.2.0])
|
2017-01-10 13:10:09 -05:00
|
|
|
FORK_FUNC_REQUIRE([FORKED], [GNU Crypt Library], [LIBGCRYPT], [gcrypt],
|
2017-01-06 03:44:18 -05:00
|
|
|
[gcry_control], [gcrypt.h])
|
|
|
|
AM_PATH_GPG_ERROR([1.6])
|
2017-01-10 13:10:09 -05:00
|
|
|
FORK_FUNC_REQUIRE([FORKED], [GNUPG Error Values], [GPG_ERROR_MT], [gpg-error],
|
2017-01-06 03:44:18 -05:00
|
|
|
[gpg_err_init], [gpg-error.h])
|
|
|
|
|
|
|
|
AC_CHECK_HEADER([sys/eventfd.h], [AC_CHECK_FUNCS([eventfd])])
|
|
|
|
|
|
|
|
AC_CHECK_HEADER([sys/timerfd.h], [AC_CHECK_FUNC([timerfd_create],
|
|
|
|
[AC_DEFINE([HAVE_TIMERFD], 1, [Define to 1 if you have timerfd])])])
|
|
|
|
|
2017-01-10 13:10:09 -05:00
|
|
|
FORK_FUNC_REQUIRE([FORKED], [inotify], [INOTIFY], [inotify],
|
2017-01-06 03:44:18 -05:00
|
|
|
[inotify_add_watch], [sys/inotify.h])
|
|
|
|
|
|
|
|
have_signal=no
|
|
|
|
AC_CHECK_HEADER([sys/signalfd.h], [AC_CHECK_FUNCS([signalfd], [have_signal=yes])])
|
|
|
|
AC_CHECK_HEADER([sys/event.h], [AC_CHECK_FUNCS([kqueue], [have_signal=yes])])
|
|
|
|
AS_IF([[test "$have_signal" = "no"]],
|
|
|
|
[AC_MSG_ERROR([[Either signalfd or kqueue are required]])])
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS_ONCE([endian.h sys/endian.h])
|
|
|
|
AC_CHECK_DECL([htobe16], [],
|
2017-01-14 00:56:43 -05:00
|
|
|
[AC_CHECK_HEADERS([libkern/OSByteOrder.h], [],
|
|
|
|
[AC_MSG_ERROR([[Missing functions to swap byte order]])])],
|
2017-01-06 03:44:18 -05:00
|
|
|
[AC_INCLUDES_DEFAULT[
|
|
|
|
#ifdef HAVE_ENDIAN_H
|
|
|
|
# include <endian.h>
|
|
|
|
#elif defined(HAVE_SYS_ENDIAN_H)
|
|
|
|
# include <sys/endian.h>
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
|
2017-02-19 09:21:00 -05:00
|
|
|
dnl libav checks should be last, as they are sometimes both installed
|
|
|
|
dnl and the CPPFLAGS/LIBS needs to be at the front of the search list.
|
|
|
|
dnl Handle alternative package names for libav
|
|
|
|
PKG_CHECK_EXISTS([libavcodec-libav], [LIBAV=-libav], [LIBAV=])
|
|
|
|
dnl Preference for ffmpeg if we have both (this could be an option...)
|
|
|
|
PKG_CHECK_EXISTS([libavcodec], [LIBAV=])
|
|
|
|
dnl Option to choose libav even if ffmpeg is detected first
|
|
|
|
AC_ARG_WITH([libav], [AS_HELP_STRING([--with-libav],
|
|
|
|
[choose libav even if ffmpeg present (default=no)])],
|
|
|
|
[[LIBAV=-libav]], [[LIBAV=]])
|
|
|
|
dnl libav/ffmpeg requires many feature checks
|
|
|
|
FORK_MODULES_CHECK([FORKED], [LIBAV],
|
|
|
|
[libavformat$LIBAV libavcodec$LIBAV libswscale$LIBAV libavutil$LIBAV libavfilter$LIBAV],
|
|
|
|
[av_init_packet], [libavcodec/avcodec.h],
|
|
|
|
[dnl Checks for misc libav and ffmpeg API differences
|
|
|
|
AC_MSG_CHECKING([whether libav libraries are ffmpeg])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libavcodec/avcodec.h>
|
|
|
|
]], [[
|
|
|
|
#if LIBAVCODEC_VERSION_MICRO >= 100
|
|
|
|
/* ffmpeg uses 100+ as its micro version */
|
|
|
|
#else
|
|
|
|
#error libav provider is not ffmpeg
|
|
|
|
#endif
|
|
|
|
]])], [
|
|
|
|
[is_ffmpeg=yes]
|
|
|
|
AC_DEFINE([HAVE_FFMPEG], 1,
|
|
|
|
[Define to 1 if you have ffmpeg (not libav)])],
|
|
|
|
[[is_ffmpeg=no]])
|
|
|
|
AC_MSG_RESULT([$is_ffmpeg])
|
2017-03-04 19:46:01 -05:00
|
|
|
dnl Check if we have modern or legacy AV apis
|
|
|
|
FORK_CHECK_DECLS([avcodec_send_packet, avcodec_parameters_from_context],
|
|
|
|
[libavcodec/avcodec.h],
|
|
|
|
[[modern_av_apis=yes]],
|
|
|
|
[[modern_av_apis=no]
|
|
|
|
FORK_CHECK_DECLS([av_buffersrc_add_frame_flags],
|
|
|
|
[libavfilter/buffersrc.h])
|
|
|
|
FORK_CHECK_DECLS([av_buffersink_get_frame],
|
|
|
|
[libavfilter/buffersink.h])
|
|
|
|
FORK_CHECK_DECLS([avfilter_graph_parse_ptr],
|
|
|
|
[libavfilter/avfilter.h])
|
|
|
|
FORK_CHECK_DECLS([av_packet_unref], [libavcodec/avcodec.h])
|
|
|
|
FORK_CHECK_DECLS([av_packet_rescale_ts], [libavcodec/avcodec.h])
|
|
|
|
FORK_CHECK_DECLS([avformat_alloc_output_context2],
|
|
|
|
[libavformat/avformat.h])
|
|
|
|
FORK_CHECK_DECLS([av_frame_alloc], [libavutil/frame.h])
|
|
|
|
FORK_CHECK_DECLS([av_frame_get_best_effort_timestamp],
|
|
|
|
[libavutil/frame.h])
|
|
|
|
FORK_CHECK_DECLS([av_image_fill_arrays], [libavutil/imgutils.h])
|
|
|
|
FORK_CHECK_DECLS([av_image_get_buffer_size], [libavutil/imgutils.h])
|
|
|
|
AC_CHECK_HEADERS([libavutil/channel_layout.h libavutil/mathematics.h])
|
|
|
|
])
|
2017-02-19 09:21:00 -05:00
|
|
|
])
|
2017-03-04 19:46:01 -05:00
|
|
|
AM_CONDITIONAL([COND_FFMPEG_LEGACY], [[test "x$modern_av_apis" = "xno"]])
|
2017-03-04 05:10:43 -05:00
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_CHECK_SIZEOF([void *])
|
2015-07-21 17:00:55 -04:00
|
|
|
|
|
|
|
dnl --- Begin configuring the options ---
|
2016-11-05 08:33:30 -04:00
|
|
|
dnl ALSA
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [ALSA support], [alsa], [ALSA],
|
2017-01-06 03:44:18 -05:00
|
|
|
[alsa], [snd_mixer_open], [asoundlib.h])
|
|
|
|
AM_CONDITIONAL([COND_ALSA], [[test "x$with_alsa" = "xyes"]])
|
2016-11-05 08:33:30 -04:00
|
|
|
|
|
|
|
dnl PULSEAUDIO
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [Pulseaudio support], [pulseaudio], [LIBPULSE],
|
2017-01-06 03:44:18 -05:00
|
|
|
[libpulse], [pa_stream_get_state], [pulse/pulseaudio.h],
|
|
|
|
[AC_CHECK_FUNCS([pa_threaded_mainloop_set_name])])
|
|
|
|
AM_CONDITIONAL([COND_PULSEAUDIO], [[test "x$with_pulseaudio" = "xyes"]])
|
2016-11-05 08:33:30 -04:00
|
|
|
|
|
|
|
dnl Build with libcurl
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [libcurl support], [libcurl], [LIBCURL],
|
2017-01-06 03:44:18 -05:00
|
|
|
[libcurl], [curl_global_init], [curl/curl.h])
|
2016-11-05 08:33:30 -04:00
|
|
|
|
2017-08-12 14:01:57 -04:00
|
|
|
dnl Build with libwebsockets
|
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [libwebsockets support], [libwebsockets], [LIBWEBSOCKETS],
|
|
|
|
[libwebsockets >= 2.0.2])
|
2017-09-15 18:05:50 -04:00
|
|
|
AM_CONDITIONAL([COND_LIBWEBSOCKETS], [[test "x$with_libwebsockets" = "xyes"]])
|
2017-08-12 14:01:57 -04:00
|
|
|
|
2017-06-19 15:52:01 -04:00
|
|
|
dnl Build with libsodium
|
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [libsodium support], [libsodium], [LIBSODIUM],
|
|
|
|
[libsodium], [sodium_init], [sodium.h])
|
|
|
|
|
|
|
|
dnl Build with libplist
|
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [libplist support], [libplist], [LIBPLIST],
|
|
|
|
[libplist >= 0.16], [plist_dict_get_item], [plist/plist.h])
|
|
|
|
|
2017-01-30 16:50:02 -05:00
|
|
|
dnl Build with libevent_pthreads
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [libevent_pthreads support],
|
|
|
|
[libevent_pthreads], [LIBEVENT_PTHREADS], [libevent_pthreads],
|
|
|
|
[evthread_use_pthreads], [event2/thread.h])
|
2017-01-30 16:50:02 -05:00
|
|
|
|
2016-11-05 08:33:30 -04:00
|
|
|
dnl Build with json-c
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [json-c support], [json], [JSON_C],
|
2017-01-06 03:44:18 -05:00
|
|
|
[json-c >= 0.11], [json_tokener_parse], [json.h], [],
|
2017-02-19 09:21:00 -05:00
|
|
|
[FORK_MODULES_CHECK([FORKED_OPTS], [JSON_C], [json],
|
2017-01-06 03:44:18 -05:00
|
|
|
[json_tokener_parse], [json.h],
|
|
|
|
[[with_json=yes]
|
|
|
|
AC_DEFINE([HAVE_JSON_C_OLD], 1,
|
|
|
|
[Define to 1 if you have json-c < 0.11])],
|
|
|
|
[AS_IF([[test "x$with_json" != "xcheck"]],
|
|
|
|
[AC_MSG_FAILURE([[--with-json was given, but test for json-c failed]])])
|
|
|
|
[with_json=no]]
|
|
|
|
)])
|
2016-11-05 08:33:30 -04:00
|
|
|
|
2017-01-14 00:56:43 -05:00
|
|
|
dnl Build with Avahi (or Bonjour if not)
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_ARG_WITH_CHECK([FORKED_OPTS], [Avahi mDNS], [avahi], [AVAHI],
|
2017-01-14 00:56:43 -05:00
|
|
|
[avahi-client >= 0.6.24], [avahi_client_new], [avahi-client/client.h])
|
|
|
|
AS_IF([[test "x$with_avahi" = "xno"]],
|
2017-02-19 09:21:00 -05:00
|
|
|
[FORK_FUNC_REQUIRE([FORKED_OPTS], [Bonjour DNS_SD], [DNSSD], [dns_sd],
|
2017-01-14 00:56:43 -05:00
|
|
|
[DNSServiceGetAddrInfo], [dns_sd.h], [],
|
|
|
|
[AC_MSG_ERROR([[Avahi client or Bonjour DNS_SD required, please install one.]])])])
|
|
|
|
AM_CONDITIONAL([COND_AVAHI], [[test "x$with_avahi" = "xyes"]])
|
|
|
|
|
2015-07-21 17:00:55 -04:00
|
|
|
dnl Spotify with dynamic linking to libspotify
|
2017-01-06 03:44:18 -05:00
|
|
|
FORK_ARG_ENABLE([Spotify support], [spotify], [SPOTIFY],
|
|
|
|
[AS_IF([[test "x$with_json" = "xno"]],
|
|
|
|
[AC_MSG_ERROR([[Spotify support requires json-c]])])
|
2017-01-30 16:50:02 -05:00
|
|
|
AS_IF([[test "x$with_libevent_pthreads" = "xno"]],
|
|
|
|
[AC_MSG_ERROR([[Spotify support requires libevent_pthreads]])])
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_MODULES_CHECK([SPOTIFY], [LIBSPOTIFY], [libspotify],
|
|
|
|
[], [libspotify/api.h])
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_DEFINE([HAVE_SPOTIFY_H], 1,
|
|
|
|
[Define to 1 if you have the <libspotify/api.h> header file.])
|
2017-02-19 09:21:00 -05:00
|
|
|
dnl Don't link with libspotify, use dynamic linking
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_SEARCH_LIBS([dlopen], [dl], [],
|
2017-02-19 09:21:00 -05:00
|
|
|
[AC_MSG_ERROR([[Spotify support requires dlopen]])])
|
|
|
|
FORK_VAR_PREPEND([FORKED_OPTS_CPPFLAGS], [$SPOTIFY_CPPFLAGS])
|
|
|
|
FORK_VAR_PREPEND([FORKED_OPTS_LIBS], [-rdynamic])
|
2017-01-06 03:44:18 -05:00
|
|
|
])
|
|
|
|
AM_CONDITIONAL([COND_SPOTIFY], [[test "x$enable_spotify" = "xyes"]])
|
2014-03-11 18:20:29 -04:00
|
|
|
|
2015-07-21 17:00:55 -04:00
|
|
|
dnl LastFM support with libcurl
|
2017-01-06 03:44:18 -05:00
|
|
|
FORK_ARG_ENABLE([LastFM support], [lastfm], [LASTFM],
|
|
|
|
[AS_IF([[test "x$with_libcurl" = "xno"]],
|
2017-09-15 18:05:50 -04:00
|
|
|
[AC_MSG_ERROR([[LastFM support requires libcurl]])])
|
|
|
|
])
|
2017-01-06 03:44:18 -05:00
|
|
|
AM_CONDITIONAL([COND_LASTFM], [[test "x$enable_lastfm" = "xyes"]])
|
2015-07-21 17:00:55 -04:00
|
|
|
|
2016-01-17 14:59:16 -05:00
|
|
|
dnl ChromeCast support with libprotobuf-c
|
2017-01-06 15:49:57 -05:00
|
|
|
FORK_ARG_ENABLE([Chromecast support], [chromecast], [CHROMECAST],
|
2017-01-06 03:44:18 -05:00
|
|
|
[AS_IF([[test "x$with_json" = "xno"]],
|
|
|
|
[AC_MSG_ERROR([[Chromecast support requires json-c]])])
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_MODULES_CHECK([FORKED_OPTS], [LIBPROTOBUF_C],
|
2017-01-06 03:44:18 -05:00
|
|
|
[libprotobuf-c >= 1.0.0], [protobuf_c_message_pack],
|
|
|
|
[protobuf-c/protobuf-c.h], [],
|
2017-02-19 09:21:00 -05:00
|
|
|
[FORK_FUNC_REQUIRE([FORKED_OPTS], [v0 libprotobuf-c],
|
2017-01-06 03:44:18 -05:00
|
|
|
[LIBPROTOBUF_OLD], [protobuf-c],
|
|
|
|
[protobuf_c_message_pack],
|
|
|
|
[google/protobuf-c/protobuf-c.h],
|
|
|
|
[AC_DEFINE([HAVE_PROTOBUF_OLD], 1,
|
|
|
|
[Define to 1 if you have libprotobuf < 1.0.0])
|
|
|
|
[protobuf_old=yes]],
|
|
|
|
[AC_MSG_ERROR([[Chromecast support requires protobuf-c]])])
|
|
|
|
])
|
2017-02-19 09:21:00 -05:00
|
|
|
FORK_MODULES_CHECK([FORKED_OPTS], [GNUTLS], [gnutls], [gnutls_init],
|
2017-01-06 03:44:18 -05:00
|
|
|
[gnutls/gnutls.h])
|
2016-12-27 18:15:04 -05:00
|
|
|
])
|
2017-01-06 03:44:18 -05:00
|
|
|
AM_CONDITIONAL([COND_CHROMECAST], [[test "x$enable_chromecast" = "xyes"]])
|
|
|
|
AM_CONDITIONAL([COND_PROTOBUF_OLD], [[test "x$protobuf_old" = "xyes"]])
|
2016-01-17 14:59:16 -05:00
|
|
|
|
2017-06-19 15:52:01 -04:00
|
|
|
dnl iTunes playlists with libplist
|
|
|
|
FORK_ARG_DISABLE([iTunes Music Library XML support], [itunes], [ITUNES],
|
|
|
|
[AS_IF([[test "x$with_libplist" = "xno"]],
|
|
|
|
[AC_MSG_ERROR([[iTunes Music Library XML support requires libplist]])])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL([COND_ITUNES], [[test "x$enable_itunes" = "xyes"]])
|
|
|
|
|
2015-07-21 17:00:55 -04:00
|
|
|
dnl MPD support
|
2017-01-06 03:44:18 -05:00
|
|
|
FORK_ARG_DISABLE([MPD client protocol support], [mpd], [MPD])
|
|
|
|
AM_CONDITIONAL([COND_MPD], [[test "x$enable_mpd" = "xyes"]])
|
2016-12-27 18:47:00 -05:00
|
|
|
|
2017-06-19 15:52:01 -04:00
|
|
|
dnl Apple device verification
|
|
|
|
FORK_ARG_DISABLE([Apple TV device verification], [verification], [RAOP_VERIFICATION],
|
|
|
|
[
|
|
|
|
AS_IF([[test "x$with_libsodium" = "xno"]],
|
|
|
|
[AC_MSG_ERROR([[Apple TV device verification requires libsodium]])])
|
|
|
|
AS_IF([[test "x$with_libplist" = "xno"]],
|
|
|
|
[AC_MSG_ERROR([[Apple TV device verification requires libplist]])])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL([COND_RAOP_VERIFICATION], [[test "x$enable_verification" = "xyes"]])
|
|
|
|
|
2017-01-06 03:44:18 -05:00
|
|
|
dnl Defining users and groups
|
2016-12-27 18:47:00 -05:00
|
|
|
AC_ARG_WITH([daapd_user],
|
|
|
|
[AS_HELP_STRING([--with-daapd-user=USER],
|
|
|
|
[User for running forked-daapd (default=daapd)])],
|
2017-01-06 03:44:18 -05:00
|
|
|
[[test x"$withval" = xyes && withval=]], [[withval=]])
|
2016-12-27 18:47:00 -05:00
|
|
|
DAAPD_USER=${withval:-daapd}
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_SUBST([DAAPD_USER])
|
2016-12-27 18:47:00 -05:00
|
|
|
|
|
|
|
AC_ARG_WITH([daapd_group],
|
|
|
|
[AS_HELP_STRING([--with-daapd-group=GROUP],
|
|
|
|
[Group for daapd user (default=USER)])],
|
2017-01-06 03:44:18 -05:00
|
|
|
[[test x"$withval" = xyes && withval=]], [[withval=]])
|
2016-12-27 18:47:00 -05:00
|
|
|
DAAPD_GROUP=${withval:-$DAAPD_USER}
|
2017-01-06 03:44:18 -05:00
|
|
|
AC_SUBST([DAAPD_GROUP])
|
2016-07-21 16:13:32 -04:00
|
|
|
dnl --- End options ---
|
|
|
|
|
2016-12-27 17:51:37 -05:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
src/Makefile
|
|
|
|
sqlext/Makefile
|
2017-08-12 13:43:10 -04:00
|
|
|
htdocs/Makefile
|
2016-12-27 17:51:37 -05:00
|
|
|
Makefile
|
2016-12-27 18:57:41 -05:00
|
|
|
forked-daapd.spec
|
2016-12-27 17:51:37 -05:00
|
|
|
])
|
|
|
|
AC_OUTPUT
|