74b9f32c889576cbb0cc6a2e1eeb301b5ca8e946
[profile/ivi/emotion.git] / m4 / emotion_check.m4
1
2 dnl use: EMOTION_CHECK_DEP_XINE(want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
3
4 AC_DEFUN([EMOTION_CHECK_DEP_XINE],
5 [
6
7 requirement=""
8
9 PKG_CHECK_MODULES([XINE],
10    [libxine >= 1.1.1 evas >= 0.9.9],
11    [
12     have_dep="yes"
13     requirement="libxine"
14    ],
15    [have_dep="no"])
16
17 if test "x$1" = "xstatic" ; then
18    requirement_emotion="${requirement} ${requirement_emotion}"
19 fi
20
21 AS_IF([test "x$have_dep" = "xyes"], [$2], [$3])
22
23 ])
24
25 dnl use: EMOTION_CHECK_DEP_GSTREAMER(want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
26
27 AC_DEFUN([EMOTION_CHECK_DEP_GSTREAMER],
28 [
29
30 GST_REQS=0.10.2
31 GSTPLUG_REQS=0.10.1
32 GST_MAJORMINOR=0.10
33
34 requirement=""
35
36 PKG_CHECK_MODULES([GSTREAMER],
37    [gstreamer-$GST_MAJORMINOR >= $GST_REQS gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPLUG_REQS evas >= 0.9.9],
38    [
39     have_dep="yes"
40     requirement="gstreamer-$GST_MAJORMINOR gstreamer-plugins-base-$GST_MAJORMINOR"
41    ],
42    [have_dep="no"])
43
44 if test "x${have_dep}" = "xyes" ; then
45
46    AM_GST_ELEMENT_CHECK([ffmpeg], [have_gst_ffmpeg="yes"], [have_gst_ffmpeg="no"])
47
48    AM_GST_ELEMENT_CHECK([cdiocddasrc], [have_gst_cdiocddasrc="yes"], [have_gst_cdiocddasrc="no"])
49
50    if test "x${have_gst_ffmpeg}" = "xno" ; then
51       AC_MSG_WARN([You should install gst-ffmpeg to decode most of the video and uadio file formats])
52    fi
53
54    if test "x${have_gst_cdiocddasrc}" = "xno" ; then
55       AC_MSG_WARN([You should install gst-cdiocddasrc to decode CD Audio])
56    fi
57 fi
58
59 if test "x$1" = "xstatic" ; then
60    requirement_emotion="${requirement} ${requirement_emotion}"
61 fi
62
63 AS_IF([test "x$have_dep" = "xyes"], [$2], [$3])
64
65 ])
66
67 dnl use: EMOTION_CHECK_DEP_VLC(want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
68
69 AC_DEFUN([EMOTION_CHECK_DEP_VLC],
70 [
71
72 requirement=""
73
74 PKG_CHECK_MODULES([VLC],
75    [libvlc >= 0.9 evas >= 0.9.9],
76    [
77     have_dep="yes"
78     requirement="libvlc"
79    ],
80    [have_dep="no"])
81
82 if test "x$1" = "xstatic" ; then
83    requirement_emotion="${requirement} ${requirement_emotion}"
84 fi
85
86 AS_IF([test "x$have_dep" = "xyes"], [$2], [$3])
87
88 ])
89
90 dnl use: EMOTION_CHECK_MODULE(description, want_module[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
91 AC_DEFUN([EMOTION_CHECK_MODULE],
92 [
93 m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
94 m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
95
96 want_module="$2"
97
98 AC_ARG_ENABLE([DOWN],
99    [AC_HELP_STRING([--enable-]DOWN, [enable build of $1 module @<:@default=yes@:>@])],
100    [
101     if test "x${enableval}" = "xyes" ; then
102        enable_module="yes"
103     else
104        if test "x${enableval}" = "xstatic" ; then
105           enable_module="static"
106        else
107           enable_module="no"
108        fi
109     fi
110    ],
111    [enable_module="yes"])
112
113 if test "x${enable_module}" = "xyes" || test "x${enable_module}" = "xstatic" ; then
114    want_module="yes"
115 fi
116
117 have_module="no"
118 if test "x${want_module}" = "xyes" && (test "x${enable_module}" = "xyes" || test "x${enable_module}" = "xstatic") ; then
119    m4_default([EMOTION_CHECK_DEP_]m4_defn([UP]))(${enable_module}, [have_module="yes"], [have_module="no"])
120 fi
121
122 AC_MSG_CHECKING([whether to enable $1 module built])
123 AC_MSG_RESULT([${have_module}])
124
125 static_module="no"
126 if test "x${have_module}" = "xyes" && test "x${enable_module}" = "xstatic" ; then
127    static_module="yes"
128 fi
129
130 AM_CONDITIONAL(EMOTION_BUILD_[]UP, [test "x${have_module}" = "xyes"])
131 AM_CONDITIONAL(EMOTION_STATIC_BUILD_[]UP, [test "x${static_module}" = "xyes"])
132
133 if test "x${static_module}" = "xyes" ; then
134    AC_DEFINE(EMOTION_STATIC_BUILD_[]UP, 1, [Set to 1 if $1 is statically built])
135    have_static_module="yes"
136 fi
137
138 enable_[]DOWN="no"
139 if test "x${have_module}" = "xyes" ; then
140    enable_[]DOWN=${enable_module}
141 fi
142
143 AS_IF([test "x$have_module" = "xyes"], [$3], [$4])
144
145 m4_popdef([UP])
146 m4_popdef([DOWN])
147 ])