[66387986] | 1 | ## Process this file with autoconf to produce a configure script. |
---|
| 2 | ## |
---|
| 3 | ## $Id$ |
---|
[eb299afc] | 4 | |
---|
[66387986] | 5 | AC_PREREQ(2.52) |
---|
| 6 | AC_INIT |
---|
| 7 | AC_CONFIG_SRCDIR([src]) |
---|
[eb299afc] | 8 | RTEMS_TOP(..) |
---|
| 9 | AC_CONFIG_AUX_DIR(..) |
---|
| 10 | |
---|
| 11 | RTEMS_CANONICAL_TARGET_CPU |
---|
| 12 | |
---|
| 13 | AM_INIT_AUTOMAKE(rtems-c,$RTEMS_VERSION,no) |
---|
| 14 | AM_MAINTAINER_MODE |
---|
| 15 | |
---|
[66387986] | 16 | ## These options are used within this file. |
---|
[eb299afc] | 17 | RTEMS_ENABLE_BARE |
---|
| 18 | RTEMS_ENABLE_RTEMSBSP(rtems_bsp) |
---|
| 19 | |
---|
| 20 | RTEMS_CHECK_CPU |
---|
| 21 | RTEMS_CANONICAL_HOST |
---|
| 22 | |
---|
| 23 | if test -z "$rtems_bsp"; then |
---|
| 24 | RTEMS_CHECK_BSPS(rtems_bsp) |
---|
| 25 | fi |
---|
| 26 | |
---|
| 27 | for i in $rtems_bsp; do |
---|
| 28 | |
---|
| 29 | # make sure there is a make/custom file for the bsp |
---|
| 30 | RTEMS_CHECK_CUSTOM_BSP(i) |
---|
| 31 | |
---|
| 32 | RTEMS_BSP_ALIAS($i,bspdir) |
---|
| 33 | |
---|
| 34 | # Is there code where there should be for this BSP? |
---|
| 35 | # The bare bsp is a special case as it is not under the RTEMS_CPU path |
---|
[b62a92c] | 36 | case $bspdir in |
---|
[eb299afc] | 37 | bare) |
---|
| 38 | bspcpudir= |
---|
| 39 | ;; |
---|
| 40 | *) |
---|
| 41 | bspcpudir=$RTEMS_CPU/ |
---|
| 42 | ;; |
---|
| 43 | esac |
---|
| 44 | |
---|
| 45 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then |
---|
| 46 | RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i" |
---|
| 47 | else |
---|
| 48 | AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for $i]) |
---|
| 49 | fi |
---|
| 50 | done |
---|
| 51 | |
---|
| 52 | # |
---|
| 53 | # Compose the configuration arguments to be passed to c/src/configure |
---|
| 54 | # |
---|
| 55 | ## |
---|
| 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" |
---|
[eb299afc] | 62 | |
---|
| 63 | ## Remove --cache-file, --srcdir and --enable-rtemsbsp arguments |
---|
| 64 | ## so they do not pile up |
---|
| 65 | rtems_bsp_configure_args= |
---|
| 66 | for ac_arg in $ac_configure_args; do |
---|
| 67 | if test -n "$ac_prev"; then |
---|
| 68 | ac_prev= |
---|
| 69 | continue |
---|
| 70 | fi |
---|
| 71 | case "$ac_arg" in |
---|
| 72 | -cache-file | --cache-file | --cache-fil | --cache-fi \ |
---|
| 73 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) |
---|
| 74 | ac_prev=cache_file ;; |
---|
| 75 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ |
---|
| 76 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) |
---|
| 77 | ;; |
---|
| 78 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) |
---|
| 79 | ac_prev=srcdir ;; |
---|
| 80 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
| 81 | ;; |
---|
[ecd5441] | 82 | -enable-rtemsbsp=* | --enable-rtemsbsp=*) ;; |
---|
[eb299afc] | 83 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) |
---|
| 84 | ;; |
---|
| 85 | *) rtems_bsp_configure_args="$rtems_bsp_configure_args $ac_arg" ;; |
---|
| 86 | esac |
---|
| 87 | done |
---|
| 88 | |
---|
| 89 | rtems_bsp_configure="$rtems_bsp_configure $rtems_bsp_configure_args" |
---|
| 90 | AC_SUBST(rtems_bsp_configure) |
---|
| 91 | |
---|
| 92 | AC_SUBST(RTEMS_BSP_LIST) |
---|
| 93 | |
---|
[d6c83529] | 94 | AC_CONFIG_SUBDIRS(make) |
---|
| 95 | |
---|
[70810dc] | 96 | # Explicitly list all Makefiles here |
---|
[66387986] | 97 | AC_CONFIG_FILES([Makefile |
---|
| 98 | ]) |
---|
| 99 | AC_OUTPUT |
---|
[eb299afc] | 100 | |
---|
| 101 | echo |
---|
| 102 | echo target architecture: $target_cpu. |
---|
| 103 | echo available BSPs: $rtems_bsp. |
---|
[7b79761] | 104 | echo \'${MAKE} all\' will build the following BSPs: $RTEMS_BSP_LIST. |
---|
| 105 | echo other BSPs can be built with \'${MAKE} RTEMS_BSP=\"bsp1 bsp2 ...\"\' |
---|
[eb299afc] | 106 | echo |
---|