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 | [AC_REQUIRE([_RTEMS_OUTPUT_BUILD_SUBDIRS]) |
---|
7 | RTEMS_BUILD_SUBDIRS="$RTEMS_BUILD_SUBDIRS [$1]" |
---|
8 | ]) |
---|
9 | |
---|
10 | dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS |
---|
11 | AC_DEFUN([_RTEMS_OUTPUT_BUILD_SUBDIRS], |
---|
12 | [AC_CONFIG_COMMANDS([bsp-tools], |
---|
13 | [ |
---|
14 | # HACK: This is a blantant hack and breaks Canadian crosses |
---|
15 | build_alias="$build_alias" |
---|
16 | host_alias="$build_alias" |
---|
17 | if test "$no_recursion" != yes; then |
---|
18 | if test x"$build_alias" != x"$host_alias"; then |
---|
19 | target_subdir="$host_alias" |
---|
20 | else |
---|
21 | target_subdir="." |
---|
22 | fi |
---|
23 | RTEMS_CONFIGURE_ARGS_QUOTE([ac_sub_configure_args], |
---|
24 | [ |
---|
25 | --target*) ;; |
---|
26 | --build*) ;; |
---|
27 | --host*) ;; |
---|
28 | *_alias=* ) ;; # HACK: Workaround to autoconf passing *_alias |
---|
29 | ], |
---|
30 | [rtems_configure_args]) |
---|
31 | |
---|
32 | for rtems_config_dir in $RTEMS_BUILD_SUBDIRS; do |
---|
33 | # Do not complain, so a configure script can configure whichever |
---|
34 | # parts of a large source tree are present. |
---|
35 | if test ! -d $srcdir/$rtems_config_dir; then |
---|
36 | continue |
---|
37 | fi |
---|
38 | |
---|
39 | _RTEMS_PUSH_BUILDDIR([$rtems_config_dir]) |
---|
40 | |
---|
41 | _RTEMS_SUB_SRCDIR([$rtems_config_dir]) |
---|
42 | |
---|
43 | # The recursion is here. |
---|
44 | if test -n "$ac_sub_configure"; then |
---|
45 | # ac_sub_cache_file=./config.cache |
---|
46 | ac_sub_cache_file=/dev/null |
---|
47 | _RTEMS_GIVEN_INSTALL |
---|
48 | |
---|
49 | echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" |
---|
50 | # The eval makes quoting arguments work. |
---|
51 | if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \ |
---|
52 | $ac_sub_configure_args \ |
---|
53 | --srcdir=$ac_sub_srcdir \ |
---|
54 | --with-target-subdir=$target_subdir \ |
---|
55 | --cache-file=$ac_sub_cache_file |
---|
56 | then : |
---|
57 | else |
---|
58 | AC_MSG_ERROR([$ac_sub_configure failed for $rtems_config_dir]) |
---|
59 | fi |
---|
60 | fi |
---|
61 | |
---|
62 | _RTEMS_POP_BUILDDIR |
---|
63 | done |
---|
64 | fi], |
---|
65 | [ |
---|
66 | RTEMS_BUILD_SUBDIRS="$RTEMS_BUILD_SUBDIRS" |
---|
67 | rtems_configure_args="$ac_configure_args" |
---|
68 | ]) |
---|
69 | ]) |
---|
70 | |
---|
71 | ## FIXME: This is obsolete. Only kept for backward compatibility |
---|
72 | AU_DEFUN([RTEMS_OUTPUT_BUILD_SUBDIRS],[]) |
---|
73 | |
---|
74 | |
---|
75 | dnl |
---|
76 | dnl Misc utility macros for subdir handling to work around missing abilities |
---|
77 | dnl in autoconf, automake and structural issues with RTEMS |
---|
78 | dnl |
---|
79 | dnl Contains parts derived from autoconf-2.13 AC_OUTPUT_SUBDIRS and Cygnus' |
---|
80 | dnl configure.in. |
---|
81 | dnl |
---|
82 | |
---|
83 | dnl |
---|
84 | dnl _RTEMS_PUSH_BUILDDIR(SUBDIR) |
---|
85 | dnl |
---|
86 | AC_DEFUN(_RTEMS_PUSH_BUILDDIR, |
---|
87 | [ |
---|
88 | # _RTEMS_PUSH_BUILDDIR |
---|
89 | echo configuring in $1 |
---|
90 | case "$srcdir" in |
---|
91 | .) ;; |
---|
92 | *) AS_MKDIR_P([$1]) |
---|
93 | ;; |
---|
94 | esac |
---|
95 | |
---|
96 | ac_popdir=`pwd` |
---|
97 | cd $1 |
---|
98 | ]) |
---|
99 | |
---|
100 | dnl |
---|
101 | dnl _RTEMS_POP_BUILDDIR |
---|
102 | dnl |
---|
103 | AC_DEFUN(_RTEMS_POP_BUILDDIR, |
---|
104 | [ |
---|
105 | cd $ac_popdir |
---|
106 | ]) |
---|
107 | |
---|
108 | dnl |
---|
109 | dnl _RTEMS_GIVEN_INSTALL |
---|
110 | dnl |
---|
111 | AC_DEFUN(_RTEMS_GIVEN_INSTALL, |
---|
112 | [ |
---|
113 | ifdef([AC_PROVIDE_AC_PROG_INSTALL],[ |
---|
114 | case "$ac_given_INSTALL" in |
---|
115 | [[\\/]]* | ?:[[\\/]]*) INSTALL="$ac_given_INSTALL" ;; |
---|
116 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; |
---|
117 | esac |
---|
118 | ])dnl |
---|
119 | ]) |
---|
120 | |
---|
121 | dnl |
---|
122 | dnl _RTEMS_SUB_SRCDIR(AC_CONFIG_DIR[,TARGET_SUBDIR]) |
---|
123 | dnl |
---|
124 | AC_DEFUN(_RTEMS_SUB_SRCDIR,[ |
---|
125 | # _RTEMS_SUB_SRCDIR |
---|
126 | _RTEMS_ADJUST_SRCDIR(ac_sub_srcdir,$1,$2) |
---|
127 | |
---|
128 | # Check for configure |
---|
129 | if test -f $ac_sub_srcdir/configure; then |
---|
130 | ac_sub_configure=$ac_sub_srcdir/configure |
---|
131 | else |
---|
132 | AC_MSG_WARN([no configuration information is in $1]) |
---|
133 | ac_sub_configure= |
---|
134 | fi |
---|
135 | ]) |
---|