summaryrefslogtreecommitdiff
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)
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 2397e22ce3..426e3fcf36 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -1,5 +1,69 @@
1dnl file to manage modules in efl 1dnl file to manage modules in efl
2 2
3dnl EFL_EVAL_PKGS(EFL)
4dnl does PKG_CHECK_MODULES() for given EFL
5AC_DEFUN([EFL_EVAL_PKGS],
6[dnl
7m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
8if test "x${requirements_pc_deps_[]m4_defn([DOWNEFL])}" != "x"; then
9 PKG_CHECK_MODULES([$1], [${requirements_pc_deps_[]m4_defn([DOWNEFL])}])
10fi
11m4_popdef([DOWNEFL])dnl
12])
13
14dnl EFL_INTERNAL_DEPEND_PKG(EFL, OTHEREFL)
15dnl Adds a pkg-config dependency on another EFL.
16AC_DEFUN([EFL_INTERNAL_DEPEND_PKG],
17[dnl
18m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
19requirements_pc_[]m4_defn([DOWNEFL])="$2 >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
20m4_popdef([DOWNEFL])dnl
21])
22
23dnl EFL_PLATFORM_DEPEND(EFL, PLATFORM)
24dnl PLATFORM is one of: all, evil, escape, exotic
25AC_DEFUN([EFL_PLATFORM_DEPEND],
26[dnl
27m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
28case "$2" in
29 all)
30 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
31 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
32 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
33 ;;
34 evil)
35 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_evil} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
36 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_evil} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
37 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_evil} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
38 ;;
39 escape)
40 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_escape} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
41 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_escape} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
42 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_escape} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
43 ;;
44 exotic)
45 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_exotic} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
46 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_exotic} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
47 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_exotic} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
48 ;;
49 *)
50 AC_MSG_ERROR([Unknown platform: $2])
51esac
52m4_popdef([DOWNEFL])dnl
53])
54
55dnl EFL_CRYPTO_DEPEND(EFL)
56dnl the given EFL will use/depend on system crypto settings
57AC_DEFUN([EFL_CRYPTO_DEPEND],
58[dnl
59m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
60requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_crypto} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
61requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_crypto} ${requirements_pc_deps_[][]m4_defn([DOWNEFL])}"
62requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_crypto} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
63requirements_cflags_[]m4_defn([DOWNEFL])="${requirements_cflags_crypto} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
64m4_popdef([DOWNEFL])dnl
65])
66
3dnl EFL_DEPEND_PKG(EFL, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 67dnl EFL_DEPEND_PKG(EFL, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4dnl Adds a pkg-config dependency to an efl, AC_DEFINE() HAVE_NAME, 68dnl Adds a pkg-config dependency to an efl, AC_DEFINE() HAVE_NAME,
5dnl and inserts dependencies in proper variables 69dnl and inserts dependencies in proper variables
@@ -41,21 +105,50 @@ m4_pushdef([DOWN], m4_translit([$3], [-A-Z], [_a-z]))dnl
41m4_popdef([DOWN]) 105m4_popdef([DOWN])
42]) 106])
43 107
108dnl EFL_ADD_LIBS(PKG, LIBS)
109dnl Add libraries that the EFL library will depend on
110dnl See EFL_DEPEND_PKG() for pkg-config version.
111AC_DEFUN([EFL_ADD_LIBS],
112[dnl
113m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
114requirements_libs_[]m4_defn([DOWN])="${requirements_libs_[]m4_defn([DOWN])} $2"
115m4_popdef([DOWN])dnl
116])
117
118dnl EFL_ADD_CFLAGS(PKG, CFLAGS)
119dnl Add CFLAGS that the EFL library will use
120dnl See EFL_DEPEND_PKG() for pkg-config version.
121AC_DEFUN([EFL_ADD_CFLAGS],
122[dnl
123m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
124requirements_cflags_[]m4_defn([DOWN])="${requirements_cflags_[]m4_defn([DOWN])} $2"
125m4_popdef([DOWN])dnl
126])
127
44dnl EFL_LIB_START(PKG) 128dnl EFL_LIB_START(PKG)
45dnl start the setup of an EFL library, defines variables and prints a notice 129dnl start the setup of an EFL library, defines variables and prints a notice
46AC_DEFUN([EFL_LIB_START], 130AC_DEFUN([EFL_LIB_START],
47[ 131[
48m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl 132m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
133m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
49 134
50requirements_libs_[]m4_defn([DOWN])="" 135requirements_libs_[]m4_defn([DOWN])=""
136requirements_cflags_[]m4_defn([DOWN])=""
51requirements_pc_[]m4_defn([DOWN])="" 137requirements_pc_[]m4_defn([DOWN])=""
52requirements_pc_deps_[]m4_defn([DOWN])="" 138requirements_pc_deps_[]m4_defn([DOWN])=""
53 139
140m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
141m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
142
54AC_SUBST([requirements_libs_]m4_defn([DOWN])) 143AC_SUBST([requirements_libs_]m4_defn([DOWN]))
144AC_SUBST([requirements_cflags_]m4_defn([DOWN]))
55AC_SUBST([requirements_pc_]m4_defn([DOWN])) 145AC_SUBST([requirements_pc_]m4_defn([DOWN]))
146AC_SUBST(m4_defn([UP])[_LIBS])
147AC_SUBST(m4_defn([UP])[_CFLAGS])
56 148
57AC_MSG_NOTICE([Start $1 checks]) 149AC_MSG_NOTICE([Start $1 checks])
58 150
151m4_popdef([UP])
59m4_popdef([DOWN]) 152m4_popdef([DOWN])
60]) 153])
61 154
@@ -63,7 +156,15 @@ dnl EFL_LIB_END(PKG)
63dnl finishes the setup of an EFL library 156dnl finishes the setup of an EFL library
64AC_DEFUN([EFL_LIB_END], 157AC_DEFUN([EFL_LIB_END],
65[ 158[
159m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
160m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
161
162m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${requirements_libs_[]m4_defn([DOWN])}"
163m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS} ${requirements_cflags_[]m4_defn([DOWN])}"
164
66AC_MSG_NOTICE([Finished $1 checks]) 165AC_MSG_NOTICE([Finished $1 checks])
166m4_popdef([UP])
167m4_popdef([DOWN])
67]) 168])
68 169
69dnl EFL_LIB_START_OPTIONAL(PKG, TEST) 170dnl EFL_LIB_START_OPTIONAL(PKG, TEST)