3
# MediaTomb - http://www.mediatomb.cc/
5
# configure.ac - this file is part of MediaTomb.
7
# Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
# Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
10
# Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
11
# Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
# Leonhard Wimmer <leo@mediatomb.cc>
14
# MediaTomb is free software; you can redistribute it and/or modify
15
# it under the terms of the GNU General Public License version 2
16
# as published by the Free Software Foundation.
18
# MediaTomb is distributed in the hope that it will be useful,
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
# GNU General Public License for more details.
23
# You should have received a copy of the GNU General Public License
24
# version 2 along with MediaTomb; if not, write to the Free Software
25
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
27
# $Id: configure.ac 2015 2009-01-11 23:22:17Z jin_eld $
32
AC_INIT([MediaTomb], [0.12.0], [jin@mediatomb.cc])
33
AM_CONFIG_HEADER([autoconfig.h tombupnp/upnp/inc/upnpconfig.h])
34
AC_CONFIG_AUX_DIR(configure_aux)
35
AC_CONFIG_SRCDIR([src/common.h])
36
AM_INIT_AUTOMAKE([1.9 -Wall])
38
if test "x${prefix}" = "xNONE"; then
39
prefix="${ac_default_prefix}"
42
SEARCH_DIR="/usr/local"
56
SEARCH_DIR="/opt/local"
59
AC_DEFINE([SOLARIS], [1], [we are on solaris])
75
# AC_HELP_STRING([--with-search=DIR], [Additionally search for packages in DIR]),
78
# AC_MSG_NOTICE([Will also search for packages in $SEARCH_DIR])
82
SEARCH_DIR_HEADERS="$SEARCH_DIR/include"
83
SEARCH_DIR_LIBS="$SEARCH_DIR/lib"
84
SEARCH_DIR_PROGS="$SEARCH_DIR/bin"
86
# per package header and library search paths
89
AC_HELP_STRING([--with-js-h=DIR], [search for js (spidermonkey) headers in DIR]),
91
JS_SEARCH_HEADERS="$withval"
96
AC_HELP_STRING([--with-js-libs=DIR], [search for js (spidermonkey) libraries in DIR]),
98
JS_SEARCH_LIBS="$withval"
103
AC_HELP_STRING([--with-iconv-h=DIR], [search for iconv headers in DIR]),
105
ICONV_SEARCH_HEADERS="$withval"
106
AC_MSG_NOTICE([Will search for iconv headers in $withval])
110
AC_ARG_WITH(iconv-libs,
111
AC_HELP_STRING([--with-iconv-libs=DIR], [search for iconv libraries in DIR]),
113
ICONV_SEARCH_LIBS="$withval"
114
AC_MSG_NOTICE([Will search for iconv libraries in $withval])
118
MT_OPTION([static], [enable],
119
[build a static version of MediaTomb],
121
CFLAGS="$CFLAGS -static"
122
CXXFLAGS="$CXXFLAGS -static"
123
AC_MSG_NOTICE([Building a static executable.])
127
MT_OPTION([db-autocreate], [disable],
128
[automatic creation of the database],[],[])
130
MT_OPTION([debug-malloc0], [enable],
131
[only for debugging purposes: abort when we try to call malloc or realloc with a value of zero],
133
AC_DEFINE([DEBUG_MALLOC_0], [1],
134
[debug: abort on malloc/realloc of zero bytes])
139
MT_OPTION([pthread-lib], [enable],
140
[if this option is set we will try to link with -lpthread, else the flag for pthread will be autodetected], [], [])
142
MT_OPTION([iconv-lib], [enable],
143
[if this option is set we will try to link with -liconv, else we will first try to use iconv built into glibc and only then search for libiconv],
163
MT_OPTION([atomic-x86-single], [enable],
164
[use x86 singleprocessor code for atomic arithmetic operations, this will increase performance but you must not use the compiled binary on an SMP system. Doing so might result in crashes and unexpected behaviour],
166
if test "$X86" -eq 1; then
170
AC_MSG_ERROR([Tried to activate x86 specific option for a non x86 host!])
175
AC_ARG_ENABLE([atomic-pthread],
177
AC_HELP_STRING([--enable-atomic-pthread],
178
[use pthreads for atomic arithmetic operations, this will deliver the worst performance but is the only portable option (default: automatic, depending on architecture])
181
if test "x$enableval" = xyes; then
182
if test "$ATOMIC_X86" -eq 1; then
183
AC_MSG_ERROR([You can not use atomic-x86-single and atomic-pthread code at the same time!])
192
MT_OPTION([atomic], [disable],
193
[NEVER disable this! This is only for devel/debugging - disables all atomic arithmetics code],
198
AC_MSG_WARN(You disabled the use of atomic arithmetics! You have been warned!)
199
AC_DEFINE([ATOMIC_TORTURE], [1], [NEVER use this! This is only for devel/debugging - disables all atomic arithmetics code.])
202
if ((test $ATOMIC_X86_SMP -eq 1) && (test $ATOMIC_X86 -eq 1)); then
203
AC_MSG_ERROR([Cannot use atomic-x86-smp and atomic-x86 options at the same time!])
206
if (((test $ATOMIC_X86_SMP -eq 1) || (test $ATOMIC_X86 -eq 1)) &&
207
(test "$X86" -eq 0)); then
208
AC_MSG_ERROR([Cannot use x86 specific code on a non a $host_cpu system!])
211
if test $ATOMIC_X86_SMP -eq 1; then
212
AC_DEFINE([ATOMIC_X86_SMP], [1], [use x86 assembler code for atomic arithmetic operations - default for SMP and UP systems])
213
elif test $ATOMIC_X86 -eq 1; then
214
AC_DEFINE([ATOMIC_X86], [1], [use x86 assembler code for atomic arithmetic operations that will only work oni singleprocessor systems - compiled binary will be buggy on SMP])
215
AC_MSG_WARN(You specified to use atomic arithmetics code for x86 single processor systems! The resulting binary must not be used on SMP machines!)
220
if test $X86 -eq 1; then
224
AC_ARG_ENABLE([sighup],
226
AC_HELP_STRING([--enable-sighup],
227
[enable SIGHUP handling, by default this is only enabled for x86 platforms, consult the README for more information (default: auto)])
230
if test "x$enableval" = xno; then
238
if test $SIGHUP -eq 1; then
239
AC_DEFINE([ENABLE_SIGHUP], [1], [enable SIGHUP handling])
242
MT_OPTION([mrreg-service], [enable],
243
[Enable the X_MS_MediaReceiverRegistrar UPnP service. This is for future XBox 360 support, other renderers will probably not need it],
245
AC_DEFINE([ENABLE_MRREG], [1], [Enable the X_MS_MediaReceiverRegistrar UPnP service. This is for future XBox 360 support, other renderers will probably not need it])
248
MT_OPTION([external-transcoding], [disable],
249
[external transcoding support],
250
[],[EXTERNAL_TRANSCODING_OPTION_ENABLED=disabled])
252
MT_OPTION([sopcast], [enable],
253
[SopCast service support],
255
AC_DEFINE([SOPCAST], [1], [SopCast service support])
256
],[SOPCAST_OPTION_ENABLED=disabled])
259
MT_OPTION([youtube], [disable],
260
[YouTube service support],
261
[],[YOUTUBE_OPTION_ENABLED=disabled])
263
MT_OPTION([weborama], [enable],
264
[Weborama service support],
265
[],[WEBORAMA_OPTION_ENABLED=disabled])
267
MT_OPTION([atrailers], [disable],
268
[Apple Trailers service support],
269
[],[ATRAILERS_OPTION_ENABLED=disabled])
271
MT_OPTION([sqlite-backup-defaults], [enable],
272
[enable sqlite database backup settings in config.xml by default],
275
MT_OPTION([protocolinfo-extension], [disable],
276
[This is required for Playstation 3 support, it adds certain tags to the protocolInfo attribute],
278
AC_DEFINE([EXTEND_PROTOCOLINFO], [1], [This is required for Playstation 3 support, it adds certain tags to the protocolInfo attribute])
283
AC_ARG_ENABLE([curl],
285
AC_HELP_STRING([--enable-curl],
286
[Enable curl support (required for YouTube support, provides additional functionality for the external transcoding feature (default: auto)])
289
if test "x$enableval" = xno; then
299
AC_ARG_WITH([curl-cfg],
301
AC_HELP_STRING([--with-curl-cfg=curl-config],
302
[absolute path/name of curl-config])
305
CURL_SEARCH_CONFIG="$withval"
306
AC_MSG_NOTICE([Will search for curl-config in $withval])
310
MT_OPTION([fseeko-check], [disable],
311
[This is a workaround for a bug on some Debian distros, use this if configure fails complaining about off_t],
314
###############################################################################
315
# The following block is derived from the configure.ac script from the
316
# libupnp-1.3.1 package
317
# (C) Copyright 2005-2006 Remi Turboult <r3mi@users.sourceforge.net>
321
AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION",
323
AC_DEFINE_UNQUOTED([UPNP_VERSION_MAJOR], $upnpmaj, [see upnpconfig.h])
324
AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h])
325
AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h])
326
###############################################################################
331
AC_PROG_GCC_TRADITIONAL
341
AC_CHECK_HEADERS([time.h syslog.h stddef.h unistd.h arpa/inet.h fcntl.h], [],
342
[AC_MSG_ERROR(required header not found)])
344
AC_CHECK_HEADERS([limits.h netdb.h netinet/in.h stdlib.h string.h sys/file.h],
346
[AC_MSG_ERROR(required header not found)])
347
AC_CHECK_HEADERS([sys/ioctl.h sys/socket.h sys/time.h sys/types.h sys/wait.h],
349
[AC_MSG_ERROR(required header not found)])
351
AC_CHECK_HEADERS([langinfo.h locale.h],[],[AC_MSG_WARN(Header that is required to retrieve system locale not found, will use default value)])
353
AC_CHECK_HEADERS([sys/utsname.h])
355
AC_CHECK_HEADERS([sched.h ctype.h],[],[])
356
AC_CHECK_FUNCS([sched_getparam sched_setparam sched_get_priority_min sched_get_priority_max],[],[])
358
AC_CHECK_FUNCS([mkdir], [],
359
[AC_MSG_ERROR(required function not found)])
361
AC_CHECK_HEADERS([getopt.h],
363
AC_CHECK_FUNCS([getopt_long],[],
365
getopt_long not found - all command line options disabled)
370
AC_MSG_WARN(getopt.h not found - all command line options disabled)
377
CPPFLAGS_SAVE="$CPPFLAGS"
378
CFLAGS_SAVE="$CFLAGS"
379
CXXFLAGS_SAVE="$CXXFLAGS"
380
LDFLAGS_SAVE="$LDFLAGS"
382
if test "x$EXTERNAL_TRANSCODING_OPTION_ENABLED" = xyes; then
383
AC_CHECK_FUNCS([mkfifo],
385
AC_DEFINE([EXTERNAL_TRANSCODING], [1], [external transcoding feature])
388
if test "x$EXTERNAL_TRANSCODING_OPTION_REQUESTED" = xyes; then
389
AC_MSG_ERROR([mkfifo is required by the external transcoding feature])
391
AC_MSG_WARN([mkfifo is required by the external transcoding feature])
392
EXTERNAL_TRANSCODING_OPTION_ENABLED=disabled
402
if test -n "$ICONV_SEARCH_HEADERS"; then
403
AC_CHECK_HEADER([$ICONV_SEARCH_HEADERS/iconv.h],
405
ICONV_CXXFLAGS="-I$ICONV_SEARCH_HEADERS"
408
AC_MSG_ERROR(iconv.h not found in requested location $ICONV_SEARCH_HEADERS)
413
AC_CHECK_HEADER([iconv.h],
416
unset ac_cv_header_iconv_h
417
AC_CHECK_HEADER([/usr/local/include/iconv.h],
419
ICONV_CXXFLAGS="-I/usr/local/include"
420
if test -z "$ICONV_SEARCH_LIBS"; then
421
LDFLAGS="-L/usr/local/lib"
425
unset ac_cv_header_iconv_h
426
AC_CHECK_HEADER([$SEARCH_DIR_HEADERS/iconv.h],
428
ICONV_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
429
if test -z "$ICONV_SEARCH_LIBS"; then
430
LDFLAGS="-L$SEARCH_DIR_LIBS"
433
[AC_MSG_ERROR(required header iconv.h not found on your system)]
442
if test -n "$ICONV_SEARCH_LIBS"; then
443
if test "x$ICONV_LIB_OPTION_ENABLED" = xno; then
444
LDFLAGS="-L$ICONV_SEARCH_LIBS"
445
AC_CHECK_FUNC([iconv],
447
ICONV_LIBS="-L$ICONV_SEARCH_LIBS"
450
LDFLAGS="-L$ICONV_SEARCH_LIBS -liconv"
451
AC_CHECK_LIB(iconv, iconv,
453
ICONV_LIBS="-L$ICONV_SEARCH_LIBS -liconv"
457
AC_CHECK_LIB(iconv, libiconv,
459
ICONV_LIBS="-L$ICONV_SEARCH_LIBS -liconv"
462
[AC_MSG_ERROR(required library iconv not found in requested location $ICONV_SEARCH_LIBS)]
469
LDFLAGS="-L$ICONV_SEARCH_LIBS -liconv"
470
AC_CHECK_LIB(iconv, iconv,
472
ICONV_LIBS="-L$ICONV_SEARCH_LIBS -liconv"
475
[AC_MSG_ERROR(You specified to use libiconv but it was not found in the requested location $ICONV_SEARCH_LIBS)]
479
if test "x$ICONV_LIB_OPTION_ENABLED" = xno; then
480
AC_CHECK_FUNC([iconv],
482
ICONV_LIBS="$LDFLAGS"
486
LDFLAGS="$LDFLAGS -liconv"
487
AC_CHECK_LIB(iconv, iconv,
489
ICONV_LIBS="$LDFLAGS"
493
AC_CHECK_LIB(iconv, libiconv,
495
ICONV_LIBS="$LDFLAGS"
498
[AC_MSG_ERROR(required library iconv not found on your system)]
505
LDFLAGS="$LDFLAGS -liconv"
506
AC_CHECK_LIB(iconv, iconv,
508
ICONV_LIBS="$LDFLAGS"
512
AC_MSG_ERROR(You specified to use libiconv but the library was not found)
518
if test $LIBICONV -eq 1; then
519
AC_DEFINE([HAVE_LIBICONV], [1], [we are using the libiconv library])
522
AC_SUBST(ICONV_CXXFLAGS)
525
CFLAGS="$CFLAGS $ICONV_CXXFLAGS -Werror"
526
AC_MSG_CHECKING([if iconv declaration requires const char cast])
537
(void)iconv(cd, ptr, &len, ptr, &len);
544
AC_DEFINE([ICONV_CONST], [1],
545
[iconv needs const char cast])
551
CFLAGS="$CFLAGS_SAVE"
552
CXXFLAGS="$CXXFLAGS_SAVE"
553
LDFLAGS="$LDFLAGS_SAVE"
555
AC_CHECK_HEADERS(execinfo.h,[],[])
557
AC_CHECK_TYPES([time_t], [], [], [#include <sys/types.h>])
564
#AC_CHECK_TYPES([ssize_t], [], [], [#include <sys/types.h>])
566
if test "x$FSEEKO_CHECK_OPTION_ENABLED" = xyes; then
569
if test "$ac_cv_func_fseeko" = no || test "$ac_cv_sys_largefile_source" = unknown; then
570
AC_MSG_WARN([fseeko has not been found on your system, will use fseek instead.])
571
AC_MSG_WARN([This has not been tested, please report if you have any problems.])
572
AC_DEFINE([fseeko], [fseek], [fseeko not present])
575
AC_MSG_WARN([Skipping fseeko test! (requested by user)])
578
AC_CHECK_SIZEOF(off_t, 4)
579
AC_CHECK_SIZEOF(size_t, 4)
580
AC_CHECK_SIZEOF(time_t, 4)
581
AC_CHECK_SIZEOF(unsigned int)
582
AC_CHECK_SIZEOF(unsigned long)
583
AC_CHECK_FUNCS(strtoll nl_langinfo setlocale,[],[])
584
AC_CHECK_FUNCS(backtrace backtrace_symbols,[],[])
585
# Checks for typedefs, structures, and compiler characteristics.
598
dnl This needs improvement!
599
AC_CHECK_DECL(LONG_MAX,
601
AC_DEFINE([HAVE_LONG_MAX], [1], [LONG_MAX definition available])
603
], , [#include <limits.h>])
606
AC_CHECK_DECL(LLONG_MAX,
608
AC_DEFINE([MAXLLONG], [LLONG_MAX], [LLONG_MAX definition])
611
AC_CHECK_DECL(__LONG_LONG_MAX__,
613
AC_DEFINE([MAXLLONG], [__LONG_LONG_MAX__],
614
[LLONG_MAX definition])],
616
if test "$have_long_max" -eq 1; then
617
AC_DEFINE([MAXLLONG], [LONG_MAX], [LLONG_MAX not available])
619
], [#include <limits.h>])
621
, [#include <limits.h>])
623
AC_ARG_ENABLE(rpl-malloc,
624
AC_HELP_STRING([--disable-rpl-malloc], [disable redefinition of malloc to rpl_malloc and realloc to rpl_realloc. Use this if you are sure that you are compiling for the GNU C library (default: enabled)]),
626
if test "x$enableval" = xno; then
627
ac_cv_func_malloc_0_nonnull=yes
628
ac_cv_func_realloc_0_nonnull=yes
629
AC_MSG_NOTICE([Disabling redefinition of malloc to rpl_malloc])
630
AC_MSG_NOTICE([Disabling redefinition of realloc to rpl_realloc])
631
AC_MSG_WARN([Use this feature only if you are sure that you are building for GNU C!])
637
# Checks for library functions.
639
AC_FUNC_CLOSEDIR_VOID
640
AC_FUNC_ERROR_AT_LINE
645
AC_FUNC_SELECT_ARGTYPES
654
AC_CHECK_FUNCS([gethostname gettimeofday localtime_r memmove memset],
656
[AC_MSG_ERROR(required library function not found)])
657
AC_CHECK_FUNCS([regcomp select strcasecmp strchr strdup strerror strncasecmp],
659
[AC_MSG_ERROR(required library function not found)])
660
AC_CHECK_FUNCS([strrchr strstr strtol strtoul uname], [],
661
[AC_MSG_ERROR(required library function not found)])
663
AC_CHECK_FUNCS([sigaction sigprocmask],[],
664
[AC_MSG_ERROR(required library function not found)])
666
AC_CHECK_FUNCS([ioctl tolower toupper],[],
667
[AC_MSG_ERROR(required library function not found)])
671
AC_CHECK_FUNCS([inet_ntoa],
674
AC_CHECK_LIB(nsl, inet_ntoa,
677
AC_MSG_ERROR(required library function not found)
681
AC_CHECK_FUNCS([socket],
683
[AC_CHECK_LIB(socket, socket,
686
AC_MSG_ERROR(required library function not found)
692
AC_CHECK_FUNCS([gethostbyname],
695
AC_CHECK_LIB(nsl, gethostbyname,
698
AC_MSG_ERROR(required library function not found)
702
if test $DARWIN_OS -eq 1 ; then
703
AC_MSG_NOTICE([You are running OSX, assuming threadsafe gethostbyname version])
704
elif test $CYGWIN_OS -eq 1; then
705
AC_MSG_NOTICE([Your are building under Cygwin, assuming threadsafe gethostbyname implementation])
708
AC_CHECK_FUNCS([gethostbyname_r],[],
710
AC_CHECK_HEADERS([lwres/netdb.h],
712
AC_CHECK_LIB(lwres, lwres_gethostbyname_r,
715
AC_DEFINE(HAVE_LIBLWRES, 1, [lwres library presence])
718
[AC_MSG_ERROR(required library function not found)])
721
if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)) ; then
722
AC_MSG_ERROR([required header not found])
727
AC_CHECK_FUNCS([if_nameindex],[],
729
AC_CHECK_LIB(nsl, if_nameindex,
735
if test $CYGWIN_OS -eq 0; then
736
AC_MSG_ERROR(required library function not found)
743
AC_CHECK_FUNCS([if_freenameindex],[],
745
AC_CHECK_LIB(nsl, if_freenameindex,[],
747
if ((test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)); then
748
AC_MSG_ERROR(required library function not found)
756
# this is not optional, we need the device and the internal webserver
757
AC_DEFINE([UPNP_HAVE_DEVICE], [1], [Compile device API])
758
AC_DEFINE([UPNP_HAVE_WEBSERVER], [1], [Compile internal web server])
763
# see acinclude.m4 for the definition of ACX_PTHREAD
764
if test "x$PTHREAD_LIB_OPTION_ENABLED" = xyes; then
765
MT_CHECK_LIBRARY([pthread], [pthread], [pthread_create])
766
if test "x$PTHREAD_STATUS" != xyes; then
767
AC_MSG_ERROR([pthread library not found, try running configure without the --enable-pthread-lib option])
770
ACX_PTHREAD(,AC_MSG_ERROR(POSIX threads missing))
772
if test $FREEBSD_OS -eq 1; then
773
ADD_PTHREAD_CFLAGS="$PTHREAD_CFLAGS $PTHREAD_LIBS"
776
if test "x$STATIC_OPTION_ENABLED" = xyes; then
777
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
778
LIBS="$LIBS $PTHREAD_LIBS"
779
CFLAGS_SAVE="$CFLAGS_SAVE $PTHREAD_CFLAGS"
780
LIBS_SAVE="$LIBS_SAVE $PTHREAD_LIBS"
783
AC_SUBST(PTHREAD_LIBS)
784
AC_SUBST(PTHREAD_CFLAGS)
789
# we might need librt for sqlite
790
MT_CHECK_LIBRARY([rt], [rt], [clock_gettime])
792
if test "x$RT_STATUS" != xyes; then
793
AC_CHECK_FUNC(clock_gettime)
798
MT_CHECK_OPTIONAL_PACKAGE([zlib], [disable],
799
[zlib support required for automated database creation],
800
[zlib], [z], [uncompress])
803
if test "x$ZLIB_STATUS" = xyes; then
804
if test "x$DB_AUTOCREATE_OPTION_ENABLED" = xyes; then
805
AC_DEFINE([AUTO_CREATE_DATABASE], [1], [create database automatically if it does not exist])
808
if test "x$DB_AUTOCREATE_OPTION_ENABLED" = xyes; then
809
if test "x$DB_AUTOCREATE_OPTION_REQUESTED" = xyes; then
810
AC_MSG_ERROR([Automatic database creation not possible due to missing zlib headers/libraries])
812
AC_MSG_WARN([Automatic database creation not possible due to missing zlib headers/libraries])
813
DB_AUTOCREATE_OPTION_ENABLED=disabled
822
if test "x$RT_STATUS" = xyes; then
823
LDFLAGS="$LDFLAGS $RT_LDFLAGS $RT_LIBS"
826
MT_CHECK_OPTIONAL_PACKAGE([sqlite3], [disable], [sqlite3 database supprot],
827
[sqlite3], [sqlite3], [sqlite3_open])
829
if test "x$SQLITE3_STATUS" = xyes; then
830
if test "x$RT_STATUS" = xyes; then
831
SQLITE_LDFLAGS="$SQLITE_LDFLAGS $RT_LDFLAGS"
832
SQLITE_LIBS="$SQLITE_LIBS $RT_LIBS"
835
AC_SUBST(SQLITE3_LDFLAGS)
836
AC_SUBST(SQLITE3_LIBS)
838
if test "x$SQLITE_BACKUP_OPTION_ENABLED" = xyes; then
839
AC_DEFINE([SQLITE_BACKUP_ENABLED], [1], [enable sqlite db backup settings in config.xml by default])
842
if (test "x$SQLITE_BACKUP_OPTION_ENABLED" = xyes) &&
843
(test "x$SQLITE_BACKUP_OPTION_REQUESTED" = xyes); then
844
AC_MSG_ERROR(You specified the option to use sqlite backup settings but the sqlite support could not be configured)
849
LDFLAGS="$LDFLAGS_SAVE"
850
CPPFLAGS="$CPPFLAGS_SAVE"
851
CXXFLAGS="$CXXFLAGS_SAVE"
855
MT_CHECK_OPTIONAL_PACKAGE_CFG([mysql],
857
[mysql database support],
860
[], [mysql_init],[--libs_r])
862
if test "x$MYSQL_STATUS" = xyes; then
863
AC_MSG_CHECKING(mysql version)
864
MYSQL_VERSION_MAJOR=`echo $MYSQL_VERSION | sed 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).\([[0-9]]\{1,\}\).*$/\1/'`
865
MYSQL_VERSION_MINOR=`echo $MYSQL_VERSION | sed 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).\([[0-9]]\{1,\}\).*$/\2/'`
866
AC_MSG_RESULT($MYSQL_VERSION)
867
if test -z $MYSQL_VERSION_MAJOR || test -z $MYSQL_VERSION_MINOR; then
868
AC_MSG_WARN([could not parse mysql version string])
870
elif test $MYSQL_VERSION_MAJOR -le 3 ; then
871
AC_MSG_WARN(MySQL version too old, we only support version 4.0.x or later)
876
LDFLAGS="$LDFLAGS_SAVE"
877
LIBS="$LIBS $MYSQL_LIBS"
878
CFLAGS="$CFLAGS $MYSQL_CFLAGS"
879
CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS"
880
CPPFLAGS="$CFLAGS $MYSQL_CFLAGS"
882
if test "x$MYSQL_STATUS" = xyes; then
883
AC_DEFINE([HAVE_MYSQL], [1], [MySQL library presence])
885
AC_SUBST(MYSQL_CFLAGS)
886
AC_CHECK_FUNCS([mysql_stmt_init],[],[])
888
AC_MSG_CHECKING([MYSQL_OPT_RECONNECT])
895
(int)mysql_options(0, MYSQL_OPT_RECONNECT, 0);
900
AC_DEFINE([HAVE_MYSQL_OPT_RECONNECT], [1], [MYSQL_OPT_RECONNECT parameter available])
911
CPPFLAGS="$CPPFLAGS_SAVE"
912
CXXFLAGS="$CXXFLAGS_SAVE"
913
CFLAGS="$CFLAGS_SAVE"
914
LDFLAGS="$LDFLAGS_SAVE"
917
######### check if at least one database available
919
if ((test "x$SQLITE3_STATUS" != xyes) && (test "x$MYSQL_STATUS" != xyes)); then
920
AC_MSG_ERROR(Support of at least one of mysql or sqlite3 must be configured)
926
AC_HELP_STRING([--enable-libjs], [compile with spidermonkey support (default: yes)]),
929
if test "x$enableval" = xno; then
942
if test "x$JS_OK" = xyes; then
943
dnl if test $DARWIN_OS -eq 1 ; then
944
dnl XP_ADD="-DXP_MAC"
949
CXXFLAGS="$CXXFLAGS $XP_ADD"
950
CPPFLAGS="$CPPFLAGS $XP_ADD"
952
if test -n "$JS_SEARCH_HEADERS" ; then
953
AC_MSG_NOTICE([Will search for js (spidermonkey) headers in $JS_SEARCH_HEADERS])
954
AC_CHECK_HEADER($JS_SEARCH_HEADERS/jsapi.h,
956
JS_CXXFLAGS="-I$JS_SEARCH_HEADERS"
959
AC_MSG_ERROR([jsapi.h not found in requested location $JS_SEARCH_HEADERS])
964
AC_CHECK_HEADER(jsapi.h,
967
for sm_path in $SEARCH_DIR_HEADERS \
971
/usr/local/include/js \
972
/usr/local/include/smjs \
973
/usr/local/include/mozjs \
974
/usr/include/spidermonkey \
975
/usr/local/include/spidermonkey \
976
$SEARCH_DIR_HEADERS/js \
977
$SEARCH_DIR_HEADERS/smjs \
978
$SEARCH_DIR_HEADERS/mozjs \
979
$SEARCH_DIR_HEADERS/spidermonkey; do
980
if test "x$ac_cv_header_jsapi_h" != xyes ; then
981
AC_MSG_CHECKING([checking alternative libjs header location: $sm_path])
982
CXXFLAGS="$XP_ADD -I$sm_path"
983
CPPFLAGS="$XP_ADD -I$sm_path"
984
unset ac_cv_header_jsapi_h
985
AC_CHECK_HEADER(jsapi.h,
987
JS_CXXFLAGS="-I$sm_path"
988
AC_MSG_RESULT([jsapi.h found in $sm_path])
995
if test "x$ac_cv_header_jsapi_h" != xyes ; then
997
AC_MSG_RESULT([not found, giving up])
1003
if test "x$JS_OK" = xyes; then
1004
if test -n "$JS_SEARCH_LIBS" ; then
1005
AC_MSG_NOTICE([Will search for js (spidermonkey) libraries in $JS_SEARCH_LIBS])
1006
LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -ljs $ADD_PTHREAD_CFLAGS"
1007
AC_CHECK_LIB(js, JS_NewObject,
1009
JS_LIBS="-L$JS_SEARCH_LIBS -ljs"
1013
LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lsmjs $ADD_PTHREAD_CFLAGS"
1014
AC_CHECK_LIB(smjs, JS_NewObject,
1016
JS_LIBS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lsmjs $ADD_PTHREAD_CFLAGS"
1020
LDFLAGS="-L$JS_SEARCH_LIBS $LDFLAGS_SAVE -lmozjs $ADD_PTHREAD_CFLAGS"
1021
AC_CHECK_LIB(mozjs, JS_NewObject,
1023
JS_LIBS="-L$JS_SEARCH_LIBS -lmozjs"
1027
AC_MSG_ERROR([Spidermonkey not found in requested location $JS_SEARCH_LIBS])
1035
LDFLAGS="$LDFLAGS_SAVE $ADD_PTHREAD_CFLAGS"
1036
AC_CHECK_LIB(js, JS_NewObject,
1042
unset ac_cv_lib_js_JS_NewObject
1043
AC_CHECK_LIB(smjs, JS_NewObject,
1049
unset ac_cv_lib_smjs_JS_NewObject
1050
AC_CHECK_LIB(mozjs, JS_NewObject,
1056
LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE $ADD_PTHREAD_CFLAGS"
1057
unset ac_cv_lib_js_JS_NewObject
1058
AC_CHECK_LIB(js, JS_NewObject,
1060
JS_LIBS="-L$SEARCH_DIR_LIBS -ljs"
1064
unset ac_cv_lib_smjs_JS_NewObject
1065
AC_CHECK_LIB(smjs, JS_NewObject,
1067
JS_LIBS="-L$SEARCH_DIR_LIBS -lsmjs"
1071
LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE -lmozjs"
1072
unset ac_cv_lib_mozjs_JS_NewObject
1073
AC_CHECK_LIB(mozjs, JS_NewObject,
1075
JS_LIBS="-L$SEARCH_DIR_LIBS -lmozjs"
1080
AC_MSG_RESULT(libjs/libsmjs link failed, giving up)
1095
if test "x$JS_OK" = xyes; then
1096
AC_DEFINE([HAVE_JS], [1], [libjs presence])
1097
AC_SUBST(JS_CXXFLAGS)
1100
LDFLAGS="$LDFLAGS $JS_LIBS"
1101
CFLAGS="$CFLAGS $JS_CXXFLAGS"
1102
CXXFLAGS="$CXXFLAGS $JS_CXXFLAGS"
1104
AC_CHECK_LIB($MOZLIB, JS_ClearContextThread,
1106
AC_DEFINE([JS_THREADSAFE], [1],
1107
[this version of spidermonkey is threadsafe])
1110
if test "x$JS_EN" = xyes; then
1111
AC_MSG_ERROR(unable to configure libjs support)
1115
CXXFLAGS="$CXXFLAGS_SAVE"
1116
CPPFLAGS="$CPPFLAGS_SAVE"
1117
LDFLAGS="$LDFLAGS_SAVE"
1119
########### libmagic
1120
MT_OPTION([libmagic], [disable],
1121
[filemagic for automatic mimetype recognition],[],[])
1123
if test "x$LIBMAGIC_OPTION_ENABLED" = xyes; then
1124
MT_CHECK_PACKAGE([libmagic], [magic], [magic], [magic_load])
1126
if test "x$LIBMAGIC_STATUS" != xyes; then
1127
if test "x$ZLIB_STATUS" != xyes; then
1128
MT_CHECK_LIBRARY([zlib], [z], [compress])
1129
LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
1130
LIBS="$LIBS $ZLIB_LIBS"
1131
AC_MSG_NOTICE([retrying libmagic check with zlib flags])
1132
MT_CHECK_PACKAGE([libmagic], [magic], [magic], [magic_load])
1133
if test "x$LIBMAGIC_STATUS" = xyes; then
1134
LIBMAGIC_LIBS="$LIBMAGIC_LIBS $ZLIB_LIBS"
1135
LIBMAGIC_LDFLAGS="$LIBMAGIC_LDFLAGS $ZLIB_LDFLAGS"
1138
LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
1139
LIBS="$LIBS $ZLIB_LIBS"
1140
AC_MSG_NOTICE([retrying libmagic check with zlib flags])
1141
MT_CHECK_PACKAGE([libmagic], [magic], [magic], [magic_load])
1142
if test "x$LIBMAGIC_STATUS" = xyes; then
1143
LIBMAGIC_LIBS="$LIBMAGIC_LIBS $ZLIB_LIBS"
1144
LIBMAGIC_LDFLAGS="$LIBMAGIC_LDFLAGS $ZLIB_LDFLAGS"
1148
AC_SUBST(LIBMAGIC_LIBS)
1149
AC_SUBST(LIBMAGIC_LDFLAGS)
1153
if test "x$LIBMAGIC_STATUS" = xyes; then
1154
AC_MSG_CHECKING([if libmagic is broken (Slackware check)])
1155
CFLAGS="$CFLAGS $LIBMAGIC_CXXLAGS"
1156
CXXFLAGS="$CXXFLAGS $LIBMAGIC_CFLAGS"
1157
LDFLAGS="$LDFLAGS $LIBMAGIC_LDFLAGS $LIBMAGIC_LIBS"
1161
AC_LANG_PROGRAM([[ #include <magic.h> ]],
1163
struct magic_set *ms;
1164
ms = magic_open(MAGIC_MIME);
1173
AC_MSG_RESULT([no]);
1176
AC_MSG_RESULT([yes])
1178
AC_MSG_WARN([your magic library is broken, if you are using Slackware install the 'file' package manually])
1181
AC_MSG_RESULT([passing for cross compiling])
1187
if test "x$LIBMAGIC_STATUS" = xyes; then
1188
AC_DEFINE([HAVE_MAGIC], [1], [filemagic library presence])
1190
if (test "x$LIBMAGIC_OPTION_REQUESTED" = xyes) &&
1191
(test "x$LIBMAGIC_OPTION_ENABLED" = xyes); then
1192
AC_MSG_ERROR(unable to configure libmagic support)
1196
CFLAGS="$CFLAGS_SAVE"
1197
CXXFLAGS="$CXXFLAGS_SAVE"
1198
CPPFLAFS="$CPPFLAFS_SAVE"
1199
LDFLGAS="$LDFLAGS_SAVE"
1201
######### taglib or id3lib selection
1206
MT_OPTION([id3lib], [enable],
1207
[id3 metadata extraction with the help of id3lib],[],[])
1209
MT_OPTION([taglib], [disable],
1210
[id3 metadata extraction with the help of taglib],[],[])
1212
if ((test "x$TAGLIB_OPTION_ENABLED" = xno) && (test "x$ID3LIB_OPTION_ENABLED" = xyes)) ; then
1213
TAGLIB_STATUS=disabled
1214
TAGLIB_OPTION_ENABLED=no
1215
AC_MSG_WARN([taglib disabled])
1216
elif ((test "x$TAGLIB_OPTION_ENABLED" = xyes) && (test "x$ID3LIB_OPTION_ENABLED" = xno)) ; then
1217
ID3LIB_STATUS=disabled
1218
ID3LIB_OPTION_ENABLED=no
1219
AC_MSG_WARN([id3lib disabled])
1220
elif ((test "x$TAGLIB_OPTION_ENABLED" = xyes) && (test "x$ID3LIB_OPTION_ENABLED" = xyes)) ; then
1221
AC_MSG_ERROR([Please select either taglib or id3lib, but not both.])
1224
if test "x$TAGLIB_OPTION_ENABLED" = xyes; then
1225
MT_CHECK_PACKAGE_CFG([taglib],
1227
[taglib.h fileref.h tag.h audioproperties.h tstring.h textidentificationframe.h attachedpictureframe.h],
1230
TAGLIB_STATUS=disabled
1231
if test "x$ID3_OPTION_REQUESTED" = no; then
1232
ID3_OPTION_ENABLED=yes
1236
if test "x$TAGLIB_STATUS" = xyes; then
1237
AC_DEFINE([HAVE_ID3_ALBUMART], [1], [not aware of taglib versions that do not support album art])
1238
ID3LIB_STATUS=disabled
1239
ID3LIB_OPTION_ENABLED=no
1241
if (test "x$TAGLIB_OPTION_REQUESTED" = xyes) &&
1242
(test "x$TAGLIB_OPTION_ENABLED" = xyes); then
1243
AC_MSG_ERROR([unable to configure taglib support])
1249
if test "x$ID3LIB_OPTION_ENABLED" = xyes; then
1250
MT_CHECK_PACKAGE([id3lib], [id3/tag], [id3], [main])
1252
if test "x$ID3LIB_STATUS" != xyes; then
1253
if test "x$ZLIB_STATUS" != xyes; then
1254
MT_CHECK_LIBRARY([zlib], [z], [compress])
1255
LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
1256
LIBS="$LIBS $ZLIB_LIBS"
1257
AC_MSG_NOTICE([retrying id3lib check with zlib flags])
1258
MT_CHECK_PACKAGE([id3lib], [id3/tag], [id3], [main])
1259
if test "x$ID3LIB_STATUS" = xyes; then
1260
ID3LIB_LIBS="$ID3LIB_LIBS $ZLIB_LIBS"
1261
ID3LIB_LDFLAGS="$ID3LIB_LDFLAGS $ZLIB_LDFLAGS"
1264
LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
1265
LIBS="$LIBS $ZLIB_LIBS"
1266
AC_MSG_NOTICE([retrying id3lib check with zlib flags])
1267
MT_CHECK_PACKAGE([id3lib], [id3/tag], [id3], [main])
1268
if test "x$ID3LIB_STATUS" = xyes; then
1269
ID3LIB_LIBS="$ID3LIB_LIBS $ZLIB_LIBS"
1270
ID3LIB_LDFLAGS="$ID3LIB_LDFLAGS $ZLIB_LDFLAGS"
1274
AC_SUBST(ID3LIB_LIBS)
1275
AC_SUBST(ID3LIB_LDFLAGS)
1279
if test "x$ID3LIB_STATUS" = xyes; then
1280
CFLAGS="$CFLAGS $ID3_CFLAGS"
1281
CXXFLAGS="$CXXFLAGS $ID3_CFLAGS"
1282
LDFLAGS="$LDFLAGS $ID3LIB_LDFLAGS $ID3LIB_LIBS"
1285
AC_MSG_CHECKING([for album art support in id3lib])
1289
#include <id3/tag.h>
1290
#include <id3/misc_support.h>
1293
(void)ID3_HasPicture(0);
1297
AC_MSG_RESULT([yes])
1298
AC_DEFINE([HAVE_ID3_ALBUMART], [1],
1299
[this version of id3lib has album art support])
1306
if (test "x$ID3LIB_OPTION_REQUESTED" = xyes) &&
1307
(test "x$ID3LIB_OPEION_ENABLED" = xyes); then
1308
if test "x$TAGLIB_STATUS" = xyes; then
1309
AC_MSG_ERROR([Please select either taglib or id3lib, but not both.])
1311
AC_MSG_ERROR(unable to configure id3lib support)
1314
ID3LIB_STATUS=disabled
1318
LDFLAGS="$LDFLAGS_SAVE"
1320
CXXFLAGS="$CXXFLAGS_SAVE"
1321
CPPFLAGS="$CPPFLAGS_SAVE"
1329
if ((test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then
1330
AC_MSG_ERROR([You enabled YouTube but disabled curl, however curl is required by the YouTube feature])
1333
if ((test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then
1334
AC_MSG_ERROR([You enabled Weborama but disabled curl, however curl is required by the Weborama feature])
1337
if ((test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then
1338
AC_MSG_ERROR([You enabled Apple Trailers but disabled curl, however curl is required by the Apple Trailers feature])
1341
if ((test "x$YOUTUBE_OPTION_ENABLED" != xyes) && (test "x$SOPCAST_OPTION_ENABLED" != xyes) && (test "x$EXTERNAL_TRANSCODING_OPTION" != xyes) && (test "x$ATRAILERS_OPTION_ENABLED" != xyes) && (test "x$WEBORAMA_OPTION_ENABLED" != xyes)); then
1342
if test $USE_CURL -eq 1; then
1343
if test $CURL_REQUESTED -eq 1; then
1344
AC_MSG_ERROR([You enabled curl support but the external transcoding, YouTube and SopCast features are disabled - curl is not needed without it])
1352
if (((test "x$YOUTUBE_OPTION_ENABLED" = xyes) || (test "x$SOPCAST_OPTION_ENABLED" = xyes) || (test "x$ATRAILERS_OPTION_ENABLED" = xyes) || (test "x$WEBORAMA_OPTION_ENABLED" = xyes) || (test "x$EXTERNAL_TRANSCODING_OPTION" = xyes)) && (test $USE_CURL -eq 1)); then
1353
AC_MSG_NOTICE([Checking for curl (needed for extended external transcoding/YouTube/SopCast support)])
1355
if test -n "$CURL_SEARCH_CONFIG"; then
1356
AC_MSG_NOTICE([You specified $CURL_SEARCH_CONFIG for curl-config])
1358
if test -f "$CURL_SEARCH_CONFIG"; then
1359
curlconfig="$CURL_SEARCH_CONFIG"
1364
if test "x$curlconfig" = xno; then
1365
AC_MSG_ERROR([$CURL_SEARCH_CONFIG not found])
1367
CURL_TEST=`${curlconfig} --version 2>/dev/null`
1368
if test -z "$CURL_TEST"; then
1369
AC_MSG_ERROR([${curlconfig} could not be executed or returned invalid values])
1374
AC_PATH_PROG(curlconfig, curl-config, no)
1375
if test "x$curlconfig" = xno; then
1376
unset ac_cv_path_curlconfig
1377
AC_PATH_PROG(curlconfig, curl-config, no, $SEARCH_DIR_PROGS)
1378
if test "x$curlconfig" = xno; then
1380
AC_MSG_RESULT([curl-config not found, please install the curl-devel package])
1389
if test $CURL_PROG_FOUND -eq 1 ; then
1390
AC_MSG_CHECKING(curl cflags)
1391
CURL_CFLAGS=`${curlconfig} --cflags`
1392
AC_MSG_RESULT($CURL_CFLAGS)
1394
AC_MSG_CHECKING(curl libraries)
1395
CURL_LIBS=`${curlconfig} --libs`
1396
AC_MSG_RESULT($CURL_LIBS)
1400
if test "x$CURL_OK" = xyes; then
1401
CPPFLAGS="$CPPFLAGS $CURL_CFLAGS"
1402
CXXFLAGS="$CXXFLAGS $CURL_CFLAGS"
1403
AC_CHECK_HEADERS([curl/curl.h],
1409
if test "x$CURL_OK" = xyes; then
1410
LDFLAGS="$CURL_LIBS"
1411
AC_CHECK_LIB(curl, curl_easy_init, [],
1416
if test "x$CURL_OK" = xyes; then
1417
AC_DEFINE([HAVE_CURL], [1], [curl library presence])
1418
AC_SUBST(CURL_CFLAGS)
1421
if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" = xyes); then
1422
AC_MSG_ERROR([unable to configure curl which is required for YouTube support!])
1425
if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" != xyes); then
1426
AC_MSG_WARN([curl not found, disabling YouTube])
1427
YOUTUBE_OPTION_ENABLED="missing"
1430
if (test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" = xyes); then
1431
AC_MSG_ERROR([unable to configure curl which is required for Weborama support!])
1434
if (test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" != xyes); then
1435
AC_MSG_WARN([curl not found, disabling Weborama])
1436
WEBORAMA_OPTION_ENABLED="missing"
1439
if (test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" = xyes); then
1440
AC_MSG_ERROR([unable to configure curl which is required for Apple Trailers support!])
1443
if (test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" != xyes); then
1444
AC_MSG_WARN([curl not found, disabling Apple Trailers])
1445
ATRAILERS_OPTION_ENABLED="missing"
1448
if (test "x$SOPCAST_OPTION_ENABLED" = xyes) && (test "x$SOPCAST_OPTION_REQUESTED" = xyes); then
1449
AC_MSG_ERROR([unable to configure curl which is required for SopCast support!])
1452
if (test "x$SOPCAST_OPTION_ENABLED" = xyes) && (test "x$SOPCAST_OPTION_REQUESTED" != xyes); then
1453
AC_MSG_WARN([curl not found, disabling SopCast])
1454
SOPCAST_OPTION_ENABLED="missing"
1457
if test "x$EXTERNAL_TRANSCODING_OPTION" = xyes; then
1458
if ((test $USE_CURL -eq 1) && (test $CURL_REQUESTED -eq 0)); then
1459
AC_MSG_WARN([unable to configure curl, external transcoding will have limited functionality!])
1462
if ((test $USE_CURL -eq 1) && (test $CURL_REQUESTED -eq 1)); then
1463
AC_MSG_ERROR([You enabled curl support but the curl library could not be configured])
1467
if (test "x$YOUTUBE_OPTION_ENABLED" != xyes) && (test "x$WEBORAMA_OPTION_ENABLED" != xyes) && (test "x$ATRAILERS_OPTION_ENABLED" != xyes) && (test "x$EXTERNAL_TRANSCODING_OPTION" = !xyes) && (test "x$SOPCAST_OPTION_ENABLED" != xyes); then
1472
CPPFLAGS="$CPPFLAGS_SAVE"
1473
CXXFLAGS="$CXXFLAGS_SAVE"
1474
LDFLAGS="$LDFLAGS_SAVE"
1476
######## ffmpeg or extractor?
1479
LIBEXTRACTOR_STATUS=
1481
MT_OPTION([libextractor], [enable],
1482
[metadata extraction with the help of libextractor],[],[])
1484
MT_OPTION([ffmpeg], [disable],
1485
[metadata extraction with the help of ffmpeg],[],[])
1487
if ((test "x$FFMPEG_OPTION_ENABLED" = xno) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes)) ; then
1488
FFMPEG_STATUS=disabled
1489
FFMPEG_OPTION_ENABLED=no
1490
AC_MSG_WARN([ffmpeg disabled])
1491
elif ((test "x$FFMPEG_OPTION_ENABLED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xno)) ; then
1492
LIBEXTRACTOR_STATUS=disabled
1493
LIBEXTRACTOR_OPTION_ENABLED=no
1494
elif ((test "x$FFMPEG_OPTION_ENABLED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes)) ; then
1495
if ((test "x$FFMPEG_OPTION_REQUESTED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes)); then
1496
AC_MSG_ERROR([Please select either ffmpeg or libextractor, but not both.])
1497
elif ((test "x$FFMPEG_OPTION_REQUESTED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xno)); then
1498
LIBEXTRACTOR_STATUS=disabled
1499
LIBEXTRACTOR_OPTION_ENABLED=no
1500
elif ((test "x$FFMPEG_OPTION_REQUESTED" = xno) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes)); then
1501
FFMPEG_STATUS=disabled
1502
FFMPEG_OPTION_ENABLED=no
1503
AC_MSG_WARN([ffmpeg disabled])
1509
if test "x$FFMPEG_OPTION_ENABLED" = xyes; then
1513
# the header location of the older and newer ffmpeg version is different
1514
MT_CHECK_HEADER([avformat], [ffmpeg/avformat], [pass])
1515
if test "x$AVFORMAT_STATUS" != xyes; then
1516
MT_CHECK_HEADER([avformat], [libavformat/avformat])
1517
if test "x$AVFORMAT_STATUS" = xyes; then
1518
AC_DEFINE_UNQUOTED([AVFORMAT_INCLUDE], [<libavformat/avformat.h>], [libavformat/avformat.h])
1521
AC_DEFINE_UNQUOTED([AVFORMAT_INCLUDE], [<ffmpeg/avformat.h>], [ffmpeg/avformat.h])
1524
if test "x$AVFORMAT_STATUS" = xyes; then
1525
MT_CHECK_LIBRARY([avformat], [avformat], [av_register_all])
1526
MT_CHECK_LIBRARY([avutil], [avutil], [av_log_set_callback])
1530
if ((test "x$AVFORMAT_STATUS" = xyes) && (test "x$AVUTIL_STATUS" = xyes)); then
1533
FFMPEG_STATUS=missing
1537
if test "x$FFMPEG_STATUS" = xyes; then
1538
AC_DEFINE([HAVE_FFMPEG], [1], [FFMPEG library presence])
1539
FFMPEG_CFLAGS="$AVFORMAT_CFLAGS $AVUTIL_CFLAGS"
1540
FFMPEG_LDFLAGS="$AVFORMAT_LDFLAGS $AVUTIL_LDFLAGS"
1541
FFMPEG_LIBS="$AVFORMAT_LIBS $AVUTIL_LIBS"
1542
AC_SUBST(FFMPEG_CFLAGS)
1543
AC_SUBST(FFMPEG_LDFLAGS)
1544
AC_SUBST(FFMPEG_LIBS)
1546
if test "x$FFMPEG_OPTIEON_REQUESTED" = xyes; then
1547
AC_MSG_ERROR(unable to configure ffmpeg support)
1551
MT_CHECK_OPTIONAL_PACKAGE([ffmpegthumbnailer], [disable],
1552
[compile with ffmpegthumbnailer support for video thumbnail generation],
1553
[libffmpegthumbnailer/videothumbnailerc],
1554
[ffmpegthumbnailer], [create_thumbnailer])
1556
if ((test "x$FFMPEG_STATUS" != xyes) && (test "x$FFMPEGTHUMBNAILER_STATUS" = xyes)); then
1557
if test "x$FFMPEGTHUMBNAILER_OPTION_REQUESTED" = xyes; then
1558
AC_MSG_ERROR([ffmpeg libraries are required in order to use ffmpegthumbnailer])
1560
AC_MSG_WARN([ffmpegthumbnailer disabled: ffmpeg libraries required])
1561
FFMPEGTHUMBNAILER_STATUS="disabled"
1562
FFMPEGTHUMBNAILER_CFLAGS=""
1563
FFMPEGTHUMBNAILER_LDFLAGS=""
1564
FFMPEGTHUMBNAILER_LIBS=""
1568
CXXFLAGS="$CXXFLAGS_SAVE"
1569
LDFLAGS="$LDFLAGS_SAVE"
1570
CPPFLAGS="$CPPFLAGS_SAVE"
1574
if test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes; then
1575
MT_CHECK_PACKAGE([libextractor], [extractor], [extractor], [EXTRACTOR_getKeywords])
1578
if test "x$LIBEXTRACTOR_STATUS" = xyes; then
1579
FFMPEG_STATUS=disabled
1580
FFMPEG_OPTION_ENABLED=no
1582
if (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes) &&
1583
(test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes); then
1584
AC_MSG_ERROR([unable to configure libextractor support])
1590
MT_CHECK_OPTIONAL_PACKAGE([libexif], [disable],
1591
[compile with libexif for exif thumbnail and metadata extraction],
1592
[libexif/exif-content], [exif], [exif_data_new_from_file])
1594
if test "x$LIBEXIF_STATUS" = xyes; then
1595
CFLAGS="$CFLAGS $LIBEXIF_CFLAGS"
1596
CXXFLAGS="$CXXFLAGS $LIBEXIF_CFLAGS"
1597
LDFLAGS="$LDFLAGS $LIBEXIF_LDFLAGS $LIBEXIF_LIBS"
1599
# try 1 argument signature
1600
AC_MSG_CHECKING([exif_entry_get_value signature])
1604
#include <libexif/exif-data.h>
1605
#include <libexif/exif-content.h>
1608
(void)exif_entry_get_value(0);
1612
AC_MSG_RESULT([requires 1 argument])
1616
# try 3 argument signature
1620
#include <libexif/exif-data.h>
1621
#include <libexif/exif-content.h>
1624
(void)exif_entry_get_value(0, 0, 0);
1628
AC_MSG_RESULT([requires 3 arguments])
1632
AC_MSG_RESULT([unsupported, disabling])
1633
EXIF_OK="disabled (unsupported version)"
1639
if test "x$EXIF_EGV_1" = xyes; then
1640
AC_DEFINE([EXIF_EGV_1], [1], [exif_entry_get_value() has 1 parameter])
1642
if test "x$EXIF_EGV_3" = xyes; then
1643
AC_DEFINE([EXIF_EGV_3], [1], [exif_entry_get_value() has 3 parameters])
1647
LDFLAGS="$LDFLAGS_SAVE"
1648
CFLAGS="$CFLAGS_SAVE"
1649
CXXFLAGS="$CXXFLAGS_SAVE"
1653
MT_CHECK_REQUIRED_PACKAGE([expat], [expat], [expat], [XML_ParserCreate])
1657
MT_CHECK_OPTIONAL_PACKAGE([libmp4v2], [disable],
1658
[libmp4v2 support for mp4 metadata extraction],
1659
[mp4], [mp4v2], [MP4Read])
1661
if test "x$LIBMP4V2_STATUS" = xyes; then
1662
CFLAGS="$CFLAGS $LIBMP4V2_CFLAGS"
1663
CXXFLAGS="$CXXFLAGS $LIBMP4V2_CFLAGS"
1664
LDFLAGS="$LDFLAGS $LIBMP4V2_LDFLAGS $LIBMP4V2_LIBS"
1667
AC_MSG_CHECKING([for MP4GetMetadataCoverArtCount() libmp4v2])
1674
(void)MP4GetMetadataCoverArtCount(0);
1678
AC_MSG_RESULT([yes])
1679
AC_DEFINE([HAVE_MP4_GET_METADATA_COVER_ART_COUNT], [1],
1680
[this version of libmp4v2 has MP4GetMetadataCoverArtCount() support])
1686
AC_MSG_CHECKING([for MP4GetTrackAudioChannels() in libmp4v2])
1693
(void)MP4GetTrackAudioChannels(0, 0);
1697
AC_MSG_RESULT([yes])
1698
AC_DEFINE([HAVE_MP4_GET_TRACK_AUDIO_CHANNELS], [1],
1699
[this version of libmp4 has MP4GetTrackAudioChannels support])
1708
########## INOTIFY TOOLS
1710
MT_OPTION([inotify], [disable], [inotify support for imporved autoscan], [],
1711
[INOTIFY_STATUS=disabled])
1713
if test "x$INOTIFY_OPTION_ENABLED" = xyes; then
1714
MT_CHECK_HEADER([inotify], [sys/inotify])
1717
if test "x$INOTIFY_STATUS" = xyes; then
1718
AC_CHECK_FUNCS([inotify_init], [], [INOTIFY_STATUS=missing])
1721
if test "x$INOTIFY_STATUS" = xyes; then
1722
dnl The check below was inspired by configure.ac from the inotify tools
1723
dnl package, see the "Acknowledgements" section in our README file for more
1725
CXXFLAGS="$CXXFLAGS $INOTIFY_CFLAGS"
1726
CFLAGS="$CFLAGS $INOTIFY_CFLAGS"
1727
AC_MSG_CHECKING([whether sys/inotify.h works])
1729
AC_LANG_PROGRAM([[#include <sys/inotify.h>]],
1730
[[return (-1 == inotify_init());]]
1733
AC_MSG_RESULT([yes]);
1734
AC_DEFINE([SYS_INOTIFY_H_OK],[1],[sys/inotify.h exists and works on this system])],
1736
AC_MSG_RESULT([no, using own inotify headers])
1737
AC_MSG_CHECKING([whether inotify-nosys.h works on this system])
1739
AC_LANG_PROGRAM([[#include "src/inotify-nosys.h"]],
1740
[[return (-1 == inotify_init());]]
1743
AC_MSG_RESULT([yes]);
1746
if ((test "x$INOTIFY_OPTION_REQUESTED" != xyes) &&
1747
(test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
1748
AC_MSG_RESULT([no, disabling inotify support])
1749
elif ((test "x$INOTIFY_OPTION_REQUESTED" != xyes) &&
1750
(test "x$INOTIFY_OPTION_ENABLED" != xyes)); then
1756
if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) &&
1757
(test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
1758
AC_MSG_RESULT([selecting yes for cross compiling])
1761
AC_MSG_RESULT([selecting no for cross compiling])
1768
if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) &&
1769
(test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
1770
AC_MSG_RESULT([selecting yes for cross compiling])
1773
AC_MSG_RESULT([selecting no for cross compiling])
1779
if test "x$INOTIFY_STATUS" = xyes; then
1780
AC_DEFINE([HAVE_INOTIFY], [1], [inotify presence])
1781
AC_SUBST(INOTIFY_CFLAGS)
1783
if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) &&
1784
(test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
1785
AC_MSG_NOTICE([enabling runtime inotify detection])
1786
# if system inotify header exists, go with it, otherwise take our own
1787
if test "x$ac_cv_header_sys_inotify_h" = xyes; then
1788
AC_DEFINE([SYS_INOTIFY_H_OK],[1],[sys/inotify.h exists])
1790
AC_DEFINE([HAVE_INOTIFY], [1], [inotify presence])
1791
AC_SUBST(INOTIFY_CFLAGS)
1796
LDFLAGS="$LDFLAGS_SAVE"
1797
CPPFLAGS="$CPPFLAGS_SAVE"
1798
CXXFLAGS="$CXXFLAGS_SAVE"
1800
AC_DEFINE([__STDC_CONSTANT_MACROS], [1], [needed for stdint.h])
1801
AC_DEFINE([__STDC_LIMIT_MACROS], [1], [needed for stdint.h])
1803
MT_CHECK_OPTIONAL_PACKAGE_CFG([libdvdnav], [disable],
1804
[compile with libdvdnav support for extended DVD image parsing],
1806
[dvdnav/dvdnav.h], [dvdnav], [dvdnav_get_audio_attr], [])
1809
MT_OPTION([tombdebug], [enable], [enable debug code for MediaTomb],
1811
AC_DEFINE(TOMBDEBUG, 1, [if defined compile with debug log output])
1815
MT_OPTION([upnpdebug], [enable], [enable debug output for TombUPnP/libupnp],
1817
AC_DEFINE(UPNP_HAVE_DEBUG, 1, [see upnpconfig.h])
1818
AC_DEFINE(DEBUG, 1, [Define to 1 to compile debug code])
1822
if (test "x$TOMBDEBUG_OPTION_ENABLED" != xyes) &&
1823
(test "x$UPNPDEBUG_OPTION_ENABLED" != xyes); then
1824
AC_DEFINE(NDEBUG, 1, [make sure there are no asserts in the retail build])
1827
MT_OPTION([log], [disable], [disable all console output],
1829
AC_DEFINE(LOG_ENABLED, 1, [if defined compile with log output])
1833
MT_OPTION([debug-log], [disable], [compile without debug messages],
1835
AC_DEFINE(DEBUG_LOG_ENABLED, 1, [compile with debug messages])
1840
eval PACKAGE_DATADIR="${datadir}/${PACKAGE}"
1841
eval PACKAGE_DATADIR="${PACKAGE_DATADIR}"
1842
AC_DEFINE_UNQUOTED(PACKAGE_DATADIR, "$PACKAGE_DATADIR", [MediaTomb data directory])
1844
if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) || (test "x$WEBORAMA_OPTION_ENABLED" = xyes) || (test "x$ATRAILERS_OPTION_ENABLED" = xyes) || (test "x$SOPCAST_OPTION_ENABLED" = xyes); then
1845
AC_DEFINE(ONLINE_SERVICES, 1, [at least one online service is supported])
1848
if (test "x$YOUTUBE_OPTION_ENABLED" = xyes); then
1849
AC_DEFINE([YOUTUBE], [1], [Enable support for the YouTube service])
1852
if (test "x$WEBORAMA_OPTION_ENABLED" = xyes); then
1853
AC_DEFINE([WEBORAMA], [1], [Enable support for the Weborama service])
1856
if (test "x$ATRAILERS_OPTION_ENABLED" = xyes); then
1857
AC_DEFINE([ATRAILERS], [1], [Enable support for the apple trailers])
1860
if (test "x$SOPCAST_OPTION_ENABLED" = xyes); then
1861
AC_DEFINE([SOPCAST], [1], [Enable support for the SopCast service])
1864
AC_DEFINE_UNQUOTED([COMPILE_INFO], "host: $host; sqlite3: $SQLITE3_STATUS; mysql: $MYSQL_STATUS libjs: $JS_OK; libmagic: $LIBMAGIC_STATUS; inotify: $INOTIFY_STATUS; libexif: $LIBEXIF_STATUS; id3lib: $ID3LIB_STATUS; taglib: $TAGLIB_STATUS; ffmpeg: $FFMPEG_STATUS; libmp4v2: $LIBMP4V2_STATUS; external transcoding: $EXTERNAL_TRANSCODING_OPTION_ENABLED; curl: $CURL_OK; YouTube: $YOUTUBE_OPTION_ENABLED; SopCast: $SOPCAST_OPTION_ENABLED; Weborama: $WEBORAMA_OPTION_ENABLED; Apple Trailers: $ATRAILERS_OPTION_ENABLED; libdvdnav: $LIBDVDNAV_STATUS; libextractor: $LIBEXTRACTOR_STATUS; db-autocreate: $DB_AUTOCREATE_OPTION_ENABLED; debug log: $DEBUG_LOG_OPTION_ENABLED; protocol info extensions: $PROTOCOLINFO_EXTENSION_OPTION_ENABLED; data directory: $PACKAGE_DATADIR; ffmpegthumbnailer: $FFMPEGTHUMBNAILER_STATUS", [compile option summary])
1873
scripts/mediatomb-service-optware
1875
tombupnp/build/Makefile
1885
echo "CONFIGURATION SUMMARY ----"
1888
echo "sqlite3 : $SQLITE3_STATUS"
1889
echo "mysql : $MYSQL_STATUS"
1890
##echo "postgresql : $PGSQL_OK"
1891
echo "libjs : $JS_OK"
1892
echo "libmagic : $LIBMAGIC_STATUS"
1893
echo "inotify : $INOTIFY_STATUS"
1894
echo "libexif : $LIBEXIF_STATUS"
1895
#echo "expat : $EXPAT_STATUS"
1896
echo "id3lib : $ID3LIB_STATUS"
1897
echo "taglib : $TAGLIB_STATUS"
1898
echo "libmp4v2 : $LIBMP4V2_STATUS"
1899
echo "libdvdnav : $LIBDVDNAV_STATUS"
1900
echo "ffmpeg : $FFMPEG_STATUS"
1901
echo "ffmpegthumbnailer : $FFMPEGTHUMBNAILER_STATUS"
1902
echo "external transcoding : $EXTERNAL_TRANSCODING_OPTION_ENABLED"
1903
echo "curl : $CURL_OK"
1904
echo "YouTube : $YOUTUBE_OPTION_ENABLED"
1905
echo "Weborama : $WEBORAMA_OPTION_ENABLED"
1906
echo "Apple Trailers : $ATRAILERS_OPTION_ENABLED"
1907
echo "SopCast : $SOPCAST_OPTION_ENABLED"
1908
echo "libextractor : $LIBEXTRACTOR_STATUS"
1909
echo "db-autocreate : $DB_AUTOCREATE_OPTION_ENABLED"
1911
if test "x$TOMBDEBUG_OPTION_ENABLED" = xyes; then
1912
echo "debug log : $TOMBDEBUG_OPTION_ENABLED"
1915
if test "x$UPNPDEBUG_OPTION_ENABLED" = xyes; then
1916
echo "upnpdebug : $UPNPDEBUG_OPTION_ENABLED"
1919
if test "x$STATIC_OPTION_ENABLED" = xyes; then
1920
echo "static build : $STATIC_OPTION_ENABLED"