source: rtems/c/configure.ac @ 3a3e5dae

4.104.114.84.95
Last change on this file since 3a3e5dae was 2d1daae, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 18, 2004 at 9:33:13 AM

2004-10-18 Ralf Corsepius <ralf_corsepius@…>

  • configure.ac: Rework checking for BSPs.
  • Property mode set to 100644
File size: 2.7 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.59)
6AC_INIT([rtems-c],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
7AC_CONFIG_SRCDIR([TOOL_TARGETS])
8RTEMS_TOP(..)
9
10RTEMS_CANONICAL_TARGET_CPU
11
12AM_INIT_AUTOMAKE([no-define foreign 1.9])
13AM_MAINTAINER_MODE
14
15## These options are used within this file.
16RTEMS_ENABLE_RTEMSBSP
17
18# Set up rtems_bsp
19AS_IF([test x"$enable_rtemsbsp" = x"no"],[
20# --disable-rtemsbsp
21  rtems_bsp=""
22],[
23  AS_IF([test -z "$enable_rtemsbsp"],
24    [# --enable-rtemsbsp=""
25    RTEMS_CHECK_BSPS(rtems_bsp)],
26    [# --enable-rtemsbsp="list"
27    rtems_bsp="$enable_rtemsbsp"])
28])
29
30# Check sanity of BSPs in $rtems_bsp
31for _rtems_bsp in : $rtems_bsp; do test "x$_rtems_bsp" = x: && continue
32  # make sure there is a make/custom file for the bsp
33  _RTEMS_CHECK_CUSTOM_BSP([$_rtems_bsp.cfg],[bsp_cfg])
34
35  AS_IF([test -n "$bsp_cfg"],
36  [
37    # retrieve bsp_family
38    RTEMS_BSP_ALIAS([$_rtems_bsp],[rtems_bsp_family])
39
40    # Is there code where there should be for this BSP?
41    case $rtems_bsp_family in
42    bare ) rtems_libbspdir="$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/bare" ;;
43    * )    rtems_libbspdir="$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$rtems_bsp_family";;
44    esac
45
46    # Is there a configure script for the BSP?   
47    AS_IF([test -r "$rtems_libbspdir/configure"],
48      [RTEMS_BSP_LIST="$RTEMS_BSP_LIST $_rtems_bsp"])
49  ])
50done
51
52#
53# Compose the configuration arguments to be passed to c/src/configure
54#
55##
56## Partially borrowed from autoconf-2.13
57##
58
59## Adjust paths
60_RTEMS_ADJUST_SRCDIR([rtems_bsp_configure],[src])
61rtems_bsp_configure="$rtems_bsp_configure/configure"
62  RTEMS_CONFIGURE_ARGS_QUOTE([rtems_bsp_configure_args],
63    [-enable-rtemsbsp=* | --enable-rtemsbsp=* ) ;;])
64
65rtems_bsp_configure="$rtems_bsp_configure $rtems_bsp_configure_args"
66rtems_bsp_configure="$rtems_bsp_configure '--with-project-root=../../'"
67rtems_bsp_configure="$rtems_bsp_configure '--with-project-top=../../'"
68AC_SUBST(rtems_bsp_configure)
69
70AC_SUBST(RTEMS_BSP_LIST)
71
72# Explicitly list all Makefiles here
73AC_CONFIG_FILES([Makefile],[
74for bsp in : $RTEMS_BSP_LIST; do test "x$bsp" = x: && continue
75cat >> Makefile << BSPEOF
76
77$bsp: src/configure
78        @set fnord \$(MAKEFLAGS); amf=\[$]\[$]2; \\
79          echo "Configuring RTEMS_BSP=$bsp"; \\
80          \$(mkdir_p) $bsp; \\
81          ( cd $bsp && \\
82            CONFIG_SHELL=\$(SHELL) RTEMS_BSP=$bsp \$(rtems_bsp_configure) ) \\
83          || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac;
84BSPEOF
85done
86],[RTEMS_BSP_LIST="$RTEMS_BSP_LIST"])
87AC_OUTPUT
88AS_IF([test -n "$RTEMS_BSP_LIST"],[
89echo
90echo target architecture: $target_cpu.
91echo available BSPs: $RTEMS_BSP_LIST.
92echo \'${MAKE} all\' will build the following BSPs: $RTEMS_BSP_LIST.
93echo other BSPs can be built with \'${MAKE} RTEMS_BSP=\"bsp1 bsp2 ...\"\'
94echo
95])
Note: See TracBrowser for help on using the repository browser.