### Checks for libraries
-PKG_CHECK_MODULES(EMOTION, [eina >= 1.2.0 evas >= 1.2.0 ecore >= 1.2.0 eet >= 1.6.0])
-requirement_emotion="ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0 eet >= 1.6.0"
+requirement_emotion="ecore >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 eina >= 1.2.0"
+PKG_CHECK_MODULES(EMOTION, [${requirement_emotion}])
+
if test "x${have_emotion_test}" = "xyes" ; then
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])
requirement_emotion="${requirement_emotion} eeze >= 1.0.99"
fi
+PKG_CHECK_MODULES([EIO], [eio >= 1.0.0], [have_eio="yes"], [have_eio="no"])
+if test "x${have_eio}" = "xyes"; then
+ AC_DEFINE(HAVE_EIO, 1, [Use EIO for asynchronous file access])
+ requirement_emotion="eio >= 1.0.0 ${requirement_emotion}"
+fi
+
+AM_CONDITIONAL([HAVE_EIO], [test "x${have_eio}" = "xyes"])
+
+# ecore-x availability, used for XV, VAAPI, VDPAU output.
+
+have_ecore_x="no"
+AC_ARG_ENABLE([ecore-x],
+ [AC_HELP_STRING([--disable-ecore-x], [disable ecore-x support. @<:@default=detect@:>@])],
+ [
+ if test "x${enableval}" = "xyes" || test "x${enableval}" = "xauto" ; then
+ want_ecore_x=${enableval}
+ else
+ want_ecore_x="no"
+ fi
+ ],
+ [want_ecore_x="auto"])
+
+if ! test "x$want_ecore_x" = "xno" ; then
+ PKG_CHECK_MODULES([ECORE_X],
+ [ecore-x >= 1.2.0],
+ [
+ AC_DEFINE(HAVE_ECORE_X, 1, [X11 support for Ecore])
+ have_ecore_x="yes"
+ requirement_elm="ecore-x >= 1.2.0 ${requirement_elm}"
+ ],
+ [have_ecore_x="no"]
+ )
+else
+ have_ecore_x="no"
+fi
+
+if test "x$want_ecore_x" = "xyes" && test "x$have_ecore_x" = "xno" ; then
+ AC_MSG_ERROR([ecore-x support requested, but not found by pkg-config.])
+fi
+
+# Check if gstreamer X Overlay is available
+build_xoverlay="no"
+if test "x${enable_gstreamer}" = "xyes" ; then
+ PKG_CHECK_MODULES([GSTREAMER_INTERFACE],
+ [gstreamer-interfaces-0.10 >= 0.10.34],
+ [build_xoverlay="yes"],
+ [build_xoverlay="no"])
+ if test "x${build_xoverlay}" = "xyes" ; then
+ save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS ${GSTREAMER_CFLAGS} ${GSTREAMER_INTERFACE_CFLAGS}"
+ AC_CHECK_HEADER([gst/interfaces/xoverlay.h],
+ [
+ AC_DEFINE(HAVE_XOVERLAY_H, 1, [Build with Gstreamer Xoverlay support])
+ build_xoverlay="yes"
+ ],
+ [build_xoverlay="no"])
+ CPPFLAGS=$save_CPPFLAGS
+
+ save_LDFLAGS=${LDFLAGS}
+ LDFLAGS="${LDFLAGS} ${GSTREAMER_INTERFACES}"
+ 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])])
+ LDFLAGS=$sava_LDFLAGS
+ fi
+fi
+
### Checks for header files
-AC_HEADER_STDC
AC_CHECK_HEADERS([unistd.h])
+# Check for video4linux
+
+AC_MSG_CHECKING([for V4L2])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdio.h>
+#include <linux/videodev2.h>
+ ]],
+ [[
+fprintf(stdout, "%i\n", V4L2_CAP_VIDEO_CAPTURE);
+ ]])],
+ [
+ AC_DEFINE(HAVE_V4L2, 1, [Define to 1 if you have Video4Linux 2 available])
+ have_v4l2="yes"
+ ],
+ [have_v4l2="no"])
+AC_MSG_RESULT([${have_v4l2}])
+
### Checks for types
### Checks for compiler characteristics
-AC_C_CONST
AC_C_BIGENDIAN
-AC_PROG_CC_STDC
AC_C___ATTRIBUTE__
EFL_EMOTION_BUILD=""
case "$host_os" in
- mingw32ce* | cegcc*)
+ mingw32ce*)
EMOTION_CPPFLAGS="-D_WIN32_WCE=0x0420"
EFL_EMOTION_BUILD="-DEFL_EMOTION_BUILD"
;;
lt_enable_auto_import=""
case "$host_os" in
- mingw* | cegcc*)
+ mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
AC_SUBST(lt_enable_auto_import)
-### Check for video4linux
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <stdio.h>
-#include <linux/videodev2.h>
- ]],
- [[
-fprintf(stdout, "%i\n", V4L2_CAP_VIDEO_CAPTURE);
- ]])],
- [
- AC_DEFINE(HAVE_V4L2, 1, [Define to 1 if you have Video4Linux 2 available])
- have_v4l2="yes"
- ],
- [have_v4l2="no"])
-AC_MSG_CHECKING([for V4L2])
-AC_MSG_RESULT([${have_v4l2}])
+### Checks for library functions
+AC_FUNC_ALLOCA
+
### Modules
fi
-PKG_CHECK_MODULES([EIO],
- [eio],
- [
- have_eio="yes"
- AC_DEFINE(HAVE_EIO, 1, [Use EIO for asynchronous file access])
- requirement_emotion="eio ${requirement_emotion}"
- ],
- [have_eio="no"])
-
-AM_CONDITIONAL([HAVE_EIO], [test "x${have_eio}" = "xyes"])
-
-## Check Ecore-X availability, used for XV, VAAPI, VDPAU output.
-
-have_ecore_x="no"
-want_ecore_x="auto"
-AC_ARG_ENABLE([ecore-x],
- [AC_HELP_STRING([--disable-ecore-x], [disable ecore-x support. @<:@default=detect@:>@])],
- [want_ecore_x=$enableval], [])
-
-if test "x$want_ecore_x" != "xno"; then
- PKG_CHECK_MODULES([ECORE_X],
- [ecore-x >= 1.2.0],
- [
- AC_DEFINE(HAVE_ECORE_X, 1, [X11 support for Ecore])
- have_ecore_x="yes"
- requirement_elm="ecore-x >= 1.2.0 ${requirement_elm}"
- ],
- [have_ecore_x="no"]
- )
-else
- have_ecore_x="no"
-fi
-if test "x$want_ecore_x" = "xyes" -a "x$have_ecore_x" = "xno"; then
- AC_MSG_ERROR([ecore-x support requested, but not found by pkg-config.])
-fi
-
-## Check if gstreamer X Overlay is available
-build_xoverlay="no"
-if test "x$enable_gstreamer" = "xyes"; then
- PKG_CHECK_MODULES([GSTREAMER_INTERFACE],
- [ gstreamer-interfaces-0.10 >= 0.10.34 ],
- [ build_xoverlay="yes" ],
- [ build_xoverlay="no" ]
- )
- if test "x${build_xoverlay}" = "xyes"; then
- save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS ${GSTREAMER_CFLAGS} ${GSTREAMER_INTERFACE_CFLAGS}"
- AC_CHECK_HEADER([gst/interfaces/xoverlay.h],
- [
- AC_DEFINE(HAVE_XOVERLAY_H, 1, [Build with Gstreamer Xoverlay support])
- build_xoverlay="yes"
- ], [
- build_xoverlay="no"
- ]
- )
- CPPFLAGS=$save_CPPFLAGS
-
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS ${GSTREAMER_INTERFACES}"
- 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]))
- LDFLAGS=$sava_LDFLAGS
- fi
-fi
-
### install and build examples
EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
--- /dev/null
+dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macro that check if shm_open function is available or not.
+
+dnl Usage: EFL_CHECK_SHM_OPEN([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Call AC_SUBST(EFL_SHM_OPEN_LIBS)
+dnl Define HAVE_SHM_OPEN to 1if shm_open is available
+
+AC_DEFUN([EFL_CHECK_SHM_OPEN],
+[
+_efl_have_shm_open="no"
+
+dnl Check is shm_open is in libc
+
+AC_MSG_CHECKING([for shm_open in libc])
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/mman.h>
+#include <sys/stat.h> /* For mode constants */
+#include <fcntl.h> /* For O_* constants */
+ ]],
+ [[
+int fd;
+
+fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+ ]])],
+ [_efl_have_shm_open="yes"],
+ [_efl_have_shm_open="no"])
+
+AC_MSG_RESULT([${_efl_have_shm_open}])
+
+if test "x$_efl_have_shm_open" = "xno" ; then
+ AC_MSG_CHECKING([for shm_open in librt])
+
+ LIBS_save="${LIBS}"
+ LIBS="${LIBS} -lrt"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/mman.h>
+#include <sys/stat.h> /* For mode constants */
+#include <fcntl.h> /* For O_* constants */
+ ]],
+ [[
+int fd;
+
+fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+ ]])],
+ [
+ EFL_SHM_OPEN_LIBS="-lrt"
+ _efl_have_shm_open="yes"],
+ [_efl_have_shm_open="no"])
+
+ LIBS="${LIBS_save}"
+
+ AC_MSG_RESULT([${_efl_have_shm_open}])
+fi
+
+AC_SUBST([EFL_SHM_OPEN_LIBS])
+
+if test "x$_efl_have_shm_open" = "xyes" ; then
+ AC_DEFINE([HAVE_SHM_OPEN], [1], [Define to 1 if you have the `shm_open' function.])
+fi
+
+AS_IF([test "x$_efl_have_shm_open" = "xyes"], [$1], [$2])
+
+])