summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-14 22:36:23 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-14 22:36:23 +0000
commitb1bc5aeb24d6dd0faf97c2d1d6c6781798a7fbe9 (patch)
treeebffce52ddbab71c6da6c2e07eeca7382abf15f6 /m4
parent283805237a9f5f194568667fc32586a3238cbde0 (diff)
efl: simplify automake.
Instead of -I$(top_srcdir)... -I$(top_builddir)... and then do it for the .la, use the EFL_ macros to generate the contents to be used in automake files. There is a nasty bit that libtool will parse Makefile*.am and will not get _DEPENDENCIES from _LIBADD and _LDADD if these are in @REPLACEMENT@. To solve this we must explicitly set _DEPENDENCIES. The contents of this is almost the same as _LIBADD or _LDADD with the "_INTERNAL_" replacement name. I hope the code will be result will be shorter and consistent as there is less places to change when we add/remove dependencies. Statistics are quite impressive (diffstat): {{{ 37 files changed, 663 insertions(+), 1599 deletions(-) }}} SVN revision: 82785
Diffstat (limited to 'm4')
-rw-r--r--m4/efl.m487
1 files changed, 60 insertions, 27 deletions
diff --git a/m4/efl.m4 b/m4/efl.m4
index 7ed137f..65fa893 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -16,18 +16,32 @@ dnl Adds a pkg-config dependency on another EFL.
16AC_DEFUN([EFL_INTERNAL_DEPEND_PKG], 16AC_DEFUN([EFL_INTERNAL_DEPEND_PKG],
17[dnl 17[dnl
18m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl 18m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
19m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
19dnl TODO: we need to fix the package config names for 2.0 20dnl TODO: we need to fix the package config names for 2.0
20dnl TODO: and make them uniform in scheme. 21dnl TODO: and make them uniform in scheme.
21depname="$2" 22depname="$2"
22case "${depname}" in 23libdirname="m4_defn([DOWNOTHER])"
24libname="m4_defn([DOWNOTHER])"
25case "m4_defn([DOWNOTHER])" in
23 edbus) 26 edbus)
24 depname="edbus2" 27 depname="edbus2"
28 libname="edbus2"
25 ;; 29 ;;
26 ethumb-client) 30 ethumb_client)
27 depname="ethumb_client" 31 depname="ethumb_client"
32 libdirname="ethumb/client"
33 ;;
34 ecore_input_evas)
35 libdirname="ecore_input"
36 ;;
37 ecore_imf_evas)
38 libdirname="ecore_imf"
28 ;; 39 ;;
29esac 40esac
30requirements_pc_[]m4_defn([DOWNEFL])="${depname} >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}" 41requirements_pc_[]m4_defn([DOWNEFL])="${depname} >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
42requirements_cflags_[]m4_defn([DOWNEFL])="-I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
43requirements_internal_libs_[]m4_defn([DOWNEFL])="lib/${libdirname}/lib${libname}.la ${requirements_internal_libs_[][]m4_defn([DOWNEFL])}"
44m4_popdef([DOWNOTHER])dnl
31m4_popdef([DOWNEFL])dnl 45m4_popdef([DOWNEFL])dnl
32]) 46])
33 47
@@ -35,32 +49,24 @@ dnl EFL_PLATFORM_DEPEND(EFL, PLATFORM)
35dnl PLATFORM is one of: all, evil, escape, exotic 49dnl PLATFORM is one of: all, evil, escape, exotic
36AC_DEFUN([EFL_PLATFORM_DEPEND], 50AC_DEFUN([EFL_PLATFORM_DEPEND],
37[dnl 51[dnl
38m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl 52m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
39case "$2" in 53case "m4_defn([DOWNOTHER])" in
40 all) 54 all)
41 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc} ${requirements_pc_[][]m4_defn([DOWNEFL])}" 55 if test "x${efl_lib_optional_evil}" = "xyes"; then
42 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs} ${requirements_libs_[][]m4_defn([DOWNEFL])}" 56 EFL_INTERNAL_DEPEND_PKG([$1], [evil])
43 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags} ${requirements_cflags_[][]m4_defn([DOWNEFL])}" 57 elif test "x${efl_lib_optional_escape}" = "xyes"; then
44 ;; 58 EFL_INTERNAL_DEPEND_PKG([$1], [escape])
45 evil) 59 elif test "x${efl_lib_optional_exotic}" = "xyes"; then
46 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_evil} ${requirements_pc_[][]m4_defn([DOWNEFL])}" 60 EFL_INTERNAL_DEPEND_PKG([$1], [exotic])
47 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_evil} ${requirements_libs_[][]m4_defn([DOWNEFL])}" 61 fi
48 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_evil} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
49 ;;
50 escape)
51 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_escape} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
52 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_escape} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
53 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_escape} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
54 ;;
55 exotic)
56 requirements_pc_[]m4_defn([DOWNEFL])="${platform_pc_exotic} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
57 requirements_libs_[]m4_defn([DOWNEFL])="${platform_libs_exotic} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
58 requirements_cflags_[]m4_defn([DOWNEFL])="${platform_cflags_exotic} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
59 ;; 62 ;;
60 *) 63 *)
61 AC_MSG_ERROR([Unknown platform: $2]) 64 if test "x${efl_lib_optional_[]m4_defn([DOWNOTHER])}" = "xyes"; then
65 EFL_INTERNAL_DEPEND_PKG([$1], [$2])
66 fi
67 ;;
62esac 68esac
63m4_popdef([DOWNEFL])dnl 69m4_popdef([DOWNOTHER])dnl
64]) 70])
65 71
66dnl EFL_CRYPTO_DEPEND(EFL) 72dnl EFL_CRYPTO_DEPEND(EFL)
@@ -156,12 +162,16 @@ AC_DEFUN([EFL_LIB_START],
156m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl 162m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
157m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl 163m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
158 164
165requirements_internal_libs_[]m4_defn([DOWN])=""
159requirements_libs_[]m4_defn([DOWN])="" 166requirements_libs_[]m4_defn([DOWN])=""
160requirements_cflags_[]m4_defn([DOWN])="" 167requirements_cflags_[]m4_defn([DOWN])=""
161requirements_pc_[]m4_defn([DOWN])="" 168requirements_pc_[]m4_defn([DOWN])=""
162requirements_pc_deps_[]m4_defn([DOWN])="" 169requirements_pc_deps_[]m4_defn([DOWN])=""
163 170
164m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}" 171m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
172m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS}"
173USE_[]m4_defn([UP])_LIBS="${USE_[]m4_defn([UP])_LIBS}"
174USE_[]m4_defn([UP])_INTERNAL_LIBS="${USE_[]m4_defn([UP])_INTERNAL_LIBS}"
165m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS}" 175m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS}"
166m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}" 176m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
167 177
@@ -169,6 +179,9 @@ AC_SUBST([requirements_libs_]m4_defn([DOWN]))
169AC_SUBST([requirements_cflags_]m4_defn([DOWN])) 179AC_SUBST([requirements_cflags_]m4_defn([DOWN]))
170AC_SUBST([requirements_pc_]m4_defn([DOWN])) 180AC_SUBST([requirements_pc_]m4_defn([DOWN]))
171AC_SUBST(m4_defn([UP])[_LIBS]) 181AC_SUBST(m4_defn([UP])[_LIBS])
182AC_SUBST(m4_defn([UP])[_INTERNAL_LIBS])
183AC_SUBST([USE_]m4_defn([UP])[_LIBS])
184AC_SUBST([USE_]m4_defn([UP])[_INTERNAL_LIBS])
172AC_SUBST(m4_defn([UP])[_LDFLAGS]) 185AC_SUBST(m4_defn([UP])[_LDFLAGS])
173AC_SUBST(m4_defn([UP])[_CFLAGS]) 186AC_SUBST(m4_defn([UP])[_CFLAGS])
174 187
@@ -185,9 +198,29 @@ AC_DEFUN([EFL_LIB_END],
185m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl 198m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
186m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl 199m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
187 200
188m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS} ${EFL_LDFLAGS}" 201libdirname="m4_defn([DOWN])"
189m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${m4_defn([UP])_LDFLAGS} ${EFL_LIBS} ${requirements_libs_[]m4_defn([DOWN])} ${requirements_libs_efl} " 202libname="m4_defn([DOWN])"
190m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS} ${EFL_CFLAGS} ${requirements_cflags_[]m4_defn([DOWN])} ${requirements_cflags_efl}" 203case "m4_defn([DOWN])" in
204 edbus)
205 libname="edbus2"
206 ;;
207 ethumb_client)
208 libdirname="ethumb/client"
209 ;;
210 ecore_input_evas)
211 libdirname="ecore_input"
212 ;;
213 ecore_imf_evas)
214 libdirname="ecore_imf"
215 ;;
216esac
217
218m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS} ${EFL_COV_CFLAGS} ${EFL_LDFLAGS}"
219m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${m4_defn([UP])_LDFLAGS} ${EFL_COV_LIBS} ${EFL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])} ${requirements_libs_[]m4_defn([DOWN])} ${requirements_libs_efl} "
220m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])}"
221USE_[]m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} lib/${libdirname}/lib${libname}.la"
222USE_[]m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} lib/${libdirname}/lib${libname}.la"
223m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS} ${EFL_CFLAGS} -I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} ${requirements_cflags_[]m4_defn([DOWN])} ${requirements_cflags_efl} -DEFL_[]m4_defn([UP])_BUILD=1"
191requirements_pc_[]m4_defn([DOWN])="${requirements_pc_[]m4_defn([DOWN])} ${requirements_pc_efl}" 224requirements_pc_[]m4_defn([DOWN])="${requirements_pc_[]m4_defn([DOWN])} ${requirements_pc_efl}"
192requirements_pc_deps_[]m4_defn([DOWN])="${requirements_pc_deps_[]m4_defn([DOWN])} ${requirements_pc_deps_efl}" 225requirements_pc_deps_[]m4_defn([DOWN])="${requirements_pc_deps_[]m4_defn([DOWN])} ${requirements_pc_deps_efl}"
193 226