summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-03-25 18:43:21 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-03-25 18:43:21 +0000
commitda77ffd07a3b4fa5d8064f66981edab3b55fba1b (patch)
tree202bb81e7f14bb189a811a03c80986de7ca40cdc /legacy/emotion
parent6d8b7c00cbfee54a4c572dd2cd1b4f28076de955 (diff)
Emotion: Fix shm_open check + various autotools cleaning
This works in linux, and should fix shm_detection on BSD (including Mac) BSD, Mac and solaris users : please check that it compiles and shm_open is detected SVN revision: 69618
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/Makefile.am47
-rw-r--r--legacy/emotion/configure.ac182
-rw-r--r--legacy/emotion/m4/efl_shm_open.m469
-rw-r--r--legacy/emotion/m4/emotion_check.m424
-rw-r--r--legacy/emotion/src/generic_players/vlc/Makefile.am2
-rw-r--r--legacy/emotion/src/lib/emotion_main.c26
-rw-r--r--legacy/emotion/src/modules/generic/Makefile.am2
7 files changed, 228 insertions, 124 deletions
diff --git a/legacy/emotion/Makefile.am b/legacy/emotion/Makefile.am
index 2ef6b695c3..248f9bdf35 100644
--- a/legacy/emotion/Makefile.am
+++ b/legacy/emotion/Makefile.am
@@ -4,18 +4,41 @@ ACLOCAL_AMFLAGS = -I m4
4 4
5SUBDIRS = src data doc 5SUBDIRS = src data doc
6 6
7MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess emotion.spec \ 7MAINTAINERCLEANFILES = \
8 config.h.in config.sub configure install-sh \ 8Makefile.in \
9 ltconfig ltmain.sh missing mkinstalldirs \ 9aclocal.m4 \
10 stamp-h.in emotion_docs.tar \ 10config.guess \
11 emotion.pc acconfig.h depcomp \ 11config.h.in \
12 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 12config.sub \
13 13configure \
14bin_SCRIPTS = 14depcomp \
15 15install-sh \
16EXTRA_DIST = README AUTHORS COPYING \ 16ltconfig \
17 emotion.spec emotion.spec.in emotion.pc.in \ 17ltmain.sh \
18 emotion.pc.in 18missing \
19mkinstalldirs \
20stamp-h.in \
21$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
22$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
23$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2
24
25EXTRA_DIST = \
26README \
27AUTHORS \
28COPYING \
29autogen.sh \
30emotion.spec \
31emotion.spec.in \
32emotion.pc.in \
33m4/ac_attribute.m4 \
34m4/efl_binary.m4 \
35m4/efl_doxygen.m4 \
36m4/efl_edje_external.m4 \
37m4/efl_examples.m4 \
38m4/efl_shm_open.m4 \
39m4/emotion_check.m4 \
40m4/gst-element-check.m4
41
19 42
20pkgconfigdir = $(libdir)/pkgconfig 43pkgconfigdir = $(libdir)/pkgconfig
21pkgconfig_DATA = emotion.pc 44pkgconfig_DATA = emotion.pc
diff --git a/legacy/emotion/configure.ac b/legacy/emotion/configure.ac
index 37edf6ac3b..8c3cc17fb9 100644
--- a/legacy/emotion/configure.ac
+++ b/legacy/emotion/configure.ac
@@ -108,8 +108,9 @@ EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
108 108
109### Checks for libraries 109### Checks for libraries
110 110
111PKG_CHECK_MODULES(EMOTION, [eina >= 1.2.0 evas >= 1.2.0 ecore >= 1.2.0 eet >= 1.6.0]) 111requirement_emotion="ecore >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 eina >= 1.2.0"
112requirement_emotion="ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0 eet >= 1.6.0" 112PKG_CHECK_MODULES(EMOTION, [${requirement_emotion}])
113
113 114
114if test "x${have_emotion_test}" = "xyes" ; then 115if test "x${have_emotion_test}" = "xyes" ; then
115 PKG_CHECK_MODULES(EMOTION_BIN, [eina >= 1.2.0 evas >= 1.2.0 ecore >= 1.2.0 ecore-evas >= 1.2.0 edje >= 1.2.0]) 116 PKG_CHECK_MODULES(EMOTION_BIN, [eina >= 1.2.0 evas >= 1.2.0 ecore >= 1.2.0 ecore-evas >= 1.2.0 edje >= 1.2.0])
@@ -144,11 +145,96 @@ if test "x${have_eeze}" = "xyes"; then
144 requirement_emotion="${requirement_emotion} eeze >= 1.0.99" 145 requirement_emotion="${requirement_emotion} eeze >= 1.0.99"
145fi 146fi
146 147
148PKG_CHECK_MODULES([EIO], [eio >= 1.0.0], [have_eio="yes"], [have_eio="no"])
149if test "x${have_eio}" = "xyes"; then
150 AC_DEFINE(HAVE_EIO, 1, [Use EIO for asynchronous file access])
151 requirement_emotion="eio >= 1.0.0 ${requirement_emotion}"
152fi
153
154AM_CONDITIONAL([HAVE_EIO], [test "x${have_eio}" = "xyes"])
155
156# ecore-x availability, used for XV, VAAPI, VDPAU output.
157
158have_ecore_x="no"
159AC_ARG_ENABLE([ecore-x],
160 [AC_HELP_STRING([--disable-ecore-x], [disable ecore-x support. @<:@default=detect@:>@])],
161 [
162 if test "x${enableval}" = "xyes" || test "x${enableval}" = "xauto" ; then
163 want_ecore_x=${enableval}
164 else
165 want_ecore_x="no"
166 fi
167 ],
168 [want_ecore_x="auto"])
169
170if ! test "x$want_ecore_x" = "xno" ; then
171 PKG_CHECK_MODULES([ECORE_X],
172 [ecore-x >= 1.2.0],
173 [
174 AC_DEFINE(HAVE_ECORE_X, 1, [X11 support for Ecore])
175 have_ecore_x="yes"
176 requirement_elm="ecore-x >= 1.2.0 ${requirement_elm}"
177 ],
178 [have_ecore_x="no"]
179 )
180else
181 have_ecore_x="no"
182fi
183
184if test "x$want_ecore_x" = "xyes" && test "x$have_ecore_x" = "xno" ; then
185 AC_MSG_ERROR([ecore-x support requested, but not found by pkg-config.])
186fi
187
188# Check if gstreamer X Overlay is available
189build_xoverlay="no"
190if test "x${enable_gstreamer}" = "xyes" ; then
191 PKG_CHECK_MODULES([GSTREAMER_INTERFACE],
192 [gstreamer-interfaces-0.10 >= 0.10.34],
193 [build_xoverlay="yes"],
194 [build_xoverlay="no"])
195 if test "x${build_xoverlay}" = "xyes" ; then
196 save_CPPFLAGS=$CPPFLAGS
197 CPPFLAGS="$CPPFLAGS ${GSTREAMER_CFLAGS} ${GSTREAMER_INTERFACE_CFLAGS}"
198 AC_CHECK_HEADER([gst/interfaces/xoverlay.h],
199 [
200 AC_DEFINE(HAVE_XOVERLAY_H, 1, [Build with Gstreamer Xoverlay support])
201 build_xoverlay="yes"
202 ],
203 [build_xoverlay="no"])
204 CPPFLAGS=$save_CPPFLAGS
205
206 save_LDFLAGS=${LDFLAGS}
207 LDFLAGS="${LDFLAGS} ${GSTREAMER_INTERFACES}"
208 AC_CHECK_LIB([gstinterfaces-0.10],
209 [gst_x_overlay_set_window_handle],
210 [AC_DEFINE([HAVE_X_OVERLAY_SET], [1], [Use gst_x_overlay_set_window_handle instead of old deprecated gst_x_overlay_set_xwindow_id])])
211 LDFLAGS=$sava_LDFLAGS
212 fi
213fi
214
147### Checks for header files 215### Checks for header files
148AC_HEADER_STDC
149 216
150AC_CHECK_HEADERS([unistd.h]) 217AC_CHECK_HEADERS([unistd.h])
151 218
219# Check for video4linux
220
221AC_MSG_CHECKING([for V4L2])
222AC_COMPILE_IFELSE(
223 [AC_LANG_PROGRAM(
224 [[
225#include <stdio.h>
226#include <linux/videodev2.h>
227 ]],
228 [[
229fprintf(stdout, "%i\n", V4L2_CAP_VIDEO_CAPTURE);
230 ]])],
231 [
232 AC_DEFINE(HAVE_V4L2, 1, [Define to 1 if you have Video4Linux 2 available])
233 have_v4l2="yes"
234 ],
235 [have_v4l2="no"])
236AC_MSG_RESULT([${have_v4l2}])
237
152### Checks for types 238### Checks for types
153 239
154 240
@@ -156,14 +242,12 @@ AC_CHECK_HEADERS([unistd.h])
156 242
157 243
158### Checks for compiler characteristics 244### Checks for compiler characteristics
159AC_C_CONST
160AC_C_BIGENDIAN 245AC_C_BIGENDIAN
161AC_PROG_CC_STDC
162AC_C___ATTRIBUTE__ 246AC_C___ATTRIBUTE__
163 247
164EFL_EMOTION_BUILD="" 248EFL_EMOTION_BUILD=""
165case "$host_os" in 249case "$host_os" in
166 mingw32ce* | cegcc*) 250 mingw32ce*)
167 EMOTION_CPPFLAGS="-D_WIN32_WCE=0x0420" 251 EMOTION_CPPFLAGS="-D_WIN32_WCE=0x0420"
168 EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD" 252 EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
169 ;; 253 ;;
@@ -182,30 +266,16 @@ AC_SUBST(EMOTION_CPPFLAGS)
182 266
183lt_enable_auto_import="" 267lt_enable_auto_import=""
184case "$host_os" in 268case "$host_os" in
185 mingw* | cegcc*) 269 mingw*)
186 lt_enable_auto_import="-Wl,--enable-auto-import" 270 lt_enable_auto_import="-Wl,--enable-auto-import"
187 ;; 271 ;;
188esac 272esac
189AC_SUBST(lt_enable_auto_import) 273AC_SUBST(lt_enable_auto_import)
190 274
191### Check for video4linux
192 275
193AC_COMPILE_IFELSE( 276### Checks for library functions
194 [AC_LANG_PROGRAM( 277AC_FUNC_ALLOCA
195 [[ 278
196#include <stdio.h>
197#include <linux/videodev2.h>
198 ]],
199 [[
200fprintf(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"])
207AC_MSG_CHECKING([for V4L2])
208AC_MSG_RESULT([${have_v4l2}])
209 279
210### Modules 280### Modules
211 281
@@ -220,70 +290,6 @@ if test "x${enable_xine}" = "xno" && test "x${enable_gstreamer}" = "xno" && test
220fi 290fi
221 291
222 292
223PKG_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
232AM_CONDITIONAL([HAVE_EIO], [test "x${have_eio}" = "xyes"])
233
234## Check Ecore-X availability, used for XV, VAAPI, VDPAU output.
235
236have_ecore_x="no"
237want_ecore_x="auto"
238AC_ARG_ENABLE([ecore-x],
239 [AC_HELP_STRING([--disable-ecore-x], [disable ecore-x support. @<:@default=detect@:>@])],
240 [want_ecore_x=$enableval], [])
241
242if test "x$want_ecore_x" != "xno"; then
243 PKG_CHECK_MODULES([ECORE_X],
244 [ecore-x >= 1.2.0],
245 [
246 AC_DEFINE(HAVE_ECORE_X, 1, [X11 support for Ecore])
247 have_ecore_x="yes"
248 requirement_elm="ecore-x >= 1.2.0 ${requirement_elm}"
249 ],
250 [have_ecore_x="no"]
251 )
252else
253 have_ecore_x="no"
254fi
255if 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.])
257fi
258
259## Check if gstreamer X Overlay is available
260build_xoverlay="no"
261if 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
285fi
286
287### install and build examples 293### install and build examples
288 294
289EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"]) 295EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
diff --git a/legacy/emotion/m4/efl_shm_open.m4 b/legacy/emotion/m4/efl_shm_open.m4
new file mode 100644
index 0000000000..0bf1b0b7ae
--- /dev/null
+++ b/legacy/emotion/m4/efl_shm_open.m4
@@ -0,0 +1,69 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if shm_open function is available or not.
5
6dnl Usage: EFL_CHECK_SHM_OPEN([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Call AC_SUBST(EFL_SHM_OPEN_LIBS)
8dnl Define HAVE_SHM_OPEN to 1if shm_open is available
9
10AC_DEFUN([EFL_CHECK_SHM_OPEN],
11[
12_efl_have_shm_open="no"
13
14dnl Check is shm_open is in libc
15
16AC_MSG_CHECKING([for shm_open in libc])
17AC_LINK_IFELSE(
18 [AC_LANG_PROGRAM(
19 [[
20#include <sys/mman.h>
21#include <sys/stat.h> /* For mode constants */
22#include <fcntl.h> /* For O_* constants */
23 ]],
24 [[
25int fd;
26
27fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
28 ]])],
29 [_efl_have_shm_open="yes"],
30 [_efl_have_shm_open="no"])
31
32AC_MSG_RESULT([${_efl_have_shm_open}])
33
34if test "x$_efl_have_shm_open" = "xno" ; then
35 AC_MSG_CHECKING([for shm_open in librt])
36
37 LIBS_save="${LIBS}"
38 LIBS="${LIBS} -lrt"
39 AC_LINK_IFELSE(
40 [AC_LANG_PROGRAM(
41 [[
42#include <sys/mman.h>
43#include <sys/stat.h> /* For mode constants */
44#include <fcntl.h> /* For O_* constants */
45 ]],
46 [[
47int fd;
48
49fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
50 ]])],
51 [
52 EFL_SHM_OPEN_LIBS="-lrt"
53 _efl_have_shm_open="yes"],
54 [_efl_have_shm_open="no"])
55
56 LIBS="${LIBS_save}"
57
58 AC_MSG_RESULT([${_efl_have_shm_open}])
59fi
60
61AC_SUBST([EFL_SHM_OPEN_LIBS])
62
63if test "x$_efl_have_shm_open" = "xyes" ; then
64 AC_DEFINE([HAVE_SHM_OPEN], [1], [Define to 1 if you have the `shm_open' function.])
65fi
66
67AS_IF([test "x$_efl_have_shm_open" = "xyes"], [$1], [$2])
68
69])
diff --git a/legacy/emotion/m4/emotion_check.m4 b/legacy/emotion/m4/emotion_check.m4
index a1d93ac7c8..043ae4415a 100644
--- a/legacy/emotion/m4/emotion_check.m4
+++ b/legacy/emotion/m4/emotion_check.m4
@@ -172,28 +172,8 @@ AC_ARG_ENABLE(generic-[]DOWN,
172 ], 172 ],
173 [enable_module="auto"]) 173 [enable_module="auto"])
174 174
175SHM_OPEN_LIBS="" 175# shm_open
176AC_COMPILE_IFELSE( 176EFL_CHECK_SHM_OPEN([have_shm_open="yes"], [have_shm_open="no"])
177 [AC_LANG_PROGRAM(
178 [[
179#include <sys/mman.h>
180#include <sys/stat.h>
181#include <fcntl.h>
182 ]],
183 [[
184shm_open("/", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
185shm_unlink("/");
186 ]])],
187 [
188 have_shm_open="yes"
189 AC_DEFINE(HAVE_SHM_OPEN, 1, [Have shm_open() call])
190 SHM_OPEN_LIBS="-lrt"
191 ],
192 [have_shm_open="no"])
193AC_SUBST(SHM_OPEN_LIBS)
194
195AC_MSG_CHECKING([shm_open])
196AC_MSG_RESULT([${have_shm_open}])
197 177
198if test "x${have_shm_open}" != "xyes"; then 178if test "x${have_shm_open}" != "xyes"; then
199 enable_generic="no" 179 enable_generic="no"
diff --git a/legacy/emotion/src/generic_players/vlc/Makefile.am b/legacy/emotion/src/generic_players/vlc/Makefile.am
index 6b00d281c1..ca9d22a92f 100644
--- a/legacy/emotion/src/generic_players/vlc/Makefile.am
+++ b/legacy/emotion/src/generic_players/vlc/Makefile.am
@@ -15,4 +15,4 @@ internal_bin_PROGRAMS = em_generic_vlc
15 15
16em_generic_vlc_SOURCES = emotion_generic_vlc.c 16em_generic_vlc_SOURCES = emotion_generic_vlc.c
17em_generic_vlc_DEPENDENCIES = $(top_srcdir)/src/modules/generic/Emotion_Generic_Plugin.h 17em_generic_vlc_DEPENDENCIES = $(top_srcdir)/src/modules/generic/Emotion_Generic_Plugin.h
18em_generic_vlc_LDADD = @GENERIC_VLC_LIBS@ -lpthread -lrt 18em_generic_vlc_LDADD = @GENERIC_VLC_LIBS@ -lpthread
diff --git a/legacy/emotion/src/lib/emotion_main.c b/legacy/emotion/src/lib/emotion_main.c
index 7fd93e8f6c..a5e9694b80 100644
--- a/legacy/emotion/src/lib/emotion_main.c
+++ b/legacy/emotion/src/lib/emotion_main.c
@@ -2,6 +2,32 @@
2# include "config.h" 2# include "config.h"
3#endif 3#endif
4 4
5#ifdef STDC_HEADERS
6# include <stdlib.h>
7# include <stddef.h>
8#else
9# ifdef HAVE_STDLIB_H
10# include <stdlib.h>
11# endif
12#endif
13#ifdef HAVE_ALLOCA_H
14# include <alloca.h>
15#elif !defined alloca
16# ifdef __GNUC__
17# define alloca __builtin_alloca
18# elif defined _AIX
19# define alloca __alloca
20# elif defined _MSC_VER
21# include <malloc.h>
22# define alloca _alloca
23# elif !defined HAVE_ALLOCA
24# ifdef __cplusplus
25extern "C"
26# endif
27void *alloca (size_t);
28# endif
29#endif
30
5#include <stdio.h> 31#include <stdio.h>
6 32
7#ifdef EMOTION_HAVE_EEZE 33#ifdef EMOTION_HAVE_EEZE
diff --git a/legacy/emotion/src/modules/generic/Makefile.am b/legacy/emotion/src/modules/generic/Makefile.am
index 04fbab540c..23be9873db 100644
--- a/legacy/emotion/src/modules/generic/Makefile.am
+++ b/legacy/emotion/src/modules/generic/Makefile.am
@@ -22,7 +22,7 @@ includesdir = $(includedir)/emotion-@VMAJ@
22noinst_HEADERS = emotion_generic.h 22noinst_HEADERS = emotion_generic.h
23 23
24em_generic_la_SOURCES = emotion_generic.c 24em_generic_la_SOURCES = emotion_generic.c
25em_generic_la_LIBADD = @EMOTION_LIBS@ @SHM_OPEN_LIBS@ $(top_builddir)/src/lib/libemotion.la 25em_generic_la_LIBADD = @EMOTION_LIBS@ @EFL_SHM_OPEN_LIBS@ $(top_builddir)/src/lib/libemotion.la
26em_generic_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version 26em_generic_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
27em_generic_la_LIBTOOLFLAGS = --tag=disable-static 27em_generic_la_LIBTOOLFLAGS = --tag=disable-static
28em_generic_la_DEPENDENCIES = emotion_generic.h Emotion_Generic_Plugin.h 28em_generic_la_DEPENDENCIES = emotion_generic.h Emotion_Generic_Plugin.h