1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id$ |
---|
4 | |
---|
5 | AC_PREREQ(2.60) |
---|
6 | AC_INIT([rtems-c-src],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) |
---|
7 | AC_CONFIG_SRCDIR([optman]) |
---|
8 | RTEMS_TOP(../..) |
---|
9 | |
---|
10 | RTEMS_ENABLE_CXX |
---|
11 | RTEMS_ENABLE_NETWORKING |
---|
12 | |
---|
13 | RTEMS_CANONICAL_TARGET_CPU |
---|
14 | |
---|
15 | AM_INIT_AUTOMAKE([no-define subdir-objects no-exeext foreign 1.10]) |
---|
16 | AM_MAINTAINER_MODE |
---|
17 | |
---|
18 | RTEMS_ENABLE_MULTILIB |
---|
19 | RTEMS_ENABLE_MULTIPROCESSING |
---|
20 | RTEMS_ENV_RTEMSBSP |
---|
21 | |
---|
22 | RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) |
---|
23 | |
---|
24 | RTEMS_CHECK_NETWORKING(RTEMS_BSP) |
---|
25 | RTEMS_CHECK_POSIX_API(RTEMS_BSP) |
---|
26 | |
---|
27 | AC_MSG_NOTICE([setting up make/custom]) |
---|
28 | |
---|
29 | AS_MKDIR_P([make/custom]) |
---|
30 | AM_SET_DEPDIR |
---|
31 | test -d ${DEPDIR} || mkdir ${DEPDIR} |
---|
32 | |
---|
33 | rm -f ${DEPDIR}/cfg.P |
---|
34 | echo "# Do not edit - automatically generated by" > ${DEPDIR}/cfg.P |
---|
35 | echo "# $0" >> ${DEPDIR}/cfg.P |
---|
36 | |
---|
37 | # Collect and copy the BSP's make/custom/*.cfg files from the toplevel make |
---|
38 | # directory into the build tree's <bsp>/make/custom subdirectories |
---|
39 | CUSTOM_CFG_FILES= |
---|
40 | f="${RTEMS_BSP}.cfg" |
---|
41 | while test -n "$f"; do |
---|
42 | cfg_file= |
---|
43 | _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file) |
---|
44 | if test -n "${cfg_file}"; then |
---|
45 | cp ${cfg_file} make/custom/$f |
---|
46 | echo "make/custom/$f: ${cfg_file}" >> ${DEPDIR}/cfg.P |
---|
47 | echo " cp ${cfg_file} make/custom/$f" >> ${DEPDIR}/cfg.P |
---|
48 | CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f" |
---|
49 | f=`grep "^include.*make/custom" ${cfg_file} \ |
---|
50 | | sed \ |
---|
51 | -e 's%^.*custom\/%%' \ |
---|
52 | -e s%\$\(RTEMS_HOST\)%${RTEMS_HOST}% \ |
---|
53 | -e 's%default\.cfg%%'`; |
---|
54 | else break; fi; |
---|
55 | done |
---|
56 | cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg |
---|
57 | |
---|
58 | AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache]) |
---|
59 | ${MAKE-make} -f ${srcdir}/make/bsp.mak \ |
---|
60 | RTEMS_BSP=${RTEMS_BSP} \ |
---|
61 | RTEMS_HOST=${RTEMS_HOST} \ |
---|
62 | RTEMS_ROOT=. make/${RTEMS_BSP}.cache |
---|
63 | |
---|
64 | # Read back the cache |
---|
65 | AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL], |
---|
66 | [. ./make/${RTEMS_BSP}.cache]) |
---|
67 | RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL |
---|
68 | AC_SUBST(RTEMS_CPU_MODEL) |
---|
69 | test -n "${RTEMS_CPU_MODEL}" && \ |
---|
70 | ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'" |
---|
71 | |
---|
72 | AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY], |
---|
73 | [. ./make/${RTEMS_BSP}.cache]) |
---|
74 | RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY |
---|
75 | AC_SUBST(RTEMS_BSP_FAMILY) |
---|
76 | test -n "${RTEMS_BSP_FAMILY}" && \ |
---|
77 | ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'" |
---|
78 | |
---|
79 | AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS], |
---|
80 | [. ./make/${RTEMS_BSP}.cache]) |
---|
81 | CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS |
---|
82 | |
---|
83 | AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V], |
---|
84 | [. ./make/${RTEMS_BSP}.cache]) |
---|
85 | CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V |
---|
86 | |
---|
87 | CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}" |
---|
88 | AS_IF([test x"${CFLAGS}" != x" "],[ |
---|
89 | ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"]) |
---|
90 | |
---|
91 | RTEMS_PROG_CC_FOR_TARGET |
---|
92 | AM_PROG_CC_C_O |
---|
93 | RTEMS_PROG_CCAS |
---|
94 | RTEMS_CANONICALIZE_TOOLS |
---|
95 | |
---|
96 | RTEMS_CHECK_GCC_WEAK |
---|
97 | |
---|
98 | AC_SUBST(CUSTOM_CFG_FILES) |
---|
99 | AC_SUBST(cfg_dir) |
---|
100 | |
---|
101 | RTEMS_CHECK_MULTIPROCESSING |
---|
102 | |
---|
103 | BSP_SUBDIRS= |
---|
104 | ## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled |
---|
105 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
106 | [cpukit],[../../cpukit], |
---|
107 | ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \ |
---|
108 | '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \ |
---|
109 | '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \ |
---|
110 | ], |
---|
111 | [test x"$multilib" = xno]) |
---|
112 | |
---|
113 | ## Note: the order of the directories below is essential |
---|
114 | AC_CONFIG_SUBDIRS([make]) |
---|
115 | BSP_SUBDIRS="$BSP_SUBDIRS make" |
---|
116 | |
---|
117 | RTEMS_CPU_SUBDIRS(lib/libcpu) |
---|
118 | if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then |
---|
119 | libcpu_cpu_subdir="${RTEMS_CPU}" |
---|
120 | else |
---|
121 | libcpu_cpu_subdir= |
---|
122 | fi |
---|
123 | AC_SUBST(libcpu_cpu_subdir) |
---|
124 | |
---|
125 | # Is there code where there should be for this BSP? |
---|
126 | # The bare bsp is a special case as it is not under the RTEMS_CPU path |
---|
127 | if test "$RTEMS_BSP_FAMILY" = bare ; then |
---|
128 | AC_CONFIG_SUBDIRS([lib/libbsp/bare]) |
---|
129 | AC_SUBST(libbsp_cpu_subdir,bare) |
---|
130 | else |
---|
131 | RTEMS_CPU_SUBDIRS([lib/libbsp]) |
---|
132 | AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU) |
---|
133 | fi |
---|
134 | |
---|
135 | BSP_SUBDIRS="$BSP_SUBDIRS lib" |
---|
136 | BSP_SUBDIRS="$BSP_SUBDIRS libchip" |
---|
137 | |
---|
138 | AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[ |
---|
139 | AC_CONFIG_SUBDIRS([librtems++]) |
---|
140 | BSP_SUBDIRS="$BSP_SUBDIRS librtems++" |
---|
141 | ]) |
---|
142 | |
---|
143 | BSP_SUBDIRS="$BSP_SUBDIRS support" |
---|
144 | BSP_SUBDIRS="$BSP_SUBDIRS ada" |
---|
145 | BSP_SUBDIRS="$BSP_SUBDIRS wrapup" |
---|
146 | |
---|
147 | BSP_SUBDIRS="$BSP_SUBDIRS optman" |
---|
148 | |
---|
149 | AC_ARG_ENABLE([ada], |
---|
150 | [AS_HELP_STRING(--enable-ada,enable ada support)], |
---|
151 | [case "${enable_ada}" in |
---|
152 | yes) ;; |
---|
153 | no) ;; |
---|
154 | *) AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;; |
---|
155 | esac],[enable_ada=no]) |
---|
156 | |
---|
157 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
158 | [ada-tests],[ada-tests], |
---|
159 | ['--enable-rtems-root=../' \ |
---|
160 | '--enable-project-root=${with_project_root}../$RTEMS_BSP' \ |
---|
161 | '--with-project-top=${with_project_top}../' \ |
---|
162 | '--enable-rtemsbsp=$RTEMS_BSP' \ |
---|
163 | ], |
---|
164 | [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes]) |
---|
165 | |
---|
166 | # HACK ALERT! |
---|
167 | |
---|
168 | # FIXME: Assume multilib implies in-source-tree multilibs |
---|
169 | # Build testsuites multilibbed |
---|
170 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
171 | [testsuites],[../../testsuites], |
---|
172 | ['--enable-rtems-root=../' \ |
---|
173 | '--enable-project-root=${with_project_root}../$RTEMS_BSP' \ |
---|
174 | '--with-project-top=${with_project_top}../' \ |
---|
175 | '--enable-rtemsbsp=$RTEMS_BSP' \ |
---|
176 | '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \ |
---|
177 | '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \ |
---|
178 | ], |
---|
179 | [test x"$enable_tests" != x"no" && test x"$multilib" = xno]) |
---|
180 | |
---|
181 | # Build testsuites non-multilibbed |
---|
182 | RTEMS_BSP_CONFIG_SUBDIR( |
---|
183 | [testsuites],[../../testsuites], |
---|
184 | ['--enable-rtems-root=../' \ |
---|
185 | '--enable-cpukit-root=${with_project_root}..' \ |
---|
186 | '--enable-project-root=${with_project_root}../$RTEMS_BSP' \ |
---|
187 | '--with-project-top=${with_project_top}../' \ |
---|
188 | '--enable-rtemsbsp=$RTEMS_BSP' \ |
---|
189 | '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \ |
---|
190 | '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \ |
---|
191 | ], |
---|
192 | [test x"$enable_tests" != x"no" && test x"$multilib" = xyes]) |
---|
193 | |
---|
194 | AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS]) |
---|
195 | |
---|
196 | AS_IF([test "$host_cpu" = sparc],[ |
---|
197 | AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1], |
---|
198 | [whether to enable ipalignment work-around]) |
---|
199 | ]) |
---|
200 | |
---|
201 | AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"]) |
---|
202 | |
---|
203 | AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes") |
---|
204 | |
---|
205 | # The posix bsp doesn't support libchip |
---|
206 | # FIXME: We should use a feature based check, here |
---|
207 | AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"]) |
---|
208 | |
---|
209 | # The bare bsp doesn't have libbsp.a |
---|
210 | # FIXME: We should use a feature based check, here |
---|
211 | AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"]) |
---|
212 | |
---|
213 | AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"]) |
---|
214 | |
---|
215 | AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \ |
---|
216 | && test x"$rtems_cv_HAS_POSIX_API" = x"yes"]) |
---|
217 | |
---|
218 | RTEMS_PROJECT_ROOT |
---|
219 | |
---|
220 | # Explicitly list all Makefiles here |
---|
221 | AC_CONFIG_FILES([Makefile], |
---|
222 | [${MAKE} make/${RTEMS_BSP}.cache], |
---|
223 | [RTEMS_BSP=${RTEMS_BSP} |
---|
224 | MAKE=${MAKE}]) |
---|
225 | |
---|
226 | AC_CONFIG_FILES([ |
---|
227 | support/Makefile |
---|
228 | |
---|
229 | libchip/Makefile |
---|
230 | |
---|
231 | optman/Makefile |
---|
232 | |
---|
233 | lib/Makefile |
---|
234 | |
---|
235 | lib/libcpu/Makefile |
---|
236 | |
---|
237 | lib/libbsp/Makefile |
---|
238 | |
---|
239 | ada/Makefile |
---|
240 | |
---|
241 | wrapup/Makefile |
---|
242 | ]) |
---|
243 | |
---|
244 | AC_OUTPUT |
---|