source: rtems/c/src/aclocal/bspopts.m4 @ 333a312

4.115
Last change on this file since 333a312 was 91d2e18, checked in by Ralf Corsépius <ralf.corsepius@…>, on 05/04/12 at 06:53:58

Remove CVS-Ids.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1dnl RTEMS_BSPOPTS_* - some autoconf voodoo to handle default values and
2dnl help-strings for per-BSP-environment variables.
3
4dnl To be used in bsp-configure scripts
5
6
7dnl Example:
8dnl
9dnl RTEMS_BSPOPTS_SET([foo],[bar],[0])
10dnl RTEMS_BSPOPTS_SET([foo],[baz*],[hello])
11dnl RTEMS_BSPOPTS_SET([foo],[*],[])
12dnl RTEMS_BSPOPTS_HELP([foo],[env. variable foo])
13dnl -> Add "0" as default value of variable "foo" for BSP "bar"
14dnl -> Add "hello" as default value of variable "foo" for all BSPs starting
15dnl with "baz" in their name.
16dnl -> Undefine foo as default clause for all BSP's.
17dnl
18dnl All this basically expands to a /bin/shell "case"-statement with
19dnl accompanying autoconf magic to propagate VAR to bspopts.h.
20
21
22dnl RTEMS_BSPOPTS_HELP(VAR,HELP-STRING)
23dnl Set up printing the HELP-STRING for bspopts.h's variable VAR and add
24dnl appropriate /bin/sh-magic to "configure" to have VAR set up.
25
26AC_DEFUN([RTEMS_BSPOPTS_HELP],[
27RTEMS_ARG_VAR([$1],[$2])
28m4_ifdef([_$1],[
29case "${RTEMS_BSP}" in
30_$1[]dnl
31esac],[])
32if test -n "[$]{$1}"; then[]dnl
33AC_DEFINE_UNQUOTED([$1],
34  [[$]$1],
35  [$2])dnl
36fi
37])
38
39dnl RTEMS_BSPOPTS_SET(VAR,BSP,DEFAULT)
40dnl Set up a value DEFAULT to be used as default value for variable VAR for
41dnl BSP in RTEMS_BSPOPTS_HELP.
42
43dnl MUST be used in front of exactly _one_ corresponding RTEMS_BSPOPTS_HELP
44
45AC_DEFUN([RTEMS_BSPOPTS_SET],[dnl
46m4_append([_$1],
47[$2 )
48  $1=[$]{$1-$3} ;;
49])
50])
51
52
53dnl RTEMS_ARG_VAR(VAR,HELP-STRING)
54dnl An internal macros to have RTEMS_BSPOPTS_HELP's help string pretty
55dnl printed with configure --help.
56dnl Stripped down version of autoconf-2.52's AC_ARG_VAR.
57
58AC_DEFUN([RTEMS_ARG_VAR],
59[
60m4_expand_once([m4_divert_once([HELP_VAR],
61[AS_HELP_STRING([$1],[$2],              )])],
62      [$0($1)])dnl
63])
64
65AC_DEFUN(
66[RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED],
67[RTEMS_BSPOPTS_SET([BSP_DATA_CACHE_ENABLED],[$1],[$2])])
68
69AC_DEFUN(
70[RTEMS_BSPOPTS_HELP_DATA_CACHE_ENABLED],
71[RTEMS_BSPOPTS_HELP([BSP_DATA_CACHE_ENABLED],
72[enables the data cache, if defined to a value other than zero])])
73
74AC_DEFUN(
75[RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED],
76[RTEMS_BSPOPTS_SET([BSP_INSTRUCTION_CACHE_ENABLED],[$1],[$2])])
77
78AC_DEFUN(
79[RTEMS_BSPOPTS_HELP_INSTRUCTION_CACHE_ENABLED],
80[RTEMS_BSPOPTS_HELP([BSP_INSTRUCTION_CACHE_ENABLED],
81[enables the instruction cache, if defined to a value other than zero])])
Note: See TracBrowser for help on using the repository browser.