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

Last change on this file since c8dcdf54 was d584269, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 4, 2018 at 2:44:52 PM

bsps: Remove librtemsbsp.a wrapup

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 4.6 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([lib])
7RTEMS_TOP(../..)
8RTEMS_SOURCE_TOP
9RTEMS_BUILD_TOP
10
11RTEMS_ENABLE_CXX
12RTEMS_ENABLE_NETWORKING
13
14RTEMS_CANONICAL_TARGET_CPU
15
16AM_INIT_AUTOMAKE([no-define subdir-objects no-exeext foreign 1.12.2])
17AM_MAINTAINER_MODE
18
19RTEMS_ENABLE_MULTIPROCESSING
20RTEMS_ENABLE_CXX
21RTEMS_ENV_RTEMSBSP
22
23RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
24
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_ENABLE_MULTILIB
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
129# Is there code where there should be for this BSP?
130RTEMS_CPU_SUBDIRS([lib/libbsp])
131AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
132
133BSP_SUBDIRS="$BSP_SUBDIRS lib/libbsp"
134
135# Build testsuites
136RTEMS_BSP_CONFIG_SUBDIR(
137  [testsuites],[../../testsuites],
138  ['--enable-rtems-root=../' \
139   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
140   '--with-project-top=${with_project_top}../' \
141   '--enable-rtemsbsp=$RTEMS_BSP' \
142   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
143   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
144  ],
145  [test x"$enable_tests" != x"no"])
146
147AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
148
149AS_IF([test "$host_cpu" = sparc],[
150  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
151    [whether to enable ipalignment work-around])
152])
153
154RTEMS_PROJECT_ROOT
155
156# Explicitly list all Makefiles here
157AC_CONFIG_FILES([Makefile],
158[${MAKE} make/${RTEMS_BSP}.cache],
159[RTEMS_BSP=${RTEMS_BSP}
160 MAKE=${MAKE}])
161
162AC_CONFIG_FILES([
163lib/libbsp/Makefile
164])
165
166AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.