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

4.104.114.95
Last change on this file since de3864e was ad20f595, checked in by Joel Sherrill <joel.sherrill@…>, on 02/26/08 at 19:29:45

2008-02-26 Joel Sherrill <joel.sherrill@…>

  • configure.ac: Stop building nfsclient here and build it in CPUKIT.
  • Property mode set to 100644
File size: 7.0 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"
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 support"
154BSP_SUBDIRS="$BSP_SUBDIRS ada"
155BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
156
157BSP_SUBDIRS="$BSP_SUBDIRS optman"
158
159AC_ARG_ENABLE([ada],
160[AS_HELP_STRING(--enable-ada,enable ada support)],
161[case "${enable_ada}" in
162  yes) ;;
163  no) ;;
164  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
165esac],[enable_ada=no])
166
167RTEMS_BSP_CONFIG_SUBDIR(
168  [ada-tests],[ada-tests],
169  ['--enable-rtems-root=../' \
170   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
171   '--with-project-top=${with_project_top}../' \
172   '--enable-rtemsbsp=$RTEMS_BSP' \
173  ],
174  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
175
176# HACK ALERT!
177
178# FIXME: Assume multilib implies in-source-tree multilibs
179# Build testsuites multilibbed
180RTEMS_BSP_CONFIG_SUBDIR(
181  [testsuites],[../../testsuites],
182  ['--enable-rtems-root=../' \
183   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
184   '--with-project-top=${with_project_top}../' \
185   '--enable-rtemsbsp=$RTEMS_BSP' \
186   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
187   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
188  ],
189  [test x"$enable_tests" != x"no" && test x"$multilib" = xno])
190
191# Build testsuites non-multilibbed
192RTEMS_BSP_CONFIG_SUBDIR(
193  [testsuites],[../../testsuites],
194  ['--enable-rtems-root=../' \
195   '--enable-cpukit-root=${with_project_root}..' \
196   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
197   '--with-project-top=${with_project_top}../' \
198   '--enable-rtemsbsp=$RTEMS_BSP' \
199   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
200   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
201  ],
202  [test x"$enable_tests" != x"no" && test x"$multilib" = xyes])
203
204AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
205
206AS_IF([test "$host_cpu" = sparc],[
207  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
208    [whether to enable ipalignment work-around])
209])
210
211AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
212
213AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
214
215# The posix bsp doesn't support libchip
216# FIXME: We should use a feature based check, here
217AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"])
218
219# The bare bsp doesn't have libbsp.a
220# FIXME: We should use a feature based check, here
221AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"])
222
223AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"])
224
225AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
226&& test -n "$AWK" \
227&& test "$enable_rpcgen" = yes])
228
229AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
230  && test x"$rtems_cv_HAS_POSIX_API" = x"yes"])
231
232RTEMS_PROJECT_ROOT
233
234# Explicitly list all Makefiles here
235AC_CONFIG_FILES([Makefile],
236[${MAKE} make/${RTEMS_BSP}.cache],
237[RTEMS_BSP=${RTEMS_BSP}
238 MAKE=${MAKE}])
239
240AC_CONFIG_FILES([
241support/Makefile
242
243libchip/Makefile
244
245optman/Makefile
246
247lib/Makefile
248
249lib/libcpu/Makefile
250
251lib/libbsp/Makefile
252
253ada/Makefile
254
255wrapup/Makefile
256])
257
258AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.