source: rtems/c/src/configure.ac @ 333a312

4.115
Last change on this file since 333a312 was 91d2e18, checked in by Ralf Corsépius <ralf.corsepius@…>, on 05/04/12 at 06:53:58

Remove CVS-Ids.

  • Property mode set to 100644
File size: 6.3 KB
Line 
1## Process this file with autoconf to produce a configure script.
2
3AC_PREREQ([2.68])
4AC_INIT([rtems-c-src],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
5AC_CONFIG_SRCDIR([libchip])
6RTEMS_TOP(../..)
7
8RTEMS_ENABLE_CXX
9RTEMS_ENABLE_NETWORKING
10
11RTEMS_CANONICAL_TARGET_CPU
12
13AM_INIT_AUTOMAKE([no-define subdir-objects no-exeext foreign 1.11.1])
14AM_MAINTAINER_MODE
15
16RTEMS_ENABLE_MULTILIB
17RTEMS_ENABLE_MULTIPROCESSING
18RTEMS_ENV_RTEMSBSP
19
20RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
21
22RTEMS_CHECK_NETWORKING(RTEMS_BSP)
23RTEMS_CHECK_POSIX_API(RTEMS_BSP)
24
25AC_MSG_NOTICE([setting up make/custom])
26
27AS_MKDIR_P([make/custom])
28AM_SET_DEPDIR
29test -d ${DEPDIR} || mkdir ${DEPDIR}
30
31rm -f ${DEPDIR}/cfg.P
32cp ${srcdir}/make/custom/default.cfg.in make/custom/default.cfg
33cat << EOF > ${DEPDIR}/cfg.P
34# Do not edit - automatically generated by $0
35make/custom/default.cfg: \$(srcdir)/make/custom/default.cfg.in
36        @\$(MKDIR_P) make/custom
37        cp \$(srcdir)/make/custom/default.cfg.in make/custom/default.cfg
38EOF
39
40# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
41# directory into the build tree's <bsp>/make/custom subdirectories
42CUSTOM_CFG_FILES=
43f="${RTEMS_BSP}.cfg"
44while test -n "$f"; do
45  cfg_file=
46  _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file)
47  if test -n "${cfg_file}"; then
48    cp ${cfg_file} make/custom/$f
49cat << EOF >> ${DEPDIR}/cfg.P
50make/custom/$f: ${cfg_file} make/custom/default.cfg
51        cp ${cfg_file} make/custom/$f
52EOF
53    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
54    f=`grep "^include.*make/custom" ${cfg_file} \
55    | sed \
56      -e 's%^.*custom\/%%' \
57      -e 's%default\.cfg%%'`;
58  else break; fi;
59done
60
61AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
62${MAKE-make} -f ${srcdir}/make/bsp.mak \
63RTEMS_BSP=${RTEMS_BSP} \
64RTEMS_ROOT=. make/${RTEMS_BSP}.cache
65
66# Read back the cache
67AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
68[. ./make/${RTEMS_BSP}.cache])
69RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
70AC_SUBST(RTEMS_CPU_MODEL)
71test -n "${RTEMS_CPU_MODEL}" && \
72  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
73
74AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
75[RTEMS_BSP_ALIAS([${RTEMS_BSP}],[ac_cv_env_RTEMS_BSP_FAMILY])])
76RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
77AC_SUBST(RTEMS_BSP_FAMILY)
78test -n "${RTEMS_BSP_FAMILY}" && \
79  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
80
81AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
82[. ./make/${RTEMS_BSP}.cache])
83CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS
84
85AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
86[. ./make/${RTEMS_BSP}.cache])
87CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
88
89# Was CFLAGS set?
90rtems_cv_CFLAGS_set="${CFLAGS+set}"
91
92CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}"
93
94RTEMS_PROG_CC_FOR_TARGET
95AM_PROG_CC_C_O
96RTEMS_PROG_CCAS
97RTEMS_CANONICALIZE_TOOLS
98
99# Append warning flags if CFLAGS wasn't set.
100AS_IF([test "$GCC" = yes && test "$rtems_cv_CFLAGS_set" != set],
101[CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs"])
102
103AS_IF([test -n "${CFLAGS}"],[
104ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"])
105
106RTEMS_CHECK_GCC_WEAK
107
108AC_SUBST(CUSTOM_CFG_FILES)
109
110RTEMS_CHECK_MULTIPROCESSING
111
112BSP_SUBDIRS=
113## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
114RTEMS_BSP_CONFIG_SUBDIR(
115  [cpukit],[../../cpukit],
116  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
117   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
118   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
119  ],
120  [test x"$multilib" = xno])
121
122## Note: the order of the directories below is essential
123AC_CONFIG_SUBDIRS([make])
124BSP_SUBDIRS="$BSP_SUBDIRS make"
125
126RTEMS_CPU_SUBDIRS(lib/libcpu)
127if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
128  libcpu_cpu_subdir="${RTEMS_CPU}"
129else
130  libcpu_cpu_subdir=
131fi
132AC_SUBST(libcpu_cpu_subdir)
133
134# Is there code where there should be for this BSP?
135RTEMS_CPU_SUBDIRS([lib/libbsp])
136AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
137
138BSP_SUBDIRS="$BSP_SUBDIRS lib"
139BSP_SUBDIRS="$BSP_SUBDIRS libchip"
140
141AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
142  AC_CONFIG_SUBDIRS([librtems++])
143  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
144])
145
146BSP_SUBDIRS="$BSP_SUBDIRS support"
147BSP_SUBDIRS="$BSP_SUBDIRS ada"
148BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
149
150AC_ARG_ENABLE([ada],
151[AS_HELP_STRING(--enable-ada,enable ada support)],
152[case "${enable_ada}" in
153  yes) ;;
154  no) ;;
155  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
156esac],[enable_ada=no])
157
158RTEMS_BSP_CONFIG_SUBDIR(
159  [ada-tests],[ada-tests],
160  ['--enable-rtems-root=../' \
161   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
162   '--with-project-top=${with_project_top}../' \
163   '--enable-rtemsbsp=$RTEMS_BSP' \
164  ],
165  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
166
167# HACK ALERT!
168
169# FIXME: Assume multilib implies in-source-tree multilibs
170# Build testsuites multilibbed
171RTEMS_BSP_CONFIG_SUBDIR(
172  [testsuites],[../../testsuites],
173  ['--enable-rtems-root=../' \
174   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
175   '--with-project-top=${with_project_top}../' \
176   '--enable-rtemsbsp=$RTEMS_BSP' \
177   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
178   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
179  ],
180  [test x"$enable_tests" != x"no" && test x"$multilib" = xno])
181
182# Build testsuites non-multilibbed
183RTEMS_BSP_CONFIG_SUBDIR(
184  [testsuites],[../../testsuites],
185  ['--enable-rtems-root=../' \
186   '--enable-cpukit-root=${with_project_root}..' \
187   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
188   '--with-project-top=${with_project_top}../' \
189   '--enable-rtemsbsp=$RTEMS_BSP' \
190   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
191   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
192  ],
193  [test x"$enable_tests" != x"no" && test x"$multilib" = xyes])
194
195AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
196
197AS_IF([test "$host_cpu" = sparc],[
198  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
199    [whether to enable ipalignment work-around])
200])
201
202AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
203
204AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
205  && test x"$rtems_cv_HAS_POSIX_API" = x"yes"])
206
207RTEMS_PROJECT_ROOT
208
209# Explicitly list all Makefiles here
210AC_CONFIG_FILES([Makefile],
211[${MAKE} make/${RTEMS_BSP}.cache],
212[RTEMS_BSP=${RTEMS_BSP}
213 MAKE=${MAKE}])
214
215AC_CONFIG_FILES([
216support/Makefile
217libchip/Makefile
218lib/Makefile
219lib/libcpu/Makefile
220lib/libbsp/Makefile
221ada/Makefile
222wrapup/Makefile
223])
224
225AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.