diff options
author | Vincent Torri <vincent.torri@gmail.com> | 2012-11-04 11:51:42 +0000 |
---|---|---|
committer | Vincent Torri <vincent.torri@gmail.com> | 2012-11-04 11:51:42 +0000 |
commit | c15e9c6575c3b5f39ded167dda5259de3de96151 (patch) | |
tree | 5115d7ae3620af24c2bc094cd062575af7adeda9 /m4 | |
parent | a5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff) | |
download | efl-c15e9c6575c3b5f39ded167dda5259de3de96151.tar.gz |
merge: and now Evas
I've tested make -j 3 install and it works nicely
I've tested expedite with software and opengl xlib,
and it works. Not tested other engines, so please
report any problems (engines or other) on the ML.
TODO: examples and tests, I'll add them later
ISSUE: Eina_Unicode size check. It indirectly depends on
eina_config.h, which is created at the end of the
configure script. So its size is always 0. I don't
know how that size is used, so I can't do a lot,
for now.
SVN revision: 78895
Diffstat (limited to 'm4')
-rw-r--r-- | m4/efl_attribute.m4 | 51 | ||||
-rw-r--r-- | m4/efl_check_funcs.m4 | 76 | ||||
-rw-r--r-- | m4/eina_config.m4 | 2 | ||||
-rw-r--r-- | m4/evas_check_engine.m4 | 851 | ||||
-rw-r--r-- | m4/evas_check_loader.m4 | 534 | ||||
-rw-r--r-- | m4/evas_dither.m4 | 44 |
6 files changed, 1555 insertions, 3 deletions
diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4 index cd42e9cda6..4f31d93175 100644 --- a/m4/efl_attribute.m4 +++ b/m4/efl_attribute.m4 @@ -29,4 +29,55 @@ if test "x${have_attribute_vector}" = "xyes" ; then fi ]) +dnl Usage: EFL_ATTRIBUTE_ALWAYS_INLINE +dnl call AC_DEFINE for alway_inline if __attribute__((always_inline)) is available + +AC_DEFUN([EFL_ATTRIBUTE_ALWAYS_INLINE], +[ + +have_attribute_forceinline="no" + +AC_MSG_CHECKING([for __forceinline]) + +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <windows.h> +static __forceinline void foo(void) {} + ]], + [[ + ]])], + [ + have_attribute_always_inline="yes" + have_attribute_forceinline="yes" + ], + [have_attribute_always_inline="no"]) + +AC_MSG_RESULT([${have_attribute_always_inline}]) + +if test "x${have_attribute_always_inline}" = "xno" ; then + AC_MSG_CHECKING([for __attribute__ ((__always_inline__))]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +static __attribute__((__always_inline__)) inline void foo(void) {} + ]], + [[ + ]])], + [have_attribute_always_inline="yes"], + [have_attribute_always_inline="no"]) + AC_MSG_RESULT([${have_attribute_always_inline}]) +fi + +if test "x${have_attribute_always_inline}" = "xyes" ; then + if test "x${have_attribute_forceinline}" = "xyes" ; then + AC_DEFINE([EFL_ALWAYS_INLINE], [__forceinline], [Macro declaring a function to always be inlined.]) + else + AC_DEFINE([EFL_ALWAYS_INLINE], [__attribute__ ((__always_inline__)) inline], [Macro declaring a function to always be inlined.]) + fi +else + AC_DEFINE([EFL_ALWAYS_INLINE], [static inline], [Macro declaring a function to always be inlined.]) +fi +]) + dnl End of efl_attribute.m4 diff --git a/m4/efl_check_funcs.m4 b/m4/efl_check_funcs.m4 index 23712bcdd7..109ad067d5 100644 --- a/m4/efl_check_funcs.m4 +++ b/m4/efl_check_funcs.m4 @@ -53,11 +53,14 @@ LIBS="${LIBS} $2" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ -#define _GNU_SOURCE +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif +#include <stdlib> #include <dlfcn.h> ]], [[ -int res = dladdr(0, 0); +int res = dladdr(NULL, NULL); ]])], [ m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2" @@ -171,6 +174,75 @@ m4_popdef([DOWNEFL]) m4_popdef([UPEFL]) ]) +dnl _EFL_CHECK_FUNC_DLSYM_PRIV is for internal use +dnl _EFL_CHECK_FUNC_DLSYM_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) + +AC_DEFUN([_EFL_CHECK_FUNC_DLSYM_PRIV], +[ +m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl +m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl + +LIBS_save="${LIBS}" +LIBS="${LIBS} $2" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif +#include <stdlib.h> +#include <dlfcn.h> + ]], + [[ +void *res = dlsym(NULL, NULL); + ]])], + [ + m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2" + requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} $2" + _efl_have_fct="yes" + ], + [_efl_have_fct="no"]) + +LIBS="${LIBS_save}" + +AS_IF([test "x${_efl_have_fct}" = "xyes"], [$3], [$4]) + +m4_popdef([DOWNEFL]) +m4_popdef([UPEFL]) +]) + +dnl _EFL_CHECK_FUNC_DLSYM is for internal use +dnl _EFL_CHECK_FUNC_DLSYM(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) + +AC_DEFUN([_EFL_CHECK_FUNC_DLSYM], +[ +m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl +m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl + +case "$host_os" in + mingw*) + _efl_have_fct="yes" + requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ldl" + ;; + *) + _efl_have_fct="no" + +dnl Check is dlsym is in libc + _EFL_CHECK_FUNC_DLSYM_PRIV([$1], [], [_efl_have_fct="yes"], [_efl_have_fct="no"]) + +dnl Check is dlopen is in libdl + if test "x${_efl_have_fct}" = "xno" ; then + _EFL_CHECK_FUNC_DLSYM_PRIV([$1], [-ldl], [_efl_have_fct="yes"], [_efl_have_fct="no"]) + fi + ;; +esac + +AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3]) + +m4_popdef([DOWNEFL]) +m4_popdef([UPEFL]) +]) + dnl _EFL_CHECK_FUNC_FNMATCH_PRIV is for internal use dnl _EFL_CHECK_FUNC_FNMATCH_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) diff --git a/m4/eina_config.m4 b/m4/eina_config.m4 index 3a0e50b526..609e4f9c74 100644 --- a/m4/eina_config.m4 +++ b/m4/eina_config.m4 @@ -4,5 +4,5 @@ AC_DEFUN([EINA_CONFIG], if $2; then EINA_CONFIGURE_$1="#define EINA_$1" fi -AC_SUBST(EINA_CONFIGURE_$1) +AC_SUBST([EINA_CONFIGURE_$1]) ]) diff --git a/m4/evas_check_engine.m4 b/m4/evas_check_engine.m4 new file mode 100644 index 0000000000..78c4acccd3 --- /dev/null +++ b/m4/evas_check_engine.m4 @@ -0,0 +1,851 @@ + +dnl use: EVAS_CHECK_ENGINE_DEP_BUFFER(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_BUFFER], +[ + +have_dep="yes" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_XLIB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_XLIB], +[ + +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_PATH_X +AC_PATH_XTRA + +AC_CHECK_HEADER([X11/X.h], [have_dep="yes"]) + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([X11], [XCreateImage], [have_dep="yes"], [have_dep="no"]) +fi + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([Xext], [XShmCreateImage], [have_dep="yes"], [have_dep="no"]) +fi + +if test "x${have_dep}" = "xyes" ; then + if test "x$2" = "xyes" ; then + x_libs="${x_libs} -lX11 -lXext" + else + x_dir=${x_dir:-/usr/X11R6} + x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} + x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext" + fi + evas_engine_[]$1[]_cflags="${x_cflags}" + evas_engine_[]$1[]_libs="${x_libs}" +fi + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_GL_XLIB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_XLIB], +[ + +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_PATH_X +AC_PATH_XTRA + +AC_CHECK_HEADER([GL/gl.h], + [have_dep="yes"], + [have_dep="no"], + [ +#include <GL/gl.h> +#include <GL/glext.h> +#include <GL/glx.h> +#include <X11/Xlib.h> +#include <X11/Xatom.h> +#include <X11/Xutil.h> +#include <X11/extensions/Xrender.h> +#include <X11/Xresource.h> + ]) + +gl_pt_lib=""; +have_gl_pt="no" + +AC_MSG_CHECKING([whether pthread_create() is supported]) +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} -pthread" +LIBS_save="${LIBS}" +LIBS="${LIBS} -pthread" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include <pthread.h> + ]], + [[ +pthread_create(NULL, NULL, NULL, NULL); + ]])], + [have_gl_pt="yes"], + [have_gl_pt="no"]) +CFLAGS=${CFLAGS_save} +LIBS=${LIBS_save} +AC_MSG_RESULT([${have_gl_pt}]) + +if test "x$have_gl_pt" = "xyes" ; then + gl_pt_lib=" -pthread" +fi + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"]) +fi + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"]) +fi + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], [-lX11 -lXext -lXrender -lm $gl_pt_lib]) +fi + +if test "x${gl_flavor_gles}" = "xyes" ; then + have_dep=no +fi + +if test "x${have_dep}" = "xyes" ; then + PKG_CHECK_MODULES([GL_EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes"], [have_dep="no"]) + if test "x${have_dep}" = "xyes" ; then + if test "x$2" = "xyes" ; then + x_libs="${x_libs} -lX11 -lXext -lXrender" + else + x_dir=${x_dir:-/usr/X11R6} + x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} + x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" + fi + evas_engine_[]$1[]_cflags="-I/usr/include ${x_cflags}" + evas_engine_[]$1[]_libs="${x_libs} -lGL $gl_pt_lib" + evas_engine_gl_common_libs="-lGL $gl_pt_lib" + fi +else + if test "x$2" = "xyes" ; then + x_libs="${x_libs} -lX11 -lXext -lXrender" + else + x_dir=${x_dir:-/usr/X11R6} + x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} + x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" + fi + AC_CHECK_HEADER([GLES2/gl2.h], + [have_egl="yes"], + [have_egl="no"], + [ +#include <GLES2/gl2.h> +#include <GLES2/gl2ext.h> +#include <EGL/egl.h> +#include <X11/Xlib.h> +#include <X11/Xatom.h> +#include <X11/Xutil.h> +#include <X11/extensions/Xrender.h> +#include <X11/Xresource.h> + ]) + if test "x${have_egl}" = "xyes" ; then + AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib) + if test "x${have_glesv2}" = "xyes" ; then + PKG_CHECK_MODULES([GL_EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes"], [have_dep="no"]) + if test "x${have_dep}" = "xyes" ; then + evas_engine_[]$1[]_cflags="${x_cflags}" + evas_engine_[]$1[]_libs="${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib" + evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib" + have_dep="yes" + AC_DEFINE(GL_GLES, 1, [GLSL runtime shader GLES2 support]) + gles_variety_sgx="yes" + fi + fi + fi +fi + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_XCB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_XCB], +[ + +requirement="" +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +PKG_CHECK_MODULES([XCB], + [xcb xcb-shm xcb-image >= 0.2.1 pixman-1], + [ + have_dep="yes" + requirement="xcb xcb-shm xcb-image pixman-1" + ], + [have_dep="no"]) + +evas_engine_[]$1[]_cflags="${XCB_CFLAGS}" +evas_engine_[]$1[]_libs="${XCB_LIBS}" + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + + +dnl use: EVAS_CHECK_ENGINE_DEP_GL_XCB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_XCB], +[ + +requirement="" +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_PATH_X +AC_PATH_XTRA + +AC_CHECK_HEADER([GL/gl.h], + [have_dep="yes"], + [have_dep="no"], + [ +#include <GL/gl.h> +#include <GL/glext.h> +#include <GL/glx.h> + ]) + +gl_pt_lib=""; +have_gl_pt="no" + +AC_MSG_CHECKING([whether pthread_create() is supported]) +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} -pthread" +LIBS_save="${LIBS}" +LIBS="${LIBS} -pthread" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include <pthread.h> + ]], + [[ +pthread_create(NULL, NULL, NULL, NULL); + ]])], + [have_gl_pt="yes"], + [have_gl_pt="no"]) +CFLAGS=${CFLAGS_save} +LIBS=${LIBS_save} +AC_MSG_RESULT([${have_gl_pt}]) + +if test "x$have_gl_pt" = "xyes" ; then + gl_pt_lib=" -pthread" +fi + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"]) +fi + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"]) +fi + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], -lX11 -lXext -lXrender -lm $gl_pt_lib) +fi + +PKG_CHECK_MODULES([XCB_GL], + [x11-xcb xcb xcb-glx xcb-render xcb-renderutil], + [ + have_dep="yes" + requirement="x11-xcb xcb xcb-glx xcb-render xcb-renderutil" + ], + [have_dep="no"]) + +evas_engine_[]$1[]_cflags="${XCB_GL_CFLAGS}" +evas_engine_[]$1[]_libs="${XCB_GL_LIBS}" + +if test "x$gl_flavor_gles" = "xyes" ; then + have_dep=no +fi + +if test "x${have_dep}" = "xyes" ; then + PKG_CHECK_MODULES([GL_EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes"], [have_dep="no"]) + if test "x${have_dep}" = "xyes" ; then + if test "x$2" = "xyes" ; then + x_libs="${x_libs} -lX11 -lXext -lXrender" + else + x_dir=${x_dir:-/usr/X11R6} + x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} + x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" + fi + evas_engine_[]$1[]_cflags="-I/usr/include ${XCB_GL_CFLAGS} ${x_cflags}" + evas_engine_[]$1[]_libs="${XCB_GL_LIBS} ${x_libs} -lGL $gl_pt_lib" + evas_engine_gl_common_libs="-lGL $gl_pt_lib" + fi +else + if test "x$2" = "xyes" ; then + x_libs="${x_libs} -lX11 -lXext -lXrender" + else + x_dir=${x_dir:-/usr/X11R6} + x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} + x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" + fi + AC_CHECK_HEADER([GLES2/gl2.h], + [have_egl="yes"], + [have_egl="no"], + [ +#include <GLES2/gl2.h> +#include <GLES2/gl2ext.h> +#include <EGL/egl.h> + ]) + if test "x${have_egl}" = "xyes" ; then + AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib) + if test "x${have_glesv2}" = "xyes" ; then + PKG_CHECK_MODULES([GL_EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes"], [have_dep="no"]) + if test "x${have_dep}" = "xyes" ; then + evas_engine_[]$1[]_cflags="${XCB_GL_CFLAGS} ${x_cflags}" + evas_engine_[]$1[]_libs="${XCB_GL_LIBS} ${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib" + evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib" + have_dep="yes" + AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support]) + gles_variety_sgx="yes" + fi + fi + fi +fi + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + + +dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_GDI(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_GDI], +[ + +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_CHECK_HEADER([windows.h], + [ + have_dep="yes" + evas_engine_[]$1[]_libs="-lgdi32" + ]) + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_DDRAW(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_DDRAW], +[ + +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_CHECK_HEADER([ddraw.h], + [ + have_dep="yes" + evas_engine_[]$1[]_libs="-lddraw" + ]) + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_DIRECT3D(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_DIRECT3D], +[ + +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_CHECK_HEADERS([d3d9.h d3dx9.h], + [ + have_dep="yes" + evas_engine_[]$1[]_libs="-ld3d9 -ld3dx9 -lgdi32" + ], + [have_dep="no"; break]) + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + + +dnl use: EVAS_CHECK_ENGINE_DEP_GL_COCOA(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_COCOA], +[ + +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_LANG_PUSH([Objective C]) + +LIBS_save="$LIBS" +LIBS="$LIBS -framework Cocoa" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <Cocoa/Cocoa.h> + ]], + [[ +NSWindow *window; +window = [[NSWindow alloc] + initWithContentRect:NSMakeRect(0, 0, 1, 1) + styleMask:(NSTitledWindowMask) + backing:NSBackingStoreBuffered + defer:NO + screen:nil + ]; + ]])], + [ + have_dep="yes" + evas_engine_[]$1[]_libs="-framework Cocoa" + ], + [have_dep="no"]) +LIBS="$LIBS_save" + +AC_LANG_POP([Objective C]) + +if test "x${have_dep}" = "xyes" ; then + PKG_CHECK_MODULES([GL_EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes"], [have_dep="no"]) +fi + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_GL_SDL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_SDL], +[ + +requirement="" +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +PKG_CHECK_MODULES([SDL], + [sdl >= 1.2.0], + [ + have_dep="yes" + requirement="sdl" + ]) + +evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" +evas_engine_[]$1[]_libs="${SDL_LIBS}" + +gl_pt_lib=""; +have_gl_pt="no" + +AC_MSG_CHECKING([whether pthread_create() is supported]) +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} -pthread" +LIBS_save="${LIBS}" +LIBS="${LIBS} -pthread" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include <pthread.h> + ]], + [[ +pthread_create(NULL, NULL, NULL, NULL); + ]])], + [have_gl_pt="yes"], + [have_gl_pt="no"]) +CFLAGS=${CFLAGS_save} +LIBS=${LIBS_save} +AC_MSG_RESULT([${have_gl_pt}]) + +if test "x$have_gl_pt" = "xyes" ; then + gl_pt_lib=" -pthread" +fi + +AC_CHECK_HEADER([GL/gl.h], + [have_dep="yes"], + [have_dep="no"], + [ +#include <GL/gl.h> +#include <GL/glext.h> + ]) + +if test "x$gl_flavor_gles" = "xyes" ; then + have_dep=no +fi + +if test "x${have_dep}" = "xyes" ; then + evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" + evas_engine_[]$1[]_libs="${SDL_LIBS} -lGL -lm $gl_pt_lib" + evas_engine_gl_common_libs="-lGL -lm $gl_pt_lib" +else + AC_CHECK_HEADER([SDL/SDL_opengles.h], + [have_egl="yes"], + [have_egl="no"], + [ +#include <SDL/SDL_opengles.h> +#include <EGL/egl.h> + ]) + if test "x${have_egl}" = "xyes" ; then + AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lm $gl_pt_lib) + if test "x${have_glesv2}" = "xyes" ; then + evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" + evas_engine_[]$1[]_libs="${SDL_LIBS} -lGLESv2 -lEGL -lm $gl_pt_lib" + evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib" + have_dep="yes" + AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support]) + gles_variety_sgx="yes" + fi + fi +fi + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_deps_evas}" + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x$3" = "xstatic" ; then + requirement_evas="${requirement} ${requirement_evas}" +fi + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_FB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_FB], +[ + +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_CHECK_HEADER([linux/fb.h], [have_dep="yes"]) + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_DIRECTFB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_DIRECTFB], +[ + +requirement="" +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +PKG_CHECK_MODULES([DIRECTFB], + [directfb >= 0.9.16], + [ + have_dep="yes" + requirement="directfb" + evas_engine_[]$1[]_cflags="${DIRECTFB_CFLAGS}" + evas_engine_[]$1[]_libs="${DIRECTFB_LIBS}" + ]) + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + +dnl use: EVAS_CHECK_ENGINE_DEP_PSL1GHT(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_PSL1GHT], +[ + +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_CHECK_HEADER([rsx/rsx.h], [have_dep="yes"]) + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + + +dnl use: EVAS_CHECK_ENGINE_DEP_WAYLAND_SHM(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_WAYLAND_SHM], +[ + +have_dep="yes" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + + +dnl use: EVAS_CHECK_ENGINE_DEP_WAYLAND_EGL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_ENGINE_DEP_WAYLAND_EGL], +[ + +requirement="" +have_dep="no" +evas_engine_[]$1[]_cflags="" +evas_engine_[]$1[]_libs="" + +if test "x${gl_flavor_gles}" = "xyes" ; then + gl_library="glesv2" +else + gl_library="gl" +fi + +PKG_CHECK_MODULES([GL_EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes"], [have_dep="no"]) + +PKG_CHECK_MODULES([WAYLAND_EGL], + [egl >= 7.10 ${gl_library} wayland-client wayland-egl], + [ + have_dep="yes" + requirement="egl ${gl_library} wayland-client wayland-egl" + ], + [have_dep="no"]) + +evas_engine_[]$1[]_cflags="${WAYLAND_EGL_CFLAGS}" +evas_engine_[]$1[]_libs="${WAYLAND_EGL_LIBS}" + +if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}" +fi + +AC_SUBST([evas_engine_$1_cflags]) +AC_SUBST([evas_engine_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$4], [:]) +else + m4_default([$5], [:]) +fi + +]) + + +dnl use: EVAS_CHECK_ENGINE(engine, want_engine, simple, description) + + +AC_DEFUN([EVAS_CHECK_ENGINE], +[ + +m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl +m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl + +want_engine="$2" +want_static_engine="no" +have_engine="no" +have_evas_engine_[]DOWN="no" + +AC_ARG_ENABLE([$1], + [AC_HELP_STRING([--enable-$1], [enable $4 rendering backend])], + [ + if test "x${enableval}" = "xyes" ; then + want_engine="yes" + else + if test "x${enableval}" = "xstatic" ; then + want_engine="static" + else + want_engine="no" + fi + fi + ]) + +AC_MSG_CHECKING([whether to enable $4 rendering backend]) +AC_MSG_RESULT([${want_engine}]) + +if test "x${want_engine}" = "xyes" -o "x${want_engine}" = "xstatic" -o "x${want_engine}" = "xauto" ; then + m4_default([EVAS_CHECK_ENGINE_DEP_]m4_defn([UP]))(DOWN, $3, ${want_engine}, [have_engine="yes"], [have_engine="no"]) +fi + +if test "x${have_engine}" = "xno" -a "x${want_engine}" = "xyes" -a "x${use_strict}" = "xyes" ; then + AC_MSG_ERROR([$4 dependencies not found (strict dependencies checking)]) +fi + +AC_MSG_CHECKING([whether $4 rendering backend will be built]) +AC_MSG_RESULT([${have_engine}]) + +if test "x${have_engine}" = "xyes" ; then + if test "x${want_engine}" = "xstatic" ; then + have_evas_engine_[]DOWN="static" + want_static_engine="yes" + else + have_evas_engine_[]DOWN="yes" + fi +fi + +if test "x${have_engine}" = "xyes" ; then + AC_DEFINE(BUILD_ENGINE_[]UP, [1], [$4 rendering backend]) +fi + +AM_CONDITIONAL(BUILD_ENGINE_[]UP, [test "x${have_engine}" = "xyes"]) + +if test "x${want_static_engine}" = "xyes" ; then + AC_DEFINE(EVAS_STATIC_BUILD_[]UP, [1], [Build $1 engine inside libevas]) + have_static_module="yes" +fi + +AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "x${want_static_engine}" = "xyes"]) + +m4_popdef([UP]) +m4_popdef([DOWN]) + +]) diff --git a/m4/evas_check_loader.m4 b/m4/evas_check_loader.m4 new file mode 100644 index 0000000000..1b0831dcea --- /dev/null +++ b/m4/evas_check_loader.m4 @@ -0,0 +1,534 @@ + +dnl use: EVAS_CHECK_LOADER_DEP_BMP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_BMP], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_EET(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_EET], +[ + +requirement="" +have_dep="no" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +PKG_CHECK_MODULES([EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes" requirement="eet >= ${PACKAGE_VERSION}"], [have_dep="no"]) +evas_image_loader_[]$1[]_cflags="${EET_CFLAGS}" +evas_image_loader_[]$1[]_libs="${EET_LIBS}" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirements_pc_deps_evas}" +fi + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_GENERIC(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_GENERIC], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_GIF(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_GIF], +[ + +have_dep="no" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_CHECK_HEADER([gif_lib.h], [have_dep="yes"]) + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([gif], + [DGifOpenFileName], + [ + evas_image_loader_[]$1[]_libs="-lgif" + ], + [have_dep="no"] + ) + + if test "x${have_dep}" = "xno" ; then + AC_CHECK_LIB([ungif], + [DGifOpenFileName], + [ + have_dep="yes" + evas_image_loader_[]$1[]_libs="-lungif" + ] + ) + fi +fi + +if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_ICO(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_ICO], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_JPEG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_JPEG], +[ + +have_dep="no" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_CHECK_HEADER([jpeglib.h], [have_dep="yes"]) + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([jpeg], + [jpeg_CreateDecompress], + [ + evas_image_loader_[]$1[]_libs="-ljpeg" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdio.h> +#include <jpeglib.h> +#include <setjmp.h> + ]], + [[ +struct jpeg_decompress_struct decomp; +decomp.region_x = 0; + ]])], + [have_jpeg_region="yes"], + [have_jpeg_region="no"]) + ], + [have_dep="no"] + ) + if test "x${have_jpeg_region}" = "xyes" ; then + AC_DEFINE(BUILD_LOADER_JPEG_REGION, [1], [JPEG Region Decode Support]) + fi +fi + +if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_PMAPS(loader, want_static[[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_PMAPS], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_PNG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_PNG], +[ + +requirement="" +have_dep="no" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +dnl libpng.pc is the latest version of libpng that ahs been installed. +dnl We check it first. +PKG_CHECK_MODULES([PNG], + [libpng >= 1.2.10], + [have_dep="yes" requirement="libpng"], + [have_dep="no"]) + +if test "x${have_dep}" = "xno" ; then + PKG_CHECK_MODULES([PNG], + [libpng15], + [have_dep="yes" requirement="libpng15"], + [have_dep="no"]) +fi + +if test "x${have_dep}" = "xno" ; then + PKG_CHECK_MODULES([PNG], + [libpng14], + [have_dep="yes" requirement="libpng14"], + [have_dep="no"]) +fi + +if test "x${have_dep}" = "xno" ; then + PKG_CHECK_MODULES([PNG], + [libpng12 >= 1.2.10], + [have_dep="yes" requirement="libpng12"], + [have_dep="no"]) +fi + +evas_image_loader_[]$1[]_cflags="${PNG_CFLAGS}" +evas_image_loader_[]$1[]_libs="${PNG_LIBS}" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}" +fi + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_PSD(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_PSD], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_SVG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_SVG], +[ + +requirement="" +have_esvg="no" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" +version_esvg="0.0.18" +version_ender="0.0.6" + +PKG_CHECK_MODULES([SVG], + [esvg >= ${version_esvg} ender >= ${version_ender}], + [have_dep="yes" have_esvg="yes" requirement="esvg >= ${version_esvg} ender >= ${version_ender}"], + [have_dep="no"]) + +if test "x${have_dep}" = "xyes" ; then + evas_image_loader_[]$1[]_cflags="${SVG_CFLAGS}" + evas_image_loader_[]$1[]_libs="${SVG_LIBS}" +fi + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_pc_evas="${requirement} ${requirements_pc_evas}" + requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}" +fi + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_TGA(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_TGA], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_TIFF(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_TIFF], +[ + +have_dep="no" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_CHECK_HEADER([tiffio.h], [have_dep="yes"]) + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([tiff], + [TIFFReadScanline], + [ + evas_image_loader_[]$1[]_libs="-ltiff" + ], + [have_dep="no"] + ) + + if test "x${have_dep}" = "xno" ; then + AC_CHECK_LIB([tiff], + [TIFFReadScanline], + [ + have_dep="yes" + evas_image_loader_[]$1[]_libs="-ltiff -ljpeg -lz -lm" + ] + ) + fi + + if test "x${have_dep}" = "xno" ; then + AC_CHECK_LIB([tiff34], + [TIFFReadScanline], + [ + have_dep="yes" + evas_image_loader_[]$1[]_libs="-ltiff34 -ljpeg -lz -lm" + ] + ) + fi +fi + +if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_WBMP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_WBMP], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_WEBP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_WEBP], +[ + +have_dep="no" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_CHECK_HEADER([webp/decode.h], [have_dep="yes"]) + +if test "x${have_dep}" = "xyes" ; then + AC_CHECK_LIB([webp], + [WebPDecodeRGBA], + [ + evas_image_loader_[]$1[]_libs="-lwebp" + ], + [have_dep="no"] + ) +fi + +if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then + requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}" + requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}" +fi + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_LOADER_DEP_XPM(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) + +AC_DEFUN([EVAS_CHECK_LOADER_DEP_XPM], +[ + +have_dep="yes" +evas_image_loader_[]$1[]_cflags="" +evas_image_loader_[]$1[]_libs="" + +AC_SUBST([evas_image_loader_$1_cflags]) +AC_SUBST([evas_image_loader_$1_libs]) + +if test "x${have_dep}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +]) + +dnl use: EVAS_CHECK_IMAGE_LOADER(loader, want_loader, macro) + + +AC_DEFUN([EVAS_CHECK_IMAGE_LOADER], +[ + +m4_pushdef([UP], m4_toupper([$1])) +m4_pushdef([DOWN], m4_tolower([$1])) + +want_loader="$2" +want_static_loader="no" +have_loader="no" +have_evas_image_loader_[]DOWN="no" + +AC_MSG_CHECKING([whether to enable $1 image loader]) +AC_MSG_RESULT([${want_loader}]) + +if test "x${want_loader}" = "xyes" -o "x${want_loader}" = "xstatic" -o "x${want_loader}" = "xauto"; then + m4_default([EVAS_CHECK_LOADER_DEP_]m4_defn([UP]))(DOWN, ${want_loader}, [have_loader="yes"], [have_loader="no"]) +fi + +if test "x${have_loader}" = "xno" -a "x${want_loader}" = "xyes" -a "x${use_strict}" = "xyes" ; then + AC_MSG_ERROR([$1 dependencies not found (strict dependencies checking)]) +fi + +AC_MSG_CHECKING([whether $1 image loader will be built]) +AC_MSG_RESULT([${have_loader}]) + +if test "x${have_loader}" = "xyes" ; then + if test "x${want_loader}" = "xstatic" ; then + have_evas_image_loader_[]DOWN="static" + want_static_loader="yes" + else + have_evas_image_loader_[]DOWN="yes" + fi +fi + +if test "x${have_loader}" = "xyes" ; then + AC_DEFINE(BUILD_LOADER_[]UP, [1], [UP Image Loader Support]) +fi + +AM_CONDITIONAL(BUILD_LOADER_[]UP, [test "x${have_loader}" = "xyes"]) + +if test "x${want_static_loader}" = "xyes" ; then + AC_DEFINE(EVAS_STATIC_BUILD_[]UP, [1], [Build $1 image loader inside libevas]) + have_static_module="yes" +fi + +AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "x${want_static_loader}" = "xyes"]) + +m4_popdef([UP]) +m4_popdef([DOWN]) + +]) diff --git a/m4/evas_dither.m4 b/m4/evas_dither.m4 new file mode 100644 index 0000000000..f8dcca3b7b --- /dev/null +++ b/m4/evas_dither.m4 @@ -0,0 +1,44 @@ +dnl Copyright (C) 2009 Vincent Torri <vtorri at univ-evry dot fr> +dnl That code is public domain and can be freely used or copied. + +dnl Macro that enables dithering support is wanted. + +dnl Usage: EVAS_CHECK_DITHER(dither, description [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl The parameter 'dither' is the type of dithering. +dnl The parameter 'description' is the description of the dithering. +dnl Defines BUILD_[TYPEOFDITHERING] + +AC_DEFUN([EVAS_CHECK_DITHER], +[ +m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl +m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl + +AC_ARG_ENABLE([$1], + AC_HELP_STRING([--enable-$1], [enable $2 @<:@default=disabled@:>@]), + [ + if test "x${enableval}" = "xyes" ; then + _efl_enable_dither_option_[]DOWN="yes" + else + _efl_enable_dither_option_[]DOWN="no" + fi + ], + [_efl_enable_dither_option_[]DOWN="no"]) + +AC_MSG_CHECKING(whether to build $2) +AC_MSG_RESULT([${_efl_enable_dither_option_[]DOWN}]) + +if test "x${_efl_enable_dither_option_[]DOWN}" = "xyes" ; then + AC_DEFINE([BUILD_]UP[], [1], [define to 1 if you have the $2 support]) +fi + +if test "x${_efl_enable_dither_option_[]DOWN}" = "xyes" ; then + m4_default([$3], [:]) +else + m4_default([$4], [:]) +fi + +m4_popdef([UP]) +m4_popdef([DOWN]) +]) + +dnl End of evas_dither.m4 |