mmm we need AC_MSG_RESULT in the no case, just not in the yes case
[profile/ivi/emotion.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 # get rid of that stupid cache mechanism
4 rm -f config.cache
5
6 AC_INIT(configure.in)
7 AM_INIT_AUTOMAKE(emotion, 0.0.1.004)
8 AM_CONFIG_HEADER(config.h)
9
10 AC_C_BIGENDIAN
11 AC_ISC_POSIX
12 AC_PROG_CC
13 AM_PROG_CC_STDC
14 AC_HEADER_STDC
15 AC_C_CONST
16 AM_ENABLE_SHARED
17 AM_PROG_LIBTOOL
18
19 if test "x${bindir}" = 'x${exec_prefix}/bin'; then
20   if test "x${exec_prefix}" = "xNONE"; then
21     if test "x${prefix}" = "xNONE"; then
22       bindir="${ac_default_prefix}/bin";
23     else
24       bindir="${prefix}/bin";
25     fi
26   else
27     if test "x${prefix}" = "xNONE"; then
28       bindir="${ac_default_prefix}/bin";
29     else
30       bindir="${prefix}/bin";
31     fi
32   fi
33 fi
34
35 if test "x${libdir}" = 'x${exec_prefix}/lib'; then
36   if test "x${exec_prefix}" = "xNONE"; then
37     if test "x${prefix}" = "xNONE"; then
38       libdir="${ac_default_prefix}/lib";
39     else
40       libdir="${prefix}/lib";
41     fi
42   else
43     if test "x${prefix}" = "xNONE"; then
44       libdir="${ac_default_prefix}/lib";
45     else
46       libdir="${prefix}/lib";
47     fi
48   fi
49 fi
50
51 dnl Set PACKAGE_DATA_DIR in config.h.
52 if test "x${datadir}" = 'x${prefix}/share'; then
53   if test "x${prefix}" = "xNONE"; then
54     AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", [Package Data Directory])
55   else
56     AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", [Package Data Directory])
57   fi
58 else
59   AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", [Package Data Directory])
60 fi
61
62 dnl Set PACKAGE_BIN_DIR in config.h.
63 if test "x${bindir}" = 'xNONE'; then
64   if test "x${prefix}" = "xNONE"; then
65     AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", [Install Location for Executables])
66   else
67     AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", [Install Location for Executables])
68   fi
69 else
70   AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", [Install Location for Executables])
71 fi
72
73 dnl Set PACKAGE_LIB_DIR in config.h.
74 if test "x${libdir}" = 'xNONE'; then
75   if test "x${prefix}" = "xNONE"; then
76     AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", [Install Location for Libraries])
77   else
78     AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", [Install Location for Libraries])
79   fi
80 else
81   AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", [Install Location for Libraries])
82 fi
83
84 dnl Set PACKAGE_SOURCE_DIR in config.h.
85 packagesrcdir=`cd $srcdir && pwd`
86 AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Source Directory])
87
88 function vser
89 {
90   v=$1
91   VSTART=`echo $v | awk -F_ '{printf("%s", $1);}'`
92   V1=`echo $VSTART | awk -F\. '{printf("%s", $1);}'`
93   V2=`echo $VSTART | awk -F\. '{printf("%s", $2);}'`
94   V3=`echo $VSTART | awk -F\. '{printf("%s", $3);}'`
95   V4="0"
96   VEND=`echo $v | awk -F_ '{printf("%s", $2);}'`
97   if test -n "$VEND"; then
98     V4=`echo $VEND | sed s/pre//`
99   fi
100   V3=$(( $V3 * 100  ));
101   V2=$(( $V2 * 10000  ));
102   V1=$(( $V1 * 1000000  ));
103   V=$(( $V4 + $V3 + $V2 + $V1 ));
104   echo $V
105 }
106
107 AC_PATH_GENERIC(eet, 0.9.10,
108   [ ],
109   [ AC_MSG_ERROR(Eet isn't installed)]
110 )
111
112 AC_PATH_GENERIC(evas, 0.9.9,
113   [ ],
114   [ AC_MSG_ERROR(Evas isn't installed)]
115 )
116
117 AC_PATH_GENERIC(edje, 0.5.0,
118   [ ],
119   [ AC_MSG_ERROR(Edje isn't installed)]
120 )
121
122 AC_PATH_GENERIC(ecore, 0.9.9,
123   [ ],
124   [ AC_MSG_ERROR(Ecore isn't installed)]
125 )
126 save_CPPFLAGS=$CPPFLAGS
127 CPPFLAGS="$CPPFLAGS $ECORE_CFLAGS"
128 AC_CHECK_HEADERS(Ecore_X.h Ecore_Fb.h)
129 CPPFLAGS=$save_CPPFLAGS
130
131 AC_PATH_GENERIC(embryo, 0.9.1,
132   [ ],
133   [ AC_MSG_ERROR(Embryo isn't installed)]
134 )
135
136 requirements="eet evas edje ecore embryo"
137
138 AC_ARG_ENABLE(xine,
139         AC_HELP_STRING([--disable-xine],[disable xine support @<:@default=auto@:>@]),
140         [enable_xine=$enableval],[enable_xine=auto])
141 HAVE_XINE="no"
142 if test "$enable_xine" != "no" ; then
143         AC_PATH_GENERIC(xine, 1.1.1, [HAVE_XINE="yes"])
144
145         if test "$HAVE_XINE" = "yes" ; then
146                 requirements="$requirements libxine"
147                 xine_plugins=`$XINE_CONFIG --plugindir`
148                 AC_SUBST(xine_plugins)
149         fi
150 fi
151 if test "$enable_xine$HAVE_XINE" = "yesno" ; then
152         AC_MSG_RESULT(xine not found)
153 fi
154
155 AC_ARG_ENABLE(gstreamer,
156         AC_HELP_STRING([--disable-gstreamer],[disable gstreamer support @<:@default=auto@:>@]),
157         [enable_gstreamer=$enableval],[enable_gstreamer=auto])
158 HAVE_GSTREAMER="no"
159 HAVE_GSTPLUG="no"
160 if test "$enable_gstreamer" != "no" ; then
161
162         dnl Gstreamer version requirement
163         GST_REQS=0.10.2
164         GSTPLUG_REQS=0.10.1
165         GST_MAJORMINOR=0.10
166
167         PKG_CHECK_MODULES(GST, \
168            gstreamer-$GST_MAJORMINOR >= $GST_REQS,
169            HAVE_GSTREAMER="yes", AC_MSG_RESULT(no)
170            HAVE_GSTREAMER="no")
171
172         PKG_CHECK_MODULES(GSTPLUG, \
173            gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPLUG_REQS,
174            HAVE_GSTPLUG="yes", AC_MSG_RESULT(no)
175            HAVE_GSTPLUG="no")
176
177         AM_GST_ELEMENT_CHECK(
178            [ffmpeg],
179            [HAVE_GSTFFMPEG="yes"],
180            [HAVE_GSTFFMPEG="no"])
181
182         AM_GST_ELEMENT_CHECK(
183            [cdiocddasrc],
184            [HAVE_GSTCDIOCDDASRC="yes"],
185            [HAVE_GSTCDIOCDDASRC="no"])
186 fi
187 if test "$enable_gstreamer$HAVE_GSTREAMER" = "yesno" ; then
188         AC_MSG_RESULT(gstreamer not found)
189 fi
190 if test "$HAVE_GSTPLUG" = "no"; then
191         if test "$HAVE_GSTREAMER" = "no" ; then
192                 GSTPLUG_MSG="no"
193         else
194                 AC_MSG_WARN([You should install gstreamer plugins and gst-ffmpeg to properly decode your video and audio files])
195                 GSTPLUG_MSG="no (you should install gst-plugins-base and gst-ffmpeg)"
196         fi
197 else
198         if test "$HAVE_GSTFFMPEG" = "no"; then
199                 if test "$HAVE_GSTREAMER" = "no" ; then
200                         GSTPLUG_MSG="no"
201                 else
202                         AC_MSG_WARN([You should install gstreamer plugins and gst-ffmpeg to properly decode your video and audio files])
203                         GSTPLUG_MSG="no (you should install gst-plugins-base and gst-ffmpeg)"
204                 fi
205                 requirements="$requirements gstreamer"
206                 GSTPLUG_MSG="yes"
207         else
208                 requirements="$requirements gstreamer"
209                 GSTPLUG_MSG="yes"
210         fi
211         if test "$HAVE_GSTCDIOCDDASRC" = "no"; then
212                 AC_MSG_WARN([You should install gstreamer-plugins-good and make sure that the cdiocddasrc element is installed])
213                 GSTCDDA_MSG="no (you should install gst-plugins-good and the cdiocddasrc element)"
214         else
215                 requirements="$requirements gstreamer"
216                 GSTCDDA_MSG="yes"
217         fi
218 fi
219 if test "$HAVE_XINE$HAVE_GSTREAMER" = "nono" ; then
220         AC_MSG_ERROR([Xine or Gstreamer must be installed to build emotion])
221 fi
222
223 AM_CONDITIONAL([BUILD_XINE_MODULE], [test "$HAVE_XINE" = yes])
224 AM_CONDITIONAL([BUILD_GSTREAMER_MODULE], [test "$HAVE_GSTREAMER" = yes])
225
226 AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
227 AC_SUBST(dlopen_libs)
228
229 AC_SUBST(requirements)
230
231 AC_OUTPUT([
232 Makefile
233 emotion.pc
234 emotion.spec
235 src/Makefile
236 src/lib/Makefile
237 src/modules/Makefile
238 src/bin/Makefile
239 data/Makefile
240 emotion-config
241 debian/changelog
242 ],[
243 chmod +x emotion-config
244 ])
245
246
247 #####################################################################
248 ## Info
249
250 echo
251 echo
252 echo
253 echo "------------------------------------------------------------------------"
254 echo "$PACKAGE $VERSION"
255 echo "------------------------------------------------------------------------"
256 echo
257 echo "Configuration Options Summary:"
258 echo
259 echo "  Modules:"
260 echo "    Xine...............: $HAVE_XINE"
261 echo "    Gstreamer..........: $HAVE_GSTREAMER"
262 echo "    Gstreamer plugins..: $GSTPLUG_MSG"
263 echo "    Gstreamer FFmpeg...: $HAVE_GSTFFMPEG"
264 echo "    Gstreamer CDDA.....: $GSTCDDA_MSG"
265 echo
266 echo "  Compilation..........: make"
267 echo
268 echo "  Installation.........: make install"
269 echo
270 echo "    prefix.........: $prefix"
271 echo "    binaries.......: $bindir"
272 echo "    libraries......: $libdir"
273 echo "    headers........: $includedir"
274 echo
275