source: rtems/c/src/configure.ac @ 67bb173

4.104.115
Last change on this file since 67bb173 was 67bb173, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/21/09 at 10:10:45

2009-10-21 Ralf Corsépius <ralf.corsepius@…>

  • aclocal/bsp-alias.m4: New.
  • configure.ac: Apply RTEMS_BSP_ALIAS for RTEMS_BSP_FAMILY.
  • Property mode set to 100644
File size: 6.3 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.60)
6AC_INIT([rtems-c-src],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
7AC_CONFIG_SRCDIR([optman])
8RTEMS_TOP(../..)
9
10RTEMS_ENABLE_CXX
11RTEMS_ENABLE_NETWORKING
12
13RTEMS_CANONICAL_TARGET_CPU
14
15AM_INIT_AUTOMAKE([no-define subdir-objects no-exeext foreign 1.10])
16AM_MAINTAINER_MODE
17
18RTEMS_ENABLE_MULTILIB
19RTEMS_ENABLE_MULTIPROCESSING
20RTEMS_ENV_RTEMSBSP
21
22RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
23
24RTEMS_CHECK_NETWORKING(RTEMS_BSP)
25RTEMS_CHECK_POSIX_API(RTEMS_BSP)
26
27AC_MSG_NOTICE([setting up make/custom])
28
29AS_MKDIR_P([make/custom])
30AM_SET_DEPDIR
31test -d ${DEPDIR} || mkdir ${DEPDIR}
32
33rm -f ${DEPDIR}/cfg.P
34cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg
35cat << EOF > ${DEPDIR}/cfg.P
36# Do not edit - automatically generated by $0
37make/custom/default.cfg: \$(srcdir)/make/custom/default.cfg.in
38        @\$(MKDIR_P) make/custom
39        cp \$(srcdir)/make/custom/default.cfg.in make/custom/default.cfg
40EOF
41
42# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
43# directory into the build tree's <bsp>/make/custom subdirectories
44CUSTOM_CFG_FILES=
45f="${RTEMS_BSP}.cfg"
46while test -n "$f"; do
47  cfg_file=
48  _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file)
49  if test -n "${cfg_file}"; then
50    cp ${cfg_file} make/custom/$f
51cat << EOF >> ${DEPDIR}/cfg.P
52make/custom/$f: ${cfg_file} make/custom/default.cfg
53        cp ${cfg_file} make/custom/$f
54EOF
55    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
56    f=`grep "^include.*make/custom" ${cfg_file} \
57    | sed \
58      -e 's%^.*custom\/%%' \
59      -e 's%default\.cfg%%'`;
60  else break; fi;
61done
62#${MAKE-make} -f ${DEPDIR}/cfg.P \
63# srcdir="${srcdir}" MKDIR_P="${MKDIR_P}" \
64# make/custom/default.cfg $CUSTOM_CFG_FILES
65
66AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
67${MAKE-make} -f ${srcdir}/make/bsp.mak \
68RTEMS_BSP=${RTEMS_BSP} \
69RTEMS_ROOT=. make/${RTEMS_BSP}.cache
70
71# Read back the cache
72AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
73[. ./make/${RTEMS_BSP}.cache])
74RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
75AC_SUBST(RTEMS_CPU_MODEL)
76test -n "${RTEMS_CPU_MODEL}" && \
77  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
78
79AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
80[RTEMS_BSP_ALIAS([${RTEMS_BSP}],[ac_cv_env_RTEMS_BSP_FAMILY])])
81RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
82AC_SUBST(RTEMS_BSP_FAMILY)
83test -n "${RTEMS_BSP_FAMILY}" && \
84  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
85
86AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
87[. ./make/${RTEMS_BSP}.cache])
88CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS
89
90AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
91[. ./make/${RTEMS_BSP}.cache])
92CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
93
94CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}"
95AS_IF([test x"${CFLAGS}" != x" "],[
96  ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"])
97
98RTEMS_PROG_CC_FOR_TARGET
99AM_PROG_CC_C_O
100RTEMS_PROG_CCAS
101RTEMS_CANONICALIZE_TOOLS
102
103RTEMS_CHECK_GCC_WEAK
104
105AC_SUBST(CUSTOM_CFG_FILES)
106
107RTEMS_CHECK_MULTIPROCESSING
108
109BSP_SUBDIRS=
110## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
111RTEMS_BSP_CONFIG_SUBDIR(
112  [cpukit],[../../cpukit],
113  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
114   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
115   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
116  ],
117  [test x"$multilib" = xno])
118
119## Note: the order of the directories below is essential
120AC_CONFIG_SUBDIRS([make])
121BSP_SUBDIRS="$BSP_SUBDIRS make"
122
123RTEMS_CPU_SUBDIRS(lib/libcpu)
124if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
125  libcpu_cpu_subdir="${RTEMS_CPU}"
126else
127  libcpu_cpu_subdir=
128fi
129AC_SUBST(libcpu_cpu_subdir)
130
131# Is there code where there should be for this BSP?
132RTEMS_CPU_SUBDIRS([lib/libbsp])
133AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
134
135BSP_SUBDIRS="$BSP_SUBDIRS lib"
136BSP_SUBDIRS="$BSP_SUBDIRS libchip"
137
138AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
139  AC_CONFIG_SUBDIRS([librtems++])
140  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
141])
142
143BSP_SUBDIRS="$BSP_SUBDIRS support"
144BSP_SUBDIRS="$BSP_SUBDIRS ada"
145BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
146
147BSP_SUBDIRS="$BSP_SUBDIRS optman"
148
149AC_ARG_ENABLE([ada],
150[AS_HELP_STRING(--enable-ada,enable ada support)],
151[case "${enable_ada}" in
152  yes) ;;
153  no) ;;
154  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
155esac],[enable_ada=no])
156
157RTEMS_BSP_CONFIG_SUBDIR(
158  [ada-tests],[ada-tests],
159  ['--enable-rtems-root=../' \
160   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
161   '--with-project-top=${with_project_top}../' \
162   '--enable-rtemsbsp=$RTEMS_BSP' \
163  ],
164  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
165
166# HACK ALERT!
167
168# FIXME: Assume multilib implies in-source-tree multilibs
169# Build testsuites multilibbed
170RTEMS_BSP_CONFIG_SUBDIR(
171  [testsuites],[../../testsuites],
172  ['--enable-rtems-root=../' \
173   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
174   '--with-project-top=${with_project_top}../' \
175   '--enable-rtemsbsp=$RTEMS_BSP' \
176   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
177   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
178  ],
179  [test x"$enable_tests" != x"no" && test x"$multilib" = xno])
180
181# Build testsuites non-multilibbed
182RTEMS_BSP_CONFIG_SUBDIR(
183  [testsuites],[../../testsuites],
184  ['--enable-rtems-root=../' \
185   '--enable-cpukit-root=${with_project_root}..' \
186   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
187   '--with-project-top=${with_project_top}../' \
188   '--enable-rtemsbsp=$RTEMS_BSP' \
189   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
190   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
191  ],
192  [test x"$enable_tests" != x"no" && test x"$multilib" = xyes])
193
194AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
195
196AS_IF([test "$host_cpu" = sparc],[
197  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
198    [whether to enable ipalignment work-around])
199])
200
201AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
202
203AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
204
205AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
206  && test x"$rtems_cv_HAS_POSIX_API" = x"yes"])
207
208RTEMS_PROJECT_ROOT
209
210# Explicitly list all Makefiles here
211AC_CONFIG_FILES([Makefile],
212[${MAKE} make/${RTEMS_BSP}.cache],
213[RTEMS_BSP=${RTEMS_BSP}
214 MAKE=${MAKE}])
215
216AC_CONFIG_FILES([
217support/Makefile
218
219libchip/Makefile
220
221optman/Makefile
222
223lib/Makefile
224
225lib/libcpu/Makefile
226
227lib/libbsp/Makefile
228
229ada/Makefile
230
231wrapup/Makefile
232])
233
234AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.