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

4.104.114.84.95
Last change on this file since b00e693 was e7ef4c3, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/16/07 at 05:55:40

2007-09-16 Ralf Corsépius <ralf.corsepius@…>

  • configure.ac: Remove AC_PROG_AWK (Unused).
  • Property mode set to 100644
File size: 7.1 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
22AC_ARG_ENABLE(rpcgen,
23[AS_HELP_STRING([--enable-rpcgen],[rebuild rpcgen-generated sources])],
24[case "${enable_rpcgen}" in
25  yes) enable_rpcgen=yes ;;
26  no) enable_rpcgen=no ;;
27  *)  enable_rpcgen=no ;;
28esac],[enable_rpcgen=no])
29
30RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
31
32RTEMS_CHECK_NETWORKING(RTEMS_BSP)
33RTEMS_CHECK_POSIX_API(RTEMS_BSP)
34
35AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
36
37AC_MSG_NOTICE([setting up make/custom])
38
39AS_MKDIR_P([make/custom])
40AM_SET_DEPDIR
41test -d ${DEPDIR} || mkdir ${DEPDIR}
42
43rm -f ${DEPDIR}/cfg.P
44echo "# Do not edit - automatically generated by" > ${DEPDIR}/cfg.P
45echo "# $0" >> ${DEPDIR}/cfg.P
46
47# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
48# directory into the build tree's <bsp>/make/custom subdirectories
49CUSTOM_CFG_FILES=
50f="${RTEMS_BSP}.cfg"
51while test -n "$f"; do
52  cfg_file=
53  _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file)
54  if test -n "${cfg_file}"; then
55    cp ${cfg_file} make/custom/$f
56    echo "make/custom/$f: ${cfg_file}" >> ${DEPDIR}/cfg.P
57    echo "      cp ${cfg_file} make/custom/$f" >> ${DEPDIR}/cfg.P
58    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
59    f=`grep "^include.*make/custom" ${cfg_file} \
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} \
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
92
93AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
94[. ./make/${RTEMS_BSP}.cache])
95CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
96
97CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}"
98AS_IF([test x"${CFLAGS}" != x" "],[
99  ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"])
100
101RTEMS_PROG_CC_FOR_TARGET
102AM_PROG_CC_C_O
103RTEMS_PROG_CCAS
104RTEMS_CANONICALIZE_TOOLS
105
106RTEMS_CHECK_GCC_WEAK
107
108AC_SUBST(CUSTOM_CFG_FILES)
109AC_SUBST(cfg_dir)
110
111RTEMS_CHECK_MULTIPROCESSING
112
113BSP_SUBDIRS=
114## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
115RTEMS_BSP_CONFIG_SUBDIR(
116  [cpukit],[../../cpukit],
117  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
118   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
119   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
120  ],
121  [test x"$multilib" = xno])
122
123## Note: the order of the directories below is essential
124AC_CONFIG_SUBDIRS([make])
125BSP_SUBDIRS="$BSP_SUBDIRS make"
126
127RTEMS_CPU_SUBDIRS(lib/libcpu)
128if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
129  libcpu_cpu_subdir="${RTEMS_CPU}"
130else
131  libcpu_cpu_subdir=
132fi
133AC_SUBST(libcpu_cpu_subdir)
134
135# Is there code where there should be for this BSP?
136# The bare bsp is a special case as it is not under the RTEMS_CPU path
137if test "$RTEMS_BSP_FAMILY" = bare ; then
138  AC_CONFIG_SUBDIRS([lib/libbsp/bare])
139  AC_SUBST(libbsp_cpu_subdir,bare)
140else
141  RTEMS_CPU_SUBDIRS([lib/libbsp])
142  AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
143fi
144
145BSP_SUBDIRS="$BSP_SUBDIRS lib"
146BSP_SUBDIRS="$BSP_SUBDIRS libchip"
147BSP_SUBDIRS="$BSP_SUBDIRS nfsclient"
148
149AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
150  AC_CONFIG_SUBDIRS([librtems++])
151  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
152])
153
154BSP_SUBDIRS="$BSP_SUBDIRS support"
155BSP_SUBDIRS="$BSP_SUBDIRS ada"
156BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
157
158BSP_SUBDIRS="$BSP_SUBDIRS optman"
159
160AC_ARG_ENABLE([ada],
161[AS_HELP_STRING(--enable-ada,enable ada support)],
162[case "${enable_ada}" in
163  yes) ;;
164  no) ;;
165  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
166esac],[enable_ada=no])
167
168RTEMS_BSP_CONFIG_SUBDIR(
169  [ada-tests],[ada-tests],
170  ['--enable-rtems-root=../' \
171   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
172   '--with-project-top=${with_project_top}../' \
173   '--enable-rtemsbsp=$RTEMS_BSP' \
174  ],
175  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
176
177# HACK ALERT!
178
179# FIXME: Assume multilib implies in-source-tree multilibs
180# Build testsuites multilibbed
181RTEMS_BSP_CONFIG_SUBDIR(
182  [testsuites],[../../testsuites],
183  ['--enable-rtems-root=../' \
184   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
185   '--with-project-top=${with_project_top}../' \
186   '--enable-rtemsbsp=$RTEMS_BSP' \
187   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
188   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
189  ],
190  [test x"$enable_tests" != x"no" && test x"$multilib" = xno])
191
192# Build testsuites non-multilibbed
193RTEMS_BSP_CONFIG_SUBDIR(
194  [testsuites],[../../testsuites],
195  ['--enable-rtems-root=../' \
196   '--enable-cpukit-root=${with_project_root}..' \
197   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
198   '--with-project-top=${with_project_top}../' \
199   '--enable-rtemsbsp=$RTEMS_BSP' \
200   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
201   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
202  ],
203  [test x"$enable_tests" != x"no" && test x"$multilib" = xyes])
204
205AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
206
207AS_IF([test "$host_cpu" = sparc],[
208  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
209    [whether to enable ipalignment work-around])
210])
211
212AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
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
235# Explicitly list all Makefiles here
236AC_CONFIG_FILES([Makefile],
237[${MAKE} make/${RTEMS_BSP}.cache],
238[RTEMS_BSP=${RTEMS_BSP}
239 MAKE=${MAKE}])
240
241AC_CONFIG_FILES([
242support/Makefile
243
244libchip/Makefile
245
246optman/Makefile
247
248lib/Makefile
249
250lib/libcpu/Makefile
251
252lib/libbsp/Makefile
253
254nfsclient/Makefile
255ada/Makefile
256
257wrapup/Makefile
258])
259
260AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.