fix typo and add warning
[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
127 AC_PATH_GENERIC(embryo, 0.9.1,
128   [ ],
129   [ AC_MSG_ERROR(Embryo isn't installed)]
130 )
131
132 AC_PATH_GENERIC(xine, 1.0.0,
133   [HAVE_XINE="yes"],
134   [HAVE_XINE="no"]
135 )
136
137 xine_plugins=`$XINE_CONFIG --plugindir`
138 AC_SUBST(xine_plugins)
139
140 dnl gstreamer
141 gstreamer_cflags=
142 gstreamer_libs=
143
144 dnl Gstreamer version requirement
145 GST_REQS=0.8.10
146 GSTPLUG_REQS=0.8.10
147 GST_MAJORMINOR=0.8
148
149 PKG_CHECK_MODULES(GST, \
150    gstreamer-$GST_MAJORMINOR >= $GST_REQS,
151    HAVE_GSTREAMER="yes", HAVE_GSTREAMER="no")
152
153 PKG_CHECK_MODULES(GSTPLUG, \
154    gstreamer-plugins-$GST_MAJORMINOR >= $GSTPLUG_REQS,
155    HAVE_GSTPLUG="yes", HAVE_GSTPLUG="no")
156
157 if test "${HAVE_GSTPLUG}" = "no" ; then
158    AC_MSG_WARN([You should install gstreamer plugins and gst-ffmpeg to decode properly your video and audio files])
159    GSTPLUG_MSG="no (you should install gst-plugins and gst-ffmpeg)"
160 else
161    GSTPLUG_MSG="yes"
162 fi
163
164 AC_SUBST(GST_CFLAGS)
165 AC_SUBST(GST_LIBS)
166
167 if test "${HAVE_XINE}" = "no" && test "${HAVE_GSTREAMER}" = "no" ; then
168    AC_MSG_ERROR([Xine or Gstreamer must be installed to build emotion])
169 fi
170
171 AM_CONDITIONAL([BUILD_XINE_MODULE], [test "$HAVE_XINE" = yes])
172 AM_CONDITIONAL([BUILD_GSTREAMER_MODULE], [test "$HAVE_GSTREAMER" = yes])
173
174 AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
175 AC_SUBST(dlopen_libs)
176
177 requirements="eet evas ecore edje libxine gstreamer"
178 AC_SUBST(requirements)
179
180 AC_OUTPUT([
181 Makefile
182 emotion.pc
183 src/Makefile
184 src/lib/Makefile
185 src/modules/Makefile
186 src/modules/xine/Makefile
187 src/bin/Makefile
188 data/Makefile
189 emotion-config
190 ],[
191 chmod +x emotion-config
192 ])
193
194
195 #####################################################################
196 ## Info
197
198 echo
199 echo
200 echo
201 echo "------------------------------------------------------------------------"
202 echo "$PACKAGE $VERSION"
203 echo "------------------------------------------------------------------------"
204 echo
205 echo "Configuration Options Summary:"
206 echo
207 echo "  Modules:"
208 echo "    Xine...............: $HAVE_XINE"
209 echo "    Gstreamer..........: $HAVE_GSTREAMER"
210 echo "    Gstreamer plugins..: $GSTPLUG_MSG"
211 echo
212 echo "  Compilation..........: make"
213 echo
214 echo "  Installation.........: make install"
215 echo
216 echo "    prefix.........: $prefix"
217 echo "    binaries.......: $bindir"
218 echo "    libraries......: $libdir"
219 echo "    headers........: $includedir"
220 echo
221