1 | dnl $Id$ |
---|
2 | |
---|
3 | ## HACK: Work-around to structural issue with RTEMS |
---|
4 | ## The macros below violate most autoconf and canonicalization standards |
---|
5 | AC_DEFUN(RTEMS_CONFIG_BUILD_SUBDIRS, |
---|
6 | [ |
---|
7 | define([RTEMS_BUILD_SUBDIRS], |
---|
8 | ifdef([RTEMS_BUILD_SUBDIRS], [RTEMS_BUILD_SUBDIRS ],)[$1])dnl |
---|
9 | build_subdirs="RTEMS_BUILD_SUBDIRS" |
---|
10 | AC_SUBST(build_subdirs) |
---|
11 | ]) |
---|
12 | |
---|
13 | dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS |
---|
14 | AC_DEFUN(RTEMS_OUTPUT_BUILD_SUBDIRS, |
---|
15 | [ |
---|
16 | if test "$no_recursion" != yes; then |
---|
17 | if test $build_alias != $host_alias; then |
---|
18 | target_subdir="$target_alias" |
---|
19 | else |
---|
20 | target_subdir="." |
---|
21 | fi |
---|
22 | # Remove --cache-file and --srcdir arguments so they do not pile up. |
---|
23 | ac_sub_configure_args= |
---|
24 | ac_prev= |
---|
25 | for ac_arg in $ac_configure_args; do |
---|
26 | if test -n "$ac_prev"; then |
---|
27 | ac_prev= |
---|
28 | continue |
---|
29 | fi |
---|
30 | case "$ac_arg" in |
---|
31 | -cache-file | --cache-file | --cache-fil | --cache-fi \ |
---|
32 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) |
---|
33 | ac_prev=cache_file ;; |
---|
34 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ |
---|
35 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) |
---|
36 | ;; |
---|
37 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) |
---|
38 | ac_prev=srcdir ;; |
---|
39 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
40 | ;; |
---|
41 | --target*) ;; |
---|
42 | --build*) ;; |
---|
43 | --host*) ;; |
---|
44 | *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; |
---|
45 | esac |
---|
46 | done |
---|
47 | |
---|
48 | for ac_config_dir in $1; do |
---|
49 | |
---|
50 | # Do not complain, so a configure script can configure whichever |
---|
51 | # parts of a large source tree are present. |
---|
52 | if test ! -d $srcdir/$ac_config_dir; then |
---|
53 | continue |
---|
54 | fi |
---|
55 | |
---|
56 | echo configuring in $ac_config_dir |
---|
57 | |
---|
58 | case "$srcdir" in |
---|
59 | ## .) ;; |
---|
60 | *) |
---|
61 | if test -d $ac_config_dir || mkdir $ac_config_dir; then :; |
---|
62 | else |
---|
63 | AC_MSG_ERROR(can not create `pwd`/$ac_config_dir) |
---|
64 | fi |
---|
65 | ;; |
---|
66 | esac |
---|
67 | |
---|
68 | ac_popdir=`pwd` |
---|
69 | cd $ac_config_dir |
---|
70 | |
---|
71 | changequote(, )dnl |
---|
72 | # A "../" for each directory in /$ac_config_dir. |
---|
73 | ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` |
---|
74 | changequote([, ])dnl |
---|
75 | |
---|
76 | case "$srcdir" in |
---|
77 | ## .) # No --srcdir option. We are building in place. |
---|
78 | ## ac_sub_srcdir=$srcdir ;; |
---|
79 | /*) # Absolute path. |
---|
80 | ac_sub_srcdir=$srcdir/$ac_config_dir ;; |
---|
81 | *) # Relative path. |
---|
82 | ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; |
---|
83 | esac |
---|
84 | |
---|
85 | # Check for configure |
---|
86 | if test -f $ac_sub_srcdir/configure; then |
---|
87 | ac_sub_configure=$ac_sub_srcdir/configure |
---|
88 | else |
---|
89 | AC_MSG_WARN(no configuration information is in $ac_config_dir) |
---|
90 | ac_sub_configure= |
---|
91 | fi |
---|
92 | |
---|
93 | # The recursion is here. |
---|
94 | if test -n "$ac_sub_configure"; then |
---|
95 | ac_sub_cache_file=./config.cache |
---|
96 | ifdef([AC_PROVIDE_AC_PROG_INSTALL], |
---|
97 | [ case "$ac_given_INSTALL" in |
---|
98 | changequote(, )dnl |
---|
99 | [/$]*) INSTALL="$ac_given_INSTALL" ;; |
---|
100 | changequote([, ])dnl |
---|
101 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; |
---|
102 | esac |
---|
103 | ])dnl |
---|
104 | |
---|
105 | echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" |
---|
106 | # The eval makes quoting arguments work. |
---|
107 | if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \ |
---|
108 | $ac_sub_configure_args \ |
---|
109 | --srcdir=$ac_sub_srcdir \ |
---|
110 | --with-target-subdir=$target_subdir \ |
---|
111 | --cache-file=$ac_sub_cache_file |
---|
112 | then : |
---|
113 | else |
---|
114 | AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir) |
---|
115 | fi |
---|
116 | fi |
---|
117 | |
---|
118 | cd $ac_popdir |
---|
119 | done |
---|
120 | fi |
---|
121 | ]) |
---|
122 | dnl $Id$ |
---|
123 | |
---|
124 | AC_DEFUN(RTEMS_CONFIG_SUBDIRS, |
---|
125 | [ |
---|
126 | define([RTEMS_TGT_SUBDIRS], |
---|
127 | ifdef([RTEMS_TGT_SUBDIRS], [RTEMS_TGT_SUBDIRS ],)[$1])dnl |
---|
128 | target_subdirs="RTEMS_TGT_SUBDIRS" |
---|
129 | AC_SUBST(target_subdirs) |
---|
130 | ]) |
---|
131 | |
---|
132 | dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS |
---|
133 | AC_DEFUN(RTEMS_OUTPUT_SUBDIRS, |
---|
134 | [ |
---|
135 | if test "$no_recursion" != yes; then |
---|
136 | if test $target_alias != $host_alias; then |
---|
137 | target_subdir="$target_alias" |
---|
138 | else |
---|
139 | target_subdir="." |
---|
140 | fi |
---|
141 | # Remove --cache-file and --srcdir arguments so they do not pile up. |
---|
142 | ac_sub_configure_args= |
---|
143 | ac_prev= |
---|
144 | for ac_arg in $ac_configure_args; do |
---|
145 | if test -n "$ac_prev"; then |
---|
146 | ac_prev= |
---|
147 | continue |
---|
148 | fi |
---|
149 | case "$ac_arg" in |
---|
150 | -cache-file | --cache-file | --cache-fil | --cache-fi \ |
---|
151 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) |
---|
152 | ac_prev=cache_file ;; |
---|
153 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ |
---|
154 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) |
---|
155 | ;; |
---|
156 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) |
---|
157 | ac_prev=srcdir ;; |
---|
158 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
159 | ;; |
---|
160 | *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; |
---|
161 | esac |
---|
162 | done |
---|
163 | |
---|
164 | test -d $target_subdir || mkdir $target_subdir |
---|
165 | for ac_config_dir in $1; do |
---|
166 | |
---|
167 | # Do not complain, so a configure script can configure whichever |
---|
168 | # parts of a large source tree are present. |
---|
169 | if test ! -d $srcdir/$ac_config_dir; then |
---|
170 | continue |
---|
171 | fi |
---|
172 | |
---|
173 | echo configuring in $target_subdir/$ac_config_dir |
---|
174 | |
---|
175 | case "$srcdir" in |
---|
176 | ## .) ;; |
---|
177 | *) |
---|
178 | if test -d $target_subdir/$ac_config_dir || mkdir $target_subdir/$ac_config_dir; then :; |
---|
179 | else |
---|
180 | AC_MSG_ERROR(can not create `pwd`/$target_subdir/$ac_config_dir) |
---|
181 | fi |
---|
182 | ;; |
---|
183 | esac |
---|
184 | |
---|
185 | ac_popdir=`pwd` |
---|
186 | cd $target_subdir/$ac_config_dir |
---|
187 | |
---|
188 | changequote(, )dnl |
---|
189 | # A "../" for each directory in /$ac_config_dir. |
---|
190 | ac_dots=`echo $target_subdir/$ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` |
---|
191 | changequote([, ])dnl |
---|
192 | |
---|
193 | case "$srcdir" in |
---|
194 | ## .) # No --srcdir option. We are building in place. |
---|
195 | ## ac_sub_srcdir=$srcdir ;; |
---|
196 | /*) # Absolute path. |
---|
197 | ac_sub_srcdir=$srcdir/$ac_config_dir ;; |
---|
198 | *) # Relative path. |
---|
199 | ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; |
---|
200 | esac |
---|
201 | |
---|
202 | # Check for guested configure; otherwise get Cygnus style configure. |
---|
203 | if test -f $ac_sub_srcdir/configure; then |
---|
204 | ac_sub_configure=$ac_sub_srcdir/configure |
---|
205 | elif test -f $ac_sub_srcdir/configure.in; then |
---|
206 | ac_sub_configure=$ac_configure |
---|
207 | else |
---|
208 | AC_MSG_WARN(no configuration information is in $ac_config_dir) |
---|
209 | ac_sub_configure= |
---|
210 | fi |
---|
211 | |
---|
212 | # The recursion is here. |
---|
213 | if test -n "$ac_sub_configure"; then |
---|
214 | |
---|
215 | # Make the cache file name correct relative to the subdirectory. |
---|
216 | if test "$target_alias" != "$host_alias"; then |
---|
217 | ac_sub_cache_file=$cache_file |
---|
218 | else |
---|
219 | case "$cache_file" in |
---|
220 | /*) ac_sub_cache_file=$cache_file ;; |
---|
221 | *) # Relative path. |
---|
222 | ac_sub_cache_file="$ac_dots$cache_file" ;; |
---|
223 | esac |
---|
224 | fi |
---|
225 | ifdef([AC_PROVIDE_AC_PROG_INSTALL], |
---|
226 | [ case "$ac_given_INSTALL" in |
---|
227 | changequote(, )dnl |
---|
228 | [/$]*) INSTALL="$ac_given_INSTALL" ;; |
---|
229 | changequote([, ])dnl |
---|
230 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; |
---|
231 | esac |
---|
232 | ])dnl |
---|
233 | |
---|
234 | echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" |
---|
235 | # The eval makes quoting arguments work. |
---|
236 | if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \ |
---|
237 | $ac_sub_configure_args --srcdir=$ac_sub_srcdir \ |
---|
238 | --with-target-subdir=$target_subdir --cache-file=$ac_sub_cache_file |
---|
239 | then : |
---|
240 | else |
---|
241 | AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir) |
---|
242 | fi |
---|
243 | fi |
---|
244 | |
---|
245 | cd $ac_popdir |
---|
246 | done |
---|
247 | fi |
---|
248 | ]) |
---|