source: rtems/c/src/configure.ac @ d4181d5

4.104.114.84.95
Last change on this file since d4181d5 was d4181d5, checked in by Ralf Corsepius <ralf.corsepius@…>, on Dec 7, 2002 at 1:08:25 PM

2002-12-07 Ralf Corsepius <corsepiu@…>

  • configure.ac: Append RTEMS_CPU_MODEL to ac_configure_args. Resort cache-checking.
  • Property mode set to 100644
File size: 6.0 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.52)
6AC_INIT([rtems-c-src],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com])
7AC_CONFIG_SRCDIR([optman])
8RTEMS_TOP(../..)
9AC_CONFIG_AUX_DIR(../..)
10
11RTEMS_ENABLE_CXX
12RTEMS_ENABLE_NETWORKING
13RTEMS_ENABLE_RDBG
14
15RTEMS_CANONICAL_TARGET_CPU
16RTEMS_CANONICAL_HOST
17
18AM_INIT_AUTOMAKE([no-define foreign 1.6])
19AM_MAINTAINER_MODE
20
21RTEMS_PROG_CC_FOR_TARGET
22RTEMS_CANONICALIZE_TOOLS
23
24RTEMS_ENABLE_MULTILIB
25RTEMS_ENABLE_MULTIPROCESSING
26RTEMS_ENV_RTEMSBSP
27RTEMS_CHECK_CPU
28RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
29
30RTEMS_CHECK_NETWORKING(RTEMS_BSP)
31
32AC_MSG_NOTICE([setting up make/custom])
33
34AS_MKDIR_P([make/custom])
35
36# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
37# directory into the build tree's <bsp>/make/custom subdirectories
38cfg_dir="${RTEMS_TOPdir}/make"
39CUSTOM_CFG_FILES=""
40f="${RTEMS_BSP}.cfg"
41while test -n "$f"; do
42  if test -r "${srcdir}/${cfg_dir}/custom/$f"; then
43    cp ${srcdir}/${cfg_dir}/custom/$f make/custom/$f
44    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
45    f=`grep "^include.*make/custom" ${srcdir}/${cfg_dir}/custom/$f \
46    | sed \
47      -e 's%^.*custom\/%%' \
48      -e s%\$\(RTEMS_HOST\)%${RTEMS_HOST}% \
49      -e 's%default\.cfg%%'`;
50  else break; fi;
51done
52cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg
53
54AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
55${MAKE-make} -f ${srcdir}/make/bsp.mak \
56RTEMS_BSP=${RTEMS_BSP} \
57RTEMS_HOST=${RTEMS_HOST} \
58BARE_CPU_MODEL=${BARE_CPU_MODEL} \
59RTEMS_ROOT=. make/${RTEMS_BSP}.cache
60
61# Read back the cache
62AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [rtems_cv_RTEMS_CPU_MODEL],
63[. $RTEMS_TOPdir/c/${RTEMS_BSP}/make/${RTEMS_BSP}.cache])
64RTEMS_CPU_MODEL=$rtems_cv_RTEMS_CPU_MODEL
65AC_SUBST(RTEMS_CPU_MODEL)
66test -n "${RTEMS_CPU_MODEL}" && \
67  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
68
69AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[rtems_cv_RTEMS_BSP_FAMILY],
70[. $RTEMS_TOPdir/c/${RTEMS_BSP}/make/${RTEMS_BSP}.cache])
71RTEMS_BSP_FAMILY=$rtems_cv_RTEMS_BSP_FAMILY
72AC_SUBST(RTEMS_BSP_FAMILY)
73test -n "${RTEMS_BSP_FAMILY}" && \
74  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
75
76AC_CACHE_CHECK([for RTEMS_BSP_CFLAGS],[rtems_cv_RTEMS_BSP_CFLAGS],
77[. $RTEMS_TOPdir/c/${RTEMS_BSP}/make/${RTEMS_BSP}.cache])
78RTEMS_BSP_CFLAGS=$rtems_cv_RTEMS_BSP_CFLAGS
79AC_SUBST(RTEMS_BSP_CFLAGS)
80test -n "${RTEMS_BSP_CFLAGS}" && \
81  ac_configure_args="$ac_configure_args 'CPU_CFLAGS=${RTEMS_BSP_CFLAGS}'"
82
83AC_CACHE_CHECK([for RTEMS_BSP_CFLAGS_OPTIMIZE_V],[rtems_cv_RTEMS_BSP_CFLAGS_OPTIMIZE_V],
84[. $RTEMS_TOPdir/c/${RTEMS_BSP}/make/${RTEMS_BSP}.cache])
85RTEMS_BSP_CFLAGS_OPTIMIZE_V=$rtems_cv_RTEMS_BSP_CFLAGS_OPTIMIZE_V
86AC_SUBST(RTEMS_BSP_CFLAGS_OPTIMIZE_V)
87test -n "{RTEMS_BSP_CFLAGS_OPTIMIZE_V}" && \
88  ac_configure_args="$ac_configure_args 'CFLAGS_OPTIMIZE_V=${RTEMS_BSP_CFLAGS_OPTIMIZE_V}'"
89
90AC_CACHE_CHECK([for RTEMS_BSP_CFLAGS_DEBUG_V],[rtems_cv_RTEMS_BSP_CFLAGS_DEBUG_V],
91[. $RTEMS_TOPdir/c/${RTEMS_BSP}/make/${RTEMS_BSP}.cache])
92RTEMS_BSP_CFLAGS_DEBUG_V=$rtems_cv_RTEMS_BSP_CFLAGS_DEBUG_V
93AC_SUBST(RTEMS_BSP_CFLAGS_DEBUG_V)
94test -n "${RTEMS_BSP_CFLAGS_DEBUG_V}" && \
95  ac_configure_args="$ac_configure_args 'CFLAGS_DEBUG_V=${RTEMS_BSP_CFLAGS_DEBUG_V}'"
96
97AC_CACHE_CHECK([for RTEMS_BSP_CFLAGS_PROFILE_V],[rtems_cv_RTEMS_BSP_CFLAGS_PROFILE_V],
98[. $RTEMS_TOPdir/c/${RTEMS_BSP}/make/${RTEMS_BSP}.cache])
99RTEMS_BSP_CFLAGS_PROFILE_V=$rtems_cv_RTEMS_BSP_CFLAGS_PROFILE_V
100AC_SUBST(RTEMS_BSP_CFLAGS_PROFILE_V)
101test -n "${RTEMS_BSP_CFLAGS_PROFILE_V}" && \
102  ac_configure_args="$ac_configure_args 'CFLAGS_PROFILE_V=${RTEMS_BSP_CFLAGS_PROFILE_V}'"
103
104
105AC_SUBST(CUSTOM_CFG_FILES)
106AC_SUBST(cfg_dir)
107
108## Configure ${srcdir}/../../cpukit as exec/ if multilibs are disabled
109AS_IF([test x"$multilib" = x"no"],[
110  RTEMS_CHECK_MULTIPROCESSING
111  RTEMS_CONFIG_SUBDIR([exec],[../../cpukit],
112  ['--with-project-root=../../' '--enable-rtemsbsp=$RTEMS_BSP'
113  ])
114  BSP_SUBDIRS="exec"
115])
116
117## Note: the order of the directories below is essential
118AC_CONFIG_SUBDIRS([make])
119BSP_SUBDIRS="$BSP_SUBDIRS make"
120AC_CONFIG_SUBDIRS([optman])
121BSP_SUBDIRS="$BSP_SUBDIRS optman"
122AC_CONFIG_SUBDIRS([lib/libcpu])
123BSP_SUBDIRS="$BSP_SUBDIRS lib/libcpu"
124AC_CONFIG_SUBDIRS([lib/libbsp])
125BSP_SUBDIRS="$BSP_SUBDIRS lib/libbsp"
126AC_CONFIG_SUBDIRS([libmisc])
127BSP_SUBDIRS="$BSP_SUBDIRS libmisc"
128
129AS_IF([test "$RTEMS_CPU" != "unix"],[
130## HACK: Suppress libchip for unix
131  AC_CONFIG_SUBDIRS([libchip])
132  BSP_SUBDIRS="$BSP_SUBDIRS libchip"
133])
134
135AS_IF([test "$HAS_NETWORKING" = "yes"],[
136  AC_CONFIG_SUBDIRS(libnetworking)
137  BSP_SUBDIRS="$BSP_SUBDIRS libnetworking"
138  AS_IF([test "$RTEMS_HAS_RDBG" = "yes"],[
139    RTEMS_CHECK_RDBG(RTEMS_BSP)
140  ])
141])
142
143AS_IF([test "$HAS_RDBG" = "yes"],[
144  AC_CONFIG_SUBDIRS([librdbg])
145  BSP_SUBDIRS="$BSP_SUBDIRS librdbg"
146])
147
148AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
149  AC_CONFIG_SUBDIRS([librtems++])
150  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
151])
152
153BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
154
155AC_ARG_ENABLE([ada],
156[AC_HELP_STRING([--enable-ada],[enable ada support])],
157[case "${enable_ada}" in
158  yes) ;;
159  no) ;;
160  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
161esac],[enable_ada=no])
162
163AS_IF([test x"$enable_ada" = x"yes"],[
164  AS_IF([test -d ${srcdir}/ada-tests],[
165    AC_CONFIG_SUBDIRS([ada-tests])
166    BSP_SUBDIRS="$BSP_SUBDIRS ada-tests"
167  ])
168])
169
170AC_CONFIG_SUBDIRS([tests])
171BSP_SUBDIRS="$BSP_SUBDIRS tests"
172
173AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
174
175AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
176AM_CONDITIONAL([HAS_RDBG],[test "$HAS_RDBG" = "yes"])
177
178# The posix bsp doesn't support libchip
179# FIXME: We should use a feature based check, here
180AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"])
181
182# The bare bsp doesn't have libbsp.a
183# FIXME: We should use a feature based check, here
184AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"])
185AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"])
186
187RTEMS_PROJECT_ROOT
188
189# Explicitly list all Makefiles here
190AC_CONFIG_FILES([Makefile],
191[${MAKE} make/${RTEMS_BSP}.cache],
192[RTEMS_BSP=${RTEMS_BSP}
193 MAKE=${MAKE}])
194
195AC_CONFIG_FILES([wrapup/Makefile])
196
197AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.