[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
[33a105fb] | 2 | ## |
---|
[eb299afc] | 3 | |
---|
[0f77281] | 4 | AC_PREREQ([2.69]) |
---|
[fcb0cd46] | 5 | AC_INIT([rtems-c],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla]) |
---|
[1204f22] | 6 | AC_CONFIG_SRCDIR([TOOL_TARGETS]) |
---|
[eb299afc] | 7 | RTEMS_TOP(..) |
---|
| 8 | |
---|
| 9 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 10 | |
---|
[bb2b825] | 11 | AM_INIT_AUTOMAKE([no-define foreign 1.12.2]) |
---|
[eb299afc] | 12 | AM_MAINTAINER_MODE |
---|
| 13 | |
---|
[66387986] | 14 | ## These options are used within this file. |
---|
[1204f22] | 15 | RTEMS_ENABLE_RTEMSBSP |
---|
[eb299afc] | 16 | |
---|
[2d1daae] | 17 | # Set up rtems_bsp |
---|
[1204f22] | 18 | AS_IF([test x"$enable_rtemsbsp" = x"no"],[ |
---|
[2d1daae] | 19 | # --disable-rtemsbsp |
---|
[1204f22] | 20 | rtems_bsp="" |
---|
| 21 | ],[ |
---|
| 22 | AS_IF([test -z "$enable_rtemsbsp"], |
---|
[2d1daae] | 23 | [# --enable-rtemsbsp="" |
---|
| 24 | RTEMS_CHECK_BSPS(rtems_bsp)], |
---|
| 25 | [# --enable-rtemsbsp="list" |
---|
| 26 | rtems_bsp="$enable_rtemsbsp"]) |
---|
| 27 | ]) |
---|
[eb299afc] | 28 | |
---|
[2d1daae] | 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]) |
---|
[eb299afc] | 33 | |
---|
[2d1daae] | 34 | AS_IF([test -n "$bsp_cfg"], |
---|
| 35 | [ |
---|
| 36 | # retrieve bsp_family |
---|
| 37 | RTEMS_BSP_ALIAS([$_rtems_bsp],[rtems_bsp_family]) |
---|
[eb299afc] | 38 | |
---|
[309dbd0] | 39 | # Is there a configure script for the BSP? |
---|
[8d9d5bd] | 40 | AS_IF([test -r "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU/$rtems_bsp_family/configure"], |
---|
[2d1daae] | 41 | [RTEMS_BSP_LIST="$RTEMS_BSP_LIST $_rtems_bsp"]) |
---|
| 42 | ]) |
---|
[eb299afc] | 43 | done |
---|
| 44 | |
---|
| 45 | # |
---|
| 46 | # Compose the configuration arguments to be passed to c/src/configure |
---|
| 47 | # |
---|
[1204f22] | 48 | ## |
---|
[eb299afc] | 49 | ## Partially borrowed from autoconf-2.13 |
---|
| 50 | ## |
---|
| 51 | |
---|
| 52 | ## Adjust paths |
---|
[eab41f63] | 53 | _RTEMS_ADJUST_SRCDIR([rtems_bsp_configure],[src]) |
---|
| 54 | rtems_bsp_configure="$rtems_bsp_configure/configure" |
---|
[2fe08ccb] | 55 | RTEMS_CONFIGURE_ARGS_QUOTE([rtems_bsp_configure_args], |
---|
[45789f2] | 56 | [-enable-rtemsbsp=* | --enable-rtemsbsp=* ) ;;]) |
---|
[eb299afc] | 57 | |
---|
| 58 | rtems_bsp_configure="$rtems_bsp_configure $rtems_bsp_configure_args" |
---|
[1b7c9183] | 59 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-root=../../'" |
---|
| 60 | rtems_bsp_configure="$rtems_bsp_configure '--with-project-top=../../'" |
---|
[eb299afc] | 61 | AC_SUBST(rtems_bsp_configure) |
---|
| 62 | |
---|
| 63 | AC_SUBST(RTEMS_BSP_LIST) |
---|
| 64 | |
---|
[70810dc] | 65 | # Explicitly list all Makefiles here |
---|
[73dc152] | 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"; \\ |
---|
[92de6270] | 73 | \$(MKDIR_P) $bsp; \\ |
---|
[73dc152] | 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"]) |
---|
[66387986] | 80 | AC_OUTPUT |
---|
[2d1daae] | 81 | AS_IF([test -n "$RTEMS_BSP_LIST"],[ |
---|
[eb299afc] | 82 | echo |
---|
| 83 | echo target architecture: $target_cpu. |
---|
[2d1daae] | 84 | echo available BSPs: $RTEMS_BSP_LIST. |
---|
[7b79761] | 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 ...\"\' |
---|
[eb299afc] | 87 | echo |
---|
[2d1daae] | 88 | ]) |
---|