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

4.104.114.84.95
Last change on this file since ea3f559 was ea3f559, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jan 5, 2005 at 5:52:33 PM

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

  • configure.ac: Pass CFLAGS to cpukit configure.
  • aclocal/rtems-flags.m4: Remove (Unused).
  • aclocal/prog-ccas.m4: Remove $(GCCSPECS).
  • aclocal/env-rtemsbsp.m4: Comment out CFLAGS_OPTIMIZE_V, CFLAGS_DEBUG_V, CPU_CFLAGS.
  • aclocal/prog-cc.m4: Don't invoke _RTEMS_FLAGS to set up RTEMS_CFLAGS.
  • automake/compile.am: AM_CFLAGS = RTEMS_CFLAGS. Add AM_CXXFLAGS. Remove CPPFLAGS, CFLAGS, CPU_CFLAGS, CFLAGS_OPTIMIZE, ASFLAGS. Cleanup comments.
  • Property mode set to 100644
File size: 7.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=yes])
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
99AC_SUBST(CPU_CFLAGS)
100test -n "${CPU_CFLAGS}" && \
101  ac_configure_args="$ac_configure_args 'CPU_CFLAGS=${CPU_CFLAGS}'"
102
103AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
104[. ./make/${RTEMS_BSP}.cache])
105CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
106AC_SUBST(CFLAGS_OPTIMIZE_V)
107test -n "${CFLAGS_OPTIMIZE_V}" && \
108  ac_configure_args="$ac_configure_args 'CFLAGS_OPTIMIZE_V=${CFLAGS_OPTIMIZE_V}'"
109
110AC_CACHE_CHECK([for CFLAGS_DEBUG_V],[ac_cv_env_CFLAGS_DEBUG_V],
111[. ./make/${RTEMS_BSP}.cache])
112CFLAGS_DEBUG_V=$ac_cv_env_CFLAGS_DEBUG_V
113AC_SUBST(CFLAGS_DEBUG_V)
114test -n "${CFLAGS_DEBUG_V}" && \
115  ac_configure_args="$ac_configure_args 'CFLAGS_DEBUG_V=${CFLAGS_DEBUG_V}'"
116
117RTEMS_PROG_CC_FOR_TARGET
118AM_PROG_CC_C_O
119RTEMS_PROG_CCAS
120RTEMS_CANONICALIZE_TOOLS
121
122RTEMS_CHECK_GCC_WEAK
123
124AC_SUBST(CUSTOM_CFG_FILES)
125AC_SUBST(cfg_dir)
126
127RTEMS_CHECK_MULTIPROCESSING
128
129BSP_SUBDIRS=
130## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
131RTEMS_BSP_CONFIG_SUBDIR(
132  [cpukit],[../../cpukit],
133  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
134   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
135   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
136   'CFLAGS="${CFLAGS}"'],
137  [test x"$multilib" = xno])
138
139## Note: the order of the directories below is essential
140AC_CONFIG_SUBDIRS([make])
141BSP_SUBDIRS="$BSP_SUBDIRS make"
142BSP_SUBDIRS="$BSP_SUBDIRS optman"
143
144RTEMS_CPU_SUBDIRS(lib/libcpu)
145if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
146  libcpu_cpu_subdir="${RTEMS_CPU}"
147else
148  libcpu_cpu_subdir=
149fi
150AC_SUBST(libcpu_cpu_subdir)
151
152# Is there code where there should be for this BSP?
153# The bare bsp is a special case as it is not under the RTEMS_CPU path
154if test "$RTEMS_BSP_FAMILY" = bare ; then
155  AC_CONFIG_SUBDIRS([lib/libbsp/bare])
156  AC_SUBST(libbsp_cpu_subdir,bare)
157else
158  RTEMS_CPU_SUBDIRS([lib/libbsp])
159  AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
160fi
161
162BSP_SUBDIRS="$BSP_SUBDIRS lib"
163BSP_SUBDIRS="$BSP_SUBDIRS libchip"
164BSP_SUBDIRS="$BSP_SUBDIRS libnetworking"
165BSP_SUBDIRS="$BSP_SUBDIRS librdbg"
166
167AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
168  AC_CONFIG_SUBDIRS([librtems++])
169  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
170])
171
172BSP_SUBDIRS="$BSP_SUBDIRS support"
173BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
174
175AC_ARG_ENABLE([ada],
176[AS_HELP_STRING(--enable-ada,enable ada support)],
177[case "${enable_ada}" in
178  yes) ;;
179  no) ;;
180  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
181esac],[enable_ada=no])
182
183RTEMS_BSP_CONFIG_SUBDIR(
184  [ada-tests],[ada-tests],
185  ['--enable-rtems-root=../' \
186   '--with-project-root=${with_project_root}../' \
187   '--with-project-top=${with_project_top}../' \
188   '--enable-rtemsbsp=$RTEMS_BSP' \
189  ],
190  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
191
192RTEMS_BSP_CONFIG_SUBDIR(
193  [testsuites],[../../testsuites],
194  ['--enable-rtems-root=../' \
195   '--with-project-root=${with_project_root}../' \
196   '--with-project-top=${with_project_top}../' \
197   '--enable-rtemsbsp=$RTEMS_BSP' \
198   ],
199  [test x"$enable_tests" != x"no"])
200
201AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
202
203AS_IF([test "$host_cpu" = sparc],[
204  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
205    [whether to enable ipalignment work-around])
206])
207
208AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
209
210# FIXME: This is sick
211AM_CONDITIONAL([HAS_RDBG],[test "$HAS_RDBG" = "yes"])
212AM_CONDITIONAL([HAS_RDBG_i386],[test "$HAS_RDBG" = "yes" \
213 && test $RTEMS_CPU = "i386"])
214AM_CONDITIONAL([HAS_RDBG_m68k],[test "$HAS_RDBG" = "yes" \
215 && test $RTEMS_CPU = "m68k"])
216AM_CONDITIONAL([HAS_RDBG_powerpc],[test "$HAS_RDBG" = "yes" \
217 && test $RTEMS_CPU = "powerpc"])
218
219AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
220
221# The posix bsp doesn't support libchip
222# FIXME: We should use a feature based check, here
223AM_CONDITIONAL([LIBCHIP],[test "$RTEMS_BSP_FAMILY" != "posix"])
224
225# The bare bsp doesn't have libbsp.a
226# FIXME: We should use a feature based check, here
227AM_CONDITIONAL([HAS_LIBBSP],[test "$RTEMS_BSP_FAMILY" != "bare"])
228
229# FIXME: HACK
230# Temporarily, we need to consider 3 cases:
231# 1. 4.7-style: lib/libbsp/<cpu>/<bsp>/libbsp.a w/o wrapup/Makefile.am
232# 2. powerpc: lib/libbsp/<cpu>/<bsp>/libbsp.a w/ wrapup/Makefile.am
233# 3. 4.6-style: lib/libbsp/<cpu>/<bsp>/wrapup/$(ARCH)/libbsp.a w/ wrapup/Makefile.am
234
235AS_IF([test -f $srcdir/lib/libbsp/$RTEMS_CPU/$RTEMS_BSP_FAMILY/wrapup/Makefile.am],
236  [AS_IF([grep ___libbsp_a $srcdir/lib/libbsp/$RTEMS_CPU/$RTEMS_BSP_FAMILY/wrapup/Makefile.am >/dev/null],
237    [HAS_WRAPUP_LIBBSP=no],
238    [HAS_WRAPUP_LIBBSP=yes])],
239  [HAS_WRAPUP_LIBBSP=no])
240AM_CONDITIONAL([HAS_WRAPUP_LIBBSP],[test $HAS_WRAPUP_LIBBSP = yes])
241AM_CONDITIONAL([MULTILIB],[test x"${enable_multilib}" = x"yes"])
242
243AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
244&& test -n "$AWK" \
245&& test "$enable_rpcgen" = yes])
246
247RTEMS_PROJECT_ROOT
248
249# Explicitly list all Makefiles here
250AC_CONFIG_FILES([Makefile],
251[${MAKE} make/${RTEMS_BSP}.cache],
252[RTEMS_BSP=${RTEMS_BSP}
253 MAKE=${MAKE}])
254
255AC_CONFIG_FILES([
256support/Makefile
257
258libnetworking/Makefile
259libnetworking/pppd/Makefile
260libnetworking/rtems_servers/Makefile
261libnetworking/rtems_telnetd/Makefile
262
263librdbg/Makefile
264
265libchip/Makefile
266
267optman/Makefile
268
269lib/Makefile
270
271lib/libcpu/Makefile
272
273lib/libbsp/Makefile
274
275wrapup/Makefile
276])
277
278AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.