[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
| 2 | ## |
---|
| 3 | ## $Id$ |
---|
[eb299afc] | 4 | |
---|
[810720b6] | 5 | AC_PREREQ(2.59) |
---|
[7dcc3fe] | 6 | AC_INIT([rtems-c],[_RTEMS_VERSION],[rtems-bugs@rtems.com]) |
---|
[1204f22] | 7 | AC_CONFIG_SRCDIR([TOOL_TARGETS]) |
---|
[eb299afc] | 8 | RTEMS_TOP(..) |
---|
| 9 | |
---|
| 10 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 11 | |
---|
[810720b6] | 12 | AM_INIT_AUTOMAKE([no-define foreign 1.8]) |
---|
[eb299afc] | 13 | AM_MAINTAINER_MODE |
---|
| 14 | |
---|
[66387986] | 15 | ## These options are used within this file. |
---|
[eb299afc] | 16 | RTEMS_ENABLE_BARE |
---|
[1204f22] | 17 | RTEMS_ENABLE_RTEMSBSP |
---|
[eb299afc] | 18 | |
---|
| 19 | RTEMS_CHECK_CPU |
---|
| 20 | |
---|
[1204f22] | 21 | AS_IF([test x"$enable_rtemsbsp" = x"no"],[ |
---|
| 22 | rtems_bsp="" |
---|
| 23 | ],[ |
---|
| 24 | AS_IF([test -z "$enable_rtemsbsp"], |
---|
| 25 | [RTEMS_CHECK_BSPS(rtems_bsp)], |
---|
| 26 | [rtems_bsp="$enable_rtemsbsp"]) |
---|
[eb299afc] | 27 | |
---|
| 28 | for i in $rtems_bsp; do |
---|
| 29 | |
---|
| 30 | # make sure there is a make/custom file for the bsp |
---|
| 31 | RTEMS_CHECK_CUSTOM_BSP(i) |
---|
| 32 | |
---|
| 33 | RTEMS_BSP_ALIAS($i,bspdir) |
---|
| 34 | |
---|
| 35 | # Is there code where there should be for this BSP? |
---|
| 36 | # The bare bsp is a special case as it is not under the RTEMS_CPU path |
---|
[b62a92c] | 37 | case $bspdir in |
---|
[eb299afc] | 38 | bare) |
---|
| 39 | bspcpudir= |
---|
| 40 | ;; |
---|
| 41 | *) |
---|
| 42 | bspcpudir=$RTEMS_CPU/ |
---|
| 43 | ;; |
---|
| 44 | esac |
---|
| 45 | |
---|
| 46 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then |
---|
| 47 | RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i" |
---|
| 48 | else |
---|
| 49 | AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for $i]) |
---|
| 50 | fi |
---|
| 51 | done |
---|
[1204f22] | 52 | ]) |
---|
[eb299afc] | 53 | |
---|
| 54 | # |
---|
| 55 | # Compose the configuration arguments to be passed to c/src/configure |
---|
| 56 | # |
---|
[1204f22] | 57 | ## |
---|
[eb299afc] | 58 | ## Partially borrowed from autoconf-2.13 |
---|
| 59 | ## |
---|
| 60 | |
---|
| 61 | ## Adjust paths |
---|
[eab41f63] | 62 | _RTEMS_ADJUST_SRCDIR([rtems_bsp_configure],[src]) |
---|
| 63 | rtems_bsp_configure="$rtems_bsp_configure/configure" |
---|
[2fe08ccb] | 64 | RTEMS_CONFIGURE_ARGS_QUOTE([rtems_bsp_configure_args], |
---|
[45789f2] | 65 | [-enable-rtemsbsp=* | --enable-rtemsbsp=* ) ;;]) |
---|
[eb299afc] | 66 | |
---|
| 67 | rtems_bsp_configure="$rtems_bsp_configure $rtems_bsp_configure_args" |
---|
[1b7c9183] | 68 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-root=../../'" |
---|
| 69 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-top=../../'" |
---|
[eb299afc] | 70 | AC_SUBST(rtems_bsp_configure) |
---|
| 71 | |
---|
| 72 | AC_SUBST(RTEMS_BSP_LIST) |
---|
| 73 | |
---|
[70810dc] | 74 | # Explicitly list all Makefiles here |
---|
[73dc152] | 75 | AC_CONFIG_FILES([Makefile],[ |
---|
| 76 | for bsp in : $RTEMS_BSP_LIST; do test "x$bsp" = x: && continue |
---|
| 77 | cat >> Makefile << BSPEOF |
---|
| 78 | |
---|
| 79 | $bsp: src/configure |
---|
| 80 | @set fnord \$(MAKEFLAGS); amf=\[$]\[$]2; \\ |
---|
| 81 | echo "Configuring RTEMS_BSP=$bsp"; \\ |
---|
| 82 | \$(mkdir_p) $bsp; \\ |
---|
| 83 | ( cd $bsp && \\ |
---|
| 84 | CONFIG_SHELL=\$(SHELL) RTEMS_BSP=$bsp \$(rtems_bsp_configure) ) \\ |
---|
| 85 | || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; |
---|
| 86 | BSPEOF |
---|
| 87 | done |
---|
| 88 | ],[RTEMS_BSP_LIST="$RTEMS_BSP_LIST"]) |
---|
[66387986] | 89 | AC_OUTPUT |
---|
[eb299afc] | 90 | |
---|
| 91 | echo |
---|
| 92 | echo target architecture: $target_cpu. |
---|
| 93 | echo available BSPs: $rtems_bsp. |
---|
[7b79761] | 94 | echo \'${MAKE} all\' will build the following BSPs: $RTEMS_BSP_LIST. |
---|
| 95 | echo other BSPs can be built with \'${MAKE} RTEMS_BSP=\"bsp1 bsp2 ...\"\' |
---|
[eb299afc] | 96 | echo |
---|