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