1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | dnl |
---|
3 | dnl $Id$ |
---|
4 | |
---|
5 | AC_PREREQ(2.13) |
---|
6 | AC_INIT(c) |
---|
7 | RTEMS_TOP(.) |
---|
8 | |
---|
9 | # Abort if trying to build inside of the source tree. |
---|
10 | if test -f VERSION; then |
---|
11 | rm -f config.cache config.log confdefs.h |
---|
12 | AC_MSG_ERROR([***] |
---|
13 | [Attempt to build inside of the source tree] |
---|
14 | [Please use a separate build directory, instead] ) |
---|
15 | fi |
---|
16 | |
---|
17 | AC_CANONICAL_SYSTEM |
---|
18 | AM_INIT_AUTOMAKE(cross,0,no) |
---|
19 | AM_MAINTAINER_MODE |
---|
20 | |
---|
21 | dnl These option are only in here to let --help report all supported |
---|
22 | dnl options. |
---|
23 | RTEMS_ENABLE_MULTIPROCESSING |
---|
24 | RTEMS_ENABLE_POSIX |
---|
25 | RTEMS_ENABLE_ITRON |
---|
26 | RTEMS_ENABLE_NETWORKING |
---|
27 | RTEMS_ENABLE_RDBG |
---|
28 | RTEMS_ENABLE_INLINES |
---|
29 | RTEMS_ENABLE_CXX |
---|
30 | RTEMS_ENABLE_GCC28 |
---|
31 | RTEMS_ENABLE_LIBCDIR |
---|
32 | RTEMS_ENABLE_TESTS |
---|
33 | RTEMS_ENABLE_RTEMS_DEBUG |
---|
34 | |
---|
35 | # these tools are built for the build environment |
---|
36 | # |
---|
37 | build_tools="tools/build tools/update tools/cpu" |
---|
38 | |
---|
39 | # these libraries are used for the host environment |
---|
40 | # |
---|
41 | host_libs="" |
---|
42 | |
---|
43 | # these tools are built for the host environment |
---|
44 | # |
---|
45 | host_tools="" |
---|
46 | |
---|
47 | # these libraries are built for the target environment, and are built after |
---|
48 | # the host libraries and the host tools (which may be a cross compiler) |
---|
49 | # |
---|
50 | target_libs="c" |
---|
51 | |
---|
52 | # these tools are built using the target libs, and are intended to run only |
---|
53 | # in the target environment |
---|
54 | # |
---|
55 | target_tools="" |
---|
56 | |
---|
57 | ## All tools belong in one of the four categories, and are assigned above |
---|
58 | ## We assign ${configdirs} this way to remove all embedded newlines. This |
---|
59 | ## is important because configure will choke if they ever get through. |
---|
60 | ## ${configdirs} is directories we build using the host tools. |
---|
61 | ## ${target_configdirs} is directories we build using the target tools. |
---|
62 | # |
---|
63 | configdirs="${host_libs} ${host_tools}" |
---|
64 | AC_SUBST(configdirs) |
---|
65 | |
---|
66 | target_configdirs="${target_libs} ${target_tools}" |
---|
67 | AC_SUBST(target_configdirs) |
---|
68 | |
---|
69 | # Record target_configdirs and the configure arguments in Makefile. |
---|
70 | targargs=`echo "${ac_configure_args}" | \ |
---|
71 | sed -e 's/--no[^ ]*//' \ |
---|
72 | -e 's/--cache[a-z-]*=[^ ]*//' \ |
---|
73 | -e 's/--ho[a-z-]*=[^ ]*//' \ |
---|
74 | -e 's/--bu[a-z-]*=[^ ]*//' \ |
---|
75 | -e 's/--ta[a-z-]*=[^ ]*//'`; |
---|
76 | |
---|
77 | targargs="--host=${target_alias} --build=${build} ${targargs}" |
---|
78 | AC_SUBST(targargs) |
---|
79 | |
---|
80 | target_subdir=${target_alias} |
---|
81 | |
---|
82 | changequote(,)dnl |
---|
83 | if test $target = $host; |
---|
84 | then |
---|
85 | HOST_SUBDIRS="$configdirs $target_configdirs" |
---|
86 | TARGET_SUBDIRS="" |
---|
87 | else |
---|
88 | HOST_SUBDIRS="$configdirs" |
---|
89 | TARGET_SUBDIRS=`echo "$target_configdirs" | \ |
---|
90 | sed -e "s%\([^ ]\+\)%$target_alias/\1%g"` |
---|
91 | fi |
---|
92 | changequote([,])dnl |
---|
93 | |
---|
94 | if test $host = $build; |
---|
95 | then |
---|
96 | HOST_SUBDIRS="$build_tools $HOST_SUBDIRS" |
---|
97 | else |
---|
98 | build_configdirs="$build_tools" |
---|
99 | fi |
---|
100 | |
---|
101 | AC_CONFIG_SUBDIRS($HOST_SUBDIRS) |
---|
102 | AC_SUBST(TARGET_SUBDIRS) |
---|
103 | AC_SUBST(HOST_SUBDIRS) |
---|
104 | |
---|
105 | AC_OUTPUT( |
---|
106 | Makefile |
---|
107 | tools/Makefile |
---|
108 | make/Makefile |
---|
109 | make/custom/Makefile |
---|
110 | make/Templates/Makefile |
---|
111 | make/compilers/Makefile |
---|
112 | doc/Makefile) |
---|
113 | |
---|
114 | if test "$no_recursion" != yes; then |
---|
115 | |
---|
116 | if test $target != $host; then |
---|
117 | # Remove --srcdir arguments so they do not pile up. |
---|
118 | ac_sub_configure_args= |
---|
119 | ac_prev= |
---|
120 | for ac_arg in $targargs; do |
---|
121 | if test -n "$ac_prev"; then |
---|
122 | ac_prev= |
---|
123 | continue |
---|
124 | fi |
---|
125 | case "$ac_arg" in |
---|
126 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) |
---|
127 | ac_prev=srcdir ;; |
---|
128 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
129 | ;; |
---|
130 | *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; |
---|
131 | esac |
---|
132 | done |
---|
133 | |
---|
134 | test -d $target_subdir || mkdir $target_subdir |
---|
135 | for ac_config_dir in $target_configdirs; do |
---|
136 | # Do not complain, so a configure script can configure whichever |
---|
137 | # parts of a large source tree are present. |
---|
138 | if test ! -d $srcdir/$ac_config_dir; then |
---|
139 | continue |
---|
140 | fi |
---|
141 | |
---|
142 | echo configuring in $target_subdir/$ac_config_dir |
---|
143 | |
---|
144 | case "$srcdir" in |
---|
145 | .) ;; |
---|
146 | *) |
---|
147 | if test -d $target_subdir/$ac_config_dir || mkdir $target_subdir/$ac_config_dir; then :; |
---|
148 | else |
---|
149 | AC_MSG_ERROR(can not create `pwd`/$target_subdir/$ac_config_dir) |
---|
150 | fi |
---|
151 | ;; |
---|
152 | esac |
---|
153 | |
---|
154 | ac_popdir=`pwd` |
---|
155 | cd $target_subdir/$ac_config_dir |
---|
156 | |
---|
157 | changequote(, )dnl |
---|
158 | # A "../" for each directory in /$ac_config_dir. |
---|
159 | ac_dots=`echo $target_subdir/$ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` |
---|
160 | changequote([, ])dnl |
---|
161 | |
---|
162 | case "$srcdir" in |
---|
163 | .) # No --srcdir option. We are building in place. |
---|
164 | ac_sub_srcdir=$srcdir ;; |
---|
165 | /*) # Absolute path. |
---|
166 | ac_sub_srcdir=$srcdir/$ac_config_dir ;; |
---|
167 | *) # Relative path. |
---|
168 | ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; |
---|
169 | esac |
---|
170 | |
---|
171 | # Check for configure |
---|
172 | if test -f $ac_sub_srcdir/configure; then |
---|
173 | ac_sub_configure=$ac_sub_srcdir/configure |
---|
174 | else |
---|
175 | AC_MSG_WARN(no configuration information is in $ac_config_dir) |
---|
176 | ac_sub_configure= |
---|
177 | fi |
---|
178 | |
---|
179 | # The recursion is here. |
---|
180 | if test -n "$ac_sub_configure"; then |
---|
181 | |
---|
182 | # Make the cache file name correct relative to the subdirectory. |
---|
183 | ac_sub_cache_file=$cache_file |
---|
184 | ifdef([AC_PROVIDE_AC_PROG_INSTALL], |
---|
185 | [ case "$ac_given_INSTALL" in |
---|
186 | changequote(, )dnl |
---|
187 | [/$]*) INSTALL="$ac_given_INSTALL" ;; |
---|
188 | changequote([, ])dnl |
---|
189 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; |
---|
190 | esac |
---|
191 | ])dnl |
---|
192 | |
---|
193 | echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" |
---|
194 | # The eval makes quoting arguments work. |
---|
195 | if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \ |
---|
196 | $ac_sub_configure_args --srcdir=$ac_sub_srcdir \ |
---|
197 | --with-target-subdir=$target_subdir \ |
---|
198 | --cache-file=$ac_sub_cache_file \ |
---|
199 | --libdir='${exec_prefix}'/$target_alias/lib |
---|
200 | then : |
---|
201 | else |
---|
202 | AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir) |
---|
203 | fi |
---|
204 | fi |
---|
205 | |
---|
206 | cd $ac_popdir |
---|
207 | done |
---|
208 | fi |
---|
209 | |
---|
210 | if test $build != $host; then |
---|
211 | # Remove --srcdir arguments so they do not pile up. |
---|
212 | ac_sub_configure_args= |
---|
213 | ac_prev= |
---|
214 | for ac_arg in $targargs; do |
---|
215 | if test -n "$ac_prev"; then |
---|
216 | ac_prev= |
---|
217 | continue |
---|
218 | fi |
---|
219 | case "$ac_arg" in |
---|
220 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) |
---|
221 | ac_prev=srcdir ;; |
---|
222 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
223 | ;; |
---|
224 | *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; |
---|
225 | esac |
---|
226 | done |
---|
227 | |
---|
228 | # test -d $target_subdir || mkdir $target_subdir |
---|
229 | for ac_config_dir in $build_configdirs; do |
---|
230 | # Do not complain, so a configure script can configure whichever |
---|
231 | # parts of a large source tree are present. |
---|
232 | if test ! -d $srcdir/$ac_config_dir; then |
---|
233 | continue |
---|
234 | fi |
---|
235 | |
---|
236 | echo configuring in $ac_config_dir |
---|
237 | |
---|
238 | case "$srcdir" in |
---|
239 | .) ;; |
---|
240 | *) |
---|
241 | if test -d $ac_config_dir || mkdir $ac_config_dir; then :; |
---|
242 | else |
---|
243 | AC_MSG_ERROR(can not create `pwd`/$ac_config_dir) |
---|
244 | fi |
---|
245 | ;; |
---|
246 | esac |
---|
247 | |
---|
248 | ac_popdir=`pwd` |
---|
249 | cd $ac_config_dir |
---|
250 | |
---|
251 | changequote(, )dnl |
---|
252 | # A "../" for each directory in /$ac_config_dir. |
---|
253 | ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` |
---|
254 | changequote([, ])dnl |
---|
255 | |
---|
256 | case "$srcdir" in |
---|
257 | .) # No --srcdir option. We are building in place. |
---|
258 | ac_sub_srcdir=$srcdir ;; |
---|
259 | /*) # Absolute path. |
---|
260 | ac_sub_srcdir=$srcdir/$ac_config_dir ;; |
---|
261 | *) # Relative path. |
---|
262 | ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; |
---|
263 | esac |
---|
264 | |
---|
265 | # Check for configure |
---|
266 | if test -f $ac_sub_srcdir/configure; then |
---|
267 | ac_sub_configure=$ac_sub_srcdir/configure |
---|
268 | else |
---|
269 | AC_MSG_WARN(no configuration information is in $ac_config_dir) |
---|
270 | ac_sub_configure= |
---|
271 | fi |
---|
272 | |
---|
273 | # The recursion is here. |
---|
274 | if test -n "$ac_sub_configure"; then |
---|
275 | |
---|
276 | # Make the cache file name correct relative to the subdirectory. |
---|
277 | ac_sub_cache_file=$cache_file |
---|
278 | ifdef([AC_PROVIDE_AC_PROG_INSTALL], |
---|
279 | [ case "$ac_given_INSTALL" in |
---|
280 | changequote(, )dnl |
---|
281 | [/$]*) INSTALL="$ac_given_INSTALL" ;; |
---|
282 | changequote([, ])dnl |
---|
283 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; |
---|
284 | esac |
---|
285 | ])dnl |
---|
286 | |
---|
287 | echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" |
---|
288 | # The eval makes quoting arguments work. |
---|
289 | if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \ |
---|
290 | $ac_sub_configure_args --srcdir=$ac_sub_srcdir \ |
---|
291 | --cache-file=$ac_sub_cache_file \ |
---|
292 | --build=$build --host=$build |
---|
293 | then : |
---|
294 | else |
---|
295 | AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir) |
---|
296 | fi |
---|
297 | fi |
---|
298 | |
---|
299 | cd $ac_popdir |
---|
300 | done |
---|
301 | fi |
---|
302 | fi |
---|