diff options
author | Gustavo Sverzut Barbieri <barbieri@gmail.com> | 2013-01-11 03:07:58 +0000 |
---|---|---|
committer | Gustavo Sverzut Barbieri <barbieri@gmail.com> | 2013-01-11 03:07:58 +0000 |
commit | fc82f2f978ee765dcd67d77ff55a9077b9211286 (patch) | |
tree | 8468550382229032ef5eb04f8851e6c26133561f /m4 | |
parent | 5c3d1f1f6be28079a7c693f6feb52881b2597501 (diff) | |
download | emotion_generic_players-fc82f2f978ee765dcd67d77ff55a9077b9211286.tar.gz |
add emotion_generic_players project.
This is similar to evas_generic_loaders. It contains VLC player
engine.
SVN revision: 82603
Diffstat (limited to 'm4')
-rw-r--r-- | m4/efl_compiler.m4 | 98 | ||||
-rw-r--r-- | m4/emotion_generic_players.m4 | 37 |
2 files changed, 135 insertions, 0 deletions
diff --git a/m4/efl_compiler.m4 b/m4/efl_compiler.m4 new file mode 100644 index 0000000..6b98390 --- /dev/null +++ b/m4/efl_compiler.m4 @@ -0,0 +1,98 @@ +dnl Copyright (C) 2012 Vincent Torri <vincent dot torri at gmail dot com> +dnl This code is public domain and can be freely used or copied. + +dnl Macro that check if compiler of linker flags are available + + +dnl Macro that checks for a compiler flag availability +dnl +dnl EFL_CHECK_COMPILER_FLAG(EFL, FLAG[, ACTION-IF-FOUND[ ,ACTION-IF-NOT-FOUND]]) +dnl AC_SUBST : EFL_CFLAGS (EFL being replaced by its value) + +AC_DEFUN([EFL_CHECK_COMPILER_FLAG], +[ +m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z])) +m4_pushdef([UP], m4_translit([[$2]], [-a-z], [_A-Z])) + +dnl store in options -Wfoo if -Wno-foo is passed +option=m4_bpatsubst([[$2]], [-Wno-], [-W]) + +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} ${option}" + +AC_LANG_PUSH([C]) +AC_MSG_CHECKING([whether the compiler supports $2]) + +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]])], + [have_flag="yes"], + [have_flag="no"]) +AC_MSG_RESULT([${have_flag}]) + +CFLAGS="${CFLAGS_save}" +AC_LANG_POP([C]) + +if test "x${have_flag}" = "xyes" ; then + UPEFL[_CFLAGS]="${UPEFL[_CFLAGS]} [$2]" +fi +AC_ARG_VAR(UPEFL[_CFLAGS], [preprocessor flags for $2]) +AC_SUBST(UPEFL[_CFLAGS]) + +m4_popdef([UP]) +m4_popdef([UPEFL]) +]) + +dnl Macro that iterates over a sequence of white separated flags +dnl and that call EFL_CHECK_COMPILER_FLAG() for each of these flags +dnl +dnl EFL_CHECK_COMPILER_FLAGS(EFL, FLAGS) + +AC_DEFUN([EFL_CHECK_COMPILER_FLAGS], +[ +m4_foreach_w([flag], [$2], [EFL_CHECK_COMPILER_FLAG([$1], m4_defn([flag]))]) +]) + + +dnl Macro that checks for a linker flag availability +dnl +dnl EFL_CHECK_LINKER_FLAG(EFL, FLAG[, ACTION-IF-FOUND[ ,ACTION-IF-NOT-FOUND]]) +dnl AC_SUBST : EFL_LDFLAGS (EFL being replaced by its value) + +AC_DEFUN([EFL_CHECK_LINKER_FLAG], +[ +m4_pushdef([UPEFL], m4_translit([[$1]], [-a-z], [_A-Z])) +m4_pushdef([UP], m4_translit([[$2]], [,-a-z], [__A-Z])) + +LDFLAGS_save="${LDFLAGS}" +LDFLAGS="${LDFLAGS} $2" + +AC_LANG_PUSH([C]) +AC_MSG_CHECKING([whether the linker supports $2]) + +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]])], + [have_flag="yes"], + [have_flag="no"]) +AC_MSG_RESULT([${have_flag}]) + +LDFLAGS="${LDFLAGS_save}" +AC_LANG_POP([C]) + +if test "x${have_flag}" = "xyes" ; then + UPEFL[_LDFLAGS]="${UPEFL[_LDFLAGS]} [$2]" +fi +AC_SUBST(UPEFL[_LDFLAGS]) + +m4_popdef([UP]) +m4_popdef([UPEFL]) +]) + +dnl Macro that iterates over a sequence of white separated flags +dnl and that call EFL_CHECK_LINKER_FLAG() for each of these flags +dnl +dnl EFL_CHECK_LINKER_FLAGS(EFL, FLAGS) + +AC_DEFUN([EFL_CHECK_LINKER_FLAGS], +[ +m4_foreach_w([flag], [$2], [EFL_CHECK_LINKER_FLAG([$1], m4_defn([flag]))]) +]) diff --git a/m4/emotion_generic_players.m4 b/m4/emotion_generic_players.m4 new file mode 100644 index 0000000..d852dba --- /dev/null +++ b/m4/emotion_generic_players.m4 @@ -0,0 +1,37 @@ +dnl EMOTION_GENERIC_PLAYER(NAME, DEFAULT_STATE, [PKG_CONFIG_DEPS]) +dnl Does the following: +dnl * AC_ARG_WITH(NAME) +dnl * define with_name to yes or no +dnl * PKG_CHECK_MODULES(NAME, PKG_CONFIG_DEPS) +dnl * AC_DEFINE([HAVE_NAME]) +dnl * AM_CONDITIONAL([HAVE_NAME]) +AC_DEFUN([EMOTION_GENERIC_PLAYER], +[dnl +m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl +m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl + +AC_ARG_WITH([DOWN], + [AC_HELP_STRING([--with-]m4_defn([DOWN]), + [build generic player ]m4_defn([UP])[. @<:@default=$2@:>@])], + [], [with_]m4_defn([DOWN])[="$2"]) + +if test "${with_[]m4_defn([DOWN])}" = "yes"; then + m4_ifval([$3], [dnl + PKG_CHECK_MODULES(m4_defn([UP]), [$3]) + ], [dnl + m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}" + m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}" + AC_SUBST(m4_defn([UP])[_LIBS]) + AC_SUBST(m4_defn([UP])[_CFLAGS]) + ]) + + AC_SEARCH_LIBS([shm_open], [rt], [], [AC_MSG_ERROR([unable to find the shm_open() function])]) + if test "${ac_cv_search_shm_open}" != "none required"; then + m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${ac_cv_search_shm_open}" + fi +fi +AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$with_[]m4_defn([DOWN])" = "yes"]) + +m4_popdef([UP])dnl +m4_popdef([DOWN])dnl +]) |