summaryrefslogtreecommitdiffstats
path: root/cpukit/acinclude.m4
blob: 54d1a39a4b1fd770a8b6919579eed2ba72b01699 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# RTEMS_CPUOPT(NAME,CONDITION,VALUE,EXPLANATION)

AC_DEFUN([_RTEMS_CPUOPT_INIT],[
AC_BEFORE([_RTEMS_CPUOPT])
cat >>cpuopts.tmp <<\_ACEOF
/**
 * @file rtems/score/cpuopts.h
 */

/* target cpu dependent options file */
/* automatically generated -- DO NOT EDIT!! */
#ifndef _RTEMS_SCORE_CPUOPTS_H
#define _RTEMS_SCORE_CPUOPTS_H
_ACEOF
])

AC_DEFUN([RTEMS_CPUOPT],[
AC_REQUIRE([_RTEMS_CPUOPT_INIT])
AC_BEFORE([_RTEMS_CPUOPT_FINI])
  if $2; then
cat >>cpuopts.tmp <<_ACEOF

/* $4 */
#define $1 $3
_ACEOF
## FIXME: Duplicate the define to the autoheader
## Sanity check - Should be removed in future
    AC_DEFINE_UNQUOTED([$1],[$3],[$4])
  else
cat >>cpuopts.tmp <<\_ACEOF

/* $4 */
/* #undef $1 */
_ACEOF
  fi
])

AC_DEFUN([_RTEMS_CPUOPT_FINI],[
AC_REQUIRE([RTEMS_BUILD_TOP])
cat >>cpuopts.tmp <<\_ACEOF

#endif /* _RTEMS_SCORE_CPUOPTS_H */
_ACEOF

AS_MKDIR_P(${RTEMS_BUILD_ROOT}/include/rtems/score)
AS_IF([test -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h],
[
  AS_IF([cmp -s ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
  [ 
    AC_MSG_NOTICE([${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h is unchanged])
    rm -f cpuopts.tmp
  ],[
    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h])
    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
    mv cpuopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
  ])
],[
    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h])
    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
    mv cpuopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
])
])

# RTEMS_TESTOPT(NAME,CONDITION,VALUE,EXPLANATION)

AC_DEFUN([_RTEMS_TESTOPT_INIT],[
AC_BEFORE([_RTEMS_TESTOPT])
cat >>testopts.tmp <<\_ACEOF
/**
 * @file rtems/testopts.h
 */

/* target test dependent options file */
/* automatically generated -- DO NOT EDIT!! */
#ifndef _RTEMS_TESTOPTS_H
#define _RTEMS_TESTOPTS_H
_ACEOF
])

AC_DEFUN([RTEMS_TESTOPT],[
AC_REQUIRE([_RTEMS_TESTOPT_INIT])
AC_BEFORE([_RTEMS_TESTOPT_FINI])
  if $2; then
cat >>testopts.tmp <<_ACEOF

/* $4 */
#define $1 $3
_ACEOF
## FIXME: Duplicate the define to the autoheader
## Sanity check - Should be removed in future
    AC_DEFINE_UNQUOTED([$1],[$3],[$4])
  else
cat >>testopts.tmp <<\_ACEOF

/* $4 */
/* #undef $1 */
_ACEOF
  fi
])

AC_DEFUN([_RTEMS_TESTOPT_FINI],[
AC_REQUIRE([RTEMS_BUILD_TOP])
cat >>testopts.tmp <<\_ACEOF

#endif /* _RTEMS_TESTOPTS_H */
_ACEOF

AS_MKDIR_P(${RTEMS_BUILD_ROOT}/include/rtems)
AS_IF([test -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h],
[
  AS_IF([cmp -s ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h testopts.tmp 2>/dev/null],
  [
    AC_MSG_NOTICE([${RTEMS_BUILD_ROOT}/include/rtems/testopts.h is unchanged])
    rm -f testopts.tmp
  ],[
    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h])
    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
    mv testopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
  ])
],[
    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h])
    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
    mv testopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
])
])