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

4.104.114.84.95
Last change on this file since f1f6f2e0 was d7610229, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 25, 2005 at 12:20:58 PM

2005-05-25 Ralf Corsepius <ralf.corsepius@…>

  • aclocal/check-rdbg.m4: Use compilation check on _OLD_EXCEPTIONS to enable rdbg.
  • configure.ac: Reflect changes above.
  • Property mode set to 100644
File size: 7.2 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.9])
17AM_MAINTAINER_MODE
18
19RTEMS_ENABLE_MULTILIB
20RTEMS_ENABLE_MULTIPROCESSING
21RTEMS_ENV_RTEMSBSP
22
23AC_ARG_ENABLE(rpcgen,
24[AS_HELP_STRING([--enable-rpcgen],[rebuild rpcgen-generated sources])],
25[case "${enable_rpcgen}" in
26  yes) enable_rpcgen=yes ;;
27  no) enable_rpcgen=no ;;
28  *)  enable_rpcgen=no ;;
29esac],[enable_rpcgen=no])
30
31RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
32
33RTEMS_CHECK_NETWORKING(RTEMS_BSP)
34RTEMS_CHECK_POSIX_API(RTEMS_BSP)
35
36AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
37AC_PROG_AWK
38
39AC_MSG_NOTICE([setting up make/custom])
40
41AS_MKDIR_P([make/custom])
42AM_SET_DEPDIR
43test -d ${DEPDIR} || mkdir ${DEPDIR}
44
45rm -f ${DEPDIR}/cfg.P
46echo "# Do not edit - automatically generated by" > ${DEPDIR}/cfg.P
47echo "# $0" >> ${DEPDIR}/cfg.P
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
51CUSTOM_CFG_FILES=
52f="${RTEMS_BSP}.cfg"
53while test -n "$f"; do
54  cfg_file=
55  _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file)
56  if test -n "${cfg_file}"; then
57    cp ${cfg_file} make/custom/$f
58    echo "make/custom/$f: ${cfg_file}" >> ${DEPDIR}/cfg.P
59    echo "      cp ${cfg_file} make/custom/$f" >> ${DEPDIR}/cfg.P
60    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
61    f=`grep "^include.*make/custom" ${cfg_file} \
62    | sed \
63      -e 's%^.*custom\/%%' \
64      -e s%\$\(RTEMS_HOST\)%${RTEMS_HOST}% \
65      -e 's%default\.cfg%%'`;
66  else break; fi;
67done
68cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg
69
70AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
71${MAKE-make} -f ${srcdir}/make/bsp.mak \
72RTEMS_BSP=${RTEMS_BSP} \
73RTEMS_HOST=${RTEMS_HOST} \
74RTEMS_ROOT=. make/${RTEMS_BSP}.cache
75
76# Read back the cache
77AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
78[. ./make/${RTEMS_BSP}.cache])
79RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
80AC_SUBST(RTEMS_CPU_MODEL)
81test -n "${RTEMS_CPU_MODEL}" && \
82  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
83
84AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
85[. ./make/${RTEMS_BSP}.cache])
86RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
87AC_SUBST(RTEMS_BSP_FAMILY)
88test -n "${RTEMS_BSP_FAMILY}" && \
89  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
90
91AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
92[. ./make/${RTEMS_BSP}.cache])
93CPU_CFLAGS=$ac_cv_env_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
100test -n "${CFLAGS_OPTIMIZE_V}" && \
101  ac_configure_args="$ac_configure_args 'CFLAGS_OPTIMIZE_V=${CFLAGS_OPTIMIZE_V}'"
102
103RTEMS_PROG_CC_FOR_TARGET
104AM_PROG_CC_C_O
105RTEMS_PROG_CCAS
106RTEMS_CANONICALIZE_TOOLS
107
108AS_IF([test "$HAS_NETWORKING" = "yes"],[
109  AS_IF([test "$RTEMS_HAS_RDBG" = "yes"],[
110    RTEMS_CHECK_RDBG(RTEMS_BSP)
111  ])
112])
113
114RTEMS_CHECK_GCC_WEAK
115
116AC_SUBST(CUSTOM_CFG_FILES)
117AC_SUBST(cfg_dir)
118
119RTEMS_CHECK_MULTIPROCESSING
120
121BSP_SUBDIRS=
122## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
123RTEMS_BSP_CONFIG_SUBDIR(
124  [cpukit],[../../cpukit],
125  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
126   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
127   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
128   'CFLAGS="${CFLAGS}"' \
129  ],
130  [test x"$multilib" = xno])
131
132## Note: the order of the directories below is essential
133AC_CONFIG_SUBDIRS([make])
134BSP_SUBDIRS="$BSP_SUBDIRS make"
135BSP_SUBDIRS="$BSP_SUBDIRS optman"
136
137RTEMS_CPU_SUBDIRS(lib/libcpu)
138if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
139  libcpu_cpu_subdir="${RTEMS_CPU}"
140else
141  libcpu_cpu_subdir=
142fi
143AC_SUBST(libcpu_cpu_subdir)
144
145# Is there code where there should be for this BSP?
146# The bare bsp is a special case as it is not under the RTEMS_CPU path
147if test "$RTEMS_BSP_FAMILY" = bare ; then
148  AC_CONFIG_SUBDIRS([lib/libbsp/bare])
149  AC_SUBST(libbsp_cpu_subdir,bare)
150else
151  RTEMS_CPU_SUBDIRS([lib/libbsp])
152  AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
153fi
154
155BSP_SUBDIRS="$BSP_SUBDIRS lib"
156BSP_SUBDIRS="$BSP_SUBDIRS libchip"
157BSP_SUBDIRS="$BSP_SUBDIRS libnetworking"
158BSP_SUBDIRS="$BSP_SUBDIRS librdbg"
159
160AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
161  AC_CONFIG_SUBDIRS([librtems++])
162  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
163])
164
165BSP_SUBDIRS="$BSP_SUBDIRS support"
166BSP_SUBDIRS="$BSP_SUBDIRS ada"
167BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
168
169AC_ARG_ENABLE([ada],
170[AS_HELP_STRING(--enable-ada,enable ada support)],
171[case "${enable_ada}" in
172  yes) ;;
173  no) ;;
174  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
175esac],[enable_ada=no])
176
177RTEMS_BSP_CONFIG_SUBDIR(
178  [ada-tests],[ada-tests],
179  ['--enable-rtems-root=../' \
180   '--with-project-root=${with_project_root}../' \
181   '--with-project-top=${with_project_top}../' \
182   '--enable-rtemsbsp=$RTEMS_BSP' \
183  ],
184  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
185
186RTEMS_BSP_CONFIG_SUBDIR(
187  [testsuites],[../../testsuites],
188  ['--enable-rtems-root=../' \
189   '--with-project-root=${with_project_root}../' \
190   '--with-project-top=${with_project_top}../' \
191   '--enable-rtemsbsp=$RTEMS_BSP' \
192   'CFLAGS="${CFLAGS}"' \
193  ],
194  [test x"$enable_tests" != x"no"])
195
196AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
197
198AS_IF([test "$host_cpu" = sparc],[
199  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
200    [whether to enable ipalignment work-around])
201])
202
203AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
204
205# FIXME: This is sick
206AM_CONDITIONAL([HAS_RDBG],[test "$HAS_RDBG" = "yes"])
207AM_CONDITIONAL([HAS_RDBG_i386],[test "$HAS_RDBG" = "yes" \
208 && test $RTEMS_CPU = "i386"])
209AM_CONDITIONAL([HAS_RDBG_m68k],[test "$HAS_RDBG" = "yes" \
210 && test $RTEMS_CPU = "m68k"])
211AM_CONDITIONAL([HAS_RDBG_powerpc],[test "$HAS_RDBG" = "yes" \
212 && test $RTEMS_CPU = "powerpc"])
213
214AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
215
216# The posix bsp doesn't support libchip
217# FIXME: We should use a feature based check, here
218AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"])
219
220# The bare bsp doesn't have libbsp.a
221# FIXME: We should use a feature based check, here
222AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"])
223
224AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"])
225
226AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
227&& test -n "$AWK" \
228&& test "$enable_rpcgen" = yes])
229
230AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
231  && test x"$rtems_cv_HAS_POSIX_API" = x"yes"])
232
233RTEMS_PROJECT_ROOT
234
235AC_PATH_PROG([AMPOLISH3],[ampolish3],[])
236AM_CONDITIONAL([AMPOLISH3],[test x"$USE_MAINTAINER_MODE" = x"yes" \
237  && test -n "$AMPOLISH3"])
238
239# Explicitly list all Makefiles here
240AC_CONFIG_FILES([Makefile],
241[${MAKE} make/${RTEMS_BSP}.cache],
242[RTEMS_BSP=${RTEMS_BSP}
243 MAKE=${MAKE}])
244
245AC_CONFIG_FILES([
246support/Makefile
247
248libnetworking/Makefile
249libnetworking/pppd/Makefile
250libnetworking/rtems_telnetd/Makefile
251
252librdbg/Makefile
253
254libchip/Makefile
255
256optman/Makefile
257
258lib/Makefile
259
260lib/libcpu/Makefile
261
262lib/libbsp/Makefile
263
264ada/Makefile
265
266wrapup/Makefile
267])
268
269AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.