aboutsummaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-30 18:08:55 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-30 18:08:55 +0000
commit1f423eb8e743fbaf0d3e014616daaa356b413f1d (patch)
tree3da0dcd01874a532b55385c643a7d50637c2028d /m4
parentfb27484376f64ab229020c70cf21ca4fc56be092 (diff)
downloadefl-1f423eb8e743fbaf0d3e014616daaa356b413f1d.tar.gz
efl-1f423eb8e743fbaf0d3e014616daaa356b413f1d.tar.xz
efl-1f423eb8e743fbaf0d3e014616daaa356b413f1d.zip
efl/configure: simplify configure.ac
more macros to aid common tasks, make it easier to read. SVN revision: 81904
Diffstat (limited to 'm4')
-rw-r--r--m4/efl.m4101
1 files changed, 101 insertions, 0 deletions
diff --git a/m4/efl.m4 b/m4/efl.m4
index 2397e22ce..426e3fcf3 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -1,5 +1,69 @@
dnl file to manage modules in efl
+dnl EFL_EVAL_PKGS(EFL)
+dnl does PKG_CHECK_MODULES() for given EFL
+AC_DEFUN([EFL_EVAL_PKGS],
+[dnl
+m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
+if test "x${requirements_pc_deps_[]m4_defn([DOWNEFL])}" != "x"; then
+ PKG_CHECK_MODULES([$1], [${requirements_pc_deps_[]m4_defn([DOWNEFL])}])
+fi
+m4_popdef([DOWNEFL])dnl
+])
+
+dnl EFL_INTERNAL_DEPEND_PKG(EFL, OTHEREFL)
+dnl Adds a pkg-config dependency on another EFL.
+AC_DEFUN([EFL_INTERNAL_DEPEND_PKG],
+[dnl
+m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
+requirements_pc_[]m4_defn([DOWNEFL])="$2 >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
+m4_popdef([DOWNEFL])dnl
+])
+
+dnl EFL_PLATFORM_DEPEND(EFL, PLATFORM)
+dnl PLATFORM is one of: all, evil, escape, exotic
+AC_DEFUN([EFL_PLATFORM_DEPEND],
+[dnl
+m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
+case "$2" in
+ all)
+ requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
+ requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
+ requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
+ ;;
+ evil)
+ requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_evil} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
+ requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_evil} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
+ requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_evil} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
+ ;;
+ escape)
+ requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_escape} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
+ requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_escape} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
+ requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_escape} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
+ ;;
+ exotic)
+ requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_exotic} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
+ requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_exotic} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
+ requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_exotic} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown platform: $2])
+esac
+m4_popdef([DOWNEFL])dnl
+])
+
+dnl EFL_CRYPTO_DEPEND(EFL)
+dnl the given EFL will use/depend on system crypto settings
+AC_DEFUN([EFL_CRYPTO_DEPEND],
+[dnl
+m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
+requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_crypto} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
+requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_crypto} ${requirements_pc_deps_[][]m4_defn([DOWNEFL])}"
+requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_crypto} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
+requirements_cflags_[]m4_defn([DOWNEFL])="${requirements_cflags_crypto} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
+m4_popdef([DOWNEFL])dnl
+])
+
dnl EFL_DEPEND_PKG(EFL, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl Adds a pkg-config dependency to an efl, AC_DEFINE() HAVE_NAME,
dnl and inserts dependencies in proper variables
@@ -41,21 +105,50 @@ m4_pushdef([DOWN], m4_translit([$3], [-A-Z], [_a-z]))dnl
m4_popdef([DOWN])
])
+dnl EFL_ADD_LIBS(PKG, LIBS)
+dnl Add libraries that the EFL library will depend on
+dnl See EFL_DEPEND_PKG() for pkg-config version.
+AC_DEFUN([EFL_ADD_LIBS],
+[dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+requirements_libs_[]m4_defn([DOWN])="${requirements_libs_[]m4_defn([DOWN])} $2"
+m4_popdef([DOWN])dnl
+])
+
+dnl EFL_ADD_CFLAGS(PKG, CFLAGS)
+dnl Add CFLAGS that the EFL library will use
+dnl See EFL_DEPEND_PKG() for pkg-config version.
+AC_DEFUN([EFL_ADD_CFLAGS],
+[dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+requirements_cflags_[]m4_defn([DOWN])="${requirements_cflags_[]m4_defn([DOWN])} $2"
+m4_popdef([DOWN])dnl
+])
+
dnl EFL_LIB_START(PKG)
dnl start the setup of an EFL library, defines variables and prints a notice
AC_DEFUN([EFL_LIB_START],
[
m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
requirements_libs_[]m4_defn([DOWN])=""
+requirements_cflags_[]m4_defn([DOWN])=""
requirements_pc_[]m4_defn([DOWN])=""
requirements_pc_deps_[]m4_defn([DOWN])=""
+m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
+m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
+
AC_SUBST([requirements_libs_]m4_defn([DOWN]))
+AC_SUBST([requirements_cflags_]m4_defn([DOWN]))
AC_SUBST([requirements_pc_]m4_defn([DOWN]))
+AC_SUBST(m4_defn([UP])[_LIBS])
+AC_SUBST(m4_defn([UP])[_CFLAGS])
AC_MSG_NOTICE([Start $1 checks])
+m4_popdef([UP])
m4_popdef([DOWN])
])
@@ -63,7 +156,15 @@ dnl EFL_LIB_END(PKG)
dnl finishes the setup of an EFL library
AC_DEFUN([EFL_LIB_END],
[
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+
+m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${requirements_libs_[]m4_defn([DOWN])}"
+m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS} ${requirements_cflags_[]m4_defn([DOWN])}"
+
AC_MSG_NOTICE([Finished $1 checks])
+m4_popdef([UP])
+m4_popdef([DOWN])
])
dnl EFL_LIB_START_OPTIONAL(PKG, TEST)