source: rtems/c/src/aclocal/bspopts.m4 @ 4778c6e0

4.11
Last change on this file since 4778c6e0 was 95fe2fd, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 7, 2011 at 12:55:44 PM

2011-06-07 Sebastian Huber <sebastian.huber@…>

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