source: rtems/c/src/lib/aclocal.m4 @ 08b5f55

4.104.114.84.95
Last change on this file since 08b5f55 was eb299afc, checked in by Joel Sherrill <joel.sherrill@…>, on 07/26/99 at 20:20:22

This is part of a major patch from Ralf Corsepius <corsepiu@…>
to move RTEMS more to automake/autoconf and GNU compliance.

Finally, here they are: the "big-patch" patches - merged into one big
patch (~1.5MB).

Sorry for the delay, but testing took much more time than I had expected

  • esp. reworking the acpolish script triggered many more tiny issues than I had expected (cf. below).

At least, now you've got something to spend your weekend with :-.

WARNINGS:

  • I've gone a little (??) further than I had announced before.
  • Several directories have been moved.
  • Several files have been added and removed
  • I have tested it with many BSPs/CPUs and a variety of permutiations of configuration flags, but not with all.
  • Most parts of the patch are automatically generated, however there are many tiny manual modifications.

APPLYING THE PATCH:

./autogen -c
mkdir tools
mv c/src/exec/score/tools tools/cpu
mv c/build-tools tools/build
mv c/update-tools tools/update
patch -p1 -E < rtems-rc-19990709-0.diff
./autogen

If the patch doesn't apply to rtems-cvs, I would suggest that you should
try to apply it brute-force and then to run tools/update/rtems-polish.sh
-ac -am afterwards. A recursive diff between rtems-19990709 + patch and
rtems-cvs + patch then should report only a few dozen significant
changes to configuration files which need to be merged manually (IIRC, I
did not change any source files).

* Attention: There are files to be removed, moved, copied and added
in/to CVS!

