source: rtems/c/src/configure.ac @ 82dcbc8

4.115
Last change on this file since 82dcbc8 was 309dbd0, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 28, 2009 at 6:28:41 AM

Whitespace removal.

  • Property mode set to 100644
File size: 6.5 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
94# Was CFLAGS set?
95rtems_cv_CFLAGS_set="${CFLAGS+set}"
96
97CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}"
98
99RTEMS_PROG_CC_FOR_TARGET
100AM_PROG_CC_C_O
101RTEMS_PROG_CCAS
102RTEMS_CANONICALIZE_TOOLS
103
104# Append warning flags if CFLAGS wasn't set.
105AS_IF([test "$GCC" = yes && test "$rtems_cv_CFLAGS_set" != set],
106[CFLAGS="$CFLAGS -Wall -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs"])
107
108AS_IF([test -n "${CFLAGS}"],[
109ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"])
110
111RTEMS_CHECK_GCC_WEAK
112
113AC_SUBST(CUSTOM_CFG_FILES)
114
115RTEMS_CHECK_MULTIPROCESSING
116
117BSP_SUBDIRS=
118## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
119RTEMS_BSP_CONFIG_SUBDIR(
120  [cpukit],[../../cpukit],
121  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
122   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
123   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
124  ],
125  [test x"$multilib" = xno])
126
127## Note: the order of the directories below is essential
128AC_CONFIG_SUBDIRS([make])
129BSP_SUBDIRS="$BSP_SUBDIRS make"
130
131RTEMS_CPU_SUBDIRS(lib/libcpu)
132if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
133  libcpu_cpu_subdir="${RTEMS_CPU}"
134else
135  libcpu_cpu_subdir=
136fi
137AC_SUBST(libcpu_cpu_subdir)
138
139# Is there code where there should be for this BSP?
140RTEMS_CPU_SUBDIRS([lib/libbsp])
141AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
142
143BSP_SUBDIRS="$BSP_SUBDIRS lib"
144BSP_SUBDIRS="$BSP_SUBDIRS libchip"
145
146AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
147  AC_CONFIG_SUBDIRS([librtems++])
148  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
149])
150
151BSP_SUBDIRS="$BSP_SUBDIRS support"
152BSP_SUBDIRS="$BSP_SUBDIRS ada"
153BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
154
155BSP_SUBDIRS="$BSP_SUBDIRS optman"
156
157AC_ARG_ENABLE([ada],
158[AS_HELP_STRING(--enable-ada,enable ada support)],
159[case "${enable_ada}" in
160  yes) ;;
161  no) ;;
162  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
163esac],[enable_ada=no])
164
165RTEMS_BSP_CONFIG_SUBDIR(
166  [ada-tests],[ada-tests],
167  ['--enable-rtems-root=../' \
168   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
169   '--with-project-top=${with_project_top}../' \
170   '--enable-rtemsbsp=$RTEMS_BSP' \
171  ],
172  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
173
174# HACK ALERT!
175
176# FIXME: Assume multilib implies in-source-tree multilibs
177# Build testsuites multilibbed
178RTEMS_BSP_CONFIG_SUBDIR(
179  [testsuites],[../../testsuites],
180  ['--enable-rtems-root=../' \
181   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
182   '--with-project-top=${with_project_top}../' \
183   '--enable-rtemsbsp=$RTEMS_BSP' \
184   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
185   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
186  ],
187  [test x"$enable_tests" != x"no" && test x"$multilib" = xno])
188
189# Build testsuites non-multilibbed
190RTEMS_BSP_CONFIG_SUBDIR(
191  [testsuites],[../../testsuites],
192  ['--enable-rtems-root=../' \
193   '--enable-cpukit-root=${with_project_root}..' \
194   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
195   '--with-project-top=${with_project_top}../' \
196   '--enable-rtemsbsp=$RTEMS_BSP' \
197   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
198   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
199  ],
200  [test x"$enable_tests" != x"no" && test x"$multilib" = xyes])
201
202AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
203
204AS_IF([test "$host_cpu" = sparc],[
205  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
206    [whether to enable ipalignment work-around])
207])
208
209AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
210
211AM_CONDITIONAL(HAS_POSIX,test "$HAS_POSIX_API" = "yes")
212
213AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
214  && test x"$rtems_cv_HAS_POSIX_API" = x"yes"])
215
216RTEMS_PROJECT_ROOT
217
218# Explicitly list all Makefiles here
219AC_CONFIG_FILES([Makefile],
220[${MAKE} make/${RTEMS_BSP}.cache],
221[RTEMS_BSP=${RTEMS_BSP}
222 MAKE=${MAKE}])
223
224AC_CONFIG_FILES([
225support/Makefile
226
227libchip/Makefile
228
229optman/Makefile
230
231lib/Makefile
232
233lib/libcpu/Makefile
234
235lib/libbsp/Makefile
236
237ada/Makefile
238
239wrapup/Makefile
240])
241
242AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.