summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2014-01-24 10:28:05 +0900
committerCedric BAIL <cedric.bail@samsung.com>2014-01-24 10:29:22 +0900
commit9aa68bca91678dcd83de3e35be1a7121094d6ef7 (patch)
treeae0a50520bc3ffdae20792011865a34dfea4b90b /m4
parent30a3d9263379e430dae63e2256b400dbb946a940 (diff)
autotools: restore support of static compilation.
This should fix T599.
Diffstat (limited to 'm4')
-rw-r--r--m4/efl.m4447
1 files changed, 447 insertions, 0 deletions
diff --git a/m4/efl.m4 b/m4/efl.m4
new file mode 100644
index 000000000..e19770811
--- /dev/null
+++ b/m4/efl.m4
@@ -0,0 +1,447 @@
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
33m4_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
60if test "${want_color}" = "yes"; then
61 if test `echo -e x` = x; then
62 echoopt=-e
63 else
64 echoopt=
65 fi
66
67 COLOR_YES=`echo $echoopt "\033@<:@1;32m"`
68 COLOR_NO=`echo $echoopt "\033@<:@1;31m"`
69 COLOR_OTHER=`echo $echoopt "\033@<:@1;36m"`
70 COLOR_RESET=`echo $echoopt "\033@<:@0m"`
71
72else
73 COLOR_YES=""
74 COLOR_NO=""
75 COLOR_OTHER=""
76 COLOR_RESET=""
77fi
78])
79
80dnl EFL_INIT()
81dnl Will AC_DEFINE() the following:
82dnl VMAJ = v_maj
83dnl VMIN = v_min
84dnl VMIC = v_mic
85dnl VREV = v_rev
86dnl Will AC_SUBST() the following:
87dnl VMAJ = v_maj
88dnl VMIN = v_min
89dnl VMIC = v_mic
90dnl EFL_LTLIBRARY_FLAGS="-no-undefined -version-info ..."
91dnl EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
92dnl Will define the following m4:
93dnl lt_cur = libtool 'current' field of libtool's -version-info
94dnl lt_rev = libtool 'revision' field of libtool's -version-info
95dnl lt_age = libtool 'age' field of libtool's -version-info
96AC_DEFUN([EFL_INIT],
97[dnl
98AC_REQUIRE([EFL_COLOR])dnl
99AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])dnl
100AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])dnl
101AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])dnl
102AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])dnl
103VMAJ=v_maj
104VMIN=v_min
105VMIC=v_mic
106AC_SUBST([VMAJ])dnl
107AC_SUBST([VMIN])dnl
108AC_SUBST([VMIC])dnl
109dnl
110dnl TODO: warning - lt_cur:
111dnl the previous code assumed v_maj + v_min, but this will be a problem when
112dnl we bump v_maj and reset v_min. 1 + 7 == 7 + 1, so if v_maj is bumped
113dnl we multiply it by 100.
114m4_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
115m4_define([lt_rev], v_mic)dnl
116m4_define([lt_age], v_min)dnl
117dnl
118EFL_LTLIBRARY_FLAGS="-no-undefined -version-info lt_cur:lt_rev:lt_age v_rel"
119AC_SUBST(EFL_LTLIBRARY_FLAGS)dnl
120EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
121AC_SUBST([EFL_LTMODULE_FLAGS])dnl
122AC_MSG_NOTICE([Initialized AC_PACKAGE_NAME (AC_PACKAGE_VERSION) development=dev_version v_rel])
123])
124
125dnl EFL_EVAL_PKGS(EFL)
126dnl does PKG_CHECK_MODULES() for given EFL
127AC_DEFUN([EFL_EVAL_PKGS],
128[dnl
129m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
130if test "x${requirements_pc_deps_[]m4_defn([DOWNEFL])}" != "x"; then
131 PKG_CHECK_MODULES([$1], [${requirements_pc_deps_[]m4_defn([DOWNEFL])}])
132fi
133m4_popdef([DOWNEFL])dnl
134])
135
136dnl EFL_INTERNAL_DEPEND_PKG(EFL, OTHEREFL)
137dnl Adds a pkg-config dependency on another EFL.
138AC_DEFUN([EFL_INTERNAL_DEPEND_PKG],
139[dnl
140m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
141m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
142dnl TODO: we need to fix the package config names for 2.0
143dnl TODO: and make them uniform in scheme.
144depname="$2"
145libdirname="m4_defn([DOWNOTHER])"
146libname="m4_defn([DOWNOTHER])"
147case "m4_defn([DOWNOTHER])" in
148 ethumb_client)
149 depname="ethumb_client"
150 ;;
151esac
152requirements_pc_[]m4_defn([DOWNEFL])="${depname} >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
153requirements_cflags_[]m4_defn([DOWNEFL])="-I\$(top_srcdir)/src/lib/${libdirname} -I\$(top_builddir)/src/lib/${libdirname} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
154requirements_internal_libs_[]m4_defn([DOWNEFL])="lib/${libdirname}/lib${libname}.la ${requirements_internal_libs_[][]m4_defn([DOWNEFL])}"
155requirements_internal_deps_libs_[]m4_defn([DOWNEFL])="${requirements_public_libs_[]m4_defn([DOWNOTHER])} ${requirements_internal_deps_libs_[][]m4_defn([DOWNEFL])}"
156m4_popdef([DOWNOTHER])dnl
157m4_popdef([DOWNEFL])dnl
158])
159
160dnl EFL_PLATFORM_DEPEND(EFL, PLATFORM)
161dnl PLATFORM is one of: all, evil, escape, exotic
162AC_DEFUN([EFL_PLATFORM_DEPEND],
163[dnl
164m4_pushdef([DOWNOTHER], m4_translit([$2], [-A-Z], [_a-z]))dnl
165case "m4_defn([DOWNOTHER])" in
166 all)
167 if test "x${efl_lib_optional_evil}" = "xyes"; then
168 EFL_INTERNAL_DEPEND_PKG([$1], [evil])
169 elif test "x${efl_lib_optional_escape}" = "xyes"; then
170 EFL_INTERNAL_DEPEND_PKG([$1], [escape])
171 elif test "x${efl_lib_optional_exotic}" = "xyes"; then
172 EFL_INTERNAL_DEPEND_PKG([$1], [exotic])
173 fi
174 ;;
175 *)
176 if test "x${efl_lib_optional_[]m4_defn([DOWNOTHER])}" = "xyes"; then
177 EFL_INTERNAL_DEPEND_PKG([$1], [$2])
178 fi
179 ;;
180esac
181m4_popdef([DOWNOTHER])dnl
182])
183
184dnl EFL_CRYPTO_DEPEND(EFL)
185dnl the given EFL will use/depend on system crypto settings
186AC_DEFUN([EFL_CRYPTO_DEPEND],
187[dnl
188m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
189requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_crypto} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
190requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_crypto} ${requirements_pc_deps_[][]m4_defn([DOWNEFL])}"
191requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_crypto} ${requirements_libs_[][]m4_defn([DOWNEFL])}"
192requirements_cflags_[]m4_defn([DOWNEFL])="${requirements_cflags_crypto} ${requirements_cflags_[][]m4_defn([DOWNEFL])}"
193m4_popdef([DOWNEFL])dnl
194])
195
196dnl EFL_DEPEND_PKG(EFL, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
197dnl Adds a pkg-config dependency to an efl, AC_DEFINE() HAVE_NAME,
198dnl and inserts dependencies in proper variables
199AC_DEFUN([EFL_DEPEND_PKG],
200[dnl
201m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
202m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
203m4_pushdef([UPNAME], m4_translit([$2], [-a-z], [_A-Z]))dnl
204m4_pushdef([DOWNNAME], m4_translit([$2], [-A-Z], [_a-z]))dnl
205
206 have_[]m4_defn([DOWNNAME])="no"
207
208 EFL_PKG_CHECK_STRICT([$3], [
209 AC_DEFINE([HAVE_]m4_defn([UPNAME]), [1], [Have `]m4_defn([DOWNNAME])[' pkg-config installed.])
210 requirements_pc_[]m4_defn([DOWNEFL])="$3 ${requirements_pc_[][]m4_defn([DOWNEFL])}"
211 requirements_pc_deps_[]m4_defn([DOWNEFL])="$3 ${requirements_pc_deps_[]m4_defn([DOWNEFL])}"
212 have_[]m4_defn([DOWNNAME])="yes"
213
214 $4
215
216 ], [$5])
217
218m4_popdef([DOWNNAME])
219m4_popdef([UPNAME])
220m4_popdef([DOWNEFL])
221m4_popdef([UPEFL])
222])
223
224dnl EFL_OPTIONAL_DEPEND_PKG(EFL, VARIABLE, NAME, PACKAGE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
225AC_DEFUN([EFL_OPTIONAL_DEPEND_PKG],
226[dnl
227m4_pushdef([DOWN], m4_translit([$3], [-A-Z], [_a-z]))dnl
228
229 have_[]m4_defn([DOWN])="no"
230 if test "x$2" = "xyes"; then
231 EFL_DEPEND_PKG([$1], [$3], [$4], [$5], [$6])
232 fi
233m4_popdef([DOWN])dnl
234])
235
236dnl EFL_OPTIONAL_INTERNAL_DEPEND_PKG(EFL, VARIABLE, NAME)
237AC_DEFUN([EFL_OPTIONAL_INTERNAL_DEPEND_PKG],
238[dnl
239 if test "x$2" = "xyes"; then
240 EFL_INTERNAL_DEPEND_PKG([$1], [$3])
241 fi
242])
243
244dnl EFL_ADD_LIBS(PKG, LIBS)
245dnl Add libraries that the EFL library will depend on
246dnl See EFL_DEPEND_PKG() for pkg-config version.
247AC_DEFUN([EFL_ADD_LIBS],
248[dnl
249m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
250requirements_libs_[]m4_defn([DOWN])="${requirements_libs_[]m4_defn([DOWN])} $2"
251m4_popdef([DOWN])dnl
252])
253
254dnl EFL_ADD_PUBLIC_LIBS(PKG, PUBLIC_LIBS)
255dnl Add libraries that the EFL library will depend on when used.
256dnl
257dnl Unlike EFL_ADD_LIBS(), that is only used when generating PKG,
258dnl this one is used when linking PKG to other libraries or applications.
259dnl
260dnl For instance if you use some other library in your header that user
261dnl inclues.
262AC_DEFUN([EFL_ADD_PUBLIC_LIBS],
263[dnl
264m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
265requirements_public_libs_[]m4_defn([DOWN])="${requirements_public_libs_[]m4_defn([DOWN])} $2"
266m4_popdef([DOWN])dnl
267])
268
269dnl EFL_ADD_CFLAGS(PKG, CFLAGS)
270dnl Add CFLAGS that the EFL library will use
271dnl See EFL_DEPEND_PKG() for pkg-config version.
272AC_DEFUN([EFL_ADD_CFLAGS],
273[dnl
274m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
275requirements_cflags_[]m4_defn([DOWN])="${requirements_cflags_[]m4_defn([DOWN])} $2"
276m4_popdef([DOWN])dnl
277])
278
279dnl EFL_LIB_START(PKG)
280dnl start the setup of an EFL library, defines variables and prints a notice
281dnl
282dnl Exports (AC_SUBST)
283dnl PKG_CFLAGS: what to use for CFLAGS
284dnl
285dnl PKG_LDFLAGS: what to use for LDFLAGS
286dnl
287dnl PKG_LIBS: what to use in automake's _LIBADD or _LDADD. Includes
288dnl everything else.
289dnl
290dnl PKG_INTERNAL_LIBS: all other EFL as lib/name/libname.la that this
291dnl package depend. Used in automake's _DEPENDENCIES.
292dnl
293dnl USE_PKG_LIBS: what to use in automake's _LIBADD or _LDADD when using
294dnl this PKG (PKG_LIBS + libpkg.la)
295dnl
296dnl USE_PKG_INTERNAL_LIBS: extends PKG_INTERNAL_LIBS with lib/pkg/libpkg.la
297dnl
298dnl requirements_pc_pkg: all pkg-config (pc) files used by this pkg,
299dnl includes internal EFL (used in 'Requires.private' in pkg.pc)
300dnl
301dnl requirements_libs_pkg: external libraries this package needs when
302dnl linking (used in 'Libs.private' in pkg.pc)
303dnl
304dnl requirements_public_libs_pkg: external libraries other packages need
305dnl when using this (used in 'Libs' in pkg.pc)
306dnl
307dnl requirements_cflags_pkg: what to use for CFLAGS (same as PKG_CFLAGS).
308dnl
309dnl Variables:
310dnl requirements_pc_deps_pkg: external pkg-config (pc) files used by this
311dnl pkg (used in EFL_EVAL_PKGS())
312dnl
313dnl requirements_internal_libs_pkg: all other EFL as lib/name/libname.la
314dnl that this package depend.
315dnl
316dnl requirements_internal_deps_libs_pkg: external libraries that are public
317dnl dependencies (due internal libs).
318dnl
319AC_DEFUN([EFL_LIB_START],
320[dnl
321m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
322m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
323
324requirements_internal_libs_[]m4_defn([DOWN])=""
325requirements_internal_deps_libs_[]m4_defn([DOWN])=""
326requirements_libs_[]m4_defn([DOWN])=""
327requirements_public_libs_[]m4_defn([DOWN])=""
328requirements_cflags_[]m4_defn([DOWN])=""
329requirements_pc_[]m4_defn([DOWN])=""
330requirements_pc_deps_[]m4_defn([DOWN])=""
331
332m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
333m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS}"
334USE_[]m4_defn([UP])_LIBS="${USE_[]m4_defn([UP])_LIBS}"
335USE_[]m4_defn([UP])_INTERNAL_LIBS="${USE_[]m4_defn([UP])_INTERNAL_LIBS}"
336m4_defn([UP])_LDFLAGS="${m4_defn([UP])_LDFLAGS}"
337m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
338
339AC_SUBST([requirements_libs_]m4_defn([DOWN]))dnl
340AC_SUBST([requirements_public_libs_]m4_defn([DOWN]))dnl
341AC_SUBST([requirements_cflags_]m4_defn([DOWN]))dnl
342AC_SUBST([requirements_pc_]m4_defn([DOWN]))dnl
343AC_SUBST(m4_defn([UP])[_LIBS])dnl
344AC_SUBST(m4_defn([UP])[_INTERNAL_LIBS])dnl
345AC_SUBST([USE_]m4_defn([UP])[_LIBS])dnl
346AC_SUBST([USE_]m4_defn([UP])[_INTERNAL_LIBS])dnl
347AC_SUBST(m4_defn([UP])[_LDFLAGS])dnl
348AC_SUBST(m4_defn([UP])[_CFLAGS])dnl
349AC_MSG_NOTICE([Start $1 checks])dnl
350m4_popdef([UP])dnl
351m4_popdef([DOWN])dnl
352])
353
354dnl EFL_LIB_END(PKG)
355dnl finishes the setup of an EFL library
356AC_DEFUN([EFL_LIB_END],
357[dnl
358m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
359m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
360
361libdirname="m4_defn([DOWN])"
362libname="m4_defn([DOWN])"
363
364m4_defn([UP])_LDFLAGS="${EFL_COV_LDFLAGS} ${EFL_LDFLAGS} ${m4_defn([UP])_LDFLAGS}"
365m4_defn([UP])_LIBS=" ${m4_defn([UP])_LDFLAGS} ${EFL_COV_LIBS} ${EFL_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_efl} "
366m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} ${requirements_internal_libs_[]m4_defn([DOWN])}"
367USE_[]m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} lib/${libdirname}/lib${libname}.la"
368USE_[]m4_defn([UP])_INTERNAL_LIBS="${m4_defn([UP])_INTERNAL_LIBS} lib/${libdirname}/lib${libname}.la"
369m4_defn([UP])_CFLAGS="${EFL_COV_CFLAGS} ${EFL_CFLAGS} ${m4_defn([UP])_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"
370requirements_pc_[]m4_defn([DOWN])="${requirements_pc_[]m4_defn([DOWN])} ${requirements_pc_efl}"
371requirements_pc_deps_[]m4_defn([DOWN])="${requirements_pc_deps_[]m4_defn([DOWN])} ${requirements_pc_deps_efl}"
372
373AC_MSG_NOTICE([Finished $1 checks])dnl
374m4_popdef([UP])dnl
375m4_popdef([DOWN])dnl
376])
377
378dnl EFL_LIB_START_OPTIONAL(PKG, TEST)
379dnl test if library should be build and then EFL_LIB_START()
380dnl must call EFL_LIB_END_OPTIONAL() to close it.
381AC_DEFUN([EFL_LIB_START_OPTIONAL],
382[dnl
383m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
384m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
385
386if $2; then
387 efl_lib_optional_[]m4_defn([DOWN])="yes"
388else
389 efl_lib_optional_[]m4_defn([DOWN])="no"
390 AC_MSG_NOTICE([Skipping $1 checks (disabled)])
391fi
392
393if test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"; then
394 EFL_LIB_START([$1])
395 AC_DEFINE([HAVE_]m4_defn([UP]), [1], [optional EFL $1 is enabled])
396dnl closed at EFL_LIB_END_OPTIONAL()
397m4_popdef([UP])dnl
398m4_popdef([DOWN])dnl
399])
400
401dnl EFL_LIB_END_OPTIONAL(PKG)
402dnl closes block started by EFL_LIB_START_OPTIONAL() and then
403dnl defines AM_CONDITIONAL([HAVE_PKG]) and AC_DEFINE([HAVE_PKG])
404AC_DEFUN([EFL_LIB_END_OPTIONAL],
405[dnl
406m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
407m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
408
409dnl close if started at EFL_LIB_START_OPTIONAL()
410 EFL_LIB_END([$1])
411fi
412
413AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$efl_lib_optional_[]m4_defn([DOWN])" = "yes"])dnl
414m4_popdef([UP])dnl
415m4_popdef([DOWN])dnl
416])
417
418dnl EFL_ADD_FEATURE(PKG, NAME, [VALUE])
419dnl if VALUE is not specified, will use ${have_name} instead.
420dnl
421dnl Defined Variables:
422dnl features_pkg
423AC_DEFUN([EFL_ADD_FEATURE],
424[dnl
425m4_pushdef([DOWNPKG], m4_translit([$1], [-A-Z], [_a-z]))dnl
426m4_pushdef([DOWNNAME], m4_translit([$2], [-A-Z], [_a-z]))dnl
427
428value="m4_if($3, , [${have_]m4_defn([DOWNNAME])[:-${want_]m4_defn([DOWNNAME])[}}], [$3])"
429case "${value}" in
430 yes)
431 tmp="${COLOR_YES}+$2${COLOR_RESET}"
432 ;;
433 no)
434 tmp="${COLOR_NO}-$2${COLOR_RESET}"
435 ;;
436 *)
437 tmp="${COLOR_OTHER}$2=${value}${COLOR_RESET}"
438 ;;
439esac
440if test -z "${features_[]m4_defn([DOWNPKG])}"; then
441 features_[]m4_defn([DOWNPKG])="${tmp}"
442else
443 features_[]m4_defn([DOWNPKG])="${features_[]m4_defn([DOWNPKG])} ${tmp}"
444fi
445m4_popdef([DOWNNAME])dnl
446m4_popdef([DOWNPKG])dnl
447])