source: rtems/c/src/configure.ac @ 51d35b2

4.104.114.84.95
Last change on this file since 51d35b2 was 51d35b2, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/21/03 at 11:42:53

2003-10-21 Ralf Corsepius <corsepiu@…>

  • aclocal/check-cpu.m4: Remove.
  • configure.ac: Merge-in former aclocal/check-cpu.m4.
  • Property mode set to 100644
File size: 6.9 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.57)
6AC_INIT([rtems-c-src],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
7AC_CONFIG_SRCDIR([optman])
8RTEMS_TOP(../..)
9
10RTEMS_ENABLE_CXX
11RTEMS_ENABLE_NETWORKING
12RTEMS_ENABLE_RDBG
13
14RTEMS_CANONICAL_TARGET_CPU
15RTEMS_CANONICAL_HOST
16
17AM_INIT_AUTOMAKE([no-define foreign 1.7.2])
18AM_MAINTAINER_MODE
19
20RTEMS_ENABLE_MULTILIB
21RTEMS_ENABLE_MULTIPROCESSING
22RTEMS_ENV_RTEMSBSP
23
24# Is this a supported CPU?
25AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
26# FIXME: Temporary hack
27if test -d "$srcdir/lib/libbsp/$RTEMS_CPU"; then
28  AC_MSG_RESULT(yes)
29else
30  AC_MSG_ERROR(no)
31fi
32
33RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
34
35RTEMS_CHECK_NETWORKING(RTEMS_BSP)
36RTEMS_CHECK_POSIX_API(RTEMS_BSP)
37AS_IF([test "$HAS_NETWORKING" = "yes"],[
38  AS_IF([test "$RTEMS_HAS_RDBG" = "yes"],[
39    RTEMS_CHECK_RDBG(RTEMS_BSP)
40  ])
41])
42
43AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen,no)
44AC_PROG_AWK
45
46AC_MSG_NOTICE([setting up make/custom])
47
48AS_MKDIR_P([make/custom])
49
50# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
51# directory into the build tree's <bsp>/make/custom subdirectories
52cfg_dir="${RTEMS_TOPdir}/make"
53CUSTOM_CFG_FILES=""
54f="${RTEMS_BSP}.cfg"
55while test -n "$f"; do
56  if test -r "${srcdir}/${cfg_dir}/custom/$f"; then
57    cp ${srcdir}/${cfg_dir}/custom/$f make/custom/$f
58    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
59    f=`grep "^include.*make/custom" ${srcdir}/${cfg_dir}/custom/$f \
60    | sed \
61      -e 's%^.*custom\/%%' \
62      -e s%\$\(RTEMS_HOST\)%${RTEMS_HOST}% \
63      -e 's%default\.cfg%%'`;
64  else break; fi;
65done
66cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg
67
68AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
69${MAKE-make} -f ${srcdir}/make/bsp.mak \
70RTEMS_BSP=${RTEMS_BSP} \
71RTEMS_HOST=${RTEMS_HOST} \
72BARE_CPU_MODEL=${BARE_CPU_MODEL} \
73RTEMS_ROOT=. make/${RTEMS_BSP}.cache
74
75# Read back the cache
76AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
77[. ./make/${RTEMS_BSP}.cache])
78RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
79AC_SUBST(RTEMS_CPU_MODEL)
80test -n "${RTEMS_CPU_MODEL}" && \
81  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
82
83AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
84[. ./make/${RTEMS_BSP}.cache])
85RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
86AC_SUBST(RTEMS_BSP_FAMILY)
87test -n "${RTEMS_BSP_FAMILY}" && \
88  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
89
90AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
91[. ./make/${RTEMS_BSP}.cache])
92CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS
93AC_SUBST(CPU_CFLAGS)
94test -n "${CPU_CFLAGS}" && \
95  ac_configure_args="$ac_configure_args 'CPU_CFLAGS=${CPU_CFLAGS}'"
96
97AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
98[. ./make/${RTEMS_BSP}.cache])
99CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
100AC_SUBST(CFLAGS_OPTIMIZE_V)
101test -n "${CFLAGS_OPTIMIZE_V}" && \
102  ac_configure_args="$ac_configure_args 'CFLAGS_OPTIMIZE_V=${CFLAGS_OPTIMIZE_V}'"
103
104AC_CACHE_CHECK([for CFLAGS_DEBUG_V],[ac_cv_env_CFLAGS_DEBUG_V],
105[. ./make/${RTEMS_BSP}.cache])
106CFLAGS_DEBUG_V=$ac_cv_env_CFLAGS_DEBUG_V
107AC_SUBST(CFLAGS_DEBUG_V)
108test -n "${CFLAGS_DEBUG_V}" && \
109  ac_configure_args="$ac_configure_args 'CFLAGS_DEBUG_V=${CFLAGS_DEBUG_V}'"
110
111RTEMS_PROG_CC_FOR_TARGET
112RTEMS_CANONICALIZE_TOOLS
113
114
115AC_SUBST(CUSTOM_CFG_FILES)
116AC_SUBST(cfg_dir)
117
118## Configure ${srcdir}/../../cpukit as exec/ if multilibs are disabled
119AS_IF([test x"$multilib" = x"no"],[
120  RTEMS_CHECK_MULTIPROCESSING
121  RTEMS_CONFIG_SUBDIR([exec],[../../cpukit],
122  ['--with-project-root=../../' '--enable-rtemsbsp=$RTEMS_BSP'
123  ])
124  BSP_SUBDIRS="exec"
125])
126
127## Note: the order of the directories below is essential
128AC_CONFIG_SUBDIRS([make])
129BSP_SUBDIRS="$BSP_SUBDIRS make"
130BSP_SUBDIRS="$BSP_SUBDIRS optman"
131
132RTEMS_CPU_SUBDIRS(lib/libcpu)
133if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
134  libcpu_cpu_subdir="${RTEMS_CPU}"
135else
136  libcpu_cpu_subdir=
137fi
138AC_SUBST(libcpu_cpu_subdir)
139
140# Is there code where there should be for this BSP?
141# The bare bsp is a special case as it is not under the RTEMS_CPU path
142if test "$RTEMS_BSP_FAMILY" = "bare" ; then
143  AC_CONFIG_SUBDIRS([lib/libbsp/bare])
144  AC_SUBST(libbsp_cpu_subdir,bare)
145else
146  RTEMS_CPU_SUBDIRS([lib/libbsp])
147  AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
148fi
149
150BSP_SUBDIRS="$BSP_SUBDIRS lib"
151BSP_SUBDIRS="$BSP_SUBDIRS libchip"
152BSP_SUBDIRS="$BSP_SUBDIRS libnetworking"
153BSP_SUBDIRS="$BSP_SUBDIRS librdbg"
154                                                         
155AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
156  AC_CONFIG_SUBDIRS([librtems++])
157  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
158])
159
160BSP_SUBDIRS="$BSP_SUBDIRS support"
161BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
162
163AC_ARG_ENABLE([ada],
164[AC_HELP_STRING([--enable-ada],[enable ada support])],
165[case "${enable_ada}" in
166  yes) ;;
167  no) ;;
168  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
169esac],[enable_ada=no])
170
171AS_IF([test x"$enable_ada" = x"yes"],[
172  AS_IF([test -d ${srcdir}/ada-tests],[
173    AC_CONFIG_SUBDIRS([ada-tests])
174    BSP_SUBDIRS="$BSP_SUBDIRS ada-tests"
175  ])
176])
177
178AS_IF([test -d ${srcdir}/tests],[
179    AC_CONFIG_SUBDIRS([tests])
180    BSP_SUBDIRS="$BSP_SUBDIRS tests"
181])
182
183AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
184
185AS_IF([test "$host_cpu" = "sparc"],[
186  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
187    [whether to enable ipalignment work-around])
188])
189
190AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
191AM_CONDITIONAL([HAS_RDBG],[test "$HAS_RDBG" = "yes"])
192AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
193AM_CONDITIONAL([HAS_MP],[test "$HAS_MP" = "yes"])
194
195# The posix bsp doesn't support libchip
196# FIXME: We should use a feature based check, here
197AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"])
198
199# The bare bsp doesn't have libbsp.a
200# FIXME: We should use a feature based check, here
201AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"])
202AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"])
203
204AM_CONDITIONAL(RPCTOOLS, test "$rpctools" != "no")
205
206RTEMS_PROJECT_ROOT
207
208# Explicitly list all Makefiles here
209AC_CONFIG_FILES([Makefile],
210[${MAKE} make/${RTEMS_BSP}.cache],
211[RTEMS_BSP=${RTEMS_BSP}
212 MAKE=${MAKE}])
213
214AC_CONFIG_FILES([
215support/Makefile
216
217libnetworking/Makefile
218libnetworking/pppd/Makefile
219libnetworking/rtems_servers/Makefile
220libnetworking/rtems_telnetd/Makefile
221libnetworking/rtems_webserver/Makefile
222libnetworking/wrapup/Makefile
223
224librdbg/Makefile
225librdbg/include/Makefile
226librdbg/include/rdbg/Makefile
227librdbg/include/rdbg/i386/Makefile
228librdbg/include/rdbg/powerpc/Makefile
229librdbg/include/rdbg/m68k/Makefile
230librdbg/src/Makefile
231librdbg/src/i386/Makefile
232librdbg/src/i386/any/Makefile
233librdbg/src/powerpc/Makefile
234librdbg/src/powerpc/new_exception_processing/Makefile
235librdbg/src/m68k/Makefile
236librdbg/src/m68k/any/Makefile
237
238libchip/Makefile
239libchip/network/Makefile
240libchip/rtc/Makefile
241libchip/serial/Makefile
242libchip/ide/Makefile
243
244optman/Makefile
245
246lib/Makefile
247
248lib/libcpu/Makefile
249
250lib/libbsp/Makefile
251lib/libbsp/shmdr/Makefile
252lib/libbsp/shared/Makefile
253
254wrapup/Makefile
255])
256
257AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.