source: rtems/c/src/configure.ac @ 9a4eca5

Last change on this file since 9a4eca5 was 9a4eca5, checked in by Chris Johns <chrisj@…>, on Aug 10, 2016 at 3:07:29 AM

build-system: Always enable C++ if the compiler is present.

We always build a C++ compiler and building with C++ does not effect
RTEMS or the runtime. This patch always enabled the support. There is
no need to manually enable it any more.

You can disable C++ with '--disable-cxx'.

If an architecture does not have a C++ compiler support is automatically
disabled.

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