OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [aclocal/] [bspopts.m4] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
dnl bspopts.m4,v 1.1 2001/11/14 18:57:26 joel Exp
2
dnl
3
 
4
dnl RTEMS_BSPOPTS_* - some autoconf voodoo to handle default values and
5
dnl help-strings for per-BSP-environment variables.
6
 
7
dnl To be used in bsp-configure scripts
8
 
9
 
10
dnl Example:
11
dnl
12
dnl RTEMS_BSPOPTS_SET([foo],[bar],[0])
13
dnl RTEMS_BSPOPTS_SET([foo],[baz*],[hello])
14
dnl RTEMS_BSPOPTS_SET([foo],[*],[])
15
dnl RTEMS_BSPOPTS_HELP([foo],[env. variable foo])
16
dnl -> Add "0" as default value of variable "foo" for BSP "bar"
17
dnl -> Add "hello" as default value of variable "foo" for all BSPs starting
18
dnl with "baz" in their name.
19
dnl -> Undefine foo as default clause for all BSP's.
20
dnl
21
dnl All this basically expands to a /bin/shell "case"-statement with
22
dnl accompanying autoconf magic to propagate VAR to bspopts.h.
23
 
24
 
25
dnl RTEMS_BSPOPTS_HELP(VAR,HELP-STRING)
26
dnl Set up printing the HELP-STRING for bspopts.h's variable VAR and add
27
dnl appropriate /bin/sh-magic to "configure" to have VAR set up.
28
 
29
AC_DEFUN([RTEMS_BSPOPTS_HELP],[
30
RTEMS_ARG_VAR([$1],[$2])
31
m4_ifdef([_$1],[
32
case ${RTEMS_BSP} in
33
_$1[]dnl
34
esac],[])
35
if test -n "[$]{$1}"; then[]dnl
36
AC_DEFINE_UNQUOTED([$1],
37
  [[$]$1],
38
  [$2])dnl
39
fi
40
])
41
 
42
dnl RTEMS_BSPOPTS_SET(VAR,BSP,DEFAULT)
43
dnl Set up a value DEFAULT to be used as default value for variable VAR for
44
dnl BSP in RTEMS_BSPOPTS_HELP.
45
 
46
dnl MUST be use in front of exactly _one_ corresponding RTEMS_BSPOPTS_HELP
47
 
48
AC_DEFUN([RTEMS_BSPOPTS_SET],[dnl
49
m4_append([_$1],
50
[$2 )
51
  $1=[$]{$1-$3} ;;
52
])
53
])
54
 
55
 
56
dnl RTEMS_ARG_VAR(VAR,HELP-STRING)
57
dnl An internal macros to have RTEMS_BSPOPTS_HELP's help string pretty
58
dnl printed with configure --help.
59
dnl Stripped down version of autoconf-2.52's AC_ARG_VAR.
60
 
61
AC_DEFUN([RTEMS_ARG_VAR],
62
[
63
m4_expand_once([m4_divert_once([HELP_VAR],
64
[AC_HELP_STRING([$1], [$2], [              ])])],
65
      [$0($1)])dnl
66
])

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.