source: rtems/c/src/configure.ac @ 005fbe56

4.104.114.84.95
Last change on this file since 005fbe56 was 005fbe56, checked in by Ralf Corsepius <ralf.corsepius@…>, on 05/10/05 at 05:15:30

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

  • configure.ac: Let enable_rpcgen default to "no".
  • Property mode set to 100644
File size: 6.9 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)
35AS_IF([test "$HAS_NETWORKING" = "yes"],[
36  AS_IF([test "$RTEMS_HAS_RDBG" = "yes"],[
37    RTEMS_CHECK_RDBG(RTEMS_BSP)
38  ])
39])
40
41AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
42AC_PROG_AWK
43
44AC_MSG_NOTICE([setting up make/custom])
45
46AS_MKDIR_P([make/custom])
47AM_SET_DEPDIR
48test -d ${DEPDIR} || mkdir ${DEPDIR}
49
50rm -f ${DEPDIR}/cfg.P
51echo "# Do not edit - automatically generated by" > ${DEPDIR}/cfg.P
52echo "# $0" >> ${DEPDIR}/cfg.P
53
54# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
55# directory into the build tree's <bsp>/make/custom subdirectories
56CUSTOM_CFG_FILES=
57f="${RTEMS_BSP}.cfg"
58while test -n "$f"; do
59  cfg_file=
60  _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file)
61  if test -n "${cfg_file}"; then
62    cp ${cfg_file} make/custom/$f
63    echo "make/custom/$f: ${cfg_file}" >> ${DEPDIR}/cfg.P
64    echo "      cp ${cfg_file} make/custom/$f" >> ${DEPDIR}/cfg.P
65    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
66    f=`grep "^include.*make/custom" ${cfg_file} \
67    | sed \
68      -e 's%^.*custom\/%%' \
69      -e s%\$\(RTEMS_HOST\)%${RTEMS_HOST}% \
70      -e 's%default\.cfg%%'`;
71  else break; fi;
72done
73cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg
74
75AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
76${MAKE-make} -f ${srcdir}/make/bsp.mak \
77RTEMS_BSP=${RTEMS_BSP} \
78RTEMS_HOST=${RTEMS_HOST} \
79RTEMS_ROOT=. make/${RTEMS_BSP}.cache
80
81# Read back the cache
82AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
83[. ./make/${RTEMS_BSP}.cache])
84RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
85AC_SUBST(RTEMS_CPU_MODEL)
86test -n "${RTEMS_CPU_MODEL}" && \
87  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
88
89AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
90[. ./make/${RTEMS_BSP}.cache])
91RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
92AC_SUBST(RTEMS_BSP_FAMILY)
93test -n "${RTEMS_BSP_FAMILY}" && \
94  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
95
96AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
97[. ./make/${RTEMS_BSP}.cache])
98CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS
99test -n "${CPU_CFLAGS}" && \
100  ac_configure_args="$ac_configure_args 'CPU_CFLAGS=${CPU_CFLAGS}'"
101
102AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
103[. ./make/${RTEMS_BSP}.cache])
104CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
105test -n "${CFLAGS_OPTIMIZE_V}" && \
106  ac_configure_args="$ac_configure_args 'CFLAGS_OPTIMIZE_V=${CFLAGS_OPTIMIZE_V}'"
107
108RTEMS_PROG_CC_FOR_TARGET
109AM_PROG_CC_C_O
110RTEMS_PROG_CCAS
111RTEMS_CANONICALIZE_TOOLS
112
113RTEMS_CHECK_GCC_WEAK
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=${with_project_root}../$RTEMS_BSP/' \
125   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
126   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
127   'CFLAGS="${CFLAGS}"' \
128  ],
129  [test x"$multilib" = xno])
130
131## Note: the order of the directories below is essential
132AC_CONFIG_SUBDIRS([make])
133BSP_SUBDIRS="$BSP_SUBDIRS make"
134BSP_SUBDIRS="$BSP_SUBDIRS optman"
135
136RTEMS_CPU_SUBDIRS(lib/libcpu)
137if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
138  libcpu_cpu_subdir="${RTEMS_CPU}"
139else
140  libcpu_cpu_subdir=
141fi
142AC_SUBST(libcpu_cpu_subdir)
143
144# Is there code where there should be for this BSP?
145# The bare bsp is a special case as it is not under the RTEMS_CPU path
146if test "$RTEMS_BSP_FAMILY" = bare ; then
147  AC_CONFIG_SUBDIRS([lib/libbsp/bare])
148  AC_SUBST(libbsp_cpu_subdir,bare)
149else
150  RTEMS_CPU_SUBDIRS([lib/libbsp])
151  AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
152fi
153
154BSP_SUBDIRS="$BSP_SUBDIRS lib"
155BSP_SUBDIRS="$BSP_SUBDIRS libchip"
156BSP_SUBDIRS="$BSP_SUBDIRS libnetworking"
157BSP_SUBDIRS="$BSP_SUBDIRS librdbg"
158
159AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
160  AC_CONFIG_SUBDIRS([librtems++])
161  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
162])
163
164BSP_SUBDIRS="$BSP_SUBDIRS support"
165BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
166
167AC_ARG_ENABLE([ada],
168[AS_HELP_STRING(--enable-ada,enable ada support)],
169[case "${enable_ada}" in
170  yes) ;;
171  no) ;;
172  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
173esac],[enable_ada=no])
174
175RTEMS_BSP_CONFIG_SUBDIR(
176  [ada-tests],[ada-tests],
177  ['--enable-rtems-root=../' \
178   '--with-project-root=${with_project_root}../' \
179   '--with-project-top=${with_project_top}../' \
180   '--enable-rtemsbsp=$RTEMS_BSP' \
181  ],
182  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
183
184RTEMS_BSP_CONFIG_SUBDIR(
185  [testsuites],[../../testsuites],
186  ['--enable-rtems-root=../' \
187   '--with-project-root=${with_project_root}../' \
188   '--with-project-top=${with_project_top}../' \
189   '--enable-rtemsbsp=$RTEMS_BSP' \
190   'CFLAGS="${CFLAGS}"' \
191  ],
192  [test x"$enable_tests" != x"no"])
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
203# FIXME: This is sick
204AM_CONDITIONAL([HAS_RDBG],[test "$HAS_RDBG" = "yes"])
205AM_CONDITIONAL([HAS_RDBG_i386],[test "$HAS_RDBG" = "yes" \
206 && test $RTEMS_CPU = "i386"])
207AM_CONDITIONAL([HAS_RDBG_m68k],[test "$HAS_RDBG" = "yes" \
208 && test $RTEMS_CPU = "m68k"])
209AM_CONDITIONAL([HAS_RDBG_powerpc],[test "$HAS_RDBG" = "yes" \
210 && test $RTEMS_CPU = "powerpc"])
211
212AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
213
214# The posix bsp doesn't support libchip
215# FIXME: We should use a feature based check, here
216AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"])
217
218# The bare bsp doesn't have libbsp.a
219# FIXME: We should use a feature based check, here
220AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"])
221
222AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"])
223
224AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
225&& test -n "$AWK" \
226&& test "$enable_rpcgen" = yes])
227
228RTEMS_PROJECT_ROOT
229
230# Explicitly list all Makefiles here
231AC_CONFIG_FILES([Makefile],
232[${MAKE} make/${RTEMS_BSP}.cache],
233[RTEMS_BSP=${RTEMS_BSP}
234 MAKE=${MAKE}])
235
236AC_CONFIG_FILES([
237support/Makefile
238
239libnetworking/Makefile
240libnetworking/pppd/Makefile
241libnetworking/rtems_telnetd/Makefile
242
243librdbg/Makefile
244
245libchip/Makefile
246
247optman/Makefile
248
249lib/Makefile
250
251lib/libcpu/Makefile
252
253lib/libbsp/Makefile
254
255wrapup/Makefile
256])
257
258AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.