Emotion: use eina_semaphore API and update EFL versions
[profile/ivi/emotion.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [0])
4 m4_define([v_min], [2])
5 m4_define([v_mic], [0])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7 m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8 ##--   When released, remove the dnl on the below line
9 dnl m4_undefine([v_rev])
10 ##--   When doing snapshots - change soname. remove dnl on below line
11 m4_define([relname], [ver-pre-svn-07])
12 m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
15 [m4_define([v_ver], [v_maj.v_min.v_mic])])
16 m4_define([lt_rev], m4_eval(v_maj + v_min))
17 m4_define([lt_cur], v_mic)
18 m4_define([lt_age], v_min)
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21
22 AC_INIT([emotion], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23 AC_PREREQ([2.60])
24 AC_CONFIG_SRCDIR([configure.ac])
25 AC_CONFIG_MACRO_DIR([m4])
26 AC_CANONICAL_BUILD
27 AC_CANONICAL_HOST
28 AC_ISC_POSIX
29
30 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
31 AM_CONFIG_HEADER([config.h])
32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33
34 AC_LIBTOOL_WIN32_DLL
35 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
36 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
37 AC_PROG_LIBTOOL
38
39 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
40 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
41 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
42 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
43 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
44 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
45 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
46 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
47 version_info="lt_rev:lt_cur:lt_age"
48 release_info="v_rel"
49 AC_SUBST(version_info)
50 AC_SUBST(release_info)
51 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
52 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
53 VMAJ=v_maj
54 AC_SUBST(VMAJ)
55
56 want_generic="yes"
57 case "$host_os" in
58    mingw*)
59       want_xine="no"
60       want_gstreamer="yes"
61       want_generic="no"
62       want_generic_vlc="no"
63       ;;
64    *)
65       want_xine="yes"
66       want_gstreamer="yes"
67       want_generic_vlc="yes"
68       ;;
69 esac
70
71 requirement_emotion=""
72
73 ### Additional options to configure
74
75 EFL_ENABLE_BIN([emotion-test])
76
77 # edje_cc
78
79 AC_ARG_WITH([edje-cc],
80    [AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc])],
81    [
82     v=$withval;
83     edje_cc=$v
84     echo "  Enlightenment edje_cc explicitly set to "$edje_cc;
85    ],
86    [edje_cc=$(pkg-config --variable=prefix edje)/bin/edje_cc])
87 AC_SUBST(edje_cc)
88
89
90 ### Checks for programs
91 AC_PROG_CC
92
93 # pkg-config
94 PKG_PROG_PKG_CONFIG
95
96 # Check whether pkg-config supports Requires.private
97 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
98    pkgconfig_requires_private="Requires.private"
99 else
100    pkgconfig_requires_private="Requires"
101 fi
102 AC_SUBST(pkgconfig_requires_private)
103
104 # doxygen program for documentation building
105
106 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
107
108
109 ### Checks for libraries
110
111 PKG_CHECK_MODULES(EMOTION, [eina >= 1.0.0 evas >= 1.0.0 ecore >= 1.0.0 eet >= 1.4.0])
112 requirement_emotion="ecore >= 1.0.0 evas >= 1.0.0 eina >= 1.0.0 eet >= 1.4.0"
113
114 if test "x${have_emotion_test}" = "xyes" ; then
115    PKG_CHECK_MODULES(EMOTION_BIN, [eina >= 1.0.0 evas >= 1.0.0 ecore >= 1.0.0 ecore-evas >= 1.0.0 edje >= 1.0.0])
116 fi
117
118 PKG_CHECK_MODULES(ECORE_X, [ecore-x >= 1.0.0 ecore-evas >= 1.0.0], [have_ecore_x="yes"], [have_ecore_x="no"])
119
120 PKG_CHECK_MODULES(ECORE_FB, [ecore-fb >= 1.0.0], [have_ecore_fb="yes"], [have_ecore_fb="no"])
121
122 if test "x${have_ecore_x}" = "xyes" ; then
123    AC_DEFINE(EMOTION_HAVE_ECORE_X, 1, [Define to 1 if Ecore_X is enabled])
124 fi
125
126 if test "x${have_ecore_fb}" = "xyes" ; then
127    AC_DEFINE(EMOTION_HAVE_ECORE_FB, 1, [Define to 1 if Ecore_Fb is enabled])
128 fi
129
130 PKG_CHECK_EXISTS([evas-software-x11 >= 1.0.0], [AC_DEFINE(HAVE_EVAS_SOFWARE_X11, 1, [Evas Software Xlib Engine Support])])
131
132 PKG_CHECK_EXISTS([evas-xrender-x11 >= 1.0.0], [AC_DEFINE(HAVE_EVAS_XRENDER_X11, 1, [Evas Software Xlib Engine Support])])
133
134 PKG_CHECK_EXISTS([evas-opengl-x11 >= 1.0.0], [AC_DEFINE(HAVE_EVAS_OPENGL_X11, 1, [Evas OpenGL Xlib Engine Support])])
135
136 PKG_CHECK_EXISTS([evas-fb >= 1.0.0], [AC_DEFINE(HAVE_EVAS_FB, 1, [Evas Framebuffer Engine Support])])
137
138 EFL_EDJE_EXTERNAL([have_edje_external="yes"], [have_edje_external="no"])
139
140 PKG_CHECK_MODULES(EEZE, [eeze >= 1.0.99], [have_eeze="yes"], [have_eeze="no"])
141
142 if test "x${have_eeze}" = "xyes"; then
143    AC_DEFINE(EMOTION_HAVE_EEZE, 1, [Define to 1 if Eeze is available])
144    requirement_emotion="${requirement_emotion} eeze >= 1.0.99"
145 fi
146
147 ### Checks for header files
148 AC_HEADER_STDC
149
150 AC_CHECK_HEADERS([unistd.h])
151
152 ### Checks for types
153
154
155 ### Checks for structures
156
157
158 ### Checks for compiler characteristics
159 AC_C_CONST
160 AC_C_BIGENDIAN
161 AC_PROG_CC_STDC
162 AC_C___ATTRIBUTE__
163
164 EFL_EMOTION_BUILD=""
165 case "$host_os" in
166    mingw32ce* | cegcc*)
167       EMOTION_CPPFLAGS="-D_WIN32_WCE=0x0420"
168       EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
169       ;;
170    mingw*)
171       EMOTION_CPPFLAGS="-D_WIN32_WINNT=0x0501"
172       EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
173       ;;
174 esac
175 AC_SUBST(EFL_EMOTION_BUILD)
176 AC_SUBST(EMOTION_CPPFLAGS)
177
178
179 ### Checks for linker characteristics
180
181 # use --enable-auto-import on Windows
182
183 lt_enable_auto_import=""
184 case "$host_os" in
185    mingw* | cegcc*)
186       lt_enable_auto_import="-Wl,--enable-auto-import"
187       ;;
188 esac
189 AC_SUBST(lt_enable_auto_import)
190
191 ### Check for video4linux
192
193 AC_COMPILE_IFELSE(
194    [AC_LANG_PROGRAM(
195        [[
196 #include <stdio.h>
197 #include <linux/videodev2.h>
198        ]],
199        [[
200 fprintf(stdout, "%i\n", V4L2_CAP_VIDEO_CAPTURE);
201        ]])],
202    [
203      AC_DEFINE(HAVE_V4L2, 1, [Define to 1 if you have Video4Linux 2 available])
204      have_v4l2="yes"
205    ],
206    [have_v4l2="no"])
207 AC_MSG_CHECKING([for V4L2])
208 AC_MSG_RESULT([${have_v4l2}])
209
210 ### Modules
211
212 EMOTION_CHECK_MODULE([Xine], [${want_xine}])
213 EMOTION_CHECK_MODULE([Gstreamer], [${want_gstreamer}])
214 EMOTION_CHECK_MODULE([Generic], [${want_generic}])
215
216 EMOTION_CHECK_GENERIC_PLAYER([VLC], [${want_generic_vlc}])
217
218 if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test "x${enable_generic}" = "xno" ; then
219    AC_MSG_ERROR([Xine, Gstreamer or Generic backends must be selected to build Emotion])
220 fi
221
222
223 PKG_CHECK_MODULES([EIO],
224         [eio],
225         [
226          have_eio="yes"
227          AC_DEFINE(HAVE_EIO, 1, [Use EIO for asynchronous file access])
228          requirement_emotion="eio ${requirement_emotion}"
229         ],
230         [have_eio="no"])
231
232 AM_CONDITIONAL([HAVE_EIO], [test "x${have_eio}" = "xyes"])
233
234 ## Check Ecore-X availability, used for XV, VAAPI, VDPAU output.
235
236 have_ecore_x="no"
237 want_ecore_x="auto"
238 AC_ARG_ENABLE([ecore-x],
239    [AC_HELP_STRING([--disable-ecore-x], [disable ecore-x support. @<:@default=detect@:>@])],
240    [want_ecore_x=$enableval], [])
241
242 if test "x$want_ecore_x" != "xno"; then
243    PKG_CHECK_MODULES([ECORE_X],
244       [ecore-x >= 1.0.0],
245       [
246        AC_DEFINE(HAVE_ECORE_X, 1, [X11 support for Ecore])
247        have_ecore_x="yes"
248        requirement_elm="ecore-x >= 1.0.0 ${requirement_elm}"
249       ],
250       [have_ecore_x="no"]
251    )
252 else
253     have_ecore_x="no"
254 fi
255 if test "x$want_ecore_x" = "xyes" -a "x$have_ecore_x" = "xno"; then
256     AC_MSG_ERROR([ecore-x support requested, but not found by pkg-config.])
257 fi
258
259 ## Check if gstreamer X Overlay is available
260 build_xoverlay="no"
261 if test "x$enable_gstreamer" = "xyes"; then
262    PKG_CHECK_MODULES([GSTREAMER_INTERFACE],
263         [ gstreamer-interfaces-0.10 >= 0.10.34 ],
264         [ build_xoverlay="yes" ],
265         [ build_xoverlay="no" ]
266    )
267    if test "x${build_xoverlay}" = "xyes"; then
268       save_CPPFLAGS=$CPPFLAGS
269       CPPFLAGS="$CPPFLAGS ${GSTREAMER_CFLAGS} ${GSTREAMER_INTERFACE_CFLAGS}"
270       AC_CHECK_HEADER([gst/interfaces/xoverlay.h],
271         [
272           AC_DEFINE(HAVE_XOVERLAY_H, 1, [Build with Gstreamer Xoverlay support])
273           build_xoverlay="yes"
274         ], [
275           build_xoverlay="no"
276         ]
277       )
278       CPPFLAGS=$save_CPPFLAGS
279
280       save_LDFLAGS=$LDFLAGS
281       LDFLAGS="$LDFLAGS ${GSTREAMER_INTERFACES}"
282       AC_CHECK_LIB(gstinterfaces-0.10, gst_x_overlay_set_window_handle, AC_DEFINE(HAVE_X_OVERLAY_SET, 1, [Use gst_x_overlay_set_window_handle instead of old deprecated gst_x_overlay_set_xwindow_id]))
283       LDFLAGS=$sava_LDFLAGS
284    fi
285 fi
286
287 ### install and build examples
288
289 EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
290 EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])
291
292 AC_SUBST(requirement_emotion)
293
294 AC_OUTPUT([
295 Makefile
296 emotion.pc
297 emotion.spec
298 src/Makefile
299 src/lib/Makefile
300 src/modules/Makefile
301 src/modules/xine/Makefile
302 src/modules/gstreamer/Makefile
303 src/modules/generic/Makefile
304 src/edje_external/Makefile
305 src/generic_players/Makefile
306 src/generic_players/vlc/Makefile
307 src/bin/Makefile
308 src/examples/Makefile
309 doc/Makefile
310 doc/Doxyfile
311 data/Makefile
312 ])
313
314
315 #####################################################################
316 ## Info
317
318 echo
319 echo
320 echo
321 echo "------------------------------------------------------------------------"
322 echo "$PACKAGE $VERSION"
323 echo "------------------------------------------------------------------------"
324 echo
325 echo "Configuration Options Summary:"
326 echo
327 echo "  Modules:"
328 echo "    Xine...............: ${enable_xine}"
329 echo "    Gstreamer..........: ${enable_gstreamer} (X: ${have_ecore_x}/${build_xoverlay})"
330 echo "    Generic............: ${enable_generic}"
331
332 if test "x${enable_generic}" = "xyes" || test "x${enable_generic}" = "xstatic"; then
333 echo
334 echo "  Generic Players:"
335 echo "    VLC................: ${enable_generic_vlc}"
336 fi
337
338 echo
339 echo "  Build emotion_test...: $have_emotion_test"
340 echo "  edje_cc..............: ${edje_cc}"
341 echo
342 echo "  Edje EXTERNAL support: ${have_edje_external}"
343 echo
344 echo "  Eio..................: ${have_eio}"
345 echo "  V4L2.................: ${have_v4l2}"
346 echo
347 echo "Documentation..........: ${build_doc}"
348 echo "Examples.............: ${enable_build_examples}"
349 echo "Examples installed...: ${enable_install_examples}"
350 echo
351 echo "Compilation............: make (or gmake)"
352 echo "  CPPFLAGS.............: $CPPFLAGS"
353 echo "  CFLAGS...............: $CFLAGS"
354 echo "  LDFLAGS..............: $LDFLAGS"
355 echo
356 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
357 echo "  prefix...............: $prefix"
358 echo
359 if test "x${have_static_module}" = "xyes" ; then
360 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Emotion."
361 echo "         You must know what you are doing, or else you will have a lot of problems."
362 echo "         And asparagus will disappear from the earth."
363 echo "         Think about that."
364 echo
365 fi