1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id$ |
---|
4 | |
---|
5 | AC_PREREQ(2.57) |
---|
6 | AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) |
---|
7 | AC_CONFIG_SRCDIR([score]) |
---|
8 | RTEMS_TOP(..) |
---|
9 | |
---|
10 | RTEMS_CANONICAL_TARGET_CPU |
---|
11 | |
---|
12 | AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.7.2]) |
---|
13 | AM_MAINTAINER_MODE |
---|
14 | |
---|
15 | RTEMS_ENABLE_MULTILIB |
---|
16 | RTEMS_ENABLE_MULTIPROCESSING |
---|
17 | RTEMS_ENABLE_POSIX |
---|
18 | RTEMS_ENABLE_ITRON |
---|
19 | RTEMS_ENABLE_INLINES |
---|
20 | RTEMS_ENABLE_RTEMS_DEBUG |
---|
21 | RTEMS_ENABLE_NETWORKING |
---|
22 | |
---|
23 | RTEMS_ENV_RTEMSCPU |
---|
24 | RTEMS_CHECK_RTEMS_DEBUG |
---|
25 | |
---|
26 | RTEMS_CHECK_CPU |
---|
27 | RTEMS_CANONICAL_HOST |
---|
28 | |
---|
29 | RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) |
---|
30 | RTEMS_CANONICALIZE_TOOLS |
---|
31 | AC_PROG_RANLIB |
---|
32 | |
---|
33 | # FIXME: For the moment, no reason to check for ada |
---|
34 | # RTEMS_PROG_GNAT |
---|
35 | |
---|
36 | RTEMS_CHECK_NEWLIB |
---|
37 | |
---|
38 | RTEMS_CHECK_MULTIPROCESSING |
---|
39 | RTEMS_CHECK_POSIX_API |
---|
40 | RTEMS_CHECK_ITRON_API |
---|
41 | RTEMS_CHECK_NETWORKING |
---|
42 | |
---|
43 | # If RTEMS macros are enabled, then use them. Otherwise, use inlines. |
---|
44 | AS_IF([test "$RTEMS_USE_MACROS" = "yes"], |
---|
45 | [INLINEdir="macros"], |
---|
46 | [INLINEdir="inline"]) |
---|
47 | AC_SUBST(INLINEdir) |
---|
48 | AM_CONDITIONAL(INLINE,test x"$INLINEdir" = x"inline" ) |
---|
49 | AM_CONDITIONAL(MACROS,test x"$INLINEdir" = x"macros" ) |
---|
50 | AM_CONDITIONAL(HAS_MP,test x"$HAS_MP" = x"yes" ) |
---|
51 | |
---|
52 | AC_DEFINE(RTEMS_VERSION,["rtems-][_RTEMS_VERSION]["],[RTEMS version string]) |
---|
53 | |
---|
54 | AM_CONDITIONAL(HAS_POSIX,test x"$HAS_POSIX_API" = x"yes") |
---|
55 | AM_CONDITIONAL(HAS_ITRON,test x"$HAS_ITRON_API" = x"yes") |
---|
56 | AM_CONDITIONAL(HAS_NETWORKING,test x"$HAS_NETWORKING" = x"yes") |
---|
57 | |
---|
58 | AS_IF([test x"$HAS_POSIX_API" = x"yes"], |
---|
59 | [AC_CONFIG_SUBDIRS([posix])] |
---|
60 | ) |
---|
61 | AS_IF([test x"$HAS_ITRON_API" = x"yes"], |
---|
62 | [AC_CONFIG_SUBDIRS(itron)] |
---|
63 | ) |
---|
64 | RTEMS_CPU_SUBDIRS([score/cpu]) |
---|
65 | # FIXME: All ports should have a libscorecpu.a - But the powerpc doesn't! |
---|
66 | AM_CONDITIONAL([LIBSCORECPU], |
---|
67 | [test -f "${srcdir}/score/cpu/${RTEMS_CPU}/cpu.c"]) |
---|
68 | |
---|
69 | AC_CONFIG_SUBDIRS([libcsupport]) |
---|
70 | AS_IF([test x"$HAS_NETWORKING" = x"yes"],[ |
---|
71 | AC_CONFIG_SUBDIRS(libnetworking) |
---|
72 | ## FIXME: Should better use a feature-based test |
---|
73 | AC_MSG_CHECKING([whether CPU supports librpc]) |
---|
74 | case "$RTEMS_CPU" in |
---|
75 | c4x ) LIBRPC=no;; |
---|
76 | or32 ) LIBRPC=no;; |
---|
77 | * ) LIBRPC=yes;; |
---|
78 | esac |
---|
79 | AC_MSG_RESULT([$LIBRPC]) |
---|
80 | AS_IF([test "$LIBRPC" = "yes"], |
---|
81 | [AC_CONFIG_SUBDIRS([librpc]) |
---|
82 | ]) |
---|
83 | ]) |
---|
84 | AM_CONDITIONAL(LIBRPC,[test "$LIBRPC" = "yes"]) |
---|
85 | |
---|
86 | AC_ARG_ENABLE([ada], |
---|
87 | [AC_HELP_STRING([--enable-ada],[enable ada support])], |
---|
88 | [case "${enable_ada}" in |
---|
89 | yes) ;; |
---|
90 | no) ;; |
---|
91 | *) AC_MSG_ERROR([bad value ${enable_ada} for --enable-ada]) ;; |
---|
92 | esac],[enable_ada=no]) |
---|
93 | |
---|
94 | RTEMS_DEFINE_POSIX_API |
---|
95 | RTEMS_DEFINE_ITRON_API |
---|
96 | RTEMS_DEFINE_MULTIPROCESSING |
---|
97 | |
---|
98 | # HACK: We should use a feature-based configuration. |
---|
99 | AS_IF([test x"${RTEMS_CPU}" = x"unix"],[ |
---|
100 | AC_DEFINE_UNQUOTED([RTEMS_UNIX],[1],[to indicate RTEMS unix]) |
---|
101 | # HACK: silently accept --enable-unixlib |
---|
102 | test -n "${enable_unixlib}" || enable_unixlib="yes" |
---|
103 | ]) |
---|
104 | |
---|
105 | AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"]) |
---|
106 | |
---|
107 | AS_IF([test x"${enable_unixlib}" = x"yes"], |
---|
108 | [AC_DEFINE_UNQUOTED([RTEMS_UNIXLIB],[1], |
---|
109 | [to indicate RTEMS using RTEMS's unixlib])] |
---|
110 | ) |
---|
111 | |
---|
112 | |
---|
113 | AM_CONFIG_HEADER([score/include/rtems/score/cpuopts-tmp.h],[ |
---|
114 | echo "/* target cpu dependent options file */" >$tmp/config.h |
---|
115 | echo "/* automatically generated -- DO NOT EDIT!! */" >>$tmp/config.h |
---|
116 | echo >>$tmp/config.h |
---|
117 | echo "#ifndef __CPU_OPTIONS_h" >>$tmp/config.h |
---|
118 | echo "#define __CPU_OPTIONS_h" >>$tmp/config.h |
---|
119 | echo >>$tmp/config.h |
---|
120 | sed -e '/.*PACKAGE.*/d' score/include/rtems/score/cpuopts-tmp.h >> $tmp/config.h |
---|
121 | echo >>$tmp/config.h |
---|
122 | echo "#endif" >>$tmp/config.h |
---|
123 | AS_IF([cmp -s score/include/rtems/score/cpuopts.h $tmp/config.h 2>/dev/null], |
---|
124 | [AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged]) |
---|
125 | rm -f $tmp/config.h], |
---|
126 | [AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h]) |
---|
127 | rm -f score/include/rtems/score/cpuopts.h |
---|
128 | mv $tmp/config.h score/include/rtems/score/cpuopts.h]) |
---|
129 | ]) |
---|
130 | |
---|
131 | AC_ENABLE_MULTILIB([Makefile],[..]) |
---|
132 | |
---|
133 | ## HACK: Add a define to cpuopts.h to indicate using multilibs |
---|
134 | ## Can be applied to produce compiler errors if using |
---|
135 | ## multilib-incompatible settings somewhere else (eg. bspopts.h). |
---|
136 | AS_IF([test x"${enable_multilib}" = x"yes"],[ |
---|
137 | AC_DEFINE_UNQUOTED([RTEMS_MULTILIBS],[1],[using multilib'ed RTEMS]) |
---|
138 | ]) |
---|
139 | |
---|
140 | AC_CONFIG_SUBDIRS([libmisc]) |
---|
141 | |
---|
142 | AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \ |
---|
143 | && test x"$HAS_POSIX_API" = x"yes"]) |
---|
144 | |
---|
145 | # Explicitly list all Makefiles here |
---|
146 | AC_CONFIG_FILES([Makefile |
---|
147 | include/Makefile |
---|
148 | rtems/Makefile |
---|
149 | sapi/Makefile |
---|
150 | score/Makefile |
---|
151 | score/cpu/Makefile |
---|
152 | ]) |
---|
153 | |
---|
154 | AC_CONFIG_FILES([libblock/Makefile]) |
---|
155 | |
---|
156 | AC_CONFIG_FILES([libfs/Makefile |
---|
157 | libfs/src/Makefile |
---|
158 | libfs/src/imfs/Makefile |
---|
159 | libfs/src/dosfs/Makefile]) |
---|
160 | |
---|
161 | AC_CONFIG_FILES([ada/Makefile]) |
---|
162 | |
---|
163 | AC_CONFIG_FILES([wrapup/Makefile]) |
---|
164 | |
---|
165 | AC_OUTPUT |
---|