summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: 53d6a9709e2ee274ca3ed06a27087d9175d4a62c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
dnl Process this file with autoconf to produce a configure script.
dnl
dnl  $Id$

AC_PREREQ(2.13)
AC_INIT(c)
RTEMS_TOP(.)

# Abort if trying to build inside of the source tree.
if test -f VERSION; then
  rm -f config.cache config.log confdefs.h
  AC_MSG_ERROR([***]
    [Attempt to build inside of the source tree]
    [Please use a separate build directory, instead] )
fi

AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(rtems,$RTEMS_VERSION,no)
AM_MAINTAINER_MODE

dnl These option are only in here to let --help report all supported
dnl options.
RTEMS_ENABLE_MULTIPROCESSING
RTEMS_ENABLE_POSIX
RTEMS_ENABLE_ITRON
RTEMS_ENABLE_NETWORKING
RTEMS_ENABLE_RDBG
RTEMS_ENABLE_INLINES
RTEMS_ENABLE_CXX
RTEMS_ENABLE_GCC28
RTEMS_ENABLE_LIBCDIR
RTEMS_ENABLE_TESTS  
RTEMS_ENABLE_RTEMS_DEBUG
RTEMS_ENABLE_RTEMSBSP(dummy)

if test $host != $build; then
AC_MSG_WARN([]
[*** *** *** WARNING *** *** ***]
[]
[Entering BEYOND BLEEDING EDGE TERRITORY]
[]
[You are trying to build RTEMS Canadian cross]
[If you really mean it, feel free to continue ...]
[*** *** *** *** *** *** *** ***])
fi

## NOTES:
## The tools/*-directories situation is unclear
## * tools/build are host-native tools to be installed on the host.
## * tools/cpu are host-native or host-cross-target-tools
## * tools/update are build-host-native tools

# these tools are built for the build environment
#
build_tools="tools/update"

# these libraries are built for the host environment
#
host_libs=""

# these tools are built for the host environment
#
host_tools="tools/build tools/cpu"

# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
#
target_libs="c"

# these tools are built using the target libs, and are intended to run only
# in the target environment
#
target_tools=""

## All tools belong in one of the five categories, and are assigned above.
## ${host_configdirs} is directories we build using the host tools.
## ${target_configdirs} is directories we build using the target tools.
#
host_configdirs="${host_libs} ${host_tools}"
AC_SUBST(host_configdirs)

target_configdirs="${target_libs} ${target_tools}"
AC_SUBST(target_configdirs)

RTEMS_TARGET_CONFIG_PREPARE
target_subdir=${target_alias}

RTEMS_HOST_CONFIG_PREPARE
host_subdir=${host_alias}

if test $build = $host;
then
  BUILD_SUBDIRS="$build_tools $host_configdirs"

  if test $build = $target;
  then
    BUILD_SUBDIRS="$BUILD_SUBDIRS $target_configdirs";
  else
    TARGET_SUBDIRS=`echo "$target_configdirs" | \
      sed -e "s%\([[^ ]][[^ ]]*\)%$target_alias/\1%g"`
  fi
else
## If building Canadian cross, disable the target directories
  target_configdirs=""
  BUILD_SUBDIRS="$build_tools"
  TARGET_SUBDIRS=`echo "$host_configdirs" | \
    sed -e "s%\([[^ ]][[^ ]]*\)%$host_alias/\1%g"`
fi

AC_CONFIG_SUBDIRS($BUILD_SUBDIRS)
AC_SUBST(TARGET_SUBDIRS)
AC_SUBST(BUILD_SUBDIRS)

AC_OUTPUT(
Makefile
tools/Makefile
make/Makefile
make/custom/Makefile
make/Templates/Makefile
make/compilers/Makefile 
doc/Makefile)

RTEMS_TARGET_CONFIG_SUBDIRS
RTEMS_HOST_CONFIG_SUBDIRS