source: rtems/c/src/configure.ac @ 0afac6a

4.115
Last change on this file since 0afac6a was 12072880, checked in by Sebastian Huber <sebastian.huber@…>, on 12/04/14 at 09:03:50

Update bug report URL

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