source: rtems/aclocal/target.m4 @ 824bf2e4

4.104.114.84.95
Last change on this file since 824bf2e4 was 824bf2e4, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/19/02 at 00:31:31

2002-11-18 Ralf Corsepius <corsepiu@…>

  • aclocal/target.m4: Apply RTEMS_CONFIGURE_ARGS_QUOTE (Part of fix to PR 312).
  • Property mode set to 100644
File size: 3.2 KB
Line 
1dnl $Id$
2
3## HACK: Work-around to structural issue with RTEMS
4## The macros below violate most autoconf and canonicalization standards
5AC_DEFUN(RTEMS_CONFIG_BUILD_SUBDIRS,
6[AC_REQUIRE([_RTEMS_OUTPUT_BUILD_SUBDIRS])
7RTEMS_BUILD_SUBDIRS="$RTEMS_BUILD_SUBDIRS [$1]"
8])
9
10dnl Derived from automake-1.4's AC_OUTPUT_SUBDIRS
11AC_DEFUN([_RTEMS_OUTPUT_BUILD_SUBDIRS],
12[AC_CONFIG_COMMANDS([bsp-tools],
13[
14# HACK: This is a blantant hack and breaks Canadian crosses
15build_alias="$build_alias"
16host_alias="$build_alias"
17if 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
64fi],
65[
66RTEMS_BUILD_SUBDIRS="$RTEMS_BUILD_SUBDIRS"
67rtems_configure_args="$ac_configure_args"
68])
69])
70
71## FIXME: This is obsolete. Only kept for backward compatibility
72AU_DEFUN([RTEMS_OUTPUT_BUILD_SUBDIRS],[])
73
74
75dnl
76dnl Misc utility macros for subdir handling to work around missing abilities
77dnl in autoconf, automake and structural issues with RTEMS
78dnl
79dnl Contains parts derived from autoconf-2.13 AC_OUTPUT_SUBDIRS and Cygnus'
80dnl configure.in.
81dnl
82
83dnl
84dnl _RTEMS_PUSH_BUILDDIR(SUBDIR)
85dnl
86AC_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
100dnl
101dnl _RTEMS_POP_BUILDDIR
102dnl
103AC_DEFUN(_RTEMS_POP_BUILDDIR,
104[
105  cd $ac_popdir
106])
107
108dnl
109dnl _RTEMS_GIVEN_INSTALL
110dnl
111AC_DEFUN(_RTEMS_GIVEN_INSTALL,
112[
113ifdef([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
121dnl
122dnl _RTEMS_SUB_SRCDIR(AC_CONFIG_DIR[,TARGET_SUBDIR])
123dnl
124AC_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])
Note: See TracBrowser for help on using the repository browser.