source: rtems/cpukit/acinclude.m4

Last change on this file was 2c367617, checked in by Sebastian Huber <sebastian.huber@…>, on 10/05/20 at 09:58:11

build: Add testopts.h to configure script

Close #4120.

  • Property mode set to 100644
File size: 3.1 KB
RevLine 
[3da33bf8]1# RTEMS_CPUOPT(NAME,CONDITION,VALUE,EXPLANATION)
2
[3058695]3AC_DEFUN([_RTEMS_CPUOPT_INIT],[
4AC_BEFORE([_RTEMS_CPUOPT])
5cat >>cpuopts.tmp <<\_ACEOF
6/**
7 * @file rtems/score/cpuopts.h
8 */
9
10/* target cpu dependent options file */
11/* automatically generated -- DO NOT EDIT!! */
12#ifndef _RTEMS_SCORE_CPUOPTS_H
13#define _RTEMS_SCORE_CPUOPTS_H
14_ACEOF
15])
16
17AC_DEFUN([RTEMS_CPUOPT],[
18AC_REQUIRE([_RTEMS_CPUOPT_INIT])
19AC_BEFORE([_RTEMS_CPUOPT_FINI])
[3da33bf8]20  if $2; then
[10ae124c]21cat >>cpuopts.tmp <<_ACEOF
[1bcbe41]22
23/* $4 */
24#define $1 $3
25_ACEOF
26## FIXME: Duplicate the define to the autoheader
27## Sanity check - Should be removed in future
[a59e6c0]28    AC_DEFINE_UNQUOTED([$1],[$3],[$4])
[3da33bf8]29  else
[1bcbe41]30cat >>cpuopts.tmp <<\_ACEOF
31
32/* $4 */
33/* #undef $1 */
34_ACEOF
35  fi
[3da33bf8]36])
[3058695]37
38AC_DEFUN([_RTEMS_CPUOPT_FINI],[
[2afb22b]39AC_REQUIRE([RTEMS_BUILD_TOP])
[3058695]40cat >>cpuopts.tmp <<\_ACEOF
41
42#endif /* _RTEMS_SCORE_CPUOPTS_H */
43_ACEOF
44
[2afb22b]45AS_MKDIR_P(${RTEMS_BUILD_ROOT}/include/rtems/score)
46AS_IF([test -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h],
[05aec0c]47[
[2afb22b]48  AS_IF([cmp -s ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
[05aec0c]49  [
[2afb22b]50    AC_MSG_NOTICE([${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h is unchanged])
[05aec0c]51    rm -f cpuopts.tmp
52  ],[
[2afb22b]53    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h])
54    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
55    mv cpuopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
[05aec0c]56  ])
57],[
[2afb22b]58    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h])
59    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
60    mv cpuopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/score/cpuopts.h
[05aec0c]61])
62])
[2c367617]63
64# RTEMS_TESTOPT(NAME,CONDITION,VALUE,EXPLANATION)
65
66AC_DEFUN([_RTEMS_TESTOPT_INIT],[
67AC_BEFORE([_RTEMS_TESTOPT])
68cat >>testopts.tmp <<\_ACEOF
69/**
70 * @file rtems/testopts.h
71 */
72
73/* target test dependent options file */
74/* automatically generated -- DO NOT EDIT!! */
75#ifndef _RTEMS_TESTOPTS_H
76#define _RTEMS_TESTOPTS_H
77_ACEOF
78])
79
80AC_DEFUN([RTEMS_TESTOPT],[
81AC_REQUIRE([_RTEMS_TESTOPT_INIT])
82AC_BEFORE([_RTEMS_TESTOPT_FINI])
83  if $2; then
84cat >>testopts.tmp <<_ACEOF
85
86/* $4 */
87#define $1 $3
88_ACEOF
89## FIXME: Duplicate the define to the autoheader
90## Sanity check - Should be removed in future
91    AC_DEFINE_UNQUOTED([$1],[$3],[$4])
92  else
93cat >>testopts.tmp <<\_ACEOF
94
95/* $4 */
96/* #undef $1 */
97_ACEOF
98  fi
99])
100
101AC_DEFUN([_RTEMS_TESTOPT_FINI],[
102AC_REQUIRE([RTEMS_BUILD_TOP])
103cat >>testopts.tmp <<\_ACEOF
104
105#endif /* _RTEMS_TESTOPTS_H */
106_ACEOF
107
108AS_MKDIR_P(${RTEMS_BUILD_ROOT}/include/rtems)
109AS_IF([test -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h],
110[
111  AS_IF([cmp -s ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h testopts.tmp 2>/dev/null],
112  [
113    AC_MSG_NOTICE([${RTEMS_BUILD_ROOT}/include/rtems/testopts.h is unchanged])
114    rm -f testopts.tmp
115  ],[
116    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h])
117    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
118    mv testopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
119  ])
120],[
121    AC_MSG_NOTICE([creating ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h])
122    rm -f ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
123    mv testopts.tmp ${RTEMS_BUILD_ROOT}/include/rtems/testopts.h
124])
125])
Note: See TracBrowser for help on using the repository browser.