source: rtems/c/src/aclocal/target.m4 @ 884fba6

Last change on this file since 884fba6 was 884fba6, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 27, 2007 at 6:15:16 AM

2007-03-27 Ralf Corsépius <ralf.corsepius@…>

  • aclocal/target.m4: Strip CFLAGS (Hack to prevent bsp-cflags from being used to compile "tools").
  • Property mode set to 100644
File size: 3.3 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    -host* | --host* ) ;;
26    --host ) ac_prev=host_alias;;
27    -target* | --target* ) ;;
28    -target ) ac_prev=target_alias ;;
29    -build* | --build* ) ;;
30    -build ) ac_prev_build_alias ;;
31    CFLAGS=* );; # HACK: Strip CFLAGS
32    *_alias=* ) ;; # HACK: Workaround to autoconf passing *_alias
33    ],
34    [rtems_configure_args])
35
36  for rtems_config_dir in $RTEMS_BUILD_SUBDIRS; do
37    # Do not complain, so a configure script can configure whichever
38    # parts of a large source tree are present.
39    if test ! -d $srcdir/$rtems_config_dir; then
40      continue
41    fi
42
43    _RTEMS_PUSH_BUILDDIR([$rtems_config_dir])
44
45    _RTEMS_SUB_SRCDIR([$rtems_config_dir])
46
47    # The recursion is here.
48    if test -n "$ac_sub_configure"; then
49#      ac_sub_cache_file=./config.cache
50      ac_sub_cache_file=/dev/null
51      _RTEMS_GIVEN_INSTALL
52
53      echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
54      # The eval makes quoting arguments work.
55      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \
56        $ac_sub_configure_args \
57        --srcdir=$ac_sub_srcdir \
58        --with-target-subdir=$target_subdir \
59        --cache-file=$ac_sub_cache_file
60      then :
61      else
62        AC_MSG_ERROR([$ac_sub_configure failed for $rtems_config_dir])
63      fi
64    fi
65
66    _RTEMS_POP_BUILDDIR
67  done
68fi],
69[
70RTEMS_BUILD_SUBDIRS="$RTEMS_BUILD_SUBDIRS"
71rtems_configure_args="$ac_configure_args"
72])
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.