[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
| 2 | ## |
---|
| 3 | ## $Id$ |
---|
[eb299afc] | 4 | |
---|
[ba2c04f] | 5 | AC_PREREQ(2.60) |
---|
[fcb0cd46] | 6 | AC_INIT([rtems-c],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) |
---|
[1204f22] | 7 | AC_CONFIG_SRCDIR([TOOL_TARGETS]) |
---|
[eb299afc] | 8 | RTEMS_TOP(..) |
---|
| 9 | |
---|
| 10 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 11 | |
---|
[ba2c04f] | 12 | AM_INIT_AUTOMAKE([no-define foreign 1.10]) |
---|
[eb299afc] | 13 | AM_MAINTAINER_MODE |
---|
| 14 | |
---|
[66387986] | 15 | ## These options are used within this file. |
---|
[1204f22] | 16 | RTEMS_ENABLE_RTEMSBSP |
---|
[eb299afc] | 17 | |
---|
[2d1daae] | 18 | # Set up rtems_bsp |
---|
[1204f22] | 19 | AS_IF([test x"$enable_rtemsbsp" = x"no"],[ |
---|
[2d1daae] | 20 | # --disable-rtemsbsp |
---|
[1204f22] | 21 | rtems_bsp="" |
---|
| 22 | ],[ |
---|
| 23 | AS_IF([test -z "$enable_rtemsbsp"], |
---|
[2d1daae] | 24 | [# --enable-rtemsbsp="" |
---|
| 25 | RTEMS_CHECK_BSPS(rtems_bsp)], |
---|
| 26 | [# --enable-rtemsbsp="list" |
---|
| 27 | rtems_bsp="$enable_rtemsbsp"]) |
---|
| 28 | ]) |
---|
[eb299afc] | 29 | |
---|
[2d1daae] | 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]) |
---|
[eb299afc] | 34 | |
---|
[2d1daae] | 35 | AS_IF([test -n "$bsp_cfg"], |
---|
| 36 | [ |
---|
| 37 | # retrieve bsp_family |
---|
| 38 | RTEMS_BSP_ALIAS([$_rtems_bsp],[rtems_bsp_family]) |
---|
[eb299afc] | 39 | |
---|
| 40 | # Is there code where there should be for this BSP? |
---|
[2d1daae] | 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";; |
---|
[eb299afc] | 44 | esac |
---|
[2d1daae] | 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 | ]) |
---|
[eb299afc] | 50 | done |
---|
| 51 | |
---|
| 52 | # |
---|
| 53 | # Compose the configuration arguments to be passed to c/src/configure |
---|
| 54 | # |
---|
[1204f22] | 55 | ## |
---|
[eb299afc] | 56 | ## Partially borrowed from autoconf-2.13 |
---|
| 57 | ## |
---|
| 58 | |
---|
| 59 | ## Adjust paths |
---|
[eab41f63] | 60 | _RTEMS_ADJUST_SRCDIR([rtems_bsp_configure],[src]) |
---|
| 61 | rtems_bsp_configure="$rtems_bsp_configure/configure" |
---|
[2fe08ccb] | 62 | RTEMS_CONFIGURE_ARGS_QUOTE([rtems_bsp_configure_args], |
---|
[45789f2] | 63 | [-enable-rtemsbsp=* | --enable-rtemsbsp=* ) ;;]) |
---|
[eb299afc] | 64 | |
---|
| 65 | rtems_bsp_configure="$rtems_bsp_configure $rtems_bsp_configure_args" |
---|
[1b7c9183] | 66 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-root=../../'" |
---|
| 67 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-top=../../'" |
---|
[eb299afc] | 68 | AC_SUBST(rtems_bsp_configure) |
---|
| 69 | |
---|
| 70 | AC_SUBST(RTEMS_BSP_LIST) |
---|
| 71 | |
---|
[70810dc] | 72 | # Explicitly list all Makefiles here |
---|
[73dc152] | 73 | AC_CONFIG_FILES([Makefile],[ |
---|
| 74 | for bsp in : $RTEMS_BSP_LIST; do test "x$bsp" = x: && continue |
---|
| 75 | cat >> Makefile << BSPEOF |
---|
| 76 | |
---|
| 77 | $bsp: src/configure |
---|
| 78 | @set fnord \$(MAKEFLAGS); amf=\[$]\[$]2; \\ |
---|
| 79 | echo "Configuring RTEMS_BSP=$bsp"; \\ |
---|
[92de6270] | 80 | \$(MKDIR_P) $bsp; \\ |
---|
[73dc152] | 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; |
---|
| 84 | BSPEOF |
---|
| 85 | done |
---|
| 86 | ],[RTEMS_BSP_LIST="$RTEMS_BSP_LIST"]) |
---|
[66387986] | 87 | AC_OUTPUT |
---|
[2d1daae] | 88 | AS_IF([test -n "$RTEMS_BSP_LIST"],[ |
---|
[eb299afc] | 89 | echo |
---|
| 90 | echo target architecture: $target_cpu. |
---|
[2d1daae] | 91 | echo available BSPs: $RTEMS_BSP_LIST. |
---|
[7b79761] | 92 | echo \'${MAKE} all\' will build the following BSPs: $RTEMS_BSP_LIST. |
---|
| 93 | echo other BSPs can be built with \'${MAKE} RTEMS_BSP=\"bsp1 bsp2 ...\"\' |
---|
[eb299afc] | 94 | echo |
---|
[2d1daae] | 95 | ]) |
---|