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