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