NEWS/CHANGES:

  1. Configuration takes place in 3 stages: 1. per host (toplevel configure script), 2. per target (c/configure), 3. per bsp c/src/configure automatically triggered from ./configure and c/Makefile.am.
  2. Building of subdirectory c/ takes place in c/$(target_alias) for cross-targets in c/ for native targets
  3. Building of subdirectory c/src takes place in c/${target_alias}/<bsp> for cross-targets, c/<bsp> for native targets
  4. c/build-tools moved to tools/build
  5. c/src/exec/score/cpu/tools moved to tools/cpu (=cpu-tools split out)
  6. c/update-tools moved to tools/update
  7. New subdirectory c/src/make, handles files from make/ on a per BSP basis
  8. Maintainer mode support: Ie. if configuring with --enable-maintainer-mode disabled (the default), then tracking of many dependencies will be disabled in Makefiles. Esp. many dependencies for auto* generated files will be switched off in Makefiles. Ie. if not using "--enable-maintainer-mode" many auto* generated files will not be updated automatically, i.e. normal users should not be required to have auto* tools anymore (untested).
  9. Independent configuration scripts for / (toplevel), tools/build, tools/cpu, tools/update, c/, c/src/, c/src/exec, c/src/lib, c/src/tests, c/src/make
  10. Automake support for all directories above and besides c/src
  11. "preinstall" now is implemented as depth-first recursive make target
  1. host compiled tools (exception bsp-tools) are accessed in location in the build tree instead of inside the build-tree when building RTEMS.
  2. RTEMS_ROOT and PROJECT_ROOT now point to directories inside the build-tree - many tiny changes as consequence from this.
  3. --with-cross-host support removed (offically announced obsolete by cygnus)
  4. Changing the order of building libraries below c/src/lib/
  5. Former toplevel configure script broken into aclocal/*.m4 macros
  6. Newlib now detected by configure macros, RTEMS_HAS_NEWLIB removed from *cfg.
  7. sptables.h now generated by autoconf
  8. Rules for "mkinstalldirs temporary installation tree" moved from c/Makefile to subdirectories.
  9. Cpu-tools do not get installed.
  10. FIX: Use ACLOCAL_AMFLAGS instead of ACLOCAL = -I ... in Makefile.ams which are in directories with own configure scripts.
  11. Hardcoding BSP names into libbsp/.../tools to avoid RTEMS_BSP get overridden from the environment.
  12. FIX: Handling of MP_PIECES in various Makefiles
  13. FIX: Removing "::" rules from some Makefile.ins
  14. FIX: File permission chaos: (-m 444 and -m 555 vs. -m 644 and -m 755) - Now all include files use -m 644.
  15. Removed many gnumake-conditionals in Makefile.ins - Partially replaced with automake-conditional, partially replaced with conditionalized Makefile variables (... _yes_V)
  16. Massively reworked acpolish: acpolish now parses Makefile.ins and interprets parts of the Makefile.ins.
  17. FIX: Some $(wildcard $(srcdir)/*.h) macros removed / replaced with explicit lists of files in Makefile.ins.
  18. FIX: Replacing MKLIB with RANLIB in Makefile.ins
  19. HACK: Add preinstallation for pc386 specific $(PROJECT_RELEASE)/BootImgs? directory

... many more details, I can't recall

KNOWN BUGS:

  1. make [debug|profile]_install do not do what they are promissing. "make [debug|profile] install" does what "make [debug|profile]_install" has been doing. Proposal: remove [debug|profile]_install
  2. Dependencies between temporary installation tree and source tree are not yet handled correctly.
  3. Dependencies between temporary installation tree and source tree are handled ineffencently (Using INSTALL_CHANGE instead of make dependencies)
  4. RTEMS_ROOT, PROJECT_ROOT, top_builddir, RTEMS_TOPdir now are redundant.
  5. The new configure scripts still are in their infancy. They contain redundant checks and might still contain bugs, too.
  6. RTEMS autoconf Makefile.ins use a mixture of configuration information gathered in c/$(target_alias)/<bsp>/make and of information collected from their configure scripts.
  7. make dist is not fully functional
  8. Subdirectory host-/build-/target- configure options (--target, --host, --build) do not conform to Cygnus/GNU conventions.
  9. Some RTEMS autoconf Makefile.in's makefile targets are not supported in automake Makefile.ams/ins (e.g. get, clobber).
  10. Some automake standard targets are not propagated from toplevel and c/Makefile.am to autoconf subdirectories (eg. make dist).
  11. rpcgen generated files are not part of the source-tree (Automake conventions favor supplying generated files inside the source-tree, however there is no support for rpcgen generated files in automake, cf. yacc/lex support in automake).
  12. RTEMS_HAS_RDBG handling is flaky. make/*.cfg use RTEMS_HAS_RDBG per CPU, while librdb's sources can only be built per BSP. Raises the more general question whether librdbg located correctly in the source-tree.
  13. All make/*cfg files are configured per cpu, currently there is no location to store per-bsp configuration information --> bsp.cfg, per aconfig.h?
  14. "make install" without having run "make all" beforehand does not work.
  15. handling of --enable-multiprocessing seems to be broken in make/custom/*
  16. Makefile.ins still exploit many gmake features.
  17. File permisson chaos on libraries (no explict -m for libraries/rels/etc).
  18. mcp750 Makefiles are broken (Note: I *do* mean buggy - I am not talking about "not-conforming to conventions", here :-).
  19. Dependencies between configure scripts are not handled, eg. aborting "make RTEMS_BSP=<bsp>" can leave the build-tree in an unusable state.
  20. "make clean" does not delete <build-tree>/<bsp>. This is intentional for now, because rerunning "make" after "make clean" requires an explicit "make preinstall" afterwards now. This should be done automatically, but doesn't work in this case for now. To work around this problem <build-tree>/<bsp> is kept during "make clean" for now (HACK).

TODO:

  1. split out host-compiled bsp-tools
  2. Use Cygnus/GNU standards for cross-compiling target-subdir (CC=CC_FOR_TARGET .. configure --host=${target_alias} --build=`config.guess'}), to be added to toplevel configure script after splitting out bsp-tools.
  3. Exploit per cpu support directory (c/src/<cpu>)- Splitting out per-cpu libraries - Are there any?
  4. Further automake support
  5. Converting subdirectories into standalone / self-contained subdirectories (Esp. moving their headers to the same common root as their sources, eg. mv lib/include/rtems++ lib/librtems++/include/rtems++) - This is the main obstacle which prevents moving further towards automake.
  6. Propagating values from *.cfg into Makefiles instead of propagating them at make time via Makefile-fragments (i.e. try to avoid using *.cfg).
  7. Testing on cygwin host (I *do* expect cygwin specific problems).
  8. The ARCH in o-$(ARCH)-$(VARIANT) build-subdirectories is not needed anymore.

GENERAL ISSUES:

  1. Temporary installation tree -- Ian and I seem to disagree basically. Though I think that I understand his argumentation, I do not share it. IMO, his way of using the buildtree is mis-using the build-tree, relying on an inofficial feature of RTEMS's current implementation, which doesn't even work correctly in the current build-tree, though it attempts hard to do so. From my very POV, it unnecessarily complicates the structures of the source- and build-trees. It is not supported by automake (No automatic generation for the necessary rules) and complicates the transition to automake significantly (Generating the rules with an enhanced version of acpolish could be possible). As Ian correctly pointed out, here a management decision is needed - though I don't see the need to draw this decision in short terms.
  1. preinstallation generally is a sure means to spoil the structure of the source tree, IMHO (No ranting intended, I am completly serious about this one). eg. through tree dependencies. The worst problem related to this I have found in the meantime is bsp_specs. bsp_specs is part of libbsp, ie. there is *no* way to build *any* part of the source tree *without* having a BSP *preinstalled*. Note: This issue is related to issue 1., but is not identical - The difference is the change of the order make rules have to be triggered. While preinstallation triggers rules spread all over the source tree before a "make all" can be run, a temporary installation tree could also be installed by post "make all" hooks (all-local:, to be run after make all in a directory is completed) if the directories' dependencies would be a tree,
  1. Stuctural dependencies between subdirectories.
  2. Depth of the source tree (Prevents multilibbing and introduces many unnecessary configure scripts).
  3. per cpu vs. per bsp configuration (There are no real per-cpu parts yets :-).
  4. automake does not support $makefiles in AC_OUTPUT. Unlike before, we now should try to avoid RTEMS_CHECK_MAKEFILE and to hard-code as much paths to Makefiles as possible.
  5. General redesign of the source tree
  6. Main installation point - Changing it to ${prefix}/${target_alias}. ?

Besides item 8. (which is a must, IMHO), as far as I see most of them
can not be solved soon and will remain issues in the mid- to long-term
:-.

REMARKS:

  • You (as the maintainer) should always use --enable-maintainer-mode when building RTEMS to ensure that maintainer mode generated files (esp. those in c/src/make) will be updated when make/* files have changed.
  • Use @RTEMS_BSP@ in Makefile.ins and Makefile.ams below c/src/, $(RTEMS_BSP) or ${RTEMS_BSP} will be overridden from environment variables when using make RTEMS_BSP="....".
  • c/src/make is a temporary cludge until configuration issues are solved. At the moment it is configured per bsp, but contains per-target/cpu info only. Its main purpose now is to circumvent modifying make/*.cfg files, because I consider make/* to be frozen for backward compatibilty.
  • This patch should only affect configuration files. At least I do not remember having touched any source files.
  • To build the bare bsp you now need to mention it in --enable-rtemsbsp.

Example: building gensh1 and sh1/bare simultaneously:
../rtems-rc-19990709-1/configure --target=sh-rtems \
--enable-rtemsbsp="bare gensh1" \
--prefix=/tmp/rtems \
--enable-bare-cpu-cflags='-DMHZ=20 -m1
-DCPU_CONSOLE_DEVNAME=\"/dev/null\"' \
--enable-bare-cpu-model=sh7032 \
--enable-maintainer-mode \
--enable-cxx
make
make install

  • The next steps in development would be to split out bsp-tools and then to change to Cygnus/GNU canonicalization conventions for building the c/ subdirectory afterwards (i.e. many standard AC_*.m4 macros could be used instead of customized versions)

FINAL REMARK:
The issues mentioned in the lists above sound much worser than the
situation actually is. Most of them are not specific to this patch, but
are also valid for the snapshot. I just wrote down what I came across
when working on the patch over the last few weeks.

I wouldn't be too surprised if you don't like the patch at the current
point in development. I am willing to discuss details and problems, I
also have no problem if you would post-pone applying this patch to times
after 4.1, but rejecting it as a whole for all times would be a false
management decision, IMHO.

Therefore I would suggest that you, if your time constaints allow it,
should at least play a little while with this patch to understand what
is going on and before drawing a decision on how to handle this
proposal. I know this patch is neither perfect nor complete, but I
consider it to be a major breakthrough. Don't be anxious because of the
size of the patch, the core of the patch is rather small, the size is
mainly the side effect of some systematic cleanups inside the Makefiles
(result of acpolish).

Feel free to ask if you encounter problems, if you don't understand
something or if you meet bugs - I am far from being perfect and am
prepared to answer them.

Ralf.

--
Ralf Corsepius
Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung (FAW)
Helmholtzstr. 16, 89081 Ulm, Germany Tel: +49/731/501-8690
mailto:corsepiu@… FAX: +49/731/501-999
http://www.faw.uni-ulm.de

  • Property mode set to 100644
File size: 24.5 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl $Id$
14
15dnl
16dnl RTEMS_TOP($1)
17dnl
18dnl $1 .. relative path from this configure.in to the toplevel configure.in
19dnl
20AC_DEFUN(RTEMS_TOP,
21[dnl
22AC_ARG_WITH(target-subdir,
23[  --with-target-subdir=DIR],
24TARGET_SUBDIR="$withval",
25TARGET_SUBDIR=".")
26
27RTEMS_TOPdir="$1";
28AC_SUBST(RTEMS_TOPdir)
29
30dnl Determine RTEMS Version string from the VERSION file
31dnl Hopefully, Joel never changes its format ;-
32AC_MSG_CHECKING([for RTEMS Version])
33if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
34changequote(,)dnl
35RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \
36sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
37changequote([,])dnl
38else
39AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
40fi
41if test -z "$RTEMS_VERSION"; then
42AC_MSG_ERROR(Unable to determine version)
43fi
44AC_MSG_RESULT($RTEMS_VERSION)
45])dnl
46
47dnl
48dnl $Id$
49dnl
50
51dnl canonicalize target cpu
52dnl NOTE: Most rtems targets do not fullfil autoconf's
53dnl target naming conventions "processor-vendor-os"
54dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
55dnl and we have to fix it for rtems ourselves
56
57AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
58[
59AC_CANONICAL_SYSTEM
60AC_MSG_CHECKING(rtems target cpu)
61changequote(,)dnl
62case "${target}" in
63  # hpux unix port should go here
64  i[3456]86-go32-rtems*)
65        RTEMS_CPU=i386
66        ;;
67  i[3456]86-pc-linux*)          # unix "simulator" port
68        RTEMS_CPU=unix
69        ;;
70  i[3456]86-*freebsd2*)         # unix "simulator" port
71        RTEMS_CPU=unix
72        ;;
73  no_cpu-*rtems*)
74        RTEMS_CPU=no_cpu
75        ;;
76  sparc-sun-solaris*)           # unix "simulator" port
77        RTEMS_CPU=unix
78        ;;
79  *)
80        RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
81        ;;
82esac
83changequote([,])dnl
84AC_SUBST(RTEMS_CPU)
85AC_MSG_RESULT($RTEMS_CPU)
86])
87
88# Add --enable-maintainer-mode option to configure.
89# From Jim Meyering
90
91# serial 1
92
93AC_DEFUN(AM_MAINTAINER_MODE,
94[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
95  dnl maintainer-mode is disabled by default
96  AC_ARG_ENABLE(maintainer-mode,
97[  --enable-maintainer-mode enable make rules and dependencies not useful
98                          (and sometimes confusing) to the casual installer],
99      USE_MAINTAINER_MODE=$enableval,
100      USE_MAINTAINER_MODE=no)
101  AC_MSG_RESULT($USE_MAINTAINER_MODE)
102  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
103  MAINT=$MAINTAINER_MODE_TRUE
104  AC_SUBST(MAINT)dnl
105]
106)
107
108# Define a conditional.
109
110AC_DEFUN(AM_CONDITIONAL,
111[AC_SUBST($1_TRUE)
112AC_SUBST($1_FALSE)
113if $2; then
114  $1_TRUE=
115  $1_FALSE='#'
116else
117  $1_TRUE='#'
118  $1_FALSE=
119fi])
120
121dnl $Id$
122
123AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING,
124[
125AC_ARG_ENABLE(multiprocessing,
126[  --enable-multiprocessing             enable multiprocessing interface],
127[case "${enableval}" in
128  yes) RTEMS_HAS_MULTIPROCESSING=yes ;;
129  no) RTEMS_HAS_MULTIPROCESSING=no ;;
130  *)  AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
131esac],[RTEMS_HAS_MULTIPROCESSING=no])
132AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl
133])
134
135dnl $Id$
136
137AC_DEFUN(RTEMS_ENABLE_POSIX,
138[
139AC_ARG_ENABLE(posix,
140[  --enable-posix                       enable posix interface],
141[case "${enableval}" in
142  yes) RTEMS_HAS_POSIX_API=yes ;;
143  no) RTEMS_HAS_POSIX_API=no ;;
144  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
145esac],[RTEMS_HAS_POSIX_API=yes])
146AC_SUBST(RTEMS_HAS_POSIX_API)
147
148changequote(,)dnl
149case "${target}" in
150  # hpux unix port should go here
151  i[3456]86-go32-rtems*)
152        RTEMS_HAS_POSIX_API=no
153        ;;
154  i[3456]86-pc-linux*)         # unix "simulator" port
155        RTEMS_HAS_POSIX_API=no
156        ;;
157  i[3456]86-*freebsd2*) # unix "simulator" port
158        RTEMS_HAS_POSIX_API=no
159        ;;
160  no_cpu-*rtems*)
161        RTEMS_HAS_POSIX_API=no
162        ;;
163  sparc-sun-solaris*)             # unix "simulator" port
164        RTEMS_HAS_POSIX_API=no
165        ;;
166  *)
167        ;;
168esac
169changequote([,])dnl
170AC_SUBST(RTEMS_HAS_POSIX_API)
171])
172
173dnl $Id$
174
175AC_DEFUN(RTEMS_ENABLE_NETWORKING,
176[
177AC_ARG_ENABLE(networking,
178[  --enable-networking                  enable TCP/IP stack],
179[case "${enableval}" in
180  yes) RTEMS_HAS_NETWORKING=yes ;;
181  no) RTEMS_HAS_NETWORKING=no ;;
182  *)  AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;;
183esac],[RTEMS_HAS_NETWORKING=yes])
184AC_SUBST(RTEMS_HAS_NETWORKING)dnl
185])
186
187dnl $Id$
188
189AC_DEFUN(RTEMS_ENABLE_RDBG,
190[
191AC_ARG_ENABLE(rdbg,
192[  --enable-rdbg                        enable remote debugger],
193[case "${enableval}" in
194  yes) RTEMS_HAS_RDBG=yes ;;
195  no) RTEMS_HAS_RDBG=no ;;
196  *)  AC_MSG_ERROR(bad value ${enableval} for enable-rdbg option) ;;
197esac],[RTEMS_HAS_RDBG=no])
198AC_SUBST(RTEMS_HAS_RDBG)dnl
199])
200
201dnl $Id$
202
203AC_DEFUN(RTEMS_ENABLE_INLINES,
204[AC_ARG_ENABLE(rtems-inlines,
205[  --enable-rtems-inlines               enable RTEMS inline functions]
206[                                       (default:enabled, disable to use macros)],
207[case "${enableval}" in
208  yes) RTEMS_USE_MACROS=no ;;
209  no) RTEMS_USE_MACROS=yes ;;
210  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
211esac],[RTEMS_USE_MACROS=no])
212AC_SUBST(RTEMS_USE_MACROS)dnl
213])
214
215dnl $Id$
216
217AC_DEFUN(RTEMS_ENABLE_CXX,
218[
219AC_ARG_ENABLE(cxx,
220[  --enable-cxx                         enable C++ support,]
221[                                       and build the rtems++ library],
222[case "${enableval}" in
223  yes) RTEMS_HAS_CPLUSPLUS=yes ;;
224  no) RTEMS_HAS_CPLUSPLUS=no   ;;
225  *)  AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;;
226esac], [RTEMS_HAS_CPLUSPLUS=no])
227])
228
229dnl $Id$
230
231AC_DEFUN(RTEMS_ENABLE_GCC28,
232[
233AC_ARG_ENABLE(gcc28,
234[  --enable-gcc28                       enable use of gcc 2.8.x features],
235[case "${enableval}" in
236  yes) RTEMS_USE_GCC272=no ;;
237  no) RTEMS_USE_GCC272=yes ;;
238  *)  AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;;
239esac],[RTEMS_USE_GCC272=no])
240])
241
242dnl $Id$
243
244AC_DEFUN(RTEMS_ENABLE_LIBCDIR,
245[
246AC_ARG_ENABLE(libcdir,
247[  --enable-libcdir=directory           set the directory for the C library],
248[ RTEMS_LIBC_DIR="${enableval}" ; \
249test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
250AC_SUBST(RTEMS_LIBC_DIR)dnl
251])
252
253AC_DEFUN(RTEMS_ENABLE_BARE,
254[
255AC_ARG_ENABLE(bare-cpu-cflags,
256[  --enable-bare-cpu-cflags             specify a particular cpu cflag]
257[                                       (bare bsp specific)],
258[case "${enableval}" in
259  no) BARE_CPU_CFLAGS="" ;;
260  *)    BARE_CPU_CFLAGS="${enableval}" ;;
261esac],
262[BARE_CPU_CFLAGS=""])
263
264AC_ARG_ENABLE(bare-cpu-model,
265[  --enable-bare-cpu-model              specify a particular cpu model]
266[                                       (bare bsp specific)],
267[case "${enableval}" in
268  no)   BARE_CPU_MODEL="" ;;
269  *)    BARE_CPU_MODEL="${enableval}" ;;
270esac],
271[BARE_CPU_MODEL=""])
272])
273
274
275dnl $Id$
276dnl
277dnl FIXME: this needs to be reworked
278
279AC_DEFUN(RTEMS_ENABLE_HWAPI,
280[dnl
281AC_ARG_ENABLE(hwapi, \
282[  --enable-hwapi                       enable hardware API library],
283[case "${enableval}" in
284    yes) RTEMS_HAS_HWAPI=yes ;;
285    no)  RTEMS_HAS_HWAPI=no ;;
286    *)  AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;;
287  esac],[RTEMS_HAS_HWAPI=no])
288AC_SUBST(RTEMS_HAS_HWAPI)dnl
289])dnl
290
291dnl $Id$
292
293dnl Override the set of BSPs to be built.
294dnl used by the toplevel configure script
295dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
296AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
297[
298AC_ARG_ENABLE(rtemsbsp,
299[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
300[case "${enableval}" in
301  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
302  *) $1=$enableval;;
303esac],[$1=""])
304])
305
306dnl Pass a single BSP via an environment variable
307dnl used by per BSP configure scripts
308AC_DEFUN(RTEMS_ENV_RTEMSBSP,
309[dnl
310AC_MSG_CHECKING([for RTEMS_BSP])
311AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
312[dnl
313  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
314])dnl
315if test -z "$rtems_cv_RTEMS_BSP"; then
316  AC_MSG_ERROR([Missing RTEMS_BSP])
317fi
318RTEMS_BSP="$rtems_cv_RTEMS_BSP"
319AC_MSG_RESULT(${RTEMS_BSP})
320AC_SUBST(RTEMS_BSP)
321])
322
323dnl $Id$
324
325dnl check if RTEMS support a cpu
326AC_DEFUN(RTEMS_CHECK_CPU,
327[dnl
328AC_REQUIRE([RTEMS_TOP])
329AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
330# Is this a supported CPU?
331AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
332if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
333  AC_MSG_RESULT(yes)
334else
335  AC_MSG_ERROR(no)
336fi
337])dnl
338
339
340dnl $Id$
341
342AC_DEFUN(RTEMS_CANONICAL_HOST,
343[dnl
344AC_REQUIRE([AC_CANONICAL_HOST])
345RTEMS_HOST=$host_os
346changequote(,)dnl
347case "${target}" in
348  # hpux unix port should go here
349  i[3456]86-pc-linux*)         # unix "simulator" port
350        RTEMS_HOST=Linux
351        ;;
352  i[3456]86-*freebsd2*) # unix "simulator" port
353        RTEMS_HOST=FreeBSD
354        ;;
355  sparc-sun-solaris*)             # unix "simulator" port
356        RTEMS_HOST=Solaris
357        ;;
358  *)
359        ;;
360esac
361changequote([,])dnl
362AC_SUBST(RTEMS_HOST)
363])dnl
364
365dnl
366dnl $Id$
367dnl
368
369AC_DEFUN(RTEMS_PROJECT_ROOT,
370[dnl
371AC_REQUIRE([RTEMS_TOP])
372if test "$TARGET_SUBDIR" = "." ; then
373PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
374else
375PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
376fi
377AC_SUBST(PROJECT_ROOT)
378
379RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
380AC_SUBST(RTEMS_ROOT)
381
382INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
383AC_SUBST(INSTALL_CHANGE)
384
385PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
386AC_SUBST(PACKHEX)
387])
388
389
390dnl
391dnl $Id$
392dnl
393dnl Check for target gcc
394dnl
395dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
396dnl                             Completely reworked
397
398AC_DEFUN(RTEMS_PROG_CC,
399[
400AC_BEFORE([$0], [AC_PROG_CPP])dnl
401AC_BEFORE([$0], [AC_PROG_CC])dnl
402AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
403
404dnl Only accept gcc and cc
405dnl NOTE: This might be too restrictive for native compilation
406AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
407test -z "$CC_FOR_TARGET" \
408  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
409
410dnl backup
411rtems_save_CC=$CC
412rtems_save_CFLAGS=$CFLAGS
413
414dnl temporarily set CC
415CC=$CC_FOR_TARGET
416
417AC_PROG_CC_WORKS
418AC_PROG_CC_GNU
419
420if test $ac_cv_prog_gcc = yes; then
421  GCC=yes
422dnl Check whether -g works, even if CFLAGS is set, in case the package
423dnl plays around with CFLAGS (such as to build both debugging and
424dnl normal versions of a library), tasteless as that idea is.
425  ac_test_CFLAGS="${CFLAGS+set}"
426  ac_save_CFLAGS="$CFLAGS"
427  CFLAGS=
428  AC_PROG_CC_G
429  if test "$ac_test_CFLAGS" = set; then
430    CFLAGS="$ac_save_CFLAGS"
431  elif test $ac_cv_prog_cc_g = yes; then
432    CFLAGS="-g -O2"
433  else
434    CFLAGS="-O2"
435  fi
436else
437  GCC=
438  test "${CFLAGS+set}" = set || CFLAGS="-g"
439fi
440
441rtems_cv_prog_gcc=$ac_cv_prog_gcc
442rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
443rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
444rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
445
446dnl restore initial values
447CC=$rtems_save_CC
448CFLAGS=$rtems_save_CFLAGS
449
450unset ac_cv_prog_gcc
451unset ac_cv_prog_cc_g
452unset ac_cv_prog_cc_works
453unset ac_cv_prog_cc_cross
454])
455
456AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
457[
458dnl check target cc
459RTEMS_PROG_CC
460dnl check if the compiler supports --specs
461RTEMS_GCC_SPECS
462dnl check if the target compiler may use --pipe
463RTEMS_GCC_PIPE
464dnl check if the compiler supports --specs if gcc28 is requested
465if test "$RTEMS_USE_GCC272" != "yes" ; then
466  if test "$rtems_cv_gcc_specs" = "no"; then
467    AC_MSG_WARN([*** disabling --enable-gcc28])
468      RTEMS_USE_GCC272=yes
469  fi
470fi
471test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
472
473dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
474case $host_os in
475*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
476*) ;;
477esac
478AC_SUBST(GCCSED)
479])
480
481dnl
482dnl  $Id$
483dnl
484dnl Set program_prefix
485dnl
486dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
487dnl                             Extracted from configure
488
489AC_DEFUN(RTEMS_TOOL_PREFIX,
490[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
491AC_REQUIRE([AC_CANONICAL_BUILD])dnl
492
493changequote(,)dnl
494if [ "${program_prefix}" = "NONE" ] ; then
495  if [ "${target}" = "${host}" ] ; then
496    program_prefix=
497  else
498    program_prefix=${target}-
499  fi
500fi
501changequote([,])dnl
502])
503
504dnl
505dnl $Id$
506dnl
507dnl Check whether the target compiler accepts -specs
508dnl
509dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
510dnl
511
512AC_DEFUN(RTEMS_GCC_SPECS,
513[AC_REQUIRE([RTEMS_PROG_CC])
514AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
515[
516rtems_cv_gcc_specs=no
517if test "$rtems_cv_prog_gcc" = "yes"; then
518  touch confspec
519  echo 'void f(){}' >conftest.c
520  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
521    rtems_cv_gcc_specs=yes
522  fi
523fi
524rm -f confspec conftest*
525])])
526
527dnl
528dnl $Id$
529dnl
530dnl Check whether the target compiler accepts -pipe
531dnl
532dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
533dnl
534
535AC_DEFUN(RTEMS_GCC_PIPE,
536[AC_REQUIRE([RTEMS_PROG_CC])
537AC_REQUIRE([AC_CANONICAL_HOST])
538AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
539[
540rtems_cv_gcc_pipe=no
541if test "$rtems_cv_prog_gcc" = "yes"; then
542case "$host_os" in
543  cygwin*)
544    ;;
545  *)
546    echo 'void f(){}' >conftest.c
547    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
548      rtems_cv_gcc_pipe=yes
549    fi
550    rm -f conftest*
551    ;;
552esac
553fi
554])
555])
556
557dnl
558dnl $Id$
559dnl
560dnl Check for target g++
561dnl
562dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
563dnl                             Completely reworked
564
565AC_DEFUN(RTEMS_PROG_CXX,
566[
567AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
568AC_BEFORE([$0], [AC_PROG_CXX])dnl
569AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
570
571dnl Only accept g++ and c++
572dnl NOTE: This might be too restrictive for native compilation
573AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++)
574test -z "$CXX_FOR_TARGET" \
575  && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
576
577dnl backup
578rtems_save_CXX=$CXX
579rtems_save_CXXFLAGS=$CXXFLAGS
580
581dnl temporarily set CXX
582CXX=$CXX_FOR_TARGET
583
584AC_PROG_CXX_WORKS
585AC_PROG_CXX_GNU
586
587if test $ac_cv_prog_gxx = yes; then
588  GXX=yes
589dnl Check whether -g works, even if CXXFLAGS is set, in case the package
590dnl plays around with CXXFLAGS (such as to build both debugging and
591dnl normal versions of a library), tasteless as that idea is.
592  ac_test_CXXFLAGS="${CXXFLAGS+set}"
593  ac_save_CXXFLAGS="$CXXFLAGS"
594  CXXFLAGS=
595  AC_PROG_CXX_G
596  if test "$ac_test_CXXFLAGS" = set; then
597    CXXFLAGS="$ac_save_CXXFLAGS"
598  elif test $ac_cv_prog_cxx_g = yes; then
599    CXXFLAGS="-g -O2"
600  else
601    CXXFLAGS="-O2"
602  fi
603else
604  GXX=
605  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
606fi
607
608rtems_cv_prog_gxx=$ac_cv_prog_gxx
609rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g
610rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works
611rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross
612
613CXX=$rtems_save_CXX
614CXXFLAGS=$rtems_save_CXXFLAGS
615
616dnl restore initial values
617unset ac_cv_prog_gxx
618unset ac_cv_prog_cc_g
619unset ac_cv_prog_cxx_works
620unset ac_cv_prog_cxx_cross
621])
622
623AC_DEFUN(RTEMS_PROG_CXX_FOR_TARGET,
624[
625  RTEMS_PROG_CXX
626  if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
627    AC_MSG_ERROR([***]
628     [Inconsistency in compiler configuration:]
629     [Target C compiler and Target C++ compiler]
630     [must both either be cross compilers or native compilers]
631     [Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
632  fi
633])
634
635dnl
636dnl $Id$
637dnl
638dnl Set target tools
639dnl
640dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
641dnl             fixing cache/environment variable handling
642dnl             adding checks for cygwin/egcs '\\'-bug
643dnl             adding checks for ranlib/ar -s problem
644dnl
645dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
646dnl
647
648AC_DEFUN(RTEMS_GCC_PRINT,
649[ case $host_os in
650  *cygwin*)
651    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
652    dnl        Should be removed once cygwin/egcs reports '/' only
653    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
654    ;;
655  *)
656    $1=`$CC_FOR_TARGET --print-prog-name=$2`
657    ;;
658  esac
659])
660
661AC_DEFUN(RTEMS_PATH_TOOL,
662[
663AC_MSG_CHECKING([target's $2])
664AC_CACHE_VAL(ac_cv_path_$1,:)
665AC_MSG_RESULT([$ac_cv_path_$1])
666
667if test -n "$ac_cv_path_$1"; then
668  dnl retrieve the value from the cache
669  $1=$ac_cv_path_$1
670else
671  dnl the cache was not set
672  if test -z "[$]$1" ; then
673    if test "$rtems_cv_prog_gcc" = "yes"; then
674      # We are using gcc, ask it about its tool
675      # NOTE: Necessary if gcc was configured to use the target's
676      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
677      RTEMS_GCC_PRINT($1,$2)
678    fi
679  else
680    # The user set an environment variable.
681    # Check whether it is an absolute path, otherwise AC_PATH_PROG
682    # will override the environment variable, which isn't what the user
683    # intends
684    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
685    case "[$]$1" in
686    /*) # valid
687      AC_MSG_RESULT("yes")
688    ;;
689    *)  # invalid for AC_PATH_PROG
690      AC_MSG_RESULT("no")
691      AC_MSG_ERROR([***]
692        [Environment variable $1 should either]
693        [be unset (preferred) or contain an absolute path])
694    ;;
695    esac
696  fi
697
698  AC_PATH_PROG($1,"$program_prefix"$2,$3)
699fi
700])
701
702AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
703[AC_REQUIRE([RTEMS_PROG_CC])dnl
704
705dnl FIXME: What shall be done if these tools are not available?
706  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
707  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
708  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
709  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
710
711dnl special treatment of ranlib
712  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
713  if test "$RANLIB_FOR_TARGET" = "no"; then
714    # ranlib wasn't found; check if ar -s is available
715    RTEMS_AR_FOR_TARGET_S
716    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
717      dnl override RANLIB_FOR_TARGET's cache
718      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
719      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
720    else
721      AC_MSG_ERROR([***]
722        [Can't figure out how to build a library index]
723        [Neither ranlib nor ar -s seem to be available] )
724    fi
725  fi
726
727dnl NOTE: These may not be available if not using gnutools
728  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
729  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
730  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
731])
732
733dnl
734dnl $Id$
735dnl
736
737AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
738[
739AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
740rtems_cv_AR_FOR_TARGET_S,
741[
742cat > conftest.$ac_ext <<EOF
743int foo( int b )
744{ return b; }
745EOF
746if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
747  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
748  && test -s conftest.a ; \
749then
750  rtems_cv_AR_FOR_TARGET_S="yes"
751else
752  rtems_cv_AR_FOR_TARGET_S="no"
753fi
754  rm -f conftest*
755])
756])
757
758
759dnl
760dnl  $Id$
761dnl
762
763dnl check for i386 gas supporting 16 bit mode
764dnl     - binutils 2.9.1.0.7 and higher
765
766AC_DEFUN(RTEMS_I386_GAS_CODE16,
767[ if test "${target_cpu}" = "i386"; then
768    AC_CACHE_CHECK([for 16 bit mode assembler support],
769      rtems_cv_prog_gas_code16,
770      [cat > conftest.s << EOF
771         .code16
772         data32
773         addr32
774         lgdt 0
775EOF
776      if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then
777        rtems_cv_prog_gas_code16=yes
778      else
779        rtems_cv_prog_gas_code16=no
780      fi])
781    RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16"
782  fi
783  AC_SUBST(RTEMS_GAS_CODE16)
784])
785
786
787dnl
788dnl $Id$
789dnl
790dnl Check for System V IPC calls used by Unix simulators
791dnl
792dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
793dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
794dnl
795dnl Note: $host_os should probably *not* ever be used here to
796dnl determine if host supports System V IPC calls, since some
797dnl (e.g. FreeBSD 2.x) are configured by default to include only
798dnl a subset of the System V IPC calls.  Therefore, to make sure
799dnl all of the required calls are found, test for each call explicitly.
800dnl
801dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
802dnl modify any existing key sets.  See the man pages for semget, shmget,
803dnl msgget, semctl, shmctl and msgctl for details.
804
805AC_DEFUN(RTEMS_SYSV_SEM,
806[AC_REQUIRE([AC_PROG_CC])
807AC_REQUIRE([RTEMS_CANONICAL_HOST])
808AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
809rtems_cv_sysv_sem,
810[
811AC_TRY_RUN([
812#include <sys/types.h>
813#include <sys/ipc.h>
814#include <sys/sem.h>
815int main () {
816#if !defined(sun)
817  union semun arg ;
818#else
819  union semun {
820    int val;
821    struct semid_ds *buf;
822    ushort *array;
823  } arg;
824#endif
825  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
826  if (id == -1)
827    exit(1);
828  arg.val = 0; /* avoid implicit type cast to union */
829  if (semctl(id, 0, IPC_RMID, arg) == -1)
830    exit(1);
831  exit(0);
832}
833],
834rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
835])
836])
837
838AC_DEFUN(RTEMS_SYSV_SHM,
839[AC_REQUIRE([AC_PROG_CC])
840AC_REQUIRE([RTEMS_CANONICAL_HOST])
841AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
842rtems_cv_sysv_shm,
843[
844AC_TRY_RUN([
845#include <sys/types.h>
846#include <sys/ipc.h>
847#include <sys/shm.h>
848int main () {
849  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
850  if (id == -1)
851    exit(1);
852  if (shmctl(id, IPC_RMID, 0) == -1)
853    exit(1);
854  exit(0);
855}
856],
857rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
858])
859])
860
861AC_DEFUN(RTEMS_SYSV_MSG,
862[AC_REQUIRE([AC_PROG_CC])
863AC_REQUIRE([RTEMS_CANONICAL_HOST])
864AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
865rtems_cv_sysv_msg,
866[
867AC_TRY_RUN([
868#include <sys/types.h>
869#include <sys/ipc.h>
870#include <sys/msg.h>
871int main () {
872  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
873  if (id == -1)
874    exit(1);
875  if (msgctl(id, IPC_RMID, 0) == -1)
876    exit(1);
877  exit(0);
878}
879],
880rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
881])
882])
883
884AC_DEFUN(RTEMS_CHECK_SYSV_UNIX,
885[AC_REQUIRE([RTEMS_CANONICAL_HOST])
886if test "$RTEMS_CPU" = "unix" ; then
887  RTEMS_SYSV_SEM
888  if test "$rtems_cv_sysv_sem" != "yes" ; then
889    AC_MSG_ERROR([System V semaphores don't work, required by simulator])
890  fi
891  RTEMS_SYSV_SHM
892  if test "$rtems_cv_sysv_shm" != "yes" ; then
893    AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
894  fi
895  RTEMS_SYSV_MSG
896  if test "$rtems_cv_sysv_msg" != "yes" ; then
897    AC_MSG_ERROR([System V messages don't work, required by simulator])
898  fi
899fi
900])
901
902dnl $Id$
903
904dnl Report all available bsps for a target,
905dnl check if a bsp-subdirectory is present for all bsps found
906dnl
907dnl RTEMS_CHECK_BSPS(bsp_list)
908AC_DEFUN(RTEMS_CHECK_BSPS,
909[
910AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
911AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
912AC_MSG_CHECKING([for bsps])
913case "${target}" in
914changequote(,)dnl
915  i[3456]86-go32-rtems*)
916changequote([,])dnl
917    $1="go32 go32_p5"
918    ;;
919  *)
920    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
921    for file in $files; do
922      case $file in
923        shared*);;
924        Makefile*);;
925        READ*);;
926        CVS*);;
927        pxfl*);;
928        go32*);;       # so the i386 port can pick up the other Makefiles
929        # Now account for BSPs with build variants
930        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
931        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
932        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
933        *) $1="[$]$1 $file";;
934      esac;
935    done
936    ;;
937esac
938AC_MSG_RESULT([[$]$1 .. done])
939])dnl
940
941AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
942[dnl
943AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
944if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
945  AC_MSG_RESULT([yes])
946else
947  AC_MSG_ERROR([no])
948fi
949])dnl
950
951dnl
952dnl  $Id$
953dnl
954
955dnl RTEMS_BSP_ALIAS(BSP_ALIAS,BSP_RETURNED)
956dnl convert a bsp alias $1 into its bsp directory $2
957AC_DEFUN(RTEMS_BSP_ALIAS,
958[
959    # account for "aliased" bsps which share source code
960    case $1 in
961      mvme162lx)    $2=mvme162  ;;  # mvme162 board variant
962      gen68360_040) $2=gen68360 ;;  # 68360 in companion mode
963      go32_p5)      $2=go32     ;;  # go32 on Pentium class CPU
964      p4600)        $2=p4000    ;;  # p4000 board with IDT 4600
965      p4650)        $2=p4000    ;;  # p4000 board with IDT 4650
966      *)            $2=$1;;
967    esac
968])
969
970dnl
971dnl $Id$
972dnl
973
974dnl RTEMS_CHECK_MAKEFILE(path)
975dnl Search for Makefile.in's within the directory starting
976dnl at path and append an entry for Makefile to global variable
977dnl "makefiles" (from configure.in) for each Makefile.in found
978dnl
979AC_DEFUN(RTEMS_CHECK_MAKEFILE,
980[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
981])
982
983dnl
984dnl $Id$
985dnl
986
987dnl RTEMS_CHECK_FILES_IN(path,file,var)
988dnl path .. path relative to srcdir, where to start searching for files
989dnl file .. name of the files to search for
990dnl var  .. shell variable to append files found
991
992AC_DEFUN(RTEMS_CHECK_FILES_IN,
993[
994AC_MSG_CHECKING(for $2.in in $1)
995if test -d $srcdir/$1; then
996  rtems_av_save_dir=`pwd`;
997  cd $srcdir;
998  rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
999  $3="$$3 $rtems_av_tmp";
1000  cd $rtems_av_save_dir;
1001  AC_MSG_RESULT(done)
1002else
1003  AC_MSG_RESULT(no)
1004fi
1005])
1006
1007
1008AC_DEFUN(RTEMS_CHECK_RDBG,
1009[dnl
1010AC_REQUIRE([RTEMS_TOP])dnl
1011AC_REQUIRE([RTEMS_CHECK_CPU])dnl
1012AC_CACHE_CHECK([whether cpu supports librdbg],
1013  rtems_cv_has_rdbg,
1014  [
1015    if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/librdbg/${RTEMS_CPU}"; then
1016      rtems_cv_has_rdbg="yes" ;
1017    else
1018      rtems_cv_has_rdbg="no";
1019    fi
1020  ])
1021])
1022
Note: See TracBrowser for help on using the repository browser.