source: rtems/c/src/aclocal/bspopts.m4 @ 4d3e70f4

4.115
Last change on this file since 4d3e70f4 was 65c6425, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 17:24:46

Remove CVS Id Strings (manual edits after script)

These modifications were required by hand after running the script.
In some cases, the file names did not match patterns. In others,
the format of the file did not match any common patterns.

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