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

5
Last change on this file since f3b29236 was 1ccce05, checked in by Daniel Hellstrom <daniel@…>, on 08/22/17 at 08:57:41

libchip,greth: disable driver if SMP kernel

Update #2355

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