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