1 | ## $Id$ |
---|
2 | |
---|
3 | m4_define([M4_RTEMS_API],[4.7]) |
---|
4 | m4_define([M4_RTEMS_VERSION],[4.6.99.3]) |
---|
5 | m4_define([M4_RTEMS_RELEASE],[0]) |
---|
6 | |
---|
7 | AC_PREREQ(2.59) |
---|
8 | AC_INIT([rtemsrpms],[M4_RTEMS_RELEASE],[rtems-bugs@rtems.com]) |
---|
9 | AC_CONFIG_AUX_DIR(.) |
---|
10 | |
---|
11 | AC_CANONICAL_HOST |
---|
12 | |
---|
13 | AC_PREFIX_DEFAULT([/opt/rtems-][M4_RTEMS_API]) |
---|
14 | |
---|
15 | AM_INIT_AUTOMAKE([1.9]) |
---|
16 | |
---|
17 | rpmprefix="[rtems-]M4_RTEMS_API[-]" |
---|
18 | |
---|
19 | case "$prefix" in |
---|
20 | /usr/local) |
---|
21 | rpmprefix="local-" |
---|
22 | ;; |
---|
23 | /opt/rtems) |
---|
24 | ;; |
---|
25 | NONE|$ac_default_prefix) |
---|
26 | prefix=$ac_default_prefix |
---|
27 | ;; |
---|
28 | *) |
---|
29 | rpmprefix="custom-" |
---|
30 | ;; |
---|
31 | esac |
---|
32 | |
---|
33 | AC_ARG_ENABLE([rpmprefix], |
---|
34 | [ --enable-rpmprefix=<rpmprefix> prefix rpms],[ |
---|
35 | case "$enable_rpmprefix" in |
---|
36 | yes) # ignore, use default |
---|
37 | ;; |
---|
38 | no) # use default |
---|
39 | ;; |
---|
40 | *) # presume user knows what he is doing |
---|
41 | rpmprefix=$enable_rpmprefix;; |
---|
42 | esac |
---|
43 | ]) |
---|
44 | |
---|
45 | AC_MSG_CHECKING([for rpm database]) |
---|
46 | rpmdbpath= |
---|
47 | AC_ARG_ENABLE([rpmdbpath], |
---|
48 | [ --enable-rpmdbpath=<rpmdbpath> rpm database path],[ |
---|
49 | case "$enable_rpmdbpath" in |
---|
50 | yes) # ignore, use default |
---|
51 | ;; |
---|
52 | no) # use default |
---|
53 | ;; |
---|
54 | *) # presume user knows what he is doing |
---|
55 | rpmdbpath="--dbpath $enable_rpmdbpath";; |
---|
56 | esac |
---|
57 | ]) |
---|
58 | AS_IF([test -z $rpmdbpath], |
---|
59 | [AC_MSG_RESULT([system])], |
---|
60 | [AC_MSG_RESULT([$rpmdbpath])]) |
---|
61 | |
---|
62 | AC_MSG_CHECKING([for bootstrap]) |
---|
63 | bootstrap=no |
---|
64 | AC_ARG_ENABLE([bootstrap], |
---|
65 | [ --enable-bootstrap=<bootstap> bootstrap RTEMS],[ |
---|
66 | case "$enable_bootstrap" in |
---|
67 | yes|no) # ignore, use default |
---|
68 | bootstrap=$enable_bootstrap;; |
---|
69 | *) # use default |
---|
70 | ;; |
---|
71 | esac |
---|
72 | ]) |
---|
73 | AC_MSG_RESULT([$bootstrap]) |
---|
74 | |
---|
75 | dnl The total list: |
---|
76 | dnl arm avr h8300 i386 m68k mips powerpc sh sparc tic4x |
---|
77 | AC_MSG_CHECKING([for targets]) |
---|
78 | AC_ARG_ENABLE([targets], |
---|
79 | AS_HELP_STRING([--enable-targets=<targets>],[build for targets <targets>]), |
---|
80 | [targets="$enable_targets"], |
---|
81 | [targets="arm i386 m68k mips powerpc sh sparc tic4x"] |
---|
82 | ) |
---|
83 | AC_MSG_RESULT([$targets]) |
---|
84 | |
---|
85 | AC_MSG_CHECKING([for bsps]) |
---|
86 | bsps="%{nil}" |
---|
87 | AC_ARG_ENABLE([bsps], |
---|
88 | [ --enable-bsps=<yes/bsps> BSP list],[ |
---|
89 | case "$enable_bsps" in |
---|
90 | yes) # ignore, use default |
---|
91 | ;; |
---|
92 | no) |
---|
93 | bsps="RTEMS_BSP=\"\"" |
---|
94 | ;; |
---|
95 | *) # take a the list to build |
---|
96 | bsps="RTEMS_BSP=\"$enable_bsps\"" |
---|
97 | ;; |
---|
98 | esac |
---|
99 | ]) |
---|
100 | AS_IF([test x"$bsps" = x"%{nil}"], |
---|
101 | [AC_MSG_RESULT([all])], |
---|
102 | [AC_MSG_RESULT([$bsps])]) |
---|
103 | |
---|
104 | AC_SUBST(RTEMS_API, [M4_RTEMS_API]) |
---|
105 | AC_SUBST(RTEMS_VERSION, [M4_RTEMS_VERSION]) |
---|
106 | AC_SUBST(RTEMS_RELEASE, [M4_RTEMS_RELEASE]) |
---|
107 | AC_SUBST(PREFIX, [$prefix]) |
---|
108 | AC_SUBST(TARGETS, [$targets]) |
---|
109 | AC_SUBST(RPMPREFIX, [$rpmprefix]) |
---|
110 | AC_SUBST(RPMDBPATH, [$rpmdbpath]) |
---|
111 | AC_SUBST(RTEMS_BOOTSTRAP, [$bootstrap]) |
---|
112 | AC_SUBST(RTEMS_BSP, [$bsps]) |
---|
113 | |
---|
114 | AC_CONFIG_FILES([Makefile rtems.spec]) |
---|
115 | |
---|
116 | AC_OUTPUT |
---|