id3: just change cur_artist_priority if it's actually used.
[platform/upstream/lightmediascanner.git] / configure.ac
1 AC_INIT(lightmediascanner, 0.1.0.1, gustavo.barbieri@openbossa.org)
2 AC_PREREQ(2.52)
3 AC_CONFIG_SRCDIR(configure.ac)
4 AC_CANONICAL_BUILD
5 AC_CANONICAL_HOST
6 AC_ISC_POSIX
7
8 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
9 AM_CONFIG_HEADER(config.h)
10 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
11 _XTERM_COLORS
12
13 AC_PROG_CC
14 AM_PROG_CC_STDC
15 AM_PROG_CC_C_O
16 AC_HEADER_STDC
17 AC_C_CONST
18
19 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
20 AC_PROG_LIBTOOL
21
22 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
23 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
24 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
25 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
26 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
27 AC_SUBST(version_info)
28
29 pluginsdir="${libdir}/lightmediascanner/plugins"
30
31 AC_SUBST(pluginsdir)
32 AS_AC_EXPAND(PLUGINSDIR, $pluginsdir)
33 AC_DEFINE_UNQUOTED(PLUGINSDIR, ["$PLUGINSDIR"], [Where plugins are installed.])
34
35 AC_CHECK_FUNCS(realpath)
36
37 # required modules
38 PKG_CHECK_MODULES(SQLITE3, [sqlite3 >= 3.3])
39
40 # plugins checks
41
42 AM_CONDITIONAL(HAVE_VORBIS, false)
43 define([CHECK_MODULE_OGG],
44 [
45         AC_LMS_CHECK_PKG(VORBIS, vorbis, [], [OGG=false])
46 ])
47
48 AM_CONDITIONAL(HAVE_MP4V2, false)
49 define([CHECK_MODULE_MP4],
50 [
51         AC_CHECK_LIB(mp4v2, MP4Read, [MP4=true], [MP4=false])
52         MP4V2_LIBS="-lmp4v2"
53         AC_SUBST(MP4V2_LIBS)
54 ])
55
56 AM_CONDITIONAL(HAVE_FLAC, false)
57 define([CHECK_MODULE_FLAC],
58 [
59         AC_LMS_CHECK_PKG(FLAC, flac, [], [FLAC=false])
60 ])
61
62 # plugins declarations
63 AC_LMS_OPTIONAL_MODULE([dummy], true)
64 AC_LMS_OPTIONAL_MODULE([jpeg], true)
65 AC_LMS_OPTIONAL_MODULE([png], true)
66 AC_LMS_OPTIONAL_MODULE([video-dummy], true)
67 AC_LMS_OPTIONAL_MODULE([audio-dummy], true)
68 AC_LMS_OPTIONAL_MODULE([m3u], true)
69 AC_LMS_OPTIONAL_MODULE([ogg], true, [CHECK_MODULE_OGG])
70 AC_LMS_OPTIONAL_MODULE([pls], true)
71 AC_LMS_OPTIONAL_MODULE([asf], true)
72 AC_LMS_OPTIONAL_MODULE([rm], true)
73 AC_LMS_OPTIONAL_MODULE([mp4], true, [CHECK_MODULE_MP4])
74 AC_LMS_OPTIONAL_MODULE([id3], true)
75 AC_LMS_OPTIONAL_MODULE([flac], true, [CHECK_MODULE_FLAC])
76
77 AC_OUTPUT([
78 lightmediascanner.pc
79 Makefile
80 m4/Makefile
81 src/Makefile
82 src/bin/Makefile
83 src/lib/Makefile
84 src/plugins/Makefile
85 src/plugins/dummy/Makefile
86 src/plugins/jpeg/Makefile
87 src/plugins/png/Makefile
88 src/plugins/video-dummy/Makefile
89 src/plugins/audio-dummy/Makefile
90 src/plugins/m3u/Makefile
91 src/plugins/ogg/Makefile
92 src/plugins/pls/Makefile
93 src/plugins/asf/Makefile
94 src/plugins/rm/Makefile
95 src/plugins/mp4/Makefile
96 src/plugins/id3/Makefile
97 src/plugins/flac/Makefile
98 ])
99
100
101 # report
102 txt_strip() {
103         echo "[$]@" | sed -e 's/^[[ \t]]*\([[^ \t]]*\)[[ \t]]*$/\1/g'
104 }
105
106 MODS=""
107 for mod in $OPTIONAL_MODULES; do
108         MODS="$MODS ${COLOR_HGREEN}+$mod${COLOR_END}"
109 done
110 MODS=$(txt_strip $MODS)
111
112 UNUSED_MODS=""
113 for mod in $UNUSED_OPTIONAL_MODULES; do
114         UNUSED_MODS="$UNUSED_MODS ${COLOR_HRED}-$mod${COLOR_END}"
115 done
116 UNUSED_MODS=$(txt_strip $UNUSED_MODS)
117
118 cat << SUMMARY_EOF
119
120 Summary:
121  * project........: $PACKAGE $VERSION
122  * prefix.........: $(txt_strip $prefix)
123  * CFLAGS.........: $(txt_strip $CFLAGS)
124 SUMMARY_EOF
125
126 echo -e " * modules........: $MODS $UNUSED_MODS"