source: rtems/aclocal/target.m4 @ 72f4ec87

4.104.114.84.95
Last change on this file since 72f4ec87 was a0ea6f1, checked in by Joel Sherrill <joel.sherrill@…>, on 01/06/02 at 20:12:13

2002-02-05 Ralf Corsepius <corsepiu@…>

  • aclocal/check-newlib.m4: Apply AS_IF.
  • aclocal/config-subdirs.m4: Remove _RTEMS_PUSH_BUILDDIR, _RTEMS_POP_BUILDDIR, _RTEMS_GIVEN_INSTALL, _RTEMS_SUB_SRCDIR.
  • aclocal/subdirs.m4: Fix comments, apply AS_IF.
  • aclocal/sysv-ipc.m4: Reflect autoconf-2.5x canonicalization changes.
  • aclocal/target.m4: Add _RTEMS_PUSH_BUILDDIR, _RTEMS_POP_BUILDDIR, _RTEMS_GIVEN_INSTALL, _RTEMS_SUB_SRCDIR.
  • automake/compile.am: Remove librtemsall from LINK_FILES.
  • Property mode set to 100644
File size: 3.9 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  # Remove --cache-file and --srcdir arguments so they do not pile up.
24  ac_sub_configure_args=
25  rtems_prev=
26  for rtems_arg in $rtems_configure_args; do
27    if test -n "$rtems_prev"; then
28      rtems_prev=
29      continue
30    fi
31    case "$rtems_arg" in
32    -cache-file | --cache-file | --cache-fil | --cache-fi \
33    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
34      rtems_prev=cache_file ;;
35    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
36    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
37      ;;
38    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
39      rtems_prev=srcdir ;;
40    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
41      ;;
42    --target*) ;;
43    --build*) ;;
44    --host*) ;;
45    *_alias* ) ;; # HACK: Workaround to autoconf passing *_alias
46    *) ac_sub_configure_args="$ac_sub_configure_args $rtems_arg" ;;
47    esac
48  done
49
50  for rtems_config_dir in $RTEMS_BUILD_SUBDIRS; do
51    # Do not complain, so a configure script can configure whichever
52    # parts of a large source tree are present.
53    if test ! -d $srcdir/$rtems_config_dir; then
54      continue
55    fi
56
57    _RTEMS_PUSH_BUILDDIR([$rtems_config_dir])
58
59    _RTEMS_SUB_SRCDIR([$rtems_config_dir])
60
61    # The recursion is here.
62    if test -n "$ac_sub_configure"; then
63#      ac_sub_cache_file=./config.cache
64      ac_sub_cache_file=/dev/null
65      _RTEMS_GIVEN_INSTALL
66
67      echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
68      # The eval makes quoting arguments work.
69      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure \
70        $ac_sub_configure_args \
71        --srcdir=$ac_sub_srcdir \
72        --with-target-subdir=$target_subdir \
73        --cache-file=$ac_sub_cache_file
74      then :
75      else
76        AC_MSG_ERROR([$ac_sub_configure failed for $rtems_config_dir])
77      fi
78    fi
79
80    _RTEMS_POP_BUILDDIR
81  done
82fi],
83[
84RTEMS_BUILD_SUBDIRS="$RTEMS_BUILD_SUBDIRS"
85rtems_configure_args="$ac_configure_args"
86])
87])
88
89## FIXME: This is obsolete. Only kept for backward compatibility
90AU_DEFUN([RTEMS_OUTPUT_BUILD_SUBDIRS],[])
91
92
93dnl
94dnl Misc utility macros for subdir handling to work around missing abilities
95dnl in autoconf, automake and structural issues with RTEMS
96dnl
97dnl Contains parts derived from autoconf-2.13 AC_OUTPUT_SUBDIRS and Cygnus'
98dnl configure.in.
99dnl
100
101dnl
102dnl _RTEMS_PUSH_BUILDDIR(SUBDIR)
103dnl
104AC_DEFUN(_RTEMS_PUSH_BUILDDIR,
105[
106# _RTEMS_PUSH_BUILDDIR
107    echo configuring in $1
108    case "$srcdir" in
109    .) ;;
110    *) AS_MKDIR_P([$1])
111      ;;
112    esac
113
114    ac_popdir=`pwd`
115    cd $1
116])
117
118dnl
119dnl _RTEMS_POP_BUILDDIR
120dnl
121AC_DEFUN(_RTEMS_POP_BUILDDIR,
122[
123  cd $ac_popdir
124])
125
126dnl
127dnl _RTEMS_GIVEN_INSTALL
128dnl
129AC_DEFUN(_RTEMS_GIVEN_INSTALL,
130[
131ifdef([AC_PROVIDE_AC_PROG_INSTALL],[ 
132  case "$ac_given_INSTALL" in
133  [[\\/]]* | ?:[[\\/]]*) INSTALL="$ac_given_INSTALL" ;;
134  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
135  esac
136])dnl
137])
138
139dnl
140dnl _RTEMS_SUB_SRCDIR(AC_CONFIG_DIR[,TARGET_SUBDIR])
141dnl
142AC_DEFUN(_RTEMS_SUB_SRCDIR,[
143# _RTEMS_SUB_SRCDIR
144    _RTEMS_ADJUST_SRCDIR(ac_sub_srcdir,$1,$2)
145
146    # Check for configure
147    if test -f $ac_sub_srcdir/configure; then
148      ac_sub_configure=$ac_sub_srcdir/configure
149    else
150      AC_MSG_WARN([no configuration information is in $1])
151      ac_sub_configure=
152    fi
153])
Note: See TracBrowser for help on using the repository browser.