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

4.11
Last change on this file since d71462b was d71462b, checked in by Ralf Corsepius <ralf.corsepius@…>, on Dec 10, 2011 at 5:53:03 AM

2011-12-10 Ralf Corsépius <ralf.corsepius@…>

  • configure.ac (CFLAGS): Add -Wmissing-prototypes.
  • Property mode set to 100644
File size: 6.3 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ([2.68])
6AC_INIT([rtems-c-src],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
7AC_CONFIG_SRCDIR([libchip])
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.11.1])
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
63AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
64${MAKE-make} -f ${srcdir}/make/bsp.mak \
65RTEMS_BSP=${RTEMS_BSP} \
66RTEMS_ROOT=. make/${RTEMS_BSP}.cache
67
68# Read back the cache
69AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
70[. ./make/${RTEMS_BSP}.cache])
71RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
72AC_SUBST(RTEMS_CPU_MODEL)
73test -n "${RTEMS_CPU_MODEL}" && \
74  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
75
76AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
77[RTEMS_BSP_ALIAS([${RTEMS_BSP}],[ac_cv_env_RTEMS_BSP_FAMILY])])
78RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
79AC_SUBST(RTEMS_BSP_FAMILY)
80test -n "${RTEMS_BSP_FAMILY}" && \
81  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
82
83AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
84[. ./make/${RTEMS_BSP}.cache])
85CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS
86
87AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
88[. ./make/${RTEMS_BSP}.cache])
89CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
90
91# Was CFLAGS set?
92rtems_cv_CFLAGS_set="${CFLAGS+set}"
93
94CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}"
95
96RTEMS_PROG_CC_FOR_TARGET
97AM_PROG_CC_C_O
98RTEMS_PROG_CCAS
99RTEMS_CANONICALIZE_TOOLS
100
101# Append warning flags if CFLAGS wasn't set.
102AS_IF([test "$GCC" = yes && test "$rtems_cv_CFLAGS_set" != set],
103[CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs"])
104
105AS_IF([test -n "${CFLAGS}"],[
106ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"])
107
108RTEMS_CHECK_GCC_WEAK
109
110AC_SUBST(CUSTOM_CFG_FILES)
111
112RTEMS_CHECK_MULTIPROCESSING
113
114BSP_SUBDIRS=
115## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
116RTEMS_BSP_CONFIG_SUBDIR(
117  [cpukit],[../../cpukit],
118  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
119   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
120   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
121  ],
122  [test x"$multilib" = xno])
123
124## Note: the order of the directories below is essential
125AC_CONFIG_SUBDIRS([make])
126BSP_SUBDIRS="$BSP_SUBDIRS make"
127
128RTEMS_CPU_SUBDIRS(lib/libcpu)
129if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
130  libcpu_cpu_subdir="${RTEMS_CPU}"
131else
132  libcpu_cpu_subdir=
133fi
134AC_SUBST(libcpu_cpu_subdir)
135
136# Is there code where there should be for this BSP?
137RTEMS_CPU_SUBDIRS([lib/libbsp])
138AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
139
140BSP_SUBDIRS="$BSP_SUBDIRS lib"
141BSP_SUBDIRS="$BSP_SUBDIRS libchip"
142
143AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
144  AC_CONFIG_SUBDIRS([librtems++])
145  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
146])
147
148BSP_SUBDIRS="$BSP_SUBDIRS support"
149BSP_SUBDIRS="$BSP_SUBDIRS ada"
150BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
151
152AC_ARG_ENABLE([ada],
153[AS_HELP_STRING(--enable-ada,enable ada support)],
154[case "${enable_ada}" in
155  yes) ;;
156  no) ;;
157  *)  AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;;
158esac],[enable_ada=no])
159
160RTEMS_BSP_CONFIG_SUBDIR(
161  [ada-tests],[ada-tests],
162  ['--enable-rtems-root=../' \
163   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
164   '--with-project-top=${with_project_top}../' \
165   '--enable-rtemsbsp=$RTEMS_BSP' \
166  ],
167  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
168
169# HACK ALERT!
170
171# FIXME: Assume multilib implies in-source-tree multilibs
172# Build testsuites multilibbed
173RTEMS_BSP_CONFIG_SUBDIR(
174  [testsuites],[../../testsuites],
175  ['--enable-rtems-root=../' \
176   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
177   '--with-project-top=${with_project_top}../' \
178   '--enable-rtemsbsp=$RTEMS_BSP' \
179   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
180   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
181  ],
182  [test x"$enable_tests" != x"no" && test x"$multilib" = xno])
183
184# Build testsuites non-multilibbed
185RTEMS_BSP_CONFIG_SUBDIR(
186  [testsuites],[../../testsuites],
187  ['--enable-rtems-root=../' \
188   '--enable-cpukit-root=${with_project_root}..' \
189   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
190   '--with-project-top=${with_project_top}../' \
191   '--enable-rtemsbsp=$RTEMS_BSP' \
192   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
193   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
194  ],
195  [test x"$enable_tests" != x"no" && test x"$multilib" = xyes])
196
197AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
198
199AS_IF([test "$host_cpu" = sparc],[
200  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
201    [whether to enable ipalignment work-around])
202])
203
204AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
205
206AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
207  && test x"$rtems_cv_HAS_POSIX_API" = x"yes"])
208
209RTEMS_PROJECT_ROOT
210
211# Explicitly list all Makefiles here
212AC_CONFIG_FILES([Makefile],
213[${MAKE} make/${RTEMS_BSP}.cache],
214[RTEMS_BSP=${RTEMS_BSP}
215 MAKE=${MAKE}])
216
217AC_CONFIG_FILES([
218support/Makefile
219libchip/Makefile
220lib/Makefile
221lib/libcpu/Makefile
222lib/libbsp/Makefile
223ada/Makefile
224wrapup/Makefile
225])
226
227AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.