source: rtems/c/src/configure.ac @ 789694a1

4.104.114.84.95
Last change on this file since 789694a1 was 789694a1, checked in by Ralf Corsepius <ralf.corsepius@…>, on Feb 20, 2004 at 1:22:04 AM

2004-02-20 Ralf Corsepius <corsepiu@…>

  • acinclude.m4: Fix loosing arguments when configuring cpukit and testsuites (Was exposed with --enable-multilib, only). Remove RTEMS_SUBCONFIGURE_ARGS_QUOTE. RTEMS_CONFIG_SUBDIR. Add RTEMS_BSP_CONFIG_SUBDIR.
  • configure.ac: Reflect changes to acinclude.m4. Reflect new args to testsuites's configure.
  • aclocal/rtems-top.m4: Remove ENDIF hack. Rework and fix setting up PROJECT_TOPdir (PACKHEX wasn't found).
  • Property mode set to 100644
File size: 7.3 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.59)
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
15
16AM_INIT_AUTOMAKE([no-define subdir-objects no-exeext foreign 1.8.2])
17AM_MAINTAINER_MODE
18
19RTEMS_ENABLE_MULTILIB
20RTEMS_ENABLE_MULTIPROCESSING
21RTEMS_ENV_RTEMSBSP
22
23# Is this a supported CPU?
24AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
25# FIXME: Temporary hack
26if test -d "$srcdir/lib/libbsp/$RTEMS_CPU"; then
27  AC_MSG_RESULT(yes)
28else
29  AC_MSG_ERROR(no)
30fi
31
32RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
33
34RTEMS_CHECK_NETWORKING(RTEMS_BSP)
35RTEMS_CHECK_POSIX_API(RTEMS_BSP)
36AS_IF([test "$HAS_NETWORKING" = "yes"],[
37  AS_IF([test "$RTEMS_HAS_RDBG" = "yes"],[
38    RTEMS_CHECK_RDBG(RTEMS_BSP)
39  ])
40])
41
42AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen,no)
43AC_PROG_AWK
44
45AC_MSG_NOTICE([setting up make/custom])
46
47AS_MKDIR_P([make/custom])
48
49# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
50# directory into the build tree's <bsp>/make/custom subdirectories
51cfg_dir="${RTEMS_TOPdir}/make"
52CUSTOM_CFG_FILES=""
53f="${RTEMS_BSP}.cfg"
54while test -n "$f"; do
55  if test -r "${srcdir}/${cfg_dir}/custom/$f"; then
56    cp ${srcdir}/${cfg_dir}/custom/$f make/custom/$f
57    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
58    f=`grep "^include.*make/custom" ${srcdir}/${cfg_dir}/custom/$f \
59    | sed \
60      -e 's%^.*custom\/%%' \
61      -e s%\$\(RTEMS_HOST\)%${RTEMS_HOST}% \
62      -e 's%default\.cfg%%'`;
63  else break; fi;
64done
65cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg
66
67AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
68${MAKE-make} -f ${srcdir}/make/bsp.mak \
69RTEMS_BSP=${RTEMS_BSP} \
70RTEMS_HOST=${RTEMS_HOST} \
71BARE_CPU_MODEL=${BARE_CPU_MODEL} \
72RTEMS_ROOT=. make/${RTEMS_BSP}.cache
73
74# Read back the cache
75AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
76[. ./make/${RTEMS_BSP}.cache])
77RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
78AC_SUBST(RTEMS_CPU_MODEL)
79test -n "${RTEMS_CPU_MODEL}" && \
80  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
81
82AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
83[. ./make/${RTEMS_BSP}.cache])
84RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
85AC_SUBST(RTEMS_BSP_FAMILY)
86test -n "${RTEMS_BSP_FAMILY}" && \
87  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
88
89AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
90[. ./make/${RTEMS_BSP}.cache])
91CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS
92AC_SUBST(CPU_CFLAGS)
93test -n "${CPU_CFLAGS}" && \
94  ac_configure_args="$ac_configure_args 'CPU_CFLAGS=${CPU_CFLAGS}'"
95
96AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
97[. ./make/${RTEMS_BSP}.cache])
98CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
99AC_SUBST(CFLAGS_OPTIMIZE_V)
100test -n "${CFLAGS_OPTIMIZE_V}" && \
101  ac_configure_args="$ac_configure_args 'CFLAGS_OPTIMIZE_V=${CFLAGS_OPTIMIZE_V}'"
102
103AC_CACHE_CHECK([for CFLAGS_DEBUG_V],[ac_cv_env_CFLAGS_DEBUG_V],
104[. ./make/${RTEMS_BSP}.cache])
105CFLAGS_DEBUG_V=$ac_cv_env_CFLAGS_DEBUG_V
106AC_SUBST(CFLAGS_DEBUG_V)
107test -n "${CFLAGS_DEBUG_V}" && \
108  ac_configure_args="$ac_configure_args 'CFLAGS_DEBUG_V=${CFLAGS_DEBUG_V}'"
109
110RTEMS_PROG_CC_FOR_TARGET
111AM_PROG_CC_C_O
112RTEMS_PROG_CCAS
113RTEMS_CANONICALIZE_TOOLS
114
115AC_SUBST(CUSTOM_CFG_FILES)
116AC_SUBST(cfg_dir)
117
118RTEMS_CHECK_MULTIPROCESSING
119
120BSP_SUBDIRS=
121## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
122RTEMS_BSP_CONFIG_SUBDIR(
123  [cpukit],[../../cpukit],
124  ['--with-project-root=../../..' '--enable-rtemsbsp=$RTEMS_BSP'],
125  [test x"$multilib" = x"no"])
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[AS_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
178RTEMS_BSP_CONFIG_SUBDIR(
179  [testsuites],[../../testsuites],
180  ['--with-target-subdir=$with_target_subdir/c/$RTEMS_BSP' \
181   '--with-rtems-root=../' \
182   '--with-project-root=../../../' \
183   '--enable-rtemsbsp=$RTEMS_BSP' \
184   ],
185  [test x"$enable_tests" != x"no"])
186
187AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
188
189AS_IF([test "$host_cpu" = "sparc"],[
190  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
191    [whether to enable ipalignment work-around])
192])
193
194AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
195
196# FIXME: This is sick
197AM_CONDITIONAL([HAS_RDBG],[test "$HAS_RDBG" = "yes"])
198AM_CONDITIONAL([HAS_RDBG_i386],[test "$HAS_RDBG" = "yes" \
199 && test $RTEMS_CPU = "i386"])
200AM_CONDITIONAL([HAS_RDBG_m68k],[test "$HAS_RDBG" = "yes" \
201 && test $RTEMS_CPU = "m68k"])
202AM_CONDITIONAL([HAS_RDBG_powerpc],[test "$HAS_RDBG" = "yes" \
203 && test $RTEMS_CPU = "powerpc"])
204
205AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
206
207# The posix bsp doesn't support libchip
208# FIXME: We should use a feature based check, here
209AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"])
210
211# The bare bsp doesn't have libbsp.a
212# FIXME: We should use a feature based check, here
213AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"])
214
215# FIXME: HACK
216# Temporarily, we need to consider 3 cases:
217# 1. 4.7-style: lib/libbsp/<cpu>/<bsp>/libbsp.a w/o wrapup/Makefile.am
218# 2. powerpc: lib/libbsp/<cpu>/<bsp>/libbsp.a w/ wrapup/Makefile.am
219# 3. 4.6-style: lib/libbsp/<cpu>/<bsp>/wrapup/$(ARCH)/libbsp.a w/ wrapup/Makefile.am
220
221AS_IF([test -f $srcdir/lib/libbsp/$RTEMS_CPU/$RTEMS_BSP_FAMILY/wrapup/Makefile.am],
222  [AS_IF([grep ___libbsp_a $srcdir/lib/libbsp/$RTEMS_CPU/$RTEMS_BSP_FAMILY/wrapup/Makefile.am >/dev/null],
223    [HAS_WRAPUP_LIBBSP=no],
224    [HAS_WRAPUP_LIBBSP=yes])],
225  [HAS_WRAPUP_LIBBSP=no])
226AM_CONDITIONAL([HAS_WRAPUP_LIBBSP],[test $HAS_WRAPUP_LIBBSP = yes])
227AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"])
228
229AM_CONDITIONAL(RPCTOOLS, test "$rpctools" != "no")
230
231RTEMS_PROJECT_ROOT
232
233# Explicitly list all Makefiles here
234AC_CONFIG_FILES([Makefile],
235[${MAKE} make/${RTEMS_BSP}.cache],
236[RTEMS_BSP=${RTEMS_BSP}
237 MAKE=${MAKE}])
238
239AC_CONFIG_FILES([
240support/Makefile
241
242libnetworking/Makefile
243libnetworking/pppd/Makefile
244libnetworking/rtems_servers/Makefile
245libnetworking/rtems_telnetd/Makefile
246libnetworking/rtems_webserver/Makefile
247
248librdbg/Makefile
249
250libchip/Makefile
251
252optman/Makefile
253
254lib/Makefile
255
256lib/libcpu/Makefile
257
258lib/libbsp/Makefile
259
260wrapup/Makefile
261])
262
263AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.