summaryrefslogtreecommitdiff
path: root/m4/efl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/efl.m4')
-rw-r--r--m4/efl.m4509
1 files changed, 0 insertions, 509 deletions
diff --git a/m4/efl.m4 b/m4/efl.m4
deleted file mode 100644
index a01c5b4..0000000
--- a/m4/efl.m4
+++ /dev/null
@@ -1,509 +0,0 @@
1dnl file to manage modules in efl
2
3dnl EFL_VERSION(major, minor, micro, release)
4dnl This setup EFL version information and should be called BEFORE AC_INIT().
5dnl
6dnl release parameter is 'dev' to use from SVN or libtool -release field.
7dnl It may be empty if not dev (svn/live build) and no -release is to be used.
8dnl
9dnl Examples:
10dnl EFL_VERSION(1, 7, 99, dev)
11dnl EFL_VERSION(1, 7, 99, ver-1234)
12dnl This will define couple of m4 symbols:
13dnl v_maj = given major number (first parameter)
14dnl v_min = given minor number (second parameter)
15dnl v_mic = given micro number (third parameter)
16dnl v_rev = if release, it's 0, otherwise it's dev_version.
17dnl v_rel = if release, it's -release followed by fourth parameter,
18dnl otherwise it's empty. (mostly for libtool)
19dnl efl_version = if release, it's major.minor.micro, otherwise it's
20dnl major.minor.micro.dev_version
21dnl dev_version = development version (svn revision).
22dnl def_build_profile = dev or release based on 'dev' release parameter.
23AC_DEFUN([EFL_VERSION],
24[dnl
25m4_define([v_maj], [$1])dnl
26m4_define([v_min], [$2])dnl
27m4_define([v_mic], [$3])dnl
28m4_define([dev_version], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
29m4_define([v_rev], m4_if($4, dev, [dev_version], [0]))dnl
30m4_define([v_rel], [])dnl
31m4_define([def_build_profile], m4_if($4, dev, [dev], [release]))dnl
32m4_define([efl_version], m4_if($4, dev, [v_maj.v_min.v_mic.v_rev], [v_maj.v_min.v_mic]))dnl
33dnl m4_define([efl_version], [v_maj.v_min.v_mic])dnl
34])
35
36dnl EFL_COLOR
37dnl will check if terminal supports color and if color is wanted by user.
38dnl
39dnl Used Variables:
40dnl WANT_COLOR: if no, forces no color output.
41dnl TERM: used to check if color should be enabled.
42dnl
43dnl Defined Variables:
44dnl COLOR_YES: to be used in positive/yes conditions
45dnl COLOR_NO: to be used in negative/no conditions
46dnl COLOR_OTHER: to be used to highlight some other condition
47dnl COLOR_RESET: to reset color
48dnl want_color: yes or no
49AC_DEFUN([EFL_COLOR],
50[dnl
51case "$TERM" in
52 xterm|xterm-color|xterm-256color|Eterm|aterm|kterm|rxvt*|screen|gnome|interix)
53 want_color="${WANT_COLOR:-yes}"
54 ;;
55 *)
56 want_color="no"
57 ;;
58esac
59
60### echo compatibility
61
62## the BSD echo does not have the -e option (it is the default behaviour)
63echo_e=
64if test "`echo -e x`" = "x"; then
65 echo_e=-e
66fi
67AC_SUBST([ECHO_E], [${echo_e}])
68
69if test "${want_color}" = "yes"; then
70 COLOR_YES=`echo $echo_e "\033@<:@1;32m"`
71 COLOR_NO=`echo $echo_e "\033@<:@1;31m"`
72 COLOR_OTHER=`echo $echo_e "\033@<:@1;36m"`
73 COLOR_RESET=`echo $echo_e "\033@<:@0m"`
74else
75 COLOR_YES=""
76 COLOR_NO=""
77 COLOR_OTHER=""
78 COLOR_RESET=""
79fi
80])
81
82dnl EFL_INIT()
83dnl Will AC_DEFINE() the following:
84dnl VMAJ = v_maj
85dnl VMIN = v_min
86dnl VMIC = v_mic
87dnl VREV = v_rev
88dnl Will AC_SUBST() the following:
89dnl VMAJ = v_maj
90dnl VMIN = v_min
91dnl VMIC = v_mic
92dnl EFL_LTLIBRARY_FLAGS="-no-undefined -version-info ..."
93dnl EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
94dnl Will define the following m4:
95dnl lt_cur = libtool 'current' field of libtool's -version-info
96dnl lt_rev = libtool 'revision' field of libtool's -version-info
97dnl lt_age = libtool 'age' field of libtool's -version-info
98AC_DEFUN([EFL_INIT],
99[dnl
100AC_REQUIRE([EFL_COLOR])dnl
101AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])dnl
102AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])dnl
103AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])dnl
104AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])dnl
105VMAJ=v_maj
106VMIN=v_min
107VMIC=v_mic
108AC_SUBST([VMAJ])dnl
109AC_SUBST([VMIN])dnl
110AC_SUBST([VMIC])dnl
111dnl
112dnl TODO: warning - lt_cur:
113dnl the previous code assumed v_maj + v_min, but this will be a problem when
114dnl we bump v_maj and reset v_min. 1 + 7 == 7 + 1, so if v_maj is bumped
115dnl we multiply it by 100.
116m4_define([lt_cur], m4_if(m4_cmp(v_maj, 1), 0, m4_eval(v_maj + v_min), m4_eval(v_maj * 100 + v_min)))dnl
117m4_define([lt_rev], v_mic)dnl
118m4_define([lt_age], v_min)dnl
119dnl
120EFL_LTLIBRARY_FLAGS="-no-undefined -version-info lt_cur:lt_rev:lt_age v_rel"
121AC_SUBST(EFL_LTLIBRARY_FLAGS)dnl
122EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
123AC_SUBST([EFL_LTMODULE_FLAGS])dnl
124AC_MSG_NOTICE([Initialized AC_PACKAGE_NAME (AC_PACKAGE_VERSION) development=dev_version v_rel])
125])
126
127dnl EFL_EVAL_PKGS(EFL)
128dnl does PKG_CHECK_MODULES() for given EFL
129AC_DEFUN([EFL_EVAL_PKGS],
130[dnl
131m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
132if test "x${requirements_pc_deps_[]m4_defn([DOWNEFL])}" != "x"; then
133 PKG_CHECK_MODULES([$1], [${requirements_pc_deps_[]m4_defn([DOWNEFL])}])
134fi
135m4_popdef([DOWNEFL])dnl
136])
137
138dnl EFL_INTERNAL_DEPEND_PKG(EFL, OTHEREFL)
139dnl Adds a pkg-config dependency on another EFL.
140AC_DEFUN([EFL_INTERNAL_DEPEND_PKG],
141[dnl
142m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
143m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
144dnl TODO: we need to fix the package config names for 2.0
145dnl TODO: and make them uniform in scheme.
146depname="$2"
147libdirname="m4_defn([DOWNOTHER])"
148libname="m4_defn([DOWNOTHER])"
149case "m4_defn([DOWNOTHER])" in
150 ethumb_client)
151 depname="ethumb_client"
152 ;;
153 efreet_mime)
154 libdirname="efreet"
155 ;;
156 efreet_trash)
157 libdirname="efreet"
158 ;;
159 ecore_x)
160 depname="ecore-x"
161 ;;
162 ecore_wl2)
163 depname="ecore-wl2"
164 ;;
165 ecore_fb)
166 depname="ecore-fb"
167 ;;
168 ecore_drm)
169 depname="ecore-drm"
170 ;;
171 ecore_cocoa)
172 depname="ecore-cocoa"
173 ;;
174 ecore_win32)
175 depname="ecore-win32"
176 ;;
177 ecore_drm2)
178 depname="ecore-drm2"
179 ;;
180 ecore_sdl)
181 depname="ecore-sdl"
182 ;;
183 ecore_file)
184 depname="ecore-file"
185 ;;
186esac
187requirements_pc_[]m4_defn([DOWNEFL])="${depname} >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
188requirements_cflags_[]m4_defn([DOWNEFL])="${requirements_cflags_[][]m4_defn([DOWNEFL])} -I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname}"
189requirements_internal_libs_[]m4_defn([DOWNEFL])="${requirements_internal_libs_[][]m4_defn([DOWNEFL])} lib/${libdirname}/lib${libname}.la"
190requirements_internal_deps_libs_[]m4_defn([DOWNEFL])="${requirements_internal_deps_libs_[][]m4_defn([DOWNEFL])} ${requirements_public_libs_[]m4_defn([DOWNOTHER])}"
191m4_popdef([DOWNOTHER])dnl
192m4_popdef([DOWNEFL])dnl
193])
194
195dnl EFL_PLATFORM_DEPEND(EFL, PLATFORM)
196dnl PLATFORM is one of: all, evil, escape, exotic
197AC_DEFUN([EFL_PLATFORM_DEPEND],
198[dnl
199m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
200case "m4_defn([DOWNOTHER])" in
201 all)
202 if test "x${efl_lib_optional_evil}" = "xyes"; then
203 EFL_INTERNAL_DEPEND_PKG([$1], [evil])
204 elif test "x${efl_lib_optional_escape}" = "xyes"; then
205 EFL_INTERNAL_DEPEND_PKG([$1], [escape])
206 elif test "x${efl_lib_optional_exotic}" = "xyes"; then
207 EFL_INTERNAL_DEPEND_PKG([$1], [exotic])
208 fi
209 ;;
210 *)
211 if test "x${efl_lib_optional_[]m4_defn([DOWNOTHER])}" = "xyes"; then
212 EFL_INTERNAL_DEPEND_PKG([$1], [$2])
213 fi
214 ;;
215esac
216m4_popdef([DOWNOTHER])dnl
217])
218
219dnl EFL_CRYPTO_DEPEND(EFL)
220dnl the given EFL will use/depend on system crypto settings
221AC_DEFUN([EFL_CRYPTO_DEPEND],
222[dnl
223m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
224requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_[][]m4_defn([DOWNEFL])} ${requirements_pc_crypto}"
225requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_[][]m4_defn([DOWNEFL])} ${requirements_pc_deps_crypto}"
226requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[][]m4_defn([DOWNEFL])} ${requirements_libs_crypto}"
227requirements_cflags_[]m4_defn([DOWNEFL])="${requirements_cflags_[][]m4_defn([DOWNEFL])} ${requirements_cflags_crypto}"
228m4_popdef([DOWNEFL])dnl
229])
230
231dnl EFL_DEPEND_PKG(EFL, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
232dnl Adds a pkg-config dependency to an efl, AC_DEFINE() HAVE_NAME,
233dnl and inserts dependencies in proper variables
234AC_DEFUN([EFL_DEPEND_PKG],
235[dnl
236m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
237m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
238m4_pushdef([UPNAME], m4_translit([$2], [-a-z], [_A-Z]))dnl
239m4_pushdef([DOWNNAME], m4_translit([$2], [-A-Z], [_a-z]))dnl
240
241 have_[]m4_defn([DOWNNAME])="no"
242
243 EFL_PKG_CHECK_STRICT([$3], [
244 AC_DEFINE([HAVE_]m4_defn([UPNAME]), [1], [Have `]m4_defn([DOWNNAME])[' pkg-config installed.])
245 requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_[][]m4_defn([DOWNEFL])} $3"
246 requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_[]m4_defn([DOWNEFL])} $3"
247 have_[]m4_defn([DOWNNAME])="yes"
248
249 $4
250
251 ], [$5])
252
253m4_popdef([DOWNNAME])
254m4_popdef([UPNAME])
255m4_popdef([DOWNEFL])
256m4_popdef([UPEFL])
257])
258
259dnl EFL_OPTIONAL_DEPEND_PKG(EFL, VARIABLE, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
260AC_DEFUN([EFL_OPTIONAL_DEPEND_PKG],
261[dnl
262m4_pushdef([DOWN], m4_translit([$3], [-A-Z], [_a-z]))dnl
263
264 have_[]m4_defn([DOWN])="no"
265 if test "x$2" = "xyes"; then
266 EFL_DEPEND_PKG([$1], [$3], [$4], [$5], [$6])
267 fi
268m4_popdef([DOWN])dnl
269])
270
271dnl EFL_OPTIONAL_INTERNAL_DEPEND_PKG(EFL, VARIABLE, NAME)
272AC_DEFUN([EFL_OPTIONAL_INTERNAL_DEPEND_PKG],
273[dnl
274 if test "x$2" = "xyes"; then
275 EFL_INTERNAL_DEPEND_PKG([$1], [$3])
276 fi
277])
278
279dnl EFL_ADD_LIBS(PKG, LIBS)
280dnl Add libraries that the EFL library will depend on
281dnl See EFL_DEPEND_PKG() for pkg-config version.
282AC_DEFUN([EFL_ADD_LIBS],
283[dnl
284m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
285requirements_libs_[]m4_defn([DOWN])="${requirements_libs_[]m4_defn([DOWN])} $2"
286m4_popdef([DOWN])dnl
287])
288
289dnl EFL_ADD_PUBLIC_LIBS(PKG, PUBLIC_LIBS)
290dnl Add libraries that the EFL library will depend on when used.
291dnl
292dnl Unlike EFL_ADD_LIBS(), that is only used when generating PKG,
293dnl this one is used when linking PKG to other libraries or applications.
294dnl
295dnl For instance if you use some other library in your header that user
296dnl inclues.
297AC_DEFUN([EFL_ADD_PUBLIC_LIBS],
298[dnl
299m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
300requirements_public_libs_[]m4_defn([DOWN])="${requirements_public_libs_[]m4_defn([DOWN])} $2"
301m4_popdef([DOWN])dnl
302])
303
304dnl EFL_ADD_CFLAGS(PKG, CFLAGS)
305dnl Add CFLAGS that the EFL library will use
306dnl See EFL_DEPEND_PKG() for pkg-config version.
307AC_DEFUN([EFL_ADD_CFLAGS],
308[dnl
309m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
310requirements_cflags_[]m4_defn([DOWN])="${requirements_cflags_[]m4_defn([DOWN])} $2"
311m4_popdef([DOWN])dnl
312])
313
314dnl EFL_LIB_START(PKG)
315dnl start the setup of an EFL library, defines variables and prints a notice
316dnl
317dnl Exports (AC_SUBST)
318dnl PKG_CFLAGS: what to use for CFLAGS
319dnl
320dnl PKG_LDFLAGS: what to use for LDFLAGS
321dnl
322dnl PKG_LIBS: what to use in automake's _LIBADD or _LDADD. Includes
323dnl everything else.
324dnl
325dnl PKG_INTERNAL_LIBS: all other EFL as lib/name/libname.la that this
326dnl package depend. Used in automake's _DEPENDENCIES.
327dnl
328dnl USE_PKG_LIBS: what to use in automake's _LIBADD or _LDADD when using
329dnl this PKG (PKG_LIBS + libpkg.la)
330dnl
331dnl USE_PKG_INTERNAL_LIBS: extends PKG_INTERNAL_LIBS with lib/pkg/libpkg.la
332dnl
333dnl requirements_pc_pkg: all pkg-config (pc) files used by this pkg,
334dnl includes internal EFL (used in 'Requires.private' in pkg.pc)
335dnl
336dnl requirements_libs_pkg: external libraries this package needs when
337dnl linking (used in 'Libs.private' in pkg.pc)
338dnl
339dnl requirements_public_libs_pkg: external libraries other packages need
340dnl when using this (used in 'Libs' in pkg.pc)
341dnl
342dnl requirements_cflags_pkg: what to use for CFLAGS (same as PKG_CFLAGS).
343dnl
344dnl Variables:
345dnl requirements_pc_deps_pkg: external pkg-config (pc) files used by this
346dnl pkg (used in EFL_EVAL_PKGS())
347dnl
348dnl requirements_internal_libs_pkg: all other EFL as lib/name/libname.la
349dnl that this package depend.
350dnl
351dnl requirements_internal_deps_libs_pkg: external libraries that are public
352dnl dependencies (due internal libs).
353dnl
354AC_DEFUN([EFL_LIB_START],
355[dnl
356m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
357m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
358
359requirements_internal_libs_[]m4_defn([DOWN])=""
360requirements_internal_deps_libs_[]m4_defn([DOWN])=""
361requirements_libs_[]m4_defn([DOWN])=""
362requirements_public_libs_[]m4_defn([DOWN])=""
363requirements_cflags_[]m4_defn([DOWN])=""
364requirements_pc_[]m4_defn([DOWN])=""
365requirements_pc_deps_[]m4_defn([DOWN])=""
366
367m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
368m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS}"
369USE_[]m4_defn([UP])_LIBS="${USE_[]m4_defn([UP])_LIBS}"
370USE_[]m4_defn([UP])_INTERNAL_LIBS="${USE_[]m4_defn([UP])_INTERNAL_LIBS}"
371m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS}"
372m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
373
374AC_SUBST([requirements_libs_]m4_defn([DOWN]))dnl
375AC_SUBST([requirements_public_libs_]m4_defn([DOWN]))dnl
376AC_SUBST([requirements_cflags_]m4_defn([DOWN]))dnl
377AC_SUBST([requirements_pc_]m4_defn([DOWN]))dnl
378AC_SUBST(m4_defn([UP])[_LIBS])dnl
379AC_SUBST(m4_defn([UP])[_INTERNAL_LIBS])dnl
380AC_SUBST([USE_]m4_defn([UP])[_LIBS])dnl
381AC_SUBST([USE_]m4_defn([UP])[_INTERNAL_LIBS])dnl
382AC_SUBST(m4_defn([UP])[_LDFLAGS])dnl
383AC_SUBST(m4_defn([UP])[_CFLAGS])dnl
384AC_MSG_NOTICE([Start $1 checks])dnl
385m4_popdef([UP])dnl
386m4_popdef([DOWN])dnl
387])
388
389dnl EFL_LIBS_SUBBUILD(TARGET, DEPENDENCIES)
390dnl Make TARGET contain all DEPENDENCIES relative to SUBDIR build
391AC_DEFUN([EFL_LIBS_SUBBUILD],
392[dnl
393$1=""
394_SUBDIR="../../"
395
396for dep in $2; do
397 case $dep in
398 lib*.la)
399 _DEPENDENCY=$_SUBDIR$dep
400 ;;
401 *)
402 _DEPENDENCY=$dep
403 ;;
404 esac
405
406 $1=${$1}" ${_DEPENDENCY}"
407done
408
409AC_SUBST([$1])
410])
411
412dnl EFL_LIB_END(PKG)
413dnl finishes the setup of an EFL library
414AC_DEFUN([EFL_LIB_END],
415[dnl
416m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
417m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
418
419libdirname="m4_defn([DOWN])"
420libname="m4_defn([DOWN])"
421
422m4_defn([UP])_LDFLAGS="${EFLALL_COV_LDFLAGS} ${EFLALL_LDFLAGS} ${m4_defn([UP])_LDFLAGS}"
423m4_defn([UP])_LIBS=" ${m4_defn([UP])_LDFLAGS} ${EFLALL_COV_LIBS} ${EFLALL_LIBS} ${m4_defn([UP])_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])} ${requirements_internal_deps_libs_[]m4_defn([DOWN])} ${requirements_public_libs_[]m4_defn([DOWN])} ${requirements_libs_[]m4_defn([DOWN])} ${requirements_libs_eflall} "
424m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])}"
425USE_[]m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} lib/${libdirname}/lib${libname}.la"
426USE_[]m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} lib/${libdirname}/lib${libname}.la"
427m4_defn([UP])_CFLAGS="${EFL_WINDOWS_VERSION_CFLAGS} ${EFLALL_COV_CFLAGS} ${EFLALL_CFLAGS} ${m4_defn([UP])_CFLAGS} -I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} -I\$(top_srcdir)/src/bindings/cxx/${libdirname} -I\$(top_builddir)/src/bindings/${libdirname} ${requirements_cflags_[]m4_defn([DOWN])} ${requirements_cflags_eflall}"
428requirements_pc_[]m4_defn([DOWN])="${requirements_pc_[]m4_defn([DOWN])} ${requirements_pc_eflall}"
429requirements_pc_deps_[]m4_defn([DOWN])="${requirements_pc_deps_[]m4_defn([DOWN])} ${requirements_pc_deps_eflall}"
430
431EFL_LIBS_SUBBUILD(m4_defn([UP])_SUBBUILD_LIBS, ${m4_defn([UP])_LIBS})
432EFL_LIBS_SUBBUILD(m4_defn([UP])_SUBBUILD_INTERNAL_LIBS, ${m4_defn([UP])_INTERNAL_LIBS})
433EFL_LIBS_SUBBUILD(USE_[]m4_defn([UP])_SUBBUILD_LIBS, "USE_[]m4_defn([UP])_LIBS")
434
435AC_MSG_NOTICE([Finished $1 checks])dnl
436m4_popdef([UP])dnl
437m4_popdef([DOWN])dnl
438])
439
440dnl EFL_LIB_START_OPTIONAL(PKG, TEST)
441dnl test if library should be build and then EFL_LIB_START()
442dnl must call EFL_LIB_END_OPTIONAL() to close it.
443AC_DEFUN([EFL_LIB_START_OPTIONAL],
444[dnl
445m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
446m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
447
448if $2; then
449 efl_lib_optional_[]m4_defn([DOWN])="yes"
450else
451 efl_lib_optional_[]m4_defn([DOWN])="no"
452 AC_MSG_NOTICE([Skipping $1 checks (disabled)])
453fi
454
455if test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"; then
456 EFL_LIB_START([$1])
457 AC_DEFINE([HAVE_]m4_defn([UP]), [1], [optional EFL $1 is enabled])
458dnl closed at EFL_LIB_END_OPTIONAL()
459m4_popdef([UP])dnl
460m4_popdef([DOWN])dnl
461])
462
463dnl EFL_LIB_END_OPTIONAL(PKG)
464dnl closes block started by EFL_LIB_START_OPTIONAL() and then
465dnl defines AM_CONDITIONAL([HAVE_PKG]) and AC_DEFINE([HAVE_PKG])
466AC_DEFUN([EFL_LIB_END_OPTIONAL],
467[dnl
468m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
469m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
470
471dnl close if started at EFL_LIB_START_OPTIONAL()
472 EFL_LIB_END([$1])
473fi
474
475AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"])dnl
476m4_popdef([UP])dnl
477m4_popdef([DOWN])dnl
478])
479
480dnl EFL_ADD_FEATURE(PKG, NAME, [VALUE])
481dnl if VALUE is not specified, will use ${have_name} instead.
482dnl
483dnl Defined Variables:
484dnl features_pkg
485AC_DEFUN([EFL_ADD_FEATURE],
486[dnl
487m4_pushdef([DOWNPKG], m4_translit([$1], [-A-Z], [_a-z]))dnl
488m4_pushdef([DOWNNAME], m4_translit([$2], [-A-Z], [_a-z]))dnl
489
490value="m4_if($3, , [${have_]m4_defn([DOWNNAME])[:-${want_]m4_defn([DOWNNAME])[}}], [$3])"
491case "${value}" in
492 yes)
493 tmp="${COLOR_YES}+$2${COLOR_RESET}"
494 ;;
495 no)
496 tmp="${COLOR_NO}-$2${COLOR_RESET}"
497 ;;
498 *)
499 tmp="${COLOR_OTHER}$2=${value}${COLOR_RESET}"
500 ;;
501esac
502if test -z "${features_[]m4_defn([DOWNPKG])}"; then
503 features_[]m4_defn([DOWNPKG])="${tmp}"
504else
505 features_[]m4_defn([DOWNPKG])="${features_[]m4_defn([DOWNPKG])} ${tmp}"
506fi
507m4_popdef([DOWNNAME])dnl
508m4_popdef([DOWNPKG])dnl
509])