summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/elm_check_backend.m438
-rw-r--r--m4/elm_check_option.m460
-rw-r--r--m4/elm_quicklaunch.m424
3 files changed, 122 insertions, 0 deletions
diff --git a/m4/elm_check_backend.m4 b/m4/elm_check_backend.m4
new file mode 100644
index 0000000000..471218f90e
--- /dev/null
+++ b/m4/elm_check_backend.m4
@@ -0,0 +1,38 @@
+
+dnl use: ELM_CHECK_BACKEND(engine)
+AC_DEFUN([ELM_CHECK_BACKEND],
+[dnl
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+
+have_elementary_[]DOWN="no"
+
+AC_ARG_ENABLE([ecore-]DOWN,
+ [AC_HELP_STRING([--disable-ecore-]DOWN, [disable ecore-]DOWN[ support. @<:@default=detect@:>@])],
+ [want_backend=$enableval],
+ [want_backend="auto"])
+
+AC_MSG_CHECKING([whether to enable $1 backend])
+AC_MSG_RESULT([${want_backend}])
+
+if test "x${want_backend}" != "xno"; then
+ PKG_CHECK_EXISTS([ecore-]DOWN[ >= efl_version],
+ [
+ AC_DEFINE([HAVE_ELEMENTARY_]UP, [1], [$1 support for Elementary])
+ have_elementary_[]DOWN="yes"
+ requirement_elm_pc="ecore-[]DOWN >= efl_version ${requirement_elm_pc}"
+ ],
+ [have_elementary_]DOWN[="no"]
+ )
+fi
+
+AC_MSG_CHECKING([whether to build $1 backend])
+AC_MSG_RESULT([${have_elementary_[]DOWN}])
+
+if test "x${want_backend}" = "xyes" && test "x$have_elementary_[]DOWN" = "xno"; then
+ AC_MSG_ERROR([ecore-]DOWN[ support requested, but ecore-]DOWN[ was not found by pkg-config.])
+fi
+
+m4_popdef([UP])dnl
+m4_popdef([DOWN])dnl
+])
diff --git a/m4/elm_check_option.m4 b/m4/elm_check_option.m4
new file mode 100644
index 0000000000..999636ad32
--- /dev/null
+++ b/m4/elm_check_option.m4
@@ -0,0 +1,60 @@
+
+dnl use: ELM_CHECK_OPTION_DEP(option, pkgver)
+AC_DEFUN([ELM_CHECK_OPTION_DEP],
+[dnl
+
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+
+ELM_[]UP[]_DEF="#undef"
+have_elementary_[]DOWN="no"
+
+AC_ARG_ENABLE(DOWN,
+ [AS_HELP_STRING([--disable-]DOWN, [disable ]DOWN[ support. @<:@default=detect@:>@])],
+ [want_option=$enableval],
+ [want_option="auto"])
+
+AC_MSG_CHECKING([whether to enable $1 option])
+AC_MSG_RESULT([${want_option}])
+
+if test "x${want_option}" != "xno"; then
+ PKG_CHECK_EXISTS(DOWN[ >= $2],
+ [
+ AC_DEFINE([HAVE_ELEMENTARY_]UP, [1], [$1 support for Elementary])
+ have_elementary_[]DOWN="yes"
+ ELM_[]UP[]_DEF="#define"
+ requirement_elm_pc="[]DOWN >= $2 ${requirement_elm_pc}"
+ ],
+ [have_elementary_]DOWN[="no"]
+ )
+fi
+
+AC_MSG_CHECKING([whether to build $1 option])
+AC_MSG_RESULT([${have_elementary_[]DOWN}])
+
+if test "x${want_elementary_[]DOWN}" = "xyes" && test "x${have_elementary_[]DOWN}" = "xno"; then
+ AC_MSG_ERROR([$1 support requested, but $1 was not found by pkg-config.])
+fi
+
+AC_SUBST([ELM_]UP[_DEF])
+
+m4_popdef([UP])dnl
+m4_popdef([DOWN])dnl
+])
+
+dnl use: ELM_CHECK_OPTION(option, pkgver)
+AC_DEFUN([ELM_CHECK_OPTION],
+[dnl
+
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+
+if test "x$1" = "xeweb" ; then
+ ELM_CHECK_OPTION_DEP_EWK2
+else
+ ELM_CHECK_OPTION_DEP($1, $2)
+fi
+
+m4_popdef([UP])dnl
+m4_popdef([DOWN])dnl
+])
diff --git a/m4/elm_quicklaunch.m4 b/m4/elm_quicklaunch.m4
new file mode 100644
index 0000000000..3db9945f02
--- /dev/null
+++ b/m4/elm_quicklaunch.m4
@@ -0,0 +1,24 @@
+dnl Copyright (C) 2013 Cedric Bail <cedric dot bail at samsung dot com>
+dnl That code is public domain and can be freely used or copied
+
+dnl Macro that check if -pie -rdynamic can be given to ld
+
+dnl Usage: ELM_QUICKLAUNCH
+dnl add -pie -rdynamic to LDFLAGS and -fpie to CFLAGS
+
+AC_DEFUN([ELM_QUICKLAUNCH],
+[
+AC_MSG_CHECKING([If the compiler as what it takes to do quicklaunch (-pie -rdynamic)])
+old_LDFLAGS="$LDFLAGS"
+old_CFLAGS="$CFLAGS"
+
+LDFLAGS="$LDFLAGS -pie -rdynamic"
+CFLAGS="$CFLAGS -fpie"
+
+AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
+ [AC_MSG_RESULT([yes])],
+ [LDFLAGS="$old_LDFLAGS"
+ CFLAGS="$old_CFLAGS"
+ AC_MSG_RESULT([no])
+ ])
+])