1 | dnl $Id$ |
---|
2 | |
---|
3 | AC_DEFUN(RTEMS_CONFIG_HOST_SUBDIRS, |
---|
4 | [ |
---|
5 | define([RTEMS_HOST_SUBDIRS], |
---|
6 | ifdef([RTEMS_HOST_SUBDIRS], [RTEMS_HOST_SUBDIRS ],)[$1])dnl |
---|
7 | host_subdirs="RTEMS_HOST_SUBDIRS" |
---|
8 | AC_SUBST(host_subdirs) |
---|
9 | ]) |
---|
10 | |
---|
11 | dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS |
---|
12 | AC_DEFUN(RTEMS_OUTPUT_HOST_SUBDIRS, |
---|
13 | [ |
---|
14 | if test "$no_recursion" != yes; then |
---|
15 | if test $target_alias != $host_alias; then |
---|
16 | target_subdir="$target_alias" |
---|
17 | else |
---|
18 | target_subdir="." |
---|
19 | fi |
---|
20 | # Remove --cache-file and --srcdir arguments so they do not pile up. |
---|
21 | ac_sub_configure_args= |
---|
22 | ac_prev= |
---|
23 | for ac_arg in $ac_configure_args; do |
---|
24 | if test -n "$ac_prev"; then |
---|
25 | ac_prev= |
---|
26 | continue |
---|
27 | fi |
---|
28 | case "$ac_arg" in |
---|
29 | -cache-file | --cache-file | --cache-fil | --cache-fi \ |
---|
30 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) |
---|
31 | ac_prev=cache_file ;; |
---|
32 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ |
---|
33 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) |
---|
34 | ;; |
---|
35 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) |
---|
36 | ac_prev=srcdir ;; |
---|
37 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
38 | ;; |
---|
39 | --target*) ;; |
---|
40 | --build*) ;; |
---|
41 | --host*) ;; |
---|
42 | *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; |
---|
43 | esac |
---|
44 | done |
---|
45 | |
---|
46 | # test -d $target_subdir || mkdir $target_subdir |
---|
47 | for ac_config_dir in $1; do |
---|
48 | |
---|
49 | # Do not complain, so a configure script can configure whichever |
---|
50 | # parts of a large source tree are present. |
---|
51 | if test ! -d $srcdir/$ac_config_dir; then |
---|
52 | continue |
---|
53 | fi |
---|
54 | |
---|
55 | echo configuring in $ac_config_dir |
---|
56 | |
---|
57 | case "$srcdir" in |
---|
58 | ## .) ;; |
---|
59 | *) |
---|
60 | if test -d $ac_config_dir || mkdir $ac_config_dir; then :; |
---|
61 | else |
---|
62 | AC_MSG_ERROR(can not create `pwd`/$ac_config_dir) |
---|
63 | fi |
---|
64 | ;; |
---|
65 | esac |
---|
66 | |
---|
67 | ac_popdir=`pwd` |
---|
68 | cd $ac_config_dir |
---|
69 | |
---|
70 | changequote(, )dnl |
---|
71 | # A "../" for each directory in /$ac_config_dir. |
---|
72 | ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` |
---|
73 | changequote([, ])dnl |
---|
74 | |
---|
75 | case "$srcdir" in |
---|
76 | ## .) # No --srcdir option. We are building in place. |
---|
77 | ## ac_sub_srcdir=$srcdir ;; |
---|
78 | /*) # Absolute path. |
---|
79 | ac_sub_srcdir=$srcdir/$ac_config_dir ;; |
---|
80 | *) # Relative path. |
---|
81 | ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; |
---|
82 | esac |
---|
83 | |
---|
84 | # Check for guested configure; otherwise get Cygnus style configure. |
---|
85 | if test -f $ac_sub_srcdir/configure; then |
---|
86 | ac_sub_configure=$ac_sub_srcdir/configure |
---|
87 | elif test -f $ac_sub_srcdir/configure.in; then |
---|
88 | ac_sub_configure=$ac_configure |
---|
89 | else |
---|
90 | AC_MSG_WARN(no configuration information is in $ac_config_dir) |
---|
91 | ac_sub_configure= |
---|
92 | fi |
---|
93 | |
---|
94 | # The recursion is here. |
---|
95 | if test -n "$ac_sub_configure"; then |
---|
96 | ac_sub_cache_file=./config.cache |
---|
97 | ifdef([AC_PROVIDE_AC_PROG_INSTALL], |
---|
98 | [ case "$ac_given_INSTALL" in |
---|
99 | changequote(, )dnl |
---|
100 | [/$]*) INSTALL="$ac_given_INSTALL" ;; |
---|
101 | changequote([, ])dnl |
---|
102 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; |
---|
103 | esac |
---|
104 | ])dnl |
---|
105 | |
---|
106 | echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" |
---|
107 | # The eval makes quoting arguments work. |
---|
108 | if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \ |
---|
109 | $ac_sub_configure_args --host=$target_alias --build=$build_alias \ |
---|
110 | --srcdir=$ac_sub_srcdir \ |
---|
111 | --with-target-subdir=$target_subdir --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 | ]) |
---|