1 | ## Process this file with autoconf to produce a configure script. |
---|
2 | ## |
---|
3 | ## $Id$ |
---|
4 | |
---|
5 | AC_PREREQ(2.60) |
---|
6 | AC_INIT([rtems-c],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) |
---|
7 | AC_CONFIG_SRCDIR([TOOL_TARGETS]) |
---|
8 | RTEMS_TOP(..) |
---|
9 | |
---|
10 | RTEMS_CANONICAL_TARGET_CPU |
---|
11 | |
---|
12 | AM_INIT_AUTOMAKE([no-define foreign 1.10]) |
---|
13 | AM_MAINTAINER_MODE |
---|
14 | |
---|
15 | ## These options are used within this file. |
---|
16 | RTEMS_ENABLE_RTEMSBSP |
---|
17 | |
---|
18 | # Set up rtems_bsp |
---|
19 | AS_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 |
---|
31 | for _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 a configure script for the BSP? |
---|
41 | AS_IF([test -r "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$rtems_bsp_family/configure"], |
---|
42 | [RTEMS_BSP_LIST="$RTEMS_BSP_LIST $_rtems_bsp"]) |
---|
43 | ]) |
---|
44 | done |
---|
45 | |
---|
46 | # |
---|
47 | # Compose the configuration arguments to be passed to c/src/configure |
---|
48 | # |
---|
49 | ## |
---|
50 | ## Partially borrowed from autoconf-2.13 |
---|
51 | ## |
---|
52 | |
---|
53 | ## Adjust paths |
---|
54 | _RTEMS_ADJUST_SRCDIR([rtems_bsp_configure],[src]) |
---|
55 | rtems_bsp_configure="$rtems_bsp_configure/configure" |
---|
56 | RTEMS_CONFIGURE_ARGS_QUOTE([rtems_bsp_configure_args], |
---|
57 | [-enable-rtemsbsp=* | --enable-rtemsbsp=* ) ;;]) |
---|
58 | |
---|
59 | rtems_bsp_configure="$rtems_bsp_configure $rtems_bsp_configure_args" |
---|
60 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-root=../../'" |
---|
61 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-top=../../'" |
---|
62 | AC_SUBST(rtems_bsp_configure) |
---|
63 | |
---|
64 | AC_SUBST(RTEMS_BSP_LIST) |
---|
65 | |
---|
66 | # Explicitly list all Makefiles here |
---|
67 | AC_CONFIG_FILES([Makefile],[ |
---|
68 | for bsp in : $RTEMS_BSP_LIST; do test "x$bsp" = x: && continue |
---|
69 | cat >> Makefile << BSPEOF |
---|
70 | |
---|
71 | $bsp: src/configure |
---|
72 | @set fnord \$(MAKEFLAGS); amf=\[$]\[$]2; \\ |
---|
73 | echo "Configuring RTEMS_BSP=$bsp"; \\ |
---|
74 | \$(MKDIR_P) $bsp; \\ |
---|
75 | ( cd $bsp && \\ |
---|
76 | CONFIG_SHELL=\$(SHELL) RTEMS_BSP=$bsp \$(rtems_bsp_configure) ) \\ |
---|
77 | || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; |
---|
78 | BSPEOF |
---|
79 | done |
---|
80 | ],[RTEMS_BSP_LIST="$RTEMS_BSP_LIST"]) |
---|
81 | AC_OUTPUT |
---|
82 | AS_IF([test -n "$RTEMS_BSP_LIST"],[ |
---|
83 | echo |
---|
84 | echo target architecture: $target_cpu. |
---|
85 | echo available BSPs: $RTEMS_BSP_LIST. |
---|
86 | echo \'${MAKE} all\' will build the following BSPs: $RTEMS_BSP_LIST. |
---|
87 | echo other BSPs can be built with \'${MAKE} RTEMS_BSP=\"bsp1 bsp2 ...\"\' |
---|
88 | echo |
---|
89 | ]) |
---|