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(c) |
---|
7 | RTEMS_TOP(.) |
---|
8 | |
---|
9 | # Abort if trying to build inside of the source tree. |
---|
10 | if test -f VERSION; then |
---|
11 | rm -f config.cache config.log confdefs.h |
---|
12 | AC_MSG_ERROR([***] |
---|
13 | [Attempt to build inside of the source tree] |
---|
14 | [Please use a separate build directory, instead] ) |
---|
15 | fi |
---|
16 | |
---|
17 | AC_CANONICAL_SYSTEM |
---|
18 | AM_INIT_AUTOMAKE(rtems,$RTEMS_VERSION,no) |
---|
19 | AM_MAINTAINER_MODE |
---|
20 | |
---|
21 | dnl These option are only in here to let --help report all supported |
---|
22 | dnl options. |
---|
23 | RTEMS_ENABLE_MULTIPROCESSING |
---|
24 | RTEMS_ENABLE_POSIX |
---|
25 | RTEMS_ENABLE_ITRON |
---|
26 | RTEMS_ENABLE_NETWORKING |
---|
27 | RTEMS_ENABLE_RDBG |
---|
28 | RTEMS_ENABLE_INLINES |
---|
29 | RTEMS_ENABLE_CXX |
---|
30 | RTEMS_ENABLE_GCC28 |
---|
31 | RTEMS_ENABLE_LIBCDIR |
---|
32 | RTEMS_ENABLE_TESTS |
---|
33 | RTEMS_ENABLE_RTEMS_DEBUG |
---|
34 | RTEMS_ENABLE_RTEMSBSP(dummy) |
---|
35 | |
---|
36 | if test $host != $build; then |
---|
37 | AC_MSG_WARN([] |
---|
38 | [*** *** *** WARNING *** *** ***] |
---|
39 | [] |
---|
40 | [Entering BEYOND BLEEDING EDGE TERRITORY] |
---|
41 | [] |
---|
42 | [You are trying to build RTEMS Canadian cross] |
---|
43 | [If you really mean it, feel free to continue ...] |
---|
44 | [*** *** *** *** *** *** *** ***]) |
---|
45 | fi |
---|
46 | |
---|
47 | ## NOTES: |
---|
48 | ## The tools/*-directories situation is unclear |
---|
49 | ## * tools/build are host-native tools to be installed on the host. |
---|
50 | ## * tools/cpu are host-native or host-cross-target-tools |
---|
51 | ## * tools/update are build-host-native tools |
---|
52 | |
---|
53 | # these tools are built for the build environment |
---|
54 | # |
---|
55 | build_tools="tools/update" |
---|
56 | |
---|
57 | # these libraries are built for the host environment |
---|
58 | # |
---|
59 | host_libs="" |
---|
60 | |
---|
61 | # these tools are built for the host environment |
---|
62 | # |
---|
63 | host_tools="tools/build tools/cpu" |
---|
64 | |
---|
65 | # these libraries are built for the target environment, and are built after |
---|
66 | # the host libraries and the host tools (which may be a cross compiler) |
---|
67 | # |
---|
68 | target_libs="c" |
---|
69 | |
---|
70 | # these tools are built using the target libs, and are intended to run only |
---|
71 | # in the target environment |
---|
72 | # |
---|
73 | target_tools="" |
---|
74 | |
---|
75 | ## All tools belong in one of the five categories, and are assigned above. |
---|
76 | ## ${host_configdirs} is directories we build using the host tools. |
---|
77 | ## ${target_configdirs} is directories we build using the target tools. |
---|
78 | # |
---|
79 | host_configdirs="${host_libs} ${host_tools}" |
---|
80 | AC_SUBST(host_configdirs) |
---|
81 | |
---|
82 | target_configdirs="${target_libs} ${target_tools}" |
---|
83 | AC_SUBST(target_configdirs) |
---|
84 | |
---|
85 | RTEMS_TARGET_CONFIG_PREPARE |
---|
86 | target_subdir=${target_alias} |
---|
87 | |
---|
88 | RTEMS_HOST_CONFIG_PREPARE |
---|
89 | host_subdir=${host_alias} |
---|
90 | |
---|
91 | if test $build = $host; |
---|
92 | then |
---|
93 | BUILD_SUBDIRS="$build_tools $host_configdirs" |
---|
94 | |
---|
95 | if test $build = $target; |
---|
96 | then |
---|
97 | BUILD_SUBDIRS="$BUILD_SUBDIRS $target_configdirs"; |
---|
98 | else |
---|
99 | TARGET_SUBDIRS=`echo "$target_configdirs" | \ |
---|
100 | sed -e "s%\([[^ ]][[^ ]]*\)%$target_alias/\1%g"` |
---|
101 | fi |
---|
102 | else |
---|
103 | ## If building Canadian cross, disable the target directories |
---|
104 | target_configdirs="" |
---|
105 | BUILD_SUBDIRS="$build_tools" |
---|
106 | TARGET_SUBDIRS=`echo "$host_configdirs" | \ |
---|
107 | sed -e "s%\([[^ ]][[^ ]]*\)%$host_alias/\1%g"` |
---|
108 | fi |
---|
109 | |
---|
110 | AC_CONFIG_SUBDIRS($BUILD_SUBDIRS) |
---|
111 | AC_SUBST(TARGET_SUBDIRS) |
---|
112 | AC_SUBST(BUILD_SUBDIRS) |
---|
113 | |
---|
114 | AC_OUTPUT( |
---|
115 | Makefile |
---|
116 | tools/Makefile |
---|
117 | make/Makefile |
---|
118 | make/custom/Makefile |
---|
119 | make/Templates/Makefile |
---|
120 | make/compilers/Makefile |
---|
121 | doc/Makefile) |
---|
122 | |
---|
123 | RTEMS_TARGET_CONFIG_SUBDIRS |
---|
124 | RTEMS_HOST_CONFIG_SUBDIRS |
---|