source: rtems/c/src/configure.ac @ 1ae60ae5

4.115
Last change on this file since 1ae60ae5 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
RevLine 
[d7aecdc]1## Process this file with autoconf to produce a configure script.
[33a105fb]2##
[d7aecdc]3
[0f77281]4AC_PREREQ([2.69])
[12072880]5AC_INIT([rtems-c-src],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
[57bbd5c]6AC_CONFIG_SRCDIR([libchip])
[d7aecdc]7RTEMS_TOP(../..)
8
9RTEMS_ENABLE_CXX
10RTEMS_ENABLE_NETWORKING
11
12RTEMS_CANONICAL_TARGET_CPU
13
[bb2b825]14AM_INIT_AUTOMAKE([no-define subdir-objects no-exeext foreign 1.12.2])
[d7aecdc]15AM_MAINTAINER_MODE
16
17RTEMS_ENABLE_MULTILIB
[02ccf4a]18RTEMS_ENABLE_MULTIPROCESSING
[d7aecdc]19RTEMS_ENV_RTEMSBSP
[51d35b2]20
[d7aecdc]21RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
22
23RTEMS_CHECK_NETWORKING(RTEMS_BSP)
[4108ae8]24RTEMS_CHECK_POSIX_API(RTEMS_BSP)
25
[f0d7515]26AC_MSG_NOTICE([setting up make/custom])
27
28AS_MKDIR_P([make/custom])
[9bb5b9d]29AM_SET_DEPDIR
30test -d ${DEPDIR} || mkdir ${DEPDIR}
31
32rm -f ${DEPDIR}/cfg.P
[31eae558]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
[f0d7515]40
[309dbd0]41# Collect and copy the BSP's make/custom/*.cfg files from the toplevel make
[f0d7515]42# directory into the build tree's <bsp>/make/custom subdirectories
[9bb5b9d]43CUSTOM_CFG_FILES=
[d8bbc3e]44f="${RTEMS_BSP}.cfg"
[f0d7515]45while test -n "$f"; do
[9bb5b9d]46  cfg_file=
47  _RTEMS_CHECK_CUSTOM_BSP([$f],cfg_file)
48  if test -n "${cfg_file}"; then
[d8bbc3e]49    cp ${cfg_file} make/custom/$f
[31eae558]50cat << EOF >> ${DEPDIR}/cfg.P
[d8bbc3e]51make/custom/$f: ${cfg_file} make/custom/default.cfg
52        cp ${cfg_file} make/custom/$f
[31eae558]53EOF
[d8bbc3e]54    CUSTOM_CFG_FILES="$CUSTOM_CFG_FILES make/custom/$f"
[9bb5b9d]55    f=`grep "^include.*make/custom" ${cfg_file} \
[f0d7515]56    | sed \
57      -e 's%^.*custom\/%%' \
[d8bbc3e]58      -e 's%default\.cfg%%'`;
[f0d7515]59  else break; fi;
60done
61
62AC_MSG_NOTICE([creating make/${RTEMS_BSP}.cache])
[f21ccd2]63${MAKE-make} -f ${srcdir}/make/bsp.mak \
64RTEMS_BSP=${RTEMS_BSP} \
[f0d7515]65RTEMS_ROOT=. make/${RTEMS_BSP}.cache
66
67# Read back the cache
[9346df0]68AC_CACHE_CHECK([for RTEMS_CPU_MODEL], [ac_cv_env_RTEMS_CPU_MODEL],
[da499ad]69[. ./make/${RTEMS_BSP}.cache])
[9346df0]70RTEMS_CPU_MODEL=$ac_cv_env_RTEMS_CPU_MODEL
[028792e8]71AC_SUBST(RTEMS_CPU_MODEL)
[d4181d5]72test -n "${RTEMS_CPU_MODEL}" && \
73  ac_configure_args="$ac_configure_args 'RTEMS_CPU_MODEL=${RTEMS_CPU_MODEL}'"
[028792e8]74
[9346df0]75AC_CACHE_CHECK([for RTEMS_BSP_FAMILY],[ac_cv_env_RTEMS_BSP_FAMILY],
[67bb173]76[RTEMS_BSP_ALIAS([${RTEMS_BSP}],[ac_cv_env_RTEMS_BSP_FAMILY])])
[9346df0]77RTEMS_BSP_FAMILY=$ac_cv_env_RTEMS_BSP_FAMILY
[028792e8]78AC_SUBST(RTEMS_BSP_FAMILY)
[d4181d5]79test -n "${RTEMS_BSP_FAMILY}" && \
80  ac_configure_args="$ac_configure_args 'RTEMS_BSP_FAMILY=${RTEMS_BSP_FAMILY}'"
[028792e8]81
[9346df0]82AC_CACHE_CHECK([for CPU_CFLAGS],[ac_cv_env_CPU_CFLAGS],
[da499ad]83[. ./make/${RTEMS_BSP}.cache])
[9346df0]84CPU_CFLAGS=$ac_cv_env_CPU_CFLAGS
[028792e8]85
[9346df0]86AC_CACHE_CHECK([for CFLAGS_OPTIMIZE_V],[ac_cv_env_CFLAGS_OPTIMIZE_V],
[da499ad]87[. ./make/${RTEMS_BSP}.cache])
[9346df0]88CFLAGS_OPTIMIZE_V=$ac_cv_env_CFLAGS_OPTIMIZE_V
[f8235c07]89
[1a44f1b]90# Was CFLAGS set?
91rtems_cv_CFLAGS_set="${CFLAGS+set}"
92
[f8235c07]93CFLAGS="${CFLAGS-${CPU_CFLAGS} ${CFLAGS_OPTIMIZE_V}}"
[028792e8]94
[3801246]95RTEMS_PROG_CC_FOR_TARGET
[d844a182]96AM_PROG_CC_C_O
[033f0686]97RTEMS_PROG_CCAS
[9346df0]98RTEMS_CANONICALIZE_TOOLS
[382e1eb3]99
[1a44f1b]100# Append warning flags if CFLAGS wasn't set.
101AS_IF([test "$GCC" = yes && test "$rtems_cv_CFLAGS_set" != set],
[d71462b]102[CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs"])
[1a44f1b]103
104AS_IF([test -n "${CFLAGS}"],[
105ac_configure_args="$ac_configure_args 'CFLAGS=${CFLAGS}'"])
106
[d71ab7fd]107RTEMS_CHECK_GCC_WEAK
108
[f0d7515]109AC_SUBST(CUSTOM_CFG_FILES)
110
[e7495ae]111RTEMS_CHECK_MULTIPROCESSING
112
[789694a1]113BSP_SUBDIRS=
[a03c1ab]114## Configure ${srcdir}/../../cpukit as cpukit/ if multilibs are disabled
[789694a1]115RTEMS_BSP_CONFIG_SUBDIR(
116  [cpukit],[../../cpukit],
[850c88d]117  ['--with-project-root=${with_project_root}../$RTEMS_BSP/' \
[cdf41b07]118   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
[ea3f559]119   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
[6c2b5324]120  ],
[259c516]121  [test x"$multilib" = xno])
[02ccf4a]122
[94f4a9ba]123## Note: the order of the directories below is essential
124AC_CONFIG_SUBDIRS([make])
[85a8933]125BSP_SUBDIRS="$BSP_SUBDIRS make"
[dd984c0]126
127RTEMS_CPU_SUBDIRS(lib/libcpu)
[539e266e]128if test -d "${srcdir}/lib/libcpu/${RTEMS_CPU}"; then
[dd984c0]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?
[57b823d6]136RTEMS_CPU_SUBDIRS([lib/libbsp])
137AC_SUBST(libbsp_cpu_subdir,$RTEMS_CPU)
[dd984c0]138
[539e266e]139BSP_SUBDIRS="$BSP_SUBDIRS lib"
[4108ae8]140BSP_SUBDIRS="$BSP_SUBDIRS libchip"
[832bed1]141
[94f4a9ba]142AS_IF([test "$RTEMS_HAS_CPLUSPLUS" = "yes"],[
[4db904ec]143  AC_CONFIG_SUBDIRS([librtems++])
[85a8933]144  BSP_SUBDIRS="$BSP_SUBDIRS librtems++"
[94f4a9ba]145])
[d7aecdc]146
[db3e91f2]147BSP_SUBDIRS="$BSP_SUBDIRS support"
[aea8e66]148BSP_SUBDIRS="$BSP_SUBDIRS ada"
[85a8933]149BSP_SUBDIRS="$BSP_SUBDIRS wrapup"
[a456af96]150
[54508fd]151AC_ARG_ENABLE([ada],
[a03c1ab]152[AS_HELP_STRING(--enable-ada,enable ada support)],
[54508fd]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
[259c516]159RTEMS_BSP_CONFIG_SUBDIR(
160  [ada-tests],[ada-tests],
161  ['--enable-rtems-root=../' \
[a4a40dac]162   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
[259c516]163   '--with-project-top=${with_project_top}../' \
164   '--enable-rtemsbsp=$RTEMS_BSP' \
165  ],
166  [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes])
[a456af96]167
[3f74676]168# HACK ALERT!
169
170# FIXME: Assume multilib implies in-source-tree multilibs
171# Build testsuites multilibbed
[789694a1]172RTEMS_BSP_CONFIG_SUBDIR(
173  [testsuites],[../../testsuites],
[850c88d]174  ['--enable-rtems-root=../' \
[3f74676]175   '--enable-project-root=${with_project_root}../$RTEMS_BSP' \
176   '--with-project-top=${with_project_top}../' \
177   '--enable-rtemsbsp=$RTEMS_BSP' \
[3136ff03]178   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
179   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
[3f74676]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' \
[850c88d]189   '--with-project-top=${with_project_top}../' \
[789694a1]190   '--enable-rtemsbsp=$RTEMS_BSP' \
[3136ff03]191   '--includedir=${exec_prefix}/${RTEMS_BSP}/lib/include' \
192   '--libdir=${exec_prefix}/${RTEMS_BSP}/lib' \
[6c2b5324]193  ],
[3f74676]194  [test x"$enable_tests" != x"no" && test x"$multilib" = xyes])
[41fc78d]195
[85a8933]196AC_SUBST([BSP_SUBDIRS],[$BSP_SUBDIRS])
[d7aecdc]197
[259c516]198AS_IF([test "$host_cpu" = sparc],[
[babba25a]199  AC_DEFINE_UNQUOTED([CPU_U32_FIX],[1],
200    [whether to enable ipalignment work-around])
201])
202
[67bfd9a6]203AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
[832bed1]204
[aea8e66]205AM_CONDITIONAL(RTEMS_ADA,[test x"$enable_ada" = x"yes" \
206  && test x"$rtems_cv_HAS_POSIX_API" = x"yes"])
207
[d7aecdc]208RTEMS_PROJECT_ROOT
[b826c3a]209
[d7aecdc]210# Explicitly list all Makefiles here
[f0d7515]211AC_CONFIG_FILES([Makefile],
212[${MAKE} make/${RTEMS_BSP}.cache],
213[RTEMS_BSP=${RTEMS_BSP}
214 MAKE=${MAKE}])
215
[babba25a]216AC_CONFIG_FILES([
[309dbd0]217support/Makefile
[babba25a]218libchip/Makefile
[539e266e]219lib/Makefile
[dd984c0]220lib/libcpu/Makefile
221lib/libbsp/Makefile
[aea8e66]222ada/Makefile
[babba25a]223wrapup/Makefile
224])
[94f4a9ba]225
[d7aecdc]226AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